Convert ScannedTextFragment fields into bitflags

This commit is contained in:
Matt Brubeck 2016-03-24 16:06:12 -07:00
parent 6171000875
commit 08caf7412f
4 changed files with 45 additions and 25 deletions

View file

@ -930,7 +930,7 @@ impl FragmentDisplayListBuilding for Fragment {
// Draw a highlighted background if the text is selected.
//
// TODO: Allow non-text fragments to be selected too.
if scanned_text_fragment_info.selected {
if scanned_text_fragment_info.selected() {
state.add_display_item(
DisplayItem::SolidColorClass(box SolidColorDisplayItem {
base: BaseDisplayItem::new(stacking_relative_border_box,
@ -1116,7 +1116,7 @@ impl FragmentDisplayListBuilding for Fragment {
//
// NB: According to CSS-BACKGROUNDS, text shadows render in *reverse* order (front
// to back).
let text_color = if text_fragment.selected {
let text_color = if text_fragment.selected() {
SELECTION_FOREGROUND_COLOR
} else {
self.style().get_color().color