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