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

Unified Diff: Source/core/rendering/style/RenderStyle.h

Issue 219633002: Proper support for multiple text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/rendering/style/RenderStyle.h
diff --git a/Source/core/rendering/style/RenderStyle.h b/Source/core/rendering/style/RenderStyle.h
index c09a10105916cd4a076ba7d1a7f7f20cd3781212..1c87676e1f56e8c97ea431fa659ca3f6b541f935 100644
--- a/Source/core/rendering/style/RenderStyle.h
+++ b/Source/core/rendering/style/RenderStyle.h
@@ -96,6 +96,8 @@ using std::max;
class FilterOperations;
+class AppliedTextDecoration;
+class AppliedTextDecorationList;
class BorderData;
class CounterContent;
class CursorList;
@@ -162,7 +164,7 @@ protected:
&& (_visibility == other._visibility)
&& (_text_align == other._text_align)
&& (_text_transform == other._text_transform)
- && (_text_decorations == other._text_decorations)
+ && (m_textUnderline == other.m_textUnderline)
&& (_cursor_style == other._cursor_style)
&& (_direction == other._direction)
&& (_white_space == other._white_space)
@@ -184,24 +186,24 @@ protected:
unsigned _visibility : 2; // EVisibility
unsigned _text_align : 4; // ETextAlign
unsigned _text_transform : 2; // ETextTransform
- unsigned _text_decorations : TextDecorationBits;
+ unsigned m_textUnderline : 1;
unsigned _cursor_style : 6; // ECursor
unsigned _direction : 1; // TextDirection
unsigned _white_space : 3; // EWhiteSpace
- // 32 bits
unsigned _border_collapse : 1; // EBorderCollapse
unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
+ // 32 bits
// non CSS2 inherited
unsigned m_rtlOrdering : 1; // Order
unsigned m_printColorAdjust : PrintColorAdjustBits;
unsigned _pointerEvents : 4; // EPointerEvents
unsigned _insideLink : 2; // EInsideLink
- // 43 bits
+ // 40 bits
// CSS Text Layout Module Level 3: Vertical writing support
unsigned m_writingMode : 2; // WritingMode
- // 45 bits
+ // 42 bits
} inherited_flags;
// don't inherit
@@ -301,7 +303,7 @@ protected:
inherited_flags._visibility = initialVisibility();
inherited_flags._text_align = initialTextAlign();
inherited_flags._text_transform = initialTextTransform();
- inherited_flags._text_decorations = initialTextDecoration();
+ inherited_flags.m_textUnderline = false;
inherited_flags._cursor_style = initialCursor();
inherited_flags._direction = initialDirection();
inherited_flags._white_space = initialWhiteSpace();
@@ -579,7 +581,10 @@ public:
TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
- TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(inherited_flags._text_decorations); }
+ TextDecoration textDecorationsInEffect() const;
+ TextDecoration appliedTextUnderline() const { return static_cast<TextDecoration>(inherited_flags.m_textUnderline); }
esprehn 2014/03/31 17:41:24 Instead of this you can encapsulate the optimizati
andersr 2014/04/01 17:07:54 Note that I have not fully addressed this issue in
+ const AppliedTextDecorationList* appliedTextDecorations() const { return rareInheritedData->appliedTextDecorations.get(); }
esprehn 2014/03/31 17:41:24 const Vector<AppliedTextDecoration>&, reference no
+ bool hasAppliedTextDecorations() const { return appliedTextUnderline() || appliedTextDecorations(); }
TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
@@ -1107,8 +1112,12 @@ public:
void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
- void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations |= v; }
- void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations = v; }
+ void setTextDecorationsInEffect(TextDecoration);
+ void addAppliedTextDecoration(TextDecoration);
+ void addAppliedTextDecoration(const AppliedTextDecoration&);
+ void applyTextDecoration(TextDecoration, TextDecorationStyle, const StyleColor&);
+ void applyTextDecorations();
+ void clearAppliedTextDecorations();
void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v); }
void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
@@ -1508,7 +1517,8 @@ public:
bool lastChildState() const { return noninherited_flags.lastChildState; }
void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
- StyleColor visitedDependentDecorationColor() const;
+ StyleColor visitedDependentDecorationStyleColor() const;
+ Color visitedDependentDecorationColor() const;
Color visitedDependentColor(int colorProperty) const;
void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInheritance = true; }

Powered by Google App Engine
This is Rietveld 408576698