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

Side by Side Diff: third_party/WebKit/Source/core/style/ComputedStyle.h

Issue 1328283005: Add support for multiple text decorations with same line positioning (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 5 years, 2 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 | Annotate | Revision Log
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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 struct InheritedFlags { 166 struct InheritedFlags {
167 bool operator==(const InheritedFlags& other) const 167 bool operator==(const InheritedFlags& other) const
168 { 168 {
169 return (_empty_cells == other._empty_cells) 169 return (_empty_cells == other._empty_cells)
170 && (_caption_side == other._caption_side) 170 && (_caption_side == other._caption_side)
171 && (_list_style_type == other._list_style_type) 171 && (_list_style_type == other._list_style_type)
172 && (_list_style_position == other._list_style_position) 172 && (_list_style_position == other._list_style_position)
173 && (_visibility == other._visibility) 173 && (_visibility == other._visibility)
174 && (_text_align == other._text_align) 174 && (_text_align == other._text_align)
175 && (_text_transform == other._text_transform) 175 && (_text_transform == other._text_transform)
176 && (m_textUnderline == other.m_textUnderline) 176 && (m_hasSimpleUnderline == other.m_hasSimpleUnderline)
177 && (_cursor_style == other._cursor_style) 177 && (_cursor_style == other._cursor_style)
178 && (_direction == other._direction) 178 && (_direction == other._direction)
179 && (_white_space == other._white_space) 179 && (_white_space == other._white_space)
180 && (_border_collapse == other._border_collapse) 180 && (_border_collapse == other._border_collapse)
181 && (_box_direction == other._box_direction) 181 && (_box_direction == other._box_direction)
182 && (m_rtlOrdering == other.m_rtlOrdering) 182 && (m_rtlOrdering == other.m_rtlOrdering)
183 && (m_printColorAdjust == other.m_printColorAdjust) 183 && (m_printColorAdjust == other.m_printColorAdjust)
184 && (_pointerEvents == other._pointerEvents) 184 && (_pointerEvents == other._pointerEvents)
185 && (_insideLink == other._insideLink) 185 && (_insideLink == other._insideLink)
186 && (m_writingMode == other.m_writingMode); 186 && (m_writingMode == other.m_writingMode);
187 } 187 }
188 188
189 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); } 189 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); }
190 190
191 unsigned _empty_cells : 1; // EEmptyCell 191 unsigned _empty_cells : 1; // EEmptyCell
192 unsigned _caption_side : 2; // ECaptionSide 192 unsigned _caption_side : 2; // ECaptionSide
193 unsigned _list_style_type : 7; // EListStyleType 193 unsigned _list_style_type : 7; // EListStyleType
194 unsigned _list_style_position : 1; // EListStylePosition 194 unsigned _list_style_position : 1; // EListStylePosition
195 unsigned _visibility : 2; // EVisibility 195 unsigned _visibility : 2; // EVisibility
196 unsigned _text_align : 4; // ETextAlign 196 unsigned _text_align : 4; // ETextAlign
197 unsigned _text_transform : 2; // ETextTransform 197 unsigned _text_transform : 2; // ETextTransform
198 unsigned m_textUnderline : 1; 198 unsigned m_hasSimpleUnderline : 1; // True if 'underline solid currentCo lor' is the only text decoration on this element
199 unsigned _cursor_style : 6; // ECursor 199 unsigned _cursor_style : 6; // ECursor
200 unsigned _direction : 1; // TextDirection 200 unsigned _direction : 1; // TextDirection
201 unsigned _white_space : 3; // EWhiteSpace 201 unsigned _white_space : 3; // EWhiteSpace
202 unsigned _border_collapse : 1; // EBorderCollapse 202 unsigned _border_collapse : 1; // EBorderCollapse
203 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module) 203 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module)
204 // 32 bits 204 // 32 bits
205 205
206 // non CSS2 inherited 206 // non CSS2 inherited
207 unsigned m_rtlOrdering : 1; // Order 207 unsigned m_rtlOrdering : 1; // Order
208 unsigned m_printColorAdjust : PrintColorAdjustBits; 208 unsigned m_printColorAdjust : PrintColorAdjustBits;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 protected: 292 protected:
293 void setBitDefaults() 293 void setBitDefaults()
294 { 294 {
295 inherited_flags._empty_cells = initialEmptyCells(); 295 inherited_flags._empty_cells = initialEmptyCells();
296 inherited_flags._caption_side = initialCaptionSide(); 296 inherited_flags._caption_side = initialCaptionSide();
297 inherited_flags._list_style_type = initialListStyleType(); 297 inherited_flags._list_style_type = initialListStyleType();
298 inherited_flags._list_style_position = initialListStylePosition(); 298 inherited_flags._list_style_position = initialListStylePosition();
299 inherited_flags._visibility = initialVisibility(); 299 inherited_flags._visibility = initialVisibility();
300 inherited_flags._text_align = initialTextAlign(); 300 inherited_flags._text_align = initialTextAlign();
301 inherited_flags._text_transform = initialTextTransform(); 301 inherited_flags._text_transform = initialTextTransform();
302 inherited_flags.m_textUnderline = false; 302 inherited_flags.m_hasSimpleUnderline = false;
303 inherited_flags._cursor_style = initialCursor(); 303 inherited_flags._cursor_style = initialCursor();
304 inherited_flags._direction = initialDirection(); 304 inherited_flags._direction = initialDirection();
305 inherited_flags._white_space = initialWhiteSpace(); 305 inherited_flags._white_space = initialWhiteSpace();
306 inherited_flags._border_collapse = initialBorderCollapse(); 306 inherited_flags._border_collapse = initialBorderCollapse();
307 inherited_flags.m_rtlOrdering = initialRTLOrdering(); 307 inherited_flags.m_rtlOrdering = initialRTLOrdering();
308 inherited_flags._box_direction = initialBoxDirection(); 308 inherited_flags._box_direction = initialBoxDirection();
309 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); 309 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
310 inherited_flags._pointerEvents = initialPointerEvents(); 310 inherited_flags._pointerEvents = initialPointerEvents();
311 inherited_flags._insideLink = NotInsideLink; 311 inherited_flags._insideLink = NotInsideLink;
312 inherited_flags.m_writingMode = initialWritingMode(); 312 inherited_flags.m_writingMode = initialWritingMode();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 const Length& textIndent() const { return rareInheritedData->indent; } 582 const Length& textIndent() const { return rareInheritedData->indent; }
583 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); } 583 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); }
584 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); } 584 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); }
585 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); } 585 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); }
586 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); } 586 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); }
587 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); } 587 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); }
588 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); } 588 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); }
589 TextDecoration textDecorationsInEffect() const; 589 TextDecoration textDecorationsInEffect() const;
590 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; 590 const Vector<AppliedTextDecoration>& appliedTextDecorations() const;
591 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); } 591 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); }
592 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } 592 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_hasSimpleUnderlinePosition); }
593 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); } 593 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); }
594 float wordSpacing() const; 594 float wordSpacing() const;
595 float letterSpacing() const; 595 float letterSpacing() const;
596 596
597 float zoom() const { return visual->m_zoom; } 597 float zoom() const { return visual->m_zoom; }
598 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } 598 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
599 599
600 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); } 600 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); }
601 bool isLeftToRightDirection() const { return direction() == LTR; } 601 bool isLeftToRightDirection() const { return direction() == LTR; }
602 bool selfOrAncestorHasDirAutoAttribute() const { return rareInheritedData->m _selfOrAncestorHasDirAutoAttribute; } 602 bool selfOrAncestorHasDirAutoAttribute() const { return rareInheritedData->m _selfOrAncestorHasDirAutoAttribute; }
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 void setTextAutosizingMultiplier(float); 1131 void setTextAutosizingMultiplier(float);
1132 1132
1133 void setColor(const Color&); 1133 void setColor(const Color&);
1134 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); } 1134 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); }
1135 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } 1135 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); }
1136 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } 1136 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); }
1137 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } 1137 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1138 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); } 1138 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); }
1139 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); } 1139 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); }
1140 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } 1140 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1141 void applyTextDecorations(); 1141 void applyTextDecorations(const ComputedStyle& parentStyle, bool overrideExi stingColors);
1142 void clearAppliedTextDecorations(); 1142 void clearAppliedTextDecorations();
1143 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); } 1143 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); }
1144 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); } 1144 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_hasSimpleUnderlinePosition, v); }
1145 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); } 1145 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); }
1146 void setDirection(TextDirection v) { inherited_flags._direction = v; } 1146 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1147 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(rareInheritedDat a, m_selfOrAncestorHasDirAutoAttribute, v); } 1147 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(rareInheritedDat a, m_selfOrAncestorHasDirAutoAttribute, v); }
1148 void setLineHeight(const Length& specifiedLineHeight); 1148 void setLineHeight(const Length& specifiedLineHeight);
1149 bool setZoom(float); 1149 bool setZoom(float);
1150 bool setEffectiveZoom(float); 1150 bool setEffectiveZoom(float);
1151 void clearMultiCol(); 1151 void clearMultiCol();
1152 1152
1153 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); } 1153 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima geRendering, v); }
1154 1154
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig in(transformOriginX(), v, transformOriginZ())); } 1376 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig in(transformOriginX(), v, transformOriginZ())); }
1377 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans formOriginX(), transformOriginY(), f)); } 1377 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans formOriginX(), transformOriginY(), f)); }
1378 void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInherited Data.access()->m_transform, m_origin, o); } 1378 void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInherited Data.access()->m_transform, m_origin, o); }
1379 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheri tedData.access()->m_transform.access()->m_translate = v; } 1379 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { rareNonInheri tedData.access()->m_transform.access()->m_translate = v; }
1380 void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedDat a.access()->m_transform.access()->m_rotate = v; } 1380 void setRotate(PassRefPtr<RotateTransformOperation> v) { rareNonInheritedDat a.access()->m_transform.access()->m_rotate = v; }
1381 void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData. access()->m_transform.access()->m_scale = v; } 1381 void setScale(PassRefPtr<ScaleTransformOperation> v) { rareNonInheritedData. access()->m_transform.access()->m_scale = v; }
1382 1382
1383 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } 1383 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
1384 void setTextCombine(TextCombine v) { SET_VAR(rareInheritedData, m_textCombin e, v); } 1384 void setTextCombine(TextCombine v) { SET_VAR(rareInheritedData, m_textCombin e, v); }
1385 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedD ata, m_textDecorationColor, c); } 1385 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedD ata, m_textDecorationColor, c); }
1386
1386 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInh eritedData, textEmphasisColor, setTextEmphasisColor, c); } 1387 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInh eritedData, textEmphasisColor, setTextEmphasisColor, c); }
1387 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); } 1388 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
1388 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); } 1389 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
1389 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInher itedData, textEmphasisCustomMark, mark); } 1390 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInher itedData, textEmphasisCustomMark, mark); }
1390 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareIn heritedData, textEmphasisPosition, position); } 1391 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareIn heritedData, textEmphasisPosition, position); }
1391 bool setTextOrientation(TextOrientation); 1392 bool setTextOrientation(TextOrientation);
1392 1393
1393 void setMotionPath(PassRefPtr<StyleMotionPath>); 1394 void setMotionPath(PassRefPtr<StyleMotionPath>);
1394 void resetMotionPath(); 1395 void resetMotionPath();
1395 void setMotionOffset(const Length& motionOffset) { SET_VAR(rareNonInheritedD ata.access()->m_transform, m_motion.m_offset, motionOffset); } 1396 void setMotionOffset(const Length& motionOffset) { SET_VAR(rareNonInheritedD ata.access()->m_transform, m_motion.m_offset, motionOffset); }
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 1856
1856 StyleColor decorationColorIncludingFallback(bool visitedLink) const; 1857 StyleColor decorationColorIncludingFallback(bool visitedLink) const;
1857 Color colorIncludingFallback(int colorProperty, bool visitedLink) const; 1858 Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
1858 1859
1859 Color stopColor() const { return svgStyle().stopColor(); } 1860 Color stopColor() const { return svgStyle().stopColor(); }
1860 Color floodColor() const { return svgStyle().floodColor(); } 1861 Color floodColor() const { return svgStyle().floodColor(); }
1861 Color lightingColor() const { return svgStyle().lightingColor(); } 1862 Color lightingColor() const { return svgStyle().lightingColor(); }
1862 1863
1863 void appendContent(PassOwnPtrWillBeRawPtr<ContentData>); 1864 void appendContent(PassOwnPtrWillBeRawPtr<ContentData>);
1864 void addAppliedTextDecoration(const AppliedTextDecoration&); 1865 void addAppliedTextDecoration(const AppliedTextDecoration&);
1866 void updateAppliedTextDecorations(Color propagatedColor);
1865 void applyMotionPathTransform(float originX, float originY, TransformationMa trix&) const; 1867 void applyMotionPathTransform(float originX, float originY, TransformationMa trix&) const;
1866 1868
1867 bool diffNeedsFullLayoutAndPaintInvalidation(const ComputedStyle& other) con st; 1869 bool diffNeedsFullLayoutAndPaintInvalidation(const ComputedStyle& other) con st;
1868 bool diffNeedsFullLayout(const ComputedStyle& other) const; 1870 bool diffNeedsFullLayout(const ComputedStyle& other) const;
1869 bool diffNeedsPaintInvalidationLayer(const ComputedStyle& other) const; 1871 bool diffNeedsPaintInvalidationLayer(const ComputedStyle& other) const;
1870 bool diffNeedsPaintInvalidationObject(const ComputedStyle& other) const; 1872 bool diffNeedsPaintInvalidationObject(const ComputedStyle& other) const;
1871 void updatePropertySpecificDifferences(const ComputedStyle& other, StyleDiff erence&) const; 1873 void updatePropertySpecificDifferences(const ComputedStyle& other, StyleDiff erence&) const;
1872 1874
1873 bool requireTransformOrigin(ApplyTransformOrigin applyOrigin, ApplyMotionPat h) const; 1875 bool requireTransformOrigin(ApplyTransformOrigin applyOrigin, ApplyMotionPat h) const;
1874 }; 1876 };
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 } 1981 }
1980 1982
1981 inline bool ComputedStyle::hasPseudoElementStyle() const 1983 inline bool ComputedStyle::hasPseudoElementStyle() const
1982 { 1984 {
1983 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; 1985 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK;
1984 } 1986 }
1985 1987
1986 } // namespace blink 1988 } // namespace blink
1987 1989
1988 #endif // ComputedStyle_h 1990 #endif // ComputedStyle_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698