aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 17:18:26 -0500
committerbors-servo <lbergstrom+bors@mozilla.com>2016-05-26 17:18:26 -0500
commit25c2d20f56509e86c5b3ce563cdea7ea611cfff7 (patch)
treec9517fab616983429bd372321a034c3a9e669965
parentdb7f8b38fc4e7f0c1b197d95b70b6bd05bea3a1f (diff)
parent94ce09763e5100b89169998f89e57895ef994537 (diff)
downloadservo-25c2d20f56509e86c5b3ce563cdea7ea611cfff7.tar.gz
servo-25c2d20f56509e86c5b3ce563cdea7ea611cfff7.zip
Auto merge of #11433 - heycam:dummy-base-url, r=bholley
Don't re-parse dummy base URL every time in GeckoElement::style_attribute Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [X] These changes do not require tests because geckolib-only Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. ---- r? @bholley <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11433) <!-- Reviewable:end -->
-rw-r--r--ports/geckolib/wrapper.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/ports/geckolib/wrapper.rs b/ports/geckolib/wrapper.rs
index ec913823caf..de1130639f7 100644
--- a/ports/geckolib/wrapper.rs
+++ b/ports/geckolib/wrapper.rs
@@ -318,6 +318,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>;
@@ -334,7 +340,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();