aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/wrapper_traits.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-03-31 14:58:56 +0200
committerAnthony Ramine <nox@nox.paris>2020-03-31 15:02:13 +0200
commit6fe294fa5bab1b0ccd80d6dfb53be85adfaec4ad (patch)
tree6a177fee39ac5ba1c3c2de58e3d11657b2044d2e /components/script_layout_interface/wrapper_traits.rs
parent409bd3d989c1877f8e0a5da92bd758dd20ac724b (diff)
downloadservo-6fe294fa5bab1b0ccd80d6dfb53be85adfaec4ad.tar.gz
servo-6fe294fa5bab1b0ccd80d6dfb53be85adfaec4ad.zip
Make LayoutNodeHelpers::text_content return a cow
Diffstat (limited to 'components/script_layout_interface/wrapper_traits.rs')
-rw-r--r--components/script_layout_interface/wrapper_traits.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs
index 67b107a86d7..462d11f2c7e 100644
--- a/components/script_layout_interface/wrapper_traits.rs
+++ b/components/script_layout_interface/wrapper_traits.rs
@@ -17,6 +17,7 @@ use net_traits::image::base::{Image, ImageMetadata};
use range::Range;
use servo_arc::Arc;
use servo_url::ServoUrl;
+use std::borrow::Cow;
use std::fmt::Debug;
use std::sync::Arc as StdArc;
use style::attr::AttrValue;
@@ -262,7 +263,7 @@ pub trait ThreadSafeLayoutNode<'dom>:
/// data flags, and we have this annoying trait separation between script and layout :-(
unsafe fn unsafe_get(self) -> Self::ConcreteNode;
- fn node_text_content(&self) -> String;
+ fn node_text_content(self) -> Cow<'dom, str>;
/// If the insertion point is within this node, returns it. Otherwise, returns `None`.
fn selection(&self) -> Option<Range<ByteIndex>>;