OSDN Git Service

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