mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
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:
parent
f2f05869d6
commit
6171000875
17 changed files with 229 additions and 62 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue