mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Introduce a node_text_content method.
This commit is contained in:
parent
16d6555f4d
commit
1039de8e7d
1 changed files with 7 additions and 1 deletions
|
@ -949,6 +949,8 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Sized + PartialEq {
|
|||
/// FIXME(pcwalton): This might have too much copying and/or allocation. Profile this.
|
||||
fn text_content(&self) -> TextContent;
|
||||
|
||||
fn node_text_content(&self) -> String;
|
||||
|
||||
/// If the insertion point is within this node, returns it. Otherwise, returns `None`.
|
||||
fn selection(&self) -> Option<Range<ByteIndex>>;
|
||||
|
||||
|
@ -1189,8 +1191,12 @@ impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
|||
};
|
||||
}
|
||||
|
||||
return TextContent::Text(self.node_text_content());
|
||||
}
|
||||
|
||||
fn node_text_content(&self) -> String {
|
||||
let this = unsafe { self.get_jsmanaged() };
|
||||
return TextContent::Text(this.text_content());
|
||||
return this.text_content();
|
||||
}
|
||||
|
||||
fn selection(&self) -> Option<Range<ByteIndex>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue