mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make LayoutNodeHelpers::text_content return a cow
This commit is contained in:
parent
409bd3d989
commit
6fe294fa5b
7 changed files with 32 additions and 19 deletions
|
@ -67,6 +67,7 @@ use selectors::sink::Push;
|
|||
use servo_arc::{Arc, ArcBorrow};
|
||||
use servo_atoms::Atom;
|
||||
use servo_url::ServoUrl;
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
use std::fmt::Debug;
|
||||
use std::hash::{Hash, Hasher};
|
||||
|
@ -1117,9 +1118,8 @@ impl<'ln> ThreadSafeLayoutNode<'ln> for ServoThreadSafeLayoutNode<'ln> {
|
|||
self.node
|
||||
}
|
||||
|
||||
fn node_text_content(&self) -> String {
|
||||
let this = unsafe { self.get_jsmanaged() };
|
||||
return this.text_content();
|
||||
fn node_text_content(self) -> Cow<'ln, str> {
|
||||
unsafe { self.get_jsmanaged().text_content() }
|
||||
}
|
||||
|
||||
fn selection(&self) -> Option<Range<ByteIndex>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue