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

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

Issue 2497963002: Add support for multiple text decorations with same line positioning (Closed)
Patch Set: Update slimming paint expectations Created 4 years, 1 month 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/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index c34902ecec7e5da81b2824dc66d53d77890c1574..495abb158f8491cada883438c03bb6ec6b2d065f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -3054,74 +3054,6 @@ LayoutObject::getUncachedPseudoStyleFromParentOrShadowHost() const {
return getUncachedPseudoStyle(PseudoStyleRequest(PseudoIdSelection));
}
-void LayoutObject::getTextDecorations(unsigned decorations,
- AppliedTextDecoration& underline,
- AppliedTextDecoration& overline,
- AppliedTextDecoration& linethrough,
- bool quirksMode,
- bool firstlineStyle) {
- LayoutObject* curr = this;
- const ComputedStyle* styleToUse = nullptr;
- unsigned currDecs = TextDecorationNone;
- Color resultColor;
- TextDecorationStyle resultStyle;
- do {
- styleToUse = curr->style(firstlineStyle);
- currDecs = styleToUse->getTextDecoration();
- currDecs &= decorations;
- resultColor =
- styleToUse->visitedDependentColor(CSSPropertyTextDecorationColor);
- resultStyle = styleToUse->getTextDecorationStyle();
- // Parameter 'decorations' is cast as an int to enable the bitwise
- // operations below.
- if (currDecs) {
- if (currDecs & TextDecorationUnderline) {
- decorations &= ~TextDecorationUnderline;
- underline.color = resultColor;
- underline.style = resultStyle;
- }
- if (currDecs & TextDecorationOverline) {
- decorations &= ~TextDecorationOverline;
- overline.color = resultColor;
- overline.style = resultStyle;
- }
- if (currDecs & TextDecorationLineThrough) {
- decorations &= ~TextDecorationLineThrough;
- linethrough.color = resultColor;
- linethrough.style = resultStyle;
- }
- }
- if (curr->isRubyText())
- return;
- curr = curr->parent();
- if (curr && curr->isAnonymousBlock() && curr->isLayoutBlockFlow() &&
- toLayoutBlockFlow(curr)->continuation())
- curr = toLayoutBlockFlow(curr)->continuation();
- } while (curr && decorations && (!quirksMode || !curr->node() ||
- (!isHTMLAnchorElement(*curr->node()) &&
- !isHTMLFontElement(*curr->node()))));
-
- // If we bailed out, use the element we bailed out at (typically a <font> or
- // <a> element).
- if (decorations && curr) {
- styleToUse = curr->style(firstlineStyle);
- resultColor =
- styleToUse->visitedDependentColor(CSSPropertyTextDecorationColor);
- if (decorations & TextDecorationUnderline) {
- underline.color = resultColor;
- underline.style = resultStyle;
- }
- if (decorations & TextDecorationOverline) {
- overline.color = resultColor;
- overline.style = resultStyle;
- }
- if (decorations & TextDecorationLineThrough) {
- linethrough.color = resultColor;
- linethrough.style = resultStyle;
- }
- }
-}
-
void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) {
// Convert the style regions to absolute coordinates.
if (style()->visibility() != EVisibility::Visible || !isBox())
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698