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

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: Undo NeedsRebaseline. 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 202
203 // CSS Text Layout Module Level 3: Vertical writing support 203 // CSS Text Layout Module Level 3: Vertical writing support
204 unsigned m_writingMode : 2; // WritingMode 204 unsigned m_writingMode : 2; // WritingMode
205 // 45 bits 205 // 42 bits
206 } inherited_flags; 206 } inherited_flags;
207 207
208 // don't inherit 208 // don't inherit
209 struct NonInheritedFlags { 209 struct NonInheritedFlags {
210 bool operator==(const NonInheritedFlags& other) const 210 bool operator==(const NonInheritedFlags& other) const
211 { 211 {
212 return _effectiveDisplay == other._effectiveDisplay 212 return _effectiveDisplay == other._effectiveDisplay
213 && _originalDisplay == other._originalDisplay 213 && _originalDisplay == other._originalDisplay
214 && _overflowX == other._overflowX 214 && _overflowX == other._overflowX
215 && _overflowY == other._overflowY 215 && _overflowY == other._overflowY
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 protected: 295 protected:
296 void setBitDefaults() 296 void setBitDefaults()
297 { 297 {
298 inherited_flags._empty_cells = initialEmptyCells(); 298 inherited_flags._empty_cells = initialEmptyCells();
299 inherited_flags._caption_side = initialCaptionSide(); 299 inherited_flags._caption_side = initialCaptionSide();
300 inherited_flags._list_style_type = initialListStyleType(); 300 inherited_flags._list_style_type = initialListStyleType();
301 inherited_flags._list_style_position = initialListStylePosition(); 301 inherited_flags._list_style_position = initialListStylePosition();
302 inherited_flags._visibility = initialVisibility(); 302 inherited_flags._visibility = initialVisibility();
303 inherited_flags._text_align = initialTextAlign(); 303 inherited_flags._text_align = initialTextAlign();
304 inherited_flags._text_transform = initialTextTransform(); 304 inherited_flags._text_transform = initialTextTransform();
305 inherited_flags._text_decorations = initialTextDecoration(); 305 inherited_flags.m_textUnderline = false;
306 inherited_flags._cursor_style = initialCursor(); 306 inherited_flags._cursor_style = initialCursor();
307 inherited_flags._direction = initialDirection(); 307 inherited_flags._direction = initialDirection();
308 inherited_flags._white_space = initialWhiteSpace(); 308 inherited_flags._white_space = initialWhiteSpace();
309 inherited_flags._border_collapse = initialBorderCollapse(); 309 inherited_flags._border_collapse = initialBorderCollapse();
310 inherited_flags.m_rtlOrdering = initialRTLOrdering(); 310 inherited_flags.m_rtlOrdering = initialRTLOrdering();
311 inherited_flags._box_direction = initialBoxDirection(); 311 inherited_flags._box_direction = initialBoxDirection();
312 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); 312 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
313 inherited_flags._pointerEvents = initialPointerEvents(); 313 inherited_flags._pointerEvents = initialPointerEvents();
314 inherited_flags._insideLink = NotInsideLink; 314 inherited_flags._insideLink = NotInsideLink;
315 inherited_flags.m_writingMode = initialWritingMode(); 315 inherited_flags.m_writingMode = initialWritingMode();
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 574
575 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult iplier; } 575 float textAutosizingMultiplier() const { return visual->m_textAutosizingMult iplier; }
576 576
577 const Length& textIndent() const { return rareInheritedData->indent; } 577 const Length& textIndent() const { return rareInheritedData->indent; }
578 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); } 578 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); }
579 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); } 579 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); }
580 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); } 580 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); }
581 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); } 581 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); }
582 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); } 582 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); }
583 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); } 583 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); } 584 TextDecoration textDecorationsInEffect() const;
585 const Vector<AppliedTextDecoration>& appliedTextDecorations() const;
585 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); } 586 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); }
586 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } 587 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
587 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); } 588 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); }
588 float wordSpacing() const; 589 float wordSpacing() const;
589 float letterSpacing() const; 590 float letterSpacing() const;
590 591
591 float zoom() const { return visual->m_zoom; } 592 float zoom() const { return visual->m_zoom; }
592 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } 593 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
593 594
594 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); } 595 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); }
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 } 1108 }
1108 1109
1109 void setColor(const Color&); 1110 void setColor(const Color&);
1110 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); } 1111 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); }
1111 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } 1112 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); }
1112 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } 1113 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); }
1113 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } 1114 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1114 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); } 1115 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); }
1115 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); } 1116 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); }
1116 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } 1117 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1117 void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_ decorations |= v; } 1118 void applyTextDecorations();
1118 void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_de corations = v; } 1119 void clearAppliedTextDecorations();
1119 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); } 1120 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); }
1120 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); } 1121 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); }
1121 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); } 1122 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); }
1122 void setDirection(TextDirection v) { inherited_flags._direction = v; } 1123 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1123 void setLineHeight(Length specifiedLineHeight); 1124 void setLineHeight(Length specifiedLineHeight);
1124 bool setZoom(float); 1125 bool setZoom(float);
1125 void setZoomWithoutReturnValue(float f) { setZoom(f); } 1126 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1126 bool setEffectiveZoom(float); 1127 bool setEffectiveZoom(float);
1127 1128
1128 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); } 1129 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); }
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1773 StyleColor visitedLinkTextFillColor() const { return rareInheritedData->visi tedLinkTextFillColor(); } 1774 StyleColor visitedLinkTextFillColor() const { return rareInheritedData->visi tedLinkTextFillColor(); }
1774 StyleColor visitedLinkTextStrokeColor() const { return rareInheritedData->vi sitedLinkTextStrokeColor(); } 1775 StyleColor visitedLinkTextStrokeColor() const { return rareInheritedData->vi sitedLinkTextStrokeColor(); }
1775 1776
1776 Color colorIncludingFallback(int colorProperty, bool visitedLink) const; 1777 Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
1777 1778
1778 Color stopColor() const { return svgStyle()->stopColor(); } 1779 Color stopColor() const { return svgStyle()->stopColor(); }
1779 Color floodColor() const { return svgStyle()->floodColor(); } 1780 Color floodColor() const { return svgStyle()->floodColor(); }
1780 Color lightingColor() const { return svgStyle()->lightingColor(); } 1781 Color lightingColor() const { return svgStyle()->lightingColor(); }
1781 1782
1782 void appendContent(PassOwnPtr<ContentData>); 1783 void appendContent(PassOwnPtr<ContentData>);
1784 void addAppliedTextDecoration(const AppliedTextDecoration&);
1783 1785
1784 bool diffNeedsFullLayout(const RenderStyle& other) const; 1786 bool diffNeedsFullLayout(const RenderStyle& other) const;
1785 bool diffNeedsRepaintLayer(const RenderStyle& other) const; 1787 bool diffNeedsRepaintLayer(const RenderStyle& other) const;
1786 bool diffNeedsRepaintObject(const RenderStyle& other) const; 1788 bool diffNeedsRepaintObject(const RenderStyle& other) const;
1787 bool diffNeedsRecompositeLayer(const RenderStyle& other) const; 1789 bool diffNeedsRecompositeLayer(const RenderStyle& other) const;
1788 unsigned computeChangedContextSensitiveProperties(const RenderStyle& other, StyleDifference) const; 1790 unsigned computeChangedContextSensitiveProperties(const RenderStyle& other, StyleDifference) const;
1789 }; 1791 };
1790 1792
1791 // FIXME: Reduce/remove the dependency on zoom adjusted int values. 1793 // FIXME: Reduce/remove the dependency on zoom adjusted int values.
1792 // The float or LayoutUnit versions of layout values should be used. 1794 // The float or LayoutUnit versions of layout values should be used.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 inline bool RenderStyle::hasPseudoElementStyle() const 1880 inline bool RenderStyle::hasPseudoElementStyle() const
1879 { 1881 {
1880 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK; 1882 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK;
1881 } 1883 }
1882 1884
1883 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&); 1885 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect ::Radii&);
1884 1886
1885 } // namespace WebCore 1887 } // namespace WebCore
1886 1888
1887 #endif // RenderStyle_h 1889 #endif // RenderStyle_h
OLDNEW
« no previous file with comments | « Source/core/rendering/style/AppliedTextDecoration.cpp ('k') | Source/core/rendering/style/RenderStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698