Bug 1867939, part 4: Implemented the ::target-text CSS Pseudo Element. r=emilio,devtools-reviewers,nchevobbe

This patch implements the `::target-text` pseudo element.
Similarly to the Custom Highlight API, this is done implementing
a new Selection type.

Differential Revision: https://phabricator.services.mozilla.com/D195687
This commit is contained in:
Jan-Niklas Jaeschke
2024-04-04 14:39:32 +00:00
parent 3463f45cb4
commit dbaf47b1f4
13 changed files with 56 additions and 5 deletions

View File

@@ -5676,6 +5676,10 @@ bool nsTextFrame::GetSelectionTextColors(SelectionType aSelectionType,
aHighlightName, aBackground);
return hasForeground || hasBackground;
}
case SelectionType::eTargetText: {
aTextPaintStyle.GetTargetTextColors(aForeground, aBackground);
return true;
}
case SelectionType::eURLSecondary:
aTextPaintStyle.GetURLSecondaryColor(aForeground);
*aBackground = NS_RGBA(0, 0, 0, 0);