summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /layout
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout')
-rw-r--r--layout/base/LayoutTelemetryTools.h4
-rw-r--r--layout/base/MotionPathUtils.cpp8
-rw-r--r--layout/base/PositionedEventTargeting.cpp12
-rw-r--r--layout/base/PresShell.cpp204
-rw-r--r--layout/base/PresShell.h12
-rw-r--r--layout/base/RestyleManager.cpp9
-rw-r--r--layout/base/TouchManager.cpp130
-rw-r--r--layout/base/TouchManager.h16
-rw-r--r--layout/base/crashtests/1435015.html9
-rw-r--r--layout/base/crashtests/243159-2.xhtml26
-rw-r--r--layout/base/crashtests/355993-1.xhtml26
-rw-r--r--layout/base/crashtests/384649-1.xhtml31
-rw-r--r--layout/base/crashtests/394150-1.xhtml27
-rw-r--r--layout/base/crashtests/399676-1.xhtml7
-rw-r--r--layout/base/crashtests/400445-1.xhtml22
-rw-r--r--layout/base/crashtests/400904-1.xhtml20
-rw-r--r--layout/base/crashtests/crashtests.list12
-rw-r--r--layout/base/nsBidiPresUtils.cpp247
-rw-r--r--layout/base/nsBidiPresUtils.h6
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp240
-rw-r--r--layout/base/nsCSSFrameConstructor.h51
-rw-r--r--layout/base/nsDocumentViewer.cpp6
-rw-r--r--layout/base/nsLayoutUtils.cpp14
-rw-r--r--layout/base/nsLayoutUtils.h8
-rw-r--r--layout/base/nsPresContext.cpp1
-rw-r--r--layout/base/nsPresContext.h3
-rw-r--r--layout/base/nsRefreshDriver.cpp3
-rw-r--r--layout/base/tests/mochitest.toml2
-rw-r--r--layout/base/tests/test_bug1836801.html59
-rw-r--r--layout/base/tests/test_event_target_iframe_oop.html177
-rw-r--r--layout/build/components.conf10
-rw-r--r--layout/build/moz.build1
-rw-r--r--layout/build/nsContentDLF.cpp1
-rw-r--r--layout/build/nsLayoutCID.h105
-rw-r--r--layout/build/nsLayoutModule.cpp2
-rw-r--r--layout/forms/HTMLSelectEventListener.cpp2
-rw-r--r--layout/forms/crashtests/crashtests.list2
-rw-r--r--layout/forms/moz.build1
-rw-r--r--layout/forms/nsButtonFrameRenderer.cpp471
-rw-r--r--layout/forms/nsButtonFrameRenderer.h83
-rw-r--r--layout/forms/nsComboboxControlFrame.cpp600
-rw-r--r--layout/forms/nsComboboxControlFrame.h128
-rw-r--r--layout/forms/nsFieldSetFrame.cpp10
-rw-r--r--layout/forms/nsGfxButtonControlFrame.cpp4
-rw-r--r--layout/forms/nsGfxButtonControlFrame.h23
-rw-r--r--layout/forms/nsHTMLButtonControlFrame.cpp175
-rw-r--r--layout/forms/nsHTMLButtonControlFrame.h15
-rw-r--r--layout/forms/nsNumberControlFrame.cpp25
-rw-r--r--layout/forms/test/test_bug536567_perwindowpb.html2
-rw-r--r--layout/forms/test/test_bug935876.html14
-rw-r--r--layout/generic/BlockReflowState.cpp31
-rw-r--r--layout/generic/BlockReflowState.h20
-rw-r--r--layout/generic/FrameClasses.py18
-rw-r--r--layout/generic/ScrollAnchorContainer.cpp7
-rw-r--r--layout/generic/ScrollAnimationMSDPhysics.cpp14
-rw-r--r--layout/generic/ScrollOrigin.h2
-rw-r--r--layout/generic/ScrollPositionUpdate.cpp15
-rw-r--r--layout/generic/ScrollPositionUpdate.h6
-rw-r--r--layout/generic/StickyScrollContainer.cpp11
-rw-r--r--layout/generic/TextOverflow.cpp16
-rw-r--r--layout/generic/ViewportFrame.cpp1
-rw-r--r--layout/generic/WritingModes.h10
-rw-r--r--layout/generic/crashtests/1140268-1.html18
-rw-r--r--layout/generic/crashtests/364686-1.xhtml12
-rw-r--r--layout/generic/crashtests/368461-1.xhtml11
-rw-r--r--layout/generic/crashtests/370884-1.xhtml14
-rw-r--r--layout/generic/crashtests/382208-1.xhtml7
-rw-r--r--layout/generic/crashtests/382396-1.xhtml7
-rw-r--r--layout/generic/crashtests/385265-1.xhtml13
-rw-r--r--layout/generic/crashtests/395450-1.xhtml28
-rw-r--r--layout/generic/crashtests/467914-1.html3
-rw-r--r--layout/generic/crashtests/547843-1.xhtml1
-rw-r--r--layout/generic/crashtests/700031.xhtml9
-rw-r--r--layout/generic/crashtests/crashtests.list17
-rw-r--r--layout/generic/nsBlockFrame.cpp506
-rw-r--r--layout/generic/nsBlockFrame.h31
-rw-r--r--layout/generic/nsBlockReflowContext.cpp2
-rw-r--r--layout/generic/nsContainerFrame.cpp52
-rw-r--r--layout/generic/nsFloatManager.h4
-rw-r--r--layout/generic/nsFrameSelection.cpp2
-rw-r--r--layout/generic/nsFrameStateBits.h31
-rw-r--r--layout/generic/nsGfxScrollFrame.cpp91
-rw-r--r--layout/generic/nsGfxScrollFrame.h8
-rw-r--r--layout/generic/nsGridContainerFrame.cpp87
-rw-r--r--layout/generic/nsGridContainerFrame.h6
-rw-r--r--layout/generic/nsHTMLParts.h4
-rw-r--r--layout/generic/nsIFrame.cpp108
-rw-r--r--layout/generic/nsIFrame.h15
-rw-r--r--layout/generic/nsImageFrame.cpp14
-rw-r--r--layout/generic/nsLineLayout.cpp5
-rw-r--r--layout/generic/nsTextFrame.cpp22
-rw-r--r--layout/generic/nsTextFrame.h8
-rw-r--r--layout/generic/nsTextPaintStyle.cpp4
-rw-r--r--layout/generic/nsTextPaintStyle.h5
-rw-r--r--layout/inspector/InspectorUtils.cpp93
-rw-r--r--layout/inspector/InspectorUtils.h16
-rw-r--r--layout/inspector/tests/mochitest.toml3
-rw-r--r--layout/inspector/tests/test_bug877690.html2
-rw-r--r--layout/inspector/tests/test_color_to.html116
-rw-r--r--layout/mathml/nsIMathMLFrame.h8
-rw-r--r--layout/mathml/nsMathMLContainerFrame.cpp57
-rw-r--r--layout/mathml/nsMathMLTokenFrame.cpp2
-rw-r--r--layout/mathml/nsMathMLmencloseFrame.cpp4
-rw-r--r--layout/mathml/nsMathMLmoFrame.cpp2
-rw-r--r--layout/mathml/nsMathMLmpaddedFrame.cpp3
-rw-r--r--layout/mathml/nsMathMLmrootFrame.cpp19
-rw-r--r--layout/mathml/nsMathMLmspaceFrame.cpp1
-rw-r--r--layout/mathml/tests/chrome.toml9
-rw-r--r--layout/painting/ActiveLayerTracker.cpp50
-rw-r--r--layout/painting/RetainedDisplayListBuilder.cpp11
-rw-r--r--layout/painting/nsDisplayItemTypesList.h4
-rw-r--r--layout/painting/nsDisplayList.cpp31
-rw-r--r--layout/painting/nsDisplayList.h16
-rw-r--r--layout/reftests/abs-pos/reftest.list2
-rw-r--r--layout/reftests/async-scrolling/reftest.list174
-rw-r--r--layout/reftests/backgrounds/reftest.list2
-rw-r--r--layout/reftests/bidi/dirAuto/1103348-1-ref.html19
-rw-r--r--layout/reftests/bidi/dirAuto/1103348-1.html36
-rw-r--r--layout/reftests/bidi/dirAuto/reftest.list1
-rw-r--r--layout/reftests/bidi/numeral/reftest.list6
-rw-r--r--layout/reftests/bidi/reftest.list6
-rw-r--r--layout/reftests/border-image/reftest.list22
-rw-r--r--layout/reftests/border-radius/reftest.list8
-rw-r--r--layout/reftests/box-shadow/reftest.list16
-rw-r--r--layout/reftests/bugs/1553571-1.html16
-rw-r--r--layout/reftests/bugs/1553571-2.html16
-rw-r--r--layout/reftests/bugs/1878294-1-ref.html8
-rw-r--r--layout/reftests/bugs/1878294-1.html41
-rw-r--r--layout/reftests/bugs/reftest.list129
-rw-r--r--layout/reftests/canvas/reftest.list12
-rw-r--r--layout/reftests/columns/reftest.list4
-rw-r--r--layout/reftests/css-animations/reftest.list2
-rw-r--r--layout/reftests/css-blending/reftest.list24
-rw-r--r--layout/reftests/css-gradients/reftest.list22
-rw-r--r--layout/reftests/css-grid/reftest.list2
-rw-r--r--layout/reftests/display-list/reftest.list42
-rw-r--r--layout/reftests/first-letter/reftest.list4
-rw-r--r--layout/reftests/floats/reftest.list4
-rw-r--r--layout/reftests/font-face/reftest.list10
-rw-r--r--layout/reftests/font-inflation/reftest.list2
-rw-r--r--layout/reftests/font-matching/reftest.list16
-rw-r--r--layout/reftests/forms/fieldset/reftest.list2
-rw-r--r--layout/reftests/forms/input/file/reftest.list2
-rw-r--r--layout/reftests/forms/input/number/number.html2
-rw-r--r--layout/reftests/forms/input/number/reftest.list6
-rw-r--r--layout/reftests/forms/input/radio/reftest.list2
-rw-r--r--layout/reftests/forms/input/text/autofill-author-background.html9
-rw-r--r--layout/reftests/forms/input/text/reftest.list3
-rw-r--r--layout/reftests/forms/placeholder/reftest.list4
-rw-r--r--layout/reftests/forms/textarea/reftest.list2
-rw-r--r--layout/reftests/forms/textbox/reftest.list1
-rw-r--r--layout/reftests/forms/textbox/setsize-ref.xhtml9
-rw-r--r--layout/reftests/forms/textbox/setsize.xhtml8
-rw-r--r--layout/reftests/high-contrast/reftest.list1
-rw-r--r--layout/reftests/high-contrast/transparent-textarea-ref.html4
-rw-r--r--layout/reftests/high-contrast/transparent-textarea.html17
-rw-r--r--layout/reftests/image-element/reftest.list12
-rw-r--r--layout/reftests/image/reftest.list2
-rw-r--r--layout/reftests/invalidation/reftest.list2
-rw-r--r--layout/reftests/layers/reftest.list16
-rw-r--r--layout/reftests/list-item/reftest.list6
-rw-r--r--layout/reftests/mathml/largeop-1-ref.html0
-rw-r--r--layout/reftests/mathml/largeop-1.html0
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-base-ref.html14
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-base.html16
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html15
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-mprescript.html18
-rw-r--r--layout/reftests/mathml/mirror-op-1-ref.html19
-rw-r--r--layout/reftests/mathml/mirror-op-1.html14
-rw-r--r--layout/reftests/mathml/mirror-op-2-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-2.html9
-rw-r--r--layout/reftests/mathml/mirror-op-3-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-3.html9
-rw-r--r--layout/reftests/mathml/mirror-op-4-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-4.html9
-rw-r--r--layout/reftests/mathml/mmultiscript-align-ref.html42
-rw-r--r--layout/reftests/mathml/mmultiscript-align.html38
-rw-r--r--layout/reftests/mathml/mo-glyph-size-ref.html14
-rw-r--r--layout/reftests/mathml/mo-glyph-size.html50
-rw-r--r--layout/reftests/mathml/mpadded-7-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-7.html16
-rw-r--r--layout/reftests/mathml/mpadded-8-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-8.html16
-rw-r--r--layout/reftests/mathml/mpadded-9-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-9.html16
-rw-r--r--layout/reftests/mathml/mstyle-2-ref.xhtml110
-rw-r--r--layout/reftests/mathml/mstyle-2.xhtml113
-rw-r--r--layout/reftests/mathml/mstyle-3-ref.xhtml133
-rw-r--r--layout/reftests/mathml/mstyle-3.xhtml136
-rw-r--r--layout/reftests/mathml/mstyle-4-ref.xhtml75
-rw-r--r--layout/reftests/mathml/mstyle-4.xhtml78
-rw-r--r--layout/reftests/mathml/multiscripts-1-ref.html71
-rw-r--r--layout/reftests/mathml/multiscripts-1.html71
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-false-ref.html114
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-false.html98
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-true-ref.html114
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-true.html98
-rw-r--r--layout/reftests/mathml/munderover-align-accent-false-ref.html132
-rw-r--r--layout/reftests/mathml/munderover-align-accent-false.html104
-rw-r--r--layout/reftests/mathml/munderover-align-accent-true-ref.html132
-rw-r--r--layout/reftests/mathml/munderover-align-accent-true.html104
-rw-r--r--layout/reftests/mathml/munderover-empty-scripts-ref.html35
-rw-r--r--layout/reftests/mathml/munderover-empty-scripts.html32
-rw-r--r--layout/reftests/mathml/overbar-width-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/overbar-width-1.xhtml25
-rw-r--r--layout/reftests/mathml/radicalbar-1.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1a.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1b.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1c.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1d.html48
-rw-r--r--layout/reftests/mathml/radicalbar-2.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2a.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2b.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2c.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2d.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3a.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3b.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3c.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3d.html47
-rw-r--r--layout/reftests/mathml/reftest.list55
-rw-r--r--layout/reftests/mathml/scale-stretchy-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/scale-stretchy-1.xhtml41
-rw-r--r--layout/reftests/mathml/scale-stretchy-2-ref.xhtml26
-rw-r--r--layout/reftests/mathml/scale-stretchy-2.xhtml41
-rw-r--r--layout/reftests/mathml/scale-stretchy-3-ref.xhtml27
-rw-r--r--layout/reftests/mathml/scale-stretchy-3.xhtml43
-rw-r--r--layout/reftests/mathml/scale-stretchy-4-ref.xhtml27
-rw-r--r--layout/reftests/mathml/scale-stretchy-4.xhtml43
-rw-r--r--layout/reftests/mathml/scale-stretchy-5-ref.xhtml14
-rw-r--r--layout/reftests/mathml/scale-stretchy-5.xhtml14
-rw-r--r--layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html25
-rw-r--r--layout/reftests/mathml/scriptlevel-movablelimits-1.html25
-rw-r--r--layout/reftests/mathml/semantics-1-ref.xhtml66
-rw-r--r--layout/reftests/mathml/semantics-1.xhtml66
-rw-r--r--layout/reftests/mathml/semantics-2-ref.html19
-rw-r--r--layout/reftests/mathml/semantics-2.html19
-rw-r--r--layout/reftests/mathml/semantics-3-ref.html21
-rw-r--r--layout/reftests/mathml/semantics-3.html21
-rw-r--r--layout/reftests/mathml/semantics-5-ref.html17
-rw-r--r--layout/reftests/mathml/semantics-5.html17
-rw-r--r--layout/reftests/mathml/stretchy-1-ref.html14
-rw-r--r--layout/reftests/mathml/stretchy-1.html14
-rw-r--r--layout/reftests/mathml/stretchy-largeop-1-ref.html56
-rw-r--r--layout/reftests/mathml/stretchy-largeop-1.html81
-rw-r--r--layout/reftests/mathml/stretchy-largeop-2-ref.html111
-rw-r--r--layout/reftests/mathml/stretchy-largeop-2.html137
-rw-r--r--layout/reftests/mathml/stretchy-largeop-3-ref.html123
-rw-r--r--layout/reftests/mathml/stretchy-largeop-3.html156
-rw-r--r--layout/reftests/mathml/subscript-italic-correction-ref.html36
-rw-r--r--layout/reftests/mathml/subscript-italic-correction.html61
-rw-r--r--layout/reftests/mathml/underbar-width-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/underbar-width-1.xhtml25
-rw-r--r--layout/reftests/mp4-video/reftest.list6
-rw-r--r--layout/reftests/native-theme/reftest.list2
-rw-r--r--layout/reftests/ogg-video/reftest.list2
-rw-r--r--layout/reftests/outline/reftest.list2
-rw-r--r--layout/reftests/pagination/reftest.list12
-rw-r--r--layout/reftests/pagination/rowgroup-page-break-after-always-1-ref.html18
-rw-r--r--layout/reftests/pagination/rowgroup-page-break-after-always-2-ref.html (renamed from layout/reftests/pagination/table-page-break-before-auto-3-ref.html)2
-rw-r--r--layout/reftests/pagination/table-caption-splitaftercaption-5-ref.html6
-rw-r--r--layout/reftests/pagination/table-nested-1308876-1-ref.html11
-rw-r--r--layout/reftests/pagination/table-nested-1308876-1.xhtml6
-rw-r--r--layout/reftests/pagination/table-tfoot-thead-1-ref.html2
-rw-r--r--layout/reftests/percent-overflow-sizing/reftest.list34
-rw-r--r--layout/reftests/position-dynamic-changes/reftest.list2
-rw-r--r--layout/reftests/position-dynamic-changes/relative/reftest.list8
-rw-r--r--layout/reftests/position-sticky/reftest.list14
-rw-r--r--layout/reftests/reftest-sanity/reftest.list20
-rw-r--r--layout/reftests/reftest.list12
-rw-r--r--layout/reftests/scrolling/reftest.list12
-rw-r--r--layout/reftests/selection/reftest.list4
-rw-r--r--layout/reftests/svg/as-image/reftest.list18
-rw-r--r--layout/reftests/svg/filters/css-filters/reftest.list32
-rw-r--r--layout/reftests/svg/filters/reftest.list8
-rw-r--r--layout/reftests/svg/filters/svg-filter-chains/reftest.list2
-rw-r--r--layout/reftests/svg/moz-only/reftest.list4
-rw-r--r--layout/reftests/svg/reftest.list24
-rw-r--r--layout/reftests/svg/sizing/reftest.list36
-rw-r--r--layout/reftests/svg/smil/container/reftest.list8
-rw-r--r--layout/reftests/svg/smil/reftest.list2
-rw-r--r--layout/reftests/svg/svg-integration/clip-path/reftest.list2
-rw-r--r--layout/reftests/svg/text/reftest.list12
-rw-r--r--layout/reftests/table-anonymous-boxes/reftest.list2
-rw-r--r--layout/reftests/table-overflow/bug785684-x-ref.html1
-rw-r--r--layout/reftests/table-overflow/bug785684-y-ref.html1
-rw-r--r--layout/reftests/table-overflow/reftest.list5
-rw-r--r--layout/reftests/text-overflow/reftest.list2
-rw-r--r--layout/reftests/text/reftest.list4
-rw-r--r--layout/reftests/text/webkit-text-security-1.html2
-rw-r--r--layout/reftests/transform-3d/reftest.list16
-rw-r--r--layout/reftests/transform/reftest.list2
-rw-r--r--layout/reftests/webm-video/reftest.list26
-rw-r--r--layout/reftests/writing-mode/reftest.list2
-rw-r--r--layout/reftests/xul/reftest.list2
-rw-r--r--layout/reftests/z-index/reftest.list6
-rw-r--r--layout/style/FontFaceSet.cpp1
-rw-r--r--layout/style/GeckoBindings.cpp2
-rw-r--r--layout/style/Loader.cpp208
-rw-r--r--layout/style/Loader.h5
-rw-r--r--layout/style/PseudoStyleType.h1
-rw-r--r--layout/style/ServoBindings.toml60
-rw-r--r--layout/style/ServoCSSParser.cpp10
-rw-r--r--layout/style/ServoCSSParser.h21
-rw-r--r--layout/style/ServoStyleConstsInlines.h68
-rw-r--r--layout/style/ServoStyleSet.h4
-rw-r--r--layout/style/SheetLoadData.h6
-rw-r--r--layout/style/StreamLoader.cpp114
-rw-r--r--layout/style/StreamLoader.h10
-rw-r--r--layout/style/StyleSheet.cpp47
-rw-r--r--layout/style/StyleSheet.h31
-rw-r--r--layout/style/contenteditable.css4
-rw-r--r--layout/style/crashtests/1397439-1.html6
-rw-r--r--layout/style/crashtests/1403465.html24
-rw-r--r--layout/style/crashtests/411603-1.html7
-rw-r--r--layout/style/crashtests/413274-1.xhtml18
-rw-r--r--layout/style/crashtests/418007-1.xhtml24
-rw-r--r--layout/style/crashtests/crashtests.list5
-rw-r--r--layout/style/nsCSSAnonBoxList.h1
-rw-r--r--layout/style/nsComputedDOMStyle.cpp28
-rw-r--r--layout/style/nsComputedDOMStyle.h6
-rw-r--r--layout/style/nsICSSDeclaration.h5
-rw-r--r--layout/style/nsMediaFeatures.cpp3
-rw-r--r--layout/style/nsStyleStruct.cpp11
-rw-r--r--layout/style/nsStyleStruct.h7
-rw-r--r--layout/style/nsStyleTransformMatrix.cpp3
-rw-r--r--layout/style/nsTransitionManager.cpp12
-rw-r--r--layout/style/nsTransitionManager.h1
-rw-r--r--layout/style/res/forms.css63
-rw-r--r--layout/style/res/html.css133
-rw-r--r--layout/style/test/ParseCSS.cpp1
-rw-r--r--layout/style/test/animation_utils.js2
-rw-r--r--layout/style/test/chrome/bug418986-2.js2
-rw-r--r--layout/style/test/mochitest.toml1
-rw-r--r--layout/style/test/property_database.js84
-rw-r--r--layout/style/test/test_shorthand_property_getters.html14
-rw-r--r--layout/svg/SVGGeometryFrame.cpp32
-rw-r--r--layout/svg/SVGGradientFrame.cpp3
-rw-r--r--layout/svg/SVGPatternFrame.cpp2
-rw-r--r--layout/svg/SVGTextFrame.cpp169
-rw-r--r--layout/svg/SVGUtils.h6
-rw-r--r--layout/svg/crashtests/1882921-1.html7
-rw-r--r--layout/svg/crashtests/crashtests.list1
-rw-r--r--layout/tables/crashtests/1555757-1.html16
-rw-r--r--layout/tables/crashtests/1555757-2.html27
-rw-r--r--layout/tables/crashtests/1881157.html26
-rw-r--r--layout/tables/crashtests/347506-1.xhtml23
-rw-r--r--layout/tables/crashtests/crashtests.list6
-rw-r--r--layout/tables/nsCellMap.cpp6
-rw-r--r--layout/tables/nsTableCellFrame.cpp19
-rw-r--r--layout/tables/nsTableFrame.cpp245
-rw-r--r--layout/tables/nsTableFrame.h3
-rw-r--r--layout/tables/nsTableRowFrame.cpp72
-rw-r--r--layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp2
-rw-r--r--layout/tools/layout-debug/ui/content/layoutdebug.js2
-rw-r--r--layout/tools/reftest/api.js2
-rw-r--r--layout/tools/reftest/reftest-content.js20
-rw-r--r--layout/tools/reftest/reftest.sys.mjs14
-rw-r--r--layout/tools/reftest/runreftest.py2
-rw-r--r--layout/xul/nsMenuPopupFrame.cpp33
-rw-r--r--layout/xul/nsSplitterFrame.cpp1
-rw-r--r--layout/xul/nsXULTooltipListener.cpp64
-rw-r--r--layout/xul/reftest/reftest.list2
-rw-r--r--layout/xul/test/browser_bug685470.js4
-rw-r--r--layout/xul/test/browser_bug703210.js4
-rw-r--r--layout/xul/test/browser_bug706743.js4
-rw-r--r--layout/xul/test/chrome.toml1
-rw-r--r--layout/xul/test/test_windowminmaxsize.xhtml62
-rw-r--r--layout/xul/test/titledpanelwindow.xhtml5
369 files changed, 3606 insertions, 8682 deletions
diff --git a/layout/base/LayoutTelemetryTools.h b/layout/base/LayoutTelemetryTools.h
index 25c80dcc2c..43eee79923 100644
--- a/layout/base/LayoutTelemetryTools.h
+++ b/layout/base/LayoutTelemetryTools.h
@@ -38,9 +38,9 @@ enum class LayoutSubsystem : uint8_t {
};
using LayoutSubsystemDurations =
- EnumeratedArray<LayoutSubsystem, LayoutSubsystem::Count, double>;
+ EnumeratedArray<LayoutSubsystem, double, size_t(LayoutSubsystem::Count)>;
using LayoutFlushCount =
- EnumeratedArray<FlushKind, FlushKind::Count, SaturateUint8>;
+ EnumeratedArray<FlushKind, SaturateUint8, size_t(FlushKind::Count)>;
struct Data {
Data();
diff --git a/layout/base/MotionPathUtils.cpp b/layout/base/MotionPathUtils.cpp
index c81020645d..4045f2304a 100644
--- a/layout/base/MotionPathUtils.cpp
+++ b/layout/base/MotionPathUtils.cpp
@@ -111,9 +111,11 @@ CSSCoord MotionPathUtils::GetRayContainReferenceSize(nsIFrame* aFrame) {
const auto size = CSSSize::FromAppUnits(
(aFrame->HasAnyStateBits(NS_FRAME_SVG_LAYOUT)
? nsLayoutUtils::ComputeSVGReferenceRect(
- aFrame, aFrame->StyleSVGReset()->HasNonScalingStroke()
- ? StyleGeometryBox::FillBox
- : StyleGeometryBox::StrokeBox)
+ aFrame,
+ aFrame->StyleSVGReset()->HasNonScalingStroke()
+ ? StyleGeometryBox::FillBox
+ : StyleGeometryBox::StrokeBox,
+ nsLayoutUtils::MayHaveNonScalingStrokeCyclicDependency::Yes)
: nsLayoutUtils::ComputeHTMLReferenceRect(
aFrame, StyleGeometryBox::BorderBox))
.Size());
diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp
index e159239f16..a975372dea 100644
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -249,18 +249,6 @@ static nsIContent* GetClickableAncestor(
return content;
}
- // Bug 921928: we don't have access to the content of remote iframe.
- // So fluffing won't go there. We do an optimistic assumption here:
- // that the content of the remote iframe needs to be a target.
- if (content->IsHTMLElement(nsGkAtoms::iframe) &&
- content->AsElement()->AttrValueIs(kNameSpaceID_None,
- nsGkAtoms::mozbrowser,
- nsGkAtoms::_true, eIgnoreCase) &&
- content->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::remote,
- nsGkAtoms::_true, eIgnoreCase)) {
- return content;
- }
-
// See nsCSSFrameConstructor::FindXULTagData. This code is not
// really intended to be used with XUL, though.
if (content->IsAnyOfXULElements(
diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp
index 90a9eee411..31c21c3377 100644
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -9,11 +9,13 @@
#include "mozilla/PresShell.h"
#include "Units.h"
+#include "mozilla/EventForwards.h"
#include "mozilla/RefPtr.h"
#include "mozilla/dom/AncestorIterator.h"
#include "mozilla/dom/FontFaceSet.h"
#include "mozilla/dom/ElementBinding.h"
#include "mozilla/dom/LargestContentfulPaint.h"
+#include "mozilla/dom/MouseEventBinding.h"
#include "mozilla/dom/PerformanceMainThread.h"
#include "mozilla/dom/HTMLAreaElement.h"
#include "mozilla/ArrayUtils.h"
@@ -45,6 +47,7 @@
#include "mozilla/StaticPrefs_font.h"
#include "mozilla/StaticPrefs_image.h"
#include "mozilla/StaticPrefs_layout.h"
+#include "mozilla/StaticPrefs_test.h"
#include "mozilla/StaticPrefs_toolkit.h"
#include "mozilla/Try.h"
#include "mozilla/TextEvents.h"
@@ -562,35 +565,52 @@ class nsBeforeFirstPaintDispatcher : public Runnable {
class MOZ_STACK_CLASS AutoPointerEventTargetUpdater final {
public:
AutoPointerEventTargetUpdater(PresShell* aShell, WidgetEvent* aEvent,
- nsIFrame* aFrame, nsIContent** aTargetContent) {
+ nsIFrame* aFrame, nsIContent* aTargetContent,
+ nsIContent** aOutTargetContent) {
MOZ_ASSERT(aEvent);
- if (!aTargetContent || aEvent->mClass != ePointerEventClass) {
+ if (!aOutTargetContent || aEvent->mClass != ePointerEventClass) {
// Make the destructor happy.
- mTargetContent = nullptr;
+ mOutTargetContent = nullptr;
return;
}
MOZ_ASSERT(aShell);
- MOZ_ASSERT(aFrame);
- MOZ_ASSERT(!aFrame->GetContent() ||
- aShell->GetDocument() == aFrame->GetContent()->OwnerDoc());
+ MOZ_ASSERT_IF(aFrame && aFrame->GetContent(),
+ aShell->GetDocument() == aFrame->GetContent()->OwnerDoc());
mShell = aShell;
mWeakFrame = aFrame;
- mTargetContent = aTargetContent;
- aShell->mPointerEventTarget = aFrame->GetContent();
+ mOutTargetContent = aOutTargetContent;
+ mFromTouch = aEvent->AsPointerEvent()->mFromTouchEvent;
+ // Touch event target may have no frame, e.g., removed from the DOM
+ MOZ_ASSERT_IF(!mFromTouch, aFrame);
+ mOriginalPointerEventTarget = aShell->mPointerEventTarget =
+ aFrame ? aFrame->GetContent() : aTargetContent;
}
~AutoPointerEventTargetUpdater() {
- if (!mTargetContent || !mShell || mWeakFrame.IsAlive()) {
+ if (!mOutTargetContent || !mShell || mWeakFrame.IsAlive()) {
return;
}
- mShell->mPointerEventTarget.swap(*mTargetContent);
+ if (mFromTouch) {
+ // If the source event is a touch event, the touch event target should
+ // always be same target as preceding ePointerDown. Therefore, we should
+ // always set it back to the original event target.
+ mOriginalPointerEventTarget.swap(*mOutTargetContent);
+ } else {
+ // If the source event is not a touch event (must be a mouse event in
+ // this case), the event should be fired on the closest inclusive ancestor
+ // of the pointer event target which is still connected. The mutations
+ // are tracked by PresShell::ContentRemoved. Therefore, we should set it.
+ mShell->mPointerEventTarget.swap(*mOutTargetContent);
+ }
}
private:
RefPtr<PresShell> mShell;
+ nsCOMPtr<nsIContent> mOriginalPointerEventTarget;
AutoWeakFrame mWeakFrame;
- nsIContent** mTargetContent;
+ nsIContent** mOutTargetContent;
+ bool mFromTouch = false;
};
bool PresShell::sDisableNonTestMouseEvents = false;
@@ -5421,7 +5441,6 @@ bool PresShell::IsTransparentContainerElement() const {
case dom::PrefersColorSchemeOverride::Dark:
return pc->DefaultBackgroundColorScheme() == ColorScheme::Dark;
case dom::PrefersColorSchemeOverride::None:
- case dom::PrefersColorSchemeOverride::EndGuard_:
break;
}
}
@@ -6888,18 +6907,13 @@ PresShell* PresShell::GetShellForTouchEvent(WidgetGUIEvent* aEvent) {
return nullptr;
}
- nsCOMPtr<nsIContent> content = do_QueryInterface(oldTouch->GetTarget());
+ nsIContent* const content =
+ nsIContent::FromEventTargetOrNull(oldTouch->GetTarget());
if (!content) {
return nullptr;
}
- nsIFrame* contentFrame = content->GetPrimaryFrame();
- if (!contentFrame) {
- return nullptr;
- }
-
- PresShell* presShell = contentFrame->PresContext()->GetPresShell();
- if (presShell) {
+ if (PresShell* const presShell = content->OwnerDoc()->GetPresShell()) {
return presShell;
}
}
@@ -7249,12 +7263,6 @@ nsresult PresShell::EventHandler::HandleEventUsingCoordinates(
return NS_OK;
}
- // frame could be null after dispatching pointer events.
- // XXX Despite of this comment, we update the event target data outside
- // DispatchPrecedingPointerEvent(). Can we make it call
- // UpdateTouchEventTarget()?
- eventTargetData.UpdateTouchEventTarget(aGUIEvent);
-
// Handle the event in the correct shell.
// We pass the subshell's root frame as the frame to start from. This is
// the only correct alternative; if the event was captured then it
@@ -7267,7 +7275,17 @@ nsresult PresShell::EventHandler::HandleEventUsingCoordinates(
nsresult rv = eventHandler.HandleEventWithCurrentEventInfo(
aGUIEvent, aEventStatus, true,
MOZ_KnownLive(eventTargetData.mOverrideClickTarget));
- return rv;
+ if (NS_FAILED(rv) ||
+ MOZ_UNLIKELY(eventTargetData.mPresShell->IsDestroying())) {
+ return rv;
+ }
+
+ if (aGUIEvent->mMessage == eTouchEnd) {
+ MaybeSynthesizeCompatMouseEventsForTouchEnd(aGUIEvent->AsTouchEvent(),
+ aEventStatus);
+ }
+
+ return NS_OK;
}
bool PresShell::EventHandler::MaybeFlushPendingNotifications(
@@ -7436,41 +7454,58 @@ bool PresShell::EventHandler::DispatchPrecedingPointerEvent(
AutoWeakFrame weakTargetFrame(targetFrame);
AutoWeakFrame weakFrame(aEventTargetData->GetFrame());
- nsCOMPtr<nsIContent> content(aEventTargetData->GetContent());
+ nsCOMPtr<nsIContent> pointerEventTargetContent(
+ aEventTargetData->GetContent());
RefPtr<PresShell> presShell(aEventTargetData->mPresShell);
- nsCOMPtr<nsIContent> targetContent;
+ nsCOMPtr<nsIContent> mouseOrTouchEventTargetContent;
PointerEventHandler::DispatchPointerFromMouseOrTouch(
- presShell, aEventTargetData->GetFrame(), content, aGUIEvent,
- aDontRetargetEvents, aEventStatus, getter_AddRefs(targetContent));
+ presShell, aEventTargetData->GetFrame(), pointerEventTargetContent,
+ aGUIEvent, aDontRetargetEvents, aEventStatus,
+ getter_AddRefs(mouseOrTouchEventTargetContent));
// If the target frame is alive, the caller should keep handling the event
// unless event target frame is destroyed.
- if (weakTargetFrame.IsAlive()) {
- return weakFrame.IsAlive();
+ if (weakTargetFrame.IsAlive() && weakFrame.IsAlive()) {
+ aEventTargetData->UpdateTouchEventTarget(aGUIEvent);
+ return true;
}
- // If the event is not a mouse event, the caller should keep handling the
- // event unless event target frame is destroyed. Note that this case is
- // not defined by the spec.
- if (aGUIEvent->mClass != eMouseEventClass) {
- return weakFrame.IsAlive();
+ presShell->FlushPendingNotifications(FlushType::Layout);
+ if (MOZ_UNLIKELY(mPresShell->IsDestroying())) {
+ return false;
}
- // Spec defines that mouse events must be dispatched to the same target as
- // the pointer event. If the target is no longer participating in its
- // ownerDocument's tree, fire the event at the original target's nearest
- // ancestor node
- if (!targetContent) {
+ // The spec defines that mouse events must be dispatched to the same target as
+ // the pointer event.
+ // The Touch Events spec defines that touch events must be dispatched to the
+ // same target as touch start and the other browsers dispatch touch events
+ // even if the touch event target is not connected to the document.
+ // Retargetting the event is handled by AutoPointerEventTargetUpdater and
+ // mouseOrTouchEventTargetContent stores the result.
+
+ // If the target is no longer participating in its ownerDocument's tree,
+ // fire the event at the original target's nearest ancestor node.
+ if (!mouseOrTouchEventTargetContent) {
+ MOZ_ASSERT(aGUIEvent->mClass == eMouseEventClass);
return false;
}
- aEventTargetData->SetFrameAndContent(targetContent->GetPrimaryFrame(),
- targetContent);
- aEventTargetData->mPresShell = PresShell::GetShellForEventTarget(
- aEventTargetData->GetFrame(), aEventTargetData->GetContent());
+ aEventTargetData->SetFrameAndContent(
+ mouseOrTouchEventTargetContent->GetPrimaryFrame(),
+ mouseOrTouchEventTargetContent);
+ aEventTargetData->mPresShell =
+ mouseOrTouchEventTargetContent->IsInComposedDoc()
+ ? PresShell::GetShellForEventTarget(aEventTargetData->GetFrame(),
+ aEventTargetData->GetContent())
+ : mouseOrTouchEventTargetContent->OwnerDoc()->GetPresShell();
// If new target PresShel is not found, we cannot keep handling the event.
- return !!aEventTargetData->mPresShell;
+ if (!aEventTargetData->mPresShell) {
+ return false;
+ }
+
+ aEventTargetData->UpdateTouchEventTarget(aGUIEvent);
+ return true;
}
/**
@@ -7586,6 +7621,60 @@ bool PresShell::EventHandler::MaybeHandleEventWithAccessibleCaret(
return true;
}
+void PresShell::EventHandler::MaybeSynthesizeCompatMouseEventsForTouchEnd(
+ const WidgetTouchEvent* aTouchEndEvent,
+ const nsEventStatus* aStatus) const {
+ MOZ_ASSERT(aTouchEndEvent->mMessage == eTouchEnd);
+
+ // If the eTouchEnd event is dispatched via APZ, APZCCallbackHelper dispatches
+ // a set of mouse events with better handling. Therefore, we don't need to
+ // handle that here.
+ if (!aTouchEndEvent->mFlags.mIsSynthesizedForTests ||
+ StaticPrefs::test_events_async_enabled()) {
+ return;
+ }
+
+ // If the tap was consumed or 2 or more touches occurred, we don't need the
+ // compatibility mouse events.
+ if (*aStatus == nsEventStatus_eConsumeNoDefault ||
+ !TouchManager::IsSingleTapEndToDoDefault(aTouchEndEvent)) {
+ return;
+ }
+
+ if (NS_WARN_IF(!aTouchEndEvent->mWidget)) {
+ return;
+ }
+
+ nsCOMPtr<nsIWidget> widget = aTouchEndEvent->mWidget;
+
+ // NOTE: I think that we don't need to implement a double click here becase
+ // WebDriver does not support a way to synthesize a double click and Chrome
+ // does not fire "dblclick" even if doing `pointerDown().pointerUp()` twice.
+ // FIXME: Currently we don't support long tap.
+ RefPtr<PresShell> presShell = mPresShell;
+ for (const EventMessage message : {eMouseMove, eMouseDown, eMouseUp}) {
+ if (MOZ_UNLIKELY(presShell->IsDestroying())) {
+ break;
+ }
+ nsIFrame* frameForPresShell = GetNearestFrameContainingPresShell(presShell);
+ if (!frameForPresShell) {
+ break;
+ }
+ WidgetMouseEvent event(true, message, widget, WidgetMouseEvent::eReal,
+ WidgetMouseEvent::eNormal);
+ event.mRefPoint = aTouchEndEvent->mTouches[0]->mRefPoint;
+ event.mButton = MouseButton::ePrimary;
+ event.mButtons = message == eMouseDown ? MouseButtonsFlag::ePrimaryFlag
+ : MouseButtonsFlag::eNoButtons;
+ event.mInputSource = MouseEvent_Binding::MOZ_SOURCE_TOUCH;
+ event.mClickCount = message == eMouseMove ? 0 : 1;
+ event.mModifiers = aTouchEndEvent->mModifiers;
+ event.convertToPointer = false;
+ nsEventStatus mouseEventStatus = nsEventStatus_eIgnore;
+ presShell->HandleEvent(frameForPresShell, &event, false, &mouseEventStatus);
+ }
+}
+
bool PresShell::EventHandler::MaybeDiscardEvent(WidgetGUIEvent* aGUIEvent) {
MOZ_ASSERT(aGUIEvent);
@@ -8252,7 +8341,7 @@ nsresult PresShell::EventHandler::HandleEventWithTarget(
mPresShell->RecordPointerLocation(aEvent->AsMouseEvent());
}
AutoPointerEventTargetUpdater updater(mPresShell, aEvent, aNewEventFrame,
- aTargetContent);
+ aNewEventContent, aTargetContent);
AutoCurrentEventInfoSetter eventInfoSetter(*this, aNewEventFrame,
aNewEventContent);
nsresult rv = HandleEventWithCurrentEventInfo(aEvent, aEventStatus, false,
@@ -8360,7 +8449,7 @@ nsresult PresShell::EventHandler::HandleEventWithCurrentEventInfo(
manager->TryToFlushPendingNotificationsToIME();
}
- FinalizeHandlingEvent(aEvent);
+ FinalizeHandlingEvent(aEvent, aEventStatus);
RecordEventHandlingResponsePerformance(aEvent);
@@ -8512,7 +8601,8 @@ bool PresShell::EventHandler::PrepareToDispatchEvent(
}
}
-void PresShell::EventHandler::FinalizeHandlingEvent(WidgetEvent* aEvent) {
+void PresShell::EventHandler::FinalizeHandlingEvent(
+ WidgetEvent* aEvent, const nsEventStatus* aStatus) {
switch (aEvent->mMessage) {
case eKeyPress:
case eKeyDown:
@@ -8562,6 +8652,16 @@ void PresShell::EventHandler::FinalizeHandlingEvent(WidgetEvent* aEvent) {
}
return;
}
+ case eTouchStart:
+ case eTouchMove:
+ case eTouchEnd:
+ case eTouchCancel:
+ case eTouchPointerCancel:
+ case eMouseLongTap:
+ case eContextMenu: {
+ mPresShell->mTouchManager.PostHandleEvent(aEvent, aStatus);
+ break;
+ }
default:
return;
}
@@ -11955,7 +12055,7 @@ void PresShell::EventHandler::EventTargetData::UpdateTouchEventTarget(
nsIFrame* newFrame =
TouchManager::SuppressInvalidPointsAndGetTargetedFrame(touchEvent);
if (!newFrame) {
- return; // XXX Why don't we stop handling the event in this case?
+ return;
}
SetFrameAndComputePresShellAndContent(newFrame, aGUIEvent);
return;
diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h
index c6a965e81e..482ace1421 100644
--- a/layout/base/PresShell.h
+++ b/layout/base/PresShell.h
@@ -2440,6 +2440,14 @@ class PresShell final : public nsStubDocumentObserver,
nsEventStatus* aEventStatus);
/**
+ * Maybe dispatch mouse events for aTouchEnd. This should be called after
+ * aTouchEndEvent is dispatched into the DOM.
+ */
+ MOZ_CAN_RUN_SCRIPT void MaybeSynthesizeCompatMouseEventsForTouchEnd(
+ const WidgetTouchEvent* aTouchEndEvent,
+ const nsEventStatus* aStatus) const;
+
+ /**
* MaybeDiscardOrDelayKeyboardEvent() may discared or put aGUIEvent into
* the delayed event queue if it's a keyboard event and if we should do so.
* If aGUIEvent is not a keyboard event, this does nothing.
@@ -2821,8 +2829,10 @@ class PresShell final : public nsStubDocumentObserver,
* and then, this cleans up the state of mPresShell and aEvent.
*
* @param aEvent The handled event.
+ * @param aStatus The status of aEvent. Must not be nullptr.
*/
- MOZ_CAN_RUN_SCRIPT void FinalizeHandlingEvent(WidgetEvent* aEvent);
+ MOZ_CAN_RUN_SCRIPT void FinalizeHandlingEvent(WidgetEvent* aEvent,
+ const nsEventStatus* aStatus);
/**
* AutoCurrentEventInfoSetter() pushes and pops current event info of
diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp
index 9c313a254c..8c07512093 100644
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -2709,6 +2709,7 @@ enum class ServoPostTraversalFlags : uint32_t {
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ServoPostTraversalFlags)
+#ifdef ACCESSIBILITY
static bool IsVisibleForA11y(const ComputedStyle& aStyle) {
return aStyle.StyleVisibility()->IsVisible() && !aStyle.StyleUI()->IsInert();
}
@@ -2717,6 +2718,7 @@ static bool IsSubtreeVisibleForA11y(const ComputedStyle& aStyle) {
return aStyle.StyleDisplay()->mContentVisibility !=
StyleContentVisibility::Hidden;
}
+#endif
// Send proper accessibility notifications and return post traversal
// flags for kids.
@@ -3450,11 +3452,8 @@ void RestyleManager::MaybeRestyleForNthOfState(ServoStyleSet& aStyleSet,
static inline bool AttributeInfluencesOtherPseudoClassState(
const Element& aElement, const nsAtom* aAttribute) {
- // We must record some state for :-moz-browser-frame,
- // :-moz-table-border-nonzero, and :-moz-select-list-box.
- if (aAttribute == nsGkAtoms::mozbrowser) {
- return aElement.IsAnyOfHTMLElements(nsGkAtoms::iframe, nsGkAtoms::frame);
- }
+ // We must record some state for :-moz-table-border-nonzero and
+ // :-moz-select-list-box.
if (aAttribute == nsGkAtoms::border) {
return aElement.IsHTMLElement(nsGkAtoms::table);
diff --git a/layout/base/TouchManager.cpp b/layout/base/TouchManager.cpp
index 0c34567b65..42ea78eb2e 100644
--- a/layout/base/TouchManager.cpp
+++ b/layout/base/TouchManager.cpp
@@ -7,9 +7,13 @@
#include "TouchManager.h"
+#include "Units.h"
+#include "mozilla/EventForwards.h"
+#include "mozilla/PresShell.h"
+#include "mozilla/StaticPrefs_test.h"
+#include "mozilla/TimeStamp.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/EventTarget.h"
-#include "mozilla/PresShell.h"
#include "mozilla/layers/InputAPZContext.h"
#include "nsIContent.h"
#include "nsIFrame.h"
@@ -24,6 +28,8 @@ namespace mozilla {
StaticAutoPtr<nsTHashMap<nsUint32HashKey, TouchManager::TouchInfo>>
TouchManager::sCaptureTouchList;
layers::LayersId TouchManager::sCaptureTouchLayersId;
+TimeStamp TouchManager::sSingleTouchStartTimeStamp;
+LayoutDeviceIntPoint TouchManager::sSingleTouchStartPoint;
/*static*/
void TouchManager::InitializeStatics() {
@@ -168,7 +174,7 @@ nsIFrame* TouchManager::SuppressInvalidPointsAndGetTargetedFrame(
}
nsIFrame* frame = nullptr;
- for (int32_t i = aEvent->mTouches.Length(); i;) {
+ for (uint32_t i = aEvent->mTouches.Length(); i;) {
--i;
dom::Touch* touch = aEvent->mTouches[i];
if (TouchManager::HasCapturedTouch(touch->Identifier())) {
@@ -176,9 +182,35 @@ nsIFrame* TouchManager::SuppressInvalidPointsAndGetTargetedFrame(
}
MOZ_ASSERT(touch->mOriginalTarget);
- nsCOMPtr<nsIContent> targetContent = do_QueryInterface(touch->GetTarget());
- nsIFrame* targetFrame =
- targetContent ? targetContent->GetPrimaryFrame() : nullptr;
+ nsIContent* const targetContent =
+ nsIContent::FromEventTargetOrNull(touch->GetTarget());
+ if (MOZ_UNLIKELY(!targetContent)) {
+ touch->mIsTouchEventSuppressed = true;
+ continue;
+ }
+
+ // Even if the target content is not connected, we should dispatch the touch
+ // start event except when the target content is owned by different
+ // document.
+ if (MOZ_UNLIKELY(!targetContent->IsInComposedDoc())) {
+ if (anyTarget && anyTarget->OwnerDoc() != targetContent->OwnerDoc()) {
+ touch->mIsTouchEventSuppressed = true;
+ continue;
+ }
+ if (!anyTarget) {
+ anyTarget = targetContent;
+ }
+ touch->SetTouchTarget(targetContent->GetAsElementOrParentElement());
+ if (PresShell* const presShell =
+ targetContent->OwnerDoc()->GetPresShell()) {
+ if (nsIFrame* rootFrame = presShell->GetRootFrame()) {
+ frame = rootFrame;
+ }
+ }
+ continue;
+ }
+
+ nsIFrame* targetFrame = targetContent->GetPrimaryFrame();
if (targetFrame && !anyTarget) {
anyTarget = targetContent;
} else {
@@ -202,10 +234,12 @@ nsIFrame* TouchManager::SuppressInvalidPointsAndGetTargetedFrame(
touch->mIsTouchEventSuppressed = true;
} else {
targetFrame = newTargetFrame;
- targetFrame->GetContentForEvent(aEvent, getter_AddRefs(targetContent));
- touch->SetTouchTarget(targetContent
- ? targetContent->GetAsElementOrParentElement()
- : nullptr);
+ nsCOMPtr<nsIContent> newTargetContent;
+ targetFrame->GetContentForEvent(aEvent,
+ getter_AddRefs(newTargetContent));
+ touch->SetTouchTarget(
+ newTargetContent ? newTargetContent->GetAsElementOrParentElement()
+ : nullptr);
}
}
if (targetFrame) {
@@ -236,8 +270,11 @@ bool TouchManager::PreHandleEvent(WidgetEvent* aEvent, nsEventStatus* aStatus,
// touch event associated to. We cache layers id of the first touchstart
// event, all subsequent touch events will use the same layers id.
sCaptureTouchLayersId = aEvent->mLayersId;
+ sSingleTouchStartTimeStamp = aEvent->mTimeStamp;
+ sSingleTouchStartPoint = aEvent->AsTouchEvent()->mTouches[0]->mRefPoint;
} else {
touchEvent->mLayersId = sCaptureTouchLayersId;
+ sSingleTouchStartTimeStamp = TimeStamp();
}
// Add any new touches to the queue
WidgetTouchEvent::TouchArray& touches = touchEvent->mTouches;
@@ -404,6 +441,60 @@ bool TouchManager::PreHandleEvent(WidgetEvent* aEvent, nsEventStatus* aStatus,
return true;
}
+void TouchManager::PostHandleEvent(const WidgetEvent* aEvent,
+ const nsEventStatus* aStatus) {
+ switch (aEvent->mMessage) {
+ case eTouchMove: {
+ if (sSingleTouchStartTimeStamp.IsNull()) {
+ break;
+ }
+ if (*aStatus == nsEventStatus_eConsumeNoDefault) {
+ sSingleTouchStartTimeStamp = TimeStamp();
+ break;
+ }
+ const WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
+ if (touchEvent->mTouches.Length() > 1) {
+ sSingleTouchStartTimeStamp = TimeStamp();
+ break;
+ }
+ if (touchEvent->mTouches.Length() == 1) {
+ // If the touch moved too far from the start point, don't treat the
+ // touch as a tap.
+ const float distance =
+ static_cast<float>((sSingleTouchStartPoint -
+ aEvent->AsTouchEvent()->mTouches[0]->mRefPoint)
+ .Length());
+ const float maxDistance =
+ StaticPrefs::apz_touch_start_tolerance() *
+ (MOZ_LIKELY(touchEvent->mWidget) ? touchEvent->mWidget->GetDPI()
+ : 96.0f);
+ if (distance > maxDistance) {
+ sSingleTouchStartTimeStamp = TimeStamp();
+ }
+ }
+ break;
+ }
+ case eTouchStart:
+ case eTouchEnd:
+ if (*aStatus == nsEventStatus_eConsumeNoDefault &&
+ !sSingleTouchStartTimeStamp.IsNull()) {
+ sSingleTouchStartTimeStamp = TimeStamp();
+ }
+ break;
+ case eTouchCancel:
+ case eTouchPointerCancel:
+ case eMouseLongTap:
+ case eContextMenu: {
+ if (!sSingleTouchStartTimeStamp.IsNull()) {
+ sSingleTouchStartTimeStamp = TimeStamp();
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
/*static*/
already_AddRefed<nsIContent> TouchManager::GetAnyCapturedTouchTarget() {
nsCOMPtr<nsIContent> result = nullptr;
@@ -473,4 +564,25 @@ bool TouchManager::ShouldConvertTouchToPointer(const Touch* aTouch,
return true;
}
+/* static */
+bool TouchManager::IsSingleTapEndToDoDefault(
+ const WidgetTouchEvent* aTouchEndEvent) {
+ MOZ_ASSERT(aTouchEndEvent);
+ MOZ_ASSERT(aTouchEndEvent->mFlags.mIsSynthesizedForTests);
+ MOZ_ASSERT(!StaticPrefs::test_events_async_enabled());
+ if (sSingleTouchStartTimeStamp.IsNull() ||
+ aTouchEndEvent->mTouches.Length() != 1) {
+ return false;
+ }
+ // If it's pressed long time, we should not treat it as a single tap because
+ // a long press should cause opening context menu by default.
+ if ((aTouchEndEvent->mTimeStamp - sSingleTouchStartTimeStamp)
+ .ToMilliseconds() > StaticPrefs::apz_max_tap_time()) {
+ return false;
+ }
+ NS_WARNING_ASSERTION(aTouchEndEvent->mTouches[0]->mChanged,
+ "The single tap end should be changed");
+ return true;
+}
+
} // namespace mozilla
diff --git a/layout/base/TouchManager.h b/layout/base/TouchManager.h
index 0e12c25c7d..40b9083bdb 100644
--- a/layout/base/TouchManager.h
+++ b/layout/base/TouchManager.h
@@ -12,6 +12,7 @@
#ifndef TouchManager_h_
#define TouchManager_h_
+#include "Units.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/dom/Touch.h"
#include "mozilla/StaticPtr.h"
@@ -20,6 +21,7 @@
namespace mozilla {
class PresShell;
+class TimeStamp;
class TouchManager {
public:
@@ -52,6 +54,8 @@ class TouchManager {
bool PreHandleEvent(mozilla::WidgetEvent* aEvent, nsEventStatus* aStatus,
bool& aTouchIsNew,
nsCOMPtr<nsIContent>& aCurrentEventContent);
+ void PostHandleEvent(const mozilla::WidgetEvent* aEvent,
+ const nsEventStatus* aStatus);
static already_AddRefed<nsIContent> GetAnyCapturedTouchTarget();
static bool HasCapturedTouch(int32_t aId);
@@ -59,6 +63,12 @@ class TouchManager {
static bool ShouldConvertTouchToPointer(const dom::Touch* aTouch,
const WidgetTouchEvent* aEvent);
+ // This should be called after PostHandleEvent() is called. Note that this
+ // cannot check touches outside this process. So, this should not be used for
+ // actual user input handling. This is designed for a fallback path to
+ // dispatch mouse events for touch events synthesized without APZ.
+ static bool IsSingleTapEndToDoDefault(const WidgetTouchEvent* aTouchEndEvent);
+
private:
void EvictTouches(dom::Document* aLimitToDocument = nullptr);
static void EvictTouchPoint(RefPtr<dom::Touch>& aTouch,
@@ -77,6 +87,12 @@ class TouchManager {
static StaticAutoPtr<nsTHashMap<nsUint32HashKey, TouchInfo>>
sCaptureTouchList;
static layers::LayersId sCaptureTouchLayersId;
+ // The last start of a single tap. This will be set to "Null" if the tap is
+ // consumed or becomes not a single tap.
+ static TimeStamp sSingleTouchStartTimeStamp;
+ // The last start point of the single tap tracked with
+ // sSingleTouchStartTimeStamp.
+ static LayoutDeviceIntPoint sSingleTouchStartPoint;
};
} // namespace mozilla
diff --git a/layout/base/crashtests/1435015.html b/layout/base/crashtests/1435015.html
deleted file mode 100644
index 329aaca22f..0000000000
--- a/layout/base/crashtests/1435015.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!doctype html>
-<style>
- div { display: contents; }
-</style>
-<math></math>
-<script>
- let div = document.createElementNS('http://www.w3.org/1998/Math/MathML', 'div');
- document.querySelector('math').appendChild(div);
-</script>
diff --git a/layout/base/crashtests/243159-2.xhtml b/layout/base/crashtests/243159-2.xhtml
deleted file mode 100644
index 79d9bcd90a..0000000000
--- a/layout/base/crashtests/243159-2.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:mathml="http://www.w3.org/1998/Math/MathML">
- <body onload="run()">
- <mathml:math id="test" style="display: block">
- </mathml:math>
-<script>
- function run() {
- var t1 = document.createElementNS("http://www.w3.org/1998/Math/MathML",
- "mtable");
- var t2 = document.createElementNS("http://www.w3.org/1998/Math/MathML",
- "mtable");
- var r1 = document.createElementNS("http://www.w3.org/1998/Math/MathML",
- "mtr");
- var r2 = document.createElementNS("http://www.w3.org/1998/Math/MathML",
- "mtr");
- var test =
- document.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML", "math")[0];
- t1.appendChild(r1);
- test.appendChild(t1);
- test.appendChild(t2);
- t2.appendChild(r2);
-
- }
-</script>
-</body>
-</html>
diff --git a/layout/base/crashtests/355993-1.xhtml b/layout/base/crashtests/355993-1.xhtml
deleted file mode 100644
index e902ee550e..0000000000
--- a/layout/base/crashtests/355993-1.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<head>
-<style>
-body, body * { position: fixed; }
-</style>
-</head>
-
-<body>
-
-
-<div>
- <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
-
- <mtable>
- <mtr>
- <mtd>
- <mn>1</mn>
- </mtd>
- </mtr>
- </mtable>
- </math>
-</div>
-
-</body>
-</html> \ No newline at end of file
diff --git a/layout/base/crashtests/384649-1.xhtml b/layout/base/crashtests/384649-1.xhtml
deleted file mode 100644
index e2ba50cdee..0000000000
--- a/layout/base/crashtests/384649-1.xhtml
+++ /dev/null
@@ -1,31 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<style>
-
-/* use attribute selector instead of the .class shorthand to work around bug 379178 */
-
-*[class="fixed"] { position: fixed; }
-
-math, mtable, mtr { position: inherit; }
-
-</style>
-</head>
-
-<body>
-
-<div class="fixed">
- <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <mtable>
- <mtr class="fixed">
- <mtd><mi>x</mi></mtd>
- </mtr>
- <mtr>
- <mtd><mi>y</mi></mtd>
- </mtr>
- </mtable>
- </math>
-</div>
-
-</body>
-
-</html>
diff --git a/layout/base/crashtests/394150-1.xhtml b/layout/base/crashtests/394150-1.xhtml
deleted file mode 100644
index b2349c9f8b..0000000000
--- a/layout/base/crashtests/394150-1.xhtml
+++ /dev/null
@@ -1,27 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-<script>
-
-function boom()
-{
- var ms = document.createElementNS("http://www.w3.org/1998/Math/MathML", "ms");
- var textNode = document.getElementById("emptyset").firstChild;
- var mrow = document.getElementById("mrow");
-
- ms.appendChild(textNode); // *move* the text node from one place to another!
- mrow.appendChild(ms);
-}
-
-</script>
-</head>
-
-<body onload="boom();">
-
-<math xmlns="http://www.w3.org/1998/Math/MathML">
-<merror><emptyset id="emptyset">
- <mrow id="mrow"></mrow></emptyset></merror>
-</math>
-
-</body>
-
-</html>
diff --git a/layout/base/crashtests/399676-1.xhtml b/layout/base/crashtests/399676-1.xhtml
deleted file mode 100644
index 82b547e5ea..0000000000
--- a/layout/base/crashtests/399676-1.xhtml
+++ /dev/null
@@ -1,7 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-</head>
-<body>
-<math:mtd><span style="float: right;" /></math:mtd>
-</body>
-</html>
diff --git a/layout/base/crashtests/400445-1.xhtml b/layout/base/crashtests/400445-1.xhtml
deleted file mode 100644
index 9cb71dbbd6..0000000000
--- a/layout/base/crashtests/400445-1.xhtml
+++ /dev/null
@@ -1,22 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-<script>
-
-function boom()
-{
- var mtd1 = document.getElementById("mtd1");
- var mtd2 = document.getElementById("mtd2");
- var newSpan = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
-
- mtd1.appendChild(newSpan);
- mtd1.removeAttribute("columnspan");
- mtd2.setAttribute("columnspan", 0);
-}
-
-</script>
-</head>
-
-<body onload="boom();">
-<math:mtd id="mtd1" columnspan="5" /><math:mtd id="mtd2" />
-</body>
-</html>
diff --git a/layout/base/crashtests/400904-1.xhtml b/layout/base/crashtests/400904-1.xhtml
deleted file mode 100644
index a00f42fd02..0000000000
--- a/layout/base/crashtests/400904-1.xhtml
+++ /dev/null
@@ -1,20 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-<script type="text/javascript">
-
-function boom()
-{
- var MATHML_NS = "http://www.w3.org/1998/Math/MathML";
- var mtd = document.getElementById("mtd");
- var n = document.createElementNS(MATHML_NS, 'mrow');
- mtd.appendChild(n);
- mtd.setAttribute('rowspan', 7);
-}
-
-</script>
-</head>
-
-<body onload="boom();">
-<math:mtd id="mtd"></math:mtd><math:mtr><math:mrow></math:mrow></math:mtr>
-</body>
-</html>
diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list
index 44572dad53..d9cf87f4d2 100644
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -7,7 +7,7 @@ load 56746-1.html
load 89101-1.html
load 89358-1.html
load 90205-1.html
-skip-if(cocoaWidget&&browserIsRemote) load 99776-1.html # Bug 849747
+skip-if(cocoaWidget) load 99776-1.html # Bug 849747
load 118931-1.html
load 121533-1.html
load 123049-1.html
@@ -31,7 +31,6 @@ load 234851-1.html
load 234851-2.html
load 241300-1.html
load 243159-1.html
-load 243159-2.xhtml
load 243519-1.html
load 244490-1.html
load 254367-1.html
@@ -116,7 +115,6 @@ load 350267-1.html
load 354133-1.html
load 354766-1.xhtml
load 355989-1.xhtml
-load 355993-1.xhtml
load chrome://reftest/content/crashtests/layout/base/crashtests/356325-1.xhtml
load 358729-1.xhtml
skip-if(Android) load chrome://reftest/content/crashtests/layout/base/crashtests/360339-1.xhtml
@@ -151,7 +149,6 @@ load 383129-1.html
load 384344-1.html
load 384392-1.xhtml
load 384392-2.svg
-load 384649-1.xhtml
load 385354.html
load 385866-1.xhtml
load 385880-1.xhtml
@@ -163,7 +160,6 @@ load 388715-1.html
load 390976-1.html
load 393661-1.html
load 393801-1.html
-load 394150-1.xhtml
load 397011-1.xhtml
load 398510-1.xhtml
load 398733-1.html
@@ -171,13 +167,10 @@ load 398733-2.html
load 399132-1.xhtml
load 399219-1.xhtml
load 399365-1.html
-load 399676-1.xhtml
load 399687-1.html
load 399940-1.xhtml
load 399951-1.html
load 399994-1.html
-load 400445-1.xhtml
-load 400904-1.xhtml
load 401734-1.html
load 401734-2.html
needs-focus pref(accessibility.browsewithcaret,true) load 403048.html
@@ -258,7 +251,7 @@ load 468645-3.xhtml
load 469861-1.xhtml
load 469861-2.xhtml
load 470851-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)
+load 473042.xhtml # bug 1034369 (may also cause a few assertions to be registered on the next test)
asserts(1) load 474075.html # bug 1775003
load 477333-1.xhtml
load 477731-1.html
@@ -483,7 +476,6 @@ load 1428892.html
load 1429088.html
load 1429961.html
load 1429962.html
-load 1435015.html
load 1437155.html
load 1439016.html
load 1442018-1.html
diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp
index b1215972c2..0331a7e5a0 100644
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -47,9 +47,10 @@ using BidiClass = intl::BidiClass;
using BidiDirection = intl::BidiDirection;
using BidiEmbeddingLevel = intl::BidiEmbeddingLevel;
-static const char16_t kSpace = 0x0020;
+static const char16_t kNextLine = 0x0085;
static const char16_t kZWSP = 0x200B;
static const char16_t kLineSeparator = 0x2028;
+static const char16_t kParagraphSeparator = 0x2029;
static const char16_t kObjectSubstitute = 0xFFFC;
static const char16_t kLRE = 0x202A;
static const char16_t kRLE = 0x202B;
@@ -60,11 +61,12 @@ static const char16_t kLRI = 0x2066;
static const char16_t kRLI = 0x2067;
static const char16_t kFSI = 0x2068;
static const char16_t kPDI = 0x2069;
-// All characters with Bidi type Segment Separator or Block Separator
+// All characters with Bidi type Segment Separator or Block Separator.
+// This should be kept in sync with the table in ReplaceSeparators.
static const char16_t kSeparators[] = {
- char16_t('\t'), char16_t('\r'), char16_t('\n'), char16_t(0xb),
- char16_t(0x1c), char16_t(0x1d), char16_t(0x1e), char16_t(0x1f),
- char16_t(0x85), char16_t(0x2029), char16_t(0)};
+ char16_t('\t'), char16_t('\r'), char16_t('\n'), char16_t(0xb),
+ char16_t(0x1c), char16_t(0x1d), char16_t(0x1e), char16_t(0x1f),
+ kNextLine, kParagraphSeparator, char16_t(0)};
#define NS_BIDI_CONTROL_FRAME ((nsIFrame*)0xfffb1d1)
@@ -478,115 +480,99 @@ struct MOZ_STACK_CLASS BidiParagraphData {
}
};
-struct MOZ_STACK_CLASS BidiLineData {
- AutoTArray<nsIFrame*, 16> mLogicalFrames;
- AutoTArray<nsIFrame*, 16> mVisualFrames;
- AutoTArray<int32_t, 16> mIndexMap;
- AutoTArray<BidiEmbeddingLevel, 16> mLevels;
- bool mIsReordered;
-
+class MOZ_STACK_CLASS BidiLineData {
+ public:
BidiLineData(nsIFrame* aFirstFrameOnLine, int32_t aNumFramesOnLine) {
- /**
- * Initialize the logically-ordered array of frames using the top-level
- * frames of a single line
- */
- bool isReordered = false;
- bool hasRTLFrames = false;
- bool hasVirtualControls = false;
-
+ // Initialize the logically-ordered array of frames using the top-level
+ // frames of a single line
auto appendFrame = [&](nsIFrame* frame, BidiEmbeddingLevel level) {
mLogicalFrames.AppendElement(frame);
mLevels.AppendElement(level);
mIndexMap.AppendElement(0);
- if (level.IsRTL()) {
- hasRTLFrames = true;
- }
};
- bool firstFrame = true;
for (nsIFrame* frame = aFirstFrameOnLine; frame && aNumFramesOnLine--;
frame = frame->GetNextSibling()) {
FrameBidiData bidiData = nsBidiPresUtils::GetFrameBidiData(frame);
- // Ignore virtual control before the first frame. Doing so should
- // not affect the visual result, but could avoid running into the
- // stripping code below for many cases.
- if (!firstFrame && bidiData.precedingControl != kBidiLevelNone) {
+ if (bidiData.precedingControl != kBidiLevelNone) {
appendFrame(NS_BIDI_CONTROL_FRAME, bidiData.precedingControl);
- hasVirtualControls = true;
}
appendFrame(frame, bidiData.embeddingLevel);
- firstFrame = false;
}
// Reorder the line
- BidiEngine::ReorderVisual(mLevels.Elements(), FrameCount(),
+ BidiEngine::ReorderVisual(mLevels.Elements(), mLevels.Length(),
mIndexMap.Elements());
- // Strip virtual frames
- if (hasVirtualControls) {
- auto originalCount = mLogicalFrames.Length();
- AutoTArray<int32_t, 16> realFrameMap;
- realFrameMap.SetCapacity(originalCount);
- size_t count = 0;
- for (auto i : IntegerRange(originalCount)) {
- if (mLogicalFrames[i] == NS_BIDI_CONTROL_FRAME) {
- realFrameMap.AppendElement(-1);
- } else {
- mLogicalFrames[count] = mLogicalFrames[i];
- mLevels[count] = mLevels[i];
- realFrameMap.AppendElement(count);
- count++;
- }
+ // Collect the frames in visual order, omitting virtual controls
+ // and noting whether frames are reordered.
+ for (uint32_t i = 0; i < mIndexMap.Length(); i++) {
+ nsIFrame* frame = mLogicalFrames[mIndexMap[i]];
+ if (frame == NS_BIDI_CONTROL_FRAME) {
+ continue;
}
- // Only keep index map for real frames.
- for (size_t i = 0, j = 0; i < originalCount; ++i) {
- auto newIndex = realFrameMap[mIndexMap[i]];
- if (newIndex != -1) {
- mIndexMap[j] = newIndex;
- j++;
- }
+ mVisualFrameIndex.AppendElement(mIndexMap[i]);
+ if (int32_t(i) != mIndexMap[i]) {
+ mIsReordered = true;
}
- mLogicalFrames.TruncateLength(count);
- mLevels.TruncateLength(count);
- mIndexMap.TruncateLength(count);
}
+ }
- for (int32_t i = 0; i < FrameCount(); i++) {
- mVisualFrames.AppendElement(LogicalFrameAt(mIndexMap[i]));
- if (i != mIndexMap[i]) {
- isReordered = true;
- }
- }
+ uint32_t LogicalFrameCount() const { return mLogicalFrames.Length(); }
+ uint32_t VisualFrameCount() const { return mVisualFrameIndex.Length(); }
- // If there's an RTL frame, assume the line is reordered
- mIsReordered = isReordered || hasRTLFrames;
+ nsIFrame* LogicalFrameAt(uint32_t aIndex) const {
+ return mLogicalFrames[aIndex];
}
- int32_t FrameCount() const { return mLogicalFrames.Length(); }
+ nsIFrame* VisualFrameAt(uint32_t aIndex) const {
+ return mLogicalFrames[mVisualFrameIndex[aIndex]];
+ }
- nsIFrame* LogicalFrameAt(int32_t aIndex) const {
- return mLogicalFrames[aIndex];
+ std::pair<nsIFrame*, BidiEmbeddingLevel> VisualFrameAndLevelAt(
+ uint32_t aIndex) const {
+ int32_t index = mVisualFrameIndex[aIndex];
+ return std::pair(mLogicalFrames[index], mLevels[index]);
}
- nsIFrame* VisualFrameAt(int32_t aIndex) const {
- return mVisualFrames[aIndex];
+ bool IsReordered() const { return mIsReordered; }
+
+ void InitContinuationStates(nsContinuationStates* aContinuationStates) const {
+ for (auto* frame : mLogicalFrames) {
+ if (frame != NS_BIDI_CONTROL_FRAME) {
+ nsBidiPresUtils::InitContinuationStates(frame, aContinuationStates);
+ }
+ }
}
+
+ private:
+ AutoTArray<nsIFrame*, 16> mLogicalFrames;
+ AutoTArray<int32_t, 16> mVisualFrameIndex;
+ AutoTArray<int32_t, 16> mIndexMap;
+ AutoTArray<BidiEmbeddingLevel, 16> mLevels;
+ bool mIsReordered = false;
};
#ifdef DEBUG
extern "C" {
-void MOZ_EXPORT DumpFrameArray(const nsTArray<nsIFrame*>& aFrames) {
- for (nsIFrame* frame : aFrames) {
+void MOZ_EXPORT DumpBidiLine(BidiLineData* aData, bool aVisualOrder) {
+ auto dump = [](nsIFrame* frame) {
if (frame == NS_BIDI_CONTROL_FRAME) {
fprintf_stderr(stderr, "(Bidi control frame)\n");
} else {
frame->List();
}
- }
-}
+ };
-void MOZ_EXPORT DumpBidiLine(BidiLineData* aData, bool aVisualOrder) {
- DumpFrameArray(aVisualOrder ? aData->mVisualFrames : aData->mLogicalFrames);
+ if (aVisualOrder) {
+ for (uint32_t i = 0; i < aData->VisualFrameCount(); i++) {
+ dump(aData->VisualFrameAt(i));
+ }
+ } else {
+ for (uint32_t i = 0; i < aData->LogicalFrameCount(); i++) {
+ dump(aData->LogicalFrameAt(i));
+ }
+ }
}
}
#endif
@@ -870,11 +856,32 @@ nsresult nsBidiPresUtils::Resolve(nsBlockFrame* aBlockFrame) {
return ResolveParagraph(&bpd);
}
+// In ResolveParagraph, we previously used ReplaceChar(kSeparators, kSpace)
+// to convert separators to spaces, but this hard-coded implementation is
+// substantially faster than the general-purpose ReplaceChar function.
+// This must be kept in sync with the definition of kSeparators.
+static inline void ReplaceSeparators(nsString& aText, size_t aStartIndex = 0) {
+ for (char16_t* cp = aText.BeginWriting() + aStartIndex;
+ cp < aText.EndWriting(); cp++) {
+ if (MOZ_UNLIKELY(*cp < char16_t(' '))) {
+ static constexpr char16_t SeparatorToSpace[32] = {
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, ' ', ' ',
+ ' ', 0x0c, ' ', 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15,
+ 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, ' ', ' ', ' ', ' ',
+ };
+ *cp = SeparatorToSpace[*cp];
+ } else if (MOZ_UNLIKELY(*cp == kNextLine || *cp == kParagraphSeparator)) {
+ *cp = ' ';
+ }
+ }
+}
+
nsresult nsBidiPresUtils::ResolveParagraph(BidiParagraphData* aBpd) {
if (aBpd->BufferLength() < 1) {
return NS_OK;
}
- aBpd->mBuffer.ReplaceChar(kSeparators, kSpace);
+
+ ReplaceSeparators(aBpd->mBuffer);
int32_t runCount;
@@ -1506,8 +1513,19 @@ nscoord nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
aStart = 0;
}
+ // No need to bidi-reorder the line if there's only a single frame.
+ if (aNumFramesOnLine == 1) {
+ auto bidiData = nsBidiPresUtils::GetFrameBidiData(aFirstFrameOnLine);
+ nsContinuationStates continuationStates;
+ InitContinuationStates(aFirstFrameOnLine, &continuationStates);
+ return aStart + RepositionFrame(aFirstFrameOnLine,
+ bidiData.embeddingLevel.IsLTR(), aStart,
+ &continuationStates, aLineWM, false,
+ containerSize);
+ }
+
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
- return RepositionInlineFrames(&bld, aLineWM, containerSize, aStart);
+ return RepositionInlineFrames(bld, aLineWM, containerSize, aStart);
}
nsIFrame* nsBidiPresUtils::GetFirstLeaf(nsIFrame* aFrame) {
@@ -1857,40 +1875,30 @@ void nsBidiPresUtils::InitContinuationStates(
}
/* static */
-nscoord nsBidiPresUtils::RepositionInlineFrames(BidiLineData* aBld,
+nscoord nsBidiPresUtils::RepositionInlineFrames(const BidiLineData& aBld,
WritingMode aLineWM,
const nsSize& aContainerSize,
nscoord aStart) {
- nscoord start = aStart;
- nsIFrame* frame;
- int32_t count = aBld->mVisualFrames.Length();
- int32_t index;
nsContinuationStates continuationStates;
+ aBld.InitContinuationStates(&continuationStates);
- // Initialize continuation states to (nullptr, 0) for
- // each frame on the line.
- for (index = 0; index < count; index++) {
- InitContinuationStates(aBld->VisualFrameAt(index), &continuationStates);
- }
-
- // Reposition frames in visual order
- int32_t step, limit;
if (aLineWM.IsBidiLTR()) {
- index = 0;
- step = 1;
- limit = count;
+ for (auto index : IntegerRange(aBld.VisualFrameCount())) {
+ auto [frame, level] = aBld.VisualFrameAndLevelAt(index);
+ aStart +=
+ RepositionFrame(frame, level.IsLTR(), aStart, &continuationStates,
+ aLineWM, false, aContainerSize);
+ }
} else {
- index = count - 1;
- step = -1;
- limit = -1;
- }
- for (; index != limit; index += step) {
- frame = aBld->VisualFrameAt(index);
- start += RepositionFrame(
- frame, !(aBld->mLevels[aBld->mIndexMap[index]].IsRTL()), start,
- &continuationStates, aLineWM, false, aContainerSize);
+ for (auto index : Reversed(IntegerRange(aBld.VisualFrameCount()))) {
+ auto [frame, level] = aBld.VisualFrameAndLevelAt(index);
+ aStart +=
+ RepositionFrame(frame, level.IsLTR(), aStart, &continuationStates,
+ aLineWM, false, aContainerSize);
+ }
}
- return start;
+
+ return aStart;
}
bool nsBidiPresUtils::CheckLineOrder(nsIFrame* aFirstFrameOnLine,
@@ -1898,16 +1906,15 @@ bool nsBidiPresUtils::CheckLineOrder(nsIFrame* aFirstFrameOnLine,
nsIFrame** aFirstVisual,
nsIFrame** aLastVisual) {
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
- int32_t count = bld.FrameCount();
if (aFirstVisual) {
*aFirstVisual = bld.VisualFrameAt(0);
}
if (aLastVisual) {
- *aLastVisual = bld.VisualFrameAt(count - 1);
+ *aLastVisual = bld.VisualFrameAt(bld.VisualFrameCount() - 1);
}
- return bld.mIsReordered;
+ return bld.IsReordered();
}
nsIFrame* nsBidiPresUtils::GetFrameToRightOf(const nsIFrame* aFrame,
@@ -1915,9 +1922,11 @@ nsIFrame* nsBidiPresUtils::GetFrameToRightOf(const nsIFrame* aFrame,
int32_t aNumFramesOnLine) {
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
- int32_t count = bld.mVisualFrames.Length();
+ int32_t count = bld.VisualFrameCount();
- if (aFrame == nullptr && count) return bld.VisualFrameAt(0);
+ if (!aFrame && count) {
+ return bld.VisualFrameAt(0);
+ }
for (int32_t i = 0; i < count - 1; i++) {
if (bld.VisualFrameAt(i) == aFrame) {
@@ -1933,9 +1942,11 @@ nsIFrame* nsBidiPresUtils::GetFrameToLeftOf(const nsIFrame* aFrame,
int32_t aNumFramesOnLine) {
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
- int32_t count = bld.mVisualFrames.Length();
+ int32_t count = bld.VisualFrameCount();
- if (aFrame == nullptr && count) return bld.VisualFrameAt(count - 1);
+ if (!aFrame && count) {
+ return bld.VisualFrameAt(count - 1);
+ }
for (int32_t i = 1; i < count; i++) {
if (bld.VisualFrameAt(i) == aFrame) {
@@ -2476,9 +2487,19 @@ nsresult nsBidiPresUtils::ProcessTextForRenderingContext(
nsIRenderingContextBidiProcessor processor(&aRenderingContext,
aTextRunConstructionDrawTarget,
&aFontMetrics, nsPoint(aX, aY));
- nsAutoString text(aText, aLength);
- text.ReplaceChar(kSeparators, ' ');
- return ProcessText(text.BeginReading(), text.Length(), aBaseLevel,
+ nsDependentSubstring text(aText, aLength);
+ auto separatorIndex = text.FindCharInSet(kSeparators);
+ if (separatorIndex == kNotFound) {
+ return ProcessText(text.BeginReading(), text.Length(), aBaseLevel,
+ aPresContext, processor, aMode, aPosResolve,
+ aPosResolveCount, aWidth, aPresContext->BidiEngine());
+ }
+
+ // We need to replace any block or segment separators with space for bidi
+ // processing, so make a local copy.
+ nsAutoString localText(text);
+ ReplaceSeparators(localText, separatorIndex);
+ return ProcessText(localText.BeginReading(), localText.Length(), aBaseLevel,
aPresContext, processor, aMode, aPosResolve,
aPosResolveCount, aWidth, aPresContext->BidiEngine());
}
diff --git a/layout/base/nsBidiPresUtils.h b/layout/base/nsBidiPresUtils.h
index c369a06f2d..80cf8fbc41 100644
--- a/layout/base/nsBidiPresUtils.h
+++ b/layout/base/nsBidiPresUtils.h
@@ -21,7 +21,7 @@
#endif
struct BidiParagraphData;
-struct BidiLineData;
+class BidiLineData;
class gfxContext;
class nsFontMetrics;
class nsIFrame;
@@ -398,6 +398,8 @@ class nsBidiPresUtils {
mozilla::ComputedStyle* aComputedStyle);
private:
+ friend class BidiLineData;
+
static nsresult ProcessTextForRenderingContext(
const char16_t* aText, int32_t aLength,
mozilla::intl::BidiEmbeddingLevel aBaseLevel, nsPresContext* aPresContext,
@@ -536,7 +538,7 @@ class nsBidiPresUtils {
*
* @lina 04/11/2000
*/
- static nscoord RepositionInlineFrames(BidiLineData* aBld,
+ static nscoord RepositionInlineFrames(const BidiLineData& aBld,
mozilla::WritingMode aLineWM,
const nsSize& aContainerSize,
nscoord aStart);
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index 3c1896c162..149f2f24bf 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -170,6 +170,7 @@ nsIFrame* NS_NewSVGFEImageFrame(PresShell* aPresShell, ComputedStyle* aStyle);
nsIFrame* NS_NewSVGFEUnstyledLeafFrame(PresShell* aPresShell,
ComputedStyle* aStyle);
nsIFrame* NS_NewFileControlLabelFrame(PresShell*, ComputedStyle*);
+nsIFrame* NS_NewComboboxLabelFrame(PresShell*, ComputedStyle*);
nsIFrame* NS_NewMiddleCroppingLabelFrame(PresShell*, ComputedStyle*);
#include "mozilla/dom/NodeInfo.h"
@@ -320,7 +321,7 @@ static bool ShouldSuppressColumnSpanDescendants(nsIFrame* aFrame) {
}
if (!aFrame->IsBlockFrameOrSubclass() ||
- aFrame->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS | NS_FRAME_OUT_OF_FLOW) ||
+ aFrame->HasAnyStateBits(NS_BLOCK_BFC | NS_FRAME_OUT_OF_FLOW) ||
aFrame->IsFixedPosContainingBlock()) {
// Need to suppress column-span if we:
// - Are a different block formatting context,
@@ -2286,7 +2287,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructTableCell(
aState, content, innerPseudoStyle, cellFrame,
PseudoStyleType::scrolledContent, false, scrollFrame);
}
- cellInnerFrame = NS_NewBlockFormattingContext(mPresShell, innerPseudoStyle);
+ cellInnerFrame = NS_NewBlockFrame(mPresShell, innerPseudoStyle);
}
auto* parent = scrollFrame ? scrollFrame : cellFrame;
InitAndRestoreFrame(aState, content, parent, cellInnerFrame);
@@ -2566,7 +2567,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructDocElementFrame(
MOZ_ASSERT(display->mDisplay == StyleDisplay::Block ||
display->mDisplay == StyleDisplay::FlowRoot,
"Unhandled display type for root element");
- contentFrame = NS_NewBlockFormattingContext(mPresShell, computedStyle);
+ contentFrame = NS_NewBlockFrame(mPresShell, computedStyle);
ConstructBlock(
state, aDocElement,
state.GetGeometricParent(*display, mDocElementContainingBlock),
@@ -3012,91 +3013,33 @@ static inline void ClearLazyBits(nsIContent* aStartContent,
}
}
-nsIFrame* nsCSSFrameConstructor::ConstructSelectFrame(
+/* static */
+const nsCSSFrameConstructor::FrameConstructionData*
+nsCSSFrameConstructor::FindSelectData(const Element& aElement,
+ ComputedStyle& aStyle) {
+ // Construct a frame-based listbox or combobox
+ const auto* sel = dom::HTMLSelectElement::FromNode(aElement);
+ MOZ_ASSERT(sel);
+ if (sel->IsCombobox()) {
+ static constexpr FrameConstructionData sComboboxData{
+ ToCreationFunc(NS_NewComboboxControlFrame), 0,
+ PseudoStyleType::buttonContent};
+ return &sComboboxData;
+ }
+ // FIXME: Can we simplify this to avoid needing ConstructListboxSelectFrame,
+ // and reuse ConstructScrollableBlock or so?
+ static constexpr FrameConstructionData sListBoxData{
+ &nsCSSFrameConstructor::ConstructListBoxSelectFrame};
+ return &sListBoxData;
+}
+
+nsIFrame* nsCSSFrameConstructor::ConstructListBoxSelectFrame(
nsFrameConstructorState& aState, FrameConstructionItem& aItem,
nsContainerFrame* aParentFrame, const nsStyleDisplay* aStyleDisplay,
nsFrameList& aFrameList) {
nsIContent* const content = aItem.mContent;
ComputedStyle* const computedStyle = aItem.mComputedStyle;
- // Construct a frame-based listbox or combobox
- dom::HTMLSelectElement* sel = dom::HTMLSelectElement::FromNode(content);
- MOZ_ASSERT(sel);
- if (sel->IsCombobox()) {
- // Construct a frame-based combo box.
- // The frame-based combo box is built out of three parts. A display area, a
- // button and a dropdown list. The display area and button are created
- // through anonymous content. The drop-down list's frame is created
- // explicitly. The combobox frame shares its content with the drop-down
- // list.
- nsComboboxControlFrame* comboboxFrame =
- NS_NewComboboxControlFrame(mPresShell, computedStyle);
-
- // Save the history state so we don't restore during construction
- // since the complete tree is required before we restore.
- nsILayoutHistoryState* historyState = aState.mFrameState;
- aState.mFrameState = nullptr;
- // Initialize the combobox frame
- InitAndRestoreFrame(aState, content,
- aState.GetGeometricParent(*aStyleDisplay, aParentFrame),
- comboboxFrame);
-
- comboboxFrame->AddStateBits(NS_FRAME_OWNS_ANON_BOXES);
-
- aState.AddChild(comboboxFrame, aFrameList, content, aParentFrame);
-
- // Resolve pseudo element style for the dropdown list
- RefPtr<ComputedStyle> listStyle =
- mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(
- PseudoStyleType::dropDownList, computedStyle);
-
- // child frames of combobox frame
- nsFrameList childList;
-
- // Create display and button frames from the combobox's anonymous content.
- // The anonymous content is appended to existing anonymous content for this
- // element (the scrollbars).
- //
- // nsComboboxControlFrame needs special frame creation behavior for its
- // first piece of anonymous content, which means that we can't take the
- // normal ProcessChildren path.
- AutoTArray<nsIAnonymousContentCreator::ContentInfo, 2> newAnonymousItems;
- DebugOnly<nsresult> rv =
- GetAnonymousContent(content, comboboxFrame, newAnonymousItems);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- MOZ_ASSERT(!newAnonymousItems.IsEmpty());
-
- // Manually create a frame for the special NAC.
- MOZ_ASSERT(newAnonymousItems[0].mContent ==
- comboboxFrame->GetDisplayNode());
- newAnonymousItems.RemoveElementAt(0);
- nsIFrame* customFrame = comboboxFrame->CreateFrameForDisplayNode();
- MOZ_ASSERT(customFrame);
- childList.AppendFrame(nullptr, customFrame);
-
- nsFrameConstructorSaveState floatSaveState;
- aState.MaybePushFloatContainingBlock(comboboxFrame, floatSaveState);
-
- // The other piece of NAC can take the normal path.
- AutoFrameConstructionItemList fcItems(this);
- AutoFrameConstructionPageName pageNameTracker(aState, comboboxFrame);
- AddFCItemsForAnonymousContent(aState, comboboxFrame, newAnonymousItems,
- fcItems, pageNameTracker);
- ConstructFramesFromItemList(aState, fcItems, comboboxFrame,
- /* aParentIsWrapperAnonBox = */ false,
- childList);
-
- comboboxFrame->SetInitialChildList(FrameChildListID::Principal,
- std::move(childList));
-
- aState.mFrameState = historyState;
- if (aState.mFrameState) {
- // Restore frame state for the entire subtree of |comboboxFrame|.
- RestoreFrameState(comboboxFrame, aState.mFrameState);
- }
- return comboboxFrame;
- }
-
// Listbox, not combobox
nsContainerFrame* listFrame =
NS_NewListControlFrame(mPresShell, computedStyle);
@@ -3175,7 +3118,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructFieldSetFrame(
const nsStyleDisplay* fieldsetContentDisplay =
fieldsetContentStyle->StyleDisplay();
- bool isScrollable = fieldsetContentDisplay->IsScrollableOverflow();
+ const bool isScrollable = fieldsetContentDisplay->IsScrollableOverflow();
nsContainerFrame* scrollFrame = nullptr;
if (isScrollable) {
fieldsetContentStyle = BeginBuildingScrollFrame(
@@ -3204,8 +3147,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructFieldSetFrame(
MOZ_ASSERT(fieldsetContentDisplay->mDisplay == StyleDisplay::Block,
"bug in StyleAdjuster::adjust_for_fieldset_content?");
- contentFrame =
- NS_NewBlockFormattingContext(mPresShell, fieldsetContentStyle);
+ contentFrame = NS_NewBlockFrame(mPresShell, fieldsetContentStyle);
if (fieldsetContentStyle->StyleColumn()->IsColumnContainerStyle()) {
contentFrameTop = BeginBuildingColumns(
aState, content, parent, contentFrame, fieldsetContentStyle);
@@ -3499,11 +3441,18 @@ nsCSSFrameConstructor::FindHTMLData(const Element& aElement,
"Unexpected parent for fieldset content anon box");
if (aElement.IsInNativeAnonymousSubtree() &&
- aElement.NodeInfo()->NameAtom() == nsGkAtoms::label &&
- static_cast<nsFileControlFrame*>(do_QueryFrame(aParentFrame))) {
- static constexpr FrameConstructionData sFileLabelData(
- NS_NewFileControlLabelFrame);
- return &sFileLabelData;
+ aElement.NodeInfo()->NameAtom() == nsGkAtoms::label && aParentFrame) {
+ if (static_cast<nsFileControlFrame*>(do_QueryFrame(aParentFrame))) {
+ static constexpr FrameConstructionData sFileLabelData(
+ NS_NewFileControlLabelFrame);
+ return &sFileLabelData;
+ }
+ if (aParentFrame->GetParent() &&
+ aParentFrame->GetParent()->IsComboboxControlFrame()) {
+ static constexpr FrameConstructionData sComboboxLabelData(
+ NS_NewComboboxLabelFrame);
+ return &sComboboxLabelData;
+ }
}
static constexpr FrameConstructionDataByTag sHTMLData[] = {
@@ -3515,7 +3464,7 @@ nsCSSFrameConstructor::FindHTMLData(const Element& aElement,
SIMPLE_TAG_CREATE(wbr, NS_NewWBRFrame),
SIMPLE_TAG_CHAIN(input, nsCSSFrameConstructor::FindInputData),
SIMPLE_TAG_CREATE(textarea, NS_NewTextControlFrame),
- COMPLEX_TAG_CREATE(select, &nsCSSFrameConstructor::ConstructSelectFrame),
+ SIMPLE_TAG_CHAIN(select, nsCSSFrameConstructor::FindSelectData),
SIMPLE_TAG_CHAIN(object, nsCSSFrameConstructor::FindObjectData),
SIMPLE_TAG_CHAIN(embed, nsCSSFrameConstructor::FindObjectData),
COMPLEX_TAG_CREATE(fieldset,
@@ -3741,11 +3690,6 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal(
CHECK_ONLY_ONE_BIT(FCDATA_WRAP_KIDS_IN_BLOCKS,
FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS);
#undef CHECK_ONLY_ONE_BIT
- NS_ASSERTION(!(bits & FCDATA_FORCED_NON_SCROLLABLE_BLOCK) ||
- ((bits & FCDATA_FUNC_IS_FULL_CTOR) &&
- data->mFunc.mFullConstructor ==
- &nsCSSFrameConstructor::ConstructNonScrollableBlock),
- "Unexpected FCDATA_FORCED_NON_SCROLLABLE_BLOCK flag");
MOZ_ASSERT(
!(bits & FCDATA_IS_WRAPPER_ANON_BOX) || (bits & FCDATA_USE_CHILD_ITEMS),
"Wrapper anon boxes should always have FCDATA_USE_CHILD_ITEMS");
@@ -3823,7 +3767,7 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal(
innerFrame = outerFrame;
break;
default: {
- innerFrame = NS_NewBlockFormattingContext(mPresShell, outerStyle);
+ innerFrame = NS_NewBlockFrame(mPresShell, outerStyle);
if (outerStyle->StyleColumn()->IsColumnContainerStyle()) {
outerFrame = BeginBuildingColumns(aState, content, container,
innerFrame, outerStyle);
@@ -3836,7 +3780,7 @@ void nsCSSFrameConstructor::ConstructFrameFromItemInternal(
}
}
} else {
- innerFrame = NS_NewBlockFormattingContext(mPresShell, outerStyle);
+ innerFrame = NS_NewBlockFrame(mPresShell, outerStyle);
InitAndRestoreFrame(aState, content, container, innerFrame);
outerFrame = innerFrame;
}
@@ -4386,14 +4330,14 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay& aDisplay,
// XXX Ignore tables for the time being (except caption)
const uint32_t kCaptionCtorFlags =
FCDATA_IS_TABLE_PART | FCDATA_DESIRED_PARENT_TYPE_TO_BITS(eTypeTable);
- bool caption = aDisplay.mDisplay == StyleDisplay::TableCaption;
- bool suppressScrollFrame = false;
- bool needScrollFrame =
+ const bool caption = aDisplay.mDisplay == StyleDisplay::TableCaption;
+ const bool needScrollFrame =
aDisplay.IsScrollableOverflow() && !propagatedScrollToViewport;
if (needScrollFrame) {
- suppressScrollFrame = mPresShell->GetPresContext()->IsPaginated() &&
- aDisplay.IsBlockOutsideStyle() &&
- !aElement.IsInNativeAnonymousSubtree();
+ const bool suppressScrollFrame =
+ mPresShell->GetPresContext()->IsPaginated() &&
+ aDisplay.IsBlockOutsideStyle() &&
+ !aElement.IsInNativeAnonymousSubtree();
if (!suppressScrollFrame) {
static constexpr FrameConstructionData sScrollableBlockData[2] = {
{&nsCSSFrameConstructor::ConstructScrollableBlock},
@@ -4401,27 +4345,14 @@ nsCSSFrameConstructor::FindDisplayData(const nsStyleDisplay& aDisplay,
kCaptionCtorFlags}};
return &sScrollableBlockData[caption];
}
-
- // If the scrollable frame would have propagated its scrolling to the
- // viewport, we still want to construct a regular block rather than a
- // scrollframe so that it paginates correctly, but we don't want to set
- // the bit on the block that tells it to clip at paint time.
- if (mPresShell->GetPresContext()->ElementWouldPropagateScrollStyles(
- aElement)) {
- suppressScrollFrame = false;
- }
}
// Handle various non-scrollable blocks.
- static constexpr FrameConstructionData sNonScrollableBlockData[2][2] = {
- {{&nsCSSFrameConstructor::ConstructNonScrollableBlock},
- {&nsCSSFrameConstructor::ConstructNonScrollableBlock,
- kCaptionCtorFlags}},
- {{&nsCSSFrameConstructor::ConstructNonScrollableBlock,
- FCDATA_FORCED_NON_SCROLLABLE_BLOCK},
- {&nsCSSFrameConstructor::ConstructNonScrollableBlock,
- FCDATA_FORCED_NON_SCROLLABLE_BLOCK | kCaptionCtorFlags}}};
- return &sNonScrollableBlockData[suppressScrollFrame][caption];
+ static constexpr FrameConstructionData sNonScrollableBlockData[2] = {
+ {&nsCSSFrameConstructor::ConstructNonScrollableBlock},
+ {&nsCSSFrameConstructor::ConstructNonScrollableBlock,
+ kCaptionCtorFlags}};
+ return &sNonScrollableBlockData[caption];
}
case StyleDisplayInside::Table: {
static constexpr FrameConstructionData data(
@@ -4555,8 +4486,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructScrollableBlock(
// Create our block frame
// pass a temporary stylecontext, the correct one will be set later
- nsContainerFrame* scrolledFrame =
- NS_NewBlockFormattingContext(mPresShell, computedStyle);
+ nsContainerFrame* scrolledFrame = NS_NewBlockFrame(mPresShell, computedStyle);
// Make sure to AddChild before we call ConstructBlock so that we
// end up before our descendants in fixed-pos lists as needed.
@@ -4579,26 +4509,7 @@ nsIFrame* nsCSSFrameConstructor::ConstructNonScrollableBlock(
nsContainerFrame* aParentFrame, const nsStyleDisplay* aDisplay,
nsFrameList& aFrameList) {
ComputedStyle* const computedStyle = aItem.mComputedStyle;
-
- // We want a block formatting context root in paginated contexts for
- // every block that would be scrollable in a non-paginated context.
- // We mark our blocks with a bit here if this condition is true, so
- // we can check it later in nsIFrame::ApplyPaginatedOverflowClipping.
- bool clipPaginatedOverflow =
- (aItem.mFCData->mBits & FCDATA_FORCED_NON_SCROLLABLE_BLOCK) != 0;
- nsFrameState flags = nsFrameState(0);
- if ((aDisplay->IsAbsolutelyPositionedStyle() || aDisplay->IsFloatingStyle() ||
- aDisplay->DisplayInside() == StyleDisplayInside::FlowRoot ||
- clipPaginatedOverflow) &&
- !aParentFrame->IsInSVGTextSubtree()) {
- flags = NS_BLOCK_STATIC_BFC;
- if (clipPaginatedOverflow) {
- flags |= NS_BLOCK_CLIP_PAGINATED_OVERFLOW;
- }
- }
-
nsContainerFrame* newFrame = NS_NewBlockFrame(mPresShell, computedStyle);
- newFrame->AddStateBits(flags);
ConstructBlock(aState, aItem.mContent,
aState.GetGeometricParent(*aDisplay, aParentFrame),
aParentFrame, computedStyle, &newFrame, aFrameList,
@@ -5165,10 +5076,14 @@ static bool ShouldSuppressFrameInSelect(const nsIContent* aParent,
return false;
}
+ // Allow native anonymous content no matter what.
+ if (aChild.IsRootOfNativeAnonymousSubtree()) {
+ return false;
+ }
+
// Options with labels have their label text added in ::before by forms.css.
// Suppress frames for their child text.
- if (aParent->IsHTMLElement(nsGkAtoms::option) &&
- !aChild.IsRootOfNativeAnonymousSubtree()) {
+ if (aParent->IsHTMLElement(nsGkAtoms::option)) {
return aParent->AsElement()->HasNonEmptyAttr(nsGkAtoms::label);
}
@@ -5191,11 +5106,7 @@ static bool ShouldSuppressFrameInSelect(const nsIContent* aParent,
return false;
}
- // Allow native anonymous content no matter what.
- if (aChild.IsRootOfNativeAnonymousSubtree()) {
- return false;
- }
-
+ // Anything else is not ok.
return true;
}
@@ -8042,6 +7953,20 @@ nsIFrame* nsCSSFrameConstructor::CreateContinuingFrame(
return newFrame;
}
+void nsCSSFrameConstructor::MaybeSetNextPageContentFramePageName(
+ const nsIFrame* aFrame) {
+ MOZ_ASSERT(aFrame, "Frame should not be null");
+ // No parent means the root frame, which isn't what this funciton is for.
+ MOZ_ASSERT(aFrame->GetParent(),
+ "Frame should be the first child placed on a new page, not the "
+ "root frame.");
+ if (mNextPageContentFramePageName) {
+ return;
+ }
+ const nsAtom* const autoValue = aFrame->GetParent()->GetAutoPageValue();
+ mNextPageContentFramePageName = aFrame->ComputePageValue(autoValue);
+}
+
nsresult nsCSSFrameConstructor::ReplicateFixedFrames(
nsPageContentFrame* aParentFrame) {
// Now deal with fixed-pos things.... They should appear on all pages,
@@ -8743,15 +8668,14 @@ void nsCSSFrameConstructor::CreateNeededAnonFlexOrGridItems(
mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle(
PseudoStyleType::anonymousItem, aParentFrame->Style());
- static constexpr FrameConstructionData sBlockFormattingContextFCData(
- ToCreationFunc(NS_NewBlockFormattingContext),
- FCDATA_SKIP_FRAMESET | FCDATA_USE_CHILD_ITEMS |
- FCDATA_IS_WRAPPER_ANON_BOX);
+ static constexpr FrameConstructionData sBlockFCData(
+ ToCreationFunc(NS_NewBlockFrame), FCDATA_SKIP_FRAMESET |
+ FCDATA_USE_CHILD_ITEMS |
+ FCDATA_IS_WRAPPER_ANON_BOX);
- FrameConstructionItem* newItem = new (this)
- FrameConstructionItem(&sBlockFormattingContextFCData,
- // Use the content of our parent frame
- parentContent, wrapperStyle.forget(), true);
+ // Use the content of our parent frame
+ auto* newItem = new (this) FrameConstructionItem(
+ &sBlockFCData, parentContent, wrapperStyle.forget(), true);
newItem->mIsAllInline =
newItem->mComputedStyle->StyleDisplay()->IsInlineOutsideStyle();
diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h
index 1b48fd15dc..283d1385ce 100644
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -297,12 +297,39 @@ class nsCSSFrameConstructor final : public nsFrameManager {
nsContainerFrame* aParentFrame,
bool aIsFluid = true);
- void SetNextPageContentFramePageName(const nsAtom* aAtom) {
+ /**
+ * Sets the page name when a page break is being generated due to a change
+ * in page name.
+ *
+ * Should only be used during paginated reflow, to signal what page value
+ * the next page content frame should have.
+ *
+ * It is an error to set this if a new page name has already been set, either
+ * through SetNextPageContentFramePageName or
+ * MaybeSetNextPageContentFramePageName.
+ */
+ void SetNextPageContentFramePageName(const nsAtom* aPageName) {
+ MOZ_ASSERT(aPageName, "New page name should never be null");
MOZ_ASSERT(!mNextPageContentFramePageName,
"PageContentFrame page name was already set");
- mNextPageContentFramePageName = aAtom;
+ mNextPageContentFramePageName = aPageName;
}
+ /**
+ * If a new page name has not been set for the next page, sets the value
+ * using the given frame.
+ *
+ * |aFrame| should be a frame to be placed on the new page.
+ *
+ * This function handles the work of resolving an atom for the frame, and
+ * avoids doing this extra work when not necessary.
+ *
+ * This is used during block reflow when a page break has occurred but it was
+ * not caused by a change in page name. It should only be used during
+ * paginated reflow.
+ */
+ void MaybeSetNextPageContentFramePageName(const nsIFrame* aFrame);
+
// Copy over fixed frames from aParentFrame's prev-in-flow
nsresult ReplicateFixedFrames(nsPageContentFrame* aParentFrame);
@@ -696,10 +723,6 @@ class nsCSSFrameConstructor final : public nsFrameManager {
This can be used with or without FCDATA_FUNC_IS_FULL_CTOR.
The child items might still need table pseudo processing. */
#define FCDATA_USE_CHILD_ITEMS 0x10000
- /* If FCDATA_FORCED_NON_SCROLLABLE_BLOCK is set, then this block
- would have been scrollable but has been forced to be
- non-scrollable due to being in a paginated context. */
-#define FCDATA_FORCED_NON_SCROLLABLE_BLOCK 0x20000
/* If FCDATA_CREATE_BLOCK_WRAPPER_FOR_ALL_KIDS is set, then create a
block formatting context wrapper around the kids of this frame
using the FrameConstructionData's mPseudoAtom for its anonymous
@@ -1361,14 +1384,6 @@ class nsCSSFrameConstructor final : public nsFrameManager {
nsFrameState aTypeBit);
private:
- // ConstructSelectFrame puts the new frame in aFrameList and
- // handles the kids of the select.
- nsIFrame* ConstructSelectFrame(nsFrameConstructorState& aState,
- FrameConstructionItem& aItem,
- nsContainerFrame* aParentFrame,
- const nsStyleDisplay* aStyleDisplay,
- nsFrameList& aFrameList);
-
// ConstructFieldSetFrame puts the new frame in aFrameList and
// handles the kids of the fieldset
nsIFrame* ConstructFieldSetFrame(nsFrameConstructorState& aState,
@@ -1377,6 +1392,12 @@ class nsCSSFrameConstructor final : public nsFrameManager {
const nsStyleDisplay* aStyleDisplay,
nsFrameList& aFrameList);
+ nsIFrame* ConstructListBoxSelectFrame(nsFrameConstructorState& aState,
+ FrameConstructionItem& aItem,
+ nsContainerFrame* aParentFrame,
+ const nsStyleDisplay* aStyleDisplay,
+ nsFrameList& aFrameList);
+
// Creates a block frame wrapping an anonymous ruby frame.
nsIFrame* ConstructBlockRubyFrame(nsFrameConstructorState& aState,
FrameConstructionItem& aItem,
@@ -1423,6 +1444,8 @@ class nsCSSFrameConstructor final : public nsFrameManager {
nsIFrame* aParentFrame,
ComputedStyle&);
// HTML data-finding helper functions
+ static const FrameConstructionData* FindSelectData(const Element&,
+ ComputedStyle&);
static const FrameConstructionData* FindImgData(const Element&,
ComputedStyle&);
static const FrameConstructionData* FindGeneratedImageData(const Element&,
diff --git a/layout/base/nsDocumentViewer.cpp b/layout/base/nsDocumentViewer.cpp
index ab61daae87..d1cf9bf237 100644
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -1143,6 +1143,8 @@ nsDocumentViewer::PermitUnload(PermitUnloadAction aAction,
*aPermitUnload = true;
+ NS_ENSURE_STATE(mContainer);
+
RefPtr<BrowsingContext> bc = mContainer->GetBrowsingContext();
if (!bc) {
return NS_OK;
@@ -1224,7 +1226,7 @@ MOZ_CAN_RUN_SCRIPT_BOUNDARY PermitUnloadResult
nsDocumentViewer::DispatchBeforeUnload() {
AutoDontWarnAboutSyncXHR disableSyncXHRWarning;
- if (!mDocument || mInPermitUnload || mInPermitUnloadPrompt) {
+ if (!mDocument || mInPermitUnload || mInPermitUnloadPrompt || !mContainer) {
return eAllowNavigation;
}
@@ -2546,6 +2548,8 @@ nsDocumentViewer::ForgetReloadEncoding() {
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHODIMP nsDocumentViewer::GetContentSize(
int32_t aMaxWidth, int32_t aMaxHeight, int32_t aPrefWidth, int32_t* aWidth,
int32_t* aHeight) {
+ NS_ENSURE_STATE(mContainer);
+
RefPtr<BrowsingContext> bc = mContainer->GetBrowsingContext();
NS_ENSURE_TRUE(bc, NS_ERROR_NOT_AVAILABLE);
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index 28230421d5..db766f6603 100644
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -9492,8 +9492,9 @@ nsRect nsLayoutUtils::ComputeSVGOriginBox(SVGViewportElement* aElement) {
}
/* static */
-nsRect nsLayoutUtils::ComputeSVGReferenceRect(nsIFrame* aFrame,
- StyleGeometryBox aGeometryBox) {
+nsRect nsLayoutUtils::ComputeSVGReferenceRect(
+ nsIFrame* aFrame, StyleGeometryBox aGeometryBox,
+ MayHaveNonScalingStrokeCyclicDependency aMayHaveCyclicDependency) {
MOZ_ASSERT(aFrame->GetContent()->IsSVGElement());
nsRect r;
@@ -9502,9 +9503,12 @@ nsRect nsLayoutUtils::ComputeSVGReferenceRect(nsIFrame* aFrame,
// XXX Bug 1299876
// The size of stroke-box is not correct if this graphic element has
// specific stroke-linejoin or stroke-linecap.
- gfxRect bbox =
- SVGUtils::GetBBox(aFrame, SVGUtils::eBBoxIncludeFillGeometry |
- SVGUtils::eBBoxIncludeStroke);
+ const uint32_t flags = SVGUtils::eBBoxIncludeFillGeometry |
+ SVGUtils::eBBoxIncludeStroke |
+ (bool(aMayHaveCyclicDependency)
+ ? SVGUtils::eAvoidCycleIfNonScalingStroke
+ : 0);
+ gfxRect bbox = SVGUtils::GetBBox(aFrame, flags);
r = nsLayoutUtils::RoundGfxRectToAppRect(bbox, AppUnitsPerCSSPixel());
break;
}
diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h
index 3cd01dce9f..697b139ed9 100644
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -2913,7 +2913,13 @@ class nsLayoutUtils {
// Compute the geometry box for SVG layout. The caller should map the CSS box
// into the proper SVG box.
- static nsRect ComputeSVGReferenceRect(nsIFrame*, StyleGeometryBox);
+ // |aMayHaveCyclicDependency| is used for stroke-box to avoid the cyclic
+ // dependency if any of its descendants uses non-scaling-stroke.
+ enum class MayHaveNonScalingStrokeCyclicDependency : bool { No, Yes };
+ static nsRect ComputeSVGReferenceRect(
+ nsIFrame*, StyleGeometryBox,
+ MayHaveNonScalingStrokeCyclicDependency =
+ MayHaveNonScalingStrokeCyclicDependency::No);
// Compute the geometry box for CSS layout. The caller should map the SVG box
// into the proper CSS box.
diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp
index c1b03aebf4..7d9515c495 100644
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -906,7 +906,6 @@ Maybe<ColorScheme> nsPresContext::GetOverriddenOrEmbedderColorScheme() const {
case dom::PrefersColorSchemeOverride::Light:
return Some(ColorScheme::Light);
case dom::PrefersColorSchemeOverride::None:
- case dom::PrefersColorSchemeOverride::EndGuard_:
break;
}
diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h
index bc4e70dbcf..563dac0eae 100644
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1397,7 +1397,8 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
#ifdef DEBUG
private:
friend struct nsAutoLayoutPhase;
- mozilla::EnumeratedArray<nsLayoutPhase, nsLayoutPhase::COUNT, uint32_t>
+ mozilla::EnumeratedArray<nsLayoutPhase, uint32_t,
+ size_t(nsLayoutPhase::COUNT)>
mLayoutPhaseCount;
public:
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index af780bb192..a5c2b1ded9 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -2264,7 +2264,8 @@ void nsRefreshDriver::DetermineProximityToViewportAndNotifyResizeObservers() {
return false;
}
return ps->HasContentVisibilityAutoFrames() ||
- aDocument->HasResizeObservers();
+ aDocument->HasResizeObservers() ||
+ aDocument->HasElementsWithLastRememberedSize();
};
AutoTArray<RefPtr<Document>, 32> documents;
diff --git a/layout/base/tests/mochitest.toml b/layout/base/tests/mochitest.toml
index d4b7932cfc..24924809c0 100644
--- a/layout/base/tests/mochitest.toml
+++ b/layout/base/tests/mochitest.toml
@@ -234,6 +234,8 @@ support-files = ["bug1448730.html"]
["test_bug1756118.html"]
+["test_bug1836801.html"]
+
["test_caret_browsing_around_form_controls.html"]
skip-if = ["os == 'android'"]
diff --git a/layout/base/tests/test_bug1836801.html b/layout/base/tests/test_bug1836801.html
new file mode 100644
index 0000000000..4584394600
--- /dev/null
+++ b/layout/base/tests/test_bug1836801.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <script src="/tests/SimpleTest/EventUtils.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+
+<script>
+// this is a crashtest, just getting to the end is a pass, fullscreen
+// doesn't work in crashtests though not sure why -->
+SimpleTest.waitForExplicitFinish();
+
+SimpleTest.requestFlakyTimeout("crashtest sensitive to timing");
+
+function begin() {
+ SimpleTest.waitForFocus(begin2);
+}
+
+function begin2() {
+ SpecialPowers.pushPrefEnv({
+ "set":[["full-screen-api.allow-trusted-requests-only", false]]
+ }, startTest);
+}
+
+window.addEventListener("load", begin);
+
+const func_0 = async function(arg0) {
+ //SpecialPowers.wrap(document).notifyUserGestureActivation();
+ await arg0.originalTarget.requestFullscreen()
+ arg0.originalTarget.ariaValueText = "a"
+}
+
+async function startTest() {
+ let a = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")
+ document.documentElement.appendChild(a)
+ document.addEventListener("DOMAttrModified", func_0, { })
+ let b = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas")
+ document.documentElement.appendChild(b)
+ b.setAttribute("class", "x")
+ //SpecialPowers.wrap(document).notifyUserGestureActivation();
+ await b.mozRequestFullScreen()
+ let c = document.createElementNS("http://www.w3.org/1999/xhtml", "slot")
+ document.documentElement.appendChild(c)
+ c.setAttribute("class", "x")
+ b.inert = true
+ setTimeout(async () => {
+ b.setAttribute("title", "a")
+ }, 200)
+ a.ariaSort = "descending"
+ setTimeout(finishup, 400);
+}
+async function finishup() {
+ await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
+ await document.exitFullscreen();
+ SimpleTest.finish();
+}
+</script>
+</html>
diff --git a/layout/base/tests/test_event_target_iframe_oop.html b/layout/base/tests/test_event_target_iframe_oop.html
deleted file mode 100644
index 562433c955..0000000000
--- a/layout/base/tests/test_event_target_iframe_oop.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<!DOCTYPE HTML>
-<html id="html" style="height:100%">
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=921928
--->
-<head>
- <title>Test for bug 921928</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <style>
- #dialer {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 50px;
- background: green;
- }
-
- #apps {
- position: absolute;
- left: 0;
- top: 51px;
- width: 100%;
- height: 100px;
- background: blue;
- }
-
- .hit {
- position: absolute;
- width: 3px;
- height: 3px;
- z-index: 20;
- background: red;
- border: 1px solid red;
- }
- </style>
-</head>
-<body id="body" style="margin:0; width:100%; height:100%">
-<script type="application/javascript">
-SimpleTest.waitForExplicitFinish();
-
-var prefs = [
- ["ui.mouse.radius.enabled", true],
- ["ui.mouse.radius.inputSource.touchOnly", false],
- ["ui.mouse.radius.leftmm", 12],
- ["ui.mouse.radius.topmm", 8],
- ["ui.mouse.radius.rightmm", 4],
- ["ui.mouse.radius.bottommm", 4],
- ["ui.mouse.radius.visitedweight", 50],
-];
-
-var eventTarget;
-var debugHit = [];
-
-function endTest() {
- SimpleTest.finish();
- SpecialPowers.removePermission("browser", location.href);
- for (var pref in prefs) {
- SpecialPowers.pushPrefEnv({"clear": pref[0]}, function() {});
- }
-}
-
-function testMouseClick(idPosition, dx, dy, idTarget, msg, options) {
- eventTarget = null;
- synthesizeMouse(document.getElementById(idPosition), dx, dy, options || {});
- try {
- is(eventTarget.id, idTarget,
- "checking '" + idPosition + "' offset " + dx + "," + dy + " [" + msg + "]");
- } catch (ex) {
- ok(false, "checking '" + idPosition + "' offset " + dx + "," + dy + " [" + msg + "]; got " + eventTarget);
- }
-}
-
-function showDebug() {
- for (var i = 0; i < debugHit.length; i++) {
- document.body.appendChild(debugHit[i]);
- }
-
- var screenshot = SpecialPowers.snapshotWindow(window, true);
- dump('IMAGE:' + screenshot.toDataURL() + '\n');
-}
-
-/*
- Setup the test environment: enabling event fluffing (all ui.* preferences),
- and enabling remote process.
-*/
-function setupTest(cont) {
- SpecialPowers.addPermission("browser", true, document);
- SpecialPowers.pushPrefEnv({"set": prefs}, cont);
-}
-
-function execTest() {
- /*
- Creating two iframes that mimics the attention screen behavior on the
- device:
- - the 'dialer' iframe is the attention screen you have when a call is
- in place. it is a green bar, so we copy it as green here too
- - the 'apps' iframe mimics another application that is being run, be it
- dialer, sms, ..., anything that the user might want to trigger during
- a call
-
- The bug we intent to reproduce here is that in this case, if the user taps
- onto the top of the 'apps', the event fluffing code will in fact redirect
- the event to the 'dialer' iframe. In practice, this is bug 921928 where
- during a call the user wants to place a second call, and while typing the
- phone number, wants to tap onto the 'delete' key to erase a digit, but ends
- tapping and activating the dialer.
- */
- var dialer = document.createElement('iframe');
- dialer.id = 'dialer';
- dialer.src = '';
- // Force OOP
- dialer.setAttribute('mozbrowser', 'true');
- dialer.setAttribute('remote', 'true');
- document.body.appendChild(dialer);
-
- var apps = document.createElement('iframe');
- apps.id = 'apps';
- apps.src = 'bug921928_event_target_iframe_apps_oop.html';
- // Force OOP
- apps.setAttribute('mozbrowser', 'true');
- apps.setAttribute('remote', 'true');
- document.body.appendChild(apps);
-
- var handleEvent = function(event) {
- eventTarget = event.target;
-
- // We draw a small red div to show where the event has tapped
- var hit = document.createElement('div');
- hit.style.left = (event.clientX - 1.5) + 'px';
- hit.style.top = (event.clientY - 1.5) + 'px';
- hit.classList.add('hit');
- debugHit.push(hit);
- };
-
- // In real life, the 'dialer' has a 'mousedown', so we mimic one too,
- // to reproduce the same behavior
- dialer.addEventListener('mousedown', function(e) {});
-
- // This event listener is just here to record what iframe has been hit,
- // and sets the 'eventTarget' to the iframe's id value so that the
- // testMouseClick() code can correctly check. We cannot add it on the
- // 'apps' otherwise it will alter the behavior of the test.
- document.addEventListener('mousedown', handleEvent);
-
- // In the following, the coordinates are relative to the iframe
-
- // First, we check that tapping onto the 'dialer' correctly triggers the
- // dialer.
- testMouseClick("dialer", 20, 1, "dialer", "correct hit on dialer with mouse input");
- testMouseClick("dialer", 20, 1, "dialer", "correct hit on dialer with touch input", {
- inputSource: MouseEvent.MOZ_SOURCE_TOUCH
- });
-
- // Now this is it: we tap inside 'apps', but very close to the border between
- // 'apps' and 'dialer'. Without the fix from this bug, this test will fail.
- testMouseClick("apps", 20, 1, "apps", "apps <iframe mozbrowser remote> hit for mouse input");
- testMouseClick("apps", 20, 1, "apps", "apps <iframe mozbrowser remote> hit for touch input", {
- inputSource: MouseEvent.MOZ_SOURCE_TOUCH
- });
-
- // Show small red spots of where the click happened
- // showDebug();
-
- endTest();
-}
-
-function runTest() {
- setupTest(execTest);
-}
-
-addEventListener('load', function() { SimpleTest.executeSoon(runTest); });
-</script>
-</body>
-</html>
diff --git a/layout/build/components.conf b/layout/build/components.conf
index 0239a7c85c..eb834a20a1 100644
--- a/layout/build/components.conf
+++ b/layout/build/components.conf
@@ -150,16 +150,6 @@ Classes = [
'headers': ['nsStructuredCloneContainer.h'],
},
{
- 'js_name': 'DOMRequest',
- 'cid': '{3160e271-138d-4cc7-9d63-6429f16957c7}',
- 'contract_ids': ['@mozilla.org/dom/dom-request-service;1'],
- 'interfaces': ['nsIDOMRequestService'],
- 'singleton': True,
- 'type': 'mozilla::dom::DOMRequestService',
- 'headers': ['mozilla/dom/DOMRequest.h'],
- 'constructor': 'mozilla::dom::DOMRequestService::FactoryCreate',
- },
- {
'js_name': 'domStorageManager',
'cid': '{656db07c-aa80-49e4-bce8-e431baae697d}',
'contract_ids': ['@mozilla.org/dom/localStorage-manager;1'],
diff --git a/layout/build/moz.build b/layout/build/moz.build
index b2059e396e..9135208edb 100644
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -6,7 +6,6 @@
EXPORTS += [
"nsContentDLF.h",
- "nsLayoutCID.h",
"nsLayoutStatics.h",
]
diff --git a/layout/build/nsContentDLF.cpp b/layout/build/nsContentDLF.cpp
index a9234099b0..fac598b68a 100644
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -16,7 +16,6 @@
#include "mozilla/dom/Document.h"
#include "nsNodeInfoManager.h"
#include "nsString.h"
-#include "nsContentCID.h"
#include "nsNetUtil.h"
#include "nsCRT.h"
#include "nsIViewSourceChannel.h"
diff --git a/layout/build/nsLayoutCID.h b/layout/build/nsLayoutCID.h
deleted file mode 100644
index 9805225fd2..0000000000
--- a/layout/build/nsLayoutCID.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef nsLayoutCID_h__
-#define nsLayoutCID_h__
-
-// {1691E1F4-EE41-11d4-9885-00C04FA0CF4B}
-#define NS_FRAMETRAVERSAL_CID \
- { \
- 0x1691e1f4, 0xee41, 0x11d4, { \
- 0x98, 0x85, 0x0, 0xc0, 0x4f, 0xa0, 0xcf, 0x4b \
- } \
- }
-
-/* a6cf90f9-15b3-11d2-932e-00805f8add32 */
-#define NS_LAYOUT_DEBUGGER_CID \
- { \
- 0xa6cf90f9, 0x15b3, 0x11d2, { \
- 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 \
- } \
- }
-
-// {2fe88332-31c6-4829-b247-a07d8a73e80f}
-#define NS_CANVASRENDERINGCONTEXTWEBGL_CID \
- { \
- 0x2fe88332, 0x31c6, 0x4829, { \
- 0xb2, 0x47, 0xa0, 0x7d, 0x8a, 0x7e, 0xe8, 0x0fe \
- } \
- }
-
-// {ae2793c0-2ba3-4adb-9c5e-c23525812c64}
-#define NS_SDBCONNECTION_CID \
- { \
- 0xae2793c0, 0x2ba3, 0x4adb, { \
- 0x9c, 0x5e, 0xc2, 0x35, 0x25, 0x81, 0x2c, 0x64 \
- } \
- }
-
-// {656DB07C-AA80-49e4-BCE8-E431BAAE697D}
-#define NS_DOMLOCALSTORAGEMANAGER_CID \
- { \
- 0x656db07c, 0xaa80, 0x49e4, { \
- 0xbc, 0xe8, 0xe4, 0x31, 0xba, 0xae, 0x69, 0x7d \
- } \
- }
-
-// {93ad72a6-02cd-4716-9626-d47d5ec275ec}
-#define NS_DOMJSON_CID \
- { \
- 0x93ad72a6, 0x02cd, 0x4716, { \
- 0x96, 0x26, 0xd4, 0x7d, 0x5e, 0xc2, 0x75, 0xec \
- } \
- }
-
-// {CF7FD51F-ABA2-44C1-9FF0-11F7508EFCD4}
-#define NS_FOCUSMANAGER_CID \
- { \
- 0xcf7fd51f, 0xaba2, 0x44c1, { \
- 0x9f, 0xf0, 0x11, 0xf7, 0x50, 0x8e, 0xfc, 0xd4 \
- } \
- }
-
-// {3160e271-138d-4cc7-9d63-6429f16957c7}
-#define DOMREQUEST_SERVICE_CID \
- { \
- 0x3160e271, 0x138d, 0x4cc7, { \
- 0x9d, 0x63, 0x64, 0x29, 0xf1, 0x69, 0x57, 0xc7 \
- } \
- }
-
-// {5a75c25a-5e7e-4d90-8f7c-07eb15cc0aa8}
-#define QUOTAMANAGER_SERVICE_CID \
- { \
- 0x5a75c25a, 0x5e7e, 0x4d90, { \
- 0x8f, 0x7c, 0x07, 0xeb, 0x15, 0xcc, 0x0a, 0xa8 \
- } \
- }
-
-// {c74bde32-bcc7-4840-8430-c733351b212a}
-#define SERVICEWORKERMANAGER_CID \
- { \
- 0xc74bde32, 0xbcc7, 0x4840, { \
- 0x84, 0x30, 0xc7, 0x33, 0x35, 0x1b, 0x21, 0x2a \
- } \
- }
-
-// {69da374a-fda3-4a93-9fbc-d9304f66a7fe}
-#define STORAGEACTIVITYSERVICE_CID \
- { \
- 0x69da374a, 0xfda3, 0x4a93, { \
- 0x9f, 0xbc, 0xd9, 0x30, 0x4f, 0x66, 0xa7, 0xfe \
- } \
- }
-
-#define NOTIFICATIONTELEMETRYSERVICE_CID \
- { \
- 0x5995b782, 0x6a0e, 0x4066, { \
- 0xaa, 0xc5, 0x27, 0x6f, 0x0a, 0x9a, 0xd8, 0xcf \
- } \
- }
-
-#endif /* nsLayoutCID_h__ */
diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp
index 542785f156..93a1c1a329 100644
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -13,7 +13,6 @@
#include "mozilla/ModuleUtils.h"
#include "nsImageModule.h"
#include "nsLayoutStatics.h"
-#include "nsContentCID.h"
#include "nsContentDLF.h"
#include "nsContentPolicyUtils.h"
#include "nsDataDocumentContentPolicy.h"
@@ -27,7 +26,6 @@
#include "nsPlainTextSerializer.h"
#include "nsXMLContentSerializer.h"
#include "nsXHTMLContentSerializer.h"
-#include "nsLayoutCID.h"
#include "nsFocusManager.h"
#include "ThirdPartyUtil.h"
#include "gfxPlatform.h"
diff --git a/layout/forms/HTMLSelectEventListener.cpp b/layout/forms/HTMLSelectEventListener.cpp
index 4f6b1e3561..8c74c57cc0 100644
--- a/layout/forms/HTMLSelectEventListener.cpp
+++ b/layout/forms/HTMLSelectEventListener.cpp
@@ -40,7 +40,7 @@ static bool IsOptionInteractivelySelectable(HTMLSelectElement& aSelect,
// options in a display: contents subtree interactively.
// test_select_key_navigation_bug1498769.html tests for this and should
// probably be changed (and this loop removed) or alternatively
- // SelectChild.jsm should be changed to match it.
+ // SelectChild.sys.mjs should be changed to match it.
for (Element* el = &aOption; el && el != &aSelect;
el = el->GetParentElement()) {
if (Servo_Element_IsDisplayContents(el)) {
diff --git a/layout/forms/crashtests/crashtests.list b/layout/forms/crashtests/crashtests.list
index da43270ba6..5bc0fa7746 100644
--- a/layout/forms/crashtests/crashtests.list
+++ b/layout/forms/crashtests/crashtests.list
@@ -68,7 +68,7 @@ load 1405830.html
load 1418477.html
load 1432853.html
asserts(1-4) load 1460787-1.html
-load 1464165-1.html
+asserts(1-4) load 1464165-1.html # Big sizes.
load 1471157.html
load 1488219.html
load 1600207.html
diff --git a/layout/forms/moz.build b/layout/forms/moz.build
index 838a17bf92..93ec0a430c 100644
--- a/layout/forms/moz.build
+++ b/layout/forms/moz.build
@@ -19,7 +19,6 @@ EXPORTS += [
UNIFIED_SOURCES += [
"HTMLSelectEventListener.cpp",
"ListMutationObserver.cpp",
- "nsButtonFrameRenderer.cpp",
"nsCheckboxRadioFrame.cpp",
"nsColorControlFrame.cpp",
"nsComboboxControlFrame.cpp",
diff --git a/layout/forms/nsButtonFrameRenderer.cpp b/layout/forms/nsButtonFrameRenderer.cpp
deleted file mode 100644
index 598610cf72..0000000000
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ /dev/null
@@ -1,471 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-#include "nsButtonFrameRenderer.h"
-#include "nsCSSRendering.h"
-#include "nsPresContext.h"
-#include "nsPresContextInlines.h"
-#include "nsGkAtoms.h"
-#include "nsCSSPseudoElements.h"
-#include "nsNameSpaceManager.h"
-#include "mozilla/ServoStyleSet.h"
-#include "mozilla/Unused.h"
-#include "nsDisplayList.h"
-#include "nsITheme.h"
-#include "nsIFrame.h"
-#include "mozilla/dom/Element.h"
-
-#include "gfxUtils.h"
-#include "mozilla/layers/RenderRootStateManager.h"
-
-using namespace mozilla;
-using namespace mozilla::image;
-using namespace mozilla::layers;
-
-namespace mozilla {
-class nsDisplayButtonBoxShadowOuter;
-class nsDisplayButtonBorder;
-class nsDisplayButtonForeground;
-} // namespace mozilla
-
-nsButtonFrameRenderer::nsButtonFrameRenderer() : mFrame(nullptr) {
- MOZ_COUNT_CTOR(nsButtonFrameRenderer);
-}
-
-nsButtonFrameRenderer::~nsButtonFrameRenderer() {
- MOZ_COUNT_DTOR(nsButtonFrameRenderer);
-}
-
-void nsButtonFrameRenderer::SetFrame(nsIFrame* aFrame,
- nsPresContext* aPresContext) {
- mFrame = aFrame;
- ReResolveStyles(aPresContext);
-}
-
-nsIFrame* nsButtonFrameRenderer::GetFrame() { return mFrame; }
-
-void nsButtonFrameRenderer::SetDisabled(bool aDisabled, bool aNotify) {
- dom::Element* element = mFrame->GetContent()->AsElement();
- if (aDisabled)
- element->SetAttr(kNameSpaceID_None, nsGkAtoms::disabled, u""_ns, aNotify);
- else
- element->UnsetAttr(kNameSpaceID_None, nsGkAtoms::disabled, aNotify);
-}
-
-bool nsButtonFrameRenderer::isDisabled() {
- return mFrame->GetContent()->AsElement()->IsDisabled();
-}
-
-nsresult nsButtonFrameRenderer::DisplayButton(nsDisplayListBuilder* aBuilder,
- nsDisplayList* aBackground,
- nsDisplayList* aForeground) {
- if (!mFrame->StyleEffects()->mBoxShadow.IsEmpty()) {
- aBackground->AppendNewToTop<nsDisplayButtonBoxShadowOuter>(aBuilder,
- GetFrame());
- }
-
- nsRect buttonRect =
- mFrame->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(mFrame);
-
- const AppendedBackgroundType result =
- nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
- aBuilder, mFrame, buttonRect, aBackground);
- if (result == AppendedBackgroundType::None) {
- aBuilder->BuildCompositorHitTestInfoIfNeeded(GetFrame(), aBackground);
- }
-
- aBackground->AppendNewToTop<nsDisplayButtonBorder>(aBuilder, GetFrame(),
- this);
-
- // Only display focus rings if we actually have them. Since at most one
- // button would normally display a focus ring, most buttons won't have them.
- if (mInnerFocusStyle && mInnerFocusStyle->StyleBorder()->HasBorder() &&
- mFrame->IsThemed() &&
- mFrame->PresContext()->Theme()->ThemeWantsButtonInnerFocusRing()) {
- aForeground->AppendNewToTop<nsDisplayButtonForeground>(aBuilder, GetFrame(),
- this);
- }
- return NS_OK;
-}
-
-void nsButtonFrameRenderer::GetButtonInnerFocusRect(const nsRect& aRect,
- nsRect& aResult) {
- aResult = aRect;
- aResult.Deflate(mFrame->GetUsedBorderAndPadding());
-
- if (mInnerFocusStyle) {
- nsMargin innerFocusPadding(0, 0, 0, 0);
- mInnerFocusStyle->StylePadding()->GetPadding(innerFocusPadding);
-
- nsMargin framePadding = mFrame->GetUsedPadding();
-
- innerFocusPadding.top = std::min(innerFocusPadding.top, framePadding.top);
- innerFocusPadding.right =
- std::min(innerFocusPadding.right, framePadding.right);
- innerFocusPadding.bottom =
- std::min(innerFocusPadding.bottom, framePadding.bottom);
- innerFocusPadding.left =
- std::min(innerFocusPadding.left, framePadding.left);
-
- aResult.Inflate(innerFocusPadding);
- }
-}
-
-ImgDrawResult nsButtonFrameRenderer::PaintInnerFocusBorder(
- nsDisplayListBuilder* aBuilder, nsPresContext* aPresContext,
- gfxContext& aRenderingContext, const nsRect& aDirtyRect,
- const nsRect& aRect) {
- // we draw the -moz-focus-inner border just inside the button's
- // normal border and padding, to match Windows themes.
-
- nsRect rect;
-
- PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
- ? PaintBorderFlags::SyncDecodeImages
- : PaintBorderFlags();
-
- ImgDrawResult result = ImgDrawResult::SUCCESS;
-
- if (mInnerFocusStyle) {
- GetButtonInnerFocusRect(aRect, rect);
-
- result &=
- nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
- aDirtyRect, rect, mInnerFocusStyle, flags);
- }
-
- return result;
-}
-
-Maybe<nsCSSBorderRenderer>
-nsButtonFrameRenderer::CreateInnerFocusBorderRenderer(
- nsDisplayListBuilder* aBuilder, nsPresContext* aPresContext,
- gfxContext* aRenderingContext, const nsRect& aDirtyRect,
- const nsRect& aRect, bool* aBorderIsEmpty) {
- if (mInnerFocusStyle) {
- nsRect rect;
- GetButtonInnerFocusRect(aRect, rect);
-
- gfx::DrawTarget* dt =
- aRenderingContext ? aRenderingContext->GetDrawTarget() : nullptr;
- return nsCSSRendering::CreateBorderRenderer(
- aPresContext, dt, mFrame, aDirtyRect, rect, mInnerFocusStyle,
- aBorderIsEmpty);
- }
-
- return Nothing();
-}
-
-ImgDrawResult nsButtonFrameRenderer::PaintBorder(nsDisplayListBuilder* aBuilder,
- nsPresContext* aPresContext,
- gfxContext& aRenderingContext,
- const nsRect& aDirtyRect,
- const nsRect& aRect) {
- // get the button rect this is inside the focus and outline rects
- nsRect buttonRect = aRect;
- ComputedStyle* context = mFrame->Style();
-
- PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
- ? PaintBorderFlags::SyncDecodeImages
- : PaintBorderFlags();
-
- nsCSSRendering::PaintBoxShadowInner(aPresContext, aRenderingContext, mFrame,
- buttonRect);
-
- ImgDrawResult result =
- nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
- aDirtyRect, buttonRect, context, borderFlags);
-
- return result;
-}
-
-/**
- * Call this when styles change
- */
-void nsButtonFrameRenderer::ReResolveStyles(nsPresContext* aPresContext) {
- // get all the styles
- ServoStyleSet* styleSet = aPresContext->StyleSet();
-
- // get styles assigned to -moz-focus-inner (ie dotted border on Windows)
- mInnerFocusStyle = styleSet->ProbePseudoElementStyle(
- *mFrame->GetContent()->AsElement(), PseudoStyleType::mozFocusInner,
- nullptr, mFrame->Style());
-}
-
-ComputedStyle* nsButtonFrameRenderer::GetComputedStyle(int32_t aIndex) const {
- switch (aIndex) {
- case NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX:
- return mInnerFocusStyle;
- default:
- return nullptr;
- }
-}
-
-void nsButtonFrameRenderer::SetComputedStyle(int32_t aIndex,
- ComputedStyle* aComputedStyle) {
- switch (aIndex) {
- case NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX:
- mInnerFocusStyle = aComputedStyle;
- break;
- }
-}
-
-namespace mozilla {
-
-class nsDisplayButtonBoxShadowOuter : public nsPaintedDisplayItem {
- public:
- nsDisplayButtonBoxShadowOuter(nsDisplayListBuilder* aBuilder,
- nsIFrame* aFrame)
- : nsPaintedDisplayItem(aBuilder, aFrame) {
- MOZ_COUNT_CTOR(nsDisplayButtonBoxShadowOuter);
- }
- MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayButtonBoxShadowOuter)
-
- virtual bool CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) override;
-
- bool CanBuildWebRenderDisplayItems();
-
- virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
- virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
- bool* aSnap) const override;
- NS_DISPLAY_DECL_NAME("ButtonBoxShadowOuter", TYPE_BUTTON_BOX_SHADOW_OUTER)
-};
-
-nsRect nsDisplayButtonBoxShadowOuter::GetBounds(nsDisplayListBuilder* aBuilder,
- bool* aSnap) const {
- *aSnap = false;
- return mFrame->InkOverflowRectRelativeToSelf() + ToReferenceFrame();
-}
-
-void nsDisplayButtonBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder,
- gfxContext* aCtx) {
- nsRect frameRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
-
- nsCSSRendering::PaintBoxShadowOuter(mFrame->PresContext(), *aCtx, mFrame,
- frameRect, GetPaintRect(aBuilder, aCtx));
-}
-
-bool nsDisplayButtonBoxShadowOuter::CanBuildWebRenderDisplayItems() {
- // FIXME(emilio): Is this right? That doesn't make much sense.
- if (mFrame->StyleEffects()->mBoxShadow.IsEmpty()) {
- return false;
- }
-
- bool hasBorderRadius;
- bool nativeTheme =
- nsCSSRendering::HasBoxShadowNativeTheme(mFrame, hasBorderRadius);
-
- // We don't support native themed things yet like box shadows around
- // input buttons.
- return !nativeTheme;
-}
-
-bool nsDisplayButtonBoxShadowOuter::CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) {
- if (!CanBuildWebRenderDisplayItems()) {
- return false;
- }
- int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
- nsRect shadowRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
- LayoutDeviceRect deviceBox =
- LayoutDeviceRect::FromAppUnits(shadowRect, appUnitsPerDevPixel);
- wr::LayoutRect deviceBoxRect = wr::ToLayoutRect(deviceBox);
-
- bool dummy;
- LayoutDeviceRect clipRect = LayoutDeviceRect::FromAppUnits(
- GetBounds(aDisplayListBuilder, &dummy), appUnitsPerDevPixel);
- wr::LayoutRect deviceClipRect = wr::ToLayoutRect(clipRect);
-
- bool hasBorderRadius;
- Unused << nsCSSRendering::HasBoxShadowNativeTheme(mFrame, hasBorderRadius);
-
- LayoutDeviceSize zeroSize;
- wr::BorderRadius borderRadius =
- wr::ToBorderRadius(zeroSize, zeroSize, zeroSize, zeroSize);
- if (hasBorderRadius) {
- gfx::RectCornerRadii borderRadii;
- hasBorderRadius = nsCSSRendering::GetBorderRadii(shadowRect, shadowRect,
- mFrame, borderRadii);
- if (hasBorderRadius) {
- borderRadius = wr::ToBorderRadius(borderRadii);
- }
- }
-
- const Span<const StyleBoxShadow> shadows =
- mFrame->StyleEffects()->mBoxShadow.AsSpan();
- MOZ_ASSERT(!shadows.IsEmpty());
-
- for (const StyleBoxShadow& shadow : Reversed(shadows)) {
- if (shadow.inset) {
- continue;
- }
- float blurRadius =
- float(shadow.base.blur.ToAppUnits()) / float(appUnitsPerDevPixel);
- gfx::DeviceColor shadowColor =
- ToDeviceColor(nsCSSRendering::GetShadowColor(shadow.base, mFrame, 1.0));
-
- LayoutDevicePoint shadowOffset = LayoutDevicePoint::FromAppUnits(
- nsPoint(shadow.base.horizontal.ToAppUnits(),
- shadow.base.vertical.ToAppUnits()),
- appUnitsPerDevPixel);
-
- float spreadRadius =
- float(shadow.spread.ToAppUnits()) / float(appUnitsPerDevPixel);
-
- aBuilder.PushBoxShadow(deviceBoxRect, deviceClipRect, !BackfaceIsHidden(),
- deviceBoxRect, wr::ToLayoutVector2D(shadowOffset),
- wr::ToColorF(shadowColor), blurRadius, spreadRadius,
- borderRadius, wr::BoxShadowClipMode::Outset);
- }
- return true;
-}
-
-class nsDisplayButtonBorder final : public nsPaintedDisplayItem {
- public:
- nsDisplayButtonBorder(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
- nsButtonFrameRenderer* aRenderer)
- : nsPaintedDisplayItem(aBuilder, aFrame), mBFR(aRenderer) {
- MOZ_COUNT_CTOR(nsDisplayButtonBorder);
- }
- MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayButtonBorder)
-
- virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
- HitTestState* aState,
- nsTArray<nsIFrame*>* aOutFrames) override {
- aOutFrames->AppendElement(mFrame);
- }
- virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
- virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
- bool* aSnap) const override;
- virtual bool CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) override;
- NS_DISPLAY_DECL_NAME("ButtonBorderBackground", TYPE_BUTTON_BORDER_BACKGROUND)
- private:
- nsButtonFrameRenderer* mBFR;
-};
-
-bool nsDisplayButtonBorder::CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) {
- // This is really a combination of paint box shadow inner +
- // paint border.
- aBuilder.StartGroup(this);
- const nsRect buttonRect = nsRect(ToReferenceFrame(), mFrame->GetSize());
- bool snap;
- nsRect visible = GetBounds(aDisplayListBuilder, &snap);
- nsDisplayBoxShadowInner::CreateInsetBoxShadowWebRenderCommands(
- aBuilder, aSc, visible, mFrame, buttonRect);
-
- bool borderIsEmpty = false;
- Maybe<nsCSSBorderRenderer> br = nsCSSRendering::CreateBorderRenderer(
- mFrame->PresContext(), nullptr, mFrame, nsRect(),
- nsRect(ToReferenceFrame(), mFrame->GetSize()), mFrame->Style(),
- &borderIsEmpty, mFrame->GetSkipSides());
- if (!br) {
- if (borderIsEmpty) {
- aBuilder.FinishGroup();
- } else {
- aBuilder.CancelGroup(true);
- }
-
- return borderIsEmpty;
- }
-
- br->CreateWebRenderCommands(this, aBuilder, aResources, aSc);
- aBuilder.FinishGroup();
- return true;
-}
-
-void nsDisplayButtonBorder::Paint(nsDisplayListBuilder* aBuilder,
- gfxContext* aCtx) {
- NS_ASSERTION(mFrame, "No frame?");
- nsPresContext* pc = mFrame->PresContext();
- nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
-
- // draw the border and background inside the focus and outline borders
- Unused << mBFR->PaintBorder(aBuilder, pc, *aCtx, GetPaintRect(aBuilder, aCtx),
- r);
-}
-
-nsRect nsDisplayButtonBorder::GetBounds(nsDisplayListBuilder* aBuilder,
- bool* aSnap) const {
- *aSnap = false;
- return aBuilder->IsForEventDelivery()
- ? nsRect(ToReferenceFrame(), mFrame->GetSize())
- : mFrame->InkOverflowRectRelativeToSelf() + ToReferenceFrame();
-}
-
-class nsDisplayButtonForeground final : public nsPaintedDisplayItem {
- public:
- nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
- nsButtonFrameRenderer* aRenderer)
- : nsPaintedDisplayItem(aBuilder, aFrame), mBFR(aRenderer) {
- MOZ_COUNT_CTOR(nsDisplayButtonForeground);
- }
- MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayButtonForeground)
-
- void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
- bool CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) override;
- NS_DISPLAY_DECL_NAME("ButtonForeground", TYPE_BUTTON_FOREGROUND)
- private:
- nsButtonFrameRenderer* mBFR;
-};
-
-void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
- gfxContext* aCtx) {
- nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
-
- // Draw the -moz-focus-inner border
- Unused << mBFR->PaintInnerFocusBorder(aBuilder, mFrame->PresContext(), *aCtx,
- GetPaintRect(aBuilder, aCtx), r);
-}
-
-bool nsDisplayButtonForeground::CreateWebRenderCommands(
- mozilla::wr::DisplayListBuilder& aBuilder,
- mozilla::wr::IpcResourceUpdateQueue& aResources,
- const StackingContextHelper& aSc,
- mozilla::layers::RenderRootStateManager* aManager,
- nsDisplayListBuilder* aDisplayListBuilder) {
- Maybe<nsCSSBorderRenderer> br;
- bool borderIsEmpty = false;
- bool dummy;
- nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
- br = mBFR->CreateInnerFocusBorderRenderer(
- aDisplayListBuilder, mFrame->PresContext(), nullptr,
- GetBounds(aDisplayListBuilder, &dummy), r, &borderIsEmpty);
-
- if (!br) {
- return borderIsEmpty;
- }
-
- aBuilder.StartGroup(this);
- br->CreateWebRenderCommands(this, aBuilder, aResources, aSc);
- aBuilder.FinishGroup();
-
- return true;
-}
-
-} // namespace mozilla
diff --git a/layout/forms/nsButtonFrameRenderer.h b/layout/forms/nsButtonFrameRenderer.h
deleted file mode 100644
index ea5a9cdea4..0000000000
--- a/layout/forms/nsButtonFrameRenderer.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef nsButtonFrameRenderer_h___
-#define nsButtonFrameRenderer_h___
-
-#include "nsMargin.h"
-#include "nsCSSRenderingBorders.h"
-
-class gfxContext;
-class nsIFrame;
-class nsPresContext;
-struct nsRect;
-
-namespace mozilla {
-class nsDisplayList;
-class nsDisplayListBuilder;
-} // namespace mozilla
-
-#define NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX 0
-#define NS_BUTTON_RENDERER_LAST_CONTEXT_INDEX \
- NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX
-
-class nsButtonFrameRenderer {
- using nsDisplayList = mozilla::nsDisplayList;
- using nsDisplayListBuilder = mozilla::nsDisplayListBuilder;
-
- typedef mozilla::image::ImgDrawResult ImgDrawResult;
- typedef mozilla::ComputedStyle ComputedStyle;
-
- public:
- nsButtonFrameRenderer();
- ~nsButtonFrameRenderer();
-
- /**
- * Create display list items for the button
- */
- nsresult DisplayButton(nsDisplayListBuilder* aBuilder,
- nsDisplayList* aBackground,
- nsDisplayList* aForeground);
-
- ImgDrawResult PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder,
- nsPresContext* aPresContext,
- gfxContext& aRenderingContext,
- const nsRect& aDirtyRect,
- const nsRect& aRect);
-
- mozilla::Maybe<nsCSSBorderRenderer> CreateInnerFocusBorderRenderer(
- nsDisplayListBuilder* aBuilder, nsPresContext* aPresContext,
- gfxContext* aRenderingContext, const nsRect& aDirtyRect,
- const nsRect& aRect, bool* aBorderIsEmpty);
-
- ImgDrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
- nsPresContext* aPresContext,
- gfxContext& aRenderingContext,
- const nsRect& aDirtyRect, const nsRect& aRect);
-
- void SetFrame(nsIFrame* aFrame, nsPresContext* aPresContext);
-
- void SetDisabled(bool aDisabled, bool notify);
-
- bool isActive();
- bool isDisabled();
-
- void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
-
- ComputedStyle* GetComputedStyle(int32_t aIndex) const;
- void SetComputedStyle(int32_t aIndex, ComputedStyle* aComputedStyle);
- void ReResolveStyles(nsPresContext* aPresContext);
-
- nsIFrame* GetFrame();
-
- private:
- // cached style for optional inner focus outline (used on Windows).
- RefPtr<ComputedStyle> mInnerFocusStyle;
-
- nsIFrame* mFrame;
-};
-
-#endif
diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp
index a935e3c761..1d4ff15b4f 100644
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -8,25 +8,17 @@
#include "gfxContext.h"
#include "gfxUtils.h"
-#include "mozilla/gfx/2D.h"
-#include "mozilla/gfx/PathHelpers.h"
#include "nsCOMPtr.h"
#include "nsDeviceContext.h"
#include "nsFocusManager.h"
-#include "nsCheckboxRadioFrame.h"
#include "nsGkAtoms.h"
-#include "nsCSSAnonBoxes.h"
#include "nsHTMLParts.h"
#include "nsIFormControl.h"
#include "nsILayoutHistoryState.h"
-#include "nsNameSpaceManager.h"
#include "nsListControlFrame.h"
#include "nsPIDOMWindow.h"
-#include "mozilla/PresState.h"
#include "nsView.h"
#include "nsViewManager.h"
-#include "nsIContentInlines.h"
-#include "nsIDOMEventListener.h"
#include "nsISelectControlFrame.h"
#include "nsContentUtils.h"
#include "mozilla/dom/Event.h"
@@ -48,12 +40,8 @@
#include "nsTextNode.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/LookAndFeel.h"
-#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/PresShellInlines.h"
-#include "mozilla/Unused.h"
-#include "gfx2DGlue.h"
-#include "mozilla/widget/nsAutoRollup.h"
using namespace mozilla;
using namespace mozilla::gfx;
@@ -85,124 +73,17 @@ nsComboboxControlFrame* NS_NewComboboxControlFrame(PresShell* aPresShell,
NS_IMPL_FRAMEARENA_HELPERS(nsComboboxControlFrame)
-//-----------------------------------------------------------
-// Reflow Debugging Macros
-// These let us "see" how many reflow counts are happening
-//-----------------------------------------------------------
-#ifdef DO_REFLOW_COUNTER
-
-# define MAX_REFLOW_CNT 1024
-static int32_t gTotalReqs = 0;
-;
-static int32_t gTotalReflows = 0;
-;
-static int32_t gReflowControlCntRQ[MAX_REFLOW_CNT];
-static int32_t gReflowControlCnt[MAX_REFLOW_CNT];
-static int32_t gReflowInx = -1;
-
-# define REFLOW_COUNTER() \
- if (mReflowId > -1) gReflowControlCnt[mReflowId]++;
-
-# define REFLOW_COUNTER_REQUEST() \
- if (mReflowId > -1) gReflowControlCntRQ[mReflowId]++;
-
-# define REFLOW_COUNTER_DUMP(__desc) \
- if (mReflowId > -1) { \
- gTotalReqs += gReflowControlCntRQ[mReflowId]; \
- gTotalReflows += gReflowControlCnt[mReflowId]; \
- printf("** Id:%5d %s RF: %d RQ: %d %d/%d %5.2f\n", mReflowId, \
- (__desc), gReflowControlCnt[mReflowId], \
- gReflowControlCntRQ[mReflowId], gTotalReflows, gTotalReqs, \
- float(gTotalReflows) / float(gTotalReqs) * 100.0f); \
- }
-
-# define REFLOW_COUNTER_INIT() \
- if (gReflowInx < MAX_REFLOW_CNT) { \
- gReflowInx++; \
- mReflowId = gReflowInx; \
- gReflowControlCnt[mReflowId] = 0; \
- gReflowControlCntRQ[mReflowId] = 0; \
- } else { \
- mReflowId = -1; \
- }
-
-// reflow messages
-# define REFLOW_DEBUG_MSG(_msg1) printf((_msg1))
-# define REFLOW_DEBUG_MSG2(_msg1, _msg2) printf((_msg1), (_msg2))
-# define REFLOW_DEBUG_MSG3(_msg1, _msg2, _msg3) \
- printf((_msg1), (_msg2), (_msg3))
-# define REFLOW_DEBUG_MSG4(_msg1, _msg2, _msg3, _msg4) \
- printf((_msg1), (_msg2), (_msg3), (_msg4))
-
-#else //-------------
-
-# define REFLOW_COUNTER_REQUEST()
-# define REFLOW_COUNTER()
-# define REFLOW_COUNTER_DUMP(__desc)
-# define REFLOW_COUNTER_INIT()
-
-# define REFLOW_DEBUG_MSG(_msg)
-# define REFLOW_DEBUG_MSG2(_msg1, _msg2)
-# define REFLOW_DEBUG_MSG3(_msg1, _msg2, _msg3)
-# define REFLOW_DEBUG_MSG4(_msg1, _msg2, _msg3, _msg4)
-
-#endif
-
-//------------------------------------------
-// This is for being VERY noisy
-//------------------------------------------
-#ifdef DO_VERY_NOISY
-# define REFLOW_NOISY_MSG(_msg1) printf((_msg1))
-# define REFLOW_NOISY_MSG2(_msg1, _msg2) printf((_msg1), (_msg2))
-# define REFLOW_NOISY_MSG3(_msg1, _msg2, _msg3) \
- printf((_msg1), (_msg2), (_msg3))
-# define REFLOW_NOISY_MSG4(_msg1, _msg2, _msg3, _msg4) \
- printf((_msg1), (_msg2), (_msg3), (_msg4))
-#else
-# define REFLOW_NOISY_MSG(_msg)
-# define REFLOW_NOISY_MSG2(_msg1, _msg2)
-# define REFLOW_NOISY_MSG3(_msg1, _msg2, _msg3)
-# define REFLOW_NOISY_MSG4(_msg1, _msg2, _msg3, _msg4)
-#endif
-
-//------------------------------------------
-// Displays value in pixels or twips
-//------------------------------------------
-#ifdef DO_PIXELS
-# define PX(__v) __v / 15
-#else
-# define PX(__v) __v
-#endif
-
-//------------------------------------------------------
-//-- Done with macros
-//------------------------------------------------------
-
nsComboboxControlFrame::nsComboboxControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext)
- : nsBlockFrame(aStyle, aPresContext, kClassID),
- mDisplayFrame(nullptr),
- mButtonFrame(nullptr),
- mDisplayISize(0),
- mMaxDisplayISize(0),
- mRecentSelectedIndex(NS_SKIP_NOTIFY_INDEX),
- mDisplayedIndex(-1),
- mInRedisplayText(false),
- mIsOpenInParentProcess(false){REFLOW_COUNTER_INIT()}
-
- //--------------------------------------------------------------
- nsComboboxControlFrame::~nsComboboxControlFrame() {
- REFLOW_COUNTER_DUMP("nsCCF");
-}
+ : nsHTMLButtonControlFrame(aStyle, aPresContext, kClassID) {}
-//--------------------------------------------------------------
+nsComboboxControlFrame::~nsComboboxControlFrame() = default;
NS_QUERYFRAME_HEAD(nsComboboxControlFrame)
NS_QUERYFRAME_ENTRY(nsComboboxControlFrame)
- NS_QUERYFRAME_ENTRY(nsIFormControlFrame)
NS_QUERYFRAME_ENTRY(nsIAnonymousContentCreator)
NS_QUERYFRAME_ENTRY(nsISelectControlFrame)
-NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
+NS_QUERYFRAME_TAIL_INHERITING(nsHTMLButtonControlFrame)
#ifdef ACCESSIBILITY
a11y::AccType nsComboboxControlFrame::AccessibleType() {
@@ -210,66 +91,6 @@ a11y::AccType nsComboboxControlFrame::AccessibleType() {
}
#endif
-void nsComboboxControlFrame::SetFocus(bool aOn, bool aRepaint) {
- // This is needed on a temporary basis. It causes the focus
- // rect to be drawn. This is much faster than ReResolvingStyle
- // Bug 32920
- InvalidateFrame();
-}
-
-nsPoint nsComboboxControlFrame::GetCSSTransformTranslation() {
- nsIFrame* frame = this;
- bool is3DTransform = false;
- Matrix transform;
- while (frame) {
- nsIFrame* parent;
- Matrix4x4Flagged ctm = frame->GetTransformMatrix(
- ViewportType::Layout, RelativeTo{nullptr}, &parent);
- Matrix matrix;
- if (ctm.Is2D(&matrix)) {
- transform = transform * matrix;
- } else {
- is3DTransform = true;
- break;
- }
- frame = parent;
- }
- nsPoint translation;
- if (!is3DTransform && !transform.HasNonTranslation()) {
- nsPresContext* pc = PresContext();
- // To get the translation introduced only by transforms we subtract the
- // regular non-transform translation.
- nsRootPresContext* rootPC = pc->GetRootPresContext();
- if (rootPC) {
- int32_t apd = pc->AppUnitsPerDevPixel();
- translation.x = NSFloatPixelsToAppUnits(transform._31, apd);
- translation.y = NSFloatPixelsToAppUnits(transform._32, apd);
- translation -= GetOffsetToCrossDoc(rootPC->PresShell()->GetRootFrame());
- }
- }
- return translation;
-}
-
-//----------------------------------------------------------
-//
-//----------------------------------------------------------
-#ifdef DO_REFLOW_DEBUG
-static int myCounter = 0;
-
-static void printSize(char* aDesc, nscoord aSize) {
- printf(" %s: ", aDesc);
- if (aSize == NS_UNCONSTRAINEDSIZE) {
- printf("UC");
- } else {
- printf("%d", PX(aSize));
- }
-}
-#endif
-
-//-------------------------------------------------------------------
-//-- Main Reflow for the Combobox
-//-------------------------------------------------------------------
-
bool nsComboboxControlFrame::HasDropDownButton() const {
const nsStyleDisplay* disp = StyleDisplay();
// FIXME(emilio): Blink also shows this for menulist-button and such... Seems
@@ -357,7 +178,7 @@ nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
return *containISize;
}
- nscoord displayISize = mDisplayFrame->IntrinsicISizeOffsets().padding;
+ nscoord displayISize = 0;
if (!containISize && !StyleContent()->mContent.IsNone()) {
displayISize += GetLongestOptionISize(aRenderingContext);
}
@@ -408,12 +229,6 @@ void nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
// 3) Default block size of button is block size of display area
// 4) Inline size of display area is whatever is left over from our
// inline size after allocating inline size for the button.
-
- if (!mDisplayFrame) {
- NS_ERROR("Why did the frame constructor allow this to happen? Fix it!!");
- return;
- }
-
// Make sure the displayed text is the same as the selected option,
// bug 297389.
mDisplayedIndex = Select().SelectedIndex();
@@ -427,53 +242,29 @@ void nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
// Check if the theme specifies a minimum size for the dropdown button
// first.
const nscoord buttonISize = DropDownButtonISize();
- const auto borderPadding = aReflowInput.ComputedLogicalBorderPadding(wm);
const auto padding = aReflowInput.ComputedLogicalPadding(wm);
- const auto border = borderPadding - padding;
+ // We ignore inline-end-padding (by adding it to our label box size) if we
+ // have a dropdown button, so that the button aligns with the end of the
+ // padding box.
mDisplayISize = aReflowInput.ComputedISize() - buttonISize;
- mMaxDisplayISize = mDisplayISize + padding.IEnd(wm);
-
- nsBlockFrame::Reflow(aPresContext, aDesiredSize, aReflowInput, aStatus);
-
- // The button should occupy the same space as a scrollbar, and its position
- // starts from the border edge.
- if (mButtonFrame) {
- LogicalRect buttonRect(wm);
- buttonRect.IStart(wm) = borderPadding.IStart(wm) + mMaxDisplayISize;
- buttonRect.BStart(wm) = border.BStart(wm);
-
- buttonRect.ISize(wm) = buttonISize;
- buttonRect.BSize(wm) = mDisplayFrame->BSize(wm) + padding.BStartEnd(wm);
-
- const nsSize containerSize = aDesiredSize.PhysicalSize();
- mButtonFrame->SetRect(buttonRect, containerSize);
+ if (buttonISize) {
+ mDisplayISize += padding.IEnd(wm);
}
- if (!aStatus.IsInlineBreakBefore() && !aStatus.IsFullyComplete()) {
- // This frame didn't fit inside a fragmentation container. Splitting
- // a nsComboboxControlFrame makes no sense, so we override the status here.
- aStatus.Reset();
- }
+ nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowInput,
+ aStatus);
}
void nsComboboxControlFrame::Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) {
- nsBlockFrame::Init(aContent, aParent, aPrevInFlow);
+ nsHTMLButtonControlFrame::Init(aContent, aParent, aPrevInFlow);
mEventListener = new HTMLSelectEventListener(
Select(), HTMLSelectEventListener::SelectType::Combobox);
}
-#ifdef DEBUG_FRAME_DUMP
-nsresult nsComboboxControlFrame::GetFrameName(nsAString& aResult) const {
- return MakeFrameName(u"ComboboxControl"_ns, aResult);
-}
-#endif
-
-///////////////////////////////////////////////////////////////
-
nsresult nsComboboxControlFrame::RedisplaySelectedText() {
nsAutoScriptBlocker scriptBlocker;
mDisplayedIndex = Select().SelectedIndex();
@@ -494,16 +285,12 @@ nsresult nsComboboxControlFrame::RedisplayText() {
mDisplayedOptionTextOrPreview.Truncate();
}
- REFLOW_DEBUG_MSG2(
- "RedisplayText \"%s\"\n",
- NS_LossyConvertUTF16toASCII(mDisplayedOptionTextOrPreview).get());
-
// Send reflow command because the new text maybe larger
nsresult rv = NS_OK;
- if (mDisplayContent && !previousText.Equals(mDisplayedOptionTextOrPreview)) {
- // Don't call ActuallyDisplayText(true) directly here since that
- // could cause recursive frame construction. See bug 283117 and the comment
- // in HandleRedisplayTextEvent() below.
+ if (!previousText.Equals(mDisplayedOptionTextOrPreview)) {
+ // Don't call ActuallyDisplayText(true) directly here since that could cause
+ // recursive frame construction. See bug 283117 and the comment in
+ // HandleRedisplayTextEvent() below.
// Revoke outstanding events to avoid out-of-order events which could mean
// displaying the wrong text.
@@ -512,7 +299,6 @@ nsresult nsComboboxControlFrame::RedisplayText() {
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"If we happen to run our redisplay event now, we might kill "
"ourselves!");
-
mRedisplayTextEvent = new RedisplayTextEvent(this);
nsContentUtils::AddScriptRunner(mRedisplayTextEvent.get());
}
@@ -520,59 +306,37 @@ nsresult nsComboboxControlFrame::RedisplayText() {
}
void nsComboboxControlFrame::HandleRedisplayTextEvent() {
- // First, make sure that the content model is up to date and we've
- // constructed the frames for all our content in the right places.
- // Otherwise they'll end up under the wrong insertion frame when we
- // ActuallyDisplayText, since that flushes out the content sink by
- // calling SetText on a DOM node with aNotify set to true. See bug
- // 289730.
+ // First, make sure that the content model is up to date and we've constructed
+ // the frames for all our content in the right places. Otherwise they'll end
+ // up under the wrong insertion frame when we ActuallyDisplayText, since that
+ // flushes out the content sink by calling SetText on a DOM node with aNotify
+ // set to true. See bug 289730.
AutoWeakFrame weakThis(this);
PresContext()->Document()->FlushPendingNotifications(
FlushType::ContentAndNotify);
- if (!weakThis.IsAlive()) return;
-
- // Redirect frame insertions during this method (see
- // GetContentInsertionFrame()) so that any reframing that the frame
- // constructor forces upon us is inserted into the correct parent
- // (mDisplayFrame). See bug 282607.
- MOZ_ASSERT(!mInRedisplayText, "Nested RedisplayText");
- mInRedisplayText = true;
- mRedisplayTextEvent.Forget();
-
- ActuallyDisplayText(true);
if (!weakThis.IsAlive()) {
return;
}
-
- // XXXbz This should perhaps be IntrinsicDirty::None. Check.
- PresShell()->FrameNeedsReflow(mDisplayFrame,
- IntrinsicDirty::FrameAncestorsAndDescendants,
- NS_FRAME_IS_DIRTY);
-
- mInRedisplayText = false;
+ mRedisplayTextEvent.Forget();
+ ActuallyDisplayText(true);
+ // Note: `this` might be dead here.
}
void nsComboboxControlFrame::ActuallyDisplayText(bool aNotify) {
- RefPtr<nsTextNode> displayContent = mDisplayContent;
- if (mDisplayedOptionTextOrPreview.IsEmpty()) {
- // Have to use a space character of some sort for line-block-size
- // calculations to be right. Also, the space character must be zero-width
- // in order for the the inline-size calculations to be consistent between
- // size-contained comboboxes vs. empty comboboxes.
- //
- // XXXdholbert Does this space need to be "non-breaking"? I'm not sure
- // if it matters, but we previously had a comment here (added in 2002)
- // saying "Have to use a non-breaking space for line-height calculations
- // to be right". So I'll stick with a non-breaking space for now...
- static const char16_t space = 0xFEFF;
- displayContent->SetText(&space, 1, aNotify);
- } else {
- displayContent->SetText(mDisplayedOptionTextOrPreview, aNotify);
- }
-}
-
-int32_t nsComboboxControlFrame::GetIndexOfDisplayArea() {
- return mDisplayedIndex;
+ RefPtr<dom::Text> displayContent = mDisplayLabel->GetFirstChild()->AsText();
+ // Have to use a space character of some sort for line-block-size calculations
+ // to be right. Also, the space character must be zero-width in order for the
+ // inline-size calculations to be consistent between size-contained comboboxes
+ // vs. empty comboboxes.
+ //
+ // XXXdholbert Does this space need to be "non-breaking"? I'm not sure if it
+ // matters, but we previously had a comment here (added in 2002) saying "Have
+ // to use a non-breaking space for line-height calculations to be right". So
+ // I'll stick with a non-breaking space for now...
+ displayContent->SetText(mDisplayedOptionTextOrPreview.IsEmpty()
+ ? u"\ufeff"_ns
+ : mDisplayedOptionTextOrPreview,
+ aNotify);
}
bool nsComboboxControlFrame::IsDroppedDown() const {
@@ -631,53 +395,19 @@ nsresult nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
- if (mContent->AsElement()->State().HasState(dom::ElementState::DISABLED)) {
- return NS_OK;
- }
-
- // If we have style that affects how we are selected, feed event down to
- // nsIFrame::HandleEvent so that selection takes place when appropriate.
- if (IsContentDisabled()) {
- return nsBlockFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
- }
- return NS_OK;
-}
-
-nsContainerFrame* nsComboboxControlFrame::GetContentInsertionFrame() {
- return mInRedisplayText ? mDisplayFrame : nullptr;
-}
-
-void nsComboboxControlFrame::AppendDirectlyOwnedAnonBoxes(
- nsTArray<OwnedAnonBox>& aResult) {
- aResult.AppendElement(OwnedAnonBox(mDisplayFrame));
+ return nsHTMLButtonControlFrame::HandleEvent(aPresContext, aEvent,
+ aEventStatus);
}
nsresult nsComboboxControlFrame::CreateAnonymousContent(
nsTArray<ContentInfo>& aElements) {
- // The frames used to display the combo box and the button used to popup the
- // dropdown list are created through anonymous content. The dropdown list is
- // not created through anonymous content because its frame is initialized
- // specifically for the drop-down case and it is placed a special list
- // referenced through NS_COMBO_FRAME_POPUP_LIST_INDEX to keep separate from
- // the layout of the display and button.
- //
- // Note: The value attribute of the display content is set when an item is
- // selected in the dropdown list. If the content specified below does not
- // honor the value attribute than nothing will be displayed.
-
- // For now the content that is created corresponds to two input buttons. It
- // would be better to create the tag as something other than input, but then
- // there isn't any way to create a button frame since it isn't possible to set
- // the display type in CSS2 to create a button frame.
-
- // create content used for display
- // nsAtom* tag = NS_Atomize("mozcombodisplay");
-
- // Add a child text content node for the label
+ dom::Document* doc = mContent->OwnerDoc();
+ mDisplayLabel = doc->CreateHTMLElement(nsGkAtoms::label);
- nsNodeInfoManager* nimgr = mContent->NodeInfo()->NodeInfoManager();
-
- mDisplayContent = new (nimgr) nsTextNode(nimgr);
+ {
+ RefPtr<nsTextNode> text = doc->CreateEmptyTextNode();
+ mDisplayLabel->AppendChildTo(text, false, IgnoreErrors());
+ }
// set the value of the text node
mDisplayedIndex = Select().SelectedIndex();
@@ -686,14 +416,17 @@ nsresult nsComboboxControlFrame::CreateAnonymousContent(
}
ActuallyDisplayText(false);
- aElements.AppendElement(mDisplayContent);
+ aElements.AppendElement(mDisplayLabel);
if (HasDropDownButton()) {
mButtonContent = mContent->OwnerDoc()->CreateHTMLElement(nsGkAtoms::button);
- if (!mButtonContent) {
- return NS_ERROR_OUT_OF_MEMORY;
+ {
+ // This gives the button a reasonable height. This could be done via CSS
+ // instead, but relative font units like 1lh don't play very well with our
+ // font inflation implementation, so we do it this way instead.
+ RefPtr<nsTextNode> text = doc->CreateTextNode(u"\ufeff"_ns);
+ mButtonContent->AppendChildTo(text, false, IgnoreErrors());
}
-
- // make someone to listen to the button.
+ // Make someone to listen to the button.
mButtonContent->SetAttr(kNameSpaceID_None, nsGkAtoms::type, u"button"_ns,
false);
// Set tabindex="-1" so that the button is not tabbable
@@ -707,8 +440,8 @@ nsresult nsComboboxControlFrame::CreateAnonymousContent(
void nsComboboxControlFrame::AppendAnonymousContentTo(
nsTArray<nsIContent*>& aElements, uint32_t aFilter) {
- if (mDisplayContent) {
- aElements.AppendElement(mDisplayContent);
+ if (mDisplayLabel) {
+ aElements.AppendElement(mDisplayLabel);
}
if (mButtonContent) {
@@ -716,226 +449,66 @@ void nsComboboxControlFrame::AppendAnonymousContentTo(
}
}
-nsIContent* nsComboboxControlFrame::GetDisplayNode() const {
- return mDisplayContent;
-}
+namespace mozilla {
-// XXXbz this is a for-now hack. Now that display:inline-block works,
-// need to revisit this.
-class nsComboboxDisplayFrame final : public nsBlockFrame {
+class ComboboxLabelFrame final : public nsBlockFrame {
public:
- NS_DECL_FRAMEARENA_HELPERS(nsComboboxDisplayFrame)
-
- nsComboboxDisplayFrame(ComputedStyle* aStyle,
- nsComboboxControlFrame* aComboBox)
- : nsBlockFrame(aStyle, aComboBox->PresContext(), kClassID),
- mComboBox(aComboBox) {}
+ NS_DECL_QUERYFRAME
+ NS_DECL_FRAMEARENA_HELPERS(ComboboxLabelFrame)
#ifdef DEBUG_FRAME_DUMP
nsresult GetFrameName(nsAString& aResult) const final {
- return MakeFrameName(u"ComboboxDisplay"_ns, aResult);
+ return MakeFrameName(u"ComboboxLabel"_ns, aResult);
}
#endif
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
- void BuildDisplayList(nsDisplayListBuilder* aBuilder,
- const nsDisplayListSet& aLists) final;
-
- protected:
- nsComboboxControlFrame* mComboBox;
+ public:
+ ComboboxLabelFrame(ComputedStyle* aStyle, nsPresContext* aPresContext)
+ : nsBlockFrame(aStyle, aPresContext, kClassID) {}
};
-NS_IMPL_FRAMEARENA_HELPERS(nsComboboxDisplayFrame)
+NS_QUERYFRAME_HEAD(ComboboxLabelFrame)
+ NS_QUERYFRAME_ENTRY(ComboboxLabelFrame)
+NS_QUERYFRAME_TAIL_INHERITING(nsBlockFrame)
+NS_IMPL_FRAMEARENA_HELPERS(ComboboxLabelFrame)
-void nsComboboxDisplayFrame::Reflow(nsPresContext* aPresContext,
- ReflowOutput& aDesiredSize,
- const ReflowInput& aReflowInput,
- nsReflowStatus& aStatus) {
+void ComboboxLabelFrame::Reflow(nsPresContext* aPresContext,
+ ReflowOutput& aDesiredSize,
+ const ReflowInput& aReflowInput,
+ nsReflowStatus& aStatus) {
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
- MOZ_ASSERT(aReflowInput.mParentReflowInput &&
- aReflowInput.mParentReflowInput->mFrame == mComboBox,
- "Combobox's frame tree is wrong!");
- ReflowInput state(aReflowInput);
- if (state.ComputedBSize() == NS_UNCONSTRAINEDSIZE) {
- state.SetLineHeight(state.mParentReflowInput->GetLineHeight());
- }
- const WritingMode wm = aReflowInput.GetWritingMode();
- const LogicalMargin bp = state.ComputedLogicalBorderPadding(wm);
- MOZ_ASSERT(bp.BStartEnd(wm) == 0,
- "We shouldn't have border and padding in the block axis in UA!");
- nscoord inlineBp = bp.IStartEnd(wm);
- nscoord computedISize = mComboBox->mDisplayISize - inlineBp;
-
- // Other UAs ignore padding in some (but not all) platforms for (themed only)
- // comboboxes. Instead of doing that, we prevent that padding if present from
- // clipping the display text, by enforcing the display text minimum size in
- // that situation.
- const bool shouldHonorMinISize =
- mComboBox->StyleDisplay()->EffectiveAppearance() ==
- StyleAppearance::Menulist;
- if (shouldHonorMinISize) {
- computedISize = std::max(state.ComputedMinISize(), computedISize);
- // Don't let this size go over mMaxDisplayISize, since that'd be
- // observable via clientWidth / scrollWidth.
- computedISize =
- std::min(computedISize, mComboBox->mMaxDisplayISize - inlineBp);
- }
+ const nsComboboxControlFrame* combobox =
+ do_QueryFrame(GetParent()->GetParent());
+ MOZ_ASSERT(combobox, "Combobox's frame tree is wrong!");
+ MOZ_ASSERT(aReflowInput.ComputedPhysicalBorderPadding() == nsMargin(),
+ "We shouldn't have border and padding in UA!");
- state.SetComputedISize(std::max(0, computedISize));
+ ReflowInput state(aReflowInput);
+ state.SetComputedISize(combobox->mDisplayISize);
nsBlockFrame::Reflow(aPresContext, aDesiredSize, state, aStatus);
aStatus.Reset(); // this type of frame can't be split
}
-void nsComboboxDisplayFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
- const nsDisplayListSet& aLists) {
- nsDisplayListCollection set(aBuilder);
- nsBlockFrame::BuildDisplayList(aBuilder, set);
-
- // remove background items if parent frame is themed
- if (mComboBox->IsThemed()) {
- set.BorderBackground()->DeleteAll(aBuilder);
- }
-
- set.MoveTo(aLists);
-}
-
-nsIFrame* nsComboboxControlFrame::CreateFrameForDisplayNode() {
- MOZ_ASSERT(mDisplayContent);
-
- // Get PresShell
- mozilla::PresShell* ps = PresShell();
- ServoStyleSet* styleSet = ps->StyleSet();
-
- // create the ComputedStyle for the anonymous block frame and text frame
- RefPtr<ComputedStyle> computedStyle =
- styleSet->ResolveInheritingAnonymousBoxStyle(
- PseudoStyleType::mozDisplayComboboxControlFrame, mComputedStyle);
-
- RefPtr<ComputedStyle> textComputedStyle =
- styleSet->ResolveStyleForText(mDisplayContent, mComputedStyle);
-
- // Start by creating our anonymous block frame
- mDisplayFrame = new (ps) nsComboboxDisplayFrame(computedStyle, this);
- mDisplayFrame->Init(mContent, this, nullptr);
-
- // Create a text frame and put it inside the block frame
- nsIFrame* textFrame = NS_NewTextFrame(ps, textComputedStyle);
-
- // initialize the text frame
- textFrame->Init(mDisplayContent, mDisplayFrame, nullptr);
- mDisplayContent->SetPrimaryFrame(textFrame);
+} // namespace mozilla
- mDisplayFrame->SetInitialChildList(FrameChildListID::Principal,
- nsFrameList(textFrame, textFrame));
- return mDisplayFrame;
+nsIFrame* NS_NewComboboxLabelFrame(PresShell* aPresShell,
+ ComputedStyle* aStyle) {
+ return new (aPresShell)
+ ComboboxLabelFrame(aStyle, aPresShell->GetPresContext());
}
void nsComboboxControlFrame::Destroy(DestroyContext& aContext) {
// Revoke any pending RedisplayTextEvent
mRedisplayTextEvent.Revoke();
-
mEventListener->Detach();
- // Cleanup frames in popup child list
- aContext.AddAnonymousContent(mDisplayContent.forget());
+ aContext.AddAnonymousContent(mDisplayLabel.forget());
aContext.AddAnonymousContent(mButtonContent.forget());
- nsBlockFrame::Destroy(aContext);
-}
-
-const nsFrameList& nsComboboxControlFrame::GetChildList(
- ChildListID aListID) const {
- return nsBlockFrame::GetChildList(aListID);
-}
-
-void nsComboboxControlFrame::GetChildLists(nsTArray<ChildList>* aLists) const {
- nsBlockFrame::GetChildLists(aLists);
-}
-
-void nsComboboxControlFrame::SetInitialChildList(ChildListID aListID,
- nsFrameList&& aChildList) {
- for (nsIFrame* f : aChildList) {
- MOZ_ASSERT(f->GetParent() == this, "Unexpected parent");
- nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(f->GetContent());
- if (formControl &&
- formControl->ControlType() == FormControlType::ButtonButton) {
- mButtonFrame = f;
- break;
- }
- }
- nsBlockFrame::SetInitialChildList(aListID, std::move(aChildList));
-}
-
-namespace mozilla {
-
-class nsDisplayComboboxFocus : public nsPaintedDisplayItem {
- public:
- nsDisplayComboboxFocus(nsDisplayListBuilder* aBuilder,
- nsComboboxControlFrame* aFrame)
- : nsPaintedDisplayItem(aBuilder, aFrame) {
- MOZ_COUNT_CTOR(nsDisplayComboboxFocus);
- }
- MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayComboboxFocus)
-
- void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
- NS_DISPLAY_DECL_NAME("ComboboxFocus", TYPE_COMBOBOX_FOCUS)
-};
-
-void nsDisplayComboboxFocus::Paint(nsDisplayListBuilder* aBuilder,
- gfxContext* aCtx) {
- static_cast<nsComboboxControlFrame*>(mFrame)->PaintFocus(
- *aCtx->GetDrawTarget(), ToReferenceFrame());
-}
-
-} // namespace mozilla
-
-void nsComboboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
- const nsDisplayListSet& aLists) {
- if (aBuilder->IsForEventDelivery()) {
- // Don't allow children to receive events.
- // REVIEW: following old GetFrameForPoint
- DisplayBorderBackgroundOutline(aBuilder, aLists);
- } else {
- // REVIEW: Our in-flow child frames are inline-level so they will paint in
- // our content list, so we don't need to mess with layers.
- nsBlockFrame::BuildDisplayList(aBuilder, aLists);
- }
-
- // draw a focus indicator only when focus rings should be drawn
- if (Select().State().HasState(dom::ElementState::FOCUSRING) && IsThemed() &&
- PresContext()->Theme()->ThemeWantsButtonInnerFocusRing()) {
- aLists.Content()->AppendNewToTop<nsDisplayComboboxFocus>(aBuilder, this);
- }
-
- DisplaySelectionOverlay(aBuilder, aLists.Content());
-}
-
-void nsComboboxControlFrame::PaintFocus(DrawTarget& aDrawTarget, nsPoint aPt) {
- /* Do we need to do anything? */
- dom::ElementState state = mContent->AsElement()->State();
- if (state.HasState(dom::ElementState::DISABLED) ||
- !state.HasState(dom::ElementState::FOCUS)) {
- return;
- }
-
- int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
-
- nsRect clipRect = mDisplayFrame->GetRect() + aPt;
- aDrawTarget.PushClipRect(
- NSRectToSnappedRect(clipRect, appUnitsPerDevPixel, aDrawTarget));
-
- StrokeOptions strokeOptions;
- nsLayoutUtils::InitDashPattern(strokeOptions, StyleBorderStyle::Dotted);
- ColorPattern color(ToDeviceColor(StyleText()->mColor));
- nscoord onePixel = nsPresContext::CSSPixelsToAppUnits(1);
- clipRect.width -= onePixel;
- clipRect.height -= onePixel;
- Rect r = ToRect(nsLayoutUtils::RectToGfxRect(clipRect, appUnitsPerDevPixel));
- StrokeSnappedEdgesOfRect(r, aDrawTarget, color, strokeOptions);
-
- aDrawTarget.PopClip();
+ nsHTMLButtonControlFrame::Destroy(aContext);
}
//---------------------------------------------------------
@@ -960,6 +533,7 @@ nsComboboxControlFrame::OnOptionSelected(int32_t aIndex, bool aSelected) {
void nsComboboxControlFrame::FireValueChangeEvent() {
// Fire ValueChange event to indicate data value of combo box has changed
+ // FIXME(emilio): This shouldn't be exposed to content.
nsContentUtils::AddScriptRunner(new AsyncEventDispatcher(
mContent, u"ValueChange"_ns, CanBubble::eYes, ChromeOnlyDispatch::eNo));
}
diff --git a/layout/forms/nsComboboxControlFrame.h b/layout/forms/nsComboboxControlFrame.h
index e878c0ebe3..4daa636f1a 100644
--- a/layout/forms/nsComboboxControlFrame.h
+++ b/layout/forms/nsComboboxControlFrame.h
@@ -7,56 +7,30 @@
#ifndef nsComboboxControlFrame_h___
#define nsComboboxControlFrame_h___
-#ifdef DEBUG_evaughan
-// #define DEBUG_rods
-#endif
-
-#ifdef DEBUG_rods
-// #define DO_REFLOW_DEBUG
-// #define DO_REFLOW_COUNTER
-// #define DO_UNCONSTRAINED_CHECK
-// #define DO_PIXELS
-// #define DO_NEW_REFLOW
-#endif
-
-// Mark used to indicate when onchange has been fired for current combobox item
-#define NS_SKIP_NOTIFY_INDEX -2
-
#include "mozilla/Attributes.h"
-#include "nsBlockFrame.h"
#include "nsIFormControlFrame.h"
#include "nsIAnonymousContentCreator.h"
#include "nsISelectControlFrame.h"
#include "nsIRollupListener.h"
#include "nsThreadUtils.h"
-
-class nsComboboxDisplayFrame;
-class nsTextNode;
+#include "nsHTMLButtonControlFrame.h"
namespace mozilla {
class PresShell;
class HTMLSelectEventListener;
+class ComboboxLabelFrame;
namespace dom {
class HTMLSelectElement;
}
-
-namespace gfx {
-class DrawTarget;
-} // namespace gfx
} // namespace mozilla
-class nsComboboxControlFrame final : public nsBlockFrame,
- public nsIFormControlFrame,
+class nsComboboxControlFrame final : public nsHTMLButtonControlFrame,
public nsIAnonymousContentCreator,
public nsISelectControlFrame {
- using DrawTarget = mozilla::gfx::DrawTarget;
using Element = mozilla::dom::Element;
public:
- friend nsComboboxControlFrame* NS_NewComboboxControlFrame(
- mozilla::PresShell* aPresShell, ComputedStyle* aStyle);
- friend class nsComboboxDisplayFrame;
-
+ friend class mozilla::ComboboxLabelFrame;
explicit nsComboboxControlFrame(ComputedStyle* aStyle,
nsPresContext* aPresContext);
~nsComboboxControlFrame();
@@ -69,17 +43,17 @@ class nsComboboxControlFrame final : public nsBlockFrame,
void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
uint32_t aFilter) final;
- nsIContent* GetDisplayNode() const;
- nsIFrame* CreateFrameForDisplayNode();
-
#ifdef ACCESSIBILITY
mozilla::a11y::AccType AccessibleType() final;
#endif
nscoord GetMinISize(gfxContext* aRenderingContext) final;
-
nscoord GetPrefISize(gfxContext* aRenderingContext) final;
+ // We're a leaf, so we need to report ourselves as the content insertion
+ // frame.
+ nsContainerFrame* GetContentInsertionFrame() override { return this; }
+
void Reflow(nsPresContext* aCX, ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput, nsReflowStatus& aStatus) final;
@@ -88,27 +62,15 @@ class nsComboboxControlFrame final : public nsBlockFrame,
mozilla::WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) final;
- void BuildDisplayList(nsDisplayListBuilder* aBuilder,
- const nsDisplayListSet& aLists) final;
-
- void PaintFocus(DrawTarget& aDrawTarget, nsPoint aPt);
-
void Init(nsIContent* aContent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) final;
+ void Destroy(DestroyContext&) final;
#ifdef DEBUG_FRAME_DUMP
- nsresult GetFrameName(nsAString& aResult) const final;
+ nsresult GetFrameName(nsAString& aResult) const final {
+ return MakeFrameName(u"ComboboxControl"_ns, aResult);
+ }
#endif
- void Destroy(DestroyContext&) final;
-
- void SetInitialChildList(ChildListID aListID, nsFrameList&& aChildList) final;
- const nsFrameList& GetChildList(ChildListID aListID) const final;
- void GetChildLists(nsTArray<ChildList>* aLists) const final;
-
- nsContainerFrame* GetContentInsertionFrame() final;
-
- // Return the dropdown and display frame.
- void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) final;
// nsIFormControlFrame
nsresult SetFormProperty(nsAtom* aName, const nsAString& aValue) final {
@@ -116,32 +78,10 @@ class nsComboboxControlFrame final : public nsBlockFrame,
}
/**
- * Inform the control that it got (or lost) focus.
- * If it lost focus, the dropdown menu will be rolled up if needed,
- * and FireOnChange() will be called.
- * @param aOn true if got focus, false if lost focus.
- * @param aRepaint if true then force repaint (NOTE: we always force repaint
- * currently)
- * @note This method might destroy |this|.
- */
- MOZ_CAN_RUN_SCRIPT_BOUNDARY
- void SetFocus(bool aOn, bool aRepaint) final;
-
- /**
- * Return the available space before and after this frame for
- * placing the drop-down list, and the current 2D translation.
- * Note that either or both can be less than or equal to zero,
- * if both are then the drop-down should be closed.
- */
- void GetAvailableDropdownSpace(mozilla::WritingMode aWM, nscoord* aBefore,
- nscoord* aAfter,
- mozilla::LogicalPoint* aTranslation);
- int32_t GetIndexOfDisplayArea();
- /**
* @note This method might destroy |this|.
*/
+ void FireValueChangeEvent();
nsresult RedisplaySelectedText();
- int32_t UpdateRecentIndex(int32_t aIndex);
bool IsDroppedDown() const;
@@ -192,53 +132,23 @@ class nsComboboxControlFrame final : public nsBlockFrame,
nsComboboxControlFrame* mControlFrame;
};
- void CheckFireOnChange();
- void FireValueChangeEvent();
nsresult RedisplayText();
void HandleRedisplayTextEvent();
void ActuallyDisplayText(bool aNotify);
- // If our total transform to the root frame of the root document is only a 2d
- // translation then return that translation, otherwise returns (0,0).
- nsPoint GetCSSTransformTranslation();
-
mozilla::dom::HTMLSelectElement& Select() const;
void GetOptionText(uint32_t aIndex, nsAString& aText) const;
- RefPtr<nsTextNode> mDisplayContent; // Anonymous content used to display the
- // current selection
- RefPtr<Element> mButtonContent; // Anonymous content for the button
- nsContainerFrame* mDisplayFrame; // frame to display selection
- nsIFrame* mButtonFrame; // button frame
-
- // The inline size of our display area. Used by that frame's reflow
- // to size to the full inline size except the drop-marker.
- nscoord mDisplayISize;
- // The maximum inline size of our display area, which is the
- // nsComoboxControlFrame's border-box.
- //
- // Going over this would be observable via DOM APIs like client / scrollWidth.
- nscoord mMaxDisplayISize;
-
+ RefPtr<Element> mDisplayLabel; // Anonymous content for the label
+ RefPtr<Element> mButtonContent; // Anonymous content for the button
nsRevocableEventPtr<RedisplayTextEvent> mRedisplayTextEvent;
- int32_t mRecentSelectedIndex;
- int32_t mDisplayedIndex;
+ // The inline size of our display area. Used by that frame's reflow to size to
+ // the full inline size except the drop-marker.
+ nscoord mDisplayISize = 0;
+ int32_t mDisplayedIndex = -1;
nsString mDisplayedOptionTextOrPreview;
-
RefPtr<mozilla::HTMLSelectEventListener> mEventListener;
-
- // See comment in HandleRedisplayTextEvent().
- bool mInRedisplayText;
- bool mIsOpenInParentProcess;
-
- // static class data member for Bug 32920
- // only one control can be focused at a time
- static nsComboboxControlFrame* sFocused;
-
-#ifdef DO_REFLOW_COUNTER
- int32_t mReflowId;
-#endif
};
#endif
diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp
index 03781da8bd..c96b293e82 100644
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -785,11 +785,6 @@ void nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
void nsFieldSetFrame::SetInitialChildList(ChildListID aListID,
nsFrameList&& aChildList) {
nsContainerFrame::SetInitialChildList(aListID, std::move(aChildList));
- if (nsBlockFrame* legend = do_QueryFrame(GetLegend())) {
- // A rendered legend always establish a new formatting context.
- // https://html.spec.whatwg.org/multipage/rendering.html#rendered-legend
- legend->AddStateBits(NS_BLOCK_STATIC_BFC);
- }
MOZ_ASSERT(
aListID != FrameChildListID::Principal || GetInner() || GetLegend(),
"Setting principal child list should populate our inner frame "
@@ -816,11 +811,6 @@ void nsFieldSetFrame::InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
nsContainerFrame::InsertFrames(aListID, aPrevFrame, aPrevFrameLine,
std::move(aFrameList));
MOZ_ASSERT(GetLegend());
- if (nsBlockFrame* legend = do_QueryFrame(GetLegend())) {
- // A rendered legend always establish a new formatting context.
- // https://html.spec.whatwg.org/multipage/rendering.html#rendered-legend
- legend->AddStateBits(NS_BLOCK_STATIC_BFC);
- }
}
#ifdef DEBUG
diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp
index 37aa996c27..b250030e13 100644
--- a/layout/forms/nsGfxButtonControlFrame.cpp
+++ b/layout/forms/nsGfxButtonControlFrame.cpp
@@ -160,10 +160,6 @@ nsresult nsGfxButtonControlFrame::AttributeChanged(int32_t aNameSpaceID,
return rv;
}
-nsContainerFrame* nsGfxButtonControlFrame::GetContentInsertionFrame() {
- return this;
-}
-
nsresult nsGfxButtonControlFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) {
diff --git a/layout/forms/nsGfxButtonControlFrame.h b/layout/forms/nsGfxButtonControlFrame.h
index 32d4689559..38c30590ab 100644
--- a/layout/forms/nsGfxButtonControlFrame.h
+++ b/layout/forms/nsGfxButtonControlFrame.h
@@ -7,9 +7,7 @@
#ifndef nsGfxButtonControlFrame_h___
#define nsGfxButtonControlFrame_h___
-#include "mozilla/Attributes.h"
#include "nsHTMLButtonControlFrame.h"
-#include "nsCOMPtr.h"
#include "nsIAnonymousContentCreator.h"
class nsTextNode;
@@ -29,26 +27,25 @@ class nsGfxButtonControlFrame final : public nsHTMLButtonControlFrame,
void Destroy(DestroyContext&) override;
- virtual nsresult HandleEvent(nsPresContext* aPresContext,
- mozilla::WidgetGUIEvent* aEvent,
- nsEventStatus* aEventStatus) override;
+ nsresult HandleEvent(nsPresContext* aPresContext,
+ mozilla::WidgetGUIEvent* aEvent,
+ nsEventStatus* aEventStatus) override;
#ifdef DEBUG_FRAME_DUMP
- virtual nsresult GetFrameName(nsAString& aResult) const override;
+ nsresult GetFrameName(nsAString& aResult) const override;
#endif
NS_DECL_QUERYFRAME
// nsIAnonymousContentCreator
- virtual nsresult CreateAnonymousContent(
- nsTArray<ContentInfo>& aElements) override;
- virtual void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
- uint32_t aFilter) override;
+ nsresult CreateAnonymousContent(nsTArray<ContentInfo>& aElements) override;
+ void AppendAnonymousContentTo(nsTArray<nsIContent*>& aElements,
+ uint32_t aFilter) override;
- virtual nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
- int32_t aModType) override;
+ nsresult AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
+ int32_t aModType) override;
- virtual nsContainerFrame* GetContentInsertionFrame() override;
+ nsContainerFrame* GetContentInsertionFrame() override { return this; }
protected:
nsresult GetDefaultLabel(nsAString& aLabel) const;
diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp
index 7a599f093b..cb24ccbfb9 100644
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -10,15 +10,17 @@
#include "mozilla/PresShell.h"
#include "nsIFrameInlines.h"
#include "nsContainerFrame.h"
+#include "nsPresContextInlines.h"
#include "nsIFormControlFrame.h"
#include "nsPresContext.h"
#include "nsLayoutUtils.h"
#include "nsGkAtoms.h"
-#include "nsButtonFrameRenderer.h"
#include "nsDisplayList.h"
+#include "nsCSSRendering.h"
#include <algorithm>
using namespace mozilla;
+using namespace mozilla::image;
nsContainerFrame* NS_NewHTMLButtonControlFrame(PresShell* aPresShell,
ComputedStyle* aStyle) {
@@ -39,7 +41,13 @@ void nsHTMLButtonControlFrame::Init(nsIContent* aContent,
nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) {
nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
- mRenderer.SetFrame(this, PresContext());
+
+ // get all the styles
+ ServoStyleSet* styleSet = PresContext()->StyleSet();
+
+ // Get styles assigned to -moz-focus-inner (i.e. dotted border on Windows)
+ mInnerFocusStyle = styleSet->ProbePseudoElementStyle(
+ *mContent->AsElement(), PseudoStyleType::mozFocusInner, nullptr, Style());
}
NS_QUERYFRAME_HEAD(nsHTMLButtonControlFrame)
@@ -57,8 +65,8 @@ void nsHTMLButtonControlFrame::SetFocus(bool aOn, bool aRepaint) {}
nsresult nsHTMLButtonControlFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus) {
- // if disabled do nothing
- if (mRenderer.isDisabled()) {
+ if (mContent->AsElement()->IsDisabled()) {
+ // If disabled do nothing
return NS_OK;
}
@@ -67,14 +75,125 @@ nsresult nsHTMLButtonControlFrame::HandleEvent(nsPresContext* aPresContext,
return nsIFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
-bool nsHTMLButtonControlFrame::ShouldClipPaintingToBorderBox() {
+bool nsHTMLButtonControlFrame::ShouldClipPaintingToBorderBox() const {
// FIXME(emilio): probably should account for per-axis clipping...
return StyleDisplay()->mOverflowX != StyleOverflow::Visible;
}
+namespace mozilla {
+
+class nsDisplayButtonForeground final : public nsPaintedDisplayItem {
+ public:
+ nsDisplayButtonForeground(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
+ : nsPaintedDisplayItem(aBuilder, aFrame) {
+ MOZ_COUNT_CTOR(nsDisplayButtonForeground);
+ }
+ MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayButtonForeground)
+
+ void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
+ bool CreateWebRenderCommands(
+ mozilla::wr::DisplayListBuilder& aBuilder,
+ mozilla::wr::IpcResourceUpdateQueue& aResources,
+ const StackingContextHelper& aSc,
+ mozilla::layers::RenderRootStateManager* aManager,
+ nsDisplayListBuilder* aDisplayListBuilder) override;
+ NS_DISPLAY_DECL_NAME("ButtonForeground", TYPE_BUTTON_FOREGROUND)
+};
+
+void nsDisplayButtonForeground::Paint(nsDisplayListBuilder* aBuilder,
+ gfxContext* aCtx) {
+ static_cast<nsHTMLButtonControlFrame*>(mFrame)->PaintInnerFocusBorder(
+ aBuilder, *aCtx, GetPaintRect(aBuilder, aCtx),
+ nsRect(ToReferenceFrame(), mFrame->GetSize()));
+}
+
+bool nsDisplayButtonForeground::CreateWebRenderCommands(
+ mozilla::wr::DisplayListBuilder& aBuilder,
+ mozilla::wr::IpcResourceUpdateQueue& aResources,
+ const StackingContextHelper& aSc,
+ mozilla::layers::RenderRootStateManager* aManager,
+ nsDisplayListBuilder* aDisplayListBuilder) {
+ bool borderIsEmpty = false;
+ bool dummy;
+ Maybe<nsCSSBorderRenderer> br =
+ static_cast<nsHTMLButtonControlFrame*>(mFrame)
+ ->CreateInnerFocusBorderRenderer(
+ aDisplayListBuilder, nullptr,
+ GetBounds(aDisplayListBuilder, &dummy),
+ nsRect(ToReferenceFrame(), mFrame->GetSize()), &borderIsEmpty);
+
+ if (!br) {
+ return borderIsEmpty;
+ }
+
+ aBuilder.StartGroup(this);
+ br->CreateWebRenderCommands(this, aBuilder, aResources, aSc);
+ aBuilder.FinishGroup();
+
+ return true;
+}
+
+} // namespace mozilla
+
+static nsRect GetButtonInnerFocusRect(const nsIFrame* aFrame,
+ const ComputedStyle& aFocusStyle,
+ const nsRect& aRect) {
+ nsRect result = aRect;
+ result.Deflate(aFrame->GetUsedBorderAndPadding());
+
+ nsMargin innerFocusPadding;
+ aFocusStyle.StylePadding()->GetPadding(innerFocusPadding);
+
+ nsMargin framePadding = aFrame->GetUsedPadding();
+ innerFocusPadding.top = std::min(innerFocusPadding.top, framePadding.top);
+ innerFocusPadding.right =
+ std::min(innerFocusPadding.right, framePadding.right);
+ innerFocusPadding.bottom =
+ std::min(innerFocusPadding.bottom, framePadding.bottom);
+ innerFocusPadding.left = std::min(innerFocusPadding.left, framePadding.left);
+
+ result.Inflate(innerFocusPadding);
+ return result;
+}
+
+void nsHTMLButtonControlFrame::PaintInnerFocusBorder(
+ nsDisplayListBuilder* aBuilder, gfxContext& aRenderingContext,
+ const nsRect& aDirtyRect, const nsRect& aRect) {
+ if (!mInnerFocusStyle) {
+ return;
+ }
+
+ // we draw the -moz-focus-inner border just inside the button's
+ // normal border and padding, to match Windows themes.
+ PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
+ ? PaintBorderFlags::SyncDecodeImages
+ : PaintBorderFlags();
+
+ nsRect rect = GetButtonInnerFocusRect(this, *mInnerFocusStyle, aRect);
+ // We don't paint border images here, so the ImgDrawResult is useless.
+ Unused << nsCSSRendering::PaintBorder(PresContext(), aRenderingContext, this,
+ aDirtyRect, rect, mInnerFocusStyle,
+ flags);
+}
+
+Maybe<nsCSSBorderRenderer>
+nsHTMLButtonControlFrame::CreateInnerFocusBorderRenderer(
+ nsDisplayListBuilder* aBuilder, gfxContext* aRenderingContext,
+ const nsRect& aDirtyRect, const nsRect& aRect, bool* aBorderIsEmpty) {
+ if (!mInnerFocusStyle) {
+ return Nothing();
+ }
+
+ nsRect rect = GetButtonInnerFocusRect(this, *mInnerFocusStyle, aRect);
+ gfx::DrawTarget* dt =
+ aRenderingContext ? aRenderingContext->GetDrawTarget() : nullptr;
+ return nsCSSRendering::CreateBorderRenderer(PresContext(), dt, this,
+ aDirtyRect, rect,
+ mInnerFocusStyle, aBorderIsEmpty);
+}
+
void nsHTMLButtonControlFrame::BuildDisplayList(
nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists) {
- nsDisplayList onTop(aBuilder);
if (IsVisibleForPainting()) {
// Clip the button itself to its border area for event hit testing.
Maybe<DisplayListClipState::AutoSaveRestore> eventClipState;
@@ -87,11 +206,9 @@ void nsHTMLButtonControlFrame::BuildDisplayList(
rect, hasRadii ? radii : nullptr);
}
- mRenderer.DisplayButton(aBuilder, aLists.BorderBackground(), &onTop);
+ DisplayBorderBackgroundOutline(aBuilder, aLists);
}
- nsDisplayListCollection set(aBuilder);
-
{
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
@@ -100,22 +217,23 @@ void nsHTMLButtonControlFrame::BuildDisplayList(
nsRect rect(aBuilder->ToReferenceFrame(this), GetSize());
rect.Deflate(border);
nscoord radii[8];
- bool hasRadii = GetPaddingBoxBorderRadii(radii);
+ const bool hasRadii = GetPaddingBoxBorderRadii(radii);
clipState.ClipContainingBlockDescendants(rect,
hasRadii ? radii : nullptr);
}
- BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), set,
+ BuildDisplayListForChild(aBuilder, mFrames.FirstChild(), aLists,
DisplayChildFlag::ForcePseudoStackingContext);
}
- // Put the foreground outline and focus rects on top of the children
- set.Content()->AppendToTop(&onTop);
- set.MoveTo(aLists);
-
- DisplayOutline(aBuilder, aLists);
+ // Put the foreground outline on top of the children.
+ if (IsVisibleForPainting() && mInnerFocusStyle &&
+ mInnerFocusStyle->StyleBorder()->HasBorder() && IsThemed() &&
+ PresContext()->Theme()->ThemeWantsButtonInnerFocusRing()) {
+ aLists.Content()->AppendNewToTop<nsDisplayButtonForeground>(aBuilder, this);
+ }
- // to draw border when selected in editor
+ // To draw border when selected in editor
DisplaySelectionOverlay(aBuilder, aLists.Content());
}
@@ -237,12 +355,14 @@ void nsHTMLButtonControlFrame::ReflowButtonContents(
// Button has a fixed block-size -- that's its content-box bSize.
buttonContentBox.BSize(wm) = aButtonReflowInput.ComputedBSize();
} else {
- // Button is intrinsically sized -- it should shrinkwrap the
- // button-contents' bSize. But if it has size containment in block axis,
- // ignore the contents and use contain-intrinsic-block-size.
- nscoord bSize = aButtonReflowInput.mFrame->ContainIntrinsicBSize().valueOr(
- contentsDesiredSize.BSize(wm));
-
+ // Button is intrinsically sized -- it should shrinkwrap the contents'
+ // bSize.
+ // If we have size containment in block axis, ignore the contents and use
+ // contain-intrinsic-block-size. The combobox content size with no content
+ // is one line-height, not zero.
+ const Maybe<nscoord> containBSize = ContainIntrinsicBSize(
+ IsComboboxControlFrame() ? aButtonReflowInput.GetLineHeight() : 0);
+ const nscoord bSize = containBSize.valueOr(contentsDesiredSize.BSize(wm));
// Make sure we obey min/max-bSize in the case when we're doing intrinsic
// sizing (we get it for free when we have a non-intrinsic
// aButtonReflowInput.ComputedBSize()). Note that we do this before
@@ -359,12 +479,17 @@ nsresult nsHTMLButtonControlFrame::SetFormProperty(nsAtom* aName,
ComputedStyle* nsHTMLButtonControlFrame::GetAdditionalComputedStyle(
int32_t aIndex) const {
- return mRenderer.GetComputedStyle(aIndex);
+ if (aIndex == 0) {
+ return mInnerFocusStyle;
+ }
+ return nullptr;
}
void nsHTMLButtonControlFrame::SetAdditionalComputedStyle(
int32_t aIndex, ComputedStyle* aComputedStyle) {
- mRenderer.SetComputedStyle(aIndex, aComputedStyle);
+ if (aIndex == 0) {
+ mInnerFocusStyle = aComputedStyle;
+ }
}
void nsHTMLButtonControlFrame::AppendDirectlyOwnedAnonBoxes(
diff --git a/layout/forms/nsHTMLButtonControlFrame.h b/layout/forms/nsHTMLButtonControlFrame.h
index b4409d66a7..760418f954 100644
--- a/layout/forms/nsHTMLButtonControlFrame.h
+++ b/layout/forms/nsHTMLButtonControlFrame.h
@@ -7,10 +7,9 @@
#ifndef nsHTMLButtonControlFrame_h___
#define nsHTMLButtonControlFrame_h___
-#include "mozilla/Attributes.h"
#include "nsContainerFrame.h"
+#include "nsCSSRenderingBorders.h"
#include "nsIFormControlFrame.h"
-#include "nsButtonFrameRenderer.h"
class gfxContext;
class nsPresContext;
@@ -83,6 +82,14 @@ class nsHTMLButtonControlFrame : public nsContainerFrame,
// Return the ::-moz-button-content anonymous box.
void AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult) override;
+ mozilla::Maybe<nsCSSBorderRenderer> CreateInnerFocusBorderRenderer(
+ nsDisplayListBuilder* aBuilder, gfxContext* aRenderingContext,
+ const nsRect& aDirtyRect, const nsRect& aRect, bool* aBorderIsEmpty);
+
+ void PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder,
+ gfxContext& aRenderingContext,
+ const nsRect& aDirtyRect, const nsRect& aRect);
+
protected:
nsHTMLButtonControlFrame(ComputedStyle* aStyle, nsPresContext* aPresContext,
nsIFrame::ClassID aID);
@@ -90,7 +97,7 @@ class nsHTMLButtonControlFrame : public nsContainerFrame,
// Indicates whether we should clip our children's painting to our
// border-box (either because of "overflow" or because of legacy reasons
// about how <input>-flavored buttons work).
- bool ShouldClipPaintingToBorderBox();
+ bool ShouldClipPaintingToBorderBox() const;
// Reflows the button's sole child frame, and computes the desired size
// of the button itself from the results.
@@ -104,7 +111,7 @@ class nsHTMLButtonControlFrame : public nsContainerFrame,
mozilla::WritingMode aWM,
BaselineSharingGroup aBaselineGroup) const override;
- nsButtonFrameRenderer mRenderer;
+ RefPtr<mozilla::ComputedStyle> mInnerFocusStyle;
};
#endif
diff --git a/layout/forms/nsNumberControlFrame.cpp b/layout/forms/nsNumberControlFrame.cpp
index e8ed87c8f3..518ba91e24 100644
--- a/layout/forms/nsNumberControlFrame.cpp
+++ b/layout/forms/nsNumberControlFrame.cpp
@@ -64,22 +64,29 @@ nsresult nsNumberControlFrame::CreateAnonymousContent(
nsTextControlFrame::CreateAnonymousContent(aElements);
+#if defined(MOZ_WIDGET_ANDROID)
+ // We don't want spin buttons on Android
+ return NS_OK;
+#else
// The author has elected to hide the spinner by setting this
// -moz-appearance. We will reframe if it changes.
- if (StyleDisplay()->EffectiveAppearance() != StyleAppearance::Textfield) {
- // Create the ::-moz-number-spin-box pseudo-element:
- mSpinBox = MakeAnonElement(PseudoStyleType::mozNumberSpinBox);
+ if (StyleDisplay()->EffectiveAppearance() == StyleAppearance::Textfield) {
+ return NS_OK;
+ }
- // Create the ::-moz-number-spin-up pseudo-element:
- mSpinUp = MakeAnonElement(PseudoStyleType::mozNumberSpinUp, mSpinBox);
+ // Create the ::-moz-number-spin-box pseudo-element:
+ mSpinBox = MakeAnonElement(PseudoStyleType::mozNumberSpinBox);
- // Create the ::-moz-number-spin-down pseudo-element:
- mSpinDown = MakeAnonElement(PseudoStyleType::mozNumberSpinDown, mSpinBox);
+ // Create the ::-moz-number-spin-up pseudo-element:
+ mSpinUp = MakeAnonElement(PseudoStyleType::mozNumberSpinUp, mSpinBox);
- aElements.AppendElement(mSpinBox);
- }
+ // Create the ::-moz-number-spin-down pseudo-element:
+ mSpinDown = MakeAnonElement(PseudoStyleType::mozNumberSpinDown, mSpinBox);
+
+ aElements.AppendElement(mSpinBox);
return NS_OK;
+#endif
}
/* static */
diff --git a/layout/forms/test/test_bug536567_perwindowpb.html b/layout/forms/test/test_bug536567_perwindowpb.html
index 224b2c74a4..e27803157e 100644
--- a/layout/forms/test/test_bug536567_perwindowpb.html
+++ b/layout/forms/test/test_bug536567_perwindowpb.html
@@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=536567
const Cm = Components.manager;
var MockFilePicker = SpecialPowers.MockFilePicker;
-MockFilePicker.init(window);
+MockFilePicker.init(SpecialPowers.wrap(window).browsingContext);
var tmpDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
var homeDir = Services.dirsvc.get("Desk", Ci.nsIFile);
diff --git a/layout/forms/test/test_bug935876.html b/layout/forms/test/test_bug935876.html
index 4488fdf962..465fcac732 100644
--- a/layout/forms/test/test_bug935876.html
+++ b/layout/forms/test/test_bug935876.html
@@ -112,7 +112,7 @@ function runTests()
var listbox = document.getElementById("listbox");
listbox.addEventListener("keydown", onKeydown);
listbox.addEventListener("keypress", onKeypress);
- SpecialPowers.addSystemEventListener(listbox, "keydown", onkeydownInSystemEventGroup, false);
+ SpecialPowers.wrap(listbox).addEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
listbox.focus();
@@ -185,14 +185,13 @@ function runTests()
listbox.removeEventListener("keydown", onKeydown);
listbox.removeEventListener("keypress", onKeypress);
- SpecialPowers.removeSystemEventListener(listbox, "keydown", onkeydownInSystemEventGroup, false);
-
+ SpecialPowers.wrap(listbox).removeEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
var multipleListbox = document.getElementById("multipleListbox");
multipleListbox.addEventListener("keydown", onKeydown);
multipleListbox.addEventListener("keypress", onKeypress);
- SpecialPowers.addSystemEventListener(multipleListbox, "keydown", onkeydownInSystemEventGroup, false);
+ SpecialPowers.wrap(multipleListbox).addEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
multipleListbox.focus();
@@ -265,14 +264,13 @@ function runTests()
multipleListbox.removeEventListener("keydown", onKeydown);
multipleListbox.removeEventListener("keypress", onKeypress);
- SpecialPowers.removeSystemEventListener(multipleListbox, "keydown", onkeydownInSystemEventGroup, false);
-
+ SpecialPowers.wrap(multipleListbox).removeEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
var combobox = document.getElementById("combobox");
combobox.addEventListener("keydown", onKeydown);
combobox.addEventListener("keypress", onKeypress);
- SpecialPowers.addSystemEventListener(combobox, "keydown", onkeydownInSystemEventGroup, false);
+ SpecialPowers.wrap(combobox).addEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
combobox.focus();
@@ -353,7 +351,7 @@ function runTests()
{
combobox.removeEventListener("keydown", onKeydown);
combobox.removeEventListener("keypress", onKeypress);
- SpecialPowers.removeSystemEventListener(combobox, "keydown", onkeydownInSystemEventGroup, false);
+ SpecialPowers.wrap(combobox).removeEventListener("keydown", onkeydownInSystemEventGroup, { mozSystemGroup: true });
SimpleTest.finish();
}
diff --git a/layout/generic/BlockReflowState.cpp b/layout/generic/BlockReflowState.cpp
index 6163a200a3..78dab82e98 100644
--- a/layout/generic/BlockReflowState.cpp
+++ b/layout/generic/BlockReflowState.cpp
@@ -47,7 +47,8 @@ BlockReflowState::BlockReflowState(
mMinLineHeight(aReflowInput.GetLineHeight()),
mLineNumber(0),
mTrailingClearFromPIF(StyleClear::None),
- mConsumedBSize(aConsumedBSize) {
+ mConsumedBSize(aConsumedBSize),
+ mAlignContentShift(mBlock->GetAlignContentShift()) {
NS_ASSERTION(mConsumedBSize != NS_UNCONSTRAINEDSIZE,
"The consumed block-size should be constrained!");
@@ -87,8 +88,8 @@ BlockReflowState::BlockReflowState(
// the "overflow" property. When we don't have a specified style block-size,
// then we may end up limiting our block-size if the available block-size is
// constrained (this situation occurs when we are paginated).
- if (const nscoord availableBSize = aReflowInput.AvailableBSize();
- availableBSize != NS_UNCONSTRAINEDSIZE) {
+ const nscoord availableBSize = aReflowInput.AvailableBSize();
+ if (availableBSize != NS_UNCONSTRAINEDSIZE) {
// We are in a paginated situation. The block-end edge of the available
// space to reflow the children is within our block-end border and padding.
// If we're cloning our border and padding, and we're going to request
@@ -112,10 +113,34 @@ BlockReflowState::BlockReflowState(
mContentArea.IStart(wm) = mBorderPadding.IStart(wm);
mBCoord = mContentArea.BStart(wm) = mBorderPadding.BStart(wm);
+ // Account for existing cached shift, we'll re-position in AlignContent() if
+ // needed.
+ if (mAlignContentShift) {
+ mBCoord += mAlignContentShift;
+ mContentArea.BStart(wm) += mAlignContentShift;
+
+ if (availableBSize != NS_UNCONSTRAINEDSIZE) {
+ mContentArea.BSize(wm) += mAlignContentShift;
+ }
+ }
+
mPrevChild = nullptr;
mCurrentLine = aFrame->LinesEnd();
}
+void BlockReflowState::UndoAlignContentShift() {
+ if (!mAlignContentShift) {
+ return;
+ }
+
+ mBCoord -= mAlignContentShift;
+ mContentArea.BStart(mReflowInput.GetWritingMode()) -= mAlignContentShift;
+
+ if (mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE) {
+ mContentArea.BSize(mReflowInput.GetWritingMode()) -= mAlignContentShift;
+ }
+}
+
void BlockReflowState::ComputeFloatAvoidingOffsets(
nsIFrame* aFloatAvoidingBlock, const LogicalRect& aFloatAvailableSpace,
nscoord& aIStartResult, nscoord& aIEndResult) const {
diff --git a/layout/generic/BlockReflowState.h b/layout/generic/BlockReflowState.h
index 1dfaa4d9ad..6f05b6ab0a 100644
--- a/layout/generic/BlockReflowState.h
+++ b/layout/generic/BlockReflowState.h
@@ -41,16 +41,16 @@ class BlockReflowState {
mCanHaveOverflowMarkers(false) {}
// Set in the BlockReflowState constructor when reflowing a "block margin
- // root" frame (i.e. a frame with any of the NS_BLOCK_BFC_STATE_BITS flag
- // set, for which margins apply by default).
+ // root" frame (i.e. a frame with any of the NS_BLOCK_BFC flag set, for
+ // which margins apply by default).
//
// The flag is also set when reflowing a frame whose computed BStart border
// padding is non-zero.
bool mIsBStartMarginRoot : 1;
// Set in the BlockReflowState constructor when reflowing a "block margin
- // root" frame (i.e. a frame with any of the NS_BLOCK_BFC_STATE_BITS flag
- // set, for which margins apply by default).
+ // root" frame (i.e. a frame with any of the NS_BLOCK_BFC flag set, for
+ // which margins apply by default).
//
// The flag is also set when reflowing a frame whose computed BEnd border
// padding is non-zero.
@@ -102,6 +102,13 @@ class BlockReflowState {
const nscoord aInset = 0);
/**
+ * Unshifts coords, restores availableBSize to reality.
+ * (Constructor applies any cached shift before reflow
+ * so that frames are reflowed with cached shift)
+ */
+ void UndoAlignContentShift();
+
+ /**
* Get the available reflow space (the area not occupied by floats)
* for the current y coordinate. The available space is relative to
* our coordinate system, which is the content box, with (0, 0) in the
@@ -407,6 +414,11 @@ class BlockReflowState {
// continuations.
const nscoord mConsumedBSize;
+ // The amount of block-axis alignment shift to assume during reflow.
+ // Cached between reflows in the AlignContentShift property.
+ // (This system optimizes reflow for not changing the shift.)
+ nscoord mAlignContentShift;
+
// Cache the current line's BSize if nsBlockFrame::PlaceLine() fails to
// place the line. When redoing the line, it will be used to query the
// accurate float available space in AddFloat() and
diff --git a/layout/generic/FrameClasses.py b/layout/generic/FrameClasses.py
index d1d0a0b13b..36c1af10d1 100644
--- a/layout/generic/FrameClasses.py
+++ b/layout/generic/FrameClasses.py
@@ -14,6 +14,7 @@ COMMON = {
LEAF = {"Leaf"}
MATHML = {"MathML"}
SVG = {"SVG"}
+BFC = {"BlockFormattingContext"}
BLOCK = COMMON | {"CanContainOverflowContainers"}
@@ -54,18 +55,13 @@ FRAME_CLASSES = [
Frame("nsCheckboxRadioFrame", "CheckboxRadio", REPLACED_WITH_BLOCK | LEAF),
Frame("nsColorControlFrame", "ColorControl", REPLACED_WITH_BLOCK | LEAF),
Frame("nsColumnSetFrame", "ColumnSet", COMMON),
- Frame("ColumnSetWrapperFrame", "ColumnSetWrapper", BLOCK),
- Frame("nsComboboxControlFrame", "ComboboxControl", BLOCK | REPLACED_WITH_BLOCK),
- # FIXME(emilio, bug 1362907): Revisit these after that bug, this is the
- # only frame that has ReplacedContainsBlock but not Replaced, which is
- # sketchy.
- Frame(
- "nsComboboxDisplayFrame", "ComboboxDisplay", REPLACED_WITH_BLOCK - {"Replaced"}
- ),
+ Frame("ColumnSetWrapperFrame", "ColumnSetWrapper", BLOCK | BFC),
+ Frame("nsComboboxControlFrame", "ComboboxControl", REPLACED_WITH_BLOCK | LEAF),
+ Frame("ComboboxLabelFrame", "Block", BLOCK),
Frame("nsContinuingTextFrame", "Text", TEXT),
Frame("nsDateTimeControlFrame", "DateTimeControl", REPLACED_WITH_BLOCK),
Frame("nsFieldSetFrame", "FieldSet", BLOCK),
- Frame("nsFileControlFrame", "Block", REPLACED_WITH_BLOCK | LEAF),
+ Frame("nsFileControlFrame", "Block", REPLACED_WITH_BLOCK | LEAF | BFC),
Frame("FileControlLabelFrame", "Block", BLOCK | LEAF),
Frame("nsFirstLetterFrame", "Letter", INLINE),
Frame("nsFloatingFirstLetterFrame", "Letter", INLINE - {"LineParticipant"}),
@@ -84,7 +80,7 @@ FRAME_CLASSES = [
Frame("nsImageFrame", "Image", REPLACED_SIZING | {"LeafDynamic"}),
Frame("nsInlineFrame", "Inline", INLINE),
Frame("nsListControlFrame", "ListControl", REPLACED_WITH_BLOCK),
- Frame("nsMathMLmathBlockFrame", "Block", BLOCK | MATHML),
+ Frame("nsMathMLmathBlockFrame", "Block", BLOCK | MATHML | BFC),
Frame("nsMathMLmathInlineFrame", "Inline", INLINE | MATHML),
Frame("nsMathMLmencloseFrame", "None", MATHML_CONTAINER),
Frame("nsMathMLmfracFrame", "None", MATHML_CONTAINER),
@@ -120,7 +116,7 @@ FRAME_CLASSES = [
Frame("nsScrollbarButtonFrame", "SimpleXULLeaf", COMMON | LEAF),
Frame("nsScrollbarFrame", "Scrollbar", COMMON),
Frame("nsSearchControlFrame", "SearchControl", LEAF),
- Frame("nsSelectsAreaFrame", "Block", BLOCK),
+ Frame("nsSelectsAreaFrame", "Block", BLOCK | BFC),
Frame("nsPageSequenceFrame", "PageSequence", COMMON),
Frame("nsSliderFrame", "Slider", COMMON),
Frame("nsSplitterFrame", "SimpleXULLeaf", COMMON | LEAF),
diff --git a/layout/generic/ScrollAnchorContainer.cpp b/layout/generic/ScrollAnchorContainer.cpp
index 5e1d8aa56d..93336480f7 100644
--- a/layout/generic/ScrollAnchorContainer.cpp
+++ b/layout/generic/ScrollAnchorContainer.cpp
@@ -539,11 +539,8 @@ void ScrollAnchorContainer::ApplyAdjustments() {
MOZ_RELEASE_ASSERT(!mApplyingAnchorAdjustment);
// We should use AutoRestore here, but that doesn't work with bitfields
mApplyingAnchorAdjustment = true;
- Frame()->ScrollToInternal(
- Frame()->GetScrollPosition() + physicalAdjustment, ScrollMode::Instant,
- StaticPrefs::layout_css_scroll_anchoring_absolute_update()
- ? ScrollOrigin::AnchorAdjustment
- : ScrollOrigin::Relative);
+ Frame()->ScrollToInternal(Frame()->GetScrollPosition() + physicalAdjustment,
+ ScrollMode::Instant, ScrollOrigin::Relative);
mApplyingAnchorAdjustment = false;
if (Frame()->mIsRoot) {
diff --git a/layout/generic/ScrollAnimationMSDPhysics.cpp b/layout/generic/ScrollAnimationMSDPhysics.cpp
index de67f9c59a..8f0ae32d3b 100644
--- a/layout/generic/ScrollAnimationMSDPhysics.cpp
+++ b/layout/generic/ScrollAnimationMSDPhysics.cpp
@@ -5,7 +5,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ScrollAnimationMSDPhysics.h"
+#include "mozilla/Logging.h"
#include "mozilla/StaticPrefs_general.h"
+#include "mozilla/ToString.h"
+
+static mozilla::LazyLogModule sApzMsdLog("apz.msd");
+#define MSD_LOG(...) MOZ_LOG(sApzMsdLog, LogLevel::Debug, (__VA_ARGS__))
using namespace mozilla;
@@ -108,13 +113,17 @@ double ScrollAnimationMSDPhysics::ComputeSpringConstant(
}
void ScrollAnimationMSDPhysics::SimulateUntil(const TimeStamp& aTime) {
- if (!mLastSimulatedTime || aTime < mLastSimulatedTime) {
+ if (!mLastSimulatedTime || aTime <= mLastSimulatedTime) {
return;
}
TimeDuration delta = aTime - mLastSimulatedTime;
mModelX.Simulate(delta);
mModelY.Simulate(delta);
mLastSimulatedTime = aTime;
+ MSD_LOG("Simulated for duration %f, finished %d position %s velocity %s\n",
+ delta.ToMilliseconds(), IsFinished(aTime),
+ ToString(CSSPoint::FromAppUnits(PositionAt(aTime))).c_str(),
+ ToString(CSSPoint::FromAppUnits(VelocityAt(aTime))).c_str());
}
nsPoint ScrollAnimationMSDPhysics::PositionAt(const TimeStamp& aTime) {
@@ -152,6 +161,9 @@ ScrollAnimationMSDPhysics::NonOscillatingAxisPhysicsMSDModel::
ClampVelocityToMaximum(aInitialVelocity, aInitialPosition,
aInitialDestination, aSpringConstant),
aSpringConstant, aDampingRatio) {
+ MSD_LOG("Constructing axis physics model with parameters %f %f %f %f %f\n",
+ aInitialPosition, aInitialDestination, aInitialVelocity,
+ aSpringConstant, aDampingRatio);
MOZ_ASSERT(aDampingRatio >= 1.0,
"Damping ratio must be >= 1.0 to avoid oscillation");
}
diff --git a/layout/generic/ScrollOrigin.h b/layout/generic/ScrollOrigin.h
index f1ad0e3367..edffa2d4f6 100644
--- a/layout/generic/ScrollOrigin.h
+++ b/layout/generic/ScrollOrigin.h
@@ -33,8 +33,6 @@ enum class ScrollOrigin : uint8_t {
// The scroll came from an attempt by the main thread to re-clamp the scroll
// position after a reflow.
Clamp,
- // The scroll came from a scroll adjustment triggered by scroll anchoring.
- AnchorAdjustment,
// The following scroll origins also are associated with prefs of the form
// general.smoothScroll.<origin>(.*)
diff --git a/layout/generic/ScrollPositionUpdate.cpp b/layout/generic/ScrollPositionUpdate.cpp
index 9607d2d18a..a680768525 100644
--- a/layout/generic/ScrollPositionUpdate.cpp
+++ b/layout/generic/ScrollPositionUpdate.cpp
@@ -93,20 +93,6 @@ ScrollPositionUpdate ScrollPositionUpdate::NewPureRelativeScroll(
return ret;
}
-/*static*/
-ScrollPositionUpdate ScrollPositionUpdate::NewMergeableScroll(
- ScrollOrigin aOrigin, nsPoint aDestination) {
- MOZ_ASSERT(aOrigin == ScrollOrigin::AnchorAdjustment);
-
- ScrollPositionUpdate ret;
- ret.mScrollGeneration = sGenerationCounter.NewMainThreadGeneration();
- ret.mType = ScrollUpdateType::MergeableAbsolute;
- ret.mScrollMode = ScrollMode::Instant;
- ret.mScrollOrigin = aOrigin;
- ret.mDestination = CSSPoint::FromAppUnits(aDestination);
- return ret;
-}
-
bool ScrollPositionUpdate::operator==(
const ScrollPositionUpdate& aOther) const {
// instances are immutable, and all the fields are set when the generation
@@ -126,7 +112,6 @@ ScrollOrigin ScrollPositionUpdate::GetOrigin() const { return mScrollOrigin; }
CSSPoint ScrollPositionUpdate::GetDestination() const {
MOZ_ASSERT(mType == ScrollUpdateType::Absolute ||
- mType == ScrollUpdateType::MergeableAbsolute ||
mType == ScrollUpdateType::Relative);
return mDestination;
}
diff --git a/layout/generic/ScrollPositionUpdate.h b/layout/generic/ScrollPositionUpdate.h
index 0e8dc020c1..ca22da8af0 100644
--- a/layout/generic/ScrollPositionUpdate.h
+++ b/layout/generic/ScrollPositionUpdate.h
@@ -34,9 +34,6 @@ enum class ScrollUpdateType {
// The delta should be applied to whatever the current scroll position is
// on the receiver side.
PureRelative,
- // Similar to |Absolute|, but even if there's an active async scroll animation
- // the position update will NOT cancel the async scroll animation.
- MergeableAbsolute,
};
enum class ScrollTriggeredByScript : bool { No, Yes };
@@ -86,9 +83,6 @@ class ScrollPositionUpdate {
ScrollMode aMode,
const nsPoint& aDelta);
- static ScrollPositionUpdate NewMergeableScroll(ScrollOrigin aOrigin,
- nsPoint aDestination);
-
bool operator==(const ScrollPositionUpdate& aOther) const;
MainThreadScrollGeneration GetGeneration() const;
diff --git a/layout/generic/StickyScrollContainer.cpp b/layout/generic/StickyScrollContainer.cpp
index 2e9d32ab5f..416bbbf4c4 100644
--- a/layout/generic/StickyScrollContainer.cpp
+++ b/layout/generic/StickyScrollContainer.cpp
@@ -186,12 +186,17 @@ void StickyScrollContainer::ComputeStickyLimits(nsIFrame* aFrame,
// Containing block limits for the position of aFrame relative to its parent.
// The margin box of the sticky element stays within the content box of the
- // contaning-block element.
+ // containing-block element.
if (cbFrame == scrolledFrame) {
// cbFrame is the scrolledFrame, and it won't have continuations. Unlike the
- // else clause, we consider scrollable overflow rect because and the union
- // of its in-flow rects doesn't include the scrollable overflow area.
+ // else clause, we consider scrollable overflow rect because the union of
+ // its in-flow rects doesn't include the scrollable overflow area. We need
+ // to subtract the padding however, which _is_ included in the scrollable
+ // area, since we want the content box.
+ MOZ_ASSERT(cbFrame->GetUsedBorder() == nsMargin(),
+ "How did the ::-moz-scrolled-frame end up with border?");
*aContain = cbFrame->ScrollableOverflowRectRelativeToSelf();
+ aContain->Deflate(cbFrame->GetUsedPadding());
nsLayoutUtils::TransformRect(cbFrame, aFrame->GetParent(), *aContain);
} else {
*aContain = nsLayoutUtils::GetAllInFlowRectsUnion(
diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp
index f529a2268d..758b61a99b 100644
--- a/layout/generic/TextOverflow.cpp
+++ b/layout/generic/TextOverflow.cpp
@@ -29,8 +29,7 @@
using mozilla::layout::TextDrawTarget;
-namespace mozilla {
-namespace css {
+namespace mozilla::css {
class LazyReferenceRenderingDrawTargetGetterFromFrame final
: public gfxFontGroup::LazyReferenceDrawTargetGetter {
@@ -165,8 +164,7 @@ class nsDisplayTextOverflowMarker final : public nsPaintedDisplayItem {
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
bool* aSnap) const override {
*aSnap = false;
- nsRect shadowRect = nsLayoutUtils::GetTextShadowRectsUnion(mRect, mFrame);
- return mRect.Union(shadowRect);
+ return nsLayoutUtils::GetTextShadowRectsUnion(mRect, mFrame);
}
virtual nsRect GetComponentAlphaBounds(
@@ -835,9 +833,10 @@ bool TextOverflow::CanHaveOverflowMarkers(nsBlockFrame* aBlockFrame,
return false;
}
- // Skip ComboboxControlFrame because it would clip the drop-down arrow.
- // Its anon block inherits 'text-overflow' and does what is expected.
- if (aBlockFrame->IsComboboxControlFrame()) {
+ // Skip the combobox anonymous block because it would clip the drop-down
+ // arrow. The inner label inherits 'text-overflow' and does the right thing.
+ if (aBlockFrame->GetParent() &&
+ aBlockFrame->GetParent()->IsComboboxControlFrame()) {
return false;
}
@@ -932,5 +931,4 @@ void TextOverflow::Marker::SetupString(nsIFrame* aFrame) {
mInitialized = true;
}
-} // namespace css
-} // namespace mozilla
+} // namespace mozilla::css
diff --git a/layout/generic/ViewportFrame.cpp b/layout/generic/ViewportFrame.cpp
index 1837441e86..812aaa8e33 100644
--- a/layout/generic/ViewportFrame.cpp
+++ b/layout/generic/ViewportFrame.cpp
@@ -21,7 +21,6 @@
#include "nsCanvasFrame.h"
#include "nsLayoutUtils.h"
#include "nsSubDocumentFrame.h"
-#include "nsIMozBrowserFrame.h"
#include "nsPlaceholderFrame.h"
#include "MobileViewportManager.h"
diff --git a/layout/generic/WritingModes.h b/layout/generic/WritingModes.h
index 2f28b73775..e84c5e276d 100644
--- a/layout/generic/WritingModes.h
+++ b/layout/generic/WritingModes.h
@@ -62,11 +62,11 @@ constexpr auto AllLogicalSides() {
eLogicalSideIEnd);
}
-enum LogicalCorner {
- eLogicalCornerBStartIStart = 0,
- eLogicalCornerBStartIEnd = 1,
- eLogicalCornerBEndIEnd = 2,
- eLogicalCornerBEndIStart = 3
+enum class LogicalCorner : uint8_t {
+ BStartIStart,
+ BStartIEnd,
+ BEndIEnd,
+ BEndIStart,
};
// Physical axis constants.
diff --git a/layout/generic/crashtests/1140268-1.html b/layout/generic/crashtests/1140268-1.html
deleted file mode 100644
index 5e5510ba7f..0000000000
--- a/layout/generic/crashtests/1140268-1.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset=utf-8>
-<script>
-function boom()
-{
- var e = document.getElementsByTagName("mo")[0];
- e.setAttribute("style", "position: absolute; top: 0px;");
- document.documentElement.offsetHeight;
- e.setAttribute("style", "position: absolute; top: 100px;");
-}
-</script>
-</head>
-<body onload="boom();">
-<math><mo>boom!</mo></math>
-</body>
-</html>
diff --git a/layout/generic/crashtests/364686-1.xhtml b/layout/generic/crashtests/364686-1.xhtml
deleted file mode 100644
index 93a1eeaa4b..0000000000
--- a/layout/generic/crashtests/364686-1.xhtml
+++ /dev/null
@@ -1,12 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:math="http://www.w3.org/1998/Math/MathML">
-
-<body>
-
-<math:merror>
- <img/>
-</math:merror>
-
-</body>
-</html>
-
diff --git a/layout/generic/crashtests/368461-1.xhtml b/layout/generic/crashtests/368461-1.xhtml
deleted file mode 100644
index d5baccf523..0000000000
--- a/layout/generic/crashtests/368461-1.xhtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-
-<head>
-</head>
-
-<body>
-
-<p><math:msubsup><span>Foo bar baz<td></td></span></math:msubsup></p>
-
-</body>
-</html>
diff --git a/layout/generic/crashtests/370884-1.xhtml b/layout/generic/crashtests/370884-1.xhtml
deleted file mode 100644
index 3959d4b178..0000000000
--- a/layout/generic/crashtests/370884-1.xhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-</head>
-
-<body>
-
-<math:mroot>
- <div>
- <div style="position: fixed;">Y</div>
- </div>
-</math:mroot>
-
-</body>
-</html>
diff --git a/layout/generic/crashtests/382208-1.xhtml b/layout/generic/crashtests/382208-1.xhtml
deleted file mode 100644
index 5264b8845d..0000000000
--- a/layout/generic/crashtests/382208-1.xhtml
+++ /dev/null
@@ -1,7 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<body>
-
-<div><math:mfrac><math:mmultiscripts/><math:mi/></math:mfrac></div>
-
-</body>
-</html>
diff --git a/layout/generic/crashtests/382396-1.xhtml b/layout/generic/crashtests/382396-1.xhtml
deleted file mode 100644
index f334bbfdf5..0000000000
--- a/layout/generic/crashtests/382396-1.xhtml
+++ /dev/null
@@ -1,7 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<body>
-
-<p style="text-indent: 0%">a<math:ms/></p>
-
-</body>
-</html>
diff --git a/layout/generic/crashtests/385265-1.xhtml b/layout/generic/crashtests/385265-1.xhtml
deleted file mode 100644
index 7994653ffa..0000000000
--- a/layout/generic/crashtests/385265-1.xhtml
+++ /dev/null
@@ -1,13 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<body>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <mtable>
- <mtr>
- <mtd><mi>x</mi></mtd>
- </mtr>
- </mtable>
-</math>
-
-</body>
-</html> \ No newline at end of file
diff --git a/layout/generic/crashtests/395450-1.xhtml b/layout/generic/crashtests/395450-1.xhtml
deleted file mode 100644
index 79510267ba..0000000000
--- a/layout/generic/crashtests/395450-1.xhtml
+++ /dev/null
@@ -1,28 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-
-<head>
-<style>
-
-/*
- This testcase uses [class~="foo"] instead of .foo to work around bug 276267
- (see bug 379178 comment 78)
-*/
-
-[class~="abs"] { position: absolute; }
-[class~="marg"] { margin: 1em; }
-[class="noheight"] { height: 0; }
-
-</style>
-</head>
-
-<body>
-
-<math:mrow class="noheight">
- <span class="abs">
- <math:mroot class="abs marg" />
- <span class="abs" />
- </span>
-</math:mrow>
-
-</body>
-</html>
diff --git a/layout/generic/crashtests/467914-1.html b/layout/generic/crashtests/467914-1.html
deleted file mode 100644
index 4f518f09df..0000000000
--- a/layout/generic/crashtests/467914-1.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:mathml="http://www.w3.org/1998/Math/MathML">
-<mathml:munder style="transform: translate(50px);clip-path: url(#h);"/>
-</window>
diff --git a/layout/generic/crashtests/547843-1.xhtml b/layout/generic/crashtests/547843-1.xhtml
deleted file mode 100644
index 0ad086d90c..0000000000
--- a/layout/generic/crashtests/547843-1.xhtml
+++ /dev/null
@@ -1 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml"><body><math xmlns="http://www.w3.org/1998/Math/MathML" style="display: table;"/><div style="position: fixed;"></div></body></html>
diff --git a/layout/generic/crashtests/700031.xhtml b/layout/generic/crashtests/700031.xhtml
deleted file mode 100644
index 70f924279e..0000000000
--- a/layout/generic/crashtests/700031.xhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml"><body>
-
-<div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML"><mover>abcdef</mover></math>
-
-</div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
-
-</body></html>
diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list
index 51589c9aba..1c184739d7 100644
--- a/layout/generic/crashtests/crashtests.list
+++ b/layout/generic/crashtests/crashtests.list
@@ -63,14 +63,12 @@ load 363722-1.html
load 363722-2.html
load 364220.html
load 364407-1.html
-load 364686-1.xhtml
load 366021-1.xhtml
load 366667-1.html
load 366952-1.html
load 367246-1.html
load 367360.html
load 368330-1.html
-load 368461-1.xhtml
load 368568.html
load 368752.html
load 368860-1.html
@@ -86,7 +84,6 @@ load 370174-2.html
load 370174-3.html
load 370699-1.html
load 370794-1.html
-load 370884-1.xhtml
load 371348-1.xhtml
load 371561-1.html
load 371566-1.xhtml
@@ -105,11 +102,8 @@ load 381152-1.html
load 382129-1.xhtml
load 382131-1.html
load 382199-1.html
-load 382208-1.xhtml
load 382262-1.html
-load 382396-1.xhtml
load 383089-1.html
-load 385265-1.xhtml
load 385295-1.xhtml
load 385344-1.html
load 385344-2.html
@@ -158,7 +152,6 @@ load 394818-1.html
load 394818-2.html
load 394820-1.html
load 395316-1.html
-load 395450-1.xhtml
load 397007-1.html
load 397187-1.html
load 397844-1.xhtml
@@ -316,7 +309,6 @@ load 467487-1.html
load 467493-1.html
load 467493-2.html
load 467875-1.xhtml
-load 467914-1.html
asserts-if(winWidget,0-2) load 468207-1.html # bug 1647811
load 468771-1.xhtml
load 468771-2.xhtml
@@ -391,7 +383,6 @@ load 541714-1.html
load 541714-2.html
load 542136-1.html
load 545571-1.html
-load 547843-1.xhtml
load 551635-1.html
load 553504-1.xhtml
load 564368-1.xhtml
@@ -457,7 +448,6 @@ load 683712.html
load 688996-1.html
load 688996-2.html
load 691210.html
-load 700031.xhtml
load 709398-1.html
load 718516.html
load 723108.html
@@ -553,7 +543,7 @@ load 942794-1.html
load 943509-1.html
asserts(2-3) load 944909-1.html # bogus sizes
load 946167-1.html
-skip-if(Android&&browserIsRemote) load 947158.html # bug 1507207
+skip-if(Android) load 947158.html # bug 1507207
load 949932.html
load 963878.html
load 964078.html
@@ -587,7 +577,6 @@ load 1137723-2.html
asserts(1) load 1140043-1.html
asserts(1) load 1140043-2.html
asserts(1) load 1140043-3.html
-load 1140268-1.html
load 1145768.html
load 1145931.html
load 1145950-1.html
@@ -631,7 +620,7 @@ load first-letter-638937-1.html
load first-letter-638937-2.html
load flex-nested-abspos-1.html
pref(dom.meta-viewport.enabled,true) test-pref(font.size.inflation.emPerLine,15) asserts(0-100) load font-inflation-762332.html # bug 762332
-asserts-if(Android||OSX,0-2) load outline-on-frameset.xhtml # bug 762332, bug 1594135
+asserts-if(Android||cocoaWidget,0-2) load outline-on-frameset.xhtml # bug 762332, bug 1594135
load summary-position-out-of-flow.html
pref(widget.windows.window_occlusion_tracking.enabled,false) load text-overflow-bug666751-1.html # Bug 1819154
pref(widget.windows.window_occlusion_tracking.enabled,false) load text-overflow-bug666751-2.html # Bug 1819154
@@ -672,7 +661,7 @@ load 1343552-2.html
load 1346454-1.html
load 1346454-2.html
load 1349650.html
-asserts-if(browserIsRemote,0-5) load 1349816-1.html # bug 1350352
+asserts(0-5) load 1349816-1.html # bug 1350352
load 1350372.html
load 1364361-1.html
load 1367413-1.html
diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp
index 54976ecc47..a25e4e996e 100644
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -41,7 +41,6 @@
#include "nsPresContextInlines.h"
#include "nsHTMLParts.h"
#include "nsGkAtoms.h"
-#include "nsAttrValueInlines.h"
#include "mozilla/Sprintf.h"
#include "nsFloatManager.h"
#include "prenv.h"
@@ -50,22 +49,15 @@
#include <algorithm>
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
-#include "nsCSSAnonBoxes.h"
#include "nsCSSFrameConstructor.h"
#include "TextOverflow.h"
#include "nsIFrameInlines.h"
#include "CounterStyleManager.h"
-#include "mozilla/dom/HTMLDetailsElement.h"
-#include "mozilla/dom/HTMLSummaryElement.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/PresShell.h"
#include "mozilla/RestyleManager.h"
#include "mozilla/ServoStyleSet.h"
-#include "mozilla/Telemetry.h"
#include "nsFlexContainerFrame.h"
-#include "nsFileControlFrame.h"
-#include "nsMathMLContainerFrame.h"
-#include "nsSelectsAreaFrame.h"
#include "nsBidiPresUtils.h"
@@ -95,7 +87,7 @@ static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock) {
static void MarkSameFloatManagerLinesDirty(nsBlockFrame* aBlock) {
nsBlockFrame* blockWithFloatMgr = aBlock;
- while (!blockWithFloatMgr->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ while (!blockWithFloatMgr->HasAnyStateBits(NS_BLOCK_BFC)) {
nsBlockFrame* bf = do_QueryFrame(blockWithFloatMgr->GetParent());
if (!bf) {
break;
@@ -130,47 +122,37 @@ static bool BlockHasAnyFloats(nsIFrame* aFrame) {
return false;
}
-/**
- * Determines whether the given frame is visible or has
- * visible children that participate in the same line. Frames
- * that are not line participants do not have their
- * children checked.
- */
-static bool FrameHasVisibleInlineContent(nsIFrame* aFrame) {
+// Determines whether the given frame is visible text or has visible text that
+// participate in the same line. Frames that are not line participants do not
+// have their children checked.
+static bool FrameHasVisibleInlineText(nsIFrame* aFrame) {
MOZ_ASSERT(aFrame, "Frame argument cannot be null");
-
- if (aFrame->StyleVisibility()->IsVisible()) {
- return true;
+ if (!aFrame->IsLineParticipant()) {
+ return false;
}
-
- if (aFrame->IsLineParticipant()) {
- for (nsIFrame* kid : aFrame->PrincipalChildList()) {
- if (kid->StyleVisibility()->IsVisible() ||
- FrameHasVisibleInlineContent(kid)) {
- return true;
- }
+ if (aFrame->IsTextFrame()) {
+ return aFrame->StyleVisibility()->IsVisible() &&
+ NS_GET_A(aFrame->StyleText()->mWebkitTextFillColor.CalcColor(
+ aFrame)) != 0;
+ }
+ for (nsIFrame* kid : aFrame->PrincipalChildList()) {
+ if (FrameHasVisibleInlineText(kid)) {
+ return true;
}
}
return false;
}
-/**
- * Determines whether any of the frames descended from the
- * given line have inline content with 'visibility: visible'.
- * This function calls FrameHasVisibleInlineContent to process
- * each frame in the line's child list.
- */
-static bool LineHasVisibleInlineContent(nsLineBox* aLine) {
+// Determines whether any of the frames from the given line have visible text.
+static bool LineHasVisibleInlineText(nsLineBox* aLine) {
nsIFrame* kid = aLine->mFirstChild;
int32_t n = aLine->GetChildCount();
while (n-- > 0) {
- if (FrameHasVisibleInlineContent(kid)) {
+ if (FrameHasVisibleInlineText(kid)) {
return true;
}
-
kid = kid->GetNextSibling();
}
-
return false;
}
@@ -446,13 +428,6 @@ nsBlockFrame* NS_NewBlockFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
return new (aPresShell) nsBlockFrame(aStyle, aPresShell->GetPresContext());
}
-nsBlockFrame* NS_NewBlockFormattingContext(PresShell* aPresShell,
- ComputedStyle* aComputedStyle) {
- nsBlockFrame* blockFrame = NS_NewBlockFrame(aPresShell, aComputedStyle);
- blockFrame->AddStateBits(NS_BLOCK_STATIC_BFC);
- return blockFrame;
-}
-
NS_IMPL_FRAMEARENA_HELPERS(nsBlockFrame)
nsBlockFrame::~nsBlockFrame() = default;
@@ -1194,7 +1169,7 @@ static LogicalSize CalculateContainingBlockSizeForAbsolutes(
*/
static const nsBlockFrame* GetAsLineClampDescendant(const nsIFrame* aFrame) {
if (const nsBlockFrame* block = do_QueryFrame(aFrame)) {
- if (!block->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (!block->HasAnyStateBits(NS_BLOCK_BFC)) {
return block;
}
}
@@ -1211,7 +1186,7 @@ static bool IsLineClampRoot(const nsBlockFrame* aFrame) {
return false;
}
- if (!aFrame->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (!aFrame->HasAnyStateBits(NS_BLOCK_BFC)) {
return false;
}
@@ -2023,6 +1998,9 @@ nsReflowStatus nsBlockFrame::TrialReflow(nsPresContext* aPresContext,
ComputeFinalSize(aReflowInput, state, aMetrics);
aTrialState.mContainerWidth = state.ContainerSize().width;
+ // Align content
+ AlignContent(state, aMetrics, aTrialState.mBlockEndEdgeOfChildren);
+
return state.mReflowStatus;
}
@@ -2191,6 +2169,11 @@ nscoord nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
aState.ClearFloats(blockEndEdgeOfChildren, StyleClear::Both);
}
+ // undo cached alignment shift for sizing purposes
+ // (we used shifted positions because the float manager uses them)
+ blockEndEdgeOfChildren -= aState.mAlignContentShift;
+ aState.UndoAlignContentShift();
+
if (NS_UNCONSTRAINEDSIZE != aReflowInput.ComputedBSize()) {
// Note: We don't use blockEndEdgeOfChildren because it includes the
// previous margin.
@@ -2221,97 +2204,83 @@ nscoord nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
// calculated from aspect-ratio. i.e. Don't carry out block margin-end if it
// is replaced by the block size from aspect-ratio and inline size.
aMetrics.mCarriedOutBEndMargin.Zero();
- } else {
- Maybe<nscoord> containBSize = ContainIntrinsicBSize(
- IsComboboxControlFrame() ? NS_UNCONSTRAINEDSIZE : 0);
- if (containBSize && *containBSize != NS_UNCONSTRAINEDSIZE) {
- // If we're size-containing in block axis and we don't have a specified
- // block size, then our final size should actually be computed from only
- // our border, padding and contain-intrinsic-block-size, ignoring the
- // actual contents. Hence this case is a simplified version of the case
- // below.
- //
- // NOTE: We exempt the nsComboboxControlFrame subclass from taking this
- // special case when it has 'contain-intrinsic-block-size: none', because
- // comboboxes implicitly honors the size-containment behavior on its
- // nsComboboxDisplayFrame child (which it shrinkwraps) rather than on the
- // nsComboboxControlFrame. (Moreover, the DisplayFrame child doesn't even
- // need any special content-size-ignoring behavior in its reflow method,
- // because that method just resolves "auto" BSize values to one
- // line-height rather than by measuring its contents' BSize.)
- nscoord contentBSize = *containBSize;
- nscoord autoBSize =
- aReflowInput.ApplyMinMaxBSize(contentBSize, aState.mConsumedBSize);
+ } else if (Maybe<nscoord> containBSize = ContainIntrinsicBSize()) {
+ // If we're size-containing in block axis and we don't have a specified
+ // block size, then our final size should actually be computed from only
+ // our border, padding and contain-intrinsic-block-size, ignoring the
+ // actual contents. Hence this case is a simplified version of the case
+ // below.
+ nscoord contentBSize = *containBSize;
+ nscoord autoBSize =
+ aReflowInput.ApplyMinMaxBSize(contentBSize, aState.mConsumedBSize);
+ aMetrics.mCarriedOutBEndMargin.Zero();
+ autoBSize += borderPadding.BStartEnd(wm);
+ finalSize.BSize(wm) = autoBSize;
+ } else if (aState.mReflowStatus.IsInlineBreakBefore()) {
+ // Our parent is expected to push this frame to the next page/column so
+ // what size we set here doesn't really matter.
+ finalSize.BSize(wm) = aReflowInput.AvailableBSize();
+ } else if (aState.mReflowStatus.IsComplete()) {
+ const nscoord lineClampedContentBlockEndEdge =
+ ApplyLineClamp(aReflowInput, this, blockEndEdgeOfChildren);
+
+ const nscoord bpBStart = borderPadding.BStart(wm);
+ const nscoord contentBSize = blockEndEdgeOfChildren - bpBStart;
+ const nscoord lineClampedContentBSize =
+ lineClampedContentBlockEndEdge - bpBStart;
+
+ const nscoord autoBSize = aReflowInput.ApplyMinMaxBSize(
+ lineClampedContentBSize, aState.mConsumedBSize);
+ if (autoBSize != contentBSize) {
+ // Our min-block-size, max-block-size, or -webkit-line-clamp value made
+ // our bsize change. Don't carry out our kids' block-end margins.
aMetrics.mCarriedOutBEndMargin.Zero();
- autoBSize += borderPadding.BStartEnd(wm);
- finalSize.BSize(wm) = autoBSize;
- } else if (aState.mReflowStatus.IsInlineBreakBefore()) {
- // Our parent is expected to push this frame to the next page/column so
- // what size we set here doesn't really matter.
- finalSize.BSize(wm) = aReflowInput.AvailableBSize();
- } else if (aState.mReflowStatus.IsComplete()) {
- const nscoord lineClampedContentBlockEndEdge =
- ApplyLineClamp(aReflowInput, this, blockEndEdgeOfChildren);
-
- const nscoord bpBStart = borderPadding.BStart(wm);
- const nscoord contentBSize = blockEndEdgeOfChildren - bpBStart;
- const nscoord lineClampedContentBSize =
- lineClampedContentBlockEndEdge - bpBStart;
-
- const nscoord autoBSize = aReflowInput.ApplyMinMaxBSize(
- lineClampedContentBSize, aState.mConsumedBSize);
- if (autoBSize != contentBSize) {
- // Our min-block-size, max-block-size, or -webkit-line-clamp value made
- // our bsize change. Don't carry out our kids' block-end margins.
- aMetrics.mCarriedOutBEndMargin.Zero();
- }
- nscoord bSize = autoBSize + borderPadding.BStartEnd(wm);
- if (MOZ_UNLIKELY(autoBSize > contentBSize &&
- bSize > aReflowInput.AvailableBSize() &&
- aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE)) {
- // Applying `min-size` made us overflow our available size.
- // Clamp it and report that we're Incomplete, or BreakBefore if we have
- // 'break-inside: avoid' that is applicable.
- bSize = aReflowInput.AvailableBSize();
- if (ShouldAvoidBreakInside(aReflowInput)) {
- aState.mReflowStatus.SetInlineLineBreakBeforeAndReset();
- } else {
- aState.mReflowStatus.SetIncomplete();
- }
+ }
+ nscoord bSize = autoBSize + borderPadding.BStartEnd(wm);
+ if (MOZ_UNLIKELY(autoBSize > contentBSize &&
+ bSize > aReflowInput.AvailableBSize() &&
+ aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE)) {
+ // Applying `min-size` made us overflow our available size.
+ // Clamp it and report that we're Incomplete, or BreakBefore if we have
+ // 'break-inside: avoid' that is applicable.
+ bSize = aReflowInput.AvailableBSize();
+ if (ShouldAvoidBreakInside(aReflowInput)) {
+ aState.mReflowStatus.SetInlineLineBreakBeforeAndReset();
+ } else {
+ aState.mReflowStatus.SetIncomplete();
}
- finalSize.BSize(wm) = bSize;
- } else {
- NS_ASSERTION(
- aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
- "Shouldn't be incomplete if availableBSize is UNCONSTRAINED.");
- nscoord bSize = std::max(aState.mBCoord, aReflowInput.AvailableBSize());
- if (aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
- // This should never happen, but it does. See bug 414255
- bSize = aState.mBCoord;
- }
- const nscoord maxBSize = aReflowInput.ComputedMaxBSize();
- if (maxBSize != NS_UNCONSTRAINEDSIZE &&
- aState.mConsumedBSize + bSize - borderPadding.BStart(wm) > maxBSize) {
- // Compute this fragment's block-size, with the max-block-size
- // constraint taken into consideration.
- const nscoord clampedBSizeWithoutEndBP =
- std::max(0, maxBSize - aState.mConsumedBSize) +
- borderPadding.BStart(wm);
- const nscoord clampedBSize =
- clampedBSizeWithoutEndBP + borderPadding.BEnd(wm);
- if (clampedBSize <= aReflowInput.AvailableBSize()) {
- // We actually fit after applying `max-size` so we should be
- // Overflow-Incomplete instead.
- bSize = clampedBSize;
- aState.mReflowStatus.SetOverflowIncomplete();
- } else {
- // We cannot fit after applying `max-size` with our block-end BP, so
- // we should draw it in our next continuation.
- bSize = clampedBSizeWithoutEndBP;
- }
+ }
+ finalSize.BSize(wm) = bSize;
+ } else {
+ NS_ASSERTION(aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
+ "Shouldn't be incomplete if availableBSize is UNCONSTRAINED.");
+ nscoord bSize = std::max(aState.mBCoord, aReflowInput.AvailableBSize());
+ if (aReflowInput.AvailableBSize() == NS_UNCONSTRAINEDSIZE) {
+ // This should never happen, but it does. See bug 414255
+ bSize = aState.mBCoord;
+ }
+ const nscoord maxBSize = aReflowInput.ComputedMaxBSize();
+ if (maxBSize != NS_UNCONSTRAINEDSIZE &&
+ aState.mConsumedBSize + bSize - borderPadding.BStart(wm) > maxBSize) {
+ // Compute this fragment's block-size, with the max-block-size
+ // constraint taken into consideration.
+ const nscoord clampedBSizeWithoutEndBP =
+ std::max(0, maxBSize - aState.mConsumedBSize) +
+ borderPadding.BStart(wm);
+ const nscoord clampedBSize =
+ clampedBSizeWithoutEndBP + borderPadding.BEnd(wm);
+ if (clampedBSize <= aReflowInput.AvailableBSize()) {
+ // We actually fit after applying `max-size` so we should be
+ // Overflow-Incomplete instead.
+ bSize = clampedBSize;
+ aState.mReflowStatus.SetOverflowIncomplete();
+ } else {
+ // We cannot fit after applying `max-size` with our block-end BP, so
+ // we should draw it in our next continuation.
+ bSize = clampedBSizeWithoutEndBP;
}
- finalSize.BSize(wm) = bSize;
}
+ finalSize.BSize(wm) = bSize;
}
if (IsTrueOverflowContainer()) {
@@ -2381,6 +2350,77 @@ nscoord nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
return blockEndEdgeOfChildren;
}
+void nsBlockFrame::AlignContent(BlockReflowState& aState,
+ ReflowOutput& aMetrics,
+ nscoord aBEndEdgeOfChildren) {
+ if (!StaticPrefs::layout_css_align_content_blocks_enabled()) {
+ return;
+ }
+
+ StyleAlignFlags alignment = StylePosition()->mAlignContent.primary;
+ alignment &= ~StyleAlignFlags::FLAG_BITS;
+
+ // Short circuit
+ const bool isCentered = alignment == StyleAlignFlags::CENTER ||
+ alignment == StyleAlignFlags::SPACE_AROUND ||
+ alignment == StyleAlignFlags::SPACE_EVENLY;
+ const bool isEndAlign = alignment == StyleAlignFlags::END ||
+ alignment == StyleAlignFlags::FLEX_END ||
+ alignment == StyleAlignFlags::LAST_BASELINE;
+ if (!isEndAlign && !isCentered && !aState.mAlignContentShift) {
+ // desired shift = 0, no cached shift to undo
+ return;
+ }
+
+ // NOTE: ComputeFinalSize already called aState.UndoAlignContentShift(),
+ // so metrics no longer include cached shift.
+ // NOTE: Content is currently positioned at cached shift
+ // NOTE: Content has been fragmented against 0-shift assumption.
+
+ // Calculate shift
+ nscoord shift = 0;
+ WritingMode wm = aState.mReflowInput.GetWritingMode();
+ if ((isCentered || isEndAlign) && !mLines.empty() &&
+ aState.mReflowStatus.IsFullyComplete() && !GetPrevInFlow()) {
+ nscoord availB = aState.mReflowInput.AvailableBSize();
+ nscoord endB = aMetrics.BSize(wm) - aState.BorderPadding().BEnd(wm);
+ shift = std::min(availB, endB) - aBEndEdgeOfChildren;
+
+ // note: these measures all include start BP, so it subtracts out
+ if (!(StylePosition()->mAlignContent.primary & StyleAlignFlags::UNSAFE)) {
+ shift = std::max(0, shift);
+ }
+ if (isCentered) {
+ shift = shift / 2;
+ }
+ }
+ // else: zero shift if start-aligned or if fragmented
+
+ nscoord delta = shift - aState.mAlignContentShift;
+ if (delta) {
+ // Shift children
+ LogicalPoint translation(wm, 0, delta);
+ for (nsLineBox& line : Lines()) {
+ SlideLine(aState, &line, delta);
+ }
+ for (nsIFrame* kid : GetChildList(FrameChildListID::Float)) {
+ kid->MovePositionBy(wm, translation);
+ nsContainerFrame::PlaceFrameView(kid);
+ }
+ if (HasOutsideMarker() && !mLines.empty()) {
+ nsIFrame* marker = GetOutsideMarker();
+ marker->MovePositionBy(wm, translation);
+ }
+ }
+
+ if (shift) {
+ // Cache shift
+ SetProperty(AlignContentShift(), shift);
+ } else {
+ RemoveProperty(AlignContentShift());
+ }
+}
+
void nsBlockFrame::ConsiderBlockEndEdgeOfChildren(
OverflowAreas& aOverflowAreas, nscoord aBEndEdgeOfChildren,
const nsStyleDisplay* aDisplay) const {
@@ -3153,9 +3193,12 @@ bool nsBlockFrame::ReflowDirtyLines(BlockReflowState& aState) {
// Immediately fragment for page-name. It is possible we could break
// out of the loop right here, but this should make it more similar to
// what happens when reflow causes fragmentation.
- PushTruncatedLine(aState, line, &keepGoing);
+ // Set the page name, so that PushTruncatedLine does not need to
+ // recalculate the new page name.
PresShell()->FrameConstructor()->SetNextPageContentFramePageName(
nextPageName ? nextPageName : GetAutoPageValue());
+ PushTruncatedLine(aState, line, &keepGoing,
+ ComputeNewPageNameIfNeeded::No);
} else {
// Reflow the dirty line. If it's an incremental reflow, then force
// it to invalidate the dirty area if necessary
@@ -3867,7 +3910,7 @@ bool nsBlockFrame::IsSelfEmpty() {
// Blocks which are margin-roots (including inline-blocks) cannot be treated
// as empty for margin-collapsing and other purposes. They're more like
// replaced elements.
- if (HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (HasAnyStateBits(NS_BLOCK_BFC)) {
return false;
}
@@ -4730,11 +4773,25 @@ void nsBlockFrame::SetBreakBeforeStatusBeforeLine(BlockReflowState& aState,
*aKeepReflowGoing = false;
}
-void nsBlockFrame::PushTruncatedLine(BlockReflowState& aState,
- LineIterator aLine,
- bool* aKeepReflowGoing) {
+void nsBlockFrame::PushTruncatedLine(
+ BlockReflowState& aState, LineIterator aLine, bool* aKeepReflowGoing,
+ ComputeNewPageNameIfNeeded aComputeNewPageName) {
PushLines(aState, aLine.prev());
*aKeepReflowGoing = false;
+
+ if (aComputeNewPageName == ComputeNewPageNameIfNeeded::Yes) {
+ // mCanHaveClassABreakpoints can only be true during paginated reflow, and
+ // we expect this function to only be called when the available bsize is
+ // constrained.
+ const WritingMode wm = GetWritingMode();
+ const bool canBreakForPageNames =
+ aState.mReflowInput.mFlags.mCanHaveClassABreakpoints &&
+ !PresShell()->GetRootFrame()->GetWritingMode().IsOrthogonalTo(wm);
+ if (canBreakForPageNames) {
+ PresShell()->FrameConstructor()->MaybeSetNextPageContentFramePageName(
+ aLine->mFirstChild);
+ }
+ }
aState.mReflowStatus.SetIncomplete();
}
@@ -5177,7 +5234,7 @@ void nsBlockFrame::SplitFloat(BlockReflowState& aState, nsIFrame* aFloat,
}
aState.AppendPushedFloatChain(nextInFlow);
- if (MOZ_LIKELY(!HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) ||
+ if (MOZ_LIKELY(!HasAnyStateBits(NS_BLOCK_BFC)) ||
MOZ_UNLIKELY(IsTrueOverflowContainer())) {
aState.mReflowStatus.SetOverflowIncomplete();
} else {
@@ -6290,7 +6347,7 @@ nsContainerFrame* nsBlockFrame::GetRubyContentPseudoFrame() {
auto* firstChild = PrincipalChildList().FirstChild();
if (firstChild && firstChild->IsRubyFrame() &&
firstChild->Style()->GetPseudoType() ==
- mozilla::PseudoStyleType::blockRubyContent) {
+ PseudoStyleType::blockRubyContent) {
return static_cast<nsContainerFrame*>(firstChild);
}
return nullptr;
@@ -6425,15 +6482,80 @@ nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
*aFoundValidLine = FindValidLine();
}
+static bool AnonymousBoxIsBFC(const ComputedStyle* aStyle) {
+ switch (aStyle->GetPseudoType()) {
+ case PseudoStyleType::fieldsetContent:
+ case PseudoStyleType::columnContent:
+ case PseudoStyleType::buttonContent:
+ case PseudoStyleType::cellContent:
+ case PseudoStyleType::scrolledContent:
+ case PseudoStyleType::anonymousItem:
+ return true;
+ default:
+ return false;
+ }
+}
+
static bool StyleEstablishesBFC(const ComputedStyle* aStyle) {
// paint/layout containment boxes and multi-column containers establish an
// independent formatting context.
// https://drafts.csswg.org/css-contain/#containment-paint
// https://drafts.csswg.org/css-contain/#containment-layout
+ // https://drafts.csswg.org/css-align/#distribution-block
// https://drafts.csswg.org/css-multicol/#columns
- return aStyle->StyleDisplay()->IsContainPaint() ||
- aStyle->StyleDisplay()->IsContainLayout() ||
- aStyle->GetPseudoType() == PseudoStyleType::columnContent;
+ const auto* disp = aStyle->StyleDisplay();
+ return disp->IsContainPaint() || disp->IsContainLayout() ||
+ disp->DisplayInside() == StyleDisplayInside::FlowRoot ||
+ disp->IsAbsolutelyPositionedStyle() || disp->IsFloatingStyle() ||
+ aStyle->StylePosition()->mAlignContent.primary !=
+ StyleAlignFlags::NORMAL ||
+ aStyle->IsRootElementStyle() || AnonymousBoxIsBFC(aStyle);
+}
+
+static bool EstablishesBFC(const nsBlockFrame* aFrame) {
+ if (aFrame->HasAnyClassFlag(LayoutFrameClassFlags::BlockFormattingContext)) {
+ return true;
+ }
+
+ if (nsIFrame* parent = aFrame->GetParent()) {
+ if (parent->IsFieldSetFrame()) {
+ // A rendered legend always establishes a new formatting context, and so
+ // does the fieldset content frame, so we can just return true here.
+ // https://html.spec.whatwg.org/#rendered-legend
+ return true;
+ }
+
+ const auto wm = aFrame->GetWritingMode();
+ const auto parentWM = parent->GetWritingMode();
+ if (wm.GetBlockDir() != parentWM.GetBlockDir() ||
+ wm.IsVerticalSideways() != parentWM.IsVerticalSideways()) {
+ // If a box has a different writing-mode value than its containing block
+ // [...] if the box is a block container, then it establishes a new block
+ // formatting context.
+ // https://drafts.csswg.org/css-writing-modes/#block-flow
+ return true;
+ }
+ }
+
+ if (aFrame->IsColumnSpan()) {
+ return true;
+ }
+
+ if (aFrame->IsSuppressedScrollableBlockForPrint()) {
+ return true;
+ }
+
+ const auto* style = aFrame->Style();
+ if (style->GetPseudoType() == PseudoStyleType::marker) {
+ if (aFrame->GetParent() &&
+ aFrame->GetParent()->StyleList()->mListStylePosition ==
+ StyleListStylePosition::Outside) {
+ // An outside ::marker needs to be an independent formatting context
+ // to avoid being influenced by the float manager etc.
+ return true;
+ }
+ }
+ return StyleEstablishesBFC(style);
}
void nsBlockFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
@@ -6442,24 +6564,16 @@ void nsBlockFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
return;
}
- // If NS_BLOCK_STATIC_BFC flag was set when the frame was initialized, it
- // remains set during the lifetime of the frame and always forces it to be
- // treated as a BFC, independently of the value of NS_BLOCK_DYNAMIC_BFC.
- // Consequently, we don't bother invalidating or updating that latter flag.
- if (HasAnyStateBits(NS_BLOCK_STATIC_BFC)) {
- return;
- }
-
- bool isBFC = StyleEstablishesBFC(Style());
- if (StyleEstablishesBFC(aOldStyle) != isBFC) {
+ const bool isBFC = EstablishesBFC(this);
+ if (HasAnyStateBits(NS_BLOCK_BFC) != isBFC) {
if (MaybeHasFloats()) {
// If the frame contains floats, this update may change their float
// manager. Be safe by dirtying all descendant lines of the nearest
// ancestor's float manager.
- RemoveStateBits(NS_BLOCK_DYNAMIC_BFC);
+ RemoveStateBits(NS_BLOCK_BFC);
MarkSameFloatManagerLinesDirty(this);
}
- AddOrRemoveStateBits(NS_BLOCK_DYNAMIC_BFC, isBFC);
+ AddOrRemoveStateBits(NS_BLOCK_BFC, isBFC);
}
}
@@ -7469,11 +7583,11 @@ void nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// We'll try to draw an accessibility backplate behind text (to ensure it's
// readable over any possible background-images), if all of the following
// hold:
- // (A) the backplate feature is preffed on
- // (B) we are not honoring the document colors
+ // (A) we are not honoring the document colors
+ // (B) the backplate feature is preffed on
// (C) the force color adjust property is set to auto
- if (StaticPrefs::browser_display_permit_backplate() &&
- PresContext()->ForcingColors() && !IsComboboxControlFrame() &&
+ if (PresContext()->ForcingColors() &&
+ StaticPrefs::browser_display_permit_backplate() &&
StyleText()->mForcedColorAdjust != StyleForcedColorAdjust::None) {
backplateColor.emplace(GetBackplateColor(this));
}
@@ -7565,7 +7679,7 @@ void nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
lastY = lineArea.y;
lastYMost = lineArea.YMost();
- if (lineInLine && backplateColor && LineHasVisibleInlineContent(line)) {
+ if (lineInLine && backplateColor && LineHasVisibleInlineText(line)) {
nsRect lineBackplate = GetLineTextArea(line, aBuilder) +
aBuilder->ToReferenceFrame(this);
if (curBackplateArea.IsEmpty()) {
@@ -7762,35 +7876,15 @@ void nsBlockFrame::ChildIsDirty(nsIFrame* aChild) {
nsContainerFrame::ChildIsDirty(aChild);
}
-static bool AlwaysEstablishesBFC(const nsBlockFrame* aFrame) {
- switch (aFrame->Type()) {
- case LayoutFrameType::ColumnSetWrapper:
- // CSS Multi-column level 1 section 2: A multi-column container
- // establishes a new block formatting context, as per CSS 2.1 section
- // 9.4.1.
- case LayoutFrameType::ComboboxControl:
- return true;
- case LayoutFrameType::Block:
- return static_cast<const nsFileControlFrame*>(do_QueryFrame(aFrame)) ||
- // Ensure that the options inside the select aren't expanded by
- // right floats outside the select.
- static_cast<const nsSelectsAreaFrame*>(do_QueryFrame(aFrame)) ||
- // See bug 1373767 and bug 353894.
- static_cast<const nsMathMLmathBlockFrame*>(do_QueryFrame(aFrame));
- default:
- return false;
- }
-}
-
void nsBlockFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
nsIFrame* aPrevInFlow) {
// These are all the block specific frame bits, they are copied from
// the prev-in-flow to a newly created next-in-flow, except for the
// NS_BLOCK_FLAGS_NON_INHERITED_MASK bits below.
constexpr nsFrameState NS_BLOCK_FLAGS_MASK =
- NS_BLOCK_BFC_STATE_BITS | NS_BLOCK_CLIP_PAGINATED_OVERFLOW |
- NS_BLOCK_HAS_FIRST_LETTER_STYLE | NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER |
- NS_BLOCK_HAS_FIRST_LETTER_CHILD | NS_BLOCK_FRAME_HAS_INSIDE_MARKER;
+ NS_BLOCK_BFC | NS_BLOCK_HAS_FIRST_LETTER_STYLE |
+ NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER | NS_BLOCK_HAS_FIRST_LETTER_CHILD |
+ NS_BLOCK_FRAME_HAS_INSIDE_MARKER;
// This is the subset of NS_BLOCK_FLAGS_MASK that is NOT inherited
// by default. They should only be set on the first-in-flow.
@@ -7812,37 +7906,12 @@ void nsBlockFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
AddStateBits(NS_BLOCK_NEEDS_BIDI_RESOLUTION);
}
- // A display:flow-root box establishes a block formatting context.
- //
- // If a box has a different writing-mode value than its containing block:
- // ...
- // If the box is a block container, then it establishes a new block
- // formatting context.
- // (https://drafts.csswg.org/css-writing-modes/#block-flow)
- //
- // If the box has contain: paint or contain:layout (or contain:strict),
- // then it should also establish a formatting context.
- //
- // Per spec, a column-span always establishes a new block formatting context.
- //
- // Other more specific frame types also always establish a BFC.
- //
- if (StyleDisplay()->mDisplay == mozilla::StyleDisplay::FlowRoot ||
- (GetParent() &&
- (GetWritingMode().GetBlockDir() !=
- GetParent()->GetWritingMode().GetBlockDir() ||
- GetWritingMode().IsVerticalSideways() !=
- GetParent()->GetWritingMode().IsVerticalSideways())) ||
- IsColumnSpan() || AlwaysEstablishesBFC(this)) {
- AddStateBits(NS_BLOCK_STATIC_BFC);
- }
-
- if (StyleEstablishesBFC(Style())) {
- AddStateBits(NS_BLOCK_DYNAMIC_BFC);
+ if (EstablishesBFC(this)) {
+ AddStateBits(NS_BLOCK_BFC);
}
if (HasAnyStateBits(NS_FRAME_FONT_INFLATION_CONTAINER) &&
- HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ HasAnyStateBits(NS_BLOCK_BFC)) {
AddStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
}
}
@@ -7866,13 +7935,13 @@ void nsBlockFrame::SetInitialChildList(ChildListID aListID,
(pseudo == PseudoStyleType::cellContent &&
!GetParent()->Style()->IsPseudoOrAnonBox()) ||
pseudo == PseudoStyleType::fieldsetContent ||
- pseudo == PseudoStyleType::buttonContent ||
+ (pseudo == PseudoStyleType::buttonContent &&
+ !GetParent()->IsComboboxControlFrame()) ||
pseudo == PseudoStyleType::columnContent ||
(pseudo == PseudoStyleType::scrolledContent &&
!GetParent()->IsListControlFrame()) ||
pseudo == PseudoStyleType::mozSVGText) &&
- !IsComboboxControlFrame() && !IsMathMLFrame() &&
- !IsColumnSetWrapperFrame() &&
+ !IsMathMLFrame() && !IsColumnSetWrapperFrame() &&
RefPtr<ComputedStyle>(GetFirstLetterStyle(PresContext())) != nullptr;
NS_ASSERTION(haveFirstLetterStyle ==
HasAnyStateBits(NS_BLOCK_HAS_FIRST_LETTER_STYLE),
@@ -7895,11 +7964,6 @@ void nsBlockFrame::SetMarkerFrameForListItem(nsIFrame* aMarkerFrame) {
SetProperty(InsideMarkerProperty(), aMarkerFrame);
AddStateBits(NS_BLOCK_FRAME_HAS_INSIDE_MARKER);
} else {
- if (nsBlockFrame* marker = do_QueryFrame(aMarkerFrame)) {
- // An outside ::marker needs to be an independent formatting context
- // to avoid being influenced by the float manager etc.
- marker->AddStateBits(NS_BLOCK_STATIC_BFC);
- }
SetProperty(OutsideMarkerProperty(),
new (PresShell()) nsFrameList(aMarkerFrame, aMarkerFrame));
AddStateBits(NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER);
@@ -8100,7 +8164,7 @@ void nsBlockFrame::CheckFloats(BlockReflowState& aState) {
void nsBlockFrame::IsMarginRoot(bool* aBStartMarginRoot,
bool* aBEndMarginRoot) {
nsIFrame* parent = GetParent();
- if (!HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (!HasAnyStateBits(NS_BLOCK_BFC)) {
if (!parent || parent->IsFloatContainingBlock()) {
*aBStartMarginRoot = false;
*aBEndMarginRoot = false;
@@ -8127,14 +8191,14 @@ bool nsBlockFrame::BlockNeedsFloatManager(nsIFrame* aBlock) {
NS_ASSERTION(aBlock->IsBlockFrameOrSubclass(), "aBlock must be a block");
nsIFrame* parent = aBlock->GetParent();
- return aBlock->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS) ||
+ return aBlock->HasAnyStateBits(NS_BLOCK_BFC) ||
(parent && !parent->IsFloatContainingBlock());
}
/* static */
bool nsBlockFrame::BlockCanIntersectFloats(nsIFrame* aFrame) {
return aFrame->IsBlockFrameOrSubclass() && !aFrame->IsReplaced() &&
- !aFrame->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS);
+ !aFrame->HasAnyStateBits(NS_BLOCK_BFC);
}
// Note that this width can vary based on the vertical position.
diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h
index 15dd4c3278..9fb909430c 100644
--- a/layout/generic/nsBlockFrame.h
+++ b/layout/generic/nsBlockFrame.h
@@ -492,6 +492,14 @@ class nsBlockFrame : public nsContainerFrame {
BlockReflowState& aState, ReflowOutput& aMetrics);
/**
+ * Calculates the necessary shift to honor 'align-content' and applies it.
+ */
+ void AlignContent(BlockReflowState& aState, ReflowOutput& aMetrics,
+ nscoord aBEndEdgeOfChildren);
+ // Stash the effective align-content shift value between reflows
+ NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(AlignContentShift, nscoord)
+
+ /**
* Helper method for Reflow(). Computes the overflow areas created by our
* children, and includes them into aOverflowAreas.
*/
@@ -540,6 +548,16 @@ class nsBlockFrame : public nsContainerFrame {
*/
bool IsVisualFormControl(nsPresContext* aPresContext);
+ /** Whether this block has an effective align-content property */
+ bool IsAligned() const {
+ return StylePosition()->mAlignContent.primary !=
+ mozilla::StyleAlignFlags::NORMAL;
+ }
+
+ nscoord GetAlignContentShift() const {
+ return IsAligned() ? GetProperty(AlignContentShift()) : 0;
+ }
+
/**
* For text-wrap:balance, we iteratively try reflowing with adjusted inline
* size to find the "best" result (the tightest size that can be applied
@@ -849,12 +867,23 @@ class nsBlockFrame : public nsContainerFrame {
bool* aKeepReflowGoing);
/**
+ * Indicates if we need to compute a page name for the next page when pushing
+ * a truncated line.
+ *
+ * Using a value of No saves work when a new page name has already been set
+ * with nsCSSFrameConstructor::SetNextPageContentFramePageName.
+ */
+ enum class ComputeNewPageNameIfNeeded : uint8_t { Yes, No };
+
+ /**
* Push aLine (and any after it), since it cannot be placed on this
* page/column. Set aKeepReflowGoing to false and set
* flag aState.mReflowStatus as incomplete.
*/
void PushTruncatedLine(BlockReflowState& aState, LineIterator aLine,
- bool* aKeepReflowGoing);
+ bool* aKeepReflowGoing,
+ ComputeNewPageNameIfNeeded aComputeNewPageName =
+ ComputeNewPageNameIfNeeded::Yes);
void SplitLine(BlockReflowState& aState, nsLineLayout& aLineLayout,
LineIterator aLine, nsIFrame* aFrame,
diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp
index ceae9f4849..23f3b83645 100644
--- a/layout/generic/nsBlockReflowContext.cpp
+++ b/layout/generic/nsBlockReflowContext.cpp
@@ -275,7 +275,7 @@ void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
tI = space.LineLeft(mWritingMode, mContainerSize);
tB = mBCoord;
- if (!mFrame->HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (!mFrame->HasAnyStateBits(NS_BLOCK_BFC)) {
aFrameRI.mBlockDelta =
mOuterReflowInput.mBlockDelta + mBCoord - aLine->BStart();
}
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index 9629905968..2577a7a00d 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1124,7 +1124,6 @@ void nsContainerFrame::ReflowOverflowContainerChildren(
// isn't dirty.
if (shouldReflowAllKids || frame->IsSubtreeDirty() ||
ScrollableOverflowExceedsAvailableBSize(frame)) {
- // Get prev-in-flow
nsIFrame* prevInFlow = frame->GetPrevInFlow();
NS_ASSERTION(prevInFlow,
"overflow container frame must have a prev-in-flow");
@@ -1132,38 +1131,45 @@ void nsContainerFrame::ReflowOverflowContainerChildren(
frame->HasAnyStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER),
"overflow container frame must have overflow container bit set");
WritingMode wm = frame->GetWritingMode();
- nsSize containerSize =
- aContainerSize ? *aContainerSize
- : aReflowInput.AvailableSize(wm).GetPhysicalSize(wm);
- LogicalRect prevRect = prevInFlow->GetLogicalRect(wm, containerSize);
-
- // Initialize reflow params
- LogicalSize availSpace(wm, prevRect.ISize(wm),
- aReflowInput.AvailableSize(wm).BSize(wm));
- ReflowOutput desiredSize(aReflowInput);
+ // Note: aReflowInput's available inline-size is technically wrong for us
+ // to hand off to children here, because it doesn't account for the space
+ // that's been used for the container's margin/border/padding (and some
+ // other space that a concrete container type, e.g. fieldset and grid [1],
+ // might reserve before setting up the available space for their
+ // children). Since we don't have a way to query the specific available
+ // inline-size each container type used, nor do we know how the container
+ // computes its non-overflow-container children's inline-size, we just
+ // unconditionally override the frame's inline-size, so that the available
+ // inline-size for the children doesn't really matter anyway.
+ //
+ // [1] For example, fieldset uses its computed inline-size with padding as
+ // the available inline-size to reflow its inner child frame.
+ // https://searchfox.org/mozilla-central/rev/04f7743d94691fa24212fb43099f9d84c3bfc890/layout/forms/nsFieldSetFrame.cpp#535-536
+ const LogicalSize availSpace = aReflowInput.AvailableSize(wm);
StyleSizeOverrides sizeOverride;
- if (frame->IsFlexItem()) {
- // A flex item's size is determined by the flex algorithm, not solely by
- // its style. Thus, the following overrides are necessary.
- //
- // Use the overflow container flex item's prev-in-flow inline-size since
- // this continuation's inline-size is the same.
- sizeOverride.mStyleISize.emplace(
- StyleSize::LengthPercentage(LengthPercentage::FromAppUnits(
- frame->StylePosition()->mBoxSizing == StyleBoxSizing::Border
- ? prevRect.ISize(wm)
- : prevInFlow->ContentISize(wm))));
+ // We override current continuation's inline-size by using the
+ // prev-in-flow's inline-size since both should be the same.
+ sizeOverride.mStyleISize.emplace(
+ StyleSize::LengthPercentage(LengthPercentage::FromAppUnits(
+ frame->StylePosition()->mBoxSizing == StyleBoxSizing::Border
+ ? prevInFlow->ISize(wm)
+ : prevInFlow->ContentISize(wm))));
+ if (frame->IsFlexItem()) {
// An overflow container's block-size must be 0.
sizeOverride.mStyleBSize.emplace(
StyleSize::LengthPercentage(LengthPercentage::FromAppUnits(0)));
}
+ ReflowOutput desiredSize(wm);
ReflowInput reflowInput(aPresContext, aReflowInput, frame, availSpace,
Nothing(), {}, sizeOverride);
-
- LogicalPoint pos(wm, prevRect.IStart(wm), 0);
+ const nsSize containerSize =
+ aContainerSize ? *aContainerSize
+ : aReflowInput.AvailableSize(wm).GetPhysicalSize(wm);
+ const LogicalPoint pos(wm, prevInFlow->IStart(wm, containerSize), 0);
nsReflowStatus frameStatus;
+
ReflowChild(frame, aPresContext, desiredSize, reflowInput, wm, pos,
containerSize, aFlags, frameStatus, &tracker);
FinishReflowChild(frame, aPresContext, desiredSize, &reflowInput, wm, pos,
diff --git a/layout/generic/nsFloatManager.h b/layout/generic/nsFloatManager.h
index f947567383..eb12d44e1d 100644
--- a/layout/generic/nsFloatManager.h
+++ b/layout/generic/nsFloatManager.h
@@ -70,8 +70,8 @@ struct nsFlowAreaRect {
/**
* nsFloatManager is responsible for implementing CSS's rules for
* positioning floats. An nsFloatManager object is created during reflow for
- * any block with NS_BLOCK_BFC_STATE_BITS. During reflow, the float manager for
- * the nearest such ancestor block is found in ReflowInput::mFloatManager.
+ * any block with NS_BLOCK_BFC. During reflow, the float manager for the nearest
+ * such ancestor block is found in ReflowInput::mFloatManager.
*
* According to the line-relative mappings in CSS Writing Modes spec [1],
* line-right and line-left are calculated with respect to the writing mode
diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp
index 002d26c4fa..f1a8c7e27c 100644
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -31,7 +31,6 @@
#include "nsFrameTraversal.h"
#include "nsString.h"
#include "nsISelectionListener.h"
-#include "nsContentCID.h"
#include "nsDeviceContext.h"
#include "nsIContent.h"
#include "nsRange.h"
@@ -48,7 +47,6 @@
#include "nsGkAtoms.h"
#include "nsLayoutUtils.h"
-#include "nsLayoutCID.h"
#include "nsBidiPresUtils.h"
#include "nsTextFrame.h"
diff --git a/layout/generic/nsFrameStateBits.h b/layout/generic/nsFrameStateBits.h
index a9a1700737..db00deab95 100644
--- a/layout/generic/nsFrameStateBits.h
+++ b/layout/generic/nsFrameStateBits.h
@@ -541,41 +541,30 @@ FRAME_STATE_BIT(Block, 21, NS_BLOCK_HAS_PUSHED_FLOATS)
// 2. This indicates that a block frame should create its own float manager.
// This is required by each block frame that can contain floats. The float
// manager is used to reserve space for the floated frames.
-FRAME_STATE_BIT(Block, 22, NS_BLOCK_STATIC_BFC)
+FRAME_STATE_BIT(Block, 22, NS_BLOCK_BFC)
-// This is the same as NS_BLOCK_STATIC_BFC but can be updated dynamically after
-// the frame construction (e.g. paint/layout containment).
-// FIXME(bug 1874823): Try and merge this and NS_BLOCK_STATIC_BFC.
-FRAME_STATE_BIT(Block, 23, NS_BLOCK_DYNAMIC_BFC)
+FRAME_STATE_BIT(Block, 23, NS_BLOCK_HAS_LINE_CURSOR)
-// For testing the relevant bits on a block formatting context:
-#define NS_BLOCK_BFC_STATE_BITS (NS_BLOCK_STATIC_BFC | NS_BLOCK_DYNAMIC_BFC)
+FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_OVERFLOW_LINES)
-FRAME_STATE_BIT(Block, 24, NS_BLOCK_HAS_LINE_CURSOR)
-
-FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_LINES)
-
-FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)
+FRAME_STATE_BIT(Block, 25, NS_BLOCK_HAS_OVERFLOW_OUT_OF_FLOWS)
// Set on any block that has descendant frames in the normal
// flow with 'clear' set to something other than 'none'
// (including <BR CLEAR="..."> frames)
-FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_CLEAR_CHILDREN)
-
-// NS_BLOCK_CLIP_PAGINATED_OVERFLOW is only set in paginated prescontexts, on
-// blocks which were forced to not have scrollframes but still need to clip
-// the display of their kids.
-FRAME_STATE_BIT(Block, 28, NS_BLOCK_CLIP_PAGINATED_OVERFLOW)
+FRAME_STATE_BIT(Block, 26, NS_BLOCK_HAS_CLEAR_CHILDREN)
// NS_BLOCK_HAS_FIRST_LETTER_STYLE means that the block has first-letter style,
// even if it has no actual first-letter frame among its descendants.
-FRAME_STATE_BIT(Block, 29, NS_BLOCK_HAS_FIRST_LETTER_STYLE)
+FRAME_STATE_BIT(Block, 27, NS_BLOCK_HAS_FIRST_LETTER_STYLE)
// NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER and NS_BLOCK_FRAME_HAS_INSIDE_MARKER
// means the block has an associated ::marker frame, they are mutually
// exclusive.
-FRAME_STATE_BIT(Block, 30, NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER)
-FRAME_STATE_BIT(Block, 31, NS_BLOCK_FRAME_HAS_INSIDE_MARKER)
+FRAME_STATE_BIT(Block, 28, NS_BLOCK_FRAME_HAS_OUTSIDE_MARKER)
+FRAME_STATE_BIT(Block, 29, NS_BLOCK_FRAME_HAS_INSIDE_MARKER)
+
+// bits 30 and 31 free.
// NS_BLOCK_HAS_LINE_CLAMP_ELLIPSIS indicates that exactly one line in this
// block has the LineClampEllipsis flag set, and that such a line must be found
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp
index b51f3eccb7..361847b753 100644
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1172,10 +1172,16 @@ void nsHTMLScrollFrame::PlaceScrollArea(ScrollReflowInput& aState,
scrolledArea, ReflowChildFlags::Default);
}
-nscoord nsHTMLScrollFrame::IntrinsicScrollbarGutterSizeAtInlineEdges() {
- const bool isVerticalWM = GetWritingMode().IsVertical();
+nscoord nsHTMLScrollFrame::IntrinsicScrollbarGutterSizeAtInlineEdges() const {
+ const auto wm = GetWritingMode();
+ const LogicalMargin gutter(wm, IntrinsicScrollbarGutterSize());
+ return gutter.IStartEnd(wm);
+}
+
+nsMargin nsHTMLScrollFrame::IntrinsicScrollbarGutterSize() const {
if (PresContext()->UseOverlayScrollbars()) {
- return 0;
+ // Overlay scrollbars do not consume space per spec.
+ return {};
}
const auto* styleForScrollbar = nsLayoutUtils::StyleForScrollbar(this);
@@ -1183,28 +1189,30 @@ nscoord nsHTMLScrollFrame::IntrinsicScrollbarGutterSizeAtInlineEdges() {
styleForScrollbar->StyleUIReset()->ScrollbarWidth();
if (styleScrollbarWidth == StyleScrollbarWidth::None) {
// Scrollbar shouldn't appear at all with "scrollbar-width: none".
- return 0;
+ return {};
}
const auto& styleScrollbarGutter =
styleForScrollbar->StyleDisplay()->mScrollbarGutter;
- ScrollStyles ss = GetScrollStyles();
- const StyleOverflow& inlineEndStyleOverflow =
- isVerticalWM ? ss.mHorizontal : ss.mVertical;
-
- // Return the scrollbar-gutter size only if we have "overflow:scroll" or
- // non-auto "scrollbar-gutter", so early-return here if the conditions aren't
- // satisfied.
- if (inlineEndStyleOverflow != StyleOverflow::Scroll &&
- styleScrollbarGutter == StyleScrollbarGutter::AUTO) {
- return 0;
+ nsMargin gutter =
+ ComputeStableScrollbarGutter(styleScrollbarWidth, styleScrollbarGutter);
+ if (gutter.LeftRight() == 0 || gutter.TopBottom() == 0) {
+ // If there is no stable scrollbar-gutter at vertical or horizontal
+ // dimension, check if a scrollbar is always shown at that dimension.
+ ScrollStyles scrollStyles = GetScrollStyles();
+ const nscoord scrollbarSize =
+ GetNonOverlayScrollbarSize(PresContext(), styleScrollbarWidth);
+ if (gutter.LeftRight() == 0 &&
+ scrollStyles.mVertical == StyleOverflow::Scroll) {
+ (IsScrollbarOnRight() ? gutter.right : gutter.left) = scrollbarSize;
+ }
+ if (gutter.TopBottom() == 0 &&
+ scrollStyles.mHorizontal == StyleOverflow::Scroll) {
+ // The horizontal scrollbar is always at the bottom side.
+ gutter.bottom = scrollbarSize;
+ }
}
-
- const nscoord scrollbarSize =
- GetNonOverlayScrollbarSize(PresContext(), styleScrollbarWidth);
- const auto bothEdges =
- bool(styleScrollbarGutter & StyleScrollbarGutter::BOTH_EDGES);
- return bothEdges ? scrollbarSize * 2 : scrollbarSize;
+ return gutter;
}
nsMargin nsHTMLScrollFrame::ComputeStableScrollbarGutter(
@@ -2040,8 +2048,13 @@ class nsHTMLScrollFrame::AsyncSmoothMSDScroll final
* Should be used at most once during the lifetime of this object.
*/
void SetRefreshObserver(nsHTMLScrollFrame* aCallee) {
- NS_ASSERTION(aCallee && !mCallee,
- "AsyncSmoothMSDScroll::SetRefreshObserver - Invalid usage.");
+ MOZ_ASSERT(aCallee,
+ "AsyncSmoothMSDScroll::SetRefreshObserver needs "
+ "a non-null aCallee in order to get a refresh driver");
+ MOZ_RELEASE_ASSERT(!mCallee,
+ "AsyncSmoothMSDScroll::SetRefreshObserver "
+ "shouldn't be called if we're already registered with "
+ "a refresh driver, via a preexisting mCallee");
RefreshDriver(aCallee)->AddRefreshObserver(this, FlushType::Style,
"Smooth scroll (MSD) animation");
@@ -2168,8 +2181,13 @@ class nsHTMLScrollFrame::AsyncScroll final : public nsARefreshObserver {
* Should be used at most once during the lifetime of this object.
*/
void SetRefreshObserver(nsHTMLScrollFrame* aCallee) {
- NS_ASSERTION(aCallee && !mCallee,
- "AsyncScroll::SetRefreshObserver - Invalid usage.");
+ MOZ_ASSERT(aCallee,
+ "AsyncScroll::SetRefreshObserver needs "
+ "a non-null aCallee in order to get a refresh driver");
+ MOZ_RELEASE_ASSERT(!mCallee,
+ "AsyncScroll::SetRefreshObserver "
+ "shouldn't be called if we're already registered with "
+ "a refresh driver, via a preexisting mCallee");
RefreshDriver(aCallee)->AddRefreshObserver(this, FlushType::Style,
"Smooth scroll animation");
@@ -2235,12 +2253,7 @@ void nsHTMLScrollFrame::AsyncScroll::InitSmoothScroll(
case ScrollOrigin::Apz:
// Likewise we should never get APZ-triggered scrolls here, and if that
// changes something is likely broken somewhere.
- MOZ_ASSERT_UNREACHABLE(
- "APZ scroll position updates should never be smooth");
- break;
- case ScrollOrigin::AnchorAdjustment:
- MOZ_ASSERT_UNREACHABLE(
- "scroll anchor adjustments should never be smooth");
+ MOZ_ASSERT(false);
break;
default:
break;
@@ -3016,7 +3029,6 @@ void nsHTMLScrollFrame::ScrollToImpl(
(mLastScrollOrigin != ScrollOrigin::None &&
mLastScrollOrigin != ScrollOrigin::NotSpecified &&
mLastScrollOrigin != ScrollOrigin::Relative &&
- mLastScrollOrigin != ScrollOrigin::AnchorAdjustment &&
mLastScrollOrigin != ScrollOrigin::Apz)) {
aOrigin = ScrollOrigin::Other;
}
@@ -3069,10 +3081,8 @@ void nsHTMLScrollFrame::ScrollToImpl(
// may simplify this a bit and should be fine from the APZ side.
if (mApzSmoothScrollDestination && aOrigin != ScrollOrigin::Clamp) {
if (aOrigin == ScrollOrigin::Relative) {
- AppendScrollUpdate(ScrollPositionUpdate::NewRelativeScroll(
- // Clamp |mApzScrollPos| here. See the comment for this clamping
- // reason below NewRelativeScroll call.
- GetLayoutScrollRange().ClampPoint(mApzScrollPos), pt));
+ AppendScrollUpdate(
+ ScrollPositionUpdate::NewRelativeScroll(mApzScrollPos, pt));
mApzScrollPos = pt;
} else if (aOrigin != ScrollOrigin::Apz) {
ScrollOrigin origin =
@@ -3159,15 +3169,8 @@ void nsHTMLScrollFrame::ScrollToImpl(
if (aOrigin == ScrollOrigin::Relative) {
MOZ_ASSERT(!isScrollOriginDowngrade);
MOZ_ASSERT(mLastScrollOrigin == ScrollOrigin::Relative);
- AppendScrollUpdate(ScrollPositionUpdate::NewRelativeScroll(
- // It's possible that |mApzScrollPos| is no longer within the scroll
- // range, we need to clamp it to the current scroll range, otherwise
- // calculating a relative scroll distance from the outside point will
- // result a point far from the desired point.
- GetLayoutScrollRange().ClampPoint(mApzScrollPos), pt));
- mApzScrollPos = pt;
- } else if (aOrigin == ScrollOrigin::AnchorAdjustment) {
- AppendScrollUpdate(ScrollPositionUpdate::NewMergeableScroll(aOrigin, pt));
+ AppendScrollUpdate(
+ ScrollPositionUpdate::NewRelativeScroll(mApzScrollPos, pt));
mApzScrollPos = pt;
} else if (aOrigin != ScrollOrigin::Apz) {
AppendScrollUpdate(ScrollPositionUpdate::NewScroll(mLastScrollOrigin, pt));
diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h
index e05a2a077b..ce2a75a3df 100644
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -110,7 +110,13 @@ class nsHTMLScrollFrame : public nsContainerFrame,
// Return the sum of inline-size of the scrollbar gutters (if any) at the
// inline-start and inline-end edges of the scroll frame (for a potential
// scrollbar that scrolls in the block axis).
- nscoord IntrinsicScrollbarGutterSizeAtInlineEdges();
+ nscoord IntrinsicScrollbarGutterSizeAtInlineEdges() const;
+
+ // Return the size of space created by scrollbar-gutter or actual scrollbars,
+ // assuming that the content is *not* overflowing the container. In other
+ // words, this space is created by stable scrollbar-gutter or by scrollbars
+ // due to "overflow: scroll".
+ nsMargin IntrinsicScrollbarGutterSize() const;
// Compute stable scrollbar-gutter from scrollbar-width and scrollbar-gutter
// properties.
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index 97d8549cb0..5eb9cde7da 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -28,6 +28,7 @@
#include "nsCSSFrameConstructor.h"
#include "nsDisplayList.h"
#include "nsFieldSetFrame.h"
+#include "nsGfxScrollFrame.h"
#include "nsHashKeys.h"
#include "nsIFrameInlines.h" // for nsIFrame::GetLogicalNormalPosition (don't remove)
#include "nsLayoutUtils.h"
@@ -3685,7 +3686,8 @@ static Subgrid* SubgridComputeMarginBorderPadding(
sz.ComputedLogicalMargin(cbWM) + sz.ComputedLogicalBorderPadding(cbWM);
if (aGridItem.mFrame != subgridFrame) {
- nsIScrollableFrame* scrollFrame = aGridItem.mFrame->GetScrollTargetFrame();
+ nsHTMLScrollFrame* scrollFrame =
+ do_QueryFrame(aGridItem.mFrame->GetScrollTargetFrame());
if (scrollFrame) {
MOZ_ASSERT(
sz.ComputedLogicalMargin(cbWM) == LogicalMargin(cbWM) &&
@@ -3699,7 +3701,7 @@ static Subgrid* SubgridComputeMarginBorderPadding(
szScrollFrame.ComputedLogicalMargin(cbWM) +
szScrollFrame.ComputedLogicalBorder(cbWM);
- nsMargin ssz = scrollFrame->GetActualScrollbarSizes();
+ nsMargin ssz = scrollFrame->IntrinsicScrollbarGutterSize();
subgrid->mMarginBorderPadding += LogicalMargin(cbWM, ssz);
}
@@ -4032,16 +4034,6 @@ static void AlignSelf(const nsGridContainerFrame::GridItemInfo& aGridItem,
aAlignSelf == StyleAlignFlags::LAST_BASELINE) {
aAlignSelf = aGridItem.GetSelfBaseline(aAlignSelf, eLogicalAxisBlock,
&baselineAdjust);
- // Adjust the baseline alignment value if the baseline affects the opposite
- // side of what AlignJustifySelf expects.
- auto state = aGridItem.mState[eLogicalAxisBlock];
- if (aAlignSelf == StyleAlignFlags::LAST_BASELINE &&
- !GridItemInfo::BaselineAlignmentAffectsEndSide(state)) {
- aAlignSelf = StyleAlignFlags::BASELINE;
- } else if (aAlignSelf == StyleAlignFlags::BASELINE &&
- GridItemInfo::BaselineAlignmentAffectsEndSide(state)) {
- aAlignSelf = StyleAlignFlags::LAST_BASELINE;
- }
}
bool isOrthogonal = aCBWM.IsOrthogonalTo(childWM);
@@ -4083,16 +4075,6 @@ static void JustifySelf(const nsGridContainerFrame::GridItemInfo& aGridItem,
aJustifySelf == StyleAlignFlags::LAST_BASELINE) {
aJustifySelf = aGridItem.GetSelfBaseline(aJustifySelf, eLogicalAxisInline,
&baselineAdjust);
- // Adjust the baseline alignment value if the baseline affects the opposite
- // side of what AlignJustifySelf expects.
- auto state = aGridItem.mState[eLogicalAxisInline];
- if (aJustifySelf == StyleAlignFlags::LAST_BASELINE &&
- !GridItemInfo::BaselineAlignmentAffectsEndSide(state)) {
- aJustifySelf = StyleAlignFlags::BASELINE;
- } else if (aJustifySelf == StyleAlignFlags::BASELINE &&
- GridItemInfo::BaselineAlignmentAffectsEndSide(state)) {
- aJustifySelf = StyleAlignFlags::LAST_BASELINE;
- }
}
bool isOrthogonal = aCBWM.IsOrthogonalTo(childWM);
@@ -6006,6 +5988,12 @@ void nsGridContainerFrame::Tracks::InitializeItemBaselines(
const WritingMode containerWM = aState.mWM;
ComputedStyle* containerStyle = aState.mFrame->Style();
+ // The physical side of the container's block start side. We use it to match
+ // against the physical block start side of the child to determine its
+ // baseline sharing group.
+ auto containerBlockStartSide =
+ containerWM.PhysicalSide(MakeLogicalSide(mAxis, eLogicalEdgeStart));
+
for (GridItemInfo& gridItem : aGridItems) {
if (gridItem.IsSubgrid(mAxis)) {
// A subgrid itself is never baseline-aligned.
@@ -6101,6 +6089,27 @@ void nsGridContainerFrame::Tracks::InitializeItemBaselines(
}
if (state & ItemState::eIsBaselineAligned) {
+ // The item is baseline aligned, so calculate the baseline sharing group.
+ // <https://drafts.csswg.org/css-align-3/#baseline-terms>
+ BaselineSharingGroup baselineAlignment =
+ (state & ItemState::eFirstBaseline) ? BaselineSharingGroup::First
+ : BaselineSharingGroup::Last;
+
+ BaselineSharingGroup baselineSharingGroup = [&]() {
+ {
+ auto childAxis = isOrthogonal ? GetOrthogonalAxis(mAxis) : mAxis;
+ auto childBlockStartSide = childWM.PhysicalSide(
+ MakeLogicalSide(childAxis, eLogicalEdgeStart));
+ bool isFirstBaseline = (state & ItemState::eFirstBaseline) != 0;
+ const bool containerAndChildHasEqualBaselineSide =
+ containerBlockStartSide == childBlockStartSide;
+
+ return isFirstBaseline == containerAndChildHasEqualBaselineSide
+ ? BaselineSharingGroup::First
+ : BaselineSharingGroup::Last;
+ }
+ }();
+
// XXXmats if |child| is a descendant of a subgrid then the metrics
// below needs to account for the accumulated MPB somehow...
@@ -6128,16 +6137,13 @@ void nsGridContainerFrame::Tracks::InitializeItemBaselines(
: margin.BStartEnd(containerWM));
Maybe<nscoord> baseline;
- auto baselineSharingGroup = state & ItemState::eFirstBaseline
- ? BaselineSharingGroup::First
- : BaselineSharingGroup::Last;
if (grid) {
baseline.emplace((isOrthogonal == isInlineAxis)
- ? grid->GetBBaseline(baselineSharingGroup)
- : grid->GetIBaseline(baselineSharingGroup));
+ ? grid->GetBBaseline(baselineAlignment)
+ : grid->GetIBaseline(baselineAlignment));
} else {
baseline = child->GetNaturalBaselineBOffset(
- childWM, baselineSharingGroup, BaselineExportContext::Other);
+ childWM, baselineAlignment, BaselineExportContext::Other);
if (!baseline) {
// If baseline alignment is specified on a grid item whose size in
@@ -6162,7 +6168,7 @@ void nsGridContainerFrame::Tracks::InitializeItemBaselines(
if (!isTrackAutoSize ||
!gridItem.IsBSizeDependentOnContainerSize(containerWM)) {
baseline.emplace(Baseline::SynthesizeBOffsetFromBorderBox(
- child, containerWM, baselineSharingGroup));
+ child, containerWM, baselineAlignment));
}
}
}
@@ -6172,15 +6178,19 @@ void nsGridContainerFrame::Tracks::InitializeItemBaselines(
NS_ASSERTION(finalBaseline != NS_INTRINSIC_ISIZE_UNKNOWN,
"about to use an unknown baseline");
+ nscoord marginAdjust = 0;
if (baselineSharingGroup == BaselineSharingGroup::First) {
- finalBaseline += isInlineAxis ? margin.IStart(containerWM)
- : margin.BStart(containerWM);
-
+ marginAdjust = isInlineAxis ? margin.IStart(containerWM)
+ : margin.BStart(containerWM);
} else {
- finalBaseline += isInlineAxis ? margin.IEnd(containerWM)
- : margin.BEnd(containerWM);
- state |= ItemState::eEndSideBaseline;
+ marginAdjust = isInlineAxis ? margin.IEnd(containerWM)
+ : margin.BEnd(containerWM);
+
+ // This flag is used in ::AlignSelf(...) to check whether the item is
+ // last baseline aligned, but this flag should go away.
+ state |= GridItemInfo::eEndSideBaseline;
}
+ finalBaseline += marginAdjust;
auto& baselineItems =
(baselineSharingGroup == BaselineSharingGroup::First)
@@ -7602,7 +7612,12 @@ void nsGridContainerFrame::ReflowInFlowChild(
// This happens when the subtree overflows its track.
// XXX spec issue? it's unclear how to handle this.
baselineAdjust = nscoord(0);
- } else if (GridItemInfo::BaselineAlignmentAffectsEndSide(state)) {
+ } else if (state & ItemState::eLastBaseline) {
+ // FIXME: We're not setting the ItemState::eEndSideBaseline flag any
+ // more as the new baseline sharing group calculation handles most of
+ // the cases we need. For non-masonry grids this flag was always set
+ // for LAST_BASELINE items, so we're just mimicking that behavior here.
+ // That said, masonry grids might not work 100% any more..
baselineAdjust = -baselineAdjust;
}
if (baselineAdjust != nscoord(0)) {
diff --git a/layout/generic/nsGridContainerFrame.h b/layout/generic/nsGridContainerFrame.h
index d785d65a50..cf3a3b5776 100644
--- a/layout/generic/nsGridContainerFrame.h
+++ b/layout/generic/nsGridContainerFrame.h
@@ -106,12 +106,10 @@ class nsGridContainerFrame final : public nsContainerFrame,
using NamedArea = mozilla::StyleNamedArea;
template <typename T>
- using PerBaseline = mozilla::EnumeratedArray<BaselineSharingGroup,
- BaselineSharingGroup(2), T>;
+ using PerBaseline = mozilla::EnumeratedArray<BaselineSharingGroup, T, 2>;
template <typename T>
- using PerLogicalAxis =
- mozilla::EnumeratedArray<LogicalAxis, LogicalAxis(2), T>;
+ using PerLogicalAxis = mozilla::EnumeratedArray<LogicalAxis, T, 2>;
// nsIFrame overrides
void Reflow(nsPresContext* aPresContext, ReflowOutput& aDesiredSize,
diff --git a/layout/generic/nsHTMLParts.h b/layout/generic/nsHTMLParts.h
index e1d7ef4d2d..e3cab48343 100644
--- a/layout/generic/nsHTMLParts.h
+++ b/layout/generic/nsHTMLParts.h
@@ -57,10 +57,6 @@ nsresult NS_NewAttributeContent(nsNodeInfoManager* aNodeInfoManager,
nsContainerFrame* NS_NewSelectsAreaFrame(mozilla::PresShell* aPresShell,
mozilla::ComputedStyle* aStyle);
-// Create a block formatting context blockframe
-nsBlockFrame* NS_NewBlockFormattingContext(mozilla::PresShell* aPresShell,
- mozilla::ComputedStyle* aStyle);
-
nsIFrame* NS_NewBRFrame(mozilla::PresShell* aPresShell,
mozilla::ComputedStyle* aStyle);
diff --git a/layout/generic/nsIFrame.cpp b/layout/generic/nsIFrame.cpp
index 81109151ff..479c26d18b 100644
--- a/layout/generic/nsIFrame.cpp
+++ b/layout/generic/nsIFrame.cpp
@@ -2117,8 +2117,8 @@ nsIFrame::CaretBlockAxisMetrics nsIFrame::GetCaretBlockAxisMetrics(
return CaretBlockAxisMetrics{.mOffset = baseline - ascent, .mExtent = height};
}
-const nsAtom* nsIFrame::ComputePageValue() const {
- const nsAtom* value = nsGkAtoms::_empty;
+const nsAtom* nsIFrame::ComputePageValue(const nsAtom* aAutoValue) const {
+ const nsAtom* value = aAutoValue ? aAutoValue : nsGkAtoms::_empty;
const nsIFrame* frame = this;
// Find what CSS page name value this frame's subtree has, if any.
// Starting with this frame, check if a page name other than auto is present,
@@ -2484,7 +2484,7 @@ bool nsIFrame::CanBeDynamicReflowRoot() const {
// If we participate in a container's block reflow context, or margins
// can collapse through us, we can't be a dynamic reflow root.
- if (IsBlockFrameOrSubclass() && !HasAnyStateBits(NS_BLOCK_BFC_STATE_BITS)) {
+ if (IsBlockFrameOrSubclass() && !HasAnyStateBits(NS_BLOCK_BFC)) {
return false;
}
@@ -3409,6 +3409,9 @@ void nsIFrame::BuildDisplayListForStackingContext(
ApplyClipProp(transformedCssClip);
}
+ uint32_t numActiveScrollframesEncounteredBefore =
+ aBuilder->GetNumActiveScrollframesEncountered();
+
nsDisplayListCollection set(aBuilder);
Maybe<nsRect> clipForMask;
{
@@ -3692,17 +3695,22 @@ void nsIFrame::BuildDisplayListForStackingContext(
if (transformItem) {
resultList.AppendToTop(transformItem);
createdContainer = true;
- }
- if (hasPerspective) {
- transformItem->MarkWithAssociatedPerspective();
+ if (numActiveScrollframesEncounteredBefore !=
+ aBuilder->GetNumActiveScrollframesEncountered()) {
+ transformItem->SetContainsASRs(true);
+ }
+
+ if (hasPerspective) {
+ transformItem->MarkWithAssociatedPerspective();
- if (clipCapturedBy == ContainerItemType::Perspective) {
- clipState.Restore();
+ if (clipCapturedBy == ContainerItemType::Perspective) {
+ clipState.Restore();
+ }
+ resultList.AppendNewToTop<nsDisplayPerspective>(aBuilder, this,
+ &resultList);
+ createdContainer = true;
}
- resultList.AppendNewToTop<nsDisplayPerspective>(aBuilder, this,
- &resultList);
- createdContainer = true;
}
}
@@ -5413,7 +5421,15 @@ static FrameTarget GetSelectionClosestFrame(nsIFrame* aFrame,
const nsPoint& aPoint,
uint32_t aFlags);
-static bool SelfIsSelectable(nsIFrame* aFrame, uint32_t aFlags) {
+static bool SelfIsSelectable(nsIFrame* aFrame, nsIFrame* aParentFrame,
+ uint32_t aFlags) {
+ // We should not move selection into a native anonymous subtree when handling
+ // selection outside it.
+ if ((aFlags & nsIFrame::IGNORE_NATIVE_ANONYMOUS_SUBTREE) &&
+ aParentFrame->GetClosestNativeAnonymousSubtreeRoot() !=
+ aFrame->GetClosestNativeAnonymousSubtreeRoot()) {
+ return false;
+ }
if ((aFlags & nsIFrame::SKIP_HIDDEN) &&
!aFrame->StyleVisibility()->IsVisible()) {
return false;
@@ -5476,21 +5492,28 @@ static FrameTarget DrillDownToSelectionFrame(nsIFrame* aFrame, bool aEndFrame,
nsIFrame* result = nullptr;
nsIFrame* frame = aFrame->PrincipalChildList().FirstChild();
if (!aEndFrame) {
- while (frame && (!SelfIsSelectable(frame, aFlags) || frame->IsEmpty()))
+ while (frame &&
+ (!SelfIsSelectable(frame, aFrame, aFlags) || frame->IsEmpty())) {
frame = frame->GetNextSibling();
- if (frame) result = frame;
+ }
+ if (frame) {
+ result = frame;
+ }
} else {
// Because the frame tree is singly linked, to find the last frame,
// we have to iterate through all the frames
// XXX I have a feeling this could be slow for long blocks, although
// I can't find any slowdowns
while (frame) {
- if (!frame->IsEmpty() && SelfIsSelectable(frame, aFlags))
+ if (!frame->IsEmpty() && SelfIsSelectable(frame, aFrame, aFlags)) {
result = frame;
+ }
frame = frame->GetNextSibling();
}
}
- if (result) return DrillDownToSelectionFrame(result, aEndFrame, aFlags);
+ if (result) {
+ return DrillDownToSelectionFrame(result, aEndFrame, aFlags);
+ }
}
// If the current frame has no targetable children, target the current frame
return FrameTarget{aFrame, true, aEndFrame};
@@ -5502,8 +5525,9 @@ static FrameTarget GetSelectionClosestFrameForLine(
nsBlockFrame* aParent, nsBlockFrame::LineIterator aLine,
const nsPoint& aPoint, uint32_t aFlags) {
// Account for end of lines (any iterator from the block is valid)
- if (aLine == aParent->LinesEnd())
+ if (aLine == aParent->LinesEnd()) {
return DrillDownToSelectionFrame(aParent, true, aFlags);
+ }
nsIFrame* frame = aLine->mFirstChild;
nsIFrame* closestFromIStart = nullptr;
nsIFrame* closestFromIEnd = nullptr;
@@ -5519,7 +5543,7 @@ static FrameTarget GetSelectionClosestFrameForLine(
// the previous thing had a different editableness than us, since then we
// may end up not being able to select after it if the br is the last thing
// on the line.
- if (!SelfIsSelectable(frame, aFlags) || frame->IsEmpty() ||
+ if (!SelfIsSelectable(frame, aParent, aFlags) || frame->IsEmpty() ||
(canSkipBr && frame->IsBrFrame() &&
lastFrameWasEditable == frame->GetContent()->IsEditable())) {
continue;
@@ -5699,7 +5723,7 @@ static FrameTarget GetSelectionClosestFrame(nsIFrame* aFrame,
// Go through all the child frames to find the closest one
nsIFrame::FrameWithDistance closest = {nullptr, nscoord_MAX, nscoord_MAX};
for (; kid; kid = kid->GetNextSibling()) {
- if (!SelfIsSelectable(kid, aFlags) || kid->IsEmpty()) {
+ if (!SelfIsSelectable(kid, aFrame, aFlags) || kid->IsEmpty()) {
continue;
}
@@ -9368,7 +9392,8 @@ nsresult nsIFrame::PeekOffsetForLineEdge(PeekOffsetStruct* aPos) {
}
}
}
- FrameTarget targetFrame = DrillDownToSelectionFrame(baseFrame, endOfLine, 0);
+ FrameTarget targetFrame = DrillDownToSelectionFrame(
+ baseFrame, endOfLine, nsIFrame::IGNORE_NATIVE_ANONYMOUS_SUBTREE);
SetPeekResultFromFrame(*aPos, targetFrame.frame, endOfLine ? -1 : 0,
OffsetIsAtLineEdge::Yes);
if (endOfLine && targetFrame.frame->HasSignificantTerminalNewline()) {
@@ -11538,11 +11563,44 @@ nsIFrame::PhysicalAxes nsIFrame::ShouldApplyOverflowClipping(
return PhysicalAxes::None;
}
- // If we're paginated and a block, and have NS_BLOCK_CLIP_PAGINATED_OVERFLOW
- // set, then we want to clip our overflow.
- bool clip = HasAnyStateBits(NS_BLOCK_CLIP_PAGINATED_OVERFLOW) &&
- PresContext()->IsPaginated() && IsBlockFrame();
- return clip ? PhysicalAxes::Both : PhysicalAxes::None;
+ return IsSuppressedScrollableBlockForPrint() ? PhysicalAxes::Both
+ : PhysicalAxes::None;
+}
+
+bool nsIFrame::IsSuppressedScrollableBlockForPrint() const {
+ // This condition needs to match the suppressScrollFrame logic in the frame
+ // constructor.
+ if (!PresContext()->IsPaginated() || !IsBlockFrame() ||
+ !StyleDisplay()->IsScrollableOverflow() ||
+ !StyleDisplay()->IsBlockOutsideStyle() ||
+ mContent->IsInNativeAnonymousSubtree()) {
+ return false;
+ }
+ if (auto* element = Element::FromNode(mContent);
+ element && PresContext()->ElementWouldPropagateScrollStyles(*element)) {
+ return false;
+ }
+ return true;
+}
+
+bool nsIFrame::HasUnreflowedContainerQueryAncestor() const {
+ // If this frame has done the first reflow, its ancestors are guaranteed to
+ // have as well.
+ if (!HasAnyStateBits(NS_FRAME_FIRST_REFLOW) ||
+ !PresContext()->HasContainerQueryFrames()) {
+ return false;
+ }
+ for (nsIFrame* cur = GetInFlowParent(); cur; cur = cur->GetInFlowParent()) {
+ if (!cur->HasAnyStateBits(NS_FRAME_FIRST_REFLOW)) {
+ // Done first reflow from this ancestor up, including query containers.
+ return false;
+ }
+ if (cur->StyleDisplay()->IsQueryContainer()) {
+ return true;
+ }
+ }
+ // No query container from this frame up to root.
+ return false;
}
#ifdef DEBUG
diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
index a29786488f..16f3d17d64 100644
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -562,6 +562,8 @@ enum class LayoutFrameClassFlags : uint16_t {
SupportsContainLayoutAndPaint = 1 << 13,
// Whether this frame class supports the `aspect-ratio` property.
SupportsAspectRatio = 1 << 14,
+ // Whether this frame class is always a BFC.
+ BlockFormattingContext = 1 << 15,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(LayoutFrameClassFlags)
@@ -1380,6 +1382,8 @@ class nsIFrame : public nsQueryFrame {
return nullptr;
}
+ bool HasUnreflowedContainerQueryAncestor() const;
+
private:
// The value that the CSS page-name "auto" keyword resolves to for children
// of this frame.
@@ -1643,7 +1647,13 @@ class nsIFrame : public nsQueryFrame {
// This is intended to be used either on the root frame to find the first
// page's page-name, or on a newly created continuation to find what the new
// page's page-name will be.
- const nsAtom* ComputePageValue() const MOZ_NONNULL_RETURN;
+ //
+ // The auto page value can be set by the caller. This is useful when trying
+ // to compute a page value in the middle of a frame tree. In that case the
+ // auto value can be found from the AutoPageValue frame property of the
+ // parent frame. A null auto value is interpreted as the empty-string atom.
+ const nsAtom* ComputePageValue(const nsAtom* aAutoValue = nullptr) const
+ MOZ_NONNULL_RETURN;
///////////////////////////////////////////////////////////////////////////////
// The public visibility API.
@@ -3027,6 +3037,9 @@ class nsIFrame : public nsQueryFrame {
nsSize OverflowClipMargin(PhysicalAxes aClipAxes) const;
// Returns the axes on which this frame should apply overflow clipping.
PhysicalAxes ShouldApplyOverflowClipping(const nsStyleDisplay* aDisp) const;
+ // Returns whether this frame is a block that was supposed to be a
+ // scrollframe, but that was suppressed for print.
+ bool IsSuppressedScrollableBlockForPrint() const;
/**
* Helper method used by block reflow to identify runs of text so
diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp
index e0a6243ed2..c1e69df6c9 100644
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -18,6 +18,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/Encoding.h"
#include "mozilla/HTMLEditor.h"
+#include "mozilla/dom/FetchPriority.h"
#include "mozilla/dom/ImageTracker.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Helpers.h"
@@ -268,7 +269,7 @@ BrokenImageIcon::BrokenImageIcon(const nsImageFrame& aFrame) {
loadFlags, nullptr, contentPolicyType, u""_ns,
false, /* aUseUrgentStartForChannel */
false, /* aLinkPreload */
- 0, getter_AddRefs(mImage));
+ 0, FetchPriority::Auto, getter_AddRefs(mImage));
Unused << NS_WARN_IF(NS_FAILED(rv));
}
@@ -554,15 +555,16 @@ void nsImageFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
//
// TODO(emilio): We might want to do the same for regular list-style-image or
// even simple content: url() changes.
- if (mKind == Kind::XULImage) {
- if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) && aOldStyle &&
+ if (mKind == Kind::XULImage && aOldStyle) {
+ if (!mContent->AsElement()->HasNonEmptyAttr(nsGkAtoms::src) &&
aOldStyle->StyleList()->mListStyleImage !=
StyleList()->mListStyleImage) {
UpdateXULImage();
}
- if (!mOwnedRequest && aOldStyle &&
- aOldStyle->StyleDisplay()->EffectiveAppearance() !=
- StyleDisplay()->EffectiveAppearance()) {
+ // If we have no image our intrinsic size might be themed. We need to
+ // update the size even if the effective appearance hasn't changed to
+ // deal correctly with theme changes.
+ if (!mOwnedRequest) {
UpdateIntrinsicSize();
}
}
diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp
index 03aa6e87b3..ab6924faa4 100644
--- a/layout/generic/nsLineLayout.cpp
+++ b/layout/generic/nsLineLayout.cpp
@@ -430,7 +430,7 @@ void nsLineLayout::BeginSpan(nsIFrame* aFrame,
psd->mIStart = aIStart;
psd->mICoord = aIStart;
psd->mIEnd = aIEnd;
- psd->mInset = mCurrentSpan->mInset;
+ psd->mInset = 0; // inset applies only to the root span
psd->mBaseline = aBaseline;
nsIFrame* frame = aSpanReflowInput->mFrame;
@@ -735,8 +735,7 @@ static bool IsPercentageAware(const nsIFrame* aFrame, WritingMode aWM) {
disp->DisplayInside() == StyleDisplayInside::Table)) ||
fType == LayoutFrameType::HTMLButtonControl ||
fType == LayoutFrameType::GfxButtonControl ||
- fType == LayoutFrameType::FieldSet ||
- fType == LayoutFrameType::ComboboxDisplay) {
+ fType == LayoutFrameType::FieldSet) {
return true;
}
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index 369722fe8d..9afefc5c28 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -226,6 +226,7 @@ struct nsTextFrame::DrawTextRunParams {
float textStrokeWidth = 0.0f;
bool drawSoftHyphen = false;
bool hasTextShadow = false;
+ bool paintingShadows = false;
DrawTextRunParams(gfxContext* aContext,
mozilla::gfx::PaletteCache& aPaletteCache)
: context(aContext), paletteCache(aPaletteCache) {}
@@ -276,6 +277,7 @@ struct nsTextFrame::PaintShadowParams {
Point framePt;
Point textBaselinePt;
gfxContext* context;
+ DrawPathCallbacks* callbacks = nullptr;
nscolor foregroundColor = NS_RGBA(0, 0, 0, 0);
const ClipEdges* clipEdges = nullptr;
PropertyProvider* provider = nullptr;
@@ -5374,9 +5376,8 @@ void nsTextFrame::UnionAdditionalOverflow(nsPresContext* aPresContext,
// Text-shadow overflows
if (aIncludeShadows) {
- nsRect shadowRect =
+ *aInkOverflowRect =
nsLayoutUtils::GetTextShadowRectsUnion(*aInkOverflowRect, this);
- aInkOverflowRect->UnionRect(*aInkOverflowRect, shadowRect);
}
// When this frame is not selected, the text-decoration area must be in
@@ -5460,6 +5461,7 @@ struct nsTextFrame::PaintDecorationLineParams
gfxFloat baselineOffset = 0.0f;
DecorationType decorationType = DecorationType::Normal;
DrawPathCallbacks* callbacks = nullptr;
+ bool paintingShadows = false;
};
void nsTextFrame::PaintDecorationLine(
@@ -5474,9 +5476,11 @@ void nsTextFrame::PaintDecorationLine(
if (aParams.callbacks) {
Rect path = nsCSSRendering::DecorationLineToPath(params);
if (aParams.decorationType == DecorationType::Normal) {
- aParams.callbacks->PaintDecorationLine(path, params.color);
+ aParams.callbacks->PaintDecorationLine(path, aParams.paintingShadows,
+ params.color);
} else {
- aParams.callbacks->PaintSelectionDecorationLine(path, params.color);
+ aParams.callbacks->PaintSelectionDecorationLine(
+ path, aParams.paintingShadows, params.color);
}
} else {
nsCSSRendering::PaintDecorationLine(this, *aParams.context->GetDrawTarget(),
@@ -5938,6 +5942,7 @@ void nsTextFrame::PaintOneShadow(const PaintShadowParams& aParams,
gfxFloat advanceWidth;
nsTextPaintStyle textPaintStyle(this);
DrawTextParams params(shadowContext, PresContext()->FontPaletteCache());
+ params.paintingShadows = true;
params.advanceWidth = &advanceWidth;
params.dirtyRect = aParams.dirtyRect;
params.framePt = aParams.framePt + shadowGfxOffset;
@@ -5945,9 +5950,10 @@ void nsTextFrame::PaintOneShadow(const PaintShadowParams& aParams,
params.textStyle = &textPaintStyle;
params.textColor =
aParams.context == shadowContext ? shadowColor : NS_RGB(0, 0, 0);
+ params.callbacks = aParams.callbacks;
params.clipEdges = aParams.clipEdges;
params.drawSoftHyphen = HasAnyStateBits(TEXT_HYPHEN_BREAK);
- // Multi-color shadow is not allowed, so we use the same color of the text
+ // Multi-color shadow is not allowed, so we use the same color as the text
// color.
params.decorationOverrideColor = &params.textColor;
params.fontPalette = StyleFont()->GetFontPaletteAtom();
@@ -6253,6 +6259,7 @@ bool nsTextFrame::PaintTextWithSelectionColors(
PaintShadowParams shadowParams(aParams);
shadowParams.provider = aParams.provider;
+ shadowParams.callbacks = aParams.callbacks;
shadowParams.clipEdges = &aClipEdges;
// Draw text
@@ -6815,6 +6822,7 @@ void nsTextFrame::PaintText(const PaintTextParams& aParams,
shadowParams.textBaselinePt = textBaselinePt;
shadowParams.leftSideOffset = snappedStartEdge;
shadowParams.provider = &provider;
+ shadowParams.callbacks = aParams.callbacks;
shadowParams.foregroundColor = foregroundColor;
shadowParams.clipEdges = &clipEdges;
PaintShadows(textStyle->mTextShadow.AsSpan(), shadowParams);
@@ -6854,7 +6862,8 @@ static void DrawTextRun(const gfxTextRun* aTextRun,
params.callbacks = aParams.callbacks;
params.hasTextShadow = aParams.hasTextShadow;
if (aParams.callbacks) {
- aParams.callbacks->NotifyBeforeText(aParams.textColor);
+ aParams.callbacks->NotifyBeforeText(aParams.paintingShadows,
+ aParams.textColor);
params.drawMode = DrawMode::GLYPH_PATH;
aTextRun->Draw(aRange, aTextBaselinePt, params);
aParams.callbacks->NotifyAfterText();
@@ -6995,6 +7004,7 @@ void nsTextFrame::DrawTextRunAndDecorations(
params.callbacks = aParams.callbacks;
params.glyphRange = aParams.glyphRange;
params.provider = aParams.provider;
+ params.paintingShadows = aParams.paintingShadows;
// pt is the physical point where the decoration is to be drawn,
// relative to the frame; one of its coordinates will be updated below.
params.pt = Point(x / app, y / app);
diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h
index 568d3333c2..707d39dba2 100644
--- a/layout/generic/nsTextFrame.h
+++ b/layout/generic/nsTextFrame.h
@@ -513,20 +513,22 @@ class nsTextFrame : public nsIFrame {
* Called before (for under/over-line) or after (for line-through) the text
* is drawn to have a text decoration line drawn.
*/
- virtual void PaintDecorationLine(Rect aPath, nscolor aColor) {}
+ virtual void PaintDecorationLine(Rect aPath, bool aPaintingShadows,
+ nscolor aColor) {}
/**
* Called after selected text is drawn to have a decoration line drawn over
* the text. (All types of text decoration are drawn after the text when
* text is selected.)
*/
- virtual void PaintSelectionDecorationLine(Rect aPath, nscolor aColor) {}
+ virtual void PaintSelectionDecorationLine(Rect aPath, bool aPaintingShadows,
+ nscolor aColor) {}
/**
* Called just before any paths have been emitted to the gfxContext
* for the glyphs of the frame's text.
*/
- virtual void NotifyBeforeText(nscolor aColor) {}
+ virtual void NotifyBeforeText(bool aPaintingShadows, nscolor aColor) {}
/**
* Called just after all the paths have been emitted to the gfxContext
diff --git a/layout/generic/nsTextPaintStyle.cpp b/layout/generic/nsTextPaintStyle.cpp
index 0eff737602..e97a059b07 100644
--- a/layout/generic/nsTextPaintStyle.cpp
+++ b/layout/generic/nsTextPaintStyle.cpp
@@ -417,8 +417,8 @@ struct StyleIDs {
LookAndFeel::IntID mLineStyle;
LookAndFeel::FloatID mLineRelativeSize;
};
-EnumeratedArray<nsTextPaintStyle::SelectionStyleIndex,
- nsTextPaintStyle::SelectionStyleIndex::Count, StyleIDs>
+EnumeratedArray<nsTextPaintStyle::SelectionStyleIndex, StyleIDs,
+ size_t(nsTextPaintStyle::SelectionStyleIndex::Count)>
SelectionStyleIDs = {
StyleIDs{LookAndFeel::ColorID::IMERawInputForeground,
LookAndFeel::ColorID::IMERawInputBackground,
diff --git a/layout/generic/nsTextPaintStyle.h b/layout/generic/nsTextPaintStyle.h
index a99ee9fd46..adf28fdad8 100644
--- a/layout/generic/nsTextPaintStyle.h
+++ b/layout/generic/nsTextPaintStyle.h
@@ -144,8 +144,9 @@ class MOZ_STACK_CLASS nsTextPaintStyle {
StyleTextDecorationStyle mUnderlineStyle;
float mUnderlineRelativeSize;
};
- mozilla::EnumeratedArray<SelectionStyleIndex, SelectionStyleIndex::Count,
- mozilla::Maybe<nsSelectionStyle>>
+ mozilla::EnumeratedArray<SelectionStyleIndex,
+ mozilla::Maybe<nsSelectionStyle>,
+ size_t(SelectionStyleIndex::Count)>
mSelectionStyle;
// Color initializations
diff --git a/layout/inspector/InspectorUtils.cpp b/layout/inspector/InspectorUtils.cpp
index e2111aa9bd..f1886a0dd0 100644
--- a/layout/inspector/InspectorUtils.cpp
+++ b/layout/inspector/InspectorUtils.cpp
@@ -351,9 +351,7 @@ uint32_t InspectorUtils::GetRelativeRuleLine(GlobalObject& aGlobal,
return aRule.GetLineNumber() + 1;
}
-
-void InspectorUtils::GetRuleIndex(GlobalObject& aGlobal,
- css::Rule& aRule,
+void InspectorUtils::GetRuleIndex(GlobalObject& aGlobal, css::Rule& aRule,
nsTArray<uint32_t>& aResult) {
css::Rule* currentRule = &aRule;
@@ -401,21 +399,56 @@ bool InspectorUtils::HasRulesModifiedByCSSOM(GlobalObject& aGlobal,
return aSheet.HasModifiedRulesForDevtools();
}
-static void CollectRules(ServoCSSRuleList& aRuleList,
- nsTArray<RefPtr<css::Rule>>& aResult) {
- for (uint32_t i = 0, len = aRuleList.Length(); i < len; ++i) {
+static uint32_t CollectAtRules(ServoCSSRuleList& aRuleList,
+ Sequence<OwningNonNull<css::Rule>>& aResult) {
+ uint32_t len = aRuleList.Length();
+ uint32_t ruleCount = len;
+ for (uint32_t i = 0; i < len; ++i) {
css::Rule* rule = aRuleList.GetRule(i);
- aResult.AppendElement(rule);
+ // This collect rules we want to display in Devtools Style Editor toolbar.
+ // When adding a new StyleCssRuleType, put it in the "default" list, and
+ // file a new bug with
+ // https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Style%20Editor&short_desc=Consider%20displaying%20new%20XXX%20rule%20type%20in%20at-rules%20sidebar
+ // so the DevTools team gets notified and can decide if it should be
+ // displayed.
+ switch (rule->Type()) {
+ case StyleCssRuleType::Media:
+ case StyleCssRuleType::Supports:
+ case StyleCssRuleType::LayerBlock:
+ case StyleCssRuleType::Container: {
+ Unused << aResult.AppendElement(OwningNonNull(*rule), fallible);
+ break;
+ }
+ case StyleCssRuleType::Style:
+ case StyleCssRuleType::Import:
+ case StyleCssRuleType::Document:
+ case StyleCssRuleType::LayerStatement:
+ case StyleCssRuleType::FontFace:
+ case StyleCssRuleType::Page:
+ case StyleCssRuleType::Property:
+ case StyleCssRuleType::Keyframes:
+ case StyleCssRuleType::Keyframe:
+ case StyleCssRuleType::Margin:
+ case StyleCssRuleType::Namespace:
+ case StyleCssRuleType::CounterStyle:
+ case StyleCssRuleType::FontFeatureValues:
+ case StyleCssRuleType::FontPaletteValues:
+ break;
+ }
+
if (rule->IsGroupRule()) {
- CollectRules(*static_cast<css::GroupRule*>(rule)->CssRules(), aResult);
+ ruleCount += CollectAtRules(
+ *static_cast<css::GroupRule*>(rule)->CssRules(), aResult);
}
}
+ return ruleCount;
}
-void InspectorUtils::GetAllStyleSheetCSSStyleRules(
+void InspectorUtils::GetStyleSheetRuleCountAndAtRules(
GlobalObject& aGlobal, StyleSheet& aSheet,
- nsTArray<RefPtr<css::Rule>>& aResult) {
- CollectRules(*aSheet.GetCssRulesInternal(), aResult);
+ InspectorStyleSheetRuleCountAndAtRulesResult& aResult) {
+ aResult.mRuleCount =
+ CollectAtRules(*aSheet.GetCssRulesInternal(), aResult.mAtRules);
}
/* static */
@@ -602,6 +635,26 @@ void InspectorUtils::ColorToRGBA(GlobalObject&, const nsACString& aColorString,
}
/* static */
+void InspectorUtils::ColorTo(GlobalObject&, const nsACString& aFromColor,
+ const nsACString& aToColorSpace,
+ Nullable<InspectorColorToResult>& aResult) {
+ nsCString resultColor;
+ nsTArray<float> resultComponents;
+ bool resultAdjusted = false;
+
+ if (!ServoCSSParser::ColorTo(aFromColor, aToColorSpace, &resultColor,
+ &resultComponents, &resultAdjusted)) {
+ aResult.SetNull();
+ return;
+ }
+
+ auto& result = aResult.SetValue();
+ result.mColor.AssignASCII(resultColor);
+ result.mComponents = std::move(resultComponents);
+ result.mAdjusted = resultAdjusted;
+}
+
+/* static */
bool InspectorUtils::IsValidCSSColor(GlobalObject& aGlobalObject,
const nsACString& aColorString) {
return ServoCSSParser::IsValidCSSColor(aColorString);
@@ -946,5 +999,23 @@ void InspectorUtils::GetCSSRegisteredProperties(
}
}
+/* static */
+void InspectorUtils::GetRuleBodyTextOffsets(
+ GlobalObject&, const nsACString& aInitialText,
+ Nullable<InspectorGetRuleBodyTextResult>& aResult) {
+ uint32_t resultStartOffset;
+ uint32_t resultEndOffset;
+
+ if (!Servo_GetRuleBodyTextOffsets(&aInitialText, &resultStartOffset,
+ &resultEndOffset)) {
+ aResult.SetNull();
+ return;
+ }
+
+ InspectorGetRuleBodyTextResult& offsets = aResult.SetValue();
+ offsets.mStartOffset = resultStartOffset;
+ offsets.mEndOffset = resultEndOffset;
+}
+
} // namespace dom
} // namespace mozilla
diff --git a/layout/inspector/InspectorUtils.h b/layout/inspector/InspectorUtils.h
index 06bc0ff5fc..f375e51472 100644
--- a/layout/inspector/InspectorUtils.h
+++ b/layout/inspector/InspectorUtils.h
@@ -78,9 +78,9 @@ class InspectorUtils {
static bool HasRulesModifiedByCSSOM(GlobalObject& aGlobal,
StyleSheet& aSheet);
- static void GetAllStyleSheetCSSStyleRules(
+ static void GetStyleSheetRuleCountAndAtRules(
GlobalObject& aGlobal, StyleSheet& aSheet,
- nsTArray<RefPtr<css::Rule>>& aResult);
+ InspectorStyleSheetRuleCountAndAtRulesResult& aResult);
// Utilities for working with CSS properties
//
@@ -118,6 +118,11 @@ class InspectorUtils {
const Document*,
Nullable<InspectorRGBATuple>& aResult);
+ // Convert a given CSS color string to another color space.
+ static void ColorTo(GlobalObject&, const nsACString& aFromColor,
+ const nsACString& aToColorSpace,
+ Nullable<InspectorColorToResult>& aResult);
+
// Check whether a given color is a valid CSS color.
static bool IsValidCSSColor(GlobalObject& aGlobal,
const nsACString& aColorString);
@@ -263,6 +268,13 @@ class InspectorUtils {
static void GetCSSRegisteredProperties(
GlobalObject& aGlobal, Document& aDocument,
nsTArray<InspectorCSSPropertyDefinition>& aResult);
+
+ /**
+ * Get the rule body text start and end offsets within aInitialText
+ */
+ static void GetRuleBodyTextOffsets(
+ GlobalObject&, const nsACString& aInitialText,
+ Nullable<InspectorGetRuleBodyTextResult>& aResult);
};
} // namespace mozilla::dom
diff --git a/layout/inspector/tests/mochitest.toml b/layout/inspector/tests/mochitest.toml
index 3db9693c20..e51941752b 100644
--- a/layout/inspector/tests/mochitest.toml
+++ b/layout/inspector/tests/mochitest.toml
@@ -3,6 +3,7 @@ prefs = [
"layout.css.basic-shape-rect.enabled=true",
"layout.css.basic-shape-xywh.enabled=true",
"layout.css.properties-and-values.enabled=true",
+ "layout.css.transition-behavior.enabled=true",
"dom.customHighlightAPI.enabled=true",
]
support-files = [
@@ -32,6 +33,8 @@ support-files = [
["test_bug1006595.html"]
+["test_color_to.html"]
+
["test_color_to_rgba.html"]
["test_containing_block_of.html"]
diff --git a/layout/inspector/tests/test_bug877690.html b/layout/inspector/tests/test_bug877690.html
index 0c01428176..9e5efca0d3 100644
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -145,7 +145,7 @@ function do_test() {
var values = InspectorUtils.getCSSValuesForProperty(prop);
var expected = [ "initial", "all", "unset", "cubic-bezier", "ease", "ease-in", "ease-in-out",
"ease-out", "inherit", "revert", "revert-layer", "linear", "none", "step-end", "step-start",
- "steps" ];
+ "steps", "normal", "allow-discrete" ];
ok(testValues(values, expected), "property transition's values.");
// test invalid property
diff --git a/layout/inspector/tests/test_color_to.html b/layout/inspector/tests/test_color_to.html
new file mode 100644
index 0000000000..b2c14e68c1
--- /dev/null
+++ b/layout/inspector/tests/test_color_to.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>Test InspectorUtils::ColorTo</title>
+ <script src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+ <script>
+ const InspectorUtils = SpecialPowers.InspectorUtils;
+
+ const kEpsilon = 0.001;
+
+ const chocolate = "color(srgb 0.8235294117647058 0.4117647058823529 0.11764705882352941)";
+ const chocolateAlpha = "color(srgb 0.8235294117647058 0.4117647058823529 0.11764705882352941 / 0.4)";
+ const noneColor = "color(srgb none none none / none)";
+
+ testColor(chocolate, "srgb", "rgb(82.35% 41.18% 11.76%)", [0.8235, 0.4118, 0.1176, 1], false);
+ testColor(chocolateAlpha, "srgb", "rgb(82.35% 41.18% 11.76% / 0.4)", [0.8235, 0.4118, 0.1176, 0.4], false);
+ testColor(noneColor, "srgb", "rgb(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "hsl", "hsl(25deg 75% 47.06%)", [25, 75, 47.0588, 1], false);
+ testColor(chocolateAlpha, "hsl", "hsl(25deg 75% 47.06% / 0.4)", [25, 75, 47.0588, 0.4], false);
+ testColor(noneColor, "hsl", "hsl(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "hwb", "hwb(25deg 11.76% 17.65%)", [25, 11.7647, 17.6471, 1], false);
+ testColor(chocolateAlpha, "hwb", "hwb(25deg 11.76% 17.65% / 0.4)", [25, 11.7647, 17.6471, 0.4], false);
+ testColor(noneColor, "hwb", "hwb(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "lab", "lab(56.63% 39.24 57.55)", [56.6293, 39.2371, 57.5538, 1], false);
+ testColor(chocolateAlpha, "lab", "lab(56.63% 39.24 57.55 / 0.4)", [56.6293, 39.2371, 57.5538, 0.4], false);
+ testColor(noneColor, "lab", "lab(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "lch", "lch(56.63 69.66 55.72deg)", [56.6293, 69.6562, 55.7159, 1], false);
+ testColor(chocolateAlpha, "lch", "lch(56.63 69.66 55.72deg / 0.4)", [56.6293, 69.6562, 55.7159, 0.4], false);
+ testColor(noneColor, "lch", "lch(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "oklab", "oklab(63.44% 0.1 0.12)", [0.6344, 0.0991, 0.1192, 1], false);
+ testColor(chocolateAlpha, "oklab", "oklab(63.44% 0.1 0.12 / 0.4)", [0.6344, 0.0991, 0.1192, 0.4], false);
+ testColor(noneColor, "oklab", "oklab(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "oklch", "oklch(0.63 0.15 50.27deg)", [0.6344, 0.1550, 50.2665, 1], false);
+ testColor(chocolateAlpha, "oklch", "oklch(0.63 0.15 50.27deg / 0.4)", [0.6344, 0.1550, 50.2665, 0.4], false);
+ testColor(noneColor, "oklch", "oklch(none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "srgb-linear", "color(srgb-linear 0.64 0.14 0.01)", [0.6445, 0.1413, 0.0130, 1], false);
+ testColor(chocolateAlpha, "srgb-linear", "color(srgb-linear 0.64 0.14 0.01 / 0.4)", [0.6445, 0.1413, 0.0130, 0.4], false);
+ testColor(noneColor, "srgb-linear", "color(srgb-linear none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "display-p3", "color(display-p3 0.77 0.43 0.2)", [0.7706, 0.434, 0.1998, 1], false);
+ testColor(chocolateAlpha, "display-p3", "color(display-p3 0.77 0.43 0.2 / 0.4)", [0.7706, 0.434, 0.1998, 0.4], false);
+ testColor(noneColor, "display-p3", "color(display-p3 none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "a98-rgb", "color(a98-rgb 0.73 0.41 0.16)", [0.7304, 0.4107, 0.162, 1], false);
+ testColor(chocolateAlpha, "a98-rgb", "color(a98-rgb 0.73 0.41 0.16 / 0.4)", [0.7304, 0.4107, 0.162, 0.4], false);
+ testColor(noneColor, "a98-rgb", "color(a98-rgb none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "prophoto-rgb", "color(prophoto-rgb 0.59 0.39 0.16)", [0.5923, 0.3941, 0.1643, 1], false);
+ testColor(chocolateAlpha, "prophoto-rgb", "color(prophoto-rgb 0.59 0.39 0.16 / 0.4)", [0.5923, 0.3941, 0.1643, 0.4], false);
+ testColor(noneColor, "prophoto-rgb", "color(prophoto-rgb none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "rec2020", "color(rec2020 0.67 0.4 0.14)", [0.6693, 0.4019, 0.1427, 1], false);
+ testColor(chocolateAlpha, "rec2020", "color(rec2020 0.67 0.4 0.14 / 0.4)", [0.6693, 0.4019, 0.1427, 0.4], false);
+ testColor(noneColor, "rec2020", "color(rec2020 none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "xyz-d50", "color(xyz-d50 0.34 0.25 0.03)", [0.3373, 0.2454, 0.032, 1], false);
+ testColor(chocolateAlpha, "xyz-d50", "color(xyz-d50 0.34 0.25 0.03 / 0.4)", [0.3373, 0.2454, 0.032, 0.4], false);
+ testColor(noneColor, "xyz-d50", "color(xyz-d50 none none none / none)", [0, 0, 0, 0], false);
+
+ testColor(chocolate, "xyz-d65", "color(xyz-d65 0.32 0.24 0.04)", [0.3186, 0.239, 0.0416, 1], false);
+ testColor(chocolateAlpha, "xyz-d65", "color(xyz-d65 0.32 0.24 0.04 / 0.4)", [0.3186, 0.239, 0.0416, 0.4], false);
+ testColor(noneColor, "xyz-d65", "color(xyz-d65 none none none / none)", [0, 0, 0, 0], false);
+
+ testColor("color(srgb calc(NaN) calc(NaN) calc(NaN) / calc(NaN))", "srgb", "rgb(0% 0% 0% / 0)", [NaN, NaN, NaN, 0], false);
+
+ // Invalid color.
+ testColor("darkblueorange", "srgb", null, null, null);
+ testColor("rgb(none, none, none)", "lab", null, null, null);
+ testColor(null, "lab", null, null, null);
+
+ // Invalid color spaces.
+ testColor(chocolate, "something", null, null, null);
+ testColor(chocolate, "", null, null, null);
+ testColor(chocolate, null, null, null, null);
+
+ function testColor(color, colorSpace, expected, expectedComponents, expectedAdjust) {
+ let actual = InspectorUtils.colorTo(color, colorSpace);
+
+ // If we only get 3 elements for the expected components, we just add the
+ // default alpha.
+ if (expectedComponents && expectedComponents.length === 3) {
+ expectedComponents.push(1);
+ }
+
+ if (actual === null) {
+ is(expected, null, "color: converting \"" + color + "\" to \"" + colorSpace + "\" returns null");
+ return;
+ }
+
+ is(actual.color, expected, "color is correctly converted to \"" + colorSpace + "\"");
+ for (let i = 0; i < 4; i++) {
+ if (isNaN(expectedComponents[i])) {
+ is(isNaN(actual.components[i]), true, "component " + i + " is NaN when converting to \"" + colorSpace + "\"");
+ } else {
+ isfuzzy(actual.components[i], expectedComponents[i], kEpsilon, "component " + i + " when converting to \"" + colorSpace + "\"");
+ }
+ }
+ is(actual.adjusted, expectedAdjust, "color adjusted status currect");
+ }
+ </script>
+</head>
+<body>
+<p id="display"></p>
+<div id="content" style="display: none"></div>
+<pre id="test"></pre>
+</body>
+</html>
diff --git a/layout/mathml/nsIMathMLFrame.h b/layout/mathml/nsIMathMLFrame.h
index f27ef806e9..efe550e0fa 100644
--- a/layout/mathml/nsIMathMLFrame.h
+++ b/layout/mathml/nsIMathMLFrame.h
@@ -291,11 +291,6 @@ struct nsPresentationData {
// feature setting.
#define NS_MATHML_DTLS 0x00000080U
-// This bit is set when the frame cannot be formatted due to an
-// error (e.g., invalid markup such as a <msup> without an overscript).
-// When set, a visual feedback will be provided to the user.
-#define NS_MATHML_ERROR 0x80000000U
-
// a bit used for debug
#define NS_MATHML_STRETCH_DONE 0x20000000U
@@ -324,9 +319,6 @@ struct nsPresentationData {
#define NS_MATHML_IS_DTLS_SET(_flags) \
(NS_MATHML_DTLS == ((_flags) & NS_MATHML_DTLS))
-#define NS_MATHML_HAS_ERROR(_flags) \
- (NS_MATHML_ERROR == ((_flags) & NS_MATHML_ERROR))
-
#define NS_MATHML_STRETCH_WAS_DONE(_flags) \
(NS_MATHML_STRETCH_DONE == ((_flags) & NS_MATHML_STRETCH_DONE))
diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp
index 7a62146504..b63792c288 100644
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -33,45 +33,6 @@ NS_QUERYFRAME_HEAD(nsMathMLContainerFrame)
NS_QUERYFRAME_ENTRY(nsMathMLContainerFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
-// =============================================================================
-
-namespace mozilla {
-
-class nsDisplayMathMLError : public nsPaintedDisplayItem {
- public:
- nsDisplayMathMLError(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
- : nsPaintedDisplayItem(aBuilder, aFrame) {
- MOZ_COUNT_CTOR(nsDisplayMathMLError);
- }
- MOZ_COUNTED_DTOR_OVERRIDE(nsDisplayMathMLError)
-
- virtual void Paint(nsDisplayListBuilder* aBuilder, gfxContext* aCtx) override;
- NS_DISPLAY_DECL_NAME("MathMLError", TYPE_MATHML_ERROR)
-};
-
-void nsDisplayMathMLError::Paint(nsDisplayListBuilder* aBuilder,
- gfxContext* aCtx) {
- // Set color and font ...
- RefPtr<nsFontMetrics> fm =
- nsLayoutUtils::GetFontMetricsForFrame(mFrame, 1.0f);
-
- nsPoint pt = ToReferenceFrame();
- int32_t appUnitsPerDevPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
- DrawTarget* drawTarget = aCtx->GetDrawTarget();
- Rect rect = NSRectToSnappedRect(nsRect(pt, mFrame->GetSize()),
- appUnitsPerDevPixel, *drawTarget);
- ColorPattern red(ToDeviceColor(sRGBColor(1.f, 0.f, 0.f, 1.f)));
- drawTarget->FillRect(rect, red);
-
- aCtx->SetColor(sRGBColor::OpaqueWhite());
- nscoord ascent = fm->MaxAscent();
- constexpr auto errorMsg = u"invalid-markup"_ns;
- nsLayoutUtils::DrawUniDirString(errorMsg.get(), uint32_t(errorMsg.Length()),
- nsPoint(pt.x, pt.y + ascent), *fm, *aCtx);
-}
-
-} // namespace mozilla
-
/* /////////////
* nsIMathMLFrame - support methods for stretchy elements
* =============================================================================
@@ -244,11 +205,6 @@ nsMathMLContainerFrame::Stretch(DrawTarget* aDrawTarget,
}
mPresentationData.flags |= NS_MATHML_STRETCH_DONE;
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags)) {
- NS_WARNING("it is wrong to fire stretch on a erroneous frame");
- return NS_OK;
- }
-
// Pass the stretch to the base child ...
nsIFrame* baseFrame = mPresentationData.baseFrame;
@@ -341,7 +297,7 @@ nsMathMLContainerFrame::Stretch(DrawTarget* aDrawTarget,
// re-position all our children
nsresult rv = Place(aDrawTarget, true, aDesiredStretchSize);
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) {
// Make sure the child frames get their DidReflow() calls.
DidReflowChildren(mFrames.FirstChild());
}
@@ -430,7 +386,7 @@ nsresult nsMathMLContainerFrame::FinalizeReflow(DrawTarget* aDrawTarget,
// that still needs it here (or we may crash - bug 366012).
// If placeOrigin is false we should reach Place() with aPlaceOrigin == true
// through Stretch() eventually.
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) {
GatherAndStoreOverflow(&aDesiredSize);
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
@@ -566,14 +522,6 @@ void nsMathMLContainerFrame::PropagatePresentationDataFromChildAt(
void nsMathMLContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
- // report an error if something wrong was found in this frame
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags)) {
- if (!IsVisibleForPainting()) return;
-
- aLists.Content()->AppendNewToTop<nsDisplayMathMLError>(aBuilder, this);
- return;
- }
-
BuildDisplayListForInline(aBuilder, aLists);
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
@@ -798,7 +746,6 @@ void nsMathMLContainerFrame::Reflow(nsPresContext* aPresContext,
MarkInReflow();
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
- mPresentationData.flags &= ~NS_MATHML_ERROR;
aDesiredSize.Width() = aDesiredSize.Height() = 0;
aDesiredSize.SetBlockStartAscent(0);
aDesiredSize.mBoundingMetrics = nsBoundingMetrics();
diff --git a/layout/mathml/nsMathMLTokenFrame.cpp b/layout/mathml/nsMathMLTokenFrame.cpp
index 5481e6faec..61cb65ef87 100644
--- a/layout/mathml/nsMathMLTokenFrame.cpp
+++ b/layout/mathml/nsMathMLTokenFrame.cpp
@@ -116,8 +116,6 @@ void nsMathMLTokenFrame::Reflow(nsPresContext* aPresContext,
MarkInReflow();
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
- mPresentationData.flags &= ~NS_MATHML_ERROR;
-
// initializations needed for empty markup like <mtag></mtag>
aDesiredSize.ClearSize();
aDesiredSize.SetBlockStartAscent(0);
diff --git a/layout/mathml/nsMathMLmencloseFrame.cpp b/layout/mathml/nsMathMLmencloseFrame.cpp
index 1b8a03991b..9f0afc9857 100644
--- a/layout/mathml/nsMathMLmencloseFrame.cpp
+++ b/layout/mathml/nsMathMLmencloseFrame.cpp
@@ -206,8 +206,6 @@ void nsMathMLmencloseFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// paint the menclosed content
nsMathMLContainerFrame::BuildDisplayList(aBuilder, aLists);
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags)) return;
-
nsRect mencloseRect = nsIFrame::GetRect();
mencloseRect.x = mencloseRect.y = 0;
@@ -322,7 +320,7 @@ nsresult nsMathMLmencloseFrame::PlaceInternal(DrawTarget* aDrawTarget,
ReflowOutput baseSize(aDesiredSize.GetWritingMode());
nsresult rv = nsMathMLContainerFrame::Place(aDrawTarget, false, baseSize);
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) {
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}
diff --git a/layout/mathml/nsMathMLmoFrame.cpp b/layout/mathml/nsMathMLmoFrame.cpp
index 45c61124df..e0d68234ae 100644
--- a/layout/mathml/nsMathMLmoFrame.cpp
+++ b/layout/mathml/nsMathMLmoFrame.cpp
@@ -732,7 +732,7 @@ nsMathMLmoFrame::Stretch(DrawTarget* aDrawTarget,
// Place our children using the default method
// This will allow our child text frame to get its DidReflow()
nsresult rv = Place(aDrawTarget, true, aDesiredStretchSize);
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) {
// Make sure the child frames get their DidReflow() calls.
DidReflowChildren(mFrames.FirstChild());
}
diff --git a/layout/mathml/nsMathMLmpaddedFrame.cpp b/layout/mathml/nsMathMLmpaddedFrame.cpp
index 07711fefa9..930a87f698 100644
--- a/layout/mathml/nsMathMLmpaddedFrame.cpp
+++ b/layout/mathml/nsMathMLmpaddedFrame.cpp
@@ -303,7 +303,6 @@ void nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
nsReflowStatus& aStatus) {
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
- mPresentationData.flags &= ~NS_MATHML_ERROR;
ProcessAttributes();
///////////////
@@ -317,7 +316,7 @@ void nsMathMLmpaddedFrame::Reflow(nsPresContext* aPresContext,
nsresult nsMathMLmpaddedFrame::Place(DrawTarget* aDrawTarget, bool aPlaceOrigin,
ReflowOutput& aDesiredSize) {
nsresult rv = nsMathMLContainerFrame::Place(aDrawTarget, false, aDesiredSize);
- if (NS_MATHML_HAS_ERROR(mPresentationData.flags) || NS_FAILED(rv)) {
+ if (NS_FAILED(rv)) {
DidReflowChildren(PrincipalChildList().FirstChild());
return rv;
}
diff --git a/layout/mathml/nsMathMLmrootFrame.cpp b/layout/mathml/nsMathMLmrootFrame.cpp
index c74767d777..5e8d65f8a8 100644
--- a/layout/mathml/nsMathMLmrootFrame.cpp
+++ b/layout/mathml/nsMathMLmrootFrame.cpp
@@ -80,20 +80,18 @@ void nsMathMLmrootFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
/////////////
// paint the sqrt symbol
- if (!NS_MATHML_HAS_ERROR(mPresentationData.flags)) {
- mSqrChar.Display(aBuilder, this, aLists, 0);
+ mSqrChar.Display(aBuilder, this, aLists, 0);
- DisplayBar(aBuilder, this, mBarRect, aLists);
+ DisplayBar(aBuilder, this, mBarRect, aLists);
#if defined(DEBUG) && defined(SHOW_BOUNDING_BOX)
- // for visual debug
- nsRect rect;
- mSqrChar.GetRect(rect);
- nsBoundingMetrics bm;
- mSqrChar.GetBoundingMetrics(bm);
- DisplayBoundingMetrics(aBuilder, this, rect.TopLeft(), bm, aLists);
+ // for visual debug
+ nsRect rect;
+ mSqrChar.GetRect(rect);
+ nsBoundingMetrics bm;
+ mSqrChar.GetBoundingMetrics(bm);
+ DisplayBoundingMetrics(aBuilder, this, rect.TopLeft(), bm, aLists);
#endif
- }
}
void nsMathMLmrootFrame::GetRadicalXOffsets(nscoord aIndexWidth,
@@ -162,7 +160,6 @@ void nsMathMLmrootFrame::Reflow(nsPresContext* aPresContext,
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
nsReflowStatus childStatus;
- mPresentationData.flags &= ~NS_MATHML_ERROR;
aDesiredSize.ClearSize();
aDesiredSize.SetBlockStartAscent(0);
diff --git a/layout/mathml/nsMathMLmspaceFrame.cpp b/layout/mathml/nsMathMLmspaceFrame.cpp
index 49746df8e4..1f87c095df 100644
--- a/layout/mathml/nsMathMLmspaceFrame.cpp
+++ b/layout/mathml/nsMathMLmspaceFrame.cpp
@@ -93,7 +93,6 @@ void nsMathMLmspaceFrame::Reflow(nsPresContext* aPresContext,
MarkInReflow();
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
- mPresentationData.flags &= ~NS_MATHML_ERROR;
ProcessAttributes(aPresContext);
auto borderPadding = aReflowInput.ComputedPhysicalBorderPadding();
diff --git a/layout/mathml/tests/chrome.toml b/layout/mathml/tests/chrome.toml
index ec3d54556e..f3c23766f1 100644
--- a/layout/mathml/tests/chrome.toml
+++ b/layout/mathml/tests/chrome.toml
@@ -1,6 +1,15 @@
+# WARNING: This directory was used for MathML mochitests and is only preserved
+# for the ones that cannot be rewritten as web-platform-tests.
+# If you want to add new tests for MathML, please instead consider adding them
+# to `testing/web-platform/tests/mathml` (for MathML Core tests) or to
+# `testing/web-platform/mozilla/tests/mathml/` (for Gecko-specific tests).
+
[DEFAULT]
support-files = ["test_disabled_chrome_iframe.html"]
prefs = ["mathml.disabled=true"]
+# FIXME(bug 1847206): Rather than a chrome mochitest, this should probably be a
+# browser mochitest, because the goal was to check `mathml.disabled` doesn't
+# apply to the user interface.
["test_disabled_chrome.html"]
diff --git a/layout/painting/ActiveLayerTracker.cpp b/layout/painting/ActiveLayerTracker.cpp
index 053445e486..b30ecdf5c2 100644
--- a/layout/painting/ActiveLayerTracker.cpp
+++ b/layout/painting/ActiveLayerTracker.cpp
@@ -218,23 +218,47 @@ void ActiveLayerTracker::TransferActivityToFrame(nsIContent* aContent,
static void IncrementScaleRestyleCountIfNeeded(nsIFrame* aFrame,
LayerActivity* aActivity) {
+ // This function is basically a simplified copy of
+ // nsDisplayTransform::GetResultingTransformMatrixInternal.
+
+ Matrix svgTransform, parentsChildrenOnlyTransform;
+ const bool hasSVGTransforms =
+ aFrame->HasAnyStateBits(NS_FRAME_MAY_BE_TRANSFORMED) &&
+ aFrame->IsSVGTransformed(&svgTransform, &parentsChildrenOnlyTransform);
+
const nsStyleDisplay* display = aFrame->StyleDisplay();
- if (!display->HasTransformProperty() && !display->HasIndividualTransform() &&
- display->mOffsetPath.IsNone()) {
- // The transform was removed.
- aActivity->mPreviousTransformScale = Nothing();
- IncrementMutationCount(
- &aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
+ if (!aFrame->HasAnyStateBits(NS_FRAME_MAY_BE_TRANSFORMED) ||
+ (!display->HasTransformProperty() && !display->HasIndividualTransform() &&
+ display->mOffsetPath.IsNone() && !hasSVGTransforms)) {
+ if (aActivity->mPreviousTransformScale.isSome()) {
+ // The transform was removed.
+ aActivity->mPreviousTransformScale = Nothing();
+ IncrementMutationCount(
+ &aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
+ }
+
return;
}
- // Compute the new scale due to the CSS transform property.
- // Note: Motion path doesn't contribute to scale factor. (It only has 2d
- // translate and 2d rotate, so we use Nothing() for it.)
- nsStyleTransformMatrix::TransformReferenceBox refBox(aFrame);
- Matrix4x4 transform = nsStyleTransformMatrix::ReadTransforms(
- display->mTranslate, display->mRotate, display->mScale, nullptr,
- display->mTransform, refBox, AppUnitsPerCSSPixel());
+ Matrix4x4 transform;
+ if (aFrame->IsCSSTransformed()) {
+ // Compute the new scale due to the CSS transform property.
+ // Note: Motion path doesn't contribute to scale factor. (It only has 2d
+ // translate and 2d rotate, so we use Nothing() for it.)
+ nsStyleTransformMatrix::TransformReferenceBox refBox(aFrame);
+ transform = nsStyleTransformMatrix::ReadTransforms(
+ display->mTranslate, display->mRotate, display->mScale, nullptr,
+ display->mTransform, refBox, AppUnitsPerCSSPixel());
+ } else if (hasSVGTransforms) {
+ transform = Matrix4x4::From2D(svgTransform);
+ }
+
+ const bool parentHasChildrenOnlyTransform =
+ hasSVGTransforms && !parentsChildrenOnlyTransform.IsIdentity();
+ if (parentHasChildrenOnlyTransform) {
+ transform *= Matrix4x4::From2D(parentsChildrenOnlyTransform);
+ }
+
Matrix transform2D;
if (!transform.Is2D(&transform2D)) {
// We don't attempt to handle 3D transforms; just assume the scale changed.
diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp
index bb3a896b9a..ca8f37a252 100644
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -523,6 +523,17 @@ class MergeState {
// current ASR, which gets reset during RestoreState(), so we always need
// to run it again.
aOutItem->UpdateBounds(mBuilder->Builder());
+
+ if (aOutItem->GetType() == DisplayItemType::TYPE_TRANSFORM) {
+ MOZ_ASSERT(!aNewItem ||
+ aNewItem->GetType() == DisplayItemType::TYPE_TRANSFORM);
+ MOZ_ASSERT(aOldItem->GetType() == DisplayItemType::TYPE_TRANSFORM);
+ static_cast<nsDisplayTransform*>(aOutItem)->SetContainsASRs(
+ static_cast<nsDisplayTransform*>(aOldItem)->GetContainsASRs() ||
+ (aNewItem
+ ? static_cast<nsDisplayTransform*>(aNewItem)->GetContainsASRs()
+ : false));
+ }
}
bool ShouldUseNewItem(nsDisplayItem* aNewItem) {
diff --git a/layout/painting/nsDisplayItemTypesList.h b/layout/painting/nsDisplayItemTypesList.h
index b3d4f14c4d..ecc107a20b 100644
--- a/layout/painting/nsDisplayItemTypesList.h
+++ b/layout/painting/nsDisplayItemTypesList.h
@@ -18,9 +18,6 @@ DECLARE_DISPLAY_ITEM_TYPE(BLEND_MODE,
DECLARE_DISPLAY_ITEM_TYPE(BORDER, 0)
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER, TYPE_RENDERS_NO_IMAGES)
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER, TYPE_RENDERS_NO_IMAGES)
-DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BORDER_BACKGROUND, TYPE_IS_CONTENTFUL)
-DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BOX_SHADOW_OUTER,
- TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTENTFUL)
DECLARE_DISPLAY_ITEM_TYPE(BUTTON_FOREGROUND, TYPE_IS_CONTENTFUL)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS, TYPE_RENDERS_NO_IMAGES)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
@@ -34,7 +31,6 @@ DECLARE_DISPLAY_ITEM_TYPE(CHECKED_CHECKBOX,
DECLARE_DISPLAY_ITEM_TYPE(CHECKED_RADIOBUTTON,
TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTENTFUL)
DECLARE_DISPLAY_ITEM_TYPE(COLUMN_RULE, TYPE_RENDERS_NO_IMAGES)
-DECLARE_DISPLAY_ITEM_TYPE(COMBOBOX_FOCUS, TYPE_RENDERS_NO_IMAGES)
DECLARE_DISPLAY_ITEM_TYPE(COMPOSITOR_HITTEST_INFO, TYPE_RENDERS_NO_IMAGES)
DECLARE_DISPLAY_ITEM_TYPE(CONTAINER, TYPE_RENDERS_NO_IMAGES | TYPE_IS_CONTAINER)
DECLARE_DISPLAY_ITEM_TYPE(DESTINATION, TYPE_RENDERS_NO_IMAGES)
diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp
index 46f8b05f82..78388d2185 100644
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -868,6 +868,11 @@ void nsDisplayListBuilder::SetIsRelativeToLayoutViewport() {
UpdateShouldBuildAsyncZoomContainer();
}
+void nsDisplayListBuilder::ForceLayerForScrollParent() {
+ mForceLayerForScrollParent = true;
+ mNumActiveScrollframesEncountered++;
+}
+
void nsDisplayListBuilder::UpdateShouldBuildAsyncZoomContainer() {
const Document* document = mReferenceFrame->PresContext()->Document();
mBuildAsyncZoomContainer = !mIsRelativeToLayoutViewport &&
@@ -5974,7 +5979,8 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
mPrerenderDecision(PrerenderDecision::No),
mIsTransformSeparator(true),
mHasTransformGetter(false),
- mHasAssociatedPerspective(false) {
+ mHasAssociatedPerspective(false),
+ mContainsASRs(false) {
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
Init(aBuilder, aList);
@@ -5990,7 +5996,8 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
mPrerenderDecision(aPrerenderDecision),
mIsTransformSeparator(false),
mHasTransformGetter(false),
- mHasAssociatedPerspective(false) {
+ mHasAssociatedPerspective(false),
+ mContainsASRs(false) {
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
SetReferenceFrameToAncestor(aBuilder);
@@ -6007,7 +6014,8 @@ nsDisplayTransform::nsDisplayTransform(nsDisplayListBuilder* aBuilder,
mPrerenderDecision(PrerenderDecision::No),
mIsTransformSeparator(false),
mHasTransformGetter(true),
- mHasAssociatedPerspective(false) {
+ mHasAssociatedPerspective(false),
+ mContainsASRs(false) {
MOZ_COUNT_CTOR(nsDisplayTransform);
MOZ_ASSERT(aFrame, "Must have a frame!");
MOZ_ASSERT(aFrame->GetTransformGetter());
@@ -6194,6 +6202,9 @@ Matrix4x4 nsDisplayTransform::GetResultingTransformMatrixInternal(
NS_ASSERTION(frame || !(aFlags & INCLUDE_PERSPECTIVE),
"Must have a frame to compute perspective!");
+ // IncrementScaleRestyleCountIfNeeded in ActiveLayerTracker.cpp is a
+ // simplified copy of this function.
+
// Get the underlying transform matrix:
/* Get the matrix, then change its basis to factor in the origin. */
@@ -6637,12 +6648,12 @@ bool nsDisplayTransform::CreateWebRenderCommands(
key};
nsDisplayTransform* deferredTransformItem = nullptr;
- if (!mFrame->ChildrenHavePerspective()) {
+ if (ShouldDeferTransform()) {
// If it has perspective, we create a new scroll data via the
- // UpdateScrollData call because that scenario is more complex. Otherwise
- // we can just stash the transform on the StackingContextHelper and
- // apply it to any scroll data that are created inside this
- // nsDisplayTransform.
+ // UpdateScrollData call because that scenario is more complex. Otherwise,
+ // if we don't contain any ASRs then just stash the transform on the
+ // StackingContextHelper and apply it to any scroll data that are created
+ // inside this nsDisplayTransform.
deferredTransformItem = this;
}
@@ -6693,14 +6704,14 @@ bool nsDisplayTransform::CreateWebRenderCommands(
bool nsDisplayTransform::UpdateScrollData(
WebRenderScrollData* aData, WebRenderLayerScrollData* aLayerData) {
- if (!mFrame->ChildrenHavePerspective()) {
+ if (ShouldDeferTransform()) {
// This case is handled in CreateWebRenderCommands by stashing the transform
// on the stacking context.
return false;
}
if (aLayerData) {
aLayerData->SetTransform(GetTransform().GetMatrix());
- aLayerData->SetTransformIsPerspective(true);
+ aLayerData->SetTransformIsPerspective(mFrame->ChildrenHavePerspective());
}
return true;
}
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h
index cf4eb1dd16..5064677cc7 100644
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -457,7 +457,10 @@ class nsDisplayListBuilder {
* a displayport, and for scroll handoff to work properly the ancestor
* scrollframes should also get their own scrollable layers.
*/
- void ForceLayerForScrollParent() { mForceLayerForScrollParent = true; }
+ void ForceLayerForScrollParent();
+ uint32_t GetNumActiveScrollframesEncountered() const {
+ return mNumActiveScrollframesEncountered;
+ }
/**
* Set the flag that indicates there is a non-minimal display port in the
* current subtree. This is used to determine display port expiry.
@@ -1848,6 +1851,8 @@ class nsDisplayListBuilder {
nsDisplayListBuilderMode mMode;
static uint32_t sPaintSequenceNumber;
+ uint32_t mNumActiveScrollframesEncountered = 0;
+
bool mContainsBlendMode;
bool mIsBuildingScrollbar;
bool mCurrentScrollbarWillHaveLayer;
@@ -3570,7 +3575,7 @@ class RetainedDisplayList : public nsDisplayList {
for (OldItemInfo& i : mOldItems) {
if (i.mItem && i.mOwnsItem) {
i.mItem->Destroy(aBuilder);
- MOZ_ASSERT(!GetBottom(),
+ MOZ_ASSERT(!GetBottom() || aBuilder->PartialBuildFailed(),
"mOldItems should not be owning items if we also have items "
"in the normal list");
}
@@ -6414,6 +6419,12 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
bool CreatesStackingContextHelper() override { return true; }
+ void SetContainsASRs(bool aContainsASRs) { mContainsASRs = aContainsASRs; }
+ bool GetContainsASRs() const { return mContainsASRs; }
+ bool ShouldDeferTransform() const {
+ return !mFrame->ChildrenHavePerspective() && !mContainsASRs;
+ }
+
private:
void ComputeBounds(nsDisplayListBuilder* aBuilder);
nsRect TransformUntransformedBounds(nsDisplayListBuilder* aBuilder,
@@ -6459,6 +6470,7 @@ class nsDisplayTransform : public nsPaintedDisplayItem {
// True if this item is created together with `nsDisplayPerspective`
// from the same CSS stacking context.
bool mHasAssociatedPerspective : 1;
+ bool mContainsASRs : 1;
};
/* A display item that applies a perspective transformation to a single
diff --git a/layout/reftests/abs-pos/reftest.list b/layout/reftests/abs-pos/reftest.list
index 3e5b85de9b..c595d14368 100644
--- a/layout/reftests/abs-pos/reftest.list
+++ b/layout/reftests/abs-pos/reftest.list
@@ -51,7 +51,7 @@ pref(layout.display-list.improve-fragmentation,true) == table-cell-8.html table-
== continuation-positioned-inline-1.html continuation-positioned-inline-ref.html
== continuation-positioned-inline-2.html continuation-positioned-inline-ref.html
== scrollframe-1.html scrollframe-1-ref.html
-fuzzy-if(gtkWidget,0-1,0-1) fuzzy-if(Android,0-9,0-185) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-140,0-144) == scrollframe-2.html scrollframe-2-ref.html #bug 756530
+fuzzy-if(gtkWidget,0-1,0-1) fuzzy-if(Android,0-9,0-185) == scrollframe-2.html scrollframe-2-ref.html #bug 756530
fuzzy-if(gtkWidget,0-1,0-8) fuzzy-if(Android,0-4,0-2) == select-1.html select-1-ref.html
fuzzy-if(gtkWidget,0-1,0-8) fuzzy-if(Android,0-4,0-2) == select-1-dynamic.html select-1-ref.html
== select-2.html select-2-ref.html
diff --git a/layout/reftests/async-scrolling/reftest.list b/layout/reftests/async-scrolling/reftest.list
index 2602ed541b..d74a1544b2 100644
--- a/layout/reftests/async-scrolling/reftest.list
+++ b/layout/reftests/async-scrolling/reftest.list
@@ -1,86 +1,86 @@
-skip-if(!asyncPan) == bg-fixed-1.html bg-fixed-1-ref.html
-skip-if(!asyncPan) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
-skip-if(!asyncPan) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
-skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
-skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
-skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
-skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
-skip-if(!asyncPan) fuzzy(0-1,0-87) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
-skip-if(!asyncPan) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-1.html bg-fixed-1-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-cover-1.html bg-fixed-cover-1-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-cover-2.html bg-fixed-cover-2-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-child.html bg-fixed-child-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
+skip-if(useDrawSnapshot) fuzzy(0-1,0-87) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
# Passing the test below without WebRender would require implementing CSS filters in the Gecko compositor.
-skip-if(!asyncPan) fuzzy-if(gtkWidget,0-1,0-87) fuzzy-if(!gtkWidget,0-1,0-3951) == bg-fixed-in-css-filter.html bg-fixed-in-css-filter-ref.html # bug 1454794 for webrender fuzziness
-skip-if(!asyncPan) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
-skip-if(!asyncPan) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
-skip-if(!asyncPan) == bg-fixed-child-no-culling-3.html bg-fixed-child-no-culling-3-ref.html
-fuzzy-if(Android,0-2,0-4000) fuzzy-if(browserIsRemote&&cocoaWidget,0-2,0-179524) fuzzy-if(browserIsRemote&&winWidget,0-1,0-74590) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-1,0-3528) skip-if(!asyncPan) fuzzy-if(geckoview,0-1,0-74590) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
-skip-if(!asyncPan) == contain-paint-scrollable-frame-1.html contain-paint-scrollable-frame-1-ref.html
-skip-if(!asyncPan) == element-1.html element-1-ref.html
-pref(layers.force-active,true) skip-if(!asyncPan) == iframe-1.html iframe-1-ref.html
-skip-if(!asyncPan) == nested-1.html nested-1-ref.html
-skip-if(!asyncPan) == nested-2.html nested-2-ref.html
-skip-if(!asyncPan) == position-fixed-1.html position-fixed-1-ref.html
-skip-if(!asyncPan) == position-fixed-2.html position-fixed-2-ref.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-3120) skip-if(!asyncPan) == position-fixed-body.html position-fixed-body-ref.html
-skip-if(!asyncPan) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
-skip-if(!asyncPan) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
-skip-if(!asyncPan) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
-fuzzy-if(Android,0-15,0-11) fuzzy-if(gtkWidget,20-33,14-32) fuzzy-if(cocoaWidget,9-21,20-44) skip-if(!asyncPan) == position-fixed-transformed-1.html position-fixed-transformed-1-ref.html # Bug 1604338
-skip-if(!asyncPan) == split-layers-1.html split-layers-1-ref.html
-skip-if(!asyncPan) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html
-fuzzy(0-2,0-240000) skip-if(!asyncPan) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
-skip-if(!asyncPan) fuzzy-if(appleSilicon,0-1,0-8) == sticky-pos-scrollable-1.html sticky-pos-scrollable-1-ref.html
-skip-if(!asyncPan) == sticky-pos-scrollable-2.html sticky-pos-scrollable-2-ref.html
-skip-if(!asyncPan) == sticky-pos-scrollable-3.html sticky-pos-scrollable-3-ref.html
-skip-if(!asyncPan) == sticky-pos-scrollable-4.html sticky-pos-scrollable-4-ref.html
-skip-if(!asyncPan) == sticky-pos-scrollable-5.html sticky-pos-scrollable-5-ref.html
-skip-if(!asyncPan) == sticky-pos-scrollable-6.html sticky-pos-scrollable-6-ref.html
-skip-if(!asyncPan) fuzzy-if(appleSilicon,0-1,0-8) == sticky-pos-scrollable-7.html sticky-pos-scrollable-7-ref.html
-skip-if(!asyncPan) fuzzy(0-2,0-2) fuzzy-if(gtkWidget,0-1,0-4) fuzzy-if(winWidget,0-1,0-51) fuzzy-if(appleSilicon,0-1,0-8) == fixed-pos-scrollable-1.html fixed-pos-scrollable-1-ref.html
-skip-if(!asyncPan) == culling-1.html culling-1-ref.html
-skip-if(!asyncPan) == position-fixed-iframe-1.html position-fixed-iframe-1-ref.html
-skip-if(!asyncPan) == position-fixed-iframe-2.html position-fixed-iframe-2-ref.html
-fuzzy(0-1,0-11300) skip-if(!asyncPan) == position-fixed-in-scroll-container.html position-fixed-in-scroll-container-ref.html
-fuzzy(0-1,0-400) skip-if(!asyncPan) == position-fixed-inside-clip-path.html position-fixed-inside-clip-path-ref.html
-skip-if(!asyncPan) == position-fixed-inside-sticky-1.html position-fixed-inside-sticky-1-ref.html
-skip-if(!asyncPan) == position-fixed-inside-sticky-2.html position-fixed-inside-sticky-2-ref.html
-skip-if(!asyncPan) == position-fixed-inside-sticky-3.html position-fixed-inside-sticky-3-ref.html
-skip-if(!asyncPan) == sticky-inside-fixed-1.html sticky-inside-fixed-1-ref.html
-skip-if(!asyncPan) == sticky-inside-transform-1.html sticky-inside-transform-1-ref.html
-fuzzy(0-1,0-60000) skip-if(!asyncPan) == group-opacity-surface-size-1.html group-opacity-surface-size-1-ref.html
-fuzzy(0-55,0-295) skip-if(!asyncPan) == position-sticky-transformed.html position-sticky-transformed-ref.html
-skip-if(!asyncPan) fuzzy-if(cocoaWidget,0-1,0-396) fuzzy-if(winWidget,0-1,0-396) == offscreen-prerendered-active-opacity.html offscreen-prerendered-active-opacity-ref.html
-fuzzy-if(Android,0-43,0-40) fuzzy-if(!Android,0-1,0-34) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-1.html offscreen-clipped-blendmode-ref.html # Bug 1604338
-fuzzy-if(Android,0-43,0-40) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-2.html offscreen-clipped-blendmode-ref.html # Bug 1604338
+skip-if(useDrawSnapshot) fuzzy-if(gtkWidget,0-1,0-87) fuzzy-if(!gtkWidget,0-1,0-3951) == bg-fixed-in-css-filter.html bg-fixed-in-css-filter-ref.html # bug 1454794 for webrender fuzziness
+skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
+skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-3.html bg-fixed-child-no-culling-3-ref.html
+fuzzy-if(Android,0-2,0-4000) fuzzy-if(cocoaWidget,0-2,0-179524) fuzzy-if(winWidget,0-1,0-74590) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-1,0-3528) skip-if(useDrawSnapshot) fuzzy-if(geckoview,0-1,0-74590) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
+skip-if(useDrawSnapshot) == contain-paint-scrollable-frame-1.html contain-paint-scrollable-frame-1-ref.html
+skip-if(useDrawSnapshot) == element-1.html element-1-ref.html
+pref(layers.force-active,true) skip-if(useDrawSnapshot) == iframe-1.html iframe-1-ref.html
+skip-if(useDrawSnapshot) == nested-1.html nested-1-ref.html
+skip-if(useDrawSnapshot) == nested-2.html nested-2-ref.html
+skip-if(useDrawSnapshot) == position-fixed-1.html position-fixed-1-ref.html
+skip-if(useDrawSnapshot) == position-fixed-2.html position-fixed-2-ref.html
+fuzzy-if(winWidget,0-1,0-3120) skip-if(useDrawSnapshot) == position-fixed-body.html position-fixed-body-ref.html
+skip-if(useDrawSnapshot) == position-fixed-cover-1.html position-fixed-cover-1-ref.html
+skip-if(useDrawSnapshot) == position-fixed-cover-2.html position-fixed-cover-2-ref.html
+skip-if(useDrawSnapshot) == position-fixed-cover-3.html position-fixed-cover-3-ref.html
+fuzzy-if(Android,0-15,0-11) fuzzy-if(gtkWidget,20-33,14-32) fuzzy-if(cocoaWidget,9-21,20-44) skip-if(useDrawSnapshot) == position-fixed-transformed-1.html position-fixed-transformed-1-ref.html # Bug 1604338
+skip-if(useDrawSnapshot) == split-layers-1.html split-layers-1-ref.html
+skip-if(useDrawSnapshot) == split-layers-multi-scrolling-1.html split-layers-multi-scrolling-1-ref.html
+fuzzy(0-2,0-240000) skip-if(useDrawSnapshot) == split-opacity-layers-1.html split-opacity-layers-1-ref.html
+skip-if(useDrawSnapshot) fuzzy-if(appleSilicon,0-1,0-8) == sticky-pos-scrollable-1.html sticky-pos-scrollable-1-ref.html
+skip-if(useDrawSnapshot) == sticky-pos-scrollable-2.html sticky-pos-scrollable-2-ref.html
+skip-if(useDrawSnapshot) == sticky-pos-scrollable-3.html sticky-pos-scrollable-3-ref.html
+skip-if(useDrawSnapshot) == sticky-pos-scrollable-4.html sticky-pos-scrollable-4-ref.html
+skip-if(useDrawSnapshot) == sticky-pos-scrollable-5.html sticky-pos-scrollable-5-ref.html
+skip-if(useDrawSnapshot) == sticky-pos-scrollable-6.html sticky-pos-scrollable-6-ref.html
+skip-if(useDrawSnapshot) fuzzy-if(appleSilicon,0-1,0-8) == sticky-pos-scrollable-7.html sticky-pos-scrollable-7-ref.html
+skip-if(useDrawSnapshot) fuzzy(0-2,0-2) fuzzy-if(gtkWidget,0-1,0-4) fuzzy-if(winWidget,0-1,0-51) fuzzy-if(appleSilicon,0-1,0-8) == fixed-pos-scrollable-1.html fixed-pos-scrollable-1-ref.html
+skip-if(useDrawSnapshot) == culling-1.html culling-1-ref.html
+skip-if(useDrawSnapshot) == position-fixed-iframe-1.html position-fixed-iframe-1-ref.html
+skip-if(useDrawSnapshot) == position-fixed-iframe-2.html position-fixed-iframe-2-ref.html
+fuzzy(0-1,0-11300) skip-if(useDrawSnapshot) == position-fixed-in-scroll-container.html position-fixed-in-scroll-container-ref.html
+fuzzy(0-1,0-400) skip-if(useDrawSnapshot) == position-fixed-inside-clip-path.html position-fixed-inside-clip-path-ref.html
+skip-if(useDrawSnapshot) == position-fixed-inside-sticky-1.html position-fixed-inside-sticky-1-ref.html
+skip-if(useDrawSnapshot) == position-fixed-inside-sticky-2.html position-fixed-inside-sticky-2-ref.html
+skip-if(useDrawSnapshot) == position-fixed-inside-sticky-3.html position-fixed-inside-sticky-3-ref.html
+skip-if(useDrawSnapshot) == sticky-inside-fixed-1.html sticky-inside-fixed-1-ref.html
+skip-if(useDrawSnapshot) == sticky-inside-transform-1.html sticky-inside-transform-1-ref.html
+fuzzy(0-1,0-60000) skip-if(useDrawSnapshot) == group-opacity-surface-size-1.html group-opacity-surface-size-1-ref.html
+fuzzy(0-55,0-295) skip-if(useDrawSnapshot) == position-sticky-transformed.html position-sticky-transformed-ref.html
+skip-if(useDrawSnapshot) fuzzy-if(cocoaWidget,0-1,0-396) fuzzy-if(winWidget,0-1,0-396) == offscreen-prerendered-active-opacity.html offscreen-prerendered-active-opacity-ref.html
+fuzzy-if(Android,0-43,0-40) fuzzy-if(!Android,0-1,0-34) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(useDrawSnapshot) == offscreen-clipped-blendmode-1.html offscreen-clipped-blendmode-ref.html # Bug 1604338
+fuzzy-if(Android,0-43,0-40) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(useDrawSnapshot) == offscreen-clipped-blendmode-2.html offscreen-clipped-blendmode-ref.html # Bug 1604338
fuzzy-if(Android,0-43,0-40) skip == offscreen-clipped-blendmode-3.html offscreen-clipped-blendmode-ref.html # bug 1251588 - wrong AGR on mix-blend-mode item
-fuzzy-if(Android,0-43,0-40) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(!asyncPan) == offscreen-clipped-blendmode-4.html offscreen-clipped-blendmode-ref.html # Bug 1604338
-fuzzy-if(Android,0-7,0-1680) fuzzy-if(gtkWidget,1-1,2-20) fuzzy-if(cocoaWidget,1-2,10-18) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-2,0-18) skip-if(!asyncPan) == perspective-scrolling-1.html perspective-scrolling-1-ref.html # Bug 1604338
-fuzzy-if(Android,0-7,0-4) skip-if(!asyncPan) == perspective-scrolling-2.html perspective-scrolling-2-ref.html
-fuzzy-if(Android,0-19,0-10) fuzzy-if(gtkWidget,8-13,12-32) fuzzy-if(cocoaWidget,10-13,20-44) skip-if(!asyncPan) == perspective-scrolling-3.html perspective-scrolling-3-ref.html # Bug 1604338
-fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,18-30,14-32) fuzzy-if(cocoaWidget,16-20,20-44) skip-if(!asyncPan) == perspective-scrolling-4.html perspective-scrolling-4-ref.html # Bug 1604338
-skip-if(!asyncPan) == perspective-scrolling-5.html perspective-scrolling-5-ref.html
-pref(apz.disable_for_scroll_linked_effects,true) skip-if(!asyncPan) == disable-apz-for-sle-pages.html disable-apz-for-sle-pages-ref.html
-fuzzy-if(browserIsRemote&&d2d,0-1,0-22) skip-if(!asyncPan) fuzzy-if(swgl,0-255,0-11) == background-blend-mode-1.html background-blend-mode-1-ref.html
-skip-if(Android||!asyncPan) != opaque-fractional-displayport-1.html about:blank
-skip-if(Android||!asyncPan) != opaque-fractional-displayport-2.html about:blank
-fuzzy-if(Android,0-19,0-10) fuzzy-if(gtkWidget,12-19,12-32) fuzzy-if(cocoaWidget,17-21,20-44) skip-if(!asyncPan) == fixed-pos-scrolled-clip-1.html fixed-pos-scrolled-clip-1-ref.html # Bug 1604338
-fuzzy-if(Android,0-44,0-136) fuzzy-if(gtkWidget,16-26,26-64) fuzzy-if(cocoaWidget,10-13,38-82) fuzzy-if(winWidget,0-4,0-36) skip-if(!asyncPan) == fixed-pos-scrolled-clip-2.html fixed-pos-scrolled-clip-2-ref.html # Bug 1604338
-fuzzy-if(Android,0-13,0-465) fuzzy-if(gtkWidget,17-28,24-60) fuzzy-if(cocoaWidget,15-19,40-75) skip-if(!asyncPan) == fixed-pos-scrolled-clip-3.html fixed-pos-scrolled-clip-3-ref.html # Bug 1604338
-fuzzy-if(Android,0-13,0-465) fuzzy-if(gtkWidget,17-29,24-60) fuzzy-if(cocoaWidget,15-19,40-75) skip-if(!asyncPan) == fixed-pos-scrolled-clip-4.html fixed-pos-scrolled-clip-4-ref.html # Bug 1604338
-skip-if(!asyncPan) == fixed-pos-scrolled-clip-5.html fixed-pos-scrolled-clip-5-ref.html
-skip-if(!asyncPan) == position-sticky-bug1434250.html position-sticky-bug1434250-ref.html
-fuzzy-if(Android,0-12,0-11) fuzzy-if(gtkWidget,16-25,12-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-scrolled-clip-1.html position-sticky-scrolled-clip-1-ref.html # Bug 1604338
+fuzzy-if(Android,0-43,0-40) fuzzy-if(gtkWidget,22-74,20-32) fuzzy-if(cocoaWidget,6-7,18-39) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-7,0-39) skip-if(useDrawSnapshot) == offscreen-clipped-blendmode-4.html offscreen-clipped-blendmode-ref.html # Bug 1604338
+fuzzy-if(Android,0-7,0-1680) fuzzy-if(gtkWidget,1-1,2-20) fuzzy-if(cocoaWidget,1-2,10-18) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-2,0-18) skip-if(useDrawSnapshot) == perspective-scrolling-1.html perspective-scrolling-1-ref.html # Bug 1604338
+fuzzy-if(Android,0-7,0-4) skip-if(useDrawSnapshot) == perspective-scrolling-2.html perspective-scrolling-2-ref.html
+fuzzy-if(Android,0-19,0-10) fuzzy-if(gtkWidget,8-13,12-32) fuzzy-if(cocoaWidget,10-13,20-44) skip-if(useDrawSnapshot) == perspective-scrolling-3.html perspective-scrolling-3-ref.html # Bug 1604338
+fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,18-30,14-32) fuzzy-if(cocoaWidget,16-20,20-44) skip-if(useDrawSnapshot) == perspective-scrolling-4.html perspective-scrolling-4-ref.html # Bug 1604338
+skip-if(useDrawSnapshot) == perspective-scrolling-5.html perspective-scrolling-5-ref.html
+pref(apz.disable_for_scroll_linked_effects,true) skip-if(useDrawSnapshot) == disable-apz-for-sle-pages.html disable-apz-for-sle-pages-ref.html
+fuzzy-if(winWidget,0-1,0-22) skip-if(useDrawSnapshot) fuzzy-if(swgl,0-255,0-11) == background-blend-mode-1.html background-blend-mode-1-ref.html
+skip-if(Android||useDrawSnapshot) != opaque-fractional-displayport-1.html about:blank
+skip-if(Android||useDrawSnapshot) != opaque-fractional-displayport-2.html about:blank
+fuzzy-if(Android,0-19,0-10) fuzzy-if(gtkWidget,12-19,12-32) fuzzy-if(cocoaWidget,17-21,20-44) skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-1.html fixed-pos-scrolled-clip-1-ref.html # Bug 1604338
+fuzzy-if(Android,0-44,0-136) fuzzy-if(gtkWidget,16-26,26-64) fuzzy-if(cocoaWidget,10-13,38-82) fuzzy-if(winWidget,0-4,0-36) skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-2.html fixed-pos-scrolled-clip-2-ref.html # Bug 1604338
+fuzzy-if(Android,0-13,0-465) fuzzy-if(gtkWidget,17-28,24-60) fuzzy-if(cocoaWidget,15-19,40-75) skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-3.html fixed-pos-scrolled-clip-3-ref.html # Bug 1604338
+fuzzy-if(Android,0-13,0-465) fuzzy-if(gtkWidget,17-29,24-60) fuzzy-if(cocoaWidget,15-19,40-75) skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-4.html fixed-pos-scrolled-clip-4-ref.html # Bug 1604338
+skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-5.html fixed-pos-scrolled-clip-5-ref.html
+skip-if(useDrawSnapshot) == position-sticky-bug1434250.html position-sticky-bug1434250-ref.html
+fuzzy-if(Android,0-12,0-11) fuzzy-if(gtkWidget,16-25,12-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(useDrawSnapshot) == position-sticky-scrolled-clip-1.html position-sticky-scrolled-clip-1-ref.html # Bug 1604338
fuzzy-if(Android,0-6,0-4) skip == position-sticky-scrolled-clip-2.html position-sticky-scrolled-clip-2-ref.html # bug ?????? - incorrectly applying clip to sticky contents
-fuzzy-if(Android,0-8,0-27) fuzzy-if(cocoaWidget,9-11,20-44) skip-if(!asyncPan) == curtain-effect-1.html curtain-effect-1-ref.html
-fuzzy-if(Android,0-7,0-9) fuzzy-if(gtkWidget,10-15,12-32) fuzzy-if(cocoaWidget,5-9,20-42) skip-if(!asyncPan) == transformed-1.html transformed-1-ref.html # Bug 1604338
-fuzzy-if(Android,2-7,1-12) fuzzy-if(gtkWidget,3-5,12-28) fuzzy-if(cocoaWidget,5-6,18-38) skip-if(!asyncPan) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-6,0-38) == position-sticky-transformed-in-scrollframe-1.html position-sticky-transformed-in-scrollframe-1-ref.html # Bug 1604338
-fuzzy-if(Android,3-3,1-470) fuzzy-if(Android&&swgl&&isDebugBuild&&/^aarch64-gcc3/.test(xulRuntime.XPCOMABI),3-3,457-457) fuzzy-if(gtkWidget,13-20,12-32) fuzzy-if(cocoaWidget,12-16,20-44) skip-if(!asyncPan) == position-sticky-transformed-in-scrollframe-2.html position-sticky-transformed-in-scrollframe-2-ref.html # Bug 1604338
-fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-in-transformed-scrollframe-1.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338
-fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(!asyncPan) == position-sticky-in-transformed-scrollframe-2.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338
+fuzzy-if(Android,0-8,0-27) fuzzy-if(cocoaWidget,9-11,20-44) skip-if(useDrawSnapshot) == curtain-effect-1.html curtain-effect-1-ref.html
+fuzzy-if(Android,0-7,0-9) fuzzy-if(gtkWidget,10-15,12-32) fuzzy-if(cocoaWidget,5-9,20-42) skip-if(useDrawSnapshot) == transformed-1.html transformed-1-ref.html # Bug 1604338
+fuzzy-if(Android,2-7,1-12) fuzzy-if(gtkWidget,3-5,12-28) fuzzy-if(cocoaWidget,5-6,18-38) skip-if(useDrawSnapshot) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-6,0-38) == position-sticky-transformed-in-scrollframe-1.html position-sticky-transformed-in-scrollframe-1-ref.html # Bug 1604338
+fuzzy-if(Android,3-3,1-470) fuzzy-if(Android&&swgl&&isDebugBuild&&/^aarch64-gcc3/.test(xulRuntime.XPCOMABI),3-3,457-457) fuzzy-if(gtkWidget,13-20,12-32) fuzzy-if(cocoaWidget,12-16,20-44) skip-if(useDrawSnapshot) == position-sticky-transformed-in-scrollframe-2.html position-sticky-transformed-in-scrollframe-2-ref.html # Bug 1604338
+fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(useDrawSnapshot) == position-sticky-in-transformed-scrollframe-1.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338
+fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(useDrawSnapshot) == position-sticky-in-transformed-scrollframe-2.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338
-skip-if(!asyncPan) == checkerboard-1.html checkerboard-1-ref.html
-skip-if(!asyncPan) == checkerboard-2.html checkerboard-2-ref.html
-skip-if(!asyncPan) == checkerboard-3.html checkerboard-3-ref.html
-skip-if(!asyncPan) == position-sticky-in-checkerboard-land-1.html position-sticky-in-checkerboard-land-1-ref.html
+skip-if(useDrawSnapshot) == checkerboard-1.html checkerboard-1-ref.html
+skip-if(useDrawSnapshot) == checkerboard-2.html checkerboard-2-ref.html
+skip-if(useDrawSnapshot) == checkerboard-3.html checkerboard-3-ref.html
+skip-if(useDrawSnapshot) == position-sticky-in-checkerboard-land-1.html position-sticky-in-checkerboard-land-1-ref.html
skip-if(!Android) pref(apz.allow_zooming,true) == position-fixed-async-zoom-1.html position-fixed-async-zoom-1-ref.html
skip-if(!Android) pref(apz.allow_zooming,true) == position-fixed-async-zoom-2.html position-fixed-async-zoom-2-ref.html
@@ -92,16 +92,16 @@ skip-if(!Android) pref(apz.allow_zooming,true) == position-sticky-async-zoom-2.h
pref(apz.allow_zooming,true) == async-scroll-and-zoom.html async-scroll-and-zoom-ref.html
# on Android we have a different overscroll effect so this test is disabled
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll.html overscroll-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-subframe.html overscroll-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed.html no-overscroll-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-transform.html overscroll-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-iframe.html overscroll-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-iframe-overscroll.html no-overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll.html overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-subframe.html overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed.html no-overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-transform.html overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-iframe.html overscroll-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-fixed-iframe-overscroll.html no-overscroll-ref.html
# This one needs to be fuzzed due to the fact that squishing a scrollbar
# thumb on the compositor doesn't preserve its shape exactly.
-skip-if(!asyncPan||Android) fuzzy(0-56,0-33) fuzzy-if(winWidget,0-107,0-17) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-scrollbar.html overscroll-scrollbar-ref.html
-skip-if(!asyncPan||Android) pref(apz.overscroll.enabled,false) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-disabled.html no-overscroll-ref.html
+skip-if(useDrawSnapshot||Android) fuzzy(0-56,0-33) fuzzy-if(winWidget,0-107,0-17) pref(apz.overscroll.enabled,true) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-scrollbar.html overscroll-scrollbar-ref.html
+skip-if(useDrawSnapshot||Android) pref(apz.overscroll.enabled,false) pref(apz.overscroll.test_async_scroll_offset.enabled,true) == overscroll-disabled.html no-overscroll-ref.html
# for this test, apz.allow_zooming is needed to ensure we take the containerless scrolling codepath that creates
# an async zoom container (since we are testing a regression in that codepath)
diff --git a/layout/reftests/backgrounds/reftest.list b/layout/reftests/backgrounds/reftest.list
index 1be6e54d53..3370e98006 100644
--- a/layout/reftests/backgrounds/reftest.list
+++ b/layout/reftests/backgrounds/reftest.list
@@ -97,7 +97,7 @@ fails-if(useDrawSnapshot) == background-size-zoom-no-repeat.html background-size
== background-size-contain-clip-padding-origin-border-padding.html background-size-contain-clip-padding-origin-border-padding-ref.html
== background-layers-1a.html background-layers-1-ref.html
-fuzzy-if(OSX,0-1,0-324) == background-layers-1b.html background-layers-1-ref.html
+fuzzy-if(cocoaWidget,0-1,0-324) == background-layers-1b.html background-layers-1-ref.html
# box-decoration-break's effect on backgrounds is touchy and hard to test due to stretching
# artifacts and the difficulty of covering exact lines, so just make sure
diff --git a/layout/reftests/bidi/dirAuto/1103348-1-ref.html b/layout/reftests/bidi/dirAuto/1103348-1-ref.html
deleted file mode 100644
index 50fba8c41d..0000000000
--- a/layout/reftests/bidi/dirAuto/1103348-1-ref.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- <title>Dynamic changes and dir=auto</title>
- </head>
- <body>
- <div>Test for elements with dir="auto" whose content changes between directional and neutral</div>
- <div dir="auto">xyz</div>
- <div dir="auto">ابج</div>
- <div dir="auto">456</div>
- <div dir="auto">xyz</div>
- <div dir="auto">ابج</div>
- <div dir="auto">456</div>
- <div dir="auto">xyz</div>
- <div dir="auto">ابج</div>
- <div dir="auto">456</div>
- </body>
-</html>
diff --git a/layout/reftests/bidi/dirAuto/1103348-1.html b/layout/reftests/bidi/dirAuto/1103348-1.html
deleted file mode 100644
index 4092f27f87..0000000000
--- a/layout/reftests/bidi/dirAuto/1103348-1.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
- <head>
- <meta charset="utf-8">
- <title>Dynamic changes and dir=auto</title>
- </head>
- <body>
- <div>Test for elements with dir="auto" whose content changes between directional and neutral</div>
- <div dir="auto" id="from_ltr_to_ltr">abc</div>
- <div dir="auto" id="from_ltr_to_rtl">abc</div>
- <div dir="auto" id="from_ltr_to_neutral">abc</div>
- <div dir="auto" id="from_rtl_to_ltr">אבג</div>
- <div dir="auto" id="from_rtl_to_rtl">אבג</div>
- <div dir="auto" id="from_rtl_to_neutral">אבג</div>
- <div dir="auto" id="from_neutral_to_ltr">123</div>
- <div dir="auto" id="from_neutral_to_rtl">123</div>
- <div dir="auto" id="from_neutral_to_neutral">123</div>
- <script type="text/javascript">
-function changeContent()
-{
- var directionalTexts = {ltr:"xyz", rtl:"ابج", neutral:"456"};
-
- for (var dirFrom in directionalTexts) {
- for (var dirTo in directionalTexts) {
- var element = document.getElementById("from_" + dirFrom +
- "_to_" + dirTo);
- element.textContent = directionalTexts[dirTo];
- }
- }
- document.documentElement.removeAttribute("class");
-}
-
-document.addEventListener("MozReftestInvalidate", changeContent);
- </script>
- </body>
-</html>
diff --git a/layout/reftests/bidi/dirAuto/reftest.list b/layout/reftests/bidi/dirAuto/reftest.list
index 14ce0aa670..f47c635124 100644
--- a/layout/reftests/bidi/dirAuto/reftest.list
+++ b/layout/reftests/bidi/dirAuto/reftest.list
@@ -112,7 +112,6 @@ fuzzy-if(Android,0-3,0-2) == dynamicDirAuto-DeleteText-LTR3.html dynamicDirAuto-
== 839886-1.html 839886-1-ref.html
== 859093-1.html 859093-1-ref.html
== 889742-1.html 889742-1-ref.html
-== 1103348-1.html 1103348-1-ref.html
== 1169267-delete-add-1a.html 1169267-delete-add-1-ref.html
== 1169267-delete-add-1b.html 1169267-delete-add-1-ref.html
== 1169267-delete-add-2a.html 1169267-delete-add-2-ref.html
diff --git a/layout/reftests/bidi/numeral/reftest.list b/layout/reftests/bidi/numeral/reftest.list
index c32d92c866..5e0b101eba 100644
--- a/layout/reftests/bidi/numeral/reftest.list
+++ b/layout/reftests/bidi/numeral/reftest.list
@@ -34,9 +34,9 @@ pref(bidi.numeral,2) == bug441782-2.html bug441782-2-ref.html
pref(bidi.numeral,3) == bug441782-2.html bug441782-2-ref.html
pref(bidi.numeral,4) == bug441782-2.html bug441782-2-ref.html
pref(bidi.numeral,0) != bug441782-3.html bug441782-3-ref.html
-fuzzy-if(winWidget&&!d2d&&d3d11,0-13,0-1) pref(bidi.numeral,1) == bug441782-3.html bug441782-3-ref.html
-fuzzy-if(winWidget&&!d2d&&d3d11,0-13,0-1) pref(bidi.numeral,2) == bug441782-3.html bug441782-3-ref.html
-fuzzy-if(winWidget&&!d2d&&d3d11,0-13,0-1) pref(bidi.numeral,3) == bug441782-3.html bug441782-3-ref.html
+pref(bidi.numeral,1) == bug441782-3.html bug441782-3-ref.html
+pref(bidi.numeral,2) == bug441782-3.html bug441782-3-ref.html
+pref(bidi.numeral,3) == bug441782-3.html bug441782-3-ref.html
pref(bidi.numeral,4) == bug441782-3.html bug441782-3-ref.html
pref(bidi.numeral,0) != bug441782-4.html bug441782-4-ref.html
pref(bidi.numeral,1) == bug441782-4.html bug441782-4-ref.html
diff --git a/layout/reftests/bidi/reftest.list b/layout/reftests/bidi/reftest.list
index 4916028c89..c9e77cd88a 100644
--- a/layout/reftests/bidi/reftest.list
+++ b/layout/reftests/bidi/reftest.list
@@ -18,8 +18,8 @@ fuzzy-if(Android,0-253,0-77) == bidiSVG-03.svg bidiSVG-03-ref.svg
fuzzy(0-1,0-1) fuzzy-if(winWidget,0-1,0-2) == bidiSVG-04.svg bidiSVG-04-ref.svg
== bidiSVG-05.svg bidiSVG-05-ref.svg
== bidiMirroring.svg bidiMirroring-ref.svg # Bug 1392106
-fuzzy-if(Android,0-9,0-134) random-if(layersGPUAccelerated) == visualmarquee.html marquee-ref.html
-fuzzy-if(Android,0-9,0-134) random-if(layersGPUAccelerated) == logicalmarquee.html marquee-ref.html
+fuzzy-if(Android,0-9,0-134) random == visualmarquee.html marquee-ref.html
+fuzzy-if(Android,0-9,0-134) random == logicalmarquee.html marquee-ref.html
== visualmarquee.html logicalmarquee.html
# test for glyph mirroring in right-to-left text
== mirroring-01.html mirroring-01-ref.html
@@ -144,7 +144,7 @@ fuzzy(0-1,0-3) == 698291-1.html 698291-1-ref.html
== 847242-1.html 847242-1-ref.html
# Skip on Android because this is a <tree> test and we don't have the requisite XUL on Android.
-skip-if(Android) fuzzy(0-92,0-350) fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-11) == chrome://reftest/content/bidi/869833-1.xhtml chrome://reftest/content/bidi/869833-1-ref.xhtml
+skip-if(Android) fuzzy(0-92,0-350) fuzzy-if(gtkWidget,0-1,0-11) == chrome://reftest/content/bidi/869833-1.xhtml chrome://reftest/content/bidi/869833-1-ref.xhtml
== 922530-1.html 922530-1-ref.html
== 922550-1.html 922550-1-ref.html # Bug 1392106
diff --git a/layout/reftests/border-image/reftest.list b/layout/reftests/border-image/reftest.list
index 677d7c65ec..6938d9717c 100644
--- a/layout/reftests/border-image/reftest.list
+++ b/layout/reftests/border-image/reftest.list
@@ -36,7 +36,7 @@ fuzzy-if(useDrawSnapshot,35-35,5220-5220) == center-scaling-3.html center-scalin
== border-image-outset-1c.html border-image-outset-1-ref.html
== border-image-nofill-1.html border-image-nofill-1-ref.html
== border-image-outset-resize-1.html border-image-outset-resize-1-ref.html
-fuzzy-if(asyncPan&&!layersGPUAccelerated,0-140,0-514) fuzzy-if(winWidget,0-144,0-448) == border-image-outset-move-1.html border-image-outset-move-1-ref.html
+fuzzy-if(winWidget,0-144,0-448) == border-image-outset-move-1.html border-image-outset-move-1-ref.html
== border-image-style-none.html border-image-style-none-ref.html
== border-image-style-none-length.html border-image-style-none-length-ref.html
== border-image-style-none-auto.html border-image-style-none-auto-ref.html
@@ -48,12 +48,12 @@ fuzzy(1-150,1-2650) fails-if(useDrawSnapshot) == border-image-repeat-space-8z.ht
# border images with gradients
fuzzy-if(!useDrawSnapshot&&!geckoview,1-3,300-1804) == border-image-linear-gradient.html border-image-linear-gradient-ref.html
fuzzy(0-1,0-350) fuzzy-if(!geckoview,1-3,179-37537) == border-image-linear-gradient-slice-1.html border-image-linear-gradient-slice-1-ref.html
-fuzzy(0-1,0-515) fuzzy-if(OSX,0-1,0-10595) fuzzy-if(!geckoview,1-3,272-25136) == border-image-linear-gradient-slice-2.html border-image-linear-gradient-slice-2-ref.html
+fuzzy(0-1,0-515) fuzzy-if(cocoaWidget,0-1,0-10595) fuzzy-if(!geckoview,1-3,272-25136) == border-image-linear-gradient-slice-2.html border-image-linear-gradient-slice-2-ref.html
fuzzy(0-1,0-2500) fuzzy-if(!geckoview,1-3,200-86037) == border-image-linear-gradient-slice-fill-1.html border-image-linear-gradient-slice-fill-1-ref.html
-fuzzy(0-1,0-649) fuzzy-if(OSX,0-1,0-25771) fuzzy-if(!Android,0-1,0-546) fuzzy-if(Android,0-1,0-6093) fuzzy-if(!geckoview,1-3,477-57480) == border-image-linear-gradient-slice-fill-2.html border-image-linear-gradient-slice-fill-2-ref.html
-fuzzy(0-1,0-134) fuzzy-if(OSX,0-5,0-1676) fuzzy-if(!geckoview,1-1,0-4537) == border-image-linear-gradient-width.html border-image-linear-gradient-width-ref.html
-fuzzy(0-2,0-60590) fuzzy-if(Android,0-4,0-18022) fuzzy-if(OSX,0-1,0-15000) fuzzy-if(!useDrawSnapshot&&!geckoview,1-2,3900-60581) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
-fuzzy(0-2,0-26758) fuzzy-if(OSX,0-1,0-6000) fuzzy-if(!geckoview,1-3,2400-26758) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
+fuzzy(0-1,0-649) fuzzy-if(cocoaWidget,0-1,0-25771) fuzzy-if(!Android,0-1,0-546) fuzzy-if(Android,0-1,0-6093) fuzzy-if(!geckoview,1-3,477-57480) == border-image-linear-gradient-slice-fill-2.html border-image-linear-gradient-slice-fill-2-ref.html
+fuzzy(0-1,0-134) fuzzy-if(cocoaWidget,0-5,0-1676) fuzzy-if(!geckoview,1-1,0-4537) == border-image-linear-gradient-width.html border-image-linear-gradient-width-ref.html
+fuzzy(0-2,0-60590) fuzzy-if(Android,0-4,0-18022) fuzzy-if(cocoaWidget,0-1,0-15000) fuzzy-if(!useDrawSnapshot&&!geckoview,1-2,3900-60581) == border-image-linear-gradient-slice-width.html border-image-linear-gradient-slice-width-ref.html
+fuzzy(0-2,0-26758) fuzzy-if(cocoaWidget,0-1,0-6000) fuzzy-if(!geckoview,1-3,2400-26758) == border-image-linear-gradient-outset.html border-image-linear-gradient-outset-ref.html
fuzzy(0-1,0-400) fuzzy-if(!geckoview,1-3,200-26872) == border-image-linear-gradient-repeat-repeat-1.html border-image-linear-gradient-repeat-repeat-1-ref.html
fuzzy(0-1,0-300) fuzzy-if(!geckoview,1-3,200-27131) == border-image-linear-gradient-repeat-round-1.html border-image-linear-gradient-repeat-round-1-ref.html
fuzzy-if(Android,0-1,0-1894) fuzzy-if(!useDrawSnapshot&&!geckoview,1-2,2400-67805) == border-image-linear-gradient-repeat-repeat-2.html border-image-linear-gradient-repeat-repeat-2-ref.html
@@ -71,18 +71,18 @@ fuzzy(0-3,0-66698) == border-image-radial-gradient-slice-width.html border-image
# OS X failures tracked in bug 957025
fuzzy-if(!useDrawSnapshot&&!geckoview,1-4,455-2000) == border-image-repeating-linear-gradient.html border-image-repeating-linear-gradient-ref.html
-fails-if(OSX) fuzzy(0-3,0-95449) == border-image-repeating-linear-gradient-slice-fill-2.html border-image-repeating-linear-gradient-slice-fill-2-ref.html
-fails-if(OSX) fuzzy(0-3,0-20000) fuzzy-if(!geckoview,1-4,800-14000) == border-image-repeating-linear-gradient-repeat-round-2.html border-image-repeating-linear-gradient-repeat-round-2-ref.html
+fails-if(cocoaWidget) fuzzy(0-3,0-95449) == border-image-repeating-linear-gradient-slice-fill-2.html border-image-repeating-linear-gradient-slice-fill-2-ref.html
+fails-if(cocoaWidget) fuzzy(0-3,0-20000) fuzzy-if(!geckoview,1-4,800-14000) == border-image-repeating-linear-gradient-repeat-round-2.html border-image-repeating-linear-gradient-repeat-round-2-ref.html
fuzzy(0-3,0-3008) == border-image-repeating-radial-gradient.html border-image-repeating-radial-gradient-ref.html
fuzzy(0-3,0-62078) == border-image-repeating-radial-gradient-slice-1.html border-image-repeating-radial-gradient-slice-1-ref.html
fuzzy(0-3,0-40536) == border-image-repeating-radial-gradient-slice-2.html border-image-repeating-radial-gradient-slice-2-ref.html
fuzzy(0-3,0-1794) fuzzy-if(!geckoview,1-3,30-12194) == border-image-repeating-radial-gradient-slice-fill-1.html border-image-repeating-radial-gradient-slice-fill-1-ref.html
-fails-if(OSX) fuzzy(0-3,0-1435) fuzzy-if(!geckoview,1-2,20-8000) == border-image-repeating-radial-gradient-slice-fill-2.html border-image-repeating-radial-gradient-slice-fill-2-ref.html
+fails-if(cocoaWidget) fuzzy(0-3,0-1435) fuzzy-if(!geckoview,1-2,20-8000) == border-image-repeating-radial-gradient-slice-fill-2.html border-image-repeating-radial-gradient-slice-fill-2-ref.html
fuzzy(0-3,0-7441) == border-image-repeating-radial-gradient-width.html border-image-repeating-radial-gradient-width-ref.html
-fails-if(OSX) fuzzy(0-8,0-99728) == border-image-repeating-radial-gradient-slice-width.html border-image-repeating-radial-gradient-slice-width-ref.html
+fails-if(cocoaWidget) fuzzy(0-8,0-99728) == border-image-repeating-radial-gradient-slice-width.html border-image-repeating-radial-gradient-slice-width-ref.html
fuzzy(0-3,0-117768) == border-image-repeating-radial-gradient-repeat-repeat-2.html border-image-repeating-radial-gradient-repeat-repeat-2-ref.html
-fails-if(OSX) fuzzy(0-3,0-116185) == border-image-repeating-radial-gradient-repeat-round-2.html border-image-repeating-radial-gradient-repeat-round-2-ref.html
+fails-if(cocoaWidget) fuzzy(0-3,0-116185) == border-image-repeating-radial-gradient-repeat-round-2.html border-image-repeating-radial-gradient-repeat-round-2-ref.html
# border-image-source (-moz-)element
fuzzy(0-125,0-5903) == border-image-element.html border-image-element-ref.html
diff --git a/layout/reftests/border-radius/reftest.list b/layout/reftests/border-radius/reftest.list
index b548c11b33..831d8f05db 100644
--- a/layout/reftests/border-radius/reftest.list
+++ b/layout/reftests/border-radius/reftest.list
@@ -47,14 +47,14 @@ skip-if(Android&&emulator) fuzzy(0-8,0-20) fuzzy-if(useDrawSnapshot,1-1,172-172)
fuzzy(0-1,0-172) == clipping-4-image.html clipping-4-ref.html
fuzzy(0-1,0-77) == clipping-4-overflow-hidden.html clipping-4-ref.html
skip-if(Android&&emulator) == clipping-5-canvas.html clipping-5-refc.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-5) == clipping-5-image.html clipping-5-refi.html
+fuzzy-if(winWidget,0-1,0-5) == clipping-5-image.html clipping-5-refi.html
fuzzy(0-1,0-77) == clipping-5-overflow-hidden.html clipping-5-ref.html
fuzzy(0-1,0-97) == clipping-5-refi.html clipping-5-ref.html
skip-if(Android&&emulator) fuzzy(0-1,0-77) fuzzy-if(useDrawSnapshot,1-1,97-97) == clipping-5-refc.html clipping-5-ref.html # bug 732535
fuzzy(0-21,0-76) fuzzy-if(winWidget,0-144,0-335) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical
fuzzy(0-28,0-97) == clipping-7.html clipping-7-ref.html # ColorLayer and MaskLayer with transforms that aren't identical. Reference image rendered without using layers (which causes fuzzy failures).
== clipping-and-zindex-1.html clipping-and-zindex-1-ref.html
-skip-if(Android&&emulator) fuzzy-if(cocoaWidget,0-1,0-4) fuzzy-if(d2d,0-59,0-342) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
+skip-if(Android&&emulator) fuzzy-if(cocoaWidget,0-1,0-4) fuzzy-if(winWidget,0-59,0-342) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
== intersecting-clipping-1-image.html intersecting-clipping-1-refi.html
== intersecting-clipping-1-overflow-hidden.html intersecting-clipping-1-ref.html
fuzzy(0-1,0-300) == intersecting-clipping-1-refi.html intersecting-clipping-1-ref.html
@@ -73,7 +73,7 @@ fuzzy(0-1,0-116) == invalidate-1a.html invalidate-1-ref.html
fuzzy(0-1,0-117) == invalidate-1b.html invalidate-1-ref.html
# test that border-radius is reduced for scrollbars
-fails-if(Android) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-12,0-12) fuzzy-if(!Android,0-1,0-50) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-12,0-12) == scrollbar-clamping-1.html scrollbar-clamping-1-ref.html
+fails-if(Android) fuzzy-if(!Android,0-1,0-50) fuzzy-if(gtkWidget,0-12,0-12) == scrollbar-clamping-1.html scrollbar-clamping-1-ref.html
fails-if(Android) == scrollbar-clamping-2.html scrollbar-clamping-2-ref.html
# Test for bad corner joins.
@@ -82,7 +82,7 @@ random-if(winWidget) fuzzy(0-255,0-610) == corner-joins-2.xhtml corner-joins-2-r
fuzzy(0-59,0-146) == scroll-1.html scroll-1-ref.html # see bug 732535 #Bug 959166
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-35,0-194) fuzzy-if(swgl,0-1,0-2) == transforms-1.html transforms-1-ref.html # bug 1507152
+fuzzy-if(winWidget,0-35,0-194) fuzzy-if(swgl,0-1,0-2) == transforms-1.html transforms-1-ref.html # bug 1507152
== zero-radius-clip-1.html zero-radius-clip-ref.html
diff --git a/layout/reftests/box-shadow/reftest.list b/layout/reftests/box-shadow/reftest.list
index ed6baf7946..f8f302b1cc 100644
--- a/layout/reftests/box-shadow/reftest.list
+++ b/layout/reftests/box-shadow/reftest.list
@@ -15,21 +15,21 @@ fuzzy(0-14,0-179) fuzzy-if(swgl&&!Android,0-1,0-952) fuzzy-if(useDrawSnapshot&&s
== boxshadow-fileupload.html boxshadow-fileupload-ref.html
fuzzy(13-19,28-51) == boxshadow-inner-basic.html boxshadow-inner-basic-ref.svg
-fuzzy(0-1,0-18) random-if(layersGPUAccelerated) == boxshadow-mixed.html boxshadow-mixed-ref.html
+fuzzy(0-1,0-18) random == boxshadow-mixed.html boxshadow-mixed-ref.html
fuzzy(0-1,0-17) == boxshadow-mixed-2.html boxshadow-mixed-2-ref.html
-random-if(d2d) fuzzy(0-127,0-3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
+random-if(winWidget) fuzzy(0-127,0-3528) == boxshadow-rounded-spread.html boxshadow-rounded-spread-ref.html
fuzzy(0-1,0-50) == chrome://reftest/content/box-shadow/boxshadow-dynamic.xhtml chrome://reftest/content/box-shadow/boxshadow-dynamic-ref.xhtml
-random-if(d2d) fuzzy(0-1,0-14) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
-random-if(d2d) fuzzy(0-1,0-22) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
-random-if(d2d) fuzzy(0-1,0-36) == boxshadow-threecorners.html boxshadow-threecorners-ref.html
+random-if(winWidget) fuzzy(0-1,0-14) == boxshadow-onecorner.html boxshadow-onecorner-ref.html
+random-if(winWidget) fuzzy(0-1,0-22) == boxshadow-twocorners.html boxshadow-twocorners-ref.html
+random-if(winWidget) fuzzy(0-1,0-36) == boxshadow-threecorners.html boxshadow-threecorners-ref.html
fuzzy(0-2,0-440) == boxshadow-skiprect.html boxshadow-skiprect-ref.html
fuzzy-if(useDrawSnapshot,1-1,1197-2400) == boxshadow-opacity.html boxshadow-opacity-ref.html
== boxshadow-color-rounding.html boxshadow-color-rounding-ref.html
== boxshadow-color-rounding-middle.html boxshadow-color-rounding-middle-ref.html
-fuzzy(0-3,0-500) fuzzy-if(d2d,0-2,0-1080) == boxshadow-border-radius-int.html boxshadow-border-radius-int-ref.html
+fuzzy(0-3,0-500) fuzzy-if(winWidget,0-2,0-1080) == boxshadow-border-radius-int.html boxshadow-border-radius-int-ref.html
== boxshadow-inset-neg-spread.html about:blank
== boxshadow-inset-neg-spread2.html boxshadow-inset-neg-spread2-ref.html
-fuzzy(0-26,0-3610) fuzzy-if(d2d,0-26,0-5910) fuzzy-if(!(swgl&&Android),0-6,378-4500) == boxshadow-rotated.html boxshadow-rotated-ref.html # Bug 1211264
+fuzzy(0-26,0-3610) fuzzy-if(winWidget,0-26,0-5910) fuzzy-if(!(swgl&&Android),0-6,378-4500) == boxshadow-rotated.html boxshadow-rotated-ref.html # Bug 1211264
== boxshadow-inset-large-border-radius.html boxshadow-inset-large-border-radius-ref.html
# fuzzy due to blur going inside, but as long as it's essentially black instead of a light gray its ok.
@@ -39,7 +39,7 @@ fuzzy(12-15,9400-13267) == boxshadow-inset-large-offset.html boxshadow-inset-lar
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref2.html
== overflow-not-scrollable-2.html overflow-not-scrollable-2-ref.html
fuzzy(0-1,0-655) == 611574-1.html 611574-1-ref.html
-fuzzy(0-4,0-144) fuzzy-if(d2d,0-1,0-36) == 611574-2.html 611574-2-ref.html
+fuzzy(0-4,0-144) fuzzy-if(winWidget,0-1,0-36) == 611574-2.html 611574-2-ref.html
fuzzy(0-16,0-10) == fieldset.html fieldset-ref.html # minor anti-aliasing problem on Windows
fuzzy(0-16,0-10) == fieldset-inset.html fieldset-inset-ref.html # minor anti-aliasing problem on Windows
== 1178575.html 1178575-ref.html
diff --git a/layout/reftests/bugs/1553571-1.html b/layout/reftests/bugs/1553571-1.html
index abb2c6ae5b..ee9e4782ab 100644
--- a/layout/reftests/bugs/1553571-1.html
+++ b/layout/reftests/bugs/1553571-1.html
@@ -2,6 +2,8 @@
<html class='reftest-wait'>
<head>
<script>
+let num = 0;
+let numMs = 50;
var changesLeft = 10;
function go() {
window.setTimeout(changeit, 0);
@@ -11,16 +13,26 @@ function changeit() {
var a = document.getElementById("a");
a.style.transform = 'scale(' + (256.1 + Math.random()*0.01) + ')';
+ num++;
+
if (changesLeft > 0) {
--changesLeft;
- window.setTimeout(changeit, 50);
+ window.setTimeout(changeit, numMs);
}
if (changesLeft == 0) {
// 75-100ms is the timeout for expirty from the active layer tracker.
// Increase the time between transform tweaks to 74ms to give the reftest the best
// chance of running the mozafterpaint handler and checking that there are no more
// paints pending so it can finish.
- window.setTimeout(changeit, 74);
+ numMs = 74;
+ if (num >= 100 && navigator.appVersion.includes("Android")) {
+ // That's not enough time on Android, so give it a bit more time. This still
+ // reproduces the original bug with the original patch backed out, even though
+ // one would think anything over 100ms would not reproduce, I'm not sure why.
+ // It's better to run the this with this timeout then have the test disabled.
+ numMs = 200;
+ }
+ window.setTimeout(changeit, numMs);
document.documentElement.classList.remove("reftest-wait");
}
}
diff --git a/layout/reftests/bugs/1553571-2.html b/layout/reftests/bugs/1553571-2.html
index 0b844745c0..ab064ca391 100644
--- a/layout/reftests/bugs/1553571-2.html
+++ b/layout/reftests/bugs/1553571-2.html
@@ -2,6 +2,8 @@
<html class='reftest-wait'>
<head>
<script>
+let num = 0;
+let numMs = 50;
var changesLeft = 10;
function go() {
window.setTimeout(changeit, 0);
@@ -11,16 +13,26 @@ function changeit() {
var a = document.getElementById("a");
a.style.transform = 'scale(' + (256.1 + Math.random()*0.01) + ') rotate(1deg)';
+ num++;
+
if (changesLeft > 0) {
--changesLeft;
- window.setTimeout(changeit, 50);
+ window.setTimeout(changeit, numMs);
}
if (changesLeft == 0) {
// 75-100ms is the timeout for expirty from the active layer tracker.
// Increase the time between transform tweaks to 74ms to give the reftest the best
// chance of running the mozafterpaint handler and checking that there are no more
// paints pending so it can finish.
- window.setTimeout(changeit, 74);
+ numMs = 74;
+ if (num >= 100 && navigator.appVersion.includes("Android")) {
+ // That's not enough time on Android, so give it a bit more time. This still
+ // reproduces the original bug with the original patch backed out, even though
+ // one would think anything over 100ms would not reproduce, I'm not sure why.
+ // It's better to run the this with this timeout then have the test disabled.
+ numMs = 200;
+ }
+ window.setTimeout(changeit, numMs);
document.documentElement.classList.remove("reftest-wait");
}
}
diff --git a/layout/reftests/bugs/1878294-1-ref.html b/layout/reftests/bugs/1878294-1-ref.html
new file mode 100644
index 0000000000..11a6029794
--- /dev/null
+++ b/layout/reftests/bugs/1878294-1-ref.html
@@ -0,0 +1,8 @@
+<html>
+<svg width="400" height="400">
+ <g id="g">
+ <circle cx="300" cy="300" r="40" style="fill: red;" transform="translate(-108213.2,-108213.2) scale(399)"></circle>
+ </g>
+</svg>
+
+</html>
diff --git a/layout/reftests/bugs/1878294-1.html b/layout/reftests/bugs/1878294-1.html
new file mode 100644
index 0000000000..ee91c38290
--- /dev/null
+++ b/layout/reftests/bugs/1878294-1.html
@@ -0,0 +1,41 @@
+<html class="reftest-wait">
+<svg width="400" height="400">
+ <g id="g">
+ <circle cx="300" cy="300" r="40" style="fill: red;"></circle>
+ </g>
+</svg>
+
+<script>
+const g = document.getElementById("g")
+
+let tx = -108213.2;
+let ty = -108213.2;
+let k = 399;
+
+let stepSize = 1;
+
+let num = 0;
+let numMs = 100;
+
+const move = () => {
+ stepSize = -1 * stepSize;
+ tx += 0.0001 * stepSize;
+ ty += 0.0001 * stepSize;
+ g.setAttribute("transform", `translate(${tx},${ty}) scale(${k})`)
+ window.setTimeout(move, numMs);
+ num++;
+ if (num == 5) {
+ document.documentElement.className = "";
+ }
+ if (num == 100 && navigator.appVersion.includes("Android")) {
+ // Android doesn't get a chance to paint and finish the reftest if another
+ // paint gets queued if we tweak the transfer, so if its taking a long time
+ // increase the timeout, this timeout value still reproduced the bug when
+ // test was landed.
+ numMs = 200;
+ }
+}
+
+move();
+</script>
+</html>
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list
index 902e7e63f0..d85d5e7310 100644
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -67,9 +67,9 @@ skip-if(isDebugBuild) == 256180-5.html 256180-5-ref.html
== 25888-2r-block.html 25888-2r-ref.html
== 25888-3l-block.html 25888-3l-ref.html
== 25888-3r-block.html 25888-3r-ref.html
-fuzzy-if(winWidget||gtkWidget,0-1,0-4) == 28811-1a.html 28811-1-ref.html
+fuzzy-if(gtkWidget||winWidget,0-1,0-4) == 28811-1a.html 28811-1-ref.html
fuzzy-if(gtkWidget,0-6,0-26200) == 28811-1b.html 28811-1-ref.html # Bug 1128229
-fuzzy-if(winWidget||gtkWidget,0-1,0-4) == 28811-2a.html 28811-2-ref.html
+fuzzy-if(gtkWidget||winWidget,0-1,0-4) == 28811-2a.html 28811-2-ref.html
fuzzy-if(gtkWidget,0-6,0-26200) == 28811-2b.html 28811-2-ref.html # Bug 1128229
== 40596-1a.html 40596-1-ref.html
!= 40596-1b.html 40596-1-ref.html
@@ -185,18 +185,18 @@ test-pref(font.minimum-size.x-western,32) == 1503662.html 1503662-ref.html
== chrome://reftest/content/bugs/192767-27.xhtml chrome://reftest/content/bugs/192767-37.xhtml
!= chrome://reftest/content/bugs/192767-01.xhtml chrome://reftest/content/bugs/192767-21.xhtml
!= chrome://reftest/content/bugs/192767-02.xhtml chrome://reftest/content/bugs/192767-22.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-03.xhtml chrome://reftest/content/bugs/192767-23.xhtml
+!= chrome://reftest/content/bugs/192767-03.xhtml chrome://reftest/content/bugs/192767-23.xhtml
!= chrome://reftest/content/bugs/192767-04.xhtml chrome://reftest/content/bugs/192767-24.xhtml
!= chrome://reftest/content/bugs/192767-05.xhtml chrome://reftest/content/bugs/192767-25.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-06.xhtml chrome://reftest/content/bugs/192767-26.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-07.xhtml chrome://reftest/content/bugs/192767-27.xhtml
+!= chrome://reftest/content/bugs/192767-06.xhtml chrome://reftest/content/bugs/192767-26.xhtml
+!= chrome://reftest/content/bugs/192767-07.xhtml chrome://reftest/content/bugs/192767-27.xhtml
!= chrome://reftest/content/bugs/192767-11.xhtml chrome://reftest/content/bugs/192767-31.xhtml
!= chrome://reftest/content/bugs/192767-12.xhtml chrome://reftest/content/bugs/192767-32.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-13.xhtml chrome://reftest/content/bugs/192767-33.xhtml
+!= chrome://reftest/content/bugs/192767-13.xhtml chrome://reftest/content/bugs/192767-33.xhtml
!= chrome://reftest/content/bugs/192767-14.xhtml chrome://reftest/content/bugs/192767-34.xhtml
!= chrome://reftest/content/bugs/192767-15.xhtml chrome://reftest/content/bugs/192767-35.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-16.xhtml chrome://reftest/content/bugs/192767-36.xhtml
-fails-if(Android&&!asyncPan) != chrome://reftest/content/bugs/192767-17.xhtml chrome://reftest/content/bugs/192767-37.xhtml
+!= chrome://reftest/content/bugs/192767-16.xhtml chrome://reftest/content/bugs/192767-36.xhtml
+!= chrome://reftest/content/bugs/192767-17.xhtml chrome://reftest/content/bugs/192767-37.xhtml
!= 200774-1.html about:blank
== 201215-1.html 201215-1-ref.html
== 201293-1a.html 201293-1-ref.html
@@ -258,7 +258,7 @@ fuzzy(0-4,0-2) == 236539-1.html 236539-1-ref.html
skip-if(Android) == 240933-2.html 240933-2-ref.html
== 243266-1.html 243266-1-ref.html
== 243302-1.html 243302-1-ref.html
-skip-if(Android&&asyncPan) == 243519-1.html 243519-1-ref.html
+skip-if(Android) == 243519-1.html 243519-1-ref.html
== 243519-2.html 243519-2-ref.html
== 243519-3.html 243519-3-ref.html
== 243519-4a.html 243519-4-ref.html
@@ -315,7 +315,7 @@ fuzzy(0-1,0-133) == 273681-1.html 273681-1-ref.html
== 283686-2.html 283686-2-ref.html
== 283686-3.html about:blank
== 289384-1.xhtml 289384-ref.xhtml
-random-if(d2d) fuzzy(0-25,0-2148) fails-if(useDrawSnapshot) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
+random-if(winWidget) fuzzy(0-25,0-2148) fails-if(useDrawSnapshot) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the winWidget failures
== 290129-1.html 290129-1-ref.html
== 291078-1.html 291078-1-ref.html
== 291078-2.html 291078-2-ref.html
@@ -326,7 +326,7 @@ random-if(d2d) fuzzy(0-25,0-2148) fails-if(useDrawSnapshot) HTTP == 289480.html#
== 296904-1.html 296904-1-ref.html
== 299136-1.html 299136-1-ref.html
== 299837-1.html 299837-1-ref.html
-skip-if(Android) random-if(d2d) == chrome://reftest/content/bugs/299837-3.xhtml chrome://reftest/content/bugs/299837-3-ref.xhtml # bug 587631
+skip-if(Android) random-if(winWidget) == chrome://reftest/content/bugs/299837-3.xhtml chrome://reftest/content/bugs/299837-3-ref.xhtml # bug 587631
== 300691-1a.html 300691-1-ref.html
== 300691-1b.html 300691-1-ref.html
== 300691-1c.html 300691-1-ref.html
@@ -554,9 +554,9 @@ fuzzy(0-4,0-11) == 363858-1.html 363858-1-ref.html
== 363858-2.html 363858-2-ref.html
fuzzy(0-1,0-4) == 363858-3.html 363858-3-ref.html
== 363858-4.html 363858-4-ref.html
-# fuzzy-if(OSX,0-45,0-2) fuzzy-if(winWidget,0-116,0-1) == 363858-5a.html 363858-5-ref.html # bug 1452797
+# fuzzy-if(cocoaWidget,0-45,0-2) fuzzy-if(winWidget,0-116,0-1) == 363858-5a.html 363858-5-ref.html # bug 1452797
fuzzy-if(Android,0-1,0-4) == 363858-5b.html 363858-5-ref.html
-# fuzzy-if(OSX,0-45,0-2) fuzzy-if(winWidget,0-116,0-1) == 363858-6a.html 363858-6-ref.html # bug 1452797
+# fuzzy-if(cocoaWidget,0-45,0-2) fuzzy-if(winWidget,0-116,0-1) == 363858-6a.html 363858-6-ref.html # bug 1452797
== 363858-6b.html 363858-6-ref.html
== 363874.html 363874-ref.html
== 363874-max-width.html 363874-max-width-ref.html
@@ -574,7 +574,7 @@ fuzzy-if(Android,0-1,0-4) == 363858-5b.html 363858-5-ref.html
== 367247-s-hidden.html 367247-s-auto.html
fails-if(Android) != 367247-s-auto.html 367247-s-scroll.html
!= 367247-l-visible.html 367247-l-hidden.html
-fails-if(Android&&!asyncPan) != 367247-l-hidden.html 367247-l-scroll.html
+!= 367247-l-hidden.html 367247-l-scroll.html
== 367247-l-scroll.html 367247-l-auto.html
== 367332-1a.html 367332-1-ref.html
== 367332-1b.html 367332-1-ref.html
@@ -595,7 +595,7 @@ fails-if(Android&&!asyncPan) != 367247-l-hidden.html 367247-l-scroll.html
== 367612-1e.html 367612-1-ref.html
== 367612-1f.html 367612-1-ref.html
!= 367612-1g.html 367612-1-ref.html
-fuzzy(0-32,0-33) fuzzy-if(d2d,0-5,0-2) == 368020-1.html 368020-1-ref.html
+fuzzy(0-32,0-33) fuzzy-if(winWidget,0-5,0-2) == 368020-1.html 368020-1-ref.html
== 368020-2.html 368020-2-ref.html
random-if(useDrawSnapshot) == 368020-3.html 368020-3-ref.html # Bug 1715408
random-if(useDrawSnapshot) == 368020-5.html 368020-5-ref.html # Bug 1715408
@@ -638,7 +638,7 @@ fuzzy(0-1,0-4) == 370422-1.html 370422-1-ref.html
== 371043-1.html 371043-1-ref.html
== 371354-1.html 371354-1-ref.html
== 371483-1.html about:blank # assertion test
-fails-if(Android&&!asyncPan) == 371561-1.html 371561-1-ref.html
+== 371561-1.html 371561-1-ref.html
!= 371681-1.xhtml about:blank
== 371925-1a.html 371925-1-ref.html
== 371925-1b.html 371925-1-ref.html
@@ -652,7 +652,7 @@ fuzzy-if(winWidget,46-92,1-2) == 373295-1.html 373295-1-ref.html
== 373298-1.html 373298-1-ref.html
== 373381-1.html 373381-1-ref.html
fuzzy-if(!Android,0-2,0-40) == 373381-2.html 373381-2-ref.html
-random-if(d2d) == 373381-3.html 373381-3-ref.html
+random-if(winWidget) == 373381-3.html 373381-3-ref.html
== 373381-4.html 373381-4-ref.html
== 373383-1.html 373383-1-ref.html
== 373433-1.html 373433-1-ref.html
@@ -693,7 +693,7 @@ fuzzy-if(Android,0-2,0-140) == 379349-3b.xhtml 379349-3-ref.xhtml
== 379461-1.xhtml 379461-1.html
== 379461-2.xhtml 379461-2.html
== 379461-3-container-xhtml.html 379461-3-container-html.html
-fails-if(Android&&!asyncPan) != 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar
+!= 379461-3-container-xhtml.html 379461-3-container-blank.html # there is a scrollbar
fuzzy(0-1,0-5) == 380004-1.html 380004-1-ref.html
fuzzy(0-2,0-5) == 380227-1.html 380227-1-ref.html
== 380825-1.html 380825-1-ref.html
@@ -990,7 +990,7 @@ fuzzy(0-92,0-430) == chrome://reftest/content/bugs/421203-2.xhtml 421203-1-ref.h
== 421436-1b.html 421436-1-ref.html
fuzzy(0-1,0-40) == 421632-1.html 421632-1-ref.html
!= 421710-1.html about:blank
-fails-if(Android) fuzzy(63-65,1024-1024) fails-if(usesRepeatResampling&&!winWidget) == 421885-1.xml 421885-1-ref.xml
+fails-if(Android) fuzzy(63-65,1024-1024) == 421885-1.xml 421885-1-ref.xml
== 421955-1.html 421955-1-ref.html
== 422249-1.html 422249-1-ref.html
== 422394-1.html 422394-1-ref.html
@@ -1140,13 +1140,13 @@ random == 445004-1.html 445004-1-ref.html # bug 472268
== 445142-1c.html 445142-1-ref.html
== 445142-2a.html 445142-2-ref.html
== 445142-2b.html 445142-2-ref.html
-skip-if(winWidget&&isCoverageBuild) fails-if(usesRepeatResampling) fails-if(!winWidget) == 446100-1a.html about:blank
-fuzzy-if(winWidget,177-178,127-127) fails-if(usesRepeatResampling) fails-if(!winWidget) == 446100-1b.html about:blank
+skip-if(winWidget&&isCoverageBuild) fails == 446100-1a.html about:blank
+fuzzy-if(winWidget,177-178,127-127) fails == 446100-1b.html about:blank
fuzzy-if(winWidget,171-172,192-192) fails-if(!winWidget) == 446100-1c.html about:blank
-fails-if(usesRepeatResampling) fails-if(!winWidget) == 446100-1d.html about:blank
-fails-if(usesRepeatResampling) fails-if(!useDrawSnapshot&&!winWidget) == 446100-1e.html about:blank
+fails == 446100-1d.html about:blank
+fails-if(!useDrawSnapshot) == 446100-1e.html about:blank
== 446100-1f.html about:blank
-fails-if(winWidget&&isCoverageBuild) fails-if(usesRepeatResampling) fails-if(Android) fails-if(!useDrawSnapshot&&!winWidget) == 446100-1g.html about:blank
+fails-if(!useDrawSnapshot) == 446100-1g.html about:blank
== 446100-1h.html about:blank
== 447749-1.html 447749-1-ref.html
fuzzy(0-127,0-2) == 448193.html 448193-ref.html
@@ -1253,7 +1253,7 @@ fuzzy(0-1,0-5) == 474472-1.html 474472-1-ref.html
== 476598-1b.html 476598-1-ref2.html
!= 476598-1-ref.html about:blank
== 476856-1.html 476856-1-ref.html
-skip-if(Android) random-if(d2d) == chrome://reftest/content/bugs/478377-1.xhtml chrome://reftest/content/bugs/478377-1-ref.xhtml
+skip-if(Android) random-if(winWidget) == chrome://reftest/content/bugs/478377-1.xhtml chrome://reftest/content/bugs/478377-1-ref.xhtml
== 478614-1.html 478614-1-ref.html
== 478614-2.html 478614-1-ref.html
== 478614-3.html 478614-3-ref.html
@@ -1282,8 +1282,8 @@ skip-if(Android) random-if(d2d) == chrome://reftest/content/bugs/478377-1.xhtml
!= 481948-2.html 481948-2-ref.html
fails-if(Android||gtkWidget) random-if(winWidget||cocoaWidget) == 481948-3.html 481948-3-ref.html # questionable test, see bug 488364
== 482398-1.html 482398-1-ref.html
-random-if(d2d) == 482592-1a-shadow.xhtml 482592-1-ref.html # bug 586771
-random-if(d2d) == 482592-1b-shadow.xhtml 482592-1-ref.html # bug 586771
+random-if(winWidget) == 482592-1a-shadow.xhtml 482592-1-ref.html # bug 586771
+random-if(winWidget) == 482592-1b-shadow.xhtml 482592-1-ref.html # bug 586771
random-if(winWidget) fuzzy(0-1,0-5) == 482659-1a.html 482659-1-ref.html
fuzzy(0-1,0-5) == 482659-1b.html 482659-1-ref.html
fuzzy(0-1,0-5) == 482659-1c.html 482659-1-ref.html
@@ -1373,7 +1373,7 @@ fuzzy(0-1,0-4) == 513153-1b.html 513153-1-ref.html
pref(widget.non-native-theme.webrender,true) == 513153-2a.html 513153-2-ref.html # appleSilicon: bug 1724583
fuzzy-if(cocoaWidget,0-112,0-108) == 513153-2b.html 513153-2-ref.html # only fuzzy when widget.non-native-theme.webrender=false, snapping difference
== chrome://reftest/content/bugs/513318-1.xhtml chrome://reftest/content/bugs/513318-1-ref.xhtml
-fails-if(Android&&(!asyncPan)) != chrome://reftest/content/bugs/513318-2.xhtml chrome://reftest/content/bugs/513318-2-ref.xhtml
+!= chrome://reftest/content/bugs/513318-2.xhtml chrome://reftest/content/bugs/513318-2-ref.xhtml
== 514917-1.html 514917-1-ref.html
== 518172-1a.html 518172-a-ref.html
fuzzy-if(winWidget,0-73,0-133) fuzzy-if(cocoaWidget,0-103,0-133) == 518172-1b.html 518172-b-ref.html
@@ -1389,7 +1389,7 @@ fuzzy(0-1,0-3) == 521525-1.html 521525-1-ref.html
== 521685-1.html 521685-1-ref.html
== 522632-1.html 522632-1-ref.html
== 523096-1.html 523096-1-ref.html
-random-if(d2d) == 523468-1.html 523468-1-ref.html
+random-if(winWidget) == 523468-1.html 523468-1-ref.html
== 524175-1.html 524175-1-ref.html
fuzzy(0-5,0-50) == 526463-1.html 526463-1-ref.html
== 527464-1.html 527464-ref.html
@@ -1445,7 +1445,7 @@ fuzzy-if(Android,0-12,0-300) == 551463-1.html 551463-1-ref.html
# Marked "random" rather than "fails" because it may (spuriously) appear to pass
# on Android devices that completely lack any Sinhala font support.
random != 553571-1.html 553571-1-notref.html # expect dotted circle in test, not in ref: "fails" under harfbuzz, which doesn't consider the sequence invalid
-random-if(d2d) skip-if(azureSkiaGL) fuzzy(0-32,0-219) == 555388-1.html 555388-1-ref.html
+random-if(winWidget) fuzzy(0-32,0-219) == 555388-1.html 555388-1-ref.html
== 556661-1.html 556661-1-ref.html
fuzzy(0-4,0-9) == 557087-1.html 557087-ref.html
fuzzy(0-2,0-5) fuzzy-if(Android,0-1,0-9) == 557087-2.html 557087-ref.html
@@ -1461,7 +1461,7 @@ fuzzy(0-1,0-5) == 561981-5.html 561981-5-ref.html
fuzzy(0-1,0-5) == 561981-7.html 561981-7-ref.html
== 561981-8.html 561981-8-ref.html
== 562835-1.html 562835-ref.html
-== 562835-2.html 562835-ref.html
+pref(layout.css.h1-in-section-ua-styles.enabled,true) == 562835-2.html 562835-ref.html
fuzzy-if(Android,0-2,0-48) == 563584-1.html 563584-1-ref.html
fuzzy-if(Android,0-2,0-48) == 563584-2.html 563584-2-ref.html
fuzzy-if(Android,0-4,0-180) == 563584-3.html 563584-3-ref.html
@@ -1487,7 +1487,7 @@ fuzzy-if(Android,0-2,0-48) == 563584-11.html 563584-11-ref.html
== 563884-1.html 563884-1-ref.html
== 564002-1.html 564002-1-ref.html
== 564054-1.html 564054-1-ref.html
-fails-if(Android) random-if(layersGPUAccelerated) fuzzy(0-1,0-1200) == 564991-1.html 564991-1-ref.html
+fails-if(Android) random fuzzy(0-1,0-1200) == 564991-1.html 564991-1-ref.html
== 565819-1.html 565819-ref.html
== 565819-2.html 565819-ref.html
fuzzy-if(Android,0-1,0-1) needs-focus == 568441.html 568441-ref.html
@@ -1513,9 +1513,9 @@ random-if(!winWidget) != 574907-3.html 574907-3-notref.html
== chrome://reftest/content/bugs/579323-1.html chrome://reftest/content/bugs/579323-1-ref.html
== 579349-1.html 579349-1-ref.html
== 579655-1.html 579655-1-ref.html
-fails-if(Android) random-if(layersGPUAccelerated) fuzzy(0-1,0-10000) == 579985-1.html 579985-1-ref.html # this bug was only for a regression in BasicLayers anyway
-fuzzy-if(asyncPan&&!layersGPUAccelerated,0-255,0-141) == 580863-1.html 580863-1-ref.html
-fails-if(Android) random-if(layersGPUAccelerated) fuzzy(0-1,0-6436) == 581317-1.html 581317-1-ref.html
+fails-if(Android) random fuzzy(0-1,0-10000) == 579985-1.html 579985-1-ref.html # this bug was only for a regression in BasicLayers anyway
+== 580863-1.html 580863-1-ref.html
+fails-if(Android) random fuzzy(0-1,0-6436) == 581317-1.html 581317-1-ref.html
== 581579-1.html 581579-1-ref.html
== 582037-1a.html 582037-1-ref.html
== 582037-1b.html 582037-1-ref.html
@@ -1527,7 +1527,7 @@ asserts(1-2) == 582146-1.html about:blank
== 584699-1.html 584699-1-ref.html
fuzzy(0-2,0-48) fuzzy-if(winWidget,0-1,0-33) == 585598-2.xhtml 585598-2-ref.xhtml
== 586400-1.html 586400-1-ref.html
-fuzzy-if(d2d,0-52,0-1051) == 586683-1.html 586683-1-ref.html
+fuzzy-if(winWidget,0-52,0-1051) == 586683-1.html 586683-1-ref.html
== 589615-1a.xhtml 589615-1-ref.html
== 589615-1b.html 589615-1-ref.html
== 589672-1.html 589672-1-ref.html
@@ -1590,19 +1590,19 @@ fails-if(useDrawSnapshot) == 621253-2-externalFilter.html 621253-2-ref.html
fails-if(useDrawSnapshot) == 621253-2-internalFilter.html 621253-2-ref.html
random-if(winWidget) == 621918-1.svg 621918-1-ref.svg # 1-pixel diacritic positioning discrepancy in rotated text (may depend on platform fonts)
random-if(winWidget) fuzzy-if(geckoview&&!emulator,0-255,0-22) == 621918-2.svg 621918-2-ref.svg # same 1px issue as above
-fuzzy-if(d2d,0-5,0-1) == 622585-1.html 622585-1-ref.html # bug 789402
+fuzzy-if(winWidget,0-5,0-1) == 622585-1.html 622585-1-ref.html # bug 789402
fuzzy(0-1,0-40000) == 625409-1.html 625409-1-ref.html
== 627393-1.html about:blank
fuzzy(0-1,0-500) == 630835-1.html about:blank
== 631352-1.html 631352-1-ref.html
random-if(winWidget) == 632781-verybig.html 632781-ref.html
== 632781-normalsize.html 632781-ref.html
-fuzzy-if(!isDebugBuild&&gtkWidget&&/^Linux\x20i686/.test(http.oscpu),0-102,0-140) == 633344-1.html 633344-1-ref.html # bug 1103623, Linux32 from GCC update
+== 633344-1.html 633344-1-ref.html # bug 1103623, Linux32 from GCC update
fuzzy(0-1,0-500) == 634232-1.html 634232-1-ref.html
skip-if(Android&&emulator) fuzzy(0-3,0-120000) == 635302-1.html 635302-1-ref.html
fuzzy(0-1,0-68) fuzzy-if(gtkWidget,0-1,0-70) fuzzy-if(!Android,0-2,0-300) == 635373-1.html 635373-1-ref.html
-random-if(d2d) fuzzy-if(winWidget&&!d2d,0-20,0-118) fuzzy-if(!Android,0-2,0-550) == 635373-2.html 635373-2-ref.html
-random-if(d2d) fuzzy-if(winWidget&&!d2d,0-20,0-116) fuzzy-if(!Android,0-2,0-650) == 635373-3.html 635373-3-ref.html
+random-if(winWidget) fuzzy-if(!Android,0-2,0-550) == 635373-2.html 635373-2-ref.html
+random-if(winWidget) fuzzy-if(!Android,0-2,0-650) == 635373-3.html 635373-3-ref.html
== 635639-1.html 635639-1-ref.html
== 635639-2.html 635639-2-ref.html
== 637597-1.html 637597-1-ref.html
@@ -1615,7 +1615,7 @@ fuzzy-if(Android,0-8,0-500) == 637852-3.html 637852-3-ref.html
== 645647-1.html 645647-1-ref.html
== 645647-2.html 645647-2-ref.html
== 645768-1.html 645768-1-ref.html
-fails-if(layersGPUAccelerated&&cocoaWidget) fuzzy(0-57,0-11000) == 650228-1.html 650228-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
+fails-if(cocoaWidget) fuzzy(0-57,0-11000) == 650228-1.html 650228-1-ref.html # Quartz alpha blending doesn't match GL alpha blending
needs-focus == 652301-1a.html 652301-1-ref.html
needs-focus == 652301-1b.html 652301-1-ref.html
fuzzy(0-2,0-5) == 652775-1.html 652775-1-ref.html
@@ -1638,7 +1638,7 @@ skip-if(Android) fuzzy(0-1,0-68000) == chrome://reftest/content/bugs/664127-1.xh
== 667079-1.html 667079-1-ref.html
skip-if(Android) == chrome://reftest/content/bugs/668319-1.xhtml about:blank
!= chrome://reftest/content/bugs/669015-1.xhtml chrome://reftest/content/bugs/669015-1-notref.xhtml
-skip-if(azureSkiaGL) fuzzy-if(Android&&device,0-55,0-3742) == 670442-1.html 670442-1-ref.html
+fuzzy-if(Android&&device,0-55,0-3742) == 670442-1.html 670442-1-ref.html
== 670467-1.html 670467-1-ref.html
== 670467-2.html 670467-2-ref.html
== 690164-1.html 690164-1-ref.html
@@ -1660,7 +1660,7 @@ fuzzy(0-1,0-3) needs-focus == 712130-2.html 712130-2-ref.html
== 714519-1-q.html 714519-1-ref.html
== 714519-2-as.html 714519-2-ref.html
== 714519-2-q.html 714519-2-ref.html
-skip-if(Android&&emulator) fuzzy(0-1,0-21) fuzzy-if(d2d,0-77,0-173) fuzzy-if(cocoaWidget,0-1,0-170) fuzzy-if(useDrawSnapshot,1-1,163-163) == 718521.html 718521-ref.html # bug 773482
+skip-if(Android&&emulator) fuzzy(0-1,0-21) fuzzy-if(winWidget,0-77,0-173) fuzzy-if(cocoaWidget,0-1,0-170) fuzzy-if(useDrawSnapshot,1-1,163-163) == 718521.html 718521-ref.html # bug 773482
== 720987.html 720987-ref.html
== 722888-1.html 722888-1-ref.html
fuzzy(0-2,0-40000) == 722923-1.html 722923-1-ref.html
@@ -1711,7 +1711,7 @@ fuzzy-if(Android,0-4,0-400) == 815593-1.html 815593-1-ref.html
fuzzy(0-1,0-5) == 816948-1.html 816948-1-ref.html
== 817019-1.html about:blank
fuzzy(0-1,0-5) == 818276-1.html 818276-1-ref.html
-fuzzy-if(asyncPan,0-190,0-510) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-510) == 825999.html 825999-ref.html
+fuzzy-if(!useDrawSnapshot,0-190,0-510) == 825999.html 825999-ref.html
== 827577-1a.html 827577-1-ref.html
== 827577-1b.html 827577-1-ref.html
== 827799-1.html about:blank
@@ -1751,7 +1751,7 @@ test-pref(font.minimum-size.x-western,32) fuzzy-if(Android,0-45,0-324) == 935056
== 936670-1.svg 936670-1-ref.svg
== 941940-1.html 941940-1-ref.html
fails == 942017.html 942017-ref.html # bug 942017
-fuzzy(0-2,0-160000) fuzzy-if(winWidget&&isDebugBuild&&layersGPUAccelerated&&!is64Bit,1-1,12-175) == 942672-1.html 942672-1-ref.html
+fuzzy(0-2,0-160000) fuzzy-if(winWidget&&isDebugBuild&&!is64Bit,1-1,12-175) == 942672-1.html 942672-1-ref.html
== 953334-win32-clipping.html 953334-win32-clipping-ref.html
fuzzy(0-1,0-5) == 956513-1.svg 956513-1-ref.svg
== 944291-1.html 944291-1-ref.html
@@ -1813,7 +1813,7 @@ fuzzy(15-65,100-500) fuzzy-if(useDrawSnapshot,33-33,218-218) == 1081185-1.html 1
== 1097437-1.html 1097437-1-ref.html
== 1103258-1.html 1103258-1-ref.html # assertion crash test with layers culling test
== 1105137-1.html 1105137-1-ref.html
-fuzzy-if(d2d,0-36,0-304) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&d2d,0-139,0-701) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
+fuzzy-if(winWidget,0-139,0-701) == 1116480-1-fakeitalic-overflow.html 1116480-1-fakeitalic-overflow-ref.html
== 1111753-1.html about:blank
== chrome://reftest/content/bugs/1114526-1.html 1114526-1-ref.html
fuzzy(0-1,0-800000) == 1119117-1a.html 1119117-1-ref.html
@@ -1943,12 +1943,12 @@ fuzzy-if(Android,0-27,0-874) fuzzy-if(!Android,0-14,0-43) fuzzy-if(gtkWidget&&fi
fuzzy(0-3,0-320000) fails-if(useDrawSnapshot) == 1315113-1.html 1315113-1-ref.html
fuzzy(0-3,0-20000) == 1315113-2.html 1315113-2-ref.html
== 1315632-1.html 1315632-1-ref.html
-fuzzy(0-3,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1a.html 1316719-1-ref.html
-fuzzy(0-13,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1b.html 1316719-1-ref.html
-fuzzy(0-13,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1c.html 1316719-1-ref.html
+fuzzy(0-3,0-40000) fuzzy-if(winWidget,0-13,0-40000) == 1316719-1a.html 1316719-1-ref.html
+fuzzy(0-13,0-40000) fuzzy-if(winWidget,0-13,0-40000) == 1316719-1b.html 1316719-1-ref.html
+fuzzy(0-13,0-40000) fuzzy-if(winWidget,0-13,0-40000) == 1316719-1c.html 1316719-1-ref.html
!= 1318769-1.html 1318769-1-ref.html
== 1322512-1.html 1322512-1-ref.html
-skip-if(isDebugBuild&&winWidget) == 1330051.svg 1330051-ref.svg
+skip-if(winWidget&&isDebugBuild) == 1330051.svg 1330051-ref.svg
!= 1336591-1.html 1336591-1-ref.html
== 1348481-1.html 1348481-ref.html
== 1348481-2.html 1348481-ref.html
@@ -2017,7 +2017,7 @@ skip-if(winWidget&&isCoverageBuild) == 1424177.html 1424177-ref.html
== 1424680.html 1424680-ref.html
== 1424798-1.html 1424798-ref.html
fuzzy-if(swgl,0-1,0-31430) == 1425243-1.html 1425243-1-ref.html
-fuzzy-if(Android,0-66,0-574) fuzzy-if(d2d,0-89,0-777) fuzzy-if(!Android&&!d2d,0-1,0-31430) fuzzy-if(winWidget,1-1,31240-31430) == 1425243-2.html 1425243-2-ref.html
+fuzzy-if(Android,0-66,0-574) fuzzy-if(winWidget,1-1,31240-31430) fuzzy-if(!Android&&!winWidget,0-1,0-31430) == 1425243-2.html 1425243-2-ref.html
== 1430869.html 1430869-ref.html
== 1432541.html 1432541-ref.html
== 1446470.html 1035091-ref.html
@@ -2046,7 +2046,7 @@ fuzzy(0-5,0-2300) == 1529992-1.html 1529992-1-ref.html
fuzzy-if(Android,9-14,44-60) fails-if(!useDrawSnapshot) == 1529992-2.html 1529992-2-ref.html
== 1535040-1.html 1535040-1-ref.html
== 1545360-1.xhtml 1545360-1-ref.xhtml
-skip-if(!asyncPan) == 1544895.html 1544895-ref.html
+skip-if(useDrawSnapshot) == 1544895.html 1544895-ref.html
random-if(useDrawSnapshot) == 1546856-1.html 1546856-ref.html
== 1546856-2.html 1546856-ref.html
== 1547759-1.html 1547759-1-ref.html
@@ -2054,8 +2054,8 @@ random-if(useDrawSnapshot) == 1546856-1.html 1546856-ref.html
test-pref(layout.css.prefers-color-scheme.content-override,0) != 1551040.txt 1551040.txt
test-pref(layout.css.prefers-color-scheme.content-override,0) == 1551040.html 1551040.html
!= 1552789-1.html 1552789-ref-1.html
-pref(image.downscale-during-decode.enabled,true) skip-if(((gtkWidget&&isDebugBuild)||(gtkWidget&&AddressSanitizer)||Android||ThreadSanitizer)||(Android&&isDebugBuild)) random-if(useDrawSnapshot) fuzzy(0-2,0-188) == 1553571-1.html 1553571-1-ref.html
-pref(image.downscale-during-decode.enabled,true) fuzzy(0-2,0-2004) skip-if(((gtkWidget&&isDebugBuild)||(gtkWidget&&AddressSanitizer)||Android||ThreadSanitizer)||(Android&&isDebugBuild)) random-if(useDrawSnapshot) == 1553571-2.html 1553571-2-ref.html
+pref(image.downscale-during-decode.enabled,true) skip-if(((gtkWidget&&isDebugBuild)||(gtkWidget&&AddressSanitizer)||ThreadSanitizer)||(Android&&isDebugBuild)) random-if(useDrawSnapshot) fuzzy(0-2,0-188) == 1553571-1.html 1553571-1-ref.html
+pref(image.downscale-during-decode.enabled,true) fuzzy(0-2,0-2004) skip-if(((gtkWidget&&isDebugBuild)||(gtkWidget&&AddressSanitizer)||ThreadSanitizer)||(Android&&isDebugBuild)) random-if(useDrawSnapshot) == 1553571-2.html 1553571-2-ref.html
== 1558937-1.html 1558937-1-ref.html
!= 1563484.html 1563484-notref.html
== 1563484.html 1563484-ref.html
@@ -2071,11 +2071,11 @@ asserts(1-2) == 1588954.html 1588954-ref.html # Bug 1588954
!= 1599841-2.html 1599841-2-notref.html
== chrome://reftest/content/bugs/1606130.html chrome://reftest/content/bugs/1606130-ref.html
== 1608124-1.html 1608124-1-ref.html
-skip-if(!OSX) != 1608124-2.html 1608124-2-notref.html
+skip-if(!cocoaWidget) != 1608124-2.html 1608124-2-notref.html
== 1613380.html 1613380-ref.html
fuzzy(0-145,0-48536) == 1614788-1.svg 1614788-1-ref.svg # large fuzz necesary to test bug: 239,202824 is how much it differs when bug exists
== blob-fallback-clip.html blob-fallback-clip-ref.html
-fuzzy-if(OSX,0-42,0-4) fuzzy-if(winWidget,249-249,999-999) == 1617515-1.html 1617515-1-ref.html
+fuzzy-if(cocoaWidget,0-42,0-4) fuzzy-if(winWidget,249-249,999-999) == 1617515-1.html 1617515-1-ref.html
== 1624118.html 1624118-ref.html
fuzzy(0-2,0-21184) == 1626259-1.html 1626259-1-ref.html
fuzzy(0-2,0-21184) == 1626259-2.html 1626259-2-ref.html
@@ -2091,9 +2091,9 @@ fuzzy(0-2,0-96600) == 1648282-1b.html 1648282-1-ref.html
== 1673677-3.html 1673677-3-ref.html
== 1686729-1.html 1686729-1-ref.html
!= chrome://reftest/content/bugs/1688004.xhtml about:blank
-pref(image.downscale-during-decode.enabled,true) fuzzy-if(OSX||winWidget,0-167,0-44310) fuzzy-if(gtkWidget,0-2,0-37220) == 1714763-1.html 1714763-1-ref.html
-pref(image.downscale-during-decode.enabled,true) fuzzy-if(OSX||winWidget,0-166,0-22530) fuzzy-if(gtkWidget,0-18,0-19006) fuzzy-if(Android,0-21,0-22260) == 1714763-2.html 1714763-2-ref.html
-pref(image.downscale-during-decode.enabled,true) fuzzy-if(OSX||winWidget,0-235,0-289) fuzzy-if(gtkWidget,0-186,0-240) fuzzy-if(Android,0-185,0-232) == 1714763-3.html 1714763-3-ref.html
+pref(image.downscale-during-decode.enabled,true) fuzzy-if(cocoaWidget||winWidget,0-167,0-44310) fuzzy-if(gtkWidget,0-2,0-37220) == 1714763-1.html 1714763-1-ref.html
+pref(image.downscale-during-decode.enabled,true) fuzzy-if(cocoaWidget||winWidget,0-166,0-22530) fuzzy-if(gtkWidget,0-18,0-19006) fuzzy-if(Android,0-21,0-22260) == 1714763-2.html 1714763-2-ref.html
+pref(image.downscale-during-decode.enabled,true) fuzzy-if(cocoaWidget||winWidget,0-235,0-289) fuzzy-if(gtkWidget,0-186,0-240) fuzzy-if(Android,0-185,0-232) == 1714763-3.html 1714763-3-ref.html
skip-if(!appleSilicon) != 1721223-1.html 1721223-1-notref.html # Big Sur required for updated system font; OSX value is clamped to 10.15
skip-if(Android) == 1727172-1.xhtml 1727172-1-ref.html
== 1726663-1.html 1726663-1-ref.html
@@ -2134,8 +2134,8 @@ pref(layout.css.prefers-color-scheme.content-override,0) == 1787127.html 1787127
pref(layout.css.prefers-color-scheme.content-override,1) == 1787127.html 1787127-ref.html
pref(layout.css.prefers-color-scheme.content-override,2) == 1787127.html 1787127-ref.html
== 1792643-1.html 1792643-1-ref.html
-skip-if(!/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == 1798297-1.html 1798297-1-ref.html
-skip-if(!/^Windows\x20NT\x2010\.0/.test(http.oscpu)) != 1798297-1.html 1798297-1-notref.html
+skip-if(!winWidget) == 1798297-1.html 1798297-1-ref.html
+skip-if(!winWidget) != 1798297-1.html 1798297-1-notref.html
== 1799425-1.html 1799425-1-ref.html
fuzzy-if(winWidget,114-114,572-572) == 1800437-1.html 1800437-1-ref.html
== 1803999-1.html 1803999-1-ref.html
@@ -2149,9 +2149,9 @@ pref(image.downscale-during-decode.enabled,true) == 1804872-3.html 1804872-3-ref
== 1827009-1.html 1827009-1-ref.html
pref(layout.testing.overlay-scrollbars.always-visible,true) pref(ui.useOverlayScrollbars,1) == 1827337-1.html 1827337-1-ref.html
pref(layout.testing.overlay-scrollbars.always-visible,true) pref(ui.useOverlayScrollbars,1) fuzzy-if(winWidget,0-21,0-134) fuzzy-if(cocoaWidget,0-2,0-12) == 1828879-1.html 1828879-1-ref.html
-skip-if(!OSX) != 1834316-1.html 1834316-1-notref.html
-skip-if(!OSX) test-pref(layout.css.font-visibility.standard,1) ref-pref(layout.css.font-visibility.standard,3) == 1835271-1.html 1835271-1-ref.html
-skip-if(!OSX) != 1836024-1.html 1836024-1-notref.html
+skip-if(!cocoaWidget) != 1834316-1.html 1834316-1-notref.html
+skip-if(!cocoaWidget) test-pref(layout.css.font-visibility.standard,1) ref-pref(layout.css.font-visibility.standard,3) == 1835271-1.html 1835271-1-ref.html
+skip-if(!cocoaWidget) != 1836024-1.html 1836024-1-notref.html
# The 1840511-* tests are reliably fuzzy on certain configurations, per bug
# 1840511. (It passes on macOS and Android. It also passes with software WR,
# or when using drawSnapshot.)
@@ -2164,3 +2164,4 @@ fuzzy-if(!useDrawSnapshot,18-19,294-322) == 1840747-1.html about:blank
# through, which is unexpected and is responsible for the 255-255 difference
# here. That's tracked in bug 1840747.
fuzzy-if(!useDrawSnapshot&&!swgl,254-255,110-121) fuzzy-if(useDrawSnapshot,18-18,93-93) fuzzy-if(swgl,19-19,58-58) == 1841355-1.html about:blank
+skip-if(((AddressSanitizer||ThreadSanitizer)&&gtkWidget)||(isDebugBuild&&Android)) fuzzy(0-123,0-1425) == 1878294-1.html 1878294-1-ref.html
diff --git a/layout/reftests/canvas/reftest.list b/layout/reftests/canvas/reftest.list
index a95705d633..66e84dd1d6 100644
--- a/layout/reftests/canvas/reftest.list
+++ b/layout/reftests/canvas/reftest.list
@@ -30,8 +30,8 @@ random-if(cocoaWidget) == subpixel-1.html about:blank # see bug 1192616, re-enab
== text-ltr-alignment-test.html text-ltr-alignment-ref.html
== text-rtl-alignment-test.html text-rtl-alignment-ref.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-256) == text-horzline-with-bottom.html text-horzline.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-256) fails-if(azureSkia&&OSX) == text-horzline-with-top.html text-horzline.html
+fuzzy-if(winWidget,0-1,0-256) == text-horzline-with-bottom.html text-horzline.html
+fuzzy-if(winWidget,0-1,0-256) fails-if(cocoaWidget) == text-horzline-with-top.html text-horzline.html
!= text-big-stroke.html text-blank.html
!= text-big-stroke.html text-big-fill.html
@@ -42,7 +42,7 @@ fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-256) fails-if(azureSki
== text-no-frame-test.html text-no-frame-ref.html
== text-no-frame-2-test.html text-not-in-doc-ref.html
-fuzzy-if(azureSkiaGL,0-10,0-400) == text-not-in-doc-test.html text-not-in-doc-ref.html
+== text-not-in-doc-test.html text-not-in-doc-ref.html
== text-bidi-ltr-test.html text-bidi-ltr-ref.html
!= text-bidi-ltr-test.html text-bidi-ltr-notref.html # for bug 698185
@@ -53,7 +53,7 @@ fuzzy-if(azureSkiaGL,0-10,0-400) == text-not-in-doc-test.html text-not-in-doc-re
== text-measure.html text-measure-ref.html
== text-small-caps-1.html text-small-caps-1-ref.html
-random-if(!d2d) != text-subpixel-1.html text-subpixel-1-ref.html
+random-if(!winWidget) != text-subpixel-1.html text-subpixel-1-ref.html
== strokeText-path.html strokeText-path-ref.html
@@ -79,7 +79,7 @@ fuzzy(0-9,0-470) random-if(Android) == dash-1.html dash-1-ref.svg # Bug 668412 (
== ctm-singular-sanity.html data:text/html,<body>Pass
== 672646-alpha-radial-gradient.html 672646-alpha-radial-gradient-ref.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-45) == 674003-alpha-radial-gradient-superlum.html 674003-alpha-radial-gradient-superlum-ref.html
+fuzzy-if(winWidget,0-1,0-45) == 674003-alpha-radial-gradient-superlum.html 674003-alpha-radial-gradient-superlum-ref.html
!= 693610-1.html 693610-1-notref.html # bug 693610: multiple glyph runs should not be overprinted
@@ -92,7 +92,7 @@ fuzzy(0-1,0-20) == transformed-gradient.html transformed-gradient-ref.html
== 749467-1.html 749467-1-ref.html
# You get a little bit of rounding fuzz on OSX from transforming the paths between user space and device space
-fuzzy(0-16,0-84) fuzzy-if(d2d&&/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-2,0-153) == 784573-1.html 784573-1-ref.html
+fuzzy(0-16,0-84) fuzzy-if(winWidget,0-2,0-153) == 784573-1.html 784573-1-ref.html
== 802658-1.html 802658-1-ref.html
== 1074733-1.html 1074733-1-ref.html
diff --git a/layout/reftests/columns/reftest.list b/layout/reftests/columns/reftest.list
index 916817f49f..9a6f694e2e 100644
--- a/layout/reftests/columns/reftest.list
+++ b/layout/reftests/columns/reftest.list
@@ -22,7 +22,7 @@ pref(layout.outline.include-overflow,true) == column-balancing-overflow-005.html
== column-box-alignment-rtl-3.html column-box-alignment-rtl-3-ref.html
== column-box-alignment-rtl-4.html column-box-alignment-rtl-4-ref.html
== columnfill-balance.html columnfill-balance-ref.html
-fuzzy-if(OSX,0-32,0-1000) == columnfill-auto.html columnfill-auto-ref.html
+fuzzy-if(cocoaWidget,0-32,0-1000) == columnfill-auto.html columnfill-auto-ref.html
== columnfill-auto-2.html columnfill-auto-2-ref.html
== columnfill-auto-3.html columnfill-auto-2-ref.html
== columnrule-basic.html columnrule-basic-ref.html
@@ -37,7 +37,7 @@ fuzzy-if(OSX,0-32,0-1000) == columnfill-auto.html columnfill-auto-ref.html
== columnrule-overflow.html columnrule-overflow-ref.html
== columns-table-caption-000.html columns-table-caption-000-ref.html
== positioning-transforms-bug1112501.html positioning-transforms-bug1112501-ref.html
-fuzzy-if(browserIsRemote&&winWidget,0-142,0-276) == fieldset-columns-001.html fieldset-columns-001-ref.html
+fuzzy-if(winWidget,0-142,0-276) == fieldset-columns-001.html fieldset-columns-001-ref.html
== fieldset-columns-002.html fieldset-columns-002-ref.html
== fieldset-columns-003.html fieldset-columns-003-ref.html
== fieldset-columns-004.html fieldset-columns-004-ref.html
diff --git a/layout/reftests/css-animations/reftest.list b/layout/reftests/css-animations/reftest.list
index ee84b01a30..11558a5c08 100644
--- a/layout/reftests/css-animations/reftest.list
+++ b/layout/reftests/css-animations/reftest.list
@@ -84,4 +84,4 @@ pref(layout.css.marker.restricted,false) == marker-reframe-and-animation-starts-
== background-color-on-html.html background-color-on-html-ref.html
skip-if(Android) == replace-with-new-positive-delay-animation.html replace-with-new-positive-delay-animation-ref.html # bug 1787682 for Android
-pref(layout.css.scroll-driven-animations.enabled,true) skip-if(!asyncPan) == scroll-timeline-in-delay-omta.html scroll-timeline-in-delay-omta-ref.html
+pref(layout.css.scroll-driven-animations.enabled,true) skip-if(useDrawSnapshot) == scroll-timeline-in-delay-omta.html scroll-timeline-in-delay-omta-ref.html
diff --git a/layout/reftests/css-blending/reftest.list b/layout/reftests/css-blending/reftest.list
index 8d2ca77586..9ed4c37029 100644
--- a/layout/reftests/css-blending/reftest.list
+++ b/layout/reftests/css-blending/reftest.list
@@ -7,11 +7,11 @@ fuzzy-if(geckoview&&device,3-3,5-5) == blend-difference-stacking.html blend-diff
fuzzy(0-1,0-30000) == background-blending-alpha.html background-blending-alpha-ref.html
== background-blending-gradient-color.html background-blending-gradient-color-ref.html
fuzzy(0-2,0-9450) fuzzy-if(!geckoview,0-1,0-6200) == background-blending-gradient-gradient.html background-blending-gradient-gradient-ref.html
-fuzzy-if(azureSkiaGL,0-2,0-7174) == background-blending-gradient-image.html background-blending-gradient-color-ref.html
-fuzzy-if(azureSkia||d2d||gtkWidget,0-1,0-10000) == background-blending-image-color-jpg.html background-blending-image-color-ref.html
+== background-blending-gradient-image.html background-blending-gradient-color-ref.html
+fuzzy(0-1,0-10000) == background-blending-image-color-jpg.html background-blending-image-color-ref.html
== background-blending-image-color-png.html background-blending-image-color-ref.html
== background-blending-image-color-svg.html background-blending-image-color-ref.html
-fuzzy-if(azureSkiaGL,0-2,0-7174) == background-blending-image-gradient.html background-blending-gradient-color-ref.html
+== background-blending-image-gradient.html background-blending-gradient-color-ref.html
== background-blending-image-image.html background-blending-image-color-ref.html
== background-blending-isolation.html background-blending-isolation-ref.html
random-if(useDrawSnapshot) == background-blending-list-repeat.html background-blending-list-repeat-ref.html
@@ -20,22 +20,22 @@ random-if(useDrawSnapshot) == background-blending-list-repeat.html background-bl
== background-blending-color-burn.html background-blending-color-burn-ref.svg
== background-blending-color-dodge.html background-blending-color-dodge-ref.svg
# need to investigate why these tests are fuzzy - first suspect is a possible color space conversion on some platforms; same for mix-blend-mode tests
-fuzzy-if(azureSkia||gtkWidget,0-2,0-9600) fuzzy-if(appleSilicon,0-1,0-11200) fuzzy-if(d2d,0-1,0-8000) fuzzy-if(swgl&&!Android,1-1,8000-9600) == background-blending-color.html background-blending-color-ref.svg
+fuzzy-if(!winWidget,0-2,0-9600) fuzzy-if(appleSilicon,0-1,0-11200) fuzzy-if(winWidget,0-1,0-8000) fuzzy-if(swgl&&!Android,1-1,8000-9600) == background-blending-color.html background-blending-color-ref.svg
== background-blending-darken.html background-blending-darken-ref.svg
== background-blending-difference.html background-blending-difference-ref.svg
fuzzy(0-1,0-1600) == background-blending-exclusion.html background-blending-exclusion-ref.svg
-fuzzy-if(cocoaWidget||d2d||swgl,0-1,0-1600) == background-blending-hard-light.html background-blending-hard-light-ref.svg
-fuzzy-if(d2d,0-1,0-9600) fuzzy-if(azureSkia||gtkWidget,0-1,0-11200) fuzzy-if(!geckoview,1-1,9600-11240) == background-blending-hue.html background-blending-hue-ref.svg
+fuzzy-if(cocoaWidget||winWidget||swgl,0-1,0-1600) == background-blending-hard-light.html background-blending-hard-light-ref.svg
+fuzzy-if(winWidget,0-1,0-9600) fuzzy-if(!winWidget,0-1,0-11200) fuzzy-if(!geckoview,1-1,9600-11240) == background-blending-hue.html background-blending-hue-ref.svg
== background-blending-lighten.html background-blending-lighten-ref.svg
-fuzzy-if(d2d,0-1,0-8000) fuzzy-if(azureSkia||gtkWidget,0-2,0-9600) fuzzy-if(appleSilicon,0-1,0-11200) fuzzy-if(swgl&&!Android,1-1,8000-9600) == background-blending-luminosity.html background-blending-luminosity-ref.svg
+fuzzy-if(winWidget,0-1,0-8000) fuzzy-if(!winWidget,0-2,0-9600) fuzzy-if(appleSilicon,0-1,0-11200) fuzzy-if(swgl&&!Android,1-1,8000-9600) == background-blending-luminosity.html background-blending-luminosity-ref.svg
fuzzy(0-1,0-1600) == background-blending-multiply.html background-blending-multiply-ref.svg
== background-blending-normal.html background-blending-normal-ref.svg
-fuzzy-if(azureSkia||gtkWidget,0-1,0-1600) == background-blending-overlay.html background-blending-overlay-ref.svg
-fuzzy-if(d2d,0-1,0-3200) fuzzy-if(azureSkia||gtkWidget,0-2,0-12800) == background-blending-saturation.html background-blending-saturation-ref.svg
-fuzzy-if(d2d||azureSkia||gtkWidget,0-1,0-1600) == background-blending-screen.html background-blending-screen-ref.svg
-fuzzy-if(d2d||azureSkia||gtkWidget,0-10,0-4800) == background-blending-soft-light.html background-blending-soft-light-ref.svg
+fuzzy-if(!winWidget,0-1,0-1600) == background-blending-overlay.html background-blending-overlay-ref.svg
+fuzzy-if(winWidget,0-1,0-3200) fuzzy-if(!winWidget,0-2,0-12800) == background-blending-saturation.html background-blending-saturation-ref.svg
+fuzzy(0-1,0-1600) == background-blending-screen.html background-blending-screen-ref.svg
+fuzzy(0-10,0-4800) == background-blending-soft-light.html background-blending-soft-light-ref.svg
-fuzzy-if(azureSkia||d2d||gtkWidget,0-1,0-40000) == background-blending-image-color-959674.html background-blending-image-color-959674-ref.html
+fuzzy(0-1,0-40000) == background-blending-image-color-959674.html background-blending-image-color-959674-ref.html
#fuzzy due to inconsistencies in rounded rect cliping between parent and child; may be related to antialiasing. Between platforms, the max difference is the same, and the number of different pixels is either 36 or 37. (Win, Mac and Lin)
fuzzy(0-65,0-53) fuzzy-if(geckoview&&device,63-64,163-328) == mix-blend-mode-952051.html mix-blend-mode-952051-ref.html
diff --git a/layout/reftests/css-gradients/reftest.list b/layout/reftests/css-gradients/reftest.list
index cb22973622..1574996fa3 100644
--- a/layout/reftests/css-gradients/reftest.list
+++ b/layout/reftests/css-gradients/reftest.list
@@ -32,19 +32,19 @@ fuzzy(0-3,0-21070) == linear-vertical-subpixel-1.html linear-vertical-subpixel-1
== linear-viewport.html linear-viewport-ref.html
== nostops.html about:blank
== onestop.html about:blank
-random-if(d2d) fuzzy(0-4,0-6000) == radial-1a.html radial-1-ref.html
-random-if(d2d) fuzzy(0-4,0-6000) == radial-1b.html radial-1-ref.html
-fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) fuzzy-if(azureSkiaGL,0-4,0-90000) == radial-2a.html radial-2-ref.html
-fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) fuzzy-if(azureSkiaGL,0-4,0-90000) == radial-2b.html radial-2-ref.html
-fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) fuzzy-if(azureSkiaGL,0-4,0-90000) == radial-2c.html radial-2-ref.html
-fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) fuzzy-if(azureSkiaGL,0-4,0-90000) == radial-2d.html radial-2-ref.html
+random-if(winWidget) fuzzy(0-4,0-6000) == radial-1a.html radial-1-ref.html
+random-if(winWidget) fuzzy(0-4,0-6000) == radial-1b.html radial-1-ref.html
+fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) == radial-2a.html radial-2-ref.html
+fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) == radial-2b.html radial-2-ref.html
+fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) == radial-2c.html radial-2-ref.html
+fuzzy(0-3,0-7860) fuzzy-if(cocoaWidget,0-5,0-89041) == radial-2d.html radial-2-ref.html
fuzzy(0-1,0-50) == radial-position-1b.html radial-position-1-ref.html
fuzzy-if(cocoaWidget,0-4,0-22317) fuzzy-if(Android,0-8,0-771) == radial-shape-closest-corner-1a.html radial-shape-closest-corner-1-ref.html
fuzzy(0-2,0-300) == radial-shape-closest-corner-1b.html radial-shape-closest-corner-1-ref.html
fuzzy(0-5,0-30000) fuzzy-if(Android,0-17,0-5000) == radial-shape-closest-side-1a.html radial-shape-closest-side-1-ref.html
fuzzy(0-5,0-30000) fuzzy-if(Android,0-17,0-5000) == radial-shape-closest-side-1b.html radial-shape-closest-side-1-ref.html
fuzzy-if(Android,0-8,0-771) == radial-shape-farthest-corner-1a.html radial-shape-farthest-corner-1-ref.html
-fails-if(gtkWidget&&/x86_64-/.test(xulRuntime.XPCOMABI)) fuzzy(0-2,0-500) == radial-shape-farthest-corner-1b.html radial-shape-farthest-corner-1-ref.html
+fails-if(gtkWidget) fuzzy(0-2,0-500) == radial-shape-farthest-corner-1b.html radial-shape-farthest-corner-1-ref.html
fuzzy(0-2,0-15000) fuzzy-if(Android,0-17,0-13320) == radial-shape-farthest-side-1a.html radial-shape-farthest-side-1-ref.html
fuzzy(0-2,0-15000) fuzzy-if(Android,0-17,0-13320) == radial-shape-farthest-side-1b.html radial-shape-farthest-side-1-ref.html
== radial-size-1a.html radial-size-1-ref.html
@@ -60,9 +60,9 @@ fuzzy(0-1,0-40) == radial-premul.html radial-premul-ref.html
== repeating-linear-1a.html repeating-linear-1-ref.html
== repeating-linear-1b.html repeating-linear-1-ref.html
== repeating-linear-2a.html repeating-linear-2-ref.html
-fuzzy-if(d2d,0-127,0-2612) == repeating-radial-1a.html repeating-radial-1-ref.html
+fuzzy-if(winWidget,0-127,0-2612) == repeating-radial-1a.html repeating-radial-1-ref.html
== repeating-radial-1b.html repeating-radial-1-ref.html
-fuzzy-if(d2d,0-127,0-2612) == repeating-radial-1c.html repeating-radial-1-ref.html
+fuzzy-if(winWidget,0-127,0-2612) == repeating-radial-1c.html repeating-radial-1-ref.html
== repeating-radial-1d.html repeating-radial-1-ref.html
== repeating-radial-2a.html repeating-radial-2-ref.html
== repeating-radial-2b.html repeating-radial-2-ref.html
@@ -73,7 +73,7 @@ fuzzy(0-141,0-300) == twostops-1d.html twostops-1-ref.html
fuzzy(0-73,0-900) == twostops-1e.html twostops-1-ref.html
# from http://www.xanthir.com/:4bhipd by way of http://a-ja.net/newgrad.html
-fuzzy-if(!contentSameGfxBackendAsCanvas,0-3,0-20000) fuzzy-if(azureSkiaGL||layersGPUAccelerated,0-8,0-20000) == aja-linear-1a.html aja-linear-1-ref.html
+fuzzy-if(winWidget,0-3,0-20000) fuzzy(0-8,0-20000) == aja-linear-1a.html aja-linear-1-ref.html
fuzzy(0-1,0-20000) == aja-linear-1b.html aja-linear-1-ref.html # bug 526694
fuzzy(0-8,0-20000) == aja-linear-1c.html aja-linear-1-ref.html
fuzzy(0-8,0-20000) == aja-linear-1d.html aja-linear-1-ref.html
@@ -90,7 +90,7 @@ fuzzy-if(cocoaWidget,0-1,0-40000) fuzzy-if(Android,0-6,0-10576) == height-depend
fuzzy-if(Android,0-6,0-10576) == height-dependence-3.html height-dependence-3-ref.html
== linear-onestopposition-1.html linear-onestopposition-1-ref.html
-fuzzy-if(d2d,0-47,0-400) fuzzy-if(winWidget,0-1,0-1375) == linear-onestopposition-1.html linear-onestopposition-1-ref2.html # d2d interpolates the hard stop
+fuzzy-if(winWidget,0-1,0-1375) == linear-onestopposition-1.html linear-onestopposition-1-ref2.html # winWidget interpolates the hard stop
== radial-onestopposition-1a.html radial-onestopposition-1-ref.html
== radial-onestopposition-1b.html radial-onestopposition-1-ref.html
fuzzy-if(winWidget,0-1,0-1875) == repeating-linear-onestopposition-1.html orange-square.html
diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list
index 8673b99897..789159ffe9 100644
--- a/layout/reftests/css-grid/reftest.list
+++ b/layout/reftests/css-grid/reftest.list
@@ -36,7 +36,7 @@ fails == grid-abspos-items-016.html grid-abspos-items-015-ref.html
fuzzy(0-1,0-200) == grid-order-placement-definite-001.html grid-order-placement-definite-001-ref.html
== grid-placement-definite-implicit-001.html grid-placement-definite-implicit-001-ref.html
== grid-placement-definite-implicit-002.html grid-placement-definite-implicit-002-ref.html
-fuzzy(0-64,0-1) skip-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == grid-placement-auto-implicit-001.html grid-placement-auto-implicit-001-ref.html # win10: bug 1507154
+fuzzy(0-64,0-1) skip-if(winWidget) == grid-placement-auto-implicit-001.html grid-placement-auto-implicit-001-ref.html # win10: bug 1507154
== grid-placement-abspos-implicit-001.html grid-placement-abspos-implicit-001-ref.html
== rtl-grid-placement-definite-001.html rtl-grid-placement-definite-001-ref.html
== rtl-grid-placement-auto-row-sparse-001.html rtl-grid-placement-auto-row-sparse-001-ref.html
diff --git a/layout/reftests/display-list/reftest.list b/layout/reftests/display-list/reftest.list
index 7ac7edc4f8..f11bd1efdb 100644
--- a/layout/reftests/display-list/reftest.list
+++ b/layout/reftests/display-list/reftest.list
@@ -1,26 +1,26 @@
# These tests are testing merging RDL implementation.
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-style-change-1.html retained-dl-style-change-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-frame-deleted-1.html retained-dl-style-change-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-frame-created-1.html retained-dl-style-change-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-style-change-stacking-context-1.html retained-dl-style-change-stacking-context-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-style-change-stacking-context-2.html retained-dl-style-change-stacking-context-2-ref.html
+skip-if(useDrawSnapshot) == retained-dl-style-change-1.html retained-dl-style-change-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-frame-deleted-1.html retained-dl-style-change-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-frame-created-1.html retained-dl-style-change-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-style-change-stacking-context-1.html retained-dl-style-change-stacking-context-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-style-change-stacking-context-2.html retained-dl-style-change-stacking-context-2-ref.html
fails == retained-dl-style-change-stacking-context-3.html retained-dl-style-change-stacking-context-3-ref.html # bug 1650699 tracks this failure
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-style-change-stacking-context-4.html retained-dl-style-change-stacking-context-4-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew||Android) == retained-dl-displayport-1.html retained-dl-displayport-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-prerender-transform-1.html retained-dl-prerender-transform-1-ref.html
-skip-if(!retainedDisplayList||retainedDisplayListNew) == retained-dl-animation-on-pseudo.html retained-dl-animation-on-pseudo-ref.html
+skip-if(useDrawSnapshot) == retained-dl-style-change-stacking-context-4.html retained-dl-style-change-stacking-context-4-ref.html
+skip-if(useDrawSnapshot||Android) == retained-dl-displayport-1.html retained-dl-displayport-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-prerender-transform-1.html retained-dl-prerender-transform-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-animation-on-pseudo.html retained-dl-animation-on-pseudo-ref.html
#
-skip-if(!retainedDisplayList||!asyncPan) == retained-dl-async-scrolled-1.html retained-dl-async-scrolled-1-ref.html
-skip-if(!retainedDisplayList) == retained-dl-remove-for-ancestor-change-1.html retained-dl-remove-for-ancestor-change-1-ref.html
-skip-if(!retainedDisplayList) == retained-dl-scroll-out-of-view-1.html retained-dl-scroll-out-of-view-1-ref.html
-skip-if(!retainedDisplayList) == retained-dl-opacity-animation-on-ib-split.html retained-dl-opacity-animation-on-ib-split-ref.html
-skip-if(!retainedDisplayList) == 1544948-1.html 1544948-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-async-scrolled-1.html retained-dl-async-scrolled-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-remove-for-ancestor-change-1.html retained-dl-remove-for-ancestor-change-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-scroll-out-of-view-1.html retained-dl-scroll-out-of-view-1-ref.html
+skip-if(useDrawSnapshot) == retained-dl-opacity-animation-on-ib-split.html retained-dl-opacity-animation-on-ib-split-ref.html
+skip-if(useDrawSnapshot) == 1544948-1.html 1544948-1-ref.html
-skip-if(!retainedDisplayListNew) == reuse-sc-style-change-1.html reuse-sc-style-change-1-ref.html
-skip-if(!retainedDisplayListNew) == reuse-sc-style-change-nested-1.html reuse-sc-style-change-nested-1-ref.html
-skip-if(!retainedDisplayListNew) == reuse-sc-style-change-abs-pos-1.html reuse-sc-style-change-abs-pos-1-ref.html
-skip-if(!retainedDisplayListNew) == reuse-sc-style-change-fixed-pos-1.html reuse-sc-style-change-fixed-pos-1-ref.html
+skip == reuse-sc-style-change-1.html reuse-sc-style-change-1-ref.html
+skip == reuse-sc-style-change-nested-1.html reuse-sc-style-change-nested-1-ref.html
+skip == reuse-sc-style-change-abs-pos-1.html reuse-sc-style-change-abs-pos-1-ref.html
+skip == reuse-sc-style-change-fixed-pos-1.html reuse-sc-style-change-fixed-pos-1-ref.html
== retained-dl-wrap-list.html retained-dl-wrap-list-ref.html
== retained-dl-zindex-1.html retained-dl-zindex-1-ref.html
@@ -38,7 +38,7 @@ needs-focus fuzzy(0-3,0-2) == 1429027-1.html 1429027-1-ref.html
== 1432553-1.html 1432553-1-ref.html
== 1432553-2.html 1432553-2-ref.html
== 1436189-1.html 1436189-1-ref.html
-skip-if(!asyncPan) == 1437374-1.html 1437374-1-ref.html
+skip-if(useDrawSnapshot) == 1437374-1.html 1437374-1-ref.html
== 1439809-1.html 1439809-1-ref.html
== 1443027-1.html 1443027-ref.html
== 1443027-2.html 1443027-ref.html
@@ -48,13 +48,13 @@ skip-if(!asyncPan) == 1437374-1.html 1437374-1-ref.html
== 1453541-2.html 1453541-ref.html
== 1452805-1.html 1452805-ref.html
== 1461231-1.html about:blank
-fuzzy(0-2,0-40000) skip-if(!asyncPan) == 1464288-1.html 1464288-ref.html
+fuzzy(0-2,0-40000) skip-if(useDrawSnapshot) == 1464288-1.html 1464288-ref.html
== 1482403-1.html 1482403-1-ref.html
== 1504233-1.html 1504233-1-ref.html
== 1533317-1.html 1533317-1-ref.html
fuzzy-if(swgl,0-1,0-1) == 1551053-1.html 1551053-1-ref.html
== 1553828-1.html 1553828-1-ref.html
-fuzzy-if(browserIsFission,0-1,0-300) == 1619370-1.html 1619370-1-ref.html
+fuzzy-if(fission,0-1,0-300) == 1619370-1.html 1619370-1-ref.html
== 1677568-1.html 1677568-1-ref.html
== 1709452-1.html 1709452-ref.html
== 1719346-1.html 1719346-1-ref.html
diff --git a/layout/reftests/first-letter/reftest.list b/layout/reftests/first-letter/reftest.list
index b6aaa5e5e6..72c6e6739f 100644
--- a/layout/reftests/first-letter/reftest.list
+++ b/layout/reftests/first-letter/reftest.list
@@ -23,7 +23,7 @@ fails == quote-1e.html quote-1-ref.html # bug 509685
== quote-1e.html quote-1b.html
== quote-1f.html quote-1-ref.html
== dynamic-1.html dynamic-1-ref.html
-random-if(d2d) == dynamic-2.html dynamic-2-ref.html
+random-if(winWidget) == dynamic-2.html dynamic-2-ref.html
== dynamic-3a.html dynamic-3-ref.html
== dynamic-3b.html dynamic-3-ref.html
== dynamic-4.html dynamic-4-ref.html
@@ -66,7 +66,7 @@ fails-if(winWidget||cocoaWidget) fails-if(geckoview) == 617869-1.html 617869-1-r
== 922550-1.html 922550-1-ref.html
== 958249.html 958249-ref.html
== font-text-styles.html font-text-styles-ref.html
-random-if(gtkWidget) random-if(winWidget&&!d2d) == font-text-styles-floater.html font-text-styles-floater-ref.html # bug 992846
+random-if(gtkWidget) == font-text-styles-floater.html font-text-styles-floater-ref.html # bug 992846
== inline-height-empty.html inline-height-empty-ref.html
== indic-clusters-1.html indic-clusters-1-ref.html
== overflow-float-nooverflow.html overflow-float-nooverflow-ref.html
diff --git a/layout/reftests/floats/reftest.list b/layout/reftests/floats/reftest.list
index c35925f2ce..701673f534 100644
--- a/layout/reftests/floats/reftest.list
+++ b/layout/reftests/floats/reftest.list
@@ -91,8 +91,8 @@ fuzzy(0-1,0-12000) == float-in-rtl-4d.html float-in-rtl-4-ref.html
== float-in-rtl-vrl-4b.html float-in-rtl-vrl-4-ref.html
== float-in-rtl-vrl-4c.html float-in-rtl-vrl-4-ref.html
== float-in-rtl-vrl-4d.html float-in-rtl-vrl-4-ref.html
-fuzzy-if(OSX,0-28,0-11) fuzzy-if(Android,0-16,0-2) == orthogonal-floats-1a.html orthogonal-floats-1-ref.html
-fuzzy-if(OSX,0-28,0-11) fuzzy-if(winWidget,0-137,0-3) == orthogonal-floats-1b.html orthogonal-floats-1-ref.html
+fuzzy-if(cocoaWidget,0-28,0-11) fuzzy-if(Android,0-16,0-2) == orthogonal-floats-1a.html orthogonal-floats-1-ref.html
+fuzzy-if(cocoaWidget,0-28,0-11) fuzzy-if(winWidget,0-137,0-3) == orthogonal-floats-1b.html orthogonal-floats-1-ref.html
fuzzy-if(winWidget,0-135,0-700) == orthogonal-floats-1c.html orthogonal-floats-1-ref.html
fuzzy-if(winWidget,0-135,0-700) == orthogonal-floats-1d.html orthogonal-floats-1-ref.html
diff --git a/layout/reftests/font-face/reftest.list b/layout/reftests/font-face/reftest.list
index 920a53a4d0..5d534ead55 100644
--- a/layout/reftests/font-face/reftest.list
+++ b/layout/reftests/font-face/reftest.list
@@ -1,9 +1,9 @@
!= download-1.html download-1-notref.html
== download-2.html download-2-ref.html
!= download-2.html about:blank
-random-if(winWidget||gtkWidget) == download-2-big.html download-2-big-otf.html # bug 470713
+random-if(gtkWidget||winWidget) == download-2-big.html download-2-big-otf.html # bug 470713
!= download-2-big-otf.html about:blank
-asserts-if(Android&&!asyncPan,1-8) != download-3-notref.html download-3.html # bug 1019192
+!= download-3-notref.html download-3.html # bug 1019192
asserts-if(Android,0-8) == download-3-ref.html download-3.html # same bugs as above
asserts-if(Android,0-8) == fallback-to-system-1.html fallback-to-system-1-ref.html # just delayed assertions from above tests
== name-override-simple-1.html name-override-simple-1-ref.html
@@ -13,7 +13,7 @@ fails == name-override-1.html name-override-1-ref.html
!= multiple-descriptor-1.html multiple-descriptor-1-notref.html
== src-list-1.html src-list-1-ref.html
== src-list-2.html src-list-2-ref.html
-random-if(winWidget||gtkWidget) == src-list-2-big-otf.html src-list-2-big-ref.html # bug 470713
+random-if(gtkWidget||winWidget) == src-list-2-big-otf.html src-list-2-big-ref.html # bug 470713
== src-list-format-1.html src-list-format-1-ref.html
== src-list-format-2.html src-list-format-2-ref.html
== src-list-format-4.html src-list-format-1-ref.html
@@ -154,9 +154,9 @@ HTTP(..) == font-redirect.html order-1-ref.html
== dynamic-duplicate-rule-1c.html dynamic-duplicate-rule-1-ref.html
# Test for COLR and CPAL support
-fuzzy-if(OSX,198-198,172-172) == color-1a.html color-1-ref.html
+fuzzy-if(cocoaWidget,198-198,172-172) == color-1a.html color-1-ref.html
!= color-1a.html color-1-notref.html
-fuzzy-if(OSX,198-198,172-172) == color-1b.html color-1-ref.html
+fuzzy-if(cocoaWidget,198-198,172-172) == color-1b.html color-1-ref.html
== color-2a.html color-2-ref.html
!= color-2a.html color-2-notref.html
diff --git a/layout/reftests/font-inflation/reftest.list b/layout/reftests/font-inflation/reftest.list
index 20548830e7..7be883a42f 100644
--- a/layout/reftests/font-inflation/reftest.list
+++ b/layout/reftests/font-inflation/reftest.list
@@ -37,7 +37,7 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceE
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == textarea-3.html textarea-3-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == css-transform-1.html css-transform-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) fuzzy(0-1,0-19) == css-transform-2.html css-transform-2-ref.html
-fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-1764) test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == container-with-clamping.html container-with-clamping-ref.html
+test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == container-with-clamping.html container-with-clamping-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) load video-1.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == intrinsic-min-1.html intrinsic-min-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == intrinsic-max-1.html intrinsic-max-1-ref.html
diff --git a/layout/reftests/font-matching/reftest.list b/layout/reftests/font-matching/reftest.list
index fe5f3a2065..0fd4a4ce1f 100644
--- a/layout/reftests/font-matching/reftest.list
+++ b/layout/reftests/font-matching/reftest.list
@@ -147,14 +147,14 @@ random-if(Android) != emoji-subregion-flag.html emoji-subregion-flag-notref.html
# Bug 1212731 - initial implementation caused startup regression and
# regression with full-width digits display in UI elements. Disable
# tests until these problems are corrected.
-# random-if(!OSX) == system-generic-fallback-1.html system-generic-fallback-1-ref.html
-# random-if(!OSX) == system-generic-fallback-2.html system-generic-fallback-2-ref.html
-# random-if(!OSX) == system-generic-fallback-3.html system-generic-fallback-3-ref.html
-# random-if(!OSX) == system-generic-fallback-4.html system-generic-fallback-4-ref.html
-# random-if(!OSX) != system-generic-fallback-ko.html system-generic-fallback-ja.html
-# random-if(!OSX) != system-generic-fallback-zh-tw.html system-generic-fallback-ja.html
-# random-if(!OSX) != system-generic-fallback-zh-cn.html system-generic-fallback-ja.html
-# random-if(!OSX) != system-generic-fallback-zh-tw.html system-generic-fallback-zh-cn.html
+# random-if(!cocoaWidget) == system-generic-fallback-1.html system-generic-fallback-1-ref.html
+# random-if(!cocoaWidget) == system-generic-fallback-2.html system-generic-fallback-2-ref.html
+# random-if(!cocoaWidget) == system-generic-fallback-3.html system-generic-fallback-3-ref.html
+# random-if(!cocoaWidget) == system-generic-fallback-4.html system-generic-fallback-4-ref.html
+# random-if(!cocoaWidget) != system-generic-fallback-ko.html system-generic-fallback-ja.html
+# random-if(!cocoaWidget) != system-generic-fallback-zh-tw.html system-generic-fallback-ja.html
+# random-if(!cocoaWidget) != system-generic-fallback-zh-cn.html system-generic-fallback-ja.html
+# random-if(!cocoaWidget) != system-generic-fallback-zh-tw.html system-generic-fallback-zh-cn.html
# Tests for legacy font family name (GDI-model families) matching;
# these depend on specific fonts that are available as standard on macOS and Windows,
diff --git a/layout/reftests/forms/fieldset/reftest.list b/layout/reftests/forms/fieldset/reftest.list
index f99032a3ec..86d6250a44 100644
--- a/layout/reftests/forms/fieldset/reftest.list
+++ b/layout/reftests/forms/fieldset/reftest.list
@@ -5,7 +5,7 @@ fuzzy(0-2,0-13) == dynamic-legend-scroll-1.html dynamic-legend-scroll-1-ref.html
== fieldset-scroll-1.html fieldset-scroll-1-ref.html
== fieldset-scrolled-1.html fieldset-scrolled-1-ref.html
== fieldset-overflow-auto-1.html fieldset-overflow-auto-1-ref.html
-fuzzy-if(!layersGPUAccelerated,0-142,0-276) == positioned-container-1.html positioned-container-1-ref.html
+== positioned-container-1.html positioned-container-1-ref.html
== relpos-legend-1.html relpos-legend-1-ref.html
== relpos-legend-2.html relpos-legend-2-ref.html
== relpos-legend-3.html relpos-legend-3-ref.html
diff --git a/layout/reftests/forms/input/file/reftest.list b/layout/reftests/forms/input/file/reftest.list
index 2ad51b2f69..d8276cb941 100644
--- a/layout/reftests/forms/input/file/reftest.list
+++ b/layout/reftests/forms/input/file/reftest.list
@@ -5,7 +5,7 @@ fuzzy(0-1,0-10) == background.html chrome://reftest/content/forms/input/file/bac
fuzzy-if(gtkWidget,0-1,0-10) == style.html chrome://reftest/content/forms/input/file/style-ref.xhtml
!= width-clip.html width-clip-ref.html
== color-inherit.html color-inherit-ref.html
-pref(widget.non-native-theme.webrender,true) fuzzy(0-1,0-5) fuzzy-if(OSX,0-46,0-134) == dynamic-max-width.html dynamic-max-width-ref.html # bug 1496542 for webrender, bug 1724582 for appleSilicon
+pref(widget.non-native-theme.webrender,true) fuzzy(0-1,0-5) fuzzy-if(cocoaWidget,0-46,0-134) == dynamic-max-width.html dynamic-max-width-ref.html # bug 1496542 for webrender, bug 1724582 for appleSilicon
== label-min-inline-size.html label-min-inline-size-ref.html
== css-overflow.html css-overflow-ref.html
== css-display.html css-display-ref.html
diff --git a/layout/reftests/forms/input/number/number.html b/layout/reftests/forms/input/number/number.html
new file mode 100644
index 0000000000..0b4221fe70
--- /dev/null
+++ b/layout/reftests/forms/input/number/number.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<input type=number>
diff --git a/layout/reftests/forms/input/number/reftest.list b/layout/reftests/forms/input/number/reftest.list
index 0a50ef8113..256e3f1df1 100644
--- a/layout/reftests/forms/input/number/reftest.list
+++ b/layout/reftests/forms/input/number/reftest.list
@@ -1,5 +1,5 @@
# sanity checks:
-!= not-other-type-unthemed-1.html not-other-type-unthemed-1a-notref.html
+fails-if(Android) pref(dom.forms.number.hide_spin_buttons_when_no_hover_or_focus,false) != not-other-type-unthemed-1.html not-other-type-unthemed-1a-notref.html
!= not-other-type-unthemed-1.html not-other-type-unthemed-1b-notref.html
# should look the same as type=text, except for the spin box
@@ -17,7 +17,7 @@ fuzzy(0-2,0-13) == show-value.html show-value-ref.html
# disabled
== number-disabled.html number-disabled-ref.html
-!= number-spinbox-disabled.html number-spinbox-disabled-notref.html
+fails-if(Android) pref(dom.forms.number.hide_spin_buttons_when_no_hover_or_focus,false) != number-spinbox-disabled.html number-spinbox-disabled-notref.html
# auto width:
== number-auto-width-1.html number-auto-width-1-ref.html
@@ -72,3 +72,5 @@ fuzzy(0-14,0-4) == clipped-text.html clipped-text-ref.html
fails-if(useDrawSnapshot) needs-focus != caret-right.html caret-right-notref.html
fails-if(useDrawSnapshot) needs-focus != caret-left-rtl.html caret-left-rtl-notref.html
fails-if(useDrawSnapshot) needs-focus != caret-right-vertical.html caret-right-vertical-notref.html
+
+fails-if(Android) test-pref(dom.forms.number.hide_spin_buttons_when_no_hover_or_focus,true) ref-pref(dom.forms.number.hide_spin_buttons_when_no_hover_or_focus,false) != number.html number.html
diff --git a/layout/reftests/forms/input/radio/reftest.list b/layout/reftests/forms/input/radio/reftest.list
index 6c80eaf447..f500a83d0d 100644
--- a/layout/reftests/forms/input/radio/reftest.list
+++ b/layout/reftests/forms/input/radio/reftest.list
@@ -5,5 +5,5 @@
!= checked-native.html about:blank
!= checked-native-notref.html about:blank
== radio-clamp-01.html radio-clamp-01-ref.html
-skip-if(OSX||winWidget||Android) == radio-clamp-02.html radio-clamp-02-ref.html
+skip-if(!gtkWidget) == radio-clamp-02.html radio-clamp-02-ref.html
!= radio-minimum-size.html radio-minimum-size-notref.html
diff --git a/layout/reftests/forms/input/text/autofill-author-background.html b/layout/reftests/forms/input/text/autofill-author-background.html
new file mode 100644
index 0000000000..691adaa1ff
--- /dev/null
+++ b/layout/reftests/forms/input/text/autofill-author-background.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<input type=text style="background-color: red; background-image: linear-gradient(red, blue);">
+<script>
+ let input = SpecialPowers.wrap(document.querySelector("input"));
+ SpecialPowers.Cc["@mozilla.org/satchel/form-fill-controller;1"].getService(SpecialPowers.Ci.nsIFormFillController).markAsAutofillField(input);
+ input.getBoundingClientRect(); // previewValue setter depends on the reframe posted by markAsAutofillField() having being processed...
+ input.previewValue = "Autofill";
+ SpecialPowers.wrap(window).windowUtils.addManuallyManagedState(input, "-moz-autofill-preview");
+</script>
diff --git a/layout/reftests/forms/input/text/reftest.list b/layout/reftests/forms/input/text/reftest.list
index b6217d46bc..6c649a5196 100644
--- a/layout/reftests/forms/input/text/reftest.list
+++ b/layout/reftests/forms/input/text/reftest.list
@@ -15,9 +15,10 @@ fuzzy(0-1,0-500) needs-focus == select.html select-ref.html
== autofill-blank.html autofill-preview-blank.html
!= autofill.html autofill-blank.html
!= autofill-preview.html autofill-preview-blank.html
-!= autofill.html autofill-preview.html
+== autofill.html autofill-preview.html
== autofill-prefilled-value.html autofill-preview.html
== autofill-preview-line-height.html autofill-line-height.html
+== autofill-author-background.html autofill.html
== pseudo-class-lock.html pseudo-class-lock-ref.html
diff --git a/layout/reftests/forms/placeholder/reftest.list b/layout/reftests/forms/placeholder/reftest.list
index 54ec3b06e0..1e00ce0131 100644
--- a/layout/reftests/forms/placeholder/reftest.list
+++ b/layout/reftests/forms/placeholder/reftest.list
@@ -18,9 +18,9 @@
== placeholder-5.html placeholder-visible-ref.html
# This tests assumes that the overflowing placeholder won't eat the padding, which is just not true in some platforms...
-fuzzy-if(winWidget,0-160,0-10) fuzzy-if(Android,0-160,0-41) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-146,0-317) == placeholder-6.html placeholder-overflow-ref.html
+fuzzy-if(winWidget,0-160,0-10) fuzzy-if(Android,0-160,0-41) == placeholder-6.html placeholder-overflow-ref.html
-skip-if(Android&&asyncPan) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
+skip-if(Android) == placeholder-6-textarea.html placeholder-overflow-textarea-ref.html
# needs-focus == placeholder-7.html placeholder-focus-ref.html
# needs-focus == placeholder-8.html placeholder-focus-ref.html
# needs-focus == placeholder-9.html placeholder-focus-ref.html
diff --git a/layout/reftests/forms/textarea/reftest.list b/layout/reftests/forms/textarea/reftest.list
index f27e99726e..ee9c32d4e9 100644
--- a/layout/reftests/forms/textarea/reftest.list
+++ b/layout/reftests/forms/textarea/reftest.list
@@ -12,7 +12,7 @@ skip-if(Android) != rtl.html no-resize.html # bug 834724
fuzzy(0-1,0-1) == rtl.html rtl-dynamic-attr.html
fuzzy(0-1,0-1) == rtl.html rtl-dynamic-style.html
== rtl.html in-dynamic-rtl-doc.html
-fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-4168) == padding-scrollbar-placement.html padding-scrollbar-placement-ref.html
+== padding-scrollbar-placement.html padding-scrollbar-placement-ref.html
== various-cols.html various-cols-ref.html
== appearance-background-change.html appearance-background-change-ref.html
!= padding-text-overflow.html padding-text-overflow-notref.html
diff --git a/layout/reftests/forms/textbox/reftest.list b/layout/reftests/forms/textbox/reftest.list
index edb83da6e2..9717969ebd 100644
--- a/layout/reftests/forms/textbox/reftest.list
+++ b/layout/reftests/forms/textbox/reftest.list
@@ -8,4 +8,3 @@ skip-if(cocoaWidget||Android) != chrome://reftest/content/forms/textbox/accesske
fuzzy(0-1,0-4) skip-if(cocoaWidget||Android) == chrome://reftest/content/forms/textbox/accesskey-4.xhtml chrome://reftest/content/forms/textbox/accesskey-4-ref.xhtml
skip-if(cocoaWidget||Android) != chrome://reftest/content/forms/textbox/accesskey-4.xhtml chrome://reftest/content/forms/textbox/accesskey-4-notref.xhtml
skip-if(Android) == chrome://reftest/content/forms/textbox/align-baseline-1.xhtml chrome://reftest/content/forms/textbox/align-baseline-1-ref.xhtml # test for bug 494901
-skip-if(Android) == chrome://reftest/content/forms/textbox/setsize.xhtml chrome://reftest/content/forms/textbox/setsize-ref.xhtml
diff --git a/layout/reftests/forms/textbox/setsize-ref.xhtml b/layout/reftests/forms/textbox/setsize-ref.xhtml
deleted file mode 100644
index 5db79ff9d9..0000000000
--- a/layout/reftests/forms/textbox/setsize-ref.xhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
-
-<hbox style="appearance: auto; -moz-default-appearance: textarea; width: 200px; height: 200px;"/>
-<html:div style="position:fixed;top:0;left:0;width:100%;height:100%;"></html:div>
-
-</window>
diff --git a/layout/reftests/forms/textbox/setsize.xhtml b/layout/reftests/forms/textbox/setsize.xhtml
deleted file mode 100644
index 14ccdfb27b..0000000000
--- a/layout/reftests/forms/textbox/setsize.xhtml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
-
-<html:textarea style="width: 200px; height: 200px; margin: 0; resize: none; box-sizing: border-box;"/>
-<html:div style="position:fixed;top:0;left:0;width:100%;height:100%;"></html:div>
-</window>
diff --git a/layout/reftests/high-contrast/reftest.list b/layout/reftests/high-contrast/reftest.list
index 0057a92b2e..d6e2dbbfe7 100644
--- a/layout/reftests/high-contrast/reftest.list
+++ b/layout/reftests/high-contrast/reftest.list
@@ -103,3 +103,4 @@ pref(ui.use_standins_for_native_colors,false) pref(browser.display.use_system_co
# Forced color adjust
pref(layout.css.forced-color-adjust.enabled,true) == backplate-force-color-adjust.html backplate-force-color-adjust-ref.html
+== transparent-textarea.html transparent-textarea-ref.html
diff --git a/layout/reftests/high-contrast/transparent-textarea-ref.html b/layout/reftests/high-contrast/transparent-textarea-ref.html
new file mode 100644
index 0000000000..1c9fb2288e
--- /dev/null
+++ b/layout/reftests/high-contrast/transparent-textarea-ref.html
@@ -0,0 +1,4 @@
+<!doctype html>
+<pre>
+ PASS
+</pre>
diff --git a/layout/reftests/high-contrast/transparent-textarea.html b/layout/reftests/high-contrast/transparent-textarea.html
new file mode 100644
index 0000000000..a82aef57d5
--- /dev/null
+++ b/layout/reftests/high-contrast/transparent-textarea.html
@@ -0,0 +1,17 @@
+<!doctype html>
+<style>
+textarea {
+ color: transparent;
+ background: unset;
+ border: none;
+ resize: none;
+ padding: 0;
+ position: absolute;
+}
+</style>
+<textarea>
+ FAIL
+</textarea>
+<pre>
+ PASS
+</pre>
diff --git a/layout/reftests/image-element/reftest.list b/layout/reftests/image-element/reftest.list
index 2b31398ccf..a31ebb89b8 100644
--- a/layout/reftests/image-element/reftest.list
+++ b/layout/reftests/image-element/reftest.list
@@ -5,30 +5,30 @@ random == bug-364968.html bug-364968-ref.html
== mozsetimageelement-02.html about:blank
== image-outside-document-invalidate.html about:blank
== canvas-outside-document-invalidate-01.html about:blank
-fails-if(azureSkia&&!winWidget) fails-if(cocoaWidget) fails-if(remoteCanvas&&swgl&&winWidget) == canvas-outside-document-invalidate-02.html about:blank # See bug 666800
+fails-if(!winWidget) fails-if(swgl&&winWidget) == canvas-outside-document-invalidate-02.html about:blank # See bug 666800
#fails with Skia due to Skia bug http://code.google.com/p/skia/issues/detail?id=568
fuzzy-if(winWidget,47-129,47-54) == element-paint-simple.html element-paint-simple-ref.html
== element-paint-repeated.html element-paint-repeated-ref.html
== element-paint-recursion.html element-paint-recursion-ref.html
== element-paint-continuation.html element-paint-continuation-ref.html
== element-paint-transform-01.html element-paint-transform-01-ref.html
-random-if(d2d) fuzzy-if(!useDrawSnapshot,255-255,39-42) == element-paint-transform-02.html element-paint-transform-02-ref.html # bug 587133
+random-if(winWidget) fuzzy-if(!useDrawSnapshot,255-255,39-42) == element-paint-transform-02.html element-paint-transform-02-ref.html # bug 587133
== element-paint-background-size-01.html element-paint-background-size-01-ref.html
== element-paint-background-size-02.html element-paint-background-size-02-ref.html
fuzzy(0-255,0-4) == element-paint-transform-repeated.html element-paint-transform-repeated-ref.html # Bug 1475907
-fuzzy-if(d2d,0-255,0-24) fuzzy-if(!useDrawSnapshot,255-255,50-115) == element-paint-transform-03.html element-paint-transform-03-ref.html
+fuzzy-if(winWidget,0-255,0-24) fuzzy-if(!useDrawSnapshot,255-255,50-115) == element-paint-transform-03.html element-paint-transform-03-ref.html
# For element() uses fallback / skia in WebRender, which antialiases differently from WR.
# For Windows: bug 1496542, the scrollframe snaps differently.
# For the rest: -ref the scrollframe is active and layerized differently with APZ.
-fuzzy(0-24,0-106) fuzzy-if(winWidget&&!layersGPUAccelerated,149-149,1203-1203) fuzzy-if(!useDrawSnapshot,1-48,5-68) fuzzy-if(winWidget,47-222,1197-1588) fuzzy-if(Android,0-40,0-81) == element-paint-native-widget.html element-paint-native-widget-ref.html
+fuzzy(0-24,0-106) fuzzy-if(!useDrawSnapshot,1-48,5-68) fuzzy-if(winWidget,47-222,1197-1588) fuzzy-if(Android,0-40,0-81) == element-paint-native-widget.html element-paint-native-widget-ref.html
# This fails with CreateSamplingRestrictedDrawable removed
fails-if(!Android&&!useDrawSnapshot) == element-paint-subimage-sampling-restriction.html about:blank
== element-paint-clippath.html element-paint-clippath-ref.html
-fuzzy-if(!useDrawSnapshot,1-1,128-128) fuzzy-if(d2d,47-47,650-652) fuzzy-if(!useDrawSnapshot,36-39,704-738) == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
+fuzzy-if(winWidget,47-47,650-652) fuzzy-if(!useDrawSnapshot,36-39,704-738) == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
fuzzy(0-1,0-326) fails-if(useDrawSnapshot) == element-paint-sharpness-01b.html element-paint-sharpness-01c.html
-fuzzy-if(!useDrawSnapshot,1-1,128-128) fuzzy-if(d2d,47-47,650-652) fuzzy-if(!useDrawSnapshot,36-39,704-738) == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
+fuzzy-if(winWidget,47-47,650-652) fuzzy-if(!useDrawSnapshot,36-39,704-738) == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
== element-paint-sharpness-02a.html element-paint-sharpness-02b.html
fails-if(useDrawSnapshot) == element-paint-sharpness-02b.html element-paint-sharpness-02c.html
== element-paint-paintserversize-rounding-01.html element-paint-paintserversize-rounding-01-ref.html
diff --git a/layout/reftests/image/reftest.list b/layout/reftests/image/reftest.list
index ad07b512fe..e6e24a1cf5 100644
--- a/layout/reftests/image/reftest.list
+++ b/layout/reftests/image/reftest.list
@@ -1,5 +1,5 @@
fuzzy-if(Android,0-8,0-30) fails-if(useDrawSnapshot) == background-image-zoom-1.html background-image-zoom-1-ref.html
-fails-if(usesRepeatResampling&&!winWidget) fails-if(useDrawSnapshot) == background-image-zoom-2.html about:blank
+fails-if(useDrawSnapshot) == background-image-zoom-2.html about:blank
== image-in-iframe-1.html image-in-iframe-1-ref.html
== image-seam-1a.html image-seam-1-ref.html
== image-seam-1b.html image-seam-1-ref.html
diff --git a/layout/reftests/invalidation/reftest.list b/layout/reftests/invalidation/reftest.list
index 27b228fa2b..99465a7f7f 100644
--- a/layout/reftests/invalidation/reftest.list
+++ b/layout/reftests/invalidation/reftest.list
@@ -97,7 +97,7 @@ pref(layers.single-tile.enabled,false) != fast-scrolling.html about:blank
== clip-path-invalidation-1d.html mask-invalidation-2-ref.html
!= fractional-transform-1.html about:blank
-skip-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) != fractional-transform-2.html about:blank
+skip-if(winWidget) != fractional-transform-2.html about:blank
!= fractional-transform-3.html about:blank
== partially-scrolled-svg-group.html partially-scrolled-svg-group-ref.html
diff --git a/layout/reftests/layers/reftest.list b/layout/reftests/layers/reftest.list
index f65a93a165..d200d69d70 100644
--- a/layout/reftests/layers/reftest.list
+++ b/layout/reftests/layers/reftest.list
@@ -16,19 +16,19 @@ skip != pull-background-animated-position-3.html about:blank # Fails because Pai
skip != pull-background-animated-position-4.html about:blank # Fails because PaintedLayer item assignment and background pulling don't recognize overflow:hidden clips
skip != pull-background-animated-position-5.html about:blank # Fails because ownLayer bounds don't anticipate changes of animated contents, but doesn't fail with event regions
-skip-if(!asyncPan) != pull-background-displayport-1.html about:blank
-skip-if(!asyncPan) != pull-background-displayport-2.html about:blank
-skip-if(!asyncPan) != pull-background-displayport-3.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
-skip-if(!asyncPan) != pull-background-displayport-4.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
-skip-if(!asyncPan) != pull-background-displayport-5.html about:blank
-skip-if(!asyncPan) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
+skip-if(useDrawSnapshot) != pull-background-displayport-1.html about:blank
+skip-if(useDrawSnapshot) != pull-background-displayport-2.html about:blank
+skip-if(useDrawSnapshot) != pull-background-displayport-3.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
+skip-if(useDrawSnapshot) != pull-background-displayport-4.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
+skip-if(useDrawSnapshot) != pull-background-displayport-5.html about:blank
+skip-if(useDrawSnapshot) != pull-background-displayport-6.html about:blank # fails with non-overlay scrollbars and event regions due to bug 1148515
skip-if(Android&&emulator) fuzzy(0-2,0-30150) == opacity-blending.html opacity-blending-ref.html
fuzzy(0-16,0-30) == mask-layer-transform.html mask-layer-transform-ref.html
fuzzy-if(gtkWidget,0-1,0-17) fuzzy-if(Android,0-3,0-4) == forced-bg-color-outside-visible-region.html forced-bg-color-outside-visible-region-ref.html
!= layerize-over-fixed-bg-1.html about:blank
-skip-if(!asyncPan) != fixed-pos-scrolled-clip-layerize.html about:blank
-skip-if(!asyncPan) == fixed-pos-scrolled-clip-opacity-layerize.html fixed-pos-scrolled-clip-opacity-inside-layerize.html
+skip-if(useDrawSnapshot) != fixed-pos-scrolled-clip-layerize.html about:blank
+skip-if(useDrawSnapshot) == fixed-pos-scrolled-clip-opacity-layerize.html fixed-pos-scrolled-clip-opacity-inside-layerize.html
fuzzy(0-1,0-8033) == opacity-background-1.html opacity-background-1-ref.html
== opacity-flattening-large-image.html opacity-flattening-large-image-ref.html
diff --git a/layout/reftests/list-item/reftest.list b/layout/reftests/list-item/reftest.list
index 36ab01f78b..5ade8fe480 100644
--- a/layout/reftests/list-item/reftest.list
+++ b/layout/reftests/list-item/reftest.list
@@ -1,7 +1,7 @@
-fuzzy-if(OSX,0-55,0-4) == numbering-1.html numbering-1-ref.html
+fuzzy-if(cocoaWidget,0-55,0-4) == numbering-1.html numbering-1-ref.html
== numbering-2.html numbering-2-ref.html
-fuzzy-if(OSX,0-11,0-1) == numbering-3.html numbering-3-ref.html
-fuzzy-if(OSX,0-76,0-2) == numbering-4.html numbering-4-ref.html
+fuzzy-if(cocoaWidget,0-11,0-1) == numbering-3.html numbering-3-ref.html
+fuzzy-if(cocoaWidget,0-76,0-2) == numbering-4.html numbering-4-ref.html
== numbering-5.html numbering-5-ref.html
== ol-reversed-1a.html ol-reversed-1-ref.html
== ol-reversed-1b.html ol-reversed-1-ref.html
diff --git a/layout/reftests/mathml/largeop-1-ref.html b/layout/reftests/mathml/largeop-1-ref.html
deleted file mode 100644
index e69de29bb2..0000000000
--- a/layout/reftests/mathml/largeop-1-ref.html
+++ /dev/null
diff --git a/layout/reftests/mathml/largeop-1.html b/layout/reftests/mathml/largeop-1.html
deleted file mode 100644
index e69de29bb2..0000000000
--- a/layout/reftests/mathml/largeop-1.html
+++ /dev/null
diff --git a/layout/reftests/mathml/mathml-mmultiscript-base-ref.html b/layout/reftests/mathml/mathml-mmultiscript-base-ref.html
deleted file mode 100644
index 45f43e9f9b..0000000000
--- a/layout/reftests/mathml/mathml-mmultiscript-base-ref.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>mmultiscript with only base</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mtext>base</mtext>
- </mmultiscripts>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-base.html b/layout/reftests/mathml/mathml-mmultiscript-base.html
deleted file mode 100644
index f2832df479..0000000000
--- a/layout/reftests/mathml/mathml-mmultiscript-base.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>mmultiscript with only base and none as placeholder</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mtext>base</mtext>
- <none/>
- <none/>
- </mmultiscripts>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html b/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
deleted file mode 100644
index b30e7fb976..0000000000
--- a/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>mmultiscript with mprescripts without none</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mtext>base</mtext>
- <mprescripts/>
- </mmultiscripts>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-mprescript.html b/layout/reftests/mathml/mathml-mmultiscript-mprescript.html
deleted file mode 100644
index 5bc0b5a5ad..0000000000
--- a/layout/reftests/mathml/mathml-mmultiscript-mprescript.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>mmultiscript with mprescripts with none as placeholders</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mtext>base</mtext>
- <none/>
- <none/>
- <mprescripts/>
- </mmultiscripts>
-
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-1-ref.html b/layout/reftests/mathml/mirror-op-1-ref.html
deleted file mode 100644
index d7515156c3..0000000000
--- a/layout/reftests/mathml/mirror-op-1-ref.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <style type="text/css">
- mo {
- transform: scaleX(-1.0);
- }
- </style>
- <body>
-
- <p><math><mo>(</mo></math></p>
- <p><math><mo>)</mo></math></p>
- <p><math><mo>[</mo></math></p>
- <p><math><mo>]</mo></math></p>
- <p><math><mo>{</mo></math></p>
- <p><math><mo>}</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-1.html b/layout/reftests/mathml/mirror-op-1.html
deleted file mode 100644
index bb59e16c23..0000000000
--- a/layout/reftests/mathml/mirror-op-1.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math dir="rtl"><mo>(</mo></math></p>
- <p><math dir="rtl"><mo>)</mo></math></p>
- <p><math dir="rtl"><mo>[</mo></math></p>
- <p><math dir="rtl"><mo>]</mo></math></p>
- <p><math dir="rtl"><mo>{</mo></math></p>
- <p><math dir="rtl"><mo>}</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-2-ref.html b/layout/reftests/mathml/mirror-op-2-ref.html
deleted file mode 100644
index c67710cca6..0000000000
--- a/layout/reftests/mathml/mirror-op-2-ref.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block"><mo>&#x2211;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-2.html b/layout/reftests/mathml/mirror-op-2.html
deleted file mode 100644
index 5db6819cfe..0000000000
--- a/layout/reftests/mathml/mirror-op-2.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block" dir="rtl"><mo>&#x2211;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-3-ref.html b/layout/reftests/mathml/mirror-op-3-ref.html
deleted file mode 100644
index fc3a183ef3..0000000000
--- a/layout/reftests/mathml/mirror-op-3-ref.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block"><mo>&#x221A;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-3.html b/layout/reftests/mathml/mirror-op-3.html
deleted file mode 100644
index 501af10926..0000000000
--- a/layout/reftests/mathml/mirror-op-3.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block" dir="rtl"><mo>&#x221A;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-4-ref.html b/layout/reftests/mathml/mirror-op-4-ref.html
deleted file mode 100644
index 6c39a47a33..0000000000
--- a/layout/reftests/mathml/mirror-op-4-ref.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block"><mo>&#x222B;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mirror-op-4.html b/layout/reftests/mathml/mirror-op-4.html
deleted file mode 100644
index ba1acf89f7..0000000000
--- a/layout/reftests/mathml/mirror-op-4.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test mirror op</title></head>
- <body>
-
- <p><math display="block" dir="rtl"><mo>&#x222B;</mo></math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/mmultiscript-align-ref.html b/layout/reftests/mathml/mmultiscript-align-ref.html
deleted file mode 100644
index 337852837f..0000000000
--- a/layout/reftests/mathml/mmultiscript-align-ref.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>alignment of mmultiscript sub/superscripts</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mspace width="50px" height="50px" mathbackground="red"/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- <mspace width="50px" height="10px"/>
- </mrow>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mprescripts/>
- <mrow>
- <mspace width="50px" height="10px"/>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- <mspace width="100px" height="10px" mathbackground="green"/>
- </mmultiscripts>
- </math>
- <br/>
- <math>
- <mmultiscripts>
- <mspace width="50px" height="50px" mathbackground="red"/>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- <mspace width="50px" height="10px"/>
- </mrow>
- <mprescripts/>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mrow>
- <mspace width="50px" height="10px"/>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- </mmultiscripts>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mmultiscript-align.html b/layout/reftests/mathml/mmultiscript-align.html
deleted file mode 100644
index 44fb713a34..0000000000
--- a/layout/reftests/mathml/mmultiscript-align.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>alignment of mmultiscript sub/superscripts</title>
- </head>
-
- <body>
- <math>
- <mmultiscripts>
- <mspace width="50px" height="50px" mathbackground="red"/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mprescripts/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- <mspace width="100px" height="10px" mathbackground="green"/>
- </mmultiscripts>
- </math>
- <br/>
- <math>
- <mmultiscripts>
- <mspace width="50px" height="50px" mathbackground="red"/>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- <mprescripts/>
- <mspace width="100px" height="10px" mathbackground="green"/>
- <mrow>
- <mspace width="50px" height="10px" mathbackground="blue"/>
- </mrow>
- </mmultiscripts>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mo-glyph-size-ref.html b/layout/reftests/mathml/mo-glyph-size-ref.html
deleted file mode 100644
index e4dd43747e..0000000000
--- a/layout/reftests/mathml/mo-glyph-size-ref.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="UTF-8">
-</head>
-<body>
-<!-- Bug 1219068 -->
-
-<div id="hider"
- style="position:absolute; top:0; left:0; background-color:green;
- height:1em; width:100%; z-index:1; padding-top:5px;
- padding-bottom:5px;" />
-</body>
-</html>
diff --git a/layout/reftests/mathml/mo-glyph-size.html b/layout/reftests/mathml/mo-glyph-size.html
deleted file mode 100644
index c0cc726daf..0000000000
--- a/layout/reftests/mathml/mo-glyph-size.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<meta charset="UTF-8">
-</head>
-<body>
-<!-- Bug 1219068 -->
-
-<math style="position:absolute; top: 0; font-size:1em; z-index: 0;" display="block">
-<mrow>
- <mo>|</mo>
- <mrow>
- <mi>f</mi>
- <mrow>
- <mn>(</mn>
- <mi>x</mi>
- <mn>)</mn>
- </mrow>
- <mn>-</mn>
- <mrow>
- <mi>f</mi>
- <mrow>
- <mn>(</mn>
- <msub>
- <mi>x</mi>
- <mn>0</mn>
- </msub>
- <mn>)</mn>
- </mrow>
- </mrow>
- </mrow>
- <mo>|</mo>
-</mrow>
-</math>
-<div id="hider"
- style="position:absolute; top:0; left:0; background-color:green;
- height:1em; width:100%; z-index:1; padding-top:5px;
- padding-bottom:5px; visibility:hidden" />
- <script>
- function obscureMathML() {
- var hider = document.getElementById("hider");
- hider.style.visibility="visible";
- // The math should now be completely obscured
-
- document.documentElement.removeAttribute("class");
- }
- window.addEventListener("MozReftestInvalidate", obscureMathML);
- </script>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-7-ref.html b/layout/reftests/mathml/mpadded-7-ref.html
deleted file mode 100644
index 50f14246ee..0000000000
--- a/layout/reftests/mathml/mpadded-7-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <mpadded mathbackground="red" height="100height" depth="0">
- <mphantom>
- <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-7.html b/layout/reftests/mathml/mpadded-7.html
deleted file mode 100644
index 94d51b5845..0000000000
--- a/layout/reftests/mathml/mpadded-7.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <!--height in term of height should not depend on the characters-->
- <mpadded mathbackground="red" height="100height" depth="0">
- <mphantom>
- <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-8-ref.html b/layout/reftests/mathml/mpadded-8-ref.html
deleted file mode 100644
index e01e6498f2..0000000000
--- a/layout/reftests/mathml/mpadded-8-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <mpadded mathbackground="red" height="100width" depth="0">
- <mphantom>
- <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-8.html b/layout/reftests/mathml/mpadded-8.html
deleted file mode 100644
index 4f203d4225..0000000000
--- a/layout/reftests/mathml/mpadded-8.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <!--height in term of width should not depend on the characters-->
- <mpadded mathbackground="red" height="100width" depth="0">
- <mphantom>
- <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-9-ref.html b/layout/reftests/mathml/mpadded-9-ref.html
deleted file mode 100644
index e2a4943edd..0000000000
--- a/layout/reftests/mathml/mpadded-9-ref.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <mpadded mathbackground="red" width="100width">
- <mphantom>
- <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mpadded-9.html b/layout/reftests/mathml/mpadded-9.html
deleted file mode 100644
index 2b86721f50..0000000000
--- a/layout/reftests/mathml/mpadded-9.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test mpadded</title>
- </head>
- <body>
- <math>
- <!--with fixed width, height + depth should not depend on the characters-->
- <mpadded mathbackground="red" width="100width">
- <mphantom>
- <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
- </mphantom>
- </mpadded>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-2-ref.xhtml b/layout/reftests/mathml/mstyle-2-ref.xhtml
deleted file mode 100644
index a8843780cb..0000000000
--- a/layout/reftests/mathml/mstyle-2-ref.xhtml
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<table>
- <tbody>
- <tr>
- <td>mpadded: width</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: lspace</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: height</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <msup>
- <mrow>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msup>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: depth</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <msub>
- <mrow>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msub>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: width</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: height</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <msup>
- <mrow>
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msup>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: depth</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <msub>
- <mrow>
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msub>
- </mstyle>
- </math></td>
- </tr>
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-2.xhtml b/layout/reftests/mathml/mstyle-2.xhtml
deleted file mode 100644
index f11f3ad8cd..0000000000
--- a/layout/reftests/mathml/mstyle-2.xhtml
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<!-- The attributes below should no longer have effect on <mstyle>/<math>
- elements. See bug 838509 -->
-
-<table>
- <tbody>
- <tr>
- <td>mpadded: width</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" width="1em">
- <mstyle width="1em">
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: lspace</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" lspace="1em">
- <mstyle lspace="1em">
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: height</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" height="1em">
- <mstyle height="1em">
- <msup>
- <mrow>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msup>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mpadded: depth</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" depth="1em">
- <mstyle depth="1em">
- <msub>
- <mrow>
- <mtext>_</mtext>
- <mpadded/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msub>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: width</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" width="1em">
- <mstyle width="1em">
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: height</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" height="1em">
- <mstyle height="1em">
- <msup>
- <mrow>
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msup>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mspace: depth</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" depth="1em">
- <mstyle depth="1em">
- <msub>
- <mrow>
- <mtext>_</mtext>
- <mspace/>
- <mtext>_</mtext>
- </mrow>
- <mtext>_</mtext>
- </msub>
- </mstyle>
- </math></td>
- </tr>
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-3-ref.xhtml b/layout/reftests/mathml/mstyle-3-ref.xhtml
deleted file mode 100644
index 66c03f89ad..0000000000
--- a/layout/reftests/mathml/mstyle-3-ref.xhtml
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<table>
- <tbody>
- <tr>
- <td>mo: form</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mrow>
- <!-- We assume that the infix/postfix forms of _ do -->
- <!-- not have the same lspace/rspace values in the operator dictionary -->
- <mtext>_</mtext>
- <mo>_</mo>
- <mtext>_</mtext>
- </mrow>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: lspace, rspace</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mrow>
- <!-- We assume that the infix form of _ has -->
- <!-- nonzero lspace/rspace values in the operator dictionary -->
- <mtext>_</mtext>
- <mo>_</mo>
- <mtext>_</mtext>
- </mrow>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: stretchy</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mover>
- <!-- We assume that the arrow has stretchy=true in the operator dictionary -->
- <mtext>abcd</mtext>
- <mo>&#x2192;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: accent</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mover>
- <!-- We assume &#x23de; has accent=true in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23de;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: maxsize</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mo>(</mo>
- <mspace height="3em"/>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: minsize</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mo>(</mo>
- <mspace height="1em"/>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: symmetric</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <!-- We assume that ( has symmetric=true in the operator dictionary -->
- <mstyle>
- <mtext>_</mtext>
- <mo minsize="200%">(</mo>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: movablelimits</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <!-- We assume that &#x2211; has movablelimits=true in the operator dictionary -->
- <mstyle>
- <munderover>
- <mo>&#x2211;</mo>
- <mi>a</mi>
- <mi>b</mi>
- </munderover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: largeop</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <!-- We assume that &#x2211; has largeop=true in the operator dictionary -->
- <mstyle>
- <mo>&#x2211;</mo>
- </mstyle>
- </math></td>
- </tr>
- <!--
- fence: This attribute generally has no direct effect on the visual rendering.
- separator: This attribute generally has no direct effect on the visual rendering.
- -->
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-3.xhtml b/layout/reftests/mathml/mstyle-3.xhtml
deleted file mode 100644
index 4b395d3942..0000000000
--- a/layout/reftests/mathml/mstyle-3.xhtml
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<!-- The attributes below (except math@display) should no longer have effect on
- <mstyle>/<math> elements. See bug 838509 -->
-
-<table>
- <tbody>
- <tr>
- <td>mo: form</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" form="postfix">
- <mstyle form="postfix">
- <mrow>
- <!-- We assume that the infix/postfix forms of _ do -->
- <!-- not have the same lspace/rspace values in the operator dictionary -->
- <mtext>_</mtext>
- <mo>_</mo>
- <mtext>_</mtext>
- </mrow>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: lspace, rspace</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" lspace="0" rspace="0">
- <mstyle lspace="0" rspace="0">
- <mrow>
- <!-- We assume that the infix form of _ has -->
- <!-- nonzero lspace/rspace values in the operator dictionary -->
- <mtext>_</mtext>
- <mo>_</mo>
- <mtext>_</mtext>
- </mrow>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: stretchy</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" stretchy="false">
- <mstyle stretchy="false">
- <mover>
- <!-- We assume that the arrow has stretchy=true in the operator dictionary -->
- <mtext>abcd</mtext>
- <mo>&#x2192;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: accent</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false">
- <mstyle accent="false">
- <mover>
- <!-- We assume &#x23de; has accent=true in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23de;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: maxsize</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" maxsize="100%">
- <mstyle maxsize="100%">
- <mo>(</mo>
- <mspace height="3em"/>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: minsize</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" minsize="300%">
- <mstyle minsize="300%">
- <mo>(</mo>
- <mspace height="1em"/>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: symmetric</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" symmetric="false">
- <!-- We assume that ( has symmetric=true in the operator dictionary -->
- <mstyle symmetric="false">
- <mtext>_</mtext>
- <mo minsize="200%">(</mo>
- <mtext>_</mtext>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: movablelimits</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" movablelimits="false">
- <!-- We assume that &#x2211; has movablelimits=true in the operator dictionary -->
- <mstyle movablelimits="false">
- <munderover>
- <mo>&#x2211;</mo>
- <mi>a</mi>
- <mi>b</mi>
- </munderover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>mo: largeop</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" largeop="false">
- <!-- We assume that &#x2211; has largeop=true in the operator dictionary -->
- <mstyle largeop="false">
- <mo>&#x2211;</mo>
- </mstyle>
- </math></td>
- </tr>
- <!--
- fence: This attribute generally has no direct effect on the visual rendering.
- separator: This attribute generally has no direct effect on the visual rendering.
- -->
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-4-ref.xhtml b/layout/reftests/mathml/mstyle-4-ref.xhtml
deleted file mode 100644
index e82876083e..0000000000
--- a/layout/reftests/mathml/mstyle-4-ref.xhtml
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<table>
- <tbody>
- <tr>
- <td>mover: accent</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <mover>
- <!-- We assume &#x23de; is accent in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23de;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>munder: accentunder</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <munder>
- <!-- We assume &#x23df; is accent in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23df;</mo>
- </munder>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>munderover: accent, accentunder</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle>
- <munderover>
- <!-- We assume &#x23de; and &#x23df; are accents in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23df;</mo>
- <mo>&#x23de;</mo>
- </munderover>
- </mstyle>
- </math></td>
- </tr>
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/mstyle-4.xhtml b/layout/reftests/mathml/mstyle-4.xhtml
deleted file mode 100644
index e934977557..0000000000
--- a/layout/reftests/mathml/mstyle-4.xhtml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="us-ascii"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=us-ascii" />
- <title>Test mstyle</title>
- <style type="text/css">
- table { width: 100%; border-collapse: collapse; }
- td { border: solid black 1px; }
- </style>
-</head>
-
-<body>
-
-<!-- The attributes below should no longer have effect on <mstyle>/<math>
- elements. See bug 838509 -->
-
-<table>
- <tbody>
- <tr>
- <td>mover: accent</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false">
- <mstyle accent="false">
- <mover>
- <!-- We assume &#x23de; is accent in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23de;</mo>
- </mover>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>munder: accentunder</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" accentunder="false">
- <mstyle accentunder="false">
- <munder>
- <!-- We assume &#x23df; is accent in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23df;</mo>
- </munder>
- </mstyle>
- </math></td>
- </tr>
- <tr>
- <td>munderover: accent, accentunder</td>
- <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false" accentunder="false">
- <mstyle accent="false" accentunder="false">
- <munderover>
- <!-- We assume &#x23de; and &#x23df; are accents in the operator dictionary -->
- <mrow>
- <mi>x</mi>
- <mo>+</mo>
- <mi>y</mi>
- <mo>+</mo>
- <mi>z</mi>
- </mrow>
- <mo>&#x23df;</mo>
- <mo>&#x23de;</mo>
- </munderover>
- </mstyle>
- </math></td>
- </tr>
- </tbody>
-</table>
-</body>
-</html>
diff --git a/layout/reftests/mathml/multiscripts-1-ref.html b/layout/reftests/mathml/multiscripts-1-ref.html
deleted file mode 100644
index 2fcc142503..0000000000
--- a/layout/reftests/mathml/multiscripts-1-ref.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html>
-<html><head>
-<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Comparison of script elements</title></head>
- <body>
- msubsup:
- <math>
- <mmultiscripts style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">ccc</mtext>
- </mmultiscripts>
- </math>
-
- <br><br>
-
- msubsup:
- <math>
- <mmultiscripts style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- <none/>
- </mmultiscripts>
- </math>
-
- <br><br>
-
- msup / msubsup:
- <math>
- <mmultiscripts style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <none/>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </mmultiscripts>
- </math>
-
- <math>
- <mmultiscripts style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <none/>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </mmultiscripts>
- </math>
-
- <br><br>
-
-
- mrow / msub:
- <math>
- <mrow style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- </mrow>
- </math>
-
- <math>
- <mrow style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- </mrow>
- </math>
-
- <br><br>
-
- msupsub:
- <math>
- <mmultiscripts style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <none />
- <none />
- </mmultiscripts>
- </math>
-
-</body></html>
diff --git a/layout/reftests/mathml/multiscripts-1.html b/layout/reftests/mathml/multiscripts-1.html
deleted file mode 100644
index fa45ff3699..0000000000
--- a/layout/reftests/mathml/multiscripts-1.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html>
-<html><head>
-<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Comparison of script elements</title></head>
- <body>
- msubsup:
- <math>
- <msubsup style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">ccc</mtext>
- </msubsup>
- </math>
-
- <br><br>
-
- <!-- Different rules apply to msub, so it won't provide equivalent output -->
- msubsup:
- <math>
- <msubsup style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- <mrow></mrow>
- </msubsup>
- </math>
-
- <br><br>
-
- msup / msubsup:
- <math>
- <msup style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </msup>
- </math>
-
- <math>
- <msubsup style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mrow></mrow>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </msubsup>
- </math>
-
- <br><br>
-
- mrow / msub:
- <math>
- <mrow style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- </mrow>
- </math>
-
- <math>
- <msub style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mrow></mrow>
- </msub>
- </math>
-
- <br><br>
-
- msupsub:
- <math>
- <msubsup style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mrow></mrow>
- <mrow></mrow>
- </msubsup>
- </math>
-
-</body></html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-false-ref.html b/layout/reftests/mathml/munder-mover-align-accent-false-ref.html
deleted file mode 100644
index ff98924f80..0000000000
--- a/layout/reftests/mathml/munder-mover-align-accent-false-ref.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="false" </h2>
- <table border="1">
- <tr>
- <th colspan="2">mover</th>
- <th colspan="2">munder</th>
- </tr>
- <tr>
- <td align="center"><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <mover>
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <mover>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <munder>
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munder>
- </math>
- </td>
- <td align="center">
- <math>
- <munder>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-false.html b/layout/reftests/mathml/munder-mover-align-accent-false.html
deleted file mode 100644
index 14696c286d..0000000000
--- a/layout/reftests/mathml/munder-mover-align-accent-false.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="false" </h2>
- <table border="1">
- <tr>
- <th colspan="2">mover</th>
- <th colspan="2">munder</th>
- </tr>
- <tr>
- <td align="center"><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <mover>
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <mover>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <munder>
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- <td align="center">
- <math>
- <munder>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-true-ref.html b/layout/reftests/mathml/munder-mover-align-accent-true-ref.html
deleted file mode 100644
index 9ed8c4e518..0000000000
--- a/layout/reftests/mathml/munder-mover-align-accent-true-ref.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="true" </h2>
- <table border="1">
- <tr>
- <th colspan="2">mover</th>
- <th colspan="2">munder</th>
- </tr>
- <tr>
- <td align="center"><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <mover accent="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <mover accent="true">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <munder accentunder="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munder>
- </math>
- </td>
- <td align="center">
- <math>
- <munder accentunder="true">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-true.html b/layout/reftests/mathml/munder-mover-align-accent-true.html
deleted file mode 100644
index e98e0ef677..0000000000
--- a/layout/reftests/mathml/munder-mover-align-accent-true.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="true" </h2>
- <table border="1">
- <tr>
- <th colspan="2">mover</th>
- <th colspan="2">munder</th>
- </tr>
- <tr>
- <td align="center"><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow>
- </td>
- <td align="center">
- <mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <mover accent="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <mover accent="true">
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </mover>
- </math>
- </td>
- <td align="center">
- <math>
- <munder accentunder="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- <td align="center">
- <math>
- <munder accentunder="true">
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-false-ref.html b/layout/reftests/mathml/munderover-align-accent-false-ref.html
deleted file mode 100644
index 7948407abf..0000000000
--- a/layout/reftests/mathml/munderover-align-accent-false-ref.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="false" </h2>
- <table border="1">
- <tr>
- <th colspan="6">munderover</th>
- </tr>
- <tr>
- <td align="center"><math><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- <mo>&lt;</mo>
- <mi>Under<mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- <mo>&gt;</mo>
- <mi>Under</mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over = Under</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow></math>
- </td>
- <td align="center"><math><mrow>
- <mi>Over = Under</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></math></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <munderover accent="false" accentunder="false">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="false" accentunder="false">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="false" accentunder="false">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="false" accentunder="false">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-false.html b/layout/reftests/mathml/munderover-align-accent-false.html
deleted file mode 100644
index d2ab965d96..0000000000
--- a/layout/reftests/mathml/munderover-align-accent-false.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="false" </h2>
- <table border="1">
- <tr>
- <th colspan="4">munderover</th>
- </tr>
- <tr>
- <td align="center"><math><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- <mo>&lt;</mo>
- <mi>Under<mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- <mo>&gt;</mo>
- <mi>Under</mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over = Under</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow></math>
- </td>
- <td align="center"><math><mrow>
- <mi>Over = Under</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></math></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <munderover>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover>
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-true-ref.html b/layout/reftests/mathml/munderover-align-accent-true-ref.html
deleted file mode 100644
index d4c88c06e1..0000000000
--- a/layout/reftests/mathml/munderover-align-accent-true-ref.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="true" </h2>
- <table border="1">
- <tr>
- <th colspan="6">munderover</th>
- </tr>
- <tr>
- <td align="center"><math><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- <mo>&lt;</mo>
- <mi>Under<mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- <mo>&gt;</mo>
- <mi>Under</mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over = Under</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow></math>
- </td>
- <td align="center"><math><mrow>
- <mi>Over = Under</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></math></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mrow>
- <mspace height="15px" width="25px"/>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="25px"/>
- </mrow>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-true.html b/layout/reftests/mathml/munderover-align-accent-true.html
deleted file mode 100644
index 3067ae5ea8..0000000000
--- a/layout/reftests/mathml/munderover-align-accent-true.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title></title></head>
- <body>
- <h2> Test with accent="true" </h2>
- <table border="1">
- <tr>
- <th colspan="4">munderover</th>
- </tr>
- <tr>
- <td align="center"><math><mrow>
- <mi>Over</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- <mo>&lt;</mo>
- <mi>Under<mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- <mo>&gt;</mo>
- <mi>Under</mi>
- </mrow></math>
- </td>
- <td align="center">
- <math><mrow>
- <mi>Over = Under</mi>
- <mo>&lt;</mo>
- <mi>Base</mi>
- </mrow></math>
- </td>
- <td align="center"><math><mrow>
- <mi>Over = Under</mi>
- <mo>&gt;</mo>
- <mi>Base</mi>
- </mrow></math></td>
- </tr>
- <tr>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mspace height="15px" width="50px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mspace height="15px" width="75px" mathbackground="blue"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- <td align="center">
- <math>
- <munderover accent="true" accentunder="true">
- <mspace height="15px" width="25px" mathbackground="blue"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- <mspace height="15px" width="75px" mathbackground="red"/>
- </munderover>
- </math>
- </td>
- </tr>
- </table>
- <table>
- <tr>
- <th>
- <h5>Under & Over</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="red"/>
- </mrow>
- </math>
- </th>
- <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
- <th>
- <h5>Base</h5>
-
- <math>
- <mrow>
- <mspace height="15px" width="25px" mathbackground="blue"/>
- </mrow>
- </math>
- </th>
- </tr>
- </table>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-empty-scripts-ref.html b/layout/reftests/mathml/munderover-empty-scripts-ref.html
deleted file mode 100644
index 27d858309d..0000000000
--- a/layout/reftests/mathml/munderover-empty-scripts-ref.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test munderover with empty scripts</title>
- </head>
- <body>
-
- <p>munder / munderover with empty overscript:
- <math>
- <munderover style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- <mspace></mspace>
- </munderover>
- </math></p>
-
- <p>mover / munderover with empty underscript:
- <math>
- <munderover style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mspace></mspace>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </munderover>
- </math></p>
-
- <p>mrow / munder with empty scripts:
- <math>
- <munderover style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mspace></mspace>
- <mspace></mspace>
- </munderover>
- </math></p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/munderover-empty-scripts.html b/layout/reftests/mathml/munderover-empty-scripts.html
deleted file mode 100644
index 5704c5c74d..0000000000
--- a/layout/reftests/mathml/munderover-empty-scripts.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test munderover with empty scripts</title>
- </head>
- <body>
-
- <p>munder / munderover with empty overscript:
- <math>
- <munder style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </munder>
- </math></p>
-
- <p>mover / munderover with empty underscript:
- <math>
- <mover style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
- </mover>
- </math></p>
-
- <p>mrow / munder with empty scripts:
- <math>
- <mrow style="background: red;">
- <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
- </mrow>
- </math></p>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/overbar-width-1-ref.xhtml b/layout/reftests/mathml/overbar-width-1-ref.xhtml
deleted file mode 100644
index 64e89f403f..0000000000
--- a/layout/reftests/mathml/overbar-width-1-ref.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- html { background-color: grey; }
- div { display: inline-block;
- font-size: 30px;
- line-height: 60px; /* Ensure space for overbar */
- border: 1px solid white;
- padding: 2px; /* 10% error allowed in char selection */
- background-color: black;
- color: red; }
- </style>
- </head>
-<body>
- <div>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mphantom>
- <mover>
- <mi>ai</mi>
- <mo>&#xaf;</mo>
- </mover>
- </mphantom>
- </math>
- </div>
-</body>
-</html>
diff --git a/layout/reftests/mathml/overbar-width-1.xhtml b/layout/reftests/mathml/overbar-width-1.xhtml
deleted file mode 100644
index ab261d061d..0000000000
--- a/layout/reftests/mathml/overbar-width-1.xhtml
+++ /dev/null
@@ -1,25 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Check width of stretchy OverBar</title>
- <style type="text/css">
- html { background-color: grey; }
- div { display: inline-block;
- font-size: 30px;
- line-height: 60px; /* Ensure space for overbar */
- border: 1px solid white;
- padding: 2px; /* 10% error allowed in char selection */
- background-color: black;
- color: black; }
- </style>
- </head>
-<body>
- <div>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
- <mi>ai</mi>
- <mo>&#xaf;</mo>
- </mover>
- </math>
- </div>
-</body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-1.html b/layout/reftests/mathml/radicalbar-1.html
deleted file mode 100644
index 326164c0fa..0000000000
--- a/layout/reftests/mathml/radicalbar-1.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
- <html>
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-1a.html b/layout/reftests/mathml/radicalbar-1a.html
deleted file mode 100644
index bf2e5147ae..0000000000
--- a/layout/reftests/mathml/radicalbar-1a.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom=".5">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-1b.html b/layout/reftests/mathml/radicalbar-1b.html
deleted file mode 100644
index a469943e79..0000000000
--- a/layout/reftests/mathml/radicalbar-1b.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom=".4">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-1c.html b/layout/reftests/mathml/radicalbar-1c.html
deleted file mode 100644
index 0485fe4136..0000000000
--- a/layout/reftests/mathml/radicalbar-1c.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom=".3">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-1d.html b/layout/reftests/mathml/radicalbar-1d.html
deleted file mode 100644
index f89db4ded3..0000000000
--- a/layout/reftests/mathml/radicalbar-1d.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom=".2">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-2.html b/layout/reftests/mathml/radicalbar-2.html
deleted file mode 100644
index 1870493cb4..0000000000
--- a/layout/reftests/mathml/radicalbar-2.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html>
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-2a.html b/layout/reftests/mathml/radicalbar-2a.html
deleted file mode 100644
index 9856fa868c..0000000000
--- a/layout/reftests/mathml/radicalbar-2a.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.5">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-2b.html b/layout/reftests/mathml/radicalbar-2b.html
deleted file mode 100644
index 7df074c40e..0000000000
--- a/layout/reftests/mathml/radicalbar-2b.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.4">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-2c.html b/layout/reftests/mathml/radicalbar-2c.html
deleted file mode 100644
index 138bad31ab..0000000000
--- a/layout/reftests/mathml/radicalbar-2c.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.3">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-2d.html b/layout/reftests/mathml/radicalbar-2d.html
deleted file mode 100644
index 7f12882422..0000000000
--- a/layout/reftests/mathml/radicalbar-2d.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.2">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-3.html b/layout/reftests/mathml/radicalbar-3.html
deleted file mode 100644
index 12fa3ae050..0000000000
--- a/layout/reftests/mathml/radicalbar-3.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html>
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-3a.html b/layout/reftests/mathml/radicalbar-3a.html
deleted file mode 100644
index 24ebfec8e5..0000000000
--- a/layout/reftests/mathml/radicalbar-3a.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.5">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-3b.html b/layout/reftests/mathml/radicalbar-3b.html
deleted file mode 100644
index 1aeafb6cb7..0000000000
--- a/layout/reftests/mathml/radicalbar-3b.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.4">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-3c.html b/layout/reftests/mathml/radicalbar-3c.html
deleted file mode 100644
index e9e7e7ae55..0000000000
--- a/layout/reftests/mathml/radicalbar-3c.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.3">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/radicalbar-3d.html b/layout/reftests/mathml/radicalbar-3d.html
deleted file mode 100644
index 7d780af44c..0000000000
--- a/layout/reftests/mathml/radicalbar-3d.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
- <html reftest-zoom="0.2">
- <head>
- <!-- Default to invisible text -->
- <style type="text/css" media="screen, print">
- .hidden {
- color: white;
- }
- .visible {
- color: black;
- }
- </style>
- </head>
- <body>
- <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
- Because the comparison is for inequality with about:blank, at most one can be visible -->
- <math>
- <mrow>
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="visible">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="1em" height="1em" />
- <msqrt class="hidden">
- <mspace width="20em" height="1em" />
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </msqrt>
- </mrow>
- </math>
-
- <!-- Block out all but the horizontal bar of the visible radical -->
- <div style="position: absolute; top: 5px; left: 0px;
- width: 20em; height: 10em; background: white;"></div>
- </body>
-</html>
diff --git a/layout/reftests/mathml/reftest.list b/layout/reftests/mathml/reftest.list
deleted file mode 100644
index b143a25174..0000000000
--- a/layout/reftests/mathml/reftest.list
+++ /dev/null
@@ -1,55 +0,0 @@
-random-if(smallScreen&&Android) fuzzy(0-255,0-200) fuzzy-if(geckoview,201-216,200-250) fuzzy-if(winWidget,114-255,245-361) fuzzy-if(OSX,79-153,240-250) == mirror-op-1.html mirror-op-1-ref.html
-!= mirror-op-2.html mirror-op-2-ref.html
-!= mirror-op-3.html mirror-op-3-ref.html
-!= mirror-op-4.html mirror-op-4-ref.html
-== overbar-width-1.xhtml overbar-width-1-ref.xhtml
-== stretchy-largeop-1.html stretchy-largeop-1-ref.html
-== stretchy-largeop-2.html stretchy-largeop-2-ref.html
-== stretchy-largeop-3.html stretchy-largeop-3-ref.html
-== underbar-width-1.xhtml underbar-width-1-ref.xhtml
-== semantics-1.xhtml semantics-1-ref.xhtml
-== semantics-2.html semantics-2-ref.html
-== semantics-3.html semantics-3-ref.html
-pref(mathml.stixgeneral_operator_stretching.disabled,false) == semantics-5.html semantics-5-ref.html # bug 1309429; bug 1648335
-fuzzy-if(OSX,0-16,0-8) == mstyle-3.xhtml mstyle-3-ref.xhtml
-fuzzy-if(OSX,0-1,0-4) == mstyle-4.xhtml mstyle-4-ref.xhtml
-== scale-stretchy-1.xhtml scale-stretchy-1-ref.xhtml
-!= scale-stretchy-2.xhtml scale-stretchy-2-ref.xhtml
-fails-if(OSX>=1010) == scale-stretchy-3.xhtml scale-stretchy-3-ref.xhtml
-!= scale-stretchy-4.xhtml scale-stretchy-4-ref.xhtml
-!= scale-stretchy-5.xhtml scale-stretchy-5-ref.xhtml
-!= stretchy-1.html stretchy-1-ref.html
-== mpadded-7.html mpadded-7-ref.html
-== mpadded-8.html mpadded-8-ref.html
-== mpadded-9.html mpadded-9-ref.html
-== scriptlevel-movablelimits-1.html scriptlevel-movablelimits-1-ref.html
-== munderover-align-accent-false.html munderover-align-accent-false-ref.html
-== munderover-align-accent-true.html munderover-align-accent-true-ref.html
-== munder-mover-align-accent-true.html munder-mover-align-accent-true-ref.html
-== munder-mover-align-accent-false.html munder-mover-align-accent-false-ref.html
-== munderover-empty-scripts.html munderover-empty-scripts-ref.html
-== mo-glyph-size.html mo-glyph-size-ref.html
-fuzzy(0-1,0-80) fuzzy-if(Android,0-255,0-105) fuzzy-if(gtkWidget,0-255,0-136) skip-if(winWidget) == multiscripts-1.html multiscripts-1-ref.html # Windows: bug 1314684; Android: bug 1392254; Linux: bug 1599638
-== mathml-mmultiscript-base.html mathml-mmultiscript-base-ref.html
-== mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html
-== mmultiscript-align.html mmultiscript-align-ref.html
-fails-if(winWidget) fuzzy-if(gtkWidget,255-255,776226-776226) == subscript-italic-correction.html subscript-italic-correction-ref.html # bug 961482 (Windows), bug 1599640 (Linux)
-
-# radicalbar*.html tests rely on reftest-zoom to verify the visibility of the
-# radical bar at different zoom levels. There does not seem to be any equivalent
-# way of testing that via WPT. See bug 1850661.
-!= radicalbar-1.html about:blank
-!= radicalbar-1a.html about:blank
-!= radicalbar-1b.html about:blank
-!= radicalbar-1c.html about:blank
-!= radicalbar-1d.html about:blank
-!= radicalbar-2.html about:blank
-!= radicalbar-2a.html about:blank
-!= radicalbar-2b.html about:blank
-!= radicalbar-2c.html about:blank
-!= radicalbar-2d.html about:blank
-!= radicalbar-3.html about:blank
-!= radicalbar-3a.html about:blank
-!= radicalbar-3b.html about:blank
-!= radicalbar-3c.html about:blank
-!= radicalbar-3d.html about:blank
diff --git a/layout/reftests/mathml/scale-stretchy-1-ref.xhtml b/layout/reftests/mathml/scale-stretchy-1-ref.xhtml
deleted file mode 100644
index e1182941c0..0000000000
--- a/layout/reftests/mathml/scale-stretchy-1-ref.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Maximal size for a vertical arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mspace height="55px" depth="55px" width="50px"
- style="background: red;"/>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-1.xhtml b/layout/reftests/mathml/scale-stretchy-1.xhtml
deleted file mode 100644
index 76f0620dfd..0000000000
--- a/layout/reftests/mathml/scale-stretchy-1.xhtml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Maximal size for a vertical arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mo style="color: blue;">&#x290B;</mo>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mspace height="55px" depth="55px" width="50px"
- style="background: red;"/>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-2-ref.xhtml b/layout/reftests/mathml/scale-stretchy-2-ref.xhtml
deleted file mode 100644
index e219fe0be6..0000000000
--- a/layout/reftests/mathml/scale-stretchy-2-ref.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Minimal size for a vertical arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mspace height="44px" depth="44px" width="50px"
- style="background: green;"/>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-2.xhtml b/layout/reftests/mathml/scale-stretchy-2.xhtml
deleted file mode 100644
index e89910586d..0000000000
--- a/layout/reftests/mathml/scale-stretchy-2.xhtml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Minimal size for a vertical arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mo style="color: blue;">&#x290B;</mo>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute;">
- <tr>
- <td><div style="height: 200px; width: 5px; background: black"/></td>
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mspace height="50px" depth="50px" width="5px"
- style="background: yellow" />
- <mspace height="44px" depth="44px" width="50px"
- style="background: green;"/>
- </mrow>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-3-ref.xhtml b/layout/reftests/mathml/scale-stretchy-3-ref.xhtml
deleted file mode 100644
index 7a671c1cad..0000000000
--- a/layout/reftests/mathml/scale-stretchy-3-ref.xhtml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Maximal size for a horizontal arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder accentunder="false">
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mspace width="110px" height="25px" depth="25px"
- style="background: red;"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-3.xhtml b/layout/reftests/mathml/scale-stretchy-3.xhtml
deleted file mode 100644
index a21b03f61d..0000000000
--- a/layout/reftests/mathml/scale-stretchy-3.xhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Maximal size for a horizontal arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder accentunder="false">
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mo style="color: blue;">&#x21DB;</mo>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder accentunder="false">
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mspace width="110px" height="25px" depth="25px"
- style="background: red;"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-4-ref.xhtml b/layout/reftests/mathml/scale-stretchy-4-ref.xhtml
deleted file mode 100644
index 87cb94d305..0000000000
--- a/layout/reftests/mathml/scale-stretchy-4-ref.xhtml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Minimal size for a horizontal arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder>
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mspace width="88px" height="25px" depth="25px"
- style="background: green;"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-4.xhtml b/layout/reftests/mathml/scale-stretchy-4.xhtml
deleted file mode 100644
index 693fdc7ed4..0000000000
--- a/layout/reftests/mathml/scale-stretchy-4.xhtml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Minimal size for a horizontal arrow stretched by scaling</title>
- </head>
-
- <body>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder>
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mo style="color: blue;">&#x21DB;</mo>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute;">
- <tr align="center">
- <td><div style="width: 200px; height: 5px; background: black"/></td>
- </tr>
- <tr align="center">
- <td>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder>
- <mspace width="100px" height="5px" style="background: yellow"/>
- <mspace width="88px" height="25px" depth="25px"
- style="background: green;"/>
- </munder>
- </math>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-5-ref.xhtml b/layout/reftests/mathml/scale-stretchy-5-ref.xhtml
deleted file mode 100644
index 8dc382e304..0000000000
--- a/layout/reftests/mathml/scale-stretchy-5-ref.xhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Largeop in display mode stretched by scaling</title>
-</head>
-
-<body>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <mo largeop="false">&#x2A0C;</mo>
-</math>
-
-</body>
-</html>
diff --git a/layout/reftests/mathml/scale-stretchy-5.xhtml b/layout/reftests/mathml/scale-stretchy-5.xhtml
deleted file mode 100644
index a79e757d73..0000000000
--- a/layout/reftests/mathml/scale-stretchy-5.xhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Largeop in display mode stretched by scaling</title>
-</head>
-
-<body>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <mo>&#x2A0C;</mo>
-</math>
-
-</body>
-</html>
diff --git a/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html b/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html
deleted file mode 100644
index bbffa910ab..0000000000
--- a/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test accent/accentunder</title></head>
- <body>
- <math displaystyle="false">
- <munderover>
- <mo>&#x2211;</mo>
- <mi>a</mi>
- <mi>b</mi>
- </munderover>
- </math>
- <math displaystyle="false">
- <munder>
- <mo>&#x2211;</mo>
- <mi>a</mi>
- </munder>
- </math>
- <math displaystyle="false">
- <mover>
- <mo>&#x2211;</mo>
- <mi>a</mi>
- </mover>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/scriptlevel-movablelimits-1.html b/layout/reftests/mathml/scriptlevel-movablelimits-1.html
deleted file mode 100644
index f3ef2e53ba..0000000000
--- a/layout/reftests/mathml/scriptlevel-movablelimits-1.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test accent/accentunder</title></head>
- <body>
- <math displaystyle="false">
- <munderover accentunder="true" accent="true">
- <mo>&#x2211;</mo>
- <mi>a</mi>
- <mi>b</mi>
- </munderover>
- </math>
- <math displaystyle="false">
- <munder accentunder="true">
- <mo>&#x2211;</mo>
- <mi>a</mi>
- </munder>
- </math>
- <math displaystyle="false">
- <mover accent="true">
- <mo>&#x2211;</mo>
- <mi>a</mi>
- </mover>
- </math>
- </body>
-</html>
diff --git a/layout/reftests/mathml/semantics-1-ref.xhtml b/layout/reftests/mathml/semantics-1-ref.xhtml
deleted file mode 100644
index f5a6d4d493..0000000000
--- a/layout/reftests/mathml/semantics-1-ref.xhtml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=utf-8" />
- <title>Various tests for semantics</title>
- <style>
- @font-face
- {
- font-family: Ahem;
- src: url(../fonts/Ahem.ttf);
- }
- math, p {
- font: 25px Ahem;
- }
- </style>
-</head>
-
-<body>
-<!-- displaystyle (bug 468059) -->
-<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <semantics>
- <mstyle displaystyle="true">
- <munderover>
- <mo movablelimits="true">pXp</mo>
- <mtext>XpXpXp</mtext>
- <mtext>XpXpXp</mtext>
- </munderover>
- </mstyle>
- </semantics>
-</math></p>
-
-<!-- unwanted whitespace (bug 512418) -->
-<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
- <mrow>
- <mrow>
- <mo>lcm</mo>
- <mo>(</mo>
- <mn>a</mn>
- <mo>,</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- <mo>=</mo>
- <mfrac>
- <mrow>
- <mo>(</mo>
- <mn>a</mn>
- <mo>&#x2062;</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- <mrow>
- <mo>gcd</mo>
- <mo>(</mo>
- <mn>a</mn>
- <mo>,</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- </mfrac>
- </mrow>
-</math>XpXpXp</p>
-
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-1.xhtml b/layout/reftests/mathml/semantics-1.xhtml
deleted file mode 100644
index d4ea92a4e5..0000000000
--- a/layout/reftests/mathml/semantics-1.xhtml
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="content-type"
- content="application/xhtml+xml; charset=utf-8" />
- <title>Various tests for semantics</title>
- <style>
- @font-face
- {
- font-family: Ahem;
- src: url(../fonts/Ahem.ttf);
- }
- math, p {
- font: 25px Ahem;
- }
-</style>
-</head>
-
-<body>
-<!-- displaystyle (bug 468059) -->
-<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
- <semantics>
- <munderover>
- <mo movablelimits="true">pXp</mo>
- <mtext>XpXpXp</mtext>
- <mtext>XpXpXp</mtext>
- </munderover>
- </semantics>
-</math></p>
-
-<!-- unwanted whitespace (bug 512418) -->
-<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
- <semantics>
- <mrow>
- <mrow>
- <mo>lcm</mo>
- <mo>(</mo>
- <mn>a</mn>
- <mo>,</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- <mo>=</mo>
- <mfrac>
- <mrow>
- <mo>(</mo>
- <mn>a</mn>
- <mo>&#x2062;</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- <mrow>
- <mo>gcd</mo>
- <mo>(</mo>
- <mn>a</mn>
- <mo>,</mo>
- <mn>b</mn>
- <mo>)</mo>
- </mrow>
- </mfrac>
- </mrow>
- </semantics>
-</math>XpXpXp</p>
-
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-2-ref.html b/layout/reftests/mathml/semantics-2-ref.html
deleted file mode 100644
index 43b52b17db..0000000000
--- a/layout/reftests/mathml/semantics-2-ref.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Various tests for semantics</title>
- <meta charset="utf-8"/>
-</head>
-
-<body>
- <p>Empty semantics: <math><mrow></mrow></math></p>
- <p>annotation: <math><mrow><annotation>annotation</annotation></mrow></math></p>
- <p>annotation-xml: <math><mrow><annotation-xml encoding="MathML-Presentation"><mtext>annotation-xml</mtext></annotation-xml></mrow></math></p>
- <p>presentation MathML (no annotations): <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
- <p>content MathML (no annotations): <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
- <p>presentation MathML ; annotation: <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
- <p>presentation MathML ; annotation-xml: <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
- <p>content MathML ; annotation: <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
- <p>content MathML ; annotation-xml: <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-2.html b/layout/reftests/mathml/semantics-2.html
deleted file mode 100644
index 2c7d99ac3d..0000000000
--- a/layout/reftests/mathml/semantics-2.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Various tests for semantics</title>
- <meta charset="utf-8"/>
-</head>
-
-<body>
- <p>Empty semantics: <math><semantics></semantics></math></p>
- <p>annotation: <math><semantics><annotation>annotation</annotation></semantics></math></p>
- <p>annotation-xml: <math><semantics><annotation-xml encoding="MathML-Presentation"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
- <p>presentation MathML (no annotations): <math><semantics><mtext>presentation MathML</mtext></semantics></math></p>
- <p>content MathML (no annotations): <math><semantics><csymbol>content MathML</csymbol></semantics></math></p>
- <p>presentation MathML ; annotation: <math><semantics><mtext>presentation MathML</mtext><annotation>annotation</annotation></semantics></math></p>
- <p>presentation MathML ; annotation-xml: <math><semantics><mtext>presentation MathML</mtext><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
- <p>content MathML ; annotation: <math><semantics><csymbol>content MathML</csymbol><annotation>annotation</annotation></semantics></math></p>
- <p>content MathML ; annotation-xml: <math><semantics><csymbol>content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-3-ref.html b/layout/reftests/mathml/semantics-3-ref.html
deleted file mode 100644
index 8d42de963c..0000000000
--- a/layout/reftests/mathml/semantics-3-ref.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Various tests for semantics</title>
- <meta charset="utf-8"/>
-</head>
-
-<body>
- <p>annotation 1: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation 2: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation 3: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
-
- <p>annotation-xml 1: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 2: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 3: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 4: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 5: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 6: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
- <p>annotation-xml 7: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-3.html b/layout/reftests/mathml/semantics-3.html
deleted file mode 100644
index 92a93c774f..0000000000
--- a/layout/reftests/mathml/semantics-3.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Various tests for semantics</title>
- <meta charset="utf-8"/>
-</head>
-
-<body>
- <p>annotation 1: <math><semantics><csymbol>Content MathML</csymbol><annotation>annotation</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
- <p>annotation 2: <math><semantics><csymbol>Content MathML</csymbol><annotation encoding="application/x-tex">\sin x + 5</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
- <p>annotation 3: <math><semantics><csymbol>Content MathML</csymbol><annotation src="external-resource">error</annotation><annotation>annotation</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
-
- <p>annotation-xml 1: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>application/mathml-presentation+xml</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 2: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="MathML-Presentation"><mtext>MathML-Presentation</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 3: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">image/svg+xml</text></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 4: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="SVG1.1"><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">SVG1.1</text></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 5: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/xhtml+xml"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>application/xhtml+xml</title></head><body><p>application/xhtml+xml</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></math></p>
- <p>annotation-xml 6: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><html><head><title>text/html</title></head><body><p>text/html</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
- <p>annotation-xml 7: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="unknown"><mtext>error</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-5-ref.html b/layout/reftests/mathml/semantics-5-ref.html
deleted file mode 100644
index 9184cdcc81..0000000000
--- a/layout/reftests/mathml/semantics-5-ref.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>semantics - embellished operator (bug 21479)</title>
- <meta charset="utf-8"/>
-</head>
-<body>
- <p>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
- <mspace width="300px" height="10px" mathbackground="black"></mspace>
- <mo>&#xaf;</mo>
- </mover>
- </math>
- </p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/semantics-5.html b/layout/reftests/mathml/semantics-5.html
deleted file mode 100644
index 0c2ad9541a..0000000000
--- a/layout/reftests/mathml/semantics-5.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>semantics - embellished operator (bug 21479)</title>
- <meta charset="utf-8"/>
-</head>
-<body>
- <p>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mover>
- <mspace width="300px" height="10px" mathbackground="black"></mspace>
- <semantics><mo>&#xaf;</mo></semantics>
- </mover>
- </math>
- </p>
-</body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-1-ref.html b/layout/reftests/mathml/stretchy-1-ref.html
deleted file mode 100644
index 23950c02fa..0000000000
--- a/layout/reftests/mathml/stretchy-1-ref.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test stretchy equal (bug 854339)</title></head>
- <body>
-
- <math>
- <munder>
- <mi>AVERYLONGBASE</mi>
- <mo stretchy="false">=</mo>
- </munder>
- </math>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-1.html b/layout/reftests/mathml/stretchy-1.html
deleted file mode 100644
index d4cfcb24f5..0000000000
--- a/layout/reftests/mathml/stretchy-1.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Test stretchy equal (bug 854339)</title></head>
- <body>
-
- <math>
- <munder>
- <mi>AVERYLONGBASE</mi>
- <mo stretchy="true">=</mo>
- </munder>
- </math>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-1-ref.html b/layout/reftests/mathml/stretchy-largeop-1-ref.html
deleted file mode 100644
index b65a38958f..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-1-ref.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8"/>
- </head>
- <body>
- <p>
- <math displaystyle="true">
- <mrow>
- <mo id="mo0">(</mo>
- <mo>∫</mo>
- <mo id="mo1">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math>
- <mrow>
- <mo id="mo0a">(</mo>
- <mo>∫</mo>
- <mo id="mo1a">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mo id="mo2">(</mo>
- <mo>&Product;</mo>
- <mo id="mo3">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math>
- <mrow>
- <mo id="mo2a">(</mo>
- <mo>&Product;</mo>
- <mo id="mo3a">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <!-- &bigotimes; included in the test to check for an assertion involving
- the direction of the largeop pre-stretch -->
- <math displaystyle="true">
- <mrow>
- <mo id="mo4">(</mo>
- <mo>&bigotimes;</mo>
- <mo id="mo5">)</mo>
- <mrow>
- </math>
- </p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-1.html b/layout/reftests/mathml/stretchy-largeop-1.html
deleted file mode 100644
index bb63c8a435..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-1.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8"/>
- <script type="text/javascript">
-
- function verifyGreaterThan(aElement, aReference) {
- /* Verify that the height of the element is greater than that of the
- reference, and otherwise paint the element in red. */
- var element = document.getElementById(aElement);
- var ref = document.getElementById(aReference);
- if (element.getBoundingClientRect().height -
- ref.getBoundingClientRect().height <= 1) {
- element.setAttribute("mathcolor", "red");
- }
- }
-
- function doTest() {
- /* Ensure that the parentheses in the displaystyle case stretch more
- than the alternative. */
- verifyGreaterThan("mo0", "mo0a");
- verifyGreaterThan("mo1", "mo1a");
- verifyGreaterThan("mo2", "mo2a");
- verifyGreaterThan("mo3", "mo3a");
-
- document.documentElement.removeAttribute("class");
-
- }
- </script>
- </head>
- <body onload="doTest();">
- <p>
- <math displaystyle="true">
- <mrow>
- <mo id="mo0">(</mo>
- <mo>∫</mo>
- <mo id="mo1">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math>
- <mrow>
- <mo id="mo0a">(</mo>
- <mo>∫</mo>
- <mo id="mo1a">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mo id="mo2">(</mo>
- <mo>&Product;</mo>
- <mo id="mo3">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <math>
- <mrow>
- <mo id="mo2a">(</mo>
- <mo>&Product;</mo>
- <mo id="mo3a">)</mo>
- <mrow>
- </math>
- </p>
- <p>
- <!-- &bigotimes; included in the test to check for an assertion involving
- the direction of the largeop pre-stretch -->
- <math displaystyle="true">
- <mrow>
- <mo id="mo4">(</mo>
- <mo>&bigotimes;</mo>
- <mo id="mo5">)</mo>
- <mrow>
- </math>
- </p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-2-ref.html b/layout/reftests/mathml/stretchy-largeop-2-ref.html
deleted file mode 100644
index d06d26527b..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-2-ref.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE html>
-<!-- Test that non-stretchy largeops are bigger in display mode -->
-
-<html>
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8"/>
- </head>
- <body>
- <p>
- <math displaystyle="true">
- <mo id="mo0">&bigodot;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo1">&bigoplus;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo2">&#x2a03;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo3">&#x2a05;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo4">&#x2a07;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo5">&#x2a08;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo6">&#x2a09;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo7">&#x2a0a;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo8">&#x2afc;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo9">&#x2aff;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef0">&bigodot;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef1">&bigoplus;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef2">&#x2a03;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef3">&#x2a05;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef4">&#x2a07;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef5">&#x2a08;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef6">&#x2a09;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef7">&#x2a0a;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef8">&#x2afc;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef9">&#x2aff;</mo>
- </math>
- </p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-2.html b/layout/reftests/mathml/stretchy-largeop-2.html
deleted file mode 100644
index c7f40580ec..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-2.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE html>
-<!-- Test that non-stretchy largeops are bigger in display mode -->
-
-<html class="reftest-wait">
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8"/>
- <script type="text/javascript">
-
- function verifyGreaterThan(aElement, aReference) {
- /* Verify that the height of the element is greater than that of the
- reference, and otherwise paint the element in red. */
- var element = document.getElementById(aElement);
- var ref = document.getElementById(aReference);
- if (element.getBoundingClientRect().height -
- ref.getBoundingClientRect().height <= 1) {
- element.setAttribute("mathcolor", "red");
- }
- }
-
- function doTest() {
- /* Ensure that largeops are bigger in displaystyle */
- var numTests = 10; // zero indexed
- var opPrefix = "mo";
- var refPrefix = "moRef";
- for (var i = 0; i < numTests; i++)
- {
- verifyGreaterThan(opPrefix + i, refPrefix + i);
- }
- document.documentElement.removeAttribute("class");
-
- }
- </script>
- </head>
- <body onload="doTest();">
- <p>
- <math displaystyle="true">
- <mo id="mo0">&bigodot;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo1">&bigoplus;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo2">&#x2a03;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo3">&#x2a05;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo4">&#x2a07;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo5">&#x2a08;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo6">&#x2a09;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo7">&#x2a0a;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo8">&#x2afc;</mo>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="mo9">&#x2aff;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef0">&bigodot;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef1">&bigoplus;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef2">&#x2a03;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef3">&#x2a05;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef4">&#x2a07;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef5">&#x2a08;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef6">&#x2a09;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef7">&#x2a0a;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef8">&#x2afc;</mo>
- </math>
- </p>
- <p>
- <math>
- <mo id="moRef9">&#x2aff;</mo>
- </math>
- </p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-3-ref.html b/layout/reftests/mathml/stretchy-largeop-3-ref.html
deleted file mode 100644
index 83837c8b30..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-3-ref.html
+++ /dev/null
@@ -1,123 +0,0 @@
-<!DOCTYPE html>
-<!-- Test that non-stretchy largeops do not stretch -->
-
-<html>
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8" />
- </head>
- <body>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo0">&bigodot;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo1">&bigoplus;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo2">&#x2a03;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo3">&#x2a05;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo4">&#x2a07;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo5">&#x2a08;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo6">&#x2a09;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo7">&#x2a0a;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo8">&#x2afc;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo9">&#x2aff;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="moRef0">&bigodot;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef1">&bigoplus;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef2">&#x2a03;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef3">&#x2a05;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef4">&#x2a07;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef5">&#x2a08;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef6">&#x2a09;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef7">&#x2a0a;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef8">&#x2afc;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef9">&#x2aff;</mo>
- </math>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/stretchy-largeop-3.html b/layout/reftests/mathml/stretchy-largeop-3.html
deleted file mode 100644
index 5fe3149894..0000000000
--- a/layout/reftests/mathml/stretchy-largeop-3.html
+++ /dev/null
@@ -1,156 +0,0 @@
-<!DOCTYPE html>
-<!-- Test that non-stretchy largeops do not stretch -->
-
-<html class="reftest-wait">
- <head>
- <title>Largeop stretching</title>
- <meta charset="utf-8" />
- <script type="text/javascript">
-
- function almostEqual(aX, aY) {
- var epsilon = 2;
- return Math.abs(aX - aY) < epsilon;
- }
-
- function verifySize(aElement, aReference) {
- /* Verify if the size of the element matches the reference, and
- otherwise paint the element in red. */
- var element = document.getElementById(aElement);
- var ref = document.getElementById(aReference);
- if (!almostEqual(element.getBoundingClientRect().height,
- ref.getBoundingClientRect().height) ||
- !almostEqual(element.getBoundingClientRect().width,
- ref.getBoundingClientRect().width)) {
- element.setAttribute("mathcolor", "red");
- }
- }
-
- function doTest() {
- /* Ensure that largeops are bigger in displaystyle */
- var numTests = 10; // zero indexed
- var opPrefix = "mo";
- var refPrefix = "moRef";
- for (var i = 0; i < numTests; i++)
- {
- verifySize(opPrefix + i, refPrefix + i);
- }
- document.documentElement.removeAttribute("class");
-
- }
- </script>
- </head>
- <body onload="doTest();">
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo0">&bigodot;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo1">&bigoplus;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo2">&#x2a03;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo3">&#x2a05;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo4">&#x2a07;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo5">&#x2a08;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo6">&#x2a09;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo7">&#x2a0a;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo8">&#x2afc;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mrow>
- <mspace height="3em" />
- <mo id="mo9">&#x2aff;</mo>
- </mrow>
- </math>
- </p>
- <p>
- <math displaystyle="true">
- <mo id="moRef0">&bigodot;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef1">&bigoplus;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef2">&#x2a03;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef3">&#x2a05;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef4">&#x2a07;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef5">&#x2a08;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef6">&#x2a09;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef7">&#x2a0a;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef8">&#x2afc;</mo>
- </math>
- <math displaystyle="true">
- <mo id="moRef9">&#x2aff;</mo>
- </math>
- </p>
- </body>
-</html>
diff --git a/layout/reftests/mathml/subscript-italic-correction-ref.html b/layout/reftests/mathml/subscript-italic-correction-ref.html
deleted file mode 100644
index a4527325cd..0000000000
--- a/layout/reftests/mathml/subscript-italic-correction-ref.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>subscript</title>
- <meta charset="utf-8"/>
- </head>
- <body style="background: #5f5; font-size: 50px;">
-
- <div>
- <math>
- <msubsup>
- <mi mathbackground="#5f5">f</mi>
- <mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
- </msubsup>
- </math>
- </div>
-
- <br/>
-
- <div>
- <math>
- <mmultiscripts>
- <mi mathbackground="#5f5">f</mi>
- <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s5" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s6" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s7" width="50px" height="50px" mathbackground="blue"/>
- </mmultiscripts>
- </math>
- </div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/subscript-italic-correction.html b/layout/reftests/mathml/subscript-italic-correction.html
deleted file mode 100644
index 04be7ba5f9..0000000000
--- a/layout/reftests/mathml/subscript-italic-correction.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
- <head>
- <title>subscript</title>
- <meta charset="utf-8"/>
- <script type="text/javascript">
- function verifyItalicCorrections()
- {
- var epsilon = 2;
- for (var i = 0; i < 8; i += 2) {
- var sub = document.getElementById("s" + i);
- var sup = document.getElementById("s" + (i+1));
- var italicCorrection =
- sup.getBoundingClientRect().left - sub.getBoundingClientRect().left;
- if (italicCorrection < epsilon) {
- return false;
- }
- }
- return true;
- }
-
- function doTest()
- {
- if (verifyItalicCorrections()) {
- document.body.style.background = "#5f5";
- }
- document.documentElement.removeAttribute("class");
- }
- window.addEventListener("MozReftestInvalidate", doTest);
- </script>
- </head>
- <body style="background: #f00; font-size: 50px;">
-
- <div>
- <math>
- <msubsup>
- <mi mathbackground="#5f5">f</mi>
- <mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
- </msubsup>
- </math>
- </div>
-
- <br/>
-
- <div>
- <math>
- <mmultiscripts>
- <mi mathbackground="#5f5">f</mi>
- <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s5" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s6" width="50px" height="50px" mathbackground="blue"/>
- <mspace id="s7" width="50px" height="50px" mathbackground="blue"/>
- </mmultiscripts>
- </math>
- </div>
-
- </body>
-</html>
diff --git a/layout/reftests/mathml/underbar-width-1-ref.xhtml b/layout/reftests/mathml/underbar-width-1-ref.xhtml
deleted file mode 100644
index 737673ccb1..0000000000
--- a/layout/reftests/mathml/underbar-width-1-ref.xhtml
+++ /dev/null
@@ -1,26 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- html { background-color: grey; }
- div { display: inline-block;
- font-size: 30px;
- line-height: 60px; /* Ensure space for underbar */
- border: 1px solid white;
- padding: 2px; /* 10% error allowed in char selection */
- background-color: black;
- color: red; }
- </style>
- </head>
-<body>
- <div>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <mphantom>
- <munder>
- <mn>1</mn>
- <mo>&#x332;</mo>
- </munder>
- </mphantom>
- </math>
- </div>
-</body>
-</html>
diff --git a/layout/reftests/mathml/underbar-width-1.xhtml b/layout/reftests/mathml/underbar-width-1.xhtml
deleted file mode 100644
index 473b25b91d..0000000000
--- a/layout/reftests/mathml/underbar-width-1.xhtml
+++ /dev/null
@@ -1,25 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Check width of stretchy OverBar</title>
- <style type="text/css">
- html { background-color: grey; }
- div { display: inline-block;
- font-size: 30px;
- line-height: 60px; /* Ensure space for underbar */
- border: 1px solid white;
- padding: 2px; /* 10% error allowed in char selection */
- background-color: black;
- color: black; }
- </style>
- </head>
-<body>
- <div>
- <math xmlns="http://www.w3.org/1998/Math/MathML">
- <munder>
- <mn>1</mn>
- <mo>&#x332;</mo>
- </munder>
- </math>
- </div>
-</body>
-</html>
diff --git a/layout/reftests/mp4-video/reftest.list b/layout/reftests/mp4-video/reftest.list
index 6462ae1820..d07ff47577 100644
--- a/layout/reftests/mp4-video/reftest.list
+++ b/layout/reftests/mp4-video/reftest.list
@@ -1,4 +1,4 @@
skip-if(winWidget) == canvas-1.xhtml canvas-1-ref.xhtml
-fuzzy-if(OSX,1-1,107584-107584) == image-rendering-css.html image-rendering-ref.html
-fuzzy-if(OSX,1-1,107584-107584) == image-rendering-script.html image-rendering-ref.html
-fuzzy-if(OSX,0-1,0-107584) != image-rendering-css.html image-rendering-css-auto.html
+fuzzy-if(cocoaWidget,1-1,107584-107584) == image-rendering-css.html image-rendering-ref.html
+fuzzy-if(cocoaWidget,1-1,107584-107584) == image-rendering-script.html image-rendering-ref.html
+fuzzy-if(cocoaWidget,0-1,0-107584) != image-rendering-css.html image-rendering-css-auto.html
diff --git a/layout/reftests/native-theme/reftest.list b/layout/reftests/native-theme/reftest.list
index 33dfbad099..d1cbd58cb2 100644
--- a/layout/reftests/native-theme/reftest.list
+++ b/layout/reftests/native-theme/reftest.list
@@ -33,7 +33,7 @@ needs-focus == listbox-nonnative-when-styled.html listbox-nonnative-when-styled-
== 492155-1.html about:blank
== 492155-2.html about:blank
== 492155-3.html about:blank
-fails-if(Android&&!asyncPan) != 492155-4.html about:blank
+!= 492155-4.html about:blank
!= box-shadow-input.html box-shadow-input-ref.html
!= box-shadow-button.html box-shadow-button-ref.html
diff --git a/layout/reftests/ogg-video/reftest.list b/layout/reftests/ogg-video/reftest.list
index fa3d68587c..2c9a96f8ee 100644
--- a/layout/reftests/ogg-video/reftest.list
+++ b/layout/reftests/ogg-video/reftest.list
@@ -6,7 +6,7 @@ fails-if(Android) skip-if(gtkWidget) == aspect-ratio-2a.xhtml aspect-ratio-2-ref
fails-if(Android) skip-if(gtkWidget) == aspect-ratio-2b.xhtml aspect-ratio-2-ref.html
== aspect-ratio-3a.xhtml aspect-ratio-3-ref.xhtml
== aspect-ratio-3b.xhtml aspect-ratio-3-ref.xhtml
-fails-if(Android) random-if(layersGPUAccelerated) == encoded-aspect-ratio-1.html encoded-aspect-ratio-1-ref.html
+fails-if(Android) random == encoded-aspect-ratio-1.html encoded-aspect-ratio-1-ref.html
fails-if(Android) == basic-1.xhtml basic-1-ref.html
== canvas-1a.xhtml basic-1-ref.html
fails-if(Android) == canvas-1b.xhtml basic-1-ref.html
diff --git a/layout/reftests/outline/reftest.list b/layout/reftests/outline/reftest.list
index 2de8cdfb3c..04931312ce 100644
--- a/layout/reftests/outline/reftest.list
+++ b/layout/reftests/outline/reftest.list
@@ -1,7 +1,7 @@
fuzzy(0-52,0-1452) == outline-and-box-shadow.html outline-and-box-shadow-ref.html
pref(layout.outline.include-overflow,true) == outline-and-3d-transform-1a.html outline-and-3d-transform-1-ref.html
pref(layout.outline.include-overflow,true) == outline-and-3d-transform-1b.html outline-and-3d-transform-1-ref.html
-fuzzy-if(gtkWidget,0-136,0-120) fuzzy-if(Android,0-255,0-356) fuzzy-if(d2d,0-16,0-96) fuzzy-if(cocoaWidget,0-255,0-120) fuzzy-if(winWidget,0-255,0-216) == outline-and-3d-transform-2.html outline-and-3d-transform-2-ref.html
+fuzzy-if(gtkWidget,0-136,0-120) fuzzy-if(Android,0-255,0-356) fuzzy-if(cocoaWidget,0-255,0-120) fuzzy-if(winWidget,0-255,0-216) == outline-and-3d-transform-2.html outline-and-3d-transform-2-ref.html
== outline-dynamic-change-1a.html outline-dynamic-change-1-ref.html
== outline-dynamic-change-1b.html outline-dynamic-change-1-ref.html
== outline-overflow-block-abspos.html outline-overflow-block-ref.html
diff --git a/layout/reftests/pagination/reftest.list b/layout/reftests/pagination/reftest.list
index 6946a3126a..a26bf56b31 100644
--- a/layout/reftests/pagination/reftest.list
+++ b/layout/reftests/pagination/reftest.list
@@ -51,11 +51,11 @@ fuzzy(0-1,0-23) == resize-reflow-001.html resize-reflow-001.ref.html
== table-page-break-after-always-1.html table-page-break-before-auto-2-ref.html
== table-page-break-after-left-1.html table-page-break-before-auto-2-ref.html
== table-page-break-after-right-1.html table-page-break-before-auto-2-ref.html
-== rowgroup-page-break-after-always-1.html table-page-break-before-auto-2-ref.html
-== row-page-break-after-always-1.html table-page-break-before-auto-2-ref.html
-== row-page-break-after-always-2.html table-page-break-before-auto-2-ref.html
-== rowgroup-thead-page-break-after-always-1.html table-page-break-before-auto-3-ref.html
-== rowgroup-tfoot-page-break-after-always-1.html table-page-break-before-auto-3-ref.html
+== rowgroup-page-break-after-always-1.html rowgroup-page-break-after-always-1-ref.html
+== row-page-break-after-always-1.html rowgroup-page-break-after-always-1-ref.html
+== row-page-break-after-always-2.html rowgroup-page-break-after-always-1-ref.html
+== rowgroup-thead-page-break-after-always-1.html rowgroup-page-break-after-always-2-ref.html
+== rowgroup-tfoot-page-break-after-always-1.html rowgroup-page-break-after-always-2-ref.html
== table-tfoot-thead-1.html table-tfoot-thead-1-ref.html
== table-caption-splitrowgroup-1.html table-caption-splitrowgroup-1-ref.html
== table-caption-splitaftercaption-1.html table-caption-splitaftercaption-1-ref.html
@@ -75,7 +75,7 @@ asserts(1-1) pref(layout.display-list.improve-fragmentation,false) == table-cell
asserts(1-1) pref(layout.display-list.improve-fragmentation,true) fails == table-cell-breaking-3b.html table-cell-breaking-3-ref.html # assert is bug 714667, fails due to bug 1681063
== column-balancing-break-inside-avoid-2.html column-balancing-break-inside-avoid-2-ref.html
fuzzy-if(Android,0-4,0-2) fuzzy-if(swgl,0-1,0-35) == combobox-page-break-inside.html combobox-page-break-inside-ref.html
-pref(layout.display-list.improve-fragmentation,false) fuzzy-if(OSX,23-23,1-1) == table-nested-1308876-1.xhtml table-nested-1308876-1-ref.html # bug 1681063
+pref(layout.display-list.improve-fragmentation,false) == table-nested-1308876-1.xhtml table-nested-1308876-1-ref.html # bug 1681063
== contain-size-break-001.html contain-size-break-001-ref.html
== contain-size-break-002.html contain-size-break-002-ref.html
== contain-size-break-003.html contain-size-break-003-ref.html
diff --git a/layout/reftests/pagination/rowgroup-page-break-after-always-1-ref.html b/layout/reftests/pagination/rowgroup-page-break-after-always-1-ref.html
new file mode 100644
index 0000000000..130833dbba
--- /dev/null
+++ b/layout/reftests/pagination/rowgroup-page-break-after-always-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-paged">
+ <style>
+ div.spacer { height: 50px; width: 50px; border: thin solid green;}
+ </style>
+
+ <table>
+ <tbody>
+ <tr><td><div class="spacer"></div></td></tr>
+ </tbody>
+ </table>
+ <div style="page-break-after: always"></div>
+ <table style="position: relative; top: -2px">
+ <tbody>
+ <tr><td><div class="spacer"></div></td></tr>
+ </tbody>
+ </table>
+</html>
diff --git a/layout/reftests/pagination/table-page-break-before-auto-3-ref.html b/layout/reftests/pagination/rowgroup-page-break-after-always-2-ref.html
index 72f5960ac2..9a47194f61 100644
--- a/layout/reftests/pagination/table-page-break-before-auto-3-ref.html
+++ b/layout/reftests/pagination/rowgroup-page-break-after-always-2-ref.html
@@ -14,7 +14,7 @@ div.spacer { height: 50px; width: 50px; border:thin solid green;}
</tbody>
</table>
<div style= "page-break-after: always"></div>
-<table>
+<table style="position: relative; top: -2px">
<thead><tr><td><div class="spacer"></div></td></tr></thead>
<tbody>
<tr><td><div class="spacer"></div></td></tr>
diff --git a/layout/reftests/pagination/table-caption-splitaftercaption-5-ref.html b/layout/reftests/pagination/table-caption-splitaftercaption-5-ref.html
index b66fef887f..c6cd61a08f 100644
--- a/layout/reftests/pagination/table-caption-splitaftercaption-5-ref.html
+++ b/layout/reftests/pagination/table-caption-splitaftercaption-5-ref.html
@@ -4,20 +4,22 @@
<head>
<style type="text/css">
div.spacer { height: 0px; width: 0px; padding: 0.2in;border:thin solid green;}
-caption {margin-top: 0.15in; margin-bottom:0.15in; caption-side:bottom}
+.caption {margin-top: 0.15in; margin-bottom:0.15in;
+ position: absolute; bottom: 0;}
table {margin-top: 0.15in; margin-bottom:0.15in}
</style>
</head>
<body>
<table cellspacing="0" cellpadding="0">
-<caption><div class="spacer"></div></caption>
<tbody>
<tr><td><div class="spacer"></div></td></tr>
</tbody>
<tfoot><tr><td><div class="spacer"></div></td></tr></tfoot>
</table>
+<div class="caption"><div class="spacer"></div></div>
+
<table cellspacing="0" cellpadding="0" style="page-break-before:always">
<tbody>
<tr><td><div class="spacer"></div></td></tr>
diff --git a/layout/reftests/pagination/table-nested-1308876-1-ref.html b/layout/reftests/pagination/table-nested-1308876-1-ref.html
index ba8cd989aa..f5521cda37 100644
--- a/layout/reftests/pagination/table-nested-1308876-1-ref.html
+++ b/layout/reftests/pagination/table-nested-1308876-1-ref.html
@@ -6,15 +6,16 @@ correct, but I'd at least like to know about it if it changes, given how
little test coverage of this we currently have.
-->
<style>
+@page { size: 5in 3in; margin: 0.5in; }
html, body { margin: 0; padding: 0; }
</style>
-<div id="page1" style="border: 2px solid black; background: yellow; height: 2in; box-sizing: border-box; padding: 3px; width: min-content">
- <div style="background: orange; height: calc(2in - 15px); padding: 3px;">
+<div id="page1" style="border: 2px solid black; border-bottom: 0; height: 2in; box-sizing: border-box; background: yellow; padding: 3px; padding-bottom: 0; width: min-content">
+ <div id="or" style="background: orange; height: calc(2in - 5px - 6px); padding: 3px;">
<div style="background: brown; color: black;padding: 1px;">A</div>
</div>
</div>
-<div id="page2" style="border: 2px solid black; background: yellow; height: 2in; box-sizing: border-box; padding: 2px 3px 3px 3px; border-bottom: none; padding-bottom: 0; width: min-content">
- <div style="background: orange; height: calc(2in - 6px); padding: 2px 3px 0 3px">
- <div style="border: 1px solid fuchsia; background: aqua; height: calc(2in - 7px); border-bottom: none; color: transparent">A</div>
+<div id="page2" style="border: solid black; border-width: 0 2px; background: yellow; height: 2in; box-sizing: border-box; padding: 0 3px; width: min-content">
+ <div style="background: orange; height: 2in; padding: 0 3px">
+ <div style="border: 1px solid fuchsia; background: aqua; height: calc(2in - 1px); border-bottom: none; color: transparent">A</div>
</div>
</div>
diff --git a/layout/reftests/pagination/table-nested-1308876-1.xhtml b/layout/reftests/pagination/table-nested-1308876-1.xhtml
index 3a804949c4..023b77429c 100644
--- a/layout/reftests/pagination/table-nested-1308876-1.xhtml
+++ b/layout/reftests/pagination/table-nested-1308876-1.xhtml
@@ -2,6 +2,10 @@
<!--
Reduced from layout/base/crashtests/470851-1.xhtml and turned into a reftest.
-->
+<style>
+@page { size: 5in 3in; margin: 0.5in; }
+html, body { margin: 0; padding: 0; }
+</style>
<table style="background: black">
<tbody>
<tr>
@@ -15,7 +19,7 @@ Reduced from layout/base/crashtests/470851-1.xhtml and turned into a reftest.
<tr><td>A</td></tr>
</tbody>
<tbody style="background: fuchsia">
- <tr><td><div style="background: aqua; line-height: 4in">A</div></td></tr>
+ <tr><td><div style="background: aqua; line-height: 4in; color: transparent">A</div></td></tr>
</tbody>
</table>
</td>
diff --git a/layout/reftests/pagination/table-tfoot-thead-1-ref.html b/layout/reftests/pagination/table-tfoot-thead-1-ref.html
index 469027d86a..9c730dea1b 100644
--- a/layout/reftests/pagination/table-tfoot-thead-1-ref.html
+++ b/layout/reftests/pagination/table-tfoot-thead-1-ref.html
@@ -18,7 +18,7 @@ thead div.spacer{height: 140px}
<tbody><tr><td><div class="spacer"></div></td></tr></tbody>
</table>
-<table cellspacing="1" cellpadding="0">
+<table cellspacing="1" cellpadding="0" style="position: relative; top: -1px">
<tbody> <tr><td><div class="spacer"></div></td></tr></tbody>
<tfoot><tr><td><div class="spacer"></div></td></tr></tfoot>
</table>
diff --git a/layout/reftests/percent-overflow-sizing/reftest.list b/layout/reftests/percent-overflow-sizing/reftest.list
index 937f0f00da..bcea88980e 100644
--- a/layout/reftests/percent-overflow-sizing/reftest.list
+++ b/layout/reftests/percent-overflow-sizing/reftest.list
@@ -1,26 +1,26 @@
== simpleHeight100.html greenbox.html
== simpleAbsHeight.html greenbox.html
-random-if(transparentScrollbars) == hScrollSimpleHeight.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-1.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-2.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-3.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsHeight.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsHeightQuirks.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeight.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-1.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-2.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-3.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsHeight.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsHeightQuirks.html greenboxhbar.html # bug 650591
== simpleHeight100D.html greenbox.html
== simpleAbsHeightD.html greenbox.html
-random-if(transparentScrollbars) == hScrollSimpleHeightD.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-1D.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-2D.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleHeightQuirks-3D.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsHeightD.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsHeightQuirksD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-1D.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-2D.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleHeightQuirks-3D.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsHeightD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsHeightQuirksD.html greenboxhbar.html # bug 650591
== simpleMinHeight100D.html greenbox.html
== simpleAbsMinHeightD.html greenbox.html
-random-if(transparentScrollbars) == hScrollSimpleMinHeightD.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleMinHeightQuirks-1D.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollSimpleMinHeightQuirks-3D.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsMinHeightD.html greenboxhbar.html # bug 650591
-random-if(transparentScrollbars) == hScrollAbsMinHeightQuirksD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleMinHeightD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleMinHeightQuirks-1D.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollSimpleMinHeightQuirks-3D.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsMinHeightD.html greenboxhbar.html # bug 650591
+random-if(gtkWidget) == hScrollAbsMinHeightQuirksD.html greenboxhbar.html # bug 650591
== dynamicHeight100.html dynamicHeight100-ref.html
== nestedHeight.html nestedHeight-ref.html
== nestedHeightQuirks.html nestedHeightQuirks-ref.html
diff --git a/layout/reftests/position-dynamic-changes/reftest.list b/layout/reftests/position-dynamic-changes/reftest.list
index 8392f8cff2..66fdbd0e13 100644
--- a/layout/reftests/position-dynamic-changes/reftest.list
+++ b/layout/reftests/position-dynamic-changes/reftest.list
@@ -7,4 +7,4 @@ include relative/reftest.list
== multiple-changes.html multiple-changes-ref.html
== shrink-wrap.html shrink-wrap-ref.html
== max-width.html max-width-ref.html
-fuzzy-if(cocoaWidget&&layersGPUAccelerated,0-1,0-2) == min-width.html min-width-ref.html # Bug 761770
+fuzzy-if(cocoaWidget,0-1,0-2) == min-width.html min-width-ref.html # Bug 761770
diff --git a/layout/reftests/position-dynamic-changes/relative/reftest.list b/layout/reftests/position-dynamic-changes/relative/reftest.list
index 320fad98b2..cca518eb05 100644
--- a/layout/reftests/position-dynamic-changes/relative/reftest.list
+++ b/layout/reftests/position-dynamic-changes/relative/reftest.list
@@ -1,5 +1,5 @@
-fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(d2d,0-47,0-26) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-169,0-970) == move-right-bottom.html move-right-bottom-ref.html
-fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-169,0-970) == move-top-left.html move-top-left-ref.html # Bug 688545
-fuzzy-if(cocoaWidget,0-1,0-3) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-144,0-580) == move-right-bottom-table.html move-right-bottom-table-ref.html
-fuzzy-if(cocoaWidget,0-1,0-3) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-144,0-580) == move-top-left-table.html move-top-left-table-ref.html # Bug 688545
+fuzzy-if(cocoaWidget,0-1,0-2) fuzzy-if(winWidget,0-47,0-26) == move-right-bottom.html move-right-bottom-ref.html
+fuzzy-if(cocoaWidget,0-1,0-2) == move-top-left.html move-top-left-ref.html # Bug 688545
+fuzzy-if(cocoaWidget,0-1,0-3) == move-right-bottom-table.html move-right-bottom-table-ref.html
+fuzzy-if(cocoaWidget,0-1,0-3) == move-top-left-table.html move-top-left-table-ref.html # Bug 688545
== percent.html percent-ref.html
diff --git a/layout/reftests/position-sticky/reftest.list b/layout/reftests/position-sticky/reftest.list
index cd47d90a45..bd9aadc1d0 100644
--- a/layout/reftests/position-sticky/reftest.list
+++ b/layout/reftests/position-sticky/reftest.list
@@ -39,17 +39,17 @@ fuzzy-if(Android,0-4,0-810) == containing-block-1.html containing-block-1-ref.ht
== overconstrained-3.html overconstrained-3-ref.html
== inline-1.html inline-1-ref.html
== inline-2.html inline-2-ref.html
-fuzzy-if(OSX,0-99,0-210) == inline-3.html inline-3-ref.html
-skip-if(!asyncPan) fuzzy-if(swgl&&!Android,0-1,0-3) fails-if(useDrawSnapshot) == inline-4.html inline-4-ref.html
+fuzzy-if(cocoaWidget,0-99,0-210) == inline-3.html inline-3-ref.html
+skip-if(useDrawSnapshot) fuzzy-if(swgl&&!Android,0-1,0-3) fails-if(useDrawSnapshot) == inline-4.html inline-4-ref.html
== column-contain-1a.html column-contain-1-ref.html
== column-contain-1b.html column-contain-1-ref.html
== column-contain-2.html column-contain-2-ref.html
== block-in-inline-1.html block-in-inline-1-ref.html
-fuzzy(0-1,0-22) fuzzy-if(winWidget&&!layersGPUAccelerated,0-116,0-1320) fuzzy-if(Android,0-8,0-1533) == block-in-inline-2.html block-in-inline-2-ref.html
-fuzzy(0-1,0-220) fuzzy-if(winWidget&&!layersGPUAccelerated,0-116,0-1320) == block-in-inline-3.html block-in-inline-3-ref.html
+fuzzy(0-1,0-22) fuzzy-if(Android,0-8,0-1533) == block-in-inline-2.html block-in-inline-2-ref.html
+fuzzy(0-1,0-220) == block-in-inline-3.html block-in-inline-3-ref.html
== block-in-inline-continuations.html block-in-inline-continuations-ref.html
== iframe-1.html iframe-1-ref.html
== transformed-1.html transformed-1-ref.html
-fuzzy-if(Android,0-8,0-9) fuzzy-if(gtkWidget,10-17,12-32) fuzzy-if(cocoaWidget,7-8,18-42) skip-if(!asyncPan) fails-if(useDrawSnapshot) == transformed-2.html transformed-2-ref.html # Bug 1604644
-skip-if(!asyncPan) fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,19-30,12-32) fuzzy-if(cocoaWidget,13-16,20-44) fails-if(useDrawSnapshot) == nested-sticky-1.html nested-sticky-1-ref.html # Bug 1604644
-skip-if(!asyncPan) fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,19-30,12-32) fuzzy-if(cocoaWidget,13-16,20-44) fails-if(useDrawSnapshot) == nested-sticky-2.html nested-sticky-2-ref.html # Bug 1604644
+fuzzy-if(Android,0-8,0-9) fuzzy-if(gtkWidget,10-17,12-32) fuzzy-if(cocoaWidget,7-8,18-42) skip-if(useDrawSnapshot) fails-if(useDrawSnapshot) == transformed-2.html transformed-2-ref.html # Bug 1604644
+skip-if(useDrawSnapshot) fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,19-30,12-32) fuzzy-if(cocoaWidget,13-16,20-44) fails-if(useDrawSnapshot) == nested-sticky-1.html nested-sticky-1-ref.html # Bug 1604644
+skip-if(useDrawSnapshot) fuzzy-if(Android,0-14,0-11) fuzzy-if(gtkWidget,19-30,12-32) fuzzy-if(cocoaWidget,13-16,20-44) fails-if(useDrawSnapshot) == nested-sticky-2.html nested-sticky-2-ref.html # Bug 1604644
diff --git a/layout/reftests/reftest-sanity/reftest.list b/layout/reftests/reftest-sanity/reftest.list
index 1aa272d6e2..52b6982aac 100644
--- a/layout/reftests/reftest-sanity/reftest.list
+++ b/layout/reftests/reftest-sanity/reftest.list
@@ -93,16 +93,16 @@ fails == data:text/plain,HELLO about:blank
needs-focus == data:text/plain, about:blank
# Sanity check of viewport+displayport overrides
-pref(dom.meta-viewport.enabled,true) skip-if(!browserIsRemote) fails-if(useDrawSnapshot) != test-displayport-2.html test-displayport-ref.html # bug 593168
-skip-if(!browserIsRemote) fails-if(OSX&&layersGPUAccelerated) fuzzy-if(layersOMTC,0-1,0-1390) random-if(Android) random-if(transparentScrollbars) == 647192-1.html 647192-1-ref.html
-skip-if(!browserIsRemote) == 656041-1.html 656041-1-ref.html
-pref(dom.meta-viewport.enabled,true) skip-if(!browserIsRemote||layersOMTC) == test-displayport-bg.html test-displayport-ref.html # bug 694706
+pref(dom.meta-viewport.enabled,true) fails-if(useDrawSnapshot) != test-displayport-2.html test-displayport-ref.html # bug 593168
+fails-if(cocoaWidget) fuzzy(0-1,0-1390) random-if(Android) random-if(gtkWidget) == 647192-1.html 647192-1-ref.html
+== 656041-1.html 656041-1-ref.html
+pref(dom.meta-viewport.enabled,true) skip == test-displayport-bg.html test-displayport-ref.html # bug 694706
# IPC Position-fixed frames/layers test
# Fixed layers are temporarily disabled (bug 656167).
-#pref(dom.meta-viewport.enabled,true) skip-if(!browserIsRemote) == test-pos-fixed.html test-pos-fixed-ref.html
-#pref(dom.meta-viewport.enabled,true) skip-if(!browserIsRemote) == test-bg-attachment-fixed.html test-bg-attachment-fixed-ref.html
-pref(dom.meta-viewport.enabled,true) skip-if(!browserIsRemote) == test-pos-fixed-transform.html test-pos-fixed-transform-ref.html
+#pref(dom.meta-viewport.enabled,true) == test-pos-fixed.html test-pos-fixed-ref.html
+#pref(dom.meta-viewport.enabled,true) == test-bg-attachment-fixed.html test-bg-attachment-fixed-ref.html
+pref(dom.meta-viewport.enabled,true) == test-pos-fixed-transform.html test-pos-fixed-transform-ref.html
# reftest syntax: require-or
require-or(unrecognizedCondition,skip) script scripttest-fail.html
@@ -171,11 +171,11 @@ noautofuzz fails fuzzy-if(false,0-2,0-1) == fuzzy.html fuzzy-ref.html
# Test that reftest-no-paint fails correctly.
== reftest-no-paint.html reftest-no-paint-ref.html
-skip-if(!asyncPan||!browserIsRemote) == async-scroll-1a.html async-scroll-1-ref.html
+skip-if(useDrawSnapshot) == async-scroll-1a.html async-scroll-1-ref.html
-skip-if(!asyncPan||!browserIsRemote) != async-scroll-1b.html async-scroll-1-ref.html
+skip-if(useDrawSnapshot) != async-scroll-1b.html async-scroll-1-ref.html
-skip-if(!asyncPan||!browserIsRemote) == async-scroll-1c.html async-scroll-1-ref.html
+skip-if(useDrawSnapshot) == async-scroll-1c.html async-scroll-1-ref.html
skip-if(!Android) pref(apz.allow_zooming,true) != async-zoom-1.html async-zoom-1-ref.html
fuzzy(0-112,0-800) skip-if(!Android) pref(apz.allow_zooming,true) == async-zoom-2.html async-zoom-2-ref.html
diff --git a/layout/reftests/reftest.list b/layout/reftests/reftest.list
index 5fc3ebc76a..9587c70798 100644
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -252,9 +252,6 @@ include line-breaking/reftest.list
# list-item/
include list-item/reftest.list
-# mathml/
-include mathml/reftest.list
-
# margin-collapsing
include margin-collapsing/reftest.list
@@ -277,13 +274,13 @@ include outline/reftest.list
include object/reftest.list
# ogg-video/
-skip-if(browserIsRemote) include ogg-video/reftest.list
+skip include ogg-video/reftest.list
# webm-video/
-skip-if(browserIsRemote) include webm-video/reftest.list
+skip include webm-video/reftest.list
# mp4-video/
-skip-if(browserIsRemote) include mp4-video/reftest.list
+skip include mp4-video/reftest.list
# parser/
include ../../parser/htmlparser/tests/reftest/reftest.list
@@ -372,8 +369,7 @@ include ../../toolkit/themes/osx/reftests/reftest.list
include ../../toolkit/content/tests/reftests/reftest.list
# transform/
-# skipping on non-e10s windows because of assertion in bug 1401228
-skip-if(winWidget&&!browserIsRemote) include transform/reftest.list
+include transform/reftest.list
# 3d transforms
include transform-3d/reftest.list
diff --git a/layout/reftests/scrolling/reftest.list b/layout/reftests/scrolling/reftest.list
index f631654250..159f480416 100644
--- a/layout/reftests/scrolling/reftest.list
+++ b/layout/reftests/scrolling/reftest.list
@@ -1,12 +1,12 @@
HTTP == deferred-anchor.xhtml#d deferred-anchor-ref.xhtml#d
-fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-23) fails-if(useDrawSnapshot) == deferred-anchor2.xhtml deferred-anchor-ref.xhtml#d # bug 1182632
+fuzzy-if(gtkWidget,0-1,0-23) fails-if(useDrawSnapshot) == deferred-anchor2.xhtml deferred-anchor-ref.xhtml#d # bug 1182632
HTTP == fixed-1.html fixed-1.html?ref
fuzzy(0-1,0-32200) HTTP == fixed-table-1.html fixed-table-1.html?ref
HTTP == fixed-opacity-1.html fixed-opacity-1.html?ref
HTTP == fixed-opacity-2.html fixed-opacity-2.html?ref
random-if(gtkWidget) fuzzy-if(Android,0-3,0-60) HTTP == fixed-text-1.html fixed-text-1.html?ref
HTTP == fixed-text-2.html fixed-text-2.html?ref
-random-if(Android) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-12) fuzzy-if(winWidget,0-1,0-31) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
+random-if(Android) fuzzy-if(winWidget,0-1,0-12) fuzzy-if(winWidget,0-1,0-31) == iframe-border-radius.html iframe-border-radius-ref.html # bug 760269
random-if(Android) HTTP == image-1.html image-1.html?ref
random-if(Android) HTTP == opacity-mixed-scrolling-1.html opacity-mixed-scrolling-1.html?ref # bug 760269
random-if(cocoaWidget) HTTP == opacity-mixed-scrolling-2.html opacity-mixed-scrolling-2.html?ref # see bug 625357
@@ -31,13 +31,13 @@ fuzzy(0-1,0-42) HTTP == transformed-1.html transformed-1.html?ref
fuzzy(0-1,0-43) HTTP == transformed-1.html?up transformed-1.html?ref
fuzzy-if(Android,0-5,0-20000) == uncovering-1.html uncovering-1-ref.html
fuzzy-if(Android,0-5,0-20000) == uncovering-2.html uncovering-2-ref.html
-fuzzy-if(asyncPan&&!layersGPUAccelerated,0-149,0-4520) == less-than-scrollbar-height.html less-than-scrollbar-height-ref.html
+== less-than-scrollbar-height.html less-than-scrollbar-height-ref.html
== huge-horizontal-overflow.html huge-horizontal-overflow-ref.html
== huge-vertical-overflow.html huge-vertical-overflow-ref.html
-pref(apz.allow_zooming,true) fuzzy-if(gtkWidget,0-1,0-80) fuzzy-if(winWidget,0-4,0-170) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-6818) fuzzy-if(winWidget&&browserIsFission,0-96,0-1109) == iframe-scrolling-attr-1.html iframe-scrolling-attr-ref.html # fission: Bug 1717856
-pref(apz.allow_zooming,true) fuzzy-if(gtkWidget,0-1,0-80) fuzzy-if(winWidget,0-4,0-170) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-140,0-6818) fuzzy-if(winWidget&&browserIsFission,0-96,0-1109) == iframe-scrolling-attr-2.html iframe-scrolling-attr-ref.html # fission: Bug 1717856
+pref(apz.allow_zooming,true) fuzzy-if(gtkWidget,0-1,0-80) fuzzy-if(winWidget,0-4,0-170) fuzzy-if(winWidget&&fission,0-96,0-1109) == iframe-scrolling-attr-1.html iframe-scrolling-attr-ref.html # fission: Bug 1717856
+pref(apz.allow_zooming,true) fuzzy-if(gtkWidget,0-1,0-80) fuzzy-if(winWidget,0-4,0-170) fuzzy-if(winWidget&&fission,0-96,0-1109) == iframe-scrolling-attr-2.html iframe-scrolling-attr-ref.html # fission: Bug 1717856
pref(apz.allow_zooming,true) fuzzy(0-1,0-2) fuzzy-if(geckoview,0-1,0-15) fuzzy-if(gtkWidget,0-1,0-48) fuzzy-if(winWidget,0-4,0-108) fuzzy-if(winWidget&&fission,0-92,0-1280) == frame-scrolling-attr-1.html frame-scrolling-attr-ref.html
-pref(apz.allow_zooming,true) fuzzy(0-1,0-2) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-102,0-2420) fuzzy-if(geckoview,0-1,0-88) fuzzy-if(gtkWidget,0-1,0-48) fuzzy-if(winWidget,0-4,0-108) fuzzy-if(winWidget&&fission,0-92,0-1920) == frame-scrolling-attr-2.html frame-scrolling-attr-ref.html
+pref(apz.allow_zooming,true) fuzzy(0-1,0-2) fuzzy-if(geckoview,0-1,0-88) fuzzy-if(gtkWidget,0-1,0-48) fuzzy-if(winWidget,0-4,0-108) fuzzy-if(winWidget&&fission,0-92,0-1920) == frame-scrolling-attr-2.html frame-scrolling-attr-ref.html
== move-item.html move-item-ref.html # bug 1125750
== fractional-scroll-area.html?top=-0.4&outerBottom=100&innerBottom=200 fractional-scroll-area.html?top=0&outerBottom=100&innerBottom=200
== fractional-scroll-area.html?top=0.4&outerBottom=100&innerBottom=200 fractional-scroll-area.html?top=0&outerBottom=100&innerBottom=200
diff --git a/layout/reftests/selection/reftest.list b/layout/reftests/selection/reftest.list
index a7d9ba1739..a807c345da 100644
--- a/layout/reftests/selection/reftest.list
+++ b/layout/reftests/selection/reftest.list
@@ -34,7 +34,7 @@ fuzzy(0-1,0-1200) == addrange-2.html addrange-ref.html
== splitText-normalize.html splitText-normalize-ref.html
== modify-range.html modify-range-ref.html
== dom-mutations.html dom-mutations-ref.html
-fuzzy-if(!OSX,0-1,0-2138) == trailing-space-1.html trailing-space-1-ref.html
+fuzzy-if(!cocoaWidget,0-1,0-2138) == trailing-space-1.html trailing-space-1-ref.html
!= invalidation-1-ref.html invalidation-2-ref.html
== invalidation-1a.html invalidation-1-ref.html
== invalidation-1b.html invalidation-1-ref.html
@@ -50,7 +50,7 @@ fuzzy-if(!OSX,0-1,0-2138) == trailing-space-1.html trailing-space-1-ref.html
== invalidation-2f.html invalidation-2-ref.html
fuzzy(0-7,0-4) needs-focus == rtl-selection-with-decoration.html rtl-selection-with-decoration-ref.html
needs-focus == semitransparent-decoration-line.html semitransparent-decoration-line-ref.html
-fuzzy-if(OSX,0-1,0-6) fuzzy-if(Android,0-188,0-39) needs-focus == writing-mode.html writing-mode-ref.html
+fuzzy-if(cocoaWidget,0-1,0-6) fuzzy-if(Android,0-188,0-39) needs-focus == writing-mode.html writing-mode-ref.html
needs-focus fuzzy(0-5,0-1) == 1478604.html 1478604-ref.html # !webrender: Seems like an antialiasing+invalidation issue.
needs-focus fuzzy(0-3,0-13) == disabled-1.html disabled-1-ref.html
diff --git a/layout/reftests/svg/as-image/reftest.list b/layout/reftests/svg/as-image/reftest.list
index fe56ae0489..6349a94e88 100644
--- a/layout/reftests/svg/as-image/reftest.list
+++ b/layout/reftests/svg/as-image/reftest.list
@@ -36,12 +36,12 @@ fails-if(useDrawSnapshot) == background-scale-with-viewbox-1.html background-sca
== canvas-drawImage-scale-1b.html lime100x100-ref.html
== canvas-drawImage-scale-1c.html lime100x100-ref.html
-fuzzy(0-192,0-2112) == canvas-drawImage-scale-2a.html canvas-drawImage-scale-2-ref.html
-fuzzy(0-192,0-2112) == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html
+fuzzy(0-192,0-2151) == canvas-drawImage-scale-2a.html canvas-drawImage-scale-2-ref.html
+fuzzy(0-192,0-2151) == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html
-fuzzy-if(winWidget,0-1,0-10000) fuzzy-if(azureSkia,0-1,0-10000) fuzzy-if(Android,0-1,0-10000) == canvas-drawImage-alpha-1.html canvas-drawImage-alpha-1-ref.html
+fuzzy(0-1,0-10000) == canvas-drawImage-alpha-1.html canvas-drawImage-alpha-1-ref.html
#Same as scale-2a but with globalAlpha:
-fuzzy(0-1,0-2) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-40000) fuzzy-if(azureSkia,0-1,0-40000) fuzzy-if(winWidget&&!remoteCanvas,0-1,0-39900) fuzzy-if(remoteCanvas&&!swgl,1-73,600-40000) fuzzy-if(Android&&device,0-48,0-39989) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
+fuzzy(0-1,0-40000) fuzzy-if(winWidget&&!swgl,1-73,600-40000) fuzzy-if(Android&&device,0-48,0-39989) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
== canvas-drawImage-slice-1a.html lime100x100-ref.html
== canvas-drawImage-slice-1b.html lime100x100-ref.html
@@ -107,7 +107,7 @@ random == img-and-image-1.html img-and-image-1-ref.svg # bug 645267
# More complex <img> tests
== img-blobURI-1.html lime100x100-ref.html
skip == img-blobURI-2.html lime100x100-ref.html
-fuzzy-if(d2d,0-16,0-10) == img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html # d2d is bug 1074161
+fuzzy-if(winWidget,0-16,0-10) == img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html # winWidget is bug 1074161
== img-display-none-1.html about:blank
== img-dyn-1.html img-dyn-1-ref.html
== img-foreignObject-1.html lime100x100-ref.html
@@ -169,10 +169,10 @@ fuzzy(0-255,0-10) == img-novb-width-slice-1.html img-novb-width-all-1-ref.html
== svg-image-simple-3.svg lime100x100.svg
# tests for <svg> files that include themselves as an <image>
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-1) == svg-image-recursive-1a.svg svg-image-recursive-1-ref.svg
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-1) == svg-image-recursive-1b.svg svg-image-recursive-1-ref.svg
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-1) == svg-image-recursive-2a.svg svg-image-recursive-2-ref.svg
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-1) == svg-image-recursive-2b.html svg-image-recursive-2-ref.svg
+fuzzy-if(winWidget,0-1,0-1) == svg-image-recursive-1a.svg svg-image-recursive-1-ref.svg
+fuzzy-if(winWidget,0-1,0-1) == svg-image-recursive-1b.svg svg-image-recursive-1-ref.svg
+fuzzy-if(winWidget,0-1,0-1) == svg-image-recursive-2a.svg svg-image-recursive-2-ref.svg
+fuzzy-if(winWidget,0-1,0-1) == svg-image-recursive-2b.html svg-image-recursive-2-ref.svg
# tests for external resources vs. data URIs in SVG as an image
== svg-image-datauri-1.html lime100x100.svg
diff --git a/layout/reftests/svg/filters/css-filters/reftest.list b/layout/reftests/svg/filters/css-filters/reftest.list
index f204de98cd..3d659e0072 100644
--- a/layout/reftests/svg/filters/css-filters/reftest.list
+++ b/layout/reftests/svg/filters/css-filters/reftest.list
@@ -5,7 +5,7 @@
== blur.svg blur-ref.svg
== blur-calc.html blur-calc-ref.html
== blur-calc-negative.html blur-calc-negative-ref.html
-fuzzy-if(cocoaWidget,0-1,0-2) skip-if(d2d) == blur-cap-large-radius-on-software.html blur-cap-large-radius-on-software-ref.html
+fuzzy-if(cocoaWidget,0-1,0-2) skip-if(winWidget) == blur-cap-large-radius-on-software.html blur-cap-large-radius-on-software-ref.html
fuzzy-if(!useDrawSnapshot,2-5,4764-8168) fuzzy-if(Android&&device&&!swgl,5-5,8574-8574) == blur-clip-rect.html ../feGaussianBlur-4-ref.svg
== blur-em-radius.html blur-em-radius-ref.html
== blur-invalid-radius.html blur-invalid-radius-ref.html
@@ -30,42 +30,42 @@ fails-if(useDrawSnapshot) == blur-zoomed-page.html blur-zoomed-page-ref.html
== drop-shadow-negative-offset.html drop-shadow-negative-offset-ref.html
== filter-on-huge-bbox.html pass.svg
fuzzy(0-1,0-44) fuzzy-if(winWidget,0-1,0-198) == filter-on-outer-svg.html pass.svg
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == grayscale.html grayscale-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == grayscale-one.html grayscale-one-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == grayscale-over-one.html grayscale-over-one-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == grayscale-percent.html grayscale-percent-ref.html
+fuzzy(0-1,0-10000) == grayscale.html grayscale-ref.html
+fuzzy(0-1,0-10000) == grayscale-one.html grayscale-one-ref.html
+fuzzy(0-1,0-10000) == grayscale-over-one.html grayscale-over-one-ref.html
+fuzzy(0-1,0-10000) == grayscale-percent.html grayscale-percent-ref.html
fuzzy(0-1,0-10000) == grayscale-zero.html grayscale-zero-ref.html
== hue-rotate.html hue-rotate-ref.html
== hue-rotate-360.html hue-rotate-360-ref.html
== hue-rotate-grad.html hue-rotate-grad-ref.html
-fuzzy-if(!useDrawSnapshot&&!geckoview,2-2,7500-7500) fuzzy-if(d2d,0-2,0-7500) == hue-rotate-multichannel.html hue-rotate-multichannel-ref.html
+fuzzy-if(!useDrawSnapshot&&!geckoview,2-2,7500-7500) fuzzy-if(winWidget,0-2,0-7500) == hue-rotate-multichannel.html hue-rotate-multichannel-ref.html
== hue-rotate-negative.html hue-rotate-negative-ref.html
== hue-rotate-over-360.html hue-rotate-over-360-ref.html
== hue-rotate-rad.html hue-rotate-rad-ref.html
== hue-rotate-turn.html hue-rotate-turn-ref.html
== hue-rotate-zero.html hue-rotate-zero-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == invert.html invert-ref.html
+fuzzy(0-1,0-10000) == invert.html invert-ref.html
fuzzy(0-1,0-10000) == invert-half.html invert-half-ref.html
== invert-one.html invert-one-ref.html
== invert-over-one.html invert-over-one-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == invert-percent.html invert-percent-ref.html
+fuzzy(0-1,0-10000) == invert-percent.html invert-percent-ref.html
== invert-zero.html invert-zero-ref.html
-fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(d2d,0-1,0-10000) == opacity.html opacity-ref.html
+fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(winWidget,0-1,0-10000) == opacity.html opacity-ref.html
== opacity-one.html opacity-one-ref.html
== opacity-over-one.html opacity-over-one-ref.html
fuzzy(0-1,0-10000) == opacity-over-one-translucent-source.html opacity-over-one-translucent-source-ref.html
-fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(d2d,0-1,0-10000) == opacity-percent.html opacity-percent-ref.html
+fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(winWidget,0-1,0-10000) == opacity-percent.html opacity-percent-ref.html
== opacity-zero.html opacity-zero-ref.html
== saturate.html saturate-ref.html
-fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(d2d,0-1,0-10000) == saturate-desaturate.html saturate-desaturate-ref.html
+fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(winWidget,0-1,0-10000) == saturate-desaturate.html saturate-desaturate-ref.html
== saturate-extreme.html saturate-extreme-ref.html
== saturate-one.html saturate-one-ref.html
== saturate-percent.html saturate-percent-ref.html
-fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(d2d,0-1,0-10000) == saturate-zero.html saturate-zero-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == sepia.html sepia-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == sepia-one.html sepia-one-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == sepia-over-one.html sepia-over-one-ref.html
-fuzzy(0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == sepia-percent.html sepia-percent-ref.html
+fuzzy-if(!useDrawSnapshot&&!geckoview,1-1,10000-10000) fuzzy-if(winWidget,0-1,0-10000) == saturate-zero.html saturate-zero-ref.html
+fuzzy(0-1,0-10000) == sepia.html sepia-ref.html
+fuzzy(0-1,0-10000) == sepia-one.html sepia-one-ref.html
+fuzzy(0-1,0-10000) == sepia-over-one.html sepia-over-one-ref.html
+fuzzy(0-1,0-10000) == sepia-percent.html sepia-percent-ref.html
== sepia-zero.html sepia-zero-ref.html
fuzzy(0-2,0-125000) == scale-filtered-content-01.html scale-filtered-content-01-ref.html
diff --git a/layout/reftests/svg/filters/reftest.list b/layout/reftests/svg/filters/reftest.list
index 9975eb190d..f6b43420a5 100644
--- a/layout/reftests/svg/filters/reftest.list
+++ b/layout/reftests/svg/filters/reftest.list
@@ -39,7 +39,7 @@ fuzzy(0-1,0-10000) == feComposite-2.svg feComposite-2-ref.svg
== feDisplacementMap-2.svg feDisplacementMap-2-ref.svg
fuzzy(0-1,0-1600) == feFlood-1.svg feFlood-1-ref.svg
-skip-if(d2d) fuzzy(0-1,0-6400) == feFlood-2.svg feFlood-2-ref.svg
+skip-if(winWidget) fuzzy(0-1,0-6400) == feFlood-2.svg feFlood-2-ref.svg
fuzzy(0-2,0-6404) fuzzy-if(Android&&device&&!swgl,6-6,6400-6400) == feGaussianBlur-1.svg feGaussianBlur-1-ref.svg
fuzzy(0-2,0-304) == feGaussianBlur-2.svg feGaussianBlur-2-ref.svg
@@ -47,7 +47,7 @@ fuzzy(0-2,0-304) == feGaussianBlur-2.svg feGaussianBlur-2-ref.svg
fuzzy-if(!useDrawSnapshot,2-5,4764-8168) fuzzy-if(Android&&device&&!swgl,5-5,8574-8574) == feGaussianBlur-4.svg feGaussianBlur-4-ref.svg
fuzzy-if(geckoview,0-4,0-200) == feGaussianBlur-5.svg feGaussianBlur-5-ref.svg
== feGaussianBlur-6.svg feGaussianBlur-6-ref.svg
-skip-if(d2d) == feGaussianBlur-cap-large-directional-radius-on-software.html feGaussianBlur-cap-large-directional-radius-on-software-ref.html
+skip-if(winWidget) == feGaussianBlur-cap-large-directional-radius-on-software.html feGaussianBlur-cap-large-directional-radius-on-software-ref.html
!= feImage-1.svg about:blank # (Make sure our image renders at all)
== feImage-1.svg feImage-1-ref.svg
@@ -107,7 +107,7 @@ fuzzy(0-1,0-400) == feDisplacementMap-alpha-01.svg pass.svg
fuzzy(0-2,0-500) == feDisplacementMap-colour-01.svg feDisplacementMap-colour-01-ref.svg
== feDisplacementMap-scale-01.svg pass.svg
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-2,0-25) fuzzy-if(!useDrawSnapshot,55-98,14033-16467) == feDropShadow-01.svg feDropShadow-01-ref.svg
+fuzzy-if(winWidget,0-2,0-25) fuzzy-if(!useDrawSnapshot,55-98,14033-16467) == feDropShadow-01.svg feDropShadow-01-ref.svg
== feFlood-color-01.svg pass.svg
@@ -124,7 +124,7 @@ fuzzy-if(!useDrawSnapshot||(winWidget&&isCoverageBuild),20-21,5540-5647) == feGa
fuzzy(0-1,0-219) == feDiffuseLighting-1.svg feDiffuseLighting-1-ref.svg
-fuzzy(0-2,0-2659) skip-if(d2d) == feSpecularLighting-1.svg feSpecularLighting-1-ref.svg
+fuzzy(0-2,0-2659) skip-if(winWidget) == feSpecularLighting-1.svg feSpecularLighting-1-ref.svg
== filter-lighting-region.svg filter-lighting-region-ref.svg
diff --git a/layout/reftests/svg/filters/svg-filter-chains/reftest.list b/layout/reftests/svg/filters/svg-filter-chains/reftest.list
index 12ddf9d8bb..7076e70f25 100644
--- a/layout/reftests/svg/filters/svg-filter-chains/reftest.list
+++ b/layout/reftests/svg/filters/svg-filter-chains/reftest.list
@@ -11,6 +11,6 @@ fuzzy(0-5,0-20300) fuzzy-if(Android&&device&&!swgl,5-5,21751-21751) == default-s
== intersecting-filter-regions.svg intersecting-filter-regions-ref.svg
fuzzy-if(!useDrawSnapshot,9-9,5168-5536) fuzzy-if(!useDrawSnapshot&&swgl,7-7,13170-13184) fuzzy-if(Android&&device&&!swgl,8-8,12391-12391) == long-chain.svg simple-chain-ref.svg
fuzzy-if(!useDrawSnapshot,9-9,5168-5536) fuzzy-if(!useDrawSnapshot&&swgl,7-7,13170-13184) fuzzy-if(Android&&device&&!swgl,8-8,12391-12391) == multiple-primitives-per-filter.svg simple-chain-ref.svg
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-173) fuzzy-if(!useDrawSnapshot||(winWidget&&isCoverageBuild),9-9,5128-5496) fuzzy-if(!useDrawSnapshot&&swgl,7-7,12820-12830) fuzzy-if(Android&&device&&!swgl,8-8,12355-12355) == second-filter-uses-SourceAlpha.svg second-filter-uses-SourceAlpha-ref.svg
+fuzzy-if(winWidget,0-1,0-173) fuzzy-if(!useDrawSnapshot||(winWidget&&isCoverageBuild),9-9,5128-5496) fuzzy-if(!useDrawSnapshot&&swgl,7-7,12820-12830) fuzzy-if(Android&&device&&!swgl,8-8,12355-12355) == second-filter-uses-SourceAlpha.svg second-filter-uses-SourceAlpha-ref.svg
fuzzy-if(!useDrawSnapshot,9-9,5168-5536) fuzzy-if(!useDrawSnapshot&&swgl,7-7,13170-13180) fuzzy-if(Android&&device&&!swgl,8-8,12391-12391) == second-filter-uses-SourceGraphic.svg simple-chain-ref.svg
== simple-chain.svg simple-chain-ref.svg
diff --git a/layout/reftests/svg/moz-only/reftest.list b/layout/reftests/svg/moz-only/reftest.list
index ce73d4119c..c6ee4d296c 100644
--- a/layout/reftests/svg/moz-only/reftest.list
+++ b/layout/reftests/svg/moz-only/reftest.list
@@ -1,6 +1,6 @@
# Tests for zooming with the full page zoom UI
-random-if(d2d) == feImage-zoom-01a.svg feImage-zoom-01-ref.svg
-random-if(d2d) == feImage-zoom-01b.svg feImage-zoom-01-ref.svg
+random-if(winWidget) == feImage-zoom-01a.svg feImage-zoom-01-ref.svg
+random-if(winWidget) == feImage-zoom-01b.svg feImage-zoom-01-ref.svg
== foreignObject-zoom-01.svg pass.svg
== zoom-invalidation-01.svg pass.svg
== replaced-element-zoom-01.html pass.svg
diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list
index 3504084b5d..5f1da97375 100644
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -37,11 +37,11 @@ needs-focus == autofocus-02b.svg pass.svg
== baseline-middle-01.svg pass.svg
== blend-color-burn.svg blend-color-burn-ref.svg
-fuzzy-if(winWidget&&gpuProcess&&!d2d,0-1,0-1600) == blend-color-dodge.svg blend-color-dodge-ref.svg
+== blend-color-dodge.svg blend-color-dodge-ref.svg
# == blend-color.svg blend-color-ref.svg
== blend-darken.svg blend-darken-ref.svg
== blend-difference.svg blend-difference-ref.svg
-fuzzy(0-1,0-1600) fuzzy-if(geckoview,0-5,0-254) == blend-exclusion.svg blend-exclusion-ref.svg
+fuzzy(0-1,0-1600) fuzzy-if(Android,0-5,0-254) == blend-exclusion.svg blend-exclusion-ref.svg
# == blend-hard-light.svg blend-hard-light-ref.svg
# == blend-hue.svg blend-hue-ref.svg
== blend-layer-blend.svg blend-layer-blend-ref.svg
@@ -164,7 +164,7 @@ fuzzy(0-1,0-10000) == dynamic-filter-contents-01b.svg dynamic-filter-contents-01
== dynamic-pattern-contents-01.svg pass.svg
== dynamic-pattern-contents-02.svg pass.svg
== dynamic-rect-01.svg dynamic-rect-01-ref.svg
-fuzzy-if(d2d&&layersGPUAccelerated,0-3,0-1200) == dynamic-rect-02.svg dynamic-rect-02-ref.svg # bug 776038 for Win7, Win8
+fuzzy-if(winWidget,0-3,0-1200) == dynamic-rect-02.svg dynamic-rect-02-ref.svg # bug 776038 for Win7, Win8
== dynamic-rect-03.svg dynamic-rect-03-ref.svg
== dynamic-rect-04.xhtml pass.svg
== dynamic-rect-05.svg pass.svg
@@ -176,8 +176,8 @@ fuzzy-if(d2d&&layersGPUAccelerated,0-3,0-1200) == dynamic-rect-02.svg dynamic-re
== dynamic-stroke-width-01.svg pass.svg
== dynamic-switch-01.svg pass.svg
== dynamic-text-01.svg dynamic-text-01-ref.svg
-fuzzy-if(d2d&&layersGPUAccelerated,0-3,0-12739) == dynamic-text-02.svg dynamic-text-02-ref.svg # bug 776038 for Win7, Win8
-fuzzy-if(d2d&&layersGPUAccelerated,0-2,0-10539) == dynamic-text-03.svg dynamic-text-03-ref.svg # bug 776038 for Win7
+fuzzy-if(winWidget,0-3,0-12739) == dynamic-text-02.svg dynamic-text-02-ref.svg # bug 776038 for Win7, Win8
+fuzzy-if(winWidget,0-2,0-10539) == dynamic-text-03.svg dynamic-text-03-ref.svg # bug 776038 for Win7
== dynamic-text-04.svg dynamic-text-04-ref.svg
== dynamic-text-05.svg pass.svg
== dynamic-text-06.svg pass.svg
@@ -226,7 +226,7 @@ skip pref(security.fileuri.strict_origin_policy,true) == filter-extref-different
== filter-foreignObject-01.svg pass.svg
== filter-in-mask-01.svg pass.svg
== filter-invalidation-01.svg pass.svg
-fuzzy(0-71,0-821) fails-if(winWidget) fuzzy-if(OSX&&!swgl,1-1,216-458) == filter-on-continuation-box-01.html filter-on-continuation-box-ref.html
+fuzzy(0-71,0-821) fails-if(winWidget) fuzzy-if(cocoaWidget&&!swgl,1-1,216-458) == filter-on-continuation-box-01.html filter-on-continuation-box-ref.html
== filter-result-01.svg filter-result-01-ref.svg
== filter-scaled-01.svg pass.svg
fuzzy(0-1,0-500) == filter-scaled-02.html filter-scaled-02-ref.html
@@ -333,7 +333,7 @@ fuzzy(0-1,0-6400) == mask-type-04.svg mask-type-01-ref.svg
fuzzy(0-3,0-448000) == nesting-invalid-01.svg nesting-invalid-01-ref.svg
-fuzzy(0-2,0-1000) == non-scaling-stroke-01.svg non-scaling-stroke-01-ref.svg # bug 1074161 for Win7 and OSX 10.8
+fuzzy(0-2,0-1000) == non-scaling-stroke-01.svg non-scaling-stroke-01-ref.svg
fuzzy(0-51,0-900) fuzzy-if(Android,0-51,0-4090) fails-if(useDrawSnapshot) == non-scaling-stroke-02.svg non-scaling-stroke-02-ref.svg
== non-scaling-stroke-03.svg non-scaling-stroke-03-ref.svg
@@ -350,7 +350,7 @@ fuzzy(0-51,0-900) fuzzy-if(Android,0-51,0-4090) fails-if(useDrawSnapshot) == non
== objectBoundingBox-and-pattern-03.svg objectBoundingBox-and-pattern-03-ref.svg
== opacity-and-gradient-01.svg pass.svg
-skip-if(d2d) fuzzy(0-1,0-200000) == opacity-and-gradient-02.svg opacity-and-gradient-02-ref.svg
+skip-if(winWidget) fuzzy(0-1,0-200000) == opacity-and-gradient-02.svg opacity-and-gradient-02-ref.svg
== opacity-and-pattern-01.svg pass.svg
fuzzy(0-1,0-10000) == opacity-and-transform-01.svg opacity-and-transform-01-ref.svg
@@ -369,11 +369,11 @@ fuzzy(0-7,0-214) == outline.html outline-ref.html # Bug 1503525
== paint-on-maskLayer-1a.html paint-on-maskLayer-1-ref.html
== paint-on-maskLayer-1b.html paint-on-maskLayer-1-ref.html
== paint-on-maskLayer-1c.html paint-on-maskLayer-1-ref.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-16,0-5) == paint-order-01.svg paint-order-01-ref.svg
+fuzzy-if(winWidget,0-16,0-5) == paint-order-01.svg paint-order-01-ref.svg
== paint-order-02.svg paint-order-02-ref.svg
== paint-order-03.svg paint-order-03-ref.svg
-#fuzzy(0-23,0-60) fails-if(d2d) == path-01.svg path-01-ref.svg
+#fuzzy(0-23,0-60) fails-if(winWidget) == path-01.svg path-01-ref.svg
== path-02.svg pass.svg
== path-04.svg pass.svg
== path-05.svg pass.svg
@@ -494,7 +494,7 @@ random-if(gtkWidget) != text-language-01.xhtml text-language-01-ref.xhtml # Fail
== text-layout-03.svg text-layout-03-ref.svg
== text-layout-04.svg text-layout-04-ref.svg
== text-layout-05.svg text-layout-05-ref.svg
-fuzzy-if(cocoaWidget&&layersGPUAccelerated,0-1,0-3) == text-layout-06.svg text-layout-06-ref.svg
+fuzzy-if(cocoaWidget,0-1,0-3) == text-layout-06.svg text-layout-06-ref.svg
== text-layout-07.svg text-layout-07-ref.svg
== text-layout-08.svg text-layout-08-ref.svg
== text-layout-09.svg pass.svg
@@ -630,7 +630,7 @@ fails-if(Android) != mask-resource.html about:blank # The image the test uses is
== 1570363-1.html 1570363-1-ref.html
fuzzy(0-1,0-150) == mask-opacity-invalidation-1.html mask-opacity-invalidation-1-ref.html # clip-path mask/opacity optimization
-skip-if(Android) skip-if(cocoaWidget) skip-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == transform-animation-on-path.html transform-animation-on-path-ref.html #Bug 1638909
+skip-if(Android) skip-if(cocoaWidget) skip-if(winWidget) == transform-animation-on-path.html transform-animation-on-path-ref.html #Bug 1638909
fuzzy(0-20,0-110) == 1792313.svg 1792313-ref.svg
pref(svg.use-element.recursive-clone-limit.enabled,1) != about:blank explosive-use.svg
diff --git a/layout/reftests/svg/sizing/reftest.list b/layout/reftests/svg/sizing/reftest.list
index 789d551147..5bd3ada14f 100644
--- a/layout/reftests/svg/sizing/reftest.list
+++ b/layout/reftests/svg/sizing/reftest.list
@@ -89,7 +89,7 @@
== standalone--auto-auto--0-pct.svg pass-empty.svg
== standalone--auto-auto--0-px.svg pass-empty.svg
== standalone--auto-auto--pct-0.svg pass-empty.svg
-fuzzy-if(d2d,0-1,0-400) == standalone--auto-auto--pct-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--auto-auto--pct-pct.svg pass-pct-pct.xhtml
== standalone--auto-auto--pct-px.svg pass-pct-px.xhtml
== standalone--auto-auto--px-0.svg pass-empty.svg
== standalone--auto-auto--px-pct.svg pass-px-pct.xhtml
@@ -98,12 +98,12 @@ fuzzy-if(d2d,0-1,0-400) == standalone--auto-auto--pct-pct.svg pass-pct-pct.xht
== standalone--auto-pct--0-0.svg pass-empty.svg
== standalone--auto-pct--0-pct.svg pass-empty.svg
== standalone--auto-pct--0-px.svg pass-empty.svg
-fuzzy-if(d2d,0-1,0-400) == standalone--auto-pct--pct-0.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--auto-pct--pct-pct.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--auto-pct--pct-px.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--auto-pct--pct-0.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--auto-pct--pct-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--auto-pct--pct-px.svg pass-pct-pct.xhtml
== standalone--auto-pct--px-0.svg pass-px-pct.xhtml
== standalone--auto-pct--px-pct.svg pass-px-pct.xhtml
-fuzzy-if(d2d,0-1,0-1000) == standalone--auto-pct--px-px.svg pass-pct-height-square.xhtml # intrinsic ratio!
+fuzzy-if(winWidget,0-1,0-1000) == standalone--auto-pct--px-px.svg pass-pct-height-square.xhtml # intrinsic ratio!
== standalone--auto-px--0-0.svg pass-empty.svg
== standalone--auto-px--0-pct.svg pass-empty.svg
@@ -126,24 +126,24 @@ fuzzy-if(d2d,0-1,0-1000) == standalone--auto-pct--px-px.svg pass-pct-height
== standalone--pct-0--px-px.svg pass-empty.svg
== standalone--pct-auto--0-0.svg pass-empty.svg
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-auto--0-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-auto--0-pct.svg pass-pct-pct.xhtml
== standalone--pct-auto--0-px.svg pass-pct-px.xhtml
== standalone--pct-auto--pct-0.svg pass-empty.svg
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-auto--pct-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-auto--pct-pct.svg pass-pct-pct.xhtml
== standalone--pct-auto--pct-px.svg pass-pct-px.xhtml
== standalone--pct-auto--px-0.svg pass-empty.svg
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-auto--px-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-auto--px-pct.svg pass-pct-pct.xhtml
== standalone--pct-auto--px-px.svg pass-pct-width-square.xhtml # intrinsic ratio!
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--0-0.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--0-pct.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--0-px.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--pct-0.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--pct-pct.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--pct-px.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--px-0.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--px-pct.svg pass-pct-pct.xhtml
-fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--px-px.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--0-0.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--0-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--0-px.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--pct-0.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--pct-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--pct-px.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--px-0.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--px-pct.svg pass-pct-pct.xhtml
+fuzzy-if(winWidget,0-1,0-400) == standalone--pct-pct--px-px.svg pass-pct-pct.xhtml
== standalone--pct-px--0-0.svg pass-pct-px.xhtml
== standalone--pct-px--0-pct.svg pass-pct-px.xhtml
@@ -260,7 +260,7 @@ fuzzy-if(d2d,0-1,0-400) == standalone--pct-pct--px-px.svg pass-pct-pct.xht
# coverage.
== inline--display-block--01.xhtml inline--display-block--01-ref.xhtml
-fuzzy-if(OSX,0-1,0-10) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
+fuzzy-if(cocoaWidget,0-1,0-10) == inline--display-inline--01.xhtml inline--display-inline--01-ref.xhtml
== inline--display-inline-block--01.xhtml inline--display-inline-block--01-ref.xhtml
== inline--float-left--01.xhtml inline--float-left--01-ref.xhtml
== inline--float-right--01.xhtml inline--float-right--01-ref.xhtml
diff --git a/layout/reftests/svg/smil/container/reftest.list b/layout/reftests/svg/smil/container/reftest.list
index c492817d3f..b0126efc1f 100644
--- a/layout/reftests/svg/smil/container/reftest.list
+++ b/layout/reftests/svg/smil/container/reftest.list
@@ -5,10 +5,10 @@
random == enveloped-tree-1.xhtml enveloped-tree-1-ref.xhtml # bug 470868
fuzzy(0-1,0-810) == promoted-tree-1.xhtml promoted-tree-1-ref.xhtml
random == moved-tree-1.xhtml moved-tree-1-ref.xhtml # bug 470868
-random-if(cocoaWidget||d2d) == deferred-anim-1.xhtml deferred-anim-1-ref.xhtml # bug 470868, bug 585484
-random-if(cocoaWidget&&layersGPUAccelerated) == deferred-tree-1.xhtml deferred-tree-1-ref.xhtml # bug 470868
-random-if(cocoaWidget&&layersGPUAccelerated) fuzzy(0-1,0-530) == deferred-tree-2a.xhtml deferred-tree-2-ref.xhtml # bug 470868
-random-if(cocoaWidget&&layersGPUAccelerated) fuzzy(0-1,0-530) == deferred-tree-2b.xhtml deferred-tree-2-ref.xhtml # bug 470868
+random-if(cocoaWidget||winWidget) == deferred-anim-1.xhtml deferred-anim-1-ref.xhtml # bug 470868, bug 585484
+random-if(cocoaWidget) == deferred-tree-1.xhtml deferred-tree-1-ref.xhtml # bug 470868
+random-if(cocoaWidget) fuzzy(0-1,0-530) == deferred-tree-2a.xhtml deferred-tree-2-ref.xhtml # bug 470868
+random-if(cocoaWidget) fuzzy(0-1,0-530) == deferred-tree-2b.xhtml deferred-tree-2-ref.xhtml # bug 470868
fuzzy(0-1,0-410) == deferred-tree-3a.xhtml deferred-tree-3-ref.xhtml
fuzzy(0-1,0-110) == deferred-tree-3b.xhtml deferred-tree-3-ref.xhtml
fuzzy(0-1,0-110) == deferred-tree-3c.xhtml deferred-tree-3-ref.xhtml
diff --git a/layout/reftests/svg/smil/reftest.list b/layout/reftests/svg/smil/reftest.list
index 1ec28de14a..0f1c5541c3 100644
--- a/layout/reftests/svg/smil/reftest.list
+++ b/layout/reftests/svg/smil/reftest.list
@@ -237,7 +237,7 @@ skip == anim-text-x-y-dx-dy-01.svg anim-text-x-y-dx-dy-01-ref.svg # bug 579588
# Test we don't rely on HasAttr to see if an attribute has been set
== anim-rect-rxry-1.svg anim-rect-rxry-1-ref.svg
fuzzy(0-1,0-350) == anim-pattern-attr-presence-01.svg anim-pattern-attr-presence-01-ref.svg
-fuzzy-if(cocoaWidget&&layersGPUAccelerated,0-1,0-2) == anim-gradient-attr-presence-01.svg anim-gradient-attr-presence-01-ref.svg
+fuzzy-if(cocoaWidget,0-1,0-2) == anim-gradient-attr-presence-01.svg anim-gradient-attr-presence-01-ref.svg
== api-sanity-1.svg lime.svg
diff --git a/layout/reftests/svg/svg-integration/clip-path/reftest.list b/layout/reftests/svg/svg-integration/clip-path/reftest.list
index 82d4c813f5..d60f61dab0 100644
--- a/layout/reftests/svg/svg-integration/clip-path/reftest.list
+++ b/layout/reftests/svg/svg-integration/clip-path/reftest.list
@@ -32,7 +32,7 @@ fuzzy-if(!useDrawSnapshot,35-70,696-800) == clip-path-circle-013.html clip-path-
fuzzy-if(!useDrawSnapshot,34-70,696-925) == clip-path-circle-014.html clip-path-circle-007-ref.html
fuzzy-if(!useDrawSnapshot,34-70,696-925) == clip-path-circle-015.html clip-path-circle-008-ref.html
fuzzy-if(!useDrawSnapshot,34-70,696-925) == clip-path-circle-016.html clip-path-circle-009-ref.html
-fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-16,0-9) fuzzy-if(!useDrawSnapshot,34-70,696-920) == clip-path-circle-017.html clip-path-circle-007-ref.html
+fuzzy-if(winWidget,0-16,0-9) fuzzy-if(!useDrawSnapshot,34-70,696-920) == clip-path-circle-017.html clip-path-circle-007-ref.html
fuzzy-if(!useDrawSnapshot,35-70,696-800) == clip-path-circle-018.html clip-path-circle-010-ref.html
fuzzy-if(!useDrawSnapshot,35-70,696-800) == clip-path-circle-019.html clip-path-circle-002-ref.html
fuzzy-if(!useDrawSnapshot,35-70,696-800) == clip-path-circle-020.html clip-path-circle-002-ref.html
diff --git a/layout/reftests/svg/text/reftest.list b/layout/reftests/svg/text/reftest.list
index 8b62546713..14b3c68b34 100644
--- a/layout/reftests/svg/text/reftest.list
+++ b/layout/reftests/svg/text/reftest.list
@@ -2,10 +2,10 @@ fuzzy-if(winWidget,47-127,221-254) == simple.svg simple-ref.html
== simple-2.svg simple.svg
fuzzy-if(winWidget,47-127,221-254) == simple-underline.svg simple-underline-ref.html
== simple-underline-scaled.svg simple-underline-scaled-ref.svg
-fuzzy-if(winWidget,47-166,255-318) fuzzy-if(OSX,0-1,0-1) == simple-anchor-end-bidi.svg simple-anchor-end-bidi-ref.html
+fuzzy-if(winWidget,47-166,255-318) fuzzy-if(cocoaWidget,0-1,0-1) == simple-anchor-end-bidi.svg simple-anchor-end-bidi-ref.html
fuzzy-if(winWidget,47-139,181-204) == simple-anchor-end-rtl.svg simple-anchor-end-rtl-ref.html
fuzzy-if(winWidget,47-137,181-250) == simple-anchor-end.svg simple-anchor-end-ref.html
-fuzzy-if(dwrite,0-104,0-131) fuzzy-if(cocoaWidget,0-143,0-124) fuzzy-if(!(gtkWidget||geckoview),79-200,59-319) == simple-anchor-middle-bidi.svg simple-anchor-middle-bidi-ref.html
+fuzzy-if(winWidget,0-104,0-131) fuzzy-if(cocoaWidget,0-143,0-124) fuzzy-if(!(gtkWidget||geckoview),79-200,59-319) == simple-anchor-middle-bidi.svg simple-anchor-middle-bidi-ref.html
fuzzy-if(winWidget,47-138,188-207) == simple-anchor-middle-rtl.svg simple-anchor-middle-rtl-ref.html
fuzzy(0-111,0-81) fuzzy-if(winWidget,47-181,221-257) == simple-anchor-middle.svg simple-anchor-middle-ref.html
fuzzy-if(winWidget,47-138,260-319) == simple-bidi.svg simple-bidi-ref.html
@@ -25,7 +25,7 @@ fuzzy-if(winWidget,47-138,260-319) == simple-bidi.svg simple-bidi-ref.html
== simple-dx-rtl-2.svg simple-dx-rtl-2-ref.svg
== simple-fill-color-dynamic.svg simple-fill-color-dynamic-ref.svg
-fuzzy-if(winWidget,47-129,221-254) fuzzy-if(OSX,23-65,195-196) == simple-fill-color.svg simple-fill-color-ref.html
+fuzzy-if(winWidget,47-129,221-254) fuzzy-if(cocoaWidget,23-65,195-196) == simple-fill-color.svg simple-fill-color-ref.html
== simple-fill-gradient.svg simple-fill-gradient-ref.svg
== simple-fill-none.svg simple.svg
== simple-pointer-events.svg simple.svg
@@ -133,7 +133,7 @@ fuzzy(0-4,0-100) == textLength-3.svg textLength-3-ref.svg
== textLength-6.svg textLength-6-ref.svg
# text-shadow
-fuzzy(0-127,0-5) fuzzy-if(Android,0-127,0-12) == text-shadow.svg text-shadow-ref.svg
+== text-shadow.svg text-shadow-ref.svg
# vertical text
== vertical-01.svg vertical-01-ref.svg
@@ -173,7 +173,7 @@ fuzzy(0-127,0-5) fuzzy-if(Android,0-127,0-12) == text-shadow.svg text-shadow-ref
== dynamic-dominant-baseline.svg dynamic-dominant-baseline-ref.svg
== dynamic-multiple-x.svg dynamic-multiple-x-ref.svg
fuzzy(0-1,0-200) == dynamic-non-scaling-stroke.svg dynamic-non-scaling-stroke-ref.svg #Bug 885316
-fuzzy(0-127,0-5) fuzzy-if(Android,0-127,0-41) == dynamic-text-shadow.svg text-shadow-ref.svg
+== dynamic-text-shadow.svg text-shadow-ref.svg
# text and masks
fuzzy-if(winWidget,0-50,0-224) == mask-applied.svg mask-applied-ref.svg
@@ -202,7 +202,7 @@ fuzzy(0-1,0-600) needs-focus == selectSubString-2.svg selectSubString-2-ref.svg
fuzzy(0-1,0-250) needs-focus == selectSubString-3.svg selectSubString-3-ref.svg
fuzzy-if(!geckoview,0-1,0-237) needs-focus fuzzy-if(winWidget,55-148,200-254) == simple-selection.svg simple-selection-ref.html
fuzzy(0-1,0-100) needs-focus fuzzy-if(winWidget,55-148,200-318) == simple-bidi-selection.svg simple-bidi-selection-ref.html
-fuzzy(0-1,0-50) needs-focus fuzzy-if(winWidget,55-148,200-254) fuzzy-if(OSX,1-65,19-196) == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
+fuzzy(0-1,0-50) needs-focus fuzzy-if(winWidget,55-148,200-254) fuzzy-if(cocoaWidget,1-65,19-196) == simple-fill-color-selection.svg simple-fill-color-selection-ref.html
fuzzy(0-1,0-150) needs-focus fuzzy-if(winWidget,125-148,221-254) == simple-underline-selection.svg simple-underline-selection-ref.html # Bug 1392106
fuzzy(0-1,0-300) needs-focus fuzzy-if(Android13,0-3,0-926) fuzzy-if(winWidget,134-152,432-501) == multiple-text-selection.svg multiple-text-selection-ref.html # Bug 1392106
needs-focus == multiple-chunks-selection.svg multiple-chunks-selection-ref.svg
diff --git a/layout/reftests/table-anonymous-boxes/reftest.list b/layout/reftests/table-anonymous-boxes/reftest.list
index 03468ebb1a..2d95873173 100644
--- a/layout/reftests/table-anonymous-boxes/reftest.list
+++ b/layout/reftests/table-anonymous-boxes/reftest.list
@@ -27,7 +27,7 @@ fuzzy(0-1,0-6) == 339388-1b.html 339388-1-ref.html
== 372641-1c.xhtml 372641-1-ref.xhtml
== 372649-1.html 372649-1-ref.html
== 373379-1.html 373379-1-ref.html
-random-if(d2d) == 394402-1a.html 394402-1-ref.html # bug 586833
+random-if(winWidget) == 394402-1a.html 394402-1-ref.html # bug 586833
== 394402-1b.html 394402-1-ref.html # bug 586833
== 398095-1.html 398095-1-ref.html
== 407115-1.html 407115-1-ref.html
diff --git a/layout/reftests/table-overflow/bug785684-x-ref.html b/layout/reftests/table-overflow/bug785684-x-ref.html
index f54122f124..5dd831f1cb 100644
--- a/layout/reftests/table-overflow/bug785684-x-ref.html
+++ b/layout/reftests/table-overflow/bug785684-x-ref.html
@@ -26,7 +26,6 @@
.clip {
overflow:hidden;
width: 300px;
- height: 20px;
box-sizing: border-box;
}
</style>
diff --git a/layout/reftests/table-overflow/bug785684-y-ref.html b/layout/reftests/table-overflow/bug785684-y-ref.html
index 5033b56e04..9bf3bb4e71 100644
--- a/layout/reftests/table-overflow/bug785684-y-ref.html
+++ b/layout/reftests/table-overflow/bug785684-y-ref.html
@@ -26,7 +26,6 @@
.clip {
overflow:hidden;
width: 300px;
- height: 20px;
box-sizing: border-box;
}
</style>
diff --git a/layout/reftests/table-overflow/reftest.list b/layout/reftests/table-overflow/reftest.list
index 7b11d4f5f7..5aeffc5285 100644
--- a/layout/reftests/table-overflow/reftest.list
+++ b/layout/reftests/table-overflow/reftest.list
@@ -1,6 +1,7 @@
defaults pref(layout.tables.scrollable-cells,true)
-skip-if(ThreadSanitizer) == bug785684-x.html bug785684-x-ref.html
-== bug785684-y.html bug785684-y-ref.html
+# Android: Tests assume non-overlay scrollbars
+fails-if(Android) skip-if(ThreadSanitizer) == bug785684-x.html bug785684-x-ref.html
+fails-if(Android) == bug785684-y.html bug785684-y-ref.html
== table-caption-scroll.html table-caption-scroll-ref.html
== table-cell-block-overflow.html table-cell-block-overflow-ref.html
diff --git a/layout/reftests/text-overflow/reftest.list b/layout/reftests/text-overflow/reftest.list
index 6c5f982c87..99e7739b08 100644
--- a/layout/reftests/text-overflow/reftest.list
+++ b/layout/reftests/text-overflow/reftest.list
@@ -4,7 +4,7 @@ fuzzy(0-47,0-6) == marker-basic.html marker-basic-ref.html # Bug 1128229
== marker-string.html marker-string-ref.html
fuzzy(0-47,0-18) == bidi-simple.html bidi-simple-ref.html
skip-if(!gtkWidget) fuzzy-if(gtkWidget,0-124,0-289) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
-fuzzy-if(Android,0-24,0-4000) fuzzy-if(cocoaWidget,0-1,0-40) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-149,0-1836) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
+fuzzy-if(Android,0-24,0-4000) fuzzy-if(cocoaWidget,0-1,0-40) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
fuzzy(0-16,0-454) fuzzy-if(winWidget,25-85,406-499) fuzzy-if(cocoaWidget,0-7,0-265) fuzzy-if(Android,0-3,0-466) == anonymous-block.html anonymous-block-ref.html # gtkWidget:bug 1309103, fuzzy: subpixel aa
fuzzy(0-47,0-3) == false-marker-overlap.html false-marker-overlap-ref.html
== visibility-hidden.html visibility-hidden-ref.html
diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
index 983d66946e..1402cc7ad7 100644
--- a/layout/reftests/text/reftest.list
+++ b/layout/reftests/text/reftest.list
@@ -58,7 +58,7 @@ skip == subpixel-glyphs-x-1a.html subpixel-glyphs-x-1b.html
# inconsistencies. On those platforms we just test that glyph positions are
# subpixel.
# D2D/DirectWrite results depend on the rendering mode chosen, so considering this as random for now.
-skip-if(!(d2d||cocoaWidget)) random-if(d2d) != subpixel-glyphs-x-2a.html subpixel-glyphs-x-2b.html
+skip-if(!(winWidget||cocoaWidget)) random-if(winWidget) != subpixel-glyphs-x-2a.html subpixel-glyphs-x-2b.html
== subpixel-glyphs-x-3a.html subpixel-glyphs-x-3b.html
# No platforms do subpixel positioning vertically
fuzzy-if(Android,0-19,0-2) == subpixel-glyphs-y-1a.html subpixel-glyphs-y-1b.html
@@ -77,7 +77,7 @@ pref(intl.icu4x.segmenter.enabled,false) == wordbreak-1.html wordbreak-1-ref.htm
== wordbreak-3.html wordbreak-3-ref.html
== wordbreak-4b.html wordbreak-4b-ref.html
== wordbreak-5.html wordbreak-5-ref.html
-fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == wordbreak-6.html wordbreak-6-ref.html # Bug 1258239
+fails-if(winWidget) == wordbreak-6.html wordbreak-6-ref.html # Bug 1258239
== wordbreak-7a.html wordbreak-7a-ref.html
fails == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829
== wordbreak-8.html wordbreak-8-ref.html
diff --git a/layout/reftests/text/webkit-text-security-1.html b/layout/reftests/text/webkit-text-security-1.html
index 19ffaf5b49..95cdeff992 100644
--- a/layout/reftests/text/webkit-text-security-1.html
+++ b/layout/reftests/text/webkit-text-security-1.html
@@ -130,7 +130,7 @@ input type="email": <input class="test" type="email" value="a@example.org"><br>
<!--input type="week": <input class="test" type="week" value="12:00:00"><br>-->
<!--input type="file": <input class="test" type="file"><br>-->
<!--input type="image": <input class="test" type="image"><br>-->
-select: <select class="test"><option>A</option><option>BB</option></select><br>
+select: <select style="appearance: none" class="test"><option>A</option><option>BB</option></select><br>
SVG: <svg height="30px" class="test"><text y="20">SVG Text</text></svg><br>
Ordered list, first item empty: <ol class="test"><li></li><li>a</li><li>bb</li></ol>
diff --git a/layout/reftests/transform-3d/reftest.list b/layout/reftests/transform-3d/reftest.list
index 12587f51a8..affea05d0b 100644
--- a/layout/reftests/transform-3d/reftest.list
+++ b/layout/reftests/transform-3d/reftest.list
@@ -24,8 +24,8 @@ fuzzy(0-16,0-100) == preserve3d-5a.html preserve3d-5-ref.html
== preserve3d-6a.html preserve3d-6-ref.html
== preserve3d-table.html preserve3d-table-ref.html
== scale3d-z.html scalez-1-ref.html
-fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) == scale3d-all.html scale3d-1-ref.html # subpixel AA
-fuzzy-if(winWidget,0-143,0-689) fuzzy-if(OSX,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA
+fuzzy-if(winWidget,0-143,0-689) fuzzy-if(cocoaWidget,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) == scale3d-all.html scale3d-1-ref.html # subpixel AA
+fuzzy-if(winWidget,0-143,0-689) fuzzy-if(cocoaWidget,0-224,0-924) fuzzy-if(winWidget,0-154,0-644) == scale3d-all-separate.html scale3d-1-ref.html # subpixel AA
== scale3d-xz.html scale3d-1-ref.html
== translatez-1a.html translatez-1-ref.html
!= translatez-1b.html translatez-1-ref.html
@@ -38,14 +38,14 @@ fuzzy(0-1,0-6) == rotate3d-2a.html rotatey-1-ref.html
!= backface-visibility-1a.html about:blank
== backface-visibility-1b.html about:blank
== backface-visibility-1c.html about:blank
-fuzzy-if(winWidget&&!layersGPUAccelerated,0-1,0-251) fuzzy-if(useDrawSnapshot,64-64,1438-1438) == backface-visibility-2.html backface-visibility-2-ref.html
+fuzzy-if(useDrawSnapshot,64-64,1438-1438) == backface-visibility-2.html backface-visibility-2-ref.html
== backface-visibility-3.html backface-visibility-3-ref.html
== perspective-clipping-1.html perspective-clipping-1-ref.html
== perspective-clipping-2.html perspective-clipping-2-ref.html
!= perspective-origin-1a.html rotatex-perspective-1a.html
fuzzy(0-1,0-3) == perspective-origin-1b.html perspective-origin-1a.html
-fuzzy(0-3,0-99) random-if(Android&&!browserIsRemote) == perspective-origin-2a.html perspective-origin-2-ref.html # subpixel AA, bug 732568
-fuzzy-if(winWidget&&!layersGPUAccelerated,0-1,0-61) == perspective-origin-3a.html perspective-origin-3-ref.html
+fuzzy(0-3,0-99) == perspective-origin-2a.html perspective-origin-2-ref.html # subpixel AA, bug 732568
+== perspective-origin-3a.html perspective-origin-3-ref.html
== perspective-origin-4a.html perspective-origin-4-ref.html
== perspective-zindex.html green-rect.html
== perspective-zindex-2.html green-rect.html
@@ -57,13 +57,13 @@ fuzzy-if(winWidget&&!layersGPUAccelerated,0-1,0-61) == perspective-origin-3a.htm
== sorting-3a.html green-rect.html
# Different, but equivalent (for the given transform) transform origins
fuzzy(0-1,0-4) == rotatex-transformorigin-1a.html rotatex-transformorigin-1-ref.html
-fuzzy-if((gtkWidget&&layersOMTC)||(winWidget&&!layersGPUAccelerated),0-1,0-86) == overflow-hidden-1a.html overflow-hidden-1-ref.html
+fuzzy-if(gtkWidget,0-1,0-86) == overflow-hidden-1a.html overflow-hidden-1-ref.html
== transform-style-flat-1a.html transform-style-flat-1-ref.html
== willchange-containing-block.html?willchange willchange-containing-block.html?ref
!= willchange-containing-block.html?willchange willchange-containing-block.html?noblock
fuzzy(0-3,0-304) == scroll-perspective-1.html scroll-perspective-1-ref.html
# Bugs
-fails-if(!layersGPUAccelerated) fails-if(useDrawSnapshot) fuzzy-if(!useDrawSnapshot,0-60,0-826) == 1035611-1.html 1035611-1-ref.html # Bug 1072898 for !layersGPUAccelerated failures
+fails-if(useDrawSnapshot) fuzzy-if(!useDrawSnapshot,0-60,0-826) == 1035611-1.html 1035611-1-ref.html
random-if(swgl&&Android) != 1157984-1.html about:blank # Bug 1157984
fuzzy(0-220,0-660) == animate-cube-radians.html animate-cube-radians-ref.html # subpixel AA
fuzzy(0-240,0-400) == animate-cube-radians-zoom.html animate-cube-radians-zoom-ref.html
@@ -71,7 +71,7 @@ fuzzy(0-240,0-400) == animate-cube-radians-zoom.html animate-cube-radians-zoom-r
fuzzy(0-240,0-660) == animate-cube-degrees.html animate-cube-degrees-ref.html # subpixel AA
fuzzy(0-240,0-400) fails-if(useDrawSnapshot) == animate-cube-degrees-zoom.html animate-cube-degrees-zoom-ref.html
!= animate-cube-degrees-ref.html animate-cube-degrees-zoom-ref.html
-fuzzy-if(gtkWidget,0-128,0-100) fuzzy-if(Android||(gtkWidget&&layersGPUAccelerated),0-143,0-100) fuzzy-if(winWidget||OSX,0-141,0-100) == preserves3d-nested.html preserves3d-nested-ref.html
+fuzzy-if(gtkWidget,0-128,0-100) fuzzy-if(Android||gtkWidget,0-143,0-100) fuzzy-if(winWidget||cocoaWidget,0-141,0-100) == preserves3d-nested.html preserves3d-nested-ref.html
fuzzy(0-255,0-153) == animate-preserve3d-parent.html animate-preserve3d-ref.html # intermittently fuzzy on Mac
fuzzy(0-255,0-153) == animate-preserve3d-child.html animate-preserve3d-ref.html # intermittently fuzzy on Mac, bug 1461311 for Android
== animate-backface-hidden.html about:blank
diff --git a/layout/reftests/transform/reftest.list b/layout/reftests/transform/reftest.list
index 86f8002ce1..f96c75e5f0 100644
--- a/layout/reftests/transform/reftest.list
+++ b/layout/reftests/transform/reftest.list
@@ -172,7 +172,7 @@ test-pref(layout.animation.prerender.partial.jank,true) test-pref(layout.animati
skip test-pref(layout.animation.prerender.partial.jank,true) test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") == partial-prerender-translate-12.html partial-prerender-translate-2-ref.html # bug 1666692 for WebRender
# This reftest heavily depends on layout.animation.prerender.viewport-ratio-limit
# and reftest viewport size (800, 1000).
-skip-if(Android) test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") fuzzy-if(!layersGPUAccelerated,0-75,0-2683) == partial-prerender-expansion-rotate.html partial-prerender-expansion-ref.html
+skip-if(Android) test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") == partial-prerender-expansion-rotate.html partial-prerender-expansion-ref.html
skip-if(useDrawSnapshot) test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") pref(dom.meta-viewport.enabled,true) pref(apz.allow_zooming,true) == partial-prerender-expansion-with-resolution-1.html partial-prerender-expansion-with-resolution-ref.html
skip test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") pref(dom.meta-viewport.enabled,true) pref(apz.allow_zooming,true) == partial-prerender-expansion-with-resolution-2.html partial-prerender-expansion-with-resolution-ref.html # bug 1650039 for WebRender
test-pref(layout.animation.prerender.partial.jank,true) test-pref(layout.animation.prerender.partial,true) test-pref(layout.animation.prerender.viewport-ratio-limit,"1.125") fuzzy-if(Android,0-255,0-400) == partial-prerender-in-svg-1.html partial-prerender-in-svg-1-ref.html
diff --git a/layout/reftests/webm-video/reftest.list b/layout/reftests/webm-video/reftest.list
index 04307a1cef..2327b477fc 100644
--- a/layout/reftests/webm-video/reftest.list
+++ b/layout/reftests/webm-video/reftest.list
@@ -5,7 +5,7 @@ fails-if(Android) skip-if(gtkWidget) == aspect-ratio-2a.xhtml aspect-ratio-2-ref
fails-if(Android) skip-if(gtkWidget) == aspect-ratio-2b.xhtml aspect-ratio-2-ref.html
== aspect-ratio-3a.xhtml aspect-ratio-3-ref.xhtml
== aspect-ratio-3b.xhtml aspect-ratio-3-ref.xhtml
-fails-if(Android) random-if(layersGPUAccelerated) == encoded-aspect-ratio-1.html encoded-aspect-ratio-1-ref.html
+fails-if(Android) random == encoded-aspect-ratio-1.html encoded-aspect-ratio-1-ref.html
fails-if(Android) == basic-1.xhtml basic-1-ref.html
== canvas-1a.xhtml basic-1-ref.html
fails-if(Android) == canvas-1b.xhtml basic-1-ref.html
@@ -43,15 +43,15 @@ fuzzy(0-5,0-111556) == webm-alpha-2.html webm-alpha-2-ref.html
# wouldn't be fair of us to make a W3C testsuite implicitly depend on any
# particular (non-spec-mandated) video codec.
defaults test-pref(gfx.ycbcr.accurate-conversion,true)
-fails-if(layersGPUAccelerated) == object-fit-contain-webm-001.html object-fit-contain-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-contain-webm-002.html object-fit-contain-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-cover-webm-001.html object-fit-cover-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-cover-webm-002.html object-fit-cover-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-fill-webm-001.html object-fit-fill-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-fill-webm-002.html object-fit-fill-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-none-webm-001.html object-fit-none-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-none-webm-002.html object-fit-none-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-scale-down-webm-001.html object-fit-scale-down-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails-if(layersGPUAccelerated) == object-fit-scale-down-webm-002.html object-fit-scale-down-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
-fails == object-position-webm-001.html object-position-webm-001-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516 for layersGPUAccelerated failures
-fails == object-position-webm-002.html object-position-webm-002-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516 for layersGPUAccelerated failures
+fails == object-fit-contain-webm-001.html object-fit-contain-webm-001-ref.html # Bug 1083516
+fails == object-fit-contain-webm-002.html object-fit-contain-webm-002-ref.html # Bug 1083516
+fails == object-fit-cover-webm-001.html object-fit-cover-webm-001-ref.html # Bug 1083516
+fails == object-fit-cover-webm-002.html object-fit-cover-webm-002-ref.html # Bug 1083516
+fails == object-fit-fill-webm-001.html object-fit-fill-webm-001-ref.html # Bug 1083516
+fails == object-fit-fill-webm-002.html object-fit-fill-webm-002-ref.html # Bug 1083516
+fails == object-fit-none-webm-001.html object-fit-none-webm-001-ref.html # Bug 1083516
+fails == object-fit-none-webm-002.html object-fit-none-webm-002-ref.html # Bug 1083516
+fails == object-fit-scale-down-webm-001.html object-fit-scale-down-webm-001-ref.html # Bug 1083516
+fails == object-fit-scale-down-webm-002.html object-fit-scale-down-webm-002-ref.html # Bug 1083516
+fails == object-position-webm-001.html object-position-webm-001-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516
+fails == object-position-webm-002.html object-position-webm-002-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516
diff --git a/layout/reftests/writing-mode/reftest.list b/layout/reftests/writing-mode/reftest.list
index a9de1ad2cb..6519b4b7e4 100644
--- a/layout/reftests/writing-mode/reftest.list
+++ b/layout/reftests/writing-mode/reftest.list
@@ -16,7 +16,7 @@ fuzzy-if(gtkWidget,0-255,0-2) fuzzy-if(winWidget||Android,0-4,0-8704) == 1083848
== 1090168-1.html 1090168-1-ref.html
!= 1090168-1.html 1090168-1-notref.html
== 1090168-2.html 1090168-2-ref.html
-fuzzy-if(azureSkia,0-255,0-2700) == 1090168-3.html 1090168-3-ref.html # bug 1230357 mark fuzzy for skia.
+fuzzy-if(!winWidget,0-255,0-2700) == 1090168-3.html 1090168-3-ref.html # bug 1230357 mark fuzzy for skia.
== 1091058-1.html 1091058-1-ref.html
random-if(useDrawSnapshot) == 1094434-1.html 1094434-1-ref.html
== 1094434-2.html 1094434-2-ref.html
diff --git a/layout/reftests/xul/reftest.list b/layout/reftests/xul/reftest.list
index 3e811bc179..e84926335a 100644
--- a/layout/reftests/xul/reftest.list
+++ b/layout/reftests/xul/reftest.list
@@ -3,7 +3,7 @@
== chrome://reftest/content/xul/menuitem-key.xhtml chrome://reftest/content/xul/menuitem-key-ref.xhtml
# accesskeys are not normally displayed on Mac, so set a pref to enable them
pref(ui.key.menuAccessKey,18) == chrome://reftest/content/xul/accesskey.xhtml chrome://reftest/content/xul/accesskey-ref.xhtml
-fuzzy-if(xulRuntime.widgetToolkit=="gtk",0-1,0-11) fuzzy-if(winWidget,0-1,0-1) == chrome://reftest/content/xul/tree-row-outline-1.xhtml chrome://reftest/content/xul/tree-row-outline-1-ref.xhtml # win8: bug 1254832
+fuzzy-if(gtkWidget,0-1,0-11) fuzzy-if(winWidget,0-1,0-1) == chrome://reftest/content/xul/tree-row-outline-1.xhtml chrome://reftest/content/xul/tree-row-outline-1-ref.xhtml # win8: bug 1254832
skip-if(!cocoaWidget) == chrome://reftest/content/xul/mac-tab-toolbar.xhtml chrome://reftest/content/xul/mac-tab-toolbar-ref.xhtml
!= chrome://reftest/content/xul/tree-row-outline-1.xhtml chrome://reftest/content/xul/tree-row-outline-1-notref.xhtml
== chrome://reftest/content/xul/text-crop.xhtml chrome://reftest/content/xul/text-crop-ref.xhtml
diff --git a/layout/reftests/z-index/reftest.list b/layout/reftests/z-index/reftest.list
index 3e0d60cc63..b90b515a14 100644
--- a/layout/reftests/z-index/reftest.list
+++ b/layout/reftests/z-index/reftest.list
@@ -4,9 +4,9 @@
fuzzy(0-1,0-1500) == stacking-context-perspective.html stacking-context-yes.html
== stacking-context-backface-visibility.html stacking-context-no.html
-fails-if(Android&&!asyncPan) != overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html
-random-if(transparentScrollbars) == overlayscrollbar-sorting-1.html overlayscrollbar-sorting-ref-visible.html
+!= overlayscrollbar-sorting-ref-visible.html overlayscrollbar-sorting-ref-hidden.html
+random-if(gtkWidget) == overlayscrollbar-sorting-1.html overlayscrollbar-sorting-ref-visible.html
== overlayscrollbar-sorting-2.html overlayscrollbar-sorting-ref-visible.html
== overlayscrollbar-sorting-3.html overlayscrollbar-sorting-ref-hidden.html
== overlayscrollbar-sorting-4.html overlayscrollbar-sorting-ref-hidden.html
-random-if(transparentScrollbars) == overlayscrollbar-sorting-5.html overlayscrollbar-sorting-ref-visible.html
+random-if(gtkWidget) == overlayscrollbar-sorting-5.html overlayscrollbar-sorting-ref-visible.html
diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp
index f350e5210a..ddc6240216 100644
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -439,7 +439,6 @@ void FontFaceSet::MaybeResolve() {
break;
case FontFaceLoadStatus::Loading:
// We should've returned above at MightHavePendingFontLoads()!
- case FontFaceLoadStatus::EndGuard_:
MOZ_ASSERT_UNREACHABLE("unexpected FontFaceLoadStatus");
break;
}
diff --git a/layout/style/GeckoBindings.cpp b/layout/style/GeckoBindings.cpp
index 5c7992f8db..dc43e9cf6a 100644
--- a/layout/style/GeckoBindings.cpp
+++ b/layout/style/GeckoBindings.cpp
@@ -27,7 +27,6 @@
#include "mozilla/dom/DocumentInlines.h"
#include "nsILoadContext.h"
#include "nsIFrame.h"
-#include "nsIMozBrowserFrame.h"
#include "nsINode.h"
#include "nsIURI.h"
#include "nsFontMetrics.h"
@@ -44,6 +43,7 @@
#include "mozilla/css/ImageLoader.h"
#include "mozilla/DeclarationBlock.h"
#include "mozilla/AttributeStyles.h"
+#include "mozilla/ClearOnShutdown.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
#include "mozilla/FontPropertyTypes.h"
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp
index ebbc934466..1ea37b094f 100644
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -8,7 +8,9 @@
#include "mozilla/css/Loader.h"
+#include "MainThreadUtils.h"
#include "mozilla/ArrayUtils.h"
+#include "mozilla/css/ErrorReporter.h"
#include "mozilla/dom/DocGroup.h"
#include "mozilla/dom/FetchPriority.h"
#include "mozilla/dom/SRILogHelper.h"
@@ -22,6 +24,7 @@
#include "mozilla/SchedulerGroup.h"
#include "mozilla/URLPreloader.h"
#include "nsIChildChannel.h"
+#include "nsIPrincipal.h"
#include "nsISupportsPriority.h"
#include "nsITimedChannel.h"
#include "nsICachingChannel.h"
@@ -34,7 +37,6 @@
#include "nsICookieJarSettings.h"
#include "mozilla/dom/Document.h"
#include "nsIURI.h"
-#include "nsNetUtil.h"
#include "nsContentUtils.h"
#include "nsIScriptSecurityManager.h"
#include "nsContentPolicyUtils.h"
@@ -64,6 +66,7 @@
#include "mozilla/css/StreamLoader.h"
#include "mozilla/SharedStyleSheetCache.h"
#include "mozilla/StaticPrefs_layout.h"
+#include "mozilla/StaticPrefs_network.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/Try.h"
@@ -308,7 +311,10 @@ SheetLoadData::SheetLoadData(
mNonce(aNonce),
mFetchPriority{aFetchPriority},
mGuessedEncoding(GetFallbackEncoding(*aLoader, aOwningNode, nullptr)),
- mCompatMode(aLoader->CompatMode(aPreloadKind)) {
+ mCompatMode(aLoader->CompatMode(aPreloadKind)),
+ mRecordErrors(
+ aLoader && aLoader->GetDocument() &&
+ css::ErrorReporter::ShouldReportErrors(*aLoader->GetDocument())) {
MOZ_ASSERT(!aOwningNode || dom::LinkStyle::FromNode(*aOwningNode),
"Must implement LinkStyle");
MOZ_ASSERT(mTriggeringPrincipal);
@@ -349,7 +355,10 @@ SheetLoadData::SheetLoadData(css::Loader* aLoader, nsIURI* aURI,
mFetchPriority(FetchPriority::Auto),
mGuessedEncoding(GetFallbackEncoding(
*aLoader, nullptr, aParentData ? aParentData->mEncoding : nullptr)),
- mCompatMode(aLoader->CompatMode(mPreloadKind)) {
+ mCompatMode(aLoader->CompatMode(mPreloadKind)),
+ mRecordErrors(
+ aLoader && aLoader->GetDocument() &&
+ css::ErrorReporter::ShouldReportErrors(*aLoader->GetDocument())) {
MOZ_ASSERT(mLoader, "Must have a loader!");
MOZ_ASSERT(mTriggeringPrincipal);
MOZ_ASSERT(!mUseSystemPrincipal || mSyncLoad,
@@ -391,7 +400,10 @@ SheetLoadData::SheetLoadData(
mFetchPriority(aFetchPriority),
mGuessedEncoding(
GetFallbackEncoding(*aLoader, nullptr, aPreloadEncoding)),
- mCompatMode(aLoader->CompatMode(aPreloadKind)) {
+ mCompatMode(aLoader->CompatMode(aPreloadKind)),
+ mRecordErrors(
+ aLoader && aLoader->GetDocument() &&
+ css::ErrorReporter::ShouldReportErrors(*aLoader->GetDocument())) {
MOZ_ASSERT(mTriggeringPrincipal);
MOZ_ASSERT(mLoader, "Must have a loader!");
MOZ_ASSERT(!mUseSystemPrincipal || mSyncLoad,
@@ -639,43 +651,54 @@ static bool AllLoadsCanceled(const SheetLoadData& aData) {
* page and check the mimetype on the channel to make sure we're not
* loading non-text/css data in standards mode.
*/
-nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
- const nsACString& aBytes1,
- const nsACString& aBytes2,
- nsIChannel* aChannel) {
+nsresult SheetLoadData::VerifySheetReadyToParse(
+ nsresult aStatus, const nsACString& aBytes1, const nsACString& aBytes2,
+ nsIChannel* aChannel, nsIURI* aFinalChannelURI,
+ nsIPrincipal* aChannelResultPrincipal) {
LOG(("SheetLoadData::VerifySheetReadyToParse"));
- NS_ASSERTION(!mLoader->mSyncCallback, "Synchronous callback from necko");
+ NS_ASSERTION((!NS_IsMainThread() || !mLoader->mSyncCallback),
+ "Synchronous callback from necko");
if (AllLoadsCanceled(*this)) {
- LOG_WARN((" All loads are canceled, dropping"));
- mLoader->SheetComplete(*this, NS_BINDING_ABORTED);
+ if (NS_IsMainThread()) {
+ LOG_WARN((" All loads are canceled, dropping"));
+ mLoader->SheetComplete(*this, NS_BINDING_ABORTED);
+ }
+ return NS_OK;
+ }
+
+ if (!NS_IsMainThread() && mRecordErrors) {
+ // we cannot parse sheet OMT if we need to record errors
return NS_OK;
}
if (NS_FAILED(aStatus)) {
- LOG_WARN(
- (" Load failed: status 0x%" PRIx32, static_cast<uint32_t>(aStatus)));
- // Handle sheet not loading error because source was a tracking URL (or
- // fingerprinting, cryptomining, etc).
- // We make a note of this sheet node by including it in a dedicated
- // array of blocked tracking nodes under its parent document.
- //
- // Multiple sheet load instances might be tied to this request,
- // we annotate each one linked to a valid owning element (node).
- if (net::UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(
- aStatus)) {
- if (Document* doc = mLoader->GetDocument()) {
- for (SheetLoadData* data = this; data; data = data->mNext) {
- // owner node may be null but AddBlockTrackingNode can cope
- doc->AddBlockedNodeByClassifier(data->mSheet->GetOwnerNode());
+ if (NS_IsMainThread()) {
+ LOG_WARN(
+ (" Load failed: status 0x%" PRIx32, static_cast<uint32_t>(aStatus)));
+ // Handle sheet not loading error because source was a tracking URL (or
+ // fingerprinting, cryptomining, etc).
+ // We make a note of this sheet node by including it in a dedicated
+ // array of blocked tracking nodes under its parent document.
+ //
+ // Multiple sheet load instances might be tied to this request,
+ // we annotate each one linked to a valid owning element (node).
+ if (net::UrlClassifierFeatureFactory::IsClassifierBlockingErrorCode(
+ aStatus)) {
+ if (Document* doc = mLoader->GetDocument()) {
+ for (SheetLoadData* data = this; data; data = data->mNext) {
+ // owner node may be null but AddBlockTrackingNode can cope
+ doc->AddBlockedNodeByClassifier(data->mSheet->GetOwnerNode());
+ }
}
}
+ mLoader->SheetComplete(*this, aStatus);
}
- mLoader->SheetComplete(*this, aStatus);
return NS_OK;
}
if (!aChannel) {
+ MOZ_ASSERT(NS_IsMainThread());
mLoader->SheetComplete(*this, NS_OK);
return NS_OK;
}
@@ -688,10 +711,8 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
// having a chrome URI. (Whether or not chrome stylesheets come through
// this codepath seems nondeterministic.)
// Otherwise we want the potentially-HTTP-redirected URI.
- nsCOMPtr<nsIURI> channelURI;
- NS_GetFinalChannelURI(aChannel, getter_AddRefs(channelURI));
-
- if (!channelURI || !originalURI) {
+ if (!aFinalChannelURI || !originalURI) {
+ MOZ_ASSERT(NS_IsMainThread());
NS_ERROR("Someone just violated the nsIRequest contract");
LOG_WARN((" Channel without a URI. Bad!"));
mLoader->SheetComplete(*this, NS_ERROR_UNEXPECTED);
@@ -705,32 +726,33 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
if (mUseSystemPrincipal) {
result = secMan->GetSystemPrincipal(getter_AddRefs(principal));
} else {
- result = secMan->GetChannelResultPrincipal(aChannel,
- getter_AddRefs(principal));
+ if (aChannelResultPrincipal) {
+ principal = aChannelResultPrincipal;
+ result = NS_OK;
+ }
}
}
if (NS_FAILED(result)) {
- LOG_WARN((" Couldn't get principal"));
- mLoader->SheetComplete(*this, result);
+ if (NS_IsMainThread()) {
+ LOG_WARN((" Couldn't get principal"));
+ mLoader->SheetComplete(*this, result);
+ }
return NS_OK;
}
mSheet->SetPrincipal(principal);
- if (mSheet->GetCORSMode() == CORS_NONE &&
- !mTriggeringPrincipal->Subsumes(principal)) {
- mIsCrossOriginNoCORS = true;
- }
-
// If it's an HTTP channel, we want to make sure this is not an
// error document we got.
if (nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(aChannel)) {
bool requestSucceeded;
result = httpChannel->GetRequestSucceeded(&requestSucceeded);
if (NS_SUCCEEDED(result) && !requestSucceeded) {
- LOG((" Load returned an error page"));
- mLoader->SheetComplete(*this, NS_ERROR_NOT_AVAILABLE);
+ if (NS_IsMainThread()) {
+ LOG((" Load returned an error page"));
+ mLoader->SheetComplete(*this, NS_ERROR_NOT_AVAILABLE);
+ }
return NS_OK;
}
@@ -753,6 +775,9 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
contentType.IsEmpty();
if (!validType) {
+ if (!NS_IsMainThread()) {
+ return NS_OK;
+ }
const char* errorMessage;
uint32_t errorFlag;
bool sameOrigin = true;
@@ -772,7 +797,8 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
}
AutoTArray<nsString, 2> strings;
- CopyUTF8toUTF16(channelURI->GetSpecOrDefault(), *strings.AppendElement());
+ CopyUTF8toUTF16(aFinalChannelURI->GetSpecOrDefault(),
+ *strings.AppendElement());
CopyASCIItoUTF16(contentType, *strings.AppendElement());
nsCOMPtr<nsIURI> referrer = ReferrerInfo()->GetOriginalReferrer();
@@ -791,6 +817,13 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
SRIMetadata sriMetadata;
mSheet->GetIntegrity(sriMetadata);
if (!sriMetadata.IsEmpty()) {
+ if (!NS_IsMainThread()) {
+ // We dont process any further in OMT.
+ // This is because we have some main-thread only accesses below.
+ // We need to find a way to optimize this handling.
+ // See Bug 1882046.
+ return NS_OK;
+ }
nsAutoCString sourceUri;
if (mLoader->mDocument && mLoader->mDocument->GetDocumentURI()) {
mLoader->mDocument->GetDocumentURI()->GetAsciiSpec(sourceUri);
@@ -815,9 +848,13 @@ nsresult SheetLoadData::VerifySheetReadyToParse(nsresult aStatus,
}
}
+ if (mSheet->GetCORSMode() == CORS_NONE &&
+ !mTriggeringPrincipal->Subsumes(principal)) {
+ mIsCrossOriginNoCORS = true;
+ }
// Enough to set the URIs on mSheet, since any sibling datas we have share
// the same mInner as mSheet and will thus get the same URI.
- mSheet->SetURIs(channelURI, originalURI, channelURI);
+ mSheet->SetURIs(aFinalChannelURI, originalURI, aFinalChannelURI);
ReferrerPolicy policy =
nsContentUtils::GetReferrerPolicyFromChannel(aChannel);
@@ -1353,11 +1390,11 @@ nsresult Loader::LoadSheet(SheetLoadData& aLoadData, SheetState aSheetState,
void Loader::AdjustPriority(const SheetLoadData& aLoadData,
nsIChannel* aChannel) {
- if (!StaticPrefs::network_fetchpriority_enabled()) {
- if (!aLoadData.ShouldDefer() && aLoadData.IsLinkRelPreload()) {
- SheetLoadData::PrioritizeAsPreload(aChannel);
- }
+ if (!aLoadData.ShouldDefer() && aLoadData.IsLinkRelPreload()) {
+ SheetLoadData::PrioritizeAsPreload(aChannel);
+ }
+ if (!StaticPrefs::network_fetchpriority_enabled()) {
return;
}
@@ -1367,32 +1404,27 @@ void Loader::AdjustPriority(const SheetLoadData& aLoadData,
return;
}
- // Adjusting priorites is specified as implementation-defined. To align with
- // other browsers for potentially important cases, some adjustments are made
- // according to
- // <https://web.dev/articles/fetch-priority#browser_priority_and_fetchpriority>.
- const int32_t supportsPriority = [&]() {
+ // Adjusting priorites is specified as implementation-defined.
+ // See corresponding preferences in StaticPrefList.yaml for more context.
+ const int32_t supportsPriorityDelta = [&]() {
if (aLoadData.ShouldDefer()) {
- return nsISupportsPriority::PRIORITY_LOW;
+ return FETCH_PRIORITY_ADJUSTMENT_FOR(deferred_style,
+ aLoadData.mFetchPriority);
}
- switch (aLoadData.mFetchPriority) {
- case FetchPriority::Auto: {
- return nsISupportsPriority::PRIORITY_HIGHEST;
- }
- case FetchPriority::High: {
- return nsISupportsPriority::PRIORITY_HIGHEST;
- }
- case FetchPriority::Low: {
- return nsISupportsPriority::PRIORITY_HIGH;
- }
+ if (aLoadData.IsLinkRelPreload()) {
+ return FETCH_PRIORITY_ADJUSTMENT_FOR(link_preload_style,
+ aLoadData.mFetchPriority);
}
-
- MOZ_ASSERT_UNREACHABLE();
- return nsISupportsPriority::PRIORITY_HIGHEST;
+ return FETCH_PRIORITY_ADJUSTMENT_FOR(non_deferred_style,
+ aLoadData.mFetchPriority);
}();
- LogPriorityMapping(sCssLoaderLog, aLoadData.mFetchPriority, supportsPriority);
- sp->SetPriority(supportsPriority);
+ sp->AdjustPriority(supportsPriorityDelta);
+#ifdef DEBUG
+ int32_t adjustedPriority;
+ sp->GetPriority(&adjustedPriority);
+ LogPriorityMapping(sCssLoaderLog, aLoadData.mFetchPriority, adjustedPriority);
+#endif
}
nsresult Loader::LoadSheetAsyncInternal(SheetLoadData& aLoadData,
@@ -1582,32 +1614,35 @@ nsresult Loader::LoadSheetAsyncInternal(SheetLoadData& aLoadData,
/**
* ParseSheet handles parsing the data stream.
*/
-Loader::Completed Loader::ParseSheet(const nsACString& aBytes,
- SheetLoadData& aLoadData,
- AllowAsyncParse aAllowAsync) {
+Loader::Completed Loader::ParseSheet(
+ const nsACString& aBytes, const RefPtr<SheetLoadDataHolder>& aLoadData,
+ AllowAsyncParse aAllowAsync) {
LOG(("css::Loader::ParseSheet"));
- if (aLoadData.mURI) {
- LOG_URI(" Load succeeded for URI: '%s', parsing", aLoadData.mURI);
+ SheetLoadData* loadData = aLoadData->get();
+ MOZ_ASSERT(loadData);
+
+ if (loadData->mURI) {
+ LOG_URI(" Load succeeded for URI: '%s', parsing", loadData->mURI);
}
AUTO_PROFILER_LABEL_CATEGORY_PAIR_RELEVANT_FOR_JS(LAYOUT_CSSParsing);
++mParsedSheetCount;
- aLoadData.mIsBeingParsed = true;
+ loadData->mIsBeingParsed = true;
- StyleSheet* sheet = aLoadData.mSheet;
+ StyleSheet* sheet = loadData->mSheet;
MOZ_ASSERT(sheet);
// Some cases, like inline style and UA stylesheets, need to be parsed
// synchronously. The former may trigger child loads, the latter must not.
- if (aLoadData.mSyncLoad || aAllowAsync == AllowAsyncParse::No) {
- sheet->ParseSheetSync(this, aBytes, &aLoadData);
- aLoadData.mIsBeingParsed = false;
+ if (loadData->mSyncLoad || aAllowAsync == AllowAsyncParse::No) {
+ sheet->ParseSheetSync(this, aBytes, loadData);
+ loadData->mIsBeingParsed = false;
- bool noPendingChildren = aLoadData.mPendingChildren == 0;
- MOZ_ASSERT_IF(aLoadData.mSyncLoad, noPendingChildren);
+ bool noPendingChildren = loadData->mPendingChildren == 0;
+ MOZ_ASSERT_IF(loadData->mSyncLoad, noPendingChildren);
if (noPendingChildren) {
- SheetComplete(aLoadData, NS_OK);
+ SheetComplete(*loadData, NS_OK);
return Completed::Yes;
}
return Completed::No;
@@ -1621,9 +1656,9 @@ Loader::Completed Loader::ParseSheet(const nsACString& aBytes,
sheet->ParseSheet(*this, aBytes, aLoadData)
->Then(
GetMainThreadSerialEventTarget(), __func__,
- [loadData = RefPtr<SheetLoadData>(&aLoadData)](bool aDummy) {
+ [loadData = aLoadData](bool aDummy) {
MOZ_ASSERT(NS_IsMainThread());
- loadData->SheetFinishedParsingAsync();
+ loadData->get()->SheetFinishedParsingAsync();
},
[] { MOZ_CRASH("rejected parse promise"); });
return Completed::No;
@@ -1847,7 +1882,10 @@ Result<Loader::LoadSheetResult, nsresult> Loader::LoadInlineStyle(
// effects of inline stylesheets are visible immediately (aside from
// @imports).
NS_ConvertUTF16toUTF8 utf8(aBuffer);
- completed = ParseSheet(utf8, *data, AllowAsyncParse::No);
+ RefPtr<SheetLoadDataHolder> holder(
+ new nsMainThreadPtrHolder<css::SheetLoadData>(__func__, data.get(),
+ true));
+ completed = ParseSheet(utf8, holder, AllowAsyncParse::No);
if (completed == Completed::Yes) {
if (isWorthCaching) {
mInlineSheets.InsertOrUpdate(aBuffer, std::move(sheet));
diff --git a/layout/style/Loader.h b/layout/style/Loader.h
index ba60218e94..70eefffb4a 100644
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -590,7 +590,8 @@ class Loader final {
//
// If this function returns Completed::Yes, then ParseSheet also called
// SheetComplete on aLoadData.
- Completed ParseSheet(const nsACString&, SheetLoadData&, AllowAsyncParse);
+ Completed ParseSheet(const nsACString&, const RefPtr<SheetLoadDataHolder>&,
+ AllowAsyncParse);
// The load of the sheet in the load data is done, one way or another.
// Do final cleanup.
@@ -646,7 +647,7 @@ class Loader final {
uint32_t mPendingLoadCount = 0;
// The number of stylesheets that we have parsed, for testing purposes.
- uint32_t mParsedSheetCount = 0;
+ Atomic<uint32_t, MemoryOrdering::Relaxed> mParsedSheetCount{0};
bool mEnabled = true;
diff --git a/layout/style/PseudoStyleType.h b/layout/style/PseudoStyleType.h
index 6804b500c3..88eb4e4cf8 100644
--- a/layout/style/PseudoStyleType.h
+++ b/layout/style/PseudoStyleType.h
@@ -7,6 +7,7 @@
#ifndef mozilla_PseudoStyleType_h
#define mozilla_PseudoStyleType_h
+#include <cstddef>
#include <cstdint>
#include <iosfwd>
diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml
index cc6d13fb5e..20e1ca4116 100644
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -186,16 +186,9 @@ allowlist-vars = [
"NODE_.*",
"ELEMENT_.*",
"NS_FONT_.*",
- "NS_STYLE_.*",
- "NS_MATHML_.*",
- "NS_RADIUS_.*",
- "BORDER_COLOR_.*",
- "BORDER_STYLE_.*",
"CSS_PSEUDO_ELEMENT_.*",
"SERVO_CSS_PSEUDO_ELEMENT_FLAGS_.*",
"kNameSpaceID_.*",
- "kGenericFont_.*",
- "kPresContext_.*",
"nsNameSpaceManager_.*",
"GECKO_IS_NIGHTLY",
"NS_SAME_AS_FOREGROUND_COLOR",
@@ -205,9 +198,7 @@ allowlist-vars = [
# TODO(emilio): A bunch of types here can go away once we generate bindings and
# structs together.
allowlist-types = [
- "ServoCssRules",
"nsFontFaceRuleContainer",
- "Matrix4x4Components",
"mozilla::ComputedKeyframeValues",
"mozilla::Keyframe",
"mozilla::PropertyValuePair",
@@ -223,7 +214,6 @@ allowlist-types = [
"mozilla::ServoElementSnapshot.*",
"mozilla::ComputedStyle",
"mozilla::StyleSheet",
- "mozilla::ServoStyleSheetInner",
"mozilla::ServoStyleSetSizes",
"mozilla::ServoTraversalStatistics",
"mozilla::css::LoaderReusableStyleSheets",
@@ -247,27 +237,14 @@ allowlist-types = [
"mozilla::gfx::Float",
"mozilla::gfx::FontVariation",
"mozilla::gfx::FontPaletteValueSet",
- "mozilla::gfx::FontPaletteValueSet::PaletteValeus",
"mozilla::StyleImageLayerAttachment",
"gfxFontFeature",
"gfxFontVariation",
- ".*ThreadSafe.*Holder",
- "AnonymousContent",
- "AudioContext",
- "DefaultDelete",
- "DOMIntersectionObserverEntry",
"Element",
- "mozilla::FontSizePrefs",
- "FragmentOrURL",
- "FrameRequestCallback",
- "GeckoParserExtraData",
"GeckoFontMetrics",
"gfxFontFeatureValueSet",
- "GridNamedArea",
"mozilla::HalfCorner",
"Image",
- "ImageURL",
- "Keyframe",
"mozilla::MediumFeaturesChangedResult",
"nsAttrName",
"nsAttrValue",
@@ -280,15 +257,7 @@ allowlist-types = [
"nsCSSPropertyID",
"nsCSSPropertyIDSet",
"nsCSSProps",
- "nsCSSShadowArray",
"nsCSSValue",
- "nsCSSValueList",
- "nsCSSValueList_heap",
- "nsCSSValuePair_heap",
- "nsCSSValuePairList",
- "nsCSSValuePairList_heap",
- "nsCSSValueTriplet_heap",
- "nsCursorImage",
"nsFont",
"nsAtom",
"nsDynamicAtom",
@@ -299,19 +268,11 @@ allowlist-types = [
"nsSize",
"nsStyleBackground",
"nsStyleBorder",
- "nsStyleColor",
"nsStyleColumn",
"nsStyleContent",
- "nsStyleContentData",
- "ComputedStyle",
- "nsStyleCounterData",
"nsStyleDisplay",
"nsStyleEffects",
- "nsStyleFilter",
"nsStyleFont",
- "nsStyleGradient",
- "nsStyleGridTemplate",
- "nsStyleImage",
"nsStyleImageLayers",
"nsStyleList",
"nsStyleMargin",
@@ -319,37 +280,17 @@ allowlist-types = [
"nsStylePadding",
"nsStylePage",
"nsStylePosition",
- "nsStyleSides",
"nsStyleSVG",
- "nsStyleSVGOpacitySource",
"nsStyleSVGReset",
"nsStyleTable",
"nsStyleTableBorder",
"nsStyleText",
"nsStyleTextReset",
"nsStyleUIReset",
- "nsStyleUnion",
"nsStyleUI",
"nsStyleVisibility",
"nsStyleXUL",
"nsTArrayHeader",
- "Position",
- "PropertyValuePair",
- "Runnable",
- "ServoAttrSnapshot",
- "ServoComputedData",
- "ServoComputedDataBorrowed",
- "ServoElementSnapshot",
- "ComputedStyleStrong",
- "ComputedStyleBorrowed",
- "ComputedStyleBorrowedOrNull",
- "SheetParsingMode",
- "StaticRefPtr",
- "StyleAnimation",
- "StyleGeometryBox",
- "StyleShapeSource",
- "StyleTransition",
- "ThemeWidgetType",
"mozilla::UniquePtr",
"mozilla::DeclarationBlock",
"mozilla::DefaultDelete",
@@ -430,6 +371,7 @@ opaque-types = [
cbindgen-types = [
{ gecko = "StyleAnimationIterationCount", servo = "crate::values::computed::AnimationIterationCount" },
{ gecko = "StyleAnimationTimeline", servo = "crate::values::computed::AnimationTimeline" },
+ { gecko = "StyleTransitionBehavior", servo = "crate::values::computed::TransitionBehavior" },
{ gecko = "StyleAppearance", servo = "crate::values::specified::Appearance" },
{ gecko = "StyleAspectRatio", servo = "crate::values::computed::position::AspectRatio" },
{ gecko = "StyleAtom", servo = "crate::Atom" },
diff --git a/layout/style/ServoCSSParser.cpp b/layout/style/ServoCSSParser.cpp
index 92e1271f2c..89f17f1733 100644
--- a/layout/style/ServoCSSParser.cpp
+++ b/layout/style/ServoCSSParser.cpp
@@ -33,6 +33,16 @@ bool ServoCSSParser::ComputeColor(ServoStyleSet* aStyleSet,
}
/* static */
+bool ServoCSSParser::ColorTo(const nsACString& aFromColor,
+ const nsACString& aToColorSpace,
+ nsACString* aResultColor,
+ nsTArray<float>* aResultComponents,
+ bool* aResultAdjusted, css::Loader* aLoader) {
+ return Servo_ColorTo(&aFromColor, &aToColorSpace, aResultColor,
+ aResultComponents, aResultAdjusted, aLoader);
+}
+
+/* static */
already_AddRefed<StyleLockedDeclarationBlock> ServoCSSParser::ParseProperty(
nsCSSPropertyID aProperty, const nsACString& aValue,
const ParsingEnvironment& aParsingEnvironment,
diff --git a/layout/style/ServoCSSParser.h b/layout/style/ServoCSSParser.h
index 4bbde6a0e8..583a2eebd9 100644
--- a/layout/style/ServoCSSParser.h
+++ b/layout/style/ServoCSSParser.h
@@ -80,6 +80,27 @@ class ServoCSSParser {
css::Loader* aLoader = nullptr);
/**
+ * Takes a CSS <color> and convert it to another color space.
+ *
+ * @param aStyleSet The style set whose nsPresContext will be used to
+ * compute system colors and other special color values.
+ * @param aFromColor The CSS <color> we use to convert from.
+ * @param aToColorSpace The CSS <color-space> to convert the color into.
+ * @param aResultColor The resulting converted color value.
+ * @param aResultAdjusted Whether the color was adjusted to fit into the SRGB
+ color space.
+ * @param aLoader The CSS loader for document we're parsing a color for,
+ * so that parse errors can be reported to the console. If nullptr, errors
+ * won't be reported to the console.
+ * @return Whether aFromColor and aToColorSpace was successfully parsed and
+ * aResultColor and aResultAdjusted was set.
+ */
+ static bool ColorTo(const nsACString& aFromColor,
+ const nsACString& aToColorSpace, nsACString* aResultColor,
+ nsTArray<float>* aResultComponents, bool* aResultAdjusted,
+ css::Loader* aLoader = nullptr);
+
+ /**
* Parse a string representing a CSS property value into a
* StyleLockedDeclarationBlock.
*
diff --git a/layout/style/ServoStyleConstsInlines.h b/layout/style/ServoStyleConstsInlines.h
index b6a574037a..1985e8fbeb 100644
--- a/layout/style/ServoStyleConstsInlines.h
+++ b/layout/style/ServoStyleConstsInlines.h
@@ -507,20 +507,15 @@ StyleCSSPixelLength StyleCSSPixelLength::ScaledBy(float aScale) const {
return FromPixels(ToCSSPixels() * aScale);
}
-nscoord StyleCSSPixelLength::ToAppUnits() const {
- // We want to resolve the length part of the calc() expression rounding 0.5
- // away from zero, instead of the default behavior of
- // NSToCoordRound{,WithClamp} which do floor(x + 0.5).
- //
- // This is what the rust code in the app_units crate does, and not doing this
- // would regress bug 1323735, for example.
- //
- // FIXME(emilio, bug 1528114): Probably we should do something smarter.
- if (IsZero()) {
- // Avoid the expensive FP math below.
- return 0;
- }
- float length = _0 * float(mozilla::AppUnitsPerCSSPixel());
+namespace detail {
+static inline nscoord DefaultPercentLengthToAppUnits(float aPixelLength) {
+ return NSToCoordTruncClamped(aPixelLength);
+}
+
+static inline nscoord DefaultLengthToAppUnits(float aPixelLength) {
+ // We want to round lengths rounding 0.5 away from zero, instead of the
+ // default behavior of NSToCoordRound{,WithClamp} which do floor(x + 0.5).
+ float length = aPixelLength * float(mozilla::AppUnitsPerCSSPixel());
if (length >= float(nscoord_MAX)) {
return nscoord_MAX;
}
@@ -529,6 +524,15 @@ nscoord StyleCSSPixelLength::ToAppUnits() const {
}
return NSToIntRound(length);
}
+} // namespace detail
+
+nscoord StyleCSSPixelLength::ToAppUnits() const {
+ if (IsZero()) {
+ // Avoid the expensive FP math below.
+ return 0;
+ }
+ return detail::DefaultLengthToAppUnits(_0);
+}
bool LengthPercentage::IsLength() const { return Tag() == TAG_LENGTH; }
@@ -693,6 +697,11 @@ CSSCoord StyleCalcLengthPercentage::ResolveToCSSPixels(CSSCoord aBasis) const {
return Servo_ResolveCalcLengthPercentage(this, aBasis);
}
+nscoord StyleCalcLengthPercentage::Resolve(nscoord aBasis) const {
+ return detail::DefaultLengthToAppUnits(
+ ResolveToCSSPixels(CSSPixel::FromAppUnits(aBasis)));
+}
+
template <>
void StyleCalcNode::ScaleLengthsBy(float);
@@ -708,20 +717,18 @@ CSSCoord LengthPercentage::ResolveToCSSPixels(CSSCoord aPercentageBasis) const {
template <typename T>
CSSCoord LengthPercentage::ResolveToCSSPixelsWith(T aPercentageGetter) const {
- static_assert(std::is_same<decltype(aPercentageGetter()), CSSCoord>::value,
- "Should return CSS pixels");
+ static_assert(std::is_same_v<decltype(aPercentageGetter()), CSSCoord>);
if (ConvertsToLength()) {
return ToLengthInCSSPixels();
}
return ResolveToCSSPixels(aPercentageGetter());
}
-template <typename T, typename U>
-nscoord LengthPercentage::Resolve(T aPercentageGetter, U aRounder) const {
- static_assert(std::is_same<decltype(aPercentageGetter()), nscoord>::value,
- "Should return app units");
- static_assert(std::is_same<decltype(aRounder(1.0f)), nscoord>::value,
- "Should return app units");
+template <typename T, typename PercentRounder>
+nscoord LengthPercentage::Resolve(T aPercentageGetter,
+ PercentRounder aPercentRounder) const {
+ static_assert(std::is_same_v<decltype(aPercentageGetter()), nscoord>);
+ static_assert(std::is_same_v<decltype(aPercentRounder(1.0f)), nscoord>);
if (ConvertsToLength()) {
return ToLength();
}
@@ -730,29 +737,26 @@ nscoord LengthPercentage::Resolve(T aPercentageGetter, U aRounder) const {
}
nscoord basis = aPercentageGetter();
if (IsPercentage()) {
- return aRounder(basis * AsPercentage()._0);
+ return aPercentRounder(basis * AsPercentage()._0);
}
- return AsCalc().Resolve(basis, aRounder);
+ return AsCalc().Resolve(basis);
}
-// Note: the static_cast<> wrappers below are needed to disambiguate between
-// the versions of NSToCoordTruncClamped that take float vs. double as the arg.
nscoord LengthPercentage::Resolve(nscoord aPercentageBasis) const {
return Resolve([=] { return aPercentageBasis; },
- static_cast<nscoord (*)(float)>(NSToCoordTruncClamped));
+ detail::DefaultPercentLengthToAppUnits);
}
template <typename T>
nscoord LengthPercentage::Resolve(T aPercentageGetter) const {
- return Resolve(aPercentageGetter,
- static_cast<nscoord (*)(float)>(NSToCoordTruncClamped));
+ return Resolve(aPercentageGetter, detail::DefaultPercentLengthToAppUnits);
}
-template <typename T>
+template <typename PercentRounder>
nscoord LengthPercentage::Resolve(nscoord aPercentageBasis,
- T aPercentageRounder) const {
+ PercentRounder aPercentRounder) const {
return Resolve([aPercentageBasis] { return aPercentageBasis; },
- aPercentageRounder);
+ aPercentRounder);
}
void LengthPercentage::ScaleLengthsBy(float aScale) {
diff --git a/layout/style/ServoStyleSet.h b/layout/style/ServoStyleSet.h
index d7225349cc..eee6cba0f7 100644
--- a/layout/style/ServoStyleSet.h
+++ b/layout/style/ServoStyleSet.h
@@ -686,8 +686,8 @@ class ServoStyleSet {
// Stores pointers to our cached ComputedStyles for non-inheriting anonymous
// boxes.
- EnumeratedArray<nsCSSAnonBoxes::NonInheriting,
- nsCSSAnonBoxes::NonInheriting::_Count, RefPtr<ComputedStyle>>
+ EnumeratedArray<nsCSSAnonBoxes::NonInheriting, RefPtr<ComputedStyle>,
+ size_t(nsCSSAnonBoxes::NonInheriting::_Count)>
mNonInheritingComputedStyles;
public:
diff --git a/layout/style/SheetLoadData.h b/layout/style/SheetLoadData.h
index c817e4c1f3..6621af35bd 100644
--- a/layout/style/SheetLoadData.h
+++ b/layout/style/SheetLoadData.h
@@ -90,7 +90,9 @@ class SheetLoadData final
// so aBytes1 and aBytes2 refer to those pieces.
nsresult VerifySheetReadyToParse(nsresult aStatus, const nsACString& aBytes1,
const nsACString& aBytes2,
- nsIChannel* aChannel);
+ nsIChannel* aChannel,
+ nsIURI* aFinalChannelURI,
+ nsIPrincipal* aPrincipal);
NS_DECL_ISUPPORTS
@@ -237,6 +239,8 @@ class SheetLoadData final
// listening for the load.
bool mIntentionallyDropped = false;
+ const bool mRecordErrors;
+
bool ShouldDefer() const { return mWasAlternate || !mMediaMatched; }
RefPtr<StyleSheet> ValueForCache() const;
diff --git a/layout/style/StreamLoader.cpp b/layout/style/StreamLoader.cpp
index 3e8bd37d76..3c614d7d0c 100644
--- a/layout/style/StreamLoader.cpp
+++ b/layout/style/StreamLoader.cpp
@@ -5,8 +5,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/css/StreamLoader.h"
-
+#include "mozilla/StaticPrefs_network.h"
#include "mozilla/Encoding.h"
+#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/TaskQueue.h"
#include "nsContentUtils.h"
#include "nsIChannel.h"
@@ -14,16 +15,21 @@
#include "nsIThreadRetargetableRequest.h"
#include "nsIStreamTransportService.h"
#include "nsNetCID.h"
+#include "nsNetUtil.h"
+#include "nsProxyRelease.h"
#include "nsServiceManagerUtils.h"
namespace mozilla::css {
StreamLoader::StreamLoader(SheetLoadData& aSheetLoadData)
- : mSheetLoadData(&aSheetLoadData), mStatus(NS_OK) {}
+ : mSheetLoadData(&aSheetLoadData),
+ mStatus(NS_OK),
+ mMainThreadSheetLoadData(new nsMainThreadPtrHolder<SheetLoadData>(
+ "StreamLoader::SheetLoadData", mSheetLoadData, false)) {}
StreamLoader::~StreamLoader() {
#ifdef NIGHTLY_BUILD
- MOZ_RELEASE_ASSERT(mOnStopRequestCalled || mChannelOpenFailed);
+ MOZ_RELEASE_ASSERT(mOnStopProcessingDone || mChannelOpenFailed);
#endif
}
@@ -34,6 +40,7 @@ NS_IMPL_ISUPPORTS(StreamLoader, nsIStreamListener,
NS_IMETHODIMP
StreamLoader::OnStartRequest(nsIRequest* aRequest) {
MOZ_ASSERT(aRequest);
+ mRequest = aRequest;
mSheetLoadData->NotifyStart(aRequest);
// It's kinda bad to let Web content send a number that results
@@ -52,6 +59,12 @@ StreamLoader::OnStartRequest(nsIRequest* aRequest) {
return (mStatus = NS_ERROR_OUT_OF_MEMORY);
}
}
+ NS_GetFinalChannelURI(channel, getter_AddRefs(mFinalChannelURI));
+ nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
+ // we dont return on error here as the error is handled in
+ // SheetLoadData::VerifySheetReadyToParse
+ Unused << secMan->GetChannelResultPrincipal(
+ channel, getter_AddRefs(mChannelResultPrincipal));
}
if (nsCOMPtr<nsIThreadRetargetableRequest> rr = do_QueryInterface(aRequest)) {
nsCOMPtr<nsIEventTarget> sts =
@@ -73,6 +86,13 @@ StreamLoader::OnStartRequest(nsIRequest* aRequest) {
return *info.mExpirationTime;
}();
+ // We need to block block resolution of parse promise until we receive
+ // OnStopRequest on Main thread. This is necessary because parse promise
+ // resolution fires OnLoad event OnLoad event must not be dispatched until
+ // OnStopRequest in main thread is processed, for stuff like performance
+ // resource entries.
+ mSheetLoadData->mSheet->BlockParsePromise();
+
return NS_OK;
}
@@ -81,39 +101,80 @@ StreamLoader::CheckListenerChain() { return NS_OK; }
NS_IMETHODIMP
StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
-#ifdef NIGHTLY_BUILD
- MOZ_RELEASE_ASSERT(!mOnStopRequestCalled);
- mOnStopRequestCalled = true;
-#endif
+ MOZ_ASSERT_IF(!StaticPrefs::network_send_OnDataFinished_cssLoader(),
+ !mOnStopProcessingDone);
+
+ // StreamLoader::OnStopRequest can get triggered twice for a request.
+ // Once from the path
+ // nsIThreadRetargetableStreamListener::OnDataFinished->StreamLoader::OnDataFinished
+ // (non-main thread) and
+ // once from nsIRequestObserver::OnStopRequest path (main thread). It is
+ // guaranteed that we will always get
+ // nsIThreadRetargetableStreamListener::OnDataFinished trigger first and this
+ // is always followed by nsIRequestObserver::OnStopRequest
+
+ // If we are executing OnStopRequest OMT, we need to block resolution of parse
+ // promise and unblock again if we are executing this in main thread.
+ // Resolution of parse promise fires onLoadEvent and this should not happen
+ // before main thread OnStopRequest is dispatched.
+ if (NS_IsMainThread()) {
+ if (mOnDataFinishedTime) {
+ // collect telemetry for the delta between OnDataFinished and
+ // OnStopRequest
+ TimeDuration delta = (TimeStamp::Now() - mOnDataFinishedTime);
+ glean::networking::http_content_cssloader_ondatafinished_to_onstop_delay
+ .AccumulateRawDuration(delta);
+ }
+ mSheetLoadData->mSheet->UnblockParsePromise();
+ }
+
+ if (mOnStopProcessingDone) {
+ return NS_OK;
+ }
+ mOnStopProcessingDone = true;
nsresult rv = mStatus;
// Decoded data
nsCString utf8String;
{
- // Hold the nsStringBuffer for the bytes from the stack to ensure release
- // no matter which return branch is taken.
- nsCString bytes = std::move(mBytes);
-
nsCOMPtr<nsIChannel> channel = do_QueryInterface(aRequest);
if (NS_FAILED(mStatus)) {
- mSheetLoadData->VerifySheetReadyToParse(mStatus, ""_ns, ""_ns, channel);
+ mSheetLoadData->VerifySheetReadyToParse(mStatus, ""_ns, ""_ns, channel,
+ mFinalChannelURI,
+ mChannelResultPrincipal);
+
+ if (!NS_IsMainThread()) {
+ // When processing OMT, we have code paths in VerifySheetReadyToParse
+ // that are main-thread only. We bail on such scenarios and continue
+ // processing them on main thread OnStopRequest.
+ mOnStopProcessingDone = false;
+ }
return mStatus;
}
- rv = mSheetLoadData->VerifySheetReadyToParse(aStatus, mBOMBytes, bytes,
- channel);
+ rv = mSheetLoadData->VerifySheetReadyToParse(aStatus, mBOMBytes, mBytes,
+ channel, mFinalChannelURI,
+ mChannelResultPrincipal);
if (rv != NS_OK_PARSE_SHEET) {
+ if (!NS_IsMainThread()) {
+ mOnStopProcessingDone = false;
+ }
return rv;
}
- // BOM detection generally happens during the write callback, but that won't
- // have happened if fewer than three bytes were received.
+ // At this point all the conditions that requires us to run on main
+ // are checked in VerifySheetReadyToParse
+
+ // BOM detection generally happens during the write callback, but that
+ // won't have happened if fewer than three bytes were received.
if (mEncodingFromBOM.isNothing()) {
HandleBOM();
MOZ_ASSERT(mEncodingFromBOM.isSome());
}
-
+ // Hold the nsStringBuffer for the bytes from the stack to ensure release
+ // after its scope ends
+ nsCString bytes = std::move(mBytes);
// The BOM handling has happened, but we still may not have an encoding if
// there was no BOM. Ensure we have one.
const Encoding* encoding = mEncodingFromBOM.value();
@@ -142,9 +203,11 @@ StreamLoader::OnStopRequest(nsIRequest* aRequest, nsresult aStatus) {
// For reasons I don't understand, factoring the below lines into
// a method on SheetLoadData resulted in a linker error. Hence,
// accessing fields of mSheetLoadData from here.
- mSheetLoadData->mLoader->ParseSheet(utf8String, *mSheetLoadData,
+ mSheetLoadData->mLoader->ParseSheet(utf8String, mMainThreadSheetLoadData,
Loader::AllowAsyncParse::Yes);
+ mRequest = nullptr;
+
return NS_OK;
}
@@ -159,9 +222,6 @@ StreamLoader::OnDataAvailable(nsIRequest*, nsIInputStream* aInputStream,
return aInputStream->ReadSegments(WriteSegmentFun, this, aCount, &dummy);
}
-NS_IMETHODIMP
-StreamLoader::OnDataFinished(nsresult aStatus) { return NS_OK; }
-
void StreamLoader::HandleBOM() {
MOZ_ASSERT(mEncodingFromBOM.isNothing());
MOZ_ASSERT(mBytes.IsEmpty());
@@ -176,6 +236,18 @@ void StreamLoader::HandleBOM() {
mBOMBytes.Truncate(bomLength);
}
+NS_IMETHODIMP
+StreamLoader::OnDataFinished(nsresult aResult) {
+ if (StaticPrefs::network_send_OnDataFinished_cssLoader()) {
+ MOZ_ASSERT(mOnDataFinishedTime.IsNull(),
+ "OnDataFinished should only be called once");
+ mOnDataFinishedTime = TimeStamp::Now();
+ return OnStopRequest(mRequest, aResult);
+ }
+
+ return NS_OK;
+}
+
nsresult StreamLoader::WriteSegmentFun(nsIInputStream*, void* aClosure,
const char* aSegment, uint32_t,
uint32_t aCount, uint32_t* aWriteCount) {
diff --git a/layout/style/StreamLoader.h b/layout/style/StreamLoader.h
index a34117625a..e940fc7936 100644
--- a/layout/style/StreamLoader.h
+++ b/layout/style/StreamLoader.h
@@ -9,6 +9,7 @@
#include "nsIStreamListener.h"
#include "nsIThreadRetargetableStreamListener.h"
+#include "nsIURI.h"
#include "nsString.h"
#include "mozilla/css/SheetLoadData.h"
#include "mozilla/Assertions.h"
@@ -52,10 +53,17 @@ class StreamLoader : public nsIThreadRetargetableStreamListener {
// mBytes, and store all subsequent data in that buffer.
nsCString mBytes;
nsAutoCStringN<3> mBOMBytes;
+ nsCOMPtr<nsIRequest> mRequest;
+ nsCOMPtr<nsIURI> mFinalChannelURI;
+ nsCOMPtr<nsIPrincipal> mChannelResultPrincipal;
+ // flag to indicate that we can skip processing of data in OnStopRequest
+ bool mOnStopProcessingDone{false};
+ RefPtr<SheetLoadDataHolder> mMainThreadSheetLoadData;
+
+ mozilla::TimeStamp mOnDataFinishedTime;
#ifdef NIGHTLY_BUILD
bool mChannelOpenFailed = false;
- bool mOnStopRequestCalled = false;
#endif
};
diff --git a/layout/style/StyleSheet.cpp b/layout/style/StyleSheet.cpp
index 494618d879..b1ce1d66e2 100644
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -28,7 +28,6 @@
#include "mozilla/css/SheetLoadData.h"
#include "mozAutoDocUpdate.h"
-#include "SheetLoadData.h"
namespace mozilla {
@@ -136,8 +135,12 @@ already_AddRefed<StyleSheet> StyleSheet::Constructor(
// 3. Set the sheet's disabled flag according to aOptions.
sheet->SetDisabled(aOptions.mDisabled);
+ sheet->SetURLExtraData();
sheet->SetComplete();
+ sheet->ReplaceSync(""_ns, aRv);
+ MOZ_ASSERT(!aRv.Failed());
+
// 4. Return sheet.
return sheet.forget();
}
@@ -740,7 +743,9 @@ already_AddRefed<dom::Promise> StyleSheet::Replace(const nsACString& aText,
loadData->mIsBeingParsed = true;
MOZ_ASSERT(!mReplacePromise);
mReplacePromise = promise;
- ParseSheet(*loader, aText, *loadData)
+ RefPtr<css::SheetLoadDataHolder> holder(
+ new css::SheetLoadDataHolder(__func__, loadData, false));
+ ParseSheet(*loader, aText, holder)
->Then(
target, __func__,
[loadData] { loadData->SheetFinishedParsingAsync(); },
@@ -769,7 +774,6 @@ void StyleSheet::ReplaceSync(const nsACString& aText, ErrorResult& aRv) {
// 3. Parse aText into rules.
// 4. If rules contain @imports, skip them and continue parsing.
auto* loader = mConstructorDocument->CSSLoader();
- SetURLExtraData();
RefPtr<const StyleStylesheetContents> rawContent =
Servo_StyleSheet_FromUTF8Bytes(
loader, this,
@@ -1159,28 +1163,19 @@ already_AddRefed<StyleSheet> StyleSheet::CreateEmptyChildSheet(
return child.forget();
}
-// We disable parallel stylesheet parsing if the browser is recording CSS errors
-// (which parallel parsing can't handle).
-static bool AllowParallelParse(css::Loader& aLoader, URLExtraData* aUrlData) {
- Document* doc = aLoader.GetDocument();
- if (doc && css::ErrorReporter::ShouldReportErrors(*doc)) {
- return false;
- }
- // Otherwise we can parse in parallel.
- return true;
-}
-
RefPtr<StyleSheetParsePromise> StyleSheet::ParseSheet(
css::Loader& aLoader, const nsACString& aBytes,
- css::SheetLoadData& aLoadData) {
+ const RefPtr<css::SheetLoadDataHolder>& aLoadData) {
MOZ_ASSERT(mParsePromise.IsEmpty());
+ MOZ_ASSERT_IF(NS_IsMainThread(), mAsyncParseBlockers == 0);
+
RefPtr<StyleSheetParsePromise> p = mParsePromise.Ensure(__func__);
- if (!aLoadData.ShouldDefer()) {
+ if (!aLoadData->get()->ShouldDefer()) {
mParsePromise.SetTaskPriority(nsIRunnablePriority::PRIORITY_RENDER_BLOCKING,
__func__);
}
+ BlockParsePromise();
SetURLExtraData();
-
// @import rules are disallowed due to this decision:
// https://github.com/WICG/construct-stylesheets/issues/119#issuecomment-588352418
// We may allow @import rules again in the future.
@@ -1191,26 +1186,26 @@ RefPtr<StyleSheetParsePromise> StyleSheet::ParseSheet(
const bool shouldRecordCounters =
aLoader.GetDocument() && aLoader.GetDocument()->GetStyleUseCounters() &&
!urlData->ChromeRulesEnabled();
- if (!AllowParallelParse(aLoader, urlData)) {
+
+ if (aLoadData->get()->mRecordErrors) {
+ MOZ_ASSERT(NS_IsMainThread());
UniquePtr<StyleUseCounters> counters;
if (shouldRecordCounters) {
counters.reset(Servo_UseCounters_Create());
}
-
RefPtr<StyleStylesheetContents> contents =
Servo_StyleSheet_FromUTF8Bytes(
- &aLoader, this, &aLoadData, &aBytes, mParsingMode, urlData,
- aLoadData.mCompatMode,
+ &aLoader, this, aLoadData->get(), &aBytes, mParsingMode, urlData,
+ aLoadData->get()->mCompatMode,
/* reusable_sheets = */ nullptr, counters.get(), allowImportRules,
StyleSanitizationKind::None,
/* sanitized_output = */ nullptr)
.Consume();
FinishAsyncParse(contents.forget(), std::move(counters));
} else {
- auto holder = MakeRefPtr<css::SheetLoadDataHolder>(__func__, &aLoadData);
- Servo_StyleSheet_FromUTF8BytesAsync(holder, urlData, &aBytes, mParsingMode,
- aLoadData.mCompatMode,
- shouldRecordCounters, allowImportRules);
+ Servo_StyleSheet_FromUTF8BytesAsync(
+ aLoadData, urlData, &aBytes, mParsingMode,
+ aLoadData->get()->mCompatMode, shouldRecordCounters, allowImportRules);
}
return p;
@@ -1224,7 +1219,7 @@ void StyleSheet::FinishAsyncParse(
Inner().mContents = aSheetContents;
Inner().mUseCounters = std::move(aUseCounters);
FixUpRuleListAfterContentsChangeIfNeeded();
- mParsePromise.Resolve(true, __func__);
+ UnblockParsePromise();
}
void StyleSheet::ParseSheetSync(
diff --git a/layout/style/StyleSheet.h b/layout/style/StyleSheet.h
index 1dbcad1e01..873ff2f4fc 100644
--- a/layout/style/StyleSheet.h
+++ b/layout/style/StyleSheet.h
@@ -7,6 +7,7 @@
#ifndef mozilla_StyleSheet_h
#define mozilla_StyleSheet_h
+#include "mozilla/Assertions.h"
#include "mozilla/css/SheetParsingMode.h"
#include "mozilla/dom/CSSStyleSheetBinding.h"
#include "mozilla/dom/SRIMetadata.h"
@@ -15,11 +16,13 @@
#include "mozilla/RefPtr.h"
#include "mozilla/ServoBindingTypes.h"
#include "mozilla/ServoTypes.h"
+#include "mozilla/StaticPrefs_network.h"
#include "mozilla/StyleSheetInfo.h"
#include "nsICSSLoaderObserver.h"
#include "nsIPrincipal.h"
#include "nsWrapperCache.h"
#include "nsStringFwd.h"
+#include "nsProxyRelease.h"
class nsIGlobalObject;
class nsINode;
@@ -44,6 +47,7 @@ class Loader;
class LoaderReusableStyleSheets;
class Rule;
class SheetLoadData;
+using SheetLoadDataHolder = nsMainThreadPtrHolder<SheetLoadData>;
} // namespace css
namespace dom {
@@ -112,9 +116,9 @@ class StyleSheet final : public nsICSSLoaderObserver, public nsWrapperCache {
// SheetLoadData for this stylesheet.
// NOTE: ParseSheet can run synchronously or asynchronously
// based on the result of `AllowParallelParse`
- RefPtr<StyleSheetParsePromise> ParseSheet(css::Loader&,
- const nsACString& aBytes,
- css::SheetLoadData&);
+ RefPtr<StyleSheetParsePromise> ParseSheet(
+ css::Loader&, const nsACString& aBytes,
+ const RefPtr<css::SheetLoadDataHolder>& aLoadData);
// Common code that needs to be called after servo finishes parsing. This is
// shared between the parallel and sequential paths.
@@ -301,7 +305,7 @@ class StyleSheet final : public nsICSSLoaderObserver, public nsWrapperCache {
*/
void SetPrincipal(nsIPrincipal* aPrincipal) {
StyleSheetInfo& info = Inner();
- MOZ_ASSERT(!info.mPrincipalSet, "Should only set principal once");
+ MOZ_ASSERT_IF(info.mPrincipalSet, info.mPrincipal == aPrincipal);
if (aPrincipal) {
info.mPrincipal = aPrincipal;
#ifdef DEBUG
@@ -468,6 +472,23 @@ class StyleSheet final : public nsICSSLoaderObserver, public nsWrapperCache {
// Gets the relevant global if exists.
nsISupports* GetRelevantGlobal() const;
+ // Blocks/Unblocks resolution of parse promise
+ void BlockParsePromise() {
+#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
+ uint32_t count =
+#endif
+ ++mAsyncParseBlockers;
+ MOZ_DIAGNOSTIC_ASSERT(count);
+ }
+
+ void UnblockParsePromise() {
+ uint32_t count = --mAsyncParseBlockers;
+ MOZ_DIAGNOSTIC_ASSERT(count != UINT32_MAX);
+ if (!count && !mParsePromise.IsEmpty()) {
+ mParsePromise.Resolve(true, __func__);
+ }
+ }
+
private:
void SetModifiedRules() {
mState |= State::ModifiedRules | State::ModifiedRulesForDevtools;
@@ -591,6 +612,8 @@ class StyleSheet final : public nsICSSLoaderObserver, public nsWrapperCache {
State mState;
+ Atomic<uint32_t, ReleaseAcquire> mAsyncParseBlockers{0};
+
// Core information we get from parsed sheets, which are shared amongst
// StyleSheet clones.
//
diff --git a/layout/style/contenteditable.css b/layout/style/contenteditable.css
index a2e2ca8712..7e9a197740 100644
--- a/layout/style/contenteditable.css
+++ b/layout/style/contenteditable.css
@@ -77,10 +77,6 @@ input[contenteditable="true"][type="hidden"] {
visibility: visible !important;
}
-*|*::-moz-display-comboboxcontrol-frame {
- user-select: text;
-}
-
option:read-write {
user-select: text;
}
diff --git a/layout/style/crashtests/1397439-1.html b/layout/style/crashtests/1397439-1.html
deleted file mode 100644
index b617f8e0ed..0000000000
--- a/layout/style/crashtests/1397439-1.html
+++ /dev/null
@@ -1,6 +0,0 @@
-<!DOCTYPE html>
-<math>
-<mstyle scriptlevel=101>
-<mstyle scriptlevel=-204>
-</math>
-
diff --git a/layout/style/crashtests/1403465.html b/layout/style/crashtests/1403465.html
deleted file mode 100644
index 924392757b..0000000000
--- a/layout/style/crashtests/1403465.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
- <math class="hidden">
- <mi>x</mi>
- <mo>=</mo>
- </math>
-<script>
-window.onload = function() {
- let s = document.createElement("style");
- s.textContent = `
- body {
- line-height: 1.42857143;
- }
-
- .hidden {
- display: none;
- }
- `;
- document.body.appendChild(s);
-};
-</script>
-</body>
-</html>
diff --git a/layout/style/crashtests/411603-1.html b/layout/style/crashtests/411603-1.html
deleted file mode 100644
index 596565fbc3..0000000000
--- a/layout/style/crashtests/411603-1.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:math="http://www.w3.org/1998/Math/MathML">
-<head>
-</head>
-<body onload="document.getElementById('ms').setAttribute('scriptminsize', '9em');">
-<math:mstyle id="ms" /><span />
-</body>
-</html>
diff --git a/layout/style/crashtests/413274-1.xhtml b/layout/style/crashtests/413274-1.xhtml
deleted file mode 100644
index 19d8fab0fd..0000000000
--- a/layout/style/crashtests/413274-1.xhtml
+++ /dev/null
@@ -1,18 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-</head>
-<body>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML">
- <mstyle scriptsizemultiplier="8205" scriptlevel="15">
- <mroot>
- <mrow/>
- <mrow>
- <span xmlns="http://www.w3.org/1999/xhtml"/>
- </mrow>
- </mroot>
- </mstyle>
-</math>
-
-</body>
-</html>
diff --git a/layout/style/crashtests/418007-1.xhtml b/layout/style/crashtests/418007-1.xhtml
deleted file mode 100644
index f07a693444..0000000000
--- a/layout/style/crashtests/418007-1.xhtml
+++ /dev/null
@@ -1,24 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head></head>
-<body>
-
-<math xmlns="http://www.w3.org/1998/Math/MathML">
- <ms fontsize="8179em">
- <span xmlns="http://www.w3.org/1999/xhtml">
- <span>
- <td>
- <mfrac xmlns="http://www.w3.org/1998/Math/MathML">
- <mfrac>
- <mrow/>
- <mrow/>
- </mfrac>
- <mrow/>
- </mfrac>
- </td>
- </span>
- </span>
- </ms>
-</math>
-
-</body>
-</html>
diff --git a/layout/style/crashtests/crashtests.list b/layout/style/crashtests/crashtests.list
index 3e7d1e2669..d54f053f1b 100644
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -16,11 +16,8 @@ load 391034-1.xhtml
load 397022-1.html
load 399289-1.svg
load 404470-1.html
-load 411603-1.html
load 412588-1.html
-load 413274-1.xhtml
skip-if(Android) load chrome://reftest/content/crashtests/layout/style/crashtests/416461-1.xhtml
-load 418007-1.xhtml
load chrome://reftest/content/crashtests/layout/style/crashtests/431705-1.xhtml
load 432561-1.html
load 437170-1.html
@@ -229,7 +226,6 @@ load 1384232.html
load 1395725.html
load 1396041.html
pref(dom.animations-api.compositing.enabled,true) load 1397363-1.html
-load 1397439-1.html
load 1395719.html
load 1397091.html
load 1398479.html
@@ -251,7 +247,6 @@ load 1402419.html
load 1402472.html
load 1403028.html
load 1403433.html
-load 1403465.html
load 1403592.html
load 1403615.html
load 1403712.html
diff --git a/layout/style/nsCSSAnonBoxList.h b/layout/style/nsCSSAnonBoxList.h
index 891b34814b..4d62f5bd79 100644
--- a/layout/style/nsCSSAnonBoxList.h
+++ b/layout/style/nsCSSAnonBoxList.h
@@ -99,7 +99,6 @@ CSS_ANON_BOX(buttonContent, ":-moz-button-content")
CSS_ANON_BOX(cellContent, ":-moz-cell-content")
CSS_ANON_BOX(dropDownList, ":-moz-dropdown-list")
CSS_ANON_BOX(fieldsetContent, ":-moz-fieldset-content")
-CSS_ANON_BOX(mozDisplayComboboxControlFrame, ":-moz-display-comboboxcontrol-frame")
CSS_ANON_BOX(htmlCanvasContent, ":-moz-html-canvas-content")
CSS_WRAPPER_ANON_BOX(inlineTable, ":-moz-inline-table")
diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp
index 3b25ff9726..d40d4bc801 100644
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -733,6 +733,16 @@ static void CollectImageURLsForProperty(nsCSSPropertyID aProp,
}
}
+float nsComputedDOMStyle::UsedFontSize() {
+ UpdateCurrentStyleSources(eCSSProperty_font_size);
+
+ if (!mComputedStyle) {
+ return -1.0;
+ }
+
+ return mComputedStyle->StyleFont()->mFont.size.ToCSSPixels();
+}
+
void nsComputedDOMStyle::GetCSSImageURLs(const nsACString& aPropertyName,
nsTArray<nsCString>& aImageURLs,
mozilla::ErrorResult& aRv) {
@@ -990,6 +1000,19 @@ bool nsComputedDOMStyle::NeedsToFlushLayout(nsCSSPropertyID aPropID) const {
}
}
+bool nsComputedDOMStyle::NeedsToFlushLayoutForContainerQuery() const {
+ const auto* outerFrame = GetOuterFrame();
+ if (!outerFrame) {
+ return false;
+ }
+ const auto* innerFrame = nsLayoutUtils::GetStyleFrame(outerFrame);
+ MOZ_ASSERT(innerFrame, "No valid inner frame?");
+ // It's possible that potential containers are styled but not yet reflowed,
+ // i.e. They don't have a correct size, which makes any container query
+ // evaluation against them invalid.
+ return innerFrame->HasUnreflowedContainerQueryAncestor();
+}
+
void nsComputedDOMStyle::Flush(Document& aDocument, FlushType aFlushType) {
MOZ_ASSERT(mElement->IsInComposedDoc());
MOZ_ASSERT(mDocumentWeak == &aDocument);
@@ -1051,8 +1074,9 @@ void nsComputedDOMStyle::UpdateCurrentStyleSources(nsCSSPropertyID aPropID) {
Flush(*document, FlushType::Frames);
}
- if (NeedsToFlushLayout(aPropID)) {
- MOZ_ASSERT(MayNeedToFlushLayout(aPropID));
+ const bool needsToFlushLayoutForProp = NeedsToFlushLayout(aPropID);
+ if (needsToFlushLayoutForProp || NeedsToFlushLayoutForContainerQuery()) {
+ MOZ_ASSERT_IF(needsToFlushLayoutForProp, MayNeedToFlushLayout(aPropID));
didFlush = true;
Flush(*document, FlushType::Layout);
#ifdef DEBUG
diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h
index 4a6fec785d..4f135a3aca 100644
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -120,6 +120,8 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
mExposeVisitedStyle = aExpose;
}
+ float UsedFontSize() final;
+
void GetCSSImageURLs(const nsACString& aPropertyName,
nsTArray<nsCString>& aImageURLs,
mozilla::ErrorResult& aRv) final;
@@ -312,6 +314,10 @@ class nsComputedDOMStyle final : public nsDOMCSSDeclaration,
// Find out if we need to flush layout of the document, depending on the
// property that was requested.
bool NeedsToFlushLayout(nsCSSPropertyID) const;
+ // Find out if we need to flush layout of the document due to container
+ // query being made before relevant query containers are reflowed at least
+ // once.
+ bool NeedsToFlushLayoutForContainerQuery() const;
// Flushes the given document, which must be our document, and potentially the
// mElement's document.
void Flush(Document&, mozilla::FlushType);
diff --git a/layout/style/nsICSSDeclaration.h b/layout/style/nsICSSDeclaration.h
index 1750fd75c3..53dcbed4ec 100644
--- a/layout/style/nsICSSDeclaration.h
+++ b/layout/style/nsICSSDeclaration.h
@@ -86,6 +86,11 @@ class nsICSSDeclaration : public nsISupports, public nsWrapperCache {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
}
+ // [Chrome only]
+ // Used font-size (taking account of the min-font-size prefs), if available;
+ // returns -1.0 on failure to retrieve a value.
+ virtual float UsedFontSize() { return -1.0; }
+
// WebIDL interface for CSSStyleDeclaration
virtual void SetCssText(const nsACString& aString,
nsIPrincipal* aSubjectPrincipal,
diff --git a/layout/style/nsMediaFeatures.cpp b/layout/style/nsMediaFeatures.cpp
index c99eecb486..f888c127d4 100644
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -248,6 +248,9 @@ bool Gecko_MediaFeatures_MatchesPlatform(StylePlatform aPlatform) {
#elif defined(XP_MACOSX)
case StylePlatform::Macos:
return true;
+#elif defined(XP_IOS)
+ case StylePlatform::Ios:
+ return true;
#else
# error "Unknown platform?"
#endif
diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
index 123a1b3304..39f5b1a760 100644
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2020,7 +2020,7 @@ StyleTransition::StyleTransition(const StyleTransition& aCopy) = default;
bool StyleTransition::operator==(const StyleTransition& aOther) const {
return mTimingFunction == aOther.mTimingFunction &&
mDuration == aOther.mDuration && mDelay == aOther.mDelay &&
- mProperty == aOther.mProperty;
+ mProperty == aOther.mProperty && mBehavior == aOther.mBehavior;
}
StyleAnimation::StyleAnimation(const StyleAnimation& aCopy) = default;
@@ -3079,6 +3079,7 @@ nsStyleUIReset::nsStyleUIReset()
mTransitionDurationCount(1),
mTransitionDelayCount(1),
mTransitionPropertyCount(1),
+ mTransitionBehaviorCount(1),
mAnimations(
nsStyleAutoArray<StyleAnimation>::WITH_SINGLE_INITIAL_ELEMENT),
mAnimationTimingFunctionCount(1),
@@ -3120,6 +3121,7 @@ nsStyleUIReset::nsStyleUIReset(const nsStyleUIReset& aSource)
mTransitionDurationCount(aSource.mTransitionDurationCount),
mTransitionDelayCount(aSource.mTransitionDelayCount),
mTransitionPropertyCount(aSource.mTransitionPropertyCount),
+ mTransitionBehaviorCount(aSource.mTransitionBehaviorCount),
mAnimations(aSource.mAnimations.Clone()),
mAnimationTimingFunctionCount(aSource.mAnimationTimingFunctionCount),
mAnimationDurationCount(aSource.mAnimationDurationCount),
@@ -3178,6 +3180,7 @@ nsChangeHint nsStyleUIReset::CalcDifference(
mTransitionDurationCount != aNewData.mTransitionDurationCount ||
mTransitionDelayCount != aNewData.mTransitionDelayCount ||
mTransitionPropertyCount != aNewData.mTransitionPropertyCount ||
+ mTransitionBehaviorCount != aNewData.mTransitionBehaviorCount ||
mAnimations != aNewData.mAnimations ||
mAnimationTimingFunctionCount !=
aNewData.mAnimationTimingFunctionCount ||
@@ -3461,12 +3464,6 @@ void StyleCalcNode::ScaleLengthsBy(float aScale) {
}
}
-nscoord StyleCalcLengthPercentage::Resolve(nscoord aBasis,
- CoordRounder aRounder) const {
- CSSCoord result = ResolveToCSSPixels(CSSPixel::FromAppUnits(aBasis));
- return aRounder(result * AppUnitsPerCSSPixel());
-}
-
bool nsStyleDisplay::PrecludesSizeContainmentOrContentVisibilityWithFrame(
const nsIFrame& aFrame) const {
// The spec says that in the case of SVG, the contain property only applies
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index b2d68a5976..8835934eaf 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -1120,6 +1120,7 @@ struct StyleTransition {
const StyleTime& GetDelay() const { return mDelay; }
const StyleTime& GetDuration() const { return mDuration; }
const StyleTransitionProperty& GetProperty() const { return mProperty; }
+ StyleTransitionBehavior GetBehavior() const { return mBehavior; }
bool operator==(const StyleTransition& aOther) const;
bool operator!=(const StyleTransition& aOther) const {
@@ -1133,6 +1134,7 @@ struct StyleTransition {
StyleTime mDelay{0.0};
StyleTransitionProperty mProperty{StyleTransitionProperty::NonCustom(
StyleNonCustomPropertyId{uint16_t(eCSSProperty_all)})};
+ StyleTransitionBehavior mBehavior = StyleTransitionBehavior::Normal;
};
struct StyleAnimation {
@@ -1647,6 +1649,10 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
return mTransitions[aIndex % mTransitionTimingFunctionCount]
.GetTimingFunction();
}
+ mozilla::StyleTransitionBehavior GetTransitionBehavior(
+ uint32_t aIndex) const {
+ return mTransitions[aIndex % mTransitionBehaviorCount].GetBehavior();
+ }
mozilla::StyleTime GetTransitionCombinedDuration(uint32_t aIndex) const {
// https://drafts.csswg.org/css-transitions/#transition-combined-duration
return {std::max(GetTransitionDuration(aIndex).seconds, 0.0f) +
@@ -1708,6 +1714,7 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset {
uint32_t mTransitionDurationCount;
uint32_t mTransitionDelayCount;
uint32_t mTransitionPropertyCount;
+ uint32_t mTransitionBehaviorCount;
nsStyleAutoArray<mozilla::StyleAnimation> mAnimations;
// The number of elements in mAnimations that are not from repeating
// a list due to another property being longer.
diff --git a/layout/style/nsStyleTransformMatrix.cpp b/layout/style/nsStyleTransformMatrix.cpp
index 593bcbb39d..71f8f826c2 100644
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -101,7 +101,8 @@ static nsRect GetSVGBox(const nsIFrame* aFrame) {
// FIXME: Bug 1849054. We may have to update
// SVGGeometryFrame::GetBBoxContribution() to get tighter stroke bounds.
nsRect strokeBox = nsLayoutUtils::ComputeSVGReferenceRect(
- const_cast<nsIFrame*>(aFrame), StyleGeometryBox::StrokeBox);
+ const_cast<nsIFrame*>(aFrame), StyleGeometryBox::StrokeBox,
+ nsLayoutUtils::MayHaveNonScalingStrokeCyclicDependency::Yes);
// The |nsIFrame::mRect| includes markers, so we have to compute the
// offsets without markers.
return nsRect{strokeBox.x - aFrame->GetPosition().x,
diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp
index ad3809c37f..66f1004354 100644
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -116,6 +116,7 @@ bool nsTransitionManager::DoUpdateTransitions(
continue;
}
+ const auto behavior = aStyle.GetTransitionBehavior(i);
ExpandTransitionProperty(aStyle.GetTransitionProperty(i),
[&](const AnimatedPropertyID& aProperty) {
// We might have something to transition. See if
@@ -123,8 +124,9 @@ bool nsTransitionManager::DoUpdateTransitions(
// are animatable.
startedAny |= ConsiderInitiatingTransition(
aProperty, aStyle, i, delay, duration,
- aElement, aPseudoType, aElementTransitions,
- aOldStyle, aNewStyle, propertiesChecked);
+ behavior, aElement, aPseudoType,
+ aElementTransitions, aOldStyle, aNewStyle,
+ propertiesChecked);
});
}
@@ -248,8 +250,8 @@ GetReplacedTransitionProperties(const CSSTransition* aTransition,
bool nsTransitionManager::ConsiderInitiatingTransition(
const AnimatedPropertyID& aProperty, const nsStyleUIReset& aStyle,
uint32_t aTransitionIndex, float aDelay, float aDuration,
- dom::Element* aElement, PseudoStyleType aPseudoType,
- CSSTransitionCollection*& aElementTransitions,
+ mozilla::StyleTransitionBehavior aBehavior, dom::Element* aElement,
+ PseudoStyleType aPseudoType, CSSTransitionCollection*& aElementTransitions,
const ComputedStyle& aOldStyle, const ComputedStyle& aNewStyle,
AnimatedPropertyIDSet& aPropertiesChecked) {
// IsShorthand itself will assert if aProperty is not a property.
@@ -294,7 +296,7 @@ bool nsTransitionManager::ConsiderInitiatingTransition(
AnimationValue startValue, endValue;
const StyleShouldTransitionResult result =
Servo_ComputedValues_ShouldTransition(
- &aOldStyle, &aNewStyle, &property,
+ &aOldStyle, &aNewStyle, &property, aBehavior,
oldTransition ? oldTransition->ToValue().mServo.get() : nullptr,
&startValue.mServo, &endValue.mServo);
diff --git a/layout/style/nsTransitionManager.h b/layout/style/nsTransitionManager.h
index e87a0109a2..02a577690d 100644
--- a/layout/style/nsTransitionManager.h
+++ b/layout/style/nsTransitionManager.h
@@ -63,6 +63,7 @@ class nsTransitionManager final
bool ConsiderInitiatingTransition(
const mozilla::AnimatedPropertyID&, const nsStyleUIReset& aStyle,
uint32_t aTransitionIndex, float aDelay, float aDuration,
+ mozilla::StyleTransitionBehavior aBehavior,
mozilla::dom::Element* aElement, mozilla::PseudoStyleType aPseudoType,
CSSTransitionCollection*& aElementTransitions,
const mozilla::ComputedStyle& aOldStyle,
diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css
index 9fb833aa74..a2d026639b 100644
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -259,40 +259,27 @@ select:-moz-select-list-box {
}
select > button {
- inline-size: 12px;
- white-space: nowrap;
- position: static;
+ padding: 0;
+ border: 0;
appearance: auto;
-moz-default-appearance: -moz-menulist-arrow-button;
- /* Make sure to size correctly if the combobox has a non-auto height. */
- block-size: 100%;
- box-sizing: border-box;
-
/* Draw the arrow in the select's color */
color: inherit;
- /*
- Make sure to align properly with the display frame. Note that we
- want the baseline of the combobox to match the baseline of the
- display frame, so the dropmarker is what gets the vertical-align.
- */
+ /* We don't want the button to grow the line-height */
+ font: inherit;
+ max-block-size: 100%;
+
+ /* Make sure to align properly with the display frame. Note that we want the
+ * baseline of the combobox to match the baseline of the label, so the
+ * dropmarker is what gets the vertical-align. */
vertical-align: top;
}
-*|*::-moz-display-comboboxcontrol-frame {
- content: inherit;
+select > label {
+ display: inline-block;
overflow: clip;
- color: unset;
- white-space: nowrap;
- text-align: unset;
- user-select: none;
- /* Make sure to size correctly if the combobox has a non-auto block-size. */
- block-size: 100%;
- /* Try to always display our own text */
- min-inline-size: max-content;
- box-sizing: border-box;
- line-height: -moz-block-height;
}
option[label]::before {
@@ -668,16 +655,15 @@ input[type=file] > label {
* inherit into the ':-moz-button-content' pseudo-element.
*
* <select>:
- * inherit into the ':-moz-display-comboboxcontrol-frame' pseudo-element and
- * the <optgroup>'s ':before' pseudo-element, which is where the label of
- * the <optgroup> gets displayed. The <option>s don't use anonymous boxes,
- * so they need no special rules.
+ * inherit into the label and the <optgroup>'s ':before' pseudo-element,
+ * which is where the label of the <optgroup> gets displayed. The <option>s
+ * don't use anonymous boxes, so they need no special rules.
*/
::placeholder,
::-moz-text-control-editing-root,
*|*::-moz-button-content,
-*|*::-moz-display-comboboxcontrol-frame,
-optgroup:before {
+select > label,
+optgroup::before {
unicode-bidi: inherit;
text-overflow: inherit;
}
@@ -868,6 +854,13 @@ input[type=number]::-moz-number-spin-box {
overflow: clip;
}
+/* stylelint-disable-next-line media-query-no-invalid */
+@media (-moz-bool-pref: "dom.forms.number.hide_spin_buttons_when_no_hover_or_focus") {
+ input[type=number]:not(:hover, :focus)::-moz-number-spin-box {
+ opacity: 0;
+ }
+}
+
input[type=number]::-moz-number-spin-up,
input[type=number]::-moz-number-spin-down {
writing-mode: horizontal-tb;
@@ -922,11 +915,7 @@ input:is([type=date], [type=time], [type=datetime-local]):is(:disabled, :read-on
}
input:autofill, select:autofill {
- /* The idea behind using background-image instead of plain background-color
- * is that it's less likely to be overridden by the page. */
- background-image: linear-gradient(-moz-autofill-background, -moz-autofill-background);
-}
-
-input:-moz-autofill-preview, select:-moz-autofill-preview {
- color: GrayText;
+ background-color: -moz-autofill-background !important;
+ background-image: none !important;
+ color: FieldText !important;
}
diff --git a/layout/style/res/html.css b/layout/style/res/html.css
index 383aa35f7b..ff58ecd4d1 100644
--- a/layout/style/res/html.css
+++ b/layout/style/res/html.css
@@ -149,10 +149,8 @@ dd {
blockquote, figure {
display: block;
- margin-block-start: 1em;
- margin-block-end: 1em;
- margin-inline-start: 40px;
- margin-inline-end: 40px;
+ margin-block: 1em;
+ margin-inline: 40px;
}
address {
@@ -169,68 +167,85 @@ h1 {
display: block;
font-size: 2em;
font-weight: bold;
- margin-block-start: .67em;
- margin-block-end: .67em;
+ margin-block: .67em;
}
-h2,
-:is(article, aside, nav, section)
-h1 {
+h2 {
display: block;
font-size: 1.5em;
font-weight: bold;
- margin-block-start: .83em;
- margin-block-end: .83em;
+ margin-block: .83em;
}
-h3,
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-h1 {
+h3 {
display: block;
font-size: 1.17em;
font-weight: bold;
- margin-block-start: 1em;
- margin-block-end: 1em;
+ margin-block: 1em;
}
-h4,
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-h1 {
+h4 {
display: block;
font-size: 1.00em;
font-weight: bold;
- margin-block-start: 1.33em;
- margin-block-end: 1.33em;
+ margin-block: 1.33em;
}
-h5,
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-h1 {
+h5 {
display: block;
font-size: 0.83em;
font-weight: bold;
- margin-block-start: 1.67em;
- margin-block-end: 1.67em;
+ margin-block: 1.67em;
}
-h6,
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-:is(article, aside, nav, section)
-h1 {
+h6 {
display: block;
font-size: 0.67em;
font-weight: bold;
- margin-block-start: 2.33em;
- margin-block-end: 2.33em;
+ margin-block: 2.33em;
+}
+
+/* stylelint-disable-next-line media-query-no-invalid */
+@media (-moz-bool-pref: "layout.css.h1-in-section-ua-styles.enabled") {
+ :is(article, aside, nav, section)
+ h1 {
+ margin-block: 0.83em;
+ font-size: 1.50em;
+ }
+
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ h1 {
+ margin-block: 1.00em;
+ font-size: 1.17em;
+ }
+
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ h1 {
+ margin-block: 1.33em;
+ font-size: 1.00em;
+ }
+
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ h1 {
+ margin-block: 1.67em;
+ font-size: 0.83em;
+ }
+
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ :is(article, aside, nav, section)
+ h1 {
+ margin-block: 2.33em;
+ font-size: 0.67em;
+ }
}
listing {
@@ -238,16 +253,14 @@ listing {
font-family: -moz-fixed;
font-size: medium;
white-space: pre;
- margin-block-start: 1em;
- margin-block-end: 1em;
+ margin-block: 1em;
}
xmp, pre, plaintext {
display: block;
font-family: -moz-fixed;
white-space: pre;
- margin-block-start: 1em;
- margin-block-end: 1em;
+ margin-block: 1em;
}
/* tables */
@@ -380,25 +393,19 @@ table[rules][rules="cols"] > tr > td,
table[rules][rules="cols"] > * > tr > td,
table[rules][rules="cols"] > tr > th,
table[rules][rules="cols"] > * > tr > th {
- border-inline-start-width: thin;
- border-inline-end-width: thin;
- border-inline-start-style: solid;
- border-inline-end-style: solid;
+ border-inline-width: thin;
+ border-inline-style: solid;
}
table[rules][rules="groups"] > colgroup {
- border-inline-start-width: thin;
- border-inline-end-width: thin;
- border-inline-start-style: solid;
- border-inline-end-style: solid;
+ border-inline-width: thin;
+ border-inline-style: solid;
}
table[rules][rules="groups"] > tfoot,
table[rules][rules="groups"] > thead,
table[rules][rules="groups"] > tbody {
- border-block-start-width: thin;
- border-block-end-width: thin;
- border-block-start-style: solid;
- border-block-end-style: solid;
+ border-block-width: thin;
+ border-block-style: solid;
}
@@ -409,8 +416,7 @@ caption {
}
table[align="center"] > caption {
- margin-inline-start: auto;
- margin-inline-end: auto;
+ margin-inline: auto;
}
table[align="center"] > caption[align="left"]:dir(ltr) {
@@ -589,8 +595,7 @@ li {
:is(ul, ol, dir, menu, dl) dir,
:is(ul, ol, dir, menu, dl) menu,
:is(ul, ol, dir, menu, dl) dl {
- margin-block-start: 0;
- margin-block-end: 0;
+ margin-block: 0;
}
/* 2 deep unordered lists use a circle */
@@ -618,10 +623,8 @@ hr {
color: gray;
border-width: 1px;
border-style: inset;
- margin-block-start: 0.5em;
- margin-block-end: 0.5em;
- margin-inline-start: auto;
- margin-inline-end: auto;
+ margin-block: 0.5em;
+ margin-inline: auto;
overflow: hidden;
/* FIXME: This is not really per spec */
diff --git a/layout/style/test/ParseCSS.cpp b/layout/style/test/ParseCSS.cpp
index 04e37d48e2..e201d191a9 100644
--- a/layout/style/test/ParseCSS.cpp
+++ b/layout/style/test/ParseCSS.cpp
@@ -18,7 +18,6 @@
#include "nsIFile.h"
#include "nsNetUtil.h"
-#include "nsContentCID.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
diff --git a/layout/style/test/animation_utils.js b/layout/style/test/animation_utils.js
index 6f7ededcd4..7239885e7c 100644
--- a/layout/style/test/animation_utils.js
+++ b/layout/style/test/animation_utils.js
@@ -4,6 +4,8 @@
//
//----------------------------------------------------------------------
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
function advance_clock(milliseconds) {
SpecialPowers.DOMWindowUtils.advanceTimeAndRefresh(milliseconds);
}
diff --git a/layout/style/test/chrome/bug418986-2.js b/layout/style/test/chrome/bug418986-2.js
index 6d2af235c3..c945eecca0 100644
--- a/layout/style/test/chrome/bug418986-2.js
+++ b/layout/style/test/chrome/bug418986-2.js
@@ -1,5 +1,7 @@
// # Bug 418986, part 2.
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
const is_chrome_window = window.location.protocol === "chrome:";
const HTML_NS = "http://www.w3.org/1999/xhtml";
diff --git a/layout/style/test/mochitest.toml b/layout/style/test/mochitest.toml
index 9df86ea539..54ad9736f2 100644
--- a/layout/style/test/mochitest.toml
+++ b/layout/style/test/mochitest.toml
@@ -18,6 +18,7 @@ prefs = [
"layout.css.basic-shape-rect.enabled=true",
"layout.css.basic-shape-xywh.enabled=true",
"layout.css.transform-box-content-stroke.enabled=true",
+ "layout.css.transition-behavior.enabled=true",
]
support-files = [
"animation_utils.js",
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index 422f2ffe5c..2e8b4c71a3 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -13604,36 +13604,32 @@ if (IsCSSPropertyPrefEnabled("layout.css.backdrop-filter.enabled")) {
};
}
-if (IsCSSPropertyPrefEnabled("layout.css.math-depth.enabled")) {
- gCSSProperties["math-depth"] = {
- domProp: "mathDepth",
- inherited: true,
- type: CSS_TYPE_LONGHAND,
- initial_values: ["0"],
- other_values: [
- // auto-add cannot be tested here because it has no effect when the
- // inherited math-style is equal to the default (normal).
- "123",
- "-123",
- "add(123)",
- "add(-123)",
- "calc(1 + 2*3)",
- "add(calc(4 - 2/3))",
- ],
- invalid_values: ["auto", "1,23", "1.23", "add(1,23)", "add(1.23)"],
- };
-}
+gCSSProperties["math-depth"] = {
+ domProp: "mathDepth",
+ inherited: true,
+ type: CSS_TYPE_LONGHAND,
+ initial_values: ["0"],
+ other_values: [
+ // auto-add cannot be tested here because it has no effect when the
+ // inherited math-style is equal to the default (normal).
+ "123",
+ "-123",
+ "add(123)",
+ "add(-123)",
+ "calc(1 + 2*3)",
+ "add(calc(4 - 2/3))",
+ ],
+ invalid_values: ["auto", "1,23", "1.23", "add(1,23)", "add(1.23)"],
+};
-if (IsCSSPropertyPrefEnabled("layout.css.math-style.enabled")) {
- gCSSProperties["math-style"] = {
- domProp: "mathStyle",
- inherited: true,
- type: CSS_TYPE_LONGHAND,
- initial_values: ["normal"],
- other_values: ["compact"],
- invalid_values: [],
- };
-}
+gCSSProperties["math-style"] = {
+ domProp: "mathStyle",
+ inherited: true,
+ type: CSS_TYPE_LONGHAND,
+ initial_values: ["normal"],
+ other_values: ["compact"],
+ invalid_values: [],
+};
if (IsCSSPropertyPrefEnabled("layout.css.forced-color-adjust.enabled")) {
gCSSProperties["forced-color-adjust"] = {
@@ -14088,6 +14084,36 @@ if (IsCSSPropertyPrefEnabled("layout.css.prefixes.transitions")) {
});
}
+if (IsCSSPropertyPrefEnabled("layout.css.transition-behavior.enabled")) {
+ Object.assign(gCSSProperties, {
+ "transition-behavior": {
+ domProp: "transitionBehavior",
+ inherited: false,
+ type: CSS_TYPE_LONGHAND,
+ applies_to_marker: true,
+ initial_values: ["normal"],
+ other_values: ["allow-discrete"],
+ invalid_values: ["none", "auto", "discrete"],
+ },
+ });
+
+ gCSSProperties["transition"].subproperties.push("transition-behavior");
+ gCSSProperties["transition"].initial_values.push("normal");
+ gCSSProperties["transition"].other_values.push(
+ "allow-discrete",
+ "width allow-discrete",
+ "1s allow-discrete",
+ "linear allow-discrete"
+ );
+ gCSSProperties["-webkit-transition"].subproperties.push(
+ "transition-behavior"
+ );
+
+ if (IsCSSPropertyPrefEnabled("layout.css.prefixes.transitions")) {
+ gCSSProperties["-moz-transition"].subproperties.push("transition-behavior");
+ }
+}
+
// Copy aliased properties' fields from their alias targets. Keep this logic
// at the bottom of this file to ensure all the aliased properties are
// processed.
diff --git a/layout/style/test/test_shorthand_property_getters.html b/layout/style/test/test_shorthand_property_getters.html
index cade526183..b5db9519a6 100644
--- a/layout/style/test/test_shorthand_property_getters.html
+++ b/layout/style/test/test_shorthand_property_getters.html
@@ -183,17 +183,19 @@ e.setAttribute("style", "background-position-x: 0px; background-position-y: top
is(e.style.backgroundPosition, "left 0px top 0px", "should serialize to 4-value form if 3-value form would only have one edge");
// Check that we only serialize transition when the lists are the same length.
-e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
+e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete;");
isnot(e.style.transition, "", "should have transition shorthand (lists same length)");
-e.setAttribute("style", "transition-property: color, width, left; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
+e.setAttribute("style", "transition-property: color, width, left; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete;");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
-e.setAttribute("style", "transition-property: all; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
+e.setAttribute("style", "transition-property: all; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete;");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
-e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms, 300ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s");
+e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms, 300ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete;");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
-e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear, ease-out; transition-delay: 0s, 1s");
+e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear, ease-out; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete;");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
-e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s, 0s");
+e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s, 0s; transition-behavior: normal, allow-discrete;");
+is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
+e.setAttribute("style", "transition-property: color, width; transition-duration: 1s, 200ms; transition-timing-function: ease-in, linear; transition-delay: 0s, 1s; transition-behavior: normal, allow-discrete, normal;");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
e.setAttribute("style", "transition: color, width; transition-delay: 0s");
is(e.style.transition, "", "should not have transition shorthand (lists different lengths)");
diff --git a/layout/svg/SVGGeometryFrame.cpp b/layout/svg/SVGGeometryFrame.cpp
index 7d0bd7cc4c..3d6d6aef7e 100644
--- a/layout/svg/SVGGeometryFrame.cpp
+++ b/layout/svg/SVGGeometryFrame.cpp
@@ -358,13 +358,31 @@ SVGBBox SVGGeometryFrame::GetBBoxContribution(const Matrix& aToBBoxUserspace,
SVGGeometryElement* element = static_cast<SVGGeometryElement*>(GetContent());
- bool getFill = (aFlags & SVGUtils::eBBoxIncludeFillGeometry) ||
- ((aFlags & SVGUtils::eBBoxIncludeFill) &&
- !StyleSVG()->mFill.kind.IsNone());
-
- bool getStroke =
- (aFlags & SVGUtils::eBBoxIncludeStrokeGeometry) ||
- ((aFlags & SVGUtils::eBBoxIncludeStroke) && SVGUtils::HasStroke(this));
+ const bool getFill = (aFlags & SVGUtils::eBBoxIncludeFillGeometry) ||
+ ((aFlags & SVGUtils::eBBoxIncludeFill) &&
+ !StyleSVG()->mFill.kind.IsNone());
+
+ const bool getStroke =
+ ((aFlags & SVGUtils::eBBoxIncludeStrokeGeometry) ||
+ ((aFlags & SVGUtils::eBBoxIncludeStroke) &&
+ SVGUtils::HasStroke(this))) &&
+ // If this frame has non-scaling-stroke and we would like to compute its
+ // stroke, it may cause a potential cyclical dependency if the caller is
+ // for transform. In this case, we have to fall back to fill-box, so make
+ // |getStroke| be false.
+ // https://github.com/w3c/csswg-drafts/issues/9640
+ //
+ // Note:
+ // 1. We don't care about the computation of the markers below in this
+ // function because we know the callers don't set
+ // SVGUtils::eBBoxIncludeMarkers.
+ // See nsStyleTransformMatrix::GetSVGBox() and
+ // MotionPathUtils::GetRayContainReferenceSize() for more details.
+ // 2. We have to break the dependency here *again* because the geometry
+ // frame may be in the subtree of a SVGContainerFrame, which may not
+ // set non-scaling-stroke.
+ !(StyleSVGReset()->HasNonScalingStroke() &&
+ (aFlags & SVGUtils::eAvoidCycleIfNonScalingStroke));
SVGContentUtils::AutoStrokeOptions strokeOptions;
if (getStroke) {
diff --git a/layout/svg/SVGGradientFrame.cpp b/layout/svg/SVGGradientFrame.cpp
index f316c0180d..92558cefcd 100644
--- a/layout/svg/SVGGradientFrame.cpp
+++ b/layout/svg/SVGGradientFrame.cpp
@@ -157,7 +157,8 @@ gfxMatrix SVGGradientFrame::GetGradientTransform(
const SVGAnimatedTransformList* animTransformList =
GetGradientTransformList(GetContent());
if (!animTransformList) {
- return bboxMatrix;
+ return bboxMatrix.PreMultiply(
+ SVGUtils::GetTransformMatrixInUserSpace(this));
}
gfxMatrix gradientTransform =
diff --git a/layout/svg/SVGPatternFrame.cpp b/layout/svg/SVGPatternFrame.cpp
index 20863db17e..7d1e99cedc 100644
--- a/layout/svg/SVGPatternFrame.cpp
+++ b/layout/svg/SVGPatternFrame.cpp
@@ -467,7 +467,7 @@ gfxMatrix SVGPatternFrame::GetPatternTransform() {
SVGAnimatedTransformList* animTransformList =
GetPatternTransformList(GetContent());
if (!animTransformList) {
- return gfxMatrix();
+ return SVGUtils::GetTransformMatrixInUserSpace(this);
}
return animTransformList->GetAnimValue().GetConsolidationMatrix();
diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp
index 246be6fe3a..d53637af0a 100644
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -800,18 +800,18 @@ SVGBBox TextRenderedRun::GetRunUserSpaceRect(nsPresContext* aContext,
return r;
}
- // Determine the amount of overflow above and below the frame's mRect.
+ // Determine the amount of overflow around frame's mRect.
//
// We need to call InkOverflowRectRelativeToSelf because this includes
- // overflowing decorations, which the MeasureText call below does not. We
- // assume here the decorations only overflow above and below the frame, never
- // horizontally.
+ // overflowing decorations, which the MeasureText call below does not.
nsRect self = mFrame->InkOverflowRectRelativeToSelf();
nsRect rect = mFrame->GetRect();
bool vertical = IsVertical();
- nscoord above = vertical ? -self.x : -self.y;
- nscoord below =
- vertical ? self.XMost() - rect.width : self.YMost() - rect.height;
+ nsMargin inkOverflow(
+ vertical ? -self.x : -self.y,
+ vertical ? self.YMost() - rect.height : self.XMost() - rect.width,
+ vertical ? self.XMost() - rect.width : self.YMost() - rect.height,
+ vertical ? -self.y : -self.x);
gfxSkipCharsIterator it = mFrame->EnsureTextRun(nsTextFrame::eInflated);
gfxSkipCharsIterator start = it;
@@ -838,8 +838,7 @@ SVGBBox TextRenderedRun::GetRunUserSpaceRect(nsPresContext* aContext,
metrics.mBoundingBox.UnionRect(metrics.mBoundingBox, fontBox);
// Determine the rectangle that covers the rendered run's fill,
- // taking into account the measured vertical overflow due to
- // decorations.
+ // taking into account the measured overflow due to decorations.
nscoord baseline =
NSToCoordRoundWithClamp(metrics.mBoundingBox.y + metrics.mAscent);
gfxFloat x, width;
@@ -854,10 +853,10 @@ SVGBBox TextRenderedRun::GetRunUserSpaceRect(nsPresContext* aContext,
x = metrics.mBoundingBox.x;
width = metrics.mBoundingBox.width;
}
- nsRect fillInAppUnits(
- NSToCoordRoundWithClamp(x), baseline - above,
- NSToCoordRoundWithClamp(width),
- NSToCoordRoundWithClamp(metrics.mBoundingBox.height) + above + below);
+ nsRect fillInAppUnits(NSToCoordRoundWithClamp(x), baseline,
+ NSToCoordRoundWithClamp(width),
+ NSToCoordRoundWithClamp(metrics.mBoundingBox.height));
+ fillInAppUnits.Inflate(inkOverflow);
if (textRun->IsVertical()) {
// Swap line-relative textMetrics dimensions to physical coordinates.
std::swap(fillInAppUnits.x, fillInAppUnits.y);
@@ -2407,15 +2406,16 @@ class SVGTextDrawPathCallbacks final : public nsTextFrame::DrawPathCallbacks {
mContext(aContext),
mFrame(aFrame),
mCanvasTM(aCanvasTM),
- mImgParams(aImgParams),
- mColor(0) {}
+ mImgParams(aImgParams) {}
void NotifySelectionBackgroundNeedsFill(const Rect& aBackgroundRect,
nscolor aColor,
DrawTarget& aDrawTarget) override;
- void PaintDecorationLine(Rect aPath, nscolor aColor) override;
- void PaintSelectionDecorationLine(Rect aPath, nscolor aColor) override;
- void NotifyBeforeText(nscolor aColor) override;
+ void PaintDecorationLine(Rect aPath, bool aPaintingShadows,
+ nscolor aColor) override;
+ void PaintSelectionDecorationLine(Rect aPath, bool aPaintingShadows,
+ nscolor aColor) override;
+ void NotifyBeforeText(bool aPaintingShadows, nscolor aColor) override;
void NotifyGlyphPathEmitted() override;
void NotifyAfterText() override;
@@ -2454,6 +2454,12 @@ class SVGTextDrawPathCallbacks final : public nsTextFrame::DrawPathCallbacks {
*/
void StrokeGeometry();
+ /*
+ * Takes a colour and modifies it to account for opacity properties.
+ */
+ void ApplyOpacity(sRGBColor& aColor, const StyleSVGPaint& aPaint,
+ const StyleSVGOpacity& aOpacity) const;
+
SVGTextFrame* const mSVGTextFrame;
gfxContext& mContext;
nsTextFrame* const mFrame;
@@ -2466,7 +2472,12 @@ class SVGTextDrawPathCallbacks final : public nsTextFrame::DrawPathCallbacks {
* NS_40PERCENT_FOREGROUND_COLOR and NS_TRANSPARENT colors when we are
* painting selections or IME decorations.
*/
- nscolor mColor;
+ nscolor mColor = NS_RGBA(0, 0, 0, 0);
+
+ /**
+ * Whether we're painting text shadows.
+ */
+ bool mPaintingShadows = false;
};
void SVGTextDrawPathCallbacks::NotifySelectionBackgroundNeedsFill(
@@ -2477,6 +2488,7 @@ void SVGTextDrawPathCallbacks::NotifySelectionBackgroundNeedsFill(
}
mColor = aColor; // currently needed by MakeFillPattern
+ mPaintingShadows = false;
GeneralPattern fillPattern;
MakeFillPattern(&fillPattern);
@@ -2487,8 +2499,10 @@ void SVGTextDrawPathCallbacks::NotifySelectionBackgroundNeedsFill(
}
}
-void SVGTextDrawPathCallbacks::NotifyBeforeText(nscolor aColor) {
+void SVGTextDrawPathCallbacks::NotifyBeforeText(bool aPaintingShadows,
+ nscolor aColor) {
mColor = aColor;
+ mPaintingShadows = aPaintingShadows;
SetupContext();
mContext.NewPath();
}
@@ -2500,8 +2514,11 @@ void SVGTextDrawPathCallbacks::NotifyGlyphPathEmitted() {
void SVGTextDrawPathCallbacks::NotifyAfterText() { mContext.Restore(); }
-void SVGTextDrawPathCallbacks::PaintDecorationLine(Rect aPath, nscolor aColor) {
+void SVGTextDrawPathCallbacks::PaintDecorationLine(Rect aPath,
+ bool aPaintingShadows,
+ nscolor aColor) {
mColor = aColor;
+ mPaintingShadows = aPaintingShadows;
AntialiasMode aaMode =
SVGUtils::ToAntialiasMode(mFrame->StyleText()->mTextRendering);
@@ -2514,14 +2531,15 @@ void SVGTextDrawPathCallbacks::PaintDecorationLine(Rect aPath, nscolor aColor) {
mContext.Restore();
}
-void SVGTextDrawPathCallbacks::PaintSelectionDecorationLine(Rect aPath,
- nscolor aColor) {
+void SVGTextDrawPathCallbacks::PaintSelectionDecorationLine(
+ Rect aPath, bool aPaintingShadows, nscolor aColor) {
if (IsClipPathChild()) {
// Don't paint selection decorations when in a clip path.
return;
}
mColor = aColor;
+ mPaintingShadows = aPaintingShadows;
mContext.Save();
mContext.NewPath();
@@ -2561,6 +2579,17 @@ void SVGTextDrawPathCallbacks::HandleTextGeometry() {
}
}
+void SVGTextDrawPathCallbacks::ApplyOpacity(
+ sRGBColor& aColor, const StyleSVGPaint& aPaint,
+ const StyleSVGOpacity& aOpacity) const {
+ if (aPaint.kind.tag == StyleSVGPaintKind::Tag::Color) {
+ aColor.a *=
+ sRGBColor::FromABGR(aPaint.kind.AsColor().CalcColor(*mFrame->Style()))
+ .a;
+ }
+ aColor.a *= SVGUtils::GetOpacity(aOpacity, /*aContextPaint*/ nullptr);
+}
+
void SVGTextDrawPathCallbacks::MakeFillPattern(GeneralPattern* aOutPattern) {
if (mColor == NS_SAME_AS_FOREGROUND_COLOR ||
mColor == NS_40PERCENT_FOREGROUND_COLOR) {
@@ -2572,7 +2601,12 @@ void SVGTextDrawPathCallbacks::MakeFillPattern(GeneralPattern* aOutPattern) {
return;
}
- aOutPattern->InitColorPattern(ToDeviceColor(mColor));
+ sRGBColor color(sRGBColor::FromABGR(mColor));
+ if (mPaintingShadows) {
+ ApplyOpacity(color, mFrame->StyleSVG()->mFill,
+ mFrame->StyleSVG()->mFillOpacity);
+ }
+ aOutPattern->InitColorPattern(ToDeviceColor(color));
}
void SVGTextDrawPathCallbacks::FillAndStrokeGeometry() {
@@ -2607,6 +2641,9 @@ void SVGTextDrawPathCallbacks::FillAndStrokeGeometry() {
}
void SVGTextDrawPathCallbacks::FillGeometry() {
+ if (mFrame->StyleSVG()->mFill.kind.IsNone()) {
+ return;
+ }
GeneralPattern fillPattern;
MakeFillPattern(&fillPattern);
if (fillPattern.GetPattern()) {
@@ -2622,39 +2659,44 @@ void SVGTextDrawPathCallbacks::FillGeometry() {
void SVGTextDrawPathCallbacks::StrokeGeometry() {
// We don't paint the stroke when we are filling with a selection color.
- if (mColor == NS_SAME_AS_FOREGROUND_COLOR ||
- mColor == NS_40PERCENT_FOREGROUND_COLOR) {
- if (SVGUtils::HasStroke(mFrame, /*aContextPaint*/ nullptr)) {
- GeneralPattern strokePattern;
- SVGUtils::MakeStrokePatternFor(mFrame, &mContext, &strokePattern,
- mImgParams, /*aContextPaint*/ nullptr);
- if (strokePattern.GetPattern()) {
- if (!mFrame->GetParent()->GetContent()->IsSVGElement()) {
- // The cast that follows would be unsafe
- MOZ_ASSERT(false, "Our nsTextFrame's parent's content should be SVG");
- return;
- }
- SVGElement* svgOwner =
- static_cast<SVGElement*>(mFrame->GetParent()->GetContent());
-
- // Apply any stroke-specific transform
- gfxMatrix outerSVGToUser;
- if (SVGUtils::GetNonScalingStrokeTransform(mFrame, &outerSVGToUser) &&
- outerSVGToUser.Invert()) {
- mContext.Multiply(outerSVGToUser);
- }
+ if (!(mColor == NS_SAME_AS_FOREGROUND_COLOR ||
+ mColor == NS_40PERCENT_FOREGROUND_COLOR || mPaintingShadows)) {
+ return;
+ }
- RefPtr<Path> path = mContext.GetPath();
- SVGContentUtils::AutoStrokeOptions strokeOptions;
- SVGContentUtils::GetStrokeOptions(&strokeOptions, svgOwner,
- mFrame->Style(),
- /*aContextPaint*/ nullptr);
- DrawOptions drawOptions;
- drawOptions.mAntialiasMode =
- SVGUtils::ToAntialiasMode(mFrame->StyleText()->mTextRendering);
- mContext.GetDrawTarget()->Stroke(path, strokePattern, strokeOptions);
- }
+ if (!SVGUtils::HasStroke(mFrame, /*aContextPaint*/ nullptr)) {
+ return;
+ }
+
+ GeneralPattern strokePattern;
+ if (mPaintingShadows) {
+ sRGBColor color(sRGBColor::FromABGR(mColor));
+ ApplyOpacity(color, mFrame->StyleSVG()->mStroke,
+ mFrame->StyleSVG()->mStrokeOpacity);
+ strokePattern.InitColorPattern(ToDeviceColor(color));
+ } else {
+ SVGUtils::MakeStrokePatternFor(mFrame, &mContext, &strokePattern,
+ mImgParams, /*aContextPaint*/ nullptr);
+ }
+ if (strokePattern.GetPattern()) {
+ SVGElement* svgOwner =
+ SVGElement::FromNode(mFrame->GetParent()->GetContent());
+
+ // Apply any stroke-specific transform
+ gfxMatrix outerSVGToUser;
+ if (SVGUtils::GetNonScalingStrokeTransform(mFrame, &outerSVGToUser) &&
+ outerSVGToUser.Invert()) {
+ mContext.Multiply(outerSVGToUser);
}
+
+ RefPtr<Path> path = mContext.GetPath();
+ SVGContentUtils::AutoStrokeOptions strokeOptions;
+ SVGContentUtils::GetStrokeOptions(&strokeOptions, svgOwner, mFrame->Style(),
+ /*aContextPaint*/ nullptr);
+ DrawOptions drawOptions;
+ drawOptions.mAntialiasMode =
+ SVGUtils::ToAntialiasMode(mFrame->StyleText()->mTextRendering);
+ mContext.GetDrawTarget()->Stroke(path, strokePattern, strokeOptions);
}
}
@@ -4911,11 +4953,20 @@ bool SVGTextFrame::ShouldRenderAsPath(nsTextFrame* aFrame,
const nsStyleSVG* style = aFrame->StyleSVG();
- // Fill is a non-solid paint, has a non-default fill-rule or has
- // non-1 opacity.
+ // Fill is a non-solid paint or is not opaque.
if (!(style->mFill.kind.IsNone() ||
- (style->mFill.kind.IsColor() && style->mFillOpacity.IsOpacity() &&
- style->mFillOpacity.AsOpacity() == 1))) {
+ (style->mFill.kind.IsColor() &&
+ SVGUtils::GetOpacity(style->mFillOpacity, /*aContextPaint*/ nullptr) ==
+ 1.0f))) {
+ return true;
+ }
+
+ // If we're going to need to draw a non-opaque shadow.
+ // It's possible nsTextFrame will support non-opaque shadows in the future,
+ // in which case this test can be removed.
+ if (style->mFill.kind.IsColor() && aFrame->StyleText()->HasTextShadow() &&
+ NS_GET_A(style->mFill.kind.AsColor().CalcColor(*aFrame->Style())) !=
+ 0xFF) {
return true;
}
diff --git a/layout/svg/SVGUtils.h b/layout/svg/SVGUtils.h
index f28879b796..809f75e344 100644
--- a/layout/svg/SVGUtils.h
+++ b/layout/svg/SVGUtils.h
@@ -346,6 +346,12 @@ class SVGUtils final {
// For a frame with a clip-path, if this flag is set then the result
// will not be clipped to the bbox of the content inside the clip-path.
eDoNotClipToBBoxOfContentInsideClipPath = 1 << 10,
+ // For some cases, e.g. when using transform-box: stroke-box, we may have
+ // the cyclical dependency if any of the elements in the subtree has
+ // non-scaling-stroke. In this case, we should break it and use
+ // transform-box:fill-box instead.
+ // https://github.com/w3c/csswg-drafts/issues/9640
+ eAvoidCycleIfNonScalingStroke = 1 << 11,
};
/**
* This function in primarily for implementing the SVG DOM function getBBox()
diff --git a/layout/svg/crashtests/1882921-1.html b/layout/svg/crashtests/1882921-1.html
new file mode 100644
index 0000000000..eafc395b18
--- /dev/null
+++ b/layout/svg/crashtests/1882921-1.html
@@ -0,0 +1,7 @@
+<script>
+document.addEventListener("DOMContentLoaded", () => {
+ document.execCommand("selectAll", false)
+})
+</script>
+<svg>
+<text fill="url(#x) rgb(76,221,188)">Text</text>
diff --git a/layout/svg/crashtests/crashtests.list b/layout/svg/crashtests/crashtests.list
index 8cdef6727c..0d38fed5ab 100644
--- a/layout/svg/crashtests/crashtests.list
+++ b/layout/svg/crashtests/crashtests.list
@@ -265,3 +265,4 @@ load 1831419.html
load 1836831.html
load 1840195-1.html
load 1848851.html
+load 1882921-1.html
diff --git a/layout/tables/crashtests/1555757-1.html b/layout/tables/crashtests/1555757-1.html
deleted file mode 100644
index 04f2b27a60..0000000000
--- a/layout/tables/crashtests/1555757-1.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-<head>
- <style>
- .class_1 {
- transition-delay: 2129ms;
- contain: strict;
- }
- </style>
-</head>
-<math>
- <mover>
- <ms></ms>
- <mtable class="class_1"></mtable>
- </mover>
-</math>
-</html>
diff --git a/layout/tables/crashtests/1555757-2.html b/layout/tables/crashtests/1555757-2.html
deleted file mode 100644
index eff048784a..0000000000
--- a/layout/tables/crashtests/1555757-2.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <style>
- #testElem {
- border: 1px solid black;
- background: yellow;
- contain: layout size;
- width: 300px;
- }
- </style>
- <script>
- function go() {
- /* trigger an incremental reflow.
- * Note: elem.style is undefined for MathML elements, so we have
- * to use setAttribute().
- */
- testElem.setAttribute("style", "width:150px");
- }
- </script>
-</head>
-<body onload="go()">
- <math>
- <mtable id="testElem">Change my size</mtable>
- </math>
-</body>
-</html>
diff --git a/layout/tables/crashtests/1881157.html b/layout/tables/crashtests/1881157.html
new file mode 100644
index 0000000000..d9beb64429
--- /dev/null
+++ b/layout/tables/crashtests/1881157.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<style>
+#a {
+ min-height: 1vw;
+ line-height: 0vw;
+}
+#b {
+ scale: 0.67976 1 1;
+}
+:root {
+ column-width: 1em;
+}
+</style>
+<script>
+document.addEventListener("DOMContentLoaded", () => {
+ b.appendChild(a)
+ document.execCommand("fontSize", false, 5)
+ b.style.setProperty("border-top-style", "dotted")
+})
+function func_0() {
+ b.rules = "cols"
+}
+</script>
+<dialog id="a" open="true">,&#x27;/,_J</dialog>
+<table id="b">
+<details open="true" ontoggle="func_0()">
diff --git a/layout/tables/crashtests/347506-1.xhtml b/layout/tables/crashtests/347506-1.xhtml
deleted file mode 100644
index 4119389a56..0000000000
--- a/layout/tables/crashtests/347506-1.xhtml
+++ /dev/null
@@ -1,23 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-<body>
-
-<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
-
- <mtable>
- <mtr>
- <mtd><mi>x</mi></mtd>
- <mtd rowspan="4" columnspan="4"><mi>y</mi></mtd>
- </mtr>
- <mtr>
- <mtd rowspan="0" columnspan="0"><mi>z</mi></mtd>
- <mtd><mi>w</mi></mtd>
- </mtr>
- </mtable>
-
-
-</math></div>
-
-</body>
-
-</html> \ No newline at end of file
diff --git a/layout/tables/crashtests/crashtests.list b/layout/tables/crashtests/crashtests.list
index 92bca235e3..58bdad5c78 100644
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -45,7 +45,6 @@ load 343087-1.html
load 343588-1.xhtml
load 344000-1.html
load 347367.html
-load 347506-1.xhtml
load 347506-2.xhtml
load 347725-1.xhtml
load 348977-1.xhtml
@@ -140,7 +139,7 @@ load 580481-1.xhtml
asserts(1) load 595758-1.xhtml # Bug 714667
load 595758-2.xhtml
load 678447-1.html
-skip-if(Android&&browserIsRemote) load 691824-1.xhtml # bug 1507207
+skip-if(Android) load 691824-1.xhtml # bug 1507207
load 695430-1.html
load 696640-1.html
load 696640-2.html
@@ -167,8 +166,6 @@ load 1232881-1.html
load 1243623-1.html
load 1335552-1.html
load 1335552-2.html
-load 1555757-1.html
-load 1555757-2.html
load 1555757-3.html
load 1555757-4.html
load 1607045.html
@@ -180,3 +177,4 @@ load 1767364-4.html
load 1795030.html
load 1795051.html
load 1821177.html
+asserts(0-2) load 1881157.html # bug 1884058
diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp
index a13a6a1c3a..7c29baa5b0 100644
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -981,13 +981,13 @@ void nsTableCellMap::SetBCBorderCorner(LogicalCorner aCorner,
int32_t yPos = aRowIndex;
int32_t rgYPos = aRowIndex - aCellMapStart;
- if (eLogicalCornerBStartIEnd == aCorner) {
+ if (LogicalCorner::BStartIEnd == aCorner) {
xPos++;
- } else if (eLogicalCornerBEndIEnd == aCorner) {
+ } else if (LogicalCorner::BEndIEnd == aCorner) {
xPos++;
rgYPos++;
yPos++;
- } else if (eLogicalCornerBEndIStart == aCorner) {
+ } else if (LogicalCorner::BEndIStart == aCorner) {
rgYPos++;
yPos++;
}
diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp
index 70556d5e28..6eb1c3146a 100644
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -456,7 +456,7 @@ void nsTableCellFrame::BlockDirAlignChild(WritingMode aWM, nscoord aMaxAscent) {
ReflowOutput desiredSize(aWM);
desiredSize.SetSize(aWM, GetLogicalSize(aWM));
- nsRect overflow(nsPoint(0, 0), GetSize());
+ nsRect overflow(nsPoint(), GetSize());
overflow.Inflate(GetBorderOverflow());
desiredSize.mOverflowAreas.SetAllTo(overflow);
ConsiderChildOverflow(desiredSize.mOverflowAreas, firstKid);
@@ -761,24 +761,21 @@ void nsTableCellFrame::Reflow(nsPresContext* aPresContext,
kidReflowInput.Init(aPresContext, Nothing(), Nothing(), Some(padding));
if (firstKid->IsScrollFrame()) {
// Propagate explicit block sizes to our inner frame, if it's a scroll
- // frame.
+ // frame. Note that in table layout, explicit heights act as a minimum
+ // height, see nsTableRowFrame::CalcCellActualBSize.
+ //
// Table cells don't respect box-sizing, so we need to remove the
// padding, so that the scroll-frame sizes properly (since the
// scrollbars also add to the padding area).
auto ToScrolledBSize = [&](const nscoord aBSize) {
return std::max(0, aBSize - padding.BStartEnd(kidWM));
};
+ nscoord minBSize = aReflowInput.ComputedMinBSize();
if (aReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) {
- kidReflowInput.SetComputedBSize(
- ToScrolledBSize(aReflowInput.ComputedBSize()));
+ minBSize = std::max(minBSize, aReflowInput.ComputedBSize());
}
- if (aReflowInput.ComputedMinBSize() > 0) {
- kidReflowInput.SetComputedMinBSize(
- ToScrolledBSize(aReflowInput.ComputedMinBSize()));
- }
- if (aReflowInput.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) {
- kidReflowInput.SetComputedMaxBSize(
- ToScrolledBSize(aReflowInput.ComputedMaxBSize()));
+ if (minBSize > 0) {
+ kidReflowInput.SetComputedMinBSize(ToScrolledBSize(minBSize));
}
}
}
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index 9a359192c0..e7fd7340bf 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -82,13 +82,19 @@ struct TableReflowInput final {
std::max(0, mReflowInput.ComputedISize() - table->GetColSpacing(-1) -
table->GetColSpacing(table->GetColCount()));
- // Bug 1863421 will fix border-spacing issue in the block-axis in printing.
mAvailSize.BSize(mWM) = aMode == TableReflowMode::Measuring
? NS_UNCONSTRAINEDSIZE
: mReflowInput.AvailableBSize();
- AdvanceBCoord(aBorderPadding.BStart(mWM));
- ReduceAvailableBSizeBy(aBorderPadding.BEnd(mWM) + table->GetRowSpacing(-1) +
- table->GetRowSpacing(table->GetRowCount()));
+ AdvanceBCoord(aBorderPadding.BStart(mWM) +
+ (!table->GetPrevInFlow() ? table->GetRowSpacing(-1) : 0));
+ if (aReflowInput.mStyleBorder->mBoxDecorationBreak ==
+ StyleBoxDecorationBreak::Clone) {
+ // At this point, we're assuming we won't be the last fragment, so we only
+ // reserve space for block-end border-padding if we're cloning it on each
+ // fragment; and we don't need to reserve any row-spacing for this
+ // hypothetical fragmentation, either.
+ ReduceAvailableBSizeBy(aBorderPadding.BEnd(mWM));
+ }
}
// Advance to the next block-offset and reduce the available block-size.
@@ -1633,12 +1639,15 @@ void nsTableFrame::Reflow(nsPresContext* aPresContext,
// Check for an overflow list, and append any row group frames being pushed
MoveOverflowToChildList();
- bool haveDesiredBSize = false;
+ bool haveCalledCalcDesiredBSize = false;
SetHaveReflowedColGroups(false);
- // Bug 1863421: We need to call ApplySkipSides() for borderPadding so that it
- // is correct in a table continuation.
- LogicalMargin borderPadding = aReflowInput.ComputedLogicalBorderPadding(wm);
+ LogicalMargin borderPadding =
+ aReflowInput.ComputedLogicalBorderPadding(wm).ApplySkipSides(
+ PreReflowBlockLevelLogicalSkipSides());
+ nsIFrame* lastChildReflowed = nullptr;
+ const nsSize containerSize =
+ aReflowInput.ComputedSizeAsContainerIfConstrained();
// The tentative width is the width we assumed for the table when the child
// frames were positioned (which only matters in vertical-rl mode, because
@@ -1691,7 +1700,6 @@ void nsTableFrame::Reflow(nsPresContext* aPresContext,
needToInitiateSpecialReflow =
HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
}
- nsIFrame* lastChildReflowed = nullptr;
NS_ASSERTION(!aReflowInput.mFlags.mSpecialBSizeReflow,
"Shouldn't be in special bsize reflow here!");
@@ -1717,8 +1725,6 @@ void nsTableFrame::Reflow(nsPresContext* aPresContext,
// Note that vertical-lr, unlike vertical-rl, doesn't need to take special
// care of this situation, because they're positioned relative to the
// left-hand edge.
- const nsSize containerSize =
- aReflowInput.ComputedSizeAsContainerIfConstrained();
if (wm.IsVerticalRL()) {
tentativeContainerWidth = containerSize.width;
mayAdjustXForAllChildren = true;
@@ -1736,29 +1742,36 @@ void nsTableFrame::Reflow(nsPresContext* aPresContext,
ReflowInput& mutable_rs = const_cast<ReflowInput&>(aReflowInput);
// distribute extra block-direction space to rows
- aDesiredSize.BSize(wm) = CalcDesiredBSize(aReflowInput, borderPadding);
+ aDesiredSize.BSize(wm) =
+ CalcDesiredBSize(aReflowInput, borderPadding, aStatus);
+ haveCalledCalcDesiredBSize = true;
+
mutable_rs.mFlags.mSpecialBSizeReflow = true;
ReflowTable(aDesiredSize, aReflowInput, borderPadding,
TableReflowMode::Final, lastChildReflowed, aStatus);
- if (lastChildReflowed && aStatus.IsIncomplete()) {
- // if there is an incomplete child, then set the desired bsize
- // to include it but not the next one
- aDesiredSize.BSize(wm) =
- borderPadding.BEnd(wm) + GetRowSpacing(GetRowCount()) +
- lastChildReflowed->GetLogicalNormalRect(wm, containerSize).BEnd(wm);
- }
- haveDesiredBSize = true;
-
mutable_rs.mFlags.mSpecialBSizeReflow = false;
}
}
+ if (aStatus.IsIncomplete() &&
+ aReflowInput.mStyleBorder->mBoxDecorationBreak ==
+ StyleBoxDecorationBreak::Slice) {
+ borderPadding.BEnd(wm) = 0;
+ }
+
aDesiredSize.ISize(wm) =
aReflowInput.ComputedISize() + borderPadding.IStartEnd(wm);
- if (!haveDesiredBSize) {
- aDesiredSize.BSize(wm) = CalcDesiredBSize(aReflowInput, borderPadding);
+ if (!haveCalledCalcDesiredBSize) {
+ aDesiredSize.BSize(wm) =
+ CalcDesiredBSize(aReflowInput, borderPadding, aStatus);
+ } else if (lastChildReflowed && aStatus.IsIncomplete()) {
+ // If there is an incomplete child, then set the desired block-size to
+ // include it but not the next one.
+ aDesiredSize.BSize(wm) =
+ borderPadding.BEnd(wm) +
+ lastChildReflowed->GetLogicalNormalRect(wm, containerSize).BEnd(wm);
}
if (IsRowInserted()) {
ProcessRowInserted(aDesiredSize.BSize(wm));
@@ -2380,16 +2393,15 @@ nsMargin nsTableFrame::GetUsedMargin() const {
return nsMargin(0, 0, 0, 0);
}
-// This property is only set on the first-in-flow of nsTableFrame.
+// TODO(TYLin): Should this property only be set on the first-in-flow of
+// nsTableFrame?
NS_DECLARE_FRAME_PROPERTY_DELETABLE(TableBCDataProperty, TableBCData)
TableBCData* nsTableFrame::GetTableBCData() const {
- return FirstInFlow()->GetProperty(TableBCDataProperty());
+ return GetProperty(TableBCDataProperty());
}
TableBCData* nsTableFrame::GetOrCreateTableBCData() {
- MOZ_ASSERT(!GetPrevInFlow(),
- "TableBCProperty should only be set on the first-in-flow!");
TableBCData* value = GetProperty(TableBCDataProperty());
if (!value) {
value = new TableBCData();
@@ -2609,7 +2621,6 @@ void nsTableFrame::PlaceRepeatedFooter(TableReflowInput& aReflowInput,
kidAvailSize, Nothing(),
ReflowInput::InitFlag::CallerWillInit);
InitChildReflowInput(footerReflowInput);
- aReflowInput.AdvanceBCoord(GetRowSpacing(GetRowCount()));
nsRect origTfootRect = aTfoot->GetRect();
nsRect origTfootInkOverflow = aTfoot->InkOverflowRect();
@@ -2727,6 +2738,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
PushChildrenToOverflow(rowGroups, childX);
aStatus.Reset();
aStatus.SetIncomplete();
+ aLastChildReflowed = allowRepeatedFooter ? tfoot : prevKidFrame;
break;
}
@@ -2769,7 +2781,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
.BEnd(wm) > 0)) {
kidReflowInput.mFlags.mIsTopOfPage = false;
}
- aReflowInput.AdvanceBCoord(rowSpacing);
+
// record the presence of a next in flow, it might get destroyed so we
// need to reorder the row group array
const bool reorder = kidFrame->GetNextInFlow();
@@ -2813,7 +2825,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
aStatus.Reset();
aStatus.SetIncomplete();
PushChildrenToOverflow(rowGroups, childX + 1);
- aLastChildReflowed = kidFrame;
+ aLastChildReflowed = allowRepeatedFooter ? tfoot : kidFrame;
break;
}
} else { // we are not on top, push this rowgroup onto the next page
@@ -2822,7 +2834,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
aStatus.Reset();
aStatus.SetIncomplete();
PushChildrenToOverflow(rowGroups, childX);
- aLastChildReflowed = prevKidFrame;
+ aLastChildReflowed = allowRepeatedFooter ? tfoot : prevKidFrame;
break;
} else { // we can't push so lets make clear how much space we need
PlaceChild(aReflowInput, kidFrame, kidReflowInput, kidPosition,
@@ -2850,6 +2862,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
// Place the child
PlaceChild(aReflowInput, kidFrame, kidReflowInput, kidPosition,
containerSize, desiredSize, oldKidRect, oldKidInkOverflow);
+ aReflowInput.AdvanceBCoord(rowSpacing);
// Remember where we just were in case we end up pushing children
prevKidFrame = kidFrame;
@@ -2887,6 +2900,7 @@ void nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
if (kidFrame->GetNextSibling()) {
PushChildrenToOverflow(rowGroups, childX + 1);
}
+ aLastChildReflowed = allowRepeatedFooter ? tfoot : kidFrame;
break;
}
} else { // it isn't being reflowed
@@ -2970,10 +2984,10 @@ void nsTableFrame::ReflowColGroups(gfxContext* aRenderingContext) {
}
nscoord nsTableFrame::CalcDesiredBSize(const ReflowInput& aReflowInput,
- const LogicalMargin& aBorderPadding) {
+ const LogicalMargin& aBorderPadding,
+ const nsReflowStatus& aStatus) {
WritingMode wm = aReflowInput.GetWritingMode();
- // get the natural bsize based on the last child's (row group) rect
RowGroupArray rowGroups = OrderedRowGroups();
if (rowGroups.IsEmpty()) {
if (eCompatibility_NavQuirks == PresContext()->CompatibilityMode()) {
@@ -2990,11 +3004,20 @@ nscoord nsTableFrame::CalcDesiredBSize(const ReflowInput& aReflowInput,
int32_t colCount = cellMap->GetColCount();
nscoord desiredBSize = aBorderPadding.BStartEnd(wm);
if (rowCount > 0 && colCount > 0) {
- desiredBSize += GetRowSpacing(-1);
- for (uint32_t rgIdx = 0; rgIdx < rowGroups.Length(); rgIdx++) {
- desiredBSize += rowGroups[rgIdx]->BSize(wm) +
- GetRowSpacing(rowGroups[rgIdx]->GetRowCount() +
- rowGroups[rgIdx]->GetStartRowIndex());
+ if (!GetPrevInFlow()) {
+ desiredBSize += GetRowSpacing(-1);
+ }
+ const nsTableRowGroupFrame* lastRG = rowGroups.LastElement();
+ for (nsTableRowGroupFrame* rg : rowGroups) {
+ desiredBSize += rg->BSize(wm);
+ if (rg != lastRG || aStatus.IsFullyComplete()) {
+ desiredBSize +=
+ GetRowSpacing(rg->GetStartRowIndex() + rg->GetRowCount());
+ }
+ }
+ if (aReflowInput.ComputedBSize() == NS_UNCONSTRAINEDSIZE &&
+ aStatus.IsIncomplete()) {
+ desiredBSize = std::max(desiredBSize, aReflowInput.AvailableBSize());
}
}
@@ -3903,16 +3926,19 @@ class BCMapCellIterator {
public:
BCMapCellIterator(nsTableFrame* aTableFrame, const TableArea& aDamageArea);
- void First(BCMapCellInfo& aMapCellInfo);
+ void First(BCMapCellInfo& aMapInfo);
- void Next(BCMapCellInfo& aMapCellInfo);
+ void Next(BCMapCellInfo& aMapInfo);
- void PeekIEnd(BCMapCellInfo& aRefInfo, uint32_t aRowIndex,
+ void PeekIEnd(const BCMapCellInfo& aRefInfo, int32_t aRowIndex,
BCMapCellInfo& aAjaInfo);
- void PeekBEnd(BCMapCellInfo& aRefInfo, uint32_t aColIndex,
+ void PeekBEnd(const BCMapCellInfo& aRefInfo, int32_t aColIndex,
BCMapCellInfo& aAjaInfo);
+ void PeekIStart(const BCMapCellInfo& aRefInfo, int32_t aRowIndex,
+ BCMapCellInfo& aAjaInfo);
+
bool IsNewRow() { return mIsNewRow; }
nsTableRowFrame* GetPrevRow() const { return mPrevRow; }
@@ -3927,6 +3953,8 @@ class BCMapCellIterator {
private:
bool SetNewRow(nsTableRowFrame* row = nullptr);
bool SetNewRowGroup(bool aFindFirstDamagedRow);
+ void PeekIAt(const BCMapCellInfo& aRefInfo, int32_t aRowIndex,
+ int32_t aColIndex, BCMapCellInfo& aAjaInfo);
nsTableFrame* mTableFrame;
nsTableCellMap* mTableCellMap;
@@ -4184,35 +4212,14 @@ void BCMapCellIterator::Next(BCMapCellInfo& aMapInfo) {
mAtEnd = true;
}
-void BCMapCellIterator::PeekIEnd(BCMapCellInfo& aRefInfo, uint32_t aRowIndex,
- BCMapCellInfo& aAjaInfo) {
- aAjaInfo.ResetCellInfo();
- int32_t colIndex = aRefInfo.mColIndex + aRefInfo.mColSpan;
- uint32_t rgRowIndex = aRowIndex - mRowGroupStart;
-
- BCCellData* cellData =
- static_cast<BCCellData*>(mCellMap->GetDataAt(rgRowIndex, colIndex));
- if (!cellData) { // add a dead cell data
- NS_ASSERTION(colIndex < mTableCellMap->GetColCount(), "program error");
- TableArea damageArea;
- cellData = static_cast<BCCellData*>(mCellMap->AppendCell(
- *mTableCellMap, nullptr, rgRowIndex, false, 0, damageArea));
- if (!cellData) ABORT0();
- }
- nsTableRowFrame* row = nullptr;
- if (cellData->IsRowSpan()) {
- rgRowIndex -= cellData->GetRowSpanOffset();
- cellData =
- static_cast<BCCellData*>(mCellMap->GetDataAt(rgRowIndex, colIndex));
- if (!cellData) ABORT0();
- } else {
- row = mRow;
- }
- aAjaInfo.SetInfo(row, colIndex, cellData, this);
+void BCMapCellIterator::PeekIEnd(const BCMapCellInfo& aRefInfo,
+ int32_t aRowIndex, BCMapCellInfo& aAjaInfo) {
+ PeekIAt(aRefInfo, aRowIndex, aRefInfo.mColIndex + aRefInfo.mColSpan,
+ aAjaInfo);
}
-void BCMapCellIterator::PeekBEnd(BCMapCellInfo& aRefInfo, uint32_t aColIndex,
- BCMapCellInfo& aAjaInfo) {
+void BCMapCellIterator::PeekBEnd(const BCMapCellInfo& aRefInfo,
+ int32_t aColIndex, BCMapCellInfo& aAjaInfo) {
aAjaInfo.ResetCellInfo();
int32_t rowIndex = aRefInfo.mRowIndex + aRefInfo.mRowSpan;
int32_t rgRowIndex = rowIndex - mRowGroupStart;
@@ -4227,6 +4234,7 @@ void BCMapCellIterator::PeekBEnd(BCMapCellInfo& aRefInfo, uint32_t aColIndex,
if (rg) {
cellMap = mTableCellMap->GetMapFor(rg, cellMap);
if (!cellMap) ABORT0();
+ // First row of the next row group
rgRowIndex = 0;
nextRow = rg->GetFirstRow();
}
@@ -4251,13 +4259,46 @@ void BCMapCellIterator::PeekBEnd(BCMapCellInfo& aRefInfo, uint32_t aColIndex,
if (!cellData) ABORT0();
}
if (cellData->IsColSpan()) {
- aColIndex -= cellData->GetColSpanOffset();
+ aColIndex -= static_cast<int32_t>(cellData->GetColSpanOffset());
cellData =
static_cast<BCCellData*>(cellMap->GetDataAt(rgRowIndex, aColIndex));
}
aAjaInfo.SetInfo(nextRow, aColIndex, cellData, this, cellMap);
}
+void BCMapCellIterator::PeekIStart(const BCMapCellInfo& aRefInfo,
+ int32_t aRowIndex, BCMapCellInfo& aAjaInfo) {
+ NS_ASSERTION(aRefInfo.mColIndex != 0, "program error");
+ PeekIAt(aRefInfo, aRowIndex, aRefInfo.mColIndex - 1, aAjaInfo);
+}
+
+void BCMapCellIterator::PeekIAt(const BCMapCellInfo& aRefInfo,
+ int32_t aRowIndex, int32_t aColIndex,
+ BCMapCellInfo& aAjaInfo) {
+ aAjaInfo.ResetCellInfo();
+ int32_t rgRowIndex = aRowIndex - mRowGroupStart;
+
+ auto* cellData =
+ static_cast<BCCellData*>(mCellMap->GetDataAt(rgRowIndex, aColIndex));
+ if (!cellData) { // add a dead cell data
+ NS_ASSERTION(aColIndex < mTableCellMap->GetColCount(), "program error");
+ TableArea damageArea;
+ cellData = static_cast<BCCellData*>(mCellMap->AppendCell(
+ *mTableCellMap, nullptr, rgRowIndex, false, 0, damageArea));
+ if (!cellData) ABORT0();
+ }
+ nsTableRowFrame* row = nullptr;
+ if (cellData->IsRowSpan()) {
+ rgRowIndex -= static_cast<int32_t>(cellData->GetRowSpanOffset());
+ cellData =
+ static_cast<BCCellData*>(mCellMap->GetDataAt(rgRowIndex, aColIndex));
+ if (!cellData) ABORT0();
+ } else {
+ row = mRow;
+ }
+ aAjaInfo.SetInfo(row, aColIndex, cellData, this);
+}
+
#define CELL_CORNER true
/** return the border style, border color and optionally the width in
@@ -5043,6 +5084,24 @@ void nsTableFrame::CalcBCBorders() {
BCCellBorders lastBlockDirBorders(damageArea.ColCount() + 1,
damageArea.StartCol());
if (!lastBlockDirBorders.borders) ABORT0();
+ if (damageArea.StartRow() != 0) {
+ // Ok, we've filled with information about the previous row's borders with
+ // the default state, which is "no borders." This is incorrect, and leaving
+ // it will result in an erroneous behaviour if the previous row did have
+ // borders, and the dirty rows don't, as we will not mark the beginning of
+ // the no border segment.
+ TableArea prevRowArea(damageArea.StartCol(), damageArea.StartRow() - 1,
+ damageArea.ColCount(), 1);
+ BCMapCellIterator iter(this, prevRowArea);
+ BCMapCellInfo info(this);
+ for (iter.First(info); !iter.mAtEnd; iter.Next(info)) {
+ if (info.mColIndex == prevRowArea.StartCol()) {
+ lastBlockDirBorders.borders[0] = info.GetIStartEdgeBorder();
+ }
+ lastBlockDirBorders.borders[info.mColIndex - prevRowArea.StartCol() + 1] =
+ info.GetIEndEdgeBorder();
+ }
+ }
// Inline direction border at block start of the table, computed by the
// previous cell. Unused afterwards.
Maybe<BCCellBorder> firstRowBStartEdgeBorder;
@@ -5072,12 +5131,27 @@ void nsTableFrame::CalcBCBorders() {
if (iter.IsNewRow()) {
if (info.mRowIndex == 0) {
BCCellBorder border;
- border.Reset(info.mRowIndex, info.mRowSpan);
+ if (info.mColIndex == 0) {
+ border.Reset(info.mRowIndex, info.mRowSpan);
+ } else {
+ // Similar to lastBlockDirBorders, the previous block-start border
+ // is filled by actually quering the adjacent cell.
+ BCMapCellInfo ajaInfo(this);
+ iter.PeekIStart(info, info.mRowIndex, ajaInfo);
+ border = ajaInfo.GetBStartEdgeBorder();
+ }
firstRowBStartEdgeBorder = Some(border);
} else {
firstRowBStartEdgeBorder = Nothing{};
}
- lastBEndBorder.Reset(info.GetCellEndRowIndex() + 1, info.mRowSpan);
+ if (info.mColIndex == 0) {
+ lastBEndBorder.Reset(info.GetCellEndRowIndex() + 1, info.mRowSpan);
+ } else {
+ // Same as above, but for block-end border.
+ BCMapCellInfo ajaInfo(this);
+ iter.PeekIStart(info, info.mRowIndex, ajaInfo);
+ lastBEndBorder = ajaInfo.GetBEndEdgeBorder();
+ }
} else if (info.mColIndex > damageArea.StartCol()) {
lastBEndBorder = lastBEndBorders[info.mColIndex - 1];
if (lastBEndBorder.rowIndex > (info.GetCellEndRowIndex() + 1)) {
@@ -5105,7 +5179,7 @@ void nsTableFrame::CalcBCBorders() {
} else {
bStartIStartCorner.Update(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBStartIStart, *iter.mCellMap, 0, 0, colIdx,
+ LogicalCorner::BStartIStart, *iter.mCellMap, 0, 0, colIdx,
LogicalSide(bStartIStartCorner.ownerSide),
bStartIStartCorner.subWidth, bStartIStartCorner.bevel);
}
@@ -5164,7 +5238,7 @@ void nsTableFrame::CalcBCBorders() {
(0 == rowB) ? bStartCorners[0] : bEndCorners[0];
bStartIStartCorner.Update(eLogicalSideBEnd, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBStartIStart, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BStartIStart, *iter.mCellMap, iter.mRowGroupStart,
rowB, 0, LogicalSide(bStartIStartCorner.ownerSide),
bStartIStartCorner.subWidth, bStartIStartCorner.bevel);
bEndCorners[0].Set(eLogicalSideBStart, currentBorder);
@@ -5203,14 +5277,15 @@ void nsTableFrame::CalcBCBorders() {
: bEndCorners[info.GetCellEndColIndex() + 1];
bStartIEndCorner.Update(eLogicalSideBEnd, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBStartIEnd, *iter.mCellMap, iter.mRowGroupStart, rowB,
- info.GetCellEndColIndex(), LogicalSide(bStartIEndCorner.ownerSide),
- bStartIEndCorner.subWidth, bStartIEndCorner.bevel);
+ LogicalCorner::BStartIEnd, *iter.mCellMap, iter.mRowGroupStart,
+ rowB, info.GetCellEndColIndex(),
+ LogicalSide(bStartIEndCorner.ownerSide), bStartIEndCorner.subWidth,
+ bStartIEndCorner.bevel);
BCCornerInfo& bEndIEndCorner =
bEndCorners[info.GetCellEndColIndex() + 1];
bEndIEndCorner.Set(eLogicalSideBStart, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIEnd, *iter.mCellMap, iter.mRowGroupStart, rowB,
+ LogicalCorner::BEndIEnd, *iter.mCellMap, iter.mRowGroupStart, rowB,
info.GetCellEndColIndex(), LogicalSide(bEndIEndCorner.ownerSide),
bEndIEndCorner.subWidth, bEndIEndCorner.bevel);
// update lastBlockDirBorders and see if a new segment starts
@@ -5293,7 +5368,7 @@ void nsTableFrame::CalcBCBorders() {
if (0 != rowB) {
// Ok, actually store the information
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBStartIEnd, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BStartIEnd, *iter.mCellMap, iter.mRowGroupStart,
rowB, info.GetCellEndColIndex(),
LogicalSide(bStartIEndCorner->ownerSide),
bStartIEndCorner->subWidth, bStartIEndCorner->bevel);
@@ -5301,8 +5376,8 @@ void nsTableFrame::CalcBCBorders() {
// Propagate this segment down the rowspan
for (int32_t rX = rowB + 1; rX < rowB + segLength; rX++) {
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIEnd, *iter.mCellMap, iter.mRowGroupStart, rX,
- info.GetCellEndColIndex(),
+ LogicalCorner::BEndIEnd, *iter.mCellMap, iter.mRowGroupStart,
+ rX, info.GetCellEndColIndex(),
LogicalSide(bStartIEndCorner->ownerSide),
bStartIEndCorner->subWidth, false);
}
@@ -5336,7 +5411,7 @@ void nsTableFrame::CalcBCBorders() {
BCCornerInfo& bEndIStartCorner = bEndCorners[colIdx];
bEndIStartCorner.Update(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIStart, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BEndIStart, *iter.mCellMap, iter.mRowGroupStart,
info.GetCellEndRowIndex(), colIdx,
LogicalSide(bEndIStartCorner.ownerSide), bEndIStartCorner.subWidth,
bEndIStartCorner.bevel);
@@ -5346,7 +5421,7 @@ void nsTableFrame::CalcBCBorders() {
// inline-end of the overall table.
if (info.mNumTableCols == colIdx + 1) {
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIEnd, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BEndIEnd, *iter.mCellMap, iter.mRowGroupStart,
info.GetCellEndRowIndex(), colIdx,
LogicalSide(bEndIEndCorner.ownerSide), bEndIEndCorner.subWidth,
bEndIEndCorner.bevel, true);
@@ -5423,7 +5498,7 @@ void nsTableFrame::CalcBCBorders() {
colIdx >= damageArea.StartCol()) {
if (hitsSpanBelow) {
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIStart, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BEndIStart, *iter.mCellMap, iter.mRowGroupStart,
info.GetCellEndRowIndex(), colIdx,
LogicalSide(bEndIStartCorner.ownerSide),
bEndIStartCorner.subWidth, bEndIStartCorner.bevel);
@@ -5433,7 +5508,7 @@ void nsTableFrame::CalcBCBorders() {
BCCornerInfo& corner = bEndCorners[c];
corner.Set(eLogicalSideIEnd, currentBorder);
tableCellMap->SetBCBorderCorner(
- eLogicalCornerBEndIStart, *iter.mCellMap, iter.mRowGroupStart,
+ LogicalCorner::BEndIStart, *iter.mCellMap, iter.mRowGroupStart,
info.GetCellEndRowIndex(), c, LogicalSide(corner.ownerSide),
corner.subWidth, false);
}
diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h
index 0204af9834..d6105308c6 100644
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -634,7 +634,8 @@ class nsTableFrame : public nsContainerFrame {
// distribute extra block-size to table rows if the table has a specified
// block-size larger than the intrinsic block-size.
nscoord CalcDesiredBSize(const ReflowInput& aReflowInput,
- const LogicalMargin& aBorderPadding);
+ const LogicalMargin& aBorderPadding,
+ const nsReflowStatus& aStatus);
// The following is a helper for CalcDesiredBSize
void DistributeBSizeToRows(const ReflowInput& aReflowInput, nscoord aAmount);
diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp
index 5d8119522f..1190561ee8 100644
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -13,7 +13,6 @@
#include "mozilla/ComputedStyle.h"
#include "mozilla/StaticPrefs_layout.h"
#include "nsStyleConsts.h"
-#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIFrame.h"
#include "nsIFrameInlines.h"
@@ -23,9 +22,7 @@
#include "nsHTMLParts.h"
#include "nsTableColGroupFrame.h"
#include "nsTableColFrame.h"
-#include "nsCOMPtr.h"
#include "nsDisplayList.h"
-#include "nsIFrameInlines.h"
#include <algorithm>
#ifdef ACCESSIBILITY
@@ -443,35 +440,36 @@ void nsTableRowFrame::UpdateBSize(nscoord aBSize, nscoord aAscent,
return;
}
- if (aBSize != NS_UNCONSTRAINEDSIZE) {
- if (!(aCellFrame->HasVerticalAlignBaseline())) { // only the cell's height
- // matters
- if (GetInitialBSize() < aBSize) {
- int32_t rowSpan = aTableFrame->GetEffectiveRowSpan(*aCellFrame);
- if (rowSpan == 1) {
- SetContentBSize(aBSize);
- }
- }
- } else { // the alignment on the baseline can change the bsize
- NS_ASSERTION((aAscent != NS_UNCONSTRAINEDSIZE) &&
- (aDescent != NS_UNCONSTRAINEDSIZE),
- "invalid call");
- // see if this is a long ascender
- if (mMaxCellAscent < aAscent) {
- mMaxCellAscent = aAscent;
- }
- // see if this is a long descender and without rowspan
- if (mMaxCellDescent < aDescent) {
- int32_t rowSpan = aTableFrame->GetEffectiveRowSpan(*aCellFrame);
- if (rowSpan == 1) {
- mMaxCellDescent = aDescent;
- }
+ if (aBSize == NS_UNCONSTRAINEDSIZE) {
+ return;
+ }
+ if (!aCellFrame->HasVerticalAlignBaseline()) {
+ // only the cell's height matters
+ if (GetInitialBSize() < aBSize) {
+ int32_t rowSpan = aTableFrame->GetEffectiveRowSpan(*aCellFrame);
+ if (rowSpan == 1) {
+ SetContentBSize(aBSize);
}
- // keep the tallest bsize in sync
- if (GetInitialBSize() < mMaxCellAscent + mMaxCellDescent) {
- SetContentBSize(mMaxCellAscent + mMaxCellDescent);
+ }
+ } else { // the alignment on the baseline can change the bsize
+ NS_ASSERTION(
+ aAscent != NS_UNCONSTRAINEDSIZE && aDescent != NS_UNCONSTRAINEDSIZE,
+ "invalid call");
+ // see if this is a long ascender
+ if (mMaxCellAscent < aAscent) {
+ mMaxCellAscent = aAscent;
+ }
+ // see if this is a long descender and without rowspan
+ if (mMaxCellDescent < aDescent) {
+ int32_t rowSpan = aTableFrame->GetEffectiveRowSpan(*aCellFrame);
+ if (rowSpan == 1) {
+ mMaxCellDescent = aDescent;
}
}
+ // keep the tallest bsize in sync
+ if (GetInitialBSize() < mMaxCellAscent + mMaxCellDescent) {
+ SetContentBSize(mMaxCellAscent + mMaxCellDescent);
+ }
}
}
@@ -497,7 +495,7 @@ nscoord nsTableRowFrame::CalcBSize(const ReflowInput& aReflowInput) {
kidFrame = kidFrame->GetNextCell()) {
MOZ_ASSERT(kidFrame->GetWritingMode() == wm);
LogicalSize desSize = kidFrame->GetDesiredSize();
- if ((NS_UNCONSTRAINEDSIZE == aReflowInput.AvailableBSize()) &&
+ if (NS_UNCONSTRAINEDSIZE == aReflowInput.AvailableBSize() &&
!GetPrevInFlow()) {
desSize.BSize(wm) = CalcCellActualBSize(kidFrame, desSize.BSize(wm), wm);
}
@@ -706,19 +704,19 @@ void nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
bool doReflowChild = true;
if (!aReflowInput.ShouldReflowAllKids() && !aTableFrame.IsGeometryDirty() &&
!kidFrame->IsSubtreeDirty()) {
- if (!aReflowInput.mFlags.mSpecialBSizeReflow) doReflowChild = false;
- } else if ((NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize())) {
+ if (!aReflowInput.mFlags.mSpecialBSizeReflow) {
+ doReflowChild = false;
+ }
+ } else if (NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize()) {
// We don't reflow a rowspan >1 cell here with a constrained bsize.
// That happens in nsTableRowGroupFrame::SplitSpanningCells.
if (aTableFrame.GetEffectiveRowSpan(*kidFrame) > 1) {
doReflowChild = false;
}
}
- if (aReflowInput.mFlags.mSpecialBSizeReflow) {
- if (!isPaginated &&
- !kidFrame->HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
- continue;
- }
+ if (aReflowInput.mFlags.mSpecialBSizeReflow && !isPaginated &&
+ !kidFrame->HasAnyStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE)) {
+ continue;
}
uint32_t cellColIndex = kidFrame->ColIndex();
diff --git a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
index 05ad47356d..6df2ad5d71 100644
--- a/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
+++ b/layout/tools/layout-debug/src/nsLayoutDebuggingTools.cpp
@@ -21,8 +21,6 @@
#include "nsViewManager.h"
#include "nsIFrame.h"
-#include "nsLayoutCID.h"
-
#include "mozilla/dom/Document.h"
#include "mozilla/dom/Element.h"
#include "mozilla/Preferences.h"
diff --git a/layout/tools/layout-debug/ui/content/layoutdebug.js b/layout/tools/layout-debug/ui/content/layoutdebug.js
index 0c68f0155c..b381822c3c 100644
--- a/layout/tools/layout-debug/ui/content/layoutdebug.js
+++ b/layout/tools/layout-debug/ui/content/layoutdebug.js
@@ -443,7 +443,7 @@ function toggle(menuitem) {
function openFile() {
var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
- fp.init(window, "Select a File", Ci.nsIFilePicker.modeOpen);
+ fp.init(window.browsingContext, "Select a File", Ci.nsIFilePicker.modeOpen);
fp.appendFilters(Ci.nsIFilePicker.filterHTML | Ci.nsIFilePicker.filterAll);
fp.open(rv => {
if (
diff --git a/layout/tools/reftest/api.js b/layout/tools/reftest/api.js
index 36b9cba32a..285bba3e55 100644
--- a/layout/tools/reftest/api.js
+++ b/layout/tools/reftest/api.js
@@ -110,7 +110,7 @@ this.reftest = class extends ExtensionAPI {
// find it by its type nor will domwindowcreated be fired.
// So we listen to either initial-document-element-inserted which
// indicates when it's okay to search for the main window by type again.
- Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
+ Services.obs.addObserver(function observer(aSubject, aTopic) {
Services.obs.removeObserver(observer, aTopic);
startAndroid(GetMainWindow());
}, "initial-document-element-inserted");
diff --git a/layout/tools/reftest/reftest-content.js b/layout/tools/reftest/reftest-content.js
index 4fdd5de26f..9aab933ed0 100644
--- a/layout/tools/reftest/reftest-content.js
+++ b/layout/tools/reftest/reftest-content.js
@@ -83,7 +83,7 @@ function IDForEventTarget(event) {
}
var progressListener = {
- onStateChange(webprogress, request, flags, status) {
+ onStateChange(webprogress, request, flags) {
let uri;
try {
request.QueryInterface(Ci.nsIChannel);
@@ -286,7 +286,7 @@ function setupViewport(contentRootElement) {
// XXX support viewconfig when needed
}
-function setupDisplayport(contentRootElement) {
+function setupDisplayport() {
let promise = content.windowGlobalChild
.getActor("ReftestFission")
.SetupDisplayportRoot();
@@ -896,7 +896,7 @@ function WaitForTestEnd(
LogInfo("MakeProgress: STATE_WAITING_FOR_APZ_FLUSH");
gFailureReason = "timed out waiting for APZ flush to complete";
- var flushWaiter = function (aSubject, aTopic, aData) {
+ var flushWaiter = function (aSubject, aTopic) {
if (aTopic) {
LogInfo("MakeProgress: apz-repaints-flushed fired");
}
@@ -1357,9 +1357,7 @@ function SynchronizeForSnapshot(flags) {
// Setup async scroll offsets now, because any scrollable layers should
// have had their AsyncPanZoomControllers created.
- return setupAsyncScrollOffsets({ allowFailure: false }).then(function (
- result
- ) {
+ return setupAsyncScrollOffsets({ allowFailure: false }).then(function () {
setupAsyncZoom({ allowFailure: false });
});
},
@@ -1370,9 +1368,7 @@ function SynchronizeForSnapshot(flags) {
// Setup async scroll offsets now, because any scrollable layers should
// have had their AsyncPanZoomControllers created.
- return setupAsyncScrollOffsets({ allowFailure: false }).then(function (
- result
- ) {
+ return setupAsyncScrollOffsets({ allowFailure: false }).then(function () {
setupAsyncZoom({ allowFailure: false });
});
}
@@ -1380,7 +1376,7 @@ function SynchronizeForSnapshot(flags) {
}
function RegisterMessageListeners() {
- addMessageListener("reftest:Clear", function (m) {
+ addMessageListener("reftest:Clear", function () {
RecvClear();
});
addMessageListener("reftest:LoadScriptTest", function (m) {
@@ -1392,7 +1388,7 @@ function RegisterMessageListeners() {
addMessageListener("reftest:LoadTest", function (m) {
RecvLoadTest(m.json.type, m.json.uri, m.json.uriTargetType, m.json.timeout);
});
- addMessageListener("reftest:ResetRenderingState", function (m) {
+ addMessageListener("reftest:ResetRenderingState", function () {
RecvResetRenderingState();
});
addMessageListener("reftest:PrintDone", function (m) {
@@ -1552,7 +1548,7 @@ function SendPrintResult(runtimeMs, status, fileName) {
});
}
-function SendExpectProcessCrash(runtimeMs) {
+function SendExpectProcessCrash() {
sendAsyncMessage("reftest:ExpectProcessCrash");
}
diff --git a/layout/tools/reftest/reftest.sys.mjs b/layout/tools/reftest/reftest.sys.mjs
index f0ed677273..1040470967 100644
--- a/layout/tools/reftest/reftest.sys.mjs
+++ b/layout/tools/reftest/reftest.sys.mjs
@@ -1770,19 +1770,19 @@ function RegisterMessageListenersAndLoadContentScript(aReload) {
);
g.browserMessageManager.addMessageListener(
"reftest:FailedNoPaint",
- function (m) {
+ function () {
RecvFailedNoPaint();
}
);
g.browserMessageManager.addMessageListener(
"reftest:FailedNoDisplayList",
- function (m) {
+ function () {
RecvFailedNoDisplayList();
}
);
g.browserMessageManager.addMessageListener(
"reftest:FailedDisplayList",
- function (m) {
+ function () {
RecvFailedDisplayList();
}
);
@@ -1800,7 +1800,7 @@ function RegisterMessageListenersAndLoadContentScript(aReload) {
);
g.browserMessageManager.addMessageListener(
"reftest:InitCanvasWithSnapshot",
- function (m) {
+ function () {
RecvInitCanvasWithSnapshot();
}
);
@@ -1836,13 +1836,13 @@ function RegisterMessageListenersAndLoadContentScript(aReload) {
);
g.browserMessageManager.addMessageListener(
"reftest:UpdateWholeCanvasForInvalidation",
- function (m) {
+ function () {
RecvUpdateWholeCanvasForInvalidation();
}
);
g.browserMessageManager.addMessageListener(
"reftest:ExpectProcessCrash",
- function (m) {
+ function () {
RecvExpectProcessCrash();
}
);
@@ -2018,7 +2018,7 @@ async function RecvUpdateWholeCanvasForInvalidation() {
SendUpdateCurrentCanvasWithSnapshotDone(true);
}
-function OnProcessCrashed(subject, topic, data) {
+function OnProcessCrashed(subject, topic) {
let id;
let additionalDumps;
let propbag = subject.QueryInterface(Ci.nsIPropertyBag2);
diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py
index b42e8e0238..cf314c99b5 100644
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -252,7 +252,7 @@ class ReftestResolver(object):
rv = [
(
os.path.join(dirname, default_manifest),
- r".*%s(?:[#?].*)?$" % pathname.replace("?", "\?"),
+ r".*%s(?:[#?].*)?$" % pathname.replace("?", r"\?"),
)
]
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp
index b41a666707..8ebb8b01d5 100644
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -220,21 +220,16 @@ widget::PopupLevel nsMenuPopupFrame::GetPopupLevel(bool aIsNoAutoHide) const {
}
// If the level attribute has been set, use that.
- static Element::AttrValuesArray strings[] = {
- nsGkAtoms::top, nsGkAtoms::parent, nsGkAtoms::floating, nullptr};
+ static Element::AttrValuesArray strings[] = {nsGkAtoms::top,
+ nsGkAtoms::parent, nullptr};
switch (mContent->AsElement()->FindAttrValueIn(
kNameSpaceID_None, nsGkAtoms::level, strings, eCaseMatters)) {
case 0:
return PopupLevel::Top;
case 1:
return PopupLevel::Parent;
- case 2:
- return PopupLevel::Floating;
- }
-
- // Panels with titlebars most likely want to be floating popups.
- if (mContent->AsElement()->HasAttr(nsGkAtoms::titlebar)) {
- return PopupLevel::Floating;
+ default:
+ break;
}
// If this panel is a noautohide panel, the default is the parent level.
@@ -281,20 +276,6 @@ nsresult nsMenuPopupFrame::CreateWidgetForView(nsView* aView) {
}
}
- nsAutoString title;
- if (widgetData.mNoAutoHide &&
- mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::titlebar,
- nsGkAtoms::normal, eCaseMatters)) {
- widgetData.mBorderStyle = widget::BorderStyle::Title;
-
- mContent->AsElement()->GetAttr(nsGkAtoms::label, title);
- if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::close,
- nsGkAtoms::_true, eCaseMatters)) {
- widgetData.mBorderStyle =
- widgetData.mBorderStyle | widget::BorderStyle::Close;
- }
- }
-
bool remote = HasRemoteContent();
const auto mode = nsLayoutUtils::GetFrameTransparency(this, this);
@@ -328,12 +309,6 @@ nsresult nsMenuPopupFrame::CreateWidgetForView(nsView* aView) {
PropagateStyleToWidget();
- // most popups don't have a title so avoid setting the title if there isn't
- // one
- if (!title.IsEmpty()) {
- widget->SetTitle(title);
- }
-
return NS_OK;
}
diff --git a/layout/xul/nsSplitterFrame.cpp b/layout/xul/nsSplitterFrame.cpp
index 89d3ac1c25..47eadf8c28 100644
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -29,7 +29,6 @@
#include "mozilla/ComputedStyle.h"
#include "mozilla/CSSOrderAwareFrameIterator.h"
#include "nsContainerFrame.h"
-#include "nsContentCID.h"
#include "nsLayoutUtils.h"
#include "nsDisplayList.h"
#include "nsContentUtils.h"
diff --git a/layout/xul/nsXULTooltipListener.cpp b/layout/xul/nsXULTooltipListener.cpp
index e8592dfc3a..77dfbb7a30 100644
--- a/layout/xul/nsXULTooltipListener.cpp
+++ b/layout/xul/nsXULTooltipListener.cpp
@@ -12,6 +12,7 @@
#include "mozilla/dom/Document.h"
#include "nsGkAtoms.h"
#include "nsMenuPopupFrame.h"
+#include "nsIContentInlines.h"
#include "nsIDragService.h"
#include "nsIDragSession.h"
#include "nsITreeView.h"
@@ -79,16 +80,9 @@ void nsXULTooltipListener::MouseOut(Event* aEvent) {
// check to see if the mouse left the targetNode, and if so,
// hide the tooltip
if (currentTooltip) {
- // which node did the mouse leave?
- EventTarget* eventTarget = aEvent->GetComposedTarget();
- nsCOMPtr<nsINode> targetNode = nsINode::FromEventTargetOrNull(eventTarget);
- if (targetNode && targetNode->IsContent() &&
- !targetNode->AsContent()->GetContainingShadow()) {
- eventTarget = aEvent->GetTarget();
- }
-
- nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
- if (pm) {
+ nsCOMPtr<nsINode> targetNode =
+ nsINode::FromEventTargetOrNull(aEvent->GetOriginalTarget());
+ if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
nsCOMPtr<nsINode> tooltipNode =
pm->GetLastTriggerTooltipNode(currentTooltip->GetComposedDoc());
@@ -98,8 +92,7 @@ void nsXULTooltipListener::MouseOut(Event* aEvent) {
// tooltip appears positioned near the mouse.
nsCOMPtr<EventTarget> relatedTarget =
aEvent->AsMouseEvent()->GetRelatedTarget();
- nsIContent* relatedContent =
- nsIContent::FromEventTargetOrNull(relatedTarget);
+ auto* relatedContent = nsIContent::FromEventTargetOrNull(relatedTarget);
if (tooltipNode == targetNode && relatedContent != currentTooltip) {
HideTooltip();
// reset special tree tracking
@@ -133,12 +126,12 @@ void nsXULTooltipListener::MouseMove(Event* aEvent) {
}
nsCOMPtr<nsIContent> currentTooltip = do_QueryReferent(mCurrentTooltip);
- nsCOMPtr<EventTarget> eventTarget = aEvent->GetComposedTarget();
- nsIContent* content = nsIContent::FromEventTargetOrNull(eventTarget);
+ auto* const mouseMoveTarget =
+ nsIContent::FromEventTargetOrNull(aEvent->GetOriginalTarget());
bool isSameTarget = true;
nsCOMPtr<nsIContent> tempContent = do_QueryReferent(mPreviousMouseMoveTarget);
- if (tempContent && tempContent != content) {
+ if (tempContent && tempContent != mouseMoveTarget) {
isSameTarget = false;
}
@@ -153,13 +146,15 @@ void nsXULTooltipListener::MouseMove(Event* aEvent) {
return;
}
mMouseScreenPoint = newMouseScreenPoint;
- mPreviousMouseMoveTarget = do_GetWeakReference(content);
+ mPreviousMouseMoveTarget = do_GetWeakReference(mouseMoveTarget);
- nsCOMPtr<nsIContent> sourceContent =
- do_QueryInterface(aEvent->GetCurrentTarget());
+ auto* const sourceContent =
+ nsIContent::FromEventTargetOrNull(aEvent->GetCurrentTarget());
mSourceNode = do_GetWeakReference(sourceContent);
mIsSourceTree = sourceContent->IsXULElement(nsGkAtoms::treechildren);
- if (mIsSourceTree) CheckTreeBodyMove(mouseEvent);
+ if (mIsSourceTree) {
+ CheckTreeBodyMove(mouseEvent);
+ }
// as the mouse moves, we want to make sure we reset the timer to show it,
// so that the delay is from when the mouse stops moving, not when it enters
@@ -184,14 +179,16 @@ void nsXULTooltipListener::MouseMove(Event* aEvent) {
// when hovering over an element inside it. The popupsinherittooltip
// attribute may be used to disable this behaviour, which is useful for
// large menu hierarchies such as bookmarks.
- if (!sourceContent->IsElement() ||
- !sourceContent->AsElement()->AttrValueIs(
- kNameSpaceID_None, nsGkAtoms::popupsinherittooltip,
- nsGkAtoms::_true, eCaseMatters)) {
- for (nsIContent* targetContent =
- nsIContent::FromEventTargetOrNull(eventTarget);
+ const bool allowTooltipCrossingPopup =
+ !sourceContent->GetParent() ||
+ (sourceContent->IsElement() &&
+ sourceContent->AsElement()->AttrValueIs(
+ kNameSpaceID_None, nsGkAtoms::popupsinherittooltip,
+ nsGkAtoms::_true, eCaseMatters));
+ if (!allowTooltipCrossingPopup) {
+ for (auto* targetContent = mouseMoveTarget;
targetContent && targetContent != sourceContent;
- targetContent = targetContent->GetParent()) {
+ targetContent = targetContent->GetFlattenedTreeParent()) {
if (targetContent->IsAnyOfXULElements(
nsGkAtoms::menupopup, nsGkAtoms::panel, nsGkAtoms::tooltip)) {
mSourceNode = nullptr;
@@ -200,13 +197,12 @@ void nsXULTooltipListener::MouseMove(Event* aEvent) {
}
}
- mTargetNode = do_GetWeakReference(eventTarget);
+ mTargetNode = do_GetWeakReference(mouseMoveTarget);
if (mTargetNode) {
nsresult rv = NS_NewTimerWithFuncCallback(
getter_AddRefs(mTooltipTimer), sTooltipCallback, this,
- LookAndFeel::GetInt(LookAndFeel::IntID::TooltipDelay, 500),
- nsITimer::TYPE_ONE_SHOT, "sTooltipCallback",
- GetMainThreadSerialEventTarget());
+ StaticPrefs::ui_tooltip_delay_ms(), nsITimer::TYPE_ONE_SHOT,
+ "sTooltipCallback", GetMainThreadSerialEventTarget());
if (NS_FAILED(rv)) {
mTargetNode = nullptr;
mSourceNode = nullptr;
@@ -215,7 +211,9 @@ void nsXULTooltipListener::MouseMove(Event* aEvent) {
return;
}
- if (mIsSourceTree) return;
+ if (mIsSourceTree) {
+ return;
+ }
// Hide the tooltip if it is currently showing.
if (currentTooltip) {
HideTooltip();
@@ -502,7 +500,9 @@ static void GetImmediateChild(nsIContent* aContent, nsAtom* aTag,
nsresult nsXULTooltipListener::FindTooltip(nsIContent* aTarget,
nsIContent** aTooltip) {
- if (!aTarget) return NS_ERROR_NULL_POINTER;
+ if (!aTarget) {
+ return NS_ERROR_NULL_POINTER;
+ }
// before we go on, make sure that target node still has a window
Document* document = aTarget->GetComposedDoc();
diff --git a/layout/xul/reftest/reftest.list b/layout/xul/reftest/reftest.list
index a2b0b6c6fe..d512addfb1 100644
--- a/layout/xul/reftest/reftest.list
+++ b/layout/xul/reftest/reftest.list
@@ -11,4 +11,4 @@ fails-if(useDrawSnapshot) != chrome://reftest/content/xul/reftest/scrollbar-mark
fails-if(useDrawSnapshot) != chrome://reftest/content/xul/reftest/scrollbar-marks2.html chrome://reftest/content/xul/reftest/scrollbar-marks-ref.html
fails-if(useDrawSnapshot) != chrome://reftest/content/xul/reftest/scrollbar-marks2.html chrome://reftest/content/xul/reftest/scrollbar-marks.html
# This test is fuzzy as the marks cannot be positioned exactly as the real ones are measured in dev pixels.
-fuzzy(0-10,0-170) fuzzy-if(winWidget&&isDebugBuild&&layersGPUAccelerated&&!is64Bit,1-1,74-170) == chrome://reftest/content/xul/reftest/scrollbar-marks-overlay.html chrome://reftest/content/xul/reftest/scrollbar-marks-overlay-ref.html
+fuzzy(0-10,0-170) fuzzy-if(winWidget&&isDebugBuild&&!is64Bit,1-1,74-170) == chrome://reftest/content/xul/reftest/scrollbar-marks-overlay.html chrome://reftest/content/xul/reftest/scrollbar-marks-overlay-ref.html
diff --git a/layout/xul/test/browser_bug685470.js b/layout/xul/test/browser_bug685470.js
index 46997b2e3b..faf013743c 100644
--- a/layout/xul/test/browser_bug685470.js
+++ b/layout/xul/test/browser_bug685470.js
@@ -6,9 +6,7 @@ add_task(async function () {
"data:text/html," + html
);
- await new Promise(resolve => {
- SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve);
- });
+ await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] });
await BrowserTestUtils.synthesizeMouseAtCenter(
"#p1",
diff --git a/layout/xul/test/browser_bug703210.js b/layout/xul/test/browser_bug703210.js
index 5026875310..cf5a0850a3 100644
--- a/layout/xul/test/browser_bug703210.js
+++ b/layout/xul/test/browser_bug703210.js
@@ -10,9 +10,7 @@ add_task(async function () {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
- await new Promise(resolve => {
- SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve);
- });
+ await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] });
let popupShownPromise = BrowserTestUtils.waitForEvent(
document,
diff --git a/layout/xul/test/browser_bug706743.js b/layout/xul/test/browser_bug706743.js
index c28721e831..af872644b9 100644
--- a/layout/xul/test/browser_bug706743.js
+++ b/layout/xul/test/browser_bug706743.js
@@ -8,9 +8,7 @@ add_task(async function () {
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
let browser = gBrowser.selectedBrowser;
- await new Promise(resolve => {
- SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve);
- });
+ await SpecialPowers.pushPrefEnv({ set: [["ui.tooltip.delay_ms", 0]] });
// Send a mousemove at a known position to start the test.
await BrowserTestUtils.synthesizeMouse(
diff --git a/layout/xul/test/chrome.toml b/layout/xul/test/chrome.toml
index 6588db2ea4..f2262b3086 100644
--- a/layout/xul/test/chrome.toml
+++ b/layout/xul/test/chrome.toml
@@ -11,7 +11,6 @@ support-files = [
"windowminmaxsize8.xhtml",
"windowminmaxsize9.xhtml",
"windowminmaxsize10.xhtml",
- "titledpanelwindow.xhtml",
]
["test_bug159346.xhtml"]
diff --git a/layout/xul/test/test_windowminmaxsize.xhtml b/layout/xul/test/test_windowminmaxsize.xhtml
index 187732dd3d..20f2109c80 100644
--- a/layout/xul/test/test_windowminmaxsize.xhtml
+++ b/layout/xul/test/test_windowminmaxsize.xhtml
@@ -125,59 +125,29 @@ function doPanelTest(panel)
function nextPopupTest(panel)
{
if (++gTestId >= popupTests.length) {
- // Next, check a panel that has a titlebar to ensure that it is accounted for
- // properly in the size.
- var titledPanelWindow = window.browsingContext.topChromeWindow.open("titledpanelwindow.xhtml", "_blank", "chrome,resizable=yes");
- SimpleTest.waitForFocus(titledPanelWindowOpened, titledPanelWindow);
+ SimpleTest.finish();
+ return;
}
- else {
- function setStyle(attr) {
- if (attr in popupTests[gTestId])
- panel.style[attr] = popupTests[gTestId][attr] + "px";
- else
- panel.style[attr] = "";
- }
- setStyle("minWidth");
- setStyle("minHeight");
- setStyle("maxWidth");
- setStyle("maxHeight");
-
- // Prevent event loop starvation as a result of popup events being
- // synchronous. See bug 1131576.
- SimpleTest.executeSoon(() => {
- // Non-chrome shells require focus to open a popup.
- SimpleTest.waitForFocus(() => { panel.openPopup() });
- });
+
+ function setStyle(attr) {
+ if (attr in popupTests[gTestId])
+ panel.style[attr] = popupTests[gTestId][attr] + "px";
+ else
+ panel.style[attr] = "";
}
-}
+ setStyle("minWidth");
+ setStyle("minHeight");
+ setStyle("maxWidth");
+ setStyle("maxHeight");
-function titledPanelWindowOpened(panelwindow)
-{
- info("titledPanelWindowOpened");
- var panel = panelwindow.document.documentElement.firstChild;
- panel.addEventListener("popupshown", () => doTitledPanelTest(panel));
- panel.addEventListener("popuphidden", () => done(panelwindow));
- // See above as for why.
+ // Prevent event loop starvation as a result of popup events being
+ // synchronous. See bug 1131576.
SimpleTest.executeSoon(() => {
- SimpleTest.waitForFocus(() => { panel.openPopup() }, panelwindow);
+ // Non-chrome shells require focus to open a popup.
+ SimpleTest.waitForFocus(() => { panel.openPopup() });
});
}
-function doTitledPanelTest(panel)
-{
- info("doTitledPanelTest");
- var rect = panel.getBoundingClientRect();
- is(rect.width, 120, "panel with titlebar width");
- is(rect.height, 140, "panel with titlebar height");
- panel.hidePopup();
-}
-
-function done(panelwindow)
-{
- panelwindow.close();
- SimpleTest.finish();
-}
-
]]>
</script>
diff --git a/layout/xul/test/titledpanelwindow.xhtml b/layout/xul/test/titledpanelwindow.xhtml
deleted file mode 100644
index 4289f8deab..0000000000
--- a/layout/xul/test/titledpanelwindow.xhtml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml-stylesheet href='chrome://global/skin' type='text/css'?>
-<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' align='start' pack='start' style='-moz-appearance: none; margin: 0; padding: 0; border: 0;'>
- <panel noautohide='true' titlebar='normal' style="background: white; min-width: 120px; min-height: 140px"/>
- <label value='Test'/>
-</window>