diff options
Diffstat (limited to 'layout/style/test')
-rw-r--r-- | layout/style/test/chrome/chrome-only-media-queries.js | 1 | ||||
-rw-r--r-- | layout/style/test/mochitest.toml | 5 | ||||
-rw-r--r-- | layout/style/test/property_database.js | 306 | ||||
-rw-r--r-- | layout/style/test/test_hover_quirk.html | 32 | ||||
-rw-r--r-- | layout/style/test/test_non_content_accessible_pseudos.html | 1 | ||||
-rw-r--r-- | layout/style/test/test_selectors.html | 1 | ||||
-rw-r--r-- | layout/style/test/test_style_struct_copy_constructors.html | 14 |
7 files changed, 197 insertions, 163 deletions
diff --git a/layout/style/test/chrome/chrome-only-media-queries.js b/layout/style/test/chrome/chrome-only-media-queries.js index aaf313a526..d17976149b 100644 --- a/layout/style/test/chrome/chrome-only-media-queries.js +++ b/layout/style/test/chrome/chrome-only-media-queries.js @@ -31,4 +31,5 @@ const CHROME_ONLY_QUERIES = [ "(-moz-gtk-theme-family: adwaita)", "(-moz-gtk-theme-family: breeze)", "(-moz-gtk-theme-family: yaru)", + "(forced-colors: requested)", ]; diff --git a/layout/style/test/mochitest.toml b/layout/style/test/mochitest.toml index 54ad9736f2..cc5f26708f 100644 --- a/layout/style/test/mochitest.toml +++ b/layout/style/test/mochitest.toml @@ -6,16 +6,13 @@ prefs = [ "gfx.font_loader.delay=0", "layout.css.container-queries.enabled=true", "layout.css.individual-transform.enabled=true", - "layout.css.motion-path-ray.enabled=true", - "layout.css.motion-path-basic-shapes.enabled=true", - "layout.css.motion-path-coord-box.enabled=true", - "layout.css.motion-path-offset-position.enabled=true", "layout.css.motion-path-url.enabled=true", "layout.css.backdrop-filter.enabled=true", "layout.css.fit-content-function.enabled=true", "layout.css.scroll-driven-animations.enabled=true", "layout.css.animation-composition.enabled=true", "layout.css.basic-shape-rect.enabled=true", + "layout.css.basic-shape-shape.enabled=true", "layout.css.basic-shape-xywh.enabled=true", "layout.css.transform-box-content-stroke.enabled=true", "layout.css.transition-behavior.enabled=true", diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 2e8b4c71a3..c63d65926e 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -1035,6 +1035,36 @@ if (IsCSSPropertyPrefEnabled("layout.css.basic-shape-rect.enabled")) { ); } +var basicShapeShapeValues = []; +var basicShapeShapeValuesWithFillRule = []; +if (IsCSSPropertyPrefEnabled("layout.css.basic-shape-shape.enabled")) { + basicShapeShapeValuesWithFillRule.push( + "shape(evenodd from 0px 0px, line to 10px 10px)", + "shape(nonzero from 0px 0px, line to 10px 10px)" + ); + + basicShapeShapeValues.push( + "shape(from 0px 0%, line to 10px 10%)", + "shape(from 10px 10px, move by 10px 5px, line by 20px 40%, close)", + "shape(from 10px 10px, hline by 10px, vline to 5rem)", + "shape(from 10px 10px, vline by 5%, hline to 1vw)", + "shape(from 10px 10px, curve to 50px 20px via 10rem 1%)", + "shape(from 10px 10px, smooth to 50px 20px via 10rem 1%)", + "shape(from 10% 1rem, arc to 50px 1pt of 20% cw large rotate 25deg)" + ); + + // It's fine to include this for properties which don't support shape(), + // e.g. shape-outside, because they must reject these values. + basicShapeInvalidValues.push( + "shape()", + "shape(evenodd, from 0px 0px)", + "shape(from 0px 0px line to 10px 10px)", + "shape(from 0px 0px)", + "shape(close)", + "shape(nonzero, close)" + ); +} + if (/* mozGradientsEnabled */ true) { // Maybe one day :( // Extend gradient lists with valid/invalid moz-prefixed expressions: @@ -6841,6 +6871,130 @@ var gCSSProperties = { "left 10px top", ], }, + offset: { + domProp: "offset", + inherited: false, + type: CSS_TYPE_TRUE_SHORTHAND, + subproperties: [ + "offset-path", + "offset-distance", + "offset-rotate", + "offset-anchor", + "offset-position", + ], + initial_values: ["none"], + other_values: [ + "none 30deg reverse", + "none 50px reverse 30deg", + "none calc(10px + 20%) auto", + "none reverse", + "none / left center", + "path('M 0 0 H 1') -200% auto", + "path('M 0 0 H 1') -200%", + "path('M 0 0 H 1') 50px", + "path('M 0 0 H 1') auto", + "path('M 0 0 H 1') reverse 30deg 50px", + "path('M 0 0 H 1')", + "path('m 20 0 h 100') -7rad 8px / auto", + "path('m 0 30 v 100') -7rad 8px / left top", + "path('m 0 0 h 100') -7rad 8px", + "path('M 0 0 H 100') 100px 0deg", + "top right / top left", + "top right ray(45deg closest-side)", + "50% 50% ray(0rad farthest-side)", + ], + invalid_values: [ + "100px 0deg path('m 0 0 h 100')", + "30deg", + "auto 30deg 100px", + "auto / none", + "none /", + "none / 100px 20px 30deg", + "path('M 20 30 A 60 70 80') bottom", + "path('M 20 30 A 60 70 80') bottom top", + "path('M 20 30 A 60 70 80') 100px 200px", + "path('M 20 30 A 60 70 80') reverse auto", + "path('M 20 30 A 60 70 80') reverse 10px 30deg", + "path('M 20 30 A 60 70 80') /", + ], + }, + "offset-anchor": { + domProp: "offsetAnchor", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: [ + "left bottom", + "center center", + "calc(20% + 10px) center", + "right 30em", + "10px 20%", + "left -10px top -20%", + "right 10% bottom 20em", + ], + invalid_values: ["none", "10deg", "left 10% top"], + }, + "offset-distance": { + domProp: "offsetDistance", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["0"], + other_values: ["10px", "10%", "190%", "-280%", "calc(30px + 40%)"], + invalid_values: ["none", "45deg"], + }, + "offset-path": { + domProp: "offsetPath", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["none"], + other_values: [ + "ray(0deg)", + "ray(45deg closest-side)", + "ray(0rad farthest-side)", + "ray(0.5turn closest-corner contain)", + "ray(200grad farthest-corner)", + "ray(sides 180deg)", + "ray(contain farthest-side 180deg)", + "ray(calc(180deg - 45deg) farthest-side)", + "ray(0deg at center center)", + "ray(at 10% 10% 1rad)", + ] + .concat(pathValues.other_values) + .concat(basicShapeOtherValues) + .concat(basicShapeXywhRectValues) + .concat(basicShapeShapeValues), + invalid_values: [ + "path('')", + "ray(closest-side)", + "ray(0deg, closest-side)", + "ray(contain 0deg closest-side contain)", + ].concat(pathValues.invalid_values), + }, + "offset-position": { + domProp: "offsetPosition", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["normal"], + other_values: [ + "auto", + "left bottom", + "center center", + "calc(20% + 10px) center", + "right 30em", + "10px 20%", + "left -10px top -20%", + "right 10% bottom 20em", + ], + invalid_values: ["none", "10deg", "left 10% top"], + }, + "offset-rotate": { + domProp: "offsetRotate", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: ["auto"], + other_values: ["reverse", "0deg", "0rad reverse", "-45deg", "5turn auto"], + invalid_values: ["none", "10px", "reverse 0deg reverse", "reverse auto"], + }, opacity: { domProp: "opacity", inherited: false, @@ -8827,7 +8981,9 @@ var gCSSProperties = { .concat(basicShapeSVGBoxValues) .concat(basicShapeOtherValues) .concat(basicShapeOtherValuesWithFillRule) - .concat(basicShapeXywhRectValues), + .concat(basicShapeXywhRectValues) + .concat(basicShapeShapeValues) + .concat(basicShapeShapeValuesWithFillRule), invalid_values: [ "path(nonzero)", "path(abs, 'M 10 10 L 10 10 z')", @@ -13409,158 +13565,10 @@ gCSSProperties["scrollbar-width"] = { invalid_values: ["1px"], }; -gCSSProperties["offset"] = { - domProp: "offset", - inherited: false, - type: CSS_TYPE_TRUE_SHORTHAND, - subproperties: [ - "offset-path", - "offset-distance", - "offset-rotate", - "offset-anchor", - ], - initial_values: ["none"], - other_values: [ - "none 30deg reverse", - "none 50px reverse 30deg", - "none calc(10px + 20%) auto", - "none reverse", - "none / left center", - "path('M 0 0 H 1') -200% auto", - "path('M 0 0 H 1') -200%", - "path('M 0 0 H 1') 50px", - "path('M 0 0 H 1') auto", - "path('M 0 0 H 1') reverse 30deg 50px", - "path('M 0 0 H 1')", - "path('m 20 0 h 100') -7rad 8px / auto", - "path('m 0 30 v 100') -7rad 8px / left top", - "path('m 0 0 h 100') -7rad 8px", - "path('M 0 0 H 100') 100px 0deg", - ], - invalid_values: [ - "100px 0deg path('m 0 0 h 100')", - "30deg", - "auto 30deg 100px", - "auto / none", - "none /", - "none / 100px 20px 30deg", - "path('M 20 30 A 60 70 80') bottom", - "path('M 20 30 A 60 70 80') bottom top", - "path('M 20 30 A 60 70 80') 100px 200px", - "path('M 20 30 A 60 70 80') reverse auto", - "path('M 20 30 A 60 70 80') reverse 10px 30deg", - "path('M 20 30 A 60 70 80') /", - ], -}; - -gCSSProperties["offset-path"] = { - domProp: "offsetPath", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: ["none"], - other_values: [...pathValues.other_values], - invalid_values: ["path('')"].concat(pathValues.invalid_values), -}; - -if (IsCSSPropertyPrefEnabled("layout.css.motion-path-ray.enabled")) { - gCSSProperties["offset-path"]["other_values"].push( - "ray(0deg)", - "ray(45deg closest-side)", - "ray(0rad farthest-side)", - "ray(0.5turn closest-corner contain)", - "ray(200grad farthest-corner)", - "ray(sides 180deg)", - "ray(contain farthest-side 180deg)", - "ray(calc(180deg - 45deg) farthest-side)", - "ray(0deg at center center)", - "ray(at 10% 10% 1rad)" - ); - - gCSSProperties["offset-path"]["invalid_values"].push( - "ray(closest-side)", - "ray(0deg, closest-side)", - "ray(contain 0deg closest-side contain)" - ); -} - -if (IsCSSPropertyPrefEnabled("layout.css.motion-path-basic-shapes.enabled")) { - gCSSProperties["offset-path"]["other_values"].push( - ...basicShapeOtherValues, - ...basicShapeXywhRectValues - ); -} - if (IsCSSPropertyPrefEnabled("layout.css.motion-path-url.enabled")) { gCSSProperties["offset-path"]["other_values"].push("url(#svgPath)"); } -gCSSProperties["offset-distance"] = { - domProp: "offsetDistance", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: ["0"], - other_values: ["10px", "10%", "190%", "-280%", "calc(30px + 40%)"], - invalid_values: ["none", "45deg"], -}; - -gCSSProperties["offset-rotate"] = { - domProp: "offsetRotate", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: ["auto"], - other_values: ["reverse", "0deg", "0rad reverse", "-45deg", "5turn auto"], - invalid_values: ["none", "10px", "reverse 0deg reverse", "reverse auto"], -}; - -gCSSProperties["offset-anchor"] = { - domProp: "offsetAnchor", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: ["auto"], - other_values: [ - "left bottom", - "center center", - "calc(20% + 10px) center", - "right 30em", - "10px 20%", - "left -10px top -20%", - "right 10% bottom 20em", - ], - invalid_values: ["none", "10deg", "left 10% top"], -}; - -if ( - IsCSSPropertyPrefEnabled("layout.css.motion-path-offset-position.enabled") -) { - gCSSProperties["offset"]["subproperties"].push("offset-position"); - gCSSProperties["offset"]["other_values"].push("top right / top left"); - - if (IsCSSPropertyPrefEnabled("layout.css.motion-path-ray.enabled")) { - gCSSProperties["offset"]["other_values"].push( - "top right ray(45deg closest-side)", - "50% 50% ray(0rad farthest-side)" - ); - } - - gCSSProperties["offset-position"] = { - domProp: "offsetPosition", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: ["normal"], - other_values: [ - "auto", - "left bottom", - "center center", - "calc(20% + 10px) center", - "right 30em", - "10px 20%", - "left -10px top -20%", - "right 10% bottom 20em", - ], - invalid_values: ["none", "10deg", "left 10% top"], - }; -} - { let linear_function_other_values = [ "linear(0, 1)", diff --git a/layout/style/test/test_hover_quirk.html b/layout/style/test/test_hover_quirk.html index 61e19f2a60..7a78185178 100644 --- a/layout/style/test/test_hover_quirk.html +++ b/layout/style/test/test_hover_quirk.html @@ -54,6 +54,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 #dynamic-test:hover > * { background: rgb(0, 255, 0); } + + #dynamic-test-2 :is(button,input,a){ + background-color:yellow !important; + } + + #dynamic-test-2 :is(button,input,a):hover{ + background-color:lime !important; + } + + #dynamic-test-2 :is(button,input):focus{ + background-color:skyblue !important; + } </style> <script src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/tests/SimpleTest/EventUtils.js"></script> @@ -97,6 +109,21 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 is(getComputedStyle(document.getElementById('should-be-green-on-hover')).backgroundColor, "rgb(0, 255, 0)", "Dynamic change should invalidate properly"); + + synthesizeMouseAtCenter(document.getElementById('button'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('button')).backgroundColor, + "rgb(0, 255, 0)", + "Button hover should be green"); + + synthesizeMouseAtCenter(document.getElementById('input'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('input')).backgroundColor, + "rgb(0, 255, 0)", + "Input hover should be green"); + + synthesizeMouseAtCenter(document.getElementById('link-2'), {type: "mousemove"}); + is(getComputedStyle(document.getElementById('link-2')).backgroundColor, + "rgb(0, 255, 0)", + "Link hover should be green"); SimpleTest.finish(); }); </script> @@ -113,6 +140,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=783213 <a id="link" href="#">Link<span class="child"></span></a><br> <div id="div" class="parent">Div <span><span class="child"></span></span></div><br> </div> + <div id="dynamic-test-2"> + <button id="button">Button</button> + <input id="input" value="Input"> + <a id="link-2"href="">Link</a> + </div> <pre id="test"></pre> </body> </html> diff --git a/layout/style/test/test_non_content_accessible_pseudos.html b/layout/style/test/test_non_content_accessible_pseudos.html index 81493b1a4a..5f2d15d6a2 100644 --- a/layout/style/test/test_non_content_accessible_pseudos.html +++ b/layout/style/test/test_non_content_accessible_pseudos.html @@ -30,7 +30,6 @@ const NON_CONTENT_ACCESIBLE_PSEUDOS = [ ":-moz-dir-attr-rtl", ":-moz-dir-attr-like-auto", ":-moz-autofill-preview", - ":-moz-lwtheme", ":-moz-is-html", ":-moz-locale-dir(rtl)", ":-moz-locale-dir(ltr)", diff --git a/layout/style/test/test_selectors.html b/layout/style/test/test_selectors.html index d688139d3c..684e9d6524 100644 --- a/layout/style/test/test_selectors.html +++ b/layout/style/test/test_selectors.html @@ -1077,7 +1077,6 @@ function runTests() { test_balanced_unparseable(":dir"); // Test chrome-only -moz-lwtheme - test_balanced_unparseable(":-moz-lwtheme"); test_balanced_unparseable(":-moz-broken"); test_balanced_unparseable(":-moz-tree-row(selected)"); diff --git a/layout/style/test/test_style_struct_copy_constructors.html b/layout/style/test/test_style_struct_copy_constructors.html index 95f727a58d..bce5a4e32c 100644 --- a/layout/style/test/test_style_struct_copy_constructors.html +++ b/layout/style/test/test_style_struct_copy_constructors.html @@ -64,6 +64,12 @@ for (var prop in gCSSProperties) { } /** Test using inheritance **/ + +// TODO(bug 1887221): Zoom right now doesn't apply to explicitly inherited +// values, so remove it to get consistent results. +gRule1.style.removeProperty("zoom"); +gRule2.style.removeProperty("zoom"); + for (var prop in gCSSProperties) { var info = gCSSProperties[prop]; if (info.inherited && !("subproperties" in info)) { @@ -79,14 +85,6 @@ for (var prop in gCSSProperties) { } } -for (var prop in gCSSProperties) { - var info = gCSSProperties[prop]; - if (!("subproperties" in info)) { - gRule1.style.removeProperty(prop); - gRule2.style.removeProperty(prop); - } -} - </script> </pre> </body> |