Update wpt-tests metadata

This commit is contained in:
Utsav Oza 2020-05-14 19:55:37 +05:30
parent 55a3eb6bf4
commit 4c637e0601
7 changed files with 20 additions and 27 deletions

View file

@ -579,6 +579,13 @@ impl Document {
if let Some(browsing_context) = self.browsing_context() {
// Step 1: If document is an iframe srcdoc document, then return the
// document base URL of document's browsing context's container document.
let container_base_url = browsing_context
.parent()
.and_then(|parent| parent.document())
.map(|document| document.base_url());
if document_url.as_str() == "about:srcdoc" && container_base_url.is_some() {
return container_base_url.unwrap();
}
// Step 2: If document's URL is about:blank, and document's browsing
// context's creator base URL is non-null, then return that creator base URL.

View file

@ -637,7 +637,7 @@ pub fn follow_hyperlink(subject: &Element, hyperlink_suffix: Option<String>) {
if let Some(suffix) = hyperlink_suffix {
href.push_str(&suffix);
}
let url = match document.url().join(&href) {
let url = match document.base_url().join(&href) {
Ok(url) => url,
Err(_) => return,
};

View file

@ -731,12 +731,10 @@ impl CreatorBrowsingContextInfo {
parent: Option<&WindowProxy>,
opener: Option<&WindowProxy>,
) -> CreatorBrowsingContextInfo {
let creator = if parent.is_some() {
parent.unwrap().document()
} else if opener.is_some() {
opener.unwrap().document()
} else {
None
let creator = match (parent, opener) {
(Some(parent), _) => parent.document(),
(None, Some(opener)) => opener.document(),
(None, None) => None,
};
let base_url = creator.as_deref().map(|document| document.base_url());