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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp

Issue 2600453003: Do not apply ink-skipping to line-through text decoration (Closed)
Patch Set: Adding rebaseline Created 3 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip-expected.png ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/InlineTextBoxPainter.h" 5 #include "core/paint/InlineTextBoxPainter.h"
6 6
7 #include "core/editing/CompositionUnderline.h" 7 #include "core/editing/CompositionUnderline.h"
8 #include "core/editing/Editor.h" 8 #include "core/editing/Editor.h"
9 #include "core/editing/markers/DocumentMarkerController.h" 9 #include "core/editing/markers/DocumentMarkerController.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 textDecorationThickness); 1127 textDecorationThickness);
1128 } 1128 }
1129 decorationPainter.paint(); 1129 decorationPainter.paint();
1130 } 1130 }
1131 if (lines & TextDecorationLineThrough) { 1131 if (lines & TextDecorationLineThrough) {
1132 const float lineThroughOffset = 2 * baseline / 3; 1132 const float lineThroughOffset = 2 * baseline / 3;
1133 AppliedDecorationPainter decorationPainter( 1133 AppliedDecorationPainter decorationPainter(
1134 context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset), 1134 context, FloatPoint(localOrigin) + FloatPoint(0, lineThroughOffset),
1135 width.toFloat(), decoration, textDecorationThickness, doubleOffset, 0, 1135 width.toFloat(), decoration, textDecorationThickness, doubleOffset, 0,
1136 antialiasDecoration); 1136 antialiasDecoration);
1137 if (skipIntercepts) { 1137 // No skip: ink for line-through,
1138 textPainter.clipDecorationsStripe( 1138 // compare https://github.com/w3c/csswg-drafts/issues/711
1139 -baseline + decorationPainter.decorationBounds().y() -
1140 FloatPoint(localOrigin).y(),
1141 decorationPainter.decorationBounds().height(),
1142 textDecorationThickness);
1143 }
1144 decorationPainter.paint(); 1139 decorationPainter.paint();
1145 } 1140 }
1146 } 1141 }
1147 } 1142 }
1148 1143
1149 void InlineTextBoxPainter::paintCompositionUnderline( 1144 void InlineTextBoxPainter::paintCompositionUnderline(
1150 GraphicsContext& context, 1145 GraphicsContext& context,
1151 const LayoutPoint& boxOrigin, 1146 const LayoutPoint& boxOrigin,
1152 const CompositionUnderline& underline) { 1147 const CompositionUnderline& underline) {
1153 if (underline.color() == Color::transparent) 1148 if (underline.color() == Color::transparent)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
1289 1284
1290 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(), 1285 LayoutRect boxRect(boxOrigin, LayoutSize(m_inlineTextBox.logicalWidth(),
1291 m_inlineTextBox.logicalHeight())); 1286 m_inlineTextBox.logicalHeight()));
1292 context.clip(FloatRect(boxRect)); 1287 context.clip(FloatRect(boxRect));
1293 context.drawHighlightForText(font, run, FloatPoint(boxOrigin), 1288 context.drawHighlightForText(font, run, FloatPoint(boxOrigin),
1294 boxRect.height().toInt(), color, 1289 boxRect.height().toInt(), color,
1295 paintOffsets.first, paintOffsets.second); 1290 paintOffsets.first, paintOffsets.second);
1296 } 1291 }
1297 1292
1298 } // namespace blink 1293 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698