Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 157 struct InheritedFlags { | 157 struct InheritedFlags { |
| 158 bool operator==(const InheritedFlags& other) const | 158 bool operator==(const InheritedFlags& other) const |
| 159 { | 159 { |
| 160 return (_empty_cells == other._empty_cells) | 160 return (_empty_cells == other._empty_cells) |
| 161 && (_caption_side == other._caption_side) | 161 && (_caption_side == other._caption_side) |
| 162 && (_list_style_type == other._list_style_type) | 162 && (_list_style_type == other._list_style_type) |
| 163 && (_list_style_position == other._list_style_position) | 163 && (_list_style_position == other._list_style_position) |
| 164 && (_visibility == other._visibility) | 164 && (_visibility == other._visibility) |
| 165 && (_text_align == other._text_align) | 165 && (_text_align == other._text_align) |
| 166 && (_text_transform == other._text_transform) | 166 && (_text_transform == other._text_transform) |
| 167 && (m_textUnderline == other.m_textUnderline) | |
| 168 && (_cursor_style == other._cursor_style) | 167 && (_cursor_style == other._cursor_style) |
| 169 && (_direction == other._direction) | 168 && (_direction == other._direction) |
| 170 && (_white_space == other._white_space) | 169 && (_white_space == other._white_space) |
| 171 && (_border_collapse == other._border_collapse) | 170 && (_border_collapse == other._border_collapse) |
| 172 && (_box_direction == other._box_direction) | 171 && (_box_direction == other._box_direction) |
| 173 && (m_rtlOrdering == other.m_rtlOrdering) | 172 && (m_rtlOrdering == other.m_rtlOrdering) |
| 174 && (m_printColorAdjust == other.m_printColorAdjust) | 173 && (m_printColorAdjust == other.m_printColorAdjust) |
| 175 && (_pointerEvents == other._pointerEvents) | 174 && (_pointerEvents == other._pointerEvents) |
| 176 && (_insideLink == other._insideLink) | 175 && (_insideLink == other._insideLink) |
| 177 && (m_writingMode == other.m_writingMode); | 176 && (m_writingMode == other.m_writingMode); |
| 178 } | 177 } |
| 179 | 178 |
| 180 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); } | 179 bool operator!=(const InheritedFlags& other) const { return !(*this == o ther); } |
| 181 | 180 |
| 182 unsigned _empty_cells : 1; // EEmptyCell | 181 unsigned _empty_cells : 1; // EEmptyCell |
| 183 unsigned _caption_side : 2; // ECaptionSide | 182 unsigned _caption_side : 2; // ECaptionSide |
| 184 unsigned _list_style_type : 7; // EListStyleType | 183 unsigned _list_style_type : 7; // EListStyleType |
| 185 unsigned _list_style_position : 1; // EListStylePosition | 184 unsigned _list_style_position : 1; // EListStylePosition |
| 186 unsigned _visibility : 2; // EVisibility | 185 unsigned _visibility : 2; // EVisibility |
| 187 unsigned _text_align : 4; // ETextAlign | 186 unsigned _text_align : 4; // ETextAlign |
| 188 unsigned _text_transform : 2; // ETextTransform | 187 unsigned _text_transform : 2; // ETextTransform |
| 189 unsigned m_textUnderline : 1; | |
| 190 unsigned _cursor_style : 6; // ECursor | 188 unsigned _cursor_style : 6; // ECursor |
| 191 unsigned _direction : 1; // TextDirection | 189 unsigned _direction : 1; // TextDirection |
| 192 unsigned _white_space : 3; // EWhiteSpace | 190 unsigned _white_space : 3; // EWhiteSpace |
| 193 unsigned _border_collapse : 1; // EBorderCollapse | 191 unsigned _border_collapse : 1; // EBorderCollapse |
| 194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module) | 192 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper ty, flexible box layout module) |
| 195 // 32 bits | 193 // 32 bits |
| 196 | 194 |
| 197 // non CSS2 inherited | 195 // non CSS2 inherited |
| 198 unsigned m_rtlOrdering : 1; // Order | 196 unsigned m_rtlOrdering : 1; // Order |
| 199 unsigned m_printColorAdjust : PrintColorAdjustBits; | 197 unsigned m_printColorAdjust : PrintColorAdjustBits; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 281 protected: | 279 protected: |
| 282 void setBitDefaults() | 280 void setBitDefaults() |
| 283 { | 281 { |
| 284 inherited_flags._empty_cells = initialEmptyCells(); | 282 inherited_flags._empty_cells = initialEmptyCells(); |
| 285 inherited_flags._caption_side = initialCaptionSide(); | 283 inherited_flags._caption_side = initialCaptionSide(); |
| 286 inherited_flags._list_style_type = initialListStyleType(); | 284 inherited_flags._list_style_type = initialListStyleType(); |
| 287 inherited_flags._list_style_position = initialListStylePosition(); | 285 inherited_flags._list_style_position = initialListStylePosition(); |
| 288 inherited_flags._visibility = initialVisibility(); | 286 inherited_flags._visibility = initialVisibility(); |
| 289 inherited_flags._text_align = initialTextAlign(); | 287 inherited_flags._text_align = initialTextAlign(); |
| 290 inherited_flags._text_transform = initialTextTransform(); | 288 inherited_flags._text_transform = initialTextTransform(); |
| 291 inherited_flags.m_textUnderline = false; | |
| 292 inherited_flags._cursor_style = initialCursor(); | 289 inherited_flags._cursor_style = initialCursor(); |
| 293 inherited_flags._direction = initialDirection(); | 290 inherited_flags._direction = initialDirection(); |
| 294 inherited_flags._white_space = initialWhiteSpace(); | 291 inherited_flags._white_space = initialWhiteSpace(); |
| 295 inherited_flags._border_collapse = initialBorderCollapse(); | 292 inherited_flags._border_collapse = initialBorderCollapse(); |
| 296 inherited_flags.m_rtlOrdering = initialRTLOrdering(); | 293 inherited_flags.m_rtlOrdering = initialRTLOrdering(); |
| 297 inherited_flags._box_direction = initialBoxDirection(); | 294 inherited_flags._box_direction = initialBoxDirection(); |
| 298 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); | 295 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); |
| 299 inherited_flags._pointerEvents = initialPointerEvents(); | 296 inherited_flags._pointerEvents = initialPointerEvents(); |
| 300 inherited_flags._insideLink = NotInsideLink; | 297 inherited_flags._insideLink = NotInsideLink; |
| 301 inherited_flags.m_writingMode = initialWritingMode(); | 298 inherited_flags.m_writingMode = initialWritingMode(); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 const Length& textIndent() const { return rareInheritedData->indent; } | 564 const Length& textIndent() const { return rareInheritedData->indent; } |
| 568 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); } | 565 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r areInheritedData->m_textIndentLine); } |
| 569 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); } | 566 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r areInheritedData->m_textIndentType); } |
| 570 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); } | 567 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag s._text_align); } |
| 571 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); } | 568 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare InheritedData->m_textAlignLast); } |
| 572 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); } | 569 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri tedData->m_textJustify); } |
| 573 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); } | 570 ETextTransform textTransform() const { return static_cast<ETextTransform>(in herited_flags._text_transform); } |
| 574 TextDecoration textDecorationsInEffect() const; | 571 TextDecoration textDecorationsInEffect() const; |
| 575 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; | 572 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; |
| 576 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); } | 573 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v isual->textDecoration); } |
| 574 bool isSimpleUnderlineDecoration() const { return visual->textDecoration & T extDecorationUnderline; } | |
|
wkorman
2015/07/01 15:16:14
Suggest adding comment explaining more on what sim
| |
| 577 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } | 575 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } |
| 578 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); } | 576 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec orationStyle>(rareNonInheritedData->m_textDecorationStyle); } |
| 579 float wordSpacing() const; | 577 float wordSpacing() const; |
| 580 float letterSpacing() const; | 578 float letterSpacing() const; |
| 581 | 579 |
| 582 float zoom() const { return visual->m_zoom; } | 580 float zoom() const { return visual->m_zoom; } |
| 583 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } | 581 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } |
| 584 | 582 |
| 585 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); } | 583 TextDirection direction() const { return static_cast<TextDirection>(inherite d_flags._direction); } |
| 586 bool isLeftToRightDirection() const { return direction() == LTR; } | 584 bool isLeftToRightDirection() const { return direction() == LTR; } |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1089 void setTextAutosizingMultiplier(float); | 1087 void setTextAutosizingMultiplier(float); |
| 1090 | 1088 |
| 1091 void setColor(const Color&); | 1089 void setColor(const Color&); |
| 1092 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); } | 1090 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v); } |
| 1093 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } | 1091 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text IndentLine, v); } |
| 1094 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } | 1092 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text IndentType, v); } |
| 1095 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } | 1093 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } |
| 1096 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); } | 1094 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl ignLast, v); } |
| 1097 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); } | 1095 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif y, v); } |
| 1098 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } | 1096 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; } |
| 1099 void applyTextDecorations(); | 1097 void applyTextDecorations(const ComputedStyle& parentStyle); |
| 1100 void clearAppliedTextDecorations(); | 1098 void clearAppliedTextDecorations(); |
| 1101 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); } | 1099 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v ); } |
| 1102 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); } | 1100 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit edData, m_textUnderlinePosition, v); } |
| 1103 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); } | 1101 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite dData, m_textDecorationStyle, v); } |
| 1104 void setDirection(TextDirection v) { inherited_flags._direction = v; } | 1102 void setDirection(TextDirection v) { inherited_flags._direction = v; } |
| 1105 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(rareInheritedDat a, m_selfOrAncestorHasDirAutoAttribute, v); } | 1103 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(rareInheritedDat a, m_selfOrAncestorHasDirAutoAttribute, v); } |
| 1106 void setLineHeight(const Length& specifiedLineHeight); | 1104 void setLineHeight(const Length& specifiedLineHeight); |
| 1107 bool setZoom(float); | 1105 bool setZoom(float); |
| 1108 bool setEffectiveZoom(float); | 1106 bool setEffectiveZoom(float); |
| 1109 void clearMultiCol(); | 1107 void clearMultiCol(); |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1876 } | 1874 } |
| 1877 | 1875 |
| 1878 inline bool ComputedStyle::hasPseudoElementStyle() const | 1876 inline bool ComputedStyle::hasPseudoElementStyle() const |
| 1879 { | 1877 { |
| 1880 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; | 1878 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; |
| 1881 } | 1879 } |
| 1882 | 1880 |
| 1883 } // namespace blink | 1881 } // namespace blink |
| 1884 | 1882 |
| 1885 #endif // ComputedStyle_h | 1883 #endif // ComputedStyle_h |
| OLD | NEW |