mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: Don't paint layouts induced by hit test queries.
Reduces CPU usage when mousing over simple pages. Part of #9999.
This commit is contained in:
parent
7cb9429a0f
commit
ed6ee29951
1 changed files with 6 additions and 2 deletions
|
@ -1021,7 +1021,11 @@ impl Window {
|
|||
|
||||
debug!("script: layout joined");
|
||||
|
||||
self.pending_reflow_count.set(0);
|
||||
// Pending reflows require display, so only reset the pending reflow count if this reflow
|
||||
// was to be displayed.
|
||||
if goal == ReflowGoal::ForDisplay {
|
||||
self.pending_reflow_count.set(0);
|
||||
}
|
||||
|
||||
if let Some(marker) = marker {
|
||||
self.emit_timeline_marker(marker.end());
|
||||
|
@ -1104,7 +1108,7 @@ impl Window {
|
|||
|
||||
pub fn hit_test_query(&self, hit_test_request: Point2D<f32>, update_cursor: bool)
|
||||
-> Option<UntrustedNodeAddress> {
|
||||
self.reflow(ReflowGoal::ForDisplay,
|
||||
self.reflow(ReflowGoal::ForScriptQuery,
|
||||
ReflowQueryType::HitTestQuery(hit_test_request, update_cursor),
|
||||
ReflowReason::Query);
|
||||
self.layout_rpc.hit_test().node_address
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue