Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / base / moz.build
blob9210804b890a26b625d4df182de31331dcc46f97
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     "IdentifierMapEntry.h",
133     "PointerLockManager.h",
134     "RangeBoundary.h",
135     "RangeUtils.h",
136     "ScriptableContentIterator.h",
137     "ScrollingMetrics.h",
138     "SelectionChangeEventDispatcher.h",
139     "TextInputProcessor.h",
140     "UseCounter.h",
143 EXPORTS.mozilla.dom += [
144     "!UseCounterList.h",
145     "!UseCounterWorkerList.h",
146     "AbstractRange.h",
147     "AncestorIterator.h",
148     "AnchorAreaFormRelValues.h",
149     "AnimationFrameProvider.h",
150     "AnonymousContent.h",
151     "Attr.h",
152     "AutoPrintEventDispatcher.h",
153     "AutoSuppressEventHandlingAndSuspend.h",
154     "BarProps.h",
155     "BindContext.h",
156     "BodyConsumer.h",
157     "BodyUtil.h",
158     "BorrowedAttrInfo.h",
159     "CCGCScheduler.h",
160     "CharacterData.h",
161     "ChildIterator.h",
162     "ChildProcessMessageManager.h",
163     "ChromeMessageBroadcaster.h",
164     "ChromeMessageSender.h",
165     "ChromeNodeList.h",
166     "ChromeUtils.h",
167     "Comment.h",
168     "CompressionStream.h",
169     "ContentFrameMessageManager.h",
170     "ContentProcessMessageManager.h",
171     "CustomElementRegistry.h",
172     "DecompressionStream.h",
173     "DirectionalityUtils.h",
174     "DocGroup.h",
175     "Document.h",
176     "DocumentFragment.h",
177     "DocumentInlines.h",
178     "DocumentOrShadowRoot.h",
179     "DocumentType.h",
180     "DOMArena.h",
181     "DOMException.h",
182     "DOMImplementation.h",
183     "DOMIntersectionObserver.h",
184     "DOMMatrix.h",
185     "DOMMozPromiseRequestHolder.h",
186     "DOMParser.h",
187     "DOMPoint.h",
188     "DOMQuad.h",
189     "DOMRect.h",
190     "DOMRequest.h",
191     "DOMStringList.h",
192     "DOMTokenListSupportedTokens.h",
193     "Element.h",
194     "ElementInlines.h",
195     "EventSource.h",
196     "EventSourceEventService.h",
197     "External.h",
198     "FilteredNodeIterator.h",
199     "FormData.h",
200     "FragmentOrElement.h",
201     "FromParser.h",
202     "GeneratedImageContent.h",
203     "Highlight.h",
204     "HighlightRegistry.h",
205     "IdleDeadline.h",
206     "IdleRequest.h",
207     "IDTracker.h",
208     "ImageEncoder.h",
209     "ImageTracker.h",
210     "IntlUtils.h",
211     "JSExecutionContext.h",
212     "Link.h",
213     "LinkStyle.h",
214     "Location.h",
215     "LocationBase.h",
216     "MaybeCrossOriginObject.h",
217     "MessageBroadcaster.h",
218     "MessageListenerManager.h",
219     "MessageManagerCallback.h",
220     "MessageManagerGlobal.h",
221     "MessageSender.h",
222     "MimeType.h",
223     "MozQueryInterface.h",
224     "MutationObservers.h",
225     "NameSpaceConstants.h",
226     "Navigator.h",
227     "NodeInfo.h",
228     "NodeInfoInlines.h",
229     "NodeIterator.h",
230     "ParentProcessMessageManager.h",
231     "PlacesBookmark.h",
232     "PlacesBookmarkAddition.h",
233     "PlacesBookmarkChanged.h",
234     "PlacesBookmarkGuid.h",
235     "PlacesBookmarkKeyword.h",
236     "PlacesBookmarkMoved.h",
237     "PlacesBookmarkRemoved.h",
238     "PlacesBookmarkTags.h",
239     "PlacesBookmarkTime.h",
240     "PlacesBookmarkTitle.h",
241     "PlacesBookmarkUrl.h",
242     "PlacesEvent.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     "UserActivation.h",
287     "ViewportMetaData.h",
288     "VisualViewport.h",
289     "WindowFeatures.h",
290     "WindowProxyHolder.h",
293 if CONFIG["FUZZING"]:
294     EXPORTS.mozilla.dom += [
295         "FuzzingFunctions.h",
296     ]
298 if CONFIG["COMPILE_ENVIRONMENT"]:
299     EXPORTS.mozilla.dom += [
300         "!GeneratedElementDocumentState.h",
301         "RustTypes.h",
302     ]
304     CbindgenHeader(
305         "GeneratedElementDocumentState.h",
306         inputs=["rust"],
307     )
309 UNIFIED_SOURCES += [
310     "AbstractRange.cpp",
311     "AnchorAreaFormRelValues.cpp",
312     "AnimationFrameProvider.cpp",
313     "AnonymousContent.cpp",
314     "Attr.cpp",
315     "AttrArray.cpp",
316     "BarProps.cpp",
317     "BindContext.cpp",
318     "BodyConsumer.cpp",
319     "BodyUtil.cpp",
320     "BorrowedAttrInfo.cpp",
321     "CCGCScheduler.cpp",
322     "CharacterData.cpp",
323     "ChildIterator.cpp",
324     "ChromeMessageBroadcaster.cpp",
325     "ChromeMessageSender.cpp",
326     "ChromeNodeList.cpp",
327     "ChromeUtils.cpp",
328     "Comment.cpp",
329     "ContentFrameMessageManager.cpp",
330     "ContentIterator.cpp",
331     "ContentProcessMessageManager.cpp",
332     "Crypto.cpp",
333     "CustomElementRegistry.cpp",
334     "DirectionalityUtils.cpp",
335     "DocGroup.cpp",
336     "Document.cpp",
337     "DocumentFragment.cpp",
338     "DocumentOrShadowRoot.cpp",
339     "DocumentType.cpp",
340     "DOMException.cpp",
341     "DOMImplementation.cpp",
342     "DOMMatrix.cpp",
343     "DOMParser.cpp",
344     "DOMPoint.cpp",
345     "DOMQuad.cpp",
346     "DOMRect.cpp",
347     "DOMRequest.cpp",
348     "DOMStringList.cpp",
349     "Element.cpp",
350     "EventSource.cpp",
351     "EventSourceEventService.cpp",
352     "External.cpp",
353     "FormData.cpp",
354     "FragmentOrElement.cpp",
355     "GeneratedImageContent.cpp",
356     "Highlight.cpp",
357     "HighlightRegistry.cpp",
358     "IdleDeadline.cpp",
359     "IdleRequest.cpp",
360     "IDTracker.cpp",
361     "ImageEncoder.cpp",
362     "ImageTracker.cpp",
363     "InProcessBrowserChildMessageManager.cpp",
364     "IntlUtils.cpp",
365     "JSExecutionContext.cpp",
366     "Link.cpp",
367     "LinkStyle.cpp",
368     "Location.cpp",
369     "LocationBase.cpp",
370     "MaybeCrossOriginObject.cpp",
371     "MessageBroadcaster.cpp",
372     "MessageListenerManager.cpp",
373     "MessageManagerGlobal.cpp",
374     "MessageSender.cpp",
375     "MimeType.cpp",
376     "MozQueryInterface.cpp",
377     "MutationObservers.cpp",
378     "Navigator.cpp",
379     "NodeInfo.cpp",
380     "NodeIterator.cpp",
381     "NodeUbiReporting.cpp",
382     "nsAttrValue.cpp",
383     "nsAttrValueOrString.cpp",
384     "nsCCUncollectableMarker.cpp",
385     "nsContentAreaDragDrop.cpp",
386     "nsContentList.cpp",
387     "nsContentPermissionHelper.cpp",
388     "nsContentPolicy.cpp",
389     "nsContentSink.cpp",
390     "nsContentTypeParser.cpp",
391     "nsCopySupport.cpp",
392     "nsDataDocumentContentPolicy.cpp",
393     "nsDOMAttributeMap.cpp",
394     "nsDOMCaretPosition.cpp",
395     "nsDOMMutationObserver.cpp",
396     "nsDOMNavigationTiming.cpp",
397     "nsDOMTokenList.cpp",
398     "nsFocusManager.cpp",
399     "nsFrameLoader.cpp",
400     "nsFrameLoaderOwner.cpp",
401     "nsGlobalWindowCommands.cpp",
402     "nsHistory.cpp",
403     "nsIGlobalObject.cpp",
404     "nsINode.cpp",
405     "nsJSEnvironment.cpp",
406     "nsJSUtils.cpp",
407     "nsLineBreaker.cpp",
408     "nsMimeTypeArray.cpp",
409     "nsNameSpaceManager.cpp",
410     "nsNoDataProtocolContentPolicy.cpp",
411     "nsNodeInfoManager.cpp",
412     "nsOpenURIInFrameParams.cpp",
413     "nsPropertyTable.cpp",
414     "nsQueryContentEventResult.cpp",
415     "nsRange.cpp",
416     "nsScreen.cpp",
417     "nsStructuredCloneContainer.cpp",
418     "nsStubAnimationObserver.cpp",
419     "nsStubDocumentObserver.cpp",
420     "nsStubMutationObserver.cpp",
421     "nsStyledElement.cpp",
422     "nsSyncLoadService.cpp",
423     "nsTextFragment.cpp",
424     "nsTextNode.cpp",
425     "nsTraversal.cpp",
426     "nsTreeSanitizer.cpp",
427     "nsViewportInfo.cpp",
428     "nsWindowMemoryReporter.cpp",
429     "nsWindowRoot.cpp",
430     "nsWrapperCache.cpp",
431     "ParentProcessMessageManager.cpp",
432     "PointerLockManager.cpp",
433     "PopoverData.cpp",
434     "PopupBlocker.cpp",
435     "Pose.cpp",
436     "PostMessageEvent.cpp",
437     "ProcessMessageManager.cpp",
438     "RadioGroupContainer.cpp",
439     "RangeUtils.cpp",
440     "RemoteOuterWindowProxy.cpp",
441     "ResizeObserver.cpp",
442     "ResponsiveImageSelector.cpp",
443     "SameProcessMessageQueue.cpp",
444     "ScreenLuminance.cpp",
445     "ScreenOrientation.cpp",
446     "ScriptableContentIterator.cpp",
447     "ScrollingMetrics.cpp",
448     "Selection.cpp",
449     "SelectionChangeEventDispatcher.cpp",
450     "SerializedStackHolder.cpp",
451     "ShadowRoot.cpp",
452     "StaticRange.cpp",
453     "StorageAccessPermissionRequest.cpp",
454     "StructuredCloneBlob.cpp",
455     "StructuredCloneHolder.cpp",
456     "StructuredCloneTester.cpp",
457     "StyledRange.cpp",
458     "StyleSheetList.cpp",
459     "SubtleCrypto.cpp",
460     "TestUtils.cpp",
461     "Text.cpp",
462     "TextInputProcessor.cpp",
463     "ThirdPartyUtil.cpp",
464     "Timeout.cpp",
465     "TimeoutBudgetManager.cpp",
466     "TimeoutExecutor.cpp",
467     "TimeoutHandler.cpp",
468     "TimeoutManager.cpp",
469     "TreeWalker.cpp",
470     "UIDirectionManager.cpp",
471     "UserActivation.cpp",
472     "ViewportMetaData.cpp",
473     "VisualViewport.cpp",
474     "WindowDestroyedEvent.cpp",
475     "WindowFeatures.cpp",
476     "WindowNamedPropertiesHandler.cpp",
477     "XPathGenerator.cpp",
480 if CONFIG["MOZ_WEBRTC"]:
481     UNIFIED_SOURCES += [
482         "nsDOMDataChannel.cpp",
483     ]
485 if CONFIG["FUZZING"]:
486     UNIFIED_SOURCES += [
487         "FuzzingFunctions.cpp",
488     ]
490 if CONFIG["MOZ_PLACES"]:
491     UNIFIED_SOURCES += [
492         "PlacesEvent.cpp",
493         "PlacesObservers.cpp",
494         "PlacesWeakCallbackWrapper.cpp",
495     ]
497 # on win32 if we add these files to UNIFIED_SOURCES then the compiler generates
498 # larger stack frames for some recursive functions that cause us to hit stack
499 # overflows (see bug 1824565)
500 if CONFIG["OS_ARCH"] == "WINNT" and CONFIG["CPU_ARCH"] == "x86":
501     SOURCES += [
502         "CompressionStream.cpp",
503         "DecompressionStream.cpp",
504     ]
505 else:
506     UNIFIED_SOURCES += [
507         "CompressionStream.cpp",
508         "DecompressionStream.cpp",
509     ]
511 # these files couldn't be in UNIFIED_SOURCES for now for reasons given below:
512 SOURCES += [
513     # Several conflicts with other bindings.
514     "DOMIntersectionObserver.cpp",
515     # Because of OS X headers.
516     "nsContentUtils.cpp",
517     # this file doesn't like windows.h
518     "nsDOMWindowUtils.cpp",
519     # Conflicts with windows.h's definition of SendMessage.
520     "nsFrameMessageManager.cpp",
521     # These files have a #error "Never include unwrapped windows.h in this file!"
522     "nsGlobalWindowInner.cpp",
523     "nsGlobalWindowOuter.cpp",
524     # Conflicts with windows.h's definition of LoadImage.
525     "nsImageLoadingContent.cpp",
526     # Because of OS X headers.
527     "nsObjectLoadingContent.cpp",
528     # nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers
529     "nsPluginArray.cpp",
532 # Are we targeting x86-32 or x86-64?  If so, we want to include SSE2 code for
533 # nsTextFragment.cpp
534 if CONFIG["INTEL_ARCHITECTURE"]:
535     SOURCES += ["nsTextFragmentSSE2.cpp"]
536     SOURCES["nsTextFragmentSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"]
538 # Are we targeting PowerPC? If so, we can enable a SIMD version for
539 # nsTextFragment.cpp as well.
540 if CONFIG["CPU_ARCH"].startswith("ppc"):
541     SOURCES += ["nsTextFragmentVMX.cpp"]
542     SOURCES["nsTextFragmentVMX.cpp"].flags += CONFIG["PPC_VMX_FLAGS"]
544 EXTRA_JS_MODULES += [
545     "ContentAreaDropListener.sys.mjs",
546     "DOMRequestHelper.sys.mjs",
547     "IndexedDBHelper.sys.mjs",
548     "LocationHelper.sys.mjs",
549     "ProcessSelector.sys.mjs",
550     "SlowScriptDebug.sys.mjs",
553 XPCOM_MANIFESTS += [
554     "components.conf",
557 LOCAL_INCLUDES += [
558     "../battery",
559     "../events",
560     "../media",
561     "../network",
562     "/caps",
563     "/docshell/base",
564     "/dom/base",
565     "/dom/file",
566     "/dom/geolocation",
567     "/dom/html",
568     "/dom/ipc",
569     "/dom/storage",
570     "/dom/svg",
571     "/dom/xml",
572     "/dom/xslt/xpath",
573     "/dom/xul",
574     "/extensions/spellcheck/src",
575     "/gfx/2d",
576     "/image",
577     "/js/xpconnect/loader",
578     "/js/xpconnect/src",
579     "/js/xpconnect/wrappers",
580     "/layout/base",
581     "/layout/forms",
582     "/layout/generic",
583     "/layout/style",
584     "/layout/xul",
585     "/netwerk/base",
586     "/netwerk/protocol/http",
587     "/netwerk/url-classifier",
588     "/parser/htmlparser",
589     "/security/manager/ssl",
590     "/third_party/xsimd/include",
591     "/widget",
592     "/xpcom/ds",
595 if CONFIG["MOZ_WEBRTC"]:
596     LOCAL_INCLUDES += [
597         "/netwerk/sctp/datachannel",
598     ]
600 include("/ipc/chromium/chromium-config.mozbuild")
602 FINAL_LIBRARY = "xul"
604 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
605     CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
607 GeneratedFile(
608     "UseCounterList.h",
609     script="gen-usecounters.py",
610     entry_point="use_counter_list",
611     inputs=["UseCounters.conf"],
614 GeneratedFile(
615     "UseCounterWorkerList.h",
616     script="gen-usecounters.py",
617     entry_point="use_counter_list",
618     inputs=["UseCountersWorker.conf"],