aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/values/specified/gecko.rs5
-rw-r--r--tests/wpt/metadata/MANIFEST.json2
-rw-r--r--tests/wpt/web-platform-tests/intersection-observer/observer-exceptions.html14
3 files changed, 19 insertions, 2 deletions
diff --git a/components/style/values/specified/gecko.rs b/components/style/values/specified/gecko.rs
index b36cd582aed..486a33eaf1e 100644
--- a/components/style/values/specified/gecko.rs
+++ b/components/style/values/specified/gecko.rs
@@ -81,6 +81,11 @@ impl ToNsCssValue for PixelOrPercentage {
}
/// The value of an IntersectionObserver's rootMargin property.
+///
+/// Only bare px or percentage values are allowed. Other length units and
+/// calc() values are not allowed.
+///
+/// https://w3c.github.io/IntersectionObserver/#parse-a-root-margin
pub struct IntersectionObserverRootMargin(pub Rect<PixelOrPercentage>);
impl Parse for IntersectionObserverRootMargin {
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index b06f515f028..7d35c458490 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -557079,7 +557079,7 @@
"testharness"
],
"intersection-observer/observer-exceptions.html": [
- "28ccc6905713894b43033e30949170439215bf2e",
+ "85d5416475091c1020e0ff92b15f841bf58c606e",
"testharness"
],
"intersection-observer/observer-in-iframe.html": [
diff --git a/tests/wpt/web-platform-tests/intersection-observer/observer-exceptions.html b/tests/wpt/web-platform-tests/intersection-observer/observer-exceptions.html
index b44b7bd0cc1..d4f178be51c 100644
--- a/tests/wpt/web-platform-tests/intersection-observer/observer-exceptions.html
+++ b/tests/wpt/web-platform-tests/intersection-observer/observer-exceptions.html
@@ -31,7 +31,19 @@ test(function () {
assert_throws("SYNTAX_ERR", function() {
new IntersectionObserver(e => {}, {rootMargin: "auto"})
})
-}, 'IntersectionObserver constructor width { rootMargin: "auto" }');
+}, 'IntersectionObserver constructor with { rootMargin: "auto" }');
+
+test(function () {
+ assert_throws("SYNTAX_ERR", function() {
+ new IntersectionObserver(e => {}, {rootMargin: "calc(1px + 2px)"})
+ })
+}, 'IntersectionObserver constructor with { rootMargin: "calc(1px + 2px)" }');
+
+test(function () {
+ assert_throws("SYNTAX_ERR", function() {
+ new IntersectionObserver(e => {}, {rootMargin: "1px !important"})
+ })
+}, 'IntersectionObserver constructor with { rootMargin: "1px !important" }');
test(function () {
assert_throws("SYNTAX_ERR", function() {