servo: Merge #9840 - Update to rust-url 1.0 (from servo:url-1.0); r=asajeffrey
**Do not merge yet:** rust-url 1.0 is not published yet and may still get breaking changes. The goal of this PR for now is to demonstrate API usage. Depends on: * <s>https://github.com/servo/rust-url/pull/176</s> * <s>https://github.com/alexcrichton/cookie-rs/pull/42</s> * <s>https://github.com/hyperium/hyper/pull/740</s> * https://github.com/cyderize/rust-websocket/pull/70 * https://github.com/jgraham/webdriver-rust/pull/28 Source-Repo: https://github.com/servo/servo Source-Revision: 84ab7e9fe8f4a6528995eff3eb6e814cb724c364
This commit is contained in:
@@ -68,7 +68,7 @@ impl HTMLBaseElementMethods for HTMLBaseElement {
|
||||
|
||||
// Step 1.
|
||||
if !self.upcast::<Element>().has_attribute(&atom!("href")) {
|
||||
return DOMString::from(document.base_url().serialize());
|
||||
return DOMString::from(document.base_url().as_str());
|
||||
}
|
||||
|
||||
// Step 2.
|
||||
@@ -81,7 +81,7 @@ impl HTMLBaseElementMethods for HTMLBaseElement {
|
||||
let url_record = fallback_base_url.join(&*url);
|
||||
|
||||
// Step 5, 6.
|
||||
DOMString::from(url_record.ok().map_or("".to_owned(), |record| record.serialize()))
|
||||
DOMString::from(url_record.as_ref().map(|url| url.as_str()).unwrap_or(""))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-base-href
|
||||
|
||||
Reference in New Issue
Block a user