Make a bunch of layout queries morally safer

This commit is contained in:
Anthony Ramine 2019-01-09 14:11:13 +01:00
parent ddef6211b3
commit 3ccda7f90c
7 changed files with 60 additions and 68 deletions

View file

@ -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