mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Do not load srcdoc iframes synchronously
This commit is contained in:
parent
6e28d7b3ec
commit
acbfd7b9ab
3 changed files with 14 additions and 8 deletions
|
@ -1090,9 +1090,12 @@ where
|
||||||
let (event_loop, host) = match sandbox {
|
let (event_loop, host) = match sandbox {
|
||||||
IFrameSandboxState::IFrameSandboxed => (None, None),
|
IFrameSandboxState::IFrameSandboxed => (None, None),
|
||||||
IFrameSandboxState::IFrameUnsandboxed => {
|
IFrameSandboxState::IFrameUnsandboxed => {
|
||||||
// If this is an about:blank load, it must share the creator's event loop.
|
// If this is an about:blank or about:srcdoc load, it must share the creator's
|
||||||
// This must match the logic in the script thread when determining the proper origin.
|
// event loop. This must match the logic in the script thread when determining
|
||||||
if load_data.url.as_str() != "about:blank" {
|
// the proper origin.
|
||||||
|
if load_data.url.as_str() != "about:blank" &&
|
||||||
|
load_data.url.as_str() != "about:srcdoc"
|
||||||
|
{
|
||||||
match reg_host(&load_data.url) {
|
match reg_host(&load_data.url) {
|
||||||
None => (None, None),
|
None => (None, None),
|
||||||
Some(host) => {
|
Some(host) => {
|
||||||
|
|
|
@ -248,7 +248,7 @@ impl HTMLIFrameElement {
|
||||||
load_data.srcdoc = String::from(element.get_string_attribute(&local_name!("srcdoc")));
|
load_data.srcdoc = String::from(element.get_string_attribute(&local_name!("srcdoc")));
|
||||||
self.navigate_or_reload_child_browsing_context(
|
self.navigate_or_reload_child_browsing_context(
|
||||||
load_data,
|
load_data,
|
||||||
NavigationType::InitialAboutBlank,
|
NavigationType::Regular,
|
||||||
HistoryEntryReplacement::Disabled,
|
HistoryEntryReplacement::Disabled,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1503,10 +1503,13 @@ impl ScriptThread {
|
||||||
ScriptThreadEventCategory::AttachLayout,
|
ScriptThreadEventCategory::AttachLayout,
|
||||||
Some(pipeline_id),
|
Some(pipeline_id),
|
||||||
|| {
|
|| {
|
||||||
// If this is an about:blank load, it must share the creator's origin.
|
// If this is an about:blank or about:srcdoc load, it must share the
|
||||||
// This must match the logic in the constellation when creating a new pipeline
|
// creator's origin. This must match the logic in the constellation
|
||||||
let origin = if new_layout_info.load_data.url.as_str() != "about:blank"
|
// 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())
|
MutableOrigin::new(new_layout_info.load_data.url.origin())
|
||||||
} else if let Some(parent) =
|
} else if let Some(parent) =
|
||||||
new_layout_info.parent_info.and_then(|pipeline_id| {
|
new_layout_info.parent_info.and_then(|pipeline_id| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue