aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-08-10 16:41:59 -0400
committerGitHub <noreply@github.com>2020-08-10 16:41:59 -0400
commitd028d71fe950ee48d0f7d1276537cf4985ad374a (patch)
treee86979fba8228c966832ec242b023a2faa570ff0
parent3c426d707859091cae24a32db6575609c42fa646 (diff)
parentc74ff42a8ff49738865686fbff9fcb9f18408b7b (diff)
downloadservo-d028d71fe950ee48d0f7d1276537cf4985ad374a.tar.gz
servo-d028d71fe950ee48d0f7d1276537cf4985ad374a.zip
Auto merge of #27505 - utsavoza:ugo/issue-24718/05-08-2020, r=jdm
Do not load srcdoc iframes synchronously - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #24718 - [x] There are tests for these changes
-rw-r--r--components/constellation/constellation.rs9
-rw-r--r--components/script/dom/htmliframeelement.rs2
-rw-r--r--components/script/script_thread.rs11
-rw-r--r--tests/wpt/metadata/cookies/cookie-enabled-noncookie-frame.html.ini5
-rw-r--r--tests/wpt/metadata/custom-elements/perform-microtask-checkpoint-before-construction.html.ini7
-rw-r--r--tests/wpt/metadata/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html.ini3
-rw-r--r--tests/wpt/metadata/html/interaction/focus/the-autofocus-attribute/skip-not-fully-active.html.ini3
-rw-r--r--tests/wpt/metadata/referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html.ini6
8 files changed, 26 insertions, 20 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs
index 5dbacfb939f..f6e8d5c7469 100644
--- a/components/constellation/constellation.rs
+++ b/components/constellation/constellation.rs
@@ -1082,9 +1082,12 @@ where
let (event_loop, host) = match sandbox {
IFrameSandboxState::IFrameSandboxed => (None, None),
IFrameSandboxState::IFrameUnsandboxed => {
- // If this is an about:blank load, it must share the creator's event loop.
- // This must match the logic in the script thread when determining the proper origin.
- if load_data.url.as_str() != "about:blank" {
+ // If this is an about:blank or about:srcdoc load, it must share the creator's
+ // event loop. This must match the logic in the script thread when determining
+ // the proper origin.
+ if load_data.url.as_str() != "about:blank" &&
+ load_data.url.as_str() != "about:srcdoc"
+ {
match reg_host(&load_data.url) {
None => (None, None),
Some(host) => {
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 2e8a37a88d8..60c3e93ece8 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -248,7 +248,7 @@ impl HTMLIFrameElement {
load_data.srcdoc = String::from(element.get_string_attribute(&local_name!("srcdoc")));
self.navigate_or_reload_child_browsing_context(
load_data,
- NavigationType::InitialAboutBlank,
+ NavigationType::Regular,
HistoryEntryReplacement::Disabled,
);
return;
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 1b7c137e9a2..16de38f0265 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1503,10 +1503,13 @@ impl ScriptThread {
ScriptThreadEventCategory::AttachLayout,
Some(pipeline_id),
|| {
- // If this is an about:blank load, it must share the creator's origin.
- // This must match the logic in the constellation when creating a new pipeline
- let origin = if new_layout_info.load_data.url.as_str() != "about:blank"
- {
+ // If this is an about:blank or about:srcdoc load, it must share the
+ // creator's origin. This must match the logic in the constellation
+ // when creating a new pipeline
+ let not_an_about_blank_and_about_srcdoc_load =
+ new_layout_info.load_data.url.as_str() != "about:blank" &&
+ new_layout_info.load_data.url.as_str() != "about:srcdoc";
+ let origin = if not_an_about_blank_and_about_srcdoc_load {
MutableOrigin::new(new_layout_info.load_data.url.origin())
} else if let Some(parent) =
new_layout_info.parent_info.and_then(|pipeline_id| {
diff --git a/tests/wpt/metadata/cookies/cookie-enabled-noncookie-frame.html.ini b/tests/wpt/metadata/cookies/cookie-enabled-noncookie-frame.html.ini
new file mode 100644
index 00000000000..672c4f54767
--- /dev/null
+++ b/tests/wpt/metadata/cookies/cookie-enabled-noncookie-frame.html.ini
@@ -0,0 +1,5 @@
+[cookie-enabled-noncookie-frame.html]
+ expected: TIMEOUT
+ [navigator.cookieEnabled behavior on frames without cookie access]
+ expected: TIMEOUT
+
diff --git a/tests/wpt/metadata/custom-elements/perform-microtask-checkpoint-before-construction.html.ini b/tests/wpt/metadata/custom-elements/perform-microtask-checkpoint-before-construction.html.ini
deleted file mode 100644
index 001942e8a22..00000000000
--- a/tests/wpt/metadata/custom-elements/perform-microtask-checkpoint-before-construction.html.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[perform-microtask-checkpoint-before-construction.html]
- [HTML parser must perform a microtask checkpoint before constructing a custom element]
- expected: FAIL
-
- [HTML parser must perform a microtask checkpoint before constructing a custom element during the adoption agency algorithm]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html.ini b/tests/wpt/metadata/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html.ini
index d3171da1938..5f700a5fef0 100644
--- a/tests/wpt/metadata/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html.ini
+++ b/tests/wpt/metadata/html/browsers/sandboxing/sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html.ini
@@ -1,4 +1,5 @@
[sandbox-disallow-scripts-via-unsandboxed-popup.tentative.html]
+ expected: ERROR
[Sandboxed => unsandboxed popup]
- expected: FAIL
+ expected: TIMEOUT
diff --git a/tests/wpt/metadata/html/interaction/focus/the-autofocus-attribute/skip-not-fully-active.html.ini b/tests/wpt/metadata/html/interaction/focus/the-autofocus-attribute/skip-not-fully-active.html.ini
deleted file mode 100644
index 5b0f5a5de3f..00000000000
--- a/tests/wpt/metadata/html/interaction/focus/the-autofocus-attribute/skip-not-fully-active.html.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[skip-not-fully-active.html]
- [Autofocus element in not-fully-active document should be skipped while flusing.]
- expected: FAIL
diff --git a/tests/wpt/metadata/referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html.ini b/tests/wpt/metadata/referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html.ini
index e2718b7ac89..d76c9d0e9b4 100644
--- a/tests/wpt/metadata/referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html.ini
+++ b/tests/wpt/metadata/referrer-policy/generic/sandboxed-iframe-with-opaque-origin.html.ini
@@ -1,5 +1,9 @@
[sandboxed-iframe-with-opaque-origin.html]
type: testharness
+ expected: TIMEOUT
[Sandboxed iframe with opaque origin doesn't send referrers.]
- expected: FAIL
+ expected: TIMEOUT
+
+ [Sandboxed iframe with tuple origin sends referrers.]
+ expected: TIMEOUT