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

Unified Diff: Source/core/rendering/InlineTextBox.cpp

Issue 187783002: Fix incorrect indices for emphasis marks drawing in InlineTextBox::paint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keeping previous FIXME Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/text/emphasis-combined-text.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index fed938064353d8cc7ac424fa19cdd33cd94cb54c..ea9d086717a5e08c1a546ab9a6a699d1b9b17741 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -705,12 +705,19 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
if (combinedText)
context->concatCTM(rotation(boxRect, Clockwise));
- if (!paintSelectedTextSeparately || ePos <= sPos) {
- // FIXME: Truncate right-to-left text correctly.
- paintTextWithShadows(context, rendererToUse, combinedText ? combinedText->originalFont() : font, emphasisMarkTextRun, emphasisMark, emphasisMarkOffset, 0, length, length, emphasisMarkTextOrigin, boxRect, textShadow, textStrokeWidth > 0, isHorizontal());
- } else {
- paintTextWithShadows(context, rendererToUse, combinedText ? combinedText->originalFont() : font, emphasisMarkTextRun, emphasisMark, emphasisMarkOffset, ePos, sPos, length, emphasisMarkTextOrigin, boxRect, textShadow, textStrokeWidth > 0, isHorizontal());
+ int startOffset = 0;
+ int endOffset = length;
+ int paintRunLength = length;
+ if (combinedText) {
+ startOffset = 0;
+ endOffset = objectReplacementCharacterTextRun.length();
+ paintRunLength = endOffset;
+ } else if (paintSelectedTextSeparately && ePos > sPos) {
+ startOffset = ePos;
+ endOffset = sPos;
}
+ // FIXME: Truncate right-to-left text correctly.
+ paintTextWithShadows(context, rendererToUse, combinedText ? combinedText->originalFont() : font, emphasisMarkTextRun, emphasisMark, emphasisMarkOffset, startOffset, endOffset, paintRunLength, emphasisMarkTextOrigin, boxRect, textShadow, textStrokeWidth > 0, isHorizontal());
if (combinedText)
context->concatCTM(rotation(boxRect, Counterclockwise));
@@ -732,7 +739,10 @@ void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset,
if (combinedText)
context->concatCTM(rotation(boxRect, Clockwise));
- paintTextWithShadows(context, rendererToUse, combinedText ? combinedText->originalFont() : font, emphasisMarkTextRun, emphasisMark, emphasisMarkOffset, sPos, ePos, length, emphasisMarkTextOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, isHorizontal());
+ int startOffset = combinedText ? 0 : sPos;
+ int endOffset = combinedText ? objectReplacementCharacterTextRun.length() : ePos;
+ int paintRunLength = combinedText ? endOffset : length;
+ paintTextWithShadows(context, rendererToUse, combinedText ? combinedText->originalFont() : font, emphasisMarkTextRun, emphasisMark, emphasisMarkOffset, startOffset, endOffset, paintRunLength, emphasisMarkTextOrigin, boxRect, selectionShadow, selectionStrokeWidth > 0, isHorizontal());
if (combinedText)
context->concatCTM(rotation(boxRect, Counterclockwise));
« no previous file with comments | « LayoutTests/fast/text/emphasis-combined-text.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698