mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make a bunch of layout queries morally safer
This commit is contained in:
parent
ddef6211b3
commit
3ccda7f90c
7 changed files with 60 additions and 68 deletions
|
@ -1467,10 +1467,8 @@ impl VirtualMethods for HTMLInputElement {
|
|||
// now.
|
||||
if let Some(point_in_target) = mouse_event.point_in_target() {
|
||||
let window = window_from_node(self);
|
||||
let TextIndexResponse(index) = window.text_index_query(
|
||||
self.upcast::<Node>().to_trusted_node_address(),
|
||||
point_in_target,
|
||||
);
|
||||
let TextIndexResponse(index) =
|
||||
window.text_index_query(self.upcast::<Node>(), point_in_target);
|
||||
if let Some(i) = index {
|
||||
self.textinput.borrow_mut().set_edit_point_index(i as usize);
|
||||
// trigger redraw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue