moz.build (16613B)
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/. 6 7 with Files("*Selection*"): 8 BUG_COMPONENT = ("Core", "DOM: Selection") 9 10 with Files("**"): 11 BUG_COMPONENT = ("Core", "DOM: Core & HTML") 12 13 TEST_DIRS += ["test"] 14 15 if CONFIG["FUZZING"]: 16 if CONFIG["FUZZING_INTERFACES"]: 17 TEST_DIRS += ["fuzztest"] 18 19 # Add libFuzzer configuration directives 20 include("/tools/fuzzing/libfuzzer-config.mozbuild") 21 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", 36 ] 37 38 XPIDL_MODULE = "dom" 39 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 "nsTextNode.h", 107 "nsTraversal.h", 108 "nsTreeSanitizer.h", 109 "nsViewportInfo.h", 110 "nsWindowMemoryReporter.h", 111 "nsWindowSizes.h", 112 "nsWrapperCache.h", 113 "nsWrapperCacheInlines.h", 114 "XPathGenerator.h", 115 ] 116 117 EXPORTS.mozilla += [ 118 "CallState.h", 119 "ConnectedAncestorTracker.h", 120 "ContentIterator.h", 121 "CORSMode.h", 122 "FlushType.h", 123 "FocusModel.h", 124 "FullscreenChange.h", 125 "GlobalFreezeObserver.h", 126 "GlobalTeardownObserver.h", 127 "IdentifierMapEntry.h", 128 "PointerLockManager.h", 129 "RangeBoundary.h", 130 "RangeUtils.h", 131 "ScriptableContentIterator.h", 132 "ScrollingMetrics.h", 133 "SelectionChangeEventDispatcher.h", 134 "SourceLocation.h", 135 "TextInputProcessor.h", 136 "UseCounter.h", 137 ] 138 139 EXPORTS.mozilla.dom += [ 140 "!UseCounterList.h", 141 "!UseCounterWorkerList.h", 142 "AbstractRange.h", 143 "AncestorIterator.h", 144 "AnimationFrameProvider.h", 145 "AnonymousContent.h", 146 "Attr.h", 147 "AutoPrintEventDispatcher.h", 148 "AutoSuppressEventHandlingAndSuspend.h", 149 "BarProps.h", 150 "BindContext.h", 151 "BodyConsumer.h", 152 "BodyUtil.h", 153 "BorrowedAttrInfo.h", 154 "CacheExpirationTime.h", 155 "CCGCScheduler.h", 156 "CharacterData.h", 157 "CharacterDataBuffer.h", 158 "ChildIterator.h", 159 "ChildProcessMessageManager.h", 160 "ChromeMessageBroadcaster.h", 161 "ChromeMessageSender.h", 162 "ChromeNodeList.h", 163 "ChromeUtils.h", 164 "Comment.h", 165 "ContentFrameMessageManager.h", 166 "ContentProcessMessageManager.h", 167 "CrossShadowBoundaryRange.h", 168 "CustomElementRegistry.h", 169 "DirectionalityUtils.h", 170 "DocGroup.h", 171 "Document.h", 172 "DocumentFragment.h", 173 "DocumentInlines.h", 174 "DocumentOrShadowRoot.h", 175 "DocumentType.h", 176 "DOMArena.h", 177 "DOMException.h", 178 "DOMImplementation.h", 179 "DOMIntersectionObserver.h", 180 "DOMMatrix.h", 181 "DOMMozPromiseRequestHolder.h", 182 "DOMParser.h", 183 "DOMPoint.h", 184 "DOMQuad.h", 185 "DOMRect.h", 186 "DOMStringList.h", 187 "DOMTokenListSupportedTokens.h", 188 "Element.h", 189 "ElementInlines.h", 190 "EventSource.h", 191 "EventSourceEventService.h", 192 "External.h", 193 "FastFrontRemovableArray.h", 194 "FilteredNodeIterator.h", 195 "FormData.h", 196 "FragmentDirective.h", 197 "FragmentOrElement.h", 198 "FromParser.h", 199 "GeneratedImageContent.h", 200 "Highlight.h", 201 "HighlightRegistry.h", 202 "IdleDeadline.h", 203 "IdleRequest.h", 204 "IDTracker.h", 205 "ImageEncoder.h", 206 "InteractiveWidget.h", 207 "IntlUtils.h", 208 "JSExecutionUtils.h", 209 "Link.h", 210 "LinkStyle.h", 211 "Location.h", 212 "LocationBase.h", 213 "MaybeCrossOriginObject.h", 214 "MessageBroadcaster.h", 215 "MessageListenerManager.h", 216 "MessageManagerCallback.h", 217 "MessageManagerGlobal.h", 218 "MessageSender.h", 219 "MimeType.h", 220 "MozQueryInterface.h", 221 "MutationObservers.h", 222 "NameSpaceConstants.h", 223 "Navigator.h", 224 "NodeInfo.h", 225 "NodeInfoInlines.h", 226 "NodeIterator.h", 227 "ParentProcessMessageManager.h", 228 "PlacesBookmark.h", 229 "PlacesBookmarkAddition.h", 230 "PlacesBookmarkChanged.h", 231 "PlacesBookmarkGuid.h", 232 "PlacesBookmarkKeyword.h", 233 "PlacesBookmarkMoved.h", 234 "PlacesBookmarkRemoved.h", 235 "PlacesBookmarkTags.h", 236 "PlacesBookmarkTime.h", 237 "PlacesBookmarkTitle.h", 238 "PlacesBookmarkUrl.h", 239 "PlacesEvent.h", 240 "PlacesEventCounts.h", 241 "PlacesFavicon.h", 242 "PlacesHistoryCleared.h", 243 "PlacesObservers.h", 244 "PlacesPurgeCaches.h", 245 "PlacesRanking.h", 246 "PlacesVisit.h", 247 "PlacesVisitRemoved.h", 248 "PlacesVisitTitle.h", 249 "PlacesWeakCallbackWrapper.h", 250 "PopoverData.h", 251 "PopupBlocker.h", 252 "Pose.h", 253 "PostMessageEvent.h", 254 "ProcessMessageManager.h", 255 "RadioGroupContainer.h", 256 "RequestCallbackManager.h", 257 "ResizeObserver.h", 258 "ResponsiveImageSelector.h", 259 "SameProcessMessageQueue.h", 260 "ScreenLuminance.h", 261 "ScreenOrientation.h", 262 "Selection.h", 263 "SerializedStackHolder.h", 264 "ShadowIncludingTreeIterator.h", 265 "ShadowRoot.h", 266 "StaticAtomSet.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 "TimeoutBudgetManager.h", 280 "TimeoutHandler.h", 281 "TimeoutManager.h", 282 "TreeIterator.h", 283 "TreeOrderedArray.h", 284 "TreeOrderedArrayInlines.h", 285 "TreeWalker.h", 286 "UIDirectionManager.h", 287 "UnbindContext.h", 288 "UseCounterMetrics.h", 289 "UserActivation.h", 290 "VideoFrameProvider.h", 291 "ViewportMetaData.h", 292 "VisualViewport.h", 293 "WindowFeatures.h", 294 "WindowProxyHolder.h", 295 ] 296 297 if CONFIG["FUZZING"]: 298 EXPORTS.mozilla.dom += [ 299 "FuzzingFunctions.h", 300 ] 301 302 if CONFIG["FUZZING_SNAPSHOT"]: 303 EXPORTS.mozilla.dom += [ 304 "Nyx.h", 305 ] 306 307 UNIFIED_SOURCES += [ 308 "Nyx.cpp", 309 ] 310 311 if CONFIG["COMPILE_ENVIRONMENT"]: 312 EXPORTS.mozilla.dom += [ 313 "!fragmentdirectives_ffi_generated.h", 314 "!GeneratedElementDocumentState.h", 315 "RustTypes.h", 316 ] 317 318 CbindgenHeader( 319 "GeneratedElementDocumentState.h", 320 inputs=["rust"], 321 ) 322 323 CbindgenHeader( 324 "fragmentdirectives_ffi_generated.h", 325 inputs=["fragmentdirectives"], 326 ) 327 328 UNIFIED_SOURCES += [ 329 "!UseCounterMetrics.cpp", 330 "AbstractRange.cpp", 331 "AnimationFrameProvider.cpp", 332 "AnonymousContent.cpp", 333 "Attr.cpp", 334 "AttrArray.cpp", 335 "BarProps.cpp", 336 "BindContext.cpp", 337 "BodyConsumer.cpp", 338 "BodyUtil.cpp", 339 "BorrowedAttrInfo.cpp", 340 "CCGCScheduler.cpp", 341 "CharacterData.cpp", 342 "CharacterDataBuffer.cpp", 343 "ChildIterator.cpp", 344 "ChromeMessageBroadcaster.cpp", 345 "ChromeMessageSender.cpp", 346 "ChromeNodeList.cpp", 347 "ChromeUtils.cpp", 348 "Comment.cpp", 349 "ContentFrameMessageManager.cpp", 350 "ContentIterator.cpp", 351 "ContentProcessMessageManager.cpp", 352 "CrossShadowBoundaryRange.cpp", 353 "Crypto.cpp", 354 "CustomElementRegistry.cpp", 355 "DirectionalityUtils.cpp", 356 "DocGroup.cpp", 357 "Document.cpp", 358 "DocumentFragment.cpp", 359 "DocumentOrShadowRoot.cpp", 360 "DocumentType.cpp", 361 "DOMException.cpp", 362 "DOMImplementation.cpp", 363 "DOMMatrix.cpp", 364 "DOMParser.cpp", 365 "DOMPoint.cpp", 366 "DOMQuad.cpp", 367 "DOMRect.cpp", 368 "DOMStringList.cpp", 369 "Element.cpp", 370 "EventSource.cpp", 371 "EventSourceEventService.cpp", 372 "External.cpp", 373 "FormData.cpp", 374 "FragmentDirective.cpp", 375 "FragmentOrElement.cpp", 376 "GeneratedImageContent.cpp", 377 "GlobalTeardownObserver.cpp", 378 "Highlight.cpp", 379 "HighlightRegistry.cpp", 380 "IdleDeadline.cpp", 381 "IdleRequest.cpp", 382 "IDTracker.cpp", 383 "ImageEncoder.cpp", 384 "InProcessBrowserChildMessageManager.cpp", 385 "IntlUtils.cpp", 386 "JSExecutionUtils.cpp", 387 "Link.cpp", 388 "LinkStyle.cpp", 389 "Location.cpp", 390 "LocationBase.cpp", 391 "MaybeCrossOriginObject.cpp", 392 "MessageBroadcaster.cpp", 393 "MessageListenerManager.cpp", 394 "MessageManagerGlobal.cpp", 395 "MessageSender.cpp", 396 "MimeType.cpp", 397 "MozQueryInterface.cpp", 398 "MutationObservers.cpp", 399 "Navigator.cpp", 400 "NodeInfo.cpp", 401 "NodeIterator.cpp", 402 "NodeUbiReporting.cpp", 403 "nsAttrValue.cpp", 404 "nsAttrValueOrString.cpp", 405 "nsCCUncollectableMarker.cpp", 406 "nsContentAreaDragDrop.cpp", 407 "nsContentList.cpp", 408 "nsContentPermissionHelper.cpp", 409 "nsContentPolicy.cpp", 410 "nsContentSink.cpp", 411 "nsContentTypeParser.cpp", 412 "nsCopySupport.cpp", 413 "nsDataDocumentContentPolicy.cpp", 414 "nsDOMAttributeMap.cpp", 415 "nsDOMCaretPosition.cpp", 416 "nsDOMMutationObserver.cpp", 417 "nsDOMNavigationTiming.cpp", 418 "nsDOMTokenList.cpp", 419 "nsFocusManager.cpp", 420 "nsFrameLoader.cpp", 421 "nsFrameLoaderOwner.cpp", 422 "nsGlobalWindowCommands.cpp", 423 "nsHistory.cpp", 424 "nsIGlobalObject.cpp", 425 "nsINode.cpp", 426 "nsJSEnvironment.cpp", 427 "nsJSUtils.cpp", 428 "nsLineBreaker.cpp", 429 "nsMimeTypeArray.cpp", 430 "nsNameSpaceManager.cpp", 431 "nsNoDataProtocolContentPolicy.cpp", 432 "nsNodeInfoManager.cpp", 433 "nsOpenURIInFrameParams.cpp", 434 "nsPropertyTable.cpp", 435 "nsQueryContentEventResult.cpp", 436 "nsRange.cpp", 437 "nsScreen.cpp", 438 "nsStructuredCloneContainer.cpp", 439 "nsStubAnimationObserver.cpp", 440 "nsStubDocumentObserver.cpp", 441 "nsStubMutationObserver.cpp", 442 "nsStyledElement.cpp", 443 "nsSyncLoadService.cpp", 444 "nsTextNode.cpp", 445 "nsTraversal.cpp", 446 "nsTreeSanitizer.cpp", 447 "nsViewportInfo.cpp", 448 "nsWindowMemoryReporter.cpp", 449 "nsWindowRoot.cpp", 450 "nsWrapperCache.cpp", 451 "ParentProcessMessageManager.cpp", 452 "PointerLockManager.cpp", 453 "PopoverData.cpp", 454 "PopupBlocker.cpp", 455 "Pose.cpp", 456 "PostMessageEvent.cpp", 457 "ProcessMessageManager.cpp", 458 "RadioGroupContainer.cpp", 459 "RangeUtils.cpp", 460 "RemoteOuterWindowProxy.cpp", 461 "ResizeObserver.cpp", 462 "ResponsiveImageSelector.cpp", 463 "SameProcessMessageQueue.cpp", 464 "ScreenLuminance.cpp", 465 "ScreenOrientation.cpp", 466 "ScriptableContentIterator.cpp", 467 "ScrollingMetrics.cpp", 468 "Selection.cpp", 469 "SelectionChangeEventDispatcher.cpp", 470 "SerializedStackHolder.cpp", 471 "ShadowRoot.cpp", 472 "SourceLocation.cpp", 473 "StaticRange.cpp", 474 "StorageAccessPermissionRequest.cpp", 475 "StructuredCloneBlob.cpp", 476 "StructuredCloneHolder.cpp", 477 "StructuredCloneTester.cpp", 478 "StyledRange.cpp", 479 "StyleSheetList.cpp", 480 "SubtleCrypto.cpp", 481 "TestUtils.cpp", 482 "Text.cpp", 483 "TextDirectiveCreator.cpp", 484 "TextDirectiveFinder.cpp", 485 "TextDirectiveUtil.cpp", 486 "TextInputProcessor.cpp", 487 "ThirdPartyUtil.cpp", 488 "Timeout.cpp", 489 "TimeoutBudgetManager.cpp", 490 "TimeoutExecutor.cpp", 491 "TimeoutHandler.cpp", 492 "TimeoutManager.cpp", 493 "TreeWalker.cpp", 494 "UIDirectionManager.cpp", 495 "UserActivation.cpp", 496 "ViewportMetaData.cpp", 497 "VisualViewport.cpp", 498 "WindowDestroyedEvent.cpp", 499 "WindowFeatures.cpp", 500 "WindowNamedPropertiesHandler.cpp", 501 "XPathGenerator.cpp", 502 ] 503 504 if CONFIG["FUZZING"]: 505 UNIFIED_SOURCES += [ 506 "FuzzingFunctions.cpp", 507 ] 508 509 if CONFIG["MOZ_PLACES"]: 510 UNIFIED_SOURCES += [ 511 "PlacesEvent.cpp", 512 "PlacesEventCounts.cpp", 513 "PlacesObservers.cpp", 514 "PlacesWeakCallbackWrapper.cpp", 515 ] 516 517 # these files couldn't be in UNIFIED_SOURCES for now for reasons given below: 518 SOURCES += [ 519 # Several conflicts with other bindings. 520 "DOMIntersectionObserver.cpp", 521 # Because of OS X headers. 522 "nsContentUtils.cpp", 523 # this file doesn't like windows.h 524 "nsDOMWindowUtils.cpp", 525 # Conflicts with windows.h's definition of SendMessage. 526 "nsFrameMessageManager.cpp", 527 # These files have a #error "Never include unwrapped windows.h in this file!" 528 "nsGlobalWindowInner.cpp", 529 "nsGlobalWindowOuter.cpp", 530 # Conflicts with windows.h's definition of LoadImage. 531 "nsImageLoadingContent.cpp", 532 # Because of OS X headers. 533 "nsObjectLoadingContent.cpp", 534 # nsPluginArray.cpp includes npapi.h indirectly, and that includes a lot of system headers 535 "nsPluginArray.cpp", 536 ] 537 538 # Are we targeting x86-32 or x86-64? If so, we want to include SSE2 code for 539 # CharacterDataBuffer.cpp 540 if CONFIG["INTEL_ARCHITECTURE"]: 541 SOURCES += ["CharacterDataBufferSSE2.cpp"] 542 SOURCES["CharacterDataBufferSSE2.cpp"].flags += CONFIG["SSE2_FLAGS"] 543 544 # Are we targeting PowerPC? If so, we can enable a SIMD version for 545 # CharacterDataBuffer.cpp as well. 546 if CONFIG["TARGET_CPU"].startswith("ppc"): 547 SOURCES += ["CharacterDataBufferVMX.cpp"] 548 SOURCES["CharacterDataBufferVMX.cpp"].flags += CONFIG["PPC_VMX_FLAGS"] 549 550 EXTRA_JS_MODULES += [ 551 "ContentAreaDropListener.sys.mjs", 552 "IndexedDBHelper.sys.mjs", 553 "LocationHelper.sys.mjs", 554 "SlowScriptDebug.sys.mjs", 555 ] 556 557 XPCOM_MANIFESTS += [ 558 "components.conf", 559 ] 560 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/build", 597 "/xpcom/ds", 598 ] 599 600 if CONFIG["MOZ_WEBRTC"]: 601 LOCAL_INCLUDES += [ 602 "/netwerk/sctp/datachannel", 603 ] 604 605 include("/ipc/chromium/chromium-config.mozbuild") 606 607 FINAL_LIBRARY = "xul" 608 609 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk": 610 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"] 611 612 GeneratedFile( 613 "UseCounterList.h", 614 script="gen-usecounters.py", 615 entry_point="use_counter_list", 616 inputs=["UseCounters.conf"], 617 ) 618 619 GeneratedFile( 620 "UseCounterWorkerList.h", 621 script="gen-usecounters.py", 622 entry_point="use_counter_list", 623 inputs=["UseCountersWorker.conf"], 624 ) 625 626 GeneratedFile( 627 "UseCounterMetrics.cpp", 628 script="usecounters.py", 629 entry_point="metric_map", 630 inputs=[ 631 "UseCounters.conf", 632 "UseCountersWorker.conf", 633 "nsDeprecatedOperationList.h", 634 "!/layout/style/ServoCSSPropList.py", 635 "/servo/components/style/properties/counted_unknown_properties.py", 636 ], 637 )