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-2014 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.
27 #include "AnimationList.h"
28 #include "BorderValue.h"
29 #include "CSSLineBoxContainValue.h"
30 #include "CSSPrimitiveValue.h"
31 #include "CSSPropertyNames.h"
33 #include "CounterDirectives.h"
35 #include "FontDescription.h"
36 #include "GraphicsTypes.h"
38 #include "LengthBox.h"
39 #include "LengthPoint.h"
40 #include "LengthSize.h"
41 #include "LineClampValue.h"
42 #include "NinePieceImage.h"
43 #include "Pagination.h"
44 #include "RenderStyleConstants.h"
45 #include "RoundedRect.h"
47 #include "SVGRenderStyle.h"
48 #include "ShadowData.h"
49 #include "ShapeValue.h"
50 #include "StyleBackgroundData.h"
51 #include "StyleBoxData.h"
52 #include "StyleDeprecatedFlexibleBoxData.h"
53 #include "StyleFilterData.h"
54 #include "StyleFlexibleBoxData.h"
55 #include "StyleMarqueeData.h"
56 #include "StyleMultiColData.h"
57 #include "StyleRareInheritedData.h"
58 #include "StyleRareNonInheritedData.h"
59 #include "StyleReflection.h"
60 #include "StyleSurroundData.h"
61 #include "StyleTransformData.h"
62 #include "StyleVisualData.h"
63 #include "TextFlags.h"
64 #include "ThemeTypes.h"
65 #include "TransformOperations.h"
66 #include "UnicodeBidi.h"
68 #include <wtf/Forward.h>
69 #include <wtf/NeverDestroyed.h>
70 #include <wtf/StdLibExtras.h>
71 #include <wtf/Vector.h>
73 #if ENABLE(CSS_GRID_LAYOUT)
74 #include "StyleGridData.h"
75 #include "StyleGridItemData.h"
78 #if ENABLE(DASHBOARD_SUPPORT)
79 #include "StyleDashboardRegion.h"
82 #if ENABLE(TEXT_AUTOSIZING)
83 #include "TextSizeAdjustment.h"
86 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<const T&>(u); }
88 #define SET_VAR(group, variable, value) \
89 if (!compareEqual(group->variable, value)) \
90 group.access()->variable = value
92 #define SET_NESTED_VAR(group, parentVariable, variable, value) \
93 if (!compareEqual(group->parentVariable->variable, value)) \
94 group.access()->parentVariable.access()->variable = value
96 #define SET_BORDERVALUE_COLOR(group, variable, value) \
97 if (!compareEqual(group->variable.color(), value)) \
98 group.access()->variable.setColor(value)
104 class CounterContent;
106 class FilterOperations;
113 class StyleInheritedData;
115 class TransformationMatrix;
117 struct ScrollSnapPoints;
119 typedef Vector<std::unique_ptr<RenderStyle>, 4> PseudoStyleCache;
122 WTF_MAKE_FAST_ALLOCATED;
124 friend class CSSPropertyAnimationWrapperMap; // Used by CSS animations. We can't allow them to animate based off visited colors.
125 friend class ApplyStyleCommand; // Editing has to only reveal unvisited info.
126 friend class EditingStyle; // Editing has to only reveal unvisited info.
127 friend class ComputedStyleExtractor; // Ignores visited styles, so needs to be able to see unvisited info.
128 friend class PropertyWrapperMaybeInvalidColor; // Used by CSS animations. We can't allow them to animate based off visited colors.
129 friend class RenderSVGResource; // FIXME: Needs to alter the visited state by hand. Should clean the SVG code up and move it into RenderStyle perhaps.
130 friend class RenderTreeAsText; // FIXME: Only needed so the render tree can keep lying and dump the wrong colors. Rebaselining would allow this to be yanked.
131 friend class StyleBuilderConverter; // Sets members directly.
132 friend class StyleBuilderCustom; // Sets members directly.
133 friend class StyleBuilderFunctions; // Sets members directly.
134 friend class StyleResolver; // Sets members directly.
137 struct NonInheritedFlags {
140 // The default values should all be zero.
141 ASSERT(!initialOverflowX());
142 ASSERT(!initialOverflowY());
143 ASSERT(!initialClear());
144 ASSERT(!initialDisplay());
145 ASSERT(!initialUnicodeBidi());
146 ASSERT(!initialPosition());
147 ASSERT(!initialVerticalAlign());
148 ASSERT(!initialFloating());
149 ASSERT(!initialTableLayout());
154 bool operator==(const NonInheritedFlags& other) const
156 return m_flags == other.m_flags;
159 bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); }
161 void copyNonInheritedFrom(const NonInheritedFlags& other)
163 // Only a subset is copied because NonInheritedFlags contains a bunch of stuff other than real style data.
164 uint64_t nonInheritedMask = overflowMask << overflowXOffset
165 | overflowMask << overflowYOffset
166 | clearMask << clearOffset
167 | displayMask << effectiveDisplayOffset
168 | positionMask << positionOffset
169 | displayMask << originalDisplayOffset
170 | unicodeBidiMask << unicodeBidiOffset
171 | verticalAlignMask << verticalAlignOffset
172 | floatingMask << floatingOffset
173 | oneBitMask << explicitInheritanceOffset
174 | tableLayoutBitMask << tableLayoutOffset
175 | hasViewportUnitsBitMask << hasViewportUnitsOffset;
177 m_flags = (m_flags & ~nonInheritedMask) | (other.m_flags & nonInheritedMask);
180 EOverflow overflowX() const { return static_cast<EOverflow>(getValue(overflowMask, overflowXOffset)); }
181 void setOverflowX(EOverflow overflowX) { updateValue(overflowX, overflowMask, overflowXOffset); }
183 EOverflow overflowY() const { return static_cast<EOverflow>(getValue(overflowMask, overflowYOffset)); }
184 void setOverflowY(EOverflow overflowY) { updateValue(overflowY, overflowMask, overflowYOffset); }
186 EClear clear() const { return static_cast<EClear>(getValue(clearMask, clearOffset)); }
187 void setClear(EClear clear) { updateValue(clear, clearMask, clearOffset); }
189 EDisplay effectiveDisplay() const { return static_cast<EDisplay>(getValue(displayMask, effectiveDisplayOffset)); }
190 void setEffectiveDisplay(EDisplay effectiveDisplay) { updateValue(effectiveDisplay, displayMask, effectiveDisplayOffset); }
192 EPosition position() const { return static_cast<EPosition>(getValue(positionMask, positionOffset)); }
193 void setPosition(EPosition position) { updateValue(position, positionMask, positionOffset); }
195 EDisplay originalDisplay() const { return static_cast<EDisplay>(getValue(displayMask, originalDisplayOffset)); }
196 void setOriginalDisplay(EDisplay originalDisplay) { updateValue(originalDisplay, displayMask, originalDisplayOffset); }
198 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(getValue(unicodeBidiMask, unicodeBidiOffset)); }
199 void setUnicodeBidi(EUnicodeBidi unicodeBidi) { updateValue(unicodeBidi, unicodeBidiMask, unicodeBidiOffset); }
201 bool hasViewportUnits() const { return getBoolean(hasViewportUnitsOffset); }
202 void setHasViewportUnits(bool value) { updateBoolean(value, hasViewportUnitsOffset); }
204 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(getValue(verticalAlignMask, verticalAlignOffset)); }
205 void setVerticalAlign(EVerticalAlign verticalAlign) { updateValue(verticalAlign, verticalAlignMask, verticalAlignOffset); }
207 bool hasExplicitlyInheritedProperties() const { return getBoolean(explicitInheritanceOffset); }
208 void setHasExplicitlyInheritedProperties(bool value) { updateBoolean(value, explicitInheritanceOffset); }
210 bool isFloating() const { return floating() != NoFloat; }
211 EFloat floating() const { return static_cast<EFloat>(getValue(floatingMask, floatingOffset)); }
212 void setFloating(EFloat floating) { updateValue(floating, floatingMask, floatingOffset); }
214 bool hasAnyPublicPseudoStyles() const { return PUBLIC_PSEUDOID_MASK & getValue(pseudoBitsMask, pseudoBitsOffset); }
215 bool hasPseudoStyle(PseudoId pseudo) const
217 ASSERT(pseudo > NOPSEUDO);
218 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
219 return (oneBitMask << (pseudoBitsOffset - 1 + pseudo)) & m_flags;
221 void setHasPseudoStyle(PseudoId pseudo)
223 ASSERT(pseudo > NOPSEUDO);
224 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID);
225 m_flags |= oneBitMask << (pseudoBitsOffset - 1 + pseudo);
227 void setHasPseudoStyles(PseudoIdSet pseudoIdSet)
230 uint64_t rawPseudoIdSet = pseudoIdSet.data();
231 ASSERT((rawPseudoIdSet & PUBLIC_PSEUDOID_MASK) == rawPseudoIdSet);
232 static_assert(pseudoBitsOffset >= 1, "(pseudoBitsOffset - 1) should be valid.");
233 m_flags |= (static_cast<uint64_t>(rawPseudoIdSet) << (pseudoBitsOffset - 1));
236 ETableLayout tableLayout() const { return static_cast<ETableLayout>(getValue(tableLayoutBitMask, tableLayoutOffset)); }
237 void setTableLayout(ETableLayout tableLayout) { updateValue(tableLayout, tableLayoutBitMask, tableLayoutOffset); }
239 PseudoId styleType() const { return static_cast<PseudoId>(getValue(styleTypeMask, styleTypeOffset)); }
240 void setStyleType(PseudoId styleType) { updateValue(styleType, styleTypeMask, styleTypeOffset); }
242 bool isUnique() const { return getBoolean(isUniqueOffset); }
243 void setIsUnique() { updateBoolean(true, isUniqueOffset); }
245 bool emptyState() const { return getBoolean(emptyStateOffset); }
246 void setEmptyState(bool value) { updateBoolean(value, emptyStateOffset); }
248 bool firstChildState() const { return getBoolean(firstChildStateOffset); }
249 void setFirstChildState(bool value) { updateBoolean(value, firstChildStateOffset); }
251 bool lastChildState() const { return getBoolean(lastChildStateOffset); }
252 void setLastChildState(bool value) { updateBoolean(value, lastChildStateOffset); }
254 bool affectedByHover() const { return getBoolean(affectedByHoverOffset); }
255 void setAffectedByHover(bool value) { updateBoolean(value, affectedByHoverOffset); }
257 bool affectedByActive() const { return getBoolean(affectedByActiveOffset); }
258 void setAffectedByActive(bool value) { updateBoolean(value, affectedByActiveOffset); }
260 bool affectedByDrag() const { return getBoolean(affectedByDragOffset); }
261 void setAffectedByDrag(bool value) { updateBoolean(value, affectedByDragOffset); }
263 bool isLink() const { return getBoolean(isLinkOffset); }
264 void setIsLink(bool value) { updateBoolean(value, isLinkOffset); }
266 bool hasExplicitlySetDirection() const { return getBoolean(hasExplicitlySetDirectionOffset); }
267 void setHasExplicitlySetDirection(bool value) { updateBoolean(value, hasExplicitlySetDirectionOffset); }
269 bool hasExplicitlySetWritingMode() const { return getBoolean(hasExplicitlySetWritingModeOffset); }
270 void setHasExplicitlySetWritingMode(bool value) { updateBoolean(value, hasExplicitlySetWritingModeOffset); }
272 static ptrdiff_t flagsMemoryOffset() { return OBJECT_OFFSETOF(NonInheritedFlags, m_flags); }
273 static uint64_t flagIsaffectedByActive() { return oneBitMask << affectedByActiveOffset; }
274 static uint64_t flagIsaffectedByHover() { return oneBitMask << affectedByHoverOffset; }
275 static uint64_t flagPseudoStyle(PseudoId pseudo) { return oneBitMask << (pseudoBitsOffset - 1 + pseudo); }
276 static uint64_t setFirstChildStateFlags() { return flagFirstChildState() | flagIsUnique(); }
277 static uint64_t setLastChildStateFlags() { return flagLastChildState() | flagIsUnique(); }
279 void updateBoolean(bool isSet, uint64_t offset)
282 m_flags |= (oneBitMask << offset);
284 m_flags &= ~(oneBitMask << offset);
287 bool getBoolean(uint64_t offset) const
289 return m_flags & (oneBitMask << offset);
292 void updateValue(uint8_t newValue, uint64_t positionIndependentMask, uint64_t offset)
294 ASSERT(!(newValue & ~positionIndependentMask));
295 uint64_t positionDependentMask = positionIndependentMask << offset;
296 m_flags = (m_flags & ~positionDependentMask) | (static_cast<uint64_t>(newValue) << offset);
299 unsigned getValue(uint64_t positionIndependentMask, uint64_t offset) const
301 return static_cast<unsigned>((m_flags >> offset) & positionIndependentMask);
304 static uint64_t flagIsUnique() { return oneBitMask << isUniqueOffset; }
305 static uint64_t flagFirstChildState() { return oneBitMask << firstChildStateOffset; }
306 static uint64_t flagLastChildState() { return oneBitMask << lastChildStateOffset; }
308 // To type the bit mask properly on 64bits.
309 static const uint64_t oneBitMask = 0x1;
312 static const unsigned overflowBitCount = 3;
313 static const uint64_t overflowMask = (oneBitMask << overflowBitCount) - 1;
314 static const unsigned overflowXOffset = 0;
315 static const unsigned overflowYOffset = overflowXOffset + overflowBitCount;
316 static const unsigned clearBitCount = 2;
317 static const uint64_t clearMask = (oneBitMask << clearBitCount) - 1;
318 static const unsigned clearOffset = overflowYOffset + overflowBitCount;
321 static const unsigned displayBitCount = 5;
322 static const uint64_t displayMask = (oneBitMask << displayBitCount) - 1;
323 static const unsigned effectiveDisplayOffset = clearOffset + clearBitCount;
324 static const unsigned positionBitCount = 3;
325 static const uint64_t positionMask = (oneBitMask << positionBitCount) - 1;
326 static const unsigned positionOffset = effectiveDisplayOffset + displayBitCount;
329 static const unsigned originalDisplayOffset = positionOffset + positionBitCount;
330 static const unsigned unicodeBidiBitCount = 3;
331 static const uint64_t unicodeBidiMask = (oneBitMask << unicodeBidiBitCount) - 1;
332 static const unsigned unicodeBidiOffset = originalDisplayOffset + displayBitCount;
335 static const unsigned floatingBitCount = 2;
336 static const uint64_t floatingMask = (oneBitMask << floatingBitCount) - 1;
337 static const unsigned floatingOffset = unicodeBidiOffset + unicodeBidiBitCount;
338 static const unsigned hasExplicitlySetDirectionBitcount = 1;
339 static const unsigned hasExplicitlySetDirectionOffset = floatingOffset + floatingBitCount;
340 static const unsigned hasExplicitlySetWritingModeBitcount = 1;
341 static const unsigned hasExplicitlySetWritingModeOffset = hasExplicitlySetDirectionOffset + hasExplicitlySetDirectionBitcount;
344 static const unsigned explicitInheritanceBitCount = 1;
345 static const unsigned explicitInheritanceOffset = hasExplicitlySetWritingModeOffset + hasExplicitlySetWritingModeBitcount;
346 static const unsigned tableLayoutBitCount = 1;
347 static const uint64_t tableLayoutBitMask = oneBitMask;
348 static const unsigned tableLayoutOffset = explicitInheritanceOffset + explicitInheritanceBitCount;
349 static const unsigned verticalAlignBitCount = 4;
350 static const unsigned verticalAlignPadding = 2;
351 static const unsigned verticalAlignAndPaddingBitCount = verticalAlignBitCount + verticalAlignPadding;
352 static const uint64_t verticalAlignMask = (oneBitMask << verticalAlignBitCount) - 1;
353 static const unsigned verticalAlignOffset = tableLayoutOffset + tableLayoutBitCount;
356 static const unsigned pseudoBitsBitCount = 7;
357 static const uint64_t pseudoBitsMask = (oneBitMask << pseudoBitsBitCount) - 1;
358 static const unsigned pseudoBitsOffset = verticalAlignOffset + verticalAlignBitCount;
360 static const unsigned hasViewportUnitsBitCount = 1;
361 static const uint64_t hasViewportUnitsBitMask = (oneBitMask << hasViewportUnitsBitCount) - 1;
362 static const unsigned hasViewportUnitsOffset = pseudoBitsOffset + pseudoBitsBitCount;
365 static const unsigned styleTypeBitCount = 6;
366 static const unsigned styleTypePadding = 2;
367 static const unsigned styleTypeAndPaddingBitCount = styleTypeBitCount + styleTypePadding;
368 static const uint64_t styleTypeMask = (oneBitMask << styleTypeAndPaddingBitCount) - 1;
369 static const unsigned styleTypeOffset = hasViewportUnitsBitCount + hasViewportUnitsOffset;
372 static const unsigned isUniqueOffset = styleTypeOffset + styleTypeAndPaddingBitCount;
373 static const unsigned emptyStateOffset = isUniqueOffset + 1;
374 static const unsigned firstChildStateOffset = emptyStateOffset + 1;
375 static const unsigned lastChildStateOffset = firstChildStateOffset + 1;
376 static const unsigned affectedByHoverOffset = lastChildStateOffset + 1;
377 static const unsigned affectedByActiveOffset = affectedByHoverOffset + 1;
378 static const unsigned affectedByDragOffset = affectedByActiveOffset + 1;
379 static const unsigned isLinkOffset = affectedByDragOffset + 1;
381 // 60 bits are assigned. There are 4 bits available currently used as padding to improve code generation.
382 // If you add more style bits here, you will also need to update RenderStyle::copyNonInheritedFrom().
388 // non-inherited attributes
389 DataRef<StyleBoxData> m_box;
390 DataRef<StyleVisualData> visual;
391 DataRef<StyleBackgroundData> m_background;
392 DataRef<StyleSurroundData> surround;
393 DataRef<StyleRareNonInheritedData> rareNonInheritedData;
395 // inherited attributes
396 DataRef<StyleRareInheritedData> rareInheritedData;
397 DataRef<StyleInheritedData> inherited;
399 // list of associated pseudo styles
400 std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles;
402 DataRef<SVGRenderStyle> m_svgStyle;
404 // !START SYNC!: Keep this in sync with the copy constructor in RenderStyle.cpp and implicitlyInherited() in StyleResolver.cpp
407 struct InheritedFlags {
408 bool operator==(const InheritedFlags& other) const
410 return (_empty_cells == other._empty_cells)
411 && (_caption_side == other._caption_side)
412 && (_list_style_type == other._list_style_type)
413 && (_list_style_position == other._list_style_position)
414 && (_visibility == other._visibility)
415 && (_text_align == other._text_align)
416 && (_text_transform == other._text_transform)
417 && (_text_decorations == other._text_decorations)
418 && (_cursor_style == other._cursor_style)
419 #if ENABLE(CURSOR_VISIBILITY)
420 && (m_cursorVisibility == other.m_cursorVisibility)
422 && (_direction == other._direction)
423 && (_white_space == other._white_space)
424 && (_border_collapse == other._border_collapse)
425 && (_box_direction == other._box_direction)
426 && (m_rtlOrdering == other.m_rtlOrdering)
427 && (m_printColorAdjust == other.m_printColorAdjust)
428 && (_pointerEvents == other._pointerEvents)
429 && (_insideLink == other._insideLink)
430 && (_insideDefaultButton == other._insideDefaultButton)
431 && (m_writingMode == other.m_writingMode);
434 bool operator!=(const InheritedFlags& other) const { return !(*this == other); }
436 unsigned _empty_cells : 1; // EEmptyCell
437 unsigned _caption_side : 2; // ECaptionSide
438 unsigned _list_style_type : 7; // EListStyleType
439 unsigned _list_style_position : 1; // EListStylePosition
440 unsigned _visibility : 2; // EVisibility
441 unsigned _text_align : 4; // ETextAlign
442 unsigned _text_transform : 2; // ETextTransform
443 unsigned _text_decorations : TextDecorationBits;
444 unsigned _cursor_style : 6; // ECursor
445 #if ENABLE(CURSOR_VISIBILITY)
446 unsigned m_cursorVisibility : 1; // CursorVisibility
448 unsigned _direction : 1; // TextDirection
449 unsigned _white_space : 3; // EWhiteSpace
451 unsigned _border_collapse : 1; // EBorderCollapse
452 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction property, flexible box layout module)
454 // non CSS2 inherited
455 unsigned m_rtlOrdering : 1; // Order
456 unsigned m_printColorAdjust : PrintColorAdjustBits;
457 unsigned _pointerEvents : 4; // EPointerEvents
458 unsigned _insideLink : 2; // EInsideLink
459 unsigned _insideDefaultButton : 1;
462 // CSS Text Layout Module Level 3: Vertical writing support
463 unsigned m_writingMode : 2; // WritingMode
468 NonInheritedFlags noninherited_flags;
470 #if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
471 bool m_deletionHasBegun { false };
476 enum CreateDefaultStyleTag { CreateDefaultStyle };
477 RenderStyle(CreateDefaultStyleTag);
479 static RenderStyle& defaultStyle();
482 RenderStyle(RenderStyle&&) = default;
483 RenderStyle& operator=(RenderStyle&&) = default;
485 // This is not a true copy constructor. It doesn't copy pseudo style caches for example.
486 enum CloneTag { Clone };
487 RenderStyle(const RenderStyle&, CloneTag);
491 static RenderStyle create();
492 static std::unique_ptr<RenderStyle> createPtr();
494 static RenderStyle clone(const RenderStyle&);
495 static std::unique_ptr<RenderStyle> clonePtr(const RenderStyle&);
497 static RenderStyle createAnonymousStyleWithDisplay(const RenderStyle& parentStyle, EDisplay);
498 static RenderStyle createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle);
500 #if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS)
501 bool deletionHasBegun() const { return m_deletionHasBegun; }
504 ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
505 ContentDistributionType resolvedJustifyContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
506 ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData& normalValueBehavior) const;
507 ContentDistributionType resolvedAlignContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const;
508 StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const;
509 StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
510 StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const;
511 StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle& parentStyle, ItemPosition normalValueBehaviour) const;
513 enum IsAtShadowBoundary {
518 void inheritFrom(const RenderStyle* inheritParent, IsAtShadowBoundary = NotAtShadowBoundary);
519 void copyNonInheritedFrom(const RenderStyle*);
521 PseudoId styleType() const { return noninherited_flags.styleType(); }
522 void setStyleType(PseudoId styleType) { noninherited_flags.setStyleType(styleType); }
524 RenderStyle* getCachedPseudoStyle(PseudoId) const;
525 RenderStyle* addCachedPseudoStyle(std::unique_ptr<RenderStyle>);
526 void removeCachedPseudoStyle(PseudoId);
528 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); }
530 void setCustomPropertyValue(const AtomicString& name, const RefPtr<CSSValue>& value) { rareInheritedData.access()->m_customProperties.access()->setCustomPropertyValue(name, value); }
531 RefPtr<CSSValue> getCustomPropertyValue(const AtomicString& name) const { return rareInheritedData->m_customProperties->getCustomPropertyValue(name); }
532 bool hasCustomProperty(const AtomicString& name) const { return rareInheritedData->m_customProperties->hasCustomProperty(name); }
533 const CustomPropertyValueMap& customProperties() const { return rareInheritedData->m_customProperties->m_values; }
535 void setHasViewportUnits(bool hasViewportUnits = true) { noninherited_flags.setHasViewportUnits(hasViewportUnits); }
536 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits(); }
538 bool affectedByHover() const { return noninherited_flags.affectedByHover(); }
539 bool affectedByActive() const { return noninherited_flags.affectedByActive(); }
540 bool affectedByDrag() const { return noninherited_flags.affectedByDrag(); }
542 void setAffectedByHover() { noninherited_flags.setAffectedByHover(true); }
543 void setAffectedByActive() { noninherited_flags.setAffectedByActive(true); }
544 void setAffectedByDrag() { noninherited_flags.setAffectedByDrag(true); }
546 void setColumnStylesFromPaginationMode(const Pagination::Mode&);
548 bool operator==(const RenderStyle& other) const;
549 bool operator!=(const RenderStyle& other) const { return !(*this == other); }
550 bool isFloating() const { return noninherited_flags.isFloating(); }
551 bool hasMargin() const { return !surround->margin.isZero(); }
552 bool hasBorder() const { return surround->border.hasBorder(); }
553 bool hasBorderFill() const { return surround->border.hasFill(); }
554 bool hasVisibleBorderDecoration() const { return hasVisibleBorder() || hasBorderFill(); }
555 bool hasVisibleBorder() const { return surround->border.hasVisibleBorder(); }
556 bool hasPadding() const { return !surround->padding.isZero(); }
557 bool hasOffset() const { return !surround->offset.isZero(); }
558 bool hasMarginBeforeQuirk() const { return marginBefore().hasQuirk(); }
559 bool hasMarginAfterQuirk() const { return marginAfter().hasQuirk(); }
561 bool hasBackgroundImage() const { return m_background->background().hasImage(); }
562 bool hasFixedBackgroundImage() const { return m_background->background().hasFixedImage(); }
564 bool hasEntirelyFixedBackground() const;
566 bool hasAppearance() const { return appearance() != NoControlPart; }
568 bool hasBackground() const
570 Color color = visitedDependentColor(CSSPropertyBackgroundColor);
571 if (color.isValid() && color.alpha())
573 return hasBackgroundImage();
576 LayoutBoxExtent imageOutsets(const NinePieceImage&) const;
577 bool hasBorderImageOutsets() const
579 return borderImage().hasImage() && !borderImage().outset().isZero();
581 LayoutBoxExtent borderImageOutsets() const
583 return imageOutsets(borderImage());
586 LayoutBoxExtent maskBoxImageOutsets() const
588 return imageOutsets(maskBoxImage());
591 bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); }
592 FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); }
594 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlOrdering); }
595 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; }
597 bool isStyleAvailable() const;
599 bool hasAnyPublicPseudoStyles() const;
600 bool hasPseudoStyle(PseudoId pseudo) const;
601 void setHasPseudoStyle(PseudoId pseudo);
602 void setHasPseudoStyles(PseudoIdSet);
603 bool hasUniquePseudoStyle() const;
605 // attribute getter methods
607 EDisplay display() const { return noninherited_flags.effectiveDisplay(); }
608 EDisplay originalDisplay() const { return noninherited_flags.originalDisplay(); }
610 const Length& left() const { return surround->offset.left(); }
611 const Length& right() const { return surround->offset.right(); }
612 const Length& top() const { return surround->offset.top(); }
613 const Length& bottom() const { return surround->offset.bottom(); }
615 // Accessors for positioned object edges that take into account writing mode.
616 const Length& logicalLeft() const { return surround->offset.start(writingMode()); }
617 const Length& logicalRight() const { return surround->offset.end(writingMode()); }
618 const Length& logicalTop() const { return surround->offset.before(writingMode()); }
619 const Length& logicalBottom() const { return surround->offset.after(writingMode()); }
621 // Whether or not a positioned element requires normal flow x/y to be computed
622 // to determine its position.
623 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); }
624 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); }
625 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); }
626 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); }
628 EPosition position() const { return noninherited_flags.position(); }
629 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition || position() == FixedPosition; }
630 bool hasInFlowPosition() const { return position() == RelativePosition || position() == StickyPosition; }
631 bool hasViewportConstrainedPosition() const { return position() == FixedPosition || position() == StickyPosition; }
632 EFloat floating() const { return noninherited_flags.floating(); }
634 const Length& width() const { return m_box->width(); }
635 const Length& height() const { return m_box->height(); }
636 const Length& minWidth() const { return m_box->minWidth(); }
637 const Length& maxWidth() const { return m_box->maxWidth(); }
638 const Length& minHeight() const { return m_box->minHeight(); }
639 const Length& maxHeight() const { return m_box->maxHeight(); }
641 const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); }
642 const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); }
643 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); }
644 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); }
645 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); }
646 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); }
648 const BorderData& border() const { return surround->border; }
649 const BorderValue& borderLeft() const { return surround->border.left(); }
650 const BorderValue& borderRight() const { return surround->border.right(); }
651 const BorderValue& borderTop() const { return surround->border.top(); }
652 const BorderValue& borderBottom() const { return surround->border.bottom(); }
654 const BorderValue& borderBefore() const;
655 const BorderValue& borderAfter() const;
656 const BorderValue& borderStart() const;
657 const BorderValue& borderEnd() const;
659 const NinePieceImage& borderImage() const { return surround->border.image(); }
660 StyleImage* borderImageSource() const { return surround->border.image().image(); }
661 const LengthBox& borderImageSlices() const { return surround->border.image().imageSlices(); }
662 const LengthBox& borderImageWidth() const { return surround->border.image().borderSlices(); }
663 const LengthBox& borderImageOutset() const { return surround->border.image().outset(); }
665 const LengthSize& borderTopLeftRadius() const { return surround->border.topLeft(); }
666 const LengthSize& borderTopRightRadius() const { return surround->border.topRight(); }
667 const LengthSize& borderBottomLeftRadius() const { return surround->border.bottomLeft(); }
668 const LengthSize& borderBottomRightRadius() const { return surround->border.bottomRight(); }
669 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); }
671 float borderLeftWidth() const { return surround->border.borderLeftWidth(); }
672 EBorderStyle borderLeftStyle() const { return surround->border.left().style(); }
673 bool borderLeftIsTransparent() const { return surround->border.left().isTransparent(); }
674 float borderRightWidth() const { return surround->border.borderRightWidth(); }
675 EBorderStyle borderRightStyle() const { return surround->border.right().style(); }
676 bool borderRightIsTransparent() const { return surround->border.right().isTransparent(); }
677 float borderTopWidth() const { return surround->border.borderTopWidth(); }
678 EBorderStyle borderTopStyle() const { return surround->border.top().style(); }
679 bool borderTopIsTransparent() const { return surround->border.top().isTransparent(); }
680 float borderBottomWidth() const { return surround->border.borderBottomWidth(); }
681 EBorderStyle borderBottomStyle() const { return surround->border.bottom().style(); }
682 bool borderBottomIsTransparent() const { return surround->border.bottom().isTransparent(); }
683 FloatBoxExtent borderWidth() const { return surround->border.borderWidth(); }
685 float borderBeforeWidth() const;
686 float borderAfterWidth() const;
687 float borderStartWidth() const;
688 float borderEndWidth() const;
690 float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); }
691 float outlineWidth() const;
692 bool hasOutline() const { return outlineStyle() > BHIDDEN && outlineWidth() > 0; }
693 EBorderStyle outlineStyle() const { return m_background->outline().style(); }
694 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_background->outline().isAuto()); }
695 bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; }
697 EOverflow overflowX() const { return noninherited_flags.overflowX(); }
698 EOverflow overflowY() const { return noninherited_flags.overflowY(); }
700 EVisibility visibility() const { return static_cast<EVisibility>(inherited_flags._visibility); }
701 EVerticalAlign verticalAlign() const { return noninherited_flags.verticalAlign(); }
702 const Length& verticalAlignLength() const { return m_box->verticalAlign(); }
704 const Length& clipLeft() const { return visual->clip.left(); }
705 const Length& clipRight() const { return visual->clip.right(); }
706 const Length& clipTop() const { return visual->clip.top(); }
707 const Length& clipBottom() const { return visual->clip.bottom(); }
708 const LengthBox& clip() const { return visual->clip; }
709 bool hasClip() const { return visual->hasClip; }
711 EUnicodeBidi unicodeBidi() const { return noninherited_flags.unicodeBidi(); }
713 EClear clear() const { return noninherited_flags.clear(); }
714 ETableLayout tableLayout() const { return noninherited_flags.tableLayout(); }
716 WEBCORE_EXPORT const FontCascade& fontCascade() const;
717 WEBCORE_EXPORT const FontMetrics& fontMetrics() const;
718 WEBCORE_EXPORT const FontCascadeDescription& fontDescription() const;
719 float specifiedFontSize() const;
720 float computedFontSize() const;
721 int fontSize() const;
722 #if ENABLE(VARIATION_FONTS)
723 FontVariationSettings fontVariationSettings() const { return fontDescription().variationSettings(); }
725 std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation();
727 const Length& textIndent() const { return rareInheritedData->indent; }
728 #if ENABLE(CSS3_TEXT)
729 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(rareInheritedData->m_textIndentLine); }
730 TextIndentType textIndentType() const { return static_cast<TextIndentType>(rareInheritedData->m_textIndentType); }
732 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flags._text_align); }
733 ETextTransform textTransform() const { return static_cast<ETextTransform>(inherited_flags._text_transform); }
734 TextDecoration textDecorationsInEffect() const { return static_cast<TextDecoration>(inherited_flags._text_decorations); }
735 TextDecoration textDecoration() const { return static_cast<TextDecoration>(visual->textDecoration); }
736 #if ENABLE(CSS3_TEXT)
737 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rareInheritedData->m_textAlignLast); }
738 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheritedData->m_textJustify); }
740 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(rareNonInheritedData->m_textDecorationStyle); }
741 TextDecorationSkip textDecorationSkip() const { return static_cast<TextDecorationSkip>(rareInheritedData->m_textDecorationSkip); }
742 TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); }
744 const Length& wordSpacing() const;
745 float letterSpacing() const;
747 float zoom() const { return visual->m_zoom; }
748 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; }
750 TextZoom textZoom() const { return static_cast<TextZoom>(rareInheritedData->m_textZoom); }
752 TextDirection direction() const { return static_cast<TextDirection>(inherited_flags._direction); }
753 bool isLeftToRightDirection() const { return direction() == LTR; }
754 bool hasExplicitlySetDirection() const { return noninherited_flags.hasExplicitlySetDirection(); }
756 const Length& specifiedLineHeight() const;
757 WEBCORE_EXPORT Length lineHeight() const;
758 WEBCORE_EXPORT int computedLineHeight() const;
760 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_flags._white_space); }
761 static bool autoWrap(EWhiteSpace ws)
763 // Nowrap and pre don't automatically wrap.
764 return ws != NOWRAP && ws != PRE;
767 bool autoWrap() const
769 return autoWrap(whiteSpace());
772 static bool preserveNewline(EWhiteSpace ws)
774 // Normal and nowrap do not preserve newlines.
775 return ws != NORMAL && ws != NOWRAP;
778 bool preserveNewline() const
780 return preserveNewline(whiteSpace());
783 static bool collapseWhiteSpace(EWhiteSpace ws)
785 // Pre and prewrap do not collapse whitespace.
786 return ws != PRE && ws != PRE_WRAP;
789 bool collapseWhiteSpace() const
791 return collapseWhiteSpace(whiteSpace());
794 bool isCollapsibleWhiteSpace(UChar c) const
799 return collapseWhiteSpace();
801 return !preserveNewline();
806 bool breakOnlyAfterWhiteSpace() const
808 return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpace;
811 bool breakWords() const
813 return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowWrap;
816 EFillRepeat backgroundRepeatX() const { return static_cast<EFillRepeat>(m_background->background().repeatX()); }
817 EFillRepeat backgroundRepeatY() const { return static_cast<EFillRepeat>(m_background->background().repeatY()); }
818 CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_background->background().composite()); }
819 EFillAttachment backgroundAttachment() const { return static_cast<EFillAttachment>(m_background->background().attachment()); }
820 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background->background().clip()); }
821 EFillBox backgroundOrigin() const { return static_cast<EFillBox>(m_background->background().origin()); }
822 const Length& backgroundXPosition() const { return m_background->background().xPosition(); }
823 const Length& backgroundYPosition() const { return m_background->background().yPosition(); }
824 EFillSizeType backgroundSizeType() const { return m_background->background().sizeType(); }
825 const LengthSize& backgroundSizeLength() const { return m_background->background().sizeLength(); }
826 FillLayer& ensureBackgroundLayers() { return m_background.access()->m_background; }
827 const FillLayer* backgroundLayers() const { return &(m_background->background()); }
829 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image(); }
830 EFillRepeat maskRepeatX() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatX()); }
831 EFillRepeat maskRepeatY() const { return static_cast<EFillRepeat>(rareNonInheritedData->m_mask.repeatY()); }
832 CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(rareNonInheritedData->m_mask.composite()); }
833 EFillBox maskClip() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.clip()); }
834 EFillBox maskOrigin() const { return static_cast<EFillBox>(rareNonInheritedData->m_mask.origin()); }
835 const Length& maskXPosition() const { return rareNonInheritedData->m_mask.xPosition(); }
836 const Length& maskYPosition() const { return rareNonInheritedData->m_mask.yPosition(); }
837 EFillSizeType maskSizeType() const { return rareNonInheritedData->m_mask.sizeType(); }
838 const LengthSize& maskSizeLength() const { return rareNonInheritedData->m_mask.sizeLength(); }
839 FillLayer& ensureMaskLayers() { return rareNonInheritedData.access()->m_mask; }
840 const FillLayer* maskLayers() const { return &(rareNonInheritedData->m_mask); }
841 const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_maskBoxImage; }
842 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_maskBoxImage.image(); }
844 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>(inherited_flags._border_collapse); }
845 float horizontalBorderSpacing() const;
846 float verticalBorderSpacing() const;
847 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_flags._empty_cells); }
848 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherited_flags._caption_side); }
850 EListStyleType listStyleType() const { return static_cast<EListStyleType>(inherited_flags._list_style_type); }
851 StyleImage* listStyleImage() const;
852 EListStylePosition listStylePosition() const { return static_cast<EListStylePosition>(inherited_flags._list_style_position); }
854 const Length& marginTop() const { return surround->margin.top(); }
855 const Length& marginBottom() const { return surround->margin.bottom(); }
856 const Length& marginLeft() const { return surround->margin.left(); }
857 const Length& marginRight() const { return surround->margin.right(); }
858 const Length& marginBefore() const { return surround->margin.before(writingMode()); }
859 const Length& marginAfter() const { return surround->margin.after(writingMode()); }
860 const Length& marginStart() const { return surround->margin.start(writingMode(), direction()); }
861 const Length& marginEnd() const { return surround->margin.end(writingMode(), direction()); }
862 const Length& marginStartUsing(const RenderStyle* otherStyle) const { return surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); }
863 const Length& marginEndUsing(const RenderStyle* otherStyle) const { return surround->margin.end(otherStyle->writingMode(), otherStyle->direction()); }
864 const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return surround->margin.before(otherStyle->writingMode()); }
865 const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return surround->margin.after(otherStyle->writingMode()); }
867 const LengthBox& paddingBox() const { return surround->padding; }
868 const Length& paddingTop() const { return surround->padding.top(); }
869 const Length& paddingBottom() const { return surround->padding.bottom(); }
870 const Length& paddingLeft() const { return surround->padding.left(); }
871 const Length& paddingRight() const { return surround->padding.right(); }
872 const Length& paddingBefore() const { return surround->padding.before(writingMode()); }
873 const Length& paddingAfter() const { return surround->padding.after(writingMode()); }
874 const Length& paddingStart() const { return surround->padding.start(writingMode(), direction()); }
875 const Length& paddingEnd() const { return surround->padding.end(writingMode(), direction()); }
877 ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor_style); }
878 #if ENABLE(CURSOR_VISIBILITY)
879 CursorVisibility cursorVisibility() const { return static_cast<CursorVisibility>(inherited_flags.m_cursorVisibility); }
882 CursorList* cursors() const { return rareInheritedData->cursorData.get(); }
884 EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_flags._insideLink); }
885 bool isLink() const { return noninherited_flags.isLink(); }
887 bool insideDefaultButton() const { return inherited_flags._insideDefaultButton; }
889 short widows() const { return rareInheritedData->widows; }
890 short orphans() const { return rareInheritedData->orphans; }
891 bool hasAutoWidows() const { return rareInheritedData->m_hasAutoWidows; }
892 bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; }
894 // CSS3 Getter Methods
895 BreakInside breakInside() const { return static_cast<BreakInside>(rareNonInheritedData->m_breakInside); }
896 BreakBetween breakBefore() const { return static_cast<BreakBetween>(rareNonInheritedData->m_breakBefore); }
897 BreakBetween breakAfter() const { return static_cast<BreakBetween>(rareNonInheritedData->m_breakAfter); }
899 HangingPunctuation hangingPunctuation() const { return static_cast<HangingPunctuation>(rareInheritedData->m_hangingPunctuation); }
901 float outlineOffset() const;
902 const ShadowData* textShadow() const { return rareInheritedData->textShadow.get(); }
903 void getTextShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(textShadow(), top, right, bottom, left); }
904 void getTextShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(textShadow(), left, right); }
905 void getTextShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(textShadow(), top, bottom); }
906 void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); }
907 void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); }
909 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; }
910 float opacity() const { return rareNonInheritedData->opacity; }
911 ControlPart appearance() const { return static_cast<ControlPart>(rareNonInheritedData->m_appearance); }
912 AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(rareNonInheritedData->m_aspectRatioType); }
913 float aspectRatio() const { return aspectRatioNumerator() / aspectRatioDenominator(); }
914 float aspectRatioDenominator() const { return rareNonInheritedData->m_aspectRatioDenominator; }
915 float aspectRatioNumerator() const { return rareNonInheritedData->m_aspectRatioNumerator; }
916 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonInheritedData->m_deprecatedFlexibleBox->align); }
917 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inherited_flags._box_direction); }
918 float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex; }
919 unsigned int boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->flex_group; }
920 EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedData->m_deprecatedFlexibleBox->lines); }
921 unsigned int boxOrdinalGroup() const { return rareNonInheritedData->m_deprecatedFlexibleBox->ordinal_group; }
922 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInheritedData->m_deprecatedFlexibleBox->orient); }
923 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData->m_deprecatedFlexibleBox->pack); }
925 int order() const { return rareNonInheritedData->m_order; }
926 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexGrow; }
927 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_flexShrink; }
928 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox->m_flexBasis; }
929 const StyleContentAlignmentData& alignContent() const { return rareNonInheritedData->m_alignContent; }
930 ContentPosition alignContentPosition() const { return rareNonInheritedData->m_alignContent.position(); }
931 ContentDistributionType alignContentDistribution() const { return rareNonInheritedData->m_alignContent.distribution(); }
932 OverflowAlignment alignContentOverflowAlignment() const { return rareNonInheritedData->m_alignContent.overflow(); }
933 const StyleSelfAlignmentData& alignItems() const { return rareNonInheritedData->m_alignItems; }
934 ItemPosition alignItemsPosition() const { return rareNonInheritedData->m_alignItems.position(); }
935 OverflowAlignment alignItemsOverflowAlignment() const { return rareNonInheritedData->m_alignItems.overflow(); }
936 const StyleSelfAlignmentData& alignSelf() const { return rareNonInheritedData->m_alignSelf; }
937 ItemPosition alignSelfPosition() const { return rareNonInheritedData->m_alignSelf.position(); }
938 OverflowAlignment alignSelfOverflowAlignment() const { return rareNonInheritedData->m_alignSelf.overflow(); }
939 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
940 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
941 bool isReverseFlexDirection() const { return flexDirection() == FlowRowReverse || flexDirection() == FlowColumnReverse; }
942 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
943 const StyleContentAlignmentData& justifyContent() const { return rareNonInheritedData->m_justifyContent; }
944 ContentPosition justifyContentPosition() const { return rareNonInheritedData->m_justifyContent.position(); }
945 ContentDistributionType justifyContentDistribution() const { return rareNonInheritedData->m_justifyContent.distribution(); }
946 OverflowAlignment justifyContentOverflowAlignment() const { return rareNonInheritedData->m_justifyContent.overflow(); }
947 const StyleSelfAlignmentData& justifyItems() const { return rareNonInheritedData->m_justifyItems; }
948 ItemPosition justifyItemsPosition() const { return rareNonInheritedData->m_justifyItems.position(); }
949 OverflowAlignment justifyItemsOverflowAlignment() const { return rareNonInheritedData->m_justifyItems.overflow(); }
950 ItemPositionType justifyItemsPositionType() const { return rareNonInheritedData->m_justifyItems.positionType(); }
951 const StyleSelfAlignmentData& justifySelf() const { return rareNonInheritedData->m_justifySelf; }
952 ItemPosition justifySelfPosition() const { return rareNonInheritedData->m_justifySelf.position(); }
953 OverflowAlignment justifySelfOverflowAlignment() const { return rareNonInheritedData->m_justifySelf.overflow(); }
955 #if ENABLE(CSS_GRID_LAYOUT)
956 const Vector<GridTrackSize>& gridColumns() const { return rareNonInheritedData->m_grid->m_gridColumns; }
957 const Vector<GridTrackSize>& gridRows() const { return rareNonInheritedData->m_grid->m_gridRows; }
958 const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatColumns; }
959 const Vector<GridTrackSize>& gridAutoRepeatRows() const { return rareNonInheritedData->m_grid->m_gridAutoRepeatRows; }
960 unsigned gridAutoRepeatColumnsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatColumnsInsertionPoint; }
961 unsigned gridAutoRepeatRowsInsertionPoint() const { return rareNonInheritedData->m_grid->m_autoRepeatRowsInsertionPoint; }
962 AutoRepeatType gridAutoRepeatColumnsType() const { return rareNonInheritedData->m_grid->m_autoRepeatColumnsType; }
963 AutoRepeatType gridAutoRepeatRowsType() const { return rareNonInheritedData->m_grid->m_autoRepeatRowsType; }
964 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheritedData->m_grid->m_namedGridColumnLines; }
965 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInheritedData->m_grid->m_namedGridRowLines; }
966 const OrderedNamedGridLinesMap& orderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; }
967 const OrderedNamedGridLinesMap& orderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_orderedNamedGridRowLines; }
968 const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridColumnLines; }
969 const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatNamedGridRowLines; }
970 const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridColumnLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridColumnLines; }
971 const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridRowLines() const { return rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridRowLines; }
972 const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData->m_grid->m_namedGridArea; }
973 size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaRowCount; }
974 size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_grid->m_namedGridAreaColumnCount; }
975 GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(rareNonInheritedData->m_grid->m_gridAutoFlow); }
976 bool isGridAutoFlowDirectionRow() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionRow); }
977 bool isGridAutoFlowDirectionColumn() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn); }
978 bool isGridAutoFlowAlgorithmSparse() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse); }
979 bool isGridAutoFlowAlgorithmDense() const { return (rareNonInheritedData->m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense); }
980 const Vector<GridTrackSize>& gridAutoColumns() const { return rareNonInheritedData->m_grid->m_gridAutoColumns; }
981 const Vector<GridTrackSize>& gridAutoRows() const { return rareNonInheritedData->m_grid->m_gridAutoRows; }
982 const Length& gridColumnGap() const { return rareNonInheritedData->m_grid->m_gridColumnGap; }
983 const Length& gridRowGap() const { return rareNonInheritedData->m_grid->m_gridRowGap; }
986 const GridPosition& gridItemColumnStart() const { return rareNonInheritedData->m_gridItem->m_gridColumnStart; }
987 const GridPosition& gridItemColumnEnd() const { return rareNonInheritedData->m_gridItem->m_gridColumnEnd; }
988 const GridPosition& gridItemRowStart() const { return rareNonInheritedData->m_gridItem->m_gridRowStart; }
989 const GridPosition& gridItemRowEnd() const { return rareNonInheritedData->m_gridItem->m_gridRowEnd; }
990 #endif /* ENABLE(CSS_GRID_LAYOUT) */
992 const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }
993 void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); }
994 LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); }
995 void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); }
996 void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); }
997 void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); }
998 void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); }
1000 #if ENABLE(CSS_BOX_DECORATION_BREAK)
1001 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecorationBreak(); }
1003 StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxReflect.get(); }
1004 EBoxSizing boxSizing() const { return m_box->boxSizing(); }
1005 const Length& marqueeIncrement() const { return rareNonInheritedData->m_marquee->increment; }
1006 int marqueeSpeed() const { return rareNonInheritedData->m_marquee->speed; }
1007 int marqueeLoopCount() const { return rareNonInheritedData->m_marquee->loops; }
1008 EMarqueeBehavior marqueeBehavior() const { return static_cast<EMarqueeBehavior>(rareNonInheritedData->m_marquee->behavior); }
1009 EMarqueeDirection marqueeDirection() const { return static_cast<EMarqueeDirection>(rareNonInheritedData->m_marquee->direction); }
1010 EUserModify userModify() const { return static_cast<EUserModify>(rareInheritedData->userModify); }
1011 EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
1012 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
1013 TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNonInheritedData->textOverflow); }
1014 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
1015 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
1016 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
1017 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareInheritedData->overflowWrap); }
1018 ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
1019 LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedData->lineBreak); }
1020 Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
1021 short hyphenationLimitBefore() const { return rareInheritedData->hyphenationLimitBefore; }
1022 short hyphenationLimitAfter() const { return rareInheritedData->hyphenationLimitAfter; }
1023 short hyphenationLimitLines() const { return rareInheritedData->hyphenationLimitLines; }
1024 const AtomicString& hyphenationString() const { return rareInheritedData->hyphenationString; }
1025 const AtomicString& locale() const { return fontDescription().locale(); }
1026 EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
1027 EResize resize() const { return static_cast<EResize>(rareNonInheritedData->m_resize); }
1028 ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(rareNonInheritedData->m_multiCol->m_axis); }
1029 bool hasInlineColumnAxis() const {
1030 ColumnAxis axis = columnAxis();
1031 return axis == AutoColumnAxis || isHorizontalWritingMode() == (axis == HorizontalColumnAxis);
1033 ColumnProgression columnProgression() const { return static_cast<ColumnProgression>(rareNonInheritedData->m_multiCol->m_progression); }
1034 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
1035 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m_autoWidth; }
1036 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol->m_count; }
1037 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m_autoCount; }
1038 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); }
1039 ColumnFill columnFill() const { return static_cast<ColumnFill>(rareNonInheritedData->m_multiCol->m_fill); }
1040 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; }
1041 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m_normalGap; }
1042 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiCol->m_rule.style(); }
1043 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_multiCol->ruleWidth(); }
1044 bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiCol->m_rule.isTransparent(); }
1045 ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheritedData->m_multiCol->m_columnSpan); }
1047 const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
1048 const Length& transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
1049 const Length& transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
1050 float transformOriginZ() const { return rareNonInheritedData->m_transform->m_z; }
1051 bool hasTransform() const { return !rareNonInheritedData->m_transform->m_operations.operations().isEmpty(); }
1053 TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(rareInheritedData->textEmphasisFill); }
1054 TextEmphasisMark textEmphasisMark() const;
1055 const AtomicString& textEmphasisCustomMark() const { return rareInheritedData->textEmphasisCustomMark; }
1056 TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextEmphasisPosition>(rareInheritedData->textEmphasisPosition); }
1057 const AtomicString& textEmphasisMarkString() const;
1059 RubyPosition rubyPosition() const { return static_cast<RubyPosition>(rareInheritedData->m_rubyPosition); }
1061 TextOrientation textOrientation() const { return static_cast<TextOrientation>(rareInheritedData->m_textOrientation); }
1063 ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInheritedData->m_objectFit); }
1064 LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPosition; }
1066 // Return true if any transform related property (currently transform, transformStyle3D or perspective)
1067 // indicates that we are transforming
1068 bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); }
1070 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin };
1071 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const;
1072 void setPageScaleTransform(float);
1074 bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rareNonInheritedData->m_maskBoxImage.hasImage(); }
1076 TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInheritedData->m_textCombine); }
1077 bool hasTextCombine() const { return textCombine() != TextCombineNone; }
1079 unsigned tabSize() const { return rareInheritedData->m_tabSize; }
1083 bool hasFlowInto() const { return !rareNonInheritedData->m_flowThread.isNull(); }
1084 const AtomicString& flowThread() const { return rareNonInheritedData->m_flowThread; }
1085 bool hasFlowFrom() const { return !rareNonInheritedData->m_regionThread.isNull(); }
1086 const AtomicString& regionThread() const { return rareNonInheritedData->m_regionThread; }
1087 RegionFragment regionFragment() const { return static_cast<RegionFragment>(rareNonInheritedData->m_regionFragment); }
1089 const AtomicString& lineGrid() const { return rareInheritedData->m_lineGrid; }
1090 LineSnap lineSnap() const { return static_cast<LineSnap>(rareInheritedData->m_lineSnap); }
1091 LineAlign lineAlign() const { return static_cast<LineAlign>(rareInheritedData->m_lineAlign); }
1093 // Apple-specific property getter methods
1094 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(inherited_flags._pointerEvents); }
1095 const AnimationList* animations() const { return rareNonInheritedData->m_animations.get(); }
1096 const AnimationList* transitions() const { return rareNonInheritedData->m_transitions.get(); }
1098 AnimationList* animations() { return rareNonInheritedData->m_animations.get(); }
1099 AnimationList* transitions() { return rareNonInheritedData->m_transitions.get(); }
1101 bool hasAnimationsOrTransitions() const { return rareNonInheritedData->hasAnimationsOrTransitions(); }
1103 AnimationList& ensureAnimations();
1104 AnimationList& ensureTransitions();
1106 bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; }
1107 bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; }
1109 // return the first found Animation (including 'all' transitions)
1110 const Animation* transitionForProperty(CSSPropertyID) const;
1112 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformStyle3D>(rareNonInheritedData->m_transformStyle3D); }
1113 bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D == TransformStyle3DPreserve3D; }
1115 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfaceVisibility>(rareNonInheritedData->m_backfaceVisibility); }
1116 float perspective() const { return rareNonInheritedData->m_perspective; }
1117 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
1118 const Length& perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
1119 const Length& perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
1120 const LengthSize& pageSize() const { return rareNonInheritedData->m_pageSize; }
1121 PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNonInheritedData->m_pageSizeType); }
1123 // When set, this ensures that styles compare as different. Used during accelerated animations.
1124 bool isRunningAcceleratedAnimation() const { return rareNonInheritedData->m_runningAcceleratedAnimation; }
1126 LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxContain; }
1127 const LineClampValue& lineClamp() const { return rareNonInheritedData->lineClamp; }
1128 const IntSize& initialLetter() const { return rareNonInheritedData->m_initialLetter; }
1129 int initialLetterDrop() const { return initialLetter().width(); }
1130 int initialLetterHeight() const { return initialLetter().height(); }
1132 #if ENABLE(TOUCH_EVENTS)
1133 TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInheritedData->m_touchAction); }
1136 #if ENABLE(CSS_SCROLL_SNAP)
1137 ScrollSnapType scrollSnapType() const { return static_cast<ScrollSnapType>(rareNonInheritedData->m_scrollSnapType); }
1138 const ScrollSnapPoints* scrollSnapPointsX() const;
1139 const ScrollSnapPoints* scrollSnapPointsY() const;
1140 const LengthSize& scrollSnapDestination() const;
1141 WEBCORE_EXPORT const Vector<LengthSize>& scrollSnapCoordinates() const;
1144 #if ENABLE(TOUCH_EVENTS)
1145 Color tapHighlightColor() const { return rareInheritedData->tapHighlightColor; }
1149 bool touchCalloutEnabled() const { return rareInheritedData->touchCalloutEnabled; }
1152 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
1153 bool useTouchOverflowScrolling() const { return rareInheritedData->useTouchOverflowScrolling; }
1156 #if ENABLE(TEXT_AUTOSIZING)
1157 TextSizeAdjustment textSizeAdjust() const { return rareInheritedData->textSizeAdjust; }
1160 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareInheritedData->textSecurity); }
1162 WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
1163 bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
1164 bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
1165 bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); }
1167 ImageOrientationEnum imageOrientation() const
1169 #if ENABLE(CSS_IMAGE_ORIENTATION)
1170 return static_cast<ImageOrientationEnum>(rareInheritedData->m_imageOrientation);
1172 return DefaultImageOrientation;
1176 EImageRendering imageRendering() const { return static_cast<EImageRendering>(rareInheritedData->m_imageRendering); }
1178 #if ENABLE(CSS_IMAGE_RESOLUTION)
1179 ImageResolutionSource imageResolutionSource() const { return static_cast<ImageResolutionSource>(rareInheritedData->m_imageResolutionSource); }
1180 ImageResolutionSnap imageResolutionSnap() const { return static_cast<ImageResolutionSnap>(rareInheritedData->m_imageResolutionSnap); }
1181 float imageResolution() const { return rareInheritedData->m_imageResolution; }
1184 ESpeak speak() const { return static_cast<ESpeak>(rareInheritedData->speak); }
1186 FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_filter.access()->m_operations; }
1187 const FilterOperations& filter() const { return rareNonInheritedData->m_filter->m_operations; }
1188 bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operations.operations().isEmpty(); }
1189 bool hasReferenceFilterOnly() const;
1191 #if ENABLE(FILTERS_LEVEL_2)
1192 FilterOperations& mutableBackdropFilter() { return rareNonInheritedData.access()->m_backdropFilter.access()->m_operations; }
1193 const FilterOperations& backdropFilter() const { return rareNonInheritedData->m_backdropFilter->m_operations; }
1194 bool hasBackdropFilter() const { return !rareNonInheritedData->m_backdropFilter->m_operations.operations().isEmpty(); }
1196 bool hasBackdropFilter() const { return false; }
1199 #if ENABLE(CSS_COMPOSITING)
1200 BlendMode blendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode); }
1201 void setBlendMode(BlendMode blendMode) { SET_VAR(rareNonInheritedData, m_effectiveBlendMode, blendMode); }
1202 bool hasBlendMode() const { return static_cast<BlendMode>(rareNonInheritedData->m_effectiveBlendMode) != BlendModeNormal; }
1204 Isolation isolation() const { return static_cast<Isolation>(rareNonInheritedData->m_isolation); }
1205 void setIsolation(Isolation isolation) { SET_VAR(rareNonInheritedData, m_isolation, isolation); }
1206 bool hasIsolation() const { return rareNonInheritedData->m_isolation != IsolationAuto; }
1208 BlendMode blendMode() const { return BlendModeNormal; }
1209 bool hasBlendMode() const { return false; }
1211 Isolation isolation() const { return IsolationAuto; }
1212 bool hasIsolation() const { return false; }
1215 bool shouldPlaceBlockDirectionScrollbarOnLeft() const;
1217 #if ENABLE(CSS_TRAILING_WORD)
1218 TrailingWord trailingWord() const { return static_cast<TrailingWord>(rareInheritedData->trailingWord); }
1221 #if ENABLE(APPLE_PAY)
1222 ApplePayButtonStyle applePayButtonStyle() const { return static_cast<ApplePayButtonStyle>(rareNonInheritedData->m_applePayButtonStyle); }
1223 ApplePayButtonType applePayButtonType() const { return static_cast<ApplePayButtonType>(rareNonInheritedData->m_applePayButtonType); }
1226 void checkVariablesInCustomProperties();
1228 // attribute setter methods
1230 void setDisplay(EDisplay v) { noninherited_flags.setEffectiveDisplay(v); }
1231 void setOriginalDisplay(EDisplay v) { noninherited_flags.setOriginalDisplay(v); }
1232 void setPosition(EPosition v) { noninherited_flags.setPosition(v); }
1233 void setFloating(EFloat v) { noninherited_flags.setFloating(v); }
1235 void setLeft(Length v) { SET_VAR(surround, offset.left(), WTFMove(v)); }
1236 void setRight(Length v) { SET_VAR(surround, offset.right(), WTFMove(v)); }
1237 void setTop(Length v) { SET_VAR(surround, offset.top(), WTFMove(v)); }
1238 void setBottom(Length v) { SET_VAR(surround, offset.bottom(), WTFMove(v)); }
1240 void setWidth(Length v) { SET_VAR(m_box, m_width, WTFMove(v)); }
1241 void setHeight(Length v) { SET_VAR(m_box, m_height, WTFMove(v)); }
1243 void setLogicalWidth(Length v)
1245 if (isHorizontalWritingMode()) {
1246 SET_VAR(m_box, m_width, WTFMove(v));
1248 SET_VAR(m_box, m_height, WTFMove(v));
1252 void setLogicalHeight(Length v)
1254 if (isHorizontalWritingMode()) {
1255 SET_VAR(m_box, m_height, WTFMove(v));
1257 SET_VAR(m_box, m_width, WTFMove(v));
1261 void setMinWidth(Length v) { SET_VAR(m_box, m_minWidth, WTFMove(v)); }
1262 void setMaxWidth(Length v) { SET_VAR(m_box, m_maxWidth, WTFMove(v)); }
1263 void setMinHeight(Length v) { SET_VAR(m_box, m_minHeight, WTFMove(v)); }
1264 void setMaxHeight(Length v) { SET_VAR(m_box, m_maxHeight, WTFMove(v)); }
1266 #if ENABLE(DASHBOARD_SUPPORT)
1267 Vector<StyleDashboardRegion> dashboardRegions() const { return rareNonInheritedData->m_dashboardRegions; }
1268 void setDashboardRegions(Vector<StyleDashboardRegion> regions) { SET_VAR(rareNonInheritedData, m_dashboardRegions, regions); }
1270 void setDashboardRegion(int type, const String& label, Length t, Length r, Length b, Length l, bool append)
1272 StyleDashboardRegion region;
1273 region.label = label;
1274 region.offset.top() = WTFMove(t);
1275 region.offset.right() = WTFMove(r);
1276 region.offset.bottom() = WTFMove(b);
1277 region.offset.left() = WTFMove(l);
1280 rareNonInheritedData.access()->m_dashboardRegions.clear();
1281 rareNonInheritedData.access()->m_dashboardRegions.append(region);
1285 void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); }
1286 void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()); }
1287 void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue()); }
1288 void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue()); }
1289 void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()); }
1290 void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()); }
1291 void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); }
1292 void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initialBorderRadius()); }
1293 void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, initialBorderRadius()); }
1294 void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft, initialBorderRadius()); }
1295 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight, initialBorderRadius()); }
1297 void setBackgroundColor(const Color& v) { SET_VAR(m_background, m_color, v); }
1299 void setBackgroundXPosition(Length length) { SET_VAR(m_background, m_background.m_xPosition, WTFMove(length)); }
1300 void setBackgroundYPosition(Length length) { SET_VAR(m_background, m_background.m_yPosition, WTFMove(length)); }
1301 void setBackgroundSize(EFillSizeType b) { SET_VAR(m_background, m_background.m_sizeType, b); }
1302 void setBackgroundSizeLength(LengthSize size) { SET_VAR(m_background, m_background.m_sizeLength, WTFMove(size)); }
1304 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_image, b); }
1305 void setBorderImageSource(PassRefPtr<StyleImage>);
1306 void setBorderImageSlices(LengthBox);
1307 void setBorderImageWidth(LengthBox);
1308 void setBorderImageOutset(LengthBox);
1310 void setBorderTopLeftRadius(LengthSize size) { SET_VAR(surround, border.m_topLeft, WTFMove(size)); }
1311 void setBorderTopRightRadius(LengthSize size) { SET_VAR(surround, border.m_topRight, WTFMove(size)); }
1312 void setBorderBottomLeftRadius(LengthSize size) { SET_VAR(surround, border.m_bottomLeft, WTFMove(size)); }
1313 void setBorderBottomRightRadius(LengthSize size) { SET_VAR(surround, border.m_bottomRight, WTFMove(size)); }
1315 void setBorderRadius(LengthSize s)
1317 setBorderTopLeftRadius(s);
1318 setBorderTopRightRadius(s);
1319 setBorderBottomLeftRadius(s);
1320 setBorderBottomRightRadius(s);
1322 void setBorderRadius(const IntSize& s)
1324 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(), Fixed)));
1327 RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1328 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1330 RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth,
1331 LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const;
1333 void setBorderLeftWidth(float v) { SET_VAR(surround, border.m_left.m_width, v); }
1334 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_style, v); }
1335 void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_left, v); }
1336 void setBorderRightWidth(float v) { SET_VAR(surround, border.m_right.m_width, v); }
1337 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.m_style, v); }
1338 void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_right, v); }
1339 void setBorderTopWidth(float v) { SET_VAR(surround, border.m_top.m_width, v); }
1340 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_style, v); }
1341 void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_top, v); }
1342 void setBorderBottomWidth(float v) { SET_VAR(surround, border.m_bottom.m_width, v); }
1343 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_bottom.m_style, v); }
1344 void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(surround, border.m_bottom, v); }
1346 void setOutlineWidth(float v) { SET_VAR(m_background, m_outline.m_width, v); }
1347 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_outline.m_isAuto, isAuto); }
1348 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_style, v); }
1349 void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_background, m_outline, v); }
1351 void setOverflowX(EOverflow v) { noninherited_flags.setOverflowX(v); }
1352 void setOverflowY(EOverflow v) { noninherited_flags.setOverflowY(v); }
1353 void setVisibility(EVisibility v) { inherited_flags._visibility = v; }
1354 void setVerticalAlign(EVerticalAlign v) { noninherited_flags.setVerticalAlign(v); }
1355 void setVerticalAlignLength(Length length) { setVerticalAlign(LENGTH); SET_VAR(m_box, m_verticalAlign, WTFMove(length)); }
1357 void setHasClip(bool b = true) { SET_VAR(visual, hasClip, b); }
1358 void setClipLeft(Length length) { SET_VAR(visual, clip.left(), WTFMove(length)); }
1359 void setClipRight(Length length) { SET_VAR(visual, clip.right(), WTFMove(length)); }
1360 void setClipTop(Length length) { SET_VAR(visual, clip.top(), WTFMove(length)); }
1361 void setClipBottom(Length length) { SET_VAR(visual, clip.bottom(), WTFMove(length)); }
1362 void setClip(Length top, Length right, Length bottom, Length left);
1363 void setClip(LengthBox box) { SET_VAR(visual, clip, WTFMove(box)); }
1365 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.setUnicodeBidi(b); }
1367 void setClear(EClear v) { noninherited_flags.setClear(v); }
1368 void setTableLayout(ETableLayout v) { noninherited_flags.setTableLayout(v); }
1370 bool setFontDescription(const FontCascadeDescription&);
1371 // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing.
1372 void setFontSize(float);
1373 #if ENABLE(VARIATION_FONTS)
1374 void setFontVariationSettings(FontVariationSettings);
1377 void setColor(const Color&);
1378 void setTextIndent(Length length) { SET_VAR(rareInheritedData, indent, WTFMove(length)); }
1379 #if ENABLE(CSS3_TEXT)
1380 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_textIndentLine, v); }
1381 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_textIndentType, v); }
1383 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; }
1384 void setTextTransform(ETextTransform v) { inherited_flags._text_transform = v; }
1385 void addToTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations |= v; }
1386 void setTextDecorationsInEffect(TextDecoration v) { inherited_flags._text_decorations = v; }
1387 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v); }
1388 #if ENABLE(CSS3_TEXT)
1389 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAlignLast, v); }
1390 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustify, v); }
1392 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInheritedData, m_textDecorationStyle, v); }
1393 void setTextDecorationSkip(TextDecorationSkip skip) { SET_VAR(rareInheritedData, m_textDecorationSkip, skip); }
1394 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInheritedData, m_textUnderlinePosition, v); }
1395 void setDirection(TextDirection v) { inherited_flags._direction = v; }
1396 void setHasExplicitlySetDirection(bool v) { noninherited_flags.setHasExplicitlySetDirection(v); }
1397 #if ENABLE(TEXT_AUTOSIZING)
1398 void setSpecifiedLineHeight(Length v);
1400 void setLineHeight(Length specifiedLineHeight);
1401 bool setZoom(float);
1402 void setZoomWithoutReturnValue(float f) { setZoom(f); }
1403 bool setEffectiveZoom(float);
1404 void setTextZoom(TextZoom v) { SET_VAR(rareInheritedData, m_textZoom, v); }
1406 #if ENABLE(CSS_IMAGE_ORIENTATION)
1407 void setImageOrientation(ImageOrientationEnum v) { SET_VAR(rareInheritedData, m_imageOrientation, static_cast<int>(v)); }
1410 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_imageRendering, v); }
1412 #if ENABLE(CSS_IMAGE_RESOLUTION)
1413 void setImageResolutionSource(ImageResolutionSource v) { SET_VAR(rareInheritedData, m_imageResolutionSource, v); }
1414 void setImageResolutionSnap(ImageResolutionSnap v) { SET_VAR(rareInheritedData, m_imageResolutionSnap, v); }
1415 void setImageResolution(float f) { SET_VAR(rareInheritedData, m_imageResolution, f); }
1418 void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; }
1420 void setWordSpacing(Length);
1421 void setLetterSpacing(float);
1423 void clearBackgroundLayers() { m_background.access()->m_background = FillLayer(BackgroundFillLayer); }
1424 void inheritBackgroundLayers(const FillLayer& parent) { m_background.access()->m_background = parent; }
1426 void adjustBackgroundLayers()
1428 if (backgroundLayers()->next()) {
1429 ensureBackgroundLayers().cullEmptyLayers();
1430 ensureBackgroundLayers().fillUnsetProperties();
1434 void clearMaskLayers() { rareNonInheritedData.access()->m_mask = FillLayer(MaskFillLayer); }
1435 void inheritMaskLayers(const FillLayer& parent) { rareNonInheritedData.access()->m_mask = parent; }
1437 void adjustMaskLayers()
1439 if (maskLayers()->next()) {
1440 ensureMaskLayers().cullEmptyLayers();
1441 ensureMaskLayers().fillUnsetProperties();
1445 void setMaskImage(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_mask.setImage(v); }
1447 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData, m_maskBoxImage, b); }
1448 void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.access()->m_maskBoxImage.setImage(v); }
1449 void setMaskXPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_xPosition, WTFMove(length)); }
1450 void setMaskYPosition(Length length) { SET_VAR(rareNonInheritedData, m_mask.m_yPosition, WTFMove(length)); }
1451 void setMaskSize(LengthSize size) { SET_VAR(rareNonInheritedData, m_mask.m_sizeLength, WTFMove(size)); }
1453 void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_collapse = collapse; }
1454 void setHorizontalBorderSpacing(float);
1455 void setVerticalBorderSpacing(float);
1456 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; }
1457 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; }
1459 void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(rareNonInheritedData, m_aspectRatioType, aspectRatioType); }
1460 void setAspectRatioDenominator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioDenominator, v); }
1461 void setAspectRatioNumerator(float v) { SET_VAR(rareNonInheritedData, m_aspectRatioNumerator, v); }
1463 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type = v; }
1464 void setListStyleImage(PassRefPtr<StyleImage>);
1465 void setListStylePosition(EListStylePosition v) { inherited_flags._list_style_position = v; }
1467 void resetMargin() { SET_VAR(surround, margin, LengthBox(Fixed)); }
1468 void setMarginTop(Length length) { SET_VAR(surround, margin.top(), WTFMove(length)); }
1469 void setMarginBottom(Length length) { SET_VAR(surround, margin.bottom(), WTFMove(length)); }
1470 void setMarginLeft(Length length) { SET_VAR(surround, margin.left(), WTFMove(length)); }
1471 void setMarginRight(Length length) { SET_VAR(surround, margin.right(), WTFMove(length)); }
1472 void setMarginStart(Length);
1473 void setMarginEnd(Length);
1475 void resetPadding() { SET_VAR(surround, padding, LengthBox(Auto)); }
1476 void setPaddingBox(LengthBox box) { SET_VAR(surround, padding, WTFMove(box)); }
1477 void setPaddingTop(Length length) { SET_VAR(surround, padding.top(), WTFMove(length)); }
1478 void setPaddingBottom(Length length) { SET_VAR(surround, padding.bottom(), WTFMove(length)); }
1479 void setPaddingLeft(Length length) { SET_VAR(surround, padding.left(), WTFMove(length)); }
1480 void setPaddingRight(Length length) { SET_VAR(surround, padding.right(), WTFMove(length)); }
1482 void setCursor(ECursor c) { inherited_flags._cursor_style = c; }
1483 void addCursor(PassRefPtr<StyleImage>, const IntPoint& hotSpot = IntPoint());
1484 void setCursorList(PassRefPtr<CursorList>);
1485 void clearCursorList();
1487 #if ENABLE(CURSOR_VISIBILITY)
1488 void setCursorVisibility(CursorVisibility c) { inherited_flags.m_cursorVisibility = c; }
1491 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = insideLink; }
1492 void setIsLink(bool b) { noninherited_flags.setIsLink(b); }
1494 void setInsideDefaultButton(bool insideDefaultButton) { inherited_flags._insideDefaultButton = insideDefaultButton; }
1496 PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(inherited_flags.m_printColorAdjust); }
1497 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printColorAdjust = value; }
1499 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); }
1500 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_box, m_zIndex, 0); }
1501 int zIndex() const { return m_box->zIndex(); }
1502 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_box, m_zIndex, v); }
1504 void setHasAutoWidows() { SET_VAR(rareInheritedData, m_hasAutoWidows, true); SET_VAR(rareInheritedData, widows, initialWidows()); }
1505 void setWidows(short w) { SET_VAR(rareInheritedData, m_hasAutoWidows, false); SET_VAR(rareInheritedData, widows, w); }
1507 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true); SET_VAR(rareInheritedData, orphans, initialOrphans()); }
1508 void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, false); SET_VAR(rareInheritedData, orphans, o); }
1511 void setOutlineOffset(float v) { SET_VAR(m_background, m_outline.m_offset, v); }
1512 void setTextShadow(std::unique_ptr<ShadowData>, bool add = false);
1513 void setTextStrokeColor(const Color& c) { SET_VAR(rareInheritedData, textStrokeColor, c); }
1514 void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidth, w); }
1515 void setTextFillColor(const Color& c) { SET_VAR(rareInheritedData, textFillColor, c); }
1516 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(rareNonInheritedData, opacity, v); }
1517 void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearance, a); }
1518 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment
1519 void setBoxAlign(EBoxAlignment a) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, align, a); }
1520 #if ENABLE(CSS_BOX_DECORATION_BREAK)
1521 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDecorationBreak, b); }
1523 void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
1524 void setBoxFlex(float f) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, flex, f); }
1525 void setBoxFlexGroup(unsigned int fg) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, flex_group, fg); }
1526 void setBoxLines(EBoxLines l) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, lines, l); }
1527 void setBoxOrdinalGroup(unsigned int og) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, ordinal_group, og); }
1528 void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, orient, o); }
1529 void setBoxPack(EBoxPack p) { SET_NESTED_VAR(rareNonInheritedData, m_deprecatedFlexibleBox, pack, p); }
1530 void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false);
1531 void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInheritedData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = reflect; }
1532 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); }
1533 void setFlexGrow(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexGrow, f); }
1534 void setFlexShrink(float f) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexShrink, f); }
1535 void setFlexBasis(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexBasis, WTFMove(length)); }
1536 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, o); }
1537 void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignContent, data); }
1538 void setAlignContentPosition(ContentPosition position) { rareNonInheritedData.access()->m_alignContent.setPosition(position); }
1539 void setAlignContentOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignContent.setOverflow(overflow); }
1540 void setAlignContentDistribution(ContentDistributionType distribution) { rareNonInheritedData.access()->m_alignContent.setDistribution(distribution); }
1541 void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignItems, data); }
1542 void setAlignItemsPosition(ItemPosition position) { rareNonInheritedData.access()->m_alignItems.setPosition(position); }
1543 void setAlignItemsOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignItems.setOverflow(overflow); }
1544 void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_alignSelf, data); }
1545 void setAlignSelfPosition(ItemPosition position) { rareNonInheritedData.access()->m_alignSelf.setPosition(position); }
1546 void setAlignSelfOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_alignSelf.setOverflow(overflow); }
1547 void setFlexDirection(EFlexDirection direction) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexDirection, direction); }
1548 void setFlexWrap(EFlexWrap w) { SET_NESTED_VAR(rareNonInheritedData, m_flexibleBox, m_flexWrap, w); }
1549 void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifyContent, data); }
1550 void setJustifyContentPosition(ContentPosition position) { rareNonInheritedData.access()->m_justifyContent.setPosition(position); }
1551 void setJustifyContentOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifyContent.setOverflow(overflow); }
1552 void setJustifyContentDistribution(ContentDistributionType distribution) { rareNonInheritedData.access()->m_justifyContent.setDistribution(distribution); }
1553 void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifyItems, data); }
1554 void setJustifyItemsPosition(ItemPosition position) { rareNonInheritedData.access()->m_justifyItems.setPosition(position); }
1555 void setJustifyItemsOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifyItems.setOverflow(overflow); }
1556 void setJustifyItemsPositionType(ItemPositionType positionType) { rareNonInheritedData.access()->m_justifyItems.setPositionType(positionType); }
1557 void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(rareNonInheritedData, m_justifySelf, data); }
1558 void setJustifySelfPosition(ItemPosition position) { rareNonInheritedData.access()->m_justifySelf.setPosition(position); }
1559 void setJustifySelfOverflow(OverflowAlignment overflow) { rareNonInheritedData.access()->m_justifySelf.setOverflow(overflow); }
1560 #if ENABLE(CSS_GRID_LAYOUT)
1561 void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoColumns, trackSizeList); }
1562 void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRows, trackSizeList); }
1563 void setGridColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridColumns, lengths); }
1564 void setGridRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridRows, lengths); }
1565 void setGridAutoRepeatColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatColumns, lengths); }
1566 void setGridAutoRepeatRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoRepeatRows, lengths); }
1567 void setGridAutoRepeatColumnsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatColumnsInsertionPoint, insertionPoint); }
1568 void setGridAutoRepeatRowsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatRowsInsertionPoint, insertionPoint); }
1569 void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatColumnsType, autoRepeatType); }
1570 void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatRowsType, autoRepeatType); }
1571 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridColumnLines, namedGridColumnLines); }
1572 void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridRowLines, namedGridRowLines); }
1573 void setOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridColumnLines, orderedNamedGridColumnLines); }
1574 void setOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_orderedNamedGridRowLines, orderedNamedGridRowLines); }
1575 void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridColumnLines, namedGridColumnLines); }
1576 void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatNamedGridRowLines, namedGridRowLines); }
1577 void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); }
1578 void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_autoRepeatOrderedNamedGridRowLines, orderedNamedGridRowLines); }
1579 void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridArea, namedGridArea); }
1580 void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaRowCount, rowCount); }
1581 void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_namedGridAreaColumnCount, columnCount); }
1582 void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridAutoFlow, flow); }
1583 void setGridItemColumnStart(const GridPosition& columnStartPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridColumnStart, columnStartPosition); }
1584 void setGridItemColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridColumnEnd, columnEndPosition); }
1585 void setGridItemRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridRowStart, rowStartPosition); }
1586 void setGridItemRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(rareNonInheritedData, m_gridItem, m_gridRowEnd, rowEndPosition); }
1587 void setGridColumnGap(const Length& v) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridColumnGap, v); }
1588 void setGridRowGap(const Length& v) { SET_NESTED_VAR(rareNonInheritedData, m_grid, m_gridRowGap, v); }
1589 #endif /* ENABLE(CSS_GRID_LAYOUT) */
1590 void setMarqueeIncrement(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, increment, WTFMove(length)); }
1591 void setMarqueeSpeed(int f) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, speed, f); }
1592 void setMarqueeDirection(EMarqueeDirection d) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, direction, d); }
1593 void setMarqueeBehavior(EMarqueeBehavior b) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, behavior, b); }
1594 void setMarqueeLoopCount(int i) { SET_NESTED_VAR(rareNonInheritedData, m_marquee, loops, i); }
1595 void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u); }
1596 void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
1597 void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
1598 void setTextOverflow(TextOverflow overflow) { SET_VAR(rareNonInheritedData, textOverflow, overflow); }
1599 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
1600 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
1601 void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
1602 void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
1603 void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
1604 void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
1605 void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
1606 void setHyphenationLimitBefore(short limit) { SET_VAR(rareInheritedData, hyphenationLimitBefore, limit); }
1607 void setHyphenationLimitAfter(short limit) { SET_VAR(rareInheritedData, hyphenationLimitAfter, limit); }
1608 void setHyphenationLimitLines(short limit) { SET_VAR(rareInheritedData, hyphenationLimitLines, limit); }
1609 void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenationString, h); }
1610 void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
1611 void setResize(EResize r) { SET_VAR(rareNonInheritedData, m_resize, r); }
1612 void setColumnAxis(ColumnAxis axis) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_axis, axis); }
1613 void setColumnProgression(ColumnProgression progression) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_progression, progression); }
1614 void setColumnWidth(float f) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoWidth, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_width, f); }
1615 void setHasAutoColumnWidth() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoWidth, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_width, 0); }
1616 void setColumnCount(unsigned short c) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoCount, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_count, c); }
1617 void setHasAutoColumnCount() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_autoCount, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_count, 0); }
1618 void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_fill, columnFill); }
1619 void setColumnGap(float f) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_normalGap, false); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_gap, f); }
1620 void setHasNormalColumnGap() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_normalGap, true); SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_gap, 0); }
1621 void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(rareNonInheritedData.access()->m_multiCol, m_rule, c); }
1622 void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule.m_style, b); }
1623 void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule.m_width, w); }
1624 void resetColumnRule() { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_rule, BorderValue()); }
1625 void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_columnSpan, columnSpan); }
1626 void inheritColumnPropertiesFrom(const RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
1627 void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_operations, ops); }
1628 void setTransformOriginX(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_x, WTFMove(length)); }
1629 void setTransformOriginY(Length length) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_y, WTFMove(length)); }
1630 void setTransformOriginZ(float f) { SET_NESTED_VAR(rareNonInheritedData, m_transform, m_z, f); }
1631 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); }
1632 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCombine, v); }
1633 void setTextDecorationColor(const Color& c) { SET_VAR(rareNonInheritedData, m_textDecorationColor, c); }
1634 void setTextEmphasisColor(const Color& c) { SET_VAR(rareInheritedData, textEmphasisColor, c); }
1635 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData, textEmphasisFill, fill); }
1636 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData, textEmphasisMark, mark); }
1637 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInheritedData, textEmphasisCustomMark, mark); }
1638 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareInheritedData, textEmphasisPosition, position); }
1639 bool setTextOrientation(TextOrientation);
1641 void setObjectFit(ObjectFit fit) { SET_VAR(rareNonInheritedData, m_objectFit, fit); }
1642 void setObjectPosition(const LengthPoint& position) { SET_VAR(rareNonInheritedData, m_objectPosition, position); }
1644 void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_rubyPosition, position); }
1646 void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_filter, m_operations, ops); }
1647 #if ENABLE(FILTERS_LEVEL_2)
1648 void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(rareNonInheritedData, m_backdropFilter, m_operations, ops); }
1651 void setTabSize(unsigned size) { SET_VAR(rareInheritedData, m_tabSize, size); }
1653 void setBreakBefore(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakBefore, breakBehavior); }
1654 void setBreakAfter(BreakBetween breakBehavior) { SET_VAR(rareNonInheritedData, m_breakAfter, breakBehavior); }
1655 void setBreakInside(BreakInside breakBehavior) { SET_VAR(rareNonInheritedData, m_breakInside, breakBehavior); }
1657 void setHangingPunctuation(HangingPunctuation punctuation) { SET_VAR(rareInheritedData, m_hangingPunctuation, punctuation); }
1661 void setLineGrid(const AtomicString& lineGrid) { SET_VAR(rareInheritedData, m_lineGrid, lineGrid); }
1662 void setLineSnap(LineSnap lineSnap) { SET_VAR(rareInheritedData, m_lineSnap, lineSnap); }
1663 void setLineAlign(LineAlign lineAlign) { SET_VAR(rareInheritedData, m_lineAlign, lineAlign); }
1665 void setFlowThread(const AtomicString& flowThread) { SET_VAR(rareNonInheritedData, m_flowThread, flowThread); }
1666 void setRegionThread(const AtomicString& regionThread) { SET_VAR(rareNonInheritedData, m_regionThread, regionThread); }
1667 void setRegionFragment(RegionFragment regionFragment) { SET_VAR(rareNonInheritedData, m_regionFragment, regionFragment); }
1669 // Apple-specific property setters
1670 void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p; }
1672 void clearAnimations()
1674 rareNonInheritedData.access()->m_animations = nullptr;
1677 void clearTransitions()
1679 rareNonInheritedData.access()->m_transitions = nullptr;
1682 void inheritAnimations(const AnimationList* parent) { rareNonInheritedData.access()->m_animations = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
1683 void inheritTransitions(const AnimationList* parent) { rareNonInheritedData.access()->m_transitions = parent ? std::make_unique<AnimationList>(*parent) : nullptr; }
1684 void adjustAnimations();
1685 void adjustTransitions();
1687 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData, m_transformStyle3D, b); }
1688 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInheritedData, m_backfaceVisibility, b); }
1689 void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
1690 void setPerspectiveOriginX(Length length) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, WTFMove(length)); }
1691 void setPerspectiveOriginY(Length length) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, WTFMove(length)); }
1692 void setPageSize(LengthSize size) { SET_VAR(rareNonInheritedData, m_pageSize, WTFMove(size)); }
1693 void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageSizeType, t); }
1694 void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAGE_SIZE_AUTO); }
1696 void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
1698 void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_lineBoxContain, c); }
1699 void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClamp, c); }
1701 void setInitialLetter(const IntSize& size) { SET_VAR(rareNonInheritedData, m_initialLetter, size); }
1703 #if ENABLE(TOUCH_EVENTS)
1704 void setTouchAction(TouchAction touchAction) { SET_VAR(rareNonInheritedData, m_touchAction, static_cast<unsigned>(touchAction)); }
1707 #if ENABLE(CSS_SCROLL_SNAP)
1708 void setScrollSnapType(ScrollSnapType type) { SET_VAR(rareNonInheritedData, m_scrollSnapType, static_cast<unsigned>(type)); }
1709 void setScrollSnapPointsX(std::unique_ptr<ScrollSnapPoints>);
1710 void setScrollSnapPointsY(std::unique_ptr<ScrollSnapPoints>);
1711 void setScrollSnapDestination(LengthSize);
1712 void setScrollSnapCoordinates(Vector<LengthSize>);
1715 #if ENABLE(TOUCH_EVENTS)
1716 void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHighlightColor, c); }
1720 void setTouchCalloutEnabled(bool v) { SET_VAR(rareInheritedData, touchCalloutEnabled, v); }
1723 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
1724 void setUseTouchOverflowScrolling(bool v) { SET_VAR(rareInheritedData, useTouchOverflowScrolling, v); }
1727 #if ENABLE(TEXT_AUTOSIZING)
1728 void setTextSizeAdjust(TextSizeAdjustment anAdjustment) { SET_VAR(rareInheritedData, textSizeAdjust, anAdjustment); }
1731 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedData, textSecurity, aTextSecurity); }
1733 #if ENABLE(CSS_TRAILING_WORD)
1734 void setTrailingWord(TrailingWord v) { SET_VAR(rareInheritedData, trailingWord, static_cast<unsigned>(v)); }
1737 #if ENABLE(APPLE_PAY)
1738 void setApplePayButtonStyle(ApplePayButtonStyle v) { SET_VAR(rareNonInheritedData, m_applePayButtonStyle, static_cast<unsigned>(v)); }
1739 void setApplePayButtonType(ApplePayButtonType v) { SET_VAR(rareNonInheritedData, m_applePayButtonType, static_cast<unsigned>(v)); }
1742 const SVGRenderStyle& svgStyle() const { return *m_svgStyle; }
1743 SVGRenderStyle& accessSVGStyle() { return *m_svgStyle.access(); }
1745 const SVGPaint::SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(); }
1746 Color fillPaintColor() const { return svgStyle().fillPaintColor(); }
1747 void setFillPaintColor(const Color& c) { accessSVGStyle().setFillPaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1748 float fillOpacity() const { return svgStyle().fillOpacity(); }
1749 void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); }
1751 const SVGPaint::SVGPaintType& strokePaintType() const { return svgStyle().strokePaintType(); }
1752 Color strokePaintColor() const { return svgStyle().strokePaintColor(); }
1753 void setStrokePaintColor(const Color& c) { accessSVGStyle().setStrokePaint(SVGPaint::SVG_PAINTTYPE_RGBCOLOR, c, ""); }
1754 float strokeOpacity() const { return svgStyle().strokeOpacity(); }
1755 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); }
1756 const Length& strokeWidth() const { return svgStyle().strokeWidth(); }
1757 void setStrokeWidth(Length w) { accessSVGStyle().setStrokeWidth(w); }
1758 Vector<SVGLength> strokeDashArray() const { return svgStyle().strokeDashArray(); }
1759 void setStrokeDashArray(Vector<SVGLength> array) { accessSVGStyle().setStrokeDashArray(array); }
1760 const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); }
1761 void setStrokeDashOffset(Length d) { accessSVGStyle().setStrokeDashOffset(d); }
1762 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); }
1763 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f); }
1765 const Length& cx() const { return svgStyle().cx(); }
1766 void setCx(Length cx) { accessSVGStyle().setCx(cx); }
1767 const Length& cy() const { return svgStyle().cy(); }
1768 void setCy(Length cy) { accessSVGStyle().setCy(cy); }
1769 const Length& r() const { return svgStyle().r(); }
1770 void setR(Length r) { accessSVGStyle().setR(r); }
1771 const Length& rx() const { return svgStyle().rx(); }
1772 void setRx(Length rx) { accessSVGStyle().setRx(rx); }
1773 const Length& ry() const { return svgStyle().ry(); }
1774 void setRy(Length ry) { accessSVGStyle().setRy(ry); }
1775 const Length& x() const { return svgStyle().x(); }
1776 void setX(Length x) { accessSVGStyle().setX(x); }
1777 const Length& y() const { return svgStyle().y(); }
1778 void setY(Length y) { accessSVGStyle().setY(y); }
1780 float floodOpacity() const { return svgStyle().floodOpacity(); }
1781 void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); }
1783 float stopOpacity() const { return svgStyle().stopOpacity(); }
1784 void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); }
1786 void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); }
1787 void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); }
1788 void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c); }
1790 SVGLength baselineShiftValue() const { return svgStyle().baselineShiftValue(); }
1791 void setBaselineShiftValue(SVGLength s) { accessSVGStyle().setBaselineShiftValue(s); }
1792 SVGLength kerning() const { return svgStyle().kerning(); }
1793 void setKerning(SVGLength k) { accessSVGStyle().setKerning(k); }
1795 void setShapeOutside(PassRefPtr<ShapeValue> value)
1797 if (rareNonInheritedData->m_shapeOutside == value)
1799 rareNonInheritedData.access()->m_shapeOutside = value;
1801 ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutside.get(); }
1803 static ShapeValue* initialShapeOutside() { return 0; }
1805 const Length& shapeMargin() const { return rareNonInheritedData->m_shapeMargin; }
1806 void setShapeMargin(Length shapeMargin) { SET_VAR(rareNonInheritedData, m_shapeMargin, WTFMove(shapeMargin)); }
1807 static Length initialShapeMargin() { return Length(0, Fixed); }
1809 float shapeImageThreshold() const { return rareNonInheritedData->m_shapeImageThreshold; }
1810 void setShapeImageThreshold(float shapeImageThreshold)
1812 float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0, 1);
1813 SET_VAR(rareNonInheritedData, m_shapeImageThreshold, clampedShapeImageThreshold);
1815 static float initialShapeImageThreshold() { return 0; }
1817 void setClipPath(PassRefPtr<ClipPathOperation> operation)
1819 if (rareNonInheritedData->m_clipPath != operation)
1820 rareNonInheritedData.access()->m_clipPath = operation;
1822 ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPath.get(); }
1824 static ClipPathOperation* initialClipPath() { return nullptr; }
1826 bool hasContent() const { return contentData(); }
1827 const ContentData* contentData() const { return rareNonInheritedData->m_content.get(); }
1828 bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->rareNonInheritedData); }
1829 void clearContent();
1830 void setContent(const String&, bool add = false);
1831 void setContent(PassRefPtr<StyleImage>, bool add = false);
1832 void setContent(std::unique_ptr<CounterContent>, bool add = false);
1833 void setContent(QuoteType, bool add = false);
1834 void setContentAltText(const String&);
1835 const String& contentAltText() const;
1836 bool hasAttrContent() const { return rareNonInheritedData->m_hasAttrContent; }
1837 void setHasAttrContent();
1839 const CounterDirectiveMap* counterDirectives() const;
1840 CounterDirectiveMap& accessCounterDirectives();
1841 const CounterDirectives getCounterDirectives(const AtomicString& identifier) const;
1843 QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
1844 void setQuotes(PassRefPtr<QuotesData>);
1846 WillChangeData* willChange() const { return rareNonInheritedData->m_willChange.get(); }
1847 void setWillChange(PassRefPtr<WillChangeData>);
1849 bool willChangeCreatesStackingContext() const
1854 return willChange()->canCreateStackingContext();
1857 const AtomicString& hyphenString() const;
1859 bool inheritedNotEqual(const RenderStyle*) const;
1860 bool inheritedDataShared(const RenderStyle*) const;
1862 #if ENABLE(TEXT_AUTOSIZING)
1863 uint32_t hashForTextAutosizing() const;
1864 bool equalForTextAutosizing(const RenderStyle&) const;
1867 StyleDifference diff(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
1868 bool diffRequiresLayerRepaint(const RenderStyle&, bool isComposited) const;
1870 bool isDisplayReplacedType() const { return isDisplayReplacedType(display()); }
1871 bool isDisplayInlineType() const { return isDisplayInlineType(display()); }
1872 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); }
1873 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); }
1874 bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display()); }
1875 bool isDisplayRegionType() const
1877 return display() == BLOCK || display() == INLINE_BLOCK
1878 || display() == TABLE_CELL || display() == TABLE_CAPTION
1879 || display() == LIST_ITEM;
1882 bool setWritingMode(WritingMode v)
1884 if (v == writingMode())
1887 inherited_flags.m_writingMode = v;
1891 bool hasExplicitlySetWritingMode() const { return noninherited_flags.hasExplicitlySetWritingMode(); }
1892 void setHasExplicitlySetWritingMode(bool v) { noninherited_flags.setHasExplicitlySetWritingMode(v); }
1894 // A unique style is one that has matches something that makes it impossible to share.
1895 bool unique() const { return noninherited_flags.isUnique(); }
1896 void setUnique() { noninherited_flags.setIsUnique(); }
1898 bool emptyState() const { return noninherited_flags.emptyState(); }
1899 void setEmptyState(bool b) { setUnique(); noninherited_flags.setEmptyState(b); }
1900 bool firstChildState() const { return noninherited_flags.firstChildState(); }
1901 void setFirstChildState() { setUnique(); noninherited_flags.setFirstChildState(true); }
1902 bool lastChildState() const { return noninherited_flags.lastChildState(); }
1903 void setLastChildState() { setUnique(); noninherited_flags.setLastChildState(true); }
1905 WEBCORE_EXPORT Color visitedDependentColor(int colorProperty) const;
1906 bool backgroundColorEqualsToColorIgnoringVisited(const Color& color) const { return color == backgroundColor(); }
1908 void setHasExplicitlyInheritedProperties() { noninherited_flags.setHasExplicitlyInheritedProperties(true); }
1909 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.hasExplicitlyInheritedProperties(); }
1911 // Initial values for all the properties
1912 static EOverflow initialOverflowX() { return OVISIBLE; }
1913 static EOverflow initialOverflowY() { return OVISIBLE; }
1914 static EClear initialClear() { return CNONE; }
1915 static EDisplay initialDisplay() { return INLINE; }
1916 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; }
1917 static EPosition initialPosition() { return StaticPosition; }
1918 static EVerticalAlign initialVerticalAlign() { return BASELINE; }
1919 static EFloat initialFloating() { return NoFloat; }
1920 static BreakBetween initialBreakBetween() { return AutoBreakBetween; }
1921 static BreakInside initialBreakInside() { return AutoBreakInside; }
1922 static HangingPunctuation initialHangingPunctuation() { return NoHangingPunctuation; }
1923 static ETableLayout initialTableLayout() { return TAUTO; }
1924 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; }
1925 static EBorderStyle initialBorderStyle() { return BNONE; }
1926 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; }
1927 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); }
1928 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed), Length(0, Fixed)); }
1929 static ECaptionSide initialCaptionSide() { return CAPTOP; }
1930 static ColumnAxis initialColumnAxis() { return AutoColumnAxis; }
1931 static ColumnProgression initialColumnProgression() { return NormalColumnProgression; }
1932 static TextDirection initialDirection() { return LTR; }
1933 static WritingMode initialWritingMode() { return TopToBottomWritingMode; }
1934 static TextCombine initialTextCombine() { return TextCombineNone; }
1935 static TextOrientation initialTextOrientation() { return TextOrientation::
1937 static ObjectFit initialObjectFit() { return ObjectFitFill; }
1938 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); }
1939 static EEmptyCell initialEmptyCells() { return SHOW; }
1940 static EListStylePosition initialListStylePosition() { return OUTSIDE; }
1941 static EListStyleType initialListStyleType() { return Disc; }
1942 static ETextTransform initialTextTransform() { return TTNONE; }
1943 static EVisibility initialVisibility() { return VISIBLE; }
1944 static EWhiteSpace initialWhiteSpace() { return NORMAL; }
1945 static float initialHorizontalBorderSpacing() { return 0; }
1946 static float initialVerticalBorderSpacing() { return 0; }
1947 static ECursor initialCursor() { return CursorAuto; }
1948 #if ENABLE(CURSOR_VISIBILITY)
1949 static CursorVisibility initialCursorVisibility() { return CursorVisibilityAuto; }
1951 static Color initialColor() { return Color::black; }
1952 static StyleImage* initialListStyleImage() { return 0; }
1953 static float initialBorderWidth() { return 3; }
1954 static unsigned short initialColumnRuleWidth() { return 3; }
1955 static float initialOutlineWidth() { return 3; }
1956 static float initialLetterSpacing() { return 0; }
1957 static Length initialWordSpacing() { return Length(Fixed); }
1958 static Length initialSize() { return Length(); }
1959 static Length initialMinSize() { return Length(); }
1960 static Length initialMaxSize() { return Length(Undefined); }
1961 static Length initialOffset() { return Length(); }
1962 static Length initialMargin() { return Length(Fixed); }
1963 static Length initialPadding() { return Length(Fixed); }
1964 static Length initialTextIndent() { return Length(Fixed); }
1965 static Length initialZeroLength() { return Length(Fixed); }
1966 static Length initialOneLength() { return Length(1, Fixed); }
1967 #if ENABLE(CSS3_TEXT)
1968 static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine; }
1969 static TextIndentType initialTextIndentType() { return TextIndentNormal; }
1971 static short initialWidows() { return 2; }
1972 static short initialOrphans() { return 2; }
1973 static Length initialLineHeight() { return Length(-100.0f, Percent); }
1974 #if ENABLE(TEXT_AUTOSIZING)
1975 static Length initialSpecifiedLineHeight() { return Length(-100.0f, Percent); }
1977 static ETextAlign initialTextAlign() { return TASTART; }
1978 static TextDecoration initialTextDecoration() { return TextDecorationNone; }
1979 #if ENABLE(CSS3_TEXT)
1980 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
1981 static TextJustify initialTextJustify() { return TextJustifyAuto; }
1983 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyleSolid; }
1984 static TextDecorationSkip initialTextDecorationSkip() { return TextDecorationSkipAuto; }
1985 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePositionAuto; }
1986 static float initialZoom() { return 1.0f; }
1987 static TextZoom initialTextZoom() { return TextZoomNormal; }
1988 static float initialOutlineOffset() { return 0; }
1989 static float initialOpacity() { return 1.0f; }
1990 static EBoxAlignment initialBoxAlign() { return BSTRETCH; }
1991 static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; }
1992 static EBoxDirection initialBoxDirection() { return BNORMAL; }
1993 static EBoxLines initialBoxLines() { return SINGLE; }
1994 static EBoxOrient initialBoxOrient() { return HORIZONTAL; }
1995 static EBoxPack initialBoxPack() { return Start; }
1996 static float initialBoxFlex() { return 0.0f; }
1997 static unsigned int initialBoxFlexGroup() { return 1; }
1998 static unsigned int initialBoxOrdinalGroup() { return 1; }
1999 static EBoxSizing initialBoxSizing() { return CONTENT_BOX; }
2000 static StyleReflection* initialBoxReflect() { return 0; }
2001 static float initialFlexGrow() { return 0; }
2002 static float initialFlexShrink() { return 1; }
2003 static Length initialFlexBasis() { return Length(Auto); }
2004 static int initialOrder() { return 0; }
2005 static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPositionAuto, OverflowAlignmentDefault); }
2006 static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(isCSSGridLayoutEnabled() ? ItemPositionNormal : ItemPositionStretch, OverflowAlignmentDefault); }
2007 static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAlignmentDefault); }
2008 static EFlexDirection initialFlexDirection() { return FlowRow; }
2009 static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
2010 static int initialMarqueeLoopCount() { return -1; }
2011 static int initialMarqueeSpeed() { return 85; }
2012 static Length initialMarqueeIncrement() { return Length(6, Fixed); }
2013 static EMarqueeBehavior initialMarqueeBehavior() { return MSCROLL; }
2014 static EMarqueeDirection initialMarqueeDirection() { return MAUTO; }
2015 static EUserModify initialUserModify() { return READ_ONLY; }
2016 static EUserDrag initialUserDrag() { return DRAG_AUTO; }
2017 static EUserSelect initialUserSelect() { return SELECT_TEXT; }
2018 static TextOverflow initialTextOverflow() { return TextOverflowClip; }
2019 static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
2020 static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
2021 static EWordBreak initialWordBreak() { return NormalWordBreak; }
2022 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; }
2023 static ENBSPMode initialNBSPMode() { return NBNORMAL; }
2024 static LineBreak initialLineBreak() { return LineBreakAuto; }
2025 static ESpeak initialSpeak() { return SpeakNormal; }
2026 static Hyphens initialHyphens() { return HyphensManual; }
2027 static short initialHyphenationLimitBefore() { return -1; }
2028 static short initialHyphenationLimitAfter() { return -1; }
2029 static short initialHyphenationLimitLines() { return -1; }
2030 static const AtomicString& initialHyphenationString() { return nullAtom; }
2031 static EBorderFit initialBorderFit() { return BorderFitBorder; }
2032 static EResize initialResize() { return RESIZE_NONE; }
2033 static ControlPart initialAppearance() { return NoControlPart; }
2034 static AspectRatioType initialAspectRatioType() { return AspectRatioAuto; }
2035 static float initialAspectRatioDenominator() { return 1; }
2036 static float initialAspectRatioNumerator() { return 1; }
2037 static Order initialRTLOrdering() { return LogicalOrder; }
2038 static float initialTextStrokeWidth() { return 0; }
2039 static unsigned short initialColumnCount() { return 1; }
2040 static ColumnFill initialColumnFill() { return ColumnFillBalance; }
2041 static ColumnSpan initialColumnSpan() { return ColumnSpanNone; }
2042 static const TransformOperations& initialTransform() { static NeverDestroyed<TransformOperations> ops; return ops; }
2043 static Length initialTransformOriginX() { return Length(50.0f, Percent); }
2044 static Length initialTransformOriginY() { return Length(50.0f, Percent); }
2045 static EPointerEvents initialPointerEvents() { return PE_AUTO; }
2046 static float initialTransformOriginZ() { return 0; }
2047 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3DFlat; }
2048 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibilityVisible; }
2049 static float initialPerspective() { return 0; }
2050 static Length initialPerspectiveOriginX() { return Length(50.0f, Percent); }
2051 static Length initialPerspectiveOriginY() { return Length(50.0f, Percent); }
2052 static Color initialBackgroundColor() { return Color::transparent; }
2053 static Color initialTextEmphasisColor() { return TextEmphasisFillFilled; }
2054 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillFilled; }
2055 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkNone; }
2056 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom; }
2057 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmphasisPositionOver | TextEmphasisPositionRight; }
2058 static RubyPosition initialRubyPosition() { return RubyPositionBefore; }
2059 static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; }
2060 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; }
2061 static EImageRendering initialImageRendering() { return ImageRenderingAuto; }
2062 static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSpecified; }
2063 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionNoSnap; }
2064 static float initialImageResolution() { return 1; }
2065 static StyleImage* initialBorderImageSource() { return nullptr; }
2066 static StyleImage* initialMaskBoxImageSource() { return nullptr; }
2067 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustEconomy; }
2068 static QuotesData* initialQuotes() { return nullptr; }
2069 static const AtomicString& initialContentAltText() { return emptyAtom; }
2071 static bool isCSSGridLayoutEnabled();
2073 static WillChangeData* initialWillChange() { return nullptr; }
2075 #if ENABLE(TOUCH_EVENTS)
2076 static TouchAction initialTouchAction() { return TouchAction::Auto; }
2079 #if ENABLE(CSS_SCROLL_SNAP)
2080 static ScrollSnapType initialScrollSnapType() { return ScrollSnapType::None; }
2081 static ScrollSnapPoints* initialScrollSnapPointsX() { return nullptr; }
2082 static ScrollSnapPoints* initialScrollSnapPointsY() { return nullptr; }
2083 static LengthSize initialScrollSnapDestination();
2084 static Vector<LengthSize> initialScrollSnapCoordinates();
2087 #if ENABLE(CSS_TRAILING_WORD)
2088 static TrailingWord initialTrailingWord() { return TrailingWord::Auto; }
2091 #if ENABLE(APPLE_PAY)
2092 static ApplePayButtonStyle initialApplePayButtonStyle() { return ApplePayButtonStyle::Black; }
2093 static ApplePayButtonType initialApplePayButtonType() { return ApplePayButtonType::Plain; }
2096 #if ENABLE(CSS_GRID_LAYOUT)
2097 // The initial value is 'none' for grid tracks.
2098 static Vector<GridTrackSize> initialGridColumns() { return Vector<GridTrackSize>(); }
2099 static Vector<GridTrackSize> initialGridRows() { return Vector<GridTrackSize>(); }
2101 static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<GridTrackSize>(); }
2102 static unsigned initialGridAutoRepeatInsertionPoint() { return 0; }
2103 static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; }
2105 static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; }
2107 static Vector<GridTrackSize> initialGridAutoColumns() { return { GridTrackSize(Length(Auto)) }; }
2108 static Vector<GridTrackSize> initialGridAutoRows() { return { GridTrackSize(Length(Auto)) }; }
2110 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); }
2111 static size_t initialNamedGridAreaCount() { return 0; }
2113 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLinesMap(); }
2114 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesMap(); }
2116 static OrderedNamedGridLinesMap initialOrderedNamedGridColumnLines() { return OrderedNamedGridLinesMap(); }
2117 static OrderedNamedGridLinesMap initialOrderedNamedGridRowLines() { return OrderedNamedGridLinesMap(); }
2119 static Length initialGridColumnGap() { return Length(Fixed); }
2120 static Length initialGridRowGap() { return Length(Fixed); }
2122 // 'auto' is the default.
2123 static GridPosition initialGridItemColumnStart() { return GridPosition(); }
2124 static GridPosition initialGridItemColumnEnd() { return GridPosition(); }
2125 static GridPosition initialGridItemRowStart() { return GridPosition(); }
2126 static GridPosition initialGridItemRowEnd() { return GridPosition(); }
2127 #endif /* ENABLE(CSS_GRID_LAYOUT) */
2129 static unsigned initialTabSize() { return 8; }
2131 static const AtomicString& initialLineGrid() { return nullAtom; }
2132 static LineSnap initialLineSnap() { return LineSnapNone; }
2133 static LineAlign initialLineAlign() { return LineAlignNone; }
2135 static const AtomicString& initialFlowThread() { return nullAtom; }
2136 static const AtomicString& initialRegionThread() { return nullAtom; }
2137 static RegionFragment initialRegionFragment() { return AutoRegionFragment; }
2139 // Keep these at the end.
2140 static IntSize initialInitialLetter() { return IntSize(); }
2141 static LineClampValue initialLineClamp() { return LineClampValue(); }
2142 static ETextSecurity initialTextSecurity() { return TSNONE; }
2143 #if ENABLE(TEXT_AUTOSIZING)
2144 static TextSizeAdjustment initialTextSizeAdjust() { return TextSizeAdjustment(); }
2147 static bool initialTouchCalloutEnabled() { return true; }
2149 #if ENABLE(TOUCH_EVENTS)
2150 static Color initialTapHighlightColor();
2152 #if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
2153 static bool initialUseTouchOverflowScrolling() { return false; }
2155 #if ENABLE(DASHBOARD_SUPPORT)
2156 static const Vector<StyleDashboardRegion>& initialDashboardRegions();
2157 static const Vector<StyleDashboardRegion>& noneDashboardRegions();
2159 static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
2160 #if ENABLE(FILTERS_LEVEL_2)
2161 static const FilterOperations& initialBackdropFilter() { static NeverDestroyed<FilterOperations> ops; return ops; }
2163 #if ENABLE(CSS_COMPOSITING)
2164 static BlendMode initialBlendMode() { return BlendModeNormal; }
2165 static Isolation initialIsolation() { return IsolationAuto; }
2168 bool isPlaceholderStyle() const { return rareNonInheritedData->m_isPlaceholderStyle; }
2169 void setIsPlaceholderStyle() { SET_VAR(rareNonInheritedData, m_isPlaceholderStyle, true); }
2171 static ptrdiff_t noninheritedFlagsMemoryOffset() { return OBJECT_OFFSETOF(RenderStyle, noninherited_flags); }
2174 bool changeAffectsVisualOverflow(const RenderStyle&) const;
2175 bool changeRequiresLayout(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2176 bool changeRequiresPositionedLayoutOnly(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2177 bool changeRequiresLayerRepaint(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2178 bool changeRequiresRepaint(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2179 bool changeRequiresRepaintIfTextOrBorderOrOutline(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2180 bool changeRequiresRecompositeLayer(const RenderStyle&, unsigned& changedContextSensitiveProperties) const;
2182 void setVisitedLinkColor(const Color&);
2183 void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBackgroundColor, v); }
2184 void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderLeftColor, v); }
2185 void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderRightColor, v); }
2186 void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderBottomColor, v); }
2187 void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkBorderTopColor, v); }
2188 void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkOutlineColor, v); }
2189 void setVisitedLinkColumnRuleColor(const Color& v) { SET_NESTED_VAR(rareNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); }
2190 void setVisitedLinkTextDecorationColor(const Color& v) { SET_VAR(rareNonInheritedData, m_visitedLinkTextDecorationColor, v); }
2191 void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextEmphasisColor, v); }
2192 void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextFillColor, v); }
2193 void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(rareInheritedData, visitedLinkTextStrokeColor, v); }
2195 void inheritUnicodeBidiFrom(const RenderStyle* parent) { noninherited_flags.setUnicodeBidi(parent->noninherited_flags.unicodeBidi()); }
2196 void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const;
2197 LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const;
2198 void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const;
2199 void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const;
2200 void getShadowInlineDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const
2202 return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight);
2204 void getShadowBlockDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const
2206 return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom);
2209 bool isDisplayReplacedType(EDisplay display) const
2211 return display == INLINE_BLOCK || display == INLINE_BOX || display == INLINE_FLEX
2212 #if ENABLE(CSS_GRID_LAYOUT)
2213 || display == INLINE_GRID
2215 || display == INLINE_TABLE;
2218 bool isDisplayInlineType(EDisplay display) const
2220 return display == INLINE || isDisplayReplacedType(display);
2223 bool isDisplayFlexibleBox(EDisplay display) const
2225 return display == FLEX || display == INLINE_FLEX;
2228 bool isDisplayGridBox(EDisplay display) const
2230 #if ENABLE(CSS_GRID_LAYOUT)
2231 return display == GRID || display == INLINE_GRID;
2233 UNUSED_PARAM(display);
2238 bool isDisplayFlexibleOrGridBox(EDisplay display) const
2240 return isDisplayFlexibleBox(display) || isDisplayGridBox(display);
2243 // Color accessors are all private to make sure callers use visitedDependentColor instead to access them.
2244 static Color invalidColor() { return Color(); }
2245 const Color& borderLeftColor() const { return surround->border.left().color(); }
2246 const Color& borderRightColor() const { return surround->border.right().color(); }
2247 const Color& borderTopColor() const { return surround->border.top().color(); }
2248 const Color& borderBottomColor() const { return surround->border.bottom().color(); }
2249 const Color& backgroundColor() const { return m_background->color(); }
2250 const Color& color() const;
2251 const Color& columnRuleColor() const { return rareNonInheritedData->m_multiCol->m_rule.color(); }
2252 const Color& outlineColor() const { return m_background->outline().color(); }
2253 const Color& textEmphasisColor() const { return rareInheritedData->textEmphasisColor; }
2254 const Color& textFillColor() const { return rareInheritedData->textFillColor; }
2255 const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; }
2256 const Color& visitedLinkColor() const;
2257 const Color& visitedLinkBackgroundColor() const { return rareNonInheritedData->m_visitedLinkBackgroundColor; }
2258 const Color& visitedLinkBorderLeftColor() const { return rareNonInheritedData->m_visitedLinkBorderLeftColor; }
2259 const Color& visitedLinkBorderRightColor() const { return rareNonInheritedData->m_visitedLinkBorderRightColor; }
2260 const Color& visitedLinkBorderBottomColor() const { return rareNonInheritedData->m_visitedLinkBorderBottomColor; }
2261 const Color& visitedLinkBorderTopColor() const { return rareNonInheritedData->m_visitedLinkBorderTopColor; }
2262 const Color& visitedLinkOutlineColor() const { return rareNonInheritedData->m_visitedLinkOutlineColor; }
2263 const Color& visitedLinkColumnRuleColor() const { return rareNonInheritedData->m_multiCol->m_visitedLinkColumnRuleColor; }
2264 const Color& textDecorationColor() const { return rareNonInheritedData->m_textDecorationColor; }
2265 const Color& visitedLinkTextDecorationColor() const { return rareNonInheritedData->m_visitedLinkTextDecorationColor; }
2266 const Color& visitedLinkTextEmphasisColor() const { return rareInheritedData->visitedLinkTextEmphasisColor; }
2267 const Color& visitedLinkTextFillColor() const { return rareInheritedData->visitedLinkTextFillColor; }
2268 const Color& visitedLinkTextStrokeColor() const { return rareInheritedData->visitedLinkTextStrokeColor; }
2270 Color colorIncludingFallback(int colorProperty, bool visitedLink) const;
2272 const Color& stopColor() const { return svgStyle().stopColor(); }
2273 const Color& floodColor() const { return svgStyle().floodColor(); }
2274 const Color& lightingColor() const { return svgStyle().lightingColor(); }
2276 void appendContent(std::unique_ptr<ContentData>);
2279 inline int adjustForAbsoluteZoom(int value, const RenderStyle& style)
2281 double zoomFactor = style.effectiveZoom();
2282 if (zoomFactor == 1)
2284 // Needed because computeLengthInt truncates (rather than rounds) when scaling up.
2285 if (zoomFactor > 1) {
2292 return roundForImpreciseConversion<int>(value / zoomFactor);
2295 inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle& style)
2297 return value / style.effectiveZoom();
2300 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, const RenderStyle& style)
2302 return value / style.effectiveZoom();
2305 inline EBorderStyle collapsedBorderStyle(EBorderStyle style)
2307 if (style == OUTSET)
2314 inline bool RenderStyle::setZoom(float f)
2316 setEffectiveZoom(effectiveZoom() * f);
2317 if (compareEqual(visual->m_zoom, f))
2319 visual.access()->m_zoom = f;
2323 inline bool RenderStyle::setEffectiveZoom(float f)
2325 if (compareEqual(rareInheritedData->m_effectiveZoom, f))
2327 rareInheritedData.access()->m_effectiveZoom = f;
2331 inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation)
2333 if (compareEqual(rareInheritedData->m_textOrientation, static_cast<unsigned>(textOrientation)))
2336 rareInheritedData.access()->m_textOrientation = static_cast<unsigned>(textOrientation);
2340 inline bool RenderStyle::hasAnyPublicPseudoStyles() const
2342 return noninherited_flags.hasAnyPublicPseudoStyles();
2345 inline bool RenderStyle::hasPseudoStyle(PseudoId pseudo) const
2347 return noninherited_flags.hasPseudoStyle(pseudo);
2350 inline void RenderStyle::setHasPseudoStyle(PseudoId pseudo)
2352 noninherited_flags.setHasPseudoStyle(pseudo);
2355 inline void RenderStyle::setHasPseudoStyles(PseudoIdSet pseudoIdSet)
2357 noninherited_flags.setHasPseudoStyles(pseudoIdSet);
2360 inline bool pseudoElementRendererIsNeeded(const RenderStyle* style)
2362 return style && style->display() != NONE && (style->contentData() || style->hasFlowFrom());
2365 } // namespace WebCore