mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #11639 - awestroke:anchor-element-base-url, r=nox
Use base_url instead of url in HTMLAnchorElement::set_url <!-- Please describe your changes on the following line: --> `script::dom::HTMLAnchorElement::set_url` now uses `document::base_url` instead of `document::url`, allowing correct parsing of relative urls on about:blank and pages with a `<base href="some_url"/>` set. spec: https://html.spec.whatwg.org/multipage/infrastructure.html#resolving-urls --- <!-- 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 - [X] These changes fix #11628 <!-- Either: --> - [x] There are tests for these changes: Some expected test failures have been removed. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/11639) <!-- Reviewable:end -->
This commit is contained in:
commit
9fae4b18d1
3 changed files with 1 additions and 169 deletions
|
@ -64,7 +64,7 @@ impl HTMLAnchorElement {
|
|||
let attribute = self.upcast::<Element>().get_attribute(&ns!(), &atom!("href"));
|
||||
*self.url.borrow_mut() = attribute.and_then(|attribute| {
|
||||
let document = document_from_node(self);
|
||||
document.url().join(&attribute.value()).ok()
|
||||
document.base_url().join(&attribute.value()).ok()
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -246,39 +246,6 @@
|
|||
[Parsing: <data:text/html,test#test> against <http://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <C|/foo/bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </C|\\foo\\bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//C|/foo/bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//server/file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <\\\\server\\file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </\\server/file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <///> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <///test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://example.com/././foo> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -762,60 +729,9 @@
|
|||
[Parsing: <sc::a@example.net> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/:@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:a:b@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/a:b@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http::@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:@:www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/@:www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <../i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <../i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <?i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <?i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:> against <http://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:> against <https://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc:> against <https://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -246,39 +246,6 @@
|
|||
[Parsing: <data:text/html,test#test> against <http://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <C|/foo/bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </C|\\foo\\bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//C|/foo/bar> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//server/file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <\\\\server\\file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </\\server/file> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <//> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <///> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <///test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <file:test> against <file:///tmp/mock/path>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http://example.com/././foo> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -762,60 +729,9 @@
|
|||
[Parsing: <sc::a@example.net> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/:@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:a:b@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/a:b@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http::@/www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:@:www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:/@:www.example.com> against <about:blank>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <../i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <../i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: </i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <?i> against <sc:sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <?i> against <sc:sd/sd>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:> against <http://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <http:> against <https://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
[Parsing: <sc:> against <https://example.org/foo/bar>]
|
||||
expected: FAIL
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue