Due to changes on Page/Window interfaces, we no longer have use

for flush_layout().
This commit is contained in:
Adenilson Cavalcanti 2015-03-04 11:39:29 -08:00
parent 761f7f056c
commit a31d3d7f70
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); el.authentic_click_activation(event);
self.commit_focus_transaction(); 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 /// 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>>) { 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 { pub trait WindowHelpers {
fn clear_js_context(self); fn clear_js_context(self);
fn clear_js_context_for_script_deallocation(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 init_browser_context(self, doc: JSRef<Document>, frame_element: Option<JSRef<Element>>);
fn load_url(self, href: DOMString); fn load_url(self, href: DOMString);
fn handle_fire_timer(self, timer_id: TimerId); 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 /// 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 /// 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. /// 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> { 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? self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxResponse(rect) = self.layout_rpc.content_box(); let ContentBoxResponse(rect) = self.layout_rpc.content_box();
rect rect
} }
fn content_boxes_query(self, content_boxes_request: TrustedNodeAddress) -> Vec<Rect<Au>> { 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? self.join_layout(); //FIXME: is this necessary, or is layout_rpc's mutex good enough?
let ContentBoxesResponse(rects) = self.layout_rpc.content_boxes(); let ContentBoxesResponse(rects) = self.layout_rpc.content_boxes();
rects rects
@ -614,7 +609,7 @@ impl<'a> WindowHelpers for JSRef<'a, Window> {
fn handle_fire_timer(self, timer_id: TimerId) { fn handle_fire_timer(self, timer_id: TimerId) {
self.timers.fire_timer(timer_id, self); 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>) { fn set_fragment_name(self, fragment: Option<String>) {

View file

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