servo: Merge #18917 - style: Add some more tests for disallowed rootMargin values (from heycam:observer-test); r=emilio
authorCameron McCormack <cam@mcc.id.au>
Tue, 17 Oct 2017 08:11:16 -0500
changeset 386784 64cc43d070afbea3fe40e66810440c0f8e2f14eb
parent 386783 da7f10ba43442e258c8ffafbd3b20ae5b2e1f805
child 386785 c94d9d435a0de59b65e89aee2a9ff8d06698dec2
push id96311
push userarchaeopteryx@coole-files.de
push dateWed, 18 Oct 2017 09:52:02 +0000
treeherdermozilla-inbound@a8a1e8cc1980 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #18917 - style: Add some more tests for disallowed rootMargin values (from heycam:observer-test); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: aa3122e7d1beb6c72868baf80d565b0760641b1d
servo/components/style/values/specified/gecko.rs
--- a/servo/components/style/values/specified/gecko.rs
+++ b/servo/components/style/values/specified/gecko.rs
@@ -76,16 +76,21 @@ impl ToNsCssValue for PixelOrPercentage 
             PixelOrPercentage::Percentage(pc) => {
                 unsafe { nscssvalue.set_percentage(pc.0); }
             }
         }
     }
 }
 
 /// 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 {
     fn parse<'i, 't>(
         context: &ParserContext,
         input: &mut Parser<'i, 't>,
     ) -> Result<Self, ParseError<'i>> {
         let rect = Rect::parse_with(context, input, PixelOrPercentage::parse)?;