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.
This commit is contained in:
Matt Brubeck 2016-03-18 16:38:17 -07:00
parent f2f05869d6
commit 6171000875
17 changed files with 229 additions and 62 deletions

View file

@ -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(),