mirror of
https://github.com/servo/servo.git
synced 2025-06-10 09:33:13 +00:00
Auto merge of #18933 - mrobinson:wr-text-index, r=jdm
Use WebRender to compute text index on click events This is the second half of switching over to WebRender for hit testing. Now that WebRender gives us the location of the hit tested point in the display item, we can use that to calculate text index. <!-- Please describe your changes on the following line: --> --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [x] These changes do not require tests because they shouldn't change behavior. <!-- 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/18933) <!-- Reviewable:end -->
This commit is contained in:
commit
4cf2ce66fc
12 changed files with 194 additions and 370 deletions
|
@ -2191,8 +2191,15 @@ impl ScriptThread {
|
|||
self.handle_resize_event(pipeline_id, new_size, size_type);
|
||||
}
|
||||
|
||||
MouseButtonEvent(event_type, button, point, node_address) => {
|
||||
self.handle_mouse_event(pipeline_id, event_type, button, point, node_address);
|
||||
MouseButtonEvent(event_type, button, point, node_address, point_in_node) => {
|
||||
self.handle_mouse_event(
|
||||
pipeline_id,
|
||||
event_type,
|
||||
button,
|
||||
point,
|
||||
node_address,
|
||||
point_in_node
|
||||
);
|
||||
}
|
||||
|
||||
MouseMoveEvent(point, node_address) => {
|
||||
|
@ -2303,7 +2310,8 @@ impl ScriptThread {
|
|||
mouse_event_type: MouseEventType,
|
||||
button: MouseButton,
|
||||
point: Point2D<f32>,
|
||||
node_address: Option<UntrustedNodeAddress>
|
||||
node_address: Option<UntrustedNodeAddress>,
|
||||
point_in_node: Option<Point2D<f32>>
|
||||
) {
|
||||
let document = match { self.documents.borrow().find_document(pipeline_id) } {
|
||||
Some(document) => document,
|
||||
|
@ -2314,7 +2322,8 @@ impl ScriptThread {
|
|||
button,
|
||||
point,
|
||||
mouse_event_type,
|
||||
node_address
|
||||
node_address,
|
||||
point_in_node
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue