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 "CSSPropertyNames.h"
29 #include "core/animation/css/CSSAnimationDataList.h"
30 #include "core/css/CSSLineBoxContainValue.h"
31 #include "core/css/CSSPrimitiveValue.h"
32 #include "core/rendering/style/BorderValue.h"
33 #include "core/rendering/style/CounterDirectives.h"
34 #include "core/rendering/style/DataRef.h"
35 #include "core/rendering/style/LineClampValue.h"
36 #include "core/rendering/style/NinePieceImage.h"
37 #include "core/rendering/style/OutlineValue.h"
38 #include "core/rendering/style/RenderStyleConstants.h"
39 #include "core/rendering/style/SVGRenderStyle.h"
40 #include "core/rendering/style/ShapeValue.h"
41 #include "core/rendering/style/StyleBackgroundData.h"
42 #include "core/rendering/style/StyleBoxData.h"
43 #include "core/rendering/style/StyleDeprecatedFlexibleBoxData.h"
44 #include "core/rendering/style/StyleDifference.h"
45 #include "core/rendering/style/StyleFilterData.h"
46 #include "core/rendering/style/StyleFlexibleBoxData.h"
47 #include "core/rendering/style/StyleGridData.h"
48 #include "core/rendering/style/StyleGridItemData.h"
49 #include "core/rendering/style/StyleMarqueeData.h"
50 #include "core/rendering/style/StyleMultiColData.h"
51 #include "core/rendering/style/StyleRareInheritedData.h"
52 #include "core/rendering/style/StyleRareNonInheritedData.h"
53 #include "core/rendering/style/StyleReflection.h"
54 #include "core/rendering/style/StyleSurroundData.h"
55 #include "core/rendering/style/StyleTransformData.h"
56 #include "core/rendering/style/StyleVisualData.h"
57 #include "core/rendering/style/StyleWillChangeData.h"
58 #include "core/svg/SVGPaint.h"
59 #include "platform/Length.h"
60 #include "platform/LengthBox.h"
61 #include "platform/LengthSize.h"
62 #include "platform/ThemeTypes.h"
63 #include "platform/fonts/FontBaseline.h"
64 #include "platform/fonts/FontDescription.h"
65 #include "platform/geometry/FloatRoundedRect.h"
66 #include "platform/geometry/LayoutBoxExtent.h"
67 #include "platform/geometry/RoundedRect.h"
68 #include "platform/graphics/Color.h"
69 #include "platform/graphics/GraphicsTypes.h"
70 #include "platform/scroll/ScrollableArea.h"
71 #include "platform/text/TextDirection.h"
72 #include "platform/text/UnicodeBidi.h"
73 #include "platform/transforms/TransformOperations.h"
74 #include "wtf/Forward.h"
75 #include "wtf/OwnPtr.h"
76 #include "wtf/RefCounted.h"
77 #include "wtf/StdLibExtras.h"
78 #include "wtf/Vector.h"
80 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
82 #define SET_VAR(group, variable, value) \
83 if (!compareEqual(group->variable, value)) \
84 group.access()->variable = value
86 #define SET_VAR_WITH_SETTER(group, getter, setter, value) \
87 if (!compareEqual(group->getter(), value)) \
88 group.access()->setter(value)
90 #define SET_BORDERVALUE_COLOR(group, variable, value) \
91 if (!compareEqual(group->variable.color(), value)) \
92 group.access()->variable.setColor(value)
98 class FilterOperations;
101 class CounterContent;
109 class StyleInheritedData;
111 class TransformationMatrix;
115 typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
117 class RenderStyle: public RefCounted<RenderStyle> {
118 friend class AnimatedStyleBuilder; // Used by Web Animations CSS. Sets the color styles
119 friend class CSSAnimatableValueFactory; // Used by Web Animations CSS. Gets visited and unvisited colors separately.
120 friend class CSSPropertyEquality; // Used by CSS animations. We can't allow them to animate based off visited colors.
121 friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
122 friend class EditingStyle; // Editing has to only reveal unvisited info.
123 friend class CSSComputedStyleDeclaration; // Ignores visited styles, so needs to be able to see unvisited info.
124 friend class PropertyWrapperMaybeInvalidStyleColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
125 friend class StyleBuilderFunctions; // Sets color styles
126 friend class CachedUAStyle; // Saves Border/Background information for later comparison.
128 // FIXME: When we stop resolving currentColor at style time, these can be removed.
129 friend class CSSToStyleMap;
130 friend class FilterOperationResolver;
131 friend class StyleBuilderConverter;
132 friend class StyleBuilder;
133 friend class StyleResolverState;
134 friend class StyleResolver;
137 // non-inherited attributes
138 DataRef<StyleBoxData> m_box;
139 DataRef<StyleVisualData> visual;
140 DataRef<StyleBackgroundData> m_background;
141 DataRef<StyleSurroundData> surround;
142 DataRef<StyleRareNonInheritedData> rareNonInheritedData;
144 // inherited attributes
145 DataRef<StyleRareInheritedData> rareInheritedData;
146 DataRef<StyleInheritedData> inherited;
148 // list of associated pseudo styles
149 OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
151 DataRef<SVGRenderStyle> m_svgStyle;
153 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
156 struct InheritedFlags {
157 bool operator==(const InheritedFlags& other) const
159 return (_empty_cells == other._empty_cells)
160 && (_caption_side == other._caption_side)
161 && (_list_style_type == other._list_style_type)
162 && (_list_style_position == other._list_style_position)
163 && (_visibility == other._visibility)
164 && (_text_align == other._text_align)
165 && (_text_transform == other._text_transform)
166 && (_text_decorations == other._text_decorations)
167 && (_cursor_style == other._cursor_style)
168 && (_direction == other._direction)
169 && (_white_space == other._white_space)
170 && (_border_collapse == other._border_collapse)
171 && (_box_direction == other._box_direction)
172 && (m_rtlOrdering == other.m_rtlOrdering)
173 && (m_printColorAdjust == other.m_printColorAdjust)
174 && (_pointerEvents == other._pointerEvents)
175 && (_insideLink == other._insideLink)
176 && (m_writingMode == other.m_writingMode);
179 bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
181 unsigned _empty_cells : 1; // EEmptyCell
182 unsigned _caption_side : 2; // ECaptionSide
183 unsigned _list_style_type : 7; // EListStyleType
184 unsigned _list_style_position : 1; // EListStylePosition
185 unsigned _visibility : 2; // EVisibility
186 unsigned _text_align : 4; // ETextAlign
187 unsigned _text_transform : 2; // ETextTransform
188 unsigned _text_decorations : TextDecorationBits;
189 unsigned _cursor_style : 6; // ECursor
190 unsigned _direction : 1; // TextDirection
191 unsigned _white_space : 3; // EWhiteSpace
193 unsigned _border_collapse : 1; // EBorderCollapse
194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
196 // non CSS2 inherited
197 unsigned m_rtlOrdering : 1; // Order
198 unsigned m_printColorAdjust : PrintColorAdjustBits;
199 unsigned _pointerEvents : 4; // EPointerEvents
200 unsigned _insideLink : 2; // EInsideLink
203 // CSS Text Layout Module Level 3: Vertical writing support
204 unsigned m_writingMode : 2; // WritingMode
209 struct NonInheritedFlags {
210 bool operator==(const NonInheritedFlags& other) const
212 return _effectiveDisplay == other._effectiveDisplay
213 && _originalDisplay == other._originalDisplay
214 && _overflowX == other._overflowX
215 && _overflowY == other._overflowY
216 && _vertical_align == other._vertical_align
217 && _clear == other._clear
218 && _position == other._position
219 && _floating == other._floating
220 && _table_layout == other._table_layout
221 && _page_break_before == other._page_break_before
222 && _page_break_after == other._page_break_after
223 && _page_break_inside == other._page_break_inside
224 && _styleType == other._styleType
225 && _affectedByFocus == other._affectedByFocus
226 && _affectedByHover == other._affectedByHover
227 && _affectedByActive == other._affectedByActive
228 && _affectedByDrag == other._affectedByDrag
229 && _pseudoBits == other._pseudoBits
230 && _unicodeBidi == other._unicodeBidi
231 && explicitInheritance == other.explicitInheritance
232 && currentColor == other.currentColor
233 && unique == other.unique
234 && emptyState == other.emptyState
235 && firstChildState == other.firstChildState
236 && lastChildState == other.lastChildState
237 && _isLink == other._isLink;
240 bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
242 unsigned _effectiveDisplay : 5; // EDisplay
243 unsigned _originalDisplay : 5; // EDisplay
244 unsigned _overflowX : 3; // EOverflow
245 unsigned _overflowY : 3; // EOverflow
246 unsigned _vertical_align : 4; // EVerticalAlign
247 unsigned _clear : 2; // EClear
248 unsigned _position : 3; // EPosition
249 unsigned _floating : 2; // EFloat
250 unsigned _table_layout : 1; // ETableLayout
252 unsigned _unicodeBidi : 3; // EUnicodeBidi
254 // This is set if we used viewport units when resolving a length.
255 // It is mutable so we can pass around const RenderStyles to resolve lengths.
256 mutable unsigned hasViewportUnits : 1;
260 unsigned _page_break_before : 2; // EPageBreak
261 unsigned _page_break_after : 2; // EPageBreak
262 unsigned _page_break_inside : 2; // EPageBreak
264 unsigned _styleType : 6; // PseudoId
265 unsigned _pseudoBits : 8;
266 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
267 unsigned currentColor : 1; // At least one color has the value 'currentColor'
268 unsigned unique : 1; // Style can not be shared.
269 unsigned emptyState : 1;
270 unsigned firstChildState : 1;
271 unsigned lastChildState : 1;
273 bool affectedByFocus() const { return _affectedByFocus; }
274 void setAffectedByFocus(bool value) { _affectedByFocus = value; }
275 bool affectedByHover() const { return _affectedByHover; }
276 void setAffectedByHover(bool value) { _affectedByHover = value; }
277 bool affectedByActive() const { return _affectedByActive; }
278 void setAffectedByActive(bool value) { _affectedByActive = value; }
279 bool affectedByDrag() const { return _affectedByDrag; }
280 void setAffectedByDrag(bool value) { _affectedByDrag = value; }
281 bool isLink() const { return _isLink; }
282 void setIsLink(bool value) { _isLink = value; }
284 unsigned _affectedByFocus : 1;
285 unsigned _affectedByHover : 1;
286 unsigned _affectedByActive : 1;
287 unsigned _affectedByDrag : 1;
288 unsigned _isLink : 1;
289 // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
291 } noninherited_flags;
296 void setBitDefaults()
298 inherited_flags._empty_cells = initialEmptyCells();
299 inherited_flags._caption_side = initialCaptionSide();
300 inherited_flags._list_style_type = initialListStyleType();
301 inherited_flags._list_style_position = initialListStylePosition();
302 inherited_flags._visibility = initialVisibility();
303 inherited_flags._text_align = initialTextAlign();
304 inherited_flags._text_transform = initialTextTransform();
305 inherited_flags._text_decorations = initialTextDecoration();
306 inherited_flags._cursor_style = initialCursor();
307 inherited_flags._direction = initialDirection();
308 inherited_flags._white_space = initialWhiteSpace();
309 inherited_flags._border_collapse = initialBorderCollapse();
310 inherited_flags.m_rtlOrdering = initialRTLOrdering();
311 inherited_flags._box_direction = initialBoxDirection();
312 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
313 inherited_flags._pointerEvents = initialPointerEvents();
314 inherited_flags._insideLink = NotInsideLink;
315 inherited_flags.m_writingMode = initialWritingMode();
317 noninherited_flags._effectiveDisplay = noninherited_flags._originalDisplay = initialDisplay();
318 noninherited_flags._overflowX = initialOverflowX();
319 noninherited_flags._overflowY = initialOverflowY();
320 noninherited_flags._vertical_align = initialVerticalAlign();
321 noninherited_flags._clear = initialClear();
322 noninherited_flags._position = initialPosition();
323 noninherited_flags._floating = initialFloating();
324 noninherited_flags._table_layout = initialTableLayout();
325 noninherited_flags._unicodeBidi = initialUnicodeBidi();
326 noninherited_flags._page_break_before = initialPageBreak();
327 noninherited_flags._page_break_after = initialPageBreak();
328 noninherited_flags._page_break_inside = initialPageBreak();
329 noninherited_flags._styleType = NOPSEUDO;
330 noninherited_flags._pseudoBits = 0;
331 noninherited_flags.explicitInheritance = false;
332 noninherited_flags.currentColor = false;
333 noninherited_flags.unique = false;
334 noninherited_flags.emptyState = false;
335 noninherited_flags.firstChildState = false;
336 noninherited_flags.lastChildState = false;
337 noninherited_flags.hasViewportUnits = false;
338 noninherited_flags.setAffectedByFocus(false);
339 noninherited_flags.setAffectedByHover(false);
340 noninherited_flags.setAffectedByActive(false);
341 noninherited_flags.setAffectedByDrag(false);
342 noninherited_flags.setIsLink(false);
346 ALWAYS_INLINE RenderStyle();
348 enum DefaultStyleTag {
351 ALWAYS_INLINE explicit RenderStyle(DefaultStyleTag);
352 ALWAYS_INLINE RenderStyle(const RenderStyle&);
355 static PassRefPtr<RenderStyle> create();
356 static PassRefPtr<RenderStyle> createDefaultStyle();
357 static PassRefPtr<RenderStyle> createAnonymousStyleWithDisplay(const RenderStyle* parentStyle, EDisplay);
358 static PassRefPtr<RenderStyle> clone(const RenderStyle*);
360 // Computes how the style change should be propagated down the tree.
361 static StyleRecalcChange stylePropagationDiff(const RenderStyle* oldStyle, const RenderStyle* newStyle);
363 // Computes how much visual invalidation the style change causes: layout, repaint or recomposite.
364 StyleDifference visualInvalidationDiff(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
366 enum IsAtShadowBoundary {
371 void inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary = NotAtShadowBoundary);
372 void copyNonInheritedFrom(const RenderStyle*);
374 PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags._styleType); }
375 void setStyleType(PseudoId styleType) { noninherited_flags._styleType = styleType; }
377 RenderStyle* getCachedPseudoStyle(PseudoId) const;
378 RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
379 void removeCachedPseudoStyle(PseudoId);
381 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
383 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_flags.hasViewportUnits = hasViewportUnits; }
384 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; }
386 bool affectedByFocus() const { return noninherited_flags.affectedByFocus(); }
387 bool affectedByHover() const { return noninherited_flags.affectedByHover(); }
388 bool affectedByActive() const { return noninherited_flags.affectedByActive(); }
389 bool affectedByDrag() const { return noninherited_flags.affectedByDrag(); }
391 void setAffectedByFocus() { noninherited_flags.setAffectedByFocus(true); }
392 void setAffectedByHover() { noninherited_flags.setAffectedByHover(true); }
393 void setAffectedByActive() { noninherited_flags.setAffectedByActive(true); }
394 void setAffectedByDrag() { noninherited_flags.setAffectedByDrag(true); }
396 bool operator==(const RenderStyle& other) const;
397 bool operator!=(const RenderStyle& other) const { return !(*this == other); }
398 bool isFloating() const { return noninherited_flags._floating != NoFloat; }
399 bool hasMargin() const { return surround->margin.nonZero(); }
400 bool hasBorder() const { return surround->border.hasBorder(); }
401 bool hasPadding() const { return surround->padding.nonZero(); }
402 bool hasOffset() const { return surround->offset.nonZero(); }
403 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); }
404 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); }
406 bool hasBackgroundImage() const { return m_background->background().hasImage(); }
407 bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
409 bool hasEntirelyFixedBackground() const;
411 bool hasAppearance() const { return appearance() != NoControlPart; }
413 bool hasBackground() const
415 Color color = visitedDependentColor(CSSPropertyBackgroundColor);
418 return hasBackgroundImage();
421 LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
422 bool hasBorderImageOutsets() const
424 return borderImage().hasImage() && borderImage().outset().nonZero();
426 LayoutBoxExtent borderImageOutsets() const
428 return imageOutsets(borderImage());
431 LayoutBoxExtent maskBoxImageOutsets() const
433 return imageOutsets(maskBoxImage());
436 bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
437 FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
439 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
440 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
442 bool isStyleAvailable() const;
444 bool hasAnyPublicPseudoStyles() const;
445 bool hasPseudoStyle(PseudoId pseudo) const;
446 void setHasPseudoStyle(PseudoId pseudo);
447 bool hasUniquePseudoStyle() const;
448 bool hasPseudoElementStyle() const;
450 // attribute getter methods
452 EDisplay display() const { return static_cast<EDisplay>(noninherited_flags._effectiveDisplay); }
453 EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags._originalDisplay); }
455 const Length& left() const { return surround->offset.left(); }
456 const Length& right() const { return surround->offset.right(); }
457 const Length& top() const { return surround->offset.top(); }
458 const Length& bottom() const { return surround->offset.bottom(); }
460 // Accessors for positioned object edges that take into account writing mode.
461 const Length& logicalLeft() const { return surround->offset.logicalLeft(writingMode()); }
462 const Length& logicalRight() const { return surround->offset.logicalRight(writingMode()); }
463 const Length& logicalTop() const { return surround->offset.before(writingMode()); }
464 const Length& logicalBottom() const { return surround->offset.after(writingMode()); }
466 // Whether or not a positioned element requires normal flow x/y to be computed
467 // to determine its position.
468 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
469 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
470 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
471 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
473 EPosition position() const { return static_cast<EPosition>(noninherited_flags._position); }
474 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
475 bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; }
476 bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; }
477 EFloat floating() const { return static_cast<EFloat>(noninherited_flags._floating); }
479 const Length& width() const { return m_box->width(); }
480 const Length& height() const { return m_box->height(); }
481 const Length& minWidth() const { return m_box->minWidth(); }
482 const Length& maxWidth() const { return m_box->maxWidth(); }
483 const Length& minHeight() const { return m_box->minHeight(); }
484 const Length& maxHeight() const { return m_box->maxHeight(); }
486 const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
487 const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
488 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
489 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
490 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
491 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
493 const BorderData& border() const { return surround->border; }
494 const BorderValue& borderLeft() const { return surround->border.left(); }
495 const BorderValue& borderRight() const { return surround->border.right(); }
496 const BorderValue& borderTop() const { return surround->border.top(); }
497 const BorderValue& borderBottom() const { return surround->border.bottom(); }
499 const BorderValue& borderBefore() const;
500 const BorderValue& borderAfter() const;
501 const BorderValue& borderStart() const;
502 const BorderValue& borderEnd() const;
504 const NinePieceImage& borderImage() const { return surround->border.image(); }
505 StyleImage* borderImageSource() const { return surround->border.image().image(); }
506 const LengthBox& borderImageSlices() const { return surround->border.image().imageSlices(); }
507 const BorderImageLengthBox& borderImageWidth() const { return surround->border.image().borderSlices(); }
508 const BorderImageLengthBox& borderImageOutset() const { return surround->border.image().outset(); }
510 const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
511 const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
512 const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
513 const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
514 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
516 unsigned borderLeftWidth() const { return surround->border.borderLeftWidth(); }
517 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
518 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
519 unsigned borderRightWidth() const { return surround->border.borderRightWidth(); }
520 EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
521 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
522 unsigned borderTopWidth() const { return surround->border.borderTopWidth(); }
523 EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
524 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
525 unsigned borderBottomWidth() const { return surround->border.borderBottomWidth(); }
526 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
527 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
529 unsigned short borderBeforeWidth() const;
530 unsigned short borderAfterWidth() const;
531 unsigned short borderStartWidth() const;
532 unsigned short borderEndWidth() const;
534 unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
535 unsigned short outlineWidth() const
537 if (m_background->outline().style() == BNONE)
539 return m_background->outline().width();
541 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
542 EBorderStyle outlineStyle() const { return m_background->outline().style(); }
543 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
545 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags._overflowX); }
546 EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags._overflowY); }
547 // It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
548 bool isOverflowVisible() const { ASSERT(overflowX() != OVISIBLE || overflowX() == overflowY()); return overflowX() == OVISIBLE; }
549 bool isOverflowPaged() const { return overflowY() == OPAGEDX || overflowY() == OPAGEDY; }
551 EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
552 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags._vertical_align); }
553 const Length& verticalAlignLength() const { return m_box->verticalAlign(); }
555 const Length& clipLeft() const { return visual->clip.left(); }
556 const Length& clipRight() const { return visual->clip.right(); }
557 const Length& clipTop() const { return visual->clip.top(); }
558 const Length& clipBottom() const { return visual->clip.bottom(); }
559 const LengthBox& clip() const { return visual->clip; }
560 bool hasClip() const { return visual->hasClip; }
562 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags._unicodeBidi); }
564 EClear clear() const { return static_cast<EClear>(noninherited_flags._clear); }
565 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags._table_layout); }
566 bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logicalWidth().isAuto(); }
568 const Font& font() const;
569 const FontMetrics& fontMetrics() const;
570 const FontDescription& fontDescription() const;
571 float specifiedFontSize() const;
572 float computedFontSize() const;
573 int fontSize() const;
574 FontWeight fontWeight() const;
576 float textAutosizingMultiplier() const { return visual->m_textAutosizingMultiplier; }
578 const Length& textIndent() const { return rareInheritedData->indent; }
579 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(rareInheritedData->m_textIndentLine); }
580 TextIndentType textIndentType() const { return static_cast<TextIndentType>(rareInheritedData->m_textIndentType); }
581 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
582 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
583 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
584 ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
585 TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(inherited_flags._text_decorations); }
586 TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
587 TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
588 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
589 float wordSpacing() const;
590 float letterSpacing() const;
592 float zoom() const { return visual->m_zoom; }
593 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
595 TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
596 bool isLeftToRightDirection() const { return direction() == LTR; }
598 const Length& specifiedLineHeight() const;
599 Length lineHeight() const;
600 int computedLineHeight() const;
602 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
603 static bool autoWrap(EWhiteSpace ws)
605 // Nowrap and pre don't automatically wrap.
606 return ws != NOWRAP && ws != PRE;
609 bool autoWrap() const
611 return autoWrap(whiteSpace());
614 static bool preserveNewline(EWhiteSpace ws)
616 // Normal and nowrap do not preserve newlines.
617 return ws != NORMAL && ws != NOWRAP;
620 bool preserveNewline() const
622 return preserveNewline(whiteSpace());
625 static bool collapseWhiteSpace(EWhiteSpace ws)
627 // Pre and prewrap do not collapse whitespace.
628 return ws != PRE && ws != PRE_WRAP;
631 bool collapseWhiteSpace() const
633 return collapseWhiteSpace(whiteSpace());
636 bool isCollapsibleWhiteSpace(UChar c) const
641 return collapseWhiteSpace();
643 return !preserveNewline();
648 bool breakOnlyAfterWhiteSpace() const
650 return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
653 bool breakWords() const
655 return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
658 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
659 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
660 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
661 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
662 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
663 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
664 const Length& backgroundXPosition() const { return m_background->background().xPosition(); }
665 const Length& backgroundYPosition() const { return m_background->background().yPosition(); }
666 EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
667 const LengthSize& backgroundSizeLength() const { return m_background->background().sizeLength(); }
668 FillLayer* accessBackgroundLayers() { return &(m_background.access()->m_background); }
669 const FillLayer* backgroundLayers() const { return &(m_background->background()); }
671 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
672 EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
673 EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
674 CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
675 EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
676 EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
677 const Length& maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
678 const Length& maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
679 EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
680 const LengthSize& maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
681 FillLayer* accessMaskLayers() { return &(rareNonInheritedData.access()->m_mask); }
682 const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
684 const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
685 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
686 const LengthBox& maskBoxImageSlices() const { return rareNonInheritedData->m_maskBoxImage.imageSlices(); }
687 bool maskBoxImageSlicesFill() const { return rareNonInheritedData->m_maskBoxImage.fill(); }
688 const BorderImageLengthBox& maskBoxImageWidth() const { return rareNonInheritedData->m_maskBoxImage.borderSlices(); }
689 const BorderImageLengthBox& maskBoxImageOutset() const { return rareNonInheritedData->m_maskBoxImage.outset(); }
691 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
692 short horizontalBorderSpacing() const;
693 short verticalBorderSpacing() const;
694 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
695 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
697 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
698 StyleImage* listStyleImage() const;
699 EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
701 const Length& marginTop() const { return surround->margin.top(); }
702 const Length& marginBottom() const { return surround->margin.bottom(); }
703 const Length& marginLeft() const { return surround->margin.left(); }
704 const Length& marginRight() const { return surround->margin.right(); }
705 const Length& marginBefore() const { return surround->margin.before(writingMode()); }
706 const Length& marginAfter() const { return surround->margin.after(writingMode()); }
707 const Length& marginStart() const { return surround->margin.start(writingMode(), direction()); }
708 const Length& marginEnd() const { return surround->margin.end(writingMode(), direction()); }
709 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
710 const Length& marginEndUsing(const RenderStyle* otherStyle) const { return surround->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
711 const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return surround->margin.before(otherStyle->writingMode()); }
712 const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return surround->margin.after(otherStyle->writingMode()); }
714 const LengthBox& paddingBox() const { return surround->padding; }
715 const Length& paddingTop() const { return surround->padding.top(); }
716 const Length& paddingBottom() const { return surround->padding.bottom(); }
717 const Length& paddingLeft() const { return surround->padding.left(); }
718 const Length& paddingRight() const { return surround->padding.right(); }
719 const Length& paddingBefore() const { return surround->padding.before(writingMode()); }
720 const Length& paddingAfter() const { return surround->padding.after(writingMode()); }
721 const Length& paddingStart() const { return surround->padding.start(writingMode(), direction()); }
722 const Length& paddingEnd() const { return surround->padding.end(writingMode(), direction()); }
724 ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
725 CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
727 EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
728 bool isLink() const { return noninherited_flags.isLink(); }
730 short widows() const { return rareInheritedData->widows; }
731 short orphans() const { return rareInheritedData->orphans; }
732 bool hasAutoWidows() const { return rareInheritedData->m_hasAutoWidows; }
733 bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; }
734 EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags._page_break_inside); }
735 EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags._page_break_before); }
736 EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags._page_break_after); }
738 // CSS3 Getter Methods
740 int outlineOffset() const
742 if (m_background->outline().style() == BNONE)
744 return m_background->outline().offset();
747 ShadowList* textShadow() const { return rareInheritedData->textShadow.get(); }
748 void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
749 void getTextShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
750 void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
751 void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
752 void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
754 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
755 float opacity() const { return rareNonInheritedData->opacity; }
756 ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
757 // aspect ratio convenience method
758 bool hasAspectRatio() const { return rareNonInheritedData->m_hasAspectRatio; }
759 float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
760 float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
761 float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
762 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->m_deprecatedFlexibleBox->align); }
763 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
764 float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex; }
765 unsigned boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flexGroup; }
766 EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedData->m_deprecatedFlexibleBox->lines); }
767 unsigned boxOrdinalGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->ordinalGroup; }
768 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->m_deprecatedFlexibleBox->orient); }
769 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
771 int order() const { return rareNonInheritedData->m_order; }
772 const Vector<String>& callbackSelectors() const { return rareNonInheritedData->m_callbackSelectors; }
773 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
774 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
775 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
776 EAlignContent alignContent() const { return static_cast<EAlignContent>(rareNonInheritedData->m_alignContent); }
777 ItemPosition alignItems() const { return static_cast<ItemPosition>(rareNonInheritedData->m_alignItems); }
778 OverflowAlignment alignItemsOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_alignItemsOverflowAlignment); }
779 ItemPosition alignSelf() const { return static_cast<ItemPosition>(rareNonInheritedData->m_alignSelf); }
780 OverflowAlignment alignSelfOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_alignSelfOverflowAlignment); }
781 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
782 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
783 bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
784 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
785 EJustifyContent justifyContent() const { return static_cast<EJustifyContent>(rareNonInheritedData->m_justifyContent); }
786 ItemPosition justifySelf() const { return static_cast<ItemPosition>(rareNonInheritedData->m_justifySelf); }
787 OverflowAlignment justifySelfOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); }
789 const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInheritedData->m_grid->m_gridTemplateColumns; }
790 const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheritedData->m_grid->m_gridTemplateRows; }
791 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheritedData->m_grid->m_namedGridColumnLines; }
792 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInheritedData->m_grid->m_namedGridRowLines; }
793 const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; }
794 const OrderedNamedGridLines& orderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridRowLines; }
795 const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData->m_grid->m_namedGridArea; }
796 size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaRowCount; }
797 size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaColumnCount; }
798 GridAutoFlow gridAutoFlow() const { return rareNonInheritedData->m_grid->m_gridAutoFlow; }
799 const GridTrackSize& gridAutoColumns() const { return rareNonInheritedData->m_grid->m_gridAutoColumns; }
800 const GridTrackSize& gridAutoRows() const { return rareNonInheritedData->m_grid->m_gridAutoRows; }
802 const GridPosition& gridColumnStart() const { return rareNonInheritedData->m_gridItem->m_gridColumnStart; }
803 const GridPosition& gridColumnEnd() const { return rareNonInheritedData->m_gridItem->m_gridColumnEnd; }
804 const GridPosition& gridRowStart() const { return rareNonInheritedData->m_gridItem->m_gridRowStart; }
805 const GridPosition& gridRowEnd() const { return rareNonInheritedData->m_gridItem->m_gridRowEnd; }
807 ShadowList* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
808 void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
809 LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
810 void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
811 void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
812 void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
813 void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
815 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecorationBreak(); }
816 StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
817 bool reflectionDataEquivalent(const RenderStyle* otherStyle) const { return rareNonInheritedData->reflectionDataEquivalent(*otherStyle->rareNonInheritedData); }
819 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
820 const Length& marqueeIncrement() const { return rareNonInheritedData->m_marquee->increment; }
821 int marqueeSpeed() const { return rareNonInheritedData->m_marquee->speed; }
822 int marqueeLoopCount() const { return rareNonInheritedData->m_marquee->loops; }
823 EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->m_marquee->behavior); }
824 EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->m_marquee->direction); }
825 EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
826 EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
827 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
828 TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNonInheritedData->textOverflow); }
829 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
830 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
831 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
832 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareInheritedData->overflowWrap); }
833 LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedData->lineBreak); }
834 const AtomicString& highlight() const { return rareInheritedData->highlight; }
835 const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
836 const AtomicString& locale() const { return rareInheritedData->locale; }
837 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
838 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
839 bool hasInlinePaginationAxis() const
841 // If the pagination axis is parallel with the writing mode inline axis, columns may be laid
842 // out along the inline axis, just like for regular multicol. Otherwise, we need to lay out
843 // along the block axis.
844 if (isOverflowPaged())
845 return (overflowY() == OPAGEDX) == isHorizontalWritingMode();
848 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
849 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
850 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
851 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
852 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth(); }
853 ColumnFill columnFill() const { return static_cast<ColumnFill>(rareNonInheritedData->m_multiCol->m_fill); }
854 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
855 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
856 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
857 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
858 bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
859 ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheritedData->m_multiCol->m_columnSpan); }
860 EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
861 EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
862 EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
863 const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
864 const Length& transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
865 const Length& transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
866 float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
867 bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
868 bool transformDataEquivalent(const RenderStyle& otherStyle) const { return rareNonInheritedData->m_transform == otherStyle.rareNonInheritedData->m_transform; }
870 TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
871 TextEmphasisMark textEmphasisMark() const;
872 const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
873 TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
874 const AtomicString& textEmphasisMarkString() const;
876 RubyPosition rubyPosition() const { return static_cast<RubyPosition>(rareInheritedData->m_rubyPosition); }
878 TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
880 ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
881 LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPosition; }
883 // Return true if any transform related property (currently transform, transformStyle3D or perspective)
884 // indicates that we are transforming
885 bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
887 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
888 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize, ApplyTransformOrigin = IncludeTransformOrigin) const;
889 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
891 bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
893 TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
894 bool hasTextCombine() const { return textCombine() != TextCombineNone; }
896 unsigned tabSize() const { return rareInheritedData->m_tabSize; }
900 WrapFlow wrapFlow() const { return static_cast<WrapFlow>(rareNonInheritedData->m_wrapFlow); }
901 WrapThrough wrapThrough() const { return static_cast<WrapThrough>(rareNonInheritedData->m_wrapThrough); }
903 // Apple-specific property getter methods
904 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
905 const CSSAnimationDataList* animations() const { return rareNonInheritedData->m_animations.get(); }
906 const CSSAnimationDataList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
908 CSSAnimationDataList* accessAnimations();
909 CSSAnimationDataList* accessTransitions();
911 bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
913 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
914 bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
916 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
917 float perspective() const { return rareNonInheritedData->m_perspective; }
918 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
919 const Length& perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
920 const Length& perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
921 const LengthSize& pageSize() const { return rareNonInheritedData->m_pageSize; }
922 PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
924 bool hasCurrentOpacityAnimation() const { return rareNonInheritedData->m_hasCurrentOpacityAnimation; }
925 bool hasCurrentTransformAnimation() const { return rareNonInheritedData->m_hasCurrentTransformAnimation; }
926 bool hasCurrentFilterAnimation() const { return rareNonInheritedData->m_hasCurrentFilterAnimation; }
927 bool shouldCompositeForCurrentAnimations() { return hasCurrentOpacityAnimation() || hasCurrentTransformAnimation() || hasCurrentFilterAnimation(); }
929 bool isRunningOpacityAnimationOnCompositor() const { return rareNonInheritedData->m_runningOpacityAnimationOnCompositor; }
930 bool isRunningTransformAnimationOnCompositor() const { return rareNonInheritedData->m_runningTransformAnimationOnCompositor; }
931 bool isRunningFilterAnimationOnCompositor() const { return rareNonInheritedData->m_runningFilterAnimationOnCompositor; }
932 bool isRunningAnimationOnCompositor() { return isRunningOpacityAnimationOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilterAnimationOnCompositor(); }
934 LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
935 const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
936 Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
937 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
939 WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
940 bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
941 bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
942 bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedBlocksWritingMode(writingMode()); }
944 EImageRendering imageRendering() const { return static_cast<EImageRendering>(rareInheritedData->m_imageRendering); }
946 ESpeak speak() const { return static_cast<ESpeak>(rareInheritedData->speak); }
948 FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_filter.access()->m_operations; }
949 const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
950 bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
952 blink::WebBlendMode blendMode() const;
953 void setBlendMode(blink::WebBlendMode v);
954 bool hasBlendMode() const;
956 EIsolation isolation() const;
957 void setIsolation(EIsolation v);
958 bool hasIsolation() const;
960 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLeftToRightDirection() && isHorizontalWritingMode(); }
962 TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); }
963 TouchActionDelay touchActionDelay() const { return static_cast<TouchActionDelay>(rareInheritedData->m_touchActionDelay); }
965 ScrollBehavior scrollBehavior() const { return static_cast<ScrollBehavior>(rareNonInheritedData->m_scrollBehavior); }
967 const Vector<CSSPropertyID>& willChangeProperties() const { return rareNonInheritedData->m_willChange->m_properties; }
968 bool willChangeContents() const { return rareNonInheritedData->m_willChange->m_contents; }
969 bool willChangeScrollPosition() const { return rareNonInheritedData->m_willChange->m_scrollPosition; }
970 bool hasWillChangeCompositingHint() const;
972 // attribute setter methods
974 void setDisplay(EDisplay v) { noninherited_flags._effectiveDisplay = v; }
975 void setOriginalDisplay(EDisplay v) { noninherited_flags._originalDisplay = v; }
976 void setPosition(EPosition v) { noninherited_flags._position = v; }
977 void setFloating(EFloat v) { noninherited_flags._floating = v; }
979 void setLeft(Length v) { SET_VAR(surround, offset.m_left, v); }
980 void setRight(Length v) { SET_VAR(surround, offset.m_right, v); }
981 void setTop(Length v) { SET_VAR(surround, offset.m_top, v); }
982 void setBottom(Length v) { SET_VAR(surround, offset.m_bottom, v); }
984 void setWidth(Length v) { SET_VAR(m_box, m_width, v); }
985 void setHeight(Length v) { SET_VAR(m_box, m_height, v); }
987 void setLogicalWidth(Length v)
989 if (isHorizontalWritingMode()) {
990 SET_VAR(m_box, m_width, v);
992 SET_VAR(m_box, m_height, v);
996 void setLogicalHeight(Length v)
998 if (isHorizontalWritingMode()) {
999 SET_VAR(m_box, m_height, v);
1001 SET_VAR(m_box, m_width, v);
1005 void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, v); }
1006 void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, v); }
1007 void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, v); }
1008 void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, v); }
1010 DraggableRegionMode getDraggableRegionMode() const { return rareNonInheritedData->m_draggableRegionMode; }
1011 void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(rareNonInheritedData, m_draggableRegionMode, v); }
1013 void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
1014 void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()); }
1015 void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()); }
1016 void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()); }
1017 void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()); }
1018 void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()); }
1019 void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
1020 void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()); }
1021 void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()); }
1022 void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()); }
1023 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()); }
1025 void setBackgroundColor(const StyleColor& v) { SET_VAR(m_background, m_color, v); }
1027 void setBackgroundXPosition(Length length) { SET_VAR(m_background, m_background.m_xPosition, length); }
1028 void setBackgroundYPosition(Length length) { SET_VAR(m_background, m_background.m_yPosition, length); }
1029 void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b); }
1030 void setBackgroundSizeLength(LengthSize s) { SET_VAR(m_background, m_background.m_sizeLength, s); }
1032 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b); }
1033 void setBorderImageSource(PassRefPtr<StyleImage>);
1034 void setBorderImageSlices(LengthBox);
1035 void setBorderImageWidth(const BorderImageLengthBox&);
1036 void setBorderImageOutset(const BorderImageLengthBox&);
1038 void setBorderTopLeftRadius(LengthSize s) { SET_VAR(surround, border.m_topLeft, s); }
1039 void setBorderTopRightRadius(LengthSize s) { SET_VAR(surround, border.m_topRight, s); }
1040 void setBorderBottomLeftRadius(LengthSize s) { SET_VAR(surround, border.m_bottomLeft, s); }
1041 void setBorderBottomRightRadius(LengthSize s) { SET_VAR(surround, border.m_bottomRight, s); }
1043 void setBorderRadius(LengthSize s)
1045 setBorderTopLeftRadius(s);
1046 setBorderTopRightRadius(s);
1047 setBorderBottomLeftRadius(s);
1048 setBorderBottomRightRadius(s);
1050 void setBorderRadius(const IntSize& s)
1052 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
1055 RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1056 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1058 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect,
1059 int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool includeLogicalLeftEdge, bool includeLogicalRightEdge) const;
1061 void setBorderLeftWidth(unsigned v) { SET_VAR(surround, border.m_left.m_width, v); }
1062 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); }
1063 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); }
1064 void setBorderRightWidth(unsigned v) { SET_VAR(surround, border.m_right.m_width, v); }
1065 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v); }
1066 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); }
1067 void setBorderTopWidth(unsigned v) { SET_VAR(surround, border.m_top.m_width, v); }
1068 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v); }
1069 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v); }
1070 void setBorderBottomWidth(unsigned v) { SET_VAR(surround, border.m_bottom.m_width, v); }
1071 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); }
1072 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); }
1074 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_width, v); }
1075 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto); }
1076 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v); }
1077 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v); }
1079 void setOverflowX(EOverflow v) { noninherited_flags._overflowX = v; }
1080 void setOverflowY(EOverflow v) { noninherited_flags._overflowY = v; }
1081 void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
1082 void setVerticalAlign(EVerticalAlign v) { noninherited_flags._vertical_align = v; }
1083 void setVerticalAlignLength(Length length) { setVerticalAlign(LENGTH); SET_VAR(m_box, m_verticalAlign, length); }
1085 void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b); }
1086 void setClipLeft(Length v) { SET_VAR(visual, clip.m_left, v); }
1087 void setClipRight(Length v) { SET_VAR(visual, clip.m_right, v); }
1088 void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v); }
1089 void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v); }
1090 void setClip(Length top, Length right, Length bottom, Length left);
1091 void setClip(LengthBox box) { SET_VAR(visual, clip, box); }
1093 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
1095 void setClear(EClear v) { noninherited_flags._clear = v; }
1096 void setTableLayout(ETableLayout v) { noninherited_flags._table_layout = v; }
1098 bool setFontDescription(const FontDescription&);
1099 // Only used for blending font sizes when animating and for text autosizing.
1100 void setFontSize(float);
1101 void setFontWeight(FontWeight);
1103 void setTextAutosizingMultiplier(float v)
1105 SET_VAR(visual, m_textAutosizingMultiplier, v);
1106 setFontSize(fontDescription().specifiedSize());
1109 void setColor(const Color&);
1110 void setTextIndent(Length v) { SET_VAR(rareInheritedData, indent, v); }
1111 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_textIndentLine, v); }
1112 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_textIndentType, v); }
1113 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1114 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
1115 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
1116 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1117 void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations |= v; }
1118 void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations = v; }
1119 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v); }
1120 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
1121 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
1122 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1123 void setLineHeight(Length specifiedLineHeight);
1124 bool setZoom(float);
1125 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1126 bool setEffectiveZoom(float);
1128 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_imageRendering, v); }
1130 void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
1132 // FIXME: Remove these two and replace them with respective FontBuilder calls.
1133 void setWordSpacing(float);
1134 void setLetterSpacing(float);
1136 void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
1137 void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
1139 void adjustBackgroundLayers()
1141 if (backgroundLayers()->next()) {
1142 accessBackgroundLayers()->cullEmptyLayers();
1143 accessBackgroundLayers()->fillUnsetProperties();
1147 void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
1148 void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
1150 void adjustMaskLayers()
1152 if (maskLayers()->next()) {
1153 accessMaskLayers()->cullEmptyLayers();
1154 accessMaskLayers()->fillUnsetProperties();
1158 void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
1160 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
1161 void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
1162 void setMaskBoxImageSlices(LengthBox slices)
1164 rareNonInheritedData.access()->m_maskBoxImage.setImageSlices(slices);
1166 void setMaskBoxImageSlicesFill(bool fill)
1168 rareNonInheritedData.access()->m_maskBoxImage.setFill(fill);
1170 void setMaskBoxImageWidth(const BorderImageLengthBox& slices)
1172 rareNonInheritedData.access()->m_maskBoxImage.setBorderSlices(slices);
1174 void setMaskBoxImageOutset(const BorderImageLengthBox& outset)
1176 rareNonInheritedData.access()->m_maskBoxImage.setOutset(outset);
1178 void setMaskXPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, length); }
1179 void setMaskYPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, length); }
1180 void setMaskSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, s); }
1182 void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
1183 void setHorizontalBorderSpacing(short);
1184 void setVerticalBorderSpacing(short);
1185 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
1186 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
1188 void setHasAspectRatio(bool b) { SET_VAR(rareNonInheritedData, m_hasAspectRatio, b); }
1189 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
1190 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
1192 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
1193 void setListStyleImage(PassRefPtr<StyleImage>);
1194 void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
1196 void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)); }
1197 void setMarginTop(Length v) { SET_VAR(surround, margin.m_top, v); }
1198 void setMarginBottom(Length v) { SET_VAR(surround, margin.m_bottom, v); }
1199 void setMarginLeft(Length v) { SET_VAR(surround, margin.m_left, v); }
1200 void setMarginRight(Length v) { SET_VAR(surround, margin.m_right, v); }
1201 void setMarginStart(Length);
1202 void setMarginEnd(Length);
1204 void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); }
1205 void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b); }
1206 void setPaddingTop(Length v) { SET_VAR(surround, padding.m_top, v); }
1207 void setPaddingBottom(Length v) { SET_VAR(surround, padding.m_bottom, v); }
1208 void setPaddingLeft(Length v) { SET_VAR(surround, padding.m_left, v); }
1209 void setPaddingRight(Length v) { SET_VAR(surround, padding.m_right, v); }
1211 void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
1212 void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
1213 void setCursorList(PassRefPtr<CursorList>);
1214 void clearCursorList();
1216 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
1217 void setIsLink(bool b) { noninherited_flags.setIsLink(b); }
1219 PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); }
1220 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; }
1222 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
1223 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0); }
1224 int zIndex() const { return m_box->zIndex(); }
1225 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v); }
1227 void setHasAutoWidows() { SET_VAR(rareInheritedData, m_hasAutoWidows, true); SET_VAR(rareInheritedData, widows, initialWidows()); }
1228 void setWidows(short w) { SET_VAR(rareInheritedData, m_hasAutoWidows, false); SET_VAR(rareInheritedData, widows, w); }
1230 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true); SET_VAR(rareInheritedData, orphans, initialOrphans()); }
1231 void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, false); SET_VAR(rareInheritedData, orphans, o); }
1233 // For valid values of page-break-inside see http://www.w3.org/TR/CSS21/page.html#page-break-props
1234 void setPageBreakInside(EPageBreak b) { ASSERT(b == PBAUTO || b == PBAVOID); noninherited_flags._page_break_inside = b; }
1235 void setPageBreakBefore(EPageBreak b) { noninherited_flags._page_break_before = b; }
1236 void setPageBreakAfter(EPageBreak b) { noninherited_flags._page_break_after = b; }
1239 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v); }
1240 void setTextShadow(PassRefPtr<ShadowList>);
1241 void setTextStrokeColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInheritedData, textStrokeColor, setTextStrokeColor, c); }
1242 void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
1243 void setTextFillColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInheritedData, textFillColor, setTextFillColor, c); }
1244 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(rareNonInheritedData, opacity, v); }
1245 void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
1246 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
1247 void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, align, a); }
1248 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDecorationBreak, b); }
1249 void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
1250 void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, flex, f); }
1251 void setBoxFlexGroup(unsigned fg) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, flexGroup, fg); }
1252 void setBoxLines(EBoxLines l) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, lines, l); }
1253 void setBoxOrdinalGroup(unsigned og) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, ordinalGroup, og); }
1254 void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, orient, o); }
1255 void setBoxPack(EBoxPack p) { SET_VAR(rareNonInheritedData.access()->m_deprecatedFlexibleBox, pack, p); }
1256 void setBoxShadow(PassRefPtr<ShadowList>);
1257 void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
1258 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
1259 void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexGrow, f); }
1260 void setFlexShrink(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexShrink, f); }
1261 void setFlexBasis(Length length) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexBasis, length); }
1262 // We restrict the smallest value to int min + 2 because we use int min and int min + 1 as special values in a hash set.
1263 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, max(std::numeric_limits<int>::min() + 2, o)); }
1264 void addCallbackSelector(const String& selector);
1265 void setAlignContent(EAlignContent p) { SET_VAR(rareNonInheritedData, m_alignContent, p); }
1266 void setAlignItems(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignItems, a); }
1267 void setAlignItemsOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_alignItemsOverflowAlignment, overflowAlignment); }
1268 void setAlignSelf(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignSelf, a); }
1269 void setAlignSelfOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_alignSelfOverflowAlignment, overflowAlignment); }
1270 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, direction); }
1271 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); }
1272 void setJustifyContent(EJustifyContent p) { SET_VAR(rareNonInheritedData, m_justifyContent, p); }
1273 void setJustifySelf(ItemPosition justifySelf) { SET_VAR(rareNonInheritedData, m_justifySelf, justifySelf); }
1274 void setJustifySelfOverflowAlignment(OverflowAlignment overflowAlignment) { SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, overflowAlignment); }
1275 void setGridAutoColumns(const GridTrackSize& length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoColumns, length); }
1276 void setGridAutoRows(const GridTrackSize& length) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoRows, length); }
1277 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridTemplateColumns, lengths); }
1278 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridTemplateRows, lengths); }
1279 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridColumnLines, namedGridColumnLines); }
1280 void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridRowLines, namedGridRowLines); }
1281 void setOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedNamedGridColumnLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_orderedNamedGridColumnLines, orderedNamedGridColumnLines); }
1282 void setOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGridRowLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_orderedNamedGridRowLines, orderedNamedGridRowLines); }
1283 void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridArea, namedGridArea); }
1284 void setNamedGridAreaRowCount(size_t rowCount) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridAreaRowCount, rowCount); }
1285 void setNamedGridAreaColumnCount(size_t columnCount) { SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridAreaColumnCount, columnCount); }
1286 void setGridAutoFlow(GridAutoFlow flow) { SET_VAR(rareNonInheritedData.access()->m_grid, m_gridAutoFlow, flow); }
1288 void setGridColumnStart(const GridPosition& columnStartPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumnStart, columnStartPosition); }
1289 void setGridColumnEnd(const GridPosition& columnEndPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridColumnEnd, columnEndPosition); }
1290 void setGridRowStart(const GridPosition& rowStartPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRowStart, rowStartPosition); }
1291 void setGridRowEnd(const GridPosition& rowEndPosition) { SET_VAR(rareNonInheritedData.access()->m_gridItem, m_gridRowEnd, rowEndPosition); }
1293 void setMarqueeIncrement(Length f) { SET_VAR(rareNonInheritedData.access()->m_marquee, increment, f); }
1294 void setMarqueeSpeed(int f) { SET_VAR(rareNonInheritedData.access()->m_marquee, speed, f); }
1295 void setMarqueeDirection(EMarqueeDirection d) { SET_VAR(rareNonInheritedData.access()->m_marquee, direction, d); }
1296 void setMarqueeBehavior(EMarqueeBehavior b) { SET_VAR(rareNonInheritedData.access()->m_marquee, behavior, b); }
1297 void setMarqueeLoopCount(int i) { SET_VAR(rareNonInheritedData.access()->m_marquee, loops, i); }
1298 void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
1299 void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
1300 void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
1301 void setTextOverflow(TextOverflow overflow) { SET_VAR(rareNonInheritedData, textOverflow, overflow); }
1302 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
1303 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
1304 void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
1305 void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
1306 void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
1307 void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
1308 void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
1309 void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
1310 void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, locale, locale); }
1311 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
1312 void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
1313 void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
1314 void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, 0); }
1315 void setColumnCount(unsigned short c) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, c); }
1316 void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_count, 0); }
1317 void setColumnFill(ColumnFill columnFill) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_fill, columnFill); }
1318 void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, f); }
1319 void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_gap, 0); }
1320 void setColumnRuleColor(const StyleColor& c) { SET_BORDERVALUE_COLOR(rareNonInheritedData.access()->m_multiCol, m_rule, c); }
1321 void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_style, b); }
1322 void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule.m_width, w); }
1323 void resetColumnRule() { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_rule, BorderValue()); }
1324 void setColumnSpan(ColumnSpan columnSpan) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_columnSpan, columnSpan); }
1325 void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakBefore, p); }
1326 // For valid values of column-break-inside see http://www.w3.org/TR/css3-multicol/#break-before-break-after-break-inside
1327 void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
1328 void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
1329 void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
1330 void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
1331 void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }
1332 void setTransformOriginY(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_y, l); }
1333 void setTransformOriginZ(float f) { SET_VAR(rareNonInheritedData.access()->m_transform, m_z, f); }
1334 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
1335 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
1336 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedData, m_textDecorationColor, c); }
1337 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInheritedData, textEmphasisColor, setTextEmphasisColor, c); }
1338 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
1339 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
1340 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
1341 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1342 bool setTextOrientation(TextOrientation);
1344 void setObjectFit(ObjectFit f) { SET_VAR(rareNonInheritedData, m_objectFit, f); }
1345 void setObjectPosition(LengthPoint position) { SET_VAR(rareNonInheritedData, m_objectPosition, position); }
1347 void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
1349 void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_filter, m_operations, ops); }
1351 void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
1355 void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(rareNonInheritedData, m_wrapFlow, wrapFlow); }
1356 void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(rareNonInheritedData, m_wrapThrough, wrapThrough); }
1358 // Apple-specific property setters
1359 void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
1361 void clearAnimations()
1363 rareNonInheritedData.access()->m_animations.clear();
1366 void clearTransitions()
1368 rareNonInheritedData.access()->m_transitions.clear();
1371 void adjustAnimations();
1372 void adjustTransitions();
1374 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
1375 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
1376 void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
1377 void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
1378 void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
1379 void setPageSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
1380 void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
1381 void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
1383 void setHasCurrentOpacityAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_hasCurrentOpacityAnimation, b); }
1384 void setHasCurrentTransformAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_hasCurrentTransformAnimation, b); }
1385 void setHasCurrentFilterAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_hasCurrentFilterAnimation, b); }
1387 void setIsRunningOpacityAnimationOnCompositor(bool b = true) { SET_VAR(rareNonInheritedData, m_runningOpacityAnimationOnCompositor, b); }
1388 void setIsRunningTransformAnimationOnCompositor(bool b = true) { SET_VAR(rareNonInheritedData, m_runningTransformAnimationOnCompositor, b); }
1389 void setIsRunningFilterAnimationOnCompositor(bool b = true) { SET_VAR(rareNonInheritedData, m_runningFilterAnimationOnCompositor, b); }
1391 void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
1392 void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
1393 void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
1394 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
1395 void setTouchAction(TouchAction t) { SET_VAR(rareNonInheritedData, m_touchAction, t); }
1396 void setTouchActionDelay(TouchActionDelay t) { SET_VAR(rareInheritedData, m_touchActionDelay, t); }
1398 void setScrollBehavior(ScrollBehavior b) { SET_VAR(rareNonInheritedData, m_scrollBehavior, b); }
1400 void setWillChangeProperties(const Vector<CSSPropertyID>& properties) { SET_VAR(rareNonInheritedData.access()->m_willChange, m_properties, properties); }
1401 void setWillChangeContents(bool b) { SET_VAR(rareNonInheritedData.access()->m_willChange, m_contents, b); }
1402 void setWillChangeScrollPosition(bool b) { SET_VAR(rareNonInheritedData.access()->m_willChange, m_scrollPosition, b); }
1404 const SVGRenderStyle* svgStyle() const { return m_svgStyle.get(); }
1405 SVGRenderStyle* accessSVGStyle() { return m_svgStyle.access(); }
1407 const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle()->fillPaintType(); }
1408 Color fillPaintColor() const { return svgStyle()->fillPaintColor(); }
1409 void setFillPaintColor(const Color& c) { accessSVGStyle()->setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1410 float fillOpacity() const { return svgStyle()->fillOpacity(); }
1411 void setFillOpacity(float f) { accessSVGStyle()->setFillOpacity(f); }
1413 const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle()->strokePaintType(); }
1414 Color strokePaintColor() const { return svgStyle()->strokePaintColor(); }
1415 void setStrokePaintColor(const Color& c) { accessSVGStyle()->setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1416 float strokeOpacity() const { return svgStyle()->strokeOpacity(); }
1417 void setStrokeOpacity(float f) { accessSVGStyle()->setStrokeOpacity(f); }
1418 SVGLength* strokeWidth() const { return svgStyle()->strokeWidth(); }
1419 void setStrokeWidth(PassRefPtr<SVGLength> w) { accessSVGStyle()->setStrokeWidth(w); }
1420 SVGLengthList* strokeDashArray() const { return svgStyle()->strokeDashArray(); }
1421 void setStrokeDashArray(PassRefPtr<SVGLengthList> array) { accessSVGStyle()->setStrokeDashArray(array); }
1422 SVGLength* strokeDashOffset() const { return svgStyle()->strokeDashOffset(); }
1423 void setStrokeDashOffset(PassRefPtr<SVGLength> d) { accessSVGStyle()->setStrokeDashOffset(d); }
1424 float strokeMiterLimit() const { return svgStyle()->strokeMiterLimit(); }
1425 void setStrokeMiterLimit(float f) { accessSVGStyle()->setStrokeMiterLimit(f); }
1427 float floodOpacity() const { return svgStyle()->floodOpacity(); }
1428 void setFloodOpacity(float f) { accessSVGStyle()->setFloodOpacity(f); }
1430 float stopOpacity() const { return svgStyle()->stopOpacity(); }
1431 void setStopOpacity(float f) { accessSVGStyle()->setStopOpacity(f); }
1433 void setStopColor(const Color& c) { accessSVGStyle()->setStopColor(c); }
1434 void setFloodColor(const Color& c) { accessSVGStyle()->setFloodColor(c); }
1435 void setLightingColor(const Color& c) { accessSVGStyle()->setLightingColor(c); }
1437 SVGLength* baselineShiftValue() const { return svgStyle()->baselineShiftValue(); }
1438 void setBaselineShiftValue(PassRefPtr<SVGLength> s) { accessSVGStyle()->setBaselineShiftValue(s); }
1440 void setShapeOutside(PassRefPtr<ShapeValue> value)
1442 if (rareNonInheritedData->m_shapeOutside == value)
1444 rareNonInheritedData.access()->m_shapeOutside = value;
1446 ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
1448 static ShapeValue* initialShapeOutside() { return 0; }
1450 void setClipPath(PassRefPtr<ClipPathOperation> operation)
1452 if (rareNonInheritedData->m_clipPath != operation)
1453 rareNonInheritedData.access()->m_clipPath = operation;
1455 ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
1457 static ClipPathOperation* initialClipPath() { return 0; }
1459 const Length& shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
1460 void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, shapeMargin); }
1461 static Length initialShapeMargin() { return Length(0, Fixed); }
1463 float shapeImageThreshold() const { return rareNonInheritedData->m_shapeImageThreshold; }
1464 void setShapeImageThreshold(float shapeImageThreshold)
1466 float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0, 1);
1467 SET_VAR(rareNonInheritedData, m_shapeImageThreshold, clampedShapeImageThreshold);
1469 static float initialShapeImageThreshold() { return 0; }
1471 bool hasContent() const { return contentData(); }
1472 const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
1473 bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
1474 void clearContent();
1475 void setContent(const String&, bool add = false);
1476 void setContent(PassRefPtr<StyleImage>, bool add = false);
1477 void setContent(PassOwnPtr<CounterContent>, bool add = false);
1478 void setContent(QuoteType, bool add = false);
1480 const CounterDirectiveMap* counterDirectives() const;
1481 CounterDirectiveMap& accessCounterDirectives();
1482 const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
1484 QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
1485 void setQuotes(PassRefPtr<QuotesData>);
1487 const AtomicString& hyphenString() const;
1489 bool inheritedNotEqual(const RenderStyle*) const;
1490 bool inheritedDataShared(const RenderStyle*) const;
1492 bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
1493 bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
1494 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
1496 bool setWritingMode(WritingMode v)
1498 if (v == writingMode())
1501 inherited_flags.m_writingMode = v;
1505 // A unique style is one that has matches something that makes it impossible to share.
1506 bool unique() const { return noninherited_flags.unique; }
1507 void setUnique() { noninherited_flags.unique = true; }
1509 bool isSharable() const;
1511 bool emptyState() const { return noninherited_flags.emptyState; }
1512 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b; }
1513 bool firstChildState() const { return noninherited_flags.firstChildState; }
1514 void setFirstChildState() { setUnique(); noninherited_flags.firstChildState = true; }
1515 bool lastChildState() const { return noninherited_flags.lastChildState; }
1516 void setLastChildState() { setUnique(); noninherited_flags.lastChildState = true; }
1518 StyleColor visitedDependentDecorationColor() const;
1519 Color visitedDependentColor(int colorProperty) const;
1521 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInheritance = true; }
1522 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.explicitInheritance; }
1524 void setHasCurrentColor() { noninherited_flags.currentColor = true; }
1525 bool hasCurrentColor() const { return noninherited_flags.currentColor; }
1527 // Initial values for all the properties
1528 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
1529 static EBorderStyle initialBorderStyle() { return BNONE; }
1530 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
1531 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
1532 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
1533 static ECaptionSide initialCaptionSide() { return CAPTOP; }
1534 static EClear initialClear() { return CNONE; }
1535 static TextDirection initialDirection() { return LTR; }
1536 static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
1537 static TextCombine initialTextCombine() { return TextCombineNone; }
1538 static TextOrientation initialTextOrientation() { return TextOrientationVerticalRight; }
1539 static ObjectFit initialObjectFit() { return ObjectFitFill; }
1540 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0, Percent), Length(50.0, Percent)); }
1541 static EDisplay initialDisplay() { return INLINE; }
1542 static EEmptyCell initialEmptyCells() { return SHOW; }
1543 static EFloat initialFloating() { return NoFloat; }
1544 static EListStylePosition initialListStylePosition() { return OUTSIDE; }
1545 static EListStyleType initialListStyleType() { return Disc; }
1546 static EOverflow initialOverflowX() { return OVISIBLE; }
1547 static EOverflow initialOverflowY() { return OVISIBLE; }
1548 static EPageBreak initialPageBreak() { return PBAUTO; }
1549 static EPosition initialPosition() { return StaticPosition; }
1550 static ETableLayout initialTableLayout() { return TAUTO; }
1551 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1552 static ETextTransform initialTextTransform() { return TTNONE; }
1553 static EVisibility initialVisibility() { return VISIBLE; }
1554 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1555 static short initialHorizontalBorderSpacing() { return 0; }
1556 static short initialVerticalBorderSpacing() { return 0; }
1557 static ECursor initialCursor() { return CURSOR_AUTO; }
1558 static Color initialColor() { return Color::black; }
1559 static StyleImage* initialListStyleImage() { return 0; }
1560 static unsigned initialBorderWidth() { return 3; }
1561 static unsigned short initialColumnRuleWidth() { return 3; }
1562 static unsigned short initialOutlineWidth() { return 3; }
1563 static float initialLetterWordSpacing() { return 0.0f; }
1564 static Length initialSize() { return Length(); }
1565 static Length initialMinSize() { return Length(Fixed); }
1566 static Length initialMaxSize() { return Length(Undefined); }
1567 static Length initialOffset() { return Length(); }
1568 static Length initialMargin() { return Length(Fixed); }
1569 static Length initialPadding() { return Length(Fixed); }
1570 static Length initialTextIndent() { return Length(Fixed); }
1571 static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
1572 static TextIndentType initialTextIndentType() { return TextIndentNormal; }
1573 static EVerticalAlign initialVerticalAlign() { return BASELINE; }
1574 static short initialWidows() { return 2; }
1575 static short initialOrphans() { return 2; }
1576 static Length initialLineHeight() { return Length(-100.0, Percent); }
1577 static ETextAlign initialTextAlign() { return TASTART; }
1578 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
1579 static TextJustify initialTextJustify() { return TextJustifyAuto; }
1580 static TextDecoration initialTextDecoration() { return TextDecorationNone; }
1581 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
1582 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
1583 static float initialZoom() { return 1.0f; }
1584 static int initialOutlineOffset() { return 0; }
1585 static float initialOpacity() { return 1.0f; }
1586 static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
1587 static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
1588 static EBoxDirection initialBoxDirection() { return BNORMAL; }
1589 static EBoxLines initialBoxLines() { return SINGLE; }
1590 static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
1591 static EBoxPack initialBoxPack() { return Start; }
1592 static float initialBoxFlex() { return 0.0f; }
1593 static unsigned initialBoxFlexGroup() { return 1; }
1594 static unsigned initialBoxOrdinalGroup() { return 1; }
1595 static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
1596 static StyleReflection* initialBoxReflect() { return 0; }
1597 static float initialFlexGrow() { return 0; }
1598 static float initialFlexShrink() { return 1; }
1599 static Length initialFlexBasis() { return Length(Auto); }
1600 static int initialOrder() { return 0; }
1601 static EAlignContent initialAlignContent() { return AlignContentStretch; }
1602 static ItemPosition initialAlignItems() { return ItemPositionStretch; }
1603 static OverflowAlignment initialAlignItemsOverflowAlignment() { return OverflowAlignmentDefault; }
1604 static ItemPosition initialAlignSelf() { return ItemPositionAuto; }
1605 static OverflowAlignment initialAlignSelfOverflowAlignment() { return OverflowAlignmentDefault; }
1606 static EFlexDirection initialFlexDirection() { return FlowRow; }
1607 static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
1608 static EJustifyContent initialJustifyContent() { return JustifyFlexStart; }
1609 static ItemPosition initialJustifySelf() { return ItemPositionAuto; }
1610 static OverflowAlignment initialJustifySelfOverflowAlignment() { return OverflowAlignmentDefault; }
1611 static int initialMarqueeLoopCount() { return -1; }
1612 static int initialMarqueeSpeed() { return 85; }
1613 static Length initialMarqueeIncrement() { return Length(6, Fixed); }
1614 static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
1615 static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
1616 static EUserModify initialUserModify() { return READ_ONLY; }
1617 static EUserDrag initialUserDrag() { return DRAG_AUTO; }
1618 static EUserSelect initialUserSelect() { return SELECT_TEXT; }
1619 static TextOverflow initialTextOverflow() { return TextOverflowClip; }
1620 static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
1621 static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
1622 static EWordBreak initialWordBreak() { return NormalWordBreak; }
1623 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; }
1624 static LineBreak initialLineBreak() { return LineBreakAuto; }
1625 static const AtomicString& initialHighlight() { return nullAtom; }
1626 static ESpeak initialSpeak() { return SpeakNormal; }
1627 static const AtomicString& initialHyphenationString() { return nullAtom; }
1628 static const AtomicString& initialLocale() { return nullAtom; }
1629 static EBorderFit initialBorderFit() { return BorderFitBorder; }
1630 static EResize initialResize() { return RESIZE_NONE; }
1631 static ControlPart initialAppearance() { return NoControlPart; }
1632 static bool initialHasAspectRatio() { return false; }
1633 static float initialAspectRatioDenominator() { return 1; }
1634 static float initialAspectRatioNumerator() { return 1; }
1635 static Order initialRTLOrdering() { return LogicalOrder; }
1636 static float initialTextStrokeWidth() { return 0; }
1637 static unsigned short initialColumnCount() { return 1; }
1638 static ColumnFill initialColumnFill() { return ColumnFillBalance; }
1639 static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
1640 static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(TransformOperations, ops, ()); return ops; }
1641 static Length initialTransformOriginX() { return Length(50.0, Percent); }
1642 static Length initialTransformOriginY() { return Length(50.0, Percent); }
1643 static EPointerEvents initialPointerEvents() { return PE_AUTO; }
1644 static float initialTransformOriginZ() { return 0; }
1645 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
1646 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
1647 static float initialPerspective() { return 0; }
1648 static Length initialPerspectiveOriginX() { return Length(50.0, Percent); }
1649 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); }
1650 static Color initialBackgroundColor() { return Color::transparent; }
1651 static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
1652 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
1653 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
1654 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
1655 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver; }
1656 static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
1657 static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
1658 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
1659 static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
1660 static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSpecified; }
1661 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
1662 static float initialImageResolution() { return 1; }
1663 static StyleImage* initialBorderImageSource() { return 0; }
1664 static StyleImage* initialMaskBoxImageSource() { return 0; }
1665 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
1666 static TouchAction initialTouchAction() { return TouchActionAuto; }
1667 static TouchActionDelay initialTouchActionDelay() { return TouchActionDelayScript; }
1668 static ShadowList* initialBoxShadow() { return 0; }
1669 static ShadowList* initialTextShadow() { return 0; }
1670 static ScrollBehavior initialScrollBehavior() { return ScrollBehaviorInstant; }
1672 // The initial value is 'none' for grid tracks.
1673 static Vector<GridTrackSize> initialGridTemplateColumns() { return Vector<GridTrackSize>(); }
1674 static Vector<GridTrackSize> initialGridTemplateRows() { return Vector<GridTrackSize>(); }
1676 static GridAutoFlow initialGridAutoFlow() { return AutoFlowNone; }
1678 static GridTrackSize initialGridAutoColumns() { return GridTrackSize(Length(Auto)); }
1679 static GridTrackSize initialGridAutoRows() { return GridTrackSize(Length(Auto)); }
1681 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLinesMap(); }
1682 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesMap(); }
1684 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return OrderedNamedGridLines(); }
1685 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return OrderedNamedGridLines(); }
1687 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); }
1688 static size_t initialNamedGridAreaCount() { return 0; }
1690 // 'auto' is the default.
1691 static GridPosition initialGridColumnStart() { return GridPosition(); }
1692 static GridPosition initialGridColumnEnd() { return GridPosition(); }
1693 static GridPosition initialGridRowStart() { return GridPosition(); }
1694 static GridPosition initialGridRowEnd() { return GridPosition(); }
1696 static unsigned initialTabSize() { return 8; }
1698 static WrapFlow initialWrapFlow() { return WrapFlowAuto; }
1699 static WrapThrough initialWrapThrough() { return WrapThroughWrap; }
1701 static QuotesData* initialQuotes() { return 0; }
1703 // Keep these at the end.
1704 // FIXME: Why? Seems these should all be one big sorted list.
1705 static LineClampValue initialLineClamp() { return LineClampValue(); }
1706 static ETextSecurity initialTextSecurity() { return TSNONE; }
1707 static Color initialTapHighlightColor();
1708 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterOperations, ops, ()); return ops; }
1709 static blink::WebBlendMode initialBlendMode() { return blink::WebBlendModeNormal; }
1710 static EIsolation initialIsolation() { return IsolationAuto; }
1712 void setVisitedLinkColor(const Color&);
1713 void setVisitedLinkBackgroundColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v); }
1714 void setVisitedLinkBorderLeftColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v); }
1715 void setVisitedLinkBorderRightColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v); }
1716 void setVisitedLinkBorderBottomColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v); }
1717 void setVisitedLinkBorderTopColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v); }
1718 void setVisitedLinkOutlineColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v); }
1719 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_visitedLinkColumnRuleColor, v); }
1720 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(rareNonInheritedData, m_visitedLinkTextDecorationColor, v); }
1721 void setVisitedLinkTextEmphasisColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextEmphasisColor, setVisitedLinkTextEmphasisColor, v); }
1722 void setVisitedLinkTextFillColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextFillColor, setVisitedLinkTextFillColor, v); }
1723 void setVisitedLinkTextStrokeColor(const StyleColor& v) { SET_VAR_WITH_SETTER(rareInheritedData, visitedLinkTextStrokeColor, setVisitedLinkTextStrokeColor, v); }
1725 void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags._unicodeBidi = parent->noninherited_flags._unicodeBidi; }
1726 void getShadowExtent(const ShadowList*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
1727 LayoutBoxExtent getShadowInsetExtent(const ShadowList*) const;
1728 void getShadowHorizontalExtent(const ShadowList*, LayoutUnit& left, LayoutUnit& right) const;
1729 void getShadowVerticalExtent(const ShadowList*, LayoutUnit& top, LayoutUnit& bottom) const;
1730 void getShadowInlineDirectionExtent(const ShadowList* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const
1732 return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
1734 void getShadowBlockDirectionExtent(const ShadowList* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const
1736 return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
1739 bool isDisplayReplacedType(EDisplay display) const
1741 return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX
1742 || display == INLINE_TABLE || display == INLINE_GRID;
1745 bool isDisplayInlineType(EDisplay display) const
1747 return display == INLINE || isDisplayReplacedType(display);
1750 // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
1751 StyleColor borderLeftColor() const { return surround->border.left().color(); }
1752 StyleColor borderRightColor() const { return surround->border.right().color(); }
1753 StyleColor borderTopColor() const { return surround->border.top().color(); }
1754 StyleColor borderBottomColor() const { return surround->border.bottom().color(); }
1755 StyleColor backgroundColor() const { return m_background->color(); }
1756 Color color() const;
1757 StyleColor columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
1758 StyleColor outlineColor() const { return m_background->outline().color(); }
1759 StyleColor textEmphasisColor() const { return rareInheritedData->textEmphasisColor(); }
1760 StyleColor textFillColor() const { return rareInheritedData->textFillColor(); }
1761 StyleColor textStrokeColor() const { return rareInheritedData->textStrokeColor(); }
1762 Color visitedLinkColor() const;
1763 StyleColor visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
1764 StyleColor visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
1765 StyleColor visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
1766 StyleColor visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
1767 StyleColor visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
1768 StyleColor visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
1769 StyleColor visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
1770 StyleColor textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
1771 StyleColor visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
1772 StyleColor visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor(); }
1773 StyleColor visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor(); }
1774 StyleColor visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor(); }
1776 Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
1778 Color stopColor() const { return svgStyle()->stopColor(); }
1779 Color floodColor() const { return svgStyle()->floodColor(); }
1780 Color lightingColor() const { return svgStyle()->lightingColor(); }
1782 void appendContent(PassOwnPtr<ContentData>);
1784 bool diffNeedsFullLayout(const RenderStyle& other) const;
1785 bool diffNeedsRepaintLayer(const RenderStyle& other) const;
1786 bool diffNeedsRepaintObject(const RenderStyle& other) const;
1787 bool diffNeedsRecompositeLayer(const RenderStyle& other) const;
1788 unsigned computeChangedContextSensitiveProperties(const RenderStyle& other, StyleDifference) const;
1791 // FIXME: Reduce/remove the dependency on zoom adjusted int values.
1792 // The float or LayoutUnit versions of layout values should be used.
1793 inline int adjustForAbsoluteZoom(int value, float zoomFactor)
1795 if (zoomFactor == 1)
1797 // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
1798 float fvalue = value;
1799 if (zoomFactor > 1) {
1806 return roundForImpreciseConversion<int>(fvalue / zoomFactor);
1809 inline int adjustForAbsoluteZoom(int value, const RenderStyle* style)
1811 return adjustForAbsoluteZoom(value, style->effectiveZoom());
1814 inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle& style)
1816 return value / style.effectiveZoom();
1819 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, const RenderStyle& style)
1821 return value / style.effectiveZoom();
1824 inline bool RenderStyle::setZoom(float f)
1826 if (compareEqual(visual->m_zoom, f))
1828 visual.access()->m_zoom = f;
1829 setEffectiveZoom(effectiveZoom() * zoom());
1833 inline bool RenderStyle::setEffectiveZoom(float f)
1835 if (compareEqual(rareInheritedData->m_effectiveZoom, f))
1837 rareInheritedData.access()->m_effectiveZoom = f;
1841 inline bool RenderStyle::isSharable() const
1845 if (hasUniquePseudoStyle())
1850 inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation)
1852 if (compareEqual(rareInheritedData->m_textOrientation, textOrientation))
1855 rareInheritedData.access()->m_textOrientation = textOrientation;
1859 inline bool RenderStyle::hasAnyPublicPseudoStyles() const
1861 return PUBLIC_PSEUDOID_MASK & noninherited_flags._pseudoBits;
1864 inline bool RenderStyle::hasPseudoStyle(PseudoId pseudo) const
1866 ASSERT(pseudo > NOPSEUDO);
1867 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
1868 return (1 << (pseudo - 1)) & noninherited_flags._pseudoBits;
1871 inline void RenderStyle::setHasPseudoStyle(PseudoId pseudo)
1873 ASSERT(pseudo > NOPSEUDO);
1874 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
1875 noninherited_flags._pseudoBits |= 1 << (pseudo - 1);
1878 inline bool RenderStyle::hasPseudoElementStyle() const
1880 return noninherited_flags._pseudoBits & PSEUDO_ELEMENT_MASK;
1883 float calcBorderRadiiConstraintScaleFor(const FloatRect&, const FloatRoundedRect::Radii&);
1885 } // namespace WebCore
1887 #endif // RenderStyle_h