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