Changeset 256360 in webkit
- Timestamp:
- Feb 11, 2020 1:53:01 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r256353 r256360 1 2020-02-11 Megan Gardner <megan_gardner@apple.com> 2 3 Draw underlines when specified in highlights 4 https://bugs.webkit.org/show_bug.cgi?id=207319 5 6 Reviewed by Simon Fraser. 7 8 * http/wpt/css/css-highlight-api/highlight-text-decorations-expected.html: Copied from LayoutTests/http/wpt/css/css-highlight-api/highlight-text-expected.html. 9 * http/wpt/css/css-highlight-api/highlight-text-decorations.html: Added. 10 * http/wpt/css/css-highlight-api/highlight-text-expected.html: 11 1 12 2020-02-11 Eric Carlson <eric.carlson@apple.com> 2 13 -
trunk/LayoutTests/platform/win/TestExpectations
r256209 r256360 406 406 # highlight API 407 407 highlight/ [ Skip ] 408 http/wpt/css/css-highlight-api/ [ Skip ] 408 409 409 410 # Pre-HMTL5 parser quirks only apply to the mac port for now. … … 4520 4521 webkit.org/b/206282 fast/text/stale-TextLayout-from-first-line.html [ ImageOnlyFailure ] 4521 4522 4522 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text-across-elements.html [ ImageOnlyFailure ]4523 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text-cascade.html [ ImageOnlyFailure ]4524 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text-replace.html [ ImageOnlyFailure ]4525 webkit.org/b/205855 http/wpt/css/css-highlight-api/highlight-text.html [ ImageOnlyFailure ]4526 4527 4523 webkit.org/b/205856 storage/indexeddb/IDBTransaction-page-cache.html [ Pass Timeout ] 4528 4524 -
trunk/Source/WebCore/ChangeLog
r256353 r256360 1 2020-02-11 Megan Gardner <megan_gardner@apple.com> 2 3 Draw underlines when specified in highlights 4 https://bugs.webkit.org/show_bug.cgi?id=207319 5 6 Reviewed by Simon Fraser. 7 8 Test: http/wpt/css/css-highlight-api/highlight-text-decorations.html 9 10 When determining if we have any text decorations, currently we were only looking at the lineStyle, 11 but since highlights can have text decorations, they need to be considered in these calculations. 12 13 * dom/Document.cpp: 14 (WebCore::Document::updateHighlightPositions): 15 * rendering/InlineTextBox.cpp: 16 (WebCore::InlineTextBox::paint): 17 (WebCore::InlineTextBox::collectMarkedTextsForHighlights const): 18 (WebCore::InlineTextBox::paintMarkedTextDecoration): 19 * rendering/TextDecorationPainter.cpp: 20 (WebCore::TextDecorationPainter::textDecorationsInEffectForStyle): 21 * rendering/TextDecorationPainter.h: 22 1 23 2020-02-11 Eric Carlson <eric.carlson@apple.com> 2 24 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r256196 r256360 623 623 // Paint decorations 624 624 auto textDecorations = lineStyle.textDecorationsInEffect(); 625 if (!textDecorations.isEmpty() && paintInfo.phase != PaintPhase::Selection) { 625 bool highlightDecorations = !collectMarkedTextsForHighlights(TextPaintPhase::Decoration).isEmpty(); 626 bool lineDecorations = !textDecorations.isEmpty(); 627 if ((lineDecorations || highlightDecorations) && paintInfo.phase != PaintPhase::Selection) { 626 628 TextRun textRun = createTextRun(); 627 629 unsigned length = textRun.length(); … … 1045 1047 if (!renderStyle) 1046 1048 continue; 1049 if (renderStyle->textDecorationsInEffect().isEmpty() && phase == TextPaintPhase::Decoration) 1050 continue; 1047 1051 for (auto& rangeData : highlight.value->rangesData()) { 1048 1052 if (rangeData->startPosition && rangeData->endPosition) { … … 1197 1201 1198 1202 // 2. Paint 1199 TextDecorationPainter decorationPainter { context, lineStyle().textDecorationsInEffect(), renderer(), isFirstLine(), lineFont(), markedText.style.textDecorationStyles }; 1203 auto textDecorations = lineStyle().textDecorationsInEffect(); 1204 textDecorations.add(TextDecorationPainter::textDecorationsInEffectForStyle(markedText.style.textDecorationStyles)); 1205 TextDecorationPainter decorationPainter { context, textDecorations, renderer(), isFirstLine(), lineFont(), markedText.style.textDecorationStyles }; 1200 1206 decorationPainter.setInlineTextBox(this); 1201 1207 decorationPainter.setWidth(snappedSelectionRect.width()); -
trunk/Source/WebCore/rendering/TextDecorationPainter.cpp
r244115 r256360 388 388 } 389 389 390 OptionSet<TextDecoration> TextDecorationPainter::textDecorationsInEffectForStyle(const TextDecorationPainter::Styles& style) 391 { 392 OptionSet<TextDecoration> decorations; 393 if (style.underlineColor.isValid()) 394 decorations.add(TextDecoration::Underline); 395 if (style.overlineColor.isValid()) 396 decorations.add(TextDecoration::Overline); 397 if (style.linethroughColor.isValid()) 398 decorations.add(TextDecoration::LineThrough); 399 return decorations; 400 }; 401 390 402 auto TextDecorationPainter::stylesForRenderer(const RenderObject& renderer, OptionSet<TextDecoration> requestedDecorations, bool firstLineStyle, PseudoId pseudoId) -> Styles 391 403 { -
trunk/Source/WebCore/rendering/TextDecorationPainter.h
r244115 r256360 65 65 TextDecorationStyle linethroughStyle; 66 66 }; 67 static OptionSet<TextDecoration> textDecorationsInEffectForStyle(const Styles&); 67 68 static Styles stylesForRenderer(const RenderObject&, OptionSet<TextDecoration> requestedDecorations, bool firstLineStyle = false, PseudoId = PseudoId::None); 68 69
Note: See TracChangeset
for help on using the changeset viewer.