mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
layout: Query and maintain the position of the insertion point
throughout layout for input elements.
This commit is contained in:
parent
34d9a6091b
commit
357419dc8d
6 changed files with 152 additions and 41 deletions
|
@ -144,6 +144,8 @@ pub trait LayoutHTMLInputElementHelpers {
|
|||
unsafe fn get_value_for_layout(self) -> String;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_size_for_layout(self) -> u32;
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_insertion_point_for_layout(self) -> TextPoint;
|
||||
}
|
||||
|
||||
pub trait RawLayoutHTMLInputElementHelpers {
|
||||
|
@ -194,6 +196,12 @@ impl LayoutHTMLInputElementHelpers for LayoutJS<HTMLInputElement> {
|
|||
unsafe fn get_size_for_layout(self) -> u32 {
|
||||
(*self.unsafe_get()).get_size_for_layout()
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
#[allow(unsafe_code)]
|
||||
unsafe fn get_insertion_point_for_layout(self) -> TextPoint {
|
||||
(*self.unsafe_get()).textinput.borrow_for_layout().edit_point
|
||||
}
|
||||
}
|
||||
|
||||
impl RawLayoutHTMLInputElementHelpers for HTMLInputElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue