• 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, 2009, 2010 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 "AnimationList.h"
29 #include "BorderValue.h"
30 #include "CSSLineBoxContainValue.h"
31 #include "CSSPrimitiveValue.h"
32 #include "CSSPropertyNames.h"
33 #include "Color.h"
34 #include "ColorSpace.h"
35 #include "CounterDirectives.h"
36 #include "DataRef.h"
37 #include "FillLayer.h"
38 #include "Font.h"
39 #include "GraphicsTypes.h"
40 #include "Length.h"
41 #include "LengthBox.h"
42 #include "LengthSize.h"
43 #include "LineClampValue.h"
44 #include "NinePieceImage.h"
45 #include "OutlineValue.h"
46 #include "RenderStyleConstants.h"
47 #include "RoundedIntRect.h"
48 #include "ShadowData.h"
49 #include "StyleBackgroundData.h"
50 #include "StyleBoxData.h"
51 #include "StyleFlexibleBoxData.h"
52 #include "StyleInheritedData.h"
53 #include "StyleMarqueeData.h"
54 #include "StyleMultiColData.h"
55 #include "StyleRareInheritedData.h"
56 #include "StyleRareNonInheritedData.h"
57 #include "StyleReflection.h"
58 #include "StyleSurroundData.h"
59 #include "StyleTransformData.h"
60 #include "StyleVisualData.h"
61 #include "TextDirection.h"
62 #include "TextOrientation.h"
63 #include "ThemeTypes.h"
64 #include "TransformOperations.h"
65 #include "UnicodeBidi.h"
66 #include <wtf/Forward.h>
67 #include <wtf/OwnPtr.h>
68 #include <wtf/RefCounted.h>
69 #include <wtf/StdLibExtras.h>
70 #include <wtf/Vector.h>
71 
72 #if ENABLE(DASHBOARD_SUPPORT)
73 #include "StyleDashboardRegion.h"
74 #endif
75 
76 #if ENABLE(SVG)
77 #include "SVGRenderStyle.h"
78 #endif
79 
80 #if COMPILER(WINSCW)
81 #define compareEqual(t, u)      ((t) == (u))
82 #else
compareEqual(const T & t,const U & u)83 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
84 #endif
85 
86 #define SET_VAR(group, variable, value) \
87     if (!compareEqual(group->variable, value)) \
88         group.access()->variable = value;
89 
90 namespace WebCore {
91 
92 using std::max;
93 
94 class BorderData;
95 class CSSStyleSelector;
96 class CounterContent;
97 class CursorList;
98 class IntRect;
99 class Pair;
100 class ShadowData;
101 class StyleImage;
102 class TransformationMatrix;
103 
104 struct ContentData;
105 
106 typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
107 
108 class RenderStyle: public RefCounted<RenderStyle> {
109     friend class AnimationBase; // Used by CSS animations. We can't allow them to animate based off visited colors.
110     friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
111     friend class EditingStyle; // Editing has to only reveal unvisited info.
112     friend class CSSStyleApplyProperty; // Sets members directly.
113     friend class CSSStyleSelector; // Sets members directly.
114     friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs to be able to see unvisited info.
115     friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
116     friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
117     friend class RenderTreeAsText; // FIXME: Only needed so the render tree can keep lying and dump the wrong colors.  Rebaselining would allow this to be yanked.
118 protected:
119 
120     // The following bitfield is 32-bits long, which optimizes padding with the
121     // int refCount in the base class. Beware when adding more bits.
122     bool m_affectedByAttributeSelectors : 1;
123     bool m_unique : 1;
124 
125     // Bits for dynamic child matching.
126     bool m_affectedByEmpty : 1;
127     bool m_emptyState : 1;
128 
129     // We optimize for :first-child and :last-child.  The other positional child selectors like nth-child or
130     // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
131     bool m_childrenAffectedByFirstChildRules : 1;
132     bool m_childrenAffectedByLastChildRules : 1;
133     bool m_childrenAffectedByDirectAdjacentRules : 1;
134     bool m_childrenAffectedByForwardPositionalRules : 1;
135     bool m_childrenAffectedByBackwardPositionalRules : 1;
136     bool m_firstChildState : 1;
137     bool m_lastChildState : 1;
138     unsigned m_childIndex : 21; // Plenty of bits to cache an index.
139 
140     // non-inherited attributes
141     DataRef<StyleBoxData> m_box;
142     DataRef<StyleVisualData> visual;
143     DataRef<StyleBackgroundData> m_background;
144     DataRef<StyleSurroundData> surround;
145     DataRef<StyleRareNonInheritedData> rareNonInheritedData;
146 
147     // inherited attributes
148     DataRef<StyleRareInheritedData> rareInheritedData;
149     DataRef<StyleInheritedData> inherited;
150 
151     // list of associated pseudo styles
152     OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
153 
154 #if ENABLE(SVG)
155     DataRef<SVGRenderStyle> m_svgStyle;
156 #endif
157 
158 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp
159 
160     // inherit
161     struct InheritedFlags {
162         bool operator==(const InheritedFlags& other) const
163         {
164             return (_empty_cells == other._empty_cells)
165                 && (_caption_side == other._caption_side)
166                 && (_list_style_type == other._list_style_type)
167                 && (_list_style_position == other._list_style_position)
168                 && (_visibility == other._visibility)
169                 && (_text_align == other._text_align)
170                 && (_text_transform == other._text_transform)
171                 && (_text_decorations == other._text_decorations)
172                 && (_cursor_style == other._cursor_style)
173                 && (_direction == other._direction)
174                 && (_border_collapse == other._border_collapse)
175                 && (_white_space == other._white_space)
176                 && (_box_direction == other._box_direction)
177                 && (_visuallyOrdered == other._visuallyOrdered)
178                 && (_force_backgrounds_to_white == other._force_backgrounds_to_white)
179                 && (_pointerEvents == other._pointerEvents)
180                 && (_insideLink == other._insideLink)
181                 && (m_writingMode == other.m_writingMode);
182         }
183 
184         bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
185 
186         unsigned _empty_cells : 1; // EEmptyCell
187         unsigned _caption_side : 2; // ECaptionSide
188         unsigned _list_style_type : 7; // EListStyleType
189         unsigned _list_style_position : 1; // EListStylePosition
190         unsigned _visibility : 2; // EVisibility
191         unsigned _text_align : 4; // ETextAlign
192         unsigned _text_transform : 2; // ETextTransform
193         unsigned _text_decorations : 4;
194         unsigned _cursor_style : 6; // ECursor
195         unsigned _direction : 1; // TextDirection
196         bool _border_collapse : 1 ;
197         unsigned _white_space : 3; // EWhiteSpace
198         unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
199         // 34 bits
200 
201         // non CSS2 inherited
202         bool _visuallyOrdered : 1;
203         bool _force_backgrounds_to_white : 1;
204         unsigned _pointerEvents : 4; // EPointerEvents
205         unsigned _insideLink : 2; // EInsideLink
206         // 43 bits
207 
208         // CSS Text Layout Module Level 3: Vertical writing support
209         unsigned m_writingMode : 2; // WritingMode
210         // 45 bits
211     } inherited_flags;
212 
213 // don't inherit
214     struct NonInheritedFlags {
215         bool operator==(const NonInheritedFlags& other) const
216         {
217             return _effectiveDisplay == other._effectiveDisplay
218                 && _originalDisplay == other._originalDisplay
219                 && _overflowX == other._overflowX
220                 && _overflowY == other._overflowY
221                 && _vertical_align == other._vertical_align
222                 && _clear == other._clear
223                 && _position == other._position
224                 && _floating == other._floating
225                 && _table_layout == other._table_layout
226                 && _page_break_before == other._page_break_before
227                 && _page_break_after == other._page_break_after
228                 && _page_break_inside == other._page_break_inside
229                 && _styleType == other._styleType
230                 && _affectedByHover == other._affectedByHover
231                 && _affectedByActive == other._affectedByActive
232                 && _affectedByDrag == other._affectedByDrag
233                 && _pseudoBits == other._pseudoBits
234                 && _unicodeBidi == other._unicodeBidi
235                 && _isLink == other._isLink;
236         }
237 
238         bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
239 
240         unsigned _effectiveDisplay : 5; // EDisplay
241         unsigned _originalDisplay : 5; // EDisplay
242         unsigned _overflowX : 3; // EOverflow
243         unsigned _overflowY : 3; // EOverflow
244         unsigned _vertical_align : 4; // EVerticalAlign
245         unsigned _clear : 2; // EClear
246         unsigned _position : 2; // EPosition
247         unsigned _floating : 2; // EFloat
248         unsigned _table_layout : 1; // ETableLayout
249 
250         unsigned _page_break_before : 2; // EPageBreak
251         unsigned _page_break_after : 2; // EPageBreak
252         unsigned _page_break_inside : 2; // EPageBreak
253 
254         unsigned _styleType : 6; // PseudoId
255         bool _affectedByHover : 1;
256         bool _affectedByActive : 1;
257         bool _affectedByDrag : 1;
258         unsigned _pseudoBits : 7;
259         unsigned _unicodeBidi : 2; // EUnicodeBidi
260         bool _isLink : 1;
261         // 50 bits
262     } noninherited_flags;
263 
264 // !END SYNC!
265 
266 protected:
setBitDefaults()267     void setBitDefaults()
268     {
269         inherited_flags._empty_cells = initialEmptyCells();
270         inherited_flags._caption_side = initialCaptionSide();
271         inherited_flags._list_style_type = initialListStyleType();
272         inherited_flags._list_style_position = initialListStylePosition();
273         inherited_flags._visibility = initialVisibility();
274         inherited_flags._text_align = initialTextAlign();
275         inherited_flags._text_transform = initialTextTransform();
276         inherited_flags._text_decorations = initialTextDecoration();
277         inherited_flags._cursor_style = initialCursor();
278         inherited_flags._direction = initialDirection();
279         inherited_flags._border_collapse = initialBorderCollapse();
280         inherited_flags._white_space = initialWhiteSpace();
281         inherited_flags._visuallyOrdered = initialVisuallyOrdered();
282         inherited_flags._box_direction = initialBoxDirection();
283         inherited_flags._force_backgrounds_to_white = false;
284         inherited_flags._pointerEvents = initialPointerEvents();
285         inherited_flags._insideLink = NotInsideLink;
286         inherited_flags.m_writingMode = initialWritingMode();
287 
288         noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
289         noninherited_flags._overflowX = initialOverflowX();
290         noninherited_flags._overflowY = initialOverflowY();
291         noninherited_flags._vertical_align = initialVerticalAlign();
292         noninherited_flags._clear = initialClear();
293         noninherited_flags._position = initialPosition();
294         noninherited_flags._floating = initialFloating();
295         noninherited_flags._table_layout = initialTableLayout();
296         noninherited_flags._page_break_before = initialPageBreak();
297         noninherited_flags._page_break_after = initialPageBreak();
298         noninherited_flags._page_break_inside = initialPageBreak();
299         noninherited_flags._styleType = NOPSEUDO;
300         noninherited_flags._affectedByHover = false;
301         noninherited_flags._affectedByActive = false;
302         noninherited_flags._affectedByDrag = false;
303         noninherited_flags._pseudoBits = 0;
304         noninherited_flags._unicodeBidi = initialUnicodeBidi();
305         noninherited_flags._isLink = false;
306     }
307 
308 private:
309     ALWAYS_INLINE RenderStyle();
310     // used to create the default style.
311     ALWAYS_INLINE RenderStyle(bool);
312     ALWAYS_INLINE RenderStyle(const RenderStyle&);
313 
314 public:
315     static PassRefPtr<RenderStyle> create();
316     static PassRefPtr<RenderStyle> createDefaultStyle();
317     static PassRefPtr<RenderStyle> createAnonymousStyle(const RenderStyle* parentStyle);
318     static PassRefPtr<RenderStyle> clone(const RenderStyle*);
319 
320     ~RenderStyle();
321 
322     void inheritFrom(const RenderStyle* inheritParent);
323 
styleType()324     PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags._styleType); }
setStyleType(PseudoId styleType)325     void setStyleType(PseudoId styleType) { noninherited_flags._styleType = styleType; }
326 
327     RenderStyle* getCachedPseudoStyle(PseudoId) const;
328     RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
329     void removeCachedPseudoStyle(PseudoId);
330 
cachedPseudoStyles()331     const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
332 
affectedByHoverRules()333     bool affectedByHoverRules() const { return noninherited_flags._affectedByHover; }
affectedByActiveRules()334     bool affectedByActiveRules() const { return noninherited_flags._affectedByActive; }
affectedByDragRules()335     bool affectedByDragRules() const { return noninherited_flags._affectedByDrag; }
336 
setAffectedByHoverRules(bool b)337     void setAffectedByHoverRules(bool b) { noninherited_flags._affectedByHover = b; }
setAffectedByActiveRules(bool b)338     void setAffectedByActiveRules(bool b) { noninherited_flags._affectedByActive = b; }
setAffectedByDragRules(bool b)339     void setAffectedByDragRules(bool b) { noninherited_flags._affectedByDrag = b; }
340 
341     bool operator==(const RenderStyle& other) const;
342     bool operator!=(const RenderStyle& other) const { return !(*this == other); }
isFloating()343     bool isFloating() const { return !(noninherited_flags._floating == FNONE); }
hasMargin()344     bool hasMargin() const { return surround->margin.nonZero(); }
hasBorder()345     bool hasBorder() const { return surround->border.hasBorder(); }
hasPadding()346     bool hasPadding() const { return surround->padding.nonZero(); }
hasOffset()347     bool hasOffset() const { return surround->offset.nonZero(); }
348 
hasBackgroundImage()349     bool hasBackgroundImage() const { return m_background->background().hasImage(); }
hasFixedBackgroundImage()350     bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
hasAppearance()351     bool hasAppearance() const { return appearance() != NoControlPart; }
352 
hasBackground()353     bool hasBackground() const
354     {
355         Color color = visitedDependentColor(CSSPropertyBackgroundColor);
356         if (color.isValid() && color.alpha() > 0)
357             return true;
358         return hasBackgroundImage();
359     }
360 
visuallyOrdered()361     bool visuallyOrdered() const { return inherited_flags._visuallyOrdered; }
setVisuallyOrdered(bool b)362     void setVisuallyOrdered(bool b) { inherited_flags._visuallyOrdered = b; }
363 
364     bool isStyleAvailable() const;
365 
366     bool hasAnyPublicPseudoStyles() const;
367     bool hasPseudoStyle(PseudoId pseudo) const;
368     void setHasPseudoStyle(PseudoId pseudo);
369 
370     // attribute getter methods
371 
display()372     EDisplay display() const { return static_cast<EDisplay>(noninherited_flags._effectiveDisplay); }
originalDisplay()373     EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags._originalDisplay); }
374 
left()375     Length left() const { return surround->offset.left(); }
right()376     Length right() const { return surround->offset.right(); }
top()377     Length top() const { return surround->offset.top(); }
bottom()378     Length bottom() const { return surround->offset.bottom(); }
379 
380     // Accessors for positioned object edges that take into account writing mode.
logicalLeft()381     Length logicalLeft() const { return isHorizontalWritingMode() ? left() : top(); }
logicalRight()382     Length logicalRight() const { return isHorizontalWritingMode() ? right() : bottom(); }
logicalTop()383     Length logicalTop() const { return isHorizontalWritingMode() ? (isFlippedBlocksWritingMode() ? bottom() : top()) : (isFlippedBlocksWritingMode() ? right() : left()); }
logicalBottom()384     Length logicalBottom() const { return isHorizontalWritingMode() ? (isFlippedBlocksWritingMode() ? top() : bottom()) : (isFlippedBlocksWritingMode() ? left() : right()); }
385 
386     // Whether or not a positioned element requires normal flow x/y to be computed
387     // to determine its position.
hasAutoLeftAndRight()388     bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
hasAutoTopAndBottom()389     bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
hasStaticInlinePosition(bool horizontal)390     bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
hasStaticBlockPosition(bool horizontal)391     bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
392 
position()393     EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
floating()394     EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
395 
width()396     Length width() const { return m_box->width(); }
height()397     Length height() const { return m_box->height(); }
minWidth()398     Length minWidth() const { return m_box->minWidth(); }
maxWidth()399     Length maxWidth() const { return m_box->maxWidth(); }
minHeight()400     Length minHeight() const { return m_box->minHeight(); }
maxHeight()401     Length maxHeight() const { return m_box->maxHeight(); }
402 
403     Length logicalWidth() const;
404     Length logicalHeight() const;
405     Length logicalMinWidth() const;
406     Length logicalMaxWidth() const;
407     Length logicalMinHeight() const;
408     Length logicalMaxHeight() const;
409 
border()410     const BorderData& border() const { return surround->border; }
borderLeft()411     const BorderValue& borderLeft() const { return surround->border.left(); }
borderRight()412     const BorderValue& borderRight() const { return surround->border.right(); }
borderTop()413     const BorderValue& borderTop() const { return surround->border.top(); }
borderBottom()414     const BorderValue& borderBottom() const { return surround->border.bottom(); }
415 
416     const BorderValue& borderBefore() const;
417     const BorderValue& borderAfter() const;
418     const BorderValue& borderStart() const;
419     const BorderValue& borderEnd() const;
420 
borderImage()421     const NinePieceImage& borderImage() const { return surround->border.image(); }
422 
borderTopLeftRadius()423     const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
borderTopRightRadius()424     const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
borderBottomLeftRadius()425     const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
borderBottomRightRadius()426     const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
hasBorderRadius()427     bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
428 
borderLeftWidth()429     unsigned short borderLeftWidth() const { return surround->border.borderLeftWidth(); }
borderLeftStyle()430     EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
borderLeftIsTransparent()431     bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
borderRightWidth()432     unsigned short borderRightWidth() const { return surround->border.borderRightWidth(); }
borderRightStyle()433     EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
borderRightIsTransparent()434     bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
borderTopWidth()435     unsigned short borderTopWidth() const { return surround->border.borderTopWidth(); }
borderTopStyle()436     EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
borderTopIsTransparent()437     bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
borderBottomWidth()438     unsigned short borderBottomWidth() const { return surround->border.borderBottomWidth(); }
borderBottomStyle()439     EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
borderBottomIsTransparent()440     bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
441 
442     unsigned short borderBeforeWidth() const;
443     unsigned short borderAfterWidth() const;
444     unsigned short borderStartWidth() const;
445     unsigned short borderEndWidth() const;
446 
outlineSize()447     unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
outlineWidth()448     unsigned short outlineWidth() const
449     {
450         if (m_background->outline().style() == BNONE)
451             return 0;
452         return m_background->outline().width();
453     }
hasOutline()454     bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
outlineStyle()455     EBorderStyle outlineStyle() const { return m_background->outline().style(); }
outlineStyleIsAuto()456     bool outlineStyleIsAuto() const { return m_background->outline().isAuto(); }
457 
overflowX()458     EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
overflowY()459     EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
460 
visibility()461     EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
verticalAlign()462     EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
verticalAlignLength()463     Length verticalAlignLength() const { return m_box->verticalAlign(); }
464 
clipLeft()465     Length clipLeft() const { return visual->clip.left(); }
clipRight()466     Length clipRight() const { return visual->clip.right(); }
clipTop()467     Length clipTop() const { return visual->clip.top(); }
clipBottom()468     Length clipBottom() const { return visual->clip.bottom(); }
clip()469     LengthBox clip() const { return visual->clip; }
hasClip()470     bool hasClip() const { return visual->hasClip; }
471 
unicodeBidi()472     EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags._unicodeBidi); }
473 
clear()474     EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
tableLayout()475     ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
476 
font()477     const Font& font() const { return inherited->font; }
fontMetrics()478     const FontMetrics& fontMetrics() const { return inherited->font.fontMetrics(); }
fontDescription()479     const FontDescription& fontDescription() const { return inherited->font.fontDescription(); }
fontSize()480     int fontSize() const { return inherited->font.pixelSize(); }
481 
textIndent()482     Length textIndent() const { return rareInheritedData->indent; }
textAlign()483     ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
textTransform()484     ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
textDecorationsInEffect()485     int textDecorationsInEffect() const { return inherited_flags._text_decorations; }
textDecoration()486     int textDecoration() const { return visual->textDecoration; }
wordSpacing()487     int wordSpacing() const { return inherited->font.wordSpacing(); }
letterSpacing()488     int letterSpacing() const { return inherited->font.letterSpacing(); }
489 
zoom()490     float zoom() const { return visual->m_zoom; }
effectiveZoom()491     float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
492 
direction()493     TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
isLeftToRightDirection()494     bool isLeftToRightDirection() const { return direction() == LTR; }
495 
lineHeight()496     Length lineHeight() const { return inherited->line_height; }
computedLineHeight()497     int computedLineHeight() const
498     {
499         Length lh = lineHeight();
500 
501         // Negative value means the line height is not set.  Use the font's built-in spacing.
502         if (lh.isNegative())
503             return fontMetrics().lineSpacing();
504 
505         if (lh.isPercent())
506             return lh.calcMinValue(fontSize());
507 
508         return lh.value();
509     }
510 
whiteSpace()511     EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
autoWrap(EWhiteSpace ws)512     static bool autoWrap(EWhiteSpace ws)
513     {
514         // Nowrap and pre don't automatically wrap.
515         return ws != NOWRAP && ws != PRE;
516     }
517 
autoWrap()518     bool autoWrap() const
519     {
520         return autoWrap(whiteSpace());
521     }
522 
preserveNewline(EWhiteSpace ws)523     static bool preserveNewline(EWhiteSpace ws)
524     {
525         // Normal and nowrap do not preserve newlines.
526         return ws != NORMAL && ws != NOWRAP;
527     }
528 
preserveNewline()529     bool preserveNewline() const
530     {
531         return preserveNewline(whiteSpace());
532     }
533 
collapseWhiteSpace(EWhiteSpace ws)534     static bool collapseWhiteSpace(EWhiteSpace ws)
535     {
536         // Pre and prewrap do not collapse whitespace.
537         return ws != PRE && ws != PRE_WRAP;
538     }
539 
collapseWhiteSpace()540     bool collapseWhiteSpace() const
541     {
542         return collapseWhiteSpace(whiteSpace());
543     }
544 
isCollapsibleWhiteSpace(UChar c)545     bool isCollapsibleWhiteSpace(UChar c) const
546     {
547         switch (c) {
548             case ' ':
549             case '\t':
550                 return collapseWhiteSpace();
551             case '\n':
552                 return !preserveNewline();
553         }
554         return false;
555     }
556 
breakOnlyAfterWhiteSpace()557     bool breakOnlyAfterWhiteSpace() const
558     {
559         return whiteSpace() == PRE_WRAP || khtmlLineBreak() == AFTER_WHITE_SPACE;
560     }
561 
breakWords()562     bool breakWords() const
563     {
564         return wordBreak() == BreakWordBreak || wordWrap() == BreakWordWrap;
565     }
566 
backgroundRepeatX()567     EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
backgroundRepeatY()568     EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
backgroundComposite()569     CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
backgroundAttachment()570     EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
backgroundClip()571     EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
backgroundOrigin()572     EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
backgroundXPosition()573     Length backgroundXPosition() const { return m_background->background().xPosition(); }
backgroundYPosition()574     Length backgroundYPosition() const { return m_background->background().yPosition(); }
backgroundSizeType()575     EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
backgroundSizeLength()576     LengthSize backgroundSizeLength() const { return m_background->background().sizeLength(); }
accessBackgroundLayers()577     FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
backgroundLayers()578     const FillLayer* backgroundLayers() const { return &(m_background->background()); }
579 
maskImage()580     StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
maskRepeatX()581     EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
maskRepeatY()582     EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
maskComposite()583     CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
maskAttachment()584     EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.attachment()); }
maskClip()585     EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
maskOrigin()586     EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
maskXPosition()587     Length maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
maskYPosition()588     Length maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
maskSizeType()589     EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
maskSizeLength()590     LengthSize maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
accessMaskLayers()591     FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
maskLayers()592     const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
maskBoxImage()593     const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
594 
595     // returns true for collapsing borders, false for separate borders
borderCollapse()596     bool borderCollapse() const { return inherited_flags._border_collapse; }
horizontalBorderSpacing()597     short horizontalBorderSpacing() const { return inherited->horizontal_border_spacing; }
verticalBorderSpacing()598     short verticalBorderSpacing() const { return inherited->vertical_border_spacing; }
emptyCells()599     EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
captionSide()600     ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
601 
counterIncrement()602     short counterIncrement() const { return rareNonInheritedData->m_counterIncrement; }
counterReset()603     short counterReset() const { return rareNonInheritedData->m_counterReset; }
604 
listStyleType()605     EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
listStyleImage()606     StyleImage* listStyleImage() const { return inherited->list_style_image.get(); }
listStylePosition()607     EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
608 
marginTop()609     Length marginTop() const { return surround->margin.top(); }
marginBottom()610     Length marginBottom() const { return surround->margin.bottom(); }
marginLeft()611     Length marginLeft() const { return surround->margin.left(); }
marginRight()612     Length marginRight() const { return surround->margin.right(); }
613     Length marginBefore() const;
614     Length marginAfter() const;
615     Length marginStart() const;
616     Length marginEnd() const;
617     Length marginStartUsing(const RenderStyle* otherStyle) const;
618     Length marginEndUsing(const RenderStyle* otherStyle) const;
619     Length marginBeforeUsing(const RenderStyle* otherStyle) const;
620     Length marginAfterUsing(const RenderStyle* otherStyle) const;
621 
paddingBox()622     LengthBox paddingBox() const { return surround->padding; }
paddingTop()623     Length paddingTop() const { return surround->padding.top(); }
paddingBottom()624     Length paddingBottom() const { return surround->padding.bottom(); }
paddingLeft()625     Length paddingLeft() const { return surround->padding.left(); }
paddingRight()626     Length paddingRight() const { return surround->padding.right(); }
627     Length paddingBefore() const;
628     Length paddingAfter() const;
629     Length paddingStart() const;
630     Length paddingEnd() const;
631 
cursor()632     ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
633 
cursors()634     CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
635 
insideLink()636     EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
isLink()637     bool isLink() const { return noninherited_flags._isLink; }
638 
widows()639     short widows() const { return rareInheritedData->widows; }
orphans()640     short orphans() const { return rareInheritedData->orphans; }
pageBreakInside()641     EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
pageBreakBefore()642     EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
pageBreakAfter()643     EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
644 
645     // CSS3 Getter Methods
646 
outlineOffset()647     int outlineOffset() const
648     {
649         if (m_background->outline().style() == BNONE)
650             return 0;
651         return m_background->outline().offset();
652     }
653 
textShadow()654     const ShadowData* textShadow() const { return rareInheritedData->textShadow; }
getTextShadowExtent(int & top,int & right,int & bottom,int & left)655     void getTextShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
getTextShadowHorizontalExtent(int & left,int & right)656     void getTextShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
getTextShadowVerticalExtent(int & top,int & bottom)657     void getTextShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
getTextShadowInlineDirectionExtent(int & logicalLeft,int & logicalRight)658     void getTextShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
getTextShadowBlockDirectionExtent(int & logicalTop,int & logicalBottom)659     void getTextShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
660 
textStrokeWidth()661     float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
colorSpace()662     ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
opacity()663     float opacity() const { return rareNonInheritedData->opacity; }
appearance()664     ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
boxAlign()665     EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->align); }
boxDirection()666     EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
boxFlex()667     float boxFlex() { return rareNonInheritedData->flexibleBox->flex; }
boxFlexGroup()668     unsigned int boxFlexGroup() const { return rareNonInheritedData->flexibleBox->flex_group; }
boxLines()669     EBoxLines boxLines() { return static_cast<EBoxLines>(rareNonInheritedData->flexibleBox->lines); }
boxOrdinalGroup()670     unsigned int boxOrdinalGroup() const { return rareNonInheritedData->flexibleBox->ordinal_group; }
boxOrient()671     EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->flexibleBox->orient); }
boxPack()672     EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); }
673 
boxShadow()674     const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
getBoxShadowExtent(int & top,int & right,int & bottom,int & left)675     void getBoxShadowExtent(int& top, int& right, int& bottom, int& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
getBoxShadowHorizontalExtent(int & left,int & right)676     void getBoxShadowHorizontalExtent(int& left, int& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
getBoxShadowVerticalExtent(int & top,int & bottom)677     void getBoxShadowVerticalExtent(int& top, int& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
getBoxShadowInlineDirectionExtent(int & logicalLeft,int & logicalRight)678     void getBoxShadowInlineDirectionExtent(int& logicalLeft, int& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
getBoxShadowBlockDirectionExtent(int & logicalTop,int & logicalBottom)679     void getBoxShadowBlockDirectionExtent(int& logicalTop, int& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
680 
boxReflect()681     StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
boxSizing()682     EBoxSizing boxSizing() const { return m_box->boxSizing(); }
marqueeIncrement()683     Length marqueeIncrement() const { return rareNonInheritedData->marquee->increment; }
marqueeSpeed()684     int marqueeSpeed() const { return rareNonInheritedData->marquee->speed; }
marqueeLoopCount()685     int marqueeLoopCount() const { return rareNonInheritedData->marquee->loops; }
marqueeBehavior()686     EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->marquee->behavior); }
marqueeDirection()687     EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->marquee->direction); }
userModify()688     EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
userDrag()689     EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
userSelect()690     EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
textOverflow()691     bool textOverflow() const { return rareNonInheritedData->textOverflow; }
marginBeforeCollapse()692     EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
marginAfterCollapse()693     EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
wordBreak()694     EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
wordWrap()695     EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); }
nbspMode()696     ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
khtmlLineBreak()697     EKHTMLLineBreak khtmlLineBreak() const { return static_cast<EKHTMLLineBreak>(rareInheritedData->khtmlLineBreak); }
matchNearestMailBlockquoteColor()698     EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); }
highlight()699     const AtomicString& highlight() const { return rareInheritedData->highlight; }
hyphens()700     Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
hyphenationLimitBefore()701     short hyphenationLimitBefore() const { return rareInheritedData->hyphenationLimitBefore; }
hyphenationLimitAfter()702     short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
hyphenationString()703     const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
locale()704     const AtomicString& locale() const { return rareInheritedData->locale; }
borderFit()705     EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
resize()706     EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
columnWidth()707     float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
hasAutoColumnWidth()708     bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
columnCount()709     unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
hasAutoColumnCount()710     bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
specifiesColumns()711     bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth(); }
columnGap()712     float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
hasNormalColumnGap()713     bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
columnRuleStyle()714     EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
columnRuleWidth()715     unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
columnRuleIsTransparent()716     bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
columnSpan()717     bool columnSpan() const { return rareNonInheritedData->m_multiCol->m_columnSpan; }
columnBreakBefore()718     EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
columnBreakInside()719     EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
columnBreakAfter()720     EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
transform()721     const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
transformOriginX()722     Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
transformOriginY()723     Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
transformOriginZ()724     float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
hasTransform()725     bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
726 
textEmphasisFill()727     TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
728     TextEmphasisMark textEmphasisMark() const;
textEmphasisCustomMark()729     const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
textEmphasisPosition()730     TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
731     const AtomicString& textEmphasisMarkString() const;
732 
733     // Return true if any transform related property (currently transform, transformStyle3D or perspective)
734     // indicates that we are transforming
hasTransformRelatedProperty()735     bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
736 
737     enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
738     void applyTransform(TransformationMatrix&, const IntSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
739     void setPageScaleTransform(float);
740 
hasMask()741     bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
742 
textCombine()743     TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
hasTextCombine()744     bool hasTextCombine() const { return textCombine() != TextCombineNone; }
745     // End CSS3 Getters
746 
747     // Apple-specific property getter methods
pointerEvents()748     EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
animations()749     const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
transitions()750     const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
751 
752     AnimationList* accessAnimations();
753     AnimationList* accessTransitions();
754 
hasAnimations()755     bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
hasTransitions()756     bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
757 
758     // return the first found Animation (including 'all' transitions)
759     const Animation* transitionForProperty(int property) const;
760 
transformStyle3D()761     ETransformStyle3D transformStyle3D() const { return rareNonInheritedData->m_transformStyle3D; }
preserves3D()762     bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
763 
backfaceVisibility()764     EBackfaceVisibility backfaceVisibility() const { return rareNonInheritedData->m_backfaceVisibility; }
perspective()765     float perspective() const { return rareNonInheritedData->m_perspective; }
hasPerspective()766     bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
perspectiveOriginX()767     Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
perspectiveOriginY()768     Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
pageSize()769     LengthSize pageSize() const { return rareNonInheritedData->m_pageSize; }
pageSizeType()770     PageSizeType pageSizeType() const { return rareNonInheritedData->m_pageSizeType; }
771 
772 #if USE(ACCELERATED_COMPOSITING)
773     // When set, this ensures that styles compare as different. Used during accelerated animations.
isRunningAcceleratedAnimation()774     bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
775 #endif
776 
lineBoxContain()777     LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
lineClamp()778     const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
textSizeAdjust()779     bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
textSecurity()780     ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
781 
writingMode()782     WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
isHorizontalWritingMode()783     bool isHorizontalWritingMode() const { return writingMode() == TopToBottomWritingMode || writingMode() == BottomToTopWritingMode; }
isFlippedLinesWritingMode()784     bool isFlippedLinesWritingMode() const { return writingMode() == LeftToRightWritingMode || writingMode() == BottomToTopWritingMode; }
isFlippedBlocksWritingMode()785     bool isFlippedBlocksWritingMode() const { return writingMode() == RightToLeftWritingMode || writingMode() == BottomToTopWritingMode; }
786 
speak()787     ESpeak speak() { return static_cast<ESpeak>(rareInheritedData->speak); }
788 
789 #ifdef ANDROID_CSS_RING
790     // called when building nav cache to determine if the ring data is unchanged
ringData()791     const void* ringData() const { return reinterpret_cast<const void*>(rareInheritedData.get()); }
ringFillColor()792     Color ringFillColor() const { return rareInheritedData->ringFillColor; }
ringInnerWidth()793     Length ringInnerWidth() const { return rareInheritedData->ringInnerWidth; }
ringOuterWidth()794     Length ringOuterWidth() const { return rareInheritedData->ringOuterWidth; }
ringOutset()795     Length ringOutset() const { return rareInheritedData->ringOutset; }
ringPressedInnerColor()796     Color ringPressedInnerColor() const { return rareInheritedData->ringPressedInnerColor; }
ringPressedOuterColor()797     Color ringPressedOuterColor() const { return rareInheritedData->ringPressedOuterColor; }
ringRadius()798     Length ringRadius() const { return rareInheritedData->ringRadius; }
ringSelectedInnerColor()799     Color ringSelectedInnerColor() const { return rareInheritedData->ringSelectedInnerColor; }
ringSelectedOuterColor()800     Color ringSelectedOuterColor() const { return rareInheritedData->ringSelectedOuterColor; }
801 #endif
802 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
tapHighlightColor()803     Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
804 #endif
805 // attribute setter methods
806 
setDisplay(EDisplay v)807     void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
setOriginalDisplay(EDisplay v)808     void setOriginalDisplay(EDisplay v) { noninherited_flags._originalDisplay = v; }
setPosition(EPosition v)809     void setPosition(EPosition v) { noninherited_flags._position = v; }
setFloating(EFloat v)810     void setFloating(EFloat v) { noninherited_flags._floating = v; }
811 
setLeft(Length v)812     void setLeft(Length v) { SET_VAR(surround, offset.m_left, v) }
setRight(Length v)813     void setRight(Length v) { SET_VAR(surround, offset.m_right, v) }
setTop(Length v)814     void setTop(Length v) { SET_VAR(surround, offset.m_top, v) }
setBottom(Length v)815     void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v) }
816 
setWidth(Length v)817     void setWidth(Length v) { SET_VAR(m_box, m_width, v) }
setHeight(Length v)818     void setHeight(Length v) { SET_VAR(m_box, m_height, v) }
819 
setMinWidth(Length v)820     void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, v) }
setMaxWidth(Length v)821     void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, v) }
setMinHeight(Length v)822     void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v) }
setMaxHeight(Length v)823     void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v) }
824 
825 #if ENABLE(DASHBOARD_SUPPORT)
dashboardRegions()826     Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
setDashboardRegions(Vector<StyleDashboardRegion> regions)827     void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
828 
setDashboardRegion(int type,const String & label,Length t,Length r,Length b,Length l,bool append)829     void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append)
830     {
831         StyleDashboardRegion region;
832         region.label = label;
833         region.offset.m_top = t;
834         region.offset.m_right = r;
835         region.offset.m_bottom = b;
836         region.offset.m_left = l;
837         region.type = type;
838         if (!append)
839             rareNonInheritedData.access()->m_dashboardRegions.clear();
840         rareNonInheritedData.access()->m_dashboardRegions.append(region);
841     }
842 #endif
843 
resetBorder()844     void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
resetBorderTop()845     void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) }
resetBorderRight()846     void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) }
resetBorderBottom()847     void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()) }
resetBorderLeft()848     void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()) }
resetBorderImage()849     void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()) }
resetBorderRadius()850     void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
resetBorderTopLeftRadius()851     void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()) }
resetBorderTopRightRadius()852     void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()) }
resetBorderBottomLeftRadius()853     void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()) }
resetBorderBottomRightRadius()854     void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) }
855 
resetOutline()856     void resetOutline() { SET_VAR(m_background, m_outline, OutlineValue()) }
857 
setBackgroundColor(const Color & v)858     void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v) }
859 
setBackgroundXPosition(Length l)860     void setBackgroundXPosition(Length l) { SET_VAR(m_background, m_background.m_xPosition, l) }
setBackgroundYPosition(Length l)861     void setBackgroundYPosition(Length l) { SET_VAR(m_background, m_background.m_yPosition, l) }
setBackgroundSize(EFillSizeType b)862     void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b) }
setBackgroundSizeLength(LengthSize l)863     void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) }
864 
setBorderImage(const NinePieceImage & b)865     void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) }
866 
setBorderTopLeftRadius(const LengthSize & s)867     void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_topLeft, s) }
setBorderTopRightRadius(const LengthSize & s)868     void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_topRight, s) }
setBorderBottomLeftRadius(const LengthSize & s)869     void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomLeft, s) }
setBorderBottomRightRadius(const LengthSize & s)870     void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(surround, border.m_bottomRight, s) }
871 
setBorderRadius(const LengthSize & s)872     void setBorderRadius(const LengthSize& s)
873     {
874         setBorderTopLeftRadius(s);
875         setBorderTopRightRadius(s);
876         setBorderBottomLeftRadius(s);
877         setBorderBottomRightRadius(s);
878     }
setBorderRadius(const IntSize & s)879     void setBorderRadius(const IntSize& s)
880     {
881         setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
882     }
883 
884     RoundedIntRect getRoundedBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
885     RoundedIntRect getRoundedInnerBorderFor(const IntRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
886 
887     RoundedIntRect getRoundedInnerBorderFor(const IntRect& borderRect,
888         int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
889 
setBorderLeftWidth(unsigned short v)890     void setBorderLeftWidth(unsigned short v) { SET_VAR(surround, border.m_left.m_width, v) }
setBorderLeftStyle(EBorderStyle v)891     void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) }
setBorderLeftColor(const Color & v)892     void setBorderLeftColor(const Color& v) { SET_VAR(surround, border.m_left.m_color, v) }
setBorderRightWidth(unsigned short v)893     void setBorderRightWidth(unsigned short v) { SET_VAR(surround, border.m_right.m_width, v) }
setBorderRightStyle(EBorderStyle v)894     void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v) }
setBorderRightColor(const Color & v)895     void setBorderRightColor(const Color& v) { SET_VAR(surround, border.m_right.m_color, v) }
setBorderTopWidth(unsigned short v)896     void setBorderTopWidth(unsigned short v) { SET_VAR(surround, border.m_top.m_width, v) }
setBorderTopStyle(EBorderStyle v)897     void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v) }
setBorderTopColor(const Color & v)898     void setBorderTopColor(const Color& v) { SET_VAR(surround, border.m_top.m_color, v) }
setBorderBottomWidth(unsigned short v)899     void setBorderBottomWidth(unsigned short v) { SET_VAR(surround, border.m_bottom.m_width, v) }
setBorderBottomStyle(EBorderStyle v)900     void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) }
setBorderBottomColor(const Color & v)901     void setBorderBottomColor(const Color& v) { SET_VAR(surround, border.m_bottom.m_color, v) }
setOutlineWidth(unsigned short v)902     void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) }
903 
904     void setOutlineStyle(EBorderStyle v, bool isAuto = false)
905     {
906         SET_VAR(m_background, m_outline.m_style, v)
907         SET_VAR(m_background, m_outline.m_isAuto, isAuto)
908     }
909 
setOutlineColor(const Color & v)910     void setOutlineColor(const Color& v) { SET_VAR(m_background, m_outline.m_color, v) }
911 
setOverflowX(EOverflow v)912     void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
setOverflowY(EOverflow v)913     void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
setVisibility(EVisibility v)914     void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
setVerticalAlign(EVerticalAlign v)915     void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
setVerticalAlignLength(Length l)916     void setVerticalAlignLength(Length l) { SET_VAR(m_box, m_verticalAlign, l) }
917 
918     void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b) }
setClipLeft(Length v)919     void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v) }
setClipRight(Length v)920     void setClipRight(Length v) { SET_VAR(visual, clip.m_right, v) }
setClipTop(Length v)921     void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v) }
setClipBottom(Length v)922     void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v) }
923     void setClip(Length top, Length right, Length bottom, Length left);
setClip(LengthBox box)924     void setClip(LengthBox box) { SET_VAR(visual, clip, box) }
925 
setUnicodeBidi(EUnicodeBidi b)926     void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
927 
setClear(EClear v)928     void setClear(EClear v) { noninherited_flags._clear = v; }
setTableLayout(ETableLayout v)929     void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
930 
setFontDescription(const FontDescription & v)931     bool setFontDescription(const FontDescription& v)
932     {
933         if (inherited->font.fontDescription() != v) {
934             inherited.access()->font = Font(v, inherited->font.letterSpacing(), inherited->font.wordSpacing());
935             return true;
936         }
937         return false;
938     }
939 
940     // Only used for blending font sizes when animating.
941     void setBlendedFontSize(int);
942 
setColor(const Color & v)943     void setColor(const Color& v) { SET_VAR(inherited, color, v) }
setTextIndent(Length v)944     void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v) }
setTextAlign(ETextAlign v)945     void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
setTextTransform(ETextTransform v)946     void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
addToTextDecorationsInEffect(int v)947     void addToTextDecorationsInEffect(int v) { inherited_flags._text_decorations |= v; }
setTextDecorationsInEffect(int v)948     void setTextDecorationsInEffect(int v) { inherited_flags._text_decorations = v; }
setTextDecoration(int v)949     void setTextDecoration(int v) { SET_VAR(visual, textDecoration, v); }
setDirection(TextDirection v)950     void setDirection(TextDirection v) { inherited_flags._direction = v; }
setLineHeight(Length v)951     void setLineHeight(Length v) { SET_VAR(inherited, line_height, v) }
setZoom(float f)952     void setZoom(float f) { SET_VAR(visual, m_zoom, f); setEffectiveZoom(effectiveZoom() * zoom()); }
setEffectiveZoom(float f)953     void setEffectiveZoom(float f) { SET_VAR(rareInheritedData, m_effectiveZoom, f) }
954 
setWhiteSpace(EWhiteSpace v)955     void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
956 
setWordSpacing(int v)957     void setWordSpacing(int v) { inherited.access()->font.setWordSpacing(v); }
setLetterSpacing(int v)958     void setLetterSpacing(int v) { inherited.access()->font.setLetterSpacing(v); }
959 
clearBackgroundLayers()960     void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
inheritBackgroundLayers(const FillLayer & parent)961     void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
962 
adjustBackgroundLayers()963     void adjustBackgroundLayers()
964     {
965         if (backgroundLayers()->next()) {
966             accessBackgroundLayers()->cullEmptyLayers();
967             accessBackgroundLayers()->fillUnsetProperties();
968         }
969     }
970 
clearMaskLayers()971     void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
inheritMaskLayers(const FillLayer & parent)972     void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
973 
adjustMaskLayers()974     void adjustMaskLayers()
975     {
976         if (maskLayers()->next()) {
977             accessMaskLayers()->cullEmptyLayers();
978             accessMaskLayers()->fillUnsetProperties();
979         }
980     }
981 
setMaskBoxImage(const NinePieceImage & b)982     void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b) }
setMaskXPosition(Length l)983     void setMaskXPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, l) }
setMaskYPosition(Length l)984     void setMaskYPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, l) }
setMaskSize(LengthSize l)985     void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
986 
setBorderCollapse(bool collapse)987     void setBorderCollapse(bool collapse) { inherited_flags._border_collapse = collapse; }
setHorizontalBorderSpacing(short v)988     void setHorizontalBorderSpacing(short v) { SET_VAR(inherited, horizontal_border_spacing, v) }
setVerticalBorderSpacing(short v)989     void setVerticalBorderSpacing(short v) { SET_VAR(inherited, vertical_border_spacing, v) }
setEmptyCells(EEmptyCell v)990     void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
setCaptionSide(ECaptionSide v)991     void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
992 
setCounterIncrement(short v)993     void setCounterIncrement(short v) { SET_VAR(rareNonInheritedData, m_counterIncrement, v) }
setCounterReset(short v)994     void setCounterReset(short v) { SET_VAR(rareNonInheritedData, m_counterReset, v) }
995 
setListStyleType(EListStyleType v)996     void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
setListStyleImage(PassRefPtr<StyleImage> v)997     void setListStyleImage(PassRefPtr<StyleImage> v) { if (inherited->list_style_image != v) inherited.access()->list_style_image = v; }
setListStylePosition(EListStylePosition v)998     void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
999 
resetMargin()1000     void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
setMarginTop(Length v)1001     void setMarginTop(Length v) { SET_VAR(surround, margin.m_top, v) }
setMarginBottom(Length v)1002     void setMarginBottom(Length v) { SET_VAR(surround, margin.m_bottom, v) }
setMarginLeft(Length v)1003     void setMarginLeft(Length v) { SET_VAR(surround, margin.m_left, v) }
setMarginRight(Length v)1004     void setMarginRight(Length v) { SET_VAR(surround, margin.m_right, v) }
1005     void setMarginStart(Length);
1006     void setMarginEnd(Length);
1007 
resetPadding()1008     void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)) }
setPaddingBox(const LengthBox & b)1009     void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b) }
setPaddingTop(Length v)1010     void setPaddingTop(Length v) { SET_VAR(surround, padding.m_top, v) }
setPaddingBottom(Length v)1011     void setPaddingBottom(Length v) { SET_VAR(surround, padding.m_bottom, v) }
setPaddingLeft(Length v)1012     void setPaddingLeft(Length v) { SET_VAR(surround, padding.m_left, v) }
setPaddingRight(Length v)1013     void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) }
1014 
setCursor(ECursor c)1015     void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
1016     void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
1017     void setCursorList(PassRefPtr<CursorList>);
1018     void clearCursorList();
1019 
setInsideLink(EInsideLink insideLink)1020     void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
setIsLink(bool b)1021     void setIsLink(bool b) { noninherited_flags._isLink = b; }
1022 
forceBackgroundsToWhite()1023     bool forceBackgroundsToWhite() const { return inherited_flags._force_backgrounds_to_white; }
1024     void setForceBackgroundsToWhite(bool b=true) { inherited_flags._force_backgrounds_to_white = b; }
1025 
hasAutoZIndex()1026     bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
setHasAutoZIndex()1027     void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) }
zIndex()1028     int zIndex() const { return m_box->zIndex(); }
setZIndex(int v)1029     void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v) }
1030 
setWidows(short w)1031     void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
setOrphans(short o)1032     void setOrphans(short o) { SET_VAR(rareInheritedData, orphans, o); }
setPageBreakInside(EPageBreak b)1033     void setPageBreakInside(EPageBreak b) { noninherited_flags._page_break_inside = b; }
setPageBreakBefore(EPageBreak b)1034     void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
setPageBreakAfter(EPageBreak b)1035     void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
1036 
1037     // CSS3 Setters
setOutlineOffset(int v)1038     void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) }
1039     void setTextShadow(ShadowData* val, bool add=false);
setTextStrokeColor(const Color & c)1040     void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) }
setTextStrokeWidth(float w)1041     void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
setTextFillColor(const Color & c)1042     void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c) }
setColorSpace(ColorSpace space)1043     void setColorSpace(ColorSpace space) { SET_VAR(rareInheritedData, colorSpace, space) }
setOpacity(float f)1044     void setOpacity(float f) { SET_VAR(rareNonInheritedData, opacity, f); }
setAppearance(ControlPart a)1045     void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
setBoxAlign(EBoxAlignment a)1046     void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->flexibleBox, align, a); }
setBoxDirection(EBoxDirection d)1047     void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
setBoxFlex(float f)1048     void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->flexibleBox, flex, f); }
setBoxFlexGroup(unsigned int fg)1049     void setBoxFlexGroup(unsigned int fg) { SET_VAR(rareNonInheritedData.access()->flexibleBox, flex_group, fg); }
setBoxLines(EBoxLines l)1050     void setBoxLines(EBoxLines l) { SET_VAR(rareNonInheritedData.access()->flexibleBox, lines, l); }
setBoxOrdinalGroup(unsigned int og)1051     void setBoxOrdinalGroup(unsigned int og) { SET_VAR(rareNonInheritedData.access()->flexibleBox, ordinal_group, og); }
setBoxOrient(EBoxOrient o)1052     void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->flexibleBox, orient, o); }
setBoxPack(EBoxAlignment p)1053     void setBoxPack(EBoxAlignment p) { SET_VAR(rareNonInheritedData.access()->flexibleBox, pack, p); }
1054     void setBoxShadow(ShadowData* val, bool add=false);
setBoxReflect(PassRefPtr<StyleReflection> reflect)1055     void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
setBoxSizing(EBoxSizing s)1056     void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
setMarqueeIncrement(const Length & f)1057     void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->marquee, increment, f); }
setMarqueeSpeed(int f)1058     void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->marquee, speed, f); }
setMarqueeDirection(EMarqueeDirection d)1059     void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->marquee, direction, d); }
setMarqueeBehavior(EMarqueeBehavior b)1060     void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(rareNonInheritedData.access()->marquee, behavior, b); }
setMarqueeLoopCount(int i)1061     void setMarqueeLoopCount(int i) { SET_VAR(rareNonInheritedData.access()->marquee, loops, i); }
setUserModify(EUserModify u)1062     void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
setUserDrag(EUserDrag d)1063     void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
setUserSelect(EUserSelect s)1064     void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
setTextOverflow(bool b)1065     void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); }
setMarginBeforeCollapse(EMarginCollapse c)1066     void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
setMarginAfterCollapse(EMarginCollapse c)1067     void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
setWordBreak(EWordBreak b)1068     void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
setWordWrap(EWordWrap b)1069     void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); }
setNBSPMode(ENBSPMode b)1070     void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
setKHTMLLineBreak(EKHTMLLineBreak b)1071     void setKHTMLLineBreak(EKHTMLLineBreak b) { SET_VAR(rareInheritedData, khtmlLineBreak, b); }
setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c)1072     void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); }
setHighlight(const AtomicString & h)1073     void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
setHyphens(Hyphens h)1074     void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
setHyphenationLimitBefore(short limit)1075     void setHyphenationLimitBefore(short limit) { SET_VAR(rareInheritedData, hyphenationLimitBefore, limit); }
setHyphenationLimitAfter(short limit)1076     void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
setHyphenationString(const AtomicString & h)1077     void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
setLocale(const AtomicString & locale)1078     void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
setBorderFit(EBorderFit b)1079     void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
setResize(EResize r)1080     void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
setColumnWidth(float f)1081     void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
setHasAutoColumnWidth()1082     void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, 0); }
setColumnCount(unsigned short c)1083     void setColumnCount(unsigned short c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, c); }
setHasAutoColumnCount()1084     void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
setColumnGap(float f)1085     void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
setHasNormalColumnGap()1086     void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
setColumnRuleColor(const Color & c)1087     void setColumnRuleColor(const Color& c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_color, c); }
setColumnRuleStyle(EBorderStyle b)1088     void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
setColumnRuleWidth(unsigned short w)1089     void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); }
resetColumnRule()1090     void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) }
setColumnSpan(bool b)1091     void setColumnSpan(bool b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_columnSpan, b); }
setColumnBreakBefore(EPageBreak p)1092     void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
setColumnBreakInside(EPageBreak p)1093     void setColumnBreakInside(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
setColumnBreakAfter(EPageBreak p)1094     void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
inheritColumnPropertiesFrom(RenderStyle * parent)1095     void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
setTransform(const TransformOperations & ops)1096     void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
setTransformOriginX(Length l)1097     void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
setTransformOriginY(Length l)1098     void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
setTransformOriginZ(float f)1099     void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
setSpeak(ESpeak s)1100     void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
setTextCombine(TextCombine v)1101     void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
setTextEmphasisColor(const Color & c)1102     void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c) }
setTextEmphasisFill(TextEmphasisFill fill)1103     void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
setTextEmphasisMark(TextEmphasisMark mark)1104     void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
setTextEmphasisCustomMark(const AtomicString & mark)1105     void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
setTextEmphasisPosition(TextEmphasisPosition position)1106     void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1107     // End CSS3 Setters
1108 
1109     // Apple-specific property setters
setPointerEvents(EPointerEvents p)1110     void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
1111 
clearAnimations()1112     void clearAnimations()
1113     {
1114         rareNonInheritedData.access()->m_animations.clear();
1115     }
1116 
clearTransitions()1117     void clearTransitions()
1118     {
1119         rareNonInheritedData.access()->m_transitions.clear();
1120     }
1121 
inheritAnimations(const AnimationList * parent)1122     void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); }
inheritTransitions(const AnimationList * parent)1123     void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : PassOwnPtr<AnimationList>(); }
1124     void adjustAnimations();
1125     void adjustTransitions();
1126 
setTransformStyle3D(ETransformStyle3D b)1127     void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
setBackfaceVisibility(EBackfaceVisibility b)1128     void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
setPerspective(float p)1129     void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
setPerspectiveOriginX(Length l)1130     void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
setPerspectiveOriginY(Length l)1131     void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
setPageSize(LengthSize s)1132     void setPageSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
setPageSizeType(PageSizeType t)1133     void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
resetPageSizeType()1134     void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
1135 
1136 #if USE(ACCELERATED_COMPOSITING)
1137     void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
1138 #endif
1139 
setLineBoxContain(LineBoxContain c)1140     void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
setLineClamp(LineClampValue c)1141     void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
setTextSizeAdjust(bool b)1142     void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); }
setTextSecurity(ETextSecurity aTextSecurity)1143     void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
1144 
1145 #ifdef ANDROID_CSS_RING
setRingFillColor(const Color & v)1146     void setRingFillColor(const Color& v) { SET_VAR(rareInheritedData, ringFillColor, v); }
setRingInnerWidth(Length v)1147     void setRingInnerWidth(Length v) { SET_VAR(rareInheritedData, ringInnerWidth, v); }
setRingOuterWidth(Length v)1148     void setRingOuterWidth(Length v) { SET_VAR(rareInheritedData, ringOuterWidth, v); }
setRingOutset(Length v)1149     void setRingOutset(Length v) { SET_VAR(rareInheritedData, ringOutset, v); }
setRingPressedInnerColor(const Color & v)1150     void setRingPressedInnerColor(const Color& v) {
1151         SET_VAR(rareInheritedData, ringPressedInnerColor, v); }
setRingPressedOuterColor(const Color & v)1152     void setRingPressedOuterColor(const Color& v) {
1153         SET_VAR(rareInheritedData, ringPressedOuterColor, v); }
setRingRadius(Length v)1154     void setRingRadius(Length v) { SET_VAR(rareInheritedData, ringRadius, v); }
setRingSelectedInnerColor(const Color & v)1155     void setRingSelectedInnerColor(const Color& v) {
1156         SET_VAR(rareInheritedData, ringSelectedInnerColor, v); }
setRingSelectedOuterColor(const Color & v)1157     void setRingSelectedOuterColor(const Color& v) {
1158         SET_VAR(rareInheritedData, ringSelectedOuterColor, v); }
1159 #endif
1160 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
setTapHighlightColor(const Color & v)1161     void setTapHighlightColor(const Color& v) { SET_VAR(rareInheritedData, tapHighlightColor, v); }
1162 #endif
1163 
1164 #if ENABLE(SVG)
svgStyle()1165     const SVGRenderStyle* svgStyle() const { return m_svgStyle.get(); }
accessSVGStyle()1166     SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
1167 
fillOpacity()1168     float fillOpacity() const { return svgStyle()->fillOpacity(); }
setFillOpacity(float f)1169     void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
1170 
strokeOpacity()1171     float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
setStrokeOpacity(float f)1172     void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
1173 
floodOpacity()1174     float floodOpacity() const { return svgStyle()->floodOpacity(); }
setFloodOpacity(float f)1175     void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); }
1176 #endif
1177 
contentData()1178     const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
contentDataEquivalent(const RenderStyle * otherStyle)1179     bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
1180     void clearContent();
1181     void setContent(PassRefPtr<StringImpl>, bool add = false);
1182     void setContent(PassRefPtr<StyleImage>, bool add = false);
1183     void setContent(PassOwnPtr<CounterContent>, bool add = false);
1184     void setContent(QuoteType, bool add = false);
1185 
1186     const CounterDirectiveMap* counterDirectives() const;
1187     CounterDirectiveMap& accessCounterDirectives();
1188 
quotes()1189     QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
1190     void setQuotes(PassRefPtr<QuotesData>);
1191 
1192     const AtomicString& hyphenString() const;
1193 
1194     bool inheritedNotEqual(const RenderStyle*) const;
1195 
1196     StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
1197 
isDisplayReplacedType()1198     bool isDisplayReplacedType() const
1199     {
1200         return display() == INLINE_BLOCK || display() == INLINE_BOX || display() == INLINE_TABLE;
1201     }
1202 
isDisplayInlineType()1203     bool isDisplayInlineType() const
1204     {
1205         return display() == INLINE || isDisplayReplacedType();
1206     }
1207 
isOriginalDisplayInlineType()1208     bool isOriginalDisplayInlineType() const
1209     {
1210         return originalDisplay() == INLINE || originalDisplay() == INLINE_BLOCK
1211             || originalDisplay() == INLINE_BOX || originalDisplay() == INLINE_TABLE;
1212     }
1213 
setWritingMode(WritingMode v)1214     void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
1215 
1216     // To tell if this style matched attribute selectors. This makes it impossible to share.
affectedByAttributeSelectors()1217     bool affectedByAttributeSelectors() const { return m_affectedByAttributeSelectors; }
setAffectedByAttributeSelectors()1218     void setAffectedByAttributeSelectors() { m_affectedByAttributeSelectors = true; }
1219 
unique()1220     bool unique() const { return m_unique; }
setUnique()1221     void setUnique() { m_unique = true; }
1222 
1223     // Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
affectedByEmpty()1224     bool affectedByEmpty() const { return m_affectedByEmpty; }
emptyState()1225     bool emptyState() const { return m_emptyState; }
setEmptyState(bool b)1226     void setEmptyState(bool b) { m_affectedByEmpty = true; m_unique = true; m_emptyState = b; }
childrenAffectedByPositionalRules()1227     bool childrenAffectedByPositionalRules() const { return childrenAffectedByForwardPositionalRules() || childrenAffectedByBackwardPositionalRules(); }
childrenAffectedByFirstChildRules()1228     bool childrenAffectedByFirstChildRules() const { return m_childrenAffectedByFirstChildRules; }
setChildrenAffectedByFirstChildRules()1229     void setChildrenAffectedByFirstChildRules() { m_childrenAffectedByFirstChildRules = true; }
childrenAffectedByLastChildRules()1230     bool childrenAffectedByLastChildRules() const { return m_childrenAffectedByLastChildRules; }
setChildrenAffectedByLastChildRules()1231     void setChildrenAffectedByLastChildRules() { m_childrenAffectedByLastChildRules = true; }
childrenAffectedByDirectAdjacentRules()1232     bool childrenAffectedByDirectAdjacentRules() const { return m_childrenAffectedByDirectAdjacentRules; }
setChildrenAffectedByDirectAdjacentRules()1233     void setChildrenAffectedByDirectAdjacentRules() { m_childrenAffectedByDirectAdjacentRules = true; }
childrenAffectedByForwardPositionalRules()1234     bool childrenAffectedByForwardPositionalRules() const { return m_childrenAffectedByForwardPositionalRules; }
setChildrenAffectedByForwardPositionalRules()1235     void setChildrenAffectedByForwardPositionalRules() { m_childrenAffectedByForwardPositionalRules = true; }
childrenAffectedByBackwardPositionalRules()1236     bool childrenAffectedByBackwardPositionalRules() const { return m_childrenAffectedByBackwardPositionalRules; }
setChildrenAffectedByBackwardPositionalRules()1237     void setChildrenAffectedByBackwardPositionalRules() { m_childrenAffectedByBackwardPositionalRules = true; }
firstChildState()1238     bool firstChildState() const { return m_firstChildState; }
setFirstChildState()1239     void setFirstChildState() { m_unique = true; m_firstChildState = true; }
lastChildState()1240     bool lastChildState() const { return m_lastChildState; }
setLastChildState()1241     void setLastChildState() { m_unique = true; m_lastChildState = true; }
childIndex()1242     unsigned childIndex() const { return m_childIndex; }
setChildIndex(unsigned index)1243     void setChildIndex(unsigned index) { m_unique = true; m_childIndex = index; }
1244 
1245     const Color visitedDependentColor(int colorProperty) const;
1246 
1247     // Initial values for all the properties
initialBorderCollapse()1248     static bool initialBorderCollapse() { return false; }
initialBorderStyle()1249     static EBorderStyle initialBorderStyle() { return BNONE; }
initialNinePieceImage()1250     static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
initialBorderRadius()1251     static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
initialCaptionSide()1252     static ECaptionSide initialCaptionSide() { return CAPTOP; }
initialClear()1253     static EClear initialClear() { return CNONE; }
initialDirection()1254     static TextDirection initialDirection() { return LTR; }
initialWritingMode()1255     static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
initialTextCombine()1256     static TextCombine initialTextCombine() { return TextCombineNone; }
initialTextOrientation()1257     static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
initialDisplay()1258     static EDisplay initialDisplay() { return INLINE; }
initialEmptyCells()1259     static EEmptyCell initialEmptyCells() { return SHOW; }
initialFloating()1260     static EFloat initialFloating() { return FNONE; }
initialListStylePosition()1261     static EListStylePosition initialListStylePosition() { return OUTSIDE; }
initialListStyleType()1262     static EListStyleType initialListStyleType() { return Disc; }
initialOverflowX()1263     static EOverflow initialOverflowX() { return OVISIBLE; }
initialOverflowY()1264     static EOverflow initialOverflowY() { return OVISIBLE; }
initialPageBreak()1265     static EPageBreak initialPageBreak() { return PBAUTO; }
initialPosition()1266     static EPosition initialPosition() { return StaticPosition; }
initialTableLayout()1267     static ETableLayout initialTableLayout() { return TAUTO; }
initialUnicodeBidi()1268     static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
initialTextTransform()1269     static ETextTransform initialTextTransform() { return TTNONE; }
initialVisibility()1270     static EVisibility initialVisibility() { return VISIBLE; }
initialWhiteSpace()1271     static EWhiteSpace initialWhiteSpace() { return NORMAL; }
initialHorizontalBorderSpacing()1272     static short initialHorizontalBorderSpacing() { return 0; }
initialVerticalBorderSpacing()1273     static short initialVerticalBorderSpacing() { return 0; }
initialCursor()1274     static ECursor initialCursor() { return CURSOR_AUTO; }
initialColor()1275     static Color initialColor() { return Color::black; }
initialListStyleImage()1276     static StyleImage* initialListStyleImage() { return 0; }
initialBorderWidth()1277     static unsigned short initialBorderWidth() { return 3; }
initialLetterWordSpacing()1278     static int initialLetterWordSpacing() { return 0; }
initialSize()1279     static Length initialSize() { return Length(); }
initialMinSize()1280     static Length initialMinSize() { return Length(0, Fixed); }
initialMaxSize()1281     static Length initialMaxSize() { return Length(undefinedLength, Fixed); }
initialOffset()1282     static Length initialOffset() { return Length(); }
initialMargin()1283     static Length initialMargin() { return Length(Fixed); }
initialPadding()1284     static Length initialPadding() { return Length(Fixed); }
initialTextIndent()1285     static Length initialTextIndent() { return Length(Fixed); }
initialVerticalAlign()1286     static EVerticalAlign initialVerticalAlign() { return BASELINE; }
initialWidows()1287     static int initialWidows() { return 2; }
initialOrphans()1288     static int initialOrphans() { return 2; }
initialLineHeight()1289     static Length initialLineHeight() { return Length(-100.0, Percent); }
initialTextAlign()1290     static ETextAlign initialTextAlign() { return TAAUTO; }
initialTextDecoration()1291     static ETextDecoration initialTextDecoration() { return TDNONE; }
initialZoom()1292     static float initialZoom() { return 1.0f; }
initialOutlineOffset()1293     static int initialOutlineOffset() { return 0; }
initialOpacity()1294     static float initialOpacity() { return 1.0f; }
initialBoxAlign()1295     static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
initialBoxDirection()1296     static EBoxDirection initialBoxDirection() { return BNORMAL; }
initialBoxLines()1297     static EBoxLines initialBoxLines() { return SINGLE; }
initialBoxOrient()1298     static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
initialBoxPack()1299     static EBoxAlignment initialBoxPack() { return BSTART; }
initialBoxFlex()1300     static float initialBoxFlex() { return 0.0f; }
initialBoxFlexGroup()1301     static int initialBoxFlexGroup() { return 1; }
initialBoxOrdinalGroup()1302     static int initialBoxOrdinalGroup() { return 1; }
initialBoxSizing()1303     static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
initialBoxReflect()1304     static StyleReflection* initialBoxReflect() { return 0; }
initialMarqueeLoopCount()1305     static int initialMarqueeLoopCount() { return -1; }
initialMarqueeSpeed()1306     static int initialMarqueeSpeed() { return 85; }
initialMarqueeIncrement()1307     static Length initialMarqueeIncrement() { return Length(6, Fixed); }
initialMarqueeBehavior()1308     static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
initialMarqueeDirection()1309     static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
initialUserModify()1310     static EUserModify initialUserModify() { return READ_ONLY; }
initialUserDrag()1311     static EUserDrag initialUserDrag() { return DRAG_AUTO; }
initialUserSelect()1312     static EUserSelect initialUserSelect() { return SELECT_TEXT; }
initialTextOverflow()1313     static bool initialTextOverflow() { return false; }
initialMarginBeforeCollapse()1314     static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
initialMarginAfterCollapse()1315     static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
initialWordBreak()1316     static EWordBreak initialWordBreak() { return NormalWordBreak; }
initialWordWrap()1317     static EWordWrap initialWordWrap() { return NormalWordWrap; }
initialNBSPMode()1318     static ENBSPMode initialNBSPMode() { return NBNORMAL; }
initialKHTMLLineBreak()1319     static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
initialMatchNearestMailBlockquoteColor()1320     static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
initialHighlight()1321     static const AtomicString& initialHighlight() { return nullAtom; }
initialSpeak()1322     static ESpeak initialSpeak() { return SpeakNormal; }
initialHyphens()1323     static Hyphens initialHyphens() { return HyphensManual; }
initialHyphenationLimitBefore()1324     static short initialHyphenationLimitBefore() { return -1; }
initialHyphenationLimitAfter()1325     static short initialHyphenationLimitAfter() { return -1; }
initialHyphenationString()1326     static const AtomicString& initialHyphenationString() { return nullAtom; }
initialLocale()1327     static const AtomicString& initialLocale() { return nullAtom; }
initialBorderFit()1328     static EBorderFit initialBorderFit() { return BorderFitBorder; }
initialResize()1329     static EResize initialResize() { return RESIZE_NONE; }
initialAppearance()1330     static ControlPart initialAppearance() { return NoControlPart; }
initialVisuallyOrdered()1331     static bool initialVisuallyOrdered() { return false; }
initialTextStrokeWidth()1332     static float initialTextStrokeWidth() { return 0; }
initialColumnCount()1333     static unsigned short initialColumnCount() { return 1; }
initialColumnSpan()1334     static bool initialColumnSpan() { return false; }
initialTransform()1335     static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
initialTransformOriginX()1336     static Length initialTransformOriginX() { return Length(50.0, Percent); }
initialTransformOriginY()1337     static Length initialTransformOriginY() { return Length(50.0, Percent); }
initialPointerEvents()1338     static EPointerEvents initialPointerEvents() { return PE_AUTO; }
initialTransformOriginZ()1339     static float initialTransformOriginZ() { return 0; }
initialTransformStyle3D()1340     static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
initialBackfaceVisibility()1341     static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
initialPerspective()1342     static float initialPerspective() { return 0; }
initialPerspectiveOriginX()1343     static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
initialPerspectiveOriginY()1344     static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
initialBackgroundColor()1345     static Color initialBackgroundColor() { return Color::transparent; }
initialTextEmphasisColor()1346     static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
initialTextEmphasisFill()1347     static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
initialTextEmphasisMark()1348     static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
initialTextEmphasisCustomMark()1349     static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
initialTextEmphasisPosition()1350     static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
initialLineBoxContain()1351     static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
1352 
1353     // Keep these at the end.
initialLineClamp()1354     static LineClampValue initialLineClamp() { return LineClampValue(); }
initialTextSizeAdjust()1355     static bool initialTextSizeAdjust() { return true; }
initialTextSecurity()1356     static ETextSecurity initialTextSecurity() { return TSNONE; }
1357 #if ENABLE(DASHBOARD_SUPPORT)
1358     static const Vector<StyleDashboardRegion>& initialDashboardRegions();
1359     static const Vector<StyleDashboardRegion>& noneDashboardRegions();
1360 #endif
1361 
1362 #ifdef ANDROID_CSS_RING
initialRingFillColor()1363     static Color initialRingFillColor() { return Color::ringFill; }
initialRingInnerWidth()1364     static Length initialRingInnerWidth() { return Length(16, Fixed); } // 1.0
initialRingOuterWidth()1365     static Length initialRingOuterWidth() { return Length(40, Fixed); } // 2.5
initialRingOutset()1366     static Length initialRingOutset() { return Length(3, Fixed); }
initialRingSelectedInnerColor()1367     static Color initialRingSelectedInnerColor() { return Color::ringSelectedInner; }
initialRingSelectedOuterColor()1368     static Color initialRingSelectedOuterColor() { return Color::ringSelectedOuter; }
initialRingPressedInnerColor()1369     static Color initialRingPressedInnerColor() { return Color::ringPressedInner; }
initialRingPressedOuterColor()1370     static Color initialRingPressedOuterColor() { return Color::ringPressedOuter; }
initialRingRadius()1371     static Length initialRingRadius() { return Length(1, Fixed); }
1372 #endif
1373 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR
initialTapHighlightColor()1374     static Color initialTapHighlightColor() { return Color::tap; }
1375 #endif
1376 
1377 private:
inheritUnicodeBidiFrom(const RenderStyle * parent)1378     void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags._unicodeBidi = parent->noninherited_flags._unicodeBidi; }
1379     void getShadowExtent(const ShadowData*, int& top, int& right, int& bottom, int& left) const;
1380     void getShadowHorizontalExtent(const ShadowData*, int& left, int& right) const;
1381     void getShadowVerticalExtent(const ShadowData*, int& top, int& bottom) const;
getShadowInlineDirectionExtent(const ShadowData * shadow,int & logicalLeft,int & logicalRight)1382     void getShadowInlineDirectionExtent(const ShadowData* shadow, int& logicalLeft, int& logicalRight) const
1383     {
1384         return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
1385     }
getShadowBlockDirectionExtent(const ShadowData * shadow,int & logicalTop,int & logicalBottom)1386     void getShadowBlockDirectionExtent(const ShadowData* shadow, int& logicalTop, int& logicalBottom) const
1387     {
1388         return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
1389     }
1390 
1391     // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
borderLeftColor()1392     const Color& borderLeftColor() const { return surround->border.left().color(); }
borderRightColor()1393     const Color& borderRightColor() const { return surround->border.right().color(); }
borderTopColor()1394     const Color& borderTopColor() const { return surround->border.top().color(); }
borderBottomColor()1395     const Color& borderBottomColor() const { return surround->border.bottom().color(); }
backgroundColor()1396     const Color& backgroundColor() const { return m_background->color(); }
color()1397     const Color& color() const { return inherited->color; }
columnRuleColor()1398     const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
outlineColor()1399     const Color& outlineColor() const { return m_background->outline().color(); }
textEmphasisColor()1400     const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
textFillColor()1401     const Color& textFillColor() const { return rareInheritedData->textFillColor; }
textStrokeColor()1402     const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
1403 
1404     const Color colorIncludingFallback(int colorProperty, EBorderStyle borderStyle) const;
1405 
1406     ContentData* prepareToSetContent(StringImpl*, bool add);
1407 };
1408 
adjustForAbsoluteZoom(int value,const RenderStyle * style)1409 inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
1410 {
1411     double zoomFactor = style->effectiveZoom();
1412     if (zoomFactor == 1)
1413         return value;
1414     // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
1415     if (zoomFactor > 1) {
1416         if (value < 0)
1417             value--;
1418         else
1419             value++;
1420     }
1421 
1422     return roundForImpreciseConversion<int, INT_MAX, INT_MIN>(value / zoomFactor);
1423 }
1424 
adjustFloatForAbsoluteZoom(float value,const RenderStyle * style)1425 inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle* style)
1426 {
1427     return value / style->effectiveZoom();
1428 }
1429 
1430 } // namespace WebCore
1431 
1432 #endif // RenderStyle_h
1433