Bug 1842773 - Part 5: Add ArrayBuffer.prototype.{maxByteLength,resizable} getters...
[gecko.git] / dom / base / moz.build
blob26fe7e716da848c0e944275bf3e98d27b7a2e17c
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 with Files("*Selection*"):
8     BUG_COMPONENT = ("Core", "DOM: Selection")
10 with Files("**"):
11     BUG_COMPONENT = ("Core", "DOM: Core & HTML")
13 TEST_DIRS += ["test"]
15 if CONFIG["FUZZING"]:
16     if CONFIG["FUZZING_INTERFACES"]:
17         TEST_DIRS += ["fuzztest"]
19 # Add libFuzzer configuration directives
20 include("/tools/fuzzing/libfuzzer-config.mozbuild")
22 XPIDL_SOURCES += [
23     "mozIDOMWindow.idl",
24     "nsIContentPolicy.idl",
25     "nsIDOMRequestService.idl",
26     "nsIDroppedLinkHandler.idl",
27     "nsIEventSourceEventService.idl",
28     "nsIImageLoadingContent.idl",
29     "nsIMessageManager.idl",
30     "nsIObjectLoadingContent.idl",
31     "nsIScriptableContentIterator.idl",
32     "nsIScriptChannel.idl",
33     "nsISelectionController.idl",
34     "nsISelectionDisplay.idl",
35     "nsISelectionListener.idl",
36     "nsISlowScriptDebug.idl",
39 XPIDL_MODULE = "dom"
41 EXPORTS += [
42     "AttrArray.h",
43     "AutocompleteFieldList.h",
44     "Crypto.h",
45     "HTMLSplitOnSpacesTokenizer.h",
46     "IframeSandboxKeywordList.h",
47     "mozAutoDocUpdate.h",
48     "NodeUbiReporting.h",
49     "nsAttrName.h",
50     "nsAttrValue.h",
51     "nsAttrValueInlines.h",
52     "nsCaseTreatment.h",
53     "nsChildContentList.h",
54     "nsContentCID.h",
55     "nsContentCreatorFunctions.h",
56     "nsContentList.h",
57     "nsContentListDeclarations.h",
58     "nsContentPermissionHelper.h",
59     "nsContentPolicyUtils.h",
60     "nsContentSink.h",
61     "nsContentTypeParser.h",
62     "nsContentUtils.h",
63     "nsCopySupport.h",
64     "nsDeprecatedOperationList.h",
65     "nsDocElementCreatedNotificationRunner.h",
66     "nsDocumentWarningList.h",
67     "nsDOMAttributeMap.h",
68     "nsDOMCID.h",
69     "nsDOMJSUtils.h",
70     "nsDOMMutationObserver.h",
71     "nsDOMNavigationTiming.h",
72     "nsDOMString.h",
73     "nsDOMTokenList.h",
74     "nsFocusManager.h",
75     "nsFrameLoader.h",  # Because binding headers include it.
76     "nsFrameLoaderOwner.h",
77     "nsFrameMessageManager.h",
78     "nsGlobalWindowInner.h",  # Because binding headers include it.
79     "nsGlobalWindowOuter.h",  # Because binding headers include it.
80     "nsIAnimationObserver.h",
81     "nsIContent.h",
82     "nsIContentInlines.h",
83     "nsIDocumentObserver.h",
84     "nsIGlobalObject.h",
85     "nsImageLoadingContent.h",
86     "nsIMutationObserver.h",
87     "nsINode.h",
88     "nsINodeList.h",
89     "nsIScriptContext.h",
90     "nsIScriptGlobalObject.h",
91     "nsIScriptObjectPrincipal.h",
92     "nsJSEnvironment.h",
93     "nsJSUtils.h",
94     "nsLineBreaker.h",
95     "nsNameSpaceManager.h",
96     "nsNodeInfoManager.h",
97     "nsPIDOMWindow.h",
98     "nsPIDOMWindowInlines.h",
99     "nsPIWindowRoot.h",
100     "nsPropertyTable.h",
101     "nsRange.h",
102     "nsSandboxFlags.h",
103     "nsStructuredCloneContainer.h",
104     "nsStubAnimationObserver.h",
105     "nsStubDocumentObserver.h",
106     "nsStubMutationObserver.h",
107     "nsStyledElement.h",
108     "nsTextFragment.h",
109     "nsTextNode.h",
110     "nsTraversal.h",
111     "nsTreeSanitizer.h",
112     "nsViewportInfo.h",
113     "nsWindowMemoryReporter.h",
114     "nsWindowSizes.h",
115     "nsWrapperCache.h",
116     "nsWrapperCacheInlines.h",
117     "XPathGenerator.h",
120 if CONFIG["MOZ_WEBRTC"]:
121     EXPORTS += [
122         "nsDOMDataChannel.h",
123         "nsDOMDataChannelDeclarations.h",
124     ]
126 EXPORTS.mozilla += [
127     "CallState.h",
128     "ContentIterator.h",
129     "CORSMode.h",
130     "FlushType.h",
131     "FullscreenChange.h",
132     "GlobalTeardownObserver.h",
133     "IdentifierMapEntry.h",
134     "PointerLockManager.h",
135     "RangeBoundary.h",
136     "RangeUtils.h",
137     "ScriptableContentIterator.h",
138     "ScrollingMetrics.h",
139     "SelectionChangeEventDispatcher.h",
140     "TextInputProcessor.h",
141     "UseCounter.h",
144 EXPORTS.mozilla.dom += [
145     "!UseCounterList.h",
146     "!UseCounterWorkerList.h",
147     "AbstractRange.h",
148     "AncestorIterator.h",
149     "AnchorAreaFormRelValues.h",
150     "AnimationFrameProvider.h",
151     "AnonymousContent.h",
152     "Attr.h",
153     "AutoPrintEventDispatcher.h",
154     "AutoSuppressEventHandlingAndSuspend.h",
155     "BarProps.h",
156     "BindContext.h",
157     "BodyConsumer.h",
158     "BodyUtil.h",
159     "BorrowedAttrInfo.h",
160     "CCGCScheduler.h",
161     "CharacterData.h",
162     "ChildIterator.h",
163     "ChildProcessMessageManager.h",
164     "ChromeMessageBroadcaster.h",
165     "ChromeMessageSender.h",
166     "ChromeNodeList.h",
167     "ChromeUtils.h",
168     "Comment.h",
169     "CompressionStream.h",
170     "ContentFrameMessageManager.h",
171     "ContentProcessMessageManager.h",
172     "CustomElementRegistry.h",
173     "DecompressionStream.h",
174     "DirectionalityUtils.h",
175     "DocGroup.h",
176     "Document.h",
177     "DocumentFragment.h",
178     "DocumentInlines.h",
179     "DocumentOrShadowRoot.h",
180     "DocumentType.h",
181     "DOMArena.h",
182     "DOMException.h",
183     "DOMImplementation.h",
184     "DOMIntersectionObserver.h",
185     "DOMMatrix.h",
186     "DOMMozPromiseRequestHolder.h",
187     "DOMParser.h",
188     "DOMPoint.h",
189     "DOMQuad.h",
190     "DOMRect.h",
191     "DOMRequest.h",
192     "DOMStringList.h",
193     "DOMTokenListSupportedTokens.h",
194     "Element.h",
195     "ElementInlines.h",
196     "EventSource.h",
197     "EventSourceEventService.h",
198     "External.h",
199     "FilteredNodeIterator.h",
200     "FormData.h",
201     "FragmentOrElement.h",
202     "FromParser.h",
203     "GeneratedImageContent.h",
204     "Highlight.h",
205     "HighlightRegistry.h",
206     "IdleDeadline.h",
207     "IdleRequest.h",
208     "IDTracker.h",
209     "ImageEncoder.h",
210     "ImageTracker.h",
211     "IntlUtils.h",
212     "JSExecutionContext.h",
213     "Link.h",
214     "LinkStyle.h",
215     "Location.h",
216     "LocationBase.h",
217     "MaybeCrossOriginObject.h",
218     "MessageBroadcaster.h",
219     "MessageListenerManager.h",
220     "MessageManagerCallback.h",
221     "MessageManagerGlobal.h",
222     "MessageSender.h",
223     "MimeType.h",
224     "MozQueryInterface.h",
225     "MutationObservers.h",
226     "NameSpaceConstants.h",
227     "Navigator.h",
228     "NodeInfo.h",
229     "NodeInfoInlines.h",
230     "NodeIterator.h",
231     "ParentProcessMessageManager.h",
232     "PlacesBookmark.h",
233     "PlacesBookmarkAddition.h",
234     "PlacesBookmarkChanged.h",
235     "PlacesBookmarkGuid.h",
236     "PlacesBookmarkKeyword.h",
237     "PlacesBookmarkMoved.h",
238     "PlacesBookmarkRemoved.h",
239     "PlacesBookmarkTags.h",
240     "PlacesBookmarkTime.h",
241     "PlacesBookmarkTitle.h",
242     "PlacesBookmarkUrl.h",
243     "PlacesEvent.h",
244     "PlacesFavicon.h",
245     "PlacesHistoryCleared.h",
246     "PlacesObservers.h",
247     "PlacesPurgeCaches.h",
248     "PlacesRanking.h",
249     "PlacesVisit.h",
250     "PlacesVisitRemoved.h",
251     "PlacesVisitTitle.h",
252     "PlacesWeakCallbackWrapper.h",
253     "PopoverData.h",
254     "PopupBlocker.h",
255     "Pose.h",
256     "PostMessageEvent.h",
257     "ProcessMessageManager.h",
258     "RadioGroupContainer.h",
259     "ResizeObserver.h",
260     "ResponsiveImageSelector.h",
261     "SameProcessMessageQueue.h",
262     "ScreenLuminance.h",
263     "ScreenOrientation.h",
264     "Selection.h",
265     "SerializedStackHolder.h",
266     "ShadowIncludingTreeIterator.h",
267     "ShadowRoot.h",
268     "StaticRange.h",
269     "StructuredCloneBlob.h",
270     "StructuredCloneHolder.h",
271     "StructuredCloneTags.h",
272     "StructuredCloneTester.h",
273     "StyledRange.h",
274     "StyleSheetList.h",
275     "SubtleCrypto.h",
276     "SyncMessageSender.h",
277     "TestUtils.h",
278     "Text.h",
279     "Timeout.h",
280     "TimeoutHandler.h",
281     "TimeoutManager.h",
282     "TreeIterator.h",
283     "TreeOrderedArray.h",
284     "TreeOrderedArrayInlines.h",
285     "TreeWalker.h",
286     "UIDirectionManager.h",
287     "UseCounterMetrics.h",
288     "UserActivation.h",
289     "ViewportMetaData.h",
290     "VisualViewport.h",
291     "WindowFeatures.h",
292     "WindowProxyHolder.h",
295 if CONFIG["FUZZING"]:
296     EXPORTS.mozilla.dom += [
297         "FuzzingFunctions.h",
298     ]
300 if CONFIG["COMPILE_ENVIRONMENT"]:
301     EXPORTS.mozilla.dom += [
302         "!GeneratedElementDocumentState.h",
303         "RustTypes.h",
304     ]
306     CbindgenHeader(
307         "GeneratedElementDocumentState.h",
308         inputs=["rust"],
309     )
311 UNIFIED_SOURCES += [
312     "!UseCounterMetrics.cpp",
313     "AbstractRange.cpp",
314     "AnchorAreaFormRelValues.cpp",
315     "AnimationFrameProvider.cpp",
316     "AnonymousContent.cpp",
317     "Attr.cpp",
318     "AttrArray.cpp",
319     "BarProps.cpp",
320     "BindContext.cpp",
321     "BodyConsumer.cpp",
322     "BodyUtil.cpp",
323     "BorrowedAttrInfo.cpp",
324     "CCGCScheduler.cpp",
325     "CharacterData.cpp",
326     "ChildIterator.cpp",
327     "ChromeMessageBroadcaster.cpp",
328     "ChromeMessageSender.cpp",
329     "ChromeNodeList.cpp",
330     "ChromeUtils.cpp",
331     "Comment.cpp",
332     "ContentFrameMessageManager.cpp",
333     "ContentIterator.cpp",
334     "ContentProcessMessageManager.cpp",
335     "Crypto.cpp",
336     "CustomElementRegistry.cpp",
337     "DirectionalityUtils.cpp",
338     "DocGroup.cpp",
339     "Document.cpp",
340     "DocumentFragment.cpp",
341     "DocumentOrShadowRoot.cpp",
342     "DocumentType.cpp",
343     "DOMException.cpp",
344     "DOMImplementation.cpp",
345     "DOMMatrix.cpp",
346     "DOMParser.cpp",
347     "DOMPoint.cpp",
348     "DOMQuad.cpp",
349     "DOMRect.cpp",
350     "DOMRequest.cpp",
351     "DOMStringList.cpp",
352     "Element.cpp",
353     "EventSource.cpp",
354     "EventSourceEventService.cpp",
355     "External.cpp",
356     "FormData.cpp",
357     "FragmentOrElement.cpp",
358     "GeneratedImageContent.cpp",
359     "GlobalTeardownObserver.cpp",
360     "Highlight.cpp",
361     "HighlightRegistry.cpp",
362     "IdleDeadline.cpp",
363     "IdleRequest.cpp",
364     "IDTracker.cpp",
365     "ImageEncoder.cpp",
366     "ImageTracker.cpp",
367     "InProcessBrowserChildMessageManager.cpp",
368     "IntlUtils.cpp",
369     "JSExecutionContext.cpp",
370     "Link.cpp",
371     "LinkStyle.cpp",
372     "Location.cpp",
373     "LocationBase.cpp",
374     "MaybeCrossOriginObject.cpp",
375     "MessageBroadcaster.cpp",
376     "MessageListenerManager.cpp",
377     "MessageManagerGlobal.cpp",
378     "MessageSender.cpp",
379     "MimeType.cpp",
380     "MozQueryInterface.cpp",
381     "MutationObservers.cpp",
382     "Navigator.cpp",
383     "NodeInfo.cpp",
384     "NodeIterator.cpp",
385     "NodeUbiReporting.cpp",
386     "nsAttrValue.cpp",
387     "nsAttrValueOrString.cpp",
388     "nsCCUncollectableMarker.cpp",
389     "nsContentAreaDragDrop.cpp",
390     "nsContentList.cpp",
391     "nsContentPermissionHelper.cpp",
392     "nsContentPolicy.cpp",
393     "nsContentSink.cpp",
394     "nsContentTypeParser.cpp",
395     "nsCopySupport.cpp",
396     "nsDataDocumentContentPolicy.cpp",
397     "nsDOMAttributeMap.cpp",
398     "nsDOMCaretPosition.cpp",
399     "nsDOMMutationObserver.cpp",
400     "nsDOMNavigationTiming.cpp",
401     "nsDOMTokenList.cpp",
402     "nsFocusManager.cpp",
403     "nsFrameLoader.cpp",
404     "nsFrameLoaderOwner.cpp",
405     "nsGlobalWindowCommands.cpp",
406     "nsHistory.cpp",
407     "nsIGlobalObject.cpp",
408     "nsINode.cpp",
409     "nsJSEnvironment.cpp",
410     "nsJSUtils.cpp",
411     "nsLineBreaker.cpp",
412     "nsMimeTypeArray.cpp",
413     "nsNameSpaceManager.cpp",
414     "nsNoDataProtocolContentPolicy.cpp",
415     "nsNodeInfoManager.cpp",
416     "nsOpenURIInFrameParams.cpp",
417     "nsPropertyTable.cpp",
418     "nsQueryContentEventResult.cpp",
419     "nsRange.cpp",
420     "nsScreen.cpp",
421     "nsStructuredCloneContainer.cpp",
422     "nsStubAnimationObserver.cpp",
423     "nsStubDocumentObserver.cpp",
424     "nsStubMutationObserver.cpp",
425     "nsStyledElement.cpp",
426     "nsSyncLoadService.cpp",
427     "nsTextFragment.cpp",
428     "nsTextNode.cpp",
429     "nsTraversal.cpp",
430     "nsTreeSanitizer.cpp",
431     "nsViewportInfo.cpp",
432     "nsWindowMemoryReporter.cpp",
433     "nsWindowRoot.cpp",
434     "nsWrapperCache.cpp",
435     "ParentProcessMessageManager.cpp",
436     "PointerLockManager.cpp",
437     "PopoverData.cpp",
438     "PopupBlocker.cpp",
439     "Pose.cpp",
440     "PostMessageEvent.cpp",
441     "ProcessMessageManager.cpp",
442     "RadioGroupContainer.cpp",
443     "RangeUtils.cpp",
444     "RemoteOuterWindowProxy.cpp",
445     "ResizeObserver.cpp",
446     "ResponsiveImageSelector.cpp",
447     "SameProcessMessageQueue.cpp",
448     "ScreenLuminance.cpp",
449     "ScreenOrientation.cpp",
450     "ScriptableContentIterator.cpp",
451     "ScrollingMetrics.cpp",
452     "Selection.cpp",
453     "SelectionChangeEventDispatcher.cpp",
454     "SerializedStackHolder.cpp",
455     "ShadowRoot.cpp",
456     "StaticRange.cpp",
457     "StorageAccessPermissionRequest.cpp",
458     "StructuredCloneBlob.cpp",
459     "StructuredCloneHolder.cpp",
460     "StructuredCloneTester.cpp",
461     "StyledRange.cpp",
462     "StyleSheetList.cpp",
463     "SubtleCrypto.cpp",
464     "TestUtils.cpp",
465     "Text.cpp",
466     "TextInputProcessor.cpp",
467     "ThirdPartyUtil.cpp",
468     "Timeout.cpp",
469     "TimeoutBudgetManager.cpp",
470     "TimeoutExecutor.cpp",
471     "TimeoutHandler.cpp",
472     "TimeoutManager.cpp",
473     "TreeWalker.cpp",
474     "UIDirectionManager.cpp",
475     "UserActivation.cpp",
476     "ViewportMetaData.cpp",
477     "VisualViewport.cpp",
478     "WindowDestroyedEvent.cpp",
479     "WindowFeatures.cpp",
480     "WindowNamedPropertiesHandler.cpp",
481     "XPathGenerator.cpp",
484 if CONFIG["MOZ_WEBRTC"]:
485     UNIFIED_SOURCES += [
486         "nsDOMDataChannel.cpp",
487     ]
489 if CONFIG["FUZZING"]:
490     UNIFIED_SOURCES += [
491         "FuzzingFunctions.cpp",
492     ]
494 if CONFIG["MOZ_PLACES"]:
495     UNIFIED_SOURCES += [
496         "PlacesEvent.cpp",
497         "PlacesObservers.cpp",
498         "PlacesWeakCallbackWrapper.cpp",
499     ]
501 # on win32 if we add these files to UNIFIED_SOURCES then the compiler generates
502 # larger stack frames for some recursive functions that cause us to hit stack
503 # overflows (see bug 1824565)
504 if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["TARGET_CPU"] == "x86":
505     SOURCES += [
506         "CompressionStream.cpp",
507         "DecompressionStream.cpp",
508     ]
509 else:
510     UNIFIED_SOURCES += [
511         "CompressionStream.cpp",
512         "DecompressionStream.cpp",
513     ]
515 # these files couldn't be in UNIFIED_SOURCES for now for reasons given below:
516 SOURCES += [
517     # Several conflicts with other bindings.
518     "DOMIntersectionObserver.cpp",
519     # Because of OS X headers.
520     "nsContentUtils.cpp",
521     # this file doesn't like windows.h
522     "nsDOMWindowUtils.cpp",
523     # Conflicts with windows.h's definition of SendMessage.
524     "nsFrameMessageManager.cpp",
525     # These files have a #error "Never include unwrapped windows.h in this file!"
526     "nsGlobalWindowInner.cpp",
527     "nsGlobalWindowOuter.cpp",
528     # Conflicts with windows.h's definition of LoadImage.
529     "nsImageLoadingContent.cpp",
530     # Because of OS X headers.
531     "nsObjectLoadingContent.cpp",
532     # nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers
533     "nsPluginArray.cpp",
536 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
537 # nsTextFragment.cpp
538 if CONFIG["INTEL_ARCHITECTURE"]:
539     SOURCES += ["nsTextFragmentSSE2.cpp"]
540     SOURCES["nsTextFragmentSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
542 # Are we targeting PowerPC? If so, we can enable a SIMD version for
543 # nsTextFragment.cpp as well.
544 if CONFIG["TARGET_CPU"].startswith("ppc"):
545     SOURCES += ["nsTextFragmentVMX.cpp"]
546     SOURCES["nsTextFragmentVMX.cpp"].flags += CONFIG["PPC_VMX_FLAGS"]
548 EXTRA_JS_MODULES += [
549     "ContentAreaDropListener.sys.mjs",
550     "DOMRequestHelper.sys.mjs",
551     "IndexedDBHelper.sys.mjs",
552     "LocationHelper.sys.mjs",
553     "ProcessSelector.sys.mjs",
554     "SlowScriptDebug.sys.mjs",
557 XPCOM_MANIFESTS += [
558     "components.conf",
561 LOCAL_INCLUDES += [
562     "../battery",
563     "../events",
564     "../media",
565     "../network",
566     "/caps",
567     "/docshell/base",
568     "/dom/base",
569     "/dom/file",
570     "/dom/geolocation",
571     "/dom/html",
572     "/dom/ipc",
573     "/dom/storage",
574     "/dom/svg",
575     "/dom/xml",
576     "/dom/xslt/xpath",
577     "/dom/xul",
578     "/extensions/spellcheck/src",
579     "/gfx/2d",
580     "/image",
581     "/js/xpconnect/loader",
582     "/js/xpconnect/src",
583     "/js/xpconnect/wrappers",
584     "/layout/base",
585     "/layout/forms",
586     "/layout/generic",
587     "/layout/style",
588     "/layout/xul",
589     "/netwerk/base",
590     "/netwerk/protocol/http",
591     "/netwerk/url-classifier",
592     "/parser/htmlparser",
593     "/security/manager/ssl",
594     "/third_party/xsimd/include",
595     "/widget",
596     "/xpcom/ds",
599 if CONFIG["MOZ_WEBRTC"]:
600     LOCAL_INCLUDES += [
601         "/netwerk/sctp/datachannel",
602     ]
604 include("/ipc/chromium/chromium-config.mozbuild")
606 FINAL_LIBRARY = "xul"
608 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
609     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
611 GeneratedFile(
612     "UseCounterList.h",
613     script="gen-usecounters.py",
614     entry_point="use_counter_list",
615     inputs=["UseCounters.conf"],
618 GeneratedFile(
619     "UseCounterWorkerList.h",
620     script="gen-usecounters.py",
621     entry_point="use_counter_list",
622     inputs=["UseCountersWorker.conf"],
625 GeneratedFile(
626     "UseCounterMetrics.cpp",
627     script="usecounters.py",
628     entry_point="metric_map",
629     inputs=[
630         "UseCounters.conf",
631         "UseCountersWorker.conf",
632         "nsDeprecatedOperationList.h",
633         "!/layout/style/ServoCSSPropList.py",
634         "/servo/components/style/properties/counted_unknown_properties.py",
635     ],