Repository navigation
script/layout: Show visible selection on images - #48149
Conversation
| /// Set whether or not this node is selected when it is an element. | ||
| fn set_element_selection(&self, selected: bool) -> bool; |
There was a problem hiding this comment.
Please document the meaning of the return value, it looks like it’s not the same as for set_text_run_selection?
There was a problem hiding this comment.
Good catch. This is done now.
| }); | ||
| self.set_character_data_selection(character_data, range); | ||
| } else if node.set_element_selection(flat_tree_selection.is_some()) { | ||
| self.needs_new_display_list = true; |
There was a problem hiding this comment.
VisibleSelectionFlagUpdate::set_character_data_selection above has a code path calling Node::dirty, is something similar not necessary for replaced elements?
There was a problem hiding this comment.
The Node::dirty call is only necessary for ::first-letter. Normally if there's no box, the node is already marked as dirty for layout. We still need the Node::dirty call when selection changes on something with ::first-letter.
| /// Whether or not this replaced element is selected by the document selection. | ||
| #[conditional_malloc_size_of] | ||
| pub selected: Arc<AtomicBool>, |
There was a problem hiding this comment.
This Arc is for sharing the same mutable AtomicBool with ImageFragment, right?
| // Selected style resolution falls back to the style of the element itself, | ||
| // and in that case we don't want to paint any overlay. |
There was a problem hiding this comment.
Should text selection background have the same special case?
There was a problem hiding this comment.
Yes, probably, though the failure mode is less severe.
0f7636b to
f9b1583
Compare
This change adds support for visible selection of images. Now when an image is selected a transparent overlay (based on the `::selection` color is drawn over it). Signed-off-by: Martin Robinson <[email protected]>
f9b1583 to
316cc66
Compare
This change adds support for visible selection of images. Now when an image is selected a transparent overlay (based on the `::selection` color is drawn over it). Testing: This change adds two Servo-specific WPT-style tests. Two more WPT tests start to pass and one starts to fail (due to not fully supporting SVG). Signed-off-by: Martin Robinson <[email protected]>
This change adds support for visible selection of images. Now when an image is selected a transparent overlay (based on the `::selection` color is drawn over it). Testing: This change adds two Servo-specific WPT-style tests. Two more WPT tests start to pass and one starts to fail (due to not fully supporting SVG). Signed-off-by: Martin Robinson <[email protected]>
This change adds support for visible selection of images. Now when an
image is selected a transparent overlay (based on the
::selectioncolor is drawn over it).
Testing: This change adds two Servo-specific WPT-style tests. Two more
WPT tests start to pass and one starts to fail (due to not fully supporting
SVG).