mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Move parsing of @viewport rules in a stylesheet behind --experimental.
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).
This commit is contained in:
parent
226b757789
commit
3f006f96b2
2 changed files with 7 additions and 1 deletions
|
@ -429,7 +429,11 @@ impl<'a, 'b> AtRuleParser for NestedRuleParser<'a, 'b> {
|
||||||
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
|
Ok(AtRuleType::WithBlock(AtRulePrelude::FontFace))
|
||||||
},
|
},
|
||||||
"viewport" => {
|
"viewport" => {
|
||||||
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
|
if ::util::opts::experimental_enabled() {
|
||||||
|
Ok(AtRuleType::WithBlock(AtRulePrelude::Viewport))
|
||||||
|
} else {
|
||||||
|
Err(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => Err(())
|
_ => Err(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ fn test_viewport_rule<F>(css: &str,
|
||||||
callback: F)
|
callback: F)
|
||||||
where F: Fn(&Vec<ViewportDescriptorDeclaration>, &str)
|
where F: Fn(&Vec<ViewportDescriptorDeclaration>, &str)
|
||||||
{
|
{
|
||||||
|
::util::opts::set_experimental_enabled(true);
|
||||||
|
|
||||||
let stylesheet = stylesheet!(css, Author);
|
let stylesheet = stylesheet!(css, Author);
|
||||||
let mut rule_count = 0;
|
let mut rule_count = 0;
|
||||||
for rule in stylesheet.effective_rules(&device).viewport() {
|
for rule in stylesheet.effective_rules(&device).viewport() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue