aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-01-28 04:55:04 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-01-28 04:55:04 +0530
commit0fa9d32c6915c9cad18e5430c10973399599458a (patch)
treec33de53472f45d72e31f35d1fbdb82c384d13b65 /components/script/dom
parent34954a98702a03ffb79344b53f85e1dfcd584257 (diff)
parentc79231f9c619f33f7fea66c08bec7a7c0695dc21 (diff)
downloadservo-0fa9d32c6915c9cad18e5430c10973399599458a.tar.gz
servo-0fa9d32c6915c9cad18e5430c10973399599458a.zip
Auto merge of #9421 - jdm:iframe-painting-after-navigation-redux, r=jdm
compositing: Fix a couple of bugs that prevented iframes from painting after navigation. The first bug was that iframes were not reflowed in their parent DOM when the child page navigated. This is fixed by simply having the constellation notify the appropriate script thread when navigation occurs. The second bug was that the compositor was unable to adjust the pipeline for existing iframe layers, only new ones. This patch adds logic to do that. The third bug was that we have ad-hoc reflow calls throughout script/, and we didn't trigger any reflow from the code that dispatches the `load` event for the iframe so the test for the first two issues would always time out. The second commit adds another reflow call to do that, and also bites the bullet and adds a catch-all reflow (which does nothing if there's no dirty nodes in the document) at the return to the event loop. Closes #8081. Extension of #9285. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9421) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r--components/script/dom/htmliframeelement.rs8
-rw-r--r--components/script/dom/window.rs6
2 files changed, 13 insertions, 1 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 65cfd32fa17..fd8788480a6 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -23,9 +23,10 @@ use dom::htmlelement::HTMLElement;
use dom::node::{Node, UnbindContext, window_from_node};
use dom::urlhelper::UrlHelper;
use dom::virtualmethods::VirtualMethods;
-use dom::window::Window;
+use dom::window::{ReflowReason, Window};
use js::jsapi::{JSAutoCompartment, JSAutoRequest, RootedValue, JSContext, MutableHandleValue};
use js::jsval::{UndefinedValue, NullValue};
+use layout_interface::ReflowQueryType;
use msg::constellation_msg::{ConstellationChan};
use msg::constellation_msg::{NavigationDirection, PipelineId, SubpageId};
use page::IterablePage;
@@ -34,6 +35,7 @@ use script_traits::{IFrameLoadInfo, MozBrowserEvent, ScriptMsg as ConstellationM
use std::ascii::AsciiExt;
use std::cell::Cell;
use string_cache::Atom;
+use style::context::ReflowGoal;
use url::Url;
use util::prefs;
use util::str::{DOMString, LengthOrPercentageOrAuto};
@@ -211,6 +213,10 @@ impl HTMLIFrameElement {
let window = window_from_node(self);
self.upcast::<EventTarget>().fire_simple_event("load", GlobalRef::Window(window.r()));
// TODO Step 5 - unset child document `mut iframe load` flag
+
+ window.reflow(ReflowGoal::ForDisplay,
+ ReflowQueryType::NoQuery,
+ ReflowReason::IFrameLoadEvent);
}
}
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 46cda6c4aa4..2ca2090e547 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -107,6 +107,9 @@ pub enum ReflowReason {
ImageLoaded,
RequestAnimationFrame,
WebFontLoaded,
+ FramedContentChanged,
+ IFrameLoadEvent,
+ MissingExplicitReflow,
}
pub type ScrollPoint = Point2D<Au>;
@@ -1425,6 +1428,9 @@ fn debug_reflow_events(goal: &ReflowGoal, query_type: &ReflowQueryType, reason:
ReflowReason::ImageLoaded => "\tImageLoaded",
ReflowReason::RequestAnimationFrame => "\tRequestAnimationFrame",
ReflowReason::WebFontLoaded => "\tWebFontLoaded",
+ ReflowReason::FramedContentChanged => "\tFramedContentChanged",
+ ReflowReason::IFrameLoadEvent => "\tIFrameLoadEvent",
+ ReflowReason::MissingExplicitReflow => "\tMissingExplicitReflow",
});
println!("{}", debug_msg);