mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
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.
This commit is contained in:
parent
80c2911348
commit
e5a1af5b7a
9 changed files with 153 additions and 26 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue