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