diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2016-01-12 20:57:23 -0800 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-01-26 16:37:23 -0500 |
commit | e5a1af5b7ae276a3a47c4b6c5a85b210ab7753a1 (patch) | |
tree | c270e1ca529f138f0114935a0b945fa1a237c6d5 /components/script/script_thread.rs | |
parent | 80c29113485c0b7d7da6be9c4f64a2b8f1cde826 (diff) | |
download | servo-e5a1af5b7ae276a3a47c4b6c5a85b210ab7753a1.tar.gz servo-e5a1af5b7ae276a3a47c4b6c5a85b210ab7753a1.zip |
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.
Closes #8081.
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r-- | components/script/script_thread.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 663d87f46ee..ef55e608be8 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1131,6 +1131,8 @@ impl ScriptThread { ConstellationControlMsg::DispatchFrameLoadEvent { target: pipeline_id, parent: containing_id } => self.handle_frame_load_event(containing_id, pipeline_id), + ConstellationControlMsg::FramedContentChanged(containing_pipeline_id, subpage_id) => + self.handle_framed_content_changed(containing_pipeline_id, subpage_id), ConstellationControlMsg::ReportCSSError(pipeline_id, filename, line, column, msg) => self.handle_css_error_reporting(pipeline_id, filename, line, column, msg), } @@ -1487,6 +1489,22 @@ impl ScriptThread { } } + fn handle_framed_content_changed(&self, + parent_pipeline_id: PipelineId, + subpage_id: SubpageId) { + let borrowed_page = self.root_page(); + let page = borrowed_page.find(parent_pipeline_id).unwrap(); + let doc = page.document(); + let frame_element = doc.find_iframe(subpage_id); + if let Some(ref frame_element) = frame_element { + frame_element.upcast::<Node>().dirty(NodeDamage::OtherNodeDamage); + let window = page.window(); + window.reflow(ReflowGoal::ForDisplay, + ReflowQueryType::NoQuery, + ReflowReason::FramedContentChanged); + } + } + /// Handles a mozbrowser event, for example see: /// https://developer.mozilla.org/en-US/docs/Web/Events/mozbrowserloadstart fn handle_mozbrowser_event_msg(&self, |