Skip to content

Commit

Permalink
Move parsing of @Viewport rules in a stylesheet behind --experimental.
Browse files Browse the repository at this point in the history
This is for parsing of the rule within a stylesheet only. <meta name=viewport> could create a viewport rule and add it to the list of stylesheets for the page (like quirks mode).
  • Loading branch information
luniv committed May 6, 2015
1 parent 226b757 commit 3f006f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/style/stylesheets.rs
Expand Up @@ -429,7 +429,11 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
},
"viewport" => {
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
if ::util::opts::experimental_enabled() {
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
} else {
Err(())
}
}
_ => Err(())
}
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/style/viewport.rs
Expand Up @@ -25,6 +25,8 @@ fn test_viewport_rule<F>(css: &str,
callback: F)
where F: Fn(&Vec<ViewportDescriptorDeclaration>, &str)
{
::util::opts::set_experimental_enabled(true);

let stylesheet = stylesheet!(css, Author);
let mut rule_count = 0;
for rule in stylesheet.effective_rules(&device).viewport() {
Expand Down

0 comments on commit 3f006f9

Please sign in to comment.