Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Unified Diff: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp

Issue 1328283005: Add support for multiple text decorations with same line positioning (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
diff --git a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
index bac8976e35ac6e246d80beb64a79d6c2c440115b..3371e8368820c12d666d1b81a93a1beddb9c730b 100644
--- a/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGInlineTextBoxPainter.cpp
@@ -21,6 +21,7 @@
#include "core/paint/LineLayoutPaintShim.h"
#include "core/paint/PaintInfo.h"
#include "core/paint/SVGPaintContext.h"
+#include "core/style/AppliedTextDecoration.h"
#include "core/style/ShadowList.h"
#include "platform/graphics/GraphicsContextStateSaver.h"
@@ -115,11 +116,13 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
}
// Spec: All text decorations except line-through should be drawn before the text is filled and stroked; thus, the text is rendered on top of these decorations.
- unsigned decorations = style.textDecorationsInEffect();
- if (decorations & TextDecorationUnderline)
- paintDecoration(paintInfo, TextDecorationUnderline, fragment);
- if (decorations & TextDecorationOverline)
- paintDecoration(paintInfo, TextDecorationOverline, fragment);
+ const Vector<AppliedTextDecoration>& decorations = style.appliedTextDecorations();
+ for (const AppliedTextDecoration& decoration : decorations) {
+ if (decoration.lines() & TextDecorationUnderline)
+ paintDecoration(paintInfo, TextDecorationUnderline, fragment);
+ if (decoration.lines() & TextDecorationOverline)
+ paintDecoration(paintInfo, TextDecorationOverline, fragment);
+ }
for (int i = 0; i < 3; i++) {
switch (svgStyle.paintOrderType(i)) {
@@ -141,8 +144,10 @@ void SVGInlineTextBoxPainter::paintTextFragments(const PaintInfo& paintInfo, Lay
}
// Spec: Line-through should be drawn after the text is filled and stroked; thus, the line-through is rendered on top of the text.
- if (decorations & TextDecorationLineThrough)
- paintDecoration(paintInfo, TextDecorationLineThrough, fragment);
+ for (const AppliedTextDecoration& decoration : decorations) {
+ if (decoration.lines() & TextDecorationLineThrough)
+ paintDecoration(paintInfo, TextDecorationLineThrough, fragment);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698