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

Side by Side Diff: Source/core/rendering/style/RenderStyle.h

Issue 272443002: Store and propagate a list of applied text decorations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #define SET_BORDERVALUE_COLOR(group, variable, value) \ 90 #define SET_BORDERVALUE_COLOR(group, variable, value) \
91 if (!compareEqual(group->variable.color(), value)) \ 91 if (!compareEqual(group->variable.color(), value)) \
92 group.access()->variable.setColor(value) 92 group.access()->variable.setColor(value)
93 93
94 namespace WebCore { 94 namespace WebCore {
95 95
96 using std::max; 96 using std::max;
97 97
98 class FilterOperations; 98 class FilterOperations;
99 99
100 class AppliedTextDecoration;
100 class BorderData; 101 class BorderData;
101 class CounterContent; 102 class CounterContent;
102 class CursorList; 103 class CursorList;
103 class Font; 104 class Font;
104 class FontMetrics; 105 class FontMetrics;
105 class IntRect; 106 class IntRect;
106 class Pair; 107 class Pair;
107 class ShadowList; 108 class ShadowList;
108 class StyleImage; 109 class StyleImage;
109 class StyleInheritedData; 110 class StyleInheritedData;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 struct InheritedFlags { 157 struct InheritedFlags {
157 bool operator==(const InheritedFlags& other) const 158 bool operator==(const InheritedFlags& other) const
158 { 159 {
159 return (_empty_cells == other._empty_cells) 160 return (_empty_cells == other._empty_cells)
160 && (_caption_side == other._caption_side) 161 && (_caption_side == other._caption_side)
161 && (_list_style_type == other._list_style_type) 162 && (_list_style_type == other._list_style_type)
162 && (_list_style_position == other._list_style_position) 163 && (_list_style_position == other._list_style_position)
163 && (_visibility == other._visibility) 164 && (_visibility == other._visibility)
164 && (_text_align == other._text_align) 165 && (_text_align == other._text_align)
165 && (_text_transform == other._text_transform) 166 && (_text_transform == other._text_transform)
166 && (_text_decorations == other._text_decorations) 167 && (m_textUnderline == other.m_textUnderline)
167 && (_cursor_style == other._cursor_style) 168 && (_cursor_style == other._cursor_style)
168 && (_direction == other._direction) 169 && (_direction == other._direction)
169 && (_white_space == other._white_space) 170 && (_white_space == other._white_space)
170 && (_border_collapse == other._border_collapse) 171 && (_border_collapse == other._border_collapse)
171 && (_box_direction == other._box_direction) 172 && (_box_direction == other._box_direction)
172 && (m_rtlOrdering == other.m_rtlOrdering) 173 && (m_rtlOrdering == other.m_rtlOrdering)
173 && (m_printColorAdjust == other.m_printColorAdjust) 174 && (m_printColorAdjust == other.m_printColorAdjust)
174 && (_pointerEvents == other._pointerEvents) 175 && (_pointerEvents == other._pointerEvents)
175 && (_insideLink == other._insideLink) 176 && (_insideLink == other._insideLink)
176 && (m_writingMode == other.m_writingMode); 177 && (m_writingMode == other.m_writingMode);
177 } 178 }
178 179
179 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); } 180 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); }
180 181
181 unsigned _empty_cells : 1; // EEmptyCell 182 unsigned _empty_cells : 1; // EEmptyCell
182 unsigned _caption_side : 2; // ECaptionSide 183 unsigned _caption_side : 2; // ECaptionSide
183 unsigned _list_style_type : 7; // EListStyleType 184 unsigned _list_style_type : 7; // EListStyleType
184 unsigned _list_style_position : 1; // EListStylePosition 185 unsigned _list_style_position : 1; // EListStylePosition
185 unsigned _visibility : 2; // EVisibility 186 unsigned _visibility : 2; // EVisibility
186 unsigned _text_align : 4; // ETextAlign 187 unsigned _text_align : 4; // ETextAlign
187 unsigned _text_transform : 2; // ETextTransform 188 unsigned _text_transform : 2; // ETextTransform
188 unsigned _text_decorations : TextDecorationBits; 189 unsigned m_textUnderline : 1;
189 unsigned _cursor_style : 6; // ECursor 190 unsigned _cursor_style : 6; // ECursor
190 unsigned _direction : 1; // TextDirection 191 unsigned _direction : 1; // TextDirection
191 unsigned _white_space : 3; // EWhiteSpace 192 unsigned _white_space : 3; // EWhiteSpace
192 // 32 bits
193 unsigned _border_collapse : 1; // EBorderCollapse 193 unsigned _border_collapse : 1; // EBorderCollapse
194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module) 194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module)
195 // 32 bits
195 196
196 // non CSS2 inherited 197 // non CSS2 inherited
197 unsigned m_rtlOrdering : 1; // Order 198 unsigned m_rtlOrdering : 1; // Order
198 unsigned m_printColorAdjust : PrintColorAdjustBits; 199 unsigned m_printColorAdjust : PrintColorAdjustBits;
199 unsigned _pointerEvents : 4; // EPointerEvents 200 unsigned _pointerEvents : 4; // EPointerEvents
200 unsigned _insideLink : 2; // EInsideLink 201 unsigned _insideLink : 2; // EInsideLink
201 // 43 bits 202 // 40 bits
Julien - ping for review 2014/05/06 23:29:30 I think we should just remove this one as it doesn
andersr 2014/05/07 11:17:53 That's true.
202 203
203 // CSS Text Layout Module Level 3: Vertical writing support 204 // CSS Text Layout Module Level 3: Vertical writing support
204 unsigned m_writingMode : 2; // WritingMode 205 unsigned m_writingMode : 2; // WritingMode
205 // 45 bits 206 // 42 bits
206 } inherited_flags; 207 } inherited_flags;
207 208
208 // don't inherit 209 // don't inherit
209 struct NonInheritedFlags { 210 struct NonInheritedFlags {
210 bool operator==(const NonInheritedFlags& other) const 211 bool operator==(const NonInheritedFlags& other) const
211 { 212 {
212 return _effectiveDisplay == other._effectiveDisplay 213 return _effectiveDisplay == other._effectiveDisplay
213 && _originalDisplay == other._originalDisplay 214 && _originalDisplay == other._originalDisplay
214 && _overflowX == other._overflowX 215 && _overflowX == other._overflowX
215 && _overflowY == other._overflowY 216 && _overflowY == other._overflowY
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 protected: 296 protected:
296 void setBitDefaults() 297 void setBitDefaults()
297 { 298 {
298 inherited_flags._empty_cells = initialEmptyCells(); 299 inherited_flags._empty_cells = initialEmptyCells();
299 inherited_flags._caption_side = initialCaptionSide(); 300 inherited_flags._caption_side = initialCaptionSide();
300 inherited_flags._list_style_type = initialListStyleType(); 301 inherited_flags._list_style_type = initialListStyleType();
301 inherited_flags._list_style_position = initialListStylePosition(); 302 inherited_flags._list_style_position = initialListStylePosition();
302 inherited_flags._visibility = initialVisibility(); 303 inherited_flags._visibility = initialVisibility();
303 inherited_flags._text_align = initialTextAlign(); 304 inherited_flags._text_align = initialTextAlign();
304 inherited_flags._text_transform = initialTextTransform(); 305 inherited_flags._text_transform = initialTextTransform();
305 inherited_flags._text_decorations = initialTextDecoration(); 306 inherited_flags.m_textUnderline = false;
306 inherited_flags._cursor_style = initialCursor(); 307 inherited_flags._cursor_style = initialCursor();
307 inherited_flags._direction = initialDirection(); 308 inherited_flags._direction = initialDirection();
308 inherited_flags._white_space = initialWhiteSpace(); 309 inherited_flags._white_space = initialWhiteSpace();
309 inherited_flags._border_collapse = initialBorderCollapse(); 310 inherited_flags._border_collapse = initialBorderCollapse();
310 inherited_flags.m_rtlOrdering = initialRTLOrdering(); 311 inherited_flags.m_rtlOrdering = initialRTLOrdering();
311 inherited_flags._box_direction = initialBoxDirection(); 312 inherited_flags._box_direction = initialBoxDirection();
312 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); 313 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
313 inherited_flags._pointerEvents = initialPointerEvents(); 314 inherited_flags._pointerEvents = initialPointerEvents();
314 inherited_flags._insideLink = NotInsideLink; 315 inherited_flags._insideLink = NotInsideLink;
315 inherited_flags.m_writingMode = initialWritingMode(); 316 inherited_flags.m_writingMode = initialWritingMode();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 575
575 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult iplier; } 576 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult iplier; }
576 577
577 const Length& textIndent() const { return rareInheritedData->indent; } 578 const Length& textIndent() const { return rareInheritedData->indent; }
578 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); } 579 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); }
579 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); } 580 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); }
580 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); } 581 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); }
581 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); } 582 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); }
582 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); } 583 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); }
583 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); } 584 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); }
584 TextDecoration textDecorationsInEffect() const { return static_cast<TextDeco ration>(inherited_flags._text_decorations); } 585 TextDecoration textDecorationsInEffect() const;
586 const Vector<AppliedTextDecoration>& appliedTextDecorations() const;
585 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); } 587 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); }
586 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } 588 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
587 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); } 589 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); }
588 float wordSpacing() const; 590 float wordSpacing() const;
589 float letterSpacing() const; 591 float letterSpacing() const;
590 592
591 float zoom() const { return visual->m_zoom; } 593 float zoom() const { return visual->m_zoom; }
592 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } 594 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
593 595
594 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); } 596 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); }
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 } 1109 }
1108 1110
1109 void setColor(const Color&); 1111 void setColor(const Color&);
1110 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); } 1112 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); }
1111 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } 1113 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); }
1112 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } 1114 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); }
1113 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } 1115 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1114 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); } 1116 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); }
1115 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); } 1117 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); }
1116 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } 1118 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1117 void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_ decorations |= v; } 1119 void addAppliedTextDecoration(const AppliedTextDecoration&);
1118 void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_de corations = v; } 1120 void applyTextDecorations();
1121 void clearAppliedTextDecorations();
1119 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); } 1122 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); }
1120 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); } 1123 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); }
1121 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); } 1124 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); }
1122 void setDirection(TextDirection v) { inherited_flags._direction = v; } 1125 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1123 void setLineHeight(Length specifiedLineHeight); 1126 void setLineHeight(Length specifiedLineHeight);
1124 bool setZoom(float); 1127 bool setZoom(float);
1125 void setZoomWithoutReturnValue(float f) { setZoom(f); } 1128 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1126 bool setEffectiveZoom(float); 1129 bool setEffectiveZoom(float);
1127 1130
1128 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); } 1131 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); }
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 1511
1509 bool isSharable() const; 1512 bool isSharable() const;
1510 1513
1511 bool emptyState() const { return noninherited_flags.emptyState; } 1514 bool emptyState() const { return noninherited_flags.emptyState; }
1512 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b; } 1515 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b; }
1513 bool firstChildState() const { return noninherited_flags.firstChildState; } 1516 bool firstChildState() const { return noninherited_flags.firstChildState; }
1514 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; } 1517 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; }
1515 bool lastChildState() const { return noninherited_flags.lastChildState; } 1518 bool lastChildState() const { return noninherited_flags.lastChildState; }
1516 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; } 1519 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
1517 1520
1518 StyleColor visitedDependentDecorationColor() const; 1521 StyleColor visitedDependentDecorationStyleColor() const;
1522 Color visitedDependentDecorationColor() const;
1519 Color visitedDependentColor(int colorProperty) const; 1523 Color visitedDependentColor(int colorProperty) const;
1520 1524
1521 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; } 1525 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe ritance = true; }
1522 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; } 1526 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex plicitInheritance; }
1523 1527
1524 void setHasCurrentColor() { noninherited_flags.currentColor = true; } 1528 void setHasCurrentColor() { noninherited_flags.currentColor = true; }
1525 bool hasCurrentColor() const { return noninherited_flags.currentColor; } 1529 bool hasCurrentColor() const { return noninherited_flags.currentColor; }
1526 1530
1527 // Initial values for all the properties 1531 // Initial values for all the properties
1528 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } 1532 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 inline bool RenderStyle::hasPseudoElementStyle() const 1882 inline bool RenderStyle::hasPseudoElementStyle() const
1879 { 1883 {
1880 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK; 1884 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK;
1881 } 1885 }
1882 1886
1883 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1887 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1884 1888
1885 } // namespace WebCore 1889 } // namespace WebCore
1886 1890
1887 #endif // RenderStyle_h 1891 #endif // RenderStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698