servo: Merge #5144 - Remove flush_layout() (from Adenilson:removeFlushLayout01); r=Manishearth

Due to changes on Page/Window interfaces, we no longer have use for flush_layout().

Source-Repo: https://github.com/servo/servo
Source-Revision: 34289943e354b2ac0e54fd1fe2d65c944f6c8e9d
This commit is contained in:
Adenilson Cavalcanti 2015-03-04 16:54:44 -07:00
parent 449cb2dc15
commit 500496a046
3 changed files with 6 additions and 11 deletions

View File

@ -523,7 +523,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
el.authentic_click_activation(event);
self.commit_focus_transaction();
window.r().flush_layout(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
}
/// Return need force reflow or not
@ -664,7 +664,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
_ => ()
}
window.r().flush_layout(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
}
fn set_current_script(self, script: Option<JSRef<HTMLScriptElement>>) {

View File

@ -394,7 +394,6 @@ impl<'a> WindowMethods for JSRef<'a, Window> {
pub trait WindowHelpers {
fn clear_js_context(self);
fn clear_js_context_for_script_deallocation(self);
fn flush_layout(self, goal: ReflowGoal, query: ReflowQueryType);
fn init_browser_context(self, doc: JSRef<Document>, frame_element: Option<JSRef<Element>>);
fn load_url(self, href: DOMString);
fn handle_fire_timer(self, timer_id: TimerId);
@ -476,10 +475,6 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
}
}
fn flush_layout(self, goal: ReflowGoal, query: ReflowQueryType) {
self.reflow(goal, query);
}
/// Reflows the page if it's possible to do so and the page is dirty. This method will wait
/// for the layout thread to complete (but see the `TODO` below). If there is no window size
/// yet, the page is presumed invisible and no reflow is performed.
@ -567,14 +562,14 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
}
fn content_box_query(self, content_box_request: TrustedNodeAddress) -> Rect<Au> {
self.flush_layout(ReflowGoal::ForScriptQuery, ReflowQueryType::ContentBoxQuery(content_box_request));
self.reflow(ReflowGoal::ForScriptQuery, ReflowQueryType::ContentBoxQuery(content_box_request));
self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxResponse(rect) = self.layout_rpc.content_box();
rect
}
fn content_boxes_query(self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>> {
self.flush_layout(ReflowGoal::ForScriptQuery, ReflowQueryType::ContentBoxesQuery(content_boxes_request));
self.reflow(ReflowGoal::ForScriptQuery, ReflowQueryType::ContentBoxesQuery(content_boxes_request));
self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxesResponse(rects) = self.layout_rpc.content_boxes();
rects
@ -614,7 +609,7 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
fn handle_fire_timer(self, timer_id: TimerId) {
self.timers.fire_timer(timer_id, self);
self.flush_layout(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
self.reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
}
fn set_fragment_name(self, fragment: Option<String>) {

View File

@ -1007,7 +1007,7 @@ impl ScriptTask {
debug!("kicking off initial reflow of {:?}", final_url);
document.r().content_changed(NodeCast::from_ref(document.r()),
NodeDamage::OtherNodeDamage);
window.r().flush_layout(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
window.r().reflow(ReflowGoal::ForDisplay, ReflowQueryType::NoQuery);
// No more reflow required
page.set_reflow_status(false);