mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Auto merge of #15768 - ferjm:issue-15592-document-elementsFromPoint, r=emilio
Trigger reflow on document.elementsFromPoint As [suggested](https://github.com/servo/servo/issues/15592#issuecomment-280379805) by @jdm `Document::nodes_from_point` now triggers a reflow. I added a new reftest that panics with `ERROR:servo: Tried to hit test without a DisplayList` if this patch is not applied. - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #15592. - [X] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15768) <!-- Reviewable:end -->
This commit is contained in:
commit
fa32d50c7a
9 changed files with 71 additions and 33 deletions
|
@ -1877,7 +1877,13 @@ impl Document {
|
|||
Point2D::new(client_point.x + self.window.PageXOffset() as f32,
|
||||
client_point.y + self.window.PageYOffset() as f32);
|
||||
|
||||
self.window.layout().nodes_from_point(page_point, *client_point)
|
||||
if !self.window.reflow(ReflowGoal::ForScriptQuery,
|
||||
ReflowQueryType::NodesFromPoint(page_point, *client_point),
|
||||
ReflowReason::Query) {
|
||||
return vec!();
|
||||
};
|
||||
|
||||
self.window.layout().nodes_from_point_response()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1811,6 +1811,7 @@ fn debug_reflow_events(id: PipelineId, goal: &ReflowGoal, query_type: &ReflowQue
|
|||
ReflowQueryType::ContentBoxQuery(_n) => "\tContentBoxQuery",
|
||||
ReflowQueryType::ContentBoxesQuery(_n) => "\tContentBoxesQuery",
|
||||
ReflowQueryType::HitTestQuery(..) => "\tHitTestQuery",
|
||||
ReflowQueryType::NodesFromPoint(..) => "\tNodesFromPoint",
|
||||
ReflowQueryType::NodeGeometryQuery(_n) => "\tNodeGeometryQuery",
|
||||
ReflowQueryType::NodeOverflowQuery(_n) => "\tNodeOverFlowQuery",
|
||||
ReflowQueryType::NodeScrollGeometryQuery(_n) => "\tNodeScrollGeometryQuery",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue