• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3  *           (C) 2000 Antti Koivisto (koivisto@kde.org)
4  *           (C) 2000 Dirk Mueller (mueller@kde.org)
5  * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6  * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  */
24 
25 #ifndef RenderStyle_h
26 #define RenderStyle_h
27 
28 #include "TransformationMatrix.h"
29 #include "AnimationList.h"
30 #include "BorderData.h"
31 #include "BorderValue.h"
32 #include "CSSHelper.h"
33 #include "CSSImageGeneratorValue.h"
34 #include "CSSPrimitiveValue.h"
35 #include "CSSReflectionDirection.h"
36 #include "CSSValueList.h"
37 #include "CachedImage.h"
38 #include "CollapsedBorderValue.h"
39 #include "Color.h"
40 #include "ColorSpace.h"
41 #include "ContentData.h"
42 #include "CounterDirectives.h"
43 #include "CursorList.h"
44 #include "DataRef.h"
45 #include "FillLayer.h"
46 #include "FloatPoint.h"
47 #include "Font.h"
48 #include "GraphicsTypes.h"
49 #include "IntRect.h"
50 #include "Length.h"
51 #include "LengthBox.h"
52 #include "LengthSize.h"
53 #include "LineClampValue.h"
54 #include "NinePieceImage.h"
55 #include "OutlineValue.h"
56 #include "Pair.h"
57 #include "RenderStyleConstants.h"
58 #include "ShadowData.h"
59 #include "StyleBackgroundData.h"
60 #include "StyleBoxData.h"
61 #include "StyleFlexibleBoxData.h"
62 #include "StyleInheritedData.h"
63 #include "StyleMarqueeData.h"
64 #include "StyleMultiColData.h"
65 #include "StyleRareInheritedData.h"
66 #include "StyleRareNonInheritedData.h"
67 #include "StyleReflection.h"
68 #include "StyleSurroundData.h"
69 #include "StyleTransformData.h"
70 #include "StyleVisualData.h"
71 #include "TextDirection.h"
72 #include "ThemeTypes.h"
73 #include "TimingFunction.h"
74 #include "TransformOperations.h"
75 #include <wtf/OwnPtr.h>
76 #include <wtf/RefCounted.h>
77 #include <wtf/StdLibExtras.h>
78 #include <wtf/Vector.h>
79 
80 #if ENABLE(DASHBOARD_SUPPORT)
81 #include "StyleDashboardRegion.h"
82 #endif
83 
84 #if ENABLE(SVG)
85 #include "SVGRenderStyle.h"
86 #endif
87 
88 #if ENABLE(XBL)
89 #include "BindingURI.h"
90 #endif
91 
92 #if COMPILER(WINSCW)
93 #define compareEqual(t, u)      ((t) == (u))
94 #else
compareEqual(const T & t,const U & u)95 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
96 #endif
97 
98 #define SET_VAR(group, variable, value) \
99     if (!compareEqual(group->variable, value)) \
100         group.access()->variable = value;
101 
102 namespace WebCore {
103 
104 using std::max;
105 
106 class CSSStyleSelector;
107 class CSSValueList;
108 class CachedImage;
109 class Pair;
110 class StringImpl;
111 class StyleImage;
112 
113 class RenderStyle: public RefCounted<RenderStyle> {
114     friend class CSSStyleSelector;
115 protected:
116 
117     // The following bitfield is 32-bits long, which optimizes padding with the
118     // int refCount in the base class. Beware when adding more bits.
119     unsigned m_pseudoState : 3; // PseudoState
120     bool m_affectedByAttributeSelectors : 1;
121     bool m_unique : 1;
122 
123     // Bits for dynamic child matching.
124     bool m_affectedByEmpty : 1;
125     bool m_emptyState : 1;
126 
127     // We optimize for :first-child and :last-child.  The other positional child selectors like nth-child or
128     // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
129     bool m_childrenAffectedByFirstChildRules : 1;
130     bool m_childrenAffectedByLastChildRules : 1;
131     bool m_childrenAffectedByDirectAdjacentRules : 1;
132     bool m_childrenAffectedByForwardPositionalRules : 1;
133     bool m_childrenAffectedByBackwardPositionalRules : 1;
134     bool m_firstChildState : 1;
135     bool m_lastChildState : 1;
136     unsigned m_childIndex : 18; // Plenty of bits to cache an index.
137 
138     // non-inherited attributes
139     DataRef<StyleBoxData> box;
140     DataRef<StyleVisualData> visual;
141     DataRef<StyleBackgroundData> background;
142     DataRef<StyleSurroundData> surround;
143     DataRef<StyleRareNonInheritedData> rareNonInheritedData;
144 
145     // inherited attributes
146     DataRef<StyleRareInheritedData> rareInheritedData;
147     DataRef<StyleInheritedData> inherited;
148 
149     // list of associated pseudo styles
150     RefPtr<RenderStyle> m_cachedPseudoStyle;
151 
152 #if ENABLE(SVG)
153     DataRef<SVGRenderStyle> m_svgStyle;
154 #endif
155 
156 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp
157 
158     // inherit
159     struct InheritedFlags {
160         bool operator==(const InheritedFlags& other) const
161         {
162             return (_empty_cells == other._empty_cells) &&
163                    (_caption_side == other._caption_side) &&
164                    (_list_style_type == other._list_style_type) &&
165                    (_list_style_position == other._list_style_position) &&
166                    (_visibility == other._visibility) &&
167                    (_text_align == other._text_align) &&
168                    (_text_transform == other._text_transform) &&
169                    (_text_decorations == other._text_decorations) &&
170                    (_text_transform == other._text_transform) &&
171                    (_cursor_style == other._cursor_style) &&
172                    (_direction == other._direction) &&
173                    (_border_collapse == other._border_collapse) &&
174                    (_white_space == other._white_space) &&
175                    (_box_direction == other._box_direction) &&
176                    (_visuallyOrdered == other._visuallyOrdered) &&
177                    (_htmlHacks == other._htmlHacks) &&
178                    (_force_backgrounds_to_white == other._force_backgrounds_to_white) &&
179                    (_pointerEvents == other._pointerEvents);
180         }
181 
182         bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
183 
184         unsigned _empty_cells : 1; // EEmptyCell
185         unsigned _caption_side : 2; // ECaptionSide
186         unsigned _list_style_type : 7; // EListStyleType
187         unsigned _list_style_position : 1; // EListStylePosition
188         unsigned _visibility : 2; // EVisibility
189         unsigned _text_align : 3; // ETextAlign
190         unsigned _text_transform : 2; // ETextTransform
191         unsigned _text_decorations : 4;
192         unsigned _cursor_style : 6; // ECursor
193         unsigned _direction : 1; // TextDirection
194         bool _border_collapse : 1 ;
195         unsigned _white_space : 3; // EWhiteSpace
196         unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
197         // 34 bits
198 
199         // non CSS2 inherited
200         bool _visuallyOrdered : 1;
201         bool _htmlHacks : 1;
202         bool _force_backgrounds_to_white : 1;
203         unsigned _pointerEvents : 4; // EPointerEvents
204         // 41 bits
205     } inherited_flags;
206 
207 // don't inherit
208     struct NonInheritedFlags {
209         bool operator==(const NonInheritedFlags& other) const
210         {
211             return _effectiveDisplay == other._effectiveDisplay
212                 && _originalDisplay == other._originalDisplay
213                 && _overflowX == other._overflowX
214                 && _overflowY == other._overflowY
215                 && _vertical_align == other._vertical_align
216                 && _clear == other._clear
217                 && _position == other._position
218                 && _floating == other._floating
219                 && _table_layout == other._table_layout
220                 && _page_break_before == other._page_break_before
221                 && _page_break_after == other._page_break_after
222                 && _page_break_inside == other._page_break_inside
223                 && _styleType == other._styleType
224                 && _affectedByHover == other._affectedByHover
225                 && _affectedByActive == other._affectedByActive
226                 && _affectedByDrag == other._affectedByDrag
227                 && _pseudoBits == other._pseudoBits
228                 && _unicodeBidi == other._unicodeBidi;
229         }
230 
231         bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
232 
233         unsigned _effectiveDisplay : 5; // EDisplay
234         unsigned _originalDisplay : 5; // EDisplay
235         unsigned _overflowX : 3; // EOverflow
236         unsigned _overflowY : 3; // EOverflow
237         unsigned _vertical_align : 4; // EVerticalAlign
238         unsigned _clear : 2; // EClear
239         unsigned _position : 2; // EPosition
240         unsigned _floating : 2; // EFloat
241         unsigned _table_layout : 1; // ETableLayout
242 
243         unsigned _page_break_before : 2; // EPageBreak
244         unsigned _page_break_after : 2; // EPageBreak
245         unsigned _page_break_inside : 2; // EPageBreak
246 
247         unsigned _styleType : 5; // PseudoId
248         bool _affectedByHover : 1;
249         bool _affectedByActive : 1;
250         bool _affectedByDrag : 1;
251         unsigned _pseudoBits : 7;
252         unsigned _unicodeBidi : 2; // EUnicodeBidi
253         // 50 bits
254     } noninherited_flags;
255 
256 // !END SYNC!
257 
258 protected:
setBitDefaults()259     void setBitDefaults()
260     {
261         inherited_flags._empty_cells = initialEmptyCells();
262         inherited_flags._caption_side = initialCaptionSide();
263         inherited_flags._list_style_type = initialListStyleType();
264         inherited_flags._list_style_position = initialListStylePosition();
265         inherited_flags._visibility = initialVisibility();
266         inherited_flags._text_align = initialTextAlign();
267         inherited_flags._text_transform = initialTextTransform();
268         inherited_flags._text_decorations = initialTextDecoration();
269         inherited_flags._cursor_style = initialCursor();
270         inherited_flags._direction = initialDirection();
271         inherited_flags._border_collapse = initialBorderCollapse();
272         inherited_flags._white_space = initialWhiteSpace();
273         inherited_flags._visuallyOrdered = initialVisuallyOrdered();
274         inherited_flags._htmlHacks=false;
275         inherited_flags._box_direction = initialBoxDirection();
276         inherited_flags._force_backgrounds_to_white = false;
277         inherited_flags._pointerEvents = initialPointerEvents();
278 
279         noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
280         noninherited_flags._overflowX = initialOverflowX();
281         noninherited_flags._overflowY = initialOverflowY();
282         noninherited_flags._vertical_align = initialVerticalAlign();
283         noninherited_flags._clear = initialClear();
284         noninherited_flags._position = initialPosition();
285         noninherited_flags._floating = initialFloating();
286         noninherited_flags._table_layout = initialTableLayout();
287         noninherited_flags._page_break_before = initialPageBreak();
288         noninherited_flags._page_break_after = initialPageBreak();
289         noninherited_flags._page_break_inside = initialPageBreak();
290         noninherited_flags._styleType = NOPSEUDO;
291         noninherited_flags._affectedByHover = false;
292         noninherited_flags._affectedByActive = false;
293         noninherited_flags._affectedByDrag = false;
294         noninherited_flags._pseudoBits = 0;
295         noninherited_flags._unicodeBidi = initialUnicodeBidi();
296     }
297 
298 protected:
299     RenderStyle();
300     // used to create the default style.
301     RenderStyle(bool);
302     RenderStyle(const RenderStyle&);
303 
304 public:
305     static PassRefPtr<RenderStyle> create();
306     static PassRefPtr<RenderStyle> createDefaultStyle();
307     static PassRefPtr<RenderStyle> clone(const RenderStyle*);
308 
309     ~RenderStyle();
310 
311     void inheritFrom(const RenderStyle* inheritParent);
312 
styleType()313     PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags._styleType); }
setStyleType(PseudoId styleType)314     void setStyleType(PseudoId styleType) { noninherited_flags._styleType = styleType; }
315 
316     RenderStyle* getCachedPseudoStyle(PseudoId) const;
317     RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
318 
319     typedef Vector<RenderStyle*, 10> PseudoStyleCache;
320     void getPseudoStyleCache(PseudoStyleCache&) const;
321 
affectedByHoverRules()322     bool affectedByHoverRules() const { return noninherited_flags._affectedByHover; }
affectedByActiveRules()323     bool affectedByActiveRules() const { return noninherited_flags._affectedByActive; }
affectedByDragRules()324     bool affectedByDragRules() const { return noninherited_flags._affectedByDrag; }
325 
setAffectedByHoverRules(bool b)326     void setAffectedByHoverRules(bool b) { noninherited_flags._affectedByHover = b; }
setAffectedByActiveRules(bool b)327     void setAffectedByActiveRules(bool b) { noninherited_flags._affectedByActive = b; }
setAffectedByDragRules(bool b)328     void setAffectedByDragRules(bool b) { noninherited_flags._affectedByDrag = b; }
329 
330     bool operator==(const RenderStyle& other) const;
331     bool operator!=(const RenderStyle& other) const { return !(*this == other); }
isFloating()332     bool isFloating() const { return !(noninherited_flags._floating == FNONE); }
hasMargin()333     bool hasMargin() const { return surround->margin.nonZero(); }
hasBorder()334     bool hasBorder() const { return surround->border.hasBorder(); }
hasPadding()335     bool hasPadding() const { return surround->padding.nonZero(); }
hasOffset()336     bool hasOffset() const { return surround->offset.nonZero(); }
337 
hasBackground()338     bool hasBackground() const
339     {
340         if (backgroundColor().isValid() && backgroundColor().alpha() > 0)
341             return true;
342         return background->m_background.hasImage();
343     }
hasBackgroundImage()344     bool hasBackgroundImage() const { return background->m_background.hasImage(); }
hasFixedBackgroundImage()345     bool hasFixedBackgroundImage() const { return background->m_background.hasFixedImage(); }
hasAppearance()346     bool hasAppearance() const { return appearance() != NoControlPart; }
347 
visuallyOrdered()348     bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
setVisuallyOrdered(bool b)349     void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }
350 
351     bool isStyleAvailable() const;
352 
353     bool hasPseudoStyle(PseudoId pseudo) const;
354     void setHasPseudoStyle(PseudoId pseudo);
355 
356     // attribute getter methods
357 
display()358     EDisplay display() const { return static_cast<EDisplay>(noninherited_flags._effectiveDisplay); }
originalDisplay()359     EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags._originalDisplay); }
360 
left()361     Length left() const { return surround->offset.left(); }
right()362     Length right() const { return surround->offset.right(); }
top()363     Length top() const { return surround->offset.top(); }
bottom()364     Length bottom() const { return surround->offset.bottom(); }
365 
366     // Whether or not a positioned element requires normal flow x/y to be computed
367     // to determine its position.
hasStaticX()368     bool hasStaticX() const { return (left().isAuto() && right().isAuto()) || left().isStatic() || right().isStatic(); }
hasStaticY()369     bool hasStaticY() const { return (top().isAuto() && bottom().isAuto()) || top().isStatic(); }
370 
position()371     EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
floating()372     EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
373 
width()374     Length width() const { return box->width; }
height()375     Length height() const { return box->height; }
minWidth()376     Length minWidth() const { return box->min_width; }
maxWidth()377     Length maxWidth() const { return box->max_width; }
minHeight()378     Length minHeight() const { return box->min_height; }
maxHeight()379     Length maxHeight() const { return box->max_height; }
380 
border()381     const BorderData& border() const { return surround->border; }
borderLeft()382     const BorderValue& borderLeft() const { return surround->border.left; }
borderRight()383     const BorderValue& borderRight() const { return surround->border.right; }
borderTop()384     const BorderValue& borderTop() const { return surround->border.top; }
borderBottom()385     const BorderValue& borderBottom() const { return surround->border.bottom; }
386 
borderImage()387     const NinePieceImage& borderImage() const { return surround->border.image; }
388 
borderTopLeftRadius()389     const IntSize& borderTopLeftRadius() const { return surround->border.topLeft; }
borderTopRightRadius()390     const IntSize& borderTopRightRadius() const { return surround->border.topRight; }
borderBottomLeftRadius()391     const IntSize& borderBottomLeftRadius() const { return surround->border.bottomLeft; }
borderBottomRightRadius()392     const IntSize& borderBottomRightRadius() const { return surround->border.bottomRight; }
hasBorderRadius()393     bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
394 
borderLeftWidth()395     unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }
borderLeftStyle()396     EBorderStyle borderLeftStyle() const { return surround->border.left.style(); }
borderLeftColor()397     const Color& borderLeftColor() const { return surround->border.left.color; }
borderLeftIsTransparent()398     bool borderLeftIsTransparent() const { return surround->border.left.isTransparent(); }
borderRightWidth()399     unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); }
borderRightStyle()400     EBorderStyle borderRightStyle() const { return surround->border.right.style(); }
borderRightColor()401     const Color& borderRightColor() const { return surround->border.right.color; }
borderRightIsTransparent()402     bool borderRightIsTransparent() const { return surround->border.right.isTransparent(); }
borderTopWidth()403     unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); }
borderTopStyle()404     EBorderStyle borderTopStyle() const { return surround->border.top.style(); }
borderTopColor()405     const Color& borderTopColor() const { return surround->border.top.color; }
borderTopIsTransparent()406     bool borderTopIsTransparent() const { return surround->border.top.isTransparent(); }
borderBottomWidth()407     unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
borderBottomStyle()408     EBorderStyle borderBottomStyle() const { return surround->border.bottom.style(); }
borderBottomColor()409     const Color& borderBottomColor() const { return surround->border.bottom.color; }
borderBottomIsTransparent()410     bool borderBottomIsTransparent() const { return surround->border.bottom.isTransparent(); }
411 
outlineSize()412     unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
outlineWidth()413     unsigned short outlineWidth() const
414     {
415         if (background->m_outline.style() == BNONE)
416             return 0;
417         return background->m_outline.width;
418     }
hasOutline()419     bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
outlineStyle()420     EBorderStyle outlineStyle() const { return background->m_outline.style(); }
outlineStyleIsAuto()421     bool outlineStyleIsAuto() const { return background->m_outline._auto; }
outlineColor()422     const Color& outlineColor() const { return background->m_outline.color; }
423 
overflowX()424     EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
overflowY()425     EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
426 
visibility()427     EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
verticalAlign()428     EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
verticalAlignLength()429     Length verticalAlignLength() const { return box->vertical_align; }
430 
clipLeft()431     Length clipLeft() const { return visual->clip.left(); }
clipRight()432     Length clipRight() const { return visual->clip.right(); }
clipTop()433     Length clipTop() const { return visual->clip.top(); }
clipBottom()434     Length clipBottom() const { return visual->clip.bottom(); }
clip()435     LengthBox clip() const { return visual->clip; }
hasClip()436     bool hasClip() const { return visual->hasClip; }
437 
unicodeBidi()438     EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags._unicodeBidi); }
439 
clear()440     EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
tableLayout()441     ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
442 
font()443     const Font& font() const { return inherited->font; }
fontDescription()444     const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
fontSize()445     int fontSize() const { return inherited->font.pixelSize(); }
446 
color()447     const Color& color() const { return inherited->color; }
textIndent()448     Length textIndent() const { return inherited->indent; }
textAlign()449     ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
textTransform()450     ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
textDecorationsInEffect()451     int textDecorationsInEffect() const { return inherited_flags._text_decorations; }
textDecoration()452     int textDecoration() const { return visual->textDecoration; }
wordSpacing()453     int wordSpacing() const { return inherited->font.wordSpacing(); }
letterSpacing()454     int letterSpacing() const { return inherited->font.letterSpacing(); }
455 
zoom()456     float zoom() const { return visual->m_zoom; }
effectiveZoom()457     float effectiveZoom() const { return inherited->m_effectiveZoom; }
458 
direction()459     TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
lineHeight()460     Length lineHeight() const { return inherited->line_height; }
computedLineHeight()461     int computedLineHeight() const
462     {
463         Length lh = lineHeight();
464 
465         // Negative value means the line height is not set.  Use the font's built-in spacing.
466         if (lh.isNegative())
467             return font().lineSpacing();
468 
469         if (lh.isPercent())
470             return lh.calcMinValue(fontSize());
471 
472         return lh.value();
473     }
474 
whiteSpace()475     EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
autoWrap(EWhiteSpace ws)476     static bool autoWrap(EWhiteSpace ws)
477     {
478         // Nowrap and pre don't automatically wrap.
479         return ws != NOWRAP && ws != PRE;
480     }
481 
autoWrap()482     bool autoWrap() const
483     {
484         return autoWrap(whiteSpace());
485     }
486 
preserveNewline(EWhiteSpace ws)487     static bool preserveNewline(EWhiteSpace ws)
488     {
489         // Normal and nowrap do not preserve newlines.
490         return ws != NORMAL && ws != NOWRAP;
491     }
492 
preserveNewline()493     bool preserveNewline() const
494     {
495         return preserveNewline(whiteSpace());
496     }
497 
collapseWhiteSpace(EWhiteSpace ws)498     static bool collapseWhiteSpace(EWhiteSpace ws)
499     {
500         // Pre and prewrap do not collapse whitespace.
501         return ws != PRE && ws != PRE_WRAP;
502     }
503 
collapseWhiteSpace()504     bool collapseWhiteSpace() const
505     {
506         return collapseWhiteSpace(whiteSpace());
507     }
508 
isCollapsibleWhiteSpace(UChar c)509     bool isCollapsibleWhiteSpace(UChar c) const
510     {
511         switch (c) {
512             case ' ':
513             case '\t':
514                 return collapseWhiteSpace();
515             case '\n':
516                 return !preserveNewline();
517         }
518         return false;
519     }
520 
breakOnlyAfterWhiteSpace()521     bool breakOnlyAfterWhiteSpace() const
522     {
523         return whiteSpace() == PRE_WRAP || khtmlLineBreak() == AFTER_WHITE_SPACE;
524     }
525 
breakWords()526     bool breakWords() const
527     {
528         return wordBreak() == BreakWordBreak || wordWrap() == BreakWordWrap;
529     }
530 
backgroundColor()531     const Color& backgroundColor() const { return background->m_color; }
backgroundImage()532     StyleImage* backgroundImage() const { return background->m_background.m_image.get(); }
backgroundRepeatX()533     EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(background->m_background.m_repeatX); }
backgroundRepeatY()534     EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(background->m_background.m_repeatY); }
backgroundComposite()535     CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(background->m_background.m_composite); }
backgroundAttachment()536     EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(background->m_background.m_attachment); }
backgroundClip()537     EFillBox backgroundClip() const { return static_cast<EFillBox>(background->m_background.m_clip); }
backgroundOrigin()538     EFillBox backgroundOrigin() const { return static_cast<EFillBox>(background->m_background.m_origin); }
backgroundXPosition()539     Length backgroundXPosition() const { return background->m_background.m_xPosition; }
backgroundYPosition()540     Length backgroundYPosition() const { return background->m_background.m_yPosition; }
backgroundSizeType()541     EFillSizeType backgroundSizeType() const { return static_cast<EFillSizeType>(background->m_background.m_sizeType); }
backgroundSizeLength()542     LengthSize backgroundSizeLength() const { return background->m_background.m_sizeLength; }
accessBackgroundLayers()543     FillLayer* accessBackgroundLayers() { return &(background.access()->m_background); }
backgroundLayers()544     const FillLayer* backgroundLayers() const { return &(background->m_background); }
545 
maskImage()546     StyleImage* maskImage() const { return rareNonInheritedData->m_mask.m_image.get(); }
maskRepeatX()547     EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatX); }
maskRepeatY()548     EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.m_repeatY); }
maskComposite()549     CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.m_composite); }
maskAttachment()550     EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.m_attachment); }
maskClip()551     EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_clip); }
maskOrigin()552     EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.m_origin); }
maskXPosition()553     Length maskXPosition() const { return rareNonInheritedData->m_mask.m_xPosition; }
maskYPosition()554     Length maskYPosition() const { return rareNonInheritedData->m_mask.m_yPosition; }
maskSize()555     LengthSize maskSize() const { return rareNonInheritedData->m_mask.m_sizeLength; }
accessMaskLayers()556     FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
maskLayers()557     const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
maskBoxImage()558     const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
559 
560     // returns true for collapsing borders, false for separate borders
borderCollapse()561     bool borderCollapse() const { return inherited_flags._border_collapse; }
horizontalBorderSpacing()562     short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
verticalBorderSpacing()563     short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
emptyCells()564     EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
captionSide()565     ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
566 
counterIncrement()567     short counterIncrement() const { return visual->counterIncrement; }
counterReset()568     short counterReset() const { return visual->counterReset; }
569 
listStyleType()570     EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
listStyleImage()571     StyleImage* listStyleImage() const { return inherited->list_style_image.get(); }
listStylePosition()572     EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
573 
marginTop()574     Length marginTop() const { return surround->margin.top(); }
marginBottom()575     Length marginBottom() const { return surround->margin.bottom(); }
marginLeft()576     Length marginLeft() const { return surround->margin.left(); }
marginRight()577     Length marginRight() const { return surround->margin.right(); }
578 
paddingBox()579     LengthBox paddingBox() const { return surround->padding; }
paddingTop()580     Length paddingTop() const { return surround->padding.top(); }
paddingBottom()581     Length paddingBottom() const { return surround->padding.bottom(); }
paddingLeft()582     Length paddingLeft() const { return surround->padding.left(); }
paddingRight()583     Length paddingRight() const { return surround->padding.right(); }
584 
cursor()585     ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
586 
cursors()587     CursorList* cursors() const { return inherited->cursorData.get(); }
588 
widows()589     short widows() const { return inherited->widows; }
orphans()590     short orphans() const { return inherited->orphans; }
pageBreakInside()591     EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
pageBreakBefore()592     EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
pageBreakAfter()593     EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
594 
595     // CSS3 Getter Methods
596 #if ENABLE(XBL)
bindingURIs()597     BindingURI* bindingURIs() const { return rareNonInheritedData->bindingURI; }
598 #endif
599 
outlineOffset()600     int outlineOffset() const
601     {
602         if (background->m_outline.style() == BNONE)
603             return 0;
604         return background->m_outline._offset;
605     }
606 
textShadow()607     ShadowData* textShadow() const { return rareInheritedData->textShadow; }
textStrokeColor()608     const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
textStrokeWidth()609     float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
textFillColor()610     const Color& textFillColor() const { return rareInheritedData->textFillColor; }
colorSpace()611     ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
opacity()612     float opacity() const { return rareNonInheritedData->opacity; }
appearance()613     ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
boxAlign()614     EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->align); }
boxDirection()615     EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
boxFlex()616     float boxFlex() { return rareNonInheritedData->flexibleBox->flex; }
boxFlexGroup()617     unsigned int boxFlexGroup() const { return rareNonInheritedData->flexibleBox->flex_group; }
boxLines()618     EBoxLines boxLines() { return static_cast<EBoxLines>(rareNonInheritedData->flexibleBox->lines); }
boxOrdinalGroup()619     unsigned int boxOrdinalGroup() const { return rareNonInheritedData->flexibleBox->ordinal_group; }
boxOrient()620     EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->flexibleBox->orient); }
boxPack()621     EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); }
622 
boxShadow()623     ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
624     void getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const;
625     void getBoxShadowHorizontalExtent(int &left, int &right) const;
626     void getBoxShadowVerticalExtent(int &top, int &bottom) const;
627 
boxReflect()628     StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
boxSizing()629     EBoxSizing boxSizing() const { return static_cast<EBoxSizing>(box->boxSizing); }
marqueeIncrement()630     Length marqueeIncrement() const { return rareNonInheritedData->marquee->increment; }
marqueeSpeed()631     int marqueeSpeed() const { return rareNonInheritedData->marquee->speed; }
marqueeLoopCount()632     int marqueeLoopCount() const { return rareNonInheritedData->marquee->loops; }
marqueeBehavior()633     EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->marquee->behavior); }
marqueeDirection()634     EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->marquee->direction); }
userModify()635     EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
userDrag()636     EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
userSelect()637     EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
textOverflow()638     bool textOverflow() const { return rareNonInheritedData->textOverflow; }
marginTopCollapse()639     EMarginCollapse marginTopCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginTopCollapse); }
marginBottomCollapse()640     EMarginCollapse marginBottomCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBottomCollapse); }
wordBreak()641     EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
wordWrap()642     EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); }
nbspMode()643     ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
khtmlLineBreak()644     EKHTMLLineBreak khtmlLineBreak() const { return static_cast<EKHTMLLineBreak>(rareInheritedData->khtmlLineBreak); }
matchNearestMailBlockquoteColor()645     EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); }
highlight()646     const AtomicString& highlight() const { return rareInheritedData->highlight; }
borderFit()647     EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
resize()648     EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
columnWidth()649     float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
hasAutoColumnWidth()650     bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
columnCount()651     unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
hasAutoColumnCount()652     bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
columnGap()653     float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
hasNormalColumnGap()654     bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
columnRuleColor()655     const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color; }
columnRuleStyle()656     EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
columnRuleWidth()657     unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
columnRuleIsTransparent()658     bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
columnBreakBefore()659     EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
columnBreakInside()660     EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
columnBreakAfter()661     EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
transform()662     const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
transformOriginX()663     Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
transformOriginY()664     Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
transformOriginZ()665     float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
hasTransform()666     bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
667 
668     // Return true if any transform related property (currently transform, transformStyle3D or perspective)
669     // indicates that we are transforming
hasTransformRelatedProperty()670     bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
671 
672     enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
673     void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
674 
hasMask()675     bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
676     // End CSS3 Getters
677 
678     // Apple-specific property getter methods
pointerEvents()679     EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
animations()680     const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
transitions()681     const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
682 
683     AnimationList* accessAnimations();
684     AnimationList* accessTransitions();
685 
hasAnimations()686     bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
hasTransitions()687     bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
688 
689     // return the first found Animation (including 'all' transitions)
690     const Animation* transitionForProperty(int property) const;
691 
transformStyle3D()692     ETransformStyle3D transformStyle3D() const { return rareNonInheritedData->m_transformStyle3D; }
preserves3D()693     bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
694 
backfaceVisibility()695     EBackfaceVisibility backfaceVisibility() const { return rareNonInheritedData->m_backfaceVisibility; }
perspective()696     float perspective() const { return rareNonInheritedData->m_perspective; }
hasPerspective()697     bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
perspectiveOriginX()698     Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
perspectiveOriginY()699     Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
700 
701 #if USE(ACCELERATED_COMPOSITING)
702     // When set, this ensures that styles compare as different. Used during accelerated animations.
isRunningAcceleratedAnimation()703     bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
704 #endif
705 
lineClamp()706     const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
textSizeAdjust()707     bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
textSecurity()708     ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
709 
710 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
tapHighlightColor()711     Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
712 #endif
713 
714 // attribute setter methods
715 
setDisplay(EDisplay v)716     void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
setOriginalDisplay(EDisplay v)717     void setOriginalDisplay(EDisplay v) { noninherited_flags._originalDisplay = v; }
setPosition(EPosition v)718     void setPosition(EPosition v) { noninherited_flags._position = v; }
setFloating(EFloat v)719     void setFloating(EFloat v) { noninherited_flags._floating = v; }
720 
setLeft(Length v)721     void setLeft(Length v) { SET_VAR(surround, offset.m_left, v) }
setRight(Length v)722     void setRight(Length v) { SET_VAR(surround, offset.m_right, v) }
setTop(Length v)723     void setTop(Length v) { SET_VAR(surround, offset.m_top, v) }
setBottom(Length v)724     void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v) }
725 
setWidth(Length v)726     void setWidth(Length v) { SET_VAR(box, width, v) }
setHeight(Length v)727     void setHeight(Length v) { SET_VAR(box, height, v) }
728 
setMinWidth(Length v)729     void setMinWidth(Length v) { SET_VAR(box, min_width, v) }
setMaxWidth(Length v)730     void setMaxWidth(Length v) { SET_VAR(box, max_width, v) }
setMinHeight(Length v)731     void setMinHeight(Length v) { SET_VAR(box, min_height, v) }
setMaxHeight(Length v)732     void setMaxHeight(Length v) { SET_VAR(box, max_height, v) }
733 
734 #if ENABLE(DASHBOARD_SUPPORT)
dashboardRegions()735     Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
setDashboardRegions(Vector<StyleDashboardRegion> regions)736     void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
737 
setDashboardRegion(int type,const String & label,Length t,Length r,Length b,Length l,bool append)738     void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append)
739     {
740         StyleDashboardRegion region;
741         region.label = label;
742         region.offset.m_top = t;
743         region.offset.m_right = r;
744         region.offset.m_bottom = b;
745         region.offset.m_left = l;
746         region.type = type;
747         if (!append)
748             rareNonInheritedData.access()->m_dashboardRegions.clear();
749         rareNonInheritedData.access()->m_dashboardRegions.append(region);
750     }
751 #endif
752 
resetBorder()753     void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
resetBorderTop()754     void resetBorderTop() { SET_VAR(surround, border.top, BorderValue()) }
resetBorderRight()755     void resetBorderRight() { SET_VAR(surround, border.right, BorderValue()) }
resetBorderBottom()756     void resetBorderBottom() { SET_VAR(surround, border.bottom, BorderValue()) }
resetBorderLeft()757     void resetBorderLeft() { SET_VAR(surround, border.left, BorderValue()) }
resetBorderImage()758     void resetBorderImage() { SET_VAR(surround, border.image, NinePieceImage()) }
resetBorderRadius()759     void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
resetBorderTopLeftRadius()760     void resetBorderTopLeftRadius() { SET_VAR(surround, border.topLeft, initialBorderRadius()) }
resetBorderTopRightRadius()761     void resetBorderTopRightRadius() { SET_VAR(surround, border.topRight, initialBorderRadius()) }
resetBorderBottomLeftRadius()762     void resetBorderBottomLeftRadius() { SET_VAR(surround, border.bottomLeft, initialBorderRadius()) }
resetBorderBottomRightRadius()763     void resetBorderBottomRightRadius() { SET_VAR(surround, border.bottomRight, initialBorderRadius()) }
764 
resetOutline()765     void resetOutline() { SET_VAR(background, m_outline, OutlineValue()) }
766 
setBackgroundColor(const Color & v)767     void setBackgroundColor(const Color& v) { SET_VAR(background, m_color, v) }
768 
setBackgroundXPosition(Length l)769     void setBackgroundXPosition(Length l) { SET_VAR(background, m_background.m_xPosition, l) }
setBackgroundYPosition(Length l)770     void setBackgroundYPosition(Length l) { SET_VAR(background, m_background.m_yPosition, l) }
setBackgroundSize(EFillSizeType b)771     void setBackgroundSize(EFillSizeType b) { SET_VAR(background, m_background.m_sizeType, b) }
setBackgroundSizeLength(LengthSize l)772     void setBackgroundSizeLength(LengthSize l) { SET_VAR(background, m_background.m_sizeLength, l) }
773 
setBorderImage(const NinePieceImage & b)774     void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.image, b) }
775 
setBorderTopLeftRadius(const IntSize & s)776     void setBorderTopLeftRadius(const IntSize& s) { SET_VAR(surround, border.topLeft, s) }
setBorderTopRightRadius(const IntSize & s)777     void setBorderTopRightRadius(const IntSize& s) { SET_VAR(surround, border.topRight, s) }
setBorderBottomLeftRadius(const IntSize & s)778     void setBorderBottomLeftRadius(const IntSize& s) { SET_VAR(surround, border.bottomLeft, s) }
setBorderBottomRightRadius(const IntSize & s)779     void setBorderBottomRightRadius(const IntSize& s) { SET_VAR(surround, border.bottomRight, s) }
780 
setBorderRadius(const IntSize & s)781     void setBorderRadius(const IntSize& s)
782     {
783         setBorderTopLeftRadius(s);
784         setBorderTopRightRadius(s);
785         setBorderBottomLeftRadius(s);
786         setBorderBottomRightRadius(s);
787     }
788 
789     void getBorderRadiiForRect(const IntRect&, IntSize& topLeft, IntSize& topRight, IntSize& bottomLeft, IntSize& bottomRight) const;
790 
setBorderLeftWidth(unsigned short v)791     void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.left.width, v) }
setBorderLeftStyle(EBorderStyle v)792     void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.left.m_style, v) }
setBorderLeftColor(const Color & v)793     void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.left.color, v) }
setBorderRightWidth(unsigned short v)794     void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.right.width, v) }
setBorderRightStyle(EBorderStyle v)795     void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.right.m_style, v) }
setBorderRightColor(const Color & v)796     void setBorderRightColor(const Color& v) { SET_VAR(surround, border.right.color, v) }
setBorderTopWidth(unsigned short v)797     void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.top.width, v) }
setBorderTopStyle(EBorderStyle v)798     void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.top.m_style, v) }
setBorderTopColor(const Color & v)799     void setBorderTopColor(const Color& v) { SET_VAR(surround, border.top.color, v) }
setBorderBottomWidth(unsigned short v)800     void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.bottom.width, v) }
setBorderBottomStyle(EBorderStyle v)801     void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.bottom.m_style, v) }
setBorderBottomColor(const Color & v)802     void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.bottom.color, v) }
setOutlineWidth(unsigned short v)803     void setOutlineWidth(unsigned short v) { SET_VAR(background, m_outline.width, v) }
804 
805     void setOutlineStyle(EBorderStyle v, bool isAuto = false)
806     {
807         SET_VAR(background, m_outline.m_style, v)
808         SET_VAR(background, m_outline._auto, isAuto)
809     }
810 
setOutlineColor(const Color & v)811     void setOutlineColor(const Color& v) { SET_VAR(background, m_outline.color, v) }
812 
setOverflowX(EOverflow v)813     void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
setOverflowY(EOverflow v)814     void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
setVisibility(EVisibility v)815     void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
setVerticalAlign(EVerticalAlign v)816     void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
setVerticalAlignLength(Length l)817     void setVerticalAlignLength(Length l) { SET_VAR(box, vertical_align, l) }
818 
819     void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b) }
setClipLeft(Length v)820     void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v) }
setClipRight(Length v)821     void setClipRight(Length v) { SET_VAR(visual, clip.m_right, v) }
setClipTop(Length v)822     void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v) }
setClipBottom(Length v)823     void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v) }
824     void setClip(Length top, Length right, Length bottom, Length left);
825 
setUnicodeBidi(EUnicodeBidi b)826     void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
827 
setClear(EClear v)828     void setClear(EClear v) { noninherited_flags._clear = v; }
setTableLayout(ETableLayout v)829     void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
830 
setFontDescription(const FontDescription & v)831     bool setFontDescription(const FontDescription& v)
832     {
833         if (inherited->font.fontDescription() != v) {
834             inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
835             return true;
836         }
837         return false;
838     }
839 
840     // Only used for blending font sizes when animating.
841     void setBlendedFontSize(int);
842 
setColor(const Color & v)843     void setColor(const Color& v) { SET_VAR(inherited, color, v) }
setTextIndent(Length v)844     void setTextIndent(Length v) { SET_VAR(inherited, indent, v) }
setTextAlign(ETextAlign v)845     void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
setTextTransform(ETextTransform v)846     void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
addToTextDecorationsInEffect(int v)847     void addToTextDecorationsInEffect(int v) { inherited_flags._text_decorations |= v; }
setTextDecorationsInEffect(int v)848     void setTextDecorationsInEffect(int v) { inherited_flags._text_decorations = v; }
setTextDecoration(int v)849     void setTextDecoration(int v) { SET_VAR(visual, textDecoration, v); }
setDirection(TextDirection v)850     void setDirection(TextDirection v) { inherited_flags._direction = v; }
setLineHeight(Length v)851     void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
setZoom(float f)852     void setZoom(float f) { SET_VAR(visual, m_zoom, f); setEffectiveZoom(effectiveZoom() * zoom()); }
setEffectiveZoom(float f)853     void setEffectiveZoom(float f) { SET_VAR(inherited, m_effectiveZoom, f) }
854 
setWhiteSpace(EWhiteSpace v)855     void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
856 
setWordSpacing(int v)857     void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
setLetterSpacing(int v)858     void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
859 
clearBackgroundLayers()860     void clearBackgroundLayers() { background.access()->m_background = FillLayer(BackgroundFillLayer); }
inheritBackgroundLayers(const FillLayer & parent)861     void inheritBackgroundLayers(const FillLayer& parent) { background.access()->m_background = parent; }
862 
adjustBackgroundLayers()863     void adjustBackgroundLayers()
864     {
865         if (backgroundLayers()->next()) {
866             accessBackgroundLayers()->cullEmptyLayers();
867             accessBackgroundLayers()->fillUnsetProperties();
868         }
869     }
870 
clearMaskLayers()871     void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
inheritMaskLayers(const FillLayer & parent)872     void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
873 
adjustMaskLayers()874     void adjustMaskLayers()
875     {
876         if (maskLayers()->next()) {
877             accessMaskLayers()->cullEmptyLayers();
878             accessMaskLayers()->fillUnsetProperties();
879         }
880     }
881 
setMaskBoxImage(const NinePieceImage & b)882     void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b) }
setMaskXPosition(Length l)883     void setMaskXPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, l) }
setMaskYPosition(Length l)884     void setMaskYPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, l) }
setMaskSize(LengthSize l)885     void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
886 
setBorderCollapse(bool collapse)887     void setBorderCollapse(bool collapse) { inherited_flags._border_collapse = collapse; }
setHorizontalBorderSpacing(short v)888     void setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
setVerticalBorderSpacing(short v)889     void setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
setEmptyCells(EEmptyCell v)890     void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
setCaptionSide(ECaptionSide v)891     void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
892 
setCounterIncrement(short v)893     void setCounterIncrement(short v) { SET_VAR(visual, counterIncrement, v) }
setCounterReset(short v)894     void setCounterReset(short v) { SET_VAR(visual, counterReset, v) }
895 
setListStyleType(EListStyleType v)896     void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
setListStyleImage(StyleImage * v)897     void setListStyleImage(StyleImage* v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
setListStylePosition(EListStylePosition v)898     void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
899 
resetMargin()900     void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
setMarginTop(Length v)901     void setMarginTop(Length v) { SET_VAR(surround, margin.m_top, v) }
setMarginBottom(Length v)902     void setMarginBottom(Length v) { SET_VAR(surround, margin.m_bottom, v) }
setMarginLeft(Length v)903     void setMarginLeft(Length v) { SET_VAR(surround, margin.m_left, v) }
setMarginRight(Length v)904     void setMarginRight(Length v) { SET_VAR(surround, margin.m_right, v) }
905 
resetPadding()906     void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)) }
setPaddingBox(const LengthBox & b)907     void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b) }
setPaddingTop(Length v)908     void setPaddingTop(Length v) { SET_VAR(surround, padding.m_top, v) }
setPaddingBottom(Length v)909     void setPaddingBottom(Length v) { SET_VAR(surround, padding.m_bottom, v) }
setPaddingLeft(Length v)910     void setPaddingLeft(Length v) { SET_VAR(surround, padding.m_left, v) }
setPaddingRight(Length v)911     void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) }
912 
setCursor(ECursor c)913     void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
914     void addCursor(CachedImage*, const IntPoint& = IntPoint());
915     void setCursorList(PassRefPtr<CursorList>);
916     void clearCursorList();
917 
forceBackgroundsToWhite()918     bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
919     void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
920 
htmlHacks()921     bool htmlHacks() const { return inherited_flags._htmlHacks; }
922     void setHtmlHacks(bool b=true) { inherited_flags._htmlHacks = b; }
923 
hasAutoZIndex()924     bool hasAutoZIndex() const { return box->z_auto; }
setHasAutoZIndex()925     void setHasAutoZIndex() { SET_VAR(box, z_auto, true); SET_VAR(box, z_index, 0) }
zIndex()926     int zIndex() const { return box->z_index; }
setZIndex(int v)927     void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box, z_index, v) }
928 
setWidows(short w)929     void setWidows(short w) { SET_VAR(inherited, widows, w); }
setOrphans(short o)930     void setOrphans(short o) { SET_VAR(inherited, orphans, o); }
setPageBreakInside(EPageBreak b)931     void setPageBreakInside(EPageBreak b) { noninherited_flags._page_break_inside = b; }
setPageBreakBefore(EPageBreak b)932     void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
setPageBreakAfter(EPageBreak b)933     void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
934 
935     // CSS3 Setters
936 #if ENABLE(XBL)
deleteBindingURIs()937     void deleteBindingURIs() { SET_VAR(rareNonInheritedData, bindingURI, static_cast<BindingURI*>(0)); }
inheritBindingURIs(BindingURI * other)938     void inheritBindingURIs(BindingURI* other) { SET_VAR(rareNonInheritedData, bindingURI, other->copy()); }
939     void addBindingURI(StringImpl* uri);
940 #endif
941 
setOutlineOffset(int v)942     void setOutlineOffset(int v) { SET_VAR(background, m_outline._offset, v) }
943     void setTextShadow(ShadowData* val, bool add=false);
setTextStrokeColor(const Color & c)944     void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) }
setTextStrokeWidth(float w)945     void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
setTextFillColor(const Color & c)946     void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c) }
setColorSpace(ColorSpace space)947     void setColorSpace(ColorSpace space) { SET_VAR(rareInheritedData, colorSpace, space) }
setOpacity(float f)948     void setOpacity(float f) { SET_VAR(rareNonInheritedData, opacity, f); }
setAppearance(ControlPart a)949     void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
setBoxAlign(EBoxAlignment a)950     void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->flexibleBox, align, a); }
setBoxDirection(EBoxDirection d)951     void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
setBoxFlex(float f)952     void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->flexibleBox, flex, f); }
setBoxFlexGroup(unsigned int fg)953     void setBoxFlexGroup(unsigned int fg) { SET_VAR(rareNonInheritedData.access()->flexibleBox, flex_group, fg); }
setBoxLines(EBoxLines l)954     void setBoxLines(EBoxLines l) { SET_VAR(rareNonInheritedData.access()->flexibleBox, lines, l); }
setBoxOrdinalGroup(unsigned int og)955     void setBoxOrdinalGroup(unsigned int og) { SET_VAR(rareNonInheritedData.access()->flexibleBox, ordinal_group, og); }
setBoxOrient(EBoxOrient o)956     void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->flexibleBox, orient, o); }
setBoxPack(EBoxAlignment p)957     void setBoxPack(EBoxAlignment p) { SET_VAR(rareNonInheritedData.access()->flexibleBox, pack, p); }
958     void setBoxShadow(ShadowData* val, bool add=false);
setBoxReflect(PassRefPtr<StyleReflection> reflect)959     void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
setBoxSizing(EBoxSizing s)960     void setBoxSizing(EBoxSizing s) { SET_VAR(box, boxSizing, s); }
setMarqueeIncrement(const Length & f)961     void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->marquee, increment, f); }
setMarqueeSpeed(int f)962     void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->marquee, speed, f); }
setMarqueeDirection(EMarqueeDirection d)963     void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->marquee, direction, d); }
setMarqueeBehavior(EMarqueeBehavior b)964     void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(rareNonInheritedData.access()->marquee, behavior, b); }
setMarqueeLoopCount(int i)965     void setMarqueeLoopCount(int i) { SET_VAR(rareNonInheritedData.access()->marquee, loops, i); }
setUserModify(EUserModify u)966     void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
setUserDrag(EUserDrag d)967     void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
setUserSelect(EUserSelect s)968     void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
setTextOverflow(bool b)969     void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); }
setMarginTopCollapse(EMarginCollapse c)970     void setMarginTopCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginTopCollapse, c); }
setMarginBottomCollapse(EMarginCollapse c)971     void setMarginBottomCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBottomCollapse, c); }
setWordBreak(EWordBreak b)972     void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
setWordWrap(EWordWrap b)973     void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); }
setNBSPMode(ENBSPMode b)974     void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
setKHTMLLineBreak(EKHTMLLineBreak b)975     void setKHTMLLineBreak(EKHTMLLineBreak b) { SET_VAR(rareInheritedData, khtmlLineBreak, b); }
setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c)976     void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); }
setHighlight(const AtomicString & h)977     void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
setBorderFit(EBorderFit b)978     void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
setResize(EResize r)979     void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
setColumnWidth(float f)980     void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
setHasAutoColumnWidth()981     void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, 0); }
setColumnCount(unsigned short c)982     void setColumnCount(unsigned short c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, c); }
setHasAutoColumnCount()983     void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
setColumnGap(float f)984     void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
setHasNormalColumnGap()985     void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
setColumnRuleColor(const Color & c)986     void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.color, c); }
setColumnRuleStyle(EBorderStyle b)987     void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
setColumnRuleWidth(unsigned short w)988     void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.width, w); }
resetColumnRule()989     void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) }
setColumnBreakBefore(EPageBreak p)990     void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
setColumnBreakInside(EPageBreak p)991     void setColumnBreakInside(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
setColumnBreakAfter(EPageBreak p)992     void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
setTransform(const TransformOperations & ops)993     void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
setTransformOriginX(Length l)994     void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
setTransformOriginY(Length l)995     void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
setTransformOriginZ(float f)996     void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
997     // End CSS3 Setters
998 
999     // Apple-specific property setters
setPointerEvents(EPointerEvents p)1000     void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
1001 
clearAnimations()1002     void clearAnimations()
1003     {
1004         rareNonInheritedData.access()->m_animations.clear();
1005     }
1006 
clearTransitions()1007     void clearTransitions()
1008     {
1009         rareNonInheritedData.access()->m_transitions.clear();
1010     }
1011 
inheritAnimations(const AnimationList * parent)1012     void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations.set(parent ? new AnimationList(*parent) : 0); }
inheritTransitions(const AnimationList * parent)1013     void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions.set(parent ? new AnimationList(*parent) : 0); }
1014     void adjustAnimations();
1015     void adjustTransitions();
1016 
setTransformStyle3D(ETransformStyle3D b)1017     void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
setBackfaceVisibility(EBackfaceVisibility b)1018     void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
setPerspective(float p)1019     void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
setPerspectiveOriginX(Length l)1020     void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
setPerspectiveOriginY(Length l)1021     void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
1022 
1023 #if USE(ACCELERATED_COMPOSITING)
1024     void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
1025 #endif
1026 
setLineClamp(LineClampValue c)1027     void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
setTextSizeAdjust(bool b)1028     void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
setTextSecurity(ETextSecurity aTextSecurity)1029     void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
1030 
1031 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
setTapHighlightColor(const Color & v)1032     void setTapHighlightColor(const Color& v) { SET_VAR(rareInheritedData, tapHighlightColor, v); }
1033 #endif
1034 
1035 #if ENABLE(SVG)
svgStyle()1036     const SVGRenderStyle* svgStyle() const { return m_svgStyle.get(); }
accessSVGStyle()1037     SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
1038 
fillOpacity()1039     float fillOpacity() const { return svgStyle()->fillOpacity(); }
setFillOpacity(float f)1040     void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
1041 
strokeOpacity()1042     float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
setStrokeOpacity(float f)1043     void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
1044 
floodOpacity()1045     float floodOpacity() const { return svgStyle()->floodOpacity(); }
setFloodOpacity(float f)1046     void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); }
1047 #endif
1048 
contentData()1049     const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
contentDataEquivalent(const RenderStyle * otherStyle)1050     bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
1051     void clearContent();
1052     void setContent(PassRefPtr<StringImpl>, bool add = false);
1053     void setContent(PassRefPtr<StyleImage>, bool add = false);
1054     void setContent(CounterContent*, bool add = false);
1055 
1056     const CounterDirectiveMap* counterDirectives() const;
1057     CounterDirectiveMap& accessCounterDirectives();
1058 
1059     bool inheritedNotEqual(const RenderStyle*) const;
1060 
1061     StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
1062 
isDisplayReplacedType()1063     bool isDisplayReplacedType() const
1064     {
1065         return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
1066     }
1067 
isDisplayInlineType()1068     bool isDisplayInlineType() const
1069     {
1070         return display() == INLINE || isDisplayReplacedType();
1071     }
1072 
isOriginalDisplayInlineType()1073     bool isOriginalDisplayInlineType() const
1074     {
1075         return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK ||
1076                originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
1077     }
1078 
1079     // To obtain at any time the pseudo state for a given link.
pseudoState()1080     PseudoState pseudoState() const { return static_cast<PseudoState>(m_pseudoState); }
setPseudoState(PseudoState s)1081     void setPseudoState(PseudoState s) { m_pseudoState = s; }
1082 
1083     // To tell if this style matched attribute selectors. This makes it impossible to share.
affectedByAttributeSelectors()1084     bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
setAffectedByAttributeSelectors()1085     void setAffectedByAttributeSelectors() { m_affectedByAttributeSelectors = true; }
1086 
unique()1087     bool unique() const { return m_unique; }
setUnique()1088     void setUnique() { m_unique = true; }
1089 
1090     // Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
affectedByEmpty()1091     bool affectedByEmpty() const { return m_affectedByEmpty; }
emptyState()1092     bool emptyState() const { return m_emptyState; }
setEmptyState(bool b)1093     void setEmptyState(bool b) { m_affectedByEmpty = true; m_unique = true; m_emptyState = b; }
childrenAffectedByPositionalRules()1094     bool childrenAffectedByPositionalRules() const { return childrenAffectedByForwardPositionalRules() || childrenAffectedByBackwardPositionalRules(); }
childrenAffectedByFirstChildRules()1095     bool childrenAffectedByFirstChildRules() const { return m_childrenAffectedByFirstChildRules; }
setChildrenAffectedByFirstChildRules()1096     void setChildrenAffectedByFirstChildRules() { m_childrenAffectedByFirstChildRules = true; }
childrenAffectedByLastChildRules()1097     bool childrenAffectedByLastChildRules() const { return m_childrenAffectedByLastChildRules; }
setChildrenAffectedByLastChildRules()1098     void setChildrenAffectedByLastChildRules() { m_childrenAffectedByLastChildRules = true; }
childrenAffectedByDirectAdjacentRules()1099     bool childrenAffectedByDirectAdjacentRules() const { return m_childrenAffectedByDirectAdjacentRules; }
setChildrenAffectedByDirectAdjacentRules()1100     void setChildrenAffectedByDirectAdjacentRules() { m_childrenAffectedByDirectAdjacentRules = true; }
childrenAffectedByForwardPositionalRules()1101     bool childrenAffectedByForwardPositionalRules() const { return m_childrenAffectedByForwardPositionalRules; }
setChildrenAffectedByForwardPositionalRules()1102     void setChildrenAffectedByForwardPositionalRules() { m_childrenAffectedByForwardPositionalRules = true; }
childrenAffectedByBackwardPositionalRules()1103     bool childrenAffectedByBackwardPositionalRules() const { return m_childrenAffectedByBackwardPositionalRules; }
setChildrenAffectedByBackwardPositionalRules()1104     void setChildrenAffectedByBackwardPositionalRules() { m_childrenAffectedByBackwardPositionalRules = true; }
firstChildState()1105     bool firstChildState() const { return m_firstChildState; }
setFirstChildState()1106     void setFirstChildState() { m_firstChildState = true; }
lastChildState()1107     bool lastChildState() const { return m_lastChildState; }
setLastChildState()1108     void setLastChildState() { m_lastChildState = true; }
childIndex()1109     unsigned childIndex() const { return m_childIndex; }
setChildIndex(unsigned index)1110     void setChildIndex(unsigned index) { m_childIndex = index; }
1111 
1112     // Initial values for all the properties
initialBorderCollapse()1113     static bool initialBorderCollapse() { return false; }
initialBorderStyle()1114     static EBorderStyle initialBorderStyle() { return BNONE; }
initialNinePieceImage()1115     static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
initialBorderRadius()1116     static IntSize initialBorderRadius() { return IntSize(0, 0); }
initialCaptionSide()1117     static ECaptionSide initialCaptionSide() { return CAPTOP; }
initialClear()1118     static EClear initialClear() { return CNONE; }
initialDirection()1119     static TextDirection initialDirection() { return LTR; }
initialDisplay()1120     static EDisplay initialDisplay() { return INLINE; }
initialEmptyCells()1121     static EEmptyCell initialEmptyCells() { return SHOW; }
initialFloating()1122     static EFloat initialFloating() { return FNONE; }
initialListStylePosition()1123     static EListStylePosition initialListStylePosition() { return OUTSIDE; }
initialListStyleType()1124     static EListStyleType initialListStyleType() { return Disc; }
initialOverflowX()1125     static EOverflow initialOverflowX() { return OVISIBLE; }
initialOverflowY()1126     static EOverflow initialOverflowY() { return OVISIBLE; }
initialPageBreak()1127     static EPageBreak initialPageBreak() { return PBAUTO; }
initialPosition()1128     static EPosition initialPosition() { return StaticPosition; }
initialTableLayout()1129     static ETableLayout initialTableLayout() { return TAUTO; }
initialUnicodeBidi()1130     static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
initialTextTransform()1131     static ETextTransform initialTextTransform() { return TTNONE; }
initialVisibility()1132     static EVisibility initialVisibility() { return VISIBLE; }
initialWhiteSpace()1133     static EWhiteSpace initialWhiteSpace() { return NORMAL; }
initialHorizontalBorderSpacing()1134     static short initialHorizontalBorderSpacing() { return 0; }
initialVerticalBorderSpacing()1135     static short initialVerticalBorderSpacing() { return 0; }
initialCursor()1136     static ECursor initialCursor() { return CURSOR_AUTO; }
initialColor()1137     static Color initialColor() { return Color::black; }
initialListStyleImage()1138     static StyleImage* initialListStyleImage() { return 0; }
initialBorderWidth()1139     static unsigned short initialBorderWidth() { return 3; }
initialLetterWordSpacing()1140     static int initialLetterWordSpacing() { return 0; }
initialSize()1141     static Length initialSize() { return Length(); }
initialMinSize()1142     static Length initialMinSize() { return Length(0, Fixed); }
initialMaxSize()1143     static Length initialMaxSize() { return Length(undefinedLength, Fixed); }
initialOffset()1144     static Length initialOffset() { return Length(); }
initialMargin()1145     static Length initialMargin() { return Length(Fixed); }
initialPadding()1146     static Length initialPadding() { return Length(Fixed); }
initialTextIndent()1147     static Length initialTextIndent() { return Length(Fixed); }
initialVerticalAlign()1148     static EVerticalAlign initialVerticalAlign() { return BASELINE; }
initialWidows()1149     static int initialWidows() { return 2; }
initialOrphans()1150     static int initialOrphans() { return 2; }
initialLineHeight()1151     static Length initialLineHeight() { return Length(-100.0, Percent); }
initialTextAlign()1152     static ETextAlign initialTextAlign() { return TAAUTO; }
initialTextDecoration()1153     static ETextDecoration initialTextDecoration() { return TDNONE; }
initialZoom()1154     static float initialZoom() { return 1.0f; }
initialOutlineOffset()1155     static int initialOutlineOffset() { return 0; }
initialOpacity()1156     static float initialOpacity() { return 1.0f; }
initialBoxAlign()1157     static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
initialBoxDirection()1158     static EBoxDirection initialBoxDirection() { return BNORMAL; }
initialBoxLines()1159     static EBoxLines initialBoxLines() { return SINGLE; }
initialBoxOrient()1160     static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
initialBoxPack()1161     static EBoxAlignment initialBoxPack() { return BSTART; }
initialBoxFlex()1162     static float initialBoxFlex() { return 0.0f; }
initialBoxFlexGroup()1163     static int initialBoxFlexGroup() { return 1; }
initialBoxOrdinalGroup()1164     static int initialBoxOrdinalGroup() { return 1; }
initialBoxSizing()1165     static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
initialBoxReflect()1166     static StyleReflection* initialBoxReflect() { return 0; }
initialMarqueeLoopCount()1167     static int initialMarqueeLoopCount() { return -1; }
initialMarqueeSpeed()1168     static int initialMarqueeSpeed() { return 85; }
initialMarqueeIncrement()1169     static Length initialMarqueeIncrement() { return Length(6, Fixed); }
initialMarqueeBehavior()1170     static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
initialMarqueeDirection()1171     static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
initialUserModify()1172     static EUserModify initialUserModify() { return READ_ONLY; }
initialUserDrag()1173     static EUserDrag initialUserDrag() { return DRAG_AUTO; }
initialUserSelect()1174     static EUserSelect initialUserSelect() { return SELECT_TEXT; }
initialTextOverflow()1175     static bool initialTextOverflow() { return false; }
initialMarginTopCollapse()1176     static EMarginCollapse initialMarginTopCollapse() { return MCOLLAPSE; }
initialMarginBottomCollapse()1177     static EMarginCollapse initialMarginBottomCollapse() { return MCOLLAPSE; }
initialWordBreak()1178     static EWordBreak initialWordBreak() { return NormalWordBreak; }
initialWordWrap()1179     static EWordWrap initialWordWrap() { return NormalWordWrap; }
initialNBSPMode()1180     static ENBSPMode initialNBSPMode() { return NBNORMAL; }
initialKHTMLLineBreak()1181     static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
initialMatchNearestMailBlockquoteColor()1182     static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
initialHighlight()1183     static const AtomicString& initialHighlight() { return nullAtom; }
initialBorderFit()1184     static EBorderFit initialBorderFit() { return BorderFitBorder; }
initialResize()1185     static EResize initialResize() { return RESIZE_NONE; }
initialAppearance()1186     static ControlPart initialAppearance() { return NoControlPart; }
initialVisuallyOrdered()1187     static bool initialVisuallyOrdered() { return false; }
initialTextStrokeWidth()1188     static float initialTextStrokeWidth() { return 0; }
initialColumnCount()1189     static unsigned short initialColumnCount() { return 1; }
initialTransform()1190     static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
initialTransformOriginX()1191     static Length initialTransformOriginX() { return Length(50.0, Percent); }
initialTransformOriginY()1192     static Length initialTransformOriginY() { return Length(50.0, Percent); }
initialPointerEvents()1193     static EPointerEvents initialPointerEvents() { return PE_AUTO; }
initialTransformOriginZ()1194     static float initialTransformOriginZ() { return 0; }
initialTransformStyle3D()1195     static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
initialBackfaceVisibility()1196     static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
initialPerspective()1197     static float initialPerspective() { return 0; }
initialPerspectiveOriginX()1198     static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
initialPerspectiveOriginY()1199     static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
initialBackgroundColor()1200     static Color initialBackgroundColor() { return Color::transparent; }
1201 
1202     // Keep these at the end.
initialLineClamp()1203     static LineClampValue initialLineClamp() { return LineClampValue(); }
initialTextSizeAdjust()1204     static bool initialTextSizeAdjust() { return true; }
initialTextSecurity()1205     static ETextSecurity initialTextSecurity() { return TSNONE; }
1206 #if ENABLE(DASHBOARD_SUPPORT)
1207     static const Vector<StyleDashboardRegion>& initialDashboardRegions();
1208     static const Vector<StyleDashboardRegion>& noneDashboardRegions();
1209 #endif
1210 
1211 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
initialTapHighlightColor()1212     static Color initialTapHighlightColor() { return Color::tap; }
1213 #endif
1214 };
1215 
1216 } // namespace WebCore
1217 
1218 #endif // RenderStyle_h
1219