mirror of
https://github.com/servo/servo.git
synced 2025-06-23 08:34:42 +01:00
Remove the 'border-width: 0' hack.
This was to work-around a netsurfcss quirk.
This commit is contained in:
parent
2045f6a068
commit
ab0d620025
1 changed files with 2 additions and 30 deletions
|
@ -2,41 +2,13 @@
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use extra::url::Url;
|
|
||||||
use style::Stylesheet;
|
use style::Stylesheet;
|
||||||
use style::Stylist;
|
use style::Stylist;
|
||||||
use style::selector_matching::UserAgentOrigin;
|
use style::selector_matching::UserAgentOrigin;
|
||||||
|
|
||||||
pub fn new_stylist() -> Stylist {
|
pub fn new_stylist() -> Stylist {
|
||||||
let mut stylist = Stylist::new();
|
let mut stylist = Stylist::new();
|
||||||
stylist.add_stylesheet(html4_default_style(), UserAgentOrigin);
|
let ua_stylesheet = Stylesheet::from_str(include_str!("user-agent.css"));
|
||||||
stylist.add_stylesheet(servo_default_style(), UserAgentOrigin);
|
stylist.add_stylesheet(ua_stylesheet, UserAgentOrigin);
|
||||||
stylist
|
stylist
|
||||||
}
|
}
|
||||||
|
|
||||||
fn html4_default_style() -> Stylesheet {
|
|
||||||
Stylesheet::from_str(html4_default_style_str())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn servo_default_style() -> Stylesheet {
|
|
||||||
Stylesheet::from_str(servo_default_style_str())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn default_url(name: &str) -> Url {
|
|
||||||
FromStr::from_str(fmt!("http://%s", name)).unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn html4_default_style_str() -> &'static str {
|
|
||||||
include_str!("user-agent.css")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FIXME: this shouldn’t be needed.
|
|
||||||
// The initial value of border-*-width is 'medium' (for which 2px is ok.)
|
|
||||||
// It’s the *computed values* that is set to 0 when the corresponding
|
|
||||||
// border-*-style is 'none' (the initial value) or 'hidden'.
|
|
||||||
// This should be taken care of when removing libcss.
|
|
||||||
fn servo_default_style_str() -> &'static str {
|
|
||||||
// libcss want's this to default to 2px..
|
|
||||||
"* { border-width: 0px; }"
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue