Auto merge of #20307 - csmoe:measure_query_time, r=jdm

Measure time required before a layout query is serviced by the layout thread

<!-- Please describe your changes on the following line: -->

- [X] extract QueryMsg from ReflowGoal
- [X] introduce QueryMsg timestamp

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [x] These changes fix #19795 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20307)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-03-26 15:42:03 -04:00 committed by GitHub
commit 4b8416fafb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 218 additions and 156 deletions

View file

@ -109,7 +109,7 @@ use num_traits::ToPrimitive;
use profile_traits::ipc;
use profile_traits::time::{TimerMetadata, TimerMetadataFrameType, TimerMetadataReflowType};
use ref_slice::ref_slice;
use script_layout_interface::message::{Msg, NodesFromPointQueryType, ReflowGoal};
use script_layout_interface::message::{Msg, NodesFromPointQueryType, QueryMsg, ReflowGoal};
use script_runtime::{CommonScriptMsg, ScriptThreadEventCategory};
use script_thread::{MainThreadScriptMsg, ScriptThread};
use script_traits::{AnimationState, DocumentActivity, MouseButton, MouseEventType};
@ -1969,8 +1969,7 @@ impl Document {
client_point: &Point2D<f32>,
reflow_goal: NodesFromPointQueryType)
-> Vec<UntrustedNodeAddress> {
if !self.window.reflow(ReflowGoal::NodesFromPointQuery(*client_point, reflow_goal),
ReflowReason::Query) {
if !self.window.layout_reflow(QueryMsg::NodesFromPointQuery(*client_point, reflow_goal)) {
return vec!();
};