mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
style: Add some more tests for disallowed rootMargin values.
This commit is contained in:
parent
ac74cd57a2
commit
893415c85a
3 changed files with 19 additions and 2 deletions
|
@ -81,6 +81,11 @@ impl ToNsCssValue for PixelOrPercentage {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The value of an IntersectionObserver's rootMargin property.
|
/// 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>);
|
pub struct IntersectionObserverRootMargin(pub Rect<PixelOrPercentage>);
|
||||||
|
|
||||||
impl Parse for IntersectionObserverRootMargin {
|
impl Parse for IntersectionObserverRootMargin {
|
||||||
|
|
|
@ -557079,7 +557079,7 @@
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"intersection-observer/observer-exceptions.html": [
|
"intersection-observer/observer-exceptions.html": [
|
||||||
"28ccc6905713894b43033e30949170439215bf2e",
|
"85d5416475091c1020e0ff92b15f841bf58c606e",
|
||||||
"testharness"
|
"testharness"
|
||||||
],
|
],
|
||||||
"intersection-observer/observer-in-iframe.html": [
|
"intersection-observer/observer-in-iframe.html": [
|
||||||
|
|
|
@ -31,7 +31,19 @@ test(function () {
|
||||||
assert_throws("SYNTAX_ERR", function() {
|
assert_throws("SYNTAX_ERR", function() {
|
||||||
new IntersectionObserver(e => {}, {rootMargin: "auto"})
|
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 () {
|
test(function () {
|
||||||
assert_throws("SYNTAX_ERR", function() {
|
assert_throws("SYNTAX_ERR", function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue