mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +01:00
Rewrite the user-agent stysheet(s)
Based on https://html.spec.whatwg.org/multipage/rendering.html rather than http://dev.w3.org/csswg/css2/grammar.html
This commit is contained in:
parent
1117d86b63
commit
e9ebfb74fc
7 changed files with 801 additions and 130 deletions
|
@ -280,12 +280,18 @@ impl Stylist {
|
|||
after_map: PerPseudoElementSelectorMap::new(),
|
||||
rules_source_order: 0u,
|
||||
};
|
||||
let ua_stylesheet = Stylesheet::from_bytes(
|
||||
read_resource_file(["user-agent.css"]).unwrap().as_slice(),
|
||||
Url::parse("chrome:///user-agent.css").unwrap(),
|
||||
None,
|
||||
None);
|
||||
stylist.add_stylesheet(ua_stylesheet, UserAgentOrigin);
|
||||
// FIXME: Add quirks-mode.css in quirks mode.
|
||||
// FIXME: Add iso-8859-9.css when the document’s encoding is ISO-8859-8.
|
||||
// FIXME: presentational-hints.css should be at author origin with zero specificity.
|
||||
// (Does it make a difference?)
|
||||
for &filename in ["user-agent.css", "servo.css", "presentational-hints.css"].iter() {
|
||||
let ua_stylesheet = Stylesheet::from_bytes(
|
||||
read_resource_file([filename]).unwrap().as_slice(),
|
||||
Url::parse(format!("chrome:///{}", filename).as_slice()).unwrap(),
|
||||
None,
|
||||
None);
|
||||
stylist.add_stylesheet(ua_stylesheet, UserAgentOrigin);
|
||||
}
|
||||
stylist
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue