1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public License
19 * along with this library; see the file COPYING.LIB. If not, write to
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22 *
23 */
24
25 #ifndef RenderStyle_h
26 #define RenderStyle_h
27
28 #include "core/CSSPropertyNames.h"
29 #include "core/animation/css/CSSAnimationData.h"
30 #include "core/animation/css/CSSTransitionData.h"
31 #include "core/css/CSSLineBoxContainValue.h"
32 #include "core/css/CSSPrimitiveValue.h"
33 #include "core/rendering/style/BorderValue.h"
34 #include "core/rendering/style/CounterDirectives.h"
35 #include "core/rendering/style/DataRef.h"
36 #include "core/rendering/style/LineClampValue.h"
37 #include "core/rendering/style/NinePieceImage.h"
38 #include "core/rendering/style/OutlineValue.h"
39 #include "core/rendering/style/RenderStyleConstants.h"
40 #include "core/rendering/style/SVGRenderStyle.h"
41 #include "core/rendering/style/ShapeValue.h"
42 #include "core/rendering/style/StyleBackgroundData.h"
43 #include "core/rendering/style/StyleBoxData.h"
44 #include "core/rendering/style/StyleDeprecatedFlexibleBoxData.h"
45 #include "core/rendering/style/StyleDifference.h"
46 #include "core/rendering/style/StyleFilterData.h"
47 #include "core/rendering/style/StyleFlexibleBoxData.h"
48 #include "core/rendering/style/StyleGridData.h"
49 #include "core/rendering/style/StyleGridItemData.h"
50 #include "core/rendering/style/StyleInheritedData.h"
51 #include "core/rendering/style/StyleMarqueeData.h"
52 #include "core/rendering/style/StyleMultiColData.h"
53 #include "core/rendering/style/StyleRareInheritedData.h"
54 #include "core/rendering/style/StyleRareNonInheritedData.h"
55 #include "core/rendering/style/StyleReflection.h"
56 #include "core/rendering/style/StyleSurroundData.h"
57 #include "core/rendering/style/StyleTransformData.h"
58 #include "core/rendering/style/StyleVisualData.h"
59 #include "core/rendering/style/StyleWillChangeData.h"
60 #include "platform/Length.h"
61 #include "platform/LengthBox.h"
62 #include "platform/LengthSize.h"
63 #include "platform/ThemeTypes.h"
64 #include "platform/fonts/FontBaseline.h"
65 #include "platform/fonts/FontDescription.h"
66 #include "platform/geometry/FloatRoundedRect.h"
67 #include "platform/geometry/LayoutBoxExtent.h"
68 #include "platform/geometry/RoundedRect.h"
69 #include "platform/graphics/Color.h"
70 #include "platform/graphics/GraphicsTypes.h"
71 #include "platform/scroll/ScrollableArea.h"
72 #include "platform/text/TextDirection.h"
73 #include "platform/text/UnicodeBidi.h"
74 #include "platform/transforms/TransformOperations.h"
75 #include "wtf/Forward.h"
76 #include "wtf/OwnPtr.h"
77 #include "wtf/RefCounted.h"
78 #include "wtf/StdLibExtras.h"
79 #include "wtf/Vector.h"
80
compareEqual(const T & t,const U & u)81 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<T>(u); }
82
83 #define SET_VAR(group, variable, value) \
84 if (!compareEqual(group->variable, value)) \
85 group.access()->variable = value
86
87 #define SET_VAR_WITH_SETTER(group, getter, setter, value) \
88 if (!compareEqual(group->getter(), value)) \
89 group.access()->setter(value)
90
91 #define SET_BORDERVALUE_COLOR(group, variable, value) \
92 if (!compareEqual(group->variable.color(), value)) \
93 group.access()->variable.setColor(value)
94
95 namespace blink {
96
97 using std::max;
98
99 class FilterOperations;
100
101 class AppliedTextDecoration;
102 class BorderData;
103 struct BorderEdge;
104 class CounterContent;
105 class Font;
106 class FontMetrics;
107 class ShadowList;
108 class StyleImage;
109 class StyleInheritedData;
110 class StyleResolver;
111 class TransformationMatrix;
112
113 class ContentData;
114
115 typedef Vector<RefPtr<RenderStyle>, 4> PseudoStyleCache;
116
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 StyleBuilderFunctions; // Sets color styles
125 friend class CachedUAStyle; // Saves Border/Background information for later comparison.
126
127 // FIXME: When we stop resolving currentColor at style time, these can be removed.
128 friend class CSSToStyleMap;
129 friend class FilterOperationResolver;
130 friend class StyleBuilderConverter;
131 friend class StyleResolverState;
132 friend class StyleResolver;
133 protected:
134
135 // non-inherited attributes
136 DataRef<StyleBoxData> m_box;
137 DataRef<StyleVisualData> visual;
138 DataRef<StyleBackgroundData> m_background;
139 DataRef<StyleSurroundData> surround;
140 DataRef<StyleRareNonInheritedData> rareNonInheritedData;
141
142 // inherited attributes
143 DataRef<StyleRareInheritedData> rareInheritedData;
144 DataRef<StyleInheritedData> inherited;
145
146 // list of associated pseudo styles
147 OwnPtr<PseudoStyleCache> m_cachedPseudoStyles;
148
149 DataRef<SVGRenderStyle> m_svgStyle;
150
151 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
152
153 // inherit
154 struct InheritedFlags {
155 bool operator==(const InheritedFlags& other) const
156 {
157 return (_empty_cells == other._empty_cells)
158 && (_caption_side == other._caption_side)
159 && (_list_style_type == other._list_style_type)
160 && (_list_style_position == other._list_style_position)
161 && (_visibility == other._visibility)
162 && (_text_align == other._text_align)
163 && (_text_transform == other._text_transform)
164 && (m_textUnderline == other.m_textUnderline)
165 && (_cursor_style == other._cursor_style)
166 && (_direction == other._direction)
167 && (_white_space == other._white_space)
168 && (_border_collapse == other._border_collapse)
169 && (_box_direction == other._box_direction)
170 && (m_rtlOrdering == other.m_rtlOrdering)
171 && (m_printColorAdjust == other.m_printColorAdjust)
172 && (_pointerEvents == other._pointerEvents)
173 && (_insideLink == other._insideLink)
174 && (m_writingMode == other.m_writingMode);
175 }
176
177 bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
178
179 unsigned _empty_cells : 1; // EEmptyCell
180 unsigned _caption_side : 2; // ECaptionSide
181 unsigned _list_style_type : 7; // EListStyleType
182 unsigned _list_style_position : 1; // EListStylePosition
183 unsigned _visibility : 2; // EVisibility
184 unsigned _text_align : 4; // ETextAlign
185 unsigned _text_transform : 2; // ETextTransform
186 unsigned m_textUnderline : 1;
187 unsigned _cursor_style : 6; // ECursor
188 unsigned _direction : 1; // TextDirection
189 unsigned _white_space : 3; // EWhiteSpace
190 unsigned _border_collapse : 1; // EBorderCollapse
191 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
192 // 32 bits
193
194 // non CSS2 inherited
195 unsigned m_rtlOrdering : 1; // Order
196 unsigned m_printColorAdjust : PrintColorAdjustBits;
197 unsigned _pointerEvents : 4; // EPointerEvents
198 unsigned _insideLink : 2; // EInsideLink
199
200 // CSS Text Layout Module Level 3: Vertical writing support
201 unsigned m_writingMode : 2; // WritingMode
202 // 42 bits
203 } inherited_flags;
204
205 // don't inherit
206 struct NonInheritedFlags {
207 bool operator==(const NonInheritedFlags& other) const
208 {
209 return effectiveDisplay == other.effectiveDisplay
210 && originalDisplay == other.originalDisplay
211 && overflowX == other.overflowX
212 && overflowY == other.overflowY
213 && verticalAlign == other.verticalAlign
214 && clear == other.clear
215 && position == other.position
216 && floating == other.floating
217 && tableLayout == other.tableLayout
218 && pageBreakBefore == other.pageBreakBefore
219 && pageBreakAfter == other.pageBreakAfter
220 && pageBreakInside == other.pageBreakInside
221 && styleType == other.styleType
222 && affectedByFocus == other.affectedByFocus
223 && affectedByHover == other.affectedByHover
224 && affectedByActive == other.affectedByActive
225 && affectedByDrag == other.affectedByDrag
226 && pseudoBits == other.pseudoBits
227 && unicodeBidi == other.unicodeBidi
228 && explicitInheritance == other.explicitInheritance
229 && unique == other.unique
230 && emptyState == other.emptyState
231 && firstChildState == other.firstChildState
232 && lastChildState == other.lastChildState
233 && isLink == other.isLink;
234 }
235
236 bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
237
238 unsigned effectiveDisplay : 5; // EDisplay
239 unsigned originalDisplay : 5; // EDisplay
240 unsigned overflowX : 3; // EOverflow
241 unsigned overflowY : 3; // EOverflow
242 unsigned verticalAlign : 4; // EVerticalAlign
243 unsigned clear : 2; // EClear
244 unsigned position : 3; // EPosition
245 unsigned floating : 2; // EFloat
246 unsigned tableLayout : 1; // ETableLayout
247 unsigned unicodeBidi : 3; // EUnicodeBidi
248
249 // This is set if we used viewport units when resolving a length.
250 // It is mutable so we can pass around const RenderStyles to resolve lengths.
251 mutable unsigned hasViewportUnits : 1;
252
253 // 32 bits
254
255 unsigned pageBreakBefore : 2; // EPageBreak
256 unsigned pageBreakAfter : 2; // EPageBreak
257 unsigned pageBreakInside : 2; // EPageBreak
258
259 unsigned styleType : 6; // PseudoId
260 unsigned pseudoBits : 8;
261 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited property
262 unsigned unique : 1; // Style can not be shared.
263
264 unsigned emptyState : 1;
265 unsigned firstChildState : 1;
266 unsigned lastChildState : 1;
267
268 unsigned affectedByFocus : 1;
269 unsigned affectedByHover : 1;
270 unsigned affectedByActive : 1;
271 unsigned affectedByDrag : 1;
272
273 unsigned isLink : 1;
274 // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom()
275 // 62 bits
276 } noninherited_flags;
277
278 // !END SYNC!
279
280 protected:
setBitDefaults()281 void setBitDefaults()
282 {
283 inherited_flags._empty_cells = initialEmptyCells();
284 inherited_flags._caption_side = initialCaptionSide();
285 inherited_flags._list_style_type = initialListStyleType();
286 inherited_flags._list_style_position = initialListStylePosition();
287 inherited_flags._visibility = initialVisibility();
288 inherited_flags._text_align = initialTextAlign();
289 inherited_flags._text_transform = initialTextTransform();
290 inherited_flags.m_textUnderline = false;
291 inherited_flags._cursor_style = initialCursor();
292 inherited_flags._direction = initialDirection();
293 inherited_flags._white_space = initialWhiteSpace();
294 inherited_flags._border_collapse = initialBorderCollapse();
295 inherited_flags.m_rtlOrdering = initialRTLOrdering();
296 inherited_flags._box_direction = initialBoxDirection();
297 inherited_flags.m_printColorAdjust = initialPrintColorAdjust();
298 inherited_flags._pointerEvents = initialPointerEvents();
299 inherited_flags._insideLink = NotInsideLink;
300 inherited_flags.m_writingMode = initialWritingMode();
301
302 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay = initialDisplay();
303 noninherited_flags.overflowX = initialOverflowX();
304 noninherited_flags.overflowY = initialOverflowY();
305 noninherited_flags.verticalAlign = initialVerticalAlign();
306 noninherited_flags.clear = initialClear();
307 noninherited_flags.position = initialPosition();
308 noninherited_flags.floating = initialFloating();
309 noninherited_flags.tableLayout = initialTableLayout();
310 noninherited_flags.unicodeBidi = initialUnicodeBidi();
311 noninherited_flags.pageBreakBefore = initialPageBreak();
312 noninherited_flags.pageBreakAfter = initialPageBreak();
313 noninherited_flags.pageBreakInside = initialPageBreak();
314 noninherited_flags.styleType = NOPSEUDO;
315 noninherited_flags.pseudoBits = 0;
316 noninherited_flags.explicitInheritance = false;
317 noninherited_flags.unique = false;
318 noninherited_flags.emptyState = false;
319 noninherited_flags.firstChildState = false;
320 noninherited_flags.lastChildState = false;
321 noninherited_flags.hasViewportUnits = false;
322 noninherited_flags.affectedByFocus = false;
323 noninherited_flags.affectedByHover = false;
324 noninherited_flags.affectedByActive = false;
325 noninherited_flags.affectedByDrag = false;
326 noninherited_flags.isLink = false;
327 }
328
329 private:
330 ALWAYS_INLINE RenderStyle();
331
332 enum DefaultStyleTag {
333 DefaultStyle
334 };
335 ALWAYS_INLINE explicit RenderStyle(DefaultStyleTag);
336 ALWAYS_INLINE RenderStyle(const RenderStyle&);
337
338 public:
339 static PassRefPtr<RenderStyle> create();
340 static PassRefPtr<RenderStyle> createDefaultStyle();
341 static PassRefPtr<RenderStyle> createAnonymousStyleWithDisplay(const RenderStyle* parentStyle, EDisplay);
342 static PassRefPtr<RenderStyle> clone(const RenderStyle*);
343
344 // Computes how the style change should be propagated down the tree.
345 static StyleRecalcChange stylePropagationDiff(const RenderStyle* oldStyle, const RenderStyle* newStyle);
346
347 StyleDifference visualInvalidationDiff(const RenderStyle&) const;
348
349 enum IsAtShadowBoundary {
350 AtShadowBoundary,
351 NotAtShadowBoundary,
352 };
353
354 void inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary = NotAtShadowBoundary);
355 void copyNonInheritedFrom(const RenderStyle*);
356
styleType()357 PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags.styleType); }
setStyleType(PseudoId styleType)358 void setStyleType(PseudoId styleType) { noninherited_flags.styleType = styleType; }
359
360 RenderStyle* getCachedPseudoStyle(PseudoId) const;
361 RenderStyle* addCachedPseudoStyle(PassRefPtr<RenderStyle>);
362 void removeCachedPseudoStyle(PseudoId);
363
cachedPseudoStyles()364 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
365
366 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_flags.hasViewportUnits = hasViewportUnits; }
hasViewportUnits()367 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits; }
368
affectedByFocus()369 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; }
affectedByHover()370 bool affectedByHover() const { return noninherited_flags.affectedByHover; }
affectedByActive()371 bool affectedByActive() const { return noninherited_flags.affectedByActive; }
affectedByDrag()372 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; }
373
setAffectedByFocus()374 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; }
setAffectedByHover()375 void setAffectedByHover() { noninherited_flags.affectedByHover = true; }
setAffectedByActive()376 void setAffectedByActive() { noninherited_flags.affectedByActive = true; }
setAffectedByDrag()377 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; }
378
379 bool operator==(const RenderStyle& other) const;
380 bool operator!=(const RenderStyle& other) const { return !(*this == other); }
isFloating()381 bool isFloating() const { return noninherited_flags.floating != NoFloat; }
hasMargin()382 bool hasMargin() const { return surround->margin.nonZero(); }
hasBorder()383 bool hasBorder() const { return surround->border.hasBorder(); }
hasPadding()384 bool hasPadding() const { return surround->padding.nonZero(); }
hasOffset()385 bool hasOffset() const { return surround->offset.nonZero(); }
hasMarginBeforeQuirk()386 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); }
hasMarginAfterQuirk()387 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); }
388
hasBackgroundImage()389 bool hasBackgroundImage() const { return m_background->background().hasImage(); }
hasFixedBackgroundImage()390 bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
391
392 bool hasEntirelyFixedBackground() const;
393
hasAppearance()394 bool hasAppearance() const { return appearance() != NoControlPart; }
395
hasBackground()396 bool hasBackground() const
397 {
398 Color color = visitedDependentColor(CSSPropertyBackgroundColor);
399 if (color.alpha())
400 return true;
401 return hasBackgroundImage();
402 }
403
404 LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
hasBorderImageOutsets()405 bool hasBorderImageOutsets() const
406 {
407 return borderImage().hasImage() && borderImage().outset().nonZero();
408 }
borderImageOutsets()409 LayoutBoxExtent borderImageOutsets() const
410 {
411 return imageOutsets(borderImage());
412 }
413
maskBoxImageOutsets()414 LayoutBoxExtent maskBoxImageOutsets() const
415 {
416 return imageOutsets(maskBoxImage());
417 }
418
hasFilterOutsets()419 bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
filterOutsets()420 FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
421
rtlOrdering()422 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
setRTLOrdering(Order o)423 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
424
425 bool isStyleAvailable() const;
426
427 bool hasAnyPublicPseudoStyles() const;
428 bool hasPseudoStyle(PseudoId pseudo) const;
429 void setHasPseudoStyle(PseudoId pseudo);
430 bool hasUniquePseudoStyle() const;
431 bool hasPseudoElementStyle() const;
432
433 // attribute getter methods
434
display()435 EDisplay display() const { return static_cast<EDisplay>(noninherited_flags.effectiveDisplay); }
originalDisplay()436 EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited_flags.originalDisplay); }
437
left()438 const Length& left() const { return surround->offset.left(); }
right()439 const Length& right() const { return surround->offset.right(); }
top()440 const Length& top() const { return surround->offset.top(); }
bottom()441 const Length& bottom() const { return surround->offset.bottom(); }
442
443 // Accessors for positioned object edges that take into account writing mode.
logicalLeft()444 const Length& logicalLeft() const { return surround->offset.logicalLeft(writingMode()); }
logicalRight()445 const Length& logicalRight() const { return surround->offset.logicalRight(writingMode()); }
logicalTop()446 const Length& logicalTop() const { return surround->offset.before(writingMode()); }
logicalBottom()447 const Length& logicalBottom() const { return surround->offset.after(writingMode()); }
448
449 // Whether or not a positioned element requires normal flow x/y to be computed
450 // to determine its position.
hasAutoLeftAndRight()451 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
hasAutoTopAndBottom()452 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
hasStaticInlinePosition(bool horizontal)453 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
hasStaticBlockPosition(bool horizontal)454 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
455
position()456 EPosition position() const { return static_cast<EPosition>(noninherited_flags.position); }
hasOutOfFlowPosition()457 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
hasInFlowPosition()458 bool hasInFlowPosition() const { return position() == RelativePosition; }
hasViewportConstrainedPosition()459 bool hasViewportConstrainedPosition() const { return position() == FixedPosition; }
floating()460 EFloat floating() const { return static_cast<EFloat>(noninherited_flags.floating); }
461
width()462 const Length& width() const { return m_box->width(); }
height()463 const Length& height() const { return m_box->height(); }
minWidth()464 const Length& minWidth() const { return m_box->minWidth(); }
maxWidth()465 const Length& maxWidth() const { return m_box->maxWidth(); }
minHeight()466 const Length& minHeight() const { return m_box->minHeight(); }
maxHeight()467 const Length& maxHeight() const { return m_box->maxHeight(); }
468
logicalWidth()469 const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
logicalHeight()470 const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
logicalMinWidth()471 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
logicalMaxWidth()472 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
logicalMinHeight()473 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
logicalMaxHeight()474 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
475
border()476 const BorderData& border() const { return surround->border; }
borderLeft()477 const BorderValue& borderLeft() const { return surround->border.left(); }
borderRight()478 const BorderValue& borderRight() const { return surround->border.right(); }
borderTop()479 const BorderValue& borderTop() const { return surround->border.top(); }
borderBottom()480 const BorderValue& borderBottom() const { return surround->border.bottom(); }
481
482 const BorderValue& borderBefore() const;
483 const BorderValue& borderAfter() const;
484 const BorderValue& borderStart() const;
485 const BorderValue& borderEnd() const;
486
borderImage()487 const NinePieceImage& borderImage() const { return surround->border.image(); }
borderImageSource()488 StyleImage* borderImageSource() const { return surround->border.image().image(); }
borderImageSlices()489 const LengthBox& borderImageSlices() const { return surround->border.image().imageSlices(); }
borderImageWidth()490 const BorderImageLengthBox& borderImageWidth() const { return surround->border.image().borderSlices(); }
borderImageOutset()491 const BorderImageLengthBox& borderImageOutset() const { return surround->border.image().outset(); }
492
borderTopLeftRadius()493 const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
borderTopRightRadius()494 const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
borderBottomLeftRadius()495 const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
borderBottomRightRadius()496 const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
hasBorderRadius()497 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
498
borderLeftWidth()499 unsigned borderLeftWidth() const { return surround->border.borderLeftWidth(); }
borderLeftStyle()500 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
borderLeftIsTransparent()501 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
borderRightWidth()502 unsigned borderRightWidth() const { return surround->border.borderRightWidth(); }
borderRightStyle()503 EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
borderRightIsTransparent()504 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
borderTopWidth()505 unsigned borderTopWidth() const { return surround->border.borderTopWidth(); }
borderTopStyle()506 EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
borderTopIsTransparent()507 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
borderBottomWidth()508 unsigned borderBottomWidth() const { return surround->border.borderBottomWidth(); }
borderBottomStyle()509 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
borderBottomIsTransparent()510 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
511
512 unsigned short borderBeforeWidth() const;
513 unsigned short borderAfterWidth() const;
514 unsigned short borderStartWidth() const;
515 unsigned short borderEndWidth() const;
516
outlineSize()517 unsigned short outlineSize() const { return max(0, outlineWidth() + outlineOffset()); }
outlineWidth()518 unsigned short outlineWidth() const
519 {
520 if (m_background->outline().style() == BNONE)
521 return 0;
522 return m_background->outline().width();
523 }
hasOutline()524 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHIDDEN; }
outlineStyle()525 EBorderStyle outlineStyle() const { return m_background->outline().style(); }
outlineStyleIsAuto()526 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
527
overflowX()528 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_flags.overflowX); }
overflowY()529 EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_flags.overflowY); }
530 // It's sufficient to just check one direction, since it's illegal to have visible on only one overflow value.
isOverflowVisible()531 bool isOverflowVisible() const { ASSERT(overflowX() != OVISIBLE || overflowX() == overflowY()); return overflowX() == OVISIBLE; }
isOverflowPaged()532 bool isOverflowPaged() const { return overflowY() == OPAGEDX || overflowY() == OPAGEDY; }
533
visibility()534 EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
verticalAlign()535 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(noninherited_flags.verticalAlign); }
verticalAlignLength()536 const Length& verticalAlignLength() const { return m_box->verticalAlign(); }
537
clipLeft()538 const Length& clipLeft() const { return visual->clip.left(); }
clipRight()539 const Length& clipRight() const { return visual->clip.right(); }
clipTop()540 const Length& clipTop() const { return visual->clip.top(); }
clipBottom()541 const Length& clipBottom() const { return visual->clip.bottom(); }
clip()542 const LengthBox& clip() const { return visual->clip; }
hasAutoClip()543 bool hasAutoClip() const { return visual->hasAutoClip; }
544
unicodeBidi()545 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninherited_flags.unicodeBidi); }
546
clear()547 EClear clear() const { return static_cast<EClear>(noninherited_flags.clear); }
tableLayout()548 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninherited_flags.tableLayout); }
isFixedTableLayout()549 bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logicalWidth().isAuto(); }
550
551 const Font& font() const;
552 const FontMetrics& fontMetrics() const;
553 const FontDescription& fontDescription() const;
554 float specifiedFontSize() const;
555 float computedFontSize() const;
556 int fontSize() const;
557 FontWeight fontWeight() const;
558 FontStretch fontStretch() const;
559
textAutosizingMultiplier()560 float textAutosizingMultiplier() const { return inherited->textAutosizingMultiplier; }
561
textIndent()562 const Length& textIndent() const { return rareInheritedData->indent; }
textIndentLine()563 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(rareInheritedData->m_textIndentLine); }
textIndentType()564 TextIndentType textIndentType() const { return static_cast<TextIndentType>(rareInheritedData->m_textIndentType); }
textAlign()565 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
textAlignLast()566 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
textJustify()567 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
textTransform()568 ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
569 TextDecoration textDecorationsInEffect() const;
570 const Vector<AppliedTextDecoration>& appliedTextDecorations() const;
textDecoration()571 TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
textUnderlinePosition()572 TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
textDecorationStyle()573 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
574 float wordSpacing() const;
575 float letterSpacing() const;
576
zoom()577 float zoom() const { return visual->m_zoom; }
effectiveZoom()578 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
579
direction()580 TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
isLeftToRightDirection()581 bool isLeftToRightDirection() const { return direction() == LTR; }
582
583 const Length& specifiedLineHeight() const;
584 Length lineHeight() const;
585 int computedLineHeight() const;
586
whiteSpace()587 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
autoWrap(EWhiteSpace ws)588 static bool autoWrap(EWhiteSpace ws)
589 {
590 // Nowrap and pre don't automatically wrap.
591 return ws != NOWRAP && ws != PRE;
592 }
593
autoWrap()594 bool autoWrap() const
595 {
596 return autoWrap(whiteSpace());
597 }
598
preserveNewline(EWhiteSpace ws)599 static bool preserveNewline(EWhiteSpace ws)
600 {
601 // Normal and nowrap do not preserve newlines.
602 return ws != NORMAL && ws != NOWRAP;
603 }
604
preserveNewline()605 bool preserveNewline() const
606 {
607 return preserveNewline(whiteSpace());
608 }
609
collapseWhiteSpace(EWhiteSpace ws)610 static bool collapseWhiteSpace(EWhiteSpace ws)
611 {
612 // Pre and prewrap do not collapse whitespace.
613 return ws != PRE && ws != PRE_WRAP;
614 }
615
collapseWhiteSpace()616 bool collapseWhiteSpace() const
617 {
618 return collapseWhiteSpace(whiteSpace());
619 }
620
isCollapsibleWhiteSpace(UChar c)621 bool isCollapsibleWhiteSpace(UChar c) const
622 {
623 switch (c) {
624 case ' ':
625 case '\t':
626 return collapseWhiteSpace();
627 case '\n':
628 return !preserveNewline();
629 }
630 return false;
631 }
632
breakOnlyAfterWhiteSpace()633 bool breakOnlyAfterWhiteSpace() const
634 {
635 return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
636 }
637
breakWords()638 bool breakWords() const
639 {
640 return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
641 }
642
backgroundRepeatX()643 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
backgroundRepeatY()644 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
backgroundComposite()645 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
backgroundAttachment()646 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
backgroundClip()647 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
backgroundOrigin()648 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
backgroundXPosition()649 const Length& backgroundXPosition() const { return m_background->background().xPosition(); }
backgroundYPosition()650 const Length& backgroundYPosition() const { return m_background->background().yPosition(); }
backgroundSizeType()651 EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
backgroundSizeLength()652 const LengthSize& backgroundSizeLength() const { return m_background->background().sizeLength(); }
accessBackgroundLayers()653 FillLayer& accessBackgroundLayers() { return m_background.access()->m_background; }
backgroundLayers()654 const FillLayer& backgroundLayers() const { return m_background->background(); }
655
maskImage()656 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
maskRepeatX()657 EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
maskRepeatY()658 EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
maskComposite()659 CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
maskClip()660 EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
maskOrigin()661 EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
maskXPosition()662 const Length& maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
maskYPosition()663 const Length& maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
maskSizeType()664 EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
maskSizeLength()665 const LengthSize& maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
accessMaskLayers()666 FillLayer& accessMaskLayers() { return rareNonInheritedData.access()->m_mask; }
maskLayers()667 const FillLayer& maskLayers() const { return rareNonInheritedData->m_mask; }
668
maskBoxImage()669 const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
maskBoxImageSource()670 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
maskBoxImageSlices()671 const LengthBox& maskBoxImageSlices() const { return rareNonInheritedData->m_maskBoxImage.imageSlices(); }
maskBoxImageSlicesFill()672 bool maskBoxImageSlicesFill() const { return rareNonInheritedData->m_maskBoxImage.fill(); }
maskBoxImageWidth()673 const BorderImageLengthBox& maskBoxImageWidth() const { return rareNonInheritedData->m_maskBoxImage.borderSlices(); }
maskBoxImageOutset()674 const BorderImageLengthBox& maskBoxImageOutset() const { return rareNonInheritedData->m_maskBoxImage.outset(); }
675
borderCollapse()676 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
677 short horizontalBorderSpacing() const;
678 short verticalBorderSpacing() const;
emptyCells()679 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
captionSide()680 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
681
listStyleType()682 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
683 StyleImage* listStyleImage() const;
listStylePosition()684 EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
685
marginTop()686 const Length& marginTop() const { return surround->margin.top(); }
marginBottom()687 const Length& marginBottom() const { return surround->margin.bottom(); }
marginLeft()688 const Length& marginLeft() const { return surround->margin.left(); }
marginRight()689 const Length& marginRight() const { return surround->margin.right(); }
marginBefore()690 const Length& marginBefore() const { return surround->margin.before(writingMode()); }
marginAfter()691 const Length& marginAfter() const { return surround->margin.after(writingMode()); }
marginStart()692 const Length& marginStart() const { return surround->margin.start(writingMode(), direction()); }
marginEnd()693 const Length& marginEnd() const { return surround->margin.end(writingMode(), direction()); }
marginStartUsing(const RenderStyle * otherStyle)694 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
marginEndUsing(const RenderStyle * otherStyle)695 const Length& marginEndUsing(const RenderStyle* otherStyle) const { return surround->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
marginBeforeUsing(const RenderStyle * otherStyle)696 const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return surround->margin.before(otherStyle->writingMode()); }
marginAfterUsing(const RenderStyle * otherStyle)697 const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return surround->margin.after(otherStyle->writingMode()); }
698
paddingBox()699 const LengthBox& paddingBox() const { return surround->padding; }
paddingTop()700 const Length& paddingTop() const { return surround->padding.top(); }
paddingBottom()701 const Length& paddingBottom() const { return surround->padding.bottom(); }
paddingLeft()702 const Length& paddingLeft() const { return surround->padding.left(); }
paddingRight()703 const Length& paddingRight() const { return surround->padding.right(); }
paddingBefore()704 const Length& paddingBefore() const { return surround->padding.before(writingMode()); }
paddingAfter()705 const Length& paddingAfter() const { return surround->padding.after(writingMode()); }
paddingStart()706 const Length& paddingStart() const { return surround->padding.start(writingMode(), direction()); }
paddingEnd()707 const Length& paddingEnd() const { return surround->padding.end(writingMode(), direction()); }
708
cursor()709 ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
cursors()710 CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
711
insideLink()712 EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
isLink()713 bool isLink() const { return noninherited_flags.isLink; }
714
widows()715 short widows() const { return rareInheritedData->widows; }
orphans()716 short orphans() const { return rareInheritedData->orphans; }
hasAutoWidows()717 bool hasAutoWidows() const { return rareInheritedData->m_hasAutoWidows; }
hasAutoOrphans()718 bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; }
pageBreakInside()719 EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakInside); }
pageBreakBefore()720 EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakBefore); }
pageBreakAfter()721 EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninherited_flags.pageBreakAfter); }
722
723 // CSS3 Getter Methods
724
outlineOffset()725 int outlineOffset() const
726 {
727 if (m_background->outline().style() == BNONE)
728 return 0;
729 return m_background->outline().offset();
730 }
731
textShadow()732 ShadowList* textShadow() const { return rareInheritedData->textShadow.get(); }
getTextShadowExtent(LayoutUnit & top,LayoutUnit & right,LayoutUnit & bottom,LayoutUnit & left)733 void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
getTextShadowHorizontalExtent(LayoutUnit & left,LayoutUnit & right)734 void getTextShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
getTextShadowVerticalExtent(LayoutUnit & top,LayoutUnit & bottom)735 void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
getTextShadowInlineDirectionExtent(LayoutUnit & logicalLeft,LayoutUnit & logicalRight)736 void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
getTextShadowBlockDirectionExtent(LayoutUnit & logicalTop,LayoutUnit & logicalBottom)737 void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
738
textStrokeWidth()739 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
opacity()740 float opacity() const { return rareNonInheritedData->opacity; }
hasOpacity()741 bool hasOpacity() const { return opacity() < 1.0f; }
appearance()742 ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
743 // aspect ratio convenience method
hasAspectRatio()744 bool hasAspectRatio() const { return rareNonInheritedData->m_hasAspectRatio; }
aspectRatio()745 float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
aspectRatioDenominator()746 float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
aspectRatioNumerator()747 float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
boxAlign()748 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->m_deprecatedFlexibleBox->align); }
boxDirection()749 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
boxFlex()750 float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex; }
boxFlexGroup()751 unsigned boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flexGroup; }
boxLines()752 EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedData->m_deprecatedFlexibleBox->lines); }
boxOrdinalGroup()753 unsigned boxOrdinalGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->ordinalGroup; }
boxOrient()754 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->m_deprecatedFlexibleBox->orient); }
boxPack()755 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
756
order()757 int order() const { return rareNonInheritedData->m_order; }
callbackSelectors()758 const Vector<String>& callbackSelectors() const { return rareNonInheritedData->m_callbackSelectors; }
flexGrow()759 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
flexShrink()760 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
flexBasis()761 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
alignContent()762 EAlignContent alignContent() const { return static_cast<EAlignContent>(rareNonInheritedData->m_alignContent); }
alignItems()763 ItemPosition alignItems() const { return static_cast<ItemPosition>(rareNonInheritedData->m_alignItems); }
alignItemsOverflowAlignment()764 OverflowAlignment alignItemsOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_alignItemsOverflowAlignment); }
alignSelf()765 ItemPosition alignSelf() const { return static_cast<ItemPosition>(rareNonInheritedData->m_alignSelf); }
alignSelfOverflowAlignment()766 OverflowAlignment alignSelfOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_alignSelfOverflowAlignment); }
flexDirection()767 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
isColumnFlexDirection()768 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
isReverseFlexDirection()769 bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
flexWrap()770 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
justifyContent()771 EJustifyContent justifyContent() const { return static_cast<EJustifyContent>(rareNonInheritedData->m_justifyContent); }
justifyItems()772 ItemPosition justifyItems() const { return static_cast<ItemPosition>(rareNonInheritedData->m_justifyItems); }
justifyItemsOverflowAlignment()773 OverflowAlignment justifyItemsOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_justifyItemsOverflowAlignment); }
justifyItemsPositionType()774 ItemPositionType justifyItemsPositionType() const { return static_cast<ItemPositionType>(rareNonInheritedData->m_justifyItemsPositionType); }
justifySelf()775 ItemPosition justifySelf() const { return static_cast<ItemPosition>(rareNonInheritedData->m_justifySelf); }
justifySelfOverflowAlignment()776 OverflowAlignment justifySelfOverflowAlignment() const { return static_cast<OverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); }
777
gridTemplateColumns()778 const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInheritedData->m_grid->m_gridTemplateColumns; }
gridTemplateRows()779 const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheritedData->m_grid->m_gridTemplateRows; }
namedGridColumnLines()780 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheritedData->m_grid->m_namedGridColumnLines; }
namedGridRowLines()781 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInheritedData->m_grid->m_namedGridRowLines; }
orderedNamedGridColumnLines()782 const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; }
orderedNamedGridRowLines()783 const OrderedNamedGridLines& orderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridRowLines; }
namedGridArea()784 const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData->m_grid->m_namedGridArea; }
namedGridAreaRowCount()785 size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaRowCount; }
namedGridAreaColumnCount()786 size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaColumnCount; }
gridAutoFlow()787 GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(rareNonInheritedData->m_grid->m_gridAutoFlow); }
isGridAutoFlowDirectionRow()788 bool isGridAutoFlowDirectionRow() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionRow) == InternalAutoFlowDirectionRow; }
isGridAutoFlowDirectionColumn()789 bool isGridAutoFlowDirectionColumn() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn) == InternalAutoFlowDirectionColumn; }
isGridAutoFlowAlgorithmSparse()790 bool isGridAutoFlowAlgorithmSparse() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse) == InternalAutoFlowAlgorithmSparse; }
isGridAutoFlowAlgorithmDense()791 bool isGridAutoFlowAlgorithmDense() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense) == InternalAutoFlowAlgorithmDense; }
isGridAutoFlowAlgorithmStack()792 bool isGridAutoFlowAlgorithmStack() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmStack) == InternalAutoFlowAlgorithmStack; }
gridAutoColumns()793 const GridTrackSize& gridAutoColumns() const { return rareNonInheritedData->m_grid->m_gridAutoColumns; }
gridAutoRows()794 const GridTrackSize& gridAutoRows() const { return rareNonInheritedData->m_grid->m_gridAutoRows; }
795
gridColumnStart()796 const GridPosition& gridColumnStart() const { return rareNonInheritedData->m_gridItem->m_gridColumnStart; }
gridColumnEnd()797 const GridPosition& gridColumnEnd() const { return rareNonInheritedData->m_gridItem->m_gridColumnEnd; }
gridRowStart()798 const GridPosition& gridRowStart() const { return rareNonInheritedData->m_gridItem->m_gridRowStart; }
gridRowEnd()799 const GridPosition& gridRowEnd() const { return rareNonInheritedData->m_gridItem->m_gridRowEnd; }
800
boxShadow()801 ShadowList* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
getBoxShadowExtent(LayoutUnit & top,LayoutUnit & right,LayoutUnit & bottom,LayoutUnit & left)802 void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
getBoxShadowInsetExtent()803 LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
getBoxShadowHorizontalExtent(LayoutUnit & left,LayoutUnit & right)804 void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
getBoxShadowVerticalExtent(LayoutUnit & top,LayoutUnit & bottom)805 void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
getBoxShadowInlineDirectionExtent(LayoutUnit & logicalLeft,LayoutUnit & logicalRight)806 void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
getBoxShadowBlockDirectionExtent(LayoutUnit & logicalTop,LayoutUnit & logicalBottom)807 void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
808
boxDecorationBreak()809 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecorationBreak(); }
boxReflect()810 StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
reflectionDataEquivalent(const RenderStyle * otherStyle)811 bool reflectionDataEquivalent(const RenderStyle* otherStyle) const { return rareNonInheritedData->reflectionDataEquivalent(*otherStyle->rareNonInheritedData); }
812
813 // FIXME: reflections should belong to this helper function but they are currently handled
814 // through their self-painting layers. So the rendering code doesn't account for them.
hasVisualOverflowingEffect()815 bool hasVisualOverflowingEffect() const { return boxShadow() || hasBorderImageOutsets() || hasOutline(); }
816
boxSizing()817 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
marqueeIncrement()818 const Length& marqueeIncrement() const { return rareNonInheritedData->m_marquee->increment; }
marqueeSpeed()819 int marqueeSpeed() const { return rareNonInheritedData->m_marquee->speed; }
marqueeLoopCount()820 int marqueeLoopCount() const { return rareNonInheritedData->m_marquee->loops; }
marqueeBehavior()821 EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->m_marquee->behavior); }
marqueeDirection()822 EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->m_marquee->direction); }
userModify()823 EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
userDrag()824 EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
userSelect()825 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
textOverflow()826 TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNonInheritedData->textOverflow); }
marginBeforeCollapse()827 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
marginAfterCollapse()828 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
wordBreak()829 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
overflowWrap()830 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareInheritedData->overflowWrap); }
lineBreak()831 LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedData->lineBreak); }
highlight()832 const AtomicString& highlight() const { return rareInheritedData->highlight; }
hyphenationString()833 const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
locale()834 const AtomicString& locale() const { return rareInheritedData->locale; }
borderFit()835 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
resize()836 EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
hasInlinePaginationAxis()837 bool hasInlinePaginationAxis() const
838 {
839 // If the pagination axis is parallel with the writing mode inline axis, columns may be laid
840 // out along the inline axis, just like for regular multicol. Otherwise, we need to lay out
841 // along the block axis.
842 if (isOverflowPaged())
843 return (overflowY() == OPAGEDX) == isHorizontalWritingMode();
844 return false;
845 }
columnWidth()846 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
hasAutoColumnWidth()847 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
columnCount()848 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
hasAutoColumnCount()849 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
specifiesColumns()850 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth(); }
columnFill()851 ColumnFill columnFill() const { return static_cast<ColumnFill>(rareNonInheritedData->m_multiCol->m_fill); }
columnGap()852 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
hasNormalColumnGap()853 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
columnRuleStyle()854 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
columnRuleWidth()855 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
columnRuleIsTransparent()856 bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
columnSpan()857 ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheritedData->m_multiCol->m_columnSpan); }
columnBreakBefore()858 EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
columnBreakInside()859 EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
columnBreakAfter()860 EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
hasInlineTransform()861 bool hasInlineTransform() const { return rareNonInheritedData->m_hasInlineTransform; }
transform()862 const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
transformOriginX()863 const Length& transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
transformOriginY()864