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, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
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.
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.
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.
28 #include "AnimationList.h"
29 #include "BorderValue.h"
30 #include "CSSLineBoxContainValue.h"
31 #include "CSSPrimitiveValue.h"
32 #include "CSSPropertyNames.h"
34 #include "ColorSpace.h"
35 #include "CounterDirectives.h"
37 #include "FontBaseline.h"
38 #include "FontDescription.h"
39 #include "GraphicsTypes.h"
40 #include "LayoutBoxExtent.h"
42 #include "LengthBox.h"
43 #include "LengthFunctions.h"
44 #include "LengthSize.h"
45 #include "LineClampValue.h"
46 #include "NinePieceImage.h"
47 #include "OutlineValue.h"
48 #include "RenderStyleConstants.h"
49 #include "RoundedRect.h"
50 #include "ShadowData.h"
51 #include "StyleBackgroundData.h"
52 #include "StyleBoxData.h"
53 #include "StyleDeprecatedFlexibleBoxData.h"
54 #include "StyleFlexibleBoxData.h"
55 #include "StyleGridData.h"
56 #include "StyleGridItemData.h"
57 #include "StyleMarqueeData.h"
58 #include "StyleMultiColData.h"
59 #include "StyleRareInheritedData.h"
60 #include "StyleRareNonInheritedData.h"
61 #include "StyleReflection.h"
62 #include "StyleSurroundData.h"
63 #include "StyleTransformData.h"
64 #include "StyleVisualData.h"
65 #include "TextDirection.h"
66 #include "TextOrientation.h"
67 #include "ThemeTypes.h"
68 #include "TransformOperations.h"
69 #include "UnicodeBidi.h"
70 #include <wtf/Forward.h>
71 #include <wtf/OwnPtr.h>
72 #include <wtf/RefCounted.h>
73 #include <wtf/StdLibExtras.h>
74 #include <wtf/Vector.h>
76 #if ENABLE(CSS_FILTERS)
77 #include "StyleFilterData.h"
80 #if ENABLE(DASHBOARD_SUPPORT)
81 #include "StyleDashboardRegion.h"
86 #include "SVGRenderStyle.h"
89 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
91 #define SET_VAR(group, variable, value) \
92 if (!compareEqual(group->variable, value)) \
93 group.access()->variable = value;
95 #define SET_BORDERVALUE_COLOR(group, variable, value) \
96 if (!compareEqual(group->variable.color(), value)) \
97 group.access()->variable.setColor(value);
103 #if ENABLE(CSS_FILTERS)
104 class FilterOperations;
108 class CounterContent;
116 class StyleInheritedData;
118 class TransformationMatrix;
122 typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
124 class RenderStyle: public RefCounted<RenderStyle> {
125 friend class CSSPropertyAnimation; // Used by CSS animations. We can't allow them to animate based off visited colors.
126 friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
127 friend class EditingStyle; // Editing has to only reveal unvisited info.
128 friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs to be able to see unvisited info.
129 friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
130 friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
131 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.
132 friend class StyleBuilder; // Sets members directly.
133 friend class StyleResolver; // Sets members directly.
136 class RenderStyleBitfields {
138 RenderStyleBitfields()
139 : m_affectedByUncommonAttributeSelectors(false)
141 , m_affectedByEmpty(false)
142 , m_emptyState(false)
143 , m_childrenAffectedByFirstChildRules(false)
144 , m_childrenAffectedByLastChildRules(false)
145 , m_childrenAffectedByDirectAdjacentRules(false)
146 , m_childrenAffectedByForwardPositionalRules(false)
147 , m_childrenAffectedByBackwardPositionalRules(false)
148 , m_firstChildState(false)
149 , m_lastChildState(false)
150 , m_explicitInheritance(false)
155 bool affectedByUncommonAttributeSelectors() const { return m_affectedByUncommonAttributeSelectors; }
156 void setAffectedByUncommonAttributeSelectors(bool value) { m_affectedByUncommonAttributeSelectors = value; }
157 bool unique() const { return m_unique; }
158 void setUnique(bool value) { m_unique = value; }
159 bool affectedByEmpty() const { return m_affectedByEmpty; }
160 void setAffectedByEmpty(bool value) { m_affectedByEmpty = value; }
161 bool emptyState() const { return m_emptyState; }
162 void setEmptyState(bool value) { m_emptyState = value; }
163 bool childrenAffectedByFirstChildRules() const { return m_childrenAffectedByFirstChildRules; }
164 void setChildrenAffectedByFirstChildRules(bool value) { m_childrenAffectedByFirstChildRules = value; }
165 bool childrenAffectedByLastChildRules() const { return m_childrenAffectedByLastChildRules; }
166 void setChildrenAffectedByLastChildRules(bool value) { m_childrenAffectedByLastChildRules = value; }
167 bool childrenAffectedByDirectAdjacentRules() const { return m_childrenAffectedByDirectAdjacentRules; }
168 void setChildrenAffectedByDirectAdjacentRules(bool value) { m_childrenAffectedByDirectAdjacentRules = value; }
169 bool childrenAffectedByForwardPositionalRules() const { return m_childrenAffectedByForwardPositionalRules; }
170 void setChildrenAffectedByForwardPositionalRules(bool value) { m_childrenAffectedByForwardPositionalRules = value; }
171 bool childrenAffectedByBackwardPositionalRules() const { return m_childrenAffectedByBackwardPositionalRules; }
172 void setChildrenAffectedByBackwardPositionalRules(bool value) { m_childrenAffectedByBackwardPositionalRules = value; }
173 bool firstChildState() const { return m_firstChildState; }
174 void setFirstChildState(bool value) { m_firstChildState = value; }
175 bool lastChildState() const { return m_lastChildState; }
176 void setLastChildState(bool value) { m_lastChildState = value; }
177 bool explicitInheritance() const { return m_explicitInheritance; }
178 void setExplicitInheritance(bool value) { m_explicitInheritance = value; }
180 unsigned childIndex() const { return m_childIndex; }
181 void setChildIndex(unsigned index) { m_childIndex = index; }
184 // The following bitfield is 32-bits long, which optimizes padding with the
185 // int refCount in the base class. Beware when adding more bits.
186 unsigned m_affectedByUncommonAttributeSelectors : 1;
187 unsigned m_unique : 1;
189 // Bits for dynamic child matching.
190 unsigned m_affectedByEmpty : 1;
191 unsigned m_emptyState : 1;
193 // We optimize for :first-child and :last-child. The other positional child selectors like nth-child or
194 // *-child-of-type, we will just give up and re-evaluate whenever children change at all.
195 unsigned m_childrenAffectedByFirstChildRules : 1;
196 unsigned m_childrenAffectedByLastChildRules : 1;
197 unsigned m_childrenAffectedByDirectAdjacentRules : 1;
198 unsigned m_childrenAffectedByForwardPositionalRules : 1;
199 unsigned m_childrenAffectedByBackwardPositionalRules : 1;
200 unsigned m_firstChildState : 1;
201 unsigned m_lastChildState : 1;
202 unsigned m_explicitInheritance : 1;
203 unsigned m_childIndex : 20; // Plenty of bits to cache an index.
205 RenderStyleBitfields m_bitfields;
207 // non-inherited attributes
208 DataRef<StyleBoxData> m_box;
209 DataRef<StyleVisualData> visual;
210 DataRef<StyleBackgroundData> m_background;
211 DataRef<StyleSurroundData> surround;
212 DataRef<StyleRareNonInheritedData> rareNonInheritedData;
214 // inherited attributes
215 DataRef<StyleRareInheritedData> rareInheritedData;
216 DataRef<StyleInheritedData> inherited;
218 // list of associated pseudo styles
219 OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
222 DataRef<SVGRenderStyle> m_svgStyle;
225 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
228 struct InheritedFlags {
229 bool operator==(const InheritedFlags& other) const
231 return (_empty_cells == other._empty_cells)
232 && (_caption_side == other._caption_side)
233 && (_list_style_type == other._list_style_type)
234 && (_list_style_position == other._list_style_position)
235 && (_visibility == other._visibility)
236 && (_text_align == other._text_align)
237 && (_text_transform == other._text_transform)
238 && (_text_decorations == other._text_decorations)
239 && (_cursor_style == other._cursor_style)
240 && (_direction == other._direction)
241 && (_white_space == other._white_space)
242 && (_border_collapse == other._border_collapse)
243 && (_box_direction == other._box_direction)
244 && (m_rtlOrdering == other.m_rtlOrdering)
245 && (m_printColorAdjust == other.m_printColorAdjust)
246 && (_pointerEvents == other._pointerEvents)
247 && (_insideLink == other._insideLink)
248 && (m_writingMode == other.m_writingMode);
251 bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
253 unsigned _empty_cells : 1; // EEmptyCell
254 unsigned _caption_side : 2; // ECaptionSide
255 unsigned _list_style_type : 7; // EListStyleType
256 unsigned _list_style_position : 1; // EListStylePosition
257 unsigned _visibility : 2; // EVisibility
258 unsigned _text_align : 4; // ETextAlign
259 unsigned _text_transform : 2; // ETextTransform
260 unsigned _text_decorations : ETextDecorationBits;
261 unsigned _cursor_style : 6; // ECursor
262 unsigned _direction : 1; // TextDirection
263 unsigned _white_space : 3; // EWhiteSpace
265 unsigned _border_collapse : 1; // EBorderCollapse
266 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
268 // non CSS2 inherited
269 unsigned m_rtlOrdering : 1; // Order
270 unsigned m_printColorAdjust : PrintColorAdjustBits;
271 unsigned _pointerEvents : 4; // EPointerEvents
272 unsigned _insideLink : 2; // EInsideLink
275 // CSS Text Layout Module Level 3: Vertical writing support
276 unsigned m_writingMode : 2; // WritingMode
281 struct NonInheritedFlags {
282 bool operator==(const NonInheritedFlags& other) const
284 return _effectiveDisplay == other._effectiveDisplay
285 && _originalDisplay == other._originalDisplay
286 && _overflowX == other._overflowX
287 && _overflowY == other._overflowY
288 && _vertical_align == other._vertical_align
289 && _clear == other._clear
290 && _position == other._position
291 && _floating == other._floating
292 && _table_layout == other._table_layout
293 && _page_break_before == other._page_break_before
294 && _page_break_after == other._page_break_after
295 && _page_break_inside == other._page_break_inside
296 && _styleType == other._styleType
297 && _affectedByHover == other._affectedByHover
298 && _affectedByActive == other._affectedByActive
299 && _affectedByDrag == other._affectedByDrag
300 && _pseudoBits == other._pseudoBits
301 && _unicodeBidi == other._unicodeBidi
302 && _isLink == other._isLink;
305 bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
307 unsigned _effectiveDisplay : 5; // EDisplay
308 unsigned _originalDisplay : 5; // EDisplay
309 unsigned _overflowX : 3; // EOverflow
310 unsigned _overflowY : 3; // EOverflow
311 unsigned _vertical_align : 4; // EVerticalAlign
312 unsigned _clear : 2; // EClear
313 unsigned _position : 3; // EPosition
314 unsigned _floating : 2; // EFloat
315 unsigned _table_layout : 1; // ETableLayout
317 unsigned _unicodeBidi : 3; // EUnicodeBidi
318 unsigned _page_break_before : 2; // EPageBreak
320 unsigned _page_break_after : 2; // EPageBreak
321 unsigned _page_break_inside : 2; // EPageBreak
323 unsigned _styleType : 6; // PseudoId
324 unsigned _pseudoBits : 7;
326 bool affectedByHover() const { return _affectedByHover; }
327 void setAffectedByHover(bool value) { _affectedByHover = value; }
328 bool affectedByActive() const { return _affectedByActive; }
329 void setAffectedByActive(bool value) { _affectedByActive = value; }
330 bool affectedByDrag() const { return _affectedByDrag; }
331 void setAffectedByDrag(bool value) { _affectedByDrag = value; }
332 bool isLink() const { return _isLink; }
333 void setIsLink(bool value) { _isLink = value; }
335 unsigned _affectedByHover : 1;
336 unsigned _affectedByActive : 1;
337 unsigned _affectedByDrag : 1;
338 unsigned _isLink : 1;
339 // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
341 } noninherited_flags;
346 void setBitDefaults()
348 inherited_flags._empty_cells = initialEmptyCells();
349 inherited_flags._caption_side = initialCaptionSide();
350 inherited_flags._list_style_type = initialListStyleType();
351 inherited_flags._list_style_position = initialListStylePosition();
352 inherited_flags._visibility = initialVisibility();
353 inherited_flags._text_align = initialTextAlign();
354 inherited_flags._text_transform = initialTextTransform();
355 inherited_flags._text_decorations = initialTextDecoration();
356 inherited_flags._cursor_style = initialCursor();
357 inherited_flags._direction = initialDirection();
358 inherited_flags._white_space = initialWhiteSpace();
359 inherited_flags._border_collapse = initialBorderCollapse();
360 inherited_flags.m_rtlOrdering = initialRTLOrdering();
361 inherited_flags._box_direction = initialBoxDirection();
362 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
363 inherited_flags._pointerEvents = initialPointerEvents();
364 inherited_flags._insideLink = NotInsideLink;
365 inherited_flags.m_writingMode = initialWritingMode();
367 noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
368 noninherited_flags._overflowX = initialOverflowX();
369 noninherited_flags._overflowY = initialOverflowY();
370 noninherited_flags._vertical_align = initialVerticalAlign();
371 noninherited_flags._clear = initialClear();
372 noninherited_flags._position = initialPosition();
373 noninherited_flags._floating = initialFloating();
374 noninherited_flags._table_layout = initialTableLayout();
375 noninherited_flags._unicodeBidi = initialUnicodeBidi();
376 noninherited_flags._page_break_before = initialPageBreak();
377 noninherited_flags._page_break_after = initialPageBreak();
378 noninherited_flags._page_break_inside = initialPageBreak();
379 noninherited_flags._styleType = NOPSEUDO;
380 noninherited_flags._pseudoBits = 0;
381 noninherited_flags.setAffectedByHover(false);
382 noninherited_flags.setAffectedByActive(false);
383 noninherited_flags.setAffectedByDrag(false);
384 noninherited_flags.setIsLink(false);
388 ALWAYS_INLINE RenderStyle();
389 // used to create the default style.
390 ALWAYS_INLINE RenderStyle(bool);
391 ALWAYS_INLINE RenderStyle(const RenderStyle&);
394 static PassRefPtr<RenderStyle> create();
395 static PassRefPtr<RenderStyle> createDefaultStyle();
396 static PassRefPtr<RenderStyle> createAnonymousStyleWithDisplay(const RenderStyle* parentStyle, EDisplay);
397 static PassRefPtr<RenderStyle> clone(const RenderStyle*);
399 enum IsAtShadowBoundary {
404 void inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary = NotAtShadowBoundary);
405 void copyNonInheritedFrom(const RenderStyle*);
407 PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags._styleType); }
408 void setStyleType(PseudoId styleType) { noninherited_flags._styleType = styleType; }
410 RenderStyle* getCachedPseudoStyle(PseudoId) const;
411 RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
412 void removeCachedPseudoStyle(PseudoId);
414 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
416 #if ENABLE(CSS_VARIABLES)
417 void setVariable(const AtomicString& name, const String& value) { rareInheritedData.access()->m_variables.access()->setVariable(name, value); }
418 const HashMap<AtomicString, String>* variables() { return &(rareInheritedData->m_variables->m_data); }
421 bool affectedByHoverRules() const { return noninherited_flags.affectedByHover(); }
422 bool affectedByActiveRules() const { return noninherited_flags.affectedByActive(); }
423 bool affectedByDragRules() const { return noninherited_flags.affectedByDrag(); }
425 void setAffectedByHoverRules(bool b) { noninherited_flags.setAffectedByHover(b); }
426 void setAffectedByActiveRules(bool b) { noninherited_flags.setAffectedByActive(b); }
427 void setAffectedByDragRules(bool b) { noninherited_flags.setAffectedByDrag(b); }
429 bool operator==(const RenderStyle& other) const;
430 bool operator!=(const RenderStyle& other) const { return !(*this == other); }
431 bool isFloating() const { return noninherited_flags._floating != NoFloat; }
432 bool hasMargin() const { return surround->margin.nonZero(); }
433 bool hasBorder() const { return surround->border.hasBorder(); }
434 bool hasPadding() const { return surround->padding.nonZero(); }
435 bool hasOffset() const { return surround->offset.nonZero(); }
437 bool hasBackgroundImage() const { return m_background->background().hasImage(); }
438 bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
439 bool hasAppearance() const { return appearance() != NoControlPart; }
441 bool hasBackground() const
443 Color color = visitedDependentColor(CSSPropertyBackgroundColor);
444 if (color.isValid() && color.alpha())
446 return hasBackgroundImage();
449 LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
450 bool hasBorderImageOutsets() const
452 return borderImage().hasImage() && borderImage().outset().nonZero();
454 LayoutBoxExtent borderImageOutsets() const
456 return imageOutsets(borderImage());
459 LayoutBoxExtent maskBoxImageOutsets() const
461 return imageOutsets(maskBoxImage());
464 #if ENABLE(CSS_FILTERS)
465 void getFilterOutsets(int& top, int& right, int& bottom, int& left) const
468 filter().getOutsets(top, right, bottom, left);
476 bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
478 bool hasFilterOutsets() const { return false; }
481 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
482 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
484 bool isStyleAvailable() const;
486 bool hasAnyPublicPseudoStyles() const;
487 bool hasPseudoStyle(PseudoId pseudo) const;
488 void setHasPseudoStyle(PseudoId pseudo);
490 // attribute getter methods
492 EDisplay display() const { return static_cast<EDisplay>(noninherited_flags._effectiveDisplay); }
493 EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags._originalDisplay); }
495 Length left() const { return surround->offset.left(); }
496 Length right() const { return surround->offset.right(); }
497 Length top() const { return surround->offset.top(); }
498 Length bottom() const { return surround->offset.bottom(); }
500 // Accessors for positioned object edges that take into account writing mode.
501 Length logicalLeft() const { return surround->offset.logicalLeft(writingMode()); }
502 Length logicalRight() const { return surround->offset.logicalRight(writingMode()); }
503 Length logicalTop() const { return surround->offset.before(writingMode()); }
504 Length logicalBottom() const { return surround->offset.after(writingMode()); }
506 // Whether or not a positioned element requires normal flow x/y to be computed
507 // to determine its position.
508 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
509 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
510 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
511 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
513 EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
514 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
515 bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; }
516 bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; }
517 EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
519 Length width() const { return m_box->width(); }
520 Length height() const { return m_box->height(); }
521 Length minWidth() const { return m_box->minWidth(); }
522 Length maxWidth() const { return m_box->maxWidth(); }
523 Length minHeight() const { return m_box->minHeight(); }
524 Length maxHeight() const { return m_box->maxHeight(); }
526 Length logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
527 Length logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
528 Length logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
529 Length logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
530 Length logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
531 Length logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
533 const BorderData& border() const { return surround->border; }
534 const BorderValue& borderLeft() const { return surround->border.left(); }
535 const BorderValue& borderRight() const { return surround->border.right(); }
536 const BorderValue& borderTop() const { return surround->border.top(); }
537 const BorderValue& borderBottom() const { return surround->border.bottom(); }
539 const BorderValue& borderBefore() const;
540 const BorderValue& borderAfter() const;
541 const BorderValue& borderStart() const;
542 const BorderValue& borderEnd() const;
544 const NinePieceImage& borderImage() const { return surround->border.image(); }
545 StyleImage* borderImageSource() const { return surround->border.image().image(); }
546 LengthBox borderImageSlices() const { return surround->border.image().imageSlices(); }
547 LengthBox borderImageWidth() const { return surround->border.image().borderSlices(); }
548 LengthBox borderImageOutset() const { return surround->border.image().outset(); }
550 LengthSize borderTopLeftRadius() const { return surround->border.topLeft(); }
551 LengthSize borderTopRightRadius() const { return surround->border.topRight(); }
552 LengthSize borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
553 LengthSize borderBottomRightRadius() const { return surround->border.bottomRight(); }
554 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
556 unsigned borderLeftWidth() const { return surround->border.borderLeftWidth(); }
557 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
558 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
559 unsigned borderRightWidth() const { return surround->border.borderRightWidth(); }
560 EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
561 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
562 unsigned borderTopWidth() const { return surround->border.borderTopWidth(); }
563 EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
564 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
565 unsigned borderBottomWidth() const { return surround->border.borderBottomWidth(); }
566 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
567 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
569 unsigned short borderBeforeWidth() const;
570 unsigned short borderAfterWidth() const;
571 unsigned short borderStartWidth() const;
572 unsigned short borderEndWidth() const;
574 unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
575 unsigned short outlineWidth() const
577 if (m_background->outline().style() == BNONE)
579 return m_background->outline().width();
581 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
582 EBorderStyle outlineStyle() const { return m_background->outline().style(); }
583 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
585 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
586 EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
588 EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
589 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
590 Length verticalAlignLength() const { return m_box->verticalAlign(); }
592 Length clipLeft() const { return visual->clip.left(); }
593 Length clipRight() const { return visual->clip.right(); }
594 Length clipTop() const { return visual->clip.top(); }
595 Length clipBottom() const { return visual->clip.bottom(); }
596 LengthBox clip() const { return visual->clip; }
597 bool hasClip() const { return visual->hasClip; }
599 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags._unicodeBidi); }
601 EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
602 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
604 const Font& font() const;
605 const FontMetrics& fontMetrics() const;
606 const FontDescription& fontDescription() const;
607 float specifiedFontSize() const;
608 float computedFontSize() const;
609 int fontSize() const;
611 #if ENABLE(TEXT_AUTOSIZING)
612 float textAutosizingMultiplier() const { return visual->m_textAutosizingMultiplier; }
615 Length textIndent() const { return rareInheritedData->indent; }
616 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
617 ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
618 ETextDecoration textDecorationsInEffect() const { return static_cast<ETextDecoration>(inherited_flags._text_decorations); }
619 ETextDecoration textDecoration() const { return static_cast<ETextDecoration>(visual->textDecoration); }
620 #if ENABLE(CSS3_TEXT)
621 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
622 ETextAlignLast textAlignLast() const { return static_cast<ETextAlignLast>(rareInheritedData->m_textAlignLast); }
624 TextDecorationStyle textDecorationStyle() const { return TextDecorationStyleSolid; }
626 int wordSpacing() const;
627 int letterSpacing() const;
629 float zoom() const { return visual->m_zoom; }
630 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
632 TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
633 bool isLeftToRightDirection() const { return direction() == LTR; }
635 Length specifiedLineHeight() const;
636 Length lineHeight() const;
637 int computedLineHeight(RenderView* = 0) const;
639 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
640 static bool autoWrap(EWhiteSpace ws)
642 // Nowrap and pre don't automatically wrap.
643 return ws != NOWRAP && ws != PRE;
646 bool autoWrap() const
648 return autoWrap(whiteSpace());
651 static bool preserveNewline(EWhiteSpace ws)
653 // Normal and nowrap do not preserve newlines.
654 return ws != NORMAL && ws != NOWRAP;
657 bool preserveNewline() const
659 return preserveNewline(whiteSpace());
662 static bool collapseWhiteSpace(EWhiteSpace ws)
664 // Pre and prewrap do not collapse whitespace.
665 return ws != PRE && ws != PRE_WRAP;
668 bool collapseWhiteSpace() const
670 return collapseWhiteSpace(whiteSpace());
673 bool isCollapsibleWhiteSpace(UChar c) const
678 return collapseWhiteSpace();
680 return !preserveNewline();
685 bool breakOnlyAfterWhiteSpace() const
687 return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
690 bool breakWords() const
692 return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
695 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
696 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
697 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
698 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
699 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
700 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
701 Length backgroundXPosition() const { return m_background->background().xPosition(); }
702 Length backgroundYPosition() const { return m_background->background().yPosition(); }
703 EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
704 LengthSize backgroundSizeLength() const { return m_background->background().sizeLength(); }
705 FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
706 const FillLayer* backgroundLayers() const { return &(m_background->background()); }
708 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
709 EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
710 EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
711 CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
712 EFillAttachment maskAttachment() const { return static_cast<EFillAttachment>(rareNonInheritedData->m_mask.attachment()); }
713 EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
714 EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
715 Length maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
716 Length maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
717 EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
718 LengthSize maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
719 FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
720 const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
721 const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
722 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
724 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
725 short horizontalBorderSpacing() const;
726 short verticalBorderSpacing() const;
727 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
728 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
730 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
731 StyleImage* listStyleImage() const;
732 EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
734 Length marginTop() const { return surround->margin.top(); }
735 Length marginBottom() const { return surround->margin.bottom(); }
736 Length marginLeft() const { return surround->margin.left(); }
737 Length marginRight() const { return surround->margin.right(); }
738 Length marginBefore() const { return surround->margin.before(writingMode()); }
739 Length marginAfter() const { return surround->margin.after(writingMode()); }
740 Length marginStart() const { return surround->margin.start(writingMode(), direction()); }
741 Length marginEnd() const { return surround->margin.end(writingMode(), direction()); }
742 Length marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
743 Length marginEndUsing(const RenderStyle* otherStyle) const { return surround->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
744 Length marginBeforeUsing(const RenderStyle* otherStyle) const { return surround->margin.before(otherStyle->writingMode()); }
745 Length marginAfterUsing(const RenderStyle* otherStyle) const { return surround->margin.after(otherStyle->writingMode()); }
747 LengthBox paddingBox() const { return surround->padding; }
748 Length paddingTop() const { return surround->padding.top(); }
749 Length paddingBottom() const { return surround->padding.bottom(); }
750 Length paddingLeft() const { return surround->padding.left(); }
751 Length paddingRight() const { return surround->padding.right(); }
752 Length paddingBefore() const { return surround->padding.before(writingMode()); }
753 Length paddingAfter() const { return surround->padding.after(writingMode()); }
754 Length paddingStart() const { return surround->padding.start(writingMode(), direction()); }
755 Length paddingEnd() const { return surround->padding.end(writingMode(), direction()); }
757 ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
759 CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
761 EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
762 bool isLink() const { return noninherited_flags.isLink(); }
764 short widows() const { return rareInheritedData->widows; }
765 short orphans() const { return rareInheritedData->orphans; }
766 EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
767 EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
768 EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
770 // CSS3 Getter Methods
772 int outlineOffset() const
774 if (m_background->outline().style() == BNONE)
776 return m_background->outline().offset();
779 const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); }
780 void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
781 void getTextShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
782 void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
783 void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
784 void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
786 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
787 ColorSpace colorSpace() const { return static_cast<ColorSpace>(rareInheritedData->colorSpace); }
788 float opacity() const { return rareNonInheritedData->opacity; }
789 ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
790 // aspect ratio convenience method
791 bool hasAspectRatio() const { return rareNonInheritedData->m_hasAspectRatio; }
792 float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
793 float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
794 float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
795 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->m_deprecatedFlexibleBox->align); }
796 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
797 float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex; }
798 unsigned int boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex_group; }
799 EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedData->m_deprecatedFlexibleBox->lines); }
800 unsigned int boxOrdinalGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->ordinal_group; }
801 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->m_deprecatedFlexibleBox->orient); }
802 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
804 int order() const { return rareNonInheritedData->m_order; }
805 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
806 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
807 Length flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
808 EAlignContent alignContent() const { return static_cast<EAlignContent>(rareNonInheritedData->m_alignContent); }
809 EAlignItems alignItems() const { return static_cast<EAlignItems>(rareNonInheritedData->m_alignItems); }
810 EAlignItems alignSelf() const { return static_cast<EAlignItems>(rareNonInheritedData->m_alignSelf); }
811 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
812 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
813 bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
814 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
815 EJustifyContent justifyContent() const { return static_cast<EJustifyContent>(rareNonInheritedData->m_justifyContent); }
817 const Vector<Length>& gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; }
818 const Vector<Length>& gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; }
820 Length gridItemColumn() const { return rareNonInheritedData->m_gridItem->m_gridColumn; }
821 Length gridItemRow() const { return rareNonInheritedData->m_gridItem->m_gridRow; }
823 const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
824 void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
825 LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
826 void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
827 void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
828 void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
829 void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
831 #if ENABLE(CSS_BOX_DECORATION_BREAK)
832 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecorationBreak(); }
834 StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
835 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
836 Length marqueeIncrement() const { return rareNonInheritedData->m_marquee->increment; }
837 int marqueeSpeed() const { return rareNonInheritedData->m_marquee->speed; }
838 int marqueeLoopCount() const { return rareNonInheritedData->m_marquee->loops; }
839 EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->m_marquee->behavior); }
840 EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->m_marquee->direction); }
841 EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
842 EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
843 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
844 TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNonInheritedData->textOverflow); }
845 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
846 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
847 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
848 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareInheritedData->overflowWrap); }
849 ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
850 LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedData->lineBreak); }
851 const AtomicString& highlight() const { return rareInheritedData->highlight; }
852 Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
853 short hyphenationLimitBefore() const { return rareInheritedData->hyphenationLimitBefore; }
854 short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
855 short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; }
856 const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
857 const AtomicString& locale() const { return rareInheritedData->locale; }
858 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
859 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
860 ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); }
861 bool hasInlineColumnAxis() const {
862 ColumnAxis axis = columnAxis();
863 return axis == AutoColumnAxis || isHorizontalWritingMode() == (axis == HorizontalColumnAxis);
865 ColumnProgression columnProgression() const { return static_cast<ColumnProgression>(rareNonInheritedData->m_multiCol->m_progression); }
866 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
867 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
868 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
869 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
870 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); }
871 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
872 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
873 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
874 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
875 bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
876 ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheritedData->m_multiCol->m_columnSpan); }
877 EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
878 EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
879 EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
880 EPageBreak regionBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakBefore); }
881 EPageBreak regionBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakInside); }
882 EPageBreak regionBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakAfter); }
883 const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
884 Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
885 Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
886 float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
887 bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
889 TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
890 TextEmphasisMark textEmphasisMark() const;
891 const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
892 TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
893 const AtomicString& textEmphasisMarkString() const;
895 // Return true if any transform related property (currently transform, transformStyle3D or perspective)
896 // indicates that we are transforming
897 bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
899 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
900 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
901 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
902 void setPageScaleTransform(float);
904 bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
906 TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
907 bool hasTextCombine() const { return textCombine() != TextCombineNone; }
909 unsigned tabSize() const { return rareInheritedData->m_tabSize; }
913 const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
914 const AtomicString& regionThread() const { return rareNonInheritedData->m_regionThread; }
915 RegionOverflow regionOverflow() const { return static_cast<RegionOverflow>(rareNonInheritedData->m_regionOverflow); }
917 const AtomicString& lineGrid() const { return rareInheritedData->m_lineGrid; }
918 LineSnap lineSnap() const { return static_cast<LineSnap>(rareInheritedData->m_lineSnap); }
919 LineAlign lineAlign() const { return static_cast<LineAlign>(rareInheritedData->m_lineAlign); }
921 WrapFlow wrapFlow() const { return static_cast<WrapFlow>(rareNonInheritedData->m_wrapFlow); }
922 WrapThrough wrapThrough() const { return static_cast<WrapThrough>(rareNonInheritedData->m_wrapThrough); }
924 // Apple-specific property getter methods
925 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
926 const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
927 const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
929 AnimationList* accessAnimations();
930 AnimationList* accessTransitions();
932 bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
933 bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
935 // return the first found Animation (including 'all' transitions)
936 const Animation* transitionForProperty(CSSPropertyID) const;
938 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
939 bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
941 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
942 float perspective() const { return rareNonInheritedData->m_perspective; }
943 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
944 Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
945 Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
946 LengthSize pageSize() const { return rareNonInheritedData->m_pageSize; }
947 PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
949 #if USE(ACCELERATED_COMPOSITING)
950 // When set, this ensures that styles compare as different. Used during accelerated animations.
951 bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
954 LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
955 const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
956 #if ENABLE(TOUCH_EVENTS)
957 Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
959 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
960 bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
962 bool textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
963 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
965 WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
966 bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
967 bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
968 bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedBlocksWritingMode(writingMode()); }
970 #if ENABLE(CSS_IMAGE_ORIENTATION)
971 ImageOrientationEnum imageOrientation() const { return static_cast<ImageOrientationEnum>(rareInheritedData->m_imageOrientation); }
974 EImageRendering imageRendering() const { return static_cast<EImageRendering>(rareInheritedData->m_imageRendering); }
976 #if ENABLE(CSS_IMAGE_RESOLUTION)
977 ImageResolutionSource imageResolutionSource() const { return static_cast<ImageResolutionSource>(rareInheritedData->m_imageResolutionSource); }
978 ImageResolutionSnap imageResolutionSnap() const { return static_cast<ImageResolutionSnap>(rareInheritedData->m_imageResolutionSnap); }
979 float imageResolution() const { return rareInheritedData->m_imageResolution; }
982 ESpeak speak() const { return static_cast<ESpeak>(rareInheritedData->speak); }
984 #if ENABLE(CSS_FILTERS)
985 FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_filter.access()->m_operations; }
986 const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
987 bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
989 bool hasFilter() const { return false; }
992 #if ENABLE(CSS_COMPOSITING)
993 BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); }
994 void setBlendMode(BlendMode v) { rareNonInheritedData.access()->m_effectiveBlendMode = v; }
995 bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal; }
997 bool hasBlendMode() const { return false; }
1000 #if USE(RTL_SCROLLBAR)
1001 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); }
1003 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return false; }
1006 // attribute setter methods
1008 void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
1009 void setOriginalDisplay(EDisplay v) { noninherited_flags._originalDisplay = v; }
1010 void setPosition(EPosition v) { noninherited_flags._position = v; }
1011 void setFloating(EFloat v) { noninherited_flags._floating = v; }
1013 void setLeft(Length v) { SET_VAR(surround, offset.m_left, v) }
1014 void setRight(Length v) { SET_VAR(surround, offset.m_right, v) }
1015 void setTop(Length v) { SET_VAR(surround, offset.m_top, v) }
1016 void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v) }
1018 void setWidth(Length v) { SET_VAR(m_box, m_width, v) }
1019 void setHeight(Length v) { SET_VAR(m_box, m_height, v) }
1021 void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, v) }
1022 void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, v) }
1023 void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v) }
1024 void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v) }
1026 #if ENABLE(DASHBOARD_SUPPORT)
1027 Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
1028 void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
1030 void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append)
1032 StyleDashboardRegion region;
1033 region.label = label;
1034 region.offset.m_top = t;
1035 region.offset.m_right = r;
1036 region.offset.m_bottom = b;
1037 region.offset.m_left = l;
1040 rareNonInheritedData.access()->m_dashboardRegions.clear();
1041 rareNonInheritedData.access()->m_dashboardRegions.append(region);
1045 #if ENABLE(DRAGGABLE_REGION)
1046 DraggableRegionMode getDraggableRegionMode() const { return rareNonInheritedData->m_draggableRegionMode; }
1047 void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(rareNonInheritedData, m_draggableRegionMode, v); }
1050 void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
1051 void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()) }
1052 void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()) }
1053 void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()) }
1054 void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()) }
1055 void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()) }
1056 void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
1057 void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()) }
1058 void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()) }
1059 void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()) }
1060 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()) }
1062 void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v) }
1064 void setBackgroundXPosition(Length l) { SET_VAR(m_background, m_background.m_xPosition, l) }
1065 void setBackgroundYPosition(Length l) { SET_VAR(m_background, m_background.m_yPosition, l) }
1066 void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b) }
1067 void setBackgroundSizeLength(LengthSize l) { SET_VAR(m_background, m_background.m_sizeLength, l) }
1069 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b) }
1070 void setBorderImageSource(PassRefPtr<StyleImage> v) { surround.access()->border.m_image.setImage(v); }
1071 void setBorderImageSlices(LengthBox slices) { surround.access()->border.m_image.setImageSlices(slices); }
1072 void setBorderImageWidth(LengthBox slices) { surround.access()->border.m_image.setBorderSlices(slices); }
1073 void setBorderImageOutset(LengthBox outset) { surround.access()->border.m_image.setOutset(outset); }
1075 void setBorderTopLeftRadius(LengthSize s) { SET_VAR(surround, border.m_topLeft, s) }
1076 void setBorderTopRightRadius(LengthSize s) { SET_VAR(surround, border.m_topRight, s) }
1077 void setBorderBottomLeftRadius(LengthSize s) { SET_VAR(surround, border.m_bottomLeft, s) }
1078 void setBorderBottomRightRadius(LengthSize s) { SET_VAR(surround, border.m_bottomRight, s) }
1080 void setBorderRadius(LengthSize s)
1082 setBorderTopLeftRadius(s);
1083 setBorderTopRightRadius(s);
1084 setBorderBottomLeftRadius(s);
1085 setBorderBottomRightRadius(s);
1087 void setBorderRadius(const IntSize& s)
1089 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
1092 RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, RenderView* = 0, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1093 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1095 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
1096 LayoutUnit topWidth, LayoutUnit bottomWidth, LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
1098 void setBorderLeftWidth(unsigned v) { SET_VAR(surround, border.m_left.m_width, v) }
1099 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v) }
1100 void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v) }
1101 void setBorderRightWidth(unsigned v) { SET_VAR(surround, border.m_right.m_width, v) }
1102 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v) }
1103 void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v) }
1104 void setBorderTopWidth(unsigned v) { SET_VAR(surround, border.m_top.m_width, v) }
1105 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v) }
1106 void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v) }
1107 void setBorderBottomWidth(unsigned v) { SET_VAR(surround, border.m_bottom.m_width, v) }
1108 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v) }
1109 void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v) }
1111 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v) }
1112 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto) }
1113 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v) }
1114 void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v) }
1116 void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
1117 void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
1118 void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
1119 void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
1120 void setVerticalAlignLength(Length length) { setVerticalAlign(LENGTH); SET_VAR(m_box, m_verticalAlign, length) }
1122 void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b) }
1123 void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v) }
1124 void setClipRight(Length v) { SET_VAR(visual, clip.m_right, v) }
1125 void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v) }
1126 void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v) }
1127 void setClip(Length top, Length right, Length bottom, Length left);
1128 void setClip(LengthBox box) { SET_VAR(visual, clip, box) }
1130 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
1132 void setClear(EClear v) { noninherited_flags._clear = v; }
1133 void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
1135 bool setFontDescription(const FontDescription&);
1136 // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
1137 void setFontSize(float);
1139 #if ENABLE(TEXT_AUTOSIZING)
1140 void setTextAutosizingMultiplier(float v)
1142 SET_VAR(visual, m_textAutosizingMultiplier, v)
1143 setFontSize(fontDescription().specifiedSize());
1147 void setColor(const Color&);
1148 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v) }
1149 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1150 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1151 void addToTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations |= v; }
1152 void setTextDecorationsInEffect(ETextDecoration v) { inherited_flags._text_decorations = v; }
1153 void setTextDecoration(ETextDecoration v) { SET_VAR(visual, textDecoration, v); }
1154 #if ENABLE(CSS3_TEXT)
1155 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
1156 void setTextAlignLast(ETextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v) }
1158 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1159 void setLineHeight(Length specifiedLineHeight);
1160 bool setZoom(float);
1161 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1162 bool setEffectiveZoom(float);
1164 #if ENABLE(CSS_IMAGE_ORIENTATION)
1165 void setImageOrientation(ImageOrientationEnum v) { SET_VAR(rareInheritedData, m_imageOrientation, static_cast<int>(v)) }
1168 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_imageRendering, v) }
1170 #if ENABLE(CSS_IMAGE_RESOLUTION)
1171 void setImageResolutionSource(ImageResolutionSource v) { SET_VAR(rareInheritedData, m_imageResolutionSource, v) }
1172 void setImageResolutionSnap(ImageResolutionSnap v) { SET_VAR(rareInheritedData, m_imageResolutionSnap, v) }
1173 void setImageResolution(float f) { SET_VAR(rareInheritedData, m_imageResolution, f) }
1176 void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
1178 void setWordSpacing(int);
1179 void setLetterSpacing(int);
1181 void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
1182 void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
1184 void adjustBackgroundLayers()
1186 if (backgroundLayers()->next()) {
1187 accessBackgroundLayers()->cullEmptyLayers();
1188 accessBackgroundLayers()->fillUnsetProperties();
1192 void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
1193 void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
1195 void adjustMaskLayers()
1197 if (maskLayers()->next()) {
1198 accessMaskLayers()->cullEmptyLayers();
1199 accessMaskLayers()->fillUnsetProperties();
1203 void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
1205 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b) }
1206 void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
1207 void setMaskXPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, l) }
1208 void setMaskYPosition(Length l) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, l) }
1209 void setMaskSize(LengthSize l) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, l) }
1211 void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
1212 void setHorizontalBorderSpacing(short);
1213 void setVerticalBorderSpacing(short);
1214 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
1215 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
1217 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
1218 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
1219 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
1221 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
1222 void setListStyleImage(PassRefPtr<StyleImage>);
1223 void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
1225 void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)) }
1226 void setMarginTop(Length v) { SET_VAR(surround, margin.m_top, v) }
1227 void setMarginBottom(Length v) { SET_VAR(surround, margin.m_bottom, v) }
1228 void setMarginLeft(Length v) { SET_VAR(surround, margin.m_left, v) }
1229 void setMarginRight(Length v) { SET_VAR(surround, margin.m_right, v) }
1230 void setMarginStart(Length);
1231 void setMarginEnd(Length);
1233 void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)) }
1234 void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b) }
1235 void setPaddingTop(Length v) { SET_VAR(surround, padding.m_top, v) }
1236 void setPaddingBottom(Length v) { SET_VAR(surround, padding.m_bottom, v) }
1237 void setPaddingLeft(Length v) { SET_VAR(surround, padding.m_left, v) }
1238 void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v) }
1240 void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
1241 void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
1242 void setCursorList(PassRefPtr<CursorList>);
1243 void clearCursorList();
1245 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
1246 void setIsLink(bool b) { noninherited_flags.setIsLink(b); }
1248 PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); }
1249 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; }
1251 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
1252 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0) }
1253 int zIndex() const { return m_box->zIndex(); }
1254 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v) }
1256 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); }
1257 void setOrphans(short o) { SET_VAR(rareInheritedData, orphans, o); }
1258 // For valid values of page-break-inside see http://www.w3.org/TR/CSS21/page.html#page-break-props
1259 void setPageBreakInside(EPageBreak b) { ASSERT(b == PBAUTO || b == PBAVOID); noninherited_flags._page_break_inside = b; }
1260 void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
1261 void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
1264 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v) }
1265 void setTextShadow(PassOwnPtr<ShadowData>, bool add = false);
1266 void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c) }
1267 void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w) }
1268 void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c) }
1269 void setColorSpace(ColorSpace space) { SET_VAR(rareInheritedData, colorSpace, space) }
1270 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(rareNonInheritedData, opacity, v); }
1271 void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
1272 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
1273 void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, align, a); }
1274 #if ENABLE(CSS_BOX_DECORATION_BREAK)
1275 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDecorationBreak, b); }
1277 void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
1278 void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, flex, f); }
1279 void setBoxFlexGroup(unsigned int fg) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, flex_group, fg); }
1280 void setBoxLines(EBoxLines l) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, lines, l); }
1281 void setBoxOrdinalGroup(unsigned int og) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, ordinal_group, og); }
1282 void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, orient, o); }
1283 void setBoxPack(EBoxPack p) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, pack, p); }
1284 void setBoxShadow(PassOwnPtr<ShadowData>, bool add = false);
1285 void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
1286 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
1287 void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); }
1288 void setFlexShrink(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexShrink, f); }
1289 void setFlexBasis(Length length) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, length); }
1290 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, o); }
1291 void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alignContent, p); }
1292 void setAlignItems(EAlignItems a) { SET_VAR(rareNonInheritedData, m_alignItems, a); }
1293 void setAlignSelf(EAlignItems a) { SET_VAR(rareNonInheritedData, m_alignSelf, a); }
1294 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, direction); }
1295 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); }
1296 void setJustifyContent(EJustifyContent p) { SET_VAR(rareNonInheritedData, m_justifyContent, p); }
1297 void setGridColumns(const Vector<Length>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridColumns, lengths); }
1298 void setGridRows(const Vector<Length>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridRows, lengths); }
1299 void setGridItemColumn(const Length& columnPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumn, columnPosition); }
1300 void setGridItemRow(const Length& rowPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRow, rowPosition); }
1302 void setMarqueeIncrement(const Length& f) { SET_VAR(rareNonInheritedData.access()->m_marquee, increment, f); }
1303 void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->m_marquee, speed, f); }
1304 void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->m_marquee, direction, d); }
1305 void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(rareNonInheritedData.access()->m_marquee, behavior, b); }
1306 void setMarqueeLoopCount(int i) { SET_VAR(rareNonInheritedData.access()->m_marquee, loops, i); }
1307 void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
1308 void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
1309 void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
1310 void setTextOverflow(TextOverflow overflow) { SET_VAR(rareNonInheritedData, textOverflow, overflow); }
1311 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
1312 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
1313 void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
1314 void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
1315 void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
1316 void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
1317 void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
1318 void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
1319 void setHyphenationLimitBefore(short limit) { SET_VAR(rareInheritedData, hyphenationLimitBefore, limit); }
1320 void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
1321 void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
1322 void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
1323 void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
1324 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
1325 void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
1326 void setColumnAxis(ColumnAxis axis) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_axis, axis); }
1327 void setColumnProgression(ColumnProgression progression) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_progression, progression); }
1328 void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
1329 void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, 0); }
1330 void setColumnCount(unsigned short c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, c); }
1331 void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
1332 void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
1333 void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
1334 void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(rareNonInheritedData.access()->m_multiCol, m_rule, c); }
1335 void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
1336 void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); }
1337 void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()) }
1338 void setColumnSpan(ColumnSpan columnSpan) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_columnSpan, columnSpan); }
1339 void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
1340 // For valid values of column-break-inside see http://www.w3.org/TR/css3-multicol/#break-before-break-after-break-inside
1341 void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
1342 void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
1343 void setRegionBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakBefore, p); }
1344 void setRegionBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData, m_regionBreakInside, p); }
1345 void setRegionBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakAfter, p); }
1346 void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
1347 void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
1348 void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
1349 void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
1350 void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
1351 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
1352 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
1353 void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c) }
1354 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
1355 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
1356 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
1357 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1359 #if ENABLE(CSS_FILTERS)
1360 void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
1363 void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
1367 void setLineGrid(const AtomicString& lineGrid) { SET_VAR(rareInheritedData, m_lineGrid, lineGrid); }
1368 void setLineSnap(LineSnap lineSnap) { SET_VAR(rareInheritedData, m_lineSnap, lineSnap); }
1369 void setLineAlign(LineAlign lineAlign) { SET_VAR(rareInheritedData, m_lineAlign, lineAlign); }
1371 void setFlowThread(const AtomicString& flowThread) { SET_VAR(rareNonInheritedData, m_flowThread, flowThread); }
1372 void setRegionThread(const AtomicString& regionThread) { SET_VAR(rareNonInheritedData, m_regionThread, regionThread); }
1373 void setRegionOverflow(RegionOverflow regionOverflow) { SET_VAR(rareNonInheritedData, m_regionOverflow, regionOverflow); }
1375 void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(rareNonInheritedData, m_wrapFlow, wrapFlow); }
1376 void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(rareNonInheritedData, m_wrapThrough, wrapThrough); }
1378 // Apple-specific property setters
1379 void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
1381 void clearAnimations()
1383 rareNonInheritedData.access()->m_animations.clear();
1386 void clearTransitions()
1388 rareNonInheritedData.access()->m_transitions.clear();
1391 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }
1392 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? adoptPtr(new AnimationList(*parent)) : nullptr; }
1393 void adjustAnimations();
1394 void adjustTransitions();
1396 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
1397 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
1398 void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
1399 void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
1400 void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
1401 void setPageSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
1402 void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
1403 void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
1405 #if USE(ACCELERATED_COMPOSITING)
1406 void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
1409 void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
1410 void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
1411 #if ENABLE(TOUCH_EVENTS)
1412 void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
1414 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
1415 void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
1417 bool setTextSizeAdjust(bool);
1418 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
1421 const SVGRenderStyle* svgStyle() const { return m_svgStyle.get(); }
1422 SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
1424 const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle()->fillPaintType(); }
1425 Color fillPaintColor() const { return svgStyle()->fillPaintColor(); }
1426 void setFillPaintColor(const Color& c) { accessSVGStyle()->setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1427 float fillOpacity() const { return svgStyle()->fillOpacity(); }
1428 void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
1430 const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle()->strokePaintType(); }
1431 Color strokePaintColor() const { return svgStyle()->strokePaintColor(); }
1432 void setStrokePaintColor(const Color& c) { accessSVGStyle()->setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1433 float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
1434 void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
1435 SVGLength strokeWidth() const { return svgStyle()->strokeWidth(); }
1436 void setStrokeWidth(SVGLength w) { accessSVGStyle()->setStrokeWidth(w); }
1437 SVGLength strokeDashOffset() const { return svgStyle()->strokeDashOffset(); }
1438 void setStrokeDashOffset(SVGLength d) { accessSVGStyle()->setStrokeDashOffset(d); }
1439 float strokeMiterLimit() const { return svgStyle()->strokeMiterLimit(); }
1440 void setStrokeMiterLimit(float f) { accessSVGStyle()->setStrokeMiterLimit(f); }
1442 float floodOpacity() const { return svgStyle()->floodOpacity(); }
1443 void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); }
1445 float stopOpacity() const { return svgStyle()->stopOpacity(); }
1446 void setStopOpacity(float f) { accessSVGStyle()->setStopOpacity(f); }
1448 void setStopColor(const Color& c) { accessSVGStyle()->setStopColor(c); }
1449 void setFloodColor(const Color& c) { accessSVGStyle()->setFloodColor(c); }
1450 void setLightingColor(const Color& c) { accessSVGStyle()->setLightingColor(c); }
1452 SVGLength baselineShiftValue() const { return svgStyle()->baselineShiftValue(); }
1453 void setBaselineShiftValue(SVGLength s) { accessSVGStyle()->setBaselineShiftValue(s); }
1454 SVGLength kerning() const { return svgStyle()->kerning(); }
1455 void setKerning(SVGLength k) { accessSVGStyle()->setKerning(k); }
1458 void setShapeInside(PassRefPtr<BasicShape> shape)
1460 if (rareNonInheritedData->m_shapeInside != shape)
1461 rareNonInheritedData.access()->m_shapeInside = shape;
1463 BasicShape* shapeInside() const { return rareNonInheritedData->m_shapeInside.get(); }
1465 void setShapeOutside(PassRefPtr<BasicShape> shape)
1467 if (rareNonInheritedData->m_shapeOutside != shape)
1468 rareNonInheritedData.access()->m_shapeOutside = shape;
1470 BasicShape* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
1472 static BasicShape* initialShapeInside() { return 0; }
1473 static BasicShape* initialShapeOutside() { return 0; }
1475 void setClipPath(PassRefPtr<ClipPathOperation> operation)
1477 if (rareNonInheritedData->m_clipPath != operation)
1478 rareNonInheritedData.access()->m_clipPath = operation;
1480 ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
1482 static ClipPathOperation* initialClipPath() { return 0; }
1484 Length shapePadding() const { return rareNonInheritedData->m_shapePadding; }
1485 void setShapePadding(Length shapePadding) { SET_VAR(rareNonInheritedData, m_shapePadding, shapePadding); }
1486 static Length initialShapePadding() { return Length(0, Fixed); }
1488 Length shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
1489 void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, shapeMargin); }
1490 static Length initialShapeMargin() { return Length(0, Fixed); }
1492 bool hasContent() const { return contentData(); }
1493 const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
1494 bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
1495 void clearContent();
1496 void setContent(const String&, bool add = false);
1497 void setContent(PassRefPtr<StyleImage>, bool add = false);
1498 void setContent(PassOwnPtr<CounterContent>, bool add = false);
1499 void setContent(QuoteType, bool add = false);
1501 const CounterDirectiveMap* counterDirectives() const;
1502 CounterDirectiveMap& accessCounterDirectives();
1503 const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
1505 QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
1506 void setQuotes(PassRefPtr<QuotesData>);
1508 const AtomicString& hyphenString() const;
1510 bool inheritedNotEqual(const RenderStyle*) const;
1511 bool inheritedDataShared(const RenderStyle*) const;
1513 StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
1515 bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
1516 bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
1517 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
1518 bool isDisplayRegionType() const
1520 return display() == BLOCK || display() == INLINE_BLOCK
1521 || display() == TABLE_CELL || display() == TABLE_CAPTION
1522 || display() == LIST_ITEM;
1525 void setWritingMode(WritingMode v) { inherited_flags.m_writingMode = v; }
1527 // To tell if this style matched attribute selectors. This makes it impossible to share.
1528 bool affectedByUncommonAttributeSelectors() const { return m_bitfields.affectedByUncommonAttributeSelectors(); }
1529 void setAffectedByUncommonAttributeSelectors() { m_bitfields.setAffectedByUncommonAttributeSelectors(true); }
1531 bool unique() const { return m_bitfields.unique(); }
1532 void setUnique() { m_bitfields.setUnique(true); }
1534 // Methods for indicating the style is affected by dynamic updates (e.g., children changing, our position changing in our sibling list, etc.)
1535 bool affectedByEmpty() const { return m_bitfields.affectedByEmpty(); }
1536 bool emptyState() const { return m_bitfields.emptyState(); }
1537 void setEmptyState(bool b) { m_bitfields.setAffectedByEmpty(true); m_bitfields.setUnique(true); m_bitfields.setEmptyState(b); }
1538 bool childrenAffectedByPositionalRules() const { return childrenAffectedByForwardPositionalRules() || childrenAffectedByBackwardPositionalRules(); }
1539 bool childrenAffectedByFirstChildRules() const { return m_bitfields.childrenAffectedByFirstChildRules(); }
1540 void setChildrenAffectedByFirstChildRules() { m_bitfields.setChildrenAffectedByFirstChildRules(true); }
1541 bool childrenAffectedByLastChildRules() const { return m_bitfields.childrenAffectedByLastChildRules(); }
1542 void setChildrenAffectedByLastChildRules() { m_bitfields.setChildrenAffectedByLastChildRules(true); }
1543 bool childrenAffectedByDirectAdjacentRules() const { return m_bitfields.childrenAffectedByDirectAdjacentRules(); }
1544 void setChildrenAffectedByDirectAdjacentRules() { m_bitfields.setChildrenAffectedByDirectAdjacentRules(true); }
1545 bool childrenAffectedByForwardPositionalRules() const { return m_bitfields.childrenAffectedByForwardPositionalRules(); }
1546 void setChildrenAffectedByForwardPositionalRules() { m_bitfields.setChildrenAffectedByForwardPositionalRules(true); }
1547 bool childrenAffectedByBackwardPositionalRules() const { return m_bitfields.childrenAffectedByBackwardPositionalRules(); }
1548 void setChildrenAffectedByBackwardPositionalRules() { m_bitfields.setChildrenAffectedByBackwardPositionalRules(true); }
1549 bool firstChildState() const { return m_bitfields.firstChildState(); }
1550 void setFirstChildState() { m_bitfields.setUnique(true); m_bitfields.setFirstChildState(true); }
1551 bool lastChildState() const { return m_bitfields.lastChildState(); }
1552 void setLastChildState() { m_bitfields.setUnique(true); m_bitfields.setLastChildState(true); }
1553 unsigned childIndex() const { return m_bitfields.childIndex(); }
1554 void setChildIndex(unsigned index) { m_bitfields.setUnique(true); m_bitfields.setChildIndex(index); }
1556 Color visitedDependentColor(int colorProperty) const;
1558 void setHasExplicitlyInheritedProperties() { m_bitfields.setExplicitInheritance(true); }
1559 bool hasExplicitlyInheritedProperties() const { return m_bitfields.explicitInheritance(); }
1561 void reportMemoryUsage(MemoryObjectInfo*) const;
1563 // Initial values for all the properties
1564 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
1565 static EBorderStyle initialBorderStyle() { return BNONE; }
1566 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
1567 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
1568 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
1569 static ECaptionSide initialCaptionSide() { return CAPTOP; }
1570 static EClear initialClear() { return CNONE; }
1571 static ColorSpace initialColorSpace() { return ColorSpaceDeviceRGB; }
1572 static ColumnAxis initialColumnAxis() { return AutoColumnAxis; }
1573 static ColumnProgression initialColumnProgression() { return NormalColumnProgression; }
1574 static TextDirection initialDirection() { return LTR; }
1575 static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
1576 static TextCombine initialTextCombine() { return TextCombineNone; }
1577 static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
1578 static EDisplay initialDisplay() { return INLINE; }
1579 static EEmptyCell initialEmptyCells() { return SHOW; }
1580 static EFloat initialFloating() { return NoFloat; }
1581 static EListStylePosition initialListStylePosition() { return OUTSIDE; }
1582 static EListStyleType initialListStyleType() { return Disc; }
1583 static EOverflow initialOverflowX() { return OVISIBLE; }
1584 static EOverflow initialOverflowY() { return OVISIBLE; }
1585 static EPageBreak initialPageBreak() { return PBAUTO; }
1586 static EPosition initialPosition() { return StaticPosition; }
1587 static ETableLayout initialTableLayout() { return TAUTO; }
1588 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1589 static ETextTransform initialTextTransform() { return TTNONE; }
1590 static EVisibility initialVisibility() { return VISIBLE; }
1591 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1592 static short initialHorizontalBorderSpacing() { return 0; }
1593 static short initialVerticalBorderSpacing() { return 0; }
1594 static ECursor initialCursor() { return CURSOR_AUTO; }
1595 static Color initialColor() { return Color::black; }
1596 static StyleImage* initialListStyleImage() { return 0; }
1597 static unsigned initialBorderWidth() { return 3; }
1598 static unsigned short initialColumnRuleWidth() { return 3; }
1599 static unsigned short initialOutlineWidth() { return 3; }
1600 static int initialLetterWordSpacing() { return 0; }
1601 static Length initialSize() { return Length(); }
1602 static Length initialMinSize() { return Length(); }
1603 static Length initialMaxSize() { return Length(Undefined); }
1604 static Length initialOffset() { return Length(); }
1605 static Length initialMargin() { return Length(Fixed); }
1606 static Length initialPadding() { return Length(Fixed); }
1607 static Length initialTextIndent() { return Length(Fixed); }
1608 static EVerticalAlign initialVerticalAlign() { return BASELINE; }
1609 static short initialWidows() { return 2; }
1610 static short initialOrphans() { return 2; }
1611 static Length initialLineHeight() { return Length(-100.0, Percent); }
1612 static ETextAlign initialTextAlign() { return TASTART; }
1613 static ETextDecoration initialTextDecoration() { return TDNONE; }
1614 #if ENABLE(CSS3_TEXT)
1615 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
1616 static ETextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
1618 static float initialZoom() { return 1.0f; }
1619 static int initialOutlineOffset() { return 0; }
1620 static float initialOpacity() { return 1.0f; }
1621 static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
1622 static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
1623 static EBoxDirection initialBoxDirection() { return BNORMAL; }
1624 static EBoxLines initialBoxLines() { return SINGLE; }
1625 static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
1626 static EBoxPack initialBoxPack() { return Start; }
1627 static float initialBoxFlex() { return 0.0f; }
1628 static unsigned int initialBoxFlexGroup() { return 1; }
1629 static unsigned int initialBoxOrdinalGroup() { return 1; }
1630 static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
1631 static StyleReflection* initialBoxReflect() { return 0; }
1632 static float initialFlexGrow() { return 0; }
1633 static float initialFlexShrink() { return 1; }
1634 static Length initialFlexBasis() { return Length(Auto); }
1635 static int initialOrder() { return 0; }
1636 static EAlignContent initialAlignContent() { return AlignContentStretch; }
1637 static EAlignItems initialAlignItems() { return AlignStretch; }
1638 static EAlignItems initialAlignSelf() { return AlignAuto; }
1639 static EFlexDirection initialFlexDirection() { return FlowRow; }
1640 static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
1641 static EJustifyContent initialJustifyContent() { return JustifyFlexStart; }
1642 static int initialMarqueeLoopCount() { return -1; }
1643 static int initialMarqueeSpeed() { return 85; }
1644 static Length initialMarqueeIncrement() { return Length(6, Fixed); }
1645 static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
1646 static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
1647 static EUserModify initialUserModify() { return READ_ONLY; }
1648 static EUserDrag initialUserDrag() { return DRAG_AUTO; }
1649 static EUserSelect initialUserSelect() { return SELECT_TEXT; }
1650 static TextOverflow initialTextOverflow() { return TextOverflowClip; }
1651 static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
1652 static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
1653 static EWordBreak initialWordBreak() { return NormalWordBreak; }
1654 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; }
1655 static ENBSPMode initialNBSPMode() { return NBNORMAL; }
1656 static LineBreak initialLineBreak() { return LineBreakAuto; }
1657 static const AtomicString& initialHighlight() { return nullAtom; }
1658 static ESpeak initialSpeak() { return SpeakNormal; }
1659 static Hyphens initialHyphens() { return HyphensManual; }
1660 static short initialHyphenationLimitBefore() { return -1; }
1661 static short initialHyphenationLimitAfter() { return -1; }
1662 static short initialHyphenationLimitLines() { return -1; }
1663 static const AtomicString& initialHyphenationString() { return nullAtom; }
1664 static const AtomicString& initialLocale() { return nullAtom; }
1665 static EBorderFit initialBorderFit() { return BorderFitBorder; }
1666 static EResize initialResize() { return RESIZE_NONE; }
1667 static ControlPart initialAppearance() { return NoControlPart; }
1668 static bool initialHasAspectRatio() { return false; }
1669 static float initialAspectRatioDenominator() { return 1; }
1670 static float initialAspectRatioNumerator() { return 1; }
1671 static Order initialRTLOrdering() { return LogicalOrder; }
1672 static float initialTextStrokeWidth() { return 0; }
1673 static unsigned short initialColumnCount() { return 1; }
1674 static ColumnSpan initialColumnSpan() { return ColumnSpanOne; }
1675 static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
1676 static Length initialTransformOriginX() { return Length(50.0, Percent); }
1677 static Length initialTransformOriginY() { return Length(50.0, Percent); }
1678 static EPointerEvents initialPointerEvents() { return PE_AUTO; }
1679 static float initialTransformOriginZ() { return 0; }
1680 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
1681 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
1682 static float initialPerspective() { return 0; }
1683 static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
1684 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
1685 static Color initialBackgroundColor() { return Color::transparent; }
1686 static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
1687 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
1688 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
1689 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
1690 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
1691 static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
1692 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
1693 static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
1694 static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSpecified; }
1695 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
1696 static float initialImageResolution() { return 1; }
1697 static StyleImage* initialBorderImageSource() { return 0; }
1698 static StyleImage* initialMaskBoxImageSource() { return 0; }
1699 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
1701 // The initial value is 'none' for grid tracks.
1702 static Vector<Length> initialGridTrackValue()
1704 DEFINE_STATIC_LOCAL(Vector<Length>, defaultLength, ());
1705 // We need to manually add the Length here as the Length(0) is 'auto'.
1706 if (!defaultLength.size())
1707 defaultLength.append(Length(Undefined));
1708 return defaultLength;
1710 static Vector<Length> initialGridColumns() { return initialGridTrackValue(); }
1711 static Vector<Length> initialGridRows() { return initialGridTrackValue(); }
1713 // 'auto' is the default.
1714 static Length initialGridItemColumn() { return Length(); }
1715 static Length initialGridItemRow() { return Length(); }
1717 static unsigned initialTabSize() { return 8; }
1719 static const AtomicString& initialLineGrid() { return nullAtom; }
1720 static LineSnap initialLineSnap() { return LineSnapNone; }
1721 static LineAlign initialLineAlign() { return LineAlignNone; }
1723 static const AtomicString& initialFlowThread() { return nullAtom; }
1724 static const AtomicString& initialRegionThread() { return nullAtom; }
1725 static RegionOverflow initialRegionOverflow() { return AutoRegionOverflow; }
1727 static WrapFlow initialWrapFlow() { return WrapFlowAuto; }
1728 static WrapThrough initialWrapThrough() { return WrapThroughWrap; }
1730 // Keep these at the end.
1731 static LineClampValue initialLineClamp() { return LineClampValue(); }
1732 static bool initialTextSizeAdjust() { return true; }
1733 static ETextSecurity initialTextSecurity() { return TSNONE; }
1734 #if ENABLE(TOUCH_EVENTS)
1735 static Color initialTapHighlightColor();
1737 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
1738 static bool initialUseTouchOverflowScrolling() { return false; }
1740 #if ENABLE(DASHBOARD_SUPPORT)
1741 static const Vector<StyleDashboardRegion>& initialDashboardRegions();
1742 static const Vector<StyleDashboardRegion>& noneDashboardRegions();
1744 #if ENABLE(CSS_FILTERS)
1745 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
1747 #if ENABLE(CSS_COMPOSITING)
1748 static BlendMode initialBlendMode() { return BlendModeNormal; }
1751 void setVisitedLinkColor(const Color&);
1752 void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v) }
1753 void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v) }
1754 void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v) }
1755 void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v) }
1756 void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v) }
1757 void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v) }
1758 void setVisitedLinkColumnRuleColor(const Color& v) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_visitedLinkColumnRuleColor, v) }
1759 void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextEmphasisColor, v) }
1760 void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextFillColor, v) }
1761 void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextStrokeColor, v) }
1763 void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags._unicodeBidi = parent->noninherited_flags._unicodeBidi; }
1764 void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
1765 LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const;
1766 void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const;
1767 void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const;
1768 void getShadowInlineDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const
1770 return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
1772 void getShadowBlockDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const
1774 return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
1777 bool isDisplayReplacedType(EDisplay display) const
1779 return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX
1780 || display == INLINE_TABLE || display == INLINE_GRID;
1783 bool isDisplayInlineType(EDisplay display) const
1785 return display == INLINE || isDisplayReplacedType(display);
1788 // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
1789 Color invalidColor() const { static Color invalid; return invalid; }
1790 Color borderLeftColor() const { return surround->border.left().color(); }
1791 Color borderRightColor() const { return surround->border.right().color(); }
1792 Color borderTopColor() const { return surround->border.top().color(); }
1793 Color borderBottomColor() const { return surround->border.bottom().color(); }
1794 Color backgroundColor() const { return m_background->color(); }
1795 Color color() const;
1796 Color columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
1797 Color outlineColor() const { return m_background->outline().color(); }
1798 Color textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
1799 Color textFillColor() const { return rareInheritedData->textFillColor; }
1800 Color textStrokeColor() const { return rareInheritedData->textStrokeColor; }
1801 Color visitedLinkColor() const;
1802 Color visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
1803 Color visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
1804 Color visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
1805 Color visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
1806 Color visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
1807 Color visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
1808 Color visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
1809 Color visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; }
1810 Color visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; }
1811 Color visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor; }
1813 Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
1816 Color stopColor() const { return svgStyle()->stopColor(); }
1817 Color floodColor() const { return svgStyle()->floodColor(); }
1818 Color lightingColor() const { return svgStyle()->lightingColor(); }
1821 void appendContent(PassOwnPtr<ContentData>);
1824 inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
1826 double zoomFactor = style->effectiveZoom();
1827 if (zoomFactor == 1)
1829 // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
1830 if (zoomFactor > 1) {
1837 return roundForImpreciseConversion<int>(value / zoomFactor);
1840 inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle* style)
1842 return value / style->effectiveZoom();
1845 inline bool RenderStyle::setZoom(float f)
1847 if (compareEqual(visual->m_zoom, f))
1849 visual.access()->m_zoom = f;
1850 setEffectiveZoom(effectiveZoom() * zoom());
1854 inline bool RenderStyle::setEffectiveZoom(float f)
1856 if (compareEqual(rareInheritedData->m_effectiveZoom, f))
1858 rareInheritedData.access()->m_effectiveZoom = f;
1862 inline bool RenderStyle::setTextSizeAdjust(bool b)
1864 if (compareEqual(rareInheritedData->textSizeAdjust, b))
1866 rareInheritedData.access()->textSizeAdjust = b;
1870 } // namespace WebCore
1872 #endif // RenderStyle_h