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

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 950623002: Store resolved color in AppliedTextDecoration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch with underline optimization handling Created 5 years, 9 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
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 2fa594d795b58033d5ff04abe59b35de5c51df22..60d21cb97a49ae8ffb45c863ab581ba605fd1e06 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -1599,6 +1599,8 @@ StyleDifference LayoutObject::adjustStyleDifference(StyleDifference diff) const
if (style()->hasBorder() || style()->hasOutline()
|| (isText() && !toLayoutText(this)->isAllCollapsibleWhitespace()))
diff.setNeedsPaintInvalidationObject();
+ if (style()->hasSimpleUnderlineTextDecoration())
+ style()->adjustTextDecorationDifference();
Timothy Loh 2015/03/25 00:26:23 This seems a bit weird. I don't think we should be
}
// The answer to layerTypeRequired() for plugins, iframes, and canvas can change without the actual
@@ -2763,18 +2765,18 @@ void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
if (currDecs) {
if (currDecs & TextDecorationUnderline) {
decorations &= ~TextDecorationUnderline;
- underline.color = resultColor;
- underline.style = resultStyle;
+ underline.setColor(resultColor);
+ underline.setStyle(resultStyle);
}
if (currDecs & TextDecorationOverline) {
decorations &= ~TextDecorationOverline;
- overline.color = resultColor;
- overline.style = resultStyle;
+ overline.setColor(resultColor);
+ overline.setStyle(resultStyle);
}
if (currDecs & TextDecorationLineThrough) {
decorations &= ~TextDecorationLineThrough;
- linethrough.color = resultColor;
- linethrough.style = resultStyle;
+ linethrough.setColor(resultColor);
+ linethrough.setStyle(resultStyle);
}
}
if (curr->isRubyText())
@@ -2789,16 +2791,16 @@ void LayoutObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
styleToUse = curr->style(firstlineStyle);
resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecorationColor);
if (decorations & TextDecorationUnderline) {
- underline.color = resultColor;
- underline.style = resultStyle;
+ underline.setColor(resultColor);
+ underline.setStyle(resultStyle);
}
if (decorations & TextDecorationOverline) {
- overline.color = resultColor;
- overline.style = resultStyle;
+ overline.setColor(resultColor);
+ overline.setStyle(resultStyle);
}
if (decorations & TextDecorationLineThrough) {
- linethrough.color = resultColor;
- linethrough.style = resultStyle;
+ linethrough.setColor(resultColor);
+ linethrough.setStyle(resultStyle);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698