mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Don't re-parse dummy base URL every time in GeckoElement::style_attribute.
This commit is contained in:
parent
92ae502765
commit
94ce09763e
1 changed files with 7 additions and 1 deletions
|
@ -314,6 +314,12 @@ impl<'le> GeckoElement<'le> {
|
|||
}
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
pub static ref DUMMY_BASE_URL: Url = {
|
||||
Url::parse("http://www.example.org").unwrap()
|
||||
};
|
||||
}
|
||||
|
||||
impl<'le> TElement for GeckoElement<'le> {
|
||||
type ConcreteNode = GeckoNode<'le>;
|
||||
type ConcreteDocument = GeckoDocument<'le>;
|
||||
|
@ -330,7 +336,7 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
// in the nsAttrValue. That will allow us to borrow it from here.
|
||||
let attr = self.get_attr(&ns!(), &atom!("style"));
|
||||
// FIXME(bholley): Real base URL and error reporter.
|
||||
let base_url = Url::parse("http://www.example.org").unwrap();
|
||||
let base_url = &*DUMMY_BASE_URL;
|
||||
// FIXME(heycam): Needs real ParserContextExtraData so that URLs parse
|
||||
// properly.
|
||||
let extra_data = ParserContextExtraData::default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue