From 21ec99e86e6888160b7c6386d6602581f6cc6872 Mon Sep 17 00:00:00 2001 From: Fedor Date: Sat, 19 Apr 2025 19:14:37 +0300 Subject: [PATCH] 68.14.8 - layout --- layout/base/FrameProperties.h | 104 ++-- layout/base/PresShell.cpp | 69 +-- layout/base/RestyleManager.cpp | 9 +- .../crashtests/{1162813.xul => 1162813.xhtml} | 0 layout/base/crashtests/1423216.html | 18 - layout/base/crashtests/288790-1-inner.xhtml | 47 -- layout/base/crashtests/288790-1.html | 9 - .../{311661-1.xul => 311661-1.xhtml} | 0 .../{311661-2.xul => 311661-2.xhtml} | 0 .../{321058-1.xul => 321058-1.xhtml} | 0 .../{321058-2.xul => 321058-2.xhtml} | 0 .../{321077-1.xul => 321077-1.xhtml} | 0 .../{321077-2.xul => 321077-2.xhtml} | 0 .../crashtests/{325218.xul => 325218.xhtml} | 0 .../{328944-1.xul => 328944-1.xhtml} | 0 .../{336999-1.xul => 336999-1.xhtml} | 0 .../{337476-1.xul => 337476-1.xhtml} | 0 .../{340093-1.xul => 340093-1.xhtml} | 0 .../{344340-1.xul => 344340-1.xhtml} | 0 layout/base/crashtests/350128-1.xhtml | 21 - .../{356325-1.xul => 356325-1.xhtml} | 0 .../{360339-1.xul => 360339-1.xhtml} | 0 .../{360339-2.xul => 360339-2.xhtml} | 0 layout/base/crashtests/374193-1.xhtml | 7 - layout/base/crashtests/374193-1xbl.xml | 10 - layout/base/crashtests/379105-1.xhtml | 48 -- layout/base/crashtests/379920-1.svg | 7 - layout/base/crashtests/379920-2.svg | 7 - layout/base/crashtests/379975.html | 15 - layout/base/crashtests/393326-1-binding.xml | 4 - layout/base/crashtests/393326-1.html | 15 - layout/base/crashtests/393326-2.html | 15 - layout/base/crashtests/394014-1-iframe.html | 21 - layout/base/crashtests/394014-1-inner.html | 10 - layout/base/crashtests/394014-1.html | 9 - layout/base/crashtests/394014-2-binding.xml | 6 - .../base/crashtests/394014-2-constructor.xml | 10 - .../394014-2-constructordestructor.xml | 12 - layout/base/crashtests/394014-2-crash.html | 13 - layout/base/crashtests/394014-2.html | 7 - layout/base/crashtests/399946-1.xhtml | 23 - .../{401589-1.xul => 401589-1.xhtml} | 0 layout/base/crashtests/404218-1.xhtml | 15 - .../{405049-1.xul => 405049-1.xhtml} | 0 layout/base/crashtests/405184-1.xhtml | 31 - layout/base/crashtests/405186-1.xhtml | 39 -- .../{421203-1.xul => 421203-1.xhtml} | 0 layout/base/crashtests/429780-1.xhtml | 4 - .../{444925-1.xul => 444925-1.xhtml} | 0 .../{454751-1.xul => 454751-1.xhtml} | 0 layout/base/crashtests/468546-1.xhtml | 25 - layout/base/crashtests/468645-1.xhtml | 17 - layout/base/crashtests/468645-2.xhtml | 13 - layout/base/crashtests/471594-1.xhtml | 20 - .../{491547-1.xul => 491547-1.xhtml} | 0 .../{491547-2.xul => 491547-2.xhtml} | 0 layout/base/crashtests/497519-1.xhtml | 28 - layout/base/crashtests/497519-2.xhtml | 26 - layout/base/crashtests/497519-3.xhtml | 26 - layout/base/crashtests/497519-4.xhtml | 26 - .../{526378-1.xul => 526378-1.xhtml} | 0 layout/base/crashtests/536623-1.xhtml | 37 -- .../crashtests/{536720.xul => 536720.xhtml} | 0 layout/base/crashtests/537059-1.xhtml | 14 - layout/base/crashtests/537141-1.xhtml | 6 - layout/base/crashtests/537141.xml | 2 - .../{538082-1.xul => 538082-1.xhtml} | 0 .../crashtests/{540760.xul => 540760.xhtml} | 0 layout/base/crashtests/559705.xhtml | 14 - layout/base/crashtests/560441-1.xhtml | 12 - layout/base/crashtests/567292-1.xhtml | 17 - .../crashtests/{572003.xul => 572003.xhtml} | 0 layout/base/crashtests/crashtests.list | 87 +-- layout/base/moz.build | 2 - layout/base/nsCSSFrameConstructor.cpp | 333 +++------- layout/base/nsCSSFrameConstructor.h | 58 +- layout/base/nsChangeHint.h | 15 +- layout/base/nsDocumentViewer.cpp | 28 +- layout/base/nsGenConList.cpp | 11 +- layout/base/nsILayoutDebugger.h | 42 -- layout/base/nsLayoutDebugger.cpp | 67 +- layout/base/nsPresContext.cpp | 51 +- layout/base/nsPresContext.h | 70 +-- layout/base/nsRefreshDriver.cpp | 71 +-- layout/base/nsRefreshDriver.h | 41 +- layout/base/tests/browser_bug617076.js | 2 +- layout/base/tests/chrome/chrome.ini | 47 +- ...> chrome_content_integration_window.xhtml} | 4 +- ...ow.xul => chrome_over_plugin_window.xhtml} | 0 ...ow.xul => default_background_window.xhtml} | 0 ...l => dialog_with_positioning_window.xhtml} | 0 ...e_bug1018265.xul => file_bug1018265.xhtml} | 0 .../tests/{ => chrome}/file_bug465448.html | 0 ...ul => printpreview_bug396024_helper.xhtml} | 0 ...ul => printpreview_bug482976_helper.xhtml} | 0 ...w_helper.xul => printpreview_helper.xhtml} | 0 ...t_bug1018265.xul => test_bug1018265.xhtml} | 2 +- ...t_bug1041200.xul => test_bug1041200.xhtml} | 0 ...est_bug420499.xul => test_bug420499.xhtml} | 4 +- .../test_bug465448.xhtml} | 4 +- ...est_bug514660.xul => test_bug514660.xhtml} | 0 ...est_bug533845.xul => test_bug533845.xhtml} | 0 ...est_bug812817.xul => test_bug812817.xhtml} | 0 ... => test_chrome_content_integration.xhtml} | 2 +- ...ugin.xul => test_chrome_over_plugin.xhtml} | 2 +- ... => test_css_visibility_propagation.xhtml} | 0 ...ound.xul => test_default_background.xhtml} | 2 +- .../chrome/test_dialog_with_positioning.html | 2 +- ...eaf_layers_partition_browser_window.xhtml} | 0 ...intpreview.xul => test_printpreview.xhtml} | 2 +- ....xul => test_printpreview_bug396024.xhtml} | 2 +- ....xul => test_printpreview_bug482976.xhtml} | 2 +- layout/base/tests/mochitest.ini | 2 - layout/build/components.conf | 8 - layout/build/moz.build | 1 - layout/build/nsContentDLF.cpp | 73 +-- layout/build/nsContentDLF.h | 6 - layout/build/nsLayoutModule.cpp | 5 - layout/build/nsLayoutStatics.cpp | 3 - .../{363696-1.xul => 363696-1.xhtml} | 0 layout/forms/crashtests/373586-1.xhtml | 40 -- layout/forms/crashtests/375299-binding.xml | 4 - layout/forms/crashtests/375299.html | 17 - layout/forms/crashtests/382212-1.xhtml | 7 - layout/forms/crashtests/478219-1.xhtml | 7 - layout/forms/crashtests/crashtests.list | 6 +- layout/forms/nsHTMLButtonControlFrame.cpp | 4 + layout/forms/nsTextControlFrame.cpp | 1 + layout/forms/nsTextControlFrame.h | 2 - ...5540_window.xul => bug665540_window.xhtml} | 0 layout/forms/test/chrome.ini | 2 +- layout/forms/test/test_bug665540.html | 2 +- layout/generic/CSSOrderAwareFrameIterator.cpp | 37 +- layout/generic/CSSOrderAwareFrameIterator.h | 73 ++- layout/generic/FrameClasses.py | 1 - layout/generic/ReflowInput.cpp | 46 +- layout/generic/ReflowOutput.cpp | 4 - layout/generic/WritingModes.h | 10 + .../crashtests/{1003441.xul => 1003441.xhtml} | 0 .../{1520798-1.xul => 1520798-1.xhtml} | 0 layout/generic/crashtests/1682686-1.html | 60 ++ layout/generic/crashtests/1682686-2.html | 35 ++ layout/generic/crashtests/1683126.html | 15 + layout/generic/crashtests/1728319.html | 11 + layout/generic/crashtests/1730506.html | 21 + .../crashtests/{321224.xul => 321224.xhtml} | 0 .../{322780-1.xul => 322780-1.xhtml} | 0 layout/generic/crashtests/374090.html | 11 - layout/generic/crashtests/374420.xhtml | 34 -- .../generic/crashtests/382745-1-binding.xml | 3 - layout/generic/crashtests/382745-1.xhtml | 10 - layout/generic/crashtests/385885-1.xul | 19 - layout/generic/crashtests/401042-1.xhtml | 17 - .../{414180-1.xul => 414180-1.xhtml} | 0 layout/generic/crashtests/417109-1.xhtml | 28 - layout/generic/crashtests/420785-1.xhtml | 26 - layout/generic/crashtests/429458.xhtml | 27 - .../{442860-1.xul => 442860-1.xhtml} | 0 layout/generic/crashtests/463785.xhtml | 40 -- layout/generic/crashtests/499885-1.xhtml | 6 - .../{508816-1.xul => 508816-1.xhtml} | 0 layout/generic/crashtests/578977.html | 2 +- .../crashtests/{578977.xul => 578977.xhtml} | 0 layout/generic/crashtests/crashtests.list | 43 +- layout/generic/nsBlockFrame.cpp | 21 +- layout/generic/nsBlockFrame.h | 7 +- layout/generic/nsCanvasFrame.cpp | 96 ++- layout/generic/nsContainerFrame.cpp | 80 ++- layout/generic/nsFlexContainerFrame.cpp | 502 ++++++++++----- layout/generic/nsFlexContainerFrame.h | 5 +- layout/generic/nsFrameStateBits.h | 2 - layout/generic/nsGfxScrollFrame.cpp | 4 +- layout/generic/nsGridContainerFrame.cpp | 146 ++++- layout/generic/nsGridContainerFrame.h | 106 +++- layout/generic/nsIFrame.cpp | 57 +- layout/generic/nsIFrame.h | 149 +---- layout/generic/nsIFrameInlines.h | 9 - layout/generic/nsLineBox.h | 6 - layout/generic/nsPluginFrame.cpp | 4 +- layout/generic/nsTextFrame.cpp | 3 + layout/generic/nsVideoFrame.cpp | 7 + layout/generic/test/chrome.ini | 14 +- ...window.xul => file_bug514732_window.xhtml} | 0 layout/generic/test/mochitest.ini | 1 - .../generic/test/selection_expanding_xbl.xml | 11 - ...delete.xul => test_backspace_delete.xhtml} | 0 ...est_bug469613.xul => test_bug469613.xhtml} | 0 ...est_bug469774.xul => test_bug469774.xhtml} | 2 +- ...est_bug508115.xul => test_bug508115.xhtml} | 0 ...bug514732-2.xul => test_bug514732-2.xhtml} | 2 +- ...est_bug632379.xul => test_bug632379.xhtml} | 0 .../test/test_selection_expanding.html | 67 +- layout/inspector/InspectorUtils.cpp | 18 +- layout/inspector/inDeepTreeWalker.cpp | 1 + layout/inspector/moz.build | 1 - layout/inspector/tests/chrome/chrome.ini | 16 +- ...est_bug467669.xul => test_bug467669.xhtml} | 0 ...est_bug695639.xul => test_bug695639.xhtml} | 0 ...est_bug708874.xul => test_bug708874.xhtml} | 0 ...est_bug727834.xul => test_bug727834.xhtml} | 0 ...Generic.xul => test_fontFaceGeneric.xhtml} | 0 ...ceRanges.xul => test_fontFaceRanges.xhtml} | 0 ...uresAPI.xul => test_fontFeaturesAPI.xhtml} | 0 ...nsAPI.xul => test_fontVariationsAPI.xhtml} | 0 layout/inspector/tests/mochitest.ini | 4 +- ...2601.xhtml => test_bug522601-shadow.xhtml} | 73 +-- ...9549.xhtml => test_bug609549-shadow.xhtml} | 25 +- layout/mathml/crashtests/477740-1.xhtml | 25 - layout/mathml/crashtests/crashtests.list | 1 - layout/mathml/mathml.css | 2 +- layout/mathml/nsMathMLmfracFrame.cpp | 45 +- layout/mathml/tests/test_bug553917.html | 60 +- layout/moz.build | 2 +- layout/painting/nsCSSRenderingGradients.cpp | 2 +- layout/painting/nsDisplayList.cpp | 42 +- layout/painting/nsDisplayList.h | 8 + layout/printing/nsPrintJob.cpp | 31 +- ...{1155359-1-ref.xul => 1155359-1-ref.xhtml} | 0 .../bidi/{1155359-1.xul => 1155359-1.xhtml} | 0 .../{869833-1-ref.xul => 869833-1-ref.xhtml} | 0 .../bidi/{869833-1.xul => 869833-1.xhtml} | 0 layout/reftests/bidi/reftest.list | 34 +- .../box-ordinal-with-out-of-flow-1-ref.html | 21 - .../box-ordinal-with-out-of-flow-1.html | 41 -- ...xul => dynamic-1-add-to-one-grouped.xhtml} | 0 ...l => dynamic-1-add-to-two-grouped-1.xhtml} | 0 ...l => dynamic-1-add-to-two-grouped-2.xhtml} | 0 ...{dynamic-1-ref.xul => dynamic-1-ref.xhtml} | 0 ...=> dynamic-1-remove-to-none-grouped.xhtml} | 0 ...> dynamic-1-remove-to-one-grouped-1.xhtml} | 0 ...> dynamic-1-remove-to-one-grouped-2.xhtml} | 0 layout/reftests/box-ordinal/reftest.list | 13 +- ...ic-ref.xul => boxshadow-dynamic-ref.xhtml} | 0 ...ow-dynamic.xul => boxshadow-dynamic.xhtml} | 0 layout/reftests/box-shadow/reftest.list | 2 +- ...box-attributes-no-box-horizontal-ref.xhtml | 2 - ...flexbox-attributes-no-box-horizontal.xhtml | 2 - ...exbox-attributes-no-box-vertical-ref.xhtml | 2 - .../flexbox-attributes-no-box-vertical.xhtml | 2 - ...x-attributes-no-input-horizontal-ref.xhtml | 2 - ...exbox-attributes-no-input-horizontal.xhtml | 2 - ...box-attributes-no-input-vertical-ref.xhtml | 2 - ...flexbox-attributes-no-input-vertical.xhtml | 2 - layout/reftests/box/reftest.list | 2 +- ...{1150021-1-ref.xul => 1150021-1-ref.xhtml} | 0 .../bugs/{1150021-1.xul => 1150021-1.xhtml} | 0 layout/reftests/bugs/1369954-1-ref.xhtml | 6 +- layout/reftests/bugs/1369954-1.xhtml | 33 +- layout/reftests/bugs/1371130-ref.xhtml | 29 +- layout/reftests/bugs/1371130.xhtml | 29 +- ...{1483649-1-ref.xul => 1483649-1-ref.xhtml} | 0 .../bugs/{1483649-1.xul => 1483649-1.xhtml} | 0 .../bugs/{192767-01.xul => 192767-01.xhtml} | 0 .../bugs/{192767-02.xul => 192767-02.xhtml} | 0 .../bugs/{192767-03.xul => 192767-03.xhtml} | 0 .../bugs/{192767-04.xul => 192767-04.xhtml} | 0 .../bugs/{192767-05.xul => 192767-05.xhtml} | 0 .../bugs/{192767-06.xul => 192767-06.xhtml} | 0 .../bugs/{192767-07.xul => 192767-07.xhtml} | 0 .../bugs/{192767-11.xul => 192767-11.xhtml} | 0 .../bugs/{192767-12.xul => 192767-12.xhtml} | 0 .../bugs/{192767-13.xul => 192767-13.xhtml} | 0 .../bugs/{192767-14.xul => 192767-14.xhtml} | 0 .../bugs/{192767-15.xul => 192767-15.xhtml} | 0 .../bugs/{192767-16.xul => 192767-16.xhtml} | 0 .../bugs/{192767-17.xul => 192767-17.xhtml} | 0 .../bugs/{192767-21.xul => 192767-21.xhtml} | 0 .../bugs/{192767-22.xul => 192767-22.xhtml} | 0 .../bugs/{192767-23.xul => 192767-23.xhtml} | 0 .../bugs/{192767-24.xul => 192767-24.xhtml} | 0 .../bugs/{192767-25.xul => 192767-25.xhtml} | 0 .../bugs/{192767-26.xul => 192767-26.xhtml} | 0 .../bugs/{192767-27.xul => 192767-27.xhtml} | 0 .../bugs/{192767-31.xul => 192767-31.xhtml} | 0 .../bugs/{192767-32.xul => 192767-32.xhtml} | 0 .../bugs/{192767-33.xul => 192767-33.xhtml} | 0 .../bugs/{192767-34.xul => 192767-34.xhtml} | 0 .../bugs/{192767-35.xul => 192767-35.xhtml} | 0 .../bugs/{192767-36.xul => 192767-36.xhtml} | 0 .../bugs/{192767-37.xul => 192767-37.xhtml} | 0 layout/reftests/bugs/232990-1b.xhtml | 63 -- .../bugs/{249141-ref.xul => 249141-ref.xhtml} | 0 .../bugs/{249141.xul => 249141.xhtml} | 0 .../{261826-1-ref.xul => 261826-1-ref.xhtml} | 0 .../bugs/{261826-1.xul => 261826-1.xhtml} | 0 .../{272646-1-ref.xul => 272646-1-ref.xhtml} | 0 .../bugs/{272646-1.xul => 272646-1.xhtml} | 2 +- .../{272646-2-ref.xul => 272646-2-ref.xhtml} | 0 .../bugs/{272646-2a.xul => 272646-2a.xhtml} | 0 .../bugs/{272646-2b.xul => 272646-2b.xhtml} | 0 .../bugs/{272646-2c.xul => 272646-2c.xhtml} | 0 .../{299837-2-ref.xul => 299837-2-ref.xhtml} | 0 .../bugs/{299837-2.xul => 299837-2.xhtml} | 0 .../{299837-3-ref.xul => 299837-3-ref.xhtml} | 0 .../bugs/{299837-3.xul => 299837-3.xhtml} | 0 layout/reftests/bugs/309914-1-ref.xul | 11 - layout/reftests/bugs/309914-1.xul | 45 -- .../{321402-3-ref.xul => 321402-3-ref.xhtml} | 0 .../bugs/{321402-3.xul => 321402-3.xhtml} | 0 .../{321402-4-ref.xul => 321402-4-ref.xhtml} | 0 .../bugs/{321402-4.xul => 321402-4.xhtml} | 0 .../{321402-5-ref.xul => 321402-5-ref.xhtml} | 0 .../bugs/{321402-5.xul => 321402-5.xhtml} | 0 .../{321402-6-ref.xul => 321402-6-ref.xhtml} | 0 .../bugs/{321402-6.xul => 321402-6.xhtml} | 0 layout/reftests/bugs/331809-1-ref.html | 2 +- layout/reftests/bugs/331809-1.html | 2 +- .../bugs/{331809-1.xul => 331809-1.xhtml} | 0 ...334829-1a.xhtml => 334829-1a-shadow.xhtml} | 19 +- ...334829-1b.xhtml => 334829-1b-shadow.xhtml} | 19 +- layout/reftests/bugs/335628-2-ref.xul | 7 - layout/reftests/bugs/335628-2.xul | 7 - .../{336096-1-ref.xul => 336096-1-ref.xhtml} | 0 .../bugs/{336096-1.xul => 336096-1.xhtml} | 0 layout/reftests/bugs/348049-1.xhtml | 26 +- .../bugs/{364968-1.xul => 364968-1.xhtml} | 6 +- layout/reftests/bugs/366207-1-ref.xul | 7 - layout/reftests/bugs/366207-1.xul | 54 -- .../{366616-1-ref.xul => 366616-1-ref.xhtml} | 0 .../bugs/{366616-1.xul => 366616-1.xhtml} | 0 .../bugs/{369882-ref.xul => 369882-ref.xhtml} | 0 .../bugs/{369882.xul => 369882.xhtml} | 0 layout/reftests/bugs/372323-1-ref.xhtml | 15 - layout/reftests/bugs/372323-1.xhtml | 32 - layout/reftests/bugs/372323-1xbl.xml | 11 - .../{374038-1-ref.xul => 374038-1-ref.xhtml} | 0 .../bugs/{374038-1.xul => 374038-1.xhtml} | 0 .../{374038-2-ref.xul => 374038-2-ref.xhtml} | 0 .../bugs/{374038-2.xul => 374038-2.xhtml} | 0 layout/reftests/bugs/374719-1-css.css | 57 -- layout/reftests/bugs/374719-1-ref.xul | 41 -- layout/reftests/bugs/374719-1-xbl.xml | 34 -- layout/reftests/bugs/374719-1.xul | 74 --- layout/reftests/bugs/386310-1b-shadow.html | 23 + layout/reftests/bugs/386310-1b.html | 9 - layout/reftests/bugs/386310-1c-shadow.html | 23 + layout/reftests/bugs/386310-1c.html | 9 - layout/reftests/bugs/386310-1d-shadow.html | 25 + layout/reftests/bugs/386310-1d.html | 9 - layout/reftests/bugs/386310-binding.xml | 27 - layout/reftests/bugs/394676-1-ref.xhtml | 6 - layout/reftests/bugs/394676-1.xhtml | 40 -- layout/reftests/bugs/395331-1-ref.xml | 6 - layout/reftests/bugs/395331-1.xml | 19 - layout/reftests/bugs/395331-xbl.xml | 30 - layout/reftests/bugs/396286-1.html | 12 - layout/reftests/bugs/396286-1xbl.xml | 20 - .../bugs/{401946-1.xul => 401946-1.xhtml} | 0 .../{403505-1-ref.xul => 403505-1-ref.xhtml} | 0 layout/reftests/bugs/403962-1-ref.xhtml | 17 - layout/reftests/bugs/403962-1.xhtml | 36 -- layout/reftests/bugs/403962-1xbl.xml | 22 - .../{404149-1-ref.xul => 404149-1-ref.xhtml} | 0 .../bugs/{404149-1.xul => 404149-1.xhtml} | 0 layout/reftests/bugs/405186-1.xhtml | 37 -- layout/reftests/bugs/420790-1-ref.xhtml | 7 - layout/reftests/bugs/420790-1.xhtml | 26 - .../bugs/{421203-1.xul => 421203-1.xhtml} | 0 .../bugs/{421203-2.xul => 421203-2.xhtml} | 0 .../bugs/{421203-3.xul => 421203-3.xhtml} | 0 .../bugs/{421203-4.xul => 421203-4.xhtml} | 0 .../bugs/{421203-5.xul => 421203-5.xhtml} | 0 .../bugs/{421203-6.xul => 421203-6.xhtml} | 0 .../{424074-1-ref.xul => 424074-1-ref.xhtml} | 0 ...{424074-1-ref2.xul => 424074-1-ref2.xhtml} | 0 ...{424074-1-ref3.xul => 424074-1-ref3.xhtml} | 0 .../bugs/{424074-1.xul => 424074-1.xhtml} | 0 .../bugs/{456147.xul => 456147.xhtml} | 0 .../{463217-1-ref.xul => 463217-1-ref.xhtml} | 0 .../bugs/{463217-1.xul => 463217-1.xhtml} | 0 .../{468473-1-ref.xul => 468473-1-ref.xhtml} | 0 .../bugs/{468473-1.xul => 468473-1.xhtml} | 0 layout/reftests/bugs/468546-1-ref.xhtml | 12 - layout/reftests/bugs/468546-1.xhtml | 25 - layout/reftests/bugs/471594-1-ref.html | 5 - layout/reftests/bugs/471594-1.xhtml | 26 - layout/reftests/bugs/472020-1-ref.xul | 22 - layout/reftests/bugs/472020-1a.xul | 22 - layout/reftests/bugs/472020-1b.xul | 22 - layout/reftests/bugs/472020-2-ref.xul | 21 - layout/reftests/bugs/472020-2.xul | 21 - layout/reftests/bugs/472020-xbl.xml | 21 - .../{472500-1-ref.xul => 472500-1-ref.xhtml} | 0 .../bugs/{472500-1.xul => 472500-1.xhtml} | 0 .../{473847-1-ref.xul => 473847-1-ref.xhtml} | 0 .../bugs/{473847-1.xul => 473847-1.xhtml} | 0 .../{478377-1-ref.xul => 478377-1-ref.xhtml} | 0 .../bugs/{478377-1.xul => 478377-1.xhtml} | 0 layout/reftests/bugs/482592-1a-shadow.xhtml | 30 + layout/reftests/bugs/482592-1a.xhtml | 27 - layout/reftests/bugs/482592-1b-shadow.xhtml | 29 + layout/reftests/bugs/482592-1b.xhtml | 26 - .../bugs/{483565-ref.xul => 483565-ref.xhtml} | 0 .../bugs/{483565.xul => 483565.xhtml} | 0 .../{491323-1-ref.xul => 491323-1-ref.xhtml} | 0 .../bugs/{491323-1.xul => 491323-1.xhtml} | 0 layout/reftests/bugs/492239-1-ref.xul | 11 - layout/reftests/bugs/492239-1.xul | 12 - layout/reftests/bugs/495354-1-ref.xhtml | 5 - layout/reftests/bugs/495354-1a.xhtml | 8 - layout/reftests/bugs/495354-1b.xhtml | 8 - layout/reftests/bugs/508816-1-ref.xul | 40 -- layout/reftests/bugs/508816-1.xul | 29 - .../{508908-1-ref.xul => 508908-1-ref.xhtml} | 0 .../bugs/{508908-1.xul => 508908-1.xhtml} | 0 .../{513318-1-ref.xul => 513318-1-ref.xhtml} | 0 .../bugs/{513318-1.xul => 513318-1.xhtml} | 0 .../{513318-2-ref.xul => 513318-2-ref.xhtml} | 0 .../bugs/{513318-2.xul => 513318-2.xhtml} | 0 ...37507-1-frame.xul => 537507-1-frame.xhtml} | 0 .../{537507-1-ref.xul => 537507-1-ref.xhtml} | 2 +- .../bugs/{537507-1.xul => 537507-1.xhtml} | 2 +- ...37507-2-frame.xul => 537507-2-frame.xhtml} | 0 layout/reftests/bugs/537507-2-ref.html | 2 +- layout/reftests/bugs/537507-2.html | 2 +- .../{558011-1-ref.xul => 558011-1-ref.xhtml} | 0 .../bugs/{558011-1.xul => 558011-1.xhtml} | 0 .../{664127-1-ref.xul => 664127-1-ref.xhtml} | 0 .../bugs/{664127-1.xul => 664127-1.xhtml} | 0 .../bugs/{668319-1.xul => 668319-1.xhtml} | 0 ...015-1-notref.xul => 669015-1-notref.xhtml} | 0 .../bugs/{669015-1.xul => 669015-1.xhtml} | 0 layout/reftests/bugs/reftest.list | 199 +++--- ...nsertionpoints-appendmultiple-shadow.xhtml | 47 ++ ...nsertionpoints-appendsingle-1-shadow.xhtml | 42 ++ ...ltipleinsertionpoints-appendsingle-1.xhtml | 40 -- ...nsertionpoints-appendsingle-2-shadow.xhtml | 43 ++ ...ltipleinsertionpoints-appendsingle-2.xhtml | 40 -- ...sertionpoints-insertmultiple-shadow.xhtml} | 38 +- ...nsertionpoints-insertsingle-1-shadow.xhtml | 44 ++ ...ltipleinsertionpoints-insertsingle-1.xhtml | 41 -- ...nsertionpoints-insertsingle-2-shadow.xhtml | 43 ++ ...ltipleinsertionpoints-insertsingle-2.xhtml | 41 -- .../multipleinsertionpoints-ref2-shadow.xhtml | 28 + .../dom/multipleinsertionpoints-ref2.xhtml | 25 - layout/reftests/dom/reftest.list | 17 +- layout/reftests/dom/xbl-children-1-ref.xhtml | 16 - layout/reftests/dom/xbl-children-2.xhtml | 31 - layout/reftests/dom/xbl-children-3-ref.html | 20 - layout/reftests/dom/xbl-children-3.xhtml | 61 -- layout/reftests/dom/xbl-children-4.xhtml | 29 - ...xbox-align-self-baseline-horiz-3-ref.xhtml | 16 +- .../flexbox-align-self-baseline-horiz-3.xhtml | 2 - layout/reftests/flexbox/reftest.list | 5 +- ...ackground-ref.xul => background-ref.xhtml} | 0 layout/reftests/forms/input/file/reftest.list | 10 +- .../input/file/{rtl-ref.xul => rtl-ref.xhtml} | 0 .../file/{simple-ref.xul => simple-ref.xhtml} | 0 .../file/{style-ref.xul => style-ref.xhtml} | 0 ...tering-1-ref.xul => centering-1-ref.xhtml} | 0 .../{centering-1.xul => centering-1.xhtml} | 0 ...t-1-ref.xul => dynamic-height-1-ref.xhtml} | 0 ...ic-height-1.xul => dynamic-height-1.xhtml} | 0 layout/reftests/forms/input/text/reftest.list | 4 +- .../forms/placeholder/placeholder-19.xul | 23 - .../placeholder-overridden-ref.xul | 5 - .../reftests/forms/placeholder/reftest.list | 1 - layout/reftests/forms/textarea/reftest.list | 1 - .../setvalue-framereconstruction-1.html | 50 -- .../setvalue-framereconstruction-ref.html | 17 - ...-1-notref.xul => accesskey-1-notref.xhtml} | 6 +- .../{accesskey-1.xul => accesskey-1.xhtml} | 6 +- ...esskey-2-ref.xul => accesskey-2-ref.xhtml} | 6 +- .../{accesskey-2.xul => accesskey-2.xhtml} | 6 +- ...-4-notref.xul => accesskey-3-notref.xhtml} | 6 +- ...esskey-3-ref.xul => accesskey-3-ref.xhtml} | 6 +- .../{accesskey-3.xul => accesskey-3.xhtml} | 6 +- ...-3-notref.xul => accesskey-4-notref.xhtml} | 6 +- ...esskey-4-ref.xul => accesskey-4-ref.xhtml} | 6 +- .../{accesskey-4.xul => accesskey-4.xhtml} | 6 +- ...e-1-ref.xul => align-baseline-1-ref.xhtml} | 4 +- ...-baseline-1.xul => align-baseline-1.xhtml} | 6 +- layout/reftests/forms/textbox/reftest.list | 16 +- .../{setsize-ref.xul => setsize-ref.xhtml} | 0 .../textbox/{setsize.xul => setsize.xhtml} | 0 .../insert-into-split-inline-5-shadow.html | 42 ++ .../ib-split/insert-into-split-inline-5.html | 28 - layout/reftests/ib-split/reftest.list | 2 +- .../referenced-from-binding-01-ref.html | 11 - .../referenced-from-binding-01.html | 22 - .../referenced-from-binding-01.xbl | 11 - layout/reftests/image-element/reftest.list | 1 - ...-region-ref.xul => image-region-ref.xhtml} | 0 .../{image-region.xul => image-region.xhtml} | 0 layout/reftests/image-region/reftest.list | 2 +- .../{540247-1-ref.xul => 540247-1-ref.xhtml} | 0 .../{540247-1.xul => 540247-1.xhtml} | 0 layout/reftests/invalidation/reftest.list | 2 +- layout/reftests/mathml/162063-mathml.xhtml | 41 ++ .../{bugs => mathml}/345563-sub.xhtml | 0 .../{bugs => mathml}/345563-sup.xhtml | 0 .../{bugs => mathml}/347348-1-ref.xhtml | 0 .../reftests/{bugs => mathml}/347348-1.xhtml | 0 .../{bugs => mathml}/347496-1-ref.xhtml | 0 .../reftests/{bugs => mathml}/347496-1.xhtml | 0 .../{bugs => mathml}/355548-1-ref.xml | 0 layout/reftests/{bugs => mathml}/355548-1.xml | 0 .../{bugs => mathml}/355548-2-ref.xml | 0 layout/reftests/{bugs => mathml}/355548-2.xml | 0 .../{bugs => mathml}/355548-3-ref.xml | 0 layout/reftests/{bugs => mathml}/355548-3.xml | 0 .../{bugs => mathml}/355548-4-ref.xml | 0 layout/reftests/{bugs => mathml}/355548-4.xml | 0 .../{bugs => mathml}/355548-5-ref.xml | 0 layout/reftests/{bugs => mathml}/355548-5.xml | 0 .../{bugs => mathml}/370692-1-ref.xhtml | 0 .../reftests/{bugs => mathml}/370692-1.xhtml | 0 .../reftests/{bugs => mathml}/373533-1.xhtml | 0 .../reftests/{bugs => mathml}/373533-2.xhtml | 0 .../reftests/{bugs => mathml}/373533-3.xhtml | 0 .../{bugs => mathml}/393760-1-ref.xml | 0 layout/reftests/{bugs => mathml}/393760-1.xml | 0 .../{bugs => mathml}/393760-2-ref.xml | 0 layout/reftests/{bugs => mathml}/393760-2.xml | 0 .../{bugs => mathml}/414123-ref.xhtml | 0 layout/reftests/{bugs => mathml}/414123.xhtml | 0 layout/reftests/mathml/dir-10-ref.html | 41 -- layout/reftests/mathml/dir-10.html | 41 -- layout/reftests/mathml/dir-11-ref.html | 76 --- layout/reftests/mathml/dir-11.html | 98 --- layout/reftests/mathml/dir-6-ref.html | 67 -- layout/reftests/mathml/dir-6.html | 67 -- layout/reftests/mathml/dir-7-ref.html | 36 -- layout/reftests/mathml/dir-7.html | 36 -- layout/reftests/mathml/dir-8-ref.html | 19 - layout/reftests/mathml/dir-8.html | 19 - layout/reftests/mathml/dir-9-ref.html | 11 - layout/reftests/mathml/dir-9.html | 11 - .../reftests/mathml/displaystyle-1-ref.html | 10 + layout/reftests/mathml/displaystyle-1.html | 10 + .../reftests/mathml/displaystyle-2-ref.html | 10 + layout/reftests/mathml/displaystyle-2.html | 10 + .../reftests/mathml/displaystyle-3-ref.html | 22 +- layout/reftests/mathml/displaystyle-3.html | 22 +- .../reftests/mathml/displaystyle-4-ref.html | 18 +- layout/reftests/mathml/displaystyle-4.html | 18 +- .../maction-dynamic-embellished-op-ref.html | 30 +- .../maction-dynamic-embellished-op.html | 30 +- .../reftests/mathml/mathbackground-4-ref.xml | 2 +- layout/reftests/mathml/mathbackground-4.xml | 2 +- layout/reftests/mathml/mathcolor-4-ref.xml | 2 +- layout/reftests/mathml/mathcolor-4.xml | 2 +- .../mathml/mfrac-linethickness-1-ref.xhtml | 24 +- .../mathml/mfrac-linethickness-1.xhtml | 24 +- .../mathml/mfrac-linethickness-2-ref.xhtml | 14 +- .../mathml/mfrac-linethickness-2.xhtml | 14 +- .../mathml/mfrac-linethickness-3-ref.xhtml | 26 +- .../mathml/mfrac-linethickness-3.xhtml | 26 +- layout/reftests/mathml/mstyle-1.xhtml | 2 +- .../mathml/mtable-align-whitespace-ref.html | 572 +++++++++--------- .../mathml/mtable-align-whitespace.html | 570 ++++++++--------- layout/reftests/mathml/reftest.list | 56 +- layout/reftests/mathml/semantics-1-ref.xhtml | 40 +- layout/reftests/mathml/semantics-1.xhtml | 40 +- .../{470711-1-ref.xul => 470711-1-ref.xhtml} | 0 .../{470711-1.xul => 470711-1.xhtml} | 0 .../{482955-1-ref.xul => 482955-1-ref.xhtml} | 0 .../{482955-1.xul => 482955-1.xhtml} | 0 .../{676387-1-ref.xul => 676387-1-ref.xhtml} | 0 .../{676387-1.xul => 676387-1.xhtml} | 0 .../{blank-window.xul => blank-window.xhtml} | 0 ...l => menulist-mirrored-when-rtl-ref.xhtml} | 0 ...l.xul => menulist-mirrored-when-rtl.xhtml} | 0 layout/reftests/native-theme/reftest.list | 36 +- ...ed.xul => resizer-bottomend-flipped.xhtml} | 0 ...nd-rtl.xul => resizer-bottomend-rtl.xhtml} | 0 ...-bottomend.xul => resizer-bottomend.xhtml} | 0 ...t-rtl.xul => resizer-bottomleft-rtl.xhtml} | 0 ...ottomleft.xul => resizer-bottomleft.xhtml} | 0 ...-rtl.xul => resizer-bottomright-rtl.xhtml} | 0 ...tomright.xul => resizer-bottomright.xhtml} | 0 ...-rtl.xul => resizer-bottomstart-rtl.xhtml} | 0 ...tomstart.xul => resizer-bottomstart.xhtml} | 0 .../{resizer-left.xul => resizer-left.xhtml} | 0 ...> searchfield-mirrored-when-rtl-ref.xhtml} | 2 +- ...ul => searchfield-mirrored-when-rtl.xhtml} | 2 +- layout/reftests/pagination/reftest.list | 20 +- layout/reftests/reftest-sanity/reftest.list | 2 +- ...est-async-ref.xul => test-async-ref.xhtml} | 0 .../{test-async.xul => test-async.xhtml} | 0 layout/reftests/svg/moz-only/reftest.list | 14 - layout/reftests/svg/moz-only/xbl-basic-01.svg | 23 - layout/reftests/svg/moz-only/xbl-basic-02.svg | 14 - layout/reftests/svg/moz-only/xbl-basic-02.xbl | 9 - .../xbl-grad-ref--grad-in-binding-01.svg | 29 - .../xbl-grad-ref--grad-in-binding-02.svg | 14 - .../xbl-grad-ref--grad-in-binding-02.xbl | 13 - .../xbl-grad-ref--grad-in-binding-03.svg | 26 - .../xbl-grad-ref--grad-in-binding-04.svg | 13 - .../xbl-grad-ref--grad-in-binding-04.xbl | 16 - .../xbl-grad-ref--grad-in-bound-01.svg | 27 - .../xbl-grad-ref--grad-in-bound-02.svg | 19 - .../xbl-grad-ref--grad-in-bound-02.xbl | 10 - .../xbl-grad-ref--grad-in-bound-03.svg | 25 - .../xbl-grad-ref--grad-in-bound-04.svg | 17 - .../xbl-grad-ref--grad-in-bound-04.xbl | 12 - .../xbl-grad-ref--grad-in-resources-01.svg | 37 -- .../xbl-grad-ref--grad-in-resources-02.svg | 14 - .../xbl-grad-ref--grad-in-resources-02.xbl | 21 - .../mask-html-xbl-bound-01.html | 22 - .../reftests/svg/svg-integration/reftest.list | 1 - .../table-anonymous-boxes/162063-1.xhtml | 29 +- .../text-shadow/basic-negcoord-ref.xhtml | 6 + .../text-shadow/basic-negcoord-ref.xul | 6 - .../reftests/text-shadow/basic-negcoord.xhtml | 5 + .../reftests/text-shadow/basic-negcoord.xul | 5 - layout/reftests/text-shadow/basic-ref.xhtml | 6 + layout/reftests/text-shadow/basic-ref.xul | 6 - layout/reftests/text-shadow/basic.xhtml | 5 + layout/reftests/text-shadow/basic.xul | 5 - .../{blur-notref.xul => blur-notref.xhtml} | 0 .../text-shadow/{blur.xul => blur.xhtml} | 0 .../text-shadow/color-inherit-ref.xhtml | 6 + .../text-shadow/color-inherit-ref.xul | 6 - .../reftests/text-shadow/color-inherit.xhtml | 5 + layout/reftests/text-shadow/color-inherit.xul | 5 - .../text-shadow/multiple-noblur-ref.xhtml | 9 + .../text-shadow/multiple-noblur-ref.xul | 9 - .../text-shadow/multiple-noblur.xhtml | 5 + .../reftests/text-shadow/multiple-noblur.xul | 5 - layout/reftests/text-shadow/reftest.list | 10 +- layout/reftests/usercss/reftest.list | 1 - layout/reftests/usercss/usercss-xbl.html | 13 - ...indow.xul => reference-green-window.xhtml} | 0 .../reftests/xul-document-load/reftest.list | 18 +- .../{test003.xul => test003.xhtml} | 0 .../{test004.xul => test004.xhtml} | 0 .../{test005.xul => test005.xhtml} | 0 .../{test006.xul => test006.xhtml} | 0 .../{test008.xul => test008.xhtml} | 0 .../{test010.xul => test010.xhtml} | 0 .../{test012.xul => test012.xhtml} | 0 .../{test013.xul => test013.xhtml} | 0 .../{test022.xul => test022.xhtml} | 0 layout/reftests/xul/accesskey-ref.xhtml | 23 + layout/reftests/xul/accesskey-ref.xul | 23 - layout/reftests/xul/accesskey.xhtml | 43 ++ layout/reftests/xul/accesskey.xul | 43 -- .../{blank-window.xul => blank-window.xhtml} | 0 .../xul/{css-flex-1.xul => css-flex-1.xhtml} | 0 .../xul/css-grid-with-xul-item-1-ref.xhtml | 40 ++ .../xul/css-grid-with-xul-item-1.xhtml | 51 ++ .../xul/{green-ref.xul => green-ref.xhtml} | 0 .../xul/image-appearance-dynamic-ref.xhtml | 16 + .../xul/image-appearance-dynamic.xhtml | 24 + ...xul => inactive-fixed-bg-bug1205630.xhtml} | 0 ...xul => inactive-fixed-bg-bug1272525.xhtml} | 0 ...lbar-ref.xul => mac-tab-toolbar-ref.xhtml} | 0 ...-tab-toolbar.xul => mac-tab-toolbar.xhtml} | 0 ...tem-key-ref.xul => menuitem-key-ref.xhtml} | 0 .../{menuitem-key.xul => menuitem-key.xhtml} | 0 ...ef.xul => menulist-shrinkwrap-1-ref.xhtml} | 2 +- ...wrap-1.xul => menulist-shrinkwrap-1.xhtml} | 2 +- ...ef.xul => menulist-shrinkwrap-2-ref.xhtml} | 0 ...wrap-2.xul => menulist-shrinkwrap-2.xhtml} | 2 +- ...1.xul => object-fit-contain-png-001.xhtml} | 0 ...2.xul => object-fit-contain-png-002.xhtml} | 0 ...1.xul => object-fit-contain-svg-001.xhtml} | 0 ...2.xul => object-fit-contain-svg-002.xhtml} | 0 ...3.xul => object-fit-contain-svg-003.xhtml} | 0 ...4.xul => object-fit-contain-svg-004.xhtml} | 0 ...5.xul => object-fit-contain-svg-005.xhtml} | 0 ...6.xul => object-fit-contain-svg-006.xhtml} | 0 ...001.xul => object-fit-cover-png-001.xhtml} | 0 ...002.xul => object-fit-cover-png-002.xhtml} | 0 ...001.xul => object-fit-cover-svg-001.xhtml} | 0 ...002.xul => object-fit-cover-svg-002.xhtml} | 0 ...003.xul => object-fit-cover-svg-003.xhtml} | 0 ...004.xul => object-fit-cover-svg-004.xhtml} | 0 ...005.xul => object-fit-cover-svg-005.xhtml} | 0 ...006.xul => object-fit-cover-svg-006.xhtml} | 0 ...-001.xul => object-fit-fill-png-001.xhtml} | 0 ...-002.xul => object-fit-fill-png-002.xhtml} | 0 ...-001.xul => object-fit-fill-svg-001.xhtml} | 0 ...-002.xul => object-fit-fill-svg-002.xhtml} | 0 ...-003.xul => object-fit-fill-svg-003.xhtml} | 0 ...-004.xul => object-fit-fill-svg-004.xhtml} | 0 ...-005.xul => object-fit-fill-svg-005.xhtml} | 0 ...-006.xul => object-fit-fill-svg-006.xhtml} | 0 ...-001.xul => object-fit-none-png-001.xhtml} | 0 ...-002.xul => object-fit-none-png-002.xhtml} | 0 ...-001.xul => object-fit-none-svg-001.xhtml} | 0 ...-002.xul => object-fit-none-svg-002.xhtml} | 0 ...-003.xul => object-fit-none-svg-003.xhtml} | 0 ...-004.xul => object-fit-none-svg-004.xhtml} | 0 ...-005.xul => object-fit-none-svg-005.xhtml} | 0 ...-006.xul => object-fit-none-svg-006.xhtml} | 0 ...ul => object-fit-scale-down-png-001.xhtml} | 0 ...ul => object-fit-scale-down-png-002.xhtml} | 0 ...ul => object-fit-scale-down-svg-001.xhtml} | 0 ...ul => object-fit-scale-down-svg-002.xhtml} | 0 ...ul => object-fit-scale-down-svg-003.xhtml} | 0 ...ul => object-fit-scale-down-svg-004.xhtml} | 0 ...ul => object-fit-scale-down-svg-005.xhtml} | 0 ...ul => object-fit-scale-down-svg-006.xhtml} | 0 ...-001.xul => object-position-png-001.xhtml} | 0 ...-002.xul => object-position-png-002.xhtml} | 0 layout/reftests/xul/reftest.list | 150 ++--- ...ed.xul => resizer-bottomend-flipped.xhtml} | 0 ...nd-rtl.xul => resizer-bottomend-rtl.xhtml} | 0 ...-bottomend.xul => resizer-bottomend.xhtml} | 0 ...t-rtl.xul => resizer-bottomleft-rtl.xhtml} | 0 ...ottomleft.xul => resizer-bottomleft.xhtml} | 0 ...-rtl.xul => resizer-bottomright-rtl.xhtml} | 0 ...tomright.xul => resizer-bottomright.xhtml} | 0 ...-rtl.xul => resizer-bottomstart-rtl.xhtml} | 0 ...tomstart.xul => resizer-bottomstart.xhtml} | 0 .../{resizer-left.xul => resizer-left.xhtml} | 0 layout/reftests/xul/stack-sizing-1-ref.xul | 55 -- layout/reftests/xul/stack-sizing-1.xul | 70 --- layout/reftests/xul/stack-sizing-2-ref.xul | 19 - layout/reftests/xul/stack-sizing-2.xul | 35 -- ...{text-crop-ref.xul => text-crop-ref.xhtml} | 2 +- .../xul/{text-crop.xul => text-crop.xhtml} | 2 +- ...-1-ref.xul => text-small-caps-1-ref.xhtml} | 2 +- ...all-caps-1.xul => text-small-caps-1.xhtml} | 2 +- ...1-ref.xul => textbox-overflow-1-ref.xhtml} | 2 +- ...verflow-1.xul => textbox-overflow-1.xhtml} | 2 +- ...ef.xul => tree-row-outline-1-notref.xhtml} | 0 ...1-ref.xul => tree-row-outline-1-ref.xhtml} | 0 ...outline-1.xul => tree-row-outline-1.xhtml} | 0 ...ref.xul => treecell-image-svg-1-ref.xhtml} | 0 ...svg-1a.xul => treecell-image-svg-1a.xhtml} | 0 ...svg-1b.xul => treecell-image-svg-1b.xhtml} | 0 ... treechildren-padding-percent-1-ref.xhtml} | 0 ...l => treechildren-padding-percent-1.xhtml} | 0 ...etwisty-svg-context-paint-1-not-ref.xhtml} | 0 ... treetwisty-svg-context-paint-1-ref.xhtml} | 0 ...l => treetwisty-svg-context-paint-1.xhtml} | 0 layout/style/GeckoBindings.cpp | 8 - layout/style/GeckoBindings.h | 6 - layout/style/Loader.cpp | 38 +- layout/style/ServoBindingTypes.h | 1 - layout/style/ServoBindings.toml | 2 - layout/style/ServoStyleSet.cpp | 1 - layout/style/StyleSheet.cpp | 19 +- layout/style/StyleSheet.h | 16 +- layout/style/crashtests/1370793-1.xhtml | 24 - layout/style/crashtests/1517319.html | 3 - .../{416461-1.xul => 416461-1.xhtml} | 0 .../{431705-1.xul => 431705-1.xhtml} | 0 layout/style/crashtests/crashtests.list | 6 +- layout/style/moz.build | 1 - layout/style/nsMediaFeatures.cpp | 20 +- layout/style/nsStyleConsts.h | 16 +- layout/style/nsStyleStruct.cpp | 27 +- layout/style/nsStyleStruct.h | 5 +- layout/style/res/forms.css | 71 ++- layout/style/res/html.css | 14 +- layout/style/res/ua.css | 14 +- layout/style/test/chrome/bug418986-2.js | 8 +- ...{bug535806-xul.xul => bug535806-xul.xhtml} | 0 layout/style/test/chrome/chrome.ini | 8 +- ...t_bug1160724.xul => test_bug1160724.xhtml} | 0 ...bug418986-2.xul => test_bug418986-2.xhtml} | 0 ...est_bug535806.xul => test_bug535806.xhtml} | 2 +- layout/style/test/mochitest.ini | 2 +- layout/style/test/property_database.js | 16 - layout/style/test/test_bug1505254.html | 14 +- .../test_compute_data_with_start_struct.html | 81 +-- .../test/test_flexbox_reflow_counts.html | 78 ++- layout/style/test/test_hover_on_part.html | 52 ++ .../style/test/test_initial_computation.html | 8 - ...ss_xul_display_values_content_enabled.html | 1 - .../test_non_content_accessible_values.html | 1 - .../test_selectors_on_anonymous_content.html | 78 --- .../test/test_transitions_per_property.html | 2 - layout/style/test/test_value_cloning.html | 4 + layout/style/test/test_value_computation.html | 8 - layout/svg/SVGObserverUtils.cpp | 44 +- .../{314244-1.xul => 314244-1.xhtml} | 0 .../{337408-1.xul => 337408-1.xhtml} | 0 layout/svg/crashtests/386566-1.svg | 21 - layout/svg/crashtests/409573-1.svg | 17 - layout/svg/crashtests/crashtests.list | 6 +- layout/svg/svg.css | 5 - .../{322779-1.xul => 322779-1.xhtml} | 0 layout/tables/crashtests/crashtests.list | 2 +- layout/tables/nsTableFrame.cpp | 4 + .../src/nsILayoutDebuggingTools.idl | 19 +- .../layout-debug/src/nsLayoutDebugCLH.cpp | 143 ++++- .../src/nsLayoutDebuggingTools.cpp | 157 +---- .../layout-debug/src/nsLayoutDebuggingTools.h | 5 - .../tests/browser/browser_openLayoutDebug.js | 2 +- .../ui/content/layoutdebug-helper.js | 19 + .../layout-debug/ui/content/layoutdebug.js | 325 ++++++++-- .../{layoutdebug.xul => layoutdebug.xhtml} | 28 +- layout/tools/layout-debug/ui/jar.mn | 3 +- .../ui/locale/en-US/layoutdebug.dtd | 18 - layout/tools/recording/RecordingCmdLine.jsm | 2 +- layout/tools/recording/jar.mn | 2 +- .../{recording.xul => recording.xhtml} | 0 layout/tools/reftest/api.js | 2 +- layout/tools/reftest/jar.mn | 46 +- .../reftest/{reftest.xul => reftest.xhtml} | 0 layout/xul/BoxObject.cpp | 523 ---------------- layout/xul/BoxObject.h | 95 --- .../{131008-1.xul => 131008-1.xhtml} | 0 .../{137216-1.xul => 137216-1.xhtml} | 0 layout/xul/crashtests/1379332-1.xul | 9 - .../{1379332-2.xul => 1379332-2.xhtml} | 0 .../{151826-1.xul => 151826-1.xhtml} | 0 .../{168724-1.xul => 168724-1.xhtml} | 0 .../{189814-1.xul => 189814-1.xhtml} | 0 .../{289410-1.xul => 289410-1.xhtml} | 0 .../{291702-1.xul => 291702-1.xhtml} | 0 .../{291702-2.xul => 291702-2.xhtml} | 0 .../{291702-3.xul => 291702-3.xhtml} | 0 .../{294371-1.xul => 294371-1.xhtml} | 0 .../{322786-1.xul => 322786-1.xhtml} | 0 .../crashtests/{325377.xul => 325377.xhtml} | 0 .../{326879-1.xul => 326879-1.xhtml} | 2 +- layout/xul/crashtests/328135-1.xul | 27 - .../{329327-1.xul => 329327-1.xhtml} | 0 .../{336962-1.xul => 336962-1.xhtml} | 0 .../{344228-1.xul => 344228-1.xhtml} | 0 .../crashtests/{350460.xul => 350460.xhtml} | 0 .../crashtests/{365151.xul => 365151.xhtml} | 0 .../{366112-1.xul => 366112-1.xhtml} | 0 .../{366203-1.xul => 366203-1.xhtml} | 0 .../{374102-1.xul => 374102-1.xhtml} | 0 .../{382746-1.xul => 382746-1.xhtml} | 0 .../{382899-1.xul => 382899-1.xhtml} | 0 ...84105-1-inner.xul => 384105-1-inner.xhtml} | 0 layout/xul/crashtests/384105-1.html | 2 +- .../{384373-1.xul => 384373-1.xhtml} | 0 .../{384373-2.xul => 384373-2.xhtml} | 0 layout/xul/crashtests/384373.html | 4 +- ...84871-1-inner.xul => 384871-1-inner.xhtml} | 0 layout/xul/crashtests/384871-1.html | 2 +- .../crashtests/{386642.xul => 386642.xhtml} | 0 layout/xul/crashtests/387033-1.xhtml | 31 - .../{387080-1.xul => 387080-1.xhtml} | 0 ...91974-1-inner.xul => 391974-1-inner.xhtml} | 0 layout/xul/crashtests/391974-1.html | 2 +- .../crashtests/{399013.xul => 399013.xhtml} | 0 .../{408904-1.xul => 408904-1.xhtml} | 0 .../crashtests/{417509.xul => 417509.xhtml} | 0 layout/xul/crashtests/452185.html | 3 - layout/xul/crashtests/467080.xul | 24 - .../{538308-1.xul => 538308-1.xhtml} | 2 +- .../{564705-1.xul => 564705-1.xhtml} | 0 layout/xul/crashtests/crashtests.list | 67 +- ...tcases.xul => 306911-grid-testcases.xhtml} | 0 ...ases2.xul => 306911-grid-testcases2.xhtml} | 0 .../{311710-1.xul => 311710-1.xhtml} | 0 .../{312784-1.xul => 312784-1.xhtml} | 0 ...13173-1-inner.xul => 313173-1-inner.xhtml} | 0 layout/xul/grid/crashtests/313173-1.html | 2 +- .../{321066-1.xul => 321066-1.xhtml} | 0 .../{423802-crash.xul => 423802-crash.xhtml} | 0 layout/xul/grid/crashtests/crashtests.list | 12 +- layout/xul/grid/examples/borderedcolumns.xul | 43 -- .../xul/grid/examples/borderedrowscolumns.xul | 55 -- .../grid/examples/borderedrowscolumns2.xul | 44 -- .../grid/examples/borderedrowscolumns3.xul | 57 -- .../grid/examples/bordermargincolumns1.xul | 44 -- layout/xul/grid/examples/collapsetest.xul | 67 -- layout/xul/grid/examples/divcolumngrid.xul | 33 - layout/xul/grid/examples/divrowgrid.xul | 36 -- layout/xul/grid/examples/dynamicgrid.xul | 370 ----------- layout/xul/grid/examples/flexgroupgrid.xul | 47 -- layout/xul/grid/examples/javascriptappend.xul | 42 -- layout/xul/grid/examples/jumpygrid.xul | 82 --- layout/xul/grid/examples/nestedrows.xul | 48 -- layout/xul/grid/examples/rowspan.xul | 41 -- layout/xul/grid/examples/scrollingcolumns.xul | 80 --- layout/xul/grid/examples/scrollingrows.xul | 80 --- layout/xul/grid/examples/splitter.xul | 40 -- ...ng-1-ref.xul => column-sizing-1-ref.xhtml} | 2 +- ...umn-sizing-1.xul => column-sizing-1.xhtml} | 2 +- ...ot-full-basic.xul => not-full-basic.xhtml} | 0 ...ign.xul => not-full-grid-pack-align.xhtml} | 0 ...ign.xul => not-full-row-group-align.xhtml} | 0 ...xul => not-full-row-group-direction.xhtml} | 0 ...pack.xul => not-full-row-group-pack.xhtml} | 0 ...lign.xul => not-full-row-leaf-align.xhtml} | 0 ....xul => not-full-row-leaf-direction.xhtml} | 0 ...-pack.xul => not-full-row-leaf-pack.xhtml} | 0 layout/xul/grid/reftests/reftest.list | 36 +- ...ing-1.xul => row-or-column-sizing-1.xhtml} | 2 +- ...ing-2.xul => row-or-column-sizing-2.xhtml} | 2 +- ...ing-3.xul => row-or-column-sizing-3.xhtml} | 2 +- ...ing-4.xul => row-or-column-sizing-4.xhtml} | 2 +- ...izing-1-ref.xul => row-sizing-1-ref.xhtml} | 2 +- .../{row-sizing-1.xul => row-sizing-1.xhtml} | 2 +- ...e-columns.xul => scrollable-columns.xhtml} | 0 ...ollable-rows.xul => scrollable-rows.xhtml} | 0 ...{sizing-2d-ref.xul => sizing-2d-ref.xhtml} | 0 .../{sizing-2d.xul => sizing-2d.xhtml} | 0 ...{z-order-1-ref.xul => z-order-1-ref.xhtml} | 0 .../{z-order-1.xul => z-order-1.xhtml} | 0 ...{z-order-2-ref.xul => z-order-2-ref.xhtml} | 0 .../{z-order-2.xul => z-order-2.xhtml} | 0 layout/xul/moz.build | 13 - layout/xul/nsBox.cpp | 20 - layout/xul/nsBoxFrame.cpp | 293 ++------- layout/xul/nsBoxFrame.h | 12 +- layout/xul/nsButtonBoxFrame.cpp | 4 +- layout/xul/nsButtonBoxFrame.h | 4 - layout/xul/nsIBoxObject.idl | 26 - layout/xul/nsImageBoxFrame.cpp | 62 +- layout/xul/nsImageBoxFrame.h | 9 +- layout/xul/nsLeafBoxFrame.cpp | 32 - layout/xul/nsLeafBoxFrame.h | 6 - layout/xul/nsMenuFrame.cpp | 23 +- layout/xul/nsMenuFrame.h | 6 - layout/xul/nsMenuPopupFrame.cpp | 97 ++- layout/xul/nsMenuPopupFrame.h | 8 +- layout/xul/nsPIBoxObject.h | 40 -- layout/xul/nsPopupSetFrame.cpp | 2 +- layout/xul/nsScrollbarFrame.cpp | 4 - layout/xul/nsSplitterFrame.cpp | 78 +-- layout/xul/nsSprocketLayout.cpp | 180 +++--- layout/xul/nsStackFrame.cpp | 60 -- layout/xul/nsStackFrame.h | 43 -- layout/xul/nsStackLayout.cpp | 109 ++-- layout/xul/nsTitleBarFrame.cpp | 1 - layout/xul/nsTitleBarFrame.h | 4 - layout/xul/nsXULPopupManager.cpp | 27 +- layout/xul/nsXULPopupManager.h | 4 +- layout/xul/nsXULTooltipListener.cpp | 7 +- ....xul => checkbox-dynamic-change-ref.xhtml} | 0 ...ange.xul => checkbox-dynamic-change.xhtml} | 0 ...l => image-scaling-min-height-1-ref.xhtml} | 0 ...1.xul => image-scaling-min-height-1.xhtml} | 0 ...mage-size-ref.xul => image-size-ref.xhtml} | 0 .../{image-size.xul => image-size.xhtml} | 0 ...-ref.xul => popup-explicit-size-ref.xhtml} | 0 ...cit-size.xul => popup-explicit-size.xhtml} | 0 ...ref.xul => radio-dynamic-change-ref.xhtml} | 0 ...-change.xul => radio-dynamic-change.xhtml} | 0 layout/xul/reftest/reftest.list | 12 +- layout/xul/reftest/textbox-multiline-ref.xul | 5 - ...f.xul => textbox-text-transform-ref.xhtml} | 0 ...sform.xul => textbox-text-transform.xhtml} | 0 layout/xul/test/chrome.ini | 62 +- layout/xul/test/mochitest.ini | 3 - layout/xul/test/test_blockify_moz_box.html | 1 - ...t_bug1197913.xul => test_bug1197913.xhtml} | 0 ...est_bug159346.xul => test_bug159346.xhtml} | 0 ...est_bug372685.xul => test_bug372685.xhtml} | 0 ...est_bug393970.xul => test_bug393970.xhtml} | 0 ...bug398982-1.xul => test_bug398982-1.xhtml} | 0 ...bug398982-2.xul => test_bug398982-2.xhtml} | 0 ...est_bug467442.xul => test_bug467442.xhtml} | 0 ...est_bug477754.xul => test_bug477754.xhtml} | 0 ...est_bug703150.xul => test_bug703150.xhtml} | 0 ...est_bug987230.xul => test_bug987230.xhtml} | 13 +- ...eflowPos.xul => test_popupReflowPos.xhtml} | 0 ...popupSizeTo.xul => test_popupSizeTo.xhtml} | 0 ...est_popupZoom.xul => test_popupZoom.xhtml} | 0 .../{test_resizer.xul => test_resizer.xhtml} | 8 +- ...ntent.xul => test_resizer_incontent.xhtml} | 4 +- layout/xul/test/test_splitter.xhtml | 101 ++++ layout/xul/test/test_splitter.xul | 117 ---- layout/xul/test/test_stack.xul | 327 ---------- ...bmenuClose.xul => test_submenuClose.xhtml} | 0 ...axsize.xul => test_windowminmaxsize.xhtml} | 22 +- ...anelwindow.xul => titledpanelwindow.xhtml} | 0 ...indow_resizer.xul => window_resizer.xhtml} | 8 +- ...ement.xul => window_resizer_element.xhtml} | 0 ...inmaxsize1.xul => windowminmaxsize1.xhtml} | 0 ...maxsize10.xul => windowminmaxsize10.xhtml} | 0 ...inmaxsize2.xul => windowminmaxsize2.xhtml} | 0 ...inmaxsize3.xul => windowminmaxsize3.xhtml} | 0 ...inmaxsize4.xul => windowminmaxsize4.xhtml} | 0 ...inmaxsize5.xul => windowminmaxsize5.xhtml} | 0 ...inmaxsize6.xul => windowminmaxsize6.xhtml} | 0 ...inmaxsize7.xul => windowminmaxsize7.xhtml} | 0 ...inmaxsize8.xul => windowminmaxsize8.xhtml} | 0 ...inmaxsize9.xul => windowminmaxsize9.xhtml} | 0 .../{307298-1.xul => 307298-1.xhtml} | 0 .../{309732-1.xul => 309732-1.xhtml} | 0 .../{309732-2.xul => 309732-2.xhtml} | 0 .../{366583-1.xul => 366583-1.xhtml} | 0 .../{380217-1.xul => 380217-1.xhtml} | 0 .../{391178-2.xul => 391178-2.xhtml} | 0 .../{393665-1.xul => 393665-1.xhtml} | 0 .../{399227-1.xul => 399227-1.xhtml} | 0 .../{409807-1.xul => 409807-1.xhtml} | 0 .../{414170-1.xul => 414170-1.xhtml} | 0 layout/xul/tree/crashtests/430394-1.xul | 8 - ...{585815-iframe.xul => 585815-iframe.xhtml} | 0 layout/xul/tree/crashtests/585815.html | 2 +- layout/xul/tree/crashtests/730441-1.xul | 54 -- layout/xul/tree/crashtests/730441-2.xul | 52 -- .../{730441-3.xul => 730441-3.xhtml} | 0 layout/xul/tree/crashtests/crashtests.list | 25 +- layout/xul/tree/nsITreeSelection.idl | 5 - layout/xul/tree/nsTreeBodyFrame.cpp | 17 - layout/xul/tree/nsTreeColFrame.cpp | 17 +- layout/xul/tree/nsTreeColumns.cpp | 95 +-- layout/xul/tree/nsTreeColumns.h | 1 - layout/xul/tree/nsTreeSelection.cpp | 4 - 995 files changed, 5062 insertions(+), 11086 deletions(-) rename layout/base/crashtests/{1162813.xul => 1162813.xhtml} (100%) delete mode 100644 layout/base/crashtests/1423216.html delete mode 100644 layout/base/crashtests/288790-1-inner.xhtml delete mode 100644 layout/base/crashtests/288790-1.html rename layout/base/crashtests/{311661-1.xul => 311661-1.xhtml} (100%) rename layout/base/crashtests/{311661-2.xul => 311661-2.xhtml} (100%) rename layout/base/crashtests/{321058-1.xul => 321058-1.xhtml} (100%) rename layout/base/crashtests/{321058-2.xul => 321058-2.xhtml} (100%) rename layout/base/crashtests/{321077-1.xul => 321077-1.xhtml} (100%) rename layout/base/crashtests/{321077-2.xul => 321077-2.xhtml} (100%) rename layout/base/crashtests/{325218.xul => 325218.xhtml} (100%) rename layout/base/crashtests/{328944-1.xul => 328944-1.xhtml} (100%) rename layout/base/crashtests/{336999-1.xul => 336999-1.xhtml} (100%) rename layout/base/crashtests/{337476-1.xul => 337476-1.xhtml} (100%) rename layout/base/crashtests/{340093-1.xul => 340093-1.xhtml} (100%) rename layout/base/crashtests/{344340-1.xul => 344340-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/350128-1.xhtml rename layout/base/crashtests/{356325-1.xul => 356325-1.xhtml} (100%) rename layout/base/crashtests/{360339-1.xul => 360339-1.xhtml} (100%) rename layout/base/crashtests/{360339-2.xul => 360339-2.xhtml} (100%) delete mode 100644 layout/base/crashtests/374193-1.xhtml delete mode 100644 layout/base/crashtests/374193-1xbl.xml delete mode 100644 layout/base/crashtests/379105-1.xhtml delete mode 100644 layout/base/crashtests/379920-1.svg delete mode 100644 layout/base/crashtests/379920-2.svg delete mode 100644 layout/base/crashtests/379975.html delete mode 100644 layout/base/crashtests/393326-1-binding.xml delete mode 100644 layout/base/crashtests/393326-1.html delete mode 100644 layout/base/crashtests/393326-2.html delete mode 100644 layout/base/crashtests/394014-1-iframe.html delete mode 100644 layout/base/crashtests/394014-1-inner.html delete mode 100644 layout/base/crashtests/394014-1.html delete mode 100644 layout/base/crashtests/394014-2-binding.xml delete mode 100644 layout/base/crashtests/394014-2-constructor.xml delete mode 100644 layout/base/crashtests/394014-2-constructordestructor.xml delete mode 100644 layout/base/crashtests/394014-2-crash.html delete mode 100644 layout/base/crashtests/394014-2.html delete mode 100644 layout/base/crashtests/399946-1.xhtml rename layout/base/crashtests/{401589-1.xul => 401589-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/404218-1.xhtml rename layout/base/crashtests/{405049-1.xul => 405049-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/405184-1.xhtml delete mode 100644 layout/base/crashtests/405186-1.xhtml rename layout/base/crashtests/{421203-1.xul => 421203-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/429780-1.xhtml rename layout/base/crashtests/{444925-1.xul => 444925-1.xhtml} (100%) rename layout/base/crashtests/{454751-1.xul => 454751-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/468546-1.xhtml delete mode 100644 layout/base/crashtests/468645-1.xhtml delete mode 100644 layout/base/crashtests/468645-2.xhtml delete mode 100644 layout/base/crashtests/471594-1.xhtml rename layout/base/crashtests/{491547-1.xul => 491547-1.xhtml} (100%) rename layout/base/crashtests/{491547-2.xul => 491547-2.xhtml} (100%) delete mode 100644 layout/base/crashtests/497519-1.xhtml delete mode 100644 layout/base/crashtests/497519-2.xhtml delete mode 100644 layout/base/crashtests/497519-3.xhtml delete mode 100644 layout/base/crashtests/497519-4.xhtml rename layout/base/crashtests/{526378-1.xul => 526378-1.xhtml} (100%) delete mode 100644 layout/base/crashtests/536623-1.xhtml rename layout/base/crashtests/{536720.xul => 536720.xhtml} (100%) delete mode 100644 layout/base/crashtests/537059-1.xhtml delete mode 100644 layout/base/crashtests/537141-1.xhtml delete mode 100644 layout/base/crashtests/537141.xml rename layout/base/crashtests/{538082-1.xul => 538082-1.xhtml} (100%) rename layout/base/crashtests/{540760.xul => 540760.xhtml} (100%) delete mode 100644 layout/base/crashtests/559705.xhtml delete mode 100644 layout/base/crashtests/560441-1.xhtml delete mode 100644 layout/base/crashtests/567292-1.xhtml rename layout/base/crashtests/{572003.xul => 572003.xhtml} (100%) delete mode 100644 layout/base/nsILayoutDebugger.h rename layout/base/tests/chrome/{chrome_content_integration_window.xul => chrome_content_integration_window.xhtml} (96%) rename layout/base/tests/chrome/{chrome_over_plugin_window.xul => chrome_over_plugin_window.xhtml} (100%) rename layout/base/tests/chrome/{default_background_window.xul => default_background_window.xhtml} (100%) rename layout/base/tests/chrome/{dialog_with_positioning_window.xul => dialog_with_positioning_window.xhtml} (100%) rename layout/base/tests/chrome/{file_bug1018265.xul => file_bug1018265.xhtml} (100%) rename layout/base/tests/{ => chrome}/file_bug465448.html (100%) rename layout/base/tests/chrome/{printpreview_bug396024_helper.xul => printpreview_bug396024_helper.xhtml} (100%) rename layout/base/tests/chrome/{printpreview_bug482976_helper.xul => printpreview_bug482976_helper.xhtml} (100%) rename layout/base/tests/chrome/{printpreview_helper.xul => printpreview_helper.xhtml} (100%) rename layout/base/tests/chrome/{test_bug1018265.xul => test_bug1018265.xhtml} (91%) rename layout/base/tests/chrome/{test_bug1041200.xul => test_bug1041200.xhtml} (100%) rename layout/base/tests/chrome/{test_bug420499.xul => test_bug420499.xhtml} (95%) rename layout/base/tests/{test_bug465448.xul => chrome/test_bug465448.xhtml} (86%) rename layout/base/tests/chrome/{test_bug514660.xul => test_bug514660.xhtml} (100%) rename layout/base/tests/chrome/{test_bug533845.xul => test_bug533845.xhtml} (100%) rename layout/base/tests/chrome/{test_bug812817.xul => test_bug812817.xhtml} (100%) rename layout/base/tests/chrome/{test_chrome_content_integration.xul => test_chrome_content_integration.xhtml} (90%) rename layout/base/tests/chrome/{test_chrome_over_plugin.xul => test_chrome_over_plugin.xhtml} (89%) rename layout/base/tests/chrome/{test_css_visibility_propagation.xul => test_css_visibility_propagation.xhtml} (100%) rename layout/base/tests/chrome/{test_default_background.xul => test_default_background.xhtml} (91%) rename layout/base/tests/chrome/{test_leaf_layers_partition_browser_window.xul => test_leaf_layers_partition_browser_window.xhtml} (100%) rename layout/base/tests/chrome/{test_printpreview.xul => test_printpreview.xhtml} (86%) rename layout/base/tests/chrome/{test_printpreview_bug396024.xul => test_printpreview_bug396024.xhtml} (88%) rename layout/base/tests/chrome/{test_printpreview_bug482976.xul => test_printpreview_bug482976.xhtml} (88%) rename layout/forms/crashtests/{363696-1.xul => 363696-1.xhtml} (100%) delete mode 100644 layout/forms/crashtests/373586-1.xhtml delete mode 100644 layout/forms/crashtests/375299-binding.xml delete mode 100644 layout/forms/crashtests/375299.html delete mode 100644 layout/forms/crashtests/382212-1.xhtml delete mode 100644 layout/forms/crashtests/478219-1.xhtml rename layout/forms/test/{bug665540_window.xul => bug665540_window.xhtml} (100%) rename layout/generic/crashtests/{1003441.xul => 1003441.xhtml} (100%) rename layout/generic/crashtests/{1520798-1.xul => 1520798-1.xhtml} (100%) create mode 100644 layout/generic/crashtests/1682686-1.html create mode 100644 layout/generic/crashtests/1682686-2.html create mode 100644 layout/generic/crashtests/1683126.html create mode 100644 layout/generic/crashtests/1728319.html create mode 100644 layout/generic/crashtests/1730506.html rename layout/generic/crashtests/{321224.xul => 321224.xhtml} (100%) rename layout/generic/crashtests/{322780-1.xul => 322780-1.xhtml} (100%) delete mode 100644 layout/generic/crashtests/374090.html delete mode 100644 layout/generic/crashtests/374420.xhtml delete mode 100644 layout/generic/crashtests/382745-1-binding.xml delete mode 100644 layout/generic/crashtests/382745-1.xhtml delete mode 100644 layout/generic/crashtests/385885-1.xul delete mode 100644 layout/generic/crashtests/401042-1.xhtml rename layout/generic/crashtests/{414180-1.xul => 414180-1.xhtml} (100%) delete mode 100644 layout/generic/crashtests/417109-1.xhtml delete mode 100644 layout/generic/crashtests/420785-1.xhtml delete mode 100644 layout/generic/crashtests/429458.xhtml rename layout/generic/crashtests/{442860-1.xul => 442860-1.xhtml} (100%) delete mode 100644 layout/generic/crashtests/463785.xhtml delete mode 100644 layout/generic/crashtests/499885-1.xhtml rename layout/generic/crashtests/{508816-1.xul => 508816-1.xhtml} (100%) rename layout/generic/crashtests/{578977.xul => 578977.xhtml} (100%) rename layout/generic/test/{file_bug514732_window.xul => file_bug514732_window.xhtml} (100%) delete mode 100644 layout/generic/test/selection_expanding_xbl.xml rename layout/generic/test/{test_backspace_delete.xul => test_backspace_delete.xhtml} (100%) rename layout/generic/test/{test_bug469613.xul => test_bug469613.xhtml} (100%) rename layout/generic/test/{test_bug469774.xul => test_bug469774.xhtml} (97%) rename layout/generic/test/{test_bug508115.xul => test_bug508115.xhtml} (100%) rename layout/generic/test/{test_bug514732-2.xul => test_bug514732-2.xhtml} (94%) rename layout/generic/test/{test_bug632379.xul => test_bug632379.xhtml} (100%) rename layout/inspector/tests/chrome/{test_bug467669.xul => test_bug467669.xhtml} (100%) rename layout/inspector/tests/chrome/{test_bug695639.xul => test_bug695639.xhtml} (100%) rename layout/inspector/tests/chrome/{test_bug708874.xul => test_bug708874.xhtml} (100%) rename layout/inspector/tests/chrome/{test_bug727834.xul => test_bug727834.xhtml} (100%) rename layout/inspector/tests/chrome/{test_fontFaceGeneric.xul => test_fontFaceGeneric.xhtml} (100%) rename layout/inspector/tests/chrome/{test_fontFaceRanges.xul => test_fontFaceRanges.xhtml} (100%) rename layout/inspector/tests/chrome/{test_fontFeaturesAPI.xul => test_fontFeaturesAPI.xhtml} (100%) rename layout/inspector/tests/chrome/{test_fontVariationsAPI.xul => test_fontVariationsAPI.xhtml} (100%) rename layout/inspector/tests/{test_bug522601.xhtml => test_bug522601-shadow.xhtml} (86%) rename layout/inspector/tests/{test_bug609549.xhtml => test_bug609549-shadow.xhtml} (70%) delete mode 100644 layout/mathml/crashtests/477740-1.xhtml rename layout/reftests/bidi/{1155359-1-ref.xul => 1155359-1-ref.xhtml} (100%) rename layout/reftests/bidi/{1155359-1.xul => 1155359-1.xhtml} (100%) rename layout/reftests/bidi/{869833-1-ref.xul => 869833-1-ref.xhtml} (100%) rename layout/reftests/bidi/{869833-1.xul => 869833-1.xhtml} (100%) delete mode 100644 layout/reftests/box-ordinal/box-ordinal-with-out-of-flow-1-ref.html delete mode 100644 layout/reftests/box-ordinal/box-ordinal-with-out-of-flow-1.html rename layout/reftests/box-ordinal/{dynamic-1-add-to-one-grouped.xul => dynamic-1-add-to-one-grouped.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-add-to-two-grouped-1.xul => dynamic-1-add-to-two-grouped-1.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-add-to-two-grouped-2.xul => dynamic-1-add-to-two-grouped-2.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-ref.xul => dynamic-1-ref.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-remove-to-none-grouped.xul => dynamic-1-remove-to-none-grouped.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-remove-to-one-grouped-1.xul => dynamic-1-remove-to-one-grouped-1.xhtml} (100%) rename layout/reftests/box-ordinal/{dynamic-1-remove-to-one-grouped-2.xul => dynamic-1-remove-to-one-grouped-2.xhtml} (100%) rename layout/reftests/box-shadow/{boxshadow-dynamic-ref.xul => boxshadow-dynamic-ref.xhtml} (100%) rename layout/reftests/box-shadow/{boxshadow-dynamic.xul => boxshadow-dynamic.xhtml} (100%) rename layout/reftests/bugs/{1150021-1-ref.xul => 1150021-1-ref.xhtml} (100%) rename layout/reftests/bugs/{1150021-1.xul => 1150021-1.xhtml} (100%) rename layout/reftests/bugs/{1483649-1-ref.xul => 1483649-1-ref.xhtml} (100%) rename layout/reftests/bugs/{1483649-1.xul => 1483649-1.xhtml} (100%) rename layout/reftests/bugs/{192767-01.xul => 192767-01.xhtml} (100%) rename layout/reftests/bugs/{192767-02.xul => 192767-02.xhtml} (100%) rename layout/reftests/bugs/{192767-03.xul => 192767-03.xhtml} (100%) rename layout/reftests/bugs/{192767-04.xul => 192767-04.xhtml} (100%) rename layout/reftests/bugs/{192767-05.xul => 192767-05.xhtml} (100%) rename layout/reftests/bugs/{192767-06.xul => 192767-06.xhtml} (100%) rename layout/reftests/bugs/{192767-07.xul => 192767-07.xhtml} (100%) rename layout/reftests/bugs/{192767-11.xul => 192767-11.xhtml} (100%) rename layout/reftests/bugs/{192767-12.xul => 192767-12.xhtml} (100%) rename layout/reftests/bugs/{192767-13.xul => 192767-13.xhtml} (100%) rename layout/reftests/bugs/{192767-14.xul => 192767-14.xhtml} (100%) rename layout/reftests/bugs/{192767-15.xul => 192767-15.xhtml} (100%) rename layout/reftests/bugs/{192767-16.xul => 192767-16.xhtml} (100%) rename layout/reftests/bugs/{192767-17.xul => 192767-17.xhtml} (100%) rename layout/reftests/bugs/{192767-21.xul => 192767-21.xhtml} (100%) rename layout/reftests/bugs/{192767-22.xul => 192767-22.xhtml} (100%) rename layout/reftests/bugs/{192767-23.xul => 192767-23.xhtml} (100%) rename layout/reftests/bugs/{192767-24.xul => 192767-24.xhtml} (100%) rename layout/reftests/bugs/{192767-25.xul => 192767-25.xhtml} (100%) rename layout/reftests/bugs/{192767-26.xul => 192767-26.xhtml} (100%) rename layout/reftests/bugs/{192767-27.xul => 192767-27.xhtml} (100%) rename layout/reftests/bugs/{192767-31.xul => 192767-31.xhtml} (100%) rename layout/reftests/bugs/{192767-32.xul => 192767-32.xhtml} (100%) rename layout/reftests/bugs/{192767-33.xul => 192767-33.xhtml} (100%) rename layout/reftests/bugs/{192767-34.xul => 192767-34.xhtml} (100%) rename layout/reftests/bugs/{192767-35.xul => 192767-35.xhtml} (100%) rename layout/reftests/bugs/{192767-36.xul => 192767-36.xhtml} (100%) rename layout/reftests/bugs/{192767-37.xul => 192767-37.xhtml} (100%) delete mode 100644 layout/reftests/bugs/232990-1b.xhtml rename layout/reftests/bugs/{249141-ref.xul => 249141-ref.xhtml} (100%) rename layout/reftests/bugs/{249141.xul => 249141.xhtml} (100%) rename layout/reftests/bugs/{261826-1-ref.xul => 261826-1-ref.xhtml} (100%) rename layout/reftests/bugs/{261826-1.xul => 261826-1.xhtml} (100%) rename layout/reftests/bugs/{272646-1-ref.xul => 272646-1-ref.xhtml} (100%) rename layout/reftests/bugs/{272646-1.xul => 272646-1.xhtml} (69%) rename layout/reftests/bugs/{272646-2-ref.xul => 272646-2-ref.xhtml} (100%) rename layout/reftests/bugs/{272646-2a.xul => 272646-2a.xhtml} (100%) rename layout/reftests/bugs/{272646-2b.xul => 272646-2b.xhtml} (100%) rename layout/reftests/bugs/{272646-2c.xul => 272646-2c.xhtml} (100%) rename layout/reftests/bugs/{299837-2-ref.xul => 299837-2-ref.xhtml} (100%) rename layout/reftests/bugs/{299837-2.xul => 299837-2.xhtml} (100%) rename layout/reftests/bugs/{299837-3-ref.xul => 299837-3-ref.xhtml} (100%) rename layout/reftests/bugs/{299837-3.xul => 299837-3.xhtml} (100%) delete mode 100644 layout/reftests/bugs/309914-1-ref.xul delete mode 100644 layout/reftests/bugs/309914-1.xul rename layout/reftests/bugs/{321402-3-ref.xul => 321402-3-ref.xhtml} (100%) rename layout/reftests/bugs/{321402-3.xul => 321402-3.xhtml} (100%) rename layout/reftests/bugs/{321402-4-ref.xul => 321402-4-ref.xhtml} (100%) rename layout/reftests/bugs/{321402-4.xul => 321402-4.xhtml} (100%) rename layout/reftests/bugs/{321402-5-ref.xul => 321402-5-ref.xhtml} (100%) rename layout/reftests/bugs/{321402-5.xul => 321402-5.xhtml} (100%) rename layout/reftests/bugs/{321402-6-ref.xul => 321402-6-ref.xhtml} (100%) rename layout/reftests/bugs/{321402-6.xul => 321402-6.xhtml} (100%) rename layout/reftests/bugs/{331809-1.xul => 331809-1.xhtml} (100%) rename layout/reftests/bugs/{334829-1a.xhtml => 334829-1a-shadow.xhtml} (60%) rename layout/reftests/bugs/{334829-1b.xhtml => 334829-1b-shadow.xhtml} (63%) delete mode 100644 layout/reftests/bugs/335628-2-ref.xul delete mode 100644 layout/reftests/bugs/335628-2.xul rename layout/reftests/bugs/{336096-1-ref.xul => 336096-1-ref.xhtml} (100%) rename layout/reftests/bugs/{336096-1.xul => 336096-1.xhtml} (100%) rename layout/reftests/bugs/{364968-1.xul => 364968-1.xhtml} (84%) delete mode 100644 layout/reftests/bugs/366207-1-ref.xul delete mode 100644 layout/reftests/bugs/366207-1.xul rename layout/reftests/bugs/{366616-1-ref.xul => 366616-1-ref.xhtml} (100%) rename layout/reftests/bugs/{366616-1.xul => 366616-1.xhtml} (100%) rename layout/reftests/bugs/{369882-ref.xul => 369882-ref.xhtml} (100%) rename layout/reftests/bugs/{369882.xul => 369882.xhtml} (100%) delete mode 100644 layout/reftests/bugs/372323-1-ref.xhtml delete mode 100644 layout/reftests/bugs/372323-1.xhtml delete mode 100644 layout/reftests/bugs/372323-1xbl.xml rename layout/reftests/bugs/{374038-1-ref.xul => 374038-1-ref.xhtml} (100%) rename layout/reftests/bugs/{374038-1.xul => 374038-1.xhtml} (100%) rename layout/reftests/bugs/{374038-2-ref.xul => 374038-2-ref.xhtml} (100%) rename layout/reftests/bugs/{374038-2.xul => 374038-2.xhtml} (100%) delete mode 100644 layout/reftests/bugs/374719-1-css.css delete mode 100644 layout/reftests/bugs/374719-1-ref.xul delete mode 100644 layout/reftests/bugs/374719-1-xbl.xml delete mode 100644 layout/reftests/bugs/374719-1.xul create mode 100644 layout/reftests/bugs/386310-1b-shadow.html delete mode 100644 layout/reftests/bugs/386310-1b.html create mode 100644 layout/reftests/bugs/386310-1c-shadow.html delete mode 100644 layout/reftests/bugs/386310-1c.html create mode 100644 layout/reftests/bugs/386310-1d-shadow.html delete mode 100644 layout/reftests/bugs/386310-1d.html delete mode 100644 layout/reftests/bugs/386310-binding.xml delete mode 100644 layout/reftests/bugs/394676-1-ref.xhtml delete mode 100644 layout/reftests/bugs/394676-1.xhtml delete mode 100644 layout/reftests/bugs/395331-1-ref.xml delete mode 100644 layout/reftests/bugs/395331-1.xml delete mode 100644 layout/reftests/bugs/395331-xbl.xml delete mode 100644 layout/reftests/bugs/396286-1.html delete mode 100644 layout/reftests/bugs/396286-1xbl.xml rename layout/reftests/bugs/{401946-1.xul => 401946-1.xhtml} (100%) rename layout/reftests/bugs/{403505-1-ref.xul => 403505-1-ref.xhtml} (100%) delete mode 100644 layout/reftests/bugs/403962-1-ref.xhtml delete mode 100644 layout/reftests/bugs/403962-1.xhtml delete mode 100644 layout/reftests/bugs/403962-1xbl.xml rename layout/reftests/bugs/{404149-1-ref.xul => 404149-1-ref.xhtml} (100%) rename layout/reftests/bugs/{404149-1.xul => 404149-1.xhtml} (100%) delete mode 100644 layout/reftests/bugs/405186-1.xhtml delete mode 100644 layout/reftests/bugs/420790-1-ref.xhtml delete mode 100644 layout/reftests/bugs/420790-1.xhtml rename layout/reftests/bugs/{421203-1.xul => 421203-1.xhtml} (100%) rename layout/reftests/bugs/{421203-2.xul => 421203-2.xhtml} (100%) rename layout/reftests/bugs/{421203-3.xul => 421203-3.xhtml} (100%) rename layout/reftests/bugs/{421203-4.xul => 421203-4.xhtml} (100%) rename layout/reftests/bugs/{421203-5.xul => 421203-5.xhtml} (100%) rename layout/reftests/bugs/{421203-6.xul => 421203-6.xhtml} (100%) rename layout/reftests/bugs/{424074-1-ref.xul => 424074-1-ref.xhtml} (100%) rename layout/reftests/bugs/{424074-1-ref2.xul => 424074-1-ref2.xhtml} (100%) rename layout/reftests/bugs/{424074-1-ref3.xul => 424074-1-ref3.xhtml} (100%) rename layout/reftests/bugs/{424074-1.xul => 424074-1.xhtml} (100%) rename layout/reftests/bugs/{456147.xul => 456147.xhtml} (100%) rename layout/reftests/bugs/{463217-1-ref.xul => 463217-1-ref.xhtml} (100%) rename layout/reftests/bugs/{463217-1.xul => 463217-1.xhtml} (100%) rename layout/reftests/bugs/{468473-1-ref.xul => 468473-1-ref.xhtml} (100%) rename layout/reftests/bugs/{468473-1.xul => 468473-1.xhtml} (100%) delete mode 100644 layout/reftests/bugs/468546-1-ref.xhtml delete mode 100644 layout/reftests/bugs/468546-1.xhtml delete mode 100644 layout/reftests/bugs/471594-1-ref.html delete mode 100644 layout/reftests/bugs/471594-1.xhtml delete mode 100644 layout/reftests/bugs/472020-1-ref.xul delete mode 100644 layout/reftests/bugs/472020-1a.xul delete mode 100644 layout/reftests/bugs/472020-1b.xul delete mode 100644 layout/reftests/bugs/472020-2-ref.xul delete mode 100644 layout/reftests/bugs/472020-2.xul delete mode 100644 layout/reftests/bugs/472020-xbl.xml rename layout/reftests/bugs/{472500-1-ref.xul => 472500-1-ref.xhtml} (100%) rename layout/reftests/bugs/{472500-1.xul => 472500-1.xhtml} (100%) rename layout/reftests/bugs/{473847-1-ref.xul => 473847-1-ref.xhtml} (100%) rename layout/reftests/bugs/{473847-1.xul => 473847-1.xhtml} (100%) rename layout/reftests/bugs/{478377-1-ref.xul => 478377-1-ref.xhtml} (100%) rename layout/reftests/bugs/{478377-1.xul => 478377-1.xhtml} (100%) create mode 100644 layout/reftests/bugs/482592-1a-shadow.xhtml delete mode 100644 layout/reftests/bugs/482592-1a.xhtml create mode 100644 layout/reftests/bugs/482592-1b-shadow.xhtml delete mode 100644 layout/reftests/bugs/482592-1b.xhtml rename layout/reftests/bugs/{483565-ref.xul => 483565-ref.xhtml} (100%) rename layout/reftests/bugs/{483565.xul => 483565.xhtml} (100%) rename layout/reftests/bugs/{491323-1-ref.xul => 491323-1-ref.xhtml} (100%) rename layout/reftests/bugs/{491323-1.xul => 491323-1.xhtml} (100%) delete mode 100644 layout/reftests/bugs/492239-1-ref.xul delete mode 100644 layout/reftests/bugs/492239-1.xul delete mode 100644 layout/reftests/bugs/495354-1-ref.xhtml delete mode 100644 layout/reftests/bugs/495354-1a.xhtml delete mode 100644 layout/reftests/bugs/495354-1b.xhtml delete mode 100644 layout/reftests/bugs/508816-1-ref.xul delete mode 100644 layout/reftests/bugs/508816-1.xul rename layout/reftests/bugs/{508908-1-ref.xul => 508908-1-ref.xhtml} (100%) rename layout/reftests/bugs/{508908-1.xul => 508908-1.xhtml} (100%) rename layout/reftests/bugs/{513318-1-ref.xul => 513318-1-ref.xhtml} (100%) rename layout/reftests/bugs/{513318-1.xul => 513318-1.xhtml} (100%) rename layout/reftests/bugs/{513318-2-ref.xul => 513318-2-ref.xhtml} (100%) rename layout/reftests/bugs/{513318-2.xul => 513318-2.xhtml} (100%) rename layout/reftests/bugs/{537507-1-frame.xul => 537507-1-frame.xhtml} (100%) rename layout/reftests/bugs/{537507-1-ref.xul => 537507-1-ref.xhtml} (85%) rename layout/reftests/bugs/{537507-1.xul => 537507-1.xhtml} (72%) rename layout/reftests/bugs/{537507-2-frame.xul => 537507-2-frame.xhtml} (100%) rename layout/reftests/bugs/{558011-1-ref.xul => 558011-1-ref.xhtml} (100%) rename layout/reftests/bugs/{558011-1.xul => 558011-1.xhtml} (100%) rename layout/reftests/bugs/{664127-1-ref.xul => 664127-1-ref.xhtml} (100%) rename layout/reftests/bugs/{664127-1.xul => 664127-1.xhtml} (100%) rename layout/reftests/bugs/{668319-1.xul => 668319-1.xhtml} (100%) rename layout/reftests/bugs/{669015-1-notref.xul => 669015-1-notref.xhtml} (100%) rename layout/reftests/bugs/{669015-1.xul => 669015-1.xhtml} (100%) create mode 100644 layout/reftests/dom/multipleinsertionpoints-appendmultiple-shadow.xhtml create mode 100644 layout/reftests/dom/multipleinsertionpoints-appendsingle-1-shadow.xhtml delete mode 100644 layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml create mode 100644 layout/reftests/dom/multipleinsertionpoints-appendsingle-2-shadow.xhtml delete mode 100644 layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml rename layout/reftests/dom/{multipleinsertionpoints-insertmultiple.xhtml => multipleinsertionpoints-insertmultiple-shadow.xhtml} (60%) create mode 100644 layout/reftests/dom/multipleinsertionpoints-insertsingle-1-shadow.xhtml delete mode 100644 layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml create mode 100644 layout/reftests/dom/multipleinsertionpoints-insertsingle-2-shadow.xhtml delete mode 100644 layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml create mode 100644 layout/reftests/dom/multipleinsertionpoints-ref2-shadow.xhtml delete mode 100644 layout/reftests/dom/multipleinsertionpoints-ref2.xhtml delete mode 100644 layout/reftests/dom/xbl-children-1-ref.xhtml delete mode 100644 layout/reftests/dom/xbl-children-2.xhtml delete mode 100644 layout/reftests/dom/xbl-children-3-ref.html delete mode 100644 layout/reftests/dom/xbl-children-3.xhtml delete mode 100644 layout/reftests/dom/xbl-children-4.xhtml rename layout/reftests/forms/input/file/{background-ref.xul => background-ref.xhtml} (100%) rename layout/reftests/forms/input/file/{rtl-ref.xul => rtl-ref.xhtml} (100%) rename layout/reftests/forms/input/file/{simple-ref.xul => simple-ref.xhtml} (100%) rename layout/reftests/forms/input/file/{style-ref.xul => style-ref.xhtml} (100%) rename layout/reftests/forms/input/text/{centering-1-ref.xul => centering-1-ref.xhtml} (100%) rename layout/reftests/forms/input/text/{centering-1.xul => centering-1.xhtml} (100%) rename layout/reftests/forms/input/text/{dynamic-height-1-ref.xul => dynamic-height-1-ref.xhtml} (100%) rename layout/reftests/forms/input/text/{dynamic-height-1.xul => dynamic-height-1.xhtml} (100%) delete mode 100644 layout/reftests/forms/placeholder/placeholder-19.xul delete mode 100644 layout/reftests/forms/placeholder/placeholder-overridden-ref.xul delete mode 100644 layout/reftests/forms/textarea/setvalue-framereconstruction-1.html delete mode 100644 layout/reftests/forms/textarea/setvalue-framereconstruction-ref.html rename layout/reftests/forms/textbox/{accesskey-1-notref.xul => accesskey-1-notref.xhtml} (89%) rename layout/reftests/forms/textbox/{accesskey-1.xul => accesskey-1.xhtml} (89%) rename layout/reftests/forms/textbox/{accesskey-2-ref.xul => accesskey-2-ref.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-2.xul => accesskey-2.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-4-notref.xul => accesskey-3-notref.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-3-ref.xul => accesskey-3-ref.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-3.xul => accesskey-3.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-3-notref.xul => accesskey-4-notref.xhtml} (90%) rename layout/reftests/forms/textbox/{accesskey-4-ref.xul => accesskey-4-ref.xhtml} (91%) rename layout/reftests/forms/textbox/{accesskey-4.xul => accesskey-4.xhtml} (90%) rename layout/reftests/forms/textbox/{align-baseline-1-ref.xul => align-baseline-1-ref.xhtml} (88%) rename layout/reftests/forms/textbox/{align-baseline-1.xul => align-baseline-1.xhtml} (88%) rename layout/reftests/forms/textbox/{setsize-ref.xul => setsize-ref.xhtml} (100%) rename layout/reftests/forms/textbox/{setsize.xul => setsize.xhtml} (100%) create mode 100644 layout/reftests/ib-split/insert-into-split-inline-5-shadow.html delete mode 100644 layout/reftests/ib-split/insert-into-split-inline-5.html delete mode 100644 layout/reftests/image-element/referenced-from-binding-01-ref.html delete mode 100644 layout/reftests/image-element/referenced-from-binding-01.html delete mode 100644 layout/reftests/image-element/referenced-from-binding-01.xbl rename layout/reftests/image-region/{image-region-ref.xul => image-region-ref.xhtml} (100%) rename layout/reftests/image-region/{image-region.xul => image-region.xhtml} (100%) rename layout/reftests/invalidation/{540247-1-ref.xul => 540247-1-ref.xhtml} (100%) rename layout/reftests/invalidation/{540247-1.xul => 540247-1.xhtml} (100%) create mode 100644 layout/reftests/mathml/162063-mathml.xhtml rename layout/reftests/{bugs => mathml}/345563-sub.xhtml (100%) rename layout/reftests/{bugs => mathml}/345563-sup.xhtml (100%) rename layout/reftests/{bugs => mathml}/347348-1-ref.xhtml (100%) rename layout/reftests/{bugs => mathml}/347348-1.xhtml (100%) rename layout/reftests/{bugs => mathml}/347496-1-ref.xhtml (100%) rename layout/reftests/{bugs => mathml}/347496-1.xhtml (100%) rename layout/reftests/{bugs => mathml}/355548-1-ref.xml (100%) rename layout/reftests/{bugs => mathml}/355548-1.xml (100%) rename layout/reftests/{bugs => mathml}/355548-2-ref.xml (100%) rename layout/reftests/{bugs => mathml}/355548-2.xml (100%) rename layout/reftests/{bugs => mathml}/355548-3-ref.xml (100%) rename layout/reftests/{bugs => mathml}/355548-3.xml (100%) rename layout/reftests/{bugs => mathml}/355548-4-ref.xml (100%) rename layout/reftests/{bugs => mathml}/355548-4.xml (100%) rename layout/reftests/{bugs => mathml}/355548-5-ref.xml (100%) rename layout/reftests/{bugs => mathml}/355548-5.xml (100%) rename layout/reftests/{bugs => mathml}/370692-1-ref.xhtml (100%) rename layout/reftests/{bugs => mathml}/370692-1.xhtml (100%) rename layout/reftests/{bugs => mathml}/373533-1.xhtml (100%) rename layout/reftests/{bugs => mathml}/373533-2.xhtml (100%) rename layout/reftests/{bugs => mathml}/373533-3.xhtml (100%) rename layout/reftests/{bugs => mathml}/393760-1-ref.xml (100%) rename layout/reftests/{bugs => mathml}/393760-1.xml (100%) rename layout/reftests/{bugs => mathml}/393760-2-ref.xml (100%) rename layout/reftests/{bugs => mathml}/393760-2.xml (100%) rename layout/reftests/{bugs => mathml}/414123-ref.xhtml (100%) rename layout/reftests/{bugs => mathml}/414123.xhtml (100%) delete mode 100644 layout/reftests/mathml/dir-10-ref.html delete mode 100644 layout/reftests/mathml/dir-10.html delete mode 100644 layout/reftests/mathml/dir-11-ref.html delete mode 100644 layout/reftests/mathml/dir-11.html delete mode 100644 layout/reftests/mathml/dir-6-ref.html delete mode 100644 layout/reftests/mathml/dir-6.html delete mode 100644 layout/reftests/mathml/dir-7-ref.html delete mode 100644 layout/reftests/mathml/dir-7.html delete mode 100644 layout/reftests/mathml/dir-8-ref.html delete mode 100644 layout/reftests/mathml/dir-8.html delete mode 100644 layout/reftests/mathml/dir-9-ref.html delete mode 100644 layout/reftests/mathml/dir-9.html rename layout/reftests/native-theme/{470711-1-ref.xul => 470711-1-ref.xhtml} (100%) rename layout/reftests/native-theme/{470711-1.xul => 470711-1.xhtml} (100%) rename layout/reftests/native-theme/{482955-1-ref.xul => 482955-1-ref.xhtml} (100%) rename layout/reftests/native-theme/{482955-1.xul => 482955-1.xhtml} (100%) rename layout/reftests/native-theme/{676387-1-ref.xul => 676387-1-ref.xhtml} (100%) rename layout/reftests/native-theme/{676387-1.xul => 676387-1.xhtml} (100%) rename layout/reftests/native-theme/{blank-window.xul => blank-window.xhtml} (100%) rename layout/reftests/native-theme/{menulist-mirrored-when-rtl-ref.xul => menulist-mirrored-when-rtl-ref.xhtml} (100%) rename layout/reftests/native-theme/{menulist-mirrored-when-rtl.xul => menulist-mirrored-when-rtl.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomend-flipped.xul => resizer-bottomend-flipped.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomend-rtl.xul => resizer-bottomend-rtl.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomend.xul => resizer-bottomend.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomleft-rtl.xul => resizer-bottomleft-rtl.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomleft.xul => resizer-bottomleft.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomright-rtl.xul => resizer-bottomright-rtl.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomright.xul => resizer-bottomright.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomstart-rtl.xul => resizer-bottomstart-rtl.xhtml} (100%) rename layout/reftests/native-theme/{resizer-bottomstart.xul => resizer-bottomstart.xhtml} (100%) rename layout/reftests/native-theme/{resizer-left.xul => resizer-left.xhtml} (100%) rename layout/reftests/native-theme/{searchfield-mirrored-when-rtl-ref.xul => searchfield-mirrored-when-rtl-ref.xhtml} (72%) rename layout/reftests/native-theme/{searchfield-mirrored-when-rtl.xul => searchfield-mirrored-when-rtl.xhtml} (74%) rename layout/reftests/reftest-sanity/{test-async-ref.xul => test-async-ref.xhtml} (100%) rename layout/reftests/reftest-sanity/{test-async.xul => test-async.xhtml} (100%) delete mode 100644 layout/reftests/svg/moz-only/xbl-basic-01.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-basic-02.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-basic-02.xbl delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-01.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-02.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-02.xbl delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-03.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-04.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-binding-04.xbl delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-01.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-02.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-02.xbl delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-03.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-04.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-bound-04.xbl delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-resources-01.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-resources-02.svg delete mode 100644 layout/reftests/svg/moz-only/xbl-grad-ref--grad-in-resources-02.xbl delete mode 100644 layout/reftests/svg/svg-integration/mask-html-xbl-bound-01.html create mode 100644 layout/reftests/text-shadow/basic-negcoord-ref.xhtml delete mode 100644 layout/reftests/text-shadow/basic-negcoord-ref.xul create mode 100644 layout/reftests/text-shadow/basic-negcoord.xhtml delete mode 100644 layout/reftests/text-shadow/basic-negcoord.xul create mode 100644 layout/reftests/text-shadow/basic-ref.xhtml delete mode 100644 layout/reftests/text-shadow/basic-ref.xul create mode 100644 layout/reftests/text-shadow/basic.xhtml delete mode 100644 layout/reftests/text-shadow/basic.xul rename layout/reftests/text-shadow/{blur-notref.xul => blur-notref.xhtml} (100%) rename layout/reftests/text-shadow/{blur.xul => blur.xhtml} (100%) create mode 100644 layout/reftests/text-shadow/color-inherit-ref.xhtml delete mode 100644 layout/reftests/text-shadow/color-inherit-ref.xul create mode 100644 layout/reftests/text-shadow/color-inherit.xhtml delete mode 100644 layout/reftests/text-shadow/color-inherit.xul create mode 100644 layout/reftests/text-shadow/multiple-noblur-ref.xhtml delete mode 100644 layout/reftests/text-shadow/multiple-noblur-ref.xul create mode 100644 layout/reftests/text-shadow/multiple-noblur.xhtml delete mode 100644 layout/reftests/text-shadow/multiple-noblur.xul delete mode 100644 layout/reftests/usercss/usercss-xbl.html rename layout/reftests/xul-document-load/{reference-green-window.xul => reference-green-window.xhtml} (100%) rename layout/reftests/xul-document-load/{test003.xul => test003.xhtml} (100%) rename layout/reftests/xul-document-load/{test004.xul => test004.xhtml} (100%) rename layout/reftests/xul-document-load/{test005.xul => test005.xhtml} (100%) rename layout/reftests/xul-document-load/{test006.xul => test006.xhtml} (100%) rename layout/reftests/xul-document-load/{test008.xul => test008.xhtml} (100%) rename layout/reftests/xul-document-load/{test010.xul => test010.xhtml} (100%) rename layout/reftests/xul-document-load/{test012.xul => test012.xhtml} (100%) rename layout/reftests/xul-document-load/{test013.xul => test013.xhtml} (100%) rename layout/reftests/xul-document-load/{test022.xul => test022.xhtml} (100%) create mode 100644 layout/reftests/xul/accesskey-ref.xhtml delete mode 100644 layout/reftests/xul/accesskey-ref.xul create mode 100644 layout/reftests/xul/accesskey.xhtml delete mode 100644 layout/reftests/xul/accesskey.xul rename layout/reftests/xul/{blank-window.xul => blank-window.xhtml} (100%) rename layout/reftests/xul/{css-flex-1.xul => css-flex-1.xhtml} (100%) create mode 100644 layout/reftests/xul/css-grid-with-xul-item-1-ref.xhtml create mode 100644 layout/reftests/xul/css-grid-with-xul-item-1.xhtml rename layout/reftests/xul/{green-ref.xul => green-ref.xhtml} (100%) create mode 100644 layout/reftests/xul/image-appearance-dynamic-ref.xhtml create mode 100644 layout/reftests/xul/image-appearance-dynamic.xhtml rename layout/reftests/xul/{inactive-fixed-bg-bug1205630.xul => inactive-fixed-bg-bug1205630.xhtml} (100%) rename layout/reftests/xul/{inactive-fixed-bg-bug1272525.xul => inactive-fixed-bg-bug1272525.xhtml} (100%) rename layout/reftests/xul/{mac-tab-toolbar-ref.xul => mac-tab-toolbar-ref.xhtml} (100%) rename layout/reftests/xul/{mac-tab-toolbar.xul => mac-tab-toolbar.xhtml} (100%) rename layout/reftests/xul/{menuitem-key-ref.xul => menuitem-key-ref.xhtml} (100%) rename layout/reftests/xul/{menuitem-key.xul => menuitem-key.xhtml} (100%) rename layout/reftests/xul/{menulist-shrinkwrap-1-ref.xul => menulist-shrinkwrap-1-ref.xhtml} (92%) rename layout/reftests/xul/{menulist-shrinkwrap-1.xul => menulist-shrinkwrap-1.xhtml} (92%) rename layout/reftests/xul/{menulist-shrinkwrap-2-ref.xul => menulist-shrinkwrap-2-ref.xhtml} (100%) rename layout/reftests/xul/{menulist-shrinkwrap-2.xul => menulist-shrinkwrap-2.xhtml} (96%) rename layout/reftests/xul/{object-fit-contain-png-001.xul => object-fit-contain-png-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-png-002.xul => object-fit-contain-png-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-001.xul => object-fit-contain-svg-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-002.xul => object-fit-contain-svg-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-003.xul => object-fit-contain-svg-003.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-004.xul => object-fit-contain-svg-004.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-005.xul => object-fit-contain-svg-005.xhtml} (100%) rename layout/reftests/xul/{object-fit-contain-svg-006.xul => object-fit-contain-svg-006.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-png-001.xul => object-fit-cover-png-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-png-002.xul => object-fit-cover-png-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-001.xul => object-fit-cover-svg-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-002.xul => object-fit-cover-svg-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-003.xul => object-fit-cover-svg-003.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-004.xul => object-fit-cover-svg-004.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-005.xul => object-fit-cover-svg-005.xhtml} (100%) rename layout/reftests/xul/{object-fit-cover-svg-006.xul => object-fit-cover-svg-006.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-png-001.xul => object-fit-fill-png-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-png-002.xul => object-fit-fill-png-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-001.xul => object-fit-fill-svg-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-002.xul => object-fit-fill-svg-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-003.xul => object-fit-fill-svg-003.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-004.xul => object-fit-fill-svg-004.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-005.xul => object-fit-fill-svg-005.xhtml} (100%) rename layout/reftests/xul/{object-fit-fill-svg-006.xul => object-fit-fill-svg-006.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-png-001.xul => object-fit-none-png-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-png-002.xul => object-fit-none-png-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-001.xul => object-fit-none-svg-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-002.xul => object-fit-none-svg-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-003.xul => object-fit-none-svg-003.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-004.xul => object-fit-none-svg-004.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-005.xul => object-fit-none-svg-005.xhtml} (100%) rename layout/reftests/xul/{object-fit-none-svg-006.xul => object-fit-none-svg-006.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-png-001.xul => object-fit-scale-down-png-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-png-002.xul => object-fit-scale-down-png-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-001.xul => object-fit-scale-down-svg-001.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-002.xul => object-fit-scale-down-svg-002.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-003.xul => object-fit-scale-down-svg-003.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-004.xul => object-fit-scale-down-svg-004.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-005.xul => object-fit-scale-down-svg-005.xhtml} (100%) rename layout/reftests/xul/{object-fit-scale-down-svg-006.xul => object-fit-scale-down-svg-006.xhtml} (100%) rename layout/reftests/xul/{object-position-png-001.xul => object-position-png-001.xhtml} (100%) rename layout/reftests/xul/{object-position-png-002.xul => object-position-png-002.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomend-flipped.xul => resizer-bottomend-flipped.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomend-rtl.xul => resizer-bottomend-rtl.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomend.xul => resizer-bottomend.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomleft-rtl.xul => resizer-bottomleft-rtl.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomleft.xul => resizer-bottomleft.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomright-rtl.xul => resizer-bottomright-rtl.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomright.xul => resizer-bottomright.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomstart-rtl.xul => resizer-bottomstart-rtl.xhtml} (100%) rename layout/reftests/xul/{resizer-bottomstart.xul => resizer-bottomstart.xhtml} (100%) rename layout/reftests/xul/{resizer-left.xul => resizer-left.xhtml} (100%) delete mode 100644 layout/reftests/xul/stack-sizing-1-ref.xul delete mode 100644 layout/reftests/xul/stack-sizing-1.xul delete mode 100644 layout/reftests/xul/stack-sizing-2-ref.xul delete mode 100644 layout/reftests/xul/stack-sizing-2.xul rename layout/reftests/xul/{text-crop-ref.xul => text-crop-ref.xhtml} (97%) rename layout/reftests/xul/{text-crop.xul => text-crop.xhtml} (97%) rename layout/reftests/xul/{text-small-caps-1-ref.xul => text-small-caps-1-ref.xhtml} (90%) rename layout/reftests/xul/{text-small-caps-1.xul => text-small-caps-1.xhtml} (91%) rename layout/reftests/xul/{textbox-overflow-1-ref.xul => textbox-overflow-1-ref.xhtml} (94%) rename layout/reftests/xul/{textbox-overflow-1.xul => textbox-overflow-1.xhtml} (94%) rename layout/reftests/xul/{tree-row-outline-1-notref.xul => tree-row-outline-1-notref.xhtml} (100%) rename layout/reftests/xul/{tree-row-outline-1-ref.xul => tree-row-outline-1-ref.xhtml} (100%) rename layout/reftests/xul/{tree-row-outline-1.xul => tree-row-outline-1.xhtml} (100%) rename layout/reftests/xul/{treecell-image-svg-1-ref.xul => treecell-image-svg-1-ref.xhtml} (100%) rename layout/reftests/xul/{treecell-image-svg-1a.xul => treecell-image-svg-1a.xhtml} (100%) rename layout/reftests/xul/{treecell-image-svg-1b.xul => treecell-image-svg-1b.xhtml} (100%) rename layout/reftests/xul/{treechildren-padding-percent-1-ref.xul => treechildren-padding-percent-1-ref.xhtml} (100%) rename layout/reftests/xul/{treechildren-padding-percent-1.xul => treechildren-padding-percent-1.xhtml} (100%) rename layout/reftests/xul/{treetwisty-svg-context-paint-1-not-ref.xul => treetwisty-svg-context-paint-1-not-ref.xhtml} (100%) rename layout/reftests/xul/{treetwisty-svg-context-paint-1-ref.xul => treetwisty-svg-context-paint-1-ref.xhtml} (100%) rename layout/reftests/xul/{treetwisty-svg-context-paint-1.xul => treetwisty-svg-context-paint-1.xhtml} (100%) delete mode 100644 layout/style/crashtests/1370793-1.xhtml delete mode 100644 layout/style/crashtests/1517319.html rename layout/style/crashtests/{416461-1.xul => 416461-1.xhtml} (100%) rename layout/style/crashtests/{431705-1.xul => 431705-1.xhtml} (100%) rename layout/style/test/chrome/{bug535806-xul.xul => bug535806-xul.xhtml} (100%) rename layout/style/test/chrome/{test_bug1160724.xul => test_bug1160724.xhtml} (100%) rename layout/style/test/chrome/{test_bug418986-2.xul => test_bug418986-2.xhtml} (100%) rename layout/style/test/chrome/{test_bug535806.xul => test_bug535806.xhtml} (95%) create mode 100644 layout/style/test/test_hover_on_part.html delete mode 100644 layout/style/test/test_selectors_on_anonymous_content.html rename layout/svg/crashtests/{314244-1.xul => 314244-1.xhtml} (100%) rename layout/svg/crashtests/{337408-1.xul => 337408-1.xhtml} (100%) delete mode 100644 layout/svg/crashtests/386566-1.svg delete mode 100644 layout/svg/crashtests/409573-1.svg rename layout/tables/crashtests/{322779-1.xul => 322779-1.xhtml} (100%) create mode 100644 layout/tools/layout-debug/ui/content/layoutdebug-helper.js rename layout/tools/layout-debug/ui/content/{layoutdebug.xul => layoutdebug.xhtml} (86%) rename layout/tools/recording/{recording.xul => recording.xhtml} (100%) rename layout/tools/reftest/{reftest.xul => reftest.xhtml} (100%) delete mode 100644 layout/xul/BoxObject.cpp delete mode 100644 layout/xul/BoxObject.h rename layout/xul/crashtests/{131008-1.xul => 131008-1.xhtml} (100%) rename layout/xul/crashtests/{137216-1.xul => 137216-1.xhtml} (100%) delete mode 100644 layout/xul/crashtests/1379332-1.xul rename layout/xul/crashtests/{1379332-2.xul => 1379332-2.xhtml} (100%) rename layout/xul/crashtests/{151826-1.xul => 151826-1.xhtml} (100%) rename layout/xul/crashtests/{168724-1.xul => 168724-1.xhtml} (100%) rename layout/xul/crashtests/{189814-1.xul => 189814-1.xhtml} (100%) rename layout/xul/crashtests/{289410-1.xul => 289410-1.xhtml} (100%) rename layout/xul/crashtests/{291702-1.xul => 291702-1.xhtml} (100%) rename layout/xul/crashtests/{291702-2.xul => 291702-2.xhtml} (100%) rename layout/xul/crashtests/{291702-3.xul => 291702-3.xhtml} (100%) rename layout/xul/crashtests/{294371-1.xul => 294371-1.xhtml} (100%) rename layout/xul/crashtests/{322786-1.xul => 322786-1.xhtml} (100%) rename layout/xul/crashtests/{325377.xul => 325377.xhtml} (100%) rename layout/xul/crashtests/{326879-1.xul => 326879-1.xhtml} (90%) delete mode 100644 layout/xul/crashtests/328135-1.xul rename layout/xul/crashtests/{329327-1.xul => 329327-1.xhtml} (100%) rename layout/xul/crashtests/{336962-1.xul => 336962-1.xhtml} (100%) rename layout/xul/crashtests/{344228-1.xul => 344228-1.xhtml} (100%) rename layout/xul/crashtests/{350460.xul => 350460.xhtml} (100%) rename layout/xul/crashtests/{365151.xul => 365151.xhtml} (100%) rename layout/xul/crashtests/{366112-1.xul => 366112-1.xhtml} (100%) rename layout/xul/crashtests/{366203-1.xul => 366203-1.xhtml} (100%) rename layout/xul/crashtests/{374102-1.xul => 374102-1.xhtml} (100%) rename layout/xul/crashtests/{382746-1.xul => 382746-1.xhtml} (100%) rename layout/xul/crashtests/{382899-1.xul => 382899-1.xhtml} (100%) rename layout/xul/crashtests/{384105-1-inner.xul => 384105-1-inner.xhtml} (100%) rename layout/xul/crashtests/{384373-1.xul => 384373-1.xhtml} (100%) rename layout/xul/crashtests/{384373-2.xul => 384373-2.xhtml} (100%) rename layout/xul/crashtests/{384871-1-inner.xul => 384871-1-inner.xhtml} (100%) rename layout/xul/crashtests/{386642.xul => 386642.xhtml} (100%) delete mode 100644 layout/xul/crashtests/387033-1.xhtml rename layout/xul/crashtests/{387080-1.xul => 387080-1.xhtml} (100%) rename layout/xul/crashtests/{391974-1-inner.xul => 391974-1-inner.xhtml} (100%) rename layout/xul/crashtests/{399013.xul => 399013.xhtml} (100%) rename layout/xul/crashtests/{408904-1.xul => 408904-1.xhtml} (100%) rename layout/xul/crashtests/{417509.xul => 417509.xhtml} (100%) delete mode 100644 layout/xul/crashtests/452185.html delete mode 100644 layout/xul/crashtests/467080.xul rename layout/xul/crashtests/{538308-1.xul => 538308-1.xhtml} (93%) rename layout/xul/crashtests/{564705-1.xul => 564705-1.xhtml} (100%) rename layout/xul/grid/crashtests/{306911-grid-testcases.xul => 306911-grid-testcases.xhtml} (100%) rename layout/xul/grid/crashtests/{306911-grid-testcases2.xul => 306911-grid-testcases2.xhtml} (100%) rename layout/xul/grid/crashtests/{311710-1.xul => 311710-1.xhtml} (100%) rename layout/xul/grid/crashtests/{312784-1.xul => 312784-1.xhtml} (100%) rename layout/xul/grid/crashtests/{313173-1-inner.xul => 313173-1-inner.xhtml} (100%) rename layout/xul/grid/crashtests/{321066-1.xul => 321066-1.xhtml} (100%) rename layout/xul/grid/crashtests/{423802-crash.xul => 423802-crash.xhtml} (100%) delete mode 100644 layout/xul/grid/examples/borderedcolumns.xul delete mode 100644 layout/xul/grid/examples/borderedrowscolumns.xul delete mode 100644 layout/xul/grid/examples/borderedrowscolumns2.xul delete mode 100644 layout/xul/grid/examples/borderedrowscolumns3.xul delete mode 100644 layout/xul/grid/examples/bordermargincolumns1.xul delete mode 100644 layout/xul/grid/examples/collapsetest.xul delete mode 100644 layout/xul/grid/examples/divcolumngrid.xul delete mode 100644 layout/xul/grid/examples/divrowgrid.xul delete mode 100644 layout/xul/grid/examples/dynamicgrid.xul delete mode 100644 layout/xul/grid/examples/flexgroupgrid.xul delete mode 100644 layout/xul/grid/examples/javascriptappend.xul delete mode 100644 layout/xul/grid/examples/jumpygrid.xul delete mode 100644 layout/xul/grid/examples/nestedrows.xul delete mode 100644 layout/xul/grid/examples/rowspan.xul delete mode 100644 layout/xul/grid/examples/scrollingcolumns.xul delete mode 100644 layout/xul/grid/examples/scrollingrows.xul delete mode 100644 layout/xul/grid/examples/splitter.xul rename layout/xul/grid/reftests/{column-sizing-1-ref.xul => column-sizing-1-ref.xhtml} (81%) rename layout/xul/grid/reftests/{column-sizing-1.xul => column-sizing-1.xhtml} (83%) rename layout/xul/grid/reftests/{not-full-basic.xul => not-full-basic.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-grid-pack-align.xul => not-full-grid-pack-align.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-group-align.xul => not-full-row-group-align.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-group-direction.xul => not-full-row-group-direction.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-group-pack.xul => not-full-row-group-pack.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-leaf-align.xul => not-full-row-leaf-align.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-leaf-direction.xul => not-full-row-leaf-direction.xhtml} (100%) rename layout/xul/grid/reftests/{not-full-row-leaf-pack.xul => not-full-row-leaf-pack.xhtml} (100%) rename layout/xul/grid/reftests/{row-or-column-sizing-1.xul => row-or-column-sizing-1.xhtml} (83%) rename layout/xul/grid/reftests/{row-or-column-sizing-2.xul => row-or-column-sizing-2.xhtml} (84%) rename layout/xul/grid/reftests/{row-or-column-sizing-3.xul => row-or-column-sizing-3.xhtml} (86%) rename layout/xul/grid/reftests/{row-or-column-sizing-4.xul => row-or-column-sizing-4.xhtml} (86%) rename layout/xul/grid/reftests/{row-sizing-1-ref.xul => row-sizing-1-ref.xhtml} (82%) rename layout/xul/grid/reftests/{row-sizing-1.xul => row-sizing-1.xhtml} (83%) rename layout/xul/grid/reftests/{scrollable-columns.xul => scrollable-columns.xhtml} (100%) rename layout/xul/grid/reftests/{scrollable-rows.xul => scrollable-rows.xhtml} (100%) rename layout/xul/grid/reftests/{sizing-2d-ref.xul => sizing-2d-ref.xhtml} (100%) rename layout/xul/grid/reftests/{sizing-2d.xul => sizing-2d.xhtml} (100%) rename layout/xul/grid/reftests/{z-order-1-ref.xul => z-order-1-ref.xhtml} (100%) rename layout/xul/grid/reftests/{z-order-1.xul => z-order-1.xhtml} (100%) rename layout/xul/grid/reftests/{z-order-2-ref.xul => z-order-2-ref.xhtml} (100%) rename layout/xul/grid/reftests/{z-order-2.xul => z-order-2.xhtml} (100%) delete mode 100644 layout/xul/nsIBoxObject.idl delete mode 100644 layout/xul/nsPIBoxObject.h delete mode 100644 layout/xul/nsStackFrame.cpp delete mode 100644 layout/xul/nsStackFrame.h rename layout/xul/reftest/{checkbox-dynamic-change-ref.xul => checkbox-dynamic-change-ref.xhtml} (100%) rename layout/xul/reftest/{checkbox-dynamic-change.xul => checkbox-dynamic-change.xhtml} (100%) rename layout/xul/reftest/{image-scaling-min-height-1-ref.xul => image-scaling-min-height-1-ref.xhtml} (100%) rename layout/xul/reftest/{image-scaling-min-height-1.xul => image-scaling-min-height-1.xhtml} (100%) rename layout/xul/reftest/{image-size-ref.xul => image-size-ref.xhtml} (100%) rename layout/xul/reftest/{image-size.xul => image-size.xhtml} (100%) rename layout/xul/reftest/{popup-explicit-size-ref.xul => popup-explicit-size-ref.xhtml} (100%) rename layout/xul/reftest/{popup-explicit-size.xul => popup-explicit-size.xhtml} (100%) rename layout/xul/reftest/{radio-dynamic-change-ref.xul => radio-dynamic-change-ref.xhtml} (100%) rename layout/xul/reftest/{radio-dynamic-change.xul => radio-dynamic-change.xhtml} (100%) delete mode 100644 layout/xul/reftest/textbox-multiline-ref.xul rename layout/xul/reftest/{textbox-text-transform-ref.xul => textbox-text-transform-ref.xhtml} (100%) rename layout/xul/reftest/{textbox-text-transform.xul => textbox-text-transform.xhtml} (100%) rename layout/xul/test/{test_bug1197913.xul => test_bug1197913.xhtml} (100%) rename layout/xul/test/{test_bug159346.xul => test_bug159346.xhtml} (100%) rename layout/xul/test/{test_bug372685.xul => test_bug372685.xhtml} (100%) rename layout/xul/test/{test_bug393970.xul => test_bug393970.xhtml} (100%) rename layout/xul/test/{test_bug398982-1.xul => test_bug398982-1.xhtml} (100%) rename layout/xul/test/{test_bug398982-2.xul => test_bug398982-2.xhtml} (100%) rename layout/xul/test/{test_bug467442.xul => test_bug467442.xhtml} (100%) rename layout/xul/test/{test_bug477754.xul => test_bug477754.xhtml} (100%) rename layout/xul/test/{test_bug703150.xul => test_bug703150.xhtml} (100%) rename layout/xul/test/{test_bug987230.xul => test_bug987230.xhtml} (93%) rename layout/xul/test/{test_popupReflowPos.xul => test_popupReflowPos.xhtml} (100%) rename layout/xul/test/{test_popupSizeTo.xul => test_popupSizeTo.xhtml} (100%) rename layout/xul/test/{test_popupZoom.xul => test_popupZoom.xhtml} (100%) rename layout/xul/test/{test_resizer.xul => test_resizer.xhtml} (91%) rename layout/xul/test/{test_resizer_incontent.xul => test_resizer_incontent.xhtml} (91%) create mode 100644 layout/xul/test/test_splitter.xhtml delete mode 100644 layout/xul/test/test_splitter.xul delete mode 100644 layout/xul/test/test_stack.xul rename layout/xul/test/{test_submenuClose.xul => test_submenuClose.xhtml} (100%) rename layout/xul/test/{test_windowminmaxsize.xul => test_windowminmaxsize.xhtml} (94%) rename layout/xul/test/{titledpanelwindow.xul => titledpanelwindow.xhtml} (100%) rename layout/xul/test/{window_resizer.xul => window_resizer.xhtml} (95%) rename layout/xul/test/{window_resizer_element.xul => window_resizer_element.xhtml} (100%) rename layout/xul/test/{windowminmaxsize1.xul => windowminmaxsize1.xhtml} (100%) rename layout/xul/test/{windowminmaxsize10.xul => windowminmaxsize10.xhtml} (100%) rename layout/xul/test/{windowminmaxsize2.xul => windowminmaxsize2.xhtml} (100%) rename layout/xul/test/{windowminmaxsize3.xul => windowminmaxsize3.xhtml} (100%) rename layout/xul/test/{windowminmaxsize4.xul => windowminmaxsize4.xhtml} (100%) rename layout/xul/test/{windowminmaxsize5.xul => windowminmaxsize5.xhtml} (100%) rename layout/xul/test/{windowminmaxsize6.xul => windowminmaxsize6.xhtml} (100%) rename layout/xul/test/{windowminmaxsize7.xul => windowminmaxsize7.xhtml} (100%) rename layout/xul/test/{windowminmaxsize8.xul => windowminmaxsize8.xhtml} (100%) rename layout/xul/test/{windowminmaxsize9.xul => windowminmaxsize9.xhtml} (100%) rename layout/xul/tree/crashtests/{307298-1.xul => 307298-1.xhtml} (100%) rename layout/xul/tree/crashtests/{309732-1.xul => 309732-1.xhtml} (100%) rename layout/xul/tree/crashtests/{309732-2.xul => 309732-2.xhtml} (100%) rename layout/xul/tree/crashtests/{366583-1.xul => 366583-1.xhtml} (100%) rename layout/xul/tree/crashtests/{380217-1.xul => 380217-1.xhtml} (100%) rename layout/xul/tree/crashtests/{391178-2.xul => 391178-2.xhtml} (100%) rename layout/xul/tree/crashtests/{393665-1.xul => 393665-1.xhtml} (100%) rename layout/xul/tree/crashtests/{399227-1.xul => 399227-1.xhtml} (100%) rename layout/xul/tree/crashtests/{409807-1.xul => 409807-1.xhtml} (100%) rename layout/xul/tree/crashtests/{414170-1.xul => 414170-1.xhtml} (100%) delete mode 100644 layout/xul/tree/crashtests/430394-1.xul rename layout/xul/tree/crashtests/{585815-iframe.xul => 585815-iframe.xhtml} (100%) delete mode 100644 layout/xul/tree/crashtests/730441-1.xul delete mode 100644 layout/xul/tree/crashtests/730441-2.xul rename layout/xul/tree/crashtests/{730441-3.xul => 730441-3.xhtml} (100%) diff --git a/layout/base/FrameProperties.h b/layout/base/FrameProperties.h index 0853a37256..308b989a0a 100644 --- a/layout/base/FrameProperties.h +++ b/layout/base/FrameProperties.h @@ -62,7 +62,7 @@ struct FramePropertyDescriptorUntyped { template struct FramePropertyDescriptor : public FramePropertyDescriptorUntyped { typedef void Destructor(T* aPropertyValue); - typedef void DestructorWithFrame(const nsIFrame* aaFrame, T* aPropertyValue); + typedef void DestructorWithFrame(const nsIFrame* aFrame, T* aPropertyValue); template static constexpr const FramePropertyDescriptor NewWithDestructor() { @@ -96,9 +96,9 @@ struct FramePropertyDescriptor : public FramePropertyDescriptorUntyped { }; // SmallValueHolder is a placeholder intended to be used as template -// argument of FramePropertyDescriptor for types which can fit into the -// size of a pointer directly. This class should never be defined, so -// that we won't use it for unexpected purpose by mistake. +// argument of FramePropertyDescriptor for types which can fit directly into our +// internal value slot (i.e. types that can fit in 64 bits). This class should +// never be defined, so that we won't use it for unexpected purpose by mistake. template class SmallValueHolder; @@ -119,12 +119,6 @@ struct FramePropertyTypeHelper> { * The FrameProperties class is optimized for storing 0 or 1 properties on * a given frame. Storing very large numbers of properties on a single * frame will not be efficient. - * - * Property values are passed as void* but do not actually have to be - * valid pointers. You can use NS_INT32_TO_PTR/NS_PTR_TO_INT32 to - * store int32_t values. Null/zero values can be stored and retrieved. - * Of course, the destructor function (if any) must handle such values - * correctly. */ class FrameProperties { public: @@ -154,8 +148,8 @@ class FrameProperties { template void Set(Descriptor aProperty, PropertyType aValue, const nsIFrame* aFrame) { - void* ptr = ReinterpretHelper::ToPointer(aValue); - SetInternal(aProperty, ptr, aFrame); + uint64_t v = ReinterpretHelper::ToInternalValue(aValue); + SetInternal(aProperty, v, aFrame); } /** @@ -164,8 +158,8 @@ class FrameProperties { template void Add(Descriptor aProperty, PropertyType aValue) { MOZ_ASSERT(!Has(aProperty), "duplicate frame property"); - void* ptr = ReinterpretHelper::ToPointer(aValue); - AddInternal(aProperty, ptr); + uint64_t v = ReinterpretHelper::ToInternalValue(aValue); + AddInternal(aProperty, v); } /** @@ -207,8 +201,8 @@ class FrameProperties { template PropertyType Get(Descriptor aProperty, bool* aFoundResult = nullptr) const { - void* ptr = GetInternal(aProperty, aFoundResult); - return ReinterpretHelper::FromPointer(ptr); + uint64_t v = GetInternal(aProperty, aFoundResult); + return ReinterpretHelper::FromInternalValue(v); } /** @@ -224,8 +218,8 @@ class FrameProperties { */ template PropertyType Take(Descriptor aProperty, bool* aFoundResult = nullptr) { - void* ptr = TakeInternal(aProperty, aFoundResult); - return ReinterpretHelper::FromPointer(ptr); + uint64_t v = TakeInternal(aProperty, aFoundResult); + return ReinterpretHelper::FromInternalValue(v); } /** @@ -282,62 +276,63 @@ class FrameProperties { FrameProperties(const FrameProperties&) = delete; FrameProperties& operator=(const FrameProperties&) = delete; - inline void SetInternal(UntypedDescriptor aProperty, void* aValue, + inline void SetInternal(UntypedDescriptor aProperty, uint64_t aValue, const nsIFrame* aFrame); - inline void AddInternal(UntypedDescriptor aProperty, void* aValue); + inline void AddInternal(UntypedDescriptor aProperty, uint64_t aValue); - inline void* GetInternal(UntypedDescriptor aProperty, - bool* aFoundResult) const; + inline uint64_t GetInternal(UntypedDescriptor aProperty, + bool* aFoundResult) const; - inline void* TakeInternal(UntypedDescriptor aProperty, bool* aFoundResult); + inline uint64_t TakeInternal(UntypedDescriptor aProperty, bool* aFoundResult); inline void RemoveInternal(UntypedDescriptor aProperty, const nsIFrame* aFrame); template struct ReinterpretHelper { - static_assert(sizeof(PropertyType) <= sizeof(void*), - "size of the value must never be larger than a pointer"); + static_assert(sizeof(PropertyType) <= sizeof(uint64_t), + "size of the value must never be larger than 64 bits"); - static void* ToPointer(PropertyType aValue) { - void* ptr = nullptr; - memcpy(&ptr, &aValue, sizeof(aValue)); - return ptr; + static uint64_t ToInternalValue(PropertyType aValue) { + uint64_t v = 0; + memcpy(&v, &aValue, sizeof(aValue)); + return v; } - static PropertyType FromPointer(void* aPtr) { + static PropertyType FromInternalValue(uint64_t aInternalValue) { PropertyType value; - memcpy(&value, &aPtr, sizeof(value)); + memcpy(&value, &aInternalValue, sizeof(value)); return value; } }; - template - struct ReinterpretHelper { - static void* ToPointer(T* aValue) { return static_cast(aValue); } - - static T* FromPointer(void* aPtr) { return static_cast(aPtr); } - }; - /** * Stores a property descriptor/value pair. */ struct PropertyValue { - PropertyValue() : mProperty(nullptr), mValue(nullptr) {} - PropertyValue(UntypedDescriptor aProperty, void* aValue) + PropertyValue() : mProperty(nullptr), mValue(0) {} + PropertyValue(UntypedDescriptor aProperty, uint64_t aValue) : mProperty(aProperty), mValue(aValue) {} + // NOTE: This function converts our internal 64-bit-integer representation + // to a pointer-type representation. This is lossy on 32-bit systems, but it + // should be fine, as long as we *only* do this in cases where we're sure + // that the stored property-value is in fact a pointer. And we should have + // that assurance, since only pointer-typed frame properties are expected to + // have a destructor void DestroyValueFor(const nsIFrame* aFrame) { if (mProperty->mDestructor) { - mProperty->mDestructor(mValue); + mProperty->mDestructor( + ReinterpretHelper::FromInternalValue(mValue)); } else if (mProperty->mDestructorWithFrame) { - mProperty->mDestructorWithFrame(aFrame, mValue); + mProperty->mDestructorWithFrame( + aFrame, ReinterpretHelper::FromInternalValue(mValue)); } } UntypedDescriptor mProperty; - void* mValue; + uint64_t mValue; }; /** @@ -360,28 +355,29 @@ class FrameProperties { nsTArray mProperties; }; -inline void* FrameProperties::GetInternal(UntypedDescriptor aProperty, - bool* aFoundResult) const { +inline uint64_t FrameProperties::GetInternal(UntypedDescriptor aProperty, + bool* aFoundResult) const { MOZ_ASSERT(aProperty, "Null property?"); return mProperties.ApplyIf( aProperty, 0, PropertyComparator(), - [&aFoundResult](const PropertyValue& aPV) -> void* { + [&aFoundResult](const PropertyValue& aPV) -> uint64_t { if (aFoundResult) { *aFoundResult = true; } return aPV.mValue; }, - [&aFoundResult]() -> void* { + [&aFoundResult]() -> uint64_t { if (aFoundResult) { *aFoundResult = false; } - return nullptr; + return 0; }); } inline void FrameProperties::SetInternal(UntypedDescriptor aProperty, - void* aValue, const nsIFrame* aFrame) { + uint64_t aValue, + const nsIFrame* aFrame) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aProperty, "Null property?"); @@ -395,15 +391,15 @@ inline void FrameProperties::SetInternal(UntypedDescriptor aProperty, } inline void FrameProperties::AddInternal(UntypedDescriptor aProperty, - void* aValue) { + uint64_t aValue) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aProperty, "Null property?"); mProperties.AppendElement(PropertyValue(aProperty, aValue)); } -inline void* FrameProperties::TakeInternal(UntypedDescriptor aProperty, - bool* aFoundResult) { +inline uint64_t FrameProperties::TakeInternal(UntypedDescriptor aProperty, + bool* aFoundResult) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aProperty, "Null property?"); @@ -412,14 +408,14 @@ inline void* FrameProperties::TakeInternal(UntypedDescriptor aProperty, if (aFoundResult) { *aFoundResult = false; } - return nullptr; + return 0; } if (aFoundResult) { *aFoundResult = true; } - void* result = mProperties.Elements()[index].mValue; + uint64_t result = mProperties.Elements()[index].mValue; mProperties.RemoveElementAt(index); return result; diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 4511b8c1a8..b12fab0e3b 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -197,7 +197,6 @@ #include "mozilla/StyleSheetInlines.h" #include "mozilla/dom/ImageTracker.h" #include "nsIDocShellTreeOwner.h" -#include "nsBindingManager.h" #include "nsClassHashtable.h" #include "nsHashKeys.h" #include "VisualViewport.h" @@ -1729,20 +1728,6 @@ void PresShell::EndObservingDocument() { char* nsPresShell_ReflowStackPointerTop; #endif -class XBLConstructorRunner : public Runnable { - public: - explicit XBLConstructorRunner(Document* aDocument) - : Runnable("XBLConstructorRunner"), mDocument(aDocument) {} - - NS_IMETHOD Run() override { - mDocument->BindingManager()->ProcessAttachedQueue(); - return NS_OK; - } - - private: - RefPtr mDocument; -}; - nsresult PresShell::Initialize() { if (mIsDestroying) { return NS_OK; @@ -1810,10 +1795,6 @@ nsresult PresShell::Initialize() { // content object down mFrameConstructor->ContentInserted( root, nsCSSFrameConstructor::InsertionKind::Sync); - // Run the XBL binding constructors for any new frames we've constructed. - // (Do this in a script runner, since our caller might have a script - // blocker on the stack.) - nsContentUtils::AddScriptRunner(new XBLConstructorRunner(mDocument)); } // Something in mFrameConstructor->ContentInserted may have caused // Destroy() to get called, bug 337586. Or, nsAutoCauseReflowNotifier @@ -2085,18 +2066,10 @@ void PresShell::FireResizeEvent() { } static nsIContent* GetNativeAnonymousSubtreeRoot(nsIContent* aContent) { - if (!aContent || !aContent->IsInNativeAnonymousSubtree()) { + if (!aContent) { return nullptr; } - auto* current = aContent; - // FIXME(emilio): This should not need to worry about current being null, but - // editor removes nodes in native anonymous subtrees, and we don't clean nodes - // from the current event content stack from ContentRemoved, so it can - // actually happen, see bug 1510208. - while (current && !current->IsRootOfNativeAnonymousSubtree()) { - current = current->GetFlattenedTreeParent(); - } - return current; + return aContent->GetClosestNativeAnonymousSubtreeRoot(); } void PresShell::NativeAnonymousContentRemoved(nsIContent* aAnonContent) { @@ -2881,9 +2854,10 @@ void PresShell::SlotAssignmentWillChange(Element& aElement, return; } - // If the old slot is about to become empty, let layout know that it needs to - // do work. - if (aOldSlot && aOldSlot->AssignedNodes().Length() == 1) { + // If the old slot is about to become empty and show fallback, let layout know + // that it needs to do work. + if (aOldSlot && aOldSlot->AssignedNodes().Length() == 1 && + aOldSlot->HasChildren()) { DestroyFramesForAndRestyle(aOldSlot); } @@ -2894,7 +2868,7 @@ void PresShell::SlotAssignmentWillChange(Element& aElement, if (aNewSlot) { // If the new slot will stop showing fallback content, we need to reframe it // altogether. - if (aNewSlot->AssignedNodes().IsEmpty()) { + if (aNewSlot->AssignedNodes().IsEmpty() && aNewSlot->HasChildren()) { DestroyFramesForAndRestyle(aNewSlot); // Otherwise we just care about the element, but we need to ensure that // something takes care of traversing to the relevant slot, if needed. @@ -2916,21 +2890,6 @@ static void AssertNoFramesInSubtree(nsIContent* aContent) { for (nsINode* node : ShadowIncludingTreeIterator(*aContent)) { nsIContent* c = nsIContent::FromNode(node); MOZ_ASSERT(!c->GetPrimaryFrame()); - if (auto* binding = c->GetXBLBinding()) { - if (auto* bindingWithContent = binding->GetBindingWithContent()) { - nsIContent* anonContent = bindingWithContent->GetAnonymousContent(); - MOZ_ASSERT(!anonContent->GetPrimaryFrame()); - - // Need to do this instead of just AssertNoFramesInSubtree(anonContent), - // because the parent of the children of the element isn't the - // element, but the bound element, and that confuses - // GetNextNode a lot. - for (nsIContent* child = anonContent->GetFirstChild(); child; - child = child->GetNextSibling()) { - AssertNoFramesInSubtree(child); - } - } - } } } #endif @@ -3164,7 +3123,7 @@ nsresult PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll, // Now focus the document itself if focus is on an element within it. nsPIDOMWindowOuter* win = mDocument->GetWindow(); - nsIFocusManager* fm = nsFocusManager::GetFocusManager(); + nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm && win) { nsCOMPtr focusedWindow; fm->GetFocusedWindow(getter_AddRefs(focusedWindow)); @@ -3287,7 +3246,7 @@ static void AccumulateFrameBounds(nsIFrame* aContainerFrame, nsIFrame* aFrame, // We can't use nsRect::UnionRect since it drops empty rects on // the floor, and we need to include them. (Thus we need // aHaveRect to know when to drop the initial value on the floor.) - aRect.UnionRectEdges(aRect, transformedBounds); + aRect = aRect.UnionEdges(transformedBounds); } else { aHaveRect = true; aRect = transformedBounds; @@ -4130,13 +4089,6 @@ void PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) { mPresContext->RestyleManager()->ProcessPendingRestyles(); } - // Process whatever XBL constructors those restyles queued up. This - // ensures that onload doesn't fire too early and that we won't do extra - // reflows after those constructors run. - if (MOZ_LIKELY(!mIsDestroying)) { - mDocument->BindingManager()->ProcessAttachedQueue(); - } - // Now those constructors or events might have posted restyle // events. At the same time, we still need up-to-date style data. // In particular, reflow depends on style being completely up to @@ -6339,7 +6291,7 @@ PresShell::GetFocusedDOMWindowInOurWindow() { } already_AddRefed PresShell::GetFocusedContentInOurWindow() const { - nsIFocusManager* fm = nsFocusManager::GetFocusManager(); + nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm && mDocument) { RefPtr focusedElement; fm->GetFocusedElementForWindow(mDocument->GetWindow(), false, nullptr, @@ -10060,7 +10012,6 @@ bool PresShell::VerifyIncrementalReflow() { nsAutoCauseReflowNotifier crNotifier(this); presShell->Initialize(); } - mDocument->BindingManager()->ProcessAttachedQueue(); presShell->FlushPendingNotifications(FlushType::Layout); presShell->SetVerifyReflowEnable( true); // turn on verify reflow again now that diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index e2978270a4..d56ecdd2f9 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -560,7 +560,6 @@ nsCString RestyleManager::ChangeHintToString(nsChangeHint aHint) { "UpdateBackgroundPosition", "AddOrRemoveTransform", "ScrollbarChange", - "UpdateWidgetProperties", "UpdateTableCellSpans", "VisibilityChange"}; static_assert(nsChangeHint_AllHints == @@ -1739,9 +1738,6 @@ void RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) { presContext->PresShell()->SynthesizeMouseMove(false); didUpdateCursor = true; } - if (hint & nsChangeHint_UpdateWidgetProperties) { - frame->UpdateWidgetProperties(); - } if (hint & nsChangeHint_UpdateTableCellSpans) { frameConstructor->UpdateTableCellSpans(content); } @@ -3111,7 +3107,6 @@ static void VerifyFlatTree(const nsIContent& aContent) { for (auto* content = iter.GetNextChild(); content; content = iter.GetNextChild()) { MOZ_ASSERT(content->GetFlattenedTreeParentNodeForStyle() == &aContent); - MOZ_ASSERT(!content->IsActiveChildrenElement()); VerifyFlatTree(*content); } } @@ -3311,8 +3306,8 @@ static inline bool AttributeChangeRequiresSubtreeRestyle( return aElement.IsHTMLElement(nsGkAtoms::table); } if (aAttr == nsGkAtoms::lwtheme || aAttr == nsGkAtoms::lwthemetextcolor) { - return aElement.GetNameSpaceID() == kNameSpaceID_XUL && - &aElement == aElement.OwnerDoc()->GetRootElement(); + Document* doc = aElement.OwnerDoc(); + return doc->IsInChromeDocShell() && &aElement == doc->GetRootElement(); } // TODO(emilio, bug 1598094): Maybe finer-grained invalidation for exportparts // attribute changes? diff --git a/layout/base/crashtests/1162813.xul b/layout/base/crashtests/1162813.xhtml similarity index 100% rename from layout/base/crashtests/1162813.xul rename to layout/base/crashtests/1162813.xhtml diff --git a/layout/base/crashtests/1423216.html b/layout/base/crashtests/1423216.html deleted file mode 100644 index a3ffe146f7..0000000000 --- a/layout/base/crashtests/1423216.html +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/layout/base/crashtests/288790-1-inner.xhtml b/layout/base/crashtests/288790-1-inner.xhtml deleted file mode 100644 index 15351dcffd..0000000000 --- a/layout/base/crashtests/288790-1-inner.xhtml +++ /dev/null @@ -1,47 +0,0 @@ - - -Testcase bug 288790 - Crash [@ GetNearestContainingBlock] with this xbl testcase - - - - - - - - - - - - - - -
- - - -
-Clicking on the above button two times, should not crash Mozilla. - - diff --git a/layout/base/crashtests/288790-1.html b/layout/base/crashtests/288790-1.html deleted file mode 100644 index de707506d1..0000000000 --- a/layout/base/crashtests/288790-1.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/layout/base/crashtests/311661-1.xul b/layout/base/crashtests/311661-1.xhtml similarity index 100% rename from layout/base/crashtests/311661-1.xul rename to layout/base/crashtests/311661-1.xhtml diff --git a/layout/base/crashtests/311661-2.xul b/layout/base/crashtests/311661-2.xhtml similarity index 100% rename from layout/base/crashtests/311661-2.xul rename to layout/base/crashtests/311661-2.xhtml diff --git a/layout/base/crashtests/321058-1.xul b/layout/base/crashtests/321058-1.xhtml similarity index 100% rename from layout/base/crashtests/321058-1.xul rename to layout/base/crashtests/321058-1.xhtml diff --git a/layout/base/crashtests/321058-2.xul b/layout/base/crashtests/321058-2.xhtml similarity index 100% rename from layout/base/crashtests/321058-2.xul rename to layout/base/crashtests/321058-2.xhtml diff --git a/layout/base/crashtests/321077-1.xul b/layout/base/crashtests/321077-1.xhtml similarity index 100% rename from layout/base/crashtests/321077-1.xul rename to layout/base/crashtests/321077-1.xhtml diff --git a/layout/base/crashtests/321077-2.xul b/layout/base/crashtests/321077-2.xhtml similarity index 100% rename from layout/base/crashtests/321077-2.xul rename to layout/base/crashtests/321077-2.xhtml diff --git a/layout/base/crashtests/325218.xul b/layout/base/crashtests/325218.xhtml similarity index 100% rename from layout/base/crashtests/325218.xul rename to layout/base/crashtests/325218.xhtml diff --git a/layout/base/crashtests/328944-1.xul b/layout/base/crashtests/328944-1.xhtml similarity index 100% rename from layout/base/crashtests/328944-1.xul rename to layout/base/crashtests/328944-1.xhtml diff --git a/layout/base/crashtests/336999-1.xul b/layout/base/crashtests/336999-1.xhtml similarity index 100% rename from layout/base/crashtests/336999-1.xul rename to layout/base/crashtests/336999-1.xhtml diff --git a/layout/base/crashtests/337476-1.xul b/layout/base/crashtests/337476-1.xhtml similarity index 100% rename from layout/base/crashtests/337476-1.xul rename to layout/base/crashtests/337476-1.xhtml diff --git a/layout/base/crashtests/340093-1.xul b/layout/base/crashtests/340093-1.xhtml similarity index 100% rename from layout/base/crashtests/340093-1.xul rename to layout/base/crashtests/340093-1.xhtml diff --git a/layout/base/crashtests/344340-1.xul b/layout/base/crashtests/344340-1.xhtml similarity index 100% rename from layout/base/crashtests/344340-1.xul rename to layout/base/crashtests/344340-1.xhtml diff --git a/layout/base/crashtests/350128-1.xhtml b/layout/base/crashtests/350128-1.xhtml deleted file mode 100644 index 1e4ff70fea..0000000000 --- a/layout/base/crashtests/350128-1.xhtml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - -
I - - - diff --git a/layout/base/crashtests/356325-1.xul b/layout/base/crashtests/356325-1.xhtml similarity index 100% rename from layout/base/crashtests/356325-1.xul rename to layout/base/crashtests/356325-1.xhtml diff --git a/layout/base/crashtests/360339-1.xul b/layout/base/crashtests/360339-1.xhtml similarity index 100% rename from layout/base/crashtests/360339-1.xul rename to layout/base/crashtests/360339-1.xhtml diff --git a/layout/base/crashtests/360339-2.xul b/layout/base/crashtests/360339-2.xhtml similarity index 100% rename from layout/base/crashtests/360339-2.xul rename to layout/base/crashtests/360339-2.xhtml diff --git a/layout/base/crashtests/374193-1.xhtml b/layout/base/crashtests/374193-1.xhtml deleted file mode 100644 index b567f97c00..0000000000 --- a/layout/base/crashtests/374193-1.xhtml +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/layout/base/crashtests/374193-1xbl.xml b/layout/base/crashtests/374193-1xbl.xml deleted file mode 100644 index c1d2883525..0000000000 --- a/layout/base/crashtests/374193-1xbl.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - this.style.position='fixed'; - - - - - diff --git a/layout/base/crashtests/379105-1.xhtml b/layout/base/crashtests/379105-1.xhtml deleted file mode 100644 index e20cced169..0000000000 --- a/layout/base/crashtests/379105-1.xhtml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - -
- - diff --git a/layout/base/crashtests/379920-1.svg b/layout/base/crashtests/379920-1.svg deleted file mode 100644 index 6021e7e00a..0000000000 --- a/layout/base/crashtests/379920-1.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/layout/base/crashtests/379920-2.svg b/layout/base/crashtests/379920-2.svg deleted file mode 100644 index 71289c17b5..0000000000 --- a/layout/base/crashtests/379920-2.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/layout/base/crashtests/379975.html b/layout/base/crashtests/379975.html deleted file mode 100644 index 280fe7e96c..0000000000 --- a/layout/base/crashtests/379975.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Crash - - - diff --git a/layout/base/crashtests/393326-1-binding.xml b/layout/base/crashtests/393326-1-binding.xml deleted file mode 100644 index ca76a33893..0000000000 --- a/layout/base/crashtests/393326-1-binding.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/layout/base/crashtests/393326-1.html b/layout/base/crashtests/393326-1.html deleted file mode 100644 index 6a79f0077b..0000000000 --- a/layout/base/crashtests/393326-1.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -
- -
- - - - - diff --git a/layout/base/crashtests/393326-2.html b/layout/base/crashtests/393326-2.html deleted file mode 100644 index 820da45b53..0000000000 --- a/layout/base/crashtests/393326-2.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - -
- -
- - - - - diff --git a/layout/base/crashtests/394014-1-iframe.html b/layout/base/crashtests/394014-1-iframe.html deleted file mode 100644 index 1d87c68d3e..0000000000 --- a/layout/base/crashtests/394014-1-iframe.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/394014-1-inner.html b/layout/base/crashtests/394014-1-inner.html deleted file mode 100644 index 9262bf12da..0000000000 --- a/layout/base/crashtests/394014-1-inner.html +++ /dev/null @@ -1,10 +0,0 @@ - -Testcase bug 394014 - Crash [@ NS_ProcessNextEvent_P] with DOMSubtreeModified removing windows, binding and other stuff - - - - - - diff --git a/layout/base/crashtests/394014-1.html b/layout/base/crashtests/394014-1.html deleted file mode 100644 index 5338fcd5e2..0000000000 --- a/layout/base/crashtests/394014-1.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - diff --git a/layout/base/crashtests/394014-2-binding.xml b/layout/base/crashtests/394014-2-binding.xml deleted file mode 100644 index d9f481dcba..0000000000 --- a/layout/base/crashtests/394014-2-binding.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/394014-2-constructor.xml b/layout/base/crashtests/394014-2-constructor.xml deleted file mode 100644 index a5b48fcb9e..0000000000 --- a/layout/base/crashtests/394014-2-constructor.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - window.frameElement.parentNode.removeChild(window.frameElement); - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/394014-2-constructordestructor.xml b/layout/base/crashtests/394014-2-constructordestructor.xml deleted file mode 100644 index 0c571a6617..0000000000 --- a/layout/base/crashtests/394014-2-constructordestructor.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - window.frameElement.parentNode.removeChild(window.frameElement); - - - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/394014-2-crash.html b/layout/base/crashtests/394014-2-crash.html deleted file mode 100644 index c16fec0a87..0000000000 --- a/layout/base/crashtests/394014-2-crash.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/394014-2.html b/layout/base/crashtests/394014-2.html deleted file mode 100644 index 52933bf1f4..0000000000 --- a/layout/base/crashtests/394014-2.html +++ /dev/null @@ -1,7 +0,0 @@ - -Testcase bug 394014 - Crash [@ NS_ProcessNextEvent_P] with DOMSubtreeModified removing windows, binding and other stuff - -tt - - - diff --git a/layout/base/crashtests/399946-1.xhtml b/layout/base/crashtests/399946-1.xhtml deleted file mode 100644 index 1632130d05..0000000000 --- a/layout/base/crashtests/399946-1.xhtml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/layout/base/crashtests/401589-1.xul b/layout/base/crashtests/401589-1.xhtml similarity index 100% rename from layout/base/crashtests/401589-1.xul rename to layout/base/crashtests/401589-1.xhtml diff --git a/layout/base/crashtests/404218-1.xhtml b/layout/base/crashtests/404218-1.xhtml deleted file mode 100644 index e1b7c683f4..0000000000 --- a/layout/base/crashtests/404218-1.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/layout/base/crashtests/405049-1.xul b/layout/base/crashtests/405049-1.xhtml similarity index 100% rename from layout/base/crashtests/405049-1.xul rename to layout/base/crashtests/405049-1.xhtml diff --git a/layout/base/crashtests/405184-1.xhtml b/layout/base/crashtests/405184-1.xhtml deleted file mode 100644 index fcddd28321..0000000000 --- a/layout/base/crashtests/405184-1.xhtml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - -
- -
-
-
-
- - - - -
- - - diff --git a/layout/base/crashtests/405186-1.xhtml b/layout/base/crashtests/405186-1.xhtml deleted file mode 100644 index ec08eab704..0000000000 --- a/layout/base/crashtests/405186-1.xhtml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -
- -
-
-
-
- - - - - - - - - - -
- - - - diff --git a/layout/base/crashtests/421203-1.xul b/layout/base/crashtests/421203-1.xhtml similarity index 100% rename from layout/base/crashtests/421203-1.xul rename to layout/base/crashtests/421203-1.xhtml diff --git a/layout/base/crashtests/429780-1.xhtml b/layout/base/crashtests/429780-1.xhtml deleted file mode 100644 index 7754cb5d71..0000000000 --- a/layout/base/crashtests/429780-1.xhtml +++ /dev/null @@ -1,4 +0,0 @@ - - - -X
diff --git a/layout/base/crashtests/444925-1.xul b/layout/base/crashtests/444925-1.xhtml similarity index 100% rename from layout/base/crashtests/444925-1.xul rename to layout/base/crashtests/444925-1.xhtml diff --git a/layout/base/crashtests/454751-1.xul b/layout/base/crashtests/454751-1.xhtml similarity index 100% rename from layout/base/crashtests/454751-1.xul rename to layout/base/crashtests/454751-1.xhtml diff --git a/layout/base/crashtests/468546-1.xhtml b/layout/base/crashtests/468546-1.xhtml deleted file mode 100644 index af2340b1a8..0000000000 --- a/layout/base/crashtests/468546-1.xhtml +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
A BCDE
- - - - -
- - diff --git a/layout/base/crashtests/468645-1.xhtml b/layout/base/crashtests/468645-1.xhtml deleted file mode 100644 index 76e5e29fb4..0000000000 --- a/layout/base/crashtests/468645-1.xhtml +++ /dev/null @@ -1,17 +0,0 @@ - - -
- - - -
- - - - - - - - - - diff --git a/layout/base/crashtests/468645-2.xhtml b/layout/base/crashtests/468645-2.xhtml deleted file mode 100644 index 9405086578..0000000000 --- a/layout/base/crashtests/468645-2.xhtml +++ /dev/null @@ -1,13 +0,0 @@ - - -
- - - - - - - - - - diff --git a/layout/base/crashtests/471594-1.xhtml b/layout/base/crashtests/471594-1.xhtml deleted file mode 100644 index 16ccdb056e..0000000000 --- a/layout/base/crashtests/471594-1.xhtml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - 2! - - - - - - -
- diff --git a/layout/base/crashtests/491547-1.xul b/layout/base/crashtests/491547-1.xhtml similarity index 100% rename from layout/base/crashtests/491547-1.xul rename to layout/base/crashtests/491547-1.xhtml diff --git a/layout/base/crashtests/491547-2.xul b/layout/base/crashtests/491547-2.xhtml similarity index 100% rename from layout/base/crashtests/491547-2.xul rename to layout/base/crashtests/491547-2.xhtml diff --git a/layout/base/crashtests/497519-1.xhtml b/layout/base/crashtests/497519-1.xhtml deleted file mode 100644 index ee4130053d..0000000000 --- a/layout/base/crashtests/497519-1.xhtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - -
-
- - - - - - - -
- -
text
- text - -
- - - diff --git a/layout/base/crashtests/497519-2.xhtml b/layout/base/crashtests/497519-2.xhtml deleted file mode 100644 index 5a08a6688b..0000000000 --- a/layout/base/crashtests/497519-2.xhtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - -
-
- - - - - - - - diff --git a/layout/base/crashtests/497519-3.xhtml b/layout/base/crashtests/497519-3.xhtml deleted file mode 100644 index 035563f45a..0000000000 --- a/layout/base/crashtests/497519-3.xhtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - -
-
- - - - - - - - diff --git a/layout/base/crashtests/497519-4.xhtml b/layout/base/crashtests/497519-4.xhtml deleted file mode 100644 index 2dfbaf77ef..0000000000 --- a/layout/base/crashtests/497519-4.xhtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - -
-
- - - - - - - - diff --git a/layout/base/crashtests/526378-1.xul b/layout/base/crashtests/526378-1.xhtml similarity index 100% rename from layout/base/crashtests/526378-1.xul rename to layout/base/crashtests/526378-1.xhtml diff --git a/layout/base/crashtests/536623-1.xhtml b/layout/base/crashtests/536623-1.xhtml deleted file mode 100644 index b01e6a018f..0000000000 --- a/layout/base/crashtests/536623-1.xhtml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - -
- - diff --git a/layout/base/crashtests/536720.xul b/layout/base/crashtests/536720.xhtml similarity index 100% rename from layout/base/crashtests/536720.xul rename to layout/base/crashtests/536720.xhtml diff --git a/layout/base/crashtests/537059-1.xhtml b/layout/base/crashtests/537059-1.xhtml deleted file mode 100644 index 16e0ab6746..0000000000 --- a/layout/base/crashtests/537059-1.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - -
AB
- - diff --git a/layout/base/crashtests/537141-1.xhtml b/layout/base/crashtests/537141-1.xhtml deleted file mode 100644 index c9b3a7abae..0000000000 --- a/layout/base/crashtests/537141-1.xhtml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/layout/base/crashtests/537141.xml b/layout/base/crashtests/537141.xml deleted file mode 100644 index 5e9ee84452..0000000000 --- a/layout/base/crashtests/537141.xml +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/layout/base/crashtests/538082-1.xul b/layout/base/crashtests/538082-1.xhtml similarity index 100% rename from layout/base/crashtests/538082-1.xul rename to layout/base/crashtests/538082-1.xhtml diff --git a/layout/base/crashtests/540760.xul b/layout/base/crashtests/540760.xhtml similarity index 100% rename from layout/base/crashtests/540760.xul rename to layout/base/crashtests/540760.xhtml diff --git a/layout/base/crashtests/559705.xhtml b/layout/base/crashtests/559705.xhtml deleted file mode 100644 index 7f58978eca..0000000000 --- a/layout/base/crashtests/559705.xhtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/layout/base/crashtests/560441-1.xhtml b/layout/base/crashtests/560441-1.xhtml deleted file mode 100644 index bc3b6b5037..0000000000 --- a/layout/base/crashtests/560441-1.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/layout/base/crashtests/567292-1.xhtml b/layout/base/crashtests/567292-1.xhtml deleted file mode 100644 index 46801170d0..0000000000 --- a/layout/base/crashtests/567292-1.xhtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - diff --git a/layout/base/crashtests/572003.xul b/layout/base/crashtests/572003.xhtml similarity index 100% rename from layout/base/crashtests/572003.xul rename to layout/base/crashtests/572003.xhtml diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list index decf3688e7..d58275e756 100644 --- a/layout/base/crashtests/crashtests.list +++ b/layout/base/crashtests/crashtests.list @@ -57,29 +57,28 @@ load 280708-2.html load 281333-1.html load 285212-1.html load 286813-1.html -load 288790-1.html load 306940-1.html load 310267-1.xml load 310638-1.svg load 310638-2.html -load 311661-1.xul -load 311661-2.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/311661-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/311661-2.xhtml load 313086-1.xml load 317285-1.html load 317934-1.html load 320459-1.html -load 321058-1.xul -load 321058-2.xul -load 321077-1.xul -load 321077-2.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/321058-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/321058-2.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/321077-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/321077-2.xhtml load 322436-1.html load 322678.html load 325024.html -load 325218.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/325218.xhtml load 325967-1.html load 325984-1.xhtml load 325984-2.html -load 328944-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/328944-1.xhtml load 329900-1.html load 330015-1.html load 331204-1.html @@ -89,14 +88,14 @@ load 331679-3.xml load 331883-1.html load 335140-1.html load 336291-1.html -load 336999-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/336999-1.xhtml load 337066-1.xhtml load 337268-1.html load 337419-1.html -load 337476-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/337476-1.xhtml load 338703-1.html load 339651-1.html -load 340093-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/340093-1.xhtml load 341382-1.html load 341382-2.html load 341858-1.html @@ -108,23 +107,22 @@ load 344057-1.xhtml load 344064-1.html load 344300-1.html load 344300-2.html -load 344340-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/344340-1.xhtml load 347898-1.html load 348126-1.html load 348688-1.html load 348708-1.xhtml load 348729-1.html load 349095-1.xhtml -load 350128-1.xhtml load 350267-1.html load 354133-1.html load 354766-1.xhtml load 355989-1.xhtml load 355993-1.xhtml -load 356325-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/356325-1.xhtml load 358729-1.xhtml -load 360339-1.xul -load 360339-2.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/360339-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/360339-2.xhtml load 363729-1.html load 363729-2.html load 363729-3.html @@ -146,17 +144,12 @@ load 372237-1.html load 372475-1.xhtml load 372550-1.html load 373628-1.html -load 374193-1.xhtml load 374297-1.html load 374297-2.html load 378325-1.html load 378682.html -load 379105-1.xhtml load 379419-1.xhtml load 379799-1.html -load 379920-1.svg -load 379920-2.svg -load 379975.html load 380096-1.html load 382204-1.html # bug 1323680 load 383129-1.html @@ -173,12 +166,8 @@ load 387195-1.html load 387195-2.xhtml load 388715-1.html load 390976-1.html -load 393326-1.html -load 393326-2.html load 393661-1.html load 393801-1.html -load 394014-1.html -load 394014-2.html load 394150-1.xhtml load 397011-1.xhtml load 398510-1.xhtml @@ -190,12 +179,11 @@ load 399365-1.html load 399676-1.xhtml load 399687-1.html load 399940-1.xhtml -load 399946-1.xhtml load 399951-1.html load 399994-1.html load 400445-1.xhtml load 400904-1.xhtml -load 401589-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/401589-1.xhtml load 401734-1.html load 401734-2.html needs-focus pref(accessibility.browsewithcaret,true) load 403048.html @@ -205,13 +193,10 @@ load 403454.html load 403569-1.xhtml load 403569-2.xhtml load 403569-3.xhtml -load 404218-1.xhtml load 404491-1.html load 404721-1.xhtml load 404721-2.xhtml -load 405049-1.xul -load 405184-1.xhtml -load 405186-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/405049-1.xhtml load 406675-1.html load 408292.html load 408299.html @@ -229,7 +214,7 @@ load 420031-1.html load 420213-1.html load 420219-1.html load 420651-1.xhtml -load 421203-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/421203-1.xhtml load 421432.html load 422276.html asserts(0-1) load 423107-1.xhtml # bug 866955 @@ -238,7 +223,6 @@ load 428138-1.html load 428448-1.html load 429088-1.html load 429088-2.html -load 429780-1.xhtml load 429865-1.html load 429881.html load 430569-1.html @@ -250,7 +234,7 @@ load 437142-1.html load 439258-1.html load 439343.html load 444863-1.html -load 444925-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/444925-1.xhtml load 444967-1.html load 446328.html load 448488-1.html @@ -259,7 +243,7 @@ load 448543-2.html load 448543-3.html load 450319-1.xhtml asserts(1) asserts-if(Android,2) load 453894-1.xhtml # Bug 398043 -load 454751-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/454751-1.xhtml load 455063-1.html load 455063-2.html load 455063-3.html @@ -272,19 +256,15 @@ load 462392.html load 466763-1.html load 467881-1.html load 468491-1.html -load 468546-1.xhtml load 468555-1.xhtml load 468563-1.html load 468578-1.xhtml # These three didn't actually crash without the resizing that the # browser does when setting up print preview, but adding them anyway. -load 468645-1.xhtml -load 468645-2.xhtml load 468645-3.xhtml load 469861-1.xhtml load 469861-2.xhtml load 470851-1.xhtml -load 471594-1.xhtml asserts-if(Android&&!asyncPan,1-2) load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test) asserts(0-5) load 474075.html # bug 847368 load 477333-1.xhtml @@ -301,17 +281,13 @@ load 489691.html load 490376-1.xhtml load 490559-1.html load 490747.html -load 491547-1.xul -load 491547-2.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/491547-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/491547-2.xhtml load 492014.xhtml load 492112-1.xhtml load 492163-1.xhtml load 495350-1.html load 496011-1.xhtml -load 497519-1.xhtml -load 497519-2.xhtml -load 497519-3.xhtml -load 497519-4.xhtml load 499741-1.xhtml load 499841-1.xhtml load 499858-1.xhtml @@ -321,37 +297,31 @@ load 503936-1.html skip-if(Android&&AndroidVersion<21) load 507119.html load 522374-1.html load 522374-2.html -load 526378-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/526378-1.xhtml load 534367-1.xhtml load 534368-1.xhtml load 534768-1.html load 534768-2.html load 535721-1.xhtml load 535911-1.xhtml -load 536623-1.xhtml -load 536720.xul -load 537059-1.xhtml -load 537141-1.xhtml +load chrome://reftest/content/crashtests/layout/base/crashtests/536720.xhtml load 537562-1.xhtml load 537624-1.html load 537631-1.html -load 538082-1.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/538082-1.xhtml load 538207-1.xhtml load 538210-1.html load 538267-1.html -load 540760.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/540760.xhtml load 540771-1.xhtml load 541869-1.xhtml load 541869-2.html load 543648-1.html -load 559705.xhtml -load 560441-1.xhtml load 560447-1.html load 564063-1.html -load 567292-1.xhtml load 569018-1.html pref(layout.css.xul-display-values.content.enabled,true) load 570038-1.html -load 572003.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/572003.xhtml load 572582-1.xhtml load 576649-1.html load 579655.html @@ -462,7 +432,7 @@ load 1140198.html load 1143535.html load 1153716.html load 1156588.html -load 1162813.xul +load chrome://reftest/content/crashtests/layout/base/crashtests/1162813.xhtml load 1163583.html load 1234622-1.html load 1235467-1.html @@ -512,7 +482,6 @@ load 1419762.html load 1419802.html load 1420533.html load 1422908.html -load 1423216.html load 1425893.html load 1425959.html load 1428353.html diff --git a/layout/base/moz.build b/layout/base/moz.build index 0d2b41cfb0..a7f236be9c 100644 --- a/layout/base/moz.build +++ b/layout/base/moz.build @@ -48,7 +48,6 @@ EXPORTS += [ 'nsFrameTraversal.h', 'nsGenConList.h', 'nsIFrameTraversal.h', - 'nsILayoutDebugger.h', 'nsIPercentBSizeObserver.h', 'nsIReflowCallback.h', 'nsLayoutUtils.h', @@ -156,7 +155,6 @@ LOCAL_INCLUDES += [ '/dom/base', '/dom/html', '/dom/svg', - '/dom/xbl', '/dom/xul', '/view', ] diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index d38f7458e2..9d88444e74 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -50,7 +50,6 @@ #include "nsStyleConsts.h" #ifdef MOZ_XUL # include "nsXULElement.h" -# include "mozilla/dom/BoxObject.h" #endif // MOZ_XUL #include "nsContainerFrame.h" #include "nsNameSpaceManager.h" @@ -62,8 +61,6 @@ #include "nsCSSAnonBoxes.h" #include "nsTextFragment.h" #include "nsIAnonymousContentCreator.h" -#include "nsBindingManager.h" -#include "nsXBLBinding.h" #include "nsContentUtils.h" #include "nsIScriptError.h" #ifdef XP_MACOSX @@ -115,8 +112,6 @@ # include "nsAccessibilityService.h" #endif -#include "nsXBLService.h" - #undef NOISY_FIRST_LETTER #include "nsMathMLParts.h" @@ -211,7 +206,6 @@ static FrameCtorDebugFlags gFlags[] = { # include "nsMenuFrame.h" # include "nsPopupSetFrame.h" # include "nsTreeColFrame.h" -# include "nsIBoxObject.h" # include "nsXULLabelFrame.h" //------------------------------------------------------------------ @@ -226,8 +220,6 @@ nsIFrame* NS_NewDeckFrame(PresShell* aPresShell, ComputedStyle* aStyle); nsIFrame* NS_NewLeafBoxFrame(PresShell* aPresShell, ComputedStyle* aStyle); -nsIFrame* NS_NewStackFrame(PresShell* aPresShell, ComputedStyle* aStyle); - nsIFrame* NS_NewRangeFrame(PresShell* aPresShell, ComputedStyle* aStyle); nsIFrame* NS_NewImageBoxFrame(PresShell* aPresShell, ComputedStyle* aStyle); @@ -652,18 +644,6 @@ class MOZ_STACK_CLASS nsFrameConstructorSaveState { friend class nsFrameConstructorState; }; -// Structure used to keep track of a list of bindings we need to call -// AddToAttachedQueue on. These should be in post-order depth-first -// flattened tree traversal order. -struct PendingBinding : public LinkedListElement { -#ifdef NS_BUILD_REFCNT_LOGGING - PendingBinding() { MOZ_COUNT_CTOR(PendingBinding); } - ~PendingBinding() { MOZ_COUNT_DTOR(PendingBinding); } -#endif - - RefPtr mBinding; -}; - // Structure used for maintaining state information during the // frame construction process class MOZ_STACK_CLASS nsFrameConstructorState { @@ -817,45 +797,6 @@ class MOZ_STACK_CLASS nsFrameConstructorState { return mFixedPosIsAbsPos ? mAbsoluteList : mFixedList; } - /** - * class to automatically push and pop a pending binding in the frame - * constructor state. See nsCSSFrameConstructor::FrameConstructionItem - * mPendingBinding documentation. - */ - class PendingBindingAutoPusher; - friend class PendingBindingAutoPusher; - class MOZ_STACK_CLASS PendingBindingAutoPusher { - public: - PendingBindingAutoPusher(nsFrameConstructorState& aState, - PendingBinding* aPendingBinding) - : mState(aState), - mPendingBinding(aState.mCurrentPendingBindingInsertionPoint) { - if (aPendingBinding) { - aState.mCurrentPendingBindingInsertionPoint = aPendingBinding; - } - } - - ~PendingBindingAutoPusher() { - mState.mCurrentPendingBindingInsertionPoint = mPendingBinding; - } - - private: - nsFrameConstructorState& mState; - PendingBinding* mPendingBinding; - }; - - /** - * Add a new pending binding to the list - */ - void AddPendingBinding(UniquePtr aPendingBinding) { - if (mCurrentPendingBindingInsertionPoint) { - mCurrentPendingBindingInsertionPoint->setPrevious( - aPendingBinding.release()); - } else { - mPendingBindings.insertBack(aPendingBinding.release()); - } - } - protected: friend class nsFrameConstructorSaveState; @@ -881,12 +822,6 @@ class MOZ_STACK_CLASS nsFrameConstructorState { nsFrameState* aPlaceholderType); void ConstructBackdropFrameFor(nsIContent* aContent, nsIFrame* aFrame); - - // Our list of all pending bindings. When we're done, we need to call - // AddToAttachedQueue on all of them, in order. - LinkedList mPendingBindings; - - PendingBinding* mCurrentPendingBindingInsertionPoint; }; nsFrameConstructorState::nsFrameConstructorState( @@ -916,8 +851,7 @@ nsFrameConstructorState::nsFrameConstructorState( mFixedPosIsAbsPos(aFixedContainingBlock == aAbsoluteContainingBlock), mHavePendingPopupgroup(false), mCreatingExtraFrames(false), - mHasRenderedLegend(false), - mCurrentPendingBindingInsertionPoint(nullptr) { + mHasRenderedLegend(false) { #ifdef MOZ_XUL nsIPopupContainer* popupContainer = nsIPopupContainer::GetPopupContainer(aPresShell); @@ -943,15 +877,6 @@ nsFrameConstructorState::~nsFrameConstructorState() { for (auto& content : Reversed(mGeneratedContentWithInitializer)) { content->RemoveProperty(nsGkAtoms::genConInitializerProperty); } - if (!mPendingBindings.isEmpty()) { - nsBindingManager* bindingManager = - mPresShell->GetDocument()->BindingManager(); - do { - UniquePtr pendingBinding(mPendingBindings.popFirst()); - bindingManager->AddToAttachedQueue(pendingBinding->mBinding); - } while (!mPendingBindings.isEmpty()); - mCurrentPendingBindingInsertionPoint = nullptr; - } } void nsFrameConstructorState::ProcessFrameInsertionsForAllLists() { @@ -1612,7 +1537,7 @@ already_AddRefed nsCSSFrameConstructor::CreateGeneratedContent( } else { auto& counters = item.AsCounters(); name = counters._0.AsAtom(); - separator = NS_ConvertUTF8toUTF16(counters._1.AsString()); + CopyUTF8toUTF16(counters._1.AsString(), separator); ptr = CounterStylePtr::FromStyle(counters._2); } @@ -1963,7 +1888,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructTable(nsFrameConstructorState& aState, aItem.mFCData->mBits & FCDATA_IS_WRAPPER_ANON_BOX, childList); } else { ProcessChildren(aState, content, computedStyle, innerFrame, true, childList, - false, aItem.mPendingBinding); + false); } nsFrameList captionList; @@ -2036,7 +1961,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructTableRowOrRowGroup( aItem.mFCData->mBits & FCDATA_IS_WRAPPER_ANON_BOX, childList); } else { ProcessChildren(aState, content, computedStyle, newFrame, true, childList, - false, aItem.mPendingBinding); + false); } newFrame->SetInitialChildList(kPrincipalList, childList); @@ -2147,7 +2072,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructTableCell( } else { // Process the child content ProcessChildren(aState, content, computedStyle, cellInnerFrame, true, - childList, isBlock, aItem.mPendingBinding); + childList, isBlock); } cellInnerFrame->SetInitialChildList(kPrincipalList, childList); @@ -2271,37 +2196,6 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( const nsStyleDisplay* display = computedStyle->StyleDisplay(); - // Ensure that our XBL bindings are installed. - // - // FIXME(emilio): Can we remove support for bindings on the root? - if (display->mBinding.IsUrl()) { - // Get the XBL loader. - nsresult rv; - - nsXBLService* xblService = nsXBLService::GetInstance(); - if (!xblService) { - return nullptr; - } - - const auto& url = display->mBinding.AsUrl(); - - RefPtr binding; - rv = xblService->LoadBindings(aDocElement, url.GetURI(), - url.ExtraData().Principal(), - getter_AddRefs(binding)); - if (NS_FAILED(rv) && rv != NS_ERROR_XBL_BLOCKED) { - // Binding will load asynchronously. - return nullptr; - } - - if (binding) { - // For backwards compat, keep firing the root's constructor - // after all of its kids' constructors. So tell the binding - // manager about it right now. - mDocument->BindingManager()->AddToAttachedQueue(binding); - } - } - // --------- IF SCROLLABLE WRAP IN SCROLLFRAME -------- NS_ASSERTION(!display->IsScrollableOverflow() || @@ -2391,9 +2285,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( // FrameConstructionData/Item, then we'd need the right function // here... but would probably be able to get away with less code in this // function in general. - // Use a null PendingBinding, since our binding is not in fact pending. static const FrameConstructionData rootSVGData = FCDATA_DECL(0, nullptr); - AutoFrameConstructionItem item(this, &rootSVGData, aDocElement, nullptr, + AutoFrameConstructionItem item(this, &rootSVGData, aDocElement, do_AddRef(computedStyle), true); contentFrame = static_cast(ConstructOuterSVG( @@ -2428,9 +2321,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( // FrameConstructionData/Item, then we'd need the right function // here... but would probably be able to get away with less code in this // function in general. - // Use a null PendingBinding, since our binding is not in fact pending. static const FrameConstructionData rootTableData = FCDATA_DECL(0, nullptr); - AutoFrameConstructionItem item(this, &rootTableData, aDocElement, nullptr, + AutoFrameConstructionItem item(this, &rootTableData, aDocElement, do_AddRef(computedStyle), true); // if the document is a table then just populate it. @@ -2439,7 +2331,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( } else if (display->DisplayInside() == StyleDisplayInside::Ruby) { static const FrameConstructionData data = FULL_CTOR_FCDATA(0, &nsCSSFrameConstructor::ConstructBlockRubyFrame); - AutoFrameConstructionItem item(this, &data, aDocElement, nullptr, + AutoFrameConstructionItem item(this, &data, aDocElement, do_AddRef(computedStyle), true); contentFrame = static_cast(ConstructBlockRubyFrame( state, item, @@ -2450,13 +2342,12 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( display->mDisplay == StyleDisplay::FlowRoot, "Unhandled display type for root element"); contentFrame = NS_NewBlockFormattingContext(mPresShell, computedStyle); - // Use a null PendingBinding, since our binding is not in fact pending. ConstructBlock( state, aDocElement, state.GetGeometricParent(*display, mDocElementContainingBlock), mDocElementContainingBlock, computedStyle, &contentFrame, frameList, - display->IsAbsPosContainingBlock(contentFrame) ? contentFrame : nullptr, - nullptr); + display->IsAbsPosContainingBlock(contentFrame) ? contentFrame + : nullptr); } MOZ_ASSERT(frameList.FirstChild()); @@ -2488,9 +2379,8 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame( NS_ASSERTION(!contentFrame->IsBlockFrameOrSubclass() && !contentFrame->IsFrameOfType(nsIFrame::eSVG), "Only XUL frames should reach here"); - // Use a null PendingBinding, since our binding is not in fact pending. ProcessChildren(state, aDocElement, computedStyle, contentFrame, true, - childList, false, nullptr); + childList, false); // Set the initial child lists contentFrame->SetInitialChildList(kPrincipalList, childList); @@ -2660,9 +2550,19 @@ void nsCSSFrameConstructor::SetUpDocElementContainingBlock( isXUL = aDocElement->IsXULElement(); } - // Never create scrollbars for XUL documents - bool isScrollable = - isPaginated ? presContext->HasPaginatedScrolling() : !isXUL; + // Never create scrollbars for XUL documents or top level XHTML documents that + // disable scrolling. + bool isScrollable = true; + if (isPaginated) { + isScrollable = presContext->HasPaginatedScrolling(); + } else if (isXUL) { + isScrollable = false; + } else if (nsContentUtils::IsInChromeDocshell(aDocElement->OwnerDoc()) && + aDocElement->AsElement()->AttrValueIs( + kNameSpaceID_None, nsGkAtoms::scrolling, nsGkAtoms::_false, + eCaseMatters)) { + isScrollable = false; + } // We no longer need to do overflow propagation here. It's taken care of // when we construct frames for the element whose overflow might be @@ -2948,8 +2848,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructSelectFrame( NS_NewSelectsAreaFrame(mPresShell, computedStyle, flags); InitializeSelectFrame(aState, listFrame, scrolledFrame, content, - comboboxFrame, listStyle, true, aItem.mPendingBinding, - childList); + comboboxFrame, listStyle, true, childList); NS_ASSERTION(listFrame->GetView(), "ListFrame's view is nullptr"); @@ -3009,8 +2908,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructSelectFrame( // please adjust this code to use BuildScrollFrame. InitializeSelectFrame(aState, listFrame, scrolledFrame, content, aParentFrame, - computedStyle, false, aItem.mPendingBinding, - aFrameList); + computedStyle, false, aFrameList); return listFrame; } @@ -3024,8 +2922,7 @@ void nsCSSFrameConstructor::InitializeSelectFrame( nsFrameConstructorState& aState, nsContainerFrame* scrollFrame, nsContainerFrame* scrolledFrame, nsIContent* aContent, nsContainerFrame* aParentFrame, ComputedStyle* aComputedStyle, - bool aBuildCombobox, PendingBinding* aPendingBinding, - nsFrameList& aFrameList) { + bool aBuildCombobox, nsFrameList& aFrameList) { // Initialize it nsContainerFrame* geometricParent = aState.GetGeometricParent(*aComputedStyle->StyleDisplay(), aParentFrame); @@ -3052,7 +2949,7 @@ void nsCSSFrameConstructor::InitializeSelectFrame( nsFrameList childList; ProcessChildren(aState, aContent, aComputedStyle, scrolledFrame, false, - childList, false, aPendingBinding); + childList, false); // Set the scrolled frame's initial child lists scrolledFrame->SetInitialChildList(kPrincipalList, childList); @@ -3143,7 +3040,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructFieldSetFrame( AutoRestore savedHasRenderedLegend(aState.mHasRenderedLegend); aState.mHasRenderedLegend = false; ProcessChildren(aState, content, computedStyle, contentFrame, true, - childList, true, aItem.mPendingBinding); + childList, true); } nsFrameList fieldsetKids; fieldsetKids.AppendFrame(nullptr, @@ -3799,7 +3696,7 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal( ProcessChildren(aState, content, computedStyle, newFrameAsContainer, !(bits & FCDATA_DISALLOW_GENERATED_CONTENT), childList, (bits & FCDATA_ALLOW_BLOCK_STYLES) != 0, - aItem.mPendingBinding, possiblyLeafFrame); + possiblyLeafFrame); } if (bits & FCDATA_WRAP_KIDS_IN_BLOCKS) { @@ -4199,9 +4096,8 @@ already_AddRefed nsCSSFrameConstructor::BeginBuildingScrollFrame( // HTMLScrollFrame const nsStyleDisplay* displayStyle = aContentStyle->StyleDisplay(); if (displayStyle->IsXULDisplayStyle()) { - gfxScrollFrame = NS_NewXULScrollFrame( - mPresShell, contentStyle, aIsRoot, - displayStyle->mDisplay == StyleDisplay::MozStack); + gfxScrollFrame = + NS_NewXULScrollFrame(mPresShell, contentStyle, aIsRoot, false); } else { gfxScrollFrame = NS_NewHTMLScrollFrame(mPresShell, contentStyle, aIsRoot); } @@ -4446,8 +4342,7 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay& aDisplay, &nsCSSFrameConstructor::ConstructTableCell); return &data; } - case StyleDisplayInside::MozBox: - case StyleDisplayInside::MozInlineBox: { + case StyleDisplayInside::MozBox: { if (!aElement.IsInNativeAnonymousSubtree() && aElement.OwnerDoc()->IsContentDocument()) { aElement.OwnerDoc()->WarnOnceAbout(Document::eMozBoxOrInlineBoxDisplay); @@ -4534,11 +4429,6 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay& aDisplay, SCROLLABLE_XUL_FCDATA(NS_NewGridRowLeafFrame); return &data; } - case StyleDisplayInside::MozStack: { - static const FrameConstructionData data = - SCROLLABLE_XUL_FCDATA(NS_NewStackFrame); - return &data; - } case StyleDisplayInside::MozDeck: { static const FrameConstructionData data = SIMPLE_XUL_FCDATA(NS_NewDeckFrame); @@ -4592,8 +4482,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructScrollableBlockWithConstructor( ConstructBlock( aState, content, newFrame, newFrame, scrolledContentStyle, &scrolledFrame, blockList, - aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr, - aItem.mPendingBinding); + aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr); MOZ_ASSERT(blockList.OnlyChild() == scrolledFrame, "Scrollframe's frameList should be exactly the scrolled frame!"); @@ -4639,8 +4528,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructNonScrollableBlockWithConstructor( aState, aItem.mContent, aState.GetGeometricParent(*aDisplay, aParentFrame), aParentFrame, computedStyle, &newFrame, aFrameList, - aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr, - aItem.mPendingBinding); + aDisplay->IsAbsPosContainingBlock(newFrame) ? newFrame : nullptr); return newFrame; } @@ -4856,7 +4744,7 @@ nsContainerFrame* nsCSSFrameConstructor::ConstructFrameWithAnonymousChild( aItem.mFCData->mBits & FCDATA_IS_WRAPPER_ANON_BOX, childList); } else { ProcessChildren(aState, content, computedStyle, innerFrame, true, childList, - false, aItem.mPendingBinding); + false); } // Set the inner wrapper frame's initial primary list @@ -5138,8 +5026,8 @@ void nsCSSFrameConstructor::AddPageBreakItem( static const FrameConstructionData sPageBreakData = FCDATA_DECL(FCDATA_SKIP_FRAMESET, NS_NewPageBreakFrame); - aItems.AppendItem(this, &sPageBreakData, aContent, nullptr, - pseudoStyle.forget(), true); + aItems.AppendItem(this, &sPageBreakData, aContent, pseudoStyle.forget(), + true); } bool nsCSSFrameConstructor::ShouldCreateItemsForChild( @@ -5370,45 +5258,6 @@ nsCSSFrameConstructor::FindElementTagData(const Element& aElement, } } -nsCSSFrameConstructor::XBLBindingLoadInfo::XBLBindingLoadInfo( - UniquePtr aPendingBinding) - : mPendingBinding(std::move(aPendingBinding)), mSuccess(true) {} - -nsCSSFrameConstructor::XBLBindingLoadInfo::XBLBindingLoadInfo() = default; - -nsCSSFrameConstructor::XBLBindingLoadInfo -nsCSSFrameConstructor::LoadXBLBindingIfNeeded(nsIContent& aContent, - const ComputedStyle& aStyle, - ItemFlags aFlags) { - if (!aFlags.contains(ItemFlag::AllowPageBreak)) { - return XBLBindingLoadInfo(nullptr); - } - - const auto& binding = aStyle.StyleDisplay()->mBinding; - if (binding.IsNone()) { - return XBLBindingLoadInfo(nullptr); - } - - nsXBLService* xblService = nsXBLService::GetInstance(); - if (!xblService) { - return {}; - } - - auto newPendingBinding = MakeUnique(); - const auto& url = binding.AsUrl(); - nsresult rv = xblService->LoadBindings( - aContent.AsElement(), url.GetURI(), url.ExtraData().Principal(), - getter_AddRefs(newPendingBinding->mBinding)); - if (NS_FAILED(rv)) { - if (rv == NS_ERROR_XBL_BLOCKED) { - return XBLBindingLoadInfo(nullptr); - } - return {}; - } - - return XBLBindingLoadInfo(std::move(newPendingBinding)); -} - void nsCSSFrameConstructor::AddFrameConstructionItemsInternal( nsFrameConstructorState& aState, nsIContent* aContent, nsContainerFrame* aParentFrame, bool aSuppressWhiteSpaceOptimizations, @@ -5420,20 +5269,6 @@ void nsCSSFrameConstructor::AddFrameConstructionItemsInternal( MOZ_ASSERT(!aContent->GetPrimaryFrame() || aState.mCreatingExtraFrames || aContent->NodeInfo()->NameAtom() == nsGkAtoms::area); - PendingBinding* pendingBinding = nullptr; - { - XBLBindingLoadInfo xblInfo = - LoadXBLBindingIfNeeded(*aContent, *aComputedStyle, aFlags); - if (!xblInfo.mSuccess) { - return; - } - - if (xblInfo.mPendingBinding && xblInfo.mPendingBinding->mBinding) { - pendingBinding = xblInfo.mPendingBinding.get(); - aState.AddPendingBinding(std::move(xblInfo.mPendingBinding)); - } - } - const bool withinSVGText = aFlags.contains(ItemFlag::IsWithinSVGText); const bool isGeneratedContent = aFlags.contains(ItemFlag::IsGeneratedContent); MOZ_ASSERT(!isGeneratedContent || aComputedStyle->IsPseudoElement(), @@ -5477,7 +5312,7 @@ void nsCSSFrameConstructor::AddFrameConstructionItemsInternal( AddFrameConstructionItems(aState, child, aSuppressWhiteSpaceOptimizations, insertion, aItems, aFlags); } - aItems.SetParentHasNoXBLChildren(!iter.XBLInvolved()); + aItems.SetParentHasNoXBLChildren(!iter.ShadowDOMInvolved()); CreateGeneratedContentItem(aState, aParentFrame, *aContent->AsElement(), *aComputedStyle, PseudoStyleType::after, aItems); @@ -5553,15 +5388,13 @@ void nsCSSFrameConstructor::AddFrameConstructionItemsInternal( if (summary && summary->IsMainSummary()) { // If details is open, the main summary needs to be rendered as if it is // the first child, so add the item to the front of the item list. - item = aItems.PrependItem(this, data, aContent, pendingBinding, - do_AddRef(aComputedStyle), + item = aItems.PrependItem(this, data, aContent, do_AddRef(aComputedStyle), aSuppressWhiteSpaceOptimizations); } } if (!item) { - item = aItems.AppendItem(this, data, aContent, pendingBinding, - do_AddRef(aComputedStyle), + item = aItems.AppendItem(this, data, aContent, do_AddRef(aComputedStyle), aSuppressWhiteSpaceOptimizations); if (aFlags.contains(ItemFlag::IsForRenderedLegend)) { item->mIsRenderedLegend = true; @@ -5705,12 +5538,11 @@ void nsCSSFrameConstructor::ConstructFramesFromItem( const auto* disp = computedStyle->StyleDisplay(); MOZ_ASSERT(!disp->IsAbsolutelyPositionedStyle() || - (disp->mDisplay != StyleDisplay::MozBox && - disp->mDisplay != StyleDisplay::MozInlineBox), + disp->DisplayInside() != StyleDisplayInside::MozBox, "This may be a frame that was previously blockified " "but isn't any longer! It probably needs explicit " "'display:block' to preserve behavior"); - Unused << disp; // (unused in configs that define the assertion away) + Unused << disp; // (unused in configs that define the assertion away) if (item.mIsText) { // If this is collapsible whitespace next to a line boundary, @@ -6321,7 +6153,7 @@ nsIFrame* nsCSSFrameConstructor::GetInsertionPrevSibling( // XBL insertion point is involved, we'll need to use _that_ to find // the preceding frame. FlattenedChildIterator iter(aInsertion->mContainer); - if (iter.XBLInvolved() || !aChild->IsRootOfAnonymousSubtree()) { + if (iter.ShadowDOMInvolved() || !aChild->IsRootOfAnonymousSubtree()) { // The check for IsRootOfAnonymousSubtree() is because editor is // severely broken and calls us directly for native anonymous // nodes that it creates. @@ -6593,7 +6425,7 @@ nsCSSFrameConstructor::GetRangeInsertionPoint(nsIContent* aStartChild, // If the children of the container may be distributed to different insertion // points, insert them separately and bail out, letting ContentInserted handle // the mess. - if (parent->GetShadowRoot() || parent->GetXBLBinding()) { + if (parent->GetShadowRoot()) { IssueSingleInsertNofications(aStartChild, aEndChild, aInsertionKind); return {}; } @@ -6850,7 +6682,8 @@ void nsCSSFrameConstructor::ContentAppended(nsIContent* aFirstNewContent, LayoutFrameType frameType = parentFrame->Type(); FlattenedChildIterator iter(insertion.mContainer); - const bool haveNoXBLChildren = !iter.XBLInvolved() || !iter.GetNextChild(); + const bool haveNoXBLChildren = + !iter.ShadowDOMInvolved() || !iter.GetNextChild(); AutoFrameConstructionItemList items(this); if (aFirstNewContent->GetPreviousSibling() && @@ -7271,7 +7104,7 @@ void nsCSSFrameConstructor::ContentRangeInserted(nsIContent* aStartChild, AutoFrameConstructionItemList items(this); ParentType parentType = GetParentType(frameType); FlattenedChildIterator iter(insertion.mContainer); - bool haveNoXBLChildren = !iter.XBLInvolved() || !iter.GetNextChild(); + bool haveNoXBLChildren = !iter.ShadowDOMInvolved() || !iter.GetNextChild(); if (aStartChild->GetPreviousSibling() && parentType == eTypeBlock && haveNoXBLChildren) { // If there's a text node in the normal content list just before the @@ -7640,9 +7473,11 @@ bool nsCSSFrameConstructor::ContentRemoved(nsIContent* aChild, } #ifdef ACCESSIBILITY - if (nsAccessibilityService* accService = - PresShell::GetAccessibilityService()) { - accService->ContentRemoved(mPresShell, aChild); + if (aFlags != REMOVE_FOR_RECONSTRUCTION) { + if (nsAccessibilityService* accService = + PresShell::GetAccessibilityService()) { + accService->ContentRemoved(mPresShell, aChild); + } } #endif @@ -8925,12 +8760,10 @@ void nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems( FCDATA_IS_WRAPPER_ANON_BOX, NS_NewBlockFormattingContext); - FrameConstructionItem* newItem = - new (this) FrameConstructionItem(&sBlockFormattingContextFCData, - // Use the content of our parent frame - parentContent, - // no pending binding - nullptr, wrapperStyle.forget(), true); + FrameConstructionItem* newItem = new (this) + FrameConstructionItem(&sBlockFormattingContextFCData, + // Use the content of our parent frame + parentContent, wrapperStyle.forget(), true); newItem->mIsAllInline = newItem->mComputedStyle->StyleDisplay()->IsInlineOutsideStyle(); @@ -9407,12 +9240,10 @@ void nsCSSFrameConstructor::WrapItemsInPseudoParent( pseudoType); } - FrameConstructionItem* newItem = - new (this) FrameConstructionItem(&pseudoData.mFCData, - // Use the content of our parent frame - aParentContent, - // no pending binding - nullptr, wrapperStyle.forget(), true); + FrameConstructionItem* newItem = new (this) + FrameConstructionItem(&pseudoData.mFCData, + // Use the content of our parent frame + aParentContent, wrapperStyle.forget(), true); const nsStyleDisplay* disp = newItem->mComputedStyle->StyleDisplay(); // Here we're cheating a tad... technically, table-internal items should be @@ -9466,12 +9297,10 @@ void nsCSSFrameConstructor::CreateNeededPseudoSiblings( RefPtr pseudoStyle = mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle( pseudoData.mPseudoType, aParentFrame->Style()); - FrameConstructionItem* newItem = - new (this) FrameConstructionItem(&pseudoData.mFCData, - // Use the content of the parent frame - aParentFrame->GetContent(), - // no pending binding - nullptr, pseudoStyle.forget(), true); + FrameConstructionItem* newItem = new (this) FrameConstructionItem( + &pseudoData.mFCData, + // Use the content of the parent frame + aParentFrame->GetContent(), pseudoStyle.forget(), true); newItem->mIsAllInline = true; newItem->mChildItems.SetParentHasNoXBLChildren(true); iter.InsertItem(newItem); @@ -9640,8 +9469,7 @@ void nsCSSFrameConstructor::ProcessChildren( nsFrameConstructorState& aState, nsIContent* aContent, ComputedStyle* aComputedStyle, nsContainerFrame* aFrame, const bool aCanHaveGeneratedContent, nsFrameList& aFrameList, - const bool aAllowBlockStyles, PendingBinding* aPendingBinding, - nsIFrame* aPossiblyLeafFrame) { + const bool aAllowBlockStyles, nsIFrame* aPossiblyLeafFrame) { MOZ_ASSERT(aFrame, "Must have parent frame here"); MOZ_ASSERT(aFrame->GetContentInsertionFrame() == aFrame, "Parent frame in ProcessChildren should be its own " @@ -9679,9 +9507,6 @@ void nsCSSFrameConstructor::ProcessChildren( aState.PushFloatContainingBlock(aFrame, floatSaveState); } - nsFrameConstructorState::PendingBindingAutoPusher pusher(aState, - aPendingBinding); - AutoFrameConstructionItemList itemsToConstruct(this); // If we have first-letter or first-line style then frames can get @@ -9746,13 +9571,13 @@ void nsCSSFrameConstructor::ProcessChildren( MOZ_ASSERT(insertion.mContainer == GetInsertionPoint(child).mContainer, "GetInsertionPoint should agree with us"); if (addChildItems) { - AddFrameConstructionItems(aState, child, iter.XBLInvolved(), insertion, - itemsToConstruct); + AddFrameConstructionItems(aState, child, iter.ShadowDOMInvolved(), + insertion, itemsToConstruct); } else { ClearLazyBits(child, child->GetNextSibling()); } } - itemsToConstruct.SetParentHasNoXBLChildren(!iter.XBLInvolved()); + itemsToConstruct.SetParentHasNoXBLChildren(!iter.ShadowDOMInvolved()); if (aCanHaveGeneratedContent) { // Probe for generated content after @@ -10537,8 +10362,7 @@ void nsCSSFrameConstructor::ConstructBlock( nsFrameConstructorState& aState, nsIContent* aContent, nsContainerFrame* aParentFrame, nsContainerFrame* aContentParentFrame, ComputedStyle* aComputedStyle, nsContainerFrame** aNewFrame, - nsFrameList& aFrameList, nsIFrame* aPositionedFrameForAbsPosContainer, - PendingBinding* aPendingBinding) { + nsFrameList& aFrameList, nsIFrame* aPositionedFrameForAbsPosContainer) { // clang-format off // // If a block frame is in a multi-column subtree, its children may need to @@ -10664,7 +10488,7 @@ void nsCSSFrameConstructor::ConstructBlock( // Process the child content nsFrameList childList; ProcessChildren(aState, aContent, aComputedStyle, blockFrame, true, childList, - true, aPendingBinding); + true); if (!MayNeedToCreateColumnSpanSiblings(blockFrame, childList)) { // No need to create column-span siblings. @@ -11199,11 +11023,6 @@ void nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState, void nsCSSFrameConstructor::BuildInlineChildItems( nsFrameConstructorState& aState, FrameConstructionItem& aParentItem, bool aItemIsWithinSVGText, bool aItemAllowsTextPathChild) { - // XXXbz should we preallocate aParentItem.mChildItems to some sane - // length? Maybe even to parentContent->GetChildCount()? - nsFrameConstructorState::PendingBindingAutoPusher pusher( - aState, aParentItem.mPendingBinding); - ComputedStyle* const parentComputedStyle = aParentItem.mComputedStyle; nsIContent* const parentContent = aParentItem.mContent; @@ -11231,7 +11050,7 @@ void nsCSSFrameConstructor::BuildInlineChildItems( FlattenedChildIterator iter(parentContent); for (nsIContent* content = iter.GetNextChild(); content; content = iter.GetNextChild()) { - AddFrameConstructionItems(aState, content, iter.XBLInvolved(), + AddFrameConstructionItems(aState, content, iter.ShadowDOMInvolved(), InsertionPoint(), aParentItem.mChildItems, flags); } @@ -11801,11 +11620,8 @@ void nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame) { nsAutoScriptBlocker scriptBlocker; nsFrameList childList; nsFrameConstructorState state(mPresShell, nullptr, nullptr, nullptr); - // We don't have a parent frame with a pending binding constructor here, - // so no need to worry about ordering of the kids' constructors with it. - // Pass null for the PendingBinding. ProcessChildren(state, aFrame->GetContent(), aFrame->Style(), aFrame, false, - childList, false, nullptr); + childList, false); aFrame->SetInitialChildList(kPrincipalList, childList); } @@ -11818,9 +11634,6 @@ void nsCSSFrameConstructor::GenerateChildFrames(nsContainerFrame* aFrame) { } } #endif - - // call XBL constructors after the frames are created - mPresShell->GetDocument()->BindingManager()->ProcessAttachedQueue(); } ////////////////////////////////////////////////////////// diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 6443c1e353..8276228c53 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -36,7 +36,6 @@ class nsCSSAnonBoxPseudoStaticAtom; class nsPageSequenceFrame; class nsPageContentFrame; -struct PendingBinding; class nsFrameConstructorState; @@ -786,24 +785,6 @@ class nsCSSFrameConstructor final : public nsFrameManager { pseudo-frames as needed */ static const PseudoParentData sPseudoParentData[eParentTypeCount]; - // The information that concerns the frame constructor after loading an XBL - // binding. - // - // This is expected to just be used temporarily to aggregate the different - // objects that LoadXBLBindingIfNeeded returns. - struct MOZ_STACK_CLASS XBLBindingLoadInfo { - mozilla::UniquePtr mPendingBinding; - bool mSuccess = false; - - // For the error case. - XBLBindingLoadInfo(); - explicit XBLBindingLoadInfo(mozilla::UniquePtr); - }; - - // Returns null mStyle member to signal an error. - XBLBindingLoadInfo LoadXBLBindingIfNeeded(nsIContent&, const ComputedStyle&, - ItemFlags aFlags); - const FrameConstructionData* FindDataForContent(nsIContent&, ComputedStyle&, nsIFrame* aParentFrame, ItemFlags aFlags); @@ -878,12 +859,11 @@ class nsCSSFrameConstructor final : public nsFrameManager { // Also, the return value is always non-null, thanks to infallible 'new'. FrameConstructionItem* AppendItem( nsCSSFrameConstructor* aFCtor, const FrameConstructionData* aFCData, - nsIContent* aContent, PendingBinding* aPendingBinding, - already_AddRefed&& aComputedStyle, + nsIContent* aContent, already_AddRefed&& aComputedStyle, bool aSuppressWhiteSpaceOptimizations) { - FrameConstructionItem* item = new (aFCtor) FrameConstructionItem( - aFCData, aContent, aPendingBinding, std::move(aComputedStyle), - aSuppressWhiteSpaceOptimizations); + FrameConstructionItem* item = new (aFCtor) + FrameConstructionItem(aFCData, aContent, std::move(aComputedStyle), + aSuppressWhiteSpaceOptimizations); mItems.insertBack(item); ++mItemCount; ++mDesiredParentCounts[item->DesiredParentType()]; @@ -893,12 +873,11 @@ class nsCSSFrameConstructor final : public nsFrameManager { // Arguments are the same as AppendItem(). FrameConstructionItem* PrependItem( nsCSSFrameConstructor* aFCtor, const FrameConstructionData* aFCData, - nsIContent* aContent, PendingBinding* aPendingBinding, - already_AddRefed&& aComputedStyle, + nsIContent* aContent, already_AddRefed&& aComputedStyle, bool aSuppressWhiteSpaceOptimizations) { - FrameConstructionItem* item = new (aFCtor) FrameConstructionItem( - aFCData, aContent, aPendingBinding, std::move(aComputedStyle), - aSuppressWhiteSpaceOptimizations); + FrameConstructionItem* item = new (aFCtor) + FrameConstructionItem(aFCData, aContent, std::move(aComputedStyle), + aSuppressWhiteSpaceOptimizations); mItems.insertFront(item); ++mItemCount; ++mDesiredParentCounts[item->DesiredParentType()]; @@ -1112,12 +1091,11 @@ class nsCSSFrameConstructor final : public nsFrameManager { struct FrameConstructionItem final : public mozilla::LinkedListElement { FrameConstructionItem(const FrameConstructionData* aFCData, - nsIContent* aContent, PendingBinding* aPendingBinding, + nsIContent* aContent, already_AddRefed&& aComputedStyle, bool aSuppressWhiteSpaceOptimizations) : mFCData(aFCData), mContent(aContent), - mPendingBinding(aPendingBinding), mComputedStyle(std::move(aComputedStyle)), mSuppressWhiteSpaceOptimizations(aSuppressWhiteSpaceOptimizations), mIsText(false), @@ -1173,15 +1151,6 @@ class nsCSSFrameConstructor final : public nsFrameManager { const FrameConstructionData* mFCData; // The nsIContent node to use when initializing the new frame. nsIContent* mContent; - // The PendingBinding for this frame construction item, if any. May be - // null. We maintain a list of PendingBindings in the frame construction - // state in the order in which AddToAttachedQueue should be called on them: - // depth-first, post-order traversal order. Since we actually traverse the - // DOM in a mix of breadth-first and depth-first, it is the responsibility - // of whoever constructs FrameConstructionItem kids of a given - // FrameConstructionItem to push its mPendingBinding as the current - // insertion point before doing so and pop it afterward. - PendingBinding* mPendingBinding; // The style to use for creating the new frame. RefPtr mComputedStyle; // Whether optimizations to skip constructing textframes around @@ -1626,8 +1595,6 @@ class nsCSSFrameConstructor final : public nsFrameManager { * @param aFrameList the list in which we should place the in-flow children * @param aAllowBlockStyles Whether to allow first-letter and first-line * styles on the parent. - * @param aPendingBinding Make sure to push this into aState before doing any - * child item construction. * @param aPossiblyLeafFrame if non-null, this should be used for the isLeaf * test and the anonymous content creation. If null, aFrame will be * used. @@ -1637,7 +1604,6 @@ class nsCSSFrameConstructor final : public nsFrameManager { nsContainerFrame* aParentFrame, const bool aCanHaveGeneratedContent, nsFrameList& aFrameList, const bool aAllowBlockStyles, - PendingBinding* aPendingBinding, nsIFrame* aPossiblyLeafFrame = nullptr); /** @@ -1687,7 +1653,6 @@ class nsCSSFrameConstructor final : public nsFrameManager { nsIContent* aContent, nsContainerFrame* aParentFrame, ComputedStyle* aComputedStyle, bool aBuildCombobox, - PendingBinding* aPendingBinding, nsFrameList& aFrameList); /** @@ -1760,15 +1725,12 @@ class nsCSSFrameConstructor final : public nsFrameManager { // @param aPositionedFrameForAbsPosContainer if non-null, then the new // block should be an abs-pos container and aPositionedFrameForAbsPosContainer // is the frame whose style is making this block an abs-pos container. - // @param aPendingBinding the pending binding from this block's frame - // construction item. void ConstructBlock(nsFrameConstructorState& aState, nsIContent* aContent, nsContainerFrame* aParentFrame, nsContainerFrame* aContentParentFrame, ComputedStyle* aComputedStyle, nsContainerFrame** aNewFrame, nsFrameList& aFrameList, - nsIFrame* aPositionedFrameForAbsPosContainer, - PendingBinding* aPendingBinding); + nsIFrame* aPositionedFrameForAbsPosContainer); // Build the initial column hierarchy around aColumnContent. This function // should be called before constructing aColumnContent's children. diff --git a/layout/base/nsChangeHint.h b/layout/base/nsChangeHint.h index 6402d5893b..9db329db88 100644 --- a/layout/base/nsChangeHint.h +++ b/layout/base/nsChangeHint.h @@ -220,17 +220,11 @@ enum nsChangeHint : uint32_t { */ nsChangeHint_ScrollbarChange = 1 << 26, - /** - * Indicates that nsIFrame::UpdateWidgetProperties needs to be called. - * This is used for -moz-window-* properties. - */ - nsChangeHint_UpdateWidgetProperties = 1 << 27, - /** * Indicates that there has been a colspan or rowspan attribute change * on the cells of a table. */ - nsChangeHint_UpdateTableCellSpans = 1 << 28, + nsChangeHint_UpdateTableCellSpans = 1 << 27, /** * Indicates that the visiblity property changed. @@ -238,7 +232,7 @@ enum nsChangeHint : uint32_t { * visibility:hidden elements in the case where the elements have no visible * descendants. */ - nsChangeHint_VisibilityChange = 1u << 29, + nsChangeHint_VisibilityChange = 1u << 28, // IMPORTANT NOTE: When adding a new hint, you will need to add it to // one of: @@ -255,7 +249,7 @@ enum nsChangeHint : uint32_t { /** * Dummy hint value for all hints. It exists for compile time check. */ - nsChangeHint_AllHints = uint32_t((1ull << 30) - 1), + nsChangeHint_AllHints = uint32_t((1ull << 29) - 1), }; // Redefine these operators to return nothing. This will catch any use @@ -336,8 +330,7 @@ inline nsChangeHint operator^=(nsChangeHint& aLeft, nsChangeHint aRight) { nsChangeHint_UpdateOverflow | nsChangeHint_UpdateParentOverflow | \ nsChangeHint_UpdatePostTransformOverflow | \ nsChangeHint_UpdateTableCellSpans | nsChangeHint_UpdateTransformLayer | \ - nsChangeHint_UpdateUsesOpacity | nsChangeHint_AddOrRemoveTransform | \ - nsChangeHint_UpdateWidgetProperties) + nsChangeHint_UpdateUsesOpacity | nsChangeHint_AddOrRemoveTransform) // The change hints that are sometimes considered to be handled for descendants. #define nsChangeHint_Hints_SometimesHandledForDescendants \ diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp index 454aea8cde..e5b94ea4ac 100644 --- a/layout/base/nsDocumentViewer.cpp +++ b/layout/base/nsDocumentViewer.cpp @@ -990,15 +990,14 @@ nsDocumentViewer::LoadComplete(nsresult aStatus) { restoring = (mDocument->GetReadyStateEnum() == Document::READYSTATE_COMPLETE); if (!restoring) { - NS_ASSERTION(mDocument->IsXULDocument() || // readyState for XUL is bogus - mDocument->GetReadyStateEnum() == - Document::READYSTATE_INTERACTIVE || - // test_stricttransportsecurity.html has old-style - // docshell-generated about:blank docs reach this code! - (mDocument->GetReadyStateEnum() == - Document::READYSTATE_UNINITIALIZED && - NS_IsAboutBlank(mDocument->GetDocumentURI())), - "Bad readystate"); + NS_ASSERTION( + mDocument->GetReadyStateEnum() == Document::READYSTATE_INTERACTIVE || + // test_stricttransportsecurity.html has old-style + // docshell-generated about:blank docs reach this code! + (mDocument->GetReadyStateEnum() == + Document::READYSTATE_UNINITIALIZED && + NS_IsAboutBlank(mDocument->GetDocumentURI())), + "Bad readystate"); #ifdef DEBUG bool docShellThinksWeAreRestoring; docShell->GetRestoringDocument(&docShellThinksWeAreRestoring); @@ -3222,11 +3221,6 @@ nsresult nsDocViewerFocusListener::HandleEvent(Event* aEvent) { NS_IMETHODIMP nsDocumentViewer::Print(nsIPrintSettings* aPrintSettings, nsIWebProgressListener* aWebProgressListener) { - // Printing XUL documents is not supported. - if (mDocument && mDocument->IsXULDocument()) { - return NS_ERROR_FAILURE; - } - if (!mContainer) { PR_PL(("Container was destroyed yet we are still trying to use it!")); return NS_ERROR_FAILURE; @@ -3316,12 +3310,6 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings, return NS_ERROR_FAILURE; } - // Printing XUL documents is not supported. - if (mDocument && mDocument->IsXULDocument()) { - nsPrintJob::CloseProgressDialog(aWebProgressListener); - return NS_ERROR_FAILURE; - } - nsCOMPtr docShell(mContainer); if (!docShell || !mDeviceContext) { PR_PL(("Can't Print Preview without device context and docshell")); diff --git a/layout/base/nsGenConList.cpp b/layout/base/nsGenConList.cpp index 5c847da76f..07cb085c26 100644 --- a/layout/base/nsGenConList.cpp +++ b/layout/base/nsGenConList.cpp @@ -68,14 +68,6 @@ inline int32_t PseudoCompareType(nsIFrame* aFrame, nsIContent** aContent) { return 0; } -#ifdef DEBUG -static bool IsXBLInvolved(nsIContent* aContent1, nsIContent* aContent2) { - auto* ancestor = nsContentUtils::GetCommonAncestor(aContent1, aContent2); - return ancestor && ancestor->IsElement() && - ancestor->AsElement()->GetXBLBinding(); -} -#endif - /* static */ bool nsGenConList::NodeAfter(const nsGenConNode* aNode1, const nsGenConNode* aNode2) { @@ -105,8 +97,7 @@ bool nsGenConList::NodeAfter(const nsGenConNode* aNode1, int32_t cmp = nsLayoutUtils::CompareTreePosition(content1, content2); // DoCompareTreePosition doesn't know about XBL anonymous content, and we // probably shouldn't bother teaching it about it. - MOZ_ASSERT(cmp != 0 || IsXBLInvolved(content1, content2), - "same content, different frames"); + MOZ_ASSERT(cmp != 0, "same content, different frames"); return cmp > 0; } diff --git a/layout/base/nsILayoutDebugger.h b/layout/base/nsILayoutDebugger.h deleted file mode 100644 index 2a9a43d9df..0000000000 --- a/layout/base/nsILayoutDebugger.h +++ /dev/null @@ -1,42 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -/* XPCOM interface for layout-debug extension to reach layout internals */ - -#ifndef nsILayoutDebugger_h___ -#define nsILayoutDebugger_h___ - -#include "nsISupports.h" - -// 1295f7c0-96b3-41fc-93ed-c95dfb712ce7 -#define NS_ILAYOUT_DEBUGGER_IID \ - { \ - 0x1295f7c0, 0x96b3, 0x41fc, { \ - 0x93, 0xed, 0xc9, 0x5d, 0xfb, 0x71, 0x2c, 0xe7 \ - } \ - } - -/** - * API for access and control of layout debugging - */ -class nsILayoutDebugger : public nsISupports { - public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILAYOUT_DEBUGGER_IID) - - NS_IMETHOD SetShowFrameBorders(bool aEnable) = 0; - - NS_IMETHOD GetShowFrameBorders(bool* aResult) = 0; - - NS_IMETHOD SetShowEventTargetFrameBorder(bool aEnable) = 0; - - NS_IMETHOD GetShowEventTargetFrameBorder(bool* aResult) = 0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsILayoutDebugger, NS_ILAYOUT_DEBUGGER_IID) - -#ifdef DEBUG -nsresult NS_NewLayoutDebugger(nsILayoutDebugger** aResult); -#endif /* DEBUG */ - -#endif /* nsILayoutDebugger_h___ */ diff --git a/layout/base/nsLayoutDebugger.cpp b/layout/base/nsLayoutDebugger.cpp index 9a6f349425..acce2ba05f 100644 --- a/layout/base/nsLayoutDebugger.cpp +++ b/layout/base/nsLayoutDebugger.cpp @@ -2,12 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -/* - * implementation of interface that allows layout-debug extension access - * to some internals of layout - */ - -#include "nsILayoutDebugger.h" +/* some layout debugging functions that ought to live in nsFrame.cpp */ #include "nsAttrValue.h" #include "nsIFrame.h" @@ -20,66 +15,6 @@ using namespace mozilla; using namespace mozilla::layers; -#ifdef DEBUG -class nsLayoutDebugger : public nsILayoutDebugger { - public: - nsLayoutDebugger(); - - NS_DECL_ISUPPORTS - - NS_IMETHOD SetShowFrameBorders(bool aEnable) override; - - NS_IMETHOD GetShowFrameBorders(bool* aResult) override; - - NS_IMETHOD SetShowEventTargetFrameBorder(bool aEnable) override; - - NS_IMETHOD GetShowEventTargetFrameBorder(bool* aResult) override; - - protected: - virtual ~nsLayoutDebugger(); -}; - -nsresult NS_NewLayoutDebugger(nsILayoutDebugger** aResult) { - MOZ_ASSERT(aResult, "null OUT ptr"); - if (!aResult) { - return NS_ERROR_NULL_POINTER; - } - nsLayoutDebugger* it = new nsLayoutDebugger(); - return it->QueryInterface(NS_GET_IID(nsILayoutDebugger), (void**)aResult); -} - -nsLayoutDebugger::nsLayoutDebugger() {} - -nsLayoutDebugger::~nsLayoutDebugger() {} - -NS_IMPL_ISUPPORTS(nsLayoutDebugger, nsILayoutDebugger) - -NS_IMETHODIMP -nsLayoutDebugger::SetShowFrameBorders(bool aEnable) { - nsFrame::ShowFrameBorders(aEnable); - return NS_OK; -} - -NS_IMETHODIMP -nsLayoutDebugger::GetShowFrameBorders(bool* aResult) { - *aResult = nsFrame::GetShowFrameBorders(); - return NS_OK; -} - -NS_IMETHODIMP -nsLayoutDebugger::SetShowEventTargetFrameBorder(bool aEnable) { - nsFrame::ShowEventTargetFrameBorder(aEnable); - return NS_OK; -} - -NS_IMETHODIMP -nsLayoutDebugger::GetShowEventTargetFrameBorder(bool* aResult) { - *aResult = nsFrame::GetShowEventTargetFrameBorder(); - return NS_OK; -} - -#endif - static std::ostream& operator<<(std::ostream& os, const nsPrintfCString& rhs) { os << rhs.get(); return os; diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 2f8c140445..f553f2f644 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -82,6 +82,7 @@ #include "mozilla/Telemetry.h" #include "mozilla/dom/Performance.h" #include "mozilla/dom/PerformanceTiming.h" +#include "mozilla/dom/PerformancePaintTiming.h" #include "mozilla/layers/APZThreadUtils.h" #include "mozilla/dom/ImageTracker.h" @@ -152,11 +153,9 @@ static bool IsVisualCharset(NotNull aCharset) { } nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType) - : mType(aType), - mPresShell(nullptr), + : mPresShell(nullptr), mDocument(aDocument), mMedium(aType == eContext_Galley ? nsGkAtoms::screen : nsGkAtoms::print), - mInflationDisabledForShrinkWrap(false), mSystemFontScale(1.0), mTextZoom(1.0), mEffectiveTextZoom(1.0), @@ -169,17 +168,19 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType) mPageScale(0.0), mPPScale(1.0f), mViewportScrollOverrideElement(nullptr), - mViewportScrollStyles(StyleOverflow::Auto, StyleOverflow::Auto), - mExistThrottledUpdates(false), - // mImageAnimationMode is initialised below, in constructor body - mImageAnimationModePref(imgIContainer::kNormalAnimMode), - mInterruptChecksToSkip(0), - mNextFrameRateMultiplier(0), mElementsRestyled(0), mFramesConstructed(0), mFramesReflowed(0), + mInterruptChecksToSkip(0), + mNextFrameRateMultiplier(0), + mViewportScrollStyles(StyleOverflow::Auto, StyleOverflow::Auto), + // mImageAnimationMode is initialised below, in constructor body + mImageAnimationModePref(imgIContainer::kNormalAnimMode), + mType(aType), + mInflationDisabledForShrinkWrap(false), mInteractionTimeEnabled(true), mHasPendingInterrupt(false), + mHasEverBuiltInvisibleText(false), mPendingInterruptFromTest(false), mInterruptsEnabled(false), mSendAfterPaintToContent(false), @@ -210,6 +211,7 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType) mQuirkSheetAdded(false), mHadNonBlankPaint(false), mHadContentfulPaint(false), + mHadNonTickContentfulPaint(false), mHadContentfulPaintComposite(false) #ifdef DEBUG , @@ -2306,12 +2308,35 @@ void nsPresContext::NotifyNonBlankPaint() { } void nsPresContext::NotifyContentfulPaint() { + nsRootPresContext* rootPresContext = GetRootPresContext(); + if (!rootPresContext) { + return; + } if (!mHadContentfulPaint) { + if (!rootPresContext->RefreshDriver()->IsInRefresh()) { + if (!mHadNonTickContentfulPaint) { + rootPresContext->RefreshDriver() + ->AddForceNotifyContentfulPaintPresContext(this); + mHadNonTickContentfulPaint = true; + } + return; + } mHadContentfulPaint = true; - if (IsRootContentDocument()) { - if (nsRootPresContext* rootPresContext = GetRootPresContext()) { - mFirstContentfulPaintTransactionId = - Some(rootPresContext->mRefreshDriver->LastTransactionId().Next()); + mFirstContentfulPaintTransactionId = + Some(rootPresContext->mRefreshDriver->LastTransactionId().Next()); + if (nsPIDOMWindowInner* innerWindow = mDocument->GetInnerWindow()) { + if (Performance* perf = innerWindow->GetPerformance()) { + TimeStamp nowTime = rootPresContext->RefreshDriver()->MostRecentRefresh( + /* aEnsureTimerStarted */ false); + MOZ_ASSERT(!nowTime.IsNull(), + "Most recent refresh timestamp should exist since we are in " + "a refresh driver tick"); + MOZ_ASSERT(rootPresContext->RefreshDriver()->IsInRefresh(), + "We should only notify contentful paint during refresh " + "driver ticks"); + RefPtr paintTiming = new PerformancePaintTiming( + perf, u"first-contentful-paint"_ns, nowTime); + perf->SetFCPTimingEntry(paintTiming); } } } diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index cd58490428..e78112d588 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -137,7 +137,7 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL NS_DECL_CYCLE_COLLECTION_CLASS(nsPresContext) - enum nsPresContextType { + enum nsPresContextType : uint8_t { eContext_Galley, // unpaginated screen presentation eContext_PrintPreview, // paginated screen presentation eContext_Print, // paginated printer presentation @@ -964,19 +964,13 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { void NotifyContentfulPaint(); void NotifyDOMContentFlushed(); + bool HasEverBuiltInvisibleText() const { return mHasEverBuiltInvisibleText; } + void SetBuiltInvisibleText() { mHasEverBuiltInvisibleText = true; } + bool UsesExChUnits() const { return mUsesExChUnits; } void SetUsesExChUnits(bool aValue) { mUsesExChUnits = aValue; } - // true if there are OMTA transition updates for the current document which - // have been throttled, and therefore some style information may not be up - // to date - bool ExistThrottledUpdates() const { return mExistThrottledUpdates; } - - void SetExistThrottledUpdates(bool aExistThrottledUpdates) { - mExistThrottledUpdates = aExistThrottledUpdates; - } - bool IsDeviceSizePageSize(); bool HasWarnedAboutPositionedTableParts() const { @@ -1083,7 +1077,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { // has been explicitly checked. If you add any members to this class, // please make the ownership explicit (pinkerton, scc). - nsPresContextType mType; // the PresShell owns a strong reference to the nsPresContext, and is // responsible for nulling this pointer before it is destroyed mozilla::PresShell* MOZ_NON_OWNING_REF mPresShell; // [WEAK] @@ -1105,15 +1098,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { RefPtr mMediaEmulated; RefPtr mFontFeatureValuesLookup; - public: - // The following are public member variables so that we can use them - // with mozilla::AutoToggle or mozilla::AutoRestore. - - // Should we disable font size inflation because we're inside of - // shrink-wrapping calculations on an inflation container? - bool mInflationDisabledForShrinkWrap; - - protected: float mSystemFontScale; // Internal text zoom factor, defaults to 1.0 float mTextZoom; // Text zoom, defaults to 1.0 float mEffectiveTextZoom; // Text zoom * system font scale @@ -1159,17 +1143,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { // fullscreen elements, it happens in the fullscreen-specific cleanup invoked // by Element::UnbindFromTree().) mozilla::dom::Element* MOZ_NON_OWNING_REF mViewportScrollOverrideElement; - ScrollStyles mViewportScrollStyles; - - bool mExistThrottledUpdates; - - uint16_t mImageAnimationMode; - uint16_t mImageAnimationModePref; - - uint32_t mInterruptChecksToSkip; - - // During page load we use slower frame rate. - uint32_t mNextFrameRateMultiplier; // Counters for tests and tools that want to detect frame construction // or reflow. @@ -1181,6 +1154,9 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { Maybe mFirstContentfulPaintTransactionId; + mozilla::UniquePtr + mPendingMediaFeatureValuesChange; + // Time of various first interaction types, used to report time from // first paint of the top level content pres shell to first interaction. mozilla::TimeStamp mFirstNonBlankPaintTime; @@ -1189,12 +1165,33 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { mozilla::TimeStamp mFirstMouseMoveTime; mozilla::TimeStamp mFirstScrollTime; - bool mInteractionTimeEnabled; - // last time we did a full style flush mozilla::TimeStamp mLastStyleUpdateForAllAnimations; + uint32_t mInterruptChecksToSkip; + + // During page load we use slower frame rate. + uint32_t mNextFrameRateMultiplier; + + ScrollStyles mViewportScrollStyles; + + uint16_t mImageAnimationMode; + uint16_t mImageAnimationModePref; + + nsPresContextType mType; + + public: + // The following are public member variables so that we can use them + // with mozilla::AutoToggle or mozilla::AutoRestore. + + // Should we disable font size inflation because we're inside of + // shrink-wrapping calculations on an inflation container? + bool mInflationDisabledForShrinkWrap; + + protected: + unsigned mInteractionTimeEnabled : 1; unsigned mHasPendingInterrupt : 1; + unsigned mHasEverBuiltInvisibleText : 1; unsigned mPendingInterruptFromTest : 1; unsigned mInterruptsEnabled : 1; unsigned mSendAfterPaintToContent : 1; @@ -1250,6 +1247,11 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { unsigned mHadNonBlankPaint : 1; // Has NotifyContentfulPaint been called on this PresContext? unsigned mHadContentfulPaint : 1; + // True when a contentful paint has happened and this paint doesn't + // come from the regular tick process. Usually this means a + // contentful paint was triggered manually. + unsigned mHadNonTickContentfulPaint : 1; + // Has NotifyDidPaintForSubtree been called for a contentful paint? unsigned mHadContentfulPaintComposite : 1; @@ -1257,8 +1259,6 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr { unsigned mInitialized : 1; #endif - mozilla::UniquePtr mPendingMediaFeatureValuesChange; - protected: virtual ~nsPresContext(); diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 77cb2b1b52..c2ff7bcc32 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -119,24 +119,6 @@ static mozilla::LazyLogModule sRefreshDriverLog("nsRefreshDriver"); #endif namespace { -// `true` if we are currently in jank-critical mode. -// -// In jank-critical mode, any iteration of the event loop that takes -// more than 16ms to compute will cause an ongoing animation to miss -// frames. -// -// For simplicity, the current implementation assumes that we are in -// jank-critical mode if and only if at least one vsync driver has -// at least one observer. -static uint64_t sActiveVsyncTimers = 0; - -// The latest value of process-wide jank levels. -// -// For each i, sJankLevels[i] counts the number of times delivery of -// vsync to the main thread has been delayed by at least 2^i ms. Use -// GetJankLevels to grab a copy of this array. -uint64_t sJankLevels[12]; - // The number outstanding nsRefreshDrivers (that have been created but not // disconnected). When this reaches zero we will call // nsRefreshDriver::Shutdown. @@ -638,7 +620,6 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { Telemetry::FX_REFRESH_DRIVER_CHROME_FRAME_DELAY_MS, sample); Telemetry::Accumulate( Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, sample); - RecordJank(sample); } else if (mVsyncRate != TimeDuration::Forever()) { TimeDuration contentDelay = (TimeStamp::Now() - mLastChildTick) - mVsyncRate; @@ -653,7 +634,6 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { Telemetry::FX_REFRESH_DRIVER_CONTENT_FRAME_DELAY_MS, sample); Telemetry::Accumulate( Telemetry::FX_REFRESH_DRIVER_SYNC_SCROLL_FRAME_DELAY_MS, sample); - RecordJank(sample); } else { // Request the vsync rate from the parent process. Might be a few vsyncs // until the parent responds. @@ -664,15 +644,6 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { #endif } - void RecordJank(uint32_t aJankMS) { - uint32_t duration = 1 /* ms */; - for (size_t i = 0; - i < mozilla::ArrayLength(sJankLevels) && duration < aJankMS; - ++i, duration *= 2) { - sJankLevels[i]++; - } - } - void TickRefreshDriver(VsyncId aId, TimeStamp aVsyncTimestamp) { MOZ_ASSERT(NS_IsMainThread()); @@ -747,7 +718,6 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { } void StartTimer() override { - // Protect updates to `sActiveVsyncTimers`. MOZ_ASSERT(NS_IsMainThread()); mLastFireTime = TimeStamp::Now(); @@ -758,12 +728,9 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { Unused << mVsyncChild->SendObserve(); mVsyncObserver->OnTimerStart(); } - - ++sActiveVsyncTimers; } void StopTimer() override { - // Protect updates to `sActiveVsyncTimers`. MOZ_ASSERT(NS_IsMainThread()); if (XRE_IsParentProcess()) { @@ -771,9 +738,6 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer { } else { Unused << mVsyncChild->SendUnobserve(); } - - MOZ_ASSERT(sActiveVsyncTimers > 0); - --sActiveVsyncTimers; } void ScheduleNextTick(TimeStamp aNowTime) override { @@ -985,8 +949,6 @@ static void CreateContentVsyncRefreshTimer(void*) { static void CreateVsyncRefreshTimer() { MOZ_ASSERT(NS_IsMainThread()); - PodArrayZero(sJankLevels); - if (gfxPlatform::IsInLayoutAsapMode()) { return; } @@ -1169,10 +1131,10 @@ void nsRefreshDriver::RestoreNormalRefresh() { mCompletedTransaction = mOutstandingTransactionId = mNextTransactionId; } -TimeStamp nsRefreshDriver::MostRecentRefresh() const { +TimeStamp nsRefreshDriver::MostRecentRefresh(bool aEnsureTimerStarted) const { // In case of stylo traversal, we have already activated the refresh driver in // RestyleManager::ProcessPendingRestyles(). - if (!ServoStyleSet::IsInServoTraversal()) { + if (aEnsureTimerStarted && !ServoStyleSet::IsInServoTraversal()) { const_cast(this)->EnsureTimerStarted(); } @@ -1309,6 +1271,21 @@ void nsRefreshDriver::NotifyDOMContentLoaded() { } } +void nsRefreshDriver::AddForceNotifyContentfulPaintPresContext( + nsPresContext* aPresContext) { + mForceNotifyContentfulPaintPresContexts.AppendElement(aPresContext); +} + +void nsRefreshDriver::FlushForceNotifyContentfulPaintPresContext() { + while (!mForceNotifyContentfulPaintPresContexts.IsEmpty()) { + WeakPtr presContext = + mForceNotifyContentfulPaintPresContexts.PopLastElement(); + if (presContext) { + presContext->NotifyContentfulPaint(); + } + } +} + void nsRefreshDriver::RunDelayedEventsSoon() { // Place entries for delayed events into their corresponding normal list, // and schedule a refresh. When these delayed events run, if their document @@ -1871,6 +1848,8 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) { DisplayPortUtils::UpdateDisplayPortMarginsFromPendingMessages(); } + FlushForceNotifyContentfulPaintPresContext(); + AutoTArray, 16> earlyRunners = std::move(mEarlyRunners); for (auto& runner : earlyRunners) { runner->Run(); @@ -2481,16 +2460,4 @@ void nsRefreshDriver::Disconnect() { } } -/* static */ -bool nsRefreshDriver::IsJankCritical() { - MOZ_ASSERT(NS_IsMainThread()); - return sActiveVsyncTimers > 0; -} - -/* static */ -bool nsRefreshDriver::GetJankLevels(Vector& aJank) { - aJank.clear(); - return aJank.append(sJankLevels, ArrayLength(sJankLevels)); -} - #undef LOG diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index 43ee633c21..11461ab3a3 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -75,7 +75,7 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator, * ensure that multiple animations started during the same event off * the main event loop have the same start time.) */ - mozilla::TimeStamp MostRecentRefresh() const; + mozilla::TimeStamp MostRecentRefresh(bool aEnsureTimerStarted = true) const; /** * Add / remove refresh observers. @@ -314,20 +314,6 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator, void SetIsResizeSuppressed() { mResizeSuppressed = true; } bool IsResizeSuppressed() const { return mResizeSuppressed; } - /** - * The latest value of process-wide jank levels. - * - * For each i, sJankLevels[i] counts the number of times delivery of - * vsync to the main thread has been delayed by at least 2^i - * ms. This data structure has been designed to make it easy to - * determine how much jank has taken place between two instants in - * time. - * - * Return `false` if `aJank` needs to be grown to accomodate the - * data but we didn't have enough memory. - */ - static bool GetJankLevels(mozilla::Vector& aJank); - // mozilla::layers::TransactionIdAllocator TransactionId GetTransactionId(bool aThrottle) override; TransactionId LastTransactionId() const override; @@ -398,6 +384,9 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator, mNeedToUpdateIntersectionObservations = true; } + void AddForceNotifyContentfulPaintPresContext(nsPresContext* aPresContext); + void FlushForceNotifyContentfulPaintPresContext(); + private: typedef nsTObserverArray ObserverArray; typedef nsTArray> VisualViewportResizeEventArray; @@ -552,23 +541,23 @@ class nsRefreshDriver final : public mozilla::layers::TransactionIdAllocator, AutoTArray mAnimationEventFlushObservers; + // nsPresContexts which `NotifyContentfulPaint` have been called, + // however the corresponding paint doesn't come from a regular + // rendering steps(aka tick). + // + // For these nsPresContexts, we invoke + // `FlushForceNotifyContentfulPaintPresContext` in the next tick + // to force notify contentful paint, regardless whether the tick paints + // or not. + nsTArray> + mForceNotifyContentfulPaintPresContexts; + void BeginRefreshingImages(RequestTable& aEntries, mozilla::TimeStamp aDesired); friend class mozilla::RefreshDriverTimer; static void Shutdown(); - - // `true` if we are currently in jank-critical mode. - // - // In jank-critical mode, any iteration of the event loop that takes - // more than 16ms to compute will cause an ongoing animation to miss - // frames. - // - // For simplicity, the current implementation assumes that we are - // in jank-critical mode if and only if the vsync driver has at least - // one observer. - static bool IsJankCritical(); }; #endif /* !defined(nsRefreshDriver_h_) */ diff --git a/layout/base/tests/browser_bug617076.js b/layout/base/tests/browser_bug617076.js index be46e6d8dc..ff8020d8c8 100644 --- a/layout/base/tests/browser_bug617076.js +++ b/layout/base/tests/browser_bug617076.js @@ -19,7 +19,7 @@ add_task(async function test() { // insert button into test page content await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() { let doc = content.document; - let e = doc.createElement("button"); + let e = doc.createXULElement("button"); e.setAttribute("label", "hello"); e.setAttribute("tooltiptext", "world"); e.setAttribute("id", "test-button"); diff --git a/layout/base/tests/chrome/chrome.ini b/layout/base/tests/chrome/chrome.ini index 46945c51e5..28b1a2b518 100644 --- a/layout/base/tests/chrome/chrome.ini +++ b/layout/base/tests/chrome/chrome.ini @@ -8,13 +8,13 @@ support-files = animated.gif blue-32x32.png bug551434_childframe.html - chrome_content_integration_window.xul - default_background_window.xul - dialog_with_positioning_window.xul + chrome_content_integration_window.xhtml + default_background_window.xhtml + dialog_with_positioning_window.xhtml file_bug458898.html - printpreview_bug396024_helper.xul - printpreview_bug482976_helper.xul - printpreview_helper.xul + printpreview_bug396024_helper.xhtml + printpreview_bug482976_helper.xhtml + printpreview_helper.xhtml printpreview_font_api.html printpreview_font_api_ref.html printpreview_font_mozprintcallback.html @@ -27,48 +27,51 @@ support-files = test_shadow_root_adopted_styles_ref.html test_shared_adopted_styles.html test_shared_adopted_styles_ref.html - file_bug1018265.xul + file_bug1018265.xhtml [test_bug396367-1.html] [test_bug396367-2.html] -[test_bug420499.xul] +[test_bug420499.xhtml] [test_bug458898.html] -[test_bug514660.xul] -[test_bug533845.xul] +[test_bug465448.xhtml] +support-files = + file_bug465448.html +[test_bug514660.xhtml] +[test_bug533845.xhtml] skip-if = os == 'linux' && !debug # Bug 1208197 [test_bug551434.html] [test_bug708062.html] -[test_bug812817.xul] +[test_bug812817.xhtml] [test_bug847890_paintFlashing.html] -[test_bug1018265.xul] -[test_bug1041200.xul] +[test_bug1018265.xhtml] +[test_bug1041200.xhtml] skip-if = os == 'win' && bits == 64 # Bug 1272321 support-files = bug1041200_frame.html bug1041200_window.html -[test_chrome_content_integration.xul] -[test_chrome_over_plugin.xul] +[test_chrome_content_integration.xhtml] +[test_chrome_over_plugin.xhtml] support-files = - chrome_over_plugin_window.xul + chrome_over_plugin_window.xhtml chrome_over_plugin_window_frame.html -[test_default_background.xul] +[test_default_background.xhtml] [test_dialog_with_positioning.html] tags = openwindow [test_fixed_bg_scrolling_repaints.html] -[test_leaf_layers_partition_browser_window.xul] +[test_leaf_layers_partition_browser_window.xhtml] skip-if = true # Bug 992311 [test_prerendered_transforms.html] -[test_printpreview.xul] +[test_printpreview.xhtml] skip-if = (os == "linux" && bits == 32) || (verify && (os == 'win')) # Disabled on Linux32 for bug 1278957 -[test_printpreview_bug396024.xul] +[test_printpreview_bug396024.xhtml] skip-if = (verify && (os == 'win')) -[test_printpreview_bug482976.xul] +[test_printpreview_bug482976.xhtml] skip-if = (verify && (os == 'win')) [test_scrolling_repaints.html] [test_will_change.html] skip-if = webrender [test_getClientRectsAndTexts.html] -[test_css_visibility_propagation.xul] +[test_css_visibility_propagation.xhtml] support-files = window_css_visibility_propagation-1.html window_css_visibility_propagation-2.html diff --git a/layout/base/tests/chrome/chrome_content_integration_window.xul b/layout/base/tests/chrome/chrome_content_integration_window.xhtml similarity index 96% rename from layout/base/tests/chrome/chrome_content_integration_window.xul rename to layout/base/tests/chrome/chrome_content_integration_window.xhtml index 627e83edd2..1590928fd4 100644 --- a/layout/base/tests/chrome/chrome_content_integration_window.xul +++ b/layout/base/tests/chrome/chrome_content_integration_window.xhtml @@ -6,7 +6,7 @@ style="background:black; -moz-appearance:none;"> - + @@ -24,7 +24,7 @@ for (var name of imports) { window[name] = window.opener.wrappedJSObject[name]; } - + function runTests() { var testCanvas = snapshotWindow(window); diff --git a/layout/base/tests/chrome/chrome_over_plugin_window.xul b/layout/base/tests/chrome/chrome_over_plugin_window.xhtml similarity index 100% rename from layout/base/tests/chrome/chrome_over_plugin_window.xul rename to layout/base/tests/chrome/chrome_over_plugin_window.xhtml diff --git a/layout/base/tests/chrome/default_background_window.xul b/layout/base/tests/chrome/default_background_window.xhtml similarity index 100% rename from layout/base/tests/chrome/default_background_window.xul rename to layout/base/tests/chrome/default_background_window.xhtml diff --git a/layout/base/tests/chrome/dialog_with_positioning_window.xul b/layout/base/tests/chrome/dialog_with_positioning_window.xhtml similarity index 100% rename from layout/base/tests/chrome/dialog_with_positioning_window.xul rename to layout/base/tests/chrome/dialog_with_positioning_window.xhtml diff --git a/layout/base/tests/chrome/file_bug1018265.xul b/layout/base/tests/chrome/file_bug1018265.xhtml similarity index 100% rename from layout/base/tests/chrome/file_bug1018265.xul rename to layout/base/tests/chrome/file_bug1018265.xhtml diff --git a/layout/base/tests/file_bug465448.html b/layout/base/tests/chrome/file_bug465448.html similarity index 100% rename from layout/base/tests/file_bug465448.html rename to layout/base/tests/chrome/file_bug465448.html diff --git a/layout/base/tests/chrome/printpreview_bug396024_helper.xul b/layout/base/tests/chrome/printpreview_bug396024_helper.xhtml similarity index 100% rename from layout/base/tests/chrome/printpreview_bug396024_helper.xul rename to layout/base/tests/chrome/printpreview_bug396024_helper.xhtml diff --git a/layout/base/tests/chrome/printpreview_bug482976_helper.xul b/layout/base/tests/chrome/printpreview_bug482976_helper.xhtml similarity index 100% rename from layout/base/tests/chrome/printpreview_bug482976_helper.xul rename to layout/base/tests/chrome/printpreview_bug482976_helper.xhtml diff --git a/layout/base/tests/chrome/printpreview_helper.xul b/layout/base/tests/chrome/printpreview_helper.xhtml similarity index 100% rename from layout/base/tests/chrome/printpreview_helper.xul rename to layout/base/tests/chrome/printpreview_helper.xhtml diff --git a/layout/base/tests/chrome/test_bug1018265.xul b/layout/base/tests/chrome/test_bug1018265.xhtml similarity index 91% rename from layout/base/tests/chrome/test_bug1018265.xul rename to layout/base/tests/chrome/test_bug1018265.xhtml index 20323123ff..898d31dd37 100644 --- a/layout/base/tests/chrome/test_bug1018265.xul +++ b/layout/base/tests/chrome/test_bug1018265.xhtml @@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1018265 SimpleTest.waitForExplicitFinish(); function run() { - window.open("file_bug1018265.xul", "contentViewerTest", "chrome,width=100,height=100"); + window.open("file_bug1018265.xhtml", "contentViewerTest", "chrome,width=100,height=100"); } function done() { diff --git a/layout/base/tests/chrome/test_bug1041200.xul b/layout/base/tests/chrome/test_bug1041200.xhtml similarity index 100% rename from layout/base/tests/chrome/test_bug1041200.xul rename to layout/base/tests/chrome/test_bug1041200.xhtml diff --git a/layout/base/tests/chrome/test_bug420499.xul b/layout/base/tests/chrome/test_bug420499.xhtml similarity index 95% rename from layout/base/tests/chrome/test_bug420499.xul rename to layout/base/tests/chrome/test_bug420499.xhtml index 4e783f191b..433e78fe1a 100644 --- a/layout/base/tests/chrome/test_bug420499.xul +++ b/layout/base/tests/chrome/test_bug420499.xhtml @@ -13,13 +13,13 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=420499 - + - + diff --git a/layout/base/tests/test_bug465448.xul b/layout/base/tests/chrome/test_bug465448.xhtml similarity index 86% rename from layout/base/tests/test_bug465448.xul rename to layout/base/tests/chrome/test_bug465448.xhtml index b90227e8ef..fa9d1589a2 100644 --- a/layout/base/tests/test_bug465448.xul +++ b/layout/base/tests/chrome/test_bug465448.xhtml @@ -7,8 +7,8 @@ xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - - + + diff --git a/layout/base/tests/chrome/test_chrome_over_plugin.xul b/layout/base/tests/chrome/test_chrome_over_plugin.xhtml similarity index 89% rename from layout/base/tests/chrome/test_chrome_over_plugin.xul rename to layout/base/tests/chrome/test_chrome_over_plugin.xhtml index 9d352bdfac..c8a7006227 100644 --- a/layout/base/tests/chrome/test_chrome_over_plugin.xul +++ b/layout/base/tests/chrome/test_chrome_over_plugin.xhtml @@ -17,7 +17,7 @@ // Run the test in a separate window so that the test runs as a chrome // window SpecialPowers.setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); - var w = window.open("chrome_over_plugin_window.xul", "chrome_over_plugin", + var w = window.open("chrome_over_plugin_window.xhtml", "chrome_over_plugin", "chrome,width=200,height=300"); ]]> diff --git a/layout/base/tests/chrome/test_css_visibility_propagation.xul b/layout/base/tests/chrome/test_css_visibility_propagation.xhtml similarity index 100% rename from layout/base/tests/chrome/test_css_visibility_propagation.xul rename to layout/base/tests/chrome/test_css_visibility_propagation.xhtml diff --git a/layout/base/tests/chrome/test_default_background.xul b/layout/base/tests/chrome/test_default_background.xhtml similarity index 91% rename from layout/base/tests/chrome/test_default_background.xul rename to layout/base/tests/chrome/test_default_background.xhtml index 4d690fd79f..804adfdb81 100644 --- a/layout/base/tests/chrome/test_default_background.xul +++ b/layout/base/tests/chrome/test_default_background.xhtml @@ -15,7 +15,7 @@ SimpleTest.waitForExplicitFinish(); // Run the test in a separate window so that the test runs as a chrome // window - window.open("default_background_window.xul", "default_background", + window.open("default_background_window.xhtml", "default_background", "chrome,width=200,height=300"); ]]> diff --git a/layout/base/tests/chrome/test_dialog_with_positioning.html b/layout/base/tests/chrome/test_dialog_with_positioning.html index 7b279411d2..1f1f76681b 100644 --- a/layout/base/tests/chrome/test_dialog_with_positioning.html +++ b/layout/base/tests/chrome/test_dialog_with_positioning.html @@ -12,7 +12,7 @@ SimpleTest.waitForExplicitFinish(); var root = getRootDirectory(window.location.href); -window.openDialog(root + "dialog_with_positioning_window.xul", "dialog_with_positioning", +window.openDialog(root + "dialog_with_positioning_window.xhtml", "dialog_with_positioning", "dialog,chrome"); diff --git a/layout/base/tests/chrome/test_leaf_layers_partition_browser_window.xul b/layout/base/tests/chrome/test_leaf_layers_partition_browser_window.xhtml similarity index 100% rename from layout/base/tests/chrome/test_leaf_layers_partition_browser_window.xul rename to layout/base/tests/chrome/test_leaf_layers_partition_browser_window.xhtml diff --git a/layout/base/tests/chrome/test_printpreview.xul b/layout/base/tests/chrome/test_printpreview.xhtml similarity index 86% rename from layout/base/tests/chrome/test_printpreview.xul rename to layout/base/tests/chrome/test_printpreview.xhtml index 00f34e2401..7ca0990970 100644 --- a/layout/base/tests/chrome/test_printpreview.xul +++ b/layout/base/tests/chrome/test_printpreview.xhtml @@ -10,6 +10,6 @@ diff --git a/layout/base/tests/chrome/test_printpreview_bug396024.xul b/layout/base/tests/chrome/test_printpreview_bug396024.xhtml similarity index 88% rename from layout/base/tests/chrome/test_printpreview_bug396024.xul rename to layout/base/tests/chrome/test_printpreview_bug396024.xhtml index 518995ca96..077d93f5dd 100644 --- a/layout/base/tests/chrome/test_printpreview_bug396024.xul +++ b/layout/base/tests/chrome/test_printpreview_bug396024.xhtml @@ -16,6 +16,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=396024 diff --git a/layout/base/tests/chrome/test_printpreview_bug482976.xul b/layout/base/tests/chrome/test_printpreview_bug482976.xhtml similarity index 88% rename from layout/base/tests/chrome/test_printpreview_bug482976.xul rename to layout/base/tests/chrome/test_printpreview_bug482976.xhtml index 06b8cb19d6..03b2f12682 100644 --- a/layout/base/tests/chrome/test_printpreview_bug482976.xul +++ b/layout/base/tests/chrome/test_printpreview_bug482976.xhtml @@ -16,6 +16,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=482976 diff --git a/layout/base/tests/mochitest.ini b/layout/base/tests/mochitest.ini index 5cf1f80799..9f6c51bc6b 100644 --- a/layout/base/tests/mochitest.ini +++ b/layout/base/tests/mochitest.ini @@ -1,7 +1,6 @@ [DEFAULT] support-files = Ahem.ttf - file_bug465448.html file_bug842853.html file_bug842853.sjs selection-utils.js @@ -41,7 +40,6 @@ skip-if = toolkit == 'android' || (os == 'win' && asan) # Bug 1355817, bug 14609 [test_bug450930.xhtml] skip-if = true # bug 934301 support-files = bug450930.xhtml -[test_bug465448.xul] [test_bug469170.html] [test_bug471126.html] [test_bug499538-1.html] diff --git a/layout/build/components.conf b/layout/build/components.conf index e017f8ba61..0b8de38664 100644 --- a/layout/build/components.conf +++ b/layout/build/components.conf @@ -439,14 +439,6 @@ Classes = [ }, ] -if defined('DEBUG'): - Classes += [ - { - 'cid': '{NS_LAYOUT_DEBUGGER_CID}', - 'type': 'nsILayoutDebugger', - }, - ] - if defined('MOZ_WEBSPEECH'): Classes += [ { diff --git a/layout/build/moz.build b/layout/build/moz.build index ba69e91668..502087ff0e 100644 --- a/layout/build/moz.build +++ b/layout/build/moz.build @@ -39,7 +39,6 @@ LOCAL_INCLUDES += [ '/dom/media', '/dom/offline', '/dom/storage', - '/dom/xbl', '/dom/xslt/base', '/dom/xslt/xml', '/dom/xslt/xpath', diff --git a/layout/build/nsContentDLF.cpp b/layout/build/nsContentDLF.cpp index c13c937083..d4918189ea 100644 --- a/layout/build/nsContentDLF.cpp +++ b/layout/build/nsContentDLF.cpp @@ -24,9 +24,6 @@ #include "nsCharsetSource.h" #include "nsMimeTypes.h" #include "DecoderTraits.h" -#ifdef MOZ_XUL -# include "XULDocument.h" -#endif // plugins #include "nsPluginHost.h" @@ -39,9 +36,13 @@ using mozilla::dom::Document; already_AddRefed NS_NewContentViewer(); -static const char* const gHTMLTypes[] = {TEXT_HTML, VIEWSOURCE_CONTENT_TYPE, +static const char* const gHTMLTypes[] = {TEXT_HTML, + VIEWSOURCE_CONTENT_TYPE, APPLICATION_XHTML_XML, - APPLICATION_WAPXHTML_XML, 0}; + APPLICATION_WAPXHTML_XML, + TEXT_XUL, + APPLICATION_CACHED_XUL, + 0}; static const char* const gXMLTypes[] = {TEXT_XML, APPLICATION_XML, @@ -52,8 +53,6 @@ static const char* const gXMLTypes[] = {TEXT_XML, static const char* const gSVGTypes[] = {IMAGE_SVG_XML, 0}; -static const char* const gXULTypes[] = {TEXT_XUL, APPLICATION_CACHED_XUL, 0}; - static bool IsTypeInList(const nsACString& aType, const char* const aList[]) { int32_t typeIndex; for (typeIndex = 0; aList[typeIndex]; ++typeIndex) { @@ -82,21 +81,6 @@ nsContentDLF::~nsContentDLF() {} NS_IMPL_ISUPPORTS(nsContentDLF, nsIDocumentLoaderFactory) -static bool MayUseXULXBL(nsIChannel* aChannel) { - nsIScriptSecurityManager* securityManager = - nsContentUtils::GetSecurityManager(); - if (!securityManager) { - return false; - } - - nsCOMPtr principal; - securityManager->GetChannelResultPrincipal(aChannel, - getter_AddRefs(principal)); - NS_ENSURE_TRUE(principal, false); - - return nsContentUtils::AllowXULXBLForPrincipal(principal); -} - NS_IMETHODIMP nsContentDLF::CreateInstance(const char* aCommand, nsIChannel* aChannel, nsILoadGroup* aLoadGroup, @@ -179,16 +163,6 @@ nsContentDLF::CreateInstance(const char* aCommand, nsIChannel* aChannel, aDocListener, aDocViewer); } - // Try XUL - if (IsTypeInList(contentType, gXULTypes)) { - if (!MayUseXULXBL(aChannel)) { - return NS_ERROR_REMOTE_XUL; - } - - return CreateXULDocument(aCommand, aChannel, aLoadGroup, aContainer, - aExtraInfo, aDocListener, aDocViewer); - } - if (mozilla::DecoderTraits::ShouldHandleMediaType( contentType.get(), /* DecoderDoctorDiagnostics* */ nullptr)) { @@ -354,41 +328,6 @@ nsresult nsContentDLF::CreateDocument( return NS_OK; } -nsresult nsContentDLF::CreateXULDocument( - const char* aCommand, nsIChannel* aChannel, nsILoadGroup* aLoadGroup, - nsIDocShell* aContainer, nsISupports* aExtraInfo, - nsIStreamListener** aDocListener, nsIContentViewer** aContentViewer) { - RefPtr doc; - nsresult rv = NS_NewXULDocument(getter_AddRefs(doc)); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr contentViewer = NS_NewContentViewer(); - - nsCOMPtr aURL; - rv = aChannel->GetURI(getter_AddRefs(aURL)); - if (NS_FAILED(rv)) return rv; - - /* - * Initialize the document to begin loading the data... - * - * An nsIStreamListener connected to the parser is returned in - * aDocListener. - */ - - doc->SetContainer(static_cast(aContainer)); - - rv = doc->StartDocumentLoad(aCommand, aChannel, aLoadGroup, aContainer, - aDocListener, true); - if (NS_FAILED(rv)) return rv; - - /* - * Bind the document to the Content Viewer... - */ - contentViewer->LoadStart(doc); - contentViewer.forget(aContentViewer); - return NS_OK; -} - bool nsContentDLF::IsImageContentType(const nsACString& aContentType) { return imgLoader::SupportImageWithMimeType(aContentType); } diff --git a/layout/build/nsContentDLF.h b/layout/build/nsContentDLF.h index d95c52fa6b..52526c396d 100644 --- a/layout/build/nsContentDLF.h +++ b/layout/build/nsContentDLF.h @@ -37,12 +37,6 @@ class nsContentDLF final : public nsIDocumentLoaderFactory { nsIStreamListener** aDocListener, nsIContentViewer** aContentViewer); - nsresult CreateXULDocument(const char* aCommand, nsIChannel* aChannel, - nsILoadGroup* aLoadGroup, nsIDocShell* aContainer, - nsISupports* aExtraInfo, - nsIStreamListener** aDocListener, - nsIContentViewer** aContentViewer); - /** * Create a blank document using the given loadgroup and given * principal. aPrincipal is allowed to be null, in which case the diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp index 7474bfff78..dcc2697fee 100644 --- a/layout/build/nsLayoutModule.cpp +++ b/layout/build/nsLayoutModule.cpp @@ -22,7 +22,6 @@ #include "nsHTMLParts.h" #include "nsIContentSerializer.h" #include "nsIContentViewer.h" -#include "nsILayoutDebugger.h" #include "nsPlainTextSerializer.h" #include "nsXMLContentSerializer.h" #include "nsXHTMLContentSerializer.h" @@ -161,10 +160,6 @@ nsresult NS_NewChildProcessMessageManager(nsISupports** aResult); #define MAKE_GENERIC_CTOR2(iface_, func_) \ NS_IMPL_COMPONENT_FACTORY(iface_) { return func_(); } -#ifdef DEBUG -MAKE_GENERIC_CTOR(nsILayoutDebugger, NS_NewLayoutDebugger) -#endif - MAKE_GENERIC_CTOR(nsIFrameTraversal, NS_CreateFrameTraversal) MAKE_GENERIC_CTOR2(nsIContentViewer, NS_NewContentViewer) diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp index d5f9287938..e638b29af8 100644 --- a/layout/build/nsLayoutStatics.cpp +++ b/layout/build/nsLayoutStatics.cpp @@ -35,7 +35,6 @@ #include "nsSprocketLayout.h" #include "nsStackLayout.h" #include "nsTextControlFrame.h" -#include "nsXBLService.h" #include "txMozillaXSLTProcessor.h" #include "nsTreeSanitizer.h" #include "nsCellMap.h" @@ -159,7 +158,6 @@ nsresult nsLayoutStatics::Initialize() { nsGlobalWindowInner::Init(); nsGlobalWindowOuter::Init(); - nsXBLService::Init(); rv = nsContentUtils::Init(); if (NS_FAILED(rv)) { @@ -362,7 +360,6 @@ void nsLayoutStatics::Shutdown() { nsGlobalWindowInner::ShutDown(); nsGlobalWindowOuter::ShutDown(); nsListControlFrame::Shutdown(); - nsXBLService::Shutdown(); FrameLayerBuilder::Shutdown(); CubebUtils::ShutdownLibrary(); diff --git a/layout/forms/crashtests/363696-1.xul b/layout/forms/crashtests/363696-1.xhtml similarity index 100% rename from layout/forms/crashtests/363696-1.xul rename to layout/forms/crashtests/363696-1.xhtml diff --git a/layout/forms/crashtests/373586-1.xhtml b/layout/forms/crashtests/373586-1.xhtml deleted file mode 100644 index 070315d153..0000000000 --- a/layout/forms/crashtests/373586-1.xhtml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - -
- -
- - - - - - diff --git a/layout/forms/crashtests/375299-binding.xml b/layout/forms/crashtests/375299-binding.xml deleted file mode 100644 index ca76a33893..0000000000 --- a/layout/forms/crashtests/375299-binding.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/layout/forms/crashtests/375299.html b/layout/forms/crashtests/375299.html deleted file mode 100644 index 944cc95dd3..0000000000 --- a/layout/forms/crashtests/375299.html +++ /dev/null @@ -1,17 +0,0 @@ - -Testcase bug - Crash [@ nsFileControlFrame::CreateAnonymousContent] when removing stylesheet with binding and removing file input - - - - - - diff --git a/layout/forms/crashtests/382212-1.xhtml b/layout/forms/crashtests/382212-1.xhtml deleted file mode 100644 index 46c957989a..0000000000 --- a/layout/forms/crashtests/382212-1.xhtml +++ /dev/null @@ -1,7 +0,0 @@ - - -
- -
- - diff --git a/layout/forms/crashtests/478219-1.xhtml b/layout/forms/crashtests/478219-1.xhtml deleted file mode 100644 index 47144e649e..0000000000 --- a/layout/forms/crashtests/478219-1.xhtml +++ /dev/null @@ -1,7 +0,0 @@ - -
- - - -
- diff --git a/layout/forms/crashtests/crashtests.list b/layout/forms/crashtests/crashtests.list index f34a15e436..d8144f2744 100644 --- a/layout/forms/crashtests/crashtests.list +++ b/layout/forms/crashtests/crashtests.list @@ -11,7 +11,7 @@ load 317502-1.xhtml load 321894.html load 323499-1.html load 343510-1.html -load 363696-1.xul +load chrome://reftest/content/crashtests/layout/forms/crashtests/363696-1.xhtml load 363696-2.html load 363696-3.html load 366205-1.html @@ -20,12 +20,9 @@ load 367587-1.html load 370703-1.html load 370940-1.html load 370967.html -load 373586-1.xhtml -load 375299.html load 378369.html load 378413-1.xhtml load 380116-1.xhtml -load 382212-1.xhtml load 382610-1.html load 383887-1.html load 386554-1.html @@ -43,7 +40,6 @@ load 451316.html load 455451-1.html load 457537-1.html load 457537-2.html -load 478219-1.xhtml load 498698-1.html load 513113-1.html load 538062-1.xhtml diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 0ad7e31120..3f9ffeb70d 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -343,6 +343,10 @@ bool nsHTMLButtonControlFrame::GetVerticalAlignBaseline( bool nsHTMLButtonControlFrame::GetNaturalBaselineBOffset( mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, nscoord* aBaseline) const { + if (StyleDisplay()->IsContainLayout()) { + return false; + } + nsIFrame* inner = mFrames.FirstChild(); if (MOZ_UNLIKELY(inner->GetWritingMode().IsOrthogonalTo(aWM))) { return false; diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 5e6ce846d7..9010776687 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -9,6 +9,7 @@ #include "nsFontMetrics.h" #include "nsTextControlFrame.h" #include "nsIEditor.h" +#include "nsINodeList.h" //MY68 #include "nsIScrollableFrame.h" #include "nsCaret.h" #include "nsCSSPseudoElements.h" diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index 67a6b1a76e..a95434a830 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -111,8 +111,6 @@ class nsTextControlFrame : public nsContainerFrame, #endif bool IsFrameOfType(uint32_t aFlags) const override { - // nsStackFrame is already both of these, but that's somewhat bogus, - // and we really mean it. return nsContainerFrame::IsFrameOfType( aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); } diff --git a/layout/forms/test/bug665540_window.xul b/layout/forms/test/bug665540_window.xhtml similarity index 100% rename from layout/forms/test/bug665540_window.xul rename to layout/forms/test/bug665540_window.xhtml diff --git a/layout/forms/test/chrome.ini b/layout/forms/test/chrome.ini index 32d862eecc..e8418139b4 100644 --- a/layout/forms/test/chrome.ini +++ b/layout/forms/test/chrome.ini @@ -3,7 +3,7 @@ skip-if = os == 'android' support-files = bug536567_iframe.html bug536567_subframe.html - bug665540_window.xul + bug665540_window.xhtml [test_bug536567_perwindowpb.html] [test_bug665540.html] diff --git a/layout/forms/test/test_bug665540.html b/layout/forms/test/test_bug665540.html index 8495bc12e2..e996fd53df 100644 --- a/layout/forms/test/test_bug665540.html +++ b/layout/forms/test/test_bug665540.html @@ -31,7 +31,7 @@ var eventOffsetX = 2; var eventOffsetY = 2; function openFullscreenWindow() { - win = open("bug665540_window.xul", "_blank", "resizable=yes,chrome"); + win = open("bug665540_window.xhtml", "_blank", "resizable=yes,chrome"); win.addEventListener("sizemodechange", function() { info("sizemodechange. windowState = " + win.windowState + " fullScreen = " + win.fullScreen); diff --git a/layout/generic/CSSOrderAwareFrameIterator.cpp b/layout/generic/CSSOrderAwareFrameIterator.cpp index 0b712a14d1..fceb06e768 100644 --- a/layout/generic/CSSOrderAwareFrameIterator.cpp +++ b/layout/generic/CSSOrderAwareFrameIterator.cpp @@ -5,19 +5,36 @@ /* Iterator class for frame lists that respect CSS "order" during layout */ #include "CSSOrderAwareFrameIterator.h" +#include "nsIFrameInlines.h" + +static bool CanUse(const nsIFrame* aFrame) { + return aFrame->IsFlexOrGridContainer() || aFrame->IsXULBoxFrame() || + (aFrame->GetContent() && + aFrame->GetContent()->IsXULElement(nsGkAtoms::treecols)); +} namespace mozilla { template <> -bool CSSOrderAwareFrameIterator::CSSOrderComparator(nsIFrame* const& a, - nsIFrame* const& b) { - return a->StylePosition()->mOrder < b->StylePosition()->mOrder; +bool CSSOrderAwareFrameIterator::CanUse(const nsIFrame* aFrame) { + return ::CanUse(aFrame); } template <> -bool CSSOrderAwareFrameIterator::CSSBoxOrdinalGroupComparator( +bool ReverseCSSOrderAwareFrameIterator::CanUse(const nsIFrame* aFrame) { + return ::CanUse(aFrame); +} + +template <> +int CSSOrderAwareFrameIterator::CSSOrderComparator(nsIFrame* const& a, + nsIFrame* const& b) { + return a->StylePosition()->mOrder - b->StylePosition()->mOrder; +} + +template <> +int CSSOrderAwareFrameIterator::CSSBoxOrdinalGroupComparator( nsIFrame* const& a, nsIFrame* const& b) { - return a->StyleXUL()->mBoxOrdinal < b->StyleXUL()->mBoxOrdinal; + return a->StyleXUL()->mBoxOrdinal - b->StyleXUL()->mBoxOrdinal; } template <> @@ -38,15 +55,15 @@ nsFrameList::iterator CSSOrderAwareFrameIterator::end( } template <> -bool ReverseCSSOrderAwareFrameIterator::CSSOrderComparator(nsIFrame* const& a, - nsIFrame* const& b) { - return a->StylePosition()->mOrder > b->StylePosition()->mOrder; +int ReverseCSSOrderAwareFrameIterator::CSSOrderComparator(nsIFrame* const& a, + nsIFrame* const& b) { + return b->StylePosition()->mOrder - a->StylePosition()->mOrder; } template <> -bool ReverseCSSOrderAwareFrameIterator::CSSBoxOrdinalGroupComparator( +int ReverseCSSOrderAwareFrameIterator::CSSBoxOrdinalGroupComparator( nsIFrame* const& a, nsIFrame* const& b) { - return a->StyleXUL()->mBoxOrdinal > b->StyleXUL()->mBoxOrdinal; + return b->StyleXUL()->mBoxOrdinal - a->StyleXUL()->mBoxOrdinal; } template <> diff --git a/layout/generic/CSSOrderAwareFrameIterator.h b/layout/generic/CSSOrderAwareFrameIterator.h index 750750d8de..25d29250b9 100644 --- a/layout/generic/CSSOrderAwareFrameIterator.h +++ b/layout/generic/CSSOrderAwareFrameIterator.h @@ -7,16 +7,12 @@ #ifndef mozilla_CSSOrderAwareFrameIterator_h #define mozilla_CSSOrderAwareFrameIterator_h -#include +#include #include "nsFrameList.h" #include "nsIFrame.h" #include "mozilla/Maybe.h" #include "mozilla/Assertions.h" -#if defined(__clang__) && __clang_major__ == 3 && __clang_minor__ <= 9 -# define CLANG_CRASH_BUG 1 -#endif - namespace mozilla { /** @@ -55,38 +51,38 @@ namespace mozilla { template class CSSOrderAwareFrameIteratorT { public: - enum OrderState { eUnknownOrder, eKnownOrdered, eKnownUnordered }; - enum ChildFilter { eSkipPlaceholders, eIncludeAll }; - enum OrderingProperty { - eUseOrder, // Default behavior: use "order". - eUseBoxOrdinalGroup // Legacy behavior: use prefixed "box-ordinal-group". + enum class OrderState { Unknown, Ordered, Unordered }; + enum class ChildFilter { SkipPlaceholders, IncludeAll }; + enum class OrderingProperty { + Order, // Default behavior: use "order". + BoxOrdinalGroup // Legacy behavior: use prefixed "box-ordinal-group". }; - CSSOrderAwareFrameIteratorT(nsIFrame* aContainer, - nsIFrame::ChildListID aListID, - ChildFilter aFilter = eSkipPlaceholders, - OrderState aState = eUnknownOrder, - OrderingProperty aOrderProp = eUseOrder) + CSSOrderAwareFrameIteratorT( + nsIFrame* aContainer, nsIFrame::ChildListID aListID, + ChildFilter aFilter = ChildFilter::SkipPlaceholders, + OrderState aState = OrderState::Unknown, + OrderingProperty aOrderProp = OrderingProperty::Order) : mChildren(aContainer->GetChildList(aListID)), mArrayIndex(0), mItemIndex(0), - mSkipPlaceholders(aFilter == eSkipPlaceholders) + mSkipPlaceholders(aFilter == ChildFilter::SkipPlaceholders) #ifdef DEBUG , mContainer(aContainer), mListID(aListID) #endif { - MOZ_ASSERT(aContainer->IsFlexOrGridContainer(), + MOZ_ASSERT(CanUse(aContainer), "Only use this iterator in a container that honors 'order'"); size_t count = 0; - bool isOrdered = aState != eKnownUnordered; - if (aState == eUnknownOrder) { + bool isOrdered = aState != OrderState::Unordered; + if (aState == OrderState::Unknown) { auto maxOrder = std::numeric_limits::min(); for (auto* child : mChildren) { ++count; - int32_t order = aOrderProp == eUseBoxOrdinalGroup + int32_t order = aOrderProp == OrderingProperty::BoxOrdinalGroup ? child->StyleXUL()->mBoxOrdinal : child->StylePosition()->mOrder; @@ -106,27 +102,26 @@ class CSSOrderAwareFrameIteratorT { for (Iterator i(begin(mChildren)), iEnd(end(mChildren)); i != iEnd; ++i) { mArray->AppendElement(*i); } - auto comparator = (aOrderProp == eUseBoxOrdinalGroup) + auto comparator = aOrderProp == OrderingProperty::BoxOrdinalGroup ? CSSBoxOrdinalGroupComparator : CSSOrderComparator; - - // XXX replace this with nsTArray::StableSort when bug 1147091 is fixed. - std::stable_sort(mArray->begin(), mArray->end(), comparator); + mArray->StableSort(comparator); } if (mSkipPlaceholders) { SkipPlaceholders(); } } + + CSSOrderAwareFrameIteratorT(CSSOrderAwareFrameIteratorT&&) = default; + ~CSSOrderAwareFrameIteratorT() { MOZ_ASSERT(IsForward() == mItemCount.isNothing()); } bool IsForward() const; - Iterator begin(const nsFrameList& aList); - Iterator end(const nsFrameList& aList); - nsIFrame* operator*() const { + nsIFrame* get() const { MOZ_ASSERT(!AtEnd()); if (mIter.isSome()) { return **mIter; @@ -134,6 +129,8 @@ class CSSOrderAwareFrameIteratorT { return (*mArray)[mArrayIndex]; } + nsIFrame* operator*() const { return get(); } + /** * Return the child index of the current item, placeholders not counted. * It's forbidden to call this method when the current frame is placeholder. @@ -148,10 +145,8 @@ class CSSOrderAwareFrameIteratorT { } void SetItemCount(size_t aItemCount) { -#ifndef CLANG_CRASH_BUG MOZ_ASSERT(mIter.isSome() || aItemCount <= mArray->Length(), "item count mismatch"); -#endif mItemCount.emplace(aItemCount); // Note: it's OK if mItemIndex underflows -- ItemIndex() // will not be called unless there is at least one item. @@ -180,10 +175,7 @@ class CSSOrderAwareFrameIteratorT { } bool AtEnd() const { -#ifndef CLANG_CRASH_BUG - // Clang 3.6.2 crashes when compiling this assertion: MOZ_ASSERT(mIter.isSome() || mArrayIndex <= mArray->Length()); -#endif return mIter ? (*mIter == *mIterEnd) : mArrayIndex >= mArray->Length(); } @@ -208,7 +200,7 @@ class CSSOrderAwareFrameIteratorT { } } - void Reset(ChildFilter aFilter = eSkipPlaceholders) { + void Reset(ChildFilter aFilter = ChildFilter::SkipPlaceholders) { if (mIter.isSome()) { mIter.reset(); mIter.emplace(begin(mChildren)); @@ -218,7 +210,7 @@ class CSSOrderAwareFrameIteratorT { mArrayIndex = 0; } mItemIndex = IsForward() ? 0 : *mItemCount - 1; - mSkipPlaceholders = aFilter == eSkipPlaceholders; + mSkipPlaceholders = aFilter == ChildFilter::SkipPlaceholders; if (mSkipPlaceholders) { SkipPlaceholders(); } @@ -234,11 +226,16 @@ class CSSOrderAwareFrameIteratorT { bool ItemsAreAlreadyInOrder() const { return mIter.isSome(); } - static bool CSSOrderComparator(nsIFrame* const& a, nsIFrame* const& b); - static bool CSSBoxOrdinalGroupComparator(nsIFrame* const& a, - nsIFrame* const& b); - private: + static bool CanUse(const nsIFrame*); + + Iterator begin(const nsFrameList& aList); + Iterator end(const nsFrameList& aList); + + static int CSSOrderComparator(nsIFrame* const& a, nsIFrame* const& b); + static int CSSBoxOrdinalGroupComparator(nsIFrame* const& a, + nsIFrame* const& b); + nsFrameList mChildren; // Used if child list is already in ascending 'order'. Maybe mIter; diff --git a/layout/generic/FrameClasses.py b/layout/generic/FrameClasses.py index 4606cfafdb..e558346c34 100644 --- a/layout/generic/FrameClasses.py +++ b/layout/generic/FrameClasses.py @@ -96,7 +96,6 @@ FRAME_CLASSES = [ Frame("nsPageSequenceFrame", "PageSequence", NOT_LEAF), Frame("nsSliderFrame", "Slider", NOT_LEAF), Frame("nsSplitterFrame", "Box", NOT_LEAF), - Frame("nsStackFrame", "Box", NOT_LEAF), Frame("nsSubDocumentFrame", "SubDocument", LEAF), Frame("PrintedSheetFrame", "PrintedSheet", NOT_LEAF), Frame("SVGAFrame", "SVGA", NOT_LEAF), diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index 5691e16b30..d0e15c5b18 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -6,29 +6,31 @@ #include "mozilla/ReflowInput.h" +#include + +#include "CounterStyleManager.h" #include "LayoutLogging.h" -#include "nsStyleConsts.h" -#include "nsCSSAnonBoxes.h" -#include "nsIFrame.h" -#include "nsIContent.h" -#include "nsGkAtoms.h" -#include "nsPresContext.h" -#include "nsFontMetrics.h" +#include "mozilla/dom/HTMLInputElement.h" +#include "mozilla/SVGUtils.h" #include "nsBlockFrame.h" -#include "nsLineBox.h" +#include "nsCSSAnonBoxes.h" +#include "nsFlexContainerFrame.h" +#include "nsFontInflationData.h" +#include "nsFontMetrics.h" +#include "nsGkAtoms.h" +#include "nsGridContainerFrame.h" +#include "nsIContent.h" +#include "nsIFrame.h" +#include "nsIFrameInlines.h" #include "nsImageFrame.h" -#include "nsTableFrame.h" -#include "nsTableCellFrame.h" #include "nsIPercentBSizeObserver.h" #include "nsLayoutUtils.h" -#include "nsFontInflationData.h" +#include "nsLineBox.h" +#include "nsPresContext.h" +#include "nsStyleConsts.h" +#include "nsTableCellFrame.h" +#include "nsTableFrame.h" #include "StickyScrollContainer.h" -#include "nsIFrameInlines.h" -#include "CounterStyleManager.h" -#include -#include "mozilla/SVGUtils.h" -#include "mozilla/dom/HTMLInputElement.h" -#include "nsGridContainerFrame.h" using namespace mozilla; using namespace mozilla::css; @@ -674,6 +676,16 @@ void ReflowInput::InitResizeFlags(nsPresContext* aPresContext, !mStylePosition->mOffset.GetBEnd(wm).IsAuto() || mFrame->IsXULBoxFrame(); + // If mFrame is a flex item, and mFrame's block axis is the flex container's + // main axis (e.g. in a column-oriented flex container with same + // writing-mode), then its block-size depends on its CB size, if its + // flex-basis has a percentage. + if (mFrame->IsFlexItem() && + !nsFlexContainerFrame::IsItemInlineAxisMainAxis(mFrame)) { + const auto& flexBasis = mStylePosition->mFlexBasis; + dependsOnCBBSize |= (flexBasis.IsSize() && flexBasis.AsSize().HasPercent()); + } + if (mStyleText->mLineHeight.IsMozBlockHeight()) { // line-height depends on block bsize mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE); diff --git a/layout/generic/ReflowOutput.cpp b/layout/generic/ReflowOutput.cpp index a2ae42ce85..9cfe196616 100644 --- a/layout/generic/ReflowOutput.cpp +++ b/layout/generic/ReflowOutput.cpp @@ -10,16 +10,12 @@ namespace mozilla { void OverflowAreas::UnionWith(const OverflowAreas& aOther) { - // Bug 1677642: We should probably change scrollable overflow to use - // UnionRectEdges (but leave ink overflow using UnionRect) InkOverflow().UnionRect(InkOverflow(), aOther.InkOverflow()); ScrollableOverflow().UnionRect(ScrollableOverflow(), aOther.ScrollableOverflow()); } void OverflowAreas::UnionAllWith(const nsRect& aRect) { - // Bug 1677642: We should probably change scrollable overflow to use - // UnionRectEdges (but leave ink overflow using UnionRect). InkOverflow().UnionRect(InkOverflow(), aRect); ScrollableOverflow().UnionRect(ScrollableOverflow(), aRect); } diff --git a/layout/generic/WritingModes.h b/layout/generic/WritingModes.h index 0286c59364..ab89ba5512 100644 --- a/layout/generic/WritingModes.h +++ b/layout/generic/WritingModes.h @@ -1425,6 +1425,16 @@ class LogicalMargin { mMargin.bottom == 0); } + bool operator==(const LogicalMargin& aMargin) const { + CHECK_WRITING_MODE(aMargin.GetWritingMode()); + return mMargin == aMargin.mMargin; + } + + bool operator!=(const LogicalMargin& aMargin) const { + CHECK_WRITING_MODE(aMargin.GetWritingMode()); + return mMargin != aMargin.mMargin; + } + LogicalMargin operator+(const LogicalMargin& aMargin) const { CHECK_WRITING_MODE(aMargin.GetWritingMode()); return LogicalMargin(GetWritingMode(), BStart() + aMargin.BStart(), diff --git a/layout/generic/crashtests/1003441.xul b/layout/generic/crashtests/1003441.xhtml similarity index 100% rename from layout/generic/crashtests/1003441.xul rename to layout/generic/crashtests/1003441.xhtml diff --git a/layout/generic/crashtests/1520798-1.xul b/layout/generic/crashtests/1520798-1.xhtml similarity index 100% rename from layout/generic/crashtests/1520798-1.xul rename to layout/generic/crashtests/1520798-1.xhtml diff --git a/layout/generic/crashtests/1682686-1.html b/layout/generic/crashtests/1682686-1.html new file mode 100644 index 0000000000..10bbf5077c --- /dev/null +++ b/layout/generic/crashtests/1682686-1.html @@ -0,0 +1,60 @@ + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+TEST +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/layout/generic/crashtests/1682686-2.html b/layout/generic/crashtests/1682686-2.html new file mode 100644 index 0000000000..3aef0e7c1f --- /dev/null +++ b/layout/generic/crashtests/1682686-2.html @@ -0,0 +1,35 @@ + + + +
1 +
2 +
3 +
4 +
5 +
6 +
7 +
8 +
9 +
10 +
11 +
12 +
13 +
14 +
15 +
16 +
17 +
18 +
19 +
20 +
21 +
22 +
23 +
24 +
25 +
26 diff --git a/layout/generic/crashtests/1683126.html b/layout/generic/crashtests/1683126.html new file mode 100644 index 0000000000..8d08ab3127 --- /dev/null +++ b/layout/generic/crashtests/1683126.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/layout/generic/crashtests/1728319.html b/layout/generic/crashtests/1728319.html new file mode 100644 index 0000000000..1ef3bf1554 --- /dev/null +++ b/layout/generic/crashtests/1728319.html @@ -0,0 +1,11 @@ + + + + + + diff --git a/layout/generic/crashtests/1730506.html b/layout/generic/crashtests/1730506.html new file mode 100644 index 0000000000..9910e5e016 --- /dev/null +++ b/layout/generic/crashtests/1730506.html @@ -0,0 +1,21 @@ + + + + + + + + + +
+ diff --git a/layout/generic/crashtests/321224.xul b/layout/generic/crashtests/321224.xhtml similarity index 100% rename from layout/generic/crashtests/321224.xul rename to layout/generic/crashtests/321224.xhtml diff --git a/layout/generic/crashtests/322780-1.xul b/layout/generic/crashtests/322780-1.xhtml similarity index 100% rename from layout/generic/crashtests/322780-1.xul rename to layout/generic/crashtests/322780-1.xhtml diff --git a/layout/generic/crashtests/374090.html b/layout/generic/crashtests/374090.html deleted file mode 100644 index 250f8c11da..0000000000 --- a/layout/generic/crashtests/374090.html +++ /dev/null @@ -1,11 +0,0 @@ -
  • - - - \ No newline at end of file diff --git a/layout/generic/crashtests/374420.xhtml b/layout/generic/crashtests/374420.xhtml deleted file mode 100644 index e1cfa13dd9..0000000000 --- a/layout/generic/crashtests/374420.xhtml +++ /dev/null @@ -1,34 +0,0 @@ - -Testcase bug - Crash [@ nsHTMLReflowState::GetNearestContainingBlock] with testcase using generated content, xbl and mathml - - -
    -
    -
    - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/layout/generic/crashtests/382745-1-binding.xml b/layout/generic/crashtests/382745-1-binding.xml deleted file mode 100644 index de8047e0c2..0000000000 --- a/layout/generic/crashtests/382745-1-binding.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/layout/generic/crashtests/382745-1.xhtml b/layout/generic/crashtests/382745-1.xhtml deleted file mode 100644 index 1b98c79f90..0000000000 --- a/layout/generic/crashtests/382745-1.xhtml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/layout/generic/crashtests/385885-1.xul b/layout/generic/crashtests/385885-1.xul deleted file mode 100644 index e36a41034d..0000000000 --- a/layout/generic/crashtests/385885-1.xul +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/layout/generic/crashtests/401042-1.xhtml b/layout/generic/crashtests/401042-1.xhtml deleted file mode 100644 index 15395eec9d..0000000000 --- a/layout/generic/crashtests/401042-1.xhtml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - -
    //
    - - \ No newline at end of file diff --git a/layout/generic/crashtests/414180-1.xul b/layout/generic/crashtests/414180-1.xhtml similarity index 100% rename from layout/generic/crashtests/414180-1.xul rename to layout/generic/crashtests/414180-1.xhtml diff --git a/layout/generic/crashtests/417109-1.xhtml b/layout/generic/crashtests/417109-1.xhtml deleted file mode 100644 index f1b93c4c68..0000000000 --- a/layout/generic/crashtests/417109-1.xhtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - ‏ك쪄 - - - - - - - - - - -
    - - diff --git a/layout/generic/crashtests/420785-1.xhtml b/layout/generic/crashtests/420785-1.xhtml deleted file mode 100644 index 3d2d985e25..0000000000 --- a/layout/generic/crashtests/420785-1.xhtml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - a b - - - - - - - - - - diff --git a/layout/generic/crashtests/429458.xhtml b/layout/generic/crashtests/429458.xhtml deleted file mode 100644 index a3597516f2..0000000000 --- a/layout/generic/crashtests/429458.xhtml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/layout/generic/crashtests/442860-1.xul b/layout/generic/crashtests/442860-1.xhtml similarity index 100% rename from layout/generic/crashtests/442860-1.xul rename to layout/generic/crashtests/442860-1.xhtml diff --git a/layout/generic/crashtests/463785.xhtml b/layout/generic/crashtests/463785.xhtml deleted file mode 100644 index d6369785ee..0000000000 --- a/layout/generic/crashtests/463785.xhtml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - -
    -
    -
    - - - - -
    - - - - -
    -m - -
    -
    -
    - - -
    -
    - - - diff --git a/layout/generic/crashtests/499885-1.xhtml b/layout/generic/crashtests/499885-1.xhtml deleted file mode 100644 index 86f1b1d505..0000000000 --- a/layout/generic/crashtests/499885-1.xhtml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/layout/generic/crashtests/508816-1.xul b/layout/generic/crashtests/508816-1.xhtml similarity index 100% rename from layout/generic/crashtests/508816-1.xul rename to layout/generic/crashtests/508816-1.xhtml diff --git a/layout/generic/crashtests/578977.html b/layout/generic/crashtests/578977.html index 2d595c908d..a378f575f4 100644 --- a/layout/generic/crashtests/578977.html +++ b/layout/generic/crashtests/578977.html @@ -5,7 +5,7 @@ - + diff --git a/layout/generic/crashtests/578977.xul b/layout/generic/crashtests/578977.xhtml similarity index 100% rename from layout/generic/crashtests/578977.xul rename to layout/generic/crashtests/578977.xhtml diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index aa4e8941ef..50edcabc0a 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -21,8 +21,8 @@ load 309322-2.html load 309322-3.html load 309322-4.html load 310556-1.xhtml -load 321224.xul -load 322780-1.xul +load chrome://reftest/content/crashtests/layout/generic/crashtests/321224.xhtml +load chrome://reftest/content/crashtests/layout/generic/crashtests/322780-1.xhtml load 323381-1.html load 323381-2.html load 323386-1.html @@ -37,7 +37,7 @@ load 331292.html load 334105-1.xhtml load 334107-1.xhtml load 334147-1.xhtml -asserts(1-18) load 334148-1.xhtml # XBL interacts poorly with CSS counters. +load 334148-1.xhtml load 334602-1.html load 337412-1.html load 337883-1.html @@ -97,8 +97,6 @@ load 371566-1.xhtml load 372376-1.xhtml load 373859-1.html load 373868-1.xhtml -load 374090.html -load 374420.xhtml load 375462-1.html load 375831.html load 376419.html @@ -115,7 +113,6 @@ load 382199-1.html load 382208-1.xhtml load 382262-1.html load 382396-1.xhtml -load 382745-1.xhtml # Bug 758695 load 383089-1.html load 385265-1.xhtml load 385295-1.xhtml @@ -126,7 +123,6 @@ load 385414-2.html load 385426-1.html load 385526.html load 385681.html -load 385885-1.xul load 386799-1.html load 386807-1.html load 386812-1.html @@ -190,7 +186,6 @@ load 400232-1.html load 400244-1.html load 400768-1.xhtml load 400768-2.xhtml -load 401042-1.xhtml load 401042-2.html load 402380-1.html load 402380-2.html @@ -239,14 +234,13 @@ load 413582-1.xhtml load 413582-2.html load 413712-1.xhtml # bug 1323680 load 414061-1.html -load 414180-1.xul +load chrome://reftest/content/crashtests/layout/generic/crashtests/414180-1.xhtml load 414719-1.html load 415685-1.html load 415818.xhtml load 416165.html load 416264-1.html load 416476-1.html -load 417109-1.xhtml load 417848-1.xhtml load 417902-1.html load 417902-2.html @@ -255,7 +249,6 @@ load 418932-1.html load 419352.html load 420000-1.html load 420718.html -load 420785-1.xhtml load 421404-1.html load 421671.html load 422283-1.html @@ -268,7 +261,6 @@ load 425253-1.html load 426040-1.html load 426272-1.html load 428263-1.html -load 429458.xhtml load 429960-1.html load 429960-2.html load 429969-1.html @@ -293,7 +285,7 @@ load 437565-3.xhtml load 438259-1.html load 438266-1.html skip load 438509-1.html # bug 511234 -load 442860-1.xul +load chrome://reftest/content/crashtests/layout/generic/crashtests/442860-1.xhtml load 443528-1.html load 444230-1.html load 444484-1.html @@ -323,7 +315,6 @@ load 463350-1.html load 463350-2.html load 463350-3.html load 463741-1.html -load 463785.xhtml load 465651-1.html load 467137-1.html load 467213-1.html @@ -352,7 +343,7 @@ load 478170-1.html load 478185-1.html load 478504.html asserts-if(!Android,0-1) load 479938-1.html # Bug 575011 -asserts(20) load 480345-1.html # bug 1655630 +load 480345-1.html load 481921.html load 489462-1.html load 489477.html @@ -370,7 +361,6 @@ load 496742.html load 499138.html load 499857-1.html load 499862-1.html -asserts(0-3) load 499885-1.xhtml # Bug 1220265 load 501535-1.html load 503961-1.xhtml load 503961-2.html @@ -378,7 +368,7 @@ load 505912-1.html load 507566.html load 508154-1.xhtml load 508168-1.html -load 508816-1.xul +load chrome://reftest/content/crashtests/layout/generic/crashtests/508816-1.xhtml load 508908-1.html load 509749-1.html load 511482.html @@ -420,7 +410,7 @@ load 570289-1.html load 571618-1.svg asserts(0-1) load 571975-1.html # bug 574889 load 571995.xhtml -asserts(1) load 574958.xhtml # bug 1655630 +load 574958.xhtml asserts(0-6) load 578977.html # bug 757305 load 580504-1.xhtml load 585598-1.xhtml @@ -579,10 +569,10 @@ load 986899.html load 1001233.html load 1001258-1.html load 1001994.html -load 1003441.xul +skip-if(ThreadSanitizer) load chrome://reftest/content/crashtests/layout/generic/crashtests/1003441.xhtml load 1015562.html -asserts(1-2) asserts-if(Android,1-3) load 1015563-1.html -asserts(1-2) load 1015563-2.html +load 1015563-1.html +load 1015563-2.html load 1015844.html asserts-if(Android,0-358) pref(font.size.inflation.minTwips,200) load 1032450.html # Bug 1607658 load 1032613-1.svg @@ -712,7 +702,7 @@ load 1474768.html load 1478178.html load 1483972.html load 1486457.html -asserts(9) asserts-if(Android,14) load 1488762-1.html # asserts from integer overflow & bogus sizes +asserts(2-4) asserts-if(Android,14) load 1488762-1.html # asserts from integer overflow & bogus sizes load 1489287.html load 1489863.html load 1489770.html @@ -731,7 +721,7 @@ load 1513282.html load 1515124.html load 1517033.html load 1517297.html -load 1520798-1.xul +load chrome://reftest/content/crashtests/layout/generic/crashtests/1520798-1.xhtml load 1520798-2.html load 1528771.html load 1539656.html @@ -784,7 +774,7 @@ load 1633737-5.html load 1640028.html load 1640051.html load 1640275.html -pref(layout.accessiblecaret.enabled,true) load 1644819.html +pref(layout.accessiblecaret.enabled,true) asserts(16-18) load 1644819.html # bug 1688115 load 1645549-1.html load 1648577.html load 1652618.html @@ -798,9 +788,14 @@ HTTP load 1677518-1.html load 1679794.html load 1680406.html load 1681788.html +pref(layout.css.grid-item-baxis-measurement.enabled,true) load 1682686-1.html +pref(layout.css.grid-item-baxis-measurement.enabled,true) load 1682686-2.html HTTP load 1682882.html +load 1683126.html load 1697262-1.html pref(layout.css.aspect-ratio.enabled,true) load 1682032.html pref(layout.css.aspect-ratio.enabled,true) load 1699263.html pref(layout.css.aspect-ratio.enabled,true) load 1699468.html +load 1728319.html +asserts(4-8) load 1730506.html # asserts from integer overflow & bogus sizes asserts(1-4) load 1730570.html # asserts from integer overflow & bogus sizes diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 396db4371e..e75d6924ce 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -566,14 +566,14 @@ nscoord nsBlockFrame::GetLogicalBaseline(WritingMode aWM) const { bool nsBlockFrame::GetNaturalBaselineBOffset( mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, nscoord* aBaseline) const { - if (aBaselineGroup == BaselineSharingGroup::First) { - return nsLayoutUtils::GetFirstLineBaseline(aWM, this, aBaseline); - } - if (StyleDisplay()->IsContainLayout()) { return false; } + if (aBaselineGroup == BaselineSharingGroup::First) { + return nsLayoutUtils::GetFirstLineBaseline(aWM, this, aBaseline); + } + for (ConstReverseLineIterator line = LinesRBegin(), line_end = LinesREnd(); line != line_end; ++line) { if (line->IsBlock()) { @@ -1529,8 +1529,8 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics, } nsRect areaBounds = nsRect(0, 0, aMetrics.Width(), aMetrics.Height()); - ComputeOverflowAreas(areaBounds, reflowInput->mStyleDisplay, - blockEndEdgeOfChildren, aMetrics.mOverflowAreas); + aMetrics.mOverflowAreas = ComputeOverflowAreas( + areaBounds, reflowInput->mStyleDisplay, blockEndEdgeOfChildren); // Factor overflow container child bounds into the overflow area aMetrics.mOverflowAreas.UnionWith(ocBounds); // Factor pushed float child bounds into the overflow area @@ -2096,10 +2096,9 @@ static void ConsiderBlockEndEdgeOfChildren(const WritingMode aWritingMode, } } -void nsBlockFrame::ComputeOverflowAreas(const nsRect& aBounds, - const nsStyleDisplay* aDisplay, - nscoord aBEndEdgeOfChildren, - OverflowAreas& aOverflowAreas) { +OverflowAreas nsBlockFrame::ComputeOverflowAreas(const nsRect& aBounds, + const nsStyleDisplay* aDisplay, + nscoord aBEndEdgeOfChildren) { // Compute the overflow areas of our children // XXX_perf: This can be done incrementally. It is currently one of // the things that makes incremental reflow O(N^2). @@ -2141,7 +2140,7 @@ void nsBlockFrame::ComputeOverflowAreas(const nsRect& aBounds, ToString(areas.ScrollableOverflow()).c_str()); #endif - aOverflowAreas = areas; + return areas; } void nsBlockFrame::UnionChildOverflow(OverflowAreas& aOverflowAreas) { diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 7c5ad56593..2a74db1419 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -470,10 +470,9 @@ class nsBlockFrame : public nsContainerFrame { BlockReflowInput& aState, ReflowOutput& aMetrics, nscoord* aBEndEdgeOfChildren); - void ComputeOverflowAreas(const nsRect& aBounds, - const nsStyleDisplay* aDisplay, - nscoord aBEndEdgeOfChildren, - mozilla::OverflowAreas& aOverflowAreas); + mozilla::OverflowAreas ComputeOverflowAreas(const nsRect& aBounds, + const nsStyleDisplay* aDisplay, + nscoord aBEndEdgeOfChildren); /** * Add the frames in aFrameList to this block after aPrevSibling. diff --git a/layout/generic/nsCanvasFrame.cpp b/layout/generic/nsCanvasFrame.cpp index a8891cfd2e..5d5007a8a3 100644 --- a/layout/generic/nsCanvasFrame.cpp +++ b/layout/generic/nsCanvasFrame.cpp @@ -149,7 +149,7 @@ nsresult nsCanvasFrame::CreateAnonymousContent( // Create a popupgroup element for chrome privileged top level non-XUL // documents to support context menus and tooltips. if (PresContext()->IsChrome() && PresContext()->IsRoot() && - doc->AllowXULXBL() && !doc->IsXULDocument()) { + doc->AllowXULXBL()) { nsNodeInfoManager* nodeInfoManager = doc->NodeInfoManager(); RefPtr nodeInfo = nodeInfoManager->GetNodeInfo(nsGkAtoms::popupgroup, nullptr, @@ -159,6 +159,9 @@ nsresult nsCanvasFrame::CreateAnonymousContent( nodeInfo.forget(), dom::NOT_FROM_PARSER); NS_ENSURE_SUCCESS(rv, rv); + mPopupgroupContent->SetProperty(nsGkAtoms::docLevelNativeAnonymousContent, + reinterpret_cast(true)); + aElements.AppendElement(mPopupgroupContent); nodeInfo = nodeInfoManager->GetNodeInfo( @@ -175,9 +178,21 @@ nsresult nsCanvasFrame::CreateAnonymousContent( mTooltipContent->SetAttr(kNameSpaceID_None, nsGkAtoms::page, u"true"_ns, false); + mTooltipContent->SetProperty(nsGkAtoms::docLevelNativeAnonymousContent, + reinterpret_cast(true)); + aElements.AppendElement(mTooltipContent); } +#ifdef DEBUG + for (auto& element : aElements) { + MOZ_ASSERT(element.mContent->GetProperty( + nsGkAtoms::docLevelNativeAnonymousContent), + "NAC from the canvas frame needs to be document-level, otherwise" + " it (1) inherits from the document which is unexpected, and (2)" + " StyleChildrenIterator won't be able to find it properly"); + } +#endif return NS_OK; } @@ -700,27 +715,39 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, // unconstrained; that's ok. Consumers should watch out for that. SetSize(nsSize(aReflowInput.ComputedWidth(), aReflowInput.ComputedHeight())); - // Reflow our one and only normal child frame. It's either the root + // Reflow our children. Typically, we only have one child - the root // element's frame or a placeholder for that frame, if the root element - // is abs-pos or fixed-pos. We may have additional children which - // are placeholders for continuations of fixed-pos content, but those - // don't need to be reflowed. The normal child is always comes before - // the fixed-pos placeholders, because we insert it at the start - // of the child list, above. - ReflowOutput kidDesiredSize(aReflowInput); - if (mFrames.IsEmpty()) { - // We have no child frame, so return an empty size - aDesiredSize.Width() = aDesiredSize.Height() = 0; - } else if (mFrames.FirstChild() != mPopupSetFrame) { - nsIFrame* kidFrame = mFrames.FirstChild(); - bool kidDirty = kidFrame->HasAnyStateBits(NS_FRAME_IS_DIRTY); + // is abs-pos or fixed-pos. Note that this child might be missing though + // if that frame was Complete in one of our earlier continuations. This + // happens when we create additional pages purely to make room for painting + // overflow (painted by BuildPreviousPageOverflow in nsPageFrame.cpp). + // We may have additional children which are placeholders for continuations + // of fixed-pos content, see nsCSSFrameConstructor::ReplicateFixedFrames. + // We may also have a nsPopupSetFrame child (mPopupSetFrame). + const WritingMode wm = aReflowInput.GetWritingMode(); + aDesiredSize.SetSize(wm, aReflowInput.ComputedSize()); + if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) { + // Set the block-size to zero for now in case we don't have any non- + // placeholder children that would update the size in the loop below. + aDesiredSize.BSize(wm) = nscoord(0); + } + aDesiredSize.SetOverflowAreasToDesiredBounds(); + nsIFrame* nextKid = nullptr; + for (auto* kidFrame = mFrames.FirstChild(); kidFrame; kidFrame = nextKid) { + nextKid = kidFrame->GetNextSibling(); + if (kidFrame == mPopupSetFrame) { + // This child is handled separately after this loop. + continue; + } + ReflowOutput kidDesiredSize(aReflowInput); + bool kidDirty = kidFrame->HasAnyStateBits(NS_FRAME_IS_DIRTY); WritingMode kidWM = kidFrame->GetWritingMode(); auto availableSize = aReflowInput.AvailableSize(kidWM); nscoord bOffset = 0; nscoord canvasBSizeSum = 0; - WritingMode wm = aReflowInput.GetWritingMode(); if (prevCanvasFrame && availableSize.BSize(kidWM) != NS_UNCONSTRAINEDSIZE && + !kidFrame->IsPlaceholderFrame() && StaticPrefs::layout_display_list_improve_fragmentation()) { for (auto* pif = prevCanvasFrame; pif; pif = static_cast(pif->GetPrevInFlow())) { @@ -747,7 +774,6 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, availableSize.BSize(kidWM) -= bOffset; } - LogicalSize finalSize = aReflowInput.ComputedSize(); if (MOZ_LIKELY(availableSize.BSize(kidWM) > 0)) { ReflowInput kidReflowInput(aPresContext, aReflowInput, kidFrame, availableSize); @@ -764,18 +790,17 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, LogicalPoint kidPt(kidWM, margin.IStart(kidWM), margin.BStart(kidWM)); (kidWM.IsOrthogonalTo(wm) ? kidPt.I(kidWM) : kidPt.B(kidWM)) += bOffset; - // Reflow the frame + nsReflowStatus kidStatus; ReflowChild(kidFrame, aPresContext, kidDesiredSize, kidReflowInput, kidWM, - kidPt, containerSize, ReflowChildFlags::Default, aStatus); + kidPt, containerSize, ReflowChildFlags::Default, kidStatus); - // Complete the reflow and position and size the child frame FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput, kidWM, kidPt, containerSize, ReflowChildFlags::ApplyRelativePositioning); - if (!aStatus.IsFullyComplete()) { + if (!kidStatus.IsFullyComplete()) { nsIFrame* nextFrame = kidFrame->GetNextInFlow(); - NS_ASSERTION(nextFrame || aStatus.NextInFlowNeedsReflow(), + NS_ASSERTION(nextFrame || kidStatus.NextInFlowNeedsReflow(), "If it's incomplete and has no nif yet, it must flag a " "nif reflow."); if (!nextFrame) { @@ -788,10 +813,11 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, // aren't any other frames we need to isolate them from // during reflow. } - if (aStatus.IsOverflowIncomplete()) { + if (kidStatus.IsOverflowIncomplete()) { nextFrame->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); } } + aStatus.MergeCompletionStatusFrom(kidStatus); // If the child frame was just inserted, then we're responsible for making // sure it repaints @@ -809,25 +835,31 @@ void nsCanvasFrame::Reflow(nsPresContext* aPresContext, } // Return our desired size. Normally it's what we're told, but - // sometimes we can be given an unconstrained height (when a window - // is sizing-to-content), and we should compute our desired height. - if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE) { + // sometimes we can be given an unconstrained block-size (when a window + // is sizing-to-content), and we should compute our desired block-size. + if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE && + !kidFrame->IsPlaceholderFrame()) { + LogicalSize finalSize = aReflowInput.ComputedSize(); finalSize.BSize(wm) = kidFrame->GetLogicalSize(wm).BSize(wm) + kidReflowInput.ComputedLogicalMargin(wm).BStartEnd(wm); + aDesiredSize.SetSize(wm, finalSize); + aDesiredSize.SetOverflowAreasToDesiredBounds(); } + aDesiredSize.mOverflowAreas.UnionWith(kidDesiredSize.mOverflowAreas + + kidFrame->GetPosition()); + } else if (kidFrame->IsPlaceholderFrame()) { + // Placeholders always fit even if there's no available block-size left. } else { // This only occurs in paginated mode. There is no available space on // this page due to reserving space for overflow from a previous page, - // so we push our child to the next page. - SetOverflowFrames(std::move(mFrames)); + // so we push our child to the next page. Note that we can have some + // placeholders for fixed pos. frames in mFrames too, so we need to be + // careful to only push `kidFrame`. + mFrames.RemoveFrame(kidFrame); + SetOverflowFrames(nsFrameList(kidFrame, kidFrame)); aStatus.SetIncomplete(); } - - aDesiredSize.SetSize(wm, finalSize); - aDesiredSize.SetOverflowAreasToDesiredBounds(); - aDesiredSize.mOverflowAreas.UnionWith(kidDesiredSize.mOverflowAreas + - kidFrame->GetPosition()); } if (prevCanvasFrame) { diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 1c9fb48176..c59d4f2c4d 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -252,7 +252,7 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot, if (MOZ_UNLIKELY(!mProperties.IsEmpty())) { using T = mozilla::FrameProperties::UntypedDescriptor; bool hasO = false, hasOC = false, hasEOC = false, hasBackdrop = false; - mProperties.ForEach([&](const T& aProp, void*) { + mProperties.ForEach([&](const T& aProp, uint64_t) { if (aProp == OverflowProperty()) { hasO = true; } else if (aProp == OverflowContainersProperty()) { @@ -331,22 +331,24 @@ void nsContainerFrame::GetChildLists(nsTArray* aLists) const { mFrames.AppendIfNonempty(aLists, kPrincipalList); using T = mozilla::FrameProperties::UntypedDescriptor; - mProperties.ForEach([this, aLists](const T& aProp, void* aValue) { + mProperties.ForEach([this, aLists](const T& aProp, uint64_t aValue) { typedef const nsFrameList* L; if (aProp == OverflowProperty()) { - L(aValue)->AppendIfNonempty(aLists, kOverflowList); + reinterpret_cast(aValue)->AppendIfNonempty(aLists, kOverflowList); } else if (aProp == OverflowContainersProperty()) { MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers), "found unexpected OverflowContainersProperty"); Unused << this; // silence clang -Wunused-lambda-capture in opt builds - L(aValue)->AppendIfNonempty(aLists, kOverflowContainersList); + reinterpret_cast(aValue)->AppendIfNonempty(aLists, + kOverflowContainersList); } else if (aProp == ExcessOverflowContainersProperty()) { MOZ_ASSERT(IsFrameOfType(nsIFrame::eCanContainOverflowContainers), "found unexpected ExcessOverflowContainersProperty"); Unused << this; // silence clang -Wunused-lambda-capture in opt builds - L(aValue)->AppendIfNonempty(aLists, kExcessOverflowContainersList); + reinterpret_cast(aValue)->AppendIfNonempty( + aLists, kExcessOverflowContainersList); } else if (aProp == BackdropProperty()) { - L(aValue)->AppendIfNonempty(aLists, kBackdropList); + reinterpret_cast(aValue)->AppendIfNonempty(aLists, kBackdropList); } return true; }); @@ -746,22 +748,7 @@ void nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext, if (aView != rootView) return; Element* rootElement = aPresContext->Document()->GetRootElement(); - if (!rootElement || !rootElement->IsXULElement()) { - // Scrollframes use native widgets which don't work well with - // translucent windows, at least in Windows XP. So if the document - // has a root scrollrame it's useless to try to make it transparent, - // we'll just get something broken. - // nsCSSFrameConstructor::ConstructRootFrame constructs root - // scrollframes whenever the root element is not a XUL element, so - // we test for that here. We can't just call - // presShell->GetRootScrollFrame() since that might not have - // been constructed yet. - // We can change this to allow translucent toplevel HTML documents - // (e.g. to do something like Dashboard widgets), once we - // have broad support for translucent scrolled documents, but be - // careful because apparently some Firefox extensions expect - // openDialog("something.html") to produce an opaque window - // even if the HTML doesn't have a background-color set. + if (!rootElement) { return; } @@ -777,12 +764,24 @@ void nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext, RefPtr kungFuDeathGrip(aPresContext); AutoWeakFrame weak(rootFrame); - nsTransparencyMode mode = - nsLayoutUtils::GetFrameTransparency(aFrame, rootFrame); - StyleWindowShadow shadow = rootFrame->StyleUIReset()->mWindowShadow; - nsCOMPtr viewWidget = aView->GetWidget(); - viewWidget->SetTransparencyMode(mode); - windowWidget->SetWindowShadowStyle(shadow); + if (!aPresContext->PresShell()->GetRootScrollFrame()) { + // Scrollframes use native widgets which don't work well with + // translucent windows, at least in Windows XP. So if the document + // has a root scrollrame it's useless to try to make it transparent, + // we'll just get something broken. + // We can change this to allow translucent toplevel HTML documents + // (e.g. to do something like Dashboard widgets), once we + // have broad support for translucent scrolled documents, but be + // careful because apparently some Firefox extensions expect + // openDialog("something.html") to produce an opaque window + // even if the HTML doesn't have a background-color set. + nsTransparencyMode mode = + nsLayoutUtils::GetFrameTransparency(aFrame, rootFrame); + StyleWindowShadow shadow = rootFrame->StyleUIReset()->mWindowShadow; + nsCOMPtr viewWidget = aView->GetWidget(); + viewWidget->SetTransparencyMode(mode); + windowWidget->SetWindowShadowStyle(shadow); + } if (!aRC) return; @@ -790,10 +789,27 @@ void nsContainerFrame::SyncWindowProperties(nsPresContext* aPresContext, return; } - nsBoxLayoutState aState(aPresContext, aRC); - nsSize minSize = rootFrame->GetXULMinSize(aState); - nsSize maxSize = rootFrame->GetXULMaxSize(aState); - + nsSize minSize(0, 0); + nsSize maxSize(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); + if (rootElement->IsXULElement()) { + nsBoxLayoutState aState(aPresContext, aRC); + minSize = rootFrame->GetXULMinSize(aState); + maxSize = rootFrame->GetXULMaxSize(aState); + } else { + auto* pos = rootFrame->StylePosition(); + if (pos->mMinWidth.ConvertsToLength()) { + minSize.width = pos->mMinWidth.ToLength(); + } + if (pos->mMinHeight.ConvertsToLength()) { + minSize.height = pos->mMinHeight.ToLength(); + } + if (pos->mMaxWidth.ConvertsToLength()) { + maxSize.width = pos->mMaxWidth.ToLength(); + } + if (pos->mMaxHeight.ConvertsToLength()) { + maxSize.height = pos->mMaxHeight.ToLength(); + } + } SetSizeConstraints(aPresContext, windowWidget, minSize, maxSize); #endif } diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 155ba24a07..7c3df15fa9 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -74,8 +74,8 @@ static CSSOrderAwareFrameIterator::OrderState OrderStateForIter( const nsFlexContainerFrame* aFlexContainer) { return aFlexContainer->HasAnyStateBits( NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER) - ? CSSOrderAwareFrameIterator::OrderState::eKnownOrdered - : CSSOrderAwareFrameIterator::OrderState::eKnownUnordered; + ? CSSOrderAwareFrameIterator::OrderState::Ordered + : CSSOrderAwareFrameIterator::OrderState::Unordered; } // Returns the OrderingProperty enum that we should pass to @@ -83,8 +83,8 @@ static CSSOrderAwareFrameIterator::OrderState OrderStateForIter( static CSSOrderAwareFrameIterator::OrderingProperty OrderingPropertyForIter( const nsFlexContainerFrame* aFlexContainer) { return IsLegacyBox(aFlexContainer) - ? CSSOrderAwareFrameIterator::OrderingProperty::eUseBoxOrdinalGroup - : CSSOrderAwareFrameIterator::OrderingProperty::eUseOrder; + ? CSSOrderAwareFrameIterator::OrderingProperty::BoxOrdinalGroup + : CSSOrderAwareFrameIterator::OrderingProperty::Order; } // Returns the "align-items" value that's equivalent to the legacy "box-align" @@ -151,14 +151,6 @@ static nscoord PhysicalCoordFromFlexRelativeCoord(nscoord aFlexRelativeCoord, return aContainerSize - aFlexRelativeCoord; } -// Add two nscoord values, using CheckedInt to handle integer overflow. -// This function returns the sum of its two args -- but if we trigger integer -// overflow while adding them, then this function returns nscoord_MAX instead. -static nscoord AddChecked(nscoord aFirst, nscoord aSecond) { - CheckedInt checkedResult = CheckedInt(aFirst) + aSecond; - return checkedResult.isValid() ? checkedResult.value() : nscoord_MAX; -} - // Check if the size is auto or it is a keyword in the block axis. // |aIsInline| should represent whether aSize is in the inline axis, from the // perspective of the writing mode of the flex item that the size comes from. @@ -387,27 +379,38 @@ class nsFlexContainerFrame::FlexItem final { nscoord CrossSize() const { return mCrossSize; } nscoord CrossPosition() const { return mCrossPosn; } + // Lazy getter for mAscent. nscoord ResolvedAscent(bool aUseFirstBaseline) const { - if (mAscent == ReflowOutput::ASK_FOR_BASELINE) { - // XXXdholbert We should probably be using the *container's* writing-mode - // here, instead of the item's -- though it doesn't much matter right - // now, because all of the baseline-handling code here essentially - // assumes that the container & items have the same writing-mode. This - // will matter more (& can be expanded/tested) once we officially support - // logical directions & vertical writing-modes in flexbox, in bug 1079155 - // or a dependency. - // Use GetFirstLineBaseline() or GetLastLineBaseline() as appropriate, - // or just GetLogicalBaseline() if that fails. - bool found = - aUseFirstBaseline - ? nsLayoutUtils::GetFirstLineBaseline(mWM, mFrame, &mAscent) - : nsLayoutUtils::GetLastLineBaseline(mWM, mFrame, &mAscent); - - if (!found) { - mAscent = mFrame->SynthesizeBaselineBOffsetFromBorderBox( - mWM, BaselineSharingGroup::First); - } + // XXXdholbert Two concerns to follow up on here: + // (1) We probably should be checking and reacting to aUseFirstBaseline + // for all of the cases here (e.g. this first one). Maybe we need to store + // two versions of mAscent and choose the appropriate one based on + // aUseFirstBaseline? This is roughly bug 1480850, I think. + // (2) We should be using the *container's* writing-mode (mCBWM) here, + // instead of the item's (mWM). This is essentially bug 1155322. + if (mAscent != ReflowOutput::ASK_FOR_BASELINE) { + return mAscent; } + + // Use GetFirstLineBaseline() or GetLastLineBaseline() as appropriate: + bool found = + aUseFirstBaseline + ? nsLayoutUtils::GetFirstLineBaseline(mWM, mFrame, &mAscent) + : nsLayoutUtils::GetLastLineBaseline(mWM, mFrame, &mAscent); + if (found) { + return mAscent; + } + + // If the nsLayoutUtils getter fails, then ask the frame directly: + auto baselineGroup = aUseFirstBaseline ? BaselineSharingGroup::First + : BaselineSharingGroup::Last; + if (mFrame->GetNaturalBaselineBOffset(mWM, baselineGroup, &mAscent)) { + return mAscent; + } + + // We couldn't determine a baseline, so we synthesize one from border box: + mAscent = mFrame->SynthesizeBaselineBOffsetFromBorderBox( + mWM, BaselineSharingGroup::First); return mAscent; } @@ -450,7 +453,7 @@ class nsFlexContainerFrame::FlexItem final { nscoord BaselineOffsetFromOuterCrossEdge(mozilla::Side aStartSide, bool aUseFirstLineBaseline) const; - float ShareOfWeightSoFar() const { return mShareOfWeightSoFar; } + double ShareOfWeightSoFar() const { return mShareOfWeightSoFar; } bool IsFrozen() const { return mIsFrozen; } @@ -518,6 +521,7 @@ class nsFlexContainerFrame::FlexItem final { bool IsBlockAxisCrossAxis() const { return mIsInlineAxisMainAxis; } WritingMode GetWritingMode() const { return mWM; } + WritingMode ContainingBlockWM() const { return mCBWM; } StyleAlignSelf AlignSelf() const { return mAlignSelf; } StyleAlignFlags AlignSelfFlags() const { return mAlignSelfFlags; } @@ -663,8 +667,8 @@ class nsFlexContainerFrame::FlexItem final { mMainSize = aNewMainSize; } - void SetShareOfWeightSoFar(float aNewShare) { - MOZ_ASSERT(!mIsFrozen || aNewShare == 0.0f, + void SetShareOfWeightSoFar(double aNewShare) { + MOZ_ASSERT(!mIsFrozen || aNewShare == 0.0, "shouldn't be giving this item any share of the weight " "after it's frozen"); mShareOfWeightSoFar = aNewShare; @@ -852,14 +856,18 @@ class nsFlexContainerFrame::FlexItem final { // Mutable b/c it's set & resolved lazily, sometimes via const pointer. See // comment above SetAscent(). - mutable nscoord mAscent = 0; + // We initialize this to ASK_FOR_BASELINE, and opportunistically fill it in + // with a real value if we end up reflowing this flex item. (But if we don't + // reflow this flex item, then this sentinel tells us that we don't know it + // yet & anyone who cares will need to explicitly request it.) + mutable nscoord mAscent = ReflowOutput::ASK_FOR_BASELINE; // Temporary state, while we're resolving flexible widths (for our main size) // XXXdholbert To save space, we could use a union to make these variables // overlay the same memory as some other member vars that aren't touched // until after main-size has been resolved. In particular, these could share // memory with mMainPosn through mAscent, and mIsStretched. - float mShareOfWeightSoFar = 0.0f; + double mShareOfWeightSoFar = 0.0; bool mIsFrozen = false; bool mHadMinViolation = false; @@ -910,7 +918,7 @@ class nsFlexContainerFrame::FlexLine final { // Returns the sum of our FlexItems' outer hypothetical main sizes plus the // sum of main axis {row,column}-gaps between items. // ("outer" = margin-box, and "hypothetical" = before flexing) - nscoord TotalOuterHypotheticalMainSize() const { + AuCoord64 TotalOuterHypotheticalMainSize() const { return mTotalOuterHypotheticalMainSize; } @@ -943,27 +951,13 @@ class nsFlexContainerFrame::FlexLine final { mNumFrozenItems++; } - // Note: If our flex item is (or contains) a table with - // "table-layout:fixed", it may have a value near nscoord_MAX as its - // hypothetical main size. This means we can run into absurdly large sizes - // here, even when the author didn't explicitly specify anything huge. - // We'd really rather not allow that to cause integer overflow (e.g. we - // don't want that to make mTotalOuterHypotheticalMainSize overflow to a - // negative value), because that'd make us incorrectly think that we should - // grow our flex items rather than shrink them when it comes time to - // resolve flexible items. Hence, we sum up the hypothetical sizes using a - // helper function AddChecked() to avoid overflow. - mTotalItemMBP = - AddChecked(mTotalItemMBP, lastItem.MarginBorderPaddingSizeInMainAxis()); - - mTotalOuterHypotheticalMainSize = - AddChecked(mTotalOuterHypotheticalMainSize, lastItem.OuterMainSize()); + mTotalItemMBP += lastItem.MarginBorderPaddingSizeInMainAxis(); + mTotalOuterHypotheticalMainSize += lastItem.OuterMainSize(); // If the item added was not the first item in the line, we add in any gap // space as needed. if (NumItems() >= 2) { - mTotalOuterHypotheticalMainSize = - AddChecked(mTotalOuterHypotheticalMainSize, mMainGapSize); + mTotalOuterHypotheticalMainSize += mMainGapSize; } } @@ -1043,7 +1037,12 @@ class nsFlexContainerFrame::FlexLine final { // {row,columnm}-gaps between items. // (i.e. their flex base sizes, clamped via their min/max-size properties, // plus their main-axis margin/border/padding, plus the sum of the gaps.) - nscoord mTotalOuterHypotheticalMainSize = 0; + // + // This variable uses a 64-bit coord type to avoid integer overflow in case + // several of the individual items have huge hypothetical main sizes, which + // can happen with percent-width table-layout:fixed descendants. We have to + // avoid integer overflow in order to shrink items properly in that scenario. + AuCoord64 mTotalOuterHypotheticalMainSize = 0; nscoord mLineCrossSize = 0; nscoord mFirstBaselineOffset = nscoord_MIN; @@ -1769,7 +1768,6 @@ void nsFlexContainerFrame::ResolveAutoFlexBasisAndMinSize( * - its AvailableBSize * ...and we cache the following as the "value", from the item's ReflowOutput: * - its final content-box BSize - * - its ascent * * The assumption here is that a given flex item measurement from our "value" * won't change unless one of the pieces of the "key" change, or the flex @@ -1822,12 +1820,11 @@ class nsFlexContainerFrame::CachedBAxisMeasurement { // This could/should be const, but it's non-const for now just because it's // assigned via a series of steps in the constructor body: nscoord mBSize; - const nscoord mAscent; public: CachedBAxisMeasurement(const ReflowInput& aReflowInput, const ReflowOutput& aReflowOutput) - : mKey(aReflowInput), mAscent(aReflowOutput.BlockStartAscent()) { + : mKey(aReflowInput) { // To get content-box bsize, we have to subtract off border & padding // (and floor at 0 in case the border/padding are too large): WritingMode itemWM = aReflowInput.GetWritingMode(); @@ -1848,8 +1845,51 @@ class nsFlexContainerFrame::CachedBAxisMeasurement { } nscoord BSize() const { return mBSize; } +}; - nscoord Ascent() const { return mAscent; } +/** + * A cached copy of various metrics from a flex item's most recent final reflow. + * It can be used to determine whether we can optimize away the flex item's + * final reflow, when we perform an incremental reflow of its flex container. + */ +class CachedFinalReflowMetrics final { + public: + CachedFinalReflowMetrics(const ReflowInput& aReflowInput, + const ReflowOutput& aReflowOutput) + : CachedFinalReflowMetrics(aReflowInput.GetWritingMode(), aReflowInput, + aReflowOutput) {} + + CachedFinalReflowMetrics(const FlexItem& aItem, const LogicalSize& aSize) + : mBorderPadding(aItem.BorderPadding().ConvertTo( + aItem.GetWritingMode(), aItem.ContainingBlockWM())), + mSize(aSize), + mTreatBSizeAsIndefinite(aItem.TreatBSizeAsIndefinite()) {} + + const LogicalSize& Size() const { return mSize; } + const LogicalMargin& BorderPadding() const { return mBorderPadding; } + bool TreatBSizeAsIndefinite() const { return mTreatBSizeAsIndefinite; } + + private: + // A convenience constructor with a WritingMode argument. + CachedFinalReflowMetrics(WritingMode aWM, const ReflowInput& aReflowInput, + const ReflowOutput& aReflowOutput) + : mBorderPadding(aReflowInput.ComputedLogicalBorderPadding(aWM)), + mSize(aReflowOutput.Size(aWM) - mBorderPadding.Size(aWM)), + mTreatBSizeAsIndefinite(aReflowInput.mFlags.mTreatBSizeAsIndefinite) {} + + // The flex item's border and padding, in its own writing-mode, that it used + // used during its most recent "final reflow". + LogicalMargin mBorderPadding; + + // The flex item's content-box size, in its own writing-mode, that it used + // during its most recent "final reflow". + LogicalSize mSize; + + // True if the flex item's BSize was considered "indefinite" in its most + // recent "final reflow". (For a flex item "final reflow", this is fully + // determined by the mTreatBSizeAsIndefinite flag in ReflowInput. See the + // flag's documentation for more information.) + bool mTreatBSizeAsIndefinite; }; /** @@ -1864,23 +1904,56 @@ enum class FlexItemReflowType { // A reflow with the flex item's "final" size at the end of the flex layout // algorithm. - // XXXdholbert Unused for now, but will be used in a later patch. Final, }; /** - * This class stores information about the previous reflow for a given flex - * item. This should hopefully help us avoid redundant reflows of that - * flex item. + * This class stores information about the conditions and results for the most + * recent ReflowChild call that we made on a given flex item. This information + * helps us reason about whether we can assume that a subsequent ReflowChild() + * invocation is unnecessary & skippable. */ class nsFlexContainerFrame::CachedFlexItemData { public: CachedFlexItemData(const ReflowInput& aReflowInput, const ReflowOutput& aReflowOutput, FlexItemReflowType aType) { + Update(aReflowInput, aReflowOutput, aType); + } + + // This method is intended to be called after we perform either a "measuring + // reflow" or a "final reflow" for a given flex item. + void Update(const ReflowInput& aReflowInput, + const ReflowOutput& aReflowOutput, FlexItemReflowType aType) { if (aType == FlexItemReflowType::Measuring) { + mBAxisMeasurement.reset(); mBAxisMeasurement.emplace(aReflowInput, aReflowOutput); + // Clear any cached "last final reflow metrics", too, because now the most + // recent reflow was *not* a "final reflow". + mFinalReflowMetrics.reset(); + return; } + + MOZ_ASSERT(aType == FlexItemReflowType::Final); + mFinalReflowMetrics.reset(); + mFinalReflowMetrics.emplace(aReflowInput, aReflowOutput); + } + + // This method is intended to be called for situations where we decide to + // skip a final reflow because we've just done a measuring reflow which left + // us (and our descendants) with the correct sizes. In this scenario, we + // still want to cache the size as if we did a final reflow (because we've + // determined that the recent measuring reflow was sufficient). That way, + // our flex container can still skip a final reflow for this item in the + // future as long as conditions are right. + void Update(const FlexItem& aItem, const LogicalSize& aSize) { + MOZ_ASSERT(!mFinalReflowMetrics, + "This version of the method is only intended to be called when " + "the most recent reflow was a 'measuring reflow'; and that " + "should have cleared out mFinalReflowMetrics"); + + mFinalReflowMetrics.reset(); // Just in case this assert^ fails. + mFinalReflowMetrics.emplace(aItem, aSize); } // If the flex container needs a measuring reflow for the flex item, then the @@ -1888,6 +1961,14 @@ class nsFlexContainerFrame::CachedFlexItemData { // has been needed so far, then this member will be Nothing(). Maybe mBAxisMeasurement; + // The metrics that the corresponding flex item used in its most recent + // "final reflow". (Note: the assumption here is that this reflow was this + // item's most recent reflow of any type. If the item ends up undergoing a + // subsequent measuring reflow, then this value needs to be cleared, because + // at that point it's no longer an accurate way of reasoning about the + // current state of the frame tree.) + Maybe mFinalReflowMetrics; + // Instances of this class are stored under this frame property, on // frames that are flex items: NS_DECLARE_FRAME_PROPERTY_DELETABLE(Prop, CachedFlexItemData) @@ -1898,22 +1979,22 @@ void nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty( MOZ_ASSERT(aItemFrame->IsFlexItem()); if (auto* cache = aItemFrame->GetProperty(CachedFlexItemData::Prop())) { cache->mBAxisMeasurement.reset(); + cache->mFinalReflowMetrics.reset(); } } -const CachedBAxisMeasurement& -nsFlexContainerFrame::MeasureAscentAndBSizeForFlexItem( +const CachedBAxisMeasurement& nsFlexContainerFrame::MeasureBSizeForFlexItem( FlexItem& aItem, ReflowInput& aChildReflowInput) { auto* cachedData = aItem.Frame()->GetProperty(CachedFlexItemData::Prop()); if (cachedData && cachedData->mBAxisMeasurement) { if (cachedData->mBAxisMeasurement->IsValidFor(aChildReflowInput)) { + FLEX_LOG("[perf] MeasureBSizeForFlexItem accepted cached value"); return *(cachedData->mBAxisMeasurement); } - FLEX_LOG("[perf] MeasureAscentAndBSizeForFlexItem rejected cached value"); + FLEX_LOG("[perf] MeasureBSizeForFlexItem rejected cached value"); } else { - FLEX_LOG( - "[perf] MeasureAscentAndBSizeForFlexItem didn't have a cached value"); + FLEX_LOG("[perf] MeasureBSizeForFlexItem didn't have a cached value"); } ReflowOutput childReflowOutput(aChildReflowInput); @@ -1943,11 +2024,13 @@ nsFlexContainerFrame::MeasureAscentAndBSizeForFlexItem( &aChildReflowInput, outerWM, dummyPosition, dummyContainerSize, flags); + aItem.SetAscent(childReflowOutput.BlockStartAscent()); + // Update (or add) our cached measurement, so that we can hopefully skip this // measuring reflow the next time around: if (cachedData) { - cachedData->mBAxisMeasurement.reset(); - cachedData->mBAxisMeasurement.emplace(aChildReflowInput, childReflowOutput); + cachedData->Update(aChildReflowInput, childReflowOutput, + FlexItemReflowType::Measuring); } else { cachedData = new CachedFlexItemData(aChildReflowInput, childReflowOutput, FlexItemReflowType::Measuring); @@ -1967,6 +2050,8 @@ void nsFlexContainerFrame::MarkIntrinsicISizesDirty() { nscoord nsFlexContainerFrame::MeasureFlexItemContentBSize( FlexItem& aFlexItem, bool aForceBResizeForMeasuringReflow, bool aHasLineClampEllipsis, const ReflowInput& aParentReflowInput) { + FLEX_LOG("Measuring flex item's content block-size"); + // Set up a reflow input for measuring the flex item's content block-size: WritingMode wm = aFlexItem.Frame()->GetWritingMode(); LogicalSize availSize = aParentReflowInput.ComputedSize(wm); @@ -1980,6 +2065,7 @@ nscoord nsFlexContainerFrame::MeasureFlexItemContentBSize( // block-size, because that would prevent us from measuring the content // block-size. sizeOverrides.mAspectRatio.emplace(AspectRatio()); + FLEX_LOGV(" Cross size override: %d", aFlexItem.CrossSize()); } sizeOverrides.mStyleBSize.emplace(StyleSize::Auto()); @@ -2005,9 +2091,8 @@ nscoord nsFlexContainerFrame::MeasureFlexItemContentBSize( } const CachedBAxisMeasurement& measurement = - MeasureAscentAndBSizeForFlexItem(aFlexItem, childRIForMeasuringBSize); + MeasureBSizeForFlexItem(aFlexItem, childRIForMeasuringBSize); - aFlexItem.SetAscent(measurement.Ascent()); return measurement.BSize(); } @@ -2451,16 +2536,89 @@ bool FlexItem::NeedsFinalReflow(const nscoord aAvailableBSizeForItem) const { // with the correct size, none of its descendants care that its BSize may // now be considered definite, and it can fit into the available block-size. // So it doesn't need a final reflow. + // + // We now cache this size as if we had done a final reflow (because we've + // determined that the measuring reflow was effectively equivalent). This + // way, in our next time through flex layout, we may be able to skip both + // the measuring reflow *and* the final reflow (if conditions are the same + // as they are now). + if (auto* cache = mFrame->GetProperty(CachedFlexItemData::Prop())) { + cache->Update(*this, finalSize); + } + return false; } - // This item didn't receive a measuring reflow. Does it need to be reflowed - // at all? + // This item didn't receive a measuring reflow (at least, not during this + // reflow of our flex container). We may still be able to skip reflowing it + // (i.e. return false from this function), if its subtree is clean & its most + // recent "final reflow" had it at the correct content-box size & + // definiteness. + // Let's check for each condition that would still require us to reflow: + if (mFrame->IsSubtreeDirty()) { + FLEX_LOG( + "[perf] Flex item %p needed a final reflow due to its subtree " + "being dirty", + mFrame); + return true; + } - // XXXdholbert in a later patch, we'll add some special cases here, making - // use of "finalSize" (which is why it's declared at this outer scope). For - // now, we assume that we unconditionally must reflow the item. - return true; + // Cool; this item & its subtree haven't experienced any style/content + // changes that would automatically require a reflow. + + // Did we cache the metrics from its most recent "final reflow"? + auto* cache = mFrame->GetProperty(CachedFlexItemData::Prop()); + if (!cache || !cache->mFinalReflowMetrics) { + FLEX_LOG( + "[perf] Flex item %p needed a final reflow due to lacking a " + "cached mFinalReflowMetrics (maybe cache was cleared)", + mFrame); + return true; + } + + // Does the cached size match our current size? + if (cache->mFinalReflowMetrics->Size() != finalSize) { + FLEX_LOG( + "[perf] Flex item %p needed a final reflow due to having a " + "different content box size vs. its most recent final reflow", + mFrame); + return true; + } + + // Does the cached border and padding match our current ones? + // + // Note: this is just to detect cases where we have a percent padding whose + // basis has changed. Any other sort of change to BorderPadding() (e.g. a new + // specified value) should result in the frame being marked dirty via proper + // change hint (see nsStylePadding::CalcDifference()), which will force it to + // reflow. + if (cache->mFinalReflowMetrics->BorderPadding() != + BorderPadding().ConvertTo(mWM, mCBWM)) { + FLEX_LOG( + "[perf] Flex item %p needed a final reflow due to having a " + "different border and padding vs. its most recent final reflow", + mFrame); + return true; + } + + // The flex container is giving this flex item the same size that the item + // had on its most recent "final reflow". But if its definiteness changed and + // one of the descendants cares, then it would still need a reflow. + if (cache->mFinalReflowMetrics->TreatBSizeAsIndefinite() != + mTreatBSizeAsIndefinite && + FrameHasRelativeBSizeDependency(mFrame)) { + FLEX_LOG( + "[perf] Flex item %p needed a final reflow due to having " + "its BSize change definiteness & having a rel-BSize child", + mFrame); + return true; + } + + // If we get here, we can skip the final reflow! (The item's subtree isn't + // dirty, and our current conditions are sufficiently similar to the most + // recent "final reflow" that it should have left our subtree in the correct + // state.) + return false; } // Keeps track of our position along a particular axis (where a '0' position @@ -2735,7 +2893,7 @@ void nsFlexContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, nsDisplayListSet childLists(aLists, aLists.BlockBorderBackgrounds()); CSSOrderAwareFrameIterator iter( - this, kPrincipalList, CSSOrderAwareFrameIterator::eIncludeAll, + this, kPrincipalList, CSSOrderAwareFrameIterator::ChildFilter::IncludeAll, OrderStateForIter(this), OrderingPropertyForIter(this)); for (; !iter.AtEnd(); iter.Next()) { @@ -2875,6 +3033,13 @@ void FlexLine::FreezeOrRestoreEachFlexibleSize(const nscoord aTotalViolation, void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, ComputedFlexLineInfo* aLineInfo) { + // In this function, we use 64-bit coord type to avoid integer overflow in + // case several of the individual items have huge hypothetical main sizes, + // which can happen with percent-width table-layout:fixed descendants. Here we + // promote the container's main size to 64-bit to make the arithmetic + // convenient. + AuCoord64 flexContainerMainSize(aFlexContainerMainSize); + // Before we start resolving sizes: if we have an aLineInfo structure to fill // out, we inform it of each item's base size, and we initialize the "delta" // for each item to 0. (And if the flex algorithm wants to grow or shrink the @@ -2890,7 +3055,7 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, // Determine whether we're going to be growing or shrinking items. const bool isUsingFlexGrow = - (mTotalOuterHypotheticalMainSize < aFlexContainerMainSize); + (mTotalOuterHypotheticalMainSize < flexContainerMainSize); if (aLineInfo) { aLineInfo->mGrowthState = @@ -2905,19 +3070,22 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, if ((mNumFrozenItems == NumItems()) && !aLineInfo) { // All our items are frozen, so we have no flexible lengths to resolve, // and we aren't being asked to generate computed line info. + FLEX_LOG("No flexible length to resolve"); return; } MOZ_ASSERT(!IsEmpty() || aLineInfo, "empty lines should take the early-return above"); + FLEX_LOG("Resolving flexible lengths for items"); + // Subtract space occupied by our items' margins/borders/padding/gaps, so // we can just be dealing with the space available for our flex items' content // boxes. - nscoord spaceAvailableForFlexItemsContentBoxes = - aFlexContainerMainSize - (mTotalItemMBP + SumOfGaps()); + const AuCoord64 totalItemMBPAndGaps = mTotalItemMBP + SumOfGaps(); + const AuCoord64 spaceAvailableForFlexItemsContentBoxes = + flexContainerMainSize - totalItemMBPAndGaps; - nscoord origAvailableFreeSpace; - bool isOrigAvailFreeSpaceInitialized = false; + Maybe origAvailableFreeSpace; // NOTE: I claim that this chunk of the algorithm (the looping part) needs to // run the loop at MOST NumItems() times. This claim should hold up @@ -2931,7 +3099,7 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, // flex base size, and subtract all the used main sizes from our // total amount of space to determine the 'available free space' // (positive or negative) to be distributed among our flexible items. - nscoord availableFreeSpace = spaceAvailableForFlexItemsContentBoxes; + AuCoord64 availableFreeSpace = spaceAvailableForFlexItemsContentBoxes; for (FlexItem& item : Items()) { if (!item.IsFrozen()) { item.SetMainSize(item.FlexBaseSize()); @@ -2939,25 +3107,37 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, availableFreeSpace -= item.MainSize(); } - FLEX_LOG(" available free space = %d", availableFreeSpace); + FLEX_LOG(" available free space: %" PRId64 "; flex items should \"%s\"", + availableFreeSpace.value, isUsingFlexGrow ? "grow" : "shrink"); // The sign of our free space should agree with the type of flexing - // (grow/shrink) that we're doing (except if we've had integer overflow; - // then, all bets are off). Any disagreement should've made us use the - // other type of flexing, or should've been resolved in FreezeItemsEarly. - // XXXdholbert If & when bug 765861 is fixed, we should upgrade this - // assertion to be fatal except in documents with enormous lengths. - NS_ASSERTION((isUsingFlexGrow && availableFreeSpace >= 0) || - (!isUsingFlexGrow && availableFreeSpace <= 0), - "availableFreeSpace's sign should match isUsingFlexGrow"); + // (grow/shrink) that we're doing. Any disagreement should've made us use + // the other type of flexing, or should've been resolved in + // FreezeItemsEarly. + // + // Note: it's possible that an individual flex item has huge + // margin/border/padding that makes either its + // MarginBorderPaddingSizeInMainAxis() or OuterMainSize() negative due to + // integer overflow. If that happens, the accumulated + // mTotalOuterHypotheticalMainSize or mTotalItemMBP could be negative due to + // that one item's negative (overflowed) size. Likewise, a huge main gap + // size between flex items can also make our accumulated SumOfGaps() + // negative. In these case, we throw up our hands and don't require + // isUsingFlexGrow to agree with availableFreeSpace. Luckily, we won't get + // stuck in the algorithm below, and just distribute the wrong + // availableFreeSpace with the wrong grow/shrink factors. + MOZ_ASSERT(!(mTotalOuterHypotheticalMainSize >= 0 && mTotalItemMBP >= 0 && + totalItemMBPAndGaps >= 0) || + (isUsingFlexGrow && availableFreeSpace >= 0) || + (!isUsingFlexGrow && availableFreeSpace <= 0), + "availableFreeSpace's sign should match isUsingFlexGrow"); // If we have any free space available, give each flexible item a portion // of availableFreeSpace. - if (availableFreeSpace != 0) { + if (availableFreeSpace != AuCoord64(0)) { // The first time we do this, we initialize origAvailableFreeSpace. - if (!isOrigAvailFreeSpaceInitialized) { - origAvailableFreeSpace = availableFreeSpace; - isOrigAvailFreeSpaceInitialized = true; + if (!origAvailableFreeSpace) { + origAvailableFreeSpace.emplace(availableFreeSpace); } // STRATEGY: On each item, we compute & store its "share" of the total @@ -2969,14 +3149,14 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, // its "share" multiplied by the remaining available space. // // SPECIAL CASE: If the sum of the weights is larger than the - // maximum representable float (overflowing to infinity), then we can't + // maximum representable double (overflowing to infinity), then we can't // sensibly divide out proportional shares anymore. In that case, we // simply treat the flex item(s) with the largest weights as if // their weights were infinite (dwarfing all the others), and we // distribute all of the available space among them. - float weightSum = 0.0f; - float flexFactorSum = 0.0f; - float largestWeight = 0.0f; + double weightSum = 0.0; + double flexFactorSum = 0.0; + double largestWeight = 0.0; uint32_t numItemsWithLargestWeight = 0; // Since this loop only operates on unfrozen flex items, we can break as @@ -2990,17 +3170,17 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, if (!item.IsFrozen()) { numUnfrozenItemsToBeSeen--; - float curWeight = item.GetWeight(isUsingFlexGrow); - float curFlexFactor = item.GetFlexFactor(isUsingFlexGrow); - MOZ_ASSERT(curWeight >= 0.0f, "weights are non-negative"); - MOZ_ASSERT(curFlexFactor >= 0.0f, "flex factors are non-negative"); + const double curWeight = item.GetWeight(isUsingFlexGrow); + const double curFlexFactor = item.GetFlexFactor(isUsingFlexGrow); + MOZ_ASSERT(curWeight >= 0.0, "weights are non-negative"); + MOZ_ASSERT(curFlexFactor >= 0.0, "flex factors are non-negative"); weightSum += curWeight; flexFactorSum += curFlexFactor; if (IsFinite(weightSum)) { - if (curWeight == 0.0f) { - item.SetShareOfWeightSoFar(0.0f); + if (curWeight == 0.0) { + item.SetShareOfWeightSoFar(0.0); } else { item.SetShareOfWeightSoFar(curWeight / weightSum); } @@ -3021,23 +3201,23 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, MOZ_ASSERT(numUnfrozenItemsToBeSeen == 0, "miscounted frozen items?"); - if (weightSum != 0.0f) { - MOZ_ASSERT(flexFactorSum != 0.0f, + if (weightSum != 0.0) { + MOZ_ASSERT(flexFactorSum != 0.0, "flex factor sum can't be 0, if a weighted sum " "of its components (weightSum) is nonzero"); - if (flexFactorSum < 1.0f) { + if (flexFactorSum < 1.0) { // Our unfrozen flex items don't want all of the original free space! // (Their flex factors add up to something less than 1.) // Hence, make sure we don't distribute any more than the portion of // our original free space that these items actually want. - nscoord totalDesiredPortionOfOrigFreeSpace = - NSToCoordRound(origAvailableFreeSpace * flexFactorSum); + auto totalDesiredPortionOfOrigFreeSpace = + AuCoord64::FromRound(*origAvailableFreeSpace * flexFactorSum); // Clamp availableFreeSpace to be no larger than that ^^. // (using min or max, depending on sign). // This should not change the sign of availableFreeSpace (except // possibly by setting it to 0), as enforced by this assertion: - NS_ASSERTION(totalDesiredPortionOfOrigFreeSpace == 0 || + NS_ASSERTION(totalDesiredPortionOfOrigFreeSpace == AuCoord64(0) || ((totalDesiredPortionOfOrigFreeSpace > 0) == (availableFreeSpace > 0)), "When we reduce available free space for flex " @@ -3071,36 +3251,37 @@ void FlexLine::ResolveFlexibleLengths(nscoord aFlexContainerMainSize, // To avoid rounding issues, we compute the change in size for this // item, and then subtract it from the remaining available space. - nscoord sizeDelta = 0; + AuCoord64 sizeDelta = 0; if (IsFinite(weightSum)) { - float myShareOfRemainingSpace = item.ShareOfWeightSoFar(); + double myShareOfRemainingSpace = item.ShareOfWeightSoFar(); - MOZ_ASSERT(myShareOfRemainingSpace >= 0.0f && - myShareOfRemainingSpace <= 1.0f, + MOZ_ASSERT(myShareOfRemainingSpace >= 0.0 && + myShareOfRemainingSpace <= 1.0, "my share should be nonnegative fractional amount"); - if (myShareOfRemainingSpace == 1.0f) { - // (We special-case 1.0f to avoid float error from converting - // availableFreeSpace from integer*1.0f --> float --> integer) + if (myShareOfRemainingSpace == 1.0) { + // (We special-case 1.0 to avoid float error from converting + // availableFreeSpace from integer*1.0 --> double --> integer) sizeDelta = availableFreeSpace; - } else if (myShareOfRemainingSpace > 0.0f) { - sizeDelta = NSToCoordRound(availableFreeSpace * - myShareOfRemainingSpace); + } else if (myShareOfRemainingSpace > 0.0) { + sizeDelta = AuCoord64::FromRound(availableFreeSpace * + myShareOfRemainingSpace); } } else if (item.GetWeight(isUsingFlexGrow) == largestWeight) { // Total flexibility is infinite, so we're just distributing // the available space equally among the items that are tied for // having the largest weight (and this is one of those items). - sizeDelta = NSToCoordRound(availableFreeSpace / - float(numItemsWithLargestWeight)); + sizeDelta = AuCoord64::FromRound( + availableFreeSpace / double(numItemsWithLargestWeight)); numItemsWithLargestWeight--; } availableFreeSpace -= sizeDelta; - item.SetMainSize(item.MainSize() + sizeDelta); - FLEX_LOG(" flex item %p receives %d, for a total of %d", - item.Frame(), sizeDelta, item.MainSize()); + item.SetMainSize(item.MainSize() + + nscoord(sizeDelta.ToMinMaxClamped())); + FLEX_LOG(" flex item %p receives %" PRId64 ", for a total of %d", + item.Frame(), sizeDelta.value, item.MainSize()); } } @@ -3937,8 +4118,9 @@ void nsFlexContainerFrame::GenerateFlexLines( uint32_t itemIdxInContainer = 0; CSSOrderAwareFrameIterator iter( - this, kPrincipalList, CSSOrderAwareFrameIterator::eIncludeAll, - CSSOrderAwareFrameIterator::eUnknownOrder, OrderingPropertyForIter(this)); + this, kPrincipalList, CSSOrderAwareFrameIterator::ChildFilter::IncludeAll, + CSSOrderAwareFrameIterator::OrderState::Unknown, + OrderingPropertyForIter(this)); AddOrRemoveStateBits(NS_STATE_FLEX_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER, iter.ItemsAreAlreadyInOrder()); @@ -3989,21 +4171,16 @@ void nsFlexContainerFrame::GenerateFlexLines( // this was the first item on the line. if (wrapThreshold != NS_UNCONSTRAINEDSIZE && curLine->Items().Length() > 1) { - // If the line will be longer than wrapThreshold because of the newly - // appended item, then wrap and move the item to a new line. - // - // NOTE: We have to account for the fact that the item's outer - // hypothetical main-size might be huge, if our item is (or contains) a - // table with "table-layout:fixed". So we use AddChecked() rather than - // (possibly-overflowing) normal addition, to be sure we don't make the - // wrong judgement about whether the item fits on this line. - nscoord newOuterSize = - AddChecked(curLine->TotalOuterHypotheticalMainSize(), - curLine->Items().LastElement().OuterMainSize()); + // If the line will be longer than wrapThreshold or at least as long as + // nscoord_MAX because of the newly appended item, then wrap and move the + // item to a new line. + auto newOuterSize = curLine->TotalOuterHypotheticalMainSize(); + newOuterSize += curLine->Items().LastElement().OuterMainSize(); - // Account for gap between this line's previous item and this item - newOuterSize = AddChecked(newOuterSize, aMainGapSize); - if (newOuterSize == nscoord_MAX || newOuterSize > wrapThreshold) { + // Account for gap between this line's previous item and this item. + newOuterSize += aMainGapSize; + + if (newOuterSize >= nscoord_MAX || newOuterSize > wrapThreshold) { curLine = ConstructNewFlexLine(); // Get the previous line after adding a new line because the address can @@ -4045,7 +4222,8 @@ void nsFlexContainerFrame::GenerateFlexLines(const SharedFlexData& aData, // Construct flex items for this flex container fragment from existing flex // items in SharedFlexData. CSSOrderAwareFrameIterator iter( - this, kPrincipalList, CSSOrderAwareFrameIterator::eSkipPlaceholders, + this, kPrincipalList, + CSSOrderAwareFrameIterator::ChildFilter::SkipPlaceholders, OrderStateForIter(this), OrderingPropertyForIter(this)); FlexItemIterator itemIter(aData.mLines); @@ -4089,8 +4267,8 @@ nscoord nsFlexContainerFrame::GetMainSizeFromReflowInput( // Returns the largest outer hypothetical main-size of any line in |aLines|. // (i.e. the hypothetical main-size of the largest line) -static nscoord GetLargestLineMainSize(nsTArray& aLines) { - nscoord largestLineOuterSize = 0; +static AuCoord64 GetLargestLineMainSize(nsTArray& aLines) { + AuCoord64 largestLineOuterSize = 0; for (const FlexLine& line : aLines) { largestLineOuterSize = std::max(largestLineOuterSize, line.TotalOuterHypotheticalMainSize()); @@ -4124,8 +4302,9 @@ nscoord nsFlexContainerFrame::ComputeMainSize( // Column-oriented case, with auto BSize: // Resolve auto BSize to the largest FlexLine length, clamped to our // computed min/max main-size properties. - nscoord largestLineOuterSize = GetLargestLineMainSize(aLines); - return NS_CSS_MINMAX(largestLineOuterSize, aReflowInput.ComputedMinBSize(), + const AuCoord64 largestLineMainSize = GetLargestLineMainSize(aLines); + return NS_CSS_MINMAX(nscoord(largestLineMainSize.ToMinMaxClamped()), + aReflowInput.ComputedMinBSize(), aReflowInput.ComputedMaxBSize()); } @@ -4279,14 +4458,13 @@ void nsFlexContainerFrame::SizeItemInCrossAxis(ReflowInput& aChildReflowInput, // Potentially reflow the item, and get the sizing info. const CachedBAxisMeasurement& measurement = - MeasureAscentAndBSizeForFlexItem(aItem, aChildReflowInput); + MeasureBSizeForFlexItem(aItem, aChildReflowInput); // Save the sizing info that we learned from this reflow // ----------------------------------------------------- // Tentatively store the child's desired content-box cross-size. aItem.SetCrossSize(measurement.BSize()); - aItem.SetAscent(measurement.Ascent()); } void FlexLine::PositionItemsInCrossAxis( @@ -4921,6 +5099,8 @@ void nsFlexContainerFrame::DoFlexLayout( } else { sizeOverrides.mStyleBSize.emplace(item.StyleMainSize()); } + FLEX_LOG("Sizing flex item %p in cross axis", item.Frame()); + FLEX_LOGV(" Main size override: %d", item.MainSize()); const WritingMode wm = item.GetWritingMode(); LogicalSize availSize = aReflowInput.ComputedSize(wm); @@ -5318,6 +5498,9 @@ void nsFlexContainerFrame::PopulateReflowOutput( void nsFlexContainerFrame::MoveFlexItemToFinalPosition( const ReflowInput& aReflowInput, const FlexItem& aItem, LogicalPoint& aFramePos, const nsSize& aContainerSize) { + FLEX_LOG("Moving flex item %p to its desired position %s", aItem.Frame(), + ToString(aFramePos).c_str()); + WritingMode outerWM = aReflowInput.GetWritingMode(); // If item is relpos, look up its offsets (cached from prev reflow) @@ -5342,6 +5525,8 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem( const FlexItem& aItem, LogicalPoint& aFramePos, const LogicalSize& aAvailableSize, const nsSize& aContainerSize, bool aHasLineClampEllipsis) { + FLEX_LOG("Doing final reflow for flex item %p", aItem.Frame()); + WritingMode outerWM = aReflowInput.GetWritingMode(); StyleSizeOverrides sizeOverrides; @@ -5351,6 +5536,8 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem( } else { sizeOverrides.mStyleBSize.emplace(aItem.StyleMainSize()); } + FLEX_LOGV(" Main size override: %d", aItem.MainSize()); + // Override flex item's cross size if it was stretched in the cross axis (in // which case we're imposing a cross size). if (aItem.IsStretched()) { @@ -5359,6 +5546,7 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem( } else { sizeOverrides.mStyleBSize.emplace(aItem.StyleCrossSize()); } + FLEX_LOGV(" Cross size override: %d", aItem.CrossSize()); } if (sizeOverrides.mStyleBSize && aItem.HadMeasuringReflow()) { // Because we are overriding the block-size, *and* we had an earlier @@ -5412,6 +5600,16 @@ nsReflowStatus nsFlexContainerFrame::ReflowFlexItem( aItem.SetAscent(childReflowOutput.BlockStartAscent()); + // Update our cached flex item info: + if (auto* cached = aItem.Frame()->GetProperty(CachedFlexItemData::Prop())) { + cached->Update(childReflowInput, childReflowOutput, + FlexItemReflowType::Final); + } else { + cached = new CachedFlexItemData(childReflowInput, childReflowOutput, + FlexItemReflowType::Final); + aItem.Frame()->SetProperty(CachedFlexItemData::Prop(), cached); + } + return childReflowStatus; } diff --git a/layout/generic/nsFlexContainerFrame.h b/layout/generic/nsFlexContainerFrame.h index 2d1be95109..138dc083b9 100644 --- a/layout/generic/nsFlexContainerFrame.h +++ b/layout/generic/nsFlexContainerFrame.h @@ -171,7 +171,8 @@ class nsFlexContainerFrame final : public nsContainerFrame { bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, nscoord* aBaseline) const override { - if (HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) { + if (StyleDisplay()->IsContainLayout() || + HasAnyStateBits(NS_STATE_FLEX_SYNTHESIZE_BASELINE)) { return false; } *aBaseline = aBaselineGroup == BaselineSharingGroup::First @@ -380,7 +381,7 @@ class nsFlexContainerFrame final : public nsContainerFrame { * This avoids exponential reflows - see the comment above the * CachedBAxisMeasurement struct. */ - const CachedBAxisMeasurement& MeasureAscentAndBSizeForFlexItem( + const CachedBAxisMeasurement& MeasureBSizeForFlexItem( FlexItem& aItem, ReflowInput& aChildReflowInput); /** diff --git a/layout/generic/nsFrameStateBits.h b/layout/generic/nsFrameStateBits.h index 1b56798160..c0b1ca184d 100644 --- a/layout/generic/nsFrameStateBits.h +++ b/layout/generic/nsFrameStateBits.h @@ -325,8 +325,6 @@ FRAME_STATE_BIT(Box, 28, NS_STATE_MENU_HAS_POPUP_LIST) FRAME_STATE_BIT(Box, 29, NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK) FRAME_STATE_BIT(Box, 30, NS_STATE_EQUAL_SIZE) FRAME_STATE_BIT(Box, 31, NS_STATE_IS_DIRECTION_NORMAL) -FRAME_STATE_BIT(Box, 60, NS_FRAME_MOUSE_THROUGH_ALWAYS) -FRAME_STATE_BIT(Box, 61, NS_FRAME_MOUSE_THROUGH_NEVER) // == Frame state bits that apply to flex container frames ==================== diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 7c0287772f..ba0cee94a6 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -937,12 +937,12 @@ void nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState, // for now, but it's possible that we may need to update both in the future. AdjustForPerspective(aState.mContentsOverflowAreas.ScrollableOverflow()); - nsRect scrolledArea; // Preserve the width or height of empty rects nsSize portSize = mHelper.mScrollPort.Size(); nsRect scrolledRect = mHelper.GetUnsnappedScrolledRectInternal( aState.mContentsOverflowAreas.ScrollableOverflow(), portSize); - scrolledArea.UnionRectEdges(scrolledRect, nsRect(nsPoint(0, 0), portSize)); + nsRect scrolledArea = + scrolledRect.UnionEdges(nsRect(nsPoint(0, 0), portSize)); // Store the new overflow area. Note that this changes where an outline // of the scrolled frame would be painted, but scrolled frames can't have diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index d89eff9261..09b841c3a8 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -47,6 +47,12 @@ using TrackListValue = using TrackRepeat = StyleGenericTrackRepeat; using NameList = StyleOwnedSlice; using SizingConstraint = nsGridContainerFrame::SizingConstraint; +using GridItemCachedBAxisMeasurement = + nsGridContainerFrame::CachedBAxisMeasurement; + +static mozilla::LazyLogModule gGridContainerLog("GridContainer"); +#define GRID_LOG(...) \ + MOZ_LOG(gGridContainerLog, LogLevel::Debug, (__VA_ARGS__)); static const int32_t kMaxLine = StyleMAX_GRID_LINE; static const int32_t kMinLine = StyleMIN_GRID_LINE; @@ -4975,6 +4981,25 @@ static nscoord MeasuringReflow(nsIFrame* aChild, nsIFrame::ReflowChildFlags::NoMoveFrame | nsIFrame::ReflowChildFlags::NoSizeView | nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild; + + if (StaticPrefs::layout_css_grid_item_baxis_measurement_enabled()) { + bool found; + GridItemCachedBAxisMeasurement cachedMeasurement = + aChild->GetProperty(GridItemCachedBAxisMeasurement::Prop(), &found); + if (found && cachedMeasurement.IsValidFor(aChild, aCBSize)) { + childSize.BSize(wm) = cachedMeasurement.BSize(); + childSize.ISize(wm) = aChild->ISize(wm); + nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm, + LogicalPoint(wm), nsSize(), flags); + GRID_LOG( + "[perf] MeasuringReflow accepted cached value=%d, child=%p, " + "aCBSize.ISize=%d", + cachedMeasurement.BSize(), aChild, + aCBSize.ISize(aChild->GetWritingMode())); + return cachedMeasurement.BSize(); + } + } + parent->ReflowChild(aChild, pc, childSize, childRI, wm, LogicalPoint(wm), nsSize(), flags, childStatus); nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm, @@ -4982,6 +5007,42 @@ static nscoord MeasuringReflow(nsIFrame* aChild, #ifdef DEBUG parent->RemoveProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); #endif + + if (StaticPrefs::layout_css_grid_item_baxis_measurement_enabled()) { + bool found; + GridItemCachedBAxisMeasurement cachedMeasurement = + aChild->GetProperty(GridItemCachedBAxisMeasurement::Prop(), &found); + if (!found && + GridItemCachedBAxisMeasurement::CanCacheMeasurement(aChild, aCBSize)) { + GridItemCachedBAxisMeasurement cachedMeasurement(aChild, aCBSize, + childSize.BSize(wm)); + aChild->SetProperty(GridItemCachedBAxisMeasurement::Prop(), + cachedMeasurement); + GRID_LOG( + "[perf] MeasuringReflow created new cached value=%d, child=%p, " + "aCBSize.ISize=%d", + cachedMeasurement.BSize(), aChild, + aCBSize.ISize(aChild->GetWritingMode())); + } else if (found) { + if (GridItemCachedBAxisMeasurement::CanCacheMeasurement(aChild, + aCBSize)) { + cachedMeasurement.Update(aChild, aCBSize, childSize.BSize(wm)); + GRID_LOG( + "[perf] MeasuringReflow rejected but updated cached value=%d, " + "child=%p, aCBSize.ISize=%d", + cachedMeasurement.BSize(), aChild, + aCBSize.ISize(aChild->GetWritingMode())); + aChild->SetProperty(GridItemCachedBAxisMeasurement::Prop(), + cachedMeasurement); + } else { + aChild->RemoveProperty(GridItemCachedBAxisMeasurement::Prop()); + GRID_LOG( + "[perf] MeasuringReflow rejected and removed cached value, " + "child=%p", + aChild); + } + } + } return childSize.BSize(wm); } @@ -5222,9 +5283,31 @@ static nscoord ContentContribution( iMinSizeClamp = aMinSizeClamp; } LogicalSize availableSize(childWM, availISize, availBSize); - size = ::MeasuringReflow(child, aState.mReflowInput, aRC, availableSize, - cbSize, iMinSizeClamp, bMinSizeClamp); - size += child->GetLogicalUsedMargin(childWM).BStartEnd(childWM); + if (MOZ_UNLIKELY(child->IsXULBoxFrame())) { + auto* pc = child->PresContext(); + // For XUL-in-CSS-Grid (e.g. in our frontend code), we defer to XUL's + // GetPrefSize() function (which reports an answer in both axes), instead + // of actually reflowing. It's important to avoid the "measuring + final" + // two-pass reflow for XUL, because some XUL layout code may incorrectly + // optimize away the second reflow in cases where it's really needed. + // XXXdholbert We'll remove this special case in bug 1600542. + ReflowInput childRI(pc, *aState.mReflowInput, child, availableSize, + Some(cbSize)); + + nsBoxLayoutState state(pc, &aState.mRenderingContext, &childRI, + childRI.mReflowDepth); + nsSize physicalPrefSize = child->GetXULPrefSize(state); + auto prefSize = LogicalSize(childWM, physicalPrefSize); + size = prefSize.BSize(childWM); + + // XXXdholbert This won't have percentage margins resolved. + // Hopefully we can just avoid those for XUL-content-in-css-grid? + size += childRI.ComputedLogicalMargin(childWM).BStartEnd(childWM); + } else { + size = ::MeasuringReflow(child, aState.mReflowInput, aRC, availableSize, + cbSize, iMinSizeClamp, bMinSizeClamp); + size += child->GetLogicalUsedMargin(childWM).BStartEnd(childWM); + } nscoord overflow = size - aMinSizeClamp; if (MOZ_UNLIKELY(overflow > 0)) { nscoord contentSize = child->ContentSize(childWM).BSize(childWM); @@ -7235,10 +7318,34 @@ void nsGridContainerFrame::ReflowInFlowChild( // aContainerSize, and then pass the correct position to FinishReflowChild. ReflowOutput childSize(childRI); const nsSize dummyContainerSize; - ReflowChild(aChild, pc, childSize, childRI, childWM, LogicalPoint(childWM), + + // XXXdholbert The childPos that we use for ReflowChild shouldn't matter, + // since we finalize it in FinishReflowChild. However, it does matter if the + // child happens to be XUL (which sizes menu popup frames based on the + // position within the viewport, during this ReflowChild call). So we make an + // educated guess that the child will be at the origin of its containing + // block, and then use align/justify to correct that as-needed further + // down. (If the child has a different writing mode than its parent, though, + // then we can't express the CB origin until we've reflowed the child and + // determined its size. In that case, we throw up our hands and don't bother + // trying to guess the position up-front after all.) + // XXXdholbert We'll remove this special case in bug 1600542, and then we can + // go back to just setting childPos in a single call after ReflowChild. + LogicalPoint childPos(childWM); + if (MOZ_LIKELY(childWM == wm)) { + // Initially, assume the child will be at the containing block origin. + // (This may get corrected during alignment/justification below.) + childPos = cb.Origin(wm); + } + ReflowChild(aChild, pc, childSize, childRI, childWM, childPos, dummyContainerSize, ReflowChildFlags::Default, aStatus); - LogicalPoint childPos = cb.Origin(wm).ConvertTo( - childWM, wm, aContainerSize - childSize.PhysicalSize()); + if (MOZ_UNLIKELY(childWM != wm)) { + // As above: assume the child will be at the containing block origin. + // (which we can now compute in terms of the childWM, now that we know the + // child's size). + childPos = cb.Origin(wm).ConvertTo( + childWM, wm, aContainerSize - childSize.PhysicalSize()); + } // Apply align/justify-self and reflow again if that affects the size. if (MOZ_LIKELY(isGridItem)) { LogicalSize size = childSize.Size(childWM); // from the ReflowChild() @@ -7300,7 +7407,7 @@ nscoord nsGridContainerFrame::ReflowInFragmentainer( // and put them in a separate array. nsTArray sortedItems(aState.mGridItems.Length()); nsTArray placeholders(aState.mAbsPosItems.Length()); - aState.mIter.Reset(CSSOrderAwareFrameIterator::eIncludeAll); + aState.mIter.Reset(CSSOrderAwareFrameIterator::ChildFilter::IncludeAll); for (; !aState.mIter.AtEnd(); aState.mIter.Next()) { nsIFrame* child = *aState.mIter; if (!child->IsPlaceholderFrame()) { @@ -7800,7 +7907,7 @@ nscoord nsGridContainerFrame::MasonryLayout(GridReflowInput& aState, // Collect our grid items and sort them in grid order. nsTArray sortedItems(aState.mGridItems.Length()); - aState.mIter.Reset(CSSOrderAwareFrameIterator::eIncludeAll); + aState.mIter.Reset(CSSOrderAwareFrameIterator::ChildFilter::IncludeAll); size_t absposIndex = 0; const LogicalAxis masonryAxis = IsMasonry(eLogicalAxisBlock) ? eLogicalAxisBlock : eLogicalAxisInline; @@ -8316,15 +8423,15 @@ nscoord nsGridContainerFrame::ReflowChildren(GridReflowInput& aState, bSize = ReflowInFragmentainer(aState, aContentArea, aDesiredSize, aStatus, *fragmentainer, aContainerSize); } else { - aState.mIter.Reset(CSSOrderAwareFrameIterator::eIncludeAll); + aState.mIter.Reset(CSSOrderAwareFrameIterator::ChildFilter::IncludeAll); for (; !aState.mIter.AtEnd(); aState.mIter.Next()) { nsIFrame* child = *aState.mIter; const GridItemInfo* info = nullptr; if (!child->IsPlaceholderFrame()) { info = &aState.mGridItems[aState.mIter.ItemIndex()]; } - ReflowInFlowChild(*aState.mIter, info, aContainerSize, Nothing(), nullptr, - aState, aContentArea, aDesiredSize, aStatus); + ReflowInFlowChild(child, info, aContainerSize, Nothing(), nullptr, aState, + aContentArea, aDesiredSize, aStatus); MOZ_ASSERT(aStatus.IsComplete(), "child should be complete in unconstrained reflow"); } @@ -8626,8 +8733,8 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext, using Filter = CSSOrderAwareFrameIterator::ChildFilter; using Order = CSSOrderAwareFrameIterator::OrderState; bool ordered = gridReflowInput.mIter.ItemsAreAlreadyInOrder(); - auto orderState = ordered ? Order::eKnownOrdered : Order::eKnownUnordered; - iter.emplace(this, kPrincipalList, Filter::eSkipPlaceholders, orderState); + auto orderState = ordered ? Order::Ordered : Order::Unordered; + iter.emplace(this, kPrincipalList, Filter::SkipPlaceholders, orderState); gridItems.emplace(); for (; !iter->AtEnd(); iter->Next()) { auto child = **iter; @@ -9209,10 +9316,11 @@ void nsGridContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, typedef CSSOrderAwareFrameIterator::OrderState OrderState; OrderState order = HasAnyStateBits(NS_STATE_GRID_NORMAL_FLOW_CHILDREN_IN_CSS_ORDER) - ? OrderState::eKnownOrdered - : OrderState::eKnownUnordered; + ? OrderState::Ordered + : OrderState::Unordered; CSSOrderAwareFrameIterator iter( - this, kPrincipalList, CSSOrderAwareFrameIterator::eIncludeAll, order); + this, kPrincipalList, CSSOrderAwareFrameIterator::ChildFilter::IncludeAll, + order); for (; !iter.AtEnd(); iter.Next()) { nsIFrame* child = *iter; BuildDisplayListForChild(aBuilder, child, aLists, @@ -9392,9 +9500,9 @@ void nsGridContainerFrame::CalculateBaselines( // iterator ('aIter' is the forward iterator from the GridReflowInput). using Iter = ReverseCSSOrderAwareFrameIterator; auto orderState = aIter->ItemsAreAlreadyInOrder() - ? Iter::OrderState::eKnownOrdered - : Iter::OrderState::eKnownUnordered; - Iter iter(this, kPrincipalList, Iter::ChildFilter::eSkipPlaceholders, + ? Iter::OrderState::Ordered + : Iter::OrderState::Unordered; + Iter iter(this, kPrincipalList, Iter::ChildFilter::SkipPlaceholders, orderState); iter.SetItemCount(aGridItems->Length()); FindItemInGridOrderResult gridOrderLastItem = FindLastItemInGridOrder( diff --git a/layout/generic/nsGridContainerFrame.h b/layout/generic/nsGridContainerFrame.h index 8b890a3b28..8b72ff3d39 100644 --- a/layout/generic/nsGridContainerFrame.h +++ b/layout/generic/nsGridContainerFrame.h @@ -8,6 +8,7 @@ #define nsGridContainerFrame_h___ #include "mozilla/CSSOrderAwareFrameIterator.h" +#include "mozilla/MathAlgorithms.h" #include "mozilla/Maybe.h" #include "mozilla/HashTable.h" #include "nsContainerFrame.h" @@ -141,7 +142,8 @@ class nsGridContainerFrame final : public nsContainerFrame { bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM, BaselineSharingGroup aBaselineGroup, nscoord* aBaseline) const override { - if (HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) { + if (StyleDisplay()->IsContainLayout() || + HasAnyStateBits(NS_STATE_GRID_SYNTHESIZE_BASELINE)) { return false; } return GetBBaseline(aBaselineGroup, aBaseline); @@ -530,6 +532,108 @@ class nsGridContainerFrame final : public nsContainerFrame { // Our baselines, one per BaselineSharingGroup per axis. PerLogicalAxis> mBaseline; + + public: + // A cached result for a grid item's block-axis measuring reflow. This + // cache prevents us from doing exponential reflows in cases of deeply + // nested grid frames. + // + // We store the cached value in the grid item's frame property table. + // + // We cache the following as a "key" + // - The size of the grid area in the item's inline axis + // - The item's block axis baseline padding + // ...and we cache the following as the "value", + // - The item's border-box BSize + class CachedBAxisMeasurement { + public: + NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(Prop, CachedBAxisMeasurement) + CachedBAxisMeasurement(const nsIFrame* aFrame, const LogicalSize& aCBSize, + const nscoord aBSize) + : mKey(aFrame, aCBSize), mBSize(aBSize) {} + + CachedBAxisMeasurement() = default; + + bool IsValidFor(const nsIFrame* aFrame, const LogicalSize& aCBSize) const { + if (aFrame->IsSubtreeDirty()) { + return false; + } + + if (!CanCacheMeasurement(aFrame, aCBSize)) { + return false; + } + + return mKey == Key(aFrame, aCBSize); + } + + static bool CanCacheMeasurement(const nsIFrame* aFrame, + const LogicalSize& aCBSize) { + return Key::CanHash(aFrame, aCBSize); + } + + nscoord BSize() const { return mBSize; } + + void Update(const nsIFrame* aFrame, const LogicalSize& aCBSize, + const nscoord aBSize) { + MOZ_ASSERT(CanCacheMeasurement(aFrame, aCBSize)); + mKey.mHashKey = Key::GenerateHash(aFrame, aCBSize); + mBSize = aBSize; + } + + private: + struct Key { + // mHashKey is generated by combining these 2 variables together + // 1. The containing block size in the item's inline axis used + // for measuring reflow + // 2. The item's baseline padding property + uint32_t mHashKey; + + Key() = default; + + Key(const nsIFrame* aFrame, const LogicalSize& aCBSize) { + MOZ_ASSERT(CanHash(aFrame, aCBSize)); + mHashKey = GenerateHash(aFrame, aCBSize); + } + + void UpdateHash(const nsIFrame* aFrame, const LogicalSize& aCBSize) { + MOZ_ASSERT(CanHash(aFrame, aCBSize)); + mHashKey = GenerateHash(aFrame, aCBSize); + } + + static uint32_t GenerateHash(const nsIFrame* aFrame, + const LogicalSize& aCBSize) { + MOZ_ASSERT(CanHash(aFrame, aCBSize)); + + nscoord gridAreaISize = aCBSize.ISize(aFrame->GetWritingMode()); + nscoord bBaselinePaddingProperty = + abs(aFrame->GetProperty(nsIFrame::BBaselinePadProperty())); + + uint_fast8_t bitsNeededForISize = mozilla::FloorLog2(gridAreaISize) + 1; + + return (gridAreaISize << (32 - bitsNeededForISize)) | + bBaselinePaddingProperty; + } + + static bool CanHash(const nsIFrame* aFrame, const LogicalSize& aCBSize) { + uint_fast8_t bitsNeededForISize = + mozilla::FloorLog2(aCBSize.ISize(aFrame->GetWritingMode())) + 1; + + uint_fast8_t bitsNeededForBBaselinePadding = + mozilla::FloorLog2( + abs(aFrame->GetProperty(nsIFrame::BBaselinePadProperty()))) + + 1; + + return bitsNeededForISize + bitsNeededForBBaselinePadding <= 32; + } + + bool operator==(const Key& aOther) const { + return mHashKey == aOther.mHashKey; + } + }; + + Key mKey; + nscoord mBSize; + }; }; #endif /* nsGridContainerFrame_h___ */ diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp index 49203dc345..7b5145cb22 100644 --- a/layout/generic/nsIFrame.cpp +++ b/layout/generic/nsIFrame.cpp @@ -66,6 +66,7 @@ #include "nsInlineFrame.h" #include "nsFrameSelection.h" #include "nsGkAtoms.h" +#include "nsGridContainerFrame.h" #include "nsCSSAnonBoxes.h" #include "nsCanvasFrame.h" @@ -1674,6 +1675,10 @@ WritingMode nsIFrame::WritingModeForLine(WritingMode aSelfWM, return writingMode; } +nsRect nsIFrame::GetMarginRect() const { + return GetMarginRectRelativeToSelf() + GetPosition(); +} + nsRect nsIFrame::GetMarginRectRelativeToSelf() const { nsMargin m = GetUsedMargin().ApplySkipSides(GetSkipSides()); nsRect r(0, 0, mRect.width, mRect.height); @@ -2280,7 +2285,7 @@ int16_t nsIFrame::DetermineDisplaySelection() { static Element* FindElementAncestorForMozSelection(nsIContent* aContent) { NS_ENSURE_TRUE(aContent, nullptr); while (aContent && aContent->IsInNativeAnonymousSubtree()) { - aContent = aContent->GetBindingParent(); + aContent = aContent->GetClosestNativeAnonymousSubtreeRootParent(); } NS_ASSERTION(aContent, "aContent isn't in non-anonymous tree?"); return aContent ? aContent->GetAsElementOrParentElement() : nullptr; @@ -5574,6 +5579,10 @@ void nsIFrame::MarkIntrinsicISizesDirty() { if (HasAnyStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT)) { nsFontInflationData::MarkFontInflationDataTextDirty(this); } + + if (StaticPrefs::layout_css_grid_item_baxis_measurement_enabled()) { + RemoveProperty(nsGridContainerFrame::CachedBAxisMeasurement::Prop()); + } } void nsIFrame::MarkSubtreeDirty() { @@ -9318,7 +9327,7 @@ static nsRect UnionBorderBoxes( u = childRect; aOutValid = true; } else { - u.UnionRectEdges(u, childRect); + u = u.UnionEdges(childRect); } } } @@ -9419,7 +9428,7 @@ static void ComputeAndIncludeOutlineArea(nsIFrame* aFrame, } nsRect& vo = aOverflowAreas.InkOverflow(); - vo.UnionRectEdges(vo, innerRect.Union(outerRect)); + vo = vo.UnionEdges(innerRect.Union(outerRect)); } bool nsIFrame::FinishAndStoreOverflow(OverflowAreas& aOverflowAreas, @@ -9539,11 +9548,9 @@ bool nsIFrame::FinishAndStoreOverflow(OverflowAreas& aOverflowAreas, // the area unnecessarily. if ((aNewSize.width != 0 || !IsInlineFrame()) && !HasAnyStateBits(NS_FRAME_SVG_LAYOUT)) { - // Bug 1677642: We should probably call OverflowArea::UnionAllWith() once - // the scrollable overflow is using UnionEdges. for (const auto otype : AllOverflowTypes()) { nsRect& o = aOverflowAreas.Overflow(otype); - o.UnionRectEdges(o, bounds); + o = o.UnionEdges(bounds); } } @@ -9556,7 +9563,7 @@ bool nsIFrame::FinishAndStoreOverflow(OverflowAreas& aOverflowAreas, presContext->DeviceContext(), this, disp->EffectiveAppearance(), &r)) { nsRect& vo = aOverflowAreas.InkOverflow(); - vo.UnionRectEdges(vo, r); + vo = vo.UnionEdges(r); } } @@ -11004,42 +11011,6 @@ gfx::Matrix nsIFrame::ComputeWidgetTransform() { return result2d; } -static already_AddRefed GetWindowWidget( - nsPresContext* aPresContext) { - // We want to obtain the widget for the window. We can't use any of these - // methods: nsPresContext::GetRootWidget, nsPresContext::GetNearestWidget, - // nsIFrame::GetNearestWidget because those deal with child widgets and - // there is no parent widget connection between child widgets and the - // window widget that contains them. - nsCOMPtr container = aPresContext->Document()->GetContainer(); - nsCOMPtr baseWindow = do_QueryInterface(container); - if (!baseWindow) { - return nullptr; - } - - nsCOMPtr mainWidget; - baseWindow->GetMainWidget(getter_AddRefs(mainWidget)); - return mainWidget.forget(); -} - -void nsIFrame::UpdateWidgetProperties() { - nsPresContext* presContext = PresContext(); - if (presContext->IsRoot() || !presContext->IsChrome()) { - // Don't do anything for documents that aren't the root chrome document. - return; - } - nsIFrame* rootFrame = - presContext->FrameConstructor()->GetRootElementStyleFrame(); - if (this != rootFrame) { - // Only the window's root style frame is relevant for widget properties. - return; - } - if (nsCOMPtr widget = GetWindowWidget(presContext)) { - widget->SetWindowOpacity(StyleUIReset()->mWindowOpacity); - widget->SetWindowTransform(ComputeWidgetTransform()); - } -} - void nsIFrame::DoUpdateStyleOfOwnedAnonBoxes(ServoRestyleState& aRestyleState) { // As a special case, we check for {ib}-split block frames here, rather // than have an nsInlineFrame::AppendDirectlyOwnedAnonBoxes implementation diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index d9eb077a56..89ab4c557e 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1079,6 +1079,7 @@ class nsIFrame : public nsQueryFrame { nsRect GetPaddingRectRelativeToSelf() const; nsRect GetContentRect() const; nsRect GetContentRectRelativeToSelf() const; + nsRect GetMarginRect() const; nsRect GetMarginRectRelativeToSelf() const; /** @@ -4284,9 +4285,6 @@ class nsIFrame : public nsQueryFrame { */ virtual nsSize GetXULMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState); - // Implemented in nsBox, used in nsBoxFrame - int32_t GetXULOrdinal(); - virtual nscoord GetXULFlex(); virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState); virtual bool IsXULCollapsed(); @@ -4325,7 +4323,6 @@ class nsIFrame : public nsQueryFrame { } nsresult XULRedraw(nsBoxLayoutState& aState); - virtual nsresult XULRelayoutChildAtOrdinal(nsIFrame* aChild); static bool AddXULPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth, bool& aHeightSet); @@ -4374,8 +4371,6 @@ class nsIFrame : public nsQueryFrame { NS_IMETHOD DoXULLayout(nsBoxLayoutState& aBoxLayoutState); nsresult EndXULLayout(nsBoxLayoutState& aState); - enum eMouseThrough { unset, never, always }; - nsSize GetUncachedXULMinSize(nsBoxLayoutState& aBoxLayoutState); nsSize GetUncachedXULPrefSize(nsBoxLayoutState& aBoxLayoutState); nsSize GetUncachedXULMaxSize(nsBoxLayoutState& aBoxLayoutState); @@ -4628,23 +4623,6 @@ class nsIFrame : public nsQueryFrame { */ static void RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame); - /** - * Sorts the given nsFrameList, so that for every two adjacent frames in the - * list, the former is less than or equal to the latter, according to the - * templated IsLessThanOrEqual method. - * - * Note: this method uses a stable merge-sort algorithm. - */ - template - static void SortFrameList(nsFrameList& aFrameList); - - /** - * Returns true if the given frame list is already sorted, according to the - * templated IsLessThanOrEqual function. - */ - template - static bool IsFrameListSorted(nsFrameList& aFrameList); - /** * Return true if aFrame is in an {ib} split and is NOT one of the * continuations of the first inline in it. @@ -4711,11 +4689,6 @@ class nsIFrame : public nsQueryFrame { */ Matrix ComputeWidgetTransform(); - /** - * Applies the values from the -moz-window-* properties to the widget. - */ - virtual void UpdateWidgetProperties(); - /** * @return true iff this frame has one or more associated image requests. * @see mozilla::css::ImageLoader. @@ -5381,13 +5354,6 @@ class nsIFrame : public nsQueryFrame { */ bool SetOverflowAreas(const mozilla::OverflowAreas& aOverflowAreas); - // Helper-functions for SortFrameList(): - template - static nsIFrame* SortedMerge(nsIFrame* aLeft, nsIFrame* aRight); - - template - static nsIFrame* MergeSort(nsIFrame* aSource); - bool HasOpacityInternal(float aThreshold, const nsStyleDisplay* aStyleDisplay, const nsStyleEffects* aStyleEffects, mozilla::EffectSet* aEffectSet = nullptr) const; @@ -5734,117 +5700,4 @@ inline nsFrameList::Iterator& nsFrameList::Iterator::operator--() { return *this; } -// Helper-functions for nsIFrame::SortFrameList() -// --------------------------------------------------- - -template -/* static */ nsIFrame* nsIFrame::SortedMerge(nsIFrame* aLeft, - nsIFrame* aRight) { - MOZ_ASSERT(aLeft && aRight, "SortedMerge must have non-empty lists"); - - nsIFrame* result; - // Unroll first iteration to avoid null-check 'result' inside the loop. - if (IsLessThanOrEqual(aLeft, aRight)) { - result = aLeft; - aLeft = aLeft->GetNextSibling(); - if (!aLeft) { - result->SetNextSibling(aRight); - return result; - } - } else { - result = aRight; - aRight = aRight->GetNextSibling(); - if (!aRight) { - result->SetNextSibling(aLeft); - return result; - } - } - - nsIFrame* last = result; - for (;;) { - if (IsLessThanOrEqual(aLeft, aRight)) { - last->SetNextSibling(aLeft); - last = aLeft; - aLeft = aLeft->GetNextSibling(); - if (!aLeft) { - last->SetNextSibling(aRight); - return result; - } - } else { - last->SetNextSibling(aRight); - last = aRight; - aRight = aRight->GetNextSibling(); - if (!aRight) { - last->SetNextSibling(aLeft); - return result; - } - } - } -} - -template -/* static */ nsIFrame* nsIFrame::MergeSort(nsIFrame* aSource) { - MOZ_ASSERT(aSource, "MergeSort null arg"); - - nsIFrame* sorted[32] = {nullptr}; - nsIFrame** fill = &sorted[0]; - nsIFrame** left; - nsIFrame* rest = aSource; - - do { - nsIFrame* current = rest; - rest = rest->GetNextSibling(); - current->SetNextSibling(nullptr); - - // Merge it with sorted[0] if present; then merge the result with sorted[1] - // etc. sorted[0] is a list of length 1 (or nullptr). sorted[1] is a list of - // length 2 (or nullptr). sorted[2] is a list of length 4 (or nullptr). etc. - for (left = &sorted[0]; left != fill && *left; ++left) { - current = SortedMerge(*left, current); - *left = nullptr; - } - - // Fill the empty slot that we couldn't merge with the last result. - *left = current; - - if (left == fill) ++fill; - } while (rest); - - // Collect and merge the results. - nsIFrame* result = nullptr; - for (left = &sorted[0]; left != fill; ++left) { - if (*left) { - result = result ? SortedMerge(*left, result) : *left; - } - } - return result; -} - -template -/* static */ bool nsIFrame::IsFrameListSorted(nsFrameList& aFrameList) { - if (aFrameList.IsEmpty()) { - // empty lists are trivially sorted. - return true; - } - - // We'll walk through the list with two iterators, one trailing behind the - // other. The list is sorted IFF trailingIter <= iter, across the whole list. - nsFrameList::Enumerator trailingIter(aFrameList); - nsFrameList::Enumerator iter(aFrameList); - iter.Next(); // Skip |iter| past first frame. (List is nonempty, so we can.) - - // Now, advance the iterators in parallel, comparing each adjacent pair. - while (!iter.AtEnd()) { - MOZ_ASSERT(!trailingIter.AtEnd(), "trailing iter shouldn't finish first"); - if (!IsLessThanOrEqual(trailingIter.get(), iter.get())) { - return false; - } - trailingIter.Next(); - iter.Next(); - } - - // We made it to the end without returning early, so the list is sorted. - return true; -} - #endif /* nsIFrame_h___ */ diff --git a/layout/generic/nsIFrameInlines.h b/layout/generic/nsIFrameInlines.h index f830690d9b..eacc7fd747 100644 --- a/layout/generic/nsIFrameInlines.h +++ b/layout/generic/nsIFrameInlines.h @@ -275,13 +275,4 @@ mozilla::LogicalPoint nsIFrame::GetLogicalNormalPosition( aContainerSize - mRect.Size()); } -template -/* static */ void nsIFrame::SortFrameList(nsFrameList& aFrameList) { - nsIFrame* head = MergeSort(aFrameList.FirstChild()); - aFrameList.Clear(); - aFrameList = nsFrameList(head, nsLayoutUtils::GetLastSibling(head)); - MOZ_ASSERT(IsFrameListSorted(aFrameList), - "After we sort a frame list, it should be in sorted order..."); -} - #endif diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index db3312c16f..2a9a7e869a 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -589,12 +589,6 @@ class nsLineBox final : public nsLineLink { mBounds = mozilla::LogicalRect(aWritingMode, aIStart, aBStart, aISize, aBSize); } - void SetBounds(mozilla::WritingMode aWritingMode, nsRect aRect, - const nsSize& aContainerSize) { - mWritingMode = aWritingMode; - mContainerSize = aContainerSize; - mBounds = mozilla::LogicalRect(aWritingMode, aRect, aContainerSize); - } // mFlags.mHasHashedFrames says which one to use union { diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 1f99bc8e96..71c7fad445 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -1480,13 +1480,13 @@ nsresult nsPluginFrame::HandleEvent(nsPresContext* aPresContext, mInstanceOwner->ConsiderNewEventloopNestingLevel(); if (anEvent->mMessage == ePluginActivate) { - nsIFocusManager* fm = nsFocusManager::GetFocusManager(); + nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) { RefPtr elem = GetContent()->AsElement(); return fm->SetFocus(elem, 0); } } else if (anEvent->mMessage == ePluginFocus) { - nsIFocusManager* fm = nsFocusManager::GetFocusManager(); + nsFocusManager* fm = nsFocusManager::GetFocusManager(); if (fm) { RefPtr elem = GetContent()->AsElement(); return fm->FocusPlugin(elem); diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index b30ecc1e26..30329049bc 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -4906,6 +4906,9 @@ void nsTextFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, TextDecorations textDecs; GetTextDecorations(PresContext(), eResolvedColors, textDecs); if (!textDecs.HasDecorationLines()) { + if (auto* currentPresContext = aBuilder->CurrentPresContext()) { + currentPresContext->SetBuiltInvisibleText(); + } return; } } diff --git a/layout/generic/nsVideoFrame.cpp b/layout/generic/nsVideoFrame.cpp index 709e21b8d8..1764a712a5 100644 --- a/layout/generic/nsVideoFrame.cpp +++ b/layout/generic/nsVideoFrame.cpp @@ -504,6 +504,13 @@ class nsDisplayVideo : public nsPaintedDisplayItem { return elem->IsPotentiallyPlaying() ? LayerState::LAYER_ACTIVE_FORCE : LayerState::LAYER_INACTIVE; } + + // Only report FirstContentfulPaint when the video is set + bool IsContentful() const override { + nsVideoFrame* f = static_cast(Frame()); + HTMLVideoElement* video = HTMLVideoElement::FromNode(f->GetContent()); + return video->VideoWidth() > 0; + } }; void nsVideoFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, diff --git a/layout/generic/test/chrome.ini b/layout/generic/test/chrome.ini index e2126b45d9..b3282eeeac 100644 --- a/layout/generic/test/chrome.ini +++ b/layout/generic/test/chrome.ini @@ -1,17 +1,17 @@ [DEFAULT] skip-if = os == 'android' support-files = - file_bug514732_window.xul + file_bug514732_window.xhtml frame_selection_underline-ref.xhtml frame_selection_underline.css frame_selection_underline.xhtml -[test_backspace_delete.xul] +[test_backspace_delete.xhtml] skip-if = true # Bug 1163311 -[test_bug469613.xul] -[test_bug469774.xul] -[test_bug508115.xul] -[test_bug514732-2.xul] -[test_bug632379.xul] +[test_bug469613.xhtml] +[test_bug469774.xhtml] +[test_bug508115.xhtml] +[test_bug514732-2.xhtml] +[test_bug632379.xhtml] skip-if = os == 'linux' || (verify && (os == 'win')) # Bug 1207914 [test_selection_underline.html] diff --git a/layout/generic/test/file_bug514732_window.xul b/layout/generic/test/file_bug514732_window.xhtml similarity index 100% rename from layout/generic/test/file_bug514732_window.xul rename to layout/generic/test/file_bug514732_window.xhtml diff --git a/layout/generic/test/mochitest.ini b/layout/generic/test/mochitest.ini index 934dcaecd5..1f27c27bdf 100644 --- a/layout/generic/test/mochitest.ini +++ b/layout/generic/test/mochitest.ini @@ -141,7 +141,6 @@ skip-if = e10s [test_scrollframe_abspos_interrupt.html] [test_selection_doubleclick.html] [test_selection_expanding.html] -support-files = selection_expanding_xbl.xml [test_selection_preventDefault.html] [test_selection_splitText-normalize.html] [test_selection_touchevents.html] diff --git a/layout/generic/test/selection_expanding_xbl.xml b/layout/generic/test/selection_expanding_xbl.xml deleted file mode 100644 index aade8f8bb6..0000000000 --- a/layout/generic/test/selection_expanding_xbl.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -

    xxxxxxx xxxxxxx xxxxxxx

    - -
    -
    -
    -
    diff --git a/layout/generic/test/test_backspace_delete.xul b/layout/generic/test/test_backspace_delete.xhtml similarity index 100% rename from layout/generic/test/test_backspace_delete.xul rename to layout/generic/test/test_backspace_delete.xhtml diff --git a/layout/generic/test/test_bug469613.xul b/layout/generic/test/test_bug469613.xhtml similarity index 100% rename from layout/generic/test/test_bug469613.xul rename to layout/generic/test/test_bug469613.xhtml diff --git a/layout/generic/test/test_bug469774.xul b/layout/generic/test/test_bug469774.xhtml similarity index 97% rename from layout/generic/test/test_bug469774.xul rename to layout/generic/test/test_bug469774.xhtml index 82a9a624eb..1a295de896 100644 --- a/layout/generic/test/test_bug469774.xul +++ b/layout/generic/test/test_bug469774.xhtml @@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=469774 - + diff --git a/layout/generic/test/test_bug508115.xul b/layout/generic/test/test_bug508115.xhtml similarity index 100% rename from layout/generic/test/test_bug508115.xul rename to layout/generic/test/test_bug508115.xhtml diff --git a/layout/generic/test/test_bug514732-2.xul b/layout/generic/test/test_bug514732-2.xhtml similarity index 94% rename from layout/generic/test/test_bug514732-2.xul rename to layout/generic/test/test_bug514732-2.xhtml index e684c38156..673a9c66ab 100644 --- a/layout/generic/test/test_bug514732-2.xul +++ b/layout/generic/test/test_bug514732-2.xhtml @@ -31,7 +31,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=514732 /** Test for Bug 514732 **/ SimpleTest.waitForExplicitFinish(); -window.open("file_bug514732_window.xul", "bug514732", +window.open("file_bug514732_window.xhtml", "bug514732", "chrome,width=600,height=600,scrollbars"); ]]> diff --git a/layout/generic/test/test_bug632379.xul b/layout/generic/test/test_bug632379.xhtml similarity index 100% rename from layout/generic/test/test_bug632379.xul rename to layout/generic/test/test_bug632379.xhtml diff --git a/layout/generic/test/test_selection_expanding.html b/layout/generic/test/test_selection_expanding.html index e6e5eb3b54..f9d25bfd17 100644 --- a/layout/generic/test/test_selection_expanding.html +++ b/layout/generic/test/test_selection_expanding.html @@ -5,7 +5,16 @@ - + +
    aaaaaaa @@ -57,9 +69,9 @@ dddddd dddddd dddddd
    -
    -

    yyyyyyy yyyyyyy yyyyyyy

    -
    + +

    yyyyyyy yyyyyyy yyyyyyy

    +
    eeeeee eeeeee eeeeee
    @@ -69,8 +81,7 @@ var div1 = document.getElementById("div1"); var div2 = document.getElementById("div2"); var div3 = document.getElementById("div3"); -var xbl = document.getElementById("xbl"); -var xbl_child = document.getElementById("xbl_child"); +var custom_child = document.getElementById("custom_child"); var fixedDiv1 = document.getElementById("fixedDiv1"); var fixedDiv2 = document.getElementById("fixedDiv2"); var iframe = document.getElementById("iframe"); @@ -116,7 +127,7 @@ function test() aDiv2ShouldBeSelected, aDiv3ShouldBeSelected, aFixedDiv1ShouldBeSelected, - aXBLChildShouldBeSelected, + aCustomChildShouldBeSelected, aFixedDiv2ShouldBeSelected, aIFrameShouldBeSelected, aInputShouldBeSelected, @@ -148,15 +159,15 @@ function test() checkCharacter(sel, "a", aDiv1ShouldBeSelected, "div1"); checkCharacter(sel, "b", aDiv2ShouldBeSelected, "div2"); checkCharacter(sel, "c", aDiv3ShouldBeSelected, "div3"); - checkCharacter(sel, "y", aXBLChildShouldBeSelected, "xbl_child"); + checkCharacter(sel, "y", aCustomChildShouldBeSelected, "custom_child"); checkCharacter(sel, "d", aFixedDiv1ShouldBeSelected, "fixedDiv1"); checkCharacter(sel, "e", aFixedDiv2ShouldBeSelected, "fixedDiv2"); - // iframe/input/xbl-bound contents must not be included on the parent + // iframe/input/custom-element contents must not be included on the parent // selection. checkCharacter(sel, "f", false, "iframe (checking on parent)"); checkCharacter(sel, "i", false, "input (checking on parent)"); - checkCharacter(sel, "x", false, "XBL bound contents (checking on parent)"); + checkCharacter(sel, "x", false, "Custom element contents (checking on parent)"); var selInIFrame = iframe.contentWindow.getSelection().toString(); checkCharacter(selInIFrame, "f", aIFrameShouldBeSelected, "iframe"); @@ -222,11 +233,11 @@ function test() kTrue, kFalse, kFalse, kFalse, kFalse, kFalse, "div1-fixedDiv1, all boxes are overflow: " + kOverflows[i] + ";"); - // to xbl_child - synthesizeMouse(xbl_child, 30, 5, { type: "mousemove" }); + // to custom_child + synthesizeMouse(custom_child, 30, 5, { type: "mousemove" }); check(kTrue, kTrue, kTrue, kTrue, kTrue, kFalse, kFalse, kFalse, kFalse, - "div1-xbl_child, all boxes are overflow: " + kOverflows[i] + ";"); + "div1-custom_child, all boxes are overflow: " + kOverflows[i] + ";"); // to fixedDiv2 (sibling of div*) synthesizeMouse(fixedDiv2, 30, 5, { type: "mousemove" }); @@ -240,11 +251,11 @@ function test() // selection starting at fixedDiv1 synthesizeMouse(fixedDiv1, 30, 5, { type: "mousedown" }); - // to xbl_child - synthesizeMouse(xbl_child, 30, 5, { type: "mousemove" }); + // to custom_child + synthesizeMouse(custom_child, 30, 5, { type: "mousemove" }); check(kFalse, kFalse, kFalse, kTrue, kTrue, kFalse, kFalse, kFalse, kFalse, - "fixedDiv1-xbl_child, all boxes are overflow: " + kOverflows[i] + ";"); + "fixedDiv1-custom_child, all boxes are overflow: " + kOverflows[i] + ";"); // to fixedDiv2 synthesizeMouse(fixedDiv2, 30, 5, { type: "mousemove" }); @@ -258,11 +269,11 @@ function test() // selection starting at fixedDiv2 synthesizeMouse(fixedDiv2, 30, 5, { type: "mousedown" }); - // to xbl_child - synthesizeMouse(xbl_child, 30, 5, { type: "mousemove" }); + // to custom_child + synthesizeMouse(custom_child, 30, 5, { type: "mousemove" }); check(kFalse, kFalse, kFalse, kFalse, kTrue, kTrue, kFalse, kFalse, kFalse, - "fixedDiv2-xbl_child, all boxes are overflow: " + kOverflows[i] + ";"); + "fixedDiv2-custom_child, all boxes are overflow: " + kOverflows[i] + ";"); // to fixedDiv1 synthesizeMouse(fixedDiv1, 30, 5, { type: "mousemove" }); @@ -293,11 +304,11 @@ function test() "div2-fixedDiv1, div3 is overflow: " + kOverflows[i] + ";, but div2 is overflow: visible;"); - // to xbl_child - synthesizeMouse(xbl_child, 30, 5, { type: "mousemove" }); + // to custom_child + synthesizeMouse(custom_child, 30, 5, { type: "mousemove" }); check(kFalse, kTrue, kTrue, kTrue, kTrue, kFalse, kFalse, kFalse, kFalse, - "div2-xbl_child, div3 is overflow: " + kOverflows[i] + + "div2-custom_child, div3 is overflow: " + kOverflows[i] + ";, but div2 is overflow: visible;"); // to fixedDiv2 (sibling of div*) @@ -327,11 +338,11 @@ function test() "div3-fixedDiv1, div3 is overflow: " + kOverflows[i] + ";, but div2 is overflow: visible;"); - // to xbl_child - synthesizeMouse(xbl_child, 30, 5, { type: "mousemove" }); + // to custom_child + synthesizeMouse(custom_child, 30, 5, { type: "mousemove" }); check(kFalse, kFalse, kTrue, kTrue, kTrue, kFalse, kFalse, kFalse, kFalse, - "div3-xbl_child, div3 is overflow: " + kOverflows[i] + + "div3-custom_child, div3 is overflow: " + kOverflows[i] + ";, but div2 is overflow: visible;"); // to fixedDiv2 (sibling of div*) diff --git a/layout/inspector/InspectorUtils.cpp b/layout/inspector/InspectorUtils.cpp index 08fb2019c7..82b56f9841 100644 --- a/layout/inspector/InspectorUtils.cpp +++ b/layout/inspector/InspectorUtils.cpp @@ -13,9 +13,6 @@ #include "nsIContentInlines.h" #include "nsIScrollableFrame.h" #include "mozilla/dom/Document.h" -#include "nsXBLBinding.h" -#include "nsXBLPrototypeBinding.h" -#include "nsBindingManager.h" #include "ChildIterator.h" #include "nsComputedDOMStyle.h" #include "mozilla/EventStateManager.h" @@ -287,7 +284,7 @@ uint32_t InspectorUtils::GetRelativeRuleLine(GlobalObject& aGlobal, /* static */ bool InspectorUtils::HasRulesModifiedByCSSOM(GlobalObject& aGlobal, StyleSheet& aSheet) { - return aSheet.HasModifiedRules(); + return aSheet.HasModifiedRulesForDevtools(); } /* static */ @@ -515,18 +512,7 @@ bool InspectorUtils::IsValidCSSColor(GlobalObject& aGlobalObject, void InspectorUtils::GetBindingURLs(GlobalObject& aGlobalObject, Element& aElement, - nsTArray& aResult) { - nsXBLBinding* binding = aElement.GetXBLBinding(); - - while (binding) { - nsCString spec; - nsCOMPtr bindingURI = binding->PrototypeBinding()->BindingURI(); - bindingURI->GetSpec(spec); - nsString* resultURI = aResult.AppendElement(); - CopyASCIItoUTF16(spec, *resultURI); - binding = binding->GetBaseBinding(); - } -} + nsTArray& aResult) {} /* static */ bool InspectorUtils::SetContentState(GlobalObject& aGlobalObject, diff --git a/layout/inspector/inDeepTreeWalker.cpp b/layout/inspector/inDeepTreeWalker.cpp index 2b2c2294da..eb034d8785 100644 --- a/layout/inspector/inDeepTreeWalker.cpp +++ b/layout/inspector/inDeepTreeWalker.cpp @@ -10,6 +10,7 @@ #include "mozilla/dom/Document.h" #include "nsServiceManagerUtils.h" #include "nsIContent.h" +#include "nsINodeList.h" //MY68 #include "ChildIterator.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/InspectorUtils.h" diff --git a/layout/inspector/moz.build b/layout/inspector/moz.build index 113c4fff58..df3aa40705 100644 --- a/layout/inspector/moz.build +++ b/layout/inspector/moz.build @@ -35,5 +35,4 @@ FINAL_LIBRARY = 'xul' LOCAL_INCLUDES += [ '../style', '/dom/base', - '/dom/xbl', ] diff --git a/layout/inspector/tests/chrome/chrome.ini b/layout/inspector/tests/chrome/chrome.ini index 9cefab81ea..7372f43b07 100644 --- a/layout/inspector/tests/chrome/chrome.ini +++ b/layout/inspector/tests/chrome/chrome.ini @@ -2,30 +2,30 @@ skip-if = os == 'android' support-files = GentiumPlus-R.woff -[test_bug467669.xul] +[test_bug467669.xhtml] support-files = test_bug467669.css -[test_bug695639.xul] +[test_bug695639.xhtml] support-files = test_bug695639.css -[test_bug708874.xul] +[test_bug708874.xhtml] support-files = test_bug708874.css -[test_bug727834.xul] +[test_bug727834.xhtml] support-files = test_bug727834.css -[test_fontFaceRanges.xul] +[test_fontFaceRanges.xhtml] support-files = test_fontFaceRanges.css -[test_fontFeaturesAPI.xul] +[test_fontFeaturesAPI.xhtml] support-files = test_fontFeaturesAPI.css DejaVuSans.ttf -[test_fontVariationsAPI.xul] +[test_fontVariationsAPI.xhtml] skip-if = ((os == 'win' && bits!=64) || (os=='linux' && bits==32) || os == 'mac') # bug 1456855, bug 1456856 support-files = test_fontVariationsAPI.css -[test_fontFaceGeneric.xul] +[test_fontFaceGeneric.xhtml] [test_ua_rule_modification.html] [test_ua_sheet_disable.html] [test_visited_style.html] \ No newline at end of file diff --git a/layout/inspector/tests/chrome/test_bug467669.xul b/layout/inspector/tests/chrome/test_bug467669.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_bug467669.xul rename to layout/inspector/tests/chrome/test_bug467669.xhtml diff --git a/layout/inspector/tests/chrome/test_bug695639.xul b/layout/inspector/tests/chrome/test_bug695639.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_bug695639.xul rename to layout/inspector/tests/chrome/test_bug695639.xhtml diff --git a/layout/inspector/tests/chrome/test_bug708874.xul b/layout/inspector/tests/chrome/test_bug708874.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_bug708874.xul rename to layout/inspector/tests/chrome/test_bug708874.xhtml diff --git a/layout/inspector/tests/chrome/test_bug727834.xul b/layout/inspector/tests/chrome/test_bug727834.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_bug727834.xul rename to layout/inspector/tests/chrome/test_bug727834.xhtml diff --git a/layout/inspector/tests/chrome/test_fontFaceGeneric.xul b/layout/inspector/tests/chrome/test_fontFaceGeneric.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_fontFaceGeneric.xul rename to layout/inspector/tests/chrome/test_fontFaceGeneric.xhtml diff --git a/layout/inspector/tests/chrome/test_fontFaceRanges.xul b/layout/inspector/tests/chrome/test_fontFaceRanges.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_fontFaceRanges.xul rename to layout/inspector/tests/chrome/test_fontFaceRanges.xhtml diff --git a/layout/inspector/tests/chrome/test_fontFeaturesAPI.xul b/layout/inspector/tests/chrome/test_fontFeaturesAPI.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_fontFeaturesAPI.xul rename to layout/inspector/tests/chrome/test_fontFeaturesAPI.xhtml diff --git a/layout/inspector/tests/chrome/test_fontVariationsAPI.xul b/layout/inspector/tests/chrome/test_fontVariationsAPI.xhtml similarity index 100% rename from layout/inspector/tests/chrome/test_fontVariationsAPI.xul rename to layout/inspector/tests/chrome/test_fontVariationsAPI.xhtml diff --git a/layout/inspector/tests/mochitest.ini b/layout/inspector/tests/mochitest.ini index 26ce6e3727..094410a9e4 100644 --- a/layout/inspector/tests/mochitest.ini +++ b/layout/inspector/tests/mochitest.ini @@ -7,11 +7,11 @@ support-files = [test_bug462787.html] [test_bug462789.html] -[test_bug522601.xhtml] +[test_bug522601-shadow.xhtml] [test_bug536379.html] [test_bug536379-2.html] [test_bug557726.html] -[test_bug609549.xhtml] +[test_bug609549-shadow.xhtml] [test_bug856317.html] [test_bug877690.html] [test_bug1006595.html] diff --git a/layout/inspector/tests/test_bug522601.xhtml b/layout/inspector/tests/test_bug522601-shadow.xhtml similarity index 86% rename from layout/inspector/tests/test_bug522601.xhtml rename to layout/inspector/tests/test_bug522601-shadow.xhtml index 68b33eabf6..55772a8d46 100644 --- a/layout/inspector/tests/test_bug522601.xhtml +++ b/layout/inspector/tests/test_bug522601-shadow.xhtml @@ -6,28 +6,19 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=522601 Test for Bug 522601 - - - -
    -
    -
    + Mozilla Bug 522601 -

    - This is some text + + This is some text More text - Even more ItalictextAnd more italic

    + Even more ItalictextAnd more italic
    -
    -

    light child

    -
     
       
    -
    -  
    -    
    -      
    -      
    x
    x
    -
    -
    + + Mozilla Bug 609549 -

    lorem ipsum dolor sit amet

    sandwiched
    + +

    lorem ipsum dolor sit amet

    sandwiched