diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-26 08:16:20 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-03-26 08:16:20 +0530 |
commit | bed91b3334786970c91a47c3bc95889d8675b4d5 (patch) | |
tree | a4f91a1957a33d18b393b41edab354a113720f5d /components/layout/construct.rs | |
parent | 1554331f06900e69f246ed9986a08aae91a0a71e (diff) | |
parent | 08caf7412fc3e86a76c47876eb9bfab9804f2182 (diff) | |
download | servo-bed91b3334786970c91a47c3bc95889d8675b4d5.tar.gz servo-bed91b3334786970c91a47c3bc95889d8675b4d5.zip |
Auto merge of #10176 - mbrubeck:selection-range, r=pcwalton
Highlight selected text in input fields
Fixes #9993. This does not yet allow stylesheets to set the selection colors; instead it uses a hard-coded orange background and white foreground.
r? @pcwalton
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10176)
<!-- Reviewable:end -->
Diffstat (limited to 'components/layout/construct.rs')
-rw-r--r-- | components/layout/construct.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/layout/construct.rs b/components/layout/construct.rs index aedbeaf04f6..c964501116c 100644 --- a/components/layout/construct.rs +++ b/components/layout/construct.rs @@ -709,13 +709,13 @@ impl<'a, ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode> return } - let insertion_point = node.insertion_point(); + let selection = node.selection(); let mut style = (*style).clone(); properties::modify_style_for_text(&mut style); match text_content { TextContent::Text(string) => { - let info = UnscannedTextFragmentInfo::new(string, insertion_point); + let info = UnscannedTextFragmentInfo::new(string, selection); let specific_fragment_info = SpecificFragmentInfo::UnscannedText(info); fragments.fragments.push_back(Fragment::from_opaque_node_and_style( node.opaque(), |