1 | /* |
2 | * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 | * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 | * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 | * Copyright (C) 2003-2017 Apple Inc. All rights reserved. |
6 | * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 | * |
8 | * This library is free software; you can redistribute it and/or |
9 | * modify it under the terms of the GNU Library General Public |
10 | * License as published by the Free Software Foundation; either |
11 | * version 2 of the License, or (at your option) any later version. |
12 | * |
13 | * This library is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 | * Library General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU Library General Public License |
19 | * along with this library; see the file COPYING.LIB. If not, write to |
20 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 | * Boston, MA 02110-1301, USA. |
22 | * |
23 | */ |
24 | |
25 | #pragma once |
26 | |
27 | #include "AnimationList.h" |
28 | #include "BorderValue.h" |
29 | #include "CSSLineBoxContainValue.h" |
30 | #include "CSSPrimitiveValue.h" |
31 | #include "CSSPropertyNames.h" |
32 | #include "Color.h" |
33 | #include "CounterDirectives.h" |
34 | #include "DataRef.h" |
35 | #include "FilterOperations.h" |
36 | #include "FontCascadeDescription.h" |
37 | #include "GapLength.h" |
38 | #include "GraphicsTypes.h" |
39 | #include "Length.h" |
40 | #include "LengthBox.h" |
41 | #include "LengthFunctions.h" |
42 | #include "LengthPoint.h" |
43 | #include "LengthSize.h" |
44 | #include "LineClampValue.h" |
45 | #include "NinePieceImage.h" |
46 | #include "Pagination.h" |
47 | #include "RenderStyleConstants.h" |
48 | #include "RoundedRect.h" |
49 | #include "SVGRenderStyle.h" |
50 | #include "ShadowData.h" |
51 | #include "ShapeValue.h" |
52 | #include "StyleBackgroundData.h" |
53 | #include "StyleBoxData.h" |
54 | #include "StyleDeprecatedFlexibleBoxData.h" |
55 | #include "StyleFilterData.h" |
56 | #include "StyleFlexibleBoxData.h" |
57 | #include "StyleMarqueeData.h" |
58 | #include "StyleMultiColData.h" |
59 | #include "StyleRareInheritedData.h" |
60 | #include "StyleRareNonInheritedData.h" |
61 | #include "StyleReflection.h" |
62 | #include "StyleSurroundData.h" |
63 | #include "StyleTransformData.h" |
64 | #include "StyleVisualData.h" |
65 | #include "TextFlags.h" |
66 | #include "ThemeTypes.h" |
67 | #include "TouchAction.h" |
68 | #include "TransformOperations.h" |
69 | #include "UnicodeBidi.h" |
70 | #include <memory> |
71 | #include <wtf/Forward.h> |
72 | #include <wtf/NeverDestroyed.h> |
73 | #include <wtf/OptionSet.h> |
74 | #include <wtf/StdLibExtras.h> |
75 | #include <wtf/Vector.h> |
76 | |
77 | #include "StyleGridData.h" |
78 | #include "StyleGridItemData.h" |
79 | |
80 | #if ENABLE(DASHBOARD_SUPPORT) |
81 | #include "StyleDashboardRegion.h" |
82 | #endif |
83 | |
84 | #if ENABLE(TEXT_AUTOSIZING) |
85 | #include "TextSizeAdjustment.h" |
86 | #endif |
87 | |
88 | #if ENABLE(DARK_MODE_CSS) |
89 | #include "StyleColorScheme.h" |
90 | #endif |
91 | |
92 | #define SET_VAR(group, variable, value) do { \ |
93 | if (!compareEqual(group->variable, value)) \ |
94 | group.access().variable = value; \ |
95 | } while (0) |
96 | |
97 | #define SET_NESTED_VAR(group, parentVariable, variable, value) do { \ |
98 | if (!compareEqual(group->parentVariable->variable, value)) \ |
99 | group.access().parentVariable.access().variable = value; \ |
100 | } while (0) |
101 | |
102 | #define SET_BORDERVALUE_COLOR(group, variable, value) do { \ |
103 | if (!compareEqual(group->variable.color(), value)) \ |
104 | group.access().variable.setColor(value); \ |
105 | } while (0) |
106 | |
107 | namespace WebCore { |
108 | |
109 | class BorderData; |
110 | class ContentData; |
111 | class CounterContent; |
112 | class CursorList; |
113 | class FontCascade; |
114 | class FontMetrics; |
115 | class IntRect; |
116 | class Pair; |
117 | class ShadowData; |
118 | class StyleImage; |
119 | class StyleInheritedData; |
120 | class StyleResolver; |
121 | class StyleScrollSnapArea; |
122 | class StyleScrollSnapPort; |
123 | class TransformationMatrix; |
124 | |
125 | struct ScrollSnapAlign; |
126 | struct ScrollSnapType; |
127 | |
128 | using PseudoStyleCache = Vector<std::unique_ptr<RenderStyle>, 4>; |
129 | |
130 | template<typename T, typename U> inline bool compareEqual(const T& t, const U& u) { return t == static_cast<const T&>(u); } |
131 | |
132 | class RenderStyle { |
133 | WTF_MAKE_FAST_ALLOCATED; |
134 | |
135 | private: |
136 | enum CloneTag { Clone }; |
137 | enum CreateDefaultStyleTag { CreateDefaultStyle }; |
138 | |
139 | public: |
140 | RenderStyle(RenderStyle&&); |
141 | RenderStyle& operator=(RenderStyle&&); |
142 | ~RenderStyle(); |
143 | |
144 | RenderStyle replace(RenderStyle&&) WARN_UNUSED_RETURN; |
145 | |
146 | explicit RenderStyle(CreateDefaultStyleTag); |
147 | RenderStyle(const RenderStyle&, CloneTag); |
148 | |
149 | static RenderStyle& defaultStyle(); |
150 | |
151 | static RenderStyle create(); |
152 | static std::unique_ptr<RenderStyle> createPtr(); |
153 | |
154 | static RenderStyle clone(const RenderStyle&); |
155 | static std::unique_ptr<RenderStyle> clonePtr(const RenderStyle&); |
156 | |
157 | static RenderStyle createAnonymousStyleWithDisplay(const RenderStyle& parentStyle, DisplayType); |
158 | static RenderStyle createStyleInheritingFromPseudoStyle(const RenderStyle& pseudoStyle); |
159 | |
160 | #if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS) |
161 | bool deletionHasBegun() const { return m_deletionHasBegun; } |
162 | #endif |
163 | |
164 | bool operator==(const RenderStyle&) const; |
165 | bool operator!=(const RenderStyle& other) const { return !(*this == other); } |
166 | |
167 | void inheritFrom(const RenderStyle& inheritParent); |
168 | void copyNonInheritedFrom(const RenderStyle&); |
169 | void copyContentFrom(const RenderStyle&); |
170 | |
171 | ContentPosition resolvedJustifyContentPosition(const StyleContentAlignmentData& normalValueBehavior) const; |
172 | ContentDistribution resolvedJustifyContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const; |
173 | ContentPosition resolvedAlignContentPosition(const StyleContentAlignmentData& normalValueBehavior) const; |
174 | ContentDistribution resolvedAlignContentDistribution(const StyleContentAlignmentData& normalValueBehavior) const; |
175 | StyleSelfAlignmentData resolvedAlignItems(ItemPosition normalValueBehaviour) const; |
176 | StyleSelfAlignmentData resolvedAlignSelf(const RenderStyle* parentStyle, ItemPosition normalValueBehaviour) const; |
177 | StyleContentAlignmentData resolvedAlignContent(const StyleContentAlignmentData& normalValueBehaviour) const; |
178 | StyleSelfAlignmentData resolvedJustifyItems(ItemPosition normalValueBehaviour) const; |
179 | StyleSelfAlignmentData resolvedJustifySelf(const RenderStyle* parentStyle, ItemPosition normalValueBehaviour) const; |
180 | StyleContentAlignmentData resolvedJustifyContent(const StyleContentAlignmentData& normalValueBehaviour) const; |
181 | |
182 | PseudoId styleType() const { return static_cast<PseudoId>(m_nonInheritedFlags.styleType); } |
183 | void setStyleType(PseudoId styleType) { m_nonInheritedFlags.styleType = static_cast<unsigned>(styleType); } |
184 | |
185 | RenderStyle* getCachedPseudoStyle(PseudoId) const; |
186 | RenderStyle* addCachedPseudoStyle(std::unique_ptr<RenderStyle>); |
187 | void removeCachedPseudoStyle(PseudoId); |
188 | |
189 | const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoStyles.get(); } |
190 | |
191 | const CustomPropertyValueMap& inheritedCustomProperties() const { return m_rareInheritedData->customProperties->values; } |
192 | const CustomPropertyValueMap& nonInheritedCustomProperties() const { return m_rareNonInheritedData->customProperties->values; } |
193 | const CSSCustomPropertyValue* getCustomProperty(const AtomicString&) const; |
194 | void setInheritedCustomPropertyValue(const AtomicString& name, Ref<CSSCustomPropertyValue>&& value) { return m_rareInheritedData.access().customProperties.access().setCustomPropertyValue(name, WTFMove(value)); } |
195 | void setNonInheritedCustomPropertyValue(const AtomicString& name, Ref<CSSCustomPropertyValue>&& value) { return m_rareNonInheritedData.access().customProperties.access().setCustomPropertyValue(name, WTFMove(value)); } |
196 | |
197 | void setHasViewportUnits(bool v = true) { m_nonInheritedFlags.hasViewportUnits = v; } |
198 | bool hasViewportUnits() const { return m_nonInheritedFlags.hasViewportUnits; } |
199 | |
200 | bool affectedByHover() const { return m_nonInheritedFlags.affectedByHover; } |
201 | bool affectedByActive() const { return m_nonInheritedFlags.affectedByActive; } |
202 | bool affectedByDrag() const { return m_nonInheritedFlags.affectedByDrag; } |
203 | |
204 | void setAffectedByHover() { m_nonInheritedFlags.affectedByHover = true; } |
205 | void setAffectedByActive() { m_nonInheritedFlags.affectedByActive = true; } |
206 | void setAffectedByDrag() { m_nonInheritedFlags.affectedByDrag = true; } |
207 | |
208 | void setColumnStylesFromPaginationMode(const Pagination::Mode&); |
209 | |
210 | bool isFloating() const { return static_cast<Float>(m_nonInheritedFlags.floating) != Float::No; } |
211 | bool hasMargin() const { return !m_surroundData->margin.isZero(); } |
212 | bool hasBorder() const { return m_surroundData->border.hasBorder(); } |
213 | bool hasBorderFill() const { return m_surroundData->border.hasFill(); } |
214 | bool hasVisibleBorderDecoration() const { return hasVisibleBorder() || hasBorderFill(); } |
215 | bool hasVisibleBorder() const { return m_surroundData->border.hasVisibleBorder(); } |
216 | bool hasPadding() const { return !m_surroundData->padding.isZero(); } |
217 | bool hasOffset() const { return !m_surroundData->offset.isZero(); } |
218 | bool hasMarginBeforeQuirk() const { return marginBefore().hasQuirk(); } |
219 | bool hasMarginAfterQuirk() const { return marginAfter().hasQuirk(); } |
220 | |
221 | bool hasBackgroundImage() const { return m_backgroundData->background.hasImage(); } |
222 | bool hasFixedBackgroundImage() const { return m_backgroundData->background.hasFixedImage(); } |
223 | |
224 | bool hasEntirelyFixedBackground() const; |
225 | |
226 | bool hasAppearance() const { return appearance() != NoControlPart; } |
227 | |
228 | bool hasBackground() const; |
229 | |
230 | LayoutBoxExtent imageOutsets(const NinePieceImage&) const; |
231 | bool hasBorderImageOutsets() const { return borderImage().hasImage() && !borderImage().outset().isZero(); } |
232 | LayoutBoxExtent borderImageOutsets() const { return imageOutsets(borderImage()); } |
233 | |
234 | LayoutBoxExtent maskBoxImageOutsets() const { return imageOutsets(maskBoxImage()); } |
235 | |
236 | bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets(); } |
237 | FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets() : FilterOutsets(); } |
238 | |
239 | Order rtlOrdering() const { return static_cast<Order>(m_inheritedFlags.rtlOrdering); } |
240 | void setRTLOrdering(Order ordering) { m_inheritedFlags.rtlOrdering = static_cast<unsigned>(ordering); } |
241 | |
242 | bool isStyleAvailable() const; |
243 | |
244 | bool hasAnyPublicPseudoStyles() const; |
245 | bool hasPseudoStyle(PseudoId) const; |
246 | void setHasPseudoStyle(PseudoId); |
247 | void setHasPseudoStyles(PseudoIdSet); |
248 | bool hasUniquePseudoStyle() const; |
249 | |
250 | // attribute getter methods |
251 | |
252 | DisplayType display() const { return static_cast<DisplayType>(m_nonInheritedFlags.effectiveDisplay); } |
253 | |
254 | const Length& left() const { return m_surroundData->offset.left(); } |
255 | const Length& right() const { return m_surroundData->offset.right(); } |
256 | const Length& top() const { return m_surroundData->offset.top(); } |
257 | const Length& bottom() const { return m_surroundData->offset.bottom(); } |
258 | |
259 | // Accessors for positioned object edges that take into account writing mode. |
260 | const Length& logicalLeft() const { return m_surroundData->offset.start(writingMode()); } |
261 | const Length& logicalRight() const { return m_surroundData->offset.end(writingMode()); } |
262 | const Length& logicalTop() const { return m_surroundData->offset.before(writingMode()); } |
263 | const Length& logicalBottom() const { return m_surroundData->offset.after(writingMode()); } |
264 | |
265 | // Whether or not a positioned element requires normal flow x/y to be computed to determine its position. |
266 | bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? hasAutoLeftAndRight() : hasAutoTopAndBottom(); } |
267 | bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? hasAutoTopAndBottom() : hasAutoLeftAndRight(); } |
268 | |
269 | PositionType position() const { return static_cast<PositionType>(m_nonInheritedFlags.position); } |
270 | bool hasOutOfFlowPosition() const { return position() == PositionType::Absolute || position() == PositionType::Fixed; } |
271 | bool hasInFlowPosition() const { return position() == PositionType::Relative || position() == PositionType::Sticky; } |
272 | bool hasViewportConstrainedPosition() const { return position() == PositionType::Fixed || position() == PositionType::Sticky; } |
273 | Float floating() const { return static_cast<Float>(m_nonInheritedFlags.floating); } |
274 | |
275 | const Length& width() const { return m_boxData->width(); } |
276 | const Length& height() const { return m_boxData->height(); } |
277 | const Length& minWidth() const { return m_boxData->minWidth(); } |
278 | const Length& maxWidth() const { return m_boxData->maxWidth(); } |
279 | const Length& minHeight() const { return m_boxData->minHeight(); } |
280 | const Length& maxHeight() const { return m_boxData->maxHeight(); } |
281 | |
282 | const Length& logicalWidth() const { return isHorizontalWritingMode() ? width() : height(); } |
283 | const Length& logicalHeight() const { return isHorizontalWritingMode() ? height() : width(); } |
284 | const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? minWidth() : minHeight(); } |
285 | const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? maxWidth() : maxHeight(); } |
286 | const Length& logicalMinHeight() const { return isHorizontalWritingMode() ? minHeight() : minWidth(); } |
287 | const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ? maxHeight() : maxWidth(); } |
288 | |
289 | const BorderData& border() const { return m_surroundData->border; } |
290 | const BorderValue& borderLeft() const { return m_surroundData->border.left(); } |
291 | const BorderValue& borderRight() const { return m_surroundData->border.right(); } |
292 | const BorderValue& borderTop() const { return m_surroundData->border.top(); } |
293 | const BorderValue& borderBottom() const { return m_surroundData->border.bottom(); } |
294 | |
295 | const BorderValue& borderBefore() const; |
296 | const BorderValue& borderAfter() const; |
297 | const BorderValue& borderStart() const; |
298 | const BorderValue& borderEnd() const; |
299 | |
300 | const NinePieceImage& borderImage() const { return m_surroundData->border.image(); } |
301 | StyleImage* borderImageSource() const { return m_surroundData->border.image().image(); } |
302 | const LengthBox& borderImageSlices() const { return m_surroundData->border.image().imageSlices(); } |
303 | const LengthBox& borderImageWidth() const { return m_surroundData->border.image().borderSlices(); } |
304 | const LengthBox& borderImageOutset() const { return m_surroundData->border.image().outset(); } |
305 | |
306 | const LengthSize& borderTopLeftRadius() const { return m_surroundData->border.topLeft(); } |
307 | const LengthSize& borderTopRightRadius() const { return m_surroundData->border.topRight(); } |
308 | const LengthSize& borderBottomLeftRadius() const { return m_surroundData->border.bottomLeft(); } |
309 | const LengthSize& borderBottomRightRadius() const { return m_surroundData->border.bottomRight(); } |
310 | bool hasBorderRadius() const { return m_surroundData->border.hasBorderRadius(); } |
311 | |
312 | float borderLeftWidth() const { return m_surroundData->border.borderLeftWidth(); } |
313 | BorderStyle borderLeftStyle() const { return m_surroundData->border.left().style(); } |
314 | bool borderLeftIsTransparent() const { return m_surroundData->border.left().isTransparent(); } |
315 | float borderRightWidth() const { return m_surroundData->border.borderRightWidth(); } |
316 | BorderStyle borderRightStyle() const { return m_surroundData->border.right().style(); } |
317 | bool borderRightIsTransparent() const { return m_surroundData->border.right().isTransparent(); } |
318 | float borderTopWidth() const { return m_surroundData->border.borderTopWidth(); } |
319 | BorderStyle borderTopStyle() const { return m_surroundData->border.top().style(); } |
320 | bool borderTopIsTransparent() const { return m_surroundData->border.top().isTransparent(); } |
321 | float borderBottomWidth() const { return m_surroundData->border.borderBottomWidth(); } |
322 | BorderStyle borderBottomStyle() const { return m_surroundData->border.bottom().style(); } |
323 | bool borderBottomIsTransparent() const { return m_surroundData->border.bottom().isTransparent(); } |
324 | FloatBoxExtent borderWidth() const { return m_surroundData->border.borderWidth(); } |
325 | |
326 | float borderBeforeWidth() const; |
327 | float borderAfterWidth() const; |
328 | float borderStartWidth() const; |
329 | float borderEndWidth() const; |
330 | |
331 | float outlineSize() const { return std::max<float>(0, outlineWidth() + outlineOffset()); } |
332 | float outlineWidth() const; |
333 | bool hasOutline() const { return outlineStyle() > BorderStyle::Hidden && outlineWidth() > 0; } |
334 | BorderStyle outlineStyle() const { return m_backgroundData->outline.style(); } |
335 | OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>(m_backgroundData->outline.isAuto()); } |
336 | bool hasOutlineInVisualOverflow() const { return hasOutline() && outlineSize() > 0; } |
337 | |
338 | Overflow overflowX() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowX); } |
339 | Overflow overflowY() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowY); } |
340 | Overflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); } |
341 | Overflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); } |
342 | bool isOverflowVisible() const { return overflowX() == Overflow::Visible || overflowY() == Overflow::Visible; } |
343 | |
344 | Visibility visibility() const { return static_cast<Visibility>(m_inheritedFlags.visibility); } |
345 | VerticalAlign verticalAlign() const { return static_cast<VerticalAlign>(m_nonInheritedFlags.verticalAlign); } |
346 | const Length& verticalAlignLength() const { return m_boxData->verticalAlign(); } |
347 | |
348 | const Length& clipLeft() const { return m_visualData->clip.left(); } |
349 | const Length& clipRight() const { return m_visualData->clip.right(); } |
350 | const Length& clipTop() const { return m_visualData->clip.top(); } |
351 | const Length& clipBottom() const { return m_visualData->clip.bottom(); } |
352 | const LengthBox& clip() const { return m_visualData->clip; } |
353 | bool hasClip() const { return m_visualData->hasClip; } |
354 | |
355 | EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(m_nonInheritedFlags.unicodeBidi); } |
356 | |
357 | Clear clear() const { return static_cast<Clear>(m_nonInheritedFlags.clear); } |
358 | TableLayoutType tableLayout() const { return static_cast<TableLayoutType>(m_nonInheritedFlags.tableLayout); } |
359 | |
360 | WEBCORE_EXPORT const FontCascade& fontCascade() const; |
361 | WEBCORE_EXPORT const FontMetrics& fontMetrics() const; |
362 | WEBCORE_EXPORT const FontCascadeDescription& fontDescription() const; |
363 | float specifiedFontSize() const; |
364 | float computedFontSize() const; |
365 | unsigned computedFontPixelSize() const; |
366 | std::pair<FontOrientation, NonCJKGlyphOrientation> fontAndGlyphOrientation(); |
367 | |
368 | #if ENABLE(VARIATION_FONTS) |
369 | FontVariationSettings fontVariationSettings() const { return fontDescription().variationSettings(); } |
370 | #endif |
371 | FontSelectionValue fontWeight() const { return fontDescription().weight(); } |
372 | FontSelectionValue fontStretch() const { return fontDescription().stretch(); } |
373 | Optional<FontSelectionValue> fontItalic() const { return fontDescription().italic(); } |
374 | |
375 | const Length& textIndent() const { return m_rareInheritedData->indent; } |
376 | TextAlignMode textAlign() const { return static_cast<TextAlignMode>(m_inheritedFlags.textAlign); } |
377 | TextTransform textTransform() const { return static_cast<TextTransform>(m_inheritedFlags.textTransform); } |
378 | OptionSet<TextDecoration> textDecorationsInEffect() const { return OptionSet<TextDecoration>::fromRaw(m_inheritedFlags.textDecorations); } |
379 | OptionSet<TextDecoration> textDecoration() const { return OptionSet<TextDecoration>::fromRaw(m_visualData->textDecoration); } |
380 | TextDecorationStyle textDecorationStyle() const { return static_cast<TextDecorationStyle>(m_rareNonInheritedData->textDecorationStyle); } |
381 | OptionSet<TextDecorationSkip> textDecorationSkip() const { return OptionSet<TextDecorationSkip>::fromRaw(m_rareInheritedData->textDecorationSkip); } |
382 | TextUnderlinePosition textUnderlinePosition() const { return static_cast<TextUnderlinePosition>(m_rareInheritedData->textUnderlinePosition); } |
383 | TextUnderlineOffset textUnderlineOffset() const { return m_rareInheritedData->textUnderlineOffset; } |
384 | TextDecorationThickness textDecorationThickness() const { return m_rareInheritedData->textDecorationThickness; } |
385 | |
386 | #if ENABLE(CSS3_TEXT) |
387 | TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(m_rareInheritedData->textIndentLine); } |
388 | TextIndentType textIndentType() const { return static_cast<TextIndentType>(m_rareInheritedData->textIndentType); } |
389 | TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(m_rareInheritedData->textAlignLast); } |
390 | TextJustify textJustify() const { return static_cast<TextJustify>(m_rareInheritedData->textJustify); } |
391 | #endif |
392 | |
393 | const Length& wordSpacing() const; |
394 | float letterSpacing() const; |
395 | |
396 | float zoom() const { return m_visualData->zoom; } |
397 | float effectiveZoom() const { return m_rareInheritedData->effectiveZoom; } |
398 | |
399 | TextZoom textZoom() const { return static_cast<TextZoom>(m_rareInheritedData->textZoom); } |
400 | |
401 | TextDirection direction() const { return static_cast<TextDirection>(m_inheritedFlags.direction); } |
402 | bool isLeftToRightDirection() const { return direction() == TextDirection::LTR; } |
403 | bool hasExplicitlySetDirection() const { return m_nonInheritedFlags.hasExplicitlySetDirection; } |
404 | |
405 | const Length& specifiedLineHeight() const; |
406 | WEBCORE_EXPORT const Length& lineHeight() const; |
407 | WEBCORE_EXPORT int computedLineHeight() const; |
408 | |
409 | WhiteSpace whiteSpace() const { return static_cast<WhiteSpace>(m_inheritedFlags.whiteSpace); } |
410 | static bool autoWrap(WhiteSpace); |
411 | bool autoWrap() const { return autoWrap(whiteSpace()); } |
412 | static bool preserveNewline(WhiteSpace); |
413 | bool preserveNewline() const { return preserveNewline(whiteSpace()); } |
414 | static bool collapseWhiteSpace(WhiteSpace); |
415 | bool collapseWhiteSpace() const { return collapseWhiteSpace(whiteSpace()); } |
416 | bool isCollapsibleWhiteSpace(UChar) const; |
417 | bool breakOnlyAfterWhiteSpace() const; |
418 | bool breakWords() const; |
419 | |
420 | FillRepeat backgroundRepeatX() const { return static_cast<FillRepeat>(m_backgroundData->background.repeatX()); } |
421 | FillRepeat backgroundRepeatY() const { return static_cast<FillRepeat>(m_backgroundData->background.repeatY()); } |
422 | CompositeOperator backgroundComposite() const { return static_cast<CompositeOperator>(m_backgroundData->background.composite()); } |
423 | FillAttachment backgroundAttachment() const { return static_cast<FillAttachment>(m_backgroundData->background.attachment()); } |
424 | FillBox backgroundClip() const { return static_cast<FillBox>(m_backgroundData->background.clip()); } |
425 | FillBox backgroundOrigin() const { return static_cast<FillBox>(m_backgroundData->background.origin()); } |
426 | const Length& backgroundXPosition() const { return m_backgroundData->background.xPosition(); } |
427 | const Length& backgroundYPosition() const { return m_backgroundData->background.yPosition(); } |
428 | FillSizeType backgroundSizeType() const { return m_backgroundData->background.sizeType(); } |
429 | const LengthSize& backgroundSizeLength() const { return m_backgroundData->background.sizeLength(); } |
430 | FillLayer& ensureBackgroundLayers() { return m_backgroundData.access().background; } |
431 | const FillLayer& backgroundLayers() const { return m_backgroundData->background; } |
432 | |
433 | StyleImage* maskImage() const { return m_rareNonInheritedData->mask.image(); } |
434 | FillRepeat maskRepeatX() const { return static_cast<FillRepeat>(m_rareNonInheritedData->mask.repeatX()); } |
435 | FillRepeat maskRepeatY() const { return static_cast<FillRepeat>(m_rareNonInheritedData->mask.repeatY()); } |
436 | CompositeOperator maskComposite() const { return static_cast<CompositeOperator>(m_rareNonInheritedData->mask.composite()); } |
437 | FillBox maskClip() const { return static_cast<FillBox>(m_rareNonInheritedData->mask.clip()); } |
438 | FillBox maskOrigin() const { return static_cast<FillBox>(m_rareNonInheritedData->mask.origin()); } |
439 | const Length& maskXPosition() const { return m_rareNonInheritedData->mask.xPosition(); } |
440 | const Length& maskYPosition() const { return m_rareNonInheritedData->mask.yPosition(); } |
441 | FillSizeType maskSizeType() const { return m_rareNonInheritedData->mask.sizeType(); } |
442 | const LengthSize& maskSizeLength() const { return m_rareNonInheritedData->mask.sizeLength(); } |
443 | FillLayer& ensureMaskLayers() { return m_rareNonInheritedData.access().mask; } |
444 | const FillLayer& maskLayers() const { return m_rareNonInheritedData->mask; } |
445 | const NinePieceImage& maskBoxImage() const { return m_rareNonInheritedData->maskBoxImage; } |
446 | StyleImage* maskBoxImageSource() const { return m_rareNonInheritedData->maskBoxImage.image(); } |
447 | |
448 | BorderCollapse borderCollapse() const { return static_cast<BorderCollapse>(m_inheritedFlags.borderCollapse); } |
449 | float horizontalBorderSpacing() const; |
450 | float verticalBorderSpacing() const; |
451 | EmptyCell emptyCells() const { return static_cast<EmptyCell>(m_inheritedFlags.emptyCells); } |
452 | CaptionSide captionSide() const { return static_cast<CaptionSide>(m_inheritedFlags.captionSide); } |
453 | |
454 | ListStyleType listStyleType() const { return static_cast<ListStyleType>(m_inheritedFlags.listStyleType); } |
455 | StyleImage* listStyleImage() const; |
456 | ListStylePosition listStylePosition() const { return static_cast<ListStylePosition>(m_inheritedFlags.listStylePosition); } |
457 | |
458 | const Length& marginTop() const { return m_surroundData->margin.top(); } |
459 | const Length& marginBottom() const { return m_surroundData->margin.bottom(); } |
460 | const Length& marginLeft() const { return m_surroundData->margin.left(); } |
461 | const Length& marginRight() const { return m_surroundData->margin.right(); } |
462 | const Length& marginBefore() const { return m_surroundData->margin.before(writingMode()); } |
463 | const Length& marginAfter() const { return m_surroundData->margin.after(writingMode()); } |
464 | const Length& marginStart() const { return m_surroundData->margin.start(writingMode(), direction()); } |
465 | const Length& marginEnd() const { return m_surroundData->margin.end(writingMode(), direction()); } |
466 | const Length& marginStartUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.start(otherStyle->writingMode(), otherStyle->direction()); } |
467 | const Length& marginEndUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.end(otherStyle->writingMode(), otherStyle->direction()); } |
468 | const Length& marginBeforeUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.before(otherStyle->writingMode()); } |
469 | const Length& marginAfterUsing(const RenderStyle* otherStyle) const { return m_surroundData->margin.after(otherStyle->writingMode()); } |
470 | |
471 | const LengthBox& paddingBox() const { return m_surroundData->padding; } |
472 | const Length& paddingTop() const { return m_surroundData->padding.top(); } |
473 | const Length& paddingBottom() const { return m_surroundData->padding.bottom(); } |
474 | const Length& paddingLeft() const { return m_surroundData->padding.left(); } |
475 | const Length& paddingRight() const { return m_surroundData->padding.right(); } |
476 | const Length& paddingBefore() const { return m_surroundData->padding.before(writingMode()); } |
477 | const Length& paddingAfter() const { return m_surroundData->padding.after(writingMode()); } |
478 | const Length& paddingStart() const { return m_surroundData->padding.start(writingMode(), direction()); } |
479 | const Length& paddingEnd() const { return m_surroundData->padding.end(writingMode(), direction()); } |
480 | |
481 | CursorType cursor() const { return static_cast<CursorType>(m_inheritedFlags.cursor); } |
482 | |
483 | #if ENABLE(CURSOR_VISIBILITY) |
484 | CursorVisibility cursorVisibility() const { return static_cast<CursorVisibility>(m_inheritedFlags.cursorVisibility); } |
485 | #endif |
486 | |
487 | CursorList* cursors() const { return m_rareInheritedData->cursorData.get(); } |
488 | |
489 | InsideLink insideLink() const { return static_cast<InsideLink>(m_inheritedFlags.insideLink); } |
490 | bool isLink() const { return m_nonInheritedFlags.isLink; } |
491 | |
492 | bool insideDefaultButton() const { return m_inheritedFlags.insideDefaultButton; } |
493 | |
494 | short widows() const { return m_rareInheritedData->widows; } |
495 | short orphans() const { return m_rareInheritedData->orphans; } |
496 | bool hasAutoWidows() const { return m_rareInheritedData->hasAutoWidows; } |
497 | bool hasAutoOrphans() const { return m_rareInheritedData->hasAutoOrphans; } |
498 | |
499 | BreakInside breakInside() const { return static_cast<BreakInside>(m_rareNonInheritedData->breakInside); } |
500 | BreakBetween breakBefore() const { return static_cast<BreakBetween>(m_rareNonInheritedData->breakBefore); } |
501 | BreakBetween breakAfter() const { return static_cast<BreakBetween>(m_rareNonInheritedData->breakAfter); } |
502 | |
503 | OptionSet<HangingPunctuation> hangingPunctuation() const { return OptionSet<HangingPunctuation>::fromRaw(m_rareInheritedData->hangingPunctuation); } |
504 | |
505 | float outlineOffset() const; |
506 | const ShadowData* textShadow() const { return m_rareInheritedData->textShadow.get(); } |
507 | void getTextShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(textShadow(), logicalLeft, logicalRight); } |
508 | void getTextShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(textShadow(), logicalTop, logicalBottom); } |
509 | |
510 | float textStrokeWidth() const { return m_rareInheritedData->textStrokeWidth; } |
511 | float opacity() const { return m_rareNonInheritedData->opacity; } |
512 | ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonInheritedData->appearance); } |
513 | AspectRatioType aspectRatioType() const { return static_cast<AspectRatioType>(m_rareNonInheritedData->aspectRatioType); } |
514 | float aspectRatioDenominator() const { return m_rareNonInheritedData->aspectRatioDenominator; } |
515 | float aspectRatioNumerator() const { return m_rareNonInheritedData->aspectRatioNumerator; } |
516 | BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); } |
517 | BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); } |
518 | float boxFlex() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flex; } |
519 | unsigned boxFlexGroup() const { return m_rareNonInheritedData->deprecatedFlexibleBox->flexGroup; } |
520 | BoxLines boxLines() const { return static_cast<BoxLines>(m_rareNonInheritedData->deprecatedFlexibleBox->lines); } |
521 | unsigned boxOrdinalGroup() const { return m_rareNonInheritedData->deprecatedFlexibleBox->ordinalGroup; } |
522 | BoxOrient boxOrient() const { return static_cast<BoxOrient>(m_rareNonInheritedData->deprecatedFlexibleBox->orient); } |
523 | BoxPack boxPack() const { return static_cast<BoxPack>(m_rareNonInheritedData->deprecatedFlexibleBox->pack); } |
524 | |
525 | int order() const { return m_rareNonInheritedData->order; } |
526 | float flexGrow() const { return m_rareNonInheritedData->flexibleBox->flexGrow; } |
527 | float flexShrink() const { return m_rareNonInheritedData->flexibleBox->flexShrink; } |
528 | const Length& flexBasis() const { return m_rareNonInheritedData->flexibleBox->flexBasis; } |
529 | const StyleContentAlignmentData& alignContent() const { return m_rareNonInheritedData->alignContent; } |
530 | const StyleSelfAlignmentData& alignItems() const { return m_rareNonInheritedData->alignItems; } |
531 | const StyleSelfAlignmentData& alignSelf() const { return m_rareNonInheritedData->alignSelf; } |
532 | FlexDirection flexDirection() const { return static_cast<FlexDirection>(m_rareNonInheritedData->flexibleBox->flexDirection); } |
533 | bool isColumnFlexDirection() const { return flexDirection() == FlexDirection::Column || flexDirection() == FlexDirection::ColumnReverse; } |
534 | bool isReverseFlexDirection() const { return flexDirection() == FlexDirection::RowReverse || flexDirection() == FlexDirection::ColumnReverse; } |
535 | FlexWrap flexWrap() const { return static_cast<FlexWrap>(m_rareNonInheritedData->flexibleBox->flexWrap); } |
536 | const StyleContentAlignmentData& justifyContent() const { return m_rareNonInheritedData->justifyContent; } |
537 | const StyleSelfAlignmentData& justifyItems() const { return m_rareNonInheritedData->justifyItems; } |
538 | const StyleSelfAlignmentData& justifySelf() const { return m_rareNonInheritedData->justifySelf; } |
539 | |
540 | const Vector<GridTrackSize>& gridColumns() const { return m_rareNonInheritedData->grid->gridColumns; } |
541 | const Vector<GridTrackSize>& gridRows() const { return m_rareNonInheritedData->grid->gridRows; } |
542 | const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return m_rareNonInheritedData->grid->gridAutoRepeatColumns; } |
543 | const Vector<GridTrackSize>& gridAutoRepeatRows() const { return m_rareNonInheritedData->grid->gridAutoRepeatRows; } |
544 | unsigned gridAutoRepeatColumnsInsertionPoint() const { return m_rareNonInheritedData->grid->autoRepeatColumnsInsertionPoint; } |
545 | unsigned gridAutoRepeatRowsInsertionPoint() const { return m_rareNonInheritedData->grid->autoRepeatRowsInsertionPoint; } |
546 | AutoRepeatType gridAutoRepeatColumnsType() const { return m_rareNonInheritedData->grid->autoRepeatColumnsType; } |
547 | AutoRepeatType gridAutoRepeatRowsType() const { return m_rareNonInheritedData->grid->autoRepeatRowsType; } |
548 | const NamedGridLinesMap& namedGridColumnLines() const { return m_rareNonInheritedData->grid->namedGridColumnLines; } |
549 | const NamedGridLinesMap& namedGridRowLines() const { return m_rareNonInheritedData->grid->namedGridRowLines; } |
550 | const OrderedNamedGridLinesMap& orderedNamedGridColumnLines() const { return m_rareNonInheritedData->grid->orderedNamedGridColumnLines; } |
551 | const OrderedNamedGridLinesMap& orderedNamedGridRowLines() const { return m_rareNonInheritedData->grid->orderedNamedGridRowLines; } |
552 | const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return m_rareNonInheritedData->grid->autoRepeatNamedGridColumnLines; } |
553 | const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return m_rareNonInheritedData->grid->autoRepeatNamedGridRowLines; } |
554 | const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridColumnLines() const { return m_rareNonInheritedData->grid->autoRepeatOrderedNamedGridColumnLines; } |
555 | const OrderedNamedGridLinesMap& autoRepeatOrderedNamedGridRowLines() const { return m_rareNonInheritedData->grid->autoRepeatOrderedNamedGridRowLines; } |
556 | const NamedGridAreaMap& namedGridArea() const { return m_rareNonInheritedData->grid->namedGridArea; } |
557 | size_t namedGridAreaRowCount() const { return m_rareNonInheritedData->grid->namedGridAreaRowCount; } |
558 | size_t namedGridAreaColumnCount() const { return m_rareNonInheritedData->grid->namedGridAreaColumnCount; } |
559 | GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(m_rareNonInheritedData->grid->gridAutoFlow); } |
560 | bool isGridAutoFlowDirectionRow() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowDirectionRow); } |
561 | bool isGridAutoFlowDirectionColumn() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowDirectionColumn); } |
562 | bool isGridAutoFlowAlgorithmSparse() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowAlgorithmSparse); } |
563 | bool isGridAutoFlowAlgorithmDense() const { return (m_rareNonInheritedData->grid->gridAutoFlow & InternalAutoFlowAlgorithmDense); } |
564 | const Vector<GridTrackSize>& gridAutoColumns() const { return m_rareNonInheritedData->grid->gridAutoColumns; } |
565 | const Vector<GridTrackSize>& gridAutoRows() const { return m_rareNonInheritedData->grid->gridAutoRows; } |
566 | |
567 | const GridPosition& gridItemColumnStart() const { return m_rareNonInheritedData->gridItem->gridColumnStart; } |
568 | const GridPosition& gridItemColumnEnd() const { return m_rareNonInheritedData->gridItem->gridColumnEnd; } |
569 | const GridPosition& gridItemRowStart() const { return m_rareNonInheritedData->gridItem->gridRowStart; } |
570 | const GridPosition& gridItemRowEnd() const { return m_rareNonInheritedData->gridItem->gridRowEnd; } |
571 | |
572 | const ShadowData* boxShadow() const { return m_rareNonInheritedData->boxShadow.get(); } |
573 | void getBoxShadowExtent(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const { getShadowExtent(boxShadow(), top, right, bottom, left); } |
574 | LayoutBoxExtent getBoxShadowInsetExtent() const { return getShadowInsetExtent(boxShadow()); } |
575 | void getBoxShadowHorizontalExtent(LayoutUnit& left, LayoutUnit& right) const { getShadowHorizontalExtent(boxShadow(), left, right); } |
576 | void getBoxShadowVerticalExtent(LayoutUnit& top, LayoutUnit& bottom) const { getShadowVerticalExtent(boxShadow(), top, bottom); } |
577 | void getBoxShadowInlineDirectionExtent(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const { getShadowInlineDirectionExtent(boxShadow(), logicalLeft, logicalRight); } |
578 | void getBoxShadowBlockDirectionExtent(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const { getShadowBlockDirectionExtent(boxShadow(), logicalTop, logicalBottom); } |
579 | |
580 | #if ENABLE(CSS_BOX_DECORATION_BREAK) |
581 | BoxDecorationBreak boxDecorationBreak() const { return m_boxData->boxDecorationBreak(); } |
582 | #endif |
583 | |
584 | StyleReflection* boxReflect() const { return m_rareNonInheritedData->boxReflect.get(); } |
585 | BoxSizing boxSizing() const { return m_boxData->boxSizing(); } |
586 | const Length& marqueeIncrement() const { return m_rareNonInheritedData->marquee->increment; } |
587 | int marqueeSpeed() const { return m_rareNonInheritedData->marquee->speed; } |
588 | int marqueeLoopCount() const { return m_rareNonInheritedData->marquee->loops; } |
589 | MarqueeBehavior marqueeBehavior() const { return static_cast<MarqueeBehavior>(m_rareNonInheritedData->marquee->behavior); } |
590 | MarqueeDirection marqueeDirection() const { return static_cast<MarqueeDirection>(m_rareNonInheritedData->marquee->direction); } |
591 | UserModify userModify() const { return static_cast<UserModify>(m_rareInheritedData->userModify); } |
592 | UserDrag userDrag() const { return static_cast<UserDrag>(m_rareNonInheritedData->userDrag); } |
593 | UserSelect userSelect() const { return static_cast<UserSelect>(m_rareInheritedData->userSelect); } |
594 | TextOverflow textOverflow() const { return static_cast<TextOverflow>(m_rareNonInheritedData->textOverflow); } |
595 | MarginCollapse marginBeforeCollapse() const { return static_cast<MarginCollapse>(m_rareNonInheritedData->marginBeforeCollapse); } |
596 | MarginCollapse marginAfterCollapse() const { return static_cast<MarginCollapse>(m_rareNonInheritedData->marginAfterCollapse); } |
597 | WordBreak wordBreak() const { return static_cast<WordBreak>(m_rareInheritedData->wordBreak); } |
598 | OverflowWrap overflowWrap() const { return static_cast<OverflowWrap>(m_rareInheritedData->overflowWrap); } |
599 | NBSPMode nbspMode() const { return static_cast<NBSPMode>(m_rareInheritedData->nbspMode); } |
600 | LineBreak lineBreak() const { return static_cast<LineBreak>(m_rareInheritedData->lineBreak); } |
601 | Hyphens hyphens() const { return static_cast<Hyphens>(m_rareInheritedData->hyphens); } |
602 | short hyphenationLimitBefore() const { return m_rareInheritedData->hyphenationLimitBefore; } |
603 | short hyphenationLimitAfter() const { return m_rareInheritedData->hyphenationLimitAfter; } |
604 | short hyphenationLimitLines() const { return m_rareInheritedData->hyphenationLimitLines; } |
605 | const AtomicString& hyphenationString() const { return m_rareInheritedData->hyphenationString; } |
606 | const AtomicString& locale() const { return fontDescription().locale(); } |
607 | BorderFit borderFit() const { return static_cast<BorderFit>(m_rareNonInheritedData->borderFit); } |
608 | Resize resize() const { return static_cast<Resize>(m_rareNonInheritedData->resize); } |
609 | ColumnAxis columnAxis() const { return static_cast<ColumnAxis>(m_rareNonInheritedData->multiCol->axis); } |
610 | bool hasInlineColumnAxis() const; |
611 | ColumnProgression columnProgression() const { return static_cast<ColumnProgression>(m_rareNonInheritedData->multiCol->progression); } |
612 | float columnWidth() const { return m_rareNonInheritedData->multiCol->width; } |
613 | bool hasAutoColumnWidth() const { return m_rareNonInheritedData->multiCol->autoWidth; } |
614 | unsigned short columnCount() const { return m_rareNonInheritedData->multiCol->count; } |
615 | bool hasAutoColumnCount() const { return m_rareNonInheritedData->multiCol->autoCount; } |
616 | bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColumnWidth() || !hasInlineColumnAxis(); } |
617 | ColumnFill columnFill() const { return static_cast<ColumnFill>(m_rareNonInheritedData->multiCol->fill); } |
618 | const GapLength& columnGap() const { return m_rareNonInheritedData->columnGap; } |
619 | const GapLength& rowGap() const { return m_rareNonInheritedData->rowGap; } |
620 | BorderStyle columnRuleStyle() const { return m_rareNonInheritedData->multiCol->rule.style(); } |
621 | unsigned short columnRuleWidth() const { return m_rareNonInheritedData->multiCol->ruleWidth(); } |
622 | bool columnRuleIsTransparent() const { return m_rareNonInheritedData->multiCol->rule.isTransparent(); } |
623 | ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(m_rareNonInheritedData->multiCol->columnSpan); } |
624 | |
625 | const TransformOperations& transform() const { return m_rareNonInheritedData->transform->operations; } |
626 | bool hasTransform() const { return !m_rareNonInheritedData->transform->operations.operations().isEmpty(); } |
627 | const Length& transformOriginX() const { return m_rareNonInheritedData->transform->x; } |
628 | const Length& transformOriginY() const { return m_rareNonInheritedData->transform->y; } |
629 | float transformOriginZ() const { return m_rareNonInheritedData->transform->z; } |
630 | TransformBox transformBox() const { return m_rareNonInheritedData->transform->transformBox; } |
631 | |
632 | TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisFill>(m_rareInheritedData->textEmphasisFill); } |
633 | TextEmphasisMark textEmphasisMark() const; |
634 | const AtomicString& textEmphasisCustomMark() const { return m_rareInheritedData->textEmphasisCustomMark; } |
635 | OptionSet<TextEmphasisPosition> textEmphasisPosition() const { return OptionSet<TextEmphasisPosition>::fromRaw(m_rareInheritedData->textEmphasisPosition); } |
636 | const AtomicString& textEmphasisMarkString() const; |
637 | |
638 | RubyPosition rubyPosition() const { return static_cast<RubyPosition>(m_rareInheritedData->rubyPosition); } |
639 | |
640 | #if ENABLE(DARK_MODE_CSS) |
641 | StyleColorScheme colorScheme() const { return m_rareInheritedData->colorScheme; } |
642 | void setHasExplicitlySetColorScheme(bool v) { m_nonInheritedFlags.hasExplicitlySetColorScheme = v; } |
643 | bool hasExplicitlySetColorScheme() const { return m_nonInheritedFlags.hasExplicitlySetColorScheme; }; |
644 | #endif |
645 | |
646 | TextOrientation textOrientation() const { return static_cast<TextOrientation>(m_rareInheritedData->textOrientation); } |
647 | |
648 | ObjectFit objectFit() const { return static_cast<ObjectFit>(m_rareNonInheritedData->objectFit); } |
649 | LengthPoint objectPosition() const { return m_rareNonInheritedData->objectPosition; } |
650 | |
651 | // Return true if any transform related property (currently transform, transformStyle3D or perspective) |
652 | // indicates that we are transforming. |
653 | bool hasTransformRelatedProperty() const { return hasTransform() || preserves3D() || hasPerspective(); } |
654 | |
655 | enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }; |
656 | void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, ApplyTransformOrigin = IncludeTransformOrigin) const; |
657 | void setPageScaleTransform(float); |
658 | |
659 | bool hasMask() const { return m_rareNonInheritedData->mask.hasImage() || m_rareNonInheritedData->maskBoxImage.hasImage(); } |
660 | |
661 | TextCombine textCombine() const { return static_cast<TextCombine>(m_rareNonInheritedData->textCombine); } |
662 | bool hasTextCombine() const { return textCombine() != TextCombine::None; } |
663 | |
664 | unsigned tabSize() const { return m_rareInheritedData->tabSize; } |
665 | |
666 | // End CSS3 Getters |
667 | |
668 | const AtomicString& lineGrid() const { return m_rareInheritedData->lineGrid; } |
669 | LineSnap lineSnap() const { return static_cast<LineSnap>(m_rareInheritedData->lineSnap); } |
670 | LineAlign lineAlign() const { return static_cast<LineAlign>(m_rareInheritedData->lineAlign); } |
671 | |
672 | PointerEvents pointerEvents() const { return static_cast<PointerEvents>(m_inheritedFlags.pointerEvents); } |
673 | const AnimationList* animations() const { return m_rareNonInheritedData->animations.get(); } |
674 | const AnimationList* transitions() const { return m_rareNonInheritedData->transitions.get(); } |
675 | |
676 | AnimationList* animations() { return m_rareNonInheritedData->animations.get(); } |
677 | AnimationList* transitions() { return m_rareNonInheritedData->transitions.get(); } |
678 | |
679 | bool hasAnimationsOrTransitions() const { return hasAnimations() || hasTransitions(); } |
680 | |
681 | AnimationList& ensureAnimations(); |
682 | AnimationList& ensureTransitions(); |
683 | |
684 | bool hasAnimations() const { return m_rareNonInheritedData->animations && m_rareNonInheritedData->animations->size() > 0; } |
685 | bool hasTransitions() const { return m_rareNonInheritedData->transitions && m_rareNonInheritedData->transitions->size() > 0; } |
686 | |
687 | // Return the first found Animation (including 'all' transitions). |
688 | const Animation* transitionForProperty(CSSPropertyID) const; |
689 | |
690 | TransformStyle3D transformStyle3D() const { return static_cast<TransformStyle3D>(m_rareNonInheritedData->transformStyle3D); } |
691 | bool preserves3D() const { return transformStyle3D() == TransformStyle3D::Preserve3D; } |
692 | |
693 | BackfaceVisibility backfaceVisibility() const { return static_cast<BackfaceVisibility>(m_rareNonInheritedData->backfaceVisibility); } |
694 | float perspective() const { return m_rareNonInheritedData->perspective; } |
695 | bool hasPerspective() const { return m_rareNonInheritedData->perspective > 0; } |
696 | const Length& perspectiveOriginX() const { return m_rareNonInheritedData->perspectiveOriginX; } |
697 | const Length& perspectiveOriginY() const { return m_rareNonInheritedData->perspectiveOriginY; } |
698 | const LengthSize& pageSize() const { return m_rareNonInheritedData->pageSize; } |
699 | PageSizeType pageSizeType() const { return static_cast<PageSizeType>(m_rareNonInheritedData->pageSizeType); } |
700 | |
701 | LineBoxContain lineBoxContain() const { return m_rareInheritedData->lineBoxContain; } |
702 | const LineClampValue& lineClamp() const { return m_rareNonInheritedData->lineClamp; } |
703 | const IntSize& initialLetter() const { return m_rareNonInheritedData->initialLetter; } |
704 | int initialLetterDrop() const { return initialLetter().width(); } |
705 | int initialLetterHeight() const { return initialLetter().height(); } |
706 | |
707 | #if ENABLE(POINTER_EVENTS) |
708 | OptionSet<TouchAction> touchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareNonInheritedData->touchActions); } |
709 | // 'touch-action' behavior depends on values in ancestors. We use an additional inherited property to implement that. |
710 | OptionSet<TouchAction> effectiveTouchActions() const { return OptionSet<TouchAction>::fromRaw(m_rareInheritedData->effectiveTouchActions); } |
711 | #endif |
712 | |
713 | #if ENABLE(CSS_SCROLL_SNAP) |
714 | // Scroll snap port style. |
715 | const StyleScrollSnapPort& scrollSnapPort() const; |
716 | const ScrollSnapType& scrollSnapType() const; |
717 | const LengthBox& scrollPadding() const; |
718 | const Length& scrollPaddingTop() const; |
719 | const Length& scrollPaddingBottom() const; |
720 | const Length& scrollPaddingLeft() const; |
721 | const Length& scrollPaddingRight() const; |
722 | |
723 | // Scroll snap area style. |
724 | const StyleScrollSnapArea& scrollSnapArea() const; |
725 | const ScrollSnapAlign& scrollSnapAlign() const; |
726 | const LengthBox& scrollSnapMargin() const; |
727 | const Length& scrollSnapMarginTop() const; |
728 | const Length& scrollSnapMarginBottom() const; |
729 | const Length& scrollSnapMarginLeft() const; |
730 | const Length& scrollSnapMarginRight() const; |
731 | #endif |
732 | |
733 | #if ENABLE(TOUCH_EVENTS) |
734 | Color tapHighlightColor() const { return m_rareInheritedData->tapHighlightColor; } |
735 | #endif |
736 | |
737 | #if PLATFORM(IOS_FAMILY) |
738 | bool touchCalloutEnabled() const { return m_rareInheritedData->touchCalloutEnabled; } |
739 | #endif |
740 | |
741 | #if ENABLE(OVERFLOW_SCROLLING_TOUCH) |
742 | bool useTouchOverflowScrolling() const { return m_rareInheritedData->useTouchOverflowScrolling; } |
743 | #endif |
744 | |
745 | #if ENABLE(TEXT_AUTOSIZING) |
746 | TextSizeAdjustment textSizeAdjust() const { return m_rareInheritedData->textSizeAdjust; } |
747 | #endif |
748 | |
749 | TextSecurity textSecurity() const { return static_cast<TextSecurity>(m_rareInheritedData->textSecurity); } |
750 | |
751 | WritingMode writingMode() const { return static_cast<WritingMode>(m_inheritedFlags.writingMode); } |
752 | bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); } |
753 | bool isVerticalWritingMode() const { return WebCore::isVerticalWritingMode(writingMode()); } |
754 | bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); } |
755 | bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); } |
756 | |
757 | ImageOrientationEnum imageOrientation() const; |
758 | |
759 | ImageRendering imageRendering() const { return static_cast<ImageRendering>(m_rareInheritedData->imageRendering); } |
760 | |
761 | #if ENABLE(CSS_IMAGE_RESOLUTION) |
762 | ImageResolutionSource imageResolutionSource() const { return static_cast<ImageResolutionSource>(m_rareInheritedData->imageResolutionSource); } |
763 | ImageResolutionSnap imageResolutionSnap() const { return static_cast<ImageResolutionSnap>(m_rareInheritedData->imageResolutionSnap); } |
764 | float imageResolution() const { return m_rareInheritedData->imageResolution; } |
765 | #endif |
766 | |
767 | OptionSet<SpeakAs> speakAs() const { return OptionSet<SpeakAs>::fromRaw(m_rareInheritedData->speakAs); } |
768 | |
769 | FilterOperations& mutableFilter() { return m_rareNonInheritedData.access().filter.access().operations; } |
770 | const FilterOperations& filter() const { return m_rareNonInheritedData->filter->operations; } |
771 | bool hasFilter() const { return !m_rareNonInheritedData->filter->operations.operations().isEmpty(); } |
772 | bool hasReferenceFilterOnly() const; |
773 | |
774 | FilterOperations& mutableAppleColorFilter() { return m_rareInheritedData.access().appleColorFilter.access().operations; } |
775 | const FilterOperations& appleColorFilter() const { return m_rareInheritedData->appleColorFilter->operations; } |
776 | bool hasAppleColorFilter() const { return !m_rareInheritedData->appleColorFilter->operations.operations().isEmpty(); } |
777 | |
778 | #if ENABLE(FILTERS_LEVEL_2) |
779 | FilterOperations& mutableBackdropFilter() { return m_rareNonInheritedData.access().backdropFilter.access().operations; } |
780 | const FilterOperations& backdropFilter() const { return m_rareNonInheritedData->backdropFilter->operations; } |
781 | bool hasBackdropFilter() const { return !m_rareNonInheritedData->backdropFilter->operations.operations().isEmpty(); } |
782 | #else |
783 | bool hasBackdropFilter() const { return false; } |
784 | #endif |
785 | |
786 | #if ENABLE(CSS_COMPOSITING) |
787 | BlendMode blendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode); } |
788 | void setBlendMode(BlendMode mode) { SET_VAR(m_rareNonInheritedData, effectiveBlendMode, static_cast<unsigned>(mode)); } |
789 | bool hasBlendMode() const { return static_cast<BlendMode>(m_rareNonInheritedData->effectiveBlendMode) != BlendMode::Normal; } |
790 | |
791 | Isolation isolation() const { return static_cast<Isolation>(m_rareNonInheritedData->isolation); } |
792 | void setIsolation(Isolation isolation) { SET_VAR(m_rareNonInheritedData, isolation, static_cast<unsigned>(isolation)); } |
793 | bool hasIsolation() const { return isolation() != Isolation::Auto; } |
794 | #else |
795 | BlendMode blendMode() const { return BlendMode::Normal; } |
796 | bool hasBlendMode() const { return false; } |
797 | |
798 | Isolation isolation() const { return Isolation::Auto; } |
799 | bool hasIsolation() const { return false; } |
800 | #endif |
801 | |
802 | bool shouldPlaceBlockDirectionScrollbarOnLeft() const; |
803 | |
804 | #if ENABLE(CSS_TRAILING_WORD) |
805 | TrailingWord trailingWord() const { return TrailingWord::Auto; } |
806 | #endif |
807 | |
808 | #if ENABLE(APPLE_PAY) |
809 | ApplePayButtonStyle applePayButtonStyle() const { return static_cast<ApplePayButtonStyle>(m_rareNonInheritedData->applePayButtonStyle); } |
810 | ApplePayButtonType applePayButtonType() const { return static_cast<ApplePayButtonType>(m_rareNonInheritedData->applePayButtonType); } |
811 | #endif |
812 | |
813 | // attribute setter methods |
814 | |
815 | void setDisplay(DisplayType v) { m_nonInheritedFlags.effectiveDisplay = static_cast<unsigned>(v); } |
816 | void setOriginalDisplay(DisplayType v) { m_nonInheritedFlags.originalDisplay = static_cast<unsigned>(v); } |
817 | void setPosition(PositionType v) { m_nonInheritedFlags.position = static_cast<unsigned>(v); } |
818 | void setFloating(Float v) { m_nonInheritedFlags.floating = static_cast<unsigned>(v); } |
819 | |
820 | void setLeft(Length&& length) { SET_VAR(m_surroundData, offset.left(), WTFMove(length)); } |
821 | void setRight(Length&& length) { SET_VAR(m_surroundData, offset.right(), WTFMove(length)); } |
822 | void setTop(Length&& length) { SET_VAR(m_surroundData, offset.top(), WTFMove(length)); } |
823 | void setBottom(Length&& length) { SET_VAR(m_surroundData, offset.bottom(), WTFMove(length)); } |
824 | |
825 | void setWidth(Length&& length) { SET_VAR(m_boxData, m_width, WTFMove(length)); } |
826 | void setHeight(Length&& length) { SET_VAR(m_boxData, m_height, WTFMove(length)); } |
827 | |
828 | void setLogicalWidth(Length&&); |
829 | void setLogicalHeight(Length&&); |
830 | |
831 | void setMinWidth(Length&& length) { SET_VAR(m_boxData, m_minWidth, WTFMove(length)); } |
832 | void setMaxWidth(Length&& length) { SET_VAR(m_boxData, m_maxWidth, WTFMove(length)); } |
833 | void setMinHeight(Length&& length) { SET_VAR(m_boxData, m_minHeight, WTFMove(length)); } |
834 | void setMaxHeight(Length&& length) { SET_VAR(m_boxData, m_maxHeight, WTFMove(length)); } |
835 | |
836 | #if ENABLE(DASHBOARD_SUPPORT) |
837 | const Vector<StyleDashboardRegion>& dashboardRegions() const { return m_rareNonInheritedData->dashboardRegions; } |
838 | void setDashboardRegions(const Vector<StyleDashboardRegion>& regions) { SET_VAR(m_rareNonInheritedData, dashboardRegions, regions); } |
839 | void setDashboardRegion(int type, const String& label, Length&& top, Length&& right, Length&& bottom, Length&& left, bool append); |
840 | #endif |
841 | |
842 | void resetBorder() { resetBorderImage(); resetBorderTop(); resetBorderRight(); resetBorderBottom(); resetBorderLeft(); resetBorderRadius(); } |
843 | void resetBorderTop() { SET_VAR(m_surroundData, border.m_top, BorderValue()); } |
844 | void resetBorderRight() { SET_VAR(m_surroundData, border.m_right, BorderValue()); } |
845 | void resetBorderBottom() { SET_VAR(m_surroundData, border.m_bottom, BorderValue()); } |
846 | void resetBorderLeft() { SET_VAR(m_surroundData, border.m_left, BorderValue()); } |
847 | void resetBorderImage() { SET_VAR(m_surroundData, border.m_image, NinePieceImage()); } |
848 | void resetBorderRadius() { resetBorderTopLeftRadius(); resetBorderTopRightRadius(); resetBorderBottomLeftRadius(); resetBorderBottomRightRadius(); } |
849 | void resetBorderTopLeftRadius() { SET_VAR(m_surroundData, border.m_topLeft, initialBorderRadius()); } |
850 | void resetBorderTopRightRadius() { SET_VAR(m_surroundData, border.m_topRight, initialBorderRadius()); } |
851 | void resetBorderBottomLeftRadius() { SET_VAR(m_surroundData, border.m_bottomLeft, initialBorderRadius()); } |
852 | void resetBorderBottomRightRadius() { SET_VAR(m_surroundData, border.m_bottomRight, initialBorderRadius()); } |
853 | |
854 | void setBackgroundColor(const Color& v) { SET_VAR(m_backgroundData, color, v); } |
855 | |
856 | void setBackgroundXPosition(Length&& length) { SET_VAR(m_backgroundData, background.m_xPosition, WTFMove(length)); } |
857 | void setBackgroundYPosition(Length&& length) { SET_VAR(m_backgroundData, background.m_yPosition, WTFMove(length)); } |
858 | void setBackgroundSize(FillSizeType b) { SET_VAR(m_backgroundData, background.m_sizeType, static_cast<unsigned>(b)); } |
859 | void setBackgroundSizeLength(LengthSize&& size) { SET_VAR(m_backgroundData, background.m_sizeLength, WTFMove(size)); } |
860 | |
861 | void setBorderImage(const NinePieceImage& b) { SET_VAR(m_surroundData, border.m_image, b); } |
862 | void setBorderImageSource(RefPtr<StyleImage>&&); |
863 | void setBorderImageSlices(LengthBox&&); |
864 | void setBorderImageWidth(LengthBox&&); |
865 | void setBorderImageOutset(LengthBox&&); |
866 | |
867 | void setBorderTopLeftRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_topLeft, WTFMove(size)); } |
868 | void setBorderTopRightRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_topRight, WTFMove(size)); } |
869 | void setBorderBottomLeftRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_bottomLeft, WTFMove(size)); } |
870 | void setBorderBottomRightRadius(LengthSize&& size) { SET_VAR(m_surroundData, border.m_bottomRight, WTFMove(size)); } |
871 | |
872 | void setBorderRadius(LengthSize&&); |
873 | void setBorderRadius(const IntSize&); |
874 | |
875 | RoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; |
876 | RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; |
877 | |
878 | RoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, LayoutUnit topWidth, LayoutUnit bottomWidth, |
879 | LayoutUnit leftWidth, LayoutUnit rightWidth, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; |
880 | |
881 | void setBorderLeftWidth(float v) { SET_VAR(m_surroundData, border.m_left.m_width, v); } |
882 | void setBorderLeftStyle(BorderStyle v) { SET_VAR(m_surroundData, border.m_left.m_style, static_cast<unsigned>(v)); } |
883 | void setBorderLeftColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_left, v); } |
884 | void setBorderRightWidth(float v) { SET_VAR(m_surroundData, border.m_right.m_width, v); } |
885 | void setBorderRightStyle(BorderStyle v) { SET_VAR(m_surroundData, border.m_right.m_style, static_cast<unsigned>(v)); } |
886 | void setBorderRightColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_right, v); } |
887 | void setBorderTopWidth(float v) { SET_VAR(m_surroundData, border.m_top.m_width, v); } |
888 | void setBorderTopStyle(BorderStyle v) { SET_VAR(m_surroundData, border.m_top.m_style, static_cast<unsigned>(v)); } |
889 | void setBorderTopColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_top, v); } |
890 | void setBorderBottomWidth(float v) { SET_VAR(m_surroundData, border.m_bottom.m_width, v); } |
891 | void setBorderBottomStyle(BorderStyle v) { SET_VAR(m_surroundData, border.m_bottom.m_style, static_cast<unsigned>(v)); } |
892 | void setBorderBottomColor(const Color& v) { SET_BORDERVALUE_COLOR(m_surroundData, border.m_bottom, v); } |
893 | |
894 | void setOutlineWidth(float v) { SET_VAR(m_backgroundData, outline.m_width, v); } |
895 | void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_backgroundData, outline.m_isAuto, static_cast<unsigned>(isAuto)); } |
896 | void setOutlineStyle(BorderStyle v) { SET_VAR(m_backgroundData, outline.m_style, static_cast<unsigned>(v)); } |
897 | void setOutlineColor(const Color& v) { SET_BORDERVALUE_COLOR(m_backgroundData, outline, v); } |
898 | |
899 | void setOverflowX(Overflow v) { m_nonInheritedFlags.overflowX = static_cast<unsigned>(v); } |
900 | void setOverflowY(Overflow v) { m_nonInheritedFlags.overflowY = static_cast<unsigned>(v); } |
901 | void setVisibility(Visibility v) { m_inheritedFlags.visibility = static_cast<unsigned>(v); } |
902 | void setVerticalAlign(VerticalAlign v) { m_nonInheritedFlags.verticalAlign = static_cast<unsigned>(v); } |
903 | void setVerticalAlignLength(Length&& length) { setVerticalAlign(VerticalAlign::Length); SET_VAR(m_boxData, m_verticalAlign, WTFMove(length)); } |
904 | |
905 | void setHasClip(bool b = true) { SET_VAR(m_visualData, hasClip, b); } |
906 | void setClipLeft(Length&& length) { SET_VAR(m_visualData, clip.left(), WTFMove(length)); } |
907 | void setClipRight(Length&& length) { SET_VAR(m_visualData, clip.right(), WTFMove(length)); } |
908 | void setClipTop(Length&& length) { SET_VAR(m_visualData, clip.top(), WTFMove(length)); } |
909 | void setClipBottom(Length&& length) { SET_VAR(m_visualData, clip.bottom(), WTFMove(length)); } |
910 | void setClip(Length&& top, Length&& right, Length&& bottom, Length&& left); |
911 | void setClip(LengthBox&& box) { SET_VAR(m_visualData, clip, WTFMove(box)); } |
912 | |
913 | void setUnicodeBidi(EUnicodeBidi v) { m_nonInheritedFlags.unicodeBidi = v; } |
914 | |
915 | void setClear(Clear v) { m_nonInheritedFlags.clear = static_cast<unsigned>(v); } |
916 | void setTableLayout(TableLayoutType v) { m_nonInheritedFlags.tableLayout = static_cast<unsigned>(v); } |
917 | |
918 | bool setFontDescription(FontCascadeDescription&&); |
919 | |
920 | // Only used for blending font sizes when animating, for MathML anonymous blocks, and for text autosizing. |
921 | void setFontSize(float); |
922 | |
923 | #if ENABLE(VARIATION_FONTS) |
924 | void setFontVariationSettings(FontVariationSettings); |
925 | #endif |
926 | void setFontWeight(FontSelectionValue); |
927 | void setFontStretch(FontSelectionValue); |
928 | void setFontItalic(Optional<FontSelectionValue>); |
929 | |
930 | void setColor(const Color&); |
931 | void setTextIndent(Length&& length) { SET_VAR(m_rareInheritedData, indent, WTFMove(length)); } |
932 | void setTextAlign(TextAlignMode v) { m_inheritedFlags.textAlign = static_cast<unsigned>(v); } |
933 | void setTextTransform(TextTransform v) { m_inheritedFlags.textTransform = static_cast<unsigned>(v); } |
934 | void addToTextDecorationsInEffect(OptionSet<TextDecoration> v) { m_inheritedFlags.textDecorations |= static_cast<unsigned>(v.toRaw()); } |
935 | void setTextDecorationsInEffect(OptionSet<TextDecoration> v) { m_inheritedFlags.textDecorations = v.toRaw(); } |
936 | void setTextDecoration(OptionSet<TextDecoration> v) { SET_VAR(m_visualData, textDecoration, v.toRaw()); } |
937 | void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(m_rareNonInheritedData, textDecorationStyle, static_cast<unsigned>(v)); } |
938 | void setTextDecorationSkip(OptionSet<TextDecorationSkip> skip) { SET_VAR(m_rareInheritedData, textDecorationSkip, skip.toRaw()); } |
939 | void setTextUnderlinePosition(TextUnderlinePosition position) { SET_VAR(m_rareInheritedData, textUnderlinePosition, static_cast<unsigned>(position)); } |
940 | void setTextUnderlineOffset(TextUnderlineOffset textUnderlineOffset) { SET_VAR(m_rareInheritedData, textUnderlineOffset, textUnderlineOffset); } |
941 | void setTextDecorationThickness(TextDecorationThickness textDecorationThickness) { SET_VAR(m_rareInheritedData, textDecorationThickness, textDecorationThickness); } |
942 | void setDirection(TextDirection v) { m_inheritedFlags.direction = static_cast<unsigned>(v); } |
943 | void setHasExplicitlySetDirection(bool v) { m_nonInheritedFlags.hasExplicitlySetDirection = v; } |
944 | void setLineHeight(Length&&); |
945 | bool setZoom(float); |
946 | void setZoomWithoutReturnValue(float f) { setZoom(f); } |
947 | bool setEffectiveZoom(float); |
948 | void setTextZoom(TextZoom v) { SET_VAR(m_rareInheritedData, textZoom, static_cast<unsigned>(v)); } |
949 | |
950 | #if ENABLE(CSS3_TEXT) |
951 | void setTextIndentLine(TextIndentLine v) { SET_VAR(m_rareInheritedData, textIndentLine, v); } |
952 | void setTextIndentType(TextIndentType v) { SET_VAR(m_rareInheritedData, textIndentType, v); } |
953 | void setTextAlignLast(TextAlignLast v) { SET_VAR(m_rareInheritedData, textAlignLast, v); } |
954 | void setTextJustify(TextJustify v) { SET_VAR(m_rareInheritedData, textJustify, v); } |
955 | #endif |
956 | |
957 | #if ENABLE(TEXT_AUTOSIZING) |
958 | void setSpecifiedLineHeight(Length&&); |
959 | #endif |
960 | |
961 | #if ENABLE(CSS_IMAGE_ORIENTATION) |
962 | void setImageOrientation(ImageOrientationEnum v) { SET_VAR(m_rareInheritedData, imageOrientation, static_cast<int>(v)); } |
963 | #endif |
964 | |
965 | void setImageRendering(ImageRendering v) { SET_VAR(m_rareInheritedData, imageRendering, static_cast<unsigned>(v)); } |
966 | |
967 | #if ENABLE(CSS_IMAGE_RESOLUTION) |
968 | void setImageResolutionSource(ImageResolutionSource v) { SET_VAR(m_rareInheritedData, imageResolutionSource, v); } |
969 | void setImageResolutionSnap(ImageResolutionSnap v) { SET_VAR(m_rareInheritedData, imageResolutionSnap, v); } |
970 | void setImageResolution(float f) { SET_VAR(m_rareInheritedData, imageResolution, f); } |
971 | #endif |
972 | |
973 | void setWhiteSpace(WhiteSpace v) { m_inheritedFlags.whiteSpace = static_cast<unsigned>(v); } |
974 | |
975 | void setWordSpacing(Length&&); |
976 | void setLetterSpacing(float); |
977 | |
978 | void clearBackgroundLayers() { m_backgroundData.access().background = FillLayer(FillLayerType::Background); } |
979 | void inheritBackgroundLayers(const FillLayer& parent) { m_backgroundData.access().background = parent; } |
980 | |
981 | void adjustBackgroundLayers(); |
982 | |
983 | void clearMaskLayers() { m_rareNonInheritedData.access().mask = FillLayer(FillLayerType::Mask); } |
984 | void inheritMaskLayers(const FillLayer& parent) { m_rareNonInheritedData.access().mask = parent; } |
985 | |
986 | void adjustMaskLayers(); |
987 | |
988 | void setMaskImage(RefPtr<StyleImage>&& v) { m_rareNonInheritedData.access().mask.setImage(WTFMove(v)); } |
989 | |
990 | void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(m_rareNonInheritedData, maskBoxImage, b); } |
991 | void setMaskBoxImageSource(RefPtr<StyleImage>&& v) { m_rareNonInheritedData.access().maskBoxImage.setImage(WTFMove(v)); } |
992 | void setMaskXPosition(Length&& length) { SET_VAR(m_rareNonInheritedData, mask.m_xPosition, WTFMove(length)); } |
993 | void setMaskYPosition(Length&& length) { SET_VAR(m_rareNonInheritedData, mask.m_yPosition, WTFMove(length)); } |
994 | void setMaskSize(LengthSize size) { SET_VAR(m_rareNonInheritedData, mask.m_sizeLength, WTFMove(size)); } |
995 | |
996 | void setBorderCollapse(BorderCollapse collapse) { m_inheritedFlags.borderCollapse = static_cast<unsigned>(collapse); } |
997 | void setHorizontalBorderSpacing(float); |
998 | void setVerticalBorderSpacing(float); |
999 | void setEmptyCells(EmptyCell v) { m_inheritedFlags.emptyCells = static_cast<unsigned>(v); } |
1000 | void setCaptionSide(CaptionSide v) { m_inheritedFlags.captionSide = static_cast<unsigned>(v); } |
1001 | |
1002 | void setAspectRatioType(AspectRatioType aspectRatioType) { SET_VAR(m_rareNonInheritedData, aspectRatioType, static_cast<unsigned>(aspectRatioType)); } |
1003 | void setAspectRatioDenominator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioDenominator, v); } |
1004 | void setAspectRatioNumerator(float v) { SET_VAR(m_rareNonInheritedData, aspectRatioNumerator, v); } |
1005 | |
1006 | void setListStyleType(ListStyleType v) { m_inheritedFlags.listStyleType = static_cast<unsigned>(v); } |
1007 | void setListStyleImage(RefPtr<StyleImage>&&); |
1008 | void setListStylePosition(ListStylePosition v) { m_inheritedFlags.listStylePosition = static_cast<unsigned>(v); } |
1009 | |
1010 | void resetMargin() { SET_VAR(m_surroundData, margin, LengthBox(Fixed)); } |
1011 | void setMarginTop(Length&& length) { SET_VAR(m_surroundData, margin.top(), WTFMove(length)); } |
1012 | void setMarginBottom(Length&& length) { SET_VAR(m_surroundData, margin.bottom(), WTFMove(length)); } |
1013 | void setMarginLeft(Length&& length) { SET_VAR(m_surroundData, margin.left(), WTFMove(length)); } |
1014 | void setMarginRight(Length&& length) { SET_VAR(m_surroundData, margin.right(), WTFMove(length)); } |
1015 | void setMarginStart(Length&&); |
1016 | void setMarginEnd(Length&&); |
1017 | |
1018 | void resetPadding() { SET_VAR(m_surroundData, padding, LengthBox(Auto)); } |
1019 | void setPaddingBox(LengthBox&& box) { SET_VAR(m_surroundData, padding, WTFMove(box)); } |
1020 | void setPaddingTop(Length&& length) { SET_VAR(m_surroundData, padding.top(), WTFMove(length)); } |
1021 | void setPaddingBottom(Length&& length) { SET_VAR(m_surroundData, padding.bottom(), WTFMove(length)); } |
1022 | void setPaddingLeft(Length&& length) { SET_VAR(m_surroundData, padding.left(), WTFMove(length)); } |
1023 | void setPaddingRight(Length&& length) { SET_VAR(m_surroundData, padding.right(), WTFMove(length)); } |
1024 | |
1025 | void setCursor(CursorType c) { m_inheritedFlags.cursor = static_cast<unsigned>(c); } |
1026 | void addCursor(RefPtr<StyleImage>&&, const IntPoint& hotSpot = IntPoint()); |
1027 | void setCursorList(RefPtr<CursorList>&&); |
1028 | void clearCursorList(); |
1029 | |
1030 | #if ENABLE(CURSOR_VISIBILITY) |
1031 | void setCursorVisibility(CursorVisibility c) { m_inheritedFlags.cursorVisibility = static_cast<unsigned>(c); } |
1032 | #endif |
1033 | |
1034 | void setInsideLink(InsideLink insideLink) { m_inheritedFlags.insideLink = static_cast<unsigned>(insideLink); } |
1035 | void setIsLink(bool v) { m_nonInheritedFlags.isLink = v; } |
1036 | |
1037 | void setInsideDefaultButton(bool insideDefaultButton) { m_inheritedFlags.insideDefaultButton = insideDefaultButton; } |
1038 | |
1039 | PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdjust>(m_inheritedFlags.printColorAdjust); } |
1040 | void setPrintColorAdjust(PrintColorAdjust value) { m_inheritedFlags.printColorAdjust = static_cast<unsigned>(value); } |
1041 | |
1042 | bool hasAutoZIndex() const { return m_boxData->hasAutoZIndex(); } |
1043 | void setHasAutoZIndex() { SET_VAR(m_boxData, m_hasAutoZIndex, true); SET_VAR(m_boxData, m_zIndex, 0); } |
1044 | int zIndex() const { return m_boxData->zIndex(); } |
1045 | void setZIndex(int v) { SET_VAR(m_boxData, m_hasAutoZIndex, false); SET_VAR(m_boxData, m_zIndex, v); } |
1046 | |
1047 | void setHasAutoWidows() { SET_VAR(m_rareInheritedData, hasAutoWidows, true); SET_VAR(m_rareInheritedData, widows, initialWidows()); } |
1048 | void setWidows(short w) { SET_VAR(m_rareInheritedData, hasAutoWidows, false); SET_VAR(m_rareInheritedData, widows, w); } |
1049 | |
1050 | void setHasAutoOrphans() { SET_VAR(m_rareInheritedData, hasAutoOrphans, true); SET_VAR(m_rareInheritedData, orphans, initialOrphans()); } |
1051 | void setOrphans(short o) { SET_VAR(m_rareInheritedData, hasAutoOrphans, false); SET_VAR(m_rareInheritedData, orphans, o); } |
1052 | |
1053 | // CSS3 Setters |
1054 | void setOutlineOffset(float v) { SET_VAR(m_backgroundData, outline.m_offset, v); } |
1055 | void setTextShadow(std::unique_ptr<ShadowData>, bool add = false); |
1056 | void setTextStrokeColor(const Color& c) { SET_VAR(m_rareInheritedData, textStrokeColor, c); } |
1057 | void setTextStrokeWidth(float w) { SET_VAR(m_rareInheritedData, textStrokeWidth, w); } |
1058 | void setTextFillColor(const Color& c) { SET_VAR(m_rareInheritedData, textFillColor, c); } |
1059 | void setCaretColor(const Color& c) { SET_VAR(m_rareInheritedData, caretColor, c); } |
1060 | void setOpacity(float f) { float v = clampTo<float>(f, 0.f, 1.f); SET_VAR(m_rareNonInheritedData, opacity, v); } |
1061 | void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, appearance, a); } |
1062 | // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/#alignment |
1063 | void setBoxAlign(BoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, align, static_cast<unsigned>(a)); } |
1064 | void setBoxDirection(BoxDirection d) { m_inheritedFlags.boxDirection = static_cast<unsigned>(d); } |
1065 | void setBoxFlex(float f) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, flex, f); } |
1066 | void setBoxFlexGroup(unsigned group) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, flexGroup, group); } |
1067 | void setBoxLines(BoxLines lines) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, lines, static_cast<unsigned>(lines)); } |
1068 | void setBoxOrdinalGroup(unsigned group) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, ordinalGroup, group); } |
1069 | void setBoxOrient(BoxOrient o) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, orient, static_cast<unsigned>(o)); } |
1070 | void setBoxPack(BoxPack p) { SET_NESTED_VAR(m_rareNonInheritedData, deprecatedFlexibleBox, pack, static_cast<unsigned>(p)); } |
1071 | void setBoxShadow(std::unique_ptr<ShadowData>, bool add = false); |
1072 | void setBoxReflect(RefPtr<StyleReflection>&&); |
1073 | void setBoxSizing(BoxSizing s) { SET_VAR(m_boxData, m_boxSizing, static_cast<unsigned>(s)); } |
1074 | void setFlexGrow(float f) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexGrow, f); } |
1075 | void setFlexShrink(float f) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexShrink, f); } |
1076 | void setFlexBasis(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexBasis, WTFMove(length)); } |
1077 | void setOrder(int o) { SET_VAR(m_rareNonInheritedData, order, o); } |
1078 | void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignContent, data); } |
1079 | void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignItems, data); } |
1080 | void setAlignItemsPosition(ItemPosition position) { m_rareNonInheritedData.access().alignItems.setPosition(position); } |
1081 | void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, alignSelf, data); } |
1082 | void setAlignSelfPosition(ItemPosition position) { m_rareNonInheritedData.access().alignSelf.setPosition(position); } |
1083 | void setFlexDirection(FlexDirection direction) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexDirection, static_cast<unsigned>(direction)); } |
1084 | void setFlexWrap(FlexWrap w) { SET_NESTED_VAR(m_rareNonInheritedData, flexibleBox, flexWrap, static_cast<unsigned>(w)); } |
1085 | void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifyContent, data); } |
1086 | void setJustifyContentPosition(ContentPosition position) { m_rareNonInheritedData.access().justifyContent.setPosition(position); } |
1087 | void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifyItems, data); } |
1088 | void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInheritedData, justifySelf, data); } |
1089 | void setJustifySelfPosition(ItemPosition position) { m_rareNonInheritedData.access().justifySelf.setPosition(position); } |
1090 | |
1091 | #if ENABLE(CSS_BOX_DECORATION_BREAK) |
1092 | void setBoxDecorationBreak(BoxDecorationBreak b) { SET_VAR(m_boxData, m_boxDecorationBreak, static_cast<unsigned>(b)); } |
1093 | #endif |
1094 | |
1095 | void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoColumns, trackSizeList); } |
1096 | void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRows, trackSizeList); } |
1097 | void setGridColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridColumns, lengths); } |
1098 | void setGridRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridRows, lengths); } |
1099 | void setGridAutoRepeatColumns(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRepeatColumns, lengths); } |
1100 | void setGridAutoRepeatRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoRepeatRows, lengths); } |
1101 | void setGridAutoRepeatColumnsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatColumnsInsertionPoint, insertionPoint); } |
1102 | void setGridAutoRepeatRowsInsertionPoint(const unsigned insertionPoint) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatRowsInsertionPoint, insertionPoint); } |
1103 | void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatColumnsType, autoRepeatType); } |
1104 | void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatRowsType, autoRepeatType); } |
1105 | void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridColumnLines, namedGridColumnLines); } |
1106 | void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridRowLines, namedGridRowLines); } |
1107 | void setOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, orderedNamedGridColumnLines, orderedNamedGridColumnLines); } |
1108 | void setOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, orderedNamedGridRowLines, orderedNamedGridRowLines); } |
1109 | void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatNamedGridColumnLines, namedGridColumnLines); } |
1110 | void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatNamedGridRowLines, namedGridRowLines); } |
1111 | void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLinesMap& orderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); } |
1112 | void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLinesMap& orderedNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, grid, autoRepeatOrderedNamedGridRowLines, orderedNamedGridRowLines); } |
1113 | void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridArea, namedGridArea); } |
1114 | void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridAreaRowCount, rowCount); } |
1115 | void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(m_rareNonInheritedData, grid, namedGridAreaColumnCount, columnCount); } |
1116 | void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(m_rareNonInheritedData, grid, gridAutoFlow, flow); } |
1117 | void setGridItemColumnStart(const GridPosition& columnStartPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridColumnStart, columnStartPosition); } |
1118 | void setGridItemColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridColumnEnd, columnEndPosition); } |
1119 | void setGridItemRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowStart, rowStartPosition); } |
1120 | void setGridItemRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(m_rareNonInheritedData, gridItem, gridRowEnd, rowEndPosition); } |
1121 | |
1122 | void setMarqueeIncrement(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, increment, WTFMove(length)); } |
1123 | void setMarqueeSpeed(int f) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, speed, f); } |
1124 | void setMarqueeDirection(MarqueeDirection d) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, direction, static_cast<unsigned>(d)); } |
1125 | void setMarqueeBehavior(MarqueeBehavior b) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, behavior, static_cast<unsigned>(b)); } |
1126 | void setMarqueeLoopCount(int i) { SET_NESTED_VAR(m_rareNonInheritedData, marquee, loops, i); } |
1127 | void setUserModify(UserModify u) { SET_VAR(m_rareInheritedData, userModify, static_cast<unsigned>(u)); } |
1128 | void setUserDrag(UserDrag d) { SET_VAR(m_rareNonInheritedData, userDrag, static_cast<unsigned>(d)); } |
1129 | void setUserSelect(UserSelect s) { SET_VAR(m_rareInheritedData, userSelect, static_cast<unsigned>(s)); } |
1130 | void setTextOverflow(TextOverflow overflow) { SET_VAR(m_rareNonInheritedData, textOverflow, static_cast<unsigned>(overflow)); } |
1131 | void setMarginBeforeCollapse(MarginCollapse c) { SET_VAR(m_rareNonInheritedData, marginBeforeCollapse, static_cast<unsigned>(c)); } |
1132 | void setMarginAfterCollapse(MarginCollapse c) { SET_VAR(m_rareNonInheritedData, marginAfterCollapse, static_cast<unsigned>(c)); } |
1133 | void setWordBreak(WordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, static_cast<unsigned>(b)); } |
1134 | void setOverflowWrap(OverflowWrap b) { SET_VAR(m_rareInheritedData, overflowWrap, static_cast<unsigned>(b)); } |
1135 | void setNBSPMode(NBSPMode b) { SET_VAR(m_rareInheritedData, nbspMode, static_cast<unsigned>(b)); } |
1136 | void setLineBreak(LineBreak b) { SET_VAR(m_rareInheritedData, lineBreak, static_cast<unsigned>(b)); } |
1137 | void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, static_cast<unsigned>(h)); } |
1138 | void setHyphenationLimitBefore(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitBefore, limit); } |
1139 | void setHyphenationLimitAfter(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitAfter, limit); } |
1140 | void setHyphenationLimitLines(short limit) { SET_VAR(m_rareInheritedData, hyphenationLimitLines, limit); } |
1141 | void setHyphenationString(const AtomicString& h) { SET_VAR(m_rareInheritedData, hyphenationString, h); } |
1142 | void setBorderFit(BorderFit b) { SET_VAR(m_rareNonInheritedData, borderFit, static_cast<unsigned>(b)); } |
1143 | void setResize(Resize r) { SET_VAR(m_rareNonInheritedData, resize, static_cast<unsigned>(r)); } |
1144 | void setColumnAxis(ColumnAxis axis) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, axis, static_cast<unsigned>(axis)); } |
1145 | void setColumnProgression(ColumnProgression progression) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, progression, static_cast<unsigned>(progression)); } |
1146 | void setColumnWidth(float f) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoWidth, false); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, width, f); } |
1147 | void setHasAutoColumnWidth() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoWidth, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, width, 0); } |
1148 | void setColumnCount(unsigned short c) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoCount, false); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, count, c); } |
1149 | void setHasAutoColumnCount() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, autoCount, true); SET_NESTED_VAR(m_rareNonInheritedData, multiCol, count, 0); } |
1150 | void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, fill, static_cast<unsigned>(columnFill)); } |
1151 | void setColumnGap(GapLength&& gapLength) { SET_VAR(m_rareNonInheritedData, columnGap, WTFMove(gapLength)); } |
1152 | void setRowGap(GapLength&& gapLength) { SET_VAR(m_rareNonInheritedData, rowGap, WTFMove(gapLength)); } |
1153 | void setColumnRuleColor(const Color& c) { SET_BORDERVALUE_COLOR(m_rareNonInheritedData.access().multiCol, rule, c); } |
1154 | void setColumnRuleStyle(BorderStyle b) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule.m_style, static_cast<unsigned>(b)); } |
1155 | void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule.m_width, w); } |
1156 | void resetColumnRule() { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, rule, BorderValue()); } |
1157 | void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, columnSpan, static_cast<unsigned>(columnSpan)); } |
1158 | void inheritColumnPropertiesFrom(const RenderStyle& parent) { m_rareNonInheritedData.access().multiCol = parent.m_rareNonInheritedData->multiCol; } |
1159 | |
1160 | void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, transform, operations, ops); } |
1161 | void setTransformOriginX(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, transform, x, WTFMove(length)); } |
1162 | void setTransformOriginY(Length&& length) { SET_NESTED_VAR(m_rareNonInheritedData, transform, y, WTFMove(length)); } |
1163 | void setTransformOriginZ(float f) { SET_NESTED_VAR(m_rareNonInheritedData, transform, z, f); } |
1164 | void setTransformBox(TransformBox box) { SET_NESTED_VAR(m_rareNonInheritedData, transform, transformBox, box); } |
1165 | |
1166 | void setSpeakAs(OptionSet<SpeakAs> s) { SET_VAR(m_rareInheritedData, speakAs, s.toRaw()); } |
1167 | void setTextCombine(TextCombine v) { SET_VAR(m_rareNonInheritedData, textCombine, static_cast<unsigned>(v)); } |
1168 | void setTextDecorationColor(const Color& c) { SET_VAR(m_rareNonInheritedData, textDecorationColor, c); } |
1169 | void setTextEmphasisColor(const Color& c) { SET_VAR(m_rareInheritedData, textEmphasisColor, c); } |
1170 | void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(m_rareInheritedData, textEmphasisFill, static_cast<unsigned>(fill)); } |
1171 | void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(m_rareInheritedData, textEmphasisMark, static_cast<unsigned>(mark)); } |
1172 | void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(m_rareInheritedData, textEmphasisCustomMark, mark); } |
1173 | void setTextEmphasisPosition(OptionSet<TextEmphasisPosition> position) { SET_VAR(m_rareInheritedData, textEmphasisPosition, static_cast<unsigned>(position.toRaw())); } |
1174 | bool setTextOrientation(TextOrientation); |
1175 | |
1176 | void setObjectFit(ObjectFit fit) { SET_VAR(m_rareNonInheritedData, objectFit, static_cast<unsigned>(fit)); } |
1177 | void setObjectPosition(LengthPoint&& position) { SET_VAR(m_rareNonInheritedData, objectPosition, WTFMove(position)); } |
1178 | |
1179 | void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, rubyPosition, static_cast<unsigned>(position)); } |
1180 | |
1181 | #if ENABLE(DARK_MODE_CSS) |
1182 | void setColorScheme(StyleColorScheme supported) { SET_VAR(m_rareInheritedData, colorScheme, supported); } |
1183 | #endif |
1184 | |
1185 | void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, filter, operations, ops); } |
1186 | void setAppleColorFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareInheritedData, appleColorFilter, operations, ops); } |
1187 | |
1188 | #if ENABLE(FILTERS_LEVEL_2) |
1189 | void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheritedData, backdropFilter, operations, ops); } |
1190 | #endif |
1191 | |
1192 | void setTabSize(unsigned size) { SET_VAR(m_rareInheritedData, tabSize, size); } |
1193 | |
1194 | void setBreakBefore(BreakBetween breakBehavior) { SET_VAR(m_rareNonInheritedData, breakBefore, static_cast<unsigned>(breakBehavior)); } |
1195 | void setBreakAfter(BreakBetween breakBehavior) { SET_VAR(m_rareNonInheritedData, breakAfter, static_cast<unsigned>(breakBehavior)); } |
1196 | void setBreakInside(BreakInside breakBehavior) { SET_VAR(m_rareNonInheritedData, breakInside, static_cast<unsigned>(breakBehavior)); } |
1197 | |
1198 | void setHangingPunctuation(OptionSet<HangingPunctuation> punctuation) { SET_VAR(m_rareInheritedData, hangingPunctuation, punctuation.toRaw()); } |
1199 | |
1200 | // End CSS3 Setters |
1201 | |
1202 | void setLineGrid(const AtomicString& lineGrid) { SET_VAR(m_rareInheritedData, lineGrid, lineGrid); } |
1203 | void setLineSnap(LineSnap lineSnap) { SET_VAR(m_rareInheritedData, lineSnap, static_cast<unsigned>(lineSnap)); } |
1204 | void setLineAlign(LineAlign lineAlign) { SET_VAR(m_rareInheritedData, lineAlign, static_cast<unsigned>(lineAlign)); } |
1205 | |
1206 | void setPointerEvents(PointerEvents p) { m_inheritedFlags.pointerEvents = static_cast<unsigned>(p); } |
1207 | |
1208 | void clearAnimations(); |
1209 | void clearTransitions(); |
1210 | |
1211 | void adjustAnimations(); |
1212 | void adjustTransitions(); |
1213 | |
1214 | void setTransformStyle3D(TransformStyle3D b) { SET_VAR(m_rareNonInheritedData, transformStyle3D, static_cast<unsigned>(b)); } |
1215 | void setBackfaceVisibility(BackfaceVisibility b) { SET_VAR(m_rareNonInheritedData, backfaceVisibility, static_cast<unsigned>(b)); } |
1216 | void setPerspective(float p) { SET_VAR(m_rareNonInheritedData, perspective, p); } |
1217 | void setPerspectiveOriginX(Length&& length) { SET_VAR(m_rareNonInheritedData, perspectiveOriginX, WTFMove(length)); } |
1218 | void setPerspectiveOriginY(Length&& length) { SET_VAR(m_rareNonInheritedData, perspectiveOriginY, WTFMove(length)); } |
1219 | void setPageSize(LengthSize size) { SET_VAR(m_rareNonInheritedData, pageSize, WTFMove(size)); } |
1220 | void setPageSizeType(PageSizeType t) { SET_VAR(m_rareNonInheritedData, pageSizeType, t); } |
1221 | void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, pageSizeType, PAGE_SIZE_AUTO); } |
1222 | |
1223 | void setLineBoxContain(LineBoxContain c) { SET_VAR(m_rareInheritedData, lineBoxContain, c); } |
1224 | void setLineClamp(LineClampValue c) { SET_VAR(m_rareNonInheritedData, lineClamp, c); } |
1225 | |
1226 | void setInitialLetter(const IntSize& size) { SET_VAR(m_rareNonInheritedData, initialLetter, size); } |
1227 | |
1228 | #if ENABLE(POINTER_EVENTS) |
1229 | void setTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareNonInheritedData, touchActions, touchActions.toRaw()); } |
1230 | void setEffectiveTouchActions(OptionSet<TouchAction> touchActions) { SET_VAR(m_rareInheritedData, effectiveTouchActions, touchActions.toRaw()); } |
1231 | #endif |
1232 | |
1233 | #if ENABLE(CSS_SCROLL_SNAP) |
1234 | void setScrollSnapType(const ScrollSnapType&); |
1235 | void setScrollPaddingTop(Length&&); |
1236 | void setScrollPaddingBottom(Length&&); |
1237 | void setScrollPaddingLeft(Length&&); |
1238 | void setScrollPaddingRight(Length&&); |
1239 | |
1240 | void setScrollSnapAlign(const ScrollSnapAlign&); |
1241 | void setScrollSnapMarginTop(Length&&); |
1242 | void setScrollSnapMarginBottom(Length&&); |
1243 | void setScrollSnapMarginLeft(Length&&); |
1244 | void setScrollSnapMarginRight(Length&&); |
1245 | #endif |
1246 | |
1247 | #if ENABLE(TOUCH_EVENTS) |
1248 | void setTapHighlightColor(const Color& c) { SET_VAR(m_rareInheritedData, tapHighlightColor, c); } |
1249 | #endif |
1250 | |
1251 | #if PLATFORM(IOS_FAMILY) |
1252 | void setTouchCalloutEnabled(bool v) { SET_VAR(m_rareInheritedData, touchCalloutEnabled, v); } |
1253 | #endif |
1254 | |
1255 | #if ENABLE(OVERFLOW_SCROLLING_TOUCH) |
1256 | void setUseTouchOverflowScrolling(bool v) { SET_VAR(m_rareInheritedData, useTouchOverflowScrolling, v); } |
1257 | #endif |
1258 | |
1259 | #if ENABLE(TEXT_AUTOSIZING) |
1260 | void setTextSizeAdjust(TextSizeAdjustment adjustment) { SET_VAR(m_rareInheritedData, textSizeAdjust, adjustment); } |
1261 | #endif |
1262 | |
1263 | void setTextSecurity(TextSecurity security) { SET_VAR(m_rareInheritedData, textSecurity, static_cast<unsigned>(security)); } |
1264 | |
1265 | #if ENABLE(CSS_TRAILING_WORD) |
1266 | void setTrailingWord(TrailingWord) { } |
1267 | #endif |
1268 | |
1269 | #if ENABLE(APPLE_PAY) |
1270 | void setApplePayButtonStyle(ApplePayButtonStyle style) { SET_VAR(m_rareNonInheritedData, applePayButtonStyle, static_cast<unsigned>(style)); } |
1271 | void setApplePayButtonType(ApplePayButtonType type) { SET_VAR(m_rareNonInheritedData, applePayButtonType, static_cast<unsigned>(type)); } |
1272 | #endif |
1273 | |
1274 | #if ENABLE(CSS_PAINTING_API) |
1275 | void addCustomPaintWatchProperty(const String& name); |
1276 | #endif |
1277 | |
1278 | // Support for paint-order, stroke-linecap, stroke-linejoin, and stroke-miterlimit from https://drafts.fxtf.org/paint/. |
1279 | void setPaintOrder(PaintOrder order) { SET_VAR(m_rareInheritedData, paintOrder, static_cast<unsigned>(order)); } |
1280 | PaintOrder paintOrder() const { return static_cast<PaintOrder>(m_rareInheritedData->paintOrder); } |
1281 | static PaintOrder initialPaintOrder() { return PaintOrder::Normal; } |
1282 | static Vector<PaintType, 3> paintTypesForPaintOrder(PaintOrder); |
1283 | |
1284 | void setCapStyle(LineCap val) { SET_VAR(m_rareInheritedData, capStyle, val); } |
1285 | LineCap capStyle() const { return static_cast<LineCap>(m_rareInheritedData->capStyle); } |
1286 | static LineCap initialCapStyle() { return ButtCap; } |
1287 | |
1288 | void setJoinStyle(LineJoin val) { SET_VAR(m_rareInheritedData, joinStyle, val); } |
1289 | LineJoin joinStyle() const { return static_cast<LineJoin>(m_rareInheritedData->joinStyle); } |
1290 | static LineJoin initialJoinStyle() { return MiterJoin; } |
1291 | |
1292 | const Length& strokeWidth() const { return m_rareInheritedData->strokeWidth; } |
1293 | void setStrokeWidth(Length&& w) { SET_VAR(m_rareInheritedData, strokeWidth, WTFMove(w)); } |
1294 | bool hasVisibleStroke() const { return svgStyle().hasStroke() && !strokeWidth().isZero(); } |
1295 | static Length initialStrokeWidth() { return initialOneLength(); } |
1296 | |
1297 | float computedStrokeWidth(const IntSize& viewportSize) const; |
1298 | void setHasExplicitlySetStrokeWidth(bool v) { SET_VAR(m_rareInheritedData, hasSetStrokeWidth, static_cast<unsigned>(v)); } |
1299 | bool hasExplicitlySetStrokeWidth() const { return m_rareInheritedData->hasSetStrokeWidth; }; |
1300 | bool hasPositiveStrokeWidth() const; |
1301 | |
1302 | Color strokeColor() const { return m_rareInheritedData->strokeColor; } |
1303 | void setStrokeColor(const Color& v) { SET_VAR(m_rareInheritedData, strokeColor, v); } |
1304 | void setVisitedLinkStrokeColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkStrokeColor, v); } |
1305 | const Color& visitedLinkStrokeColor() const { return m_rareInheritedData->visitedLinkStrokeColor; } |
1306 | void setHasExplicitlySetStrokeColor(bool v) { SET_VAR(m_rareInheritedData, hasSetStrokeColor, static_cast<unsigned>(v)); } |
1307 | bool hasExplicitlySetStrokeColor() const { return m_rareInheritedData->hasSetStrokeColor; }; |
1308 | static Color initialStrokeColor() { return Color(Color::transparent); } |
1309 | Color computedStrokeColor() const; |
1310 | |
1311 | float strokeMiterLimit() const { return m_rareInheritedData->miterLimit; } |
1312 | void setStrokeMiterLimit(float f) { SET_VAR(m_rareInheritedData, miterLimit, f); } |
1313 | static float initialStrokeMiterLimit() { return defaultMiterLimit; } |
1314 | |
1315 | |
1316 | const SVGRenderStyle& svgStyle() const { return m_svgStyle; } |
1317 | SVGRenderStyle& accessSVGStyle() { return m_svgStyle.access(); } |
1318 | |
1319 | SVGPaintType fillPaintType() const { return svgStyle().fillPaintType(); } |
1320 | Color fillPaintColor() const { return svgStyle().fillPaintColor(); } |
1321 | void setFillPaintColor(const Color& color) { accessSVGStyle().setFillPaint(SVGPaintType::RGBColor, color, emptyString()); } |
1322 | float fillOpacity() const { return svgStyle().fillOpacity(); } |
1323 | void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); } |
1324 | |
1325 | SVGPaintType strokePaintType() const { return svgStyle().strokePaintType(); } |
1326 | Color strokePaintColor() const { return svgStyle().strokePaintColor(); } |
1327 | void setStrokePaintColor(const Color& color) { accessSVGStyle().setStrokePaint(SVGPaintType::RGBColor, color, emptyString()); } |
1328 | float strokeOpacity() const { return svgStyle().strokeOpacity(); } |
1329 | void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } |
1330 | Vector<SVGLengthValue> strokeDashArray() const { return svgStyle().strokeDashArray(); } |
1331 | void setStrokeDashArray(Vector<SVGLengthValue> array) { accessSVGStyle().setStrokeDashArray(array); } |
1332 | const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(); } |
1333 | void setStrokeDashOffset(Length&& d) { accessSVGStyle().setStrokeDashOffset(WTFMove(d)); } |
1334 | |
1335 | const Length& cx() const { return svgStyle().cx(); } |
1336 | void setCx(Length&& cx) { accessSVGStyle().setCx(WTFMove(cx)); } |
1337 | const Length& cy() const { return svgStyle().cy(); } |
1338 | void setCy(Length&& cy) { accessSVGStyle().setCy(WTFMove(cy)); } |
1339 | const Length& r() const { return svgStyle().r(); } |
1340 | void setR(Length&& r) { accessSVGStyle().setR(WTFMove(r)); } |
1341 | const Length& rx() const { return svgStyle().rx(); } |
1342 | void setRx(Length&& rx) { accessSVGStyle().setRx(WTFMove(rx)); } |
1343 | const Length& ry() const { return svgStyle().ry(); } |
1344 | void setRy(Length&& ry) { accessSVGStyle().setRy(WTFMove(ry)); } |
1345 | const Length& x() const { return svgStyle().x(); } |
1346 | void setX(Length&& x) { accessSVGStyle().setX(WTFMove(x)); } |
1347 | const Length& y() const { return svgStyle().y(); } |
1348 | void setY(Length&& y) { accessSVGStyle().setY(WTFMove(y)); } |
1349 | |
1350 | float floodOpacity() const { return svgStyle().floodOpacity(); } |
1351 | void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); } |
1352 | |
1353 | float stopOpacity() const { return svgStyle().stopOpacity(); } |
1354 | void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); } |
1355 | |
1356 | void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); } |
1357 | void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); } |
1358 | void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c); } |
1359 | |
1360 | SVGLengthValue baselineShiftValue() const { return svgStyle().baselineShiftValue(); } |
1361 | void setBaselineShiftValue(SVGLengthValue s) { accessSVGStyle().setBaselineShiftValue(s); } |
1362 | SVGLengthValue kerning() const { return svgStyle().kerning(); } |
1363 | void setKerning(SVGLengthValue k) { accessSVGStyle().setKerning(k); } |
1364 | |
1365 | void setShapeOutside(RefPtr<ShapeValue>&&); |
1366 | ShapeValue* shapeOutside() const { return m_rareNonInheritedData->shapeOutside.get(); } |
1367 | static ShapeValue* initialShapeOutside() { return nullptr; } |
1368 | |
1369 | const Length& shapeMargin() const { return m_rareNonInheritedData->shapeMargin; } |
1370 | void setShapeMargin(Length&& shapeMargin) { SET_VAR(m_rareNonInheritedData, shapeMargin, WTFMove(shapeMargin)); } |
1371 | static Length initialShapeMargin() { return Length(0, Fixed); } |
1372 | |
1373 | float shapeImageThreshold() const { return m_rareNonInheritedData->shapeImageThreshold; } |
1374 | void setShapeImageThreshold(float); |
1375 | static float initialShapeImageThreshold() { return 0; } |
1376 | |
1377 | void setClipPath(RefPtr<ClipPathOperation>&&); |
1378 | ClipPathOperation* clipPath() const { return m_rareNonInheritedData->clipPath.get(); } |
1379 | static ClipPathOperation* initialClipPath() { return nullptr; } |
1380 | |
1381 | bool hasContent() const { return contentData(); } |
1382 | const ContentData* contentData() const { return m_rareNonInheritedData->content.get(); } |
1383 | bool contentDataEquivalent(const RenderStyle* otherStyle) const { return const_cast<RenderStyle*>(this)->m_rareNonInheritedData->contentDataEquivalent(*const_cast<RenderStyle*>(otherStyle)->m_rareNonInheritedData); } |
1384 | void clearContent(); |
1385 | void setContent(const String&, bool add = false); |
1386 | void setContent(RefPtr<StyleImage>&&, bool add = false); |
1387 | void setContent(std::unique_ptr<CounterContent>, bool add = false); |
1388 | void setContent(QuoteType, bool add = false); |
1389 | void setContentAltText(const String&); |
1390 | const String& contentAltText() const; |
1391 | bool hasAttrContent() const { return m_rareNonInheritedData->hasAttrContent; } |
1392 | void setHasAttrContent(); |
1393 | |
1394 | const CounterDirectiveMap* counterDirectives() const; |
1395 | CounterDirectiveMap& accessCounterDirectives(); |
1396 | |
1397 | QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); } |
1398 | void setQuotes(RefPtr<QuotesData>&&); |
1399 | |
1400 | WillChangeData* willChange() const { return m_rareNonInheritedData->willChange.get(); } |
1401 | void setWillChange(RefPtr<WillChangeData>&&); |
1402 | |
1403 | bool willChangeCreatesStackingContext() const; |
1404 | |
1405 | const AtomicString& hyphenString() const; |
1406 | |
1407 | bool inheritedNotEqual(const RenderStyle*) const; |
1408 | bool inheritedDataShared(const RenderStyle*) const; |
1409 | |
1410 | #if ENABLE(TEXT_AUTOSIZING) |
1411 | uint32_t hashForTextAutosizing() const; |
1412 | bool equalForTextAutosizing(const RenderStyle&) const; |
1413 | #endif |
1414 | |
1415 | StyleDifference diff(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1416 | bool diffRequiresLayerRepaint(const RenderStyle&, bool isComposited) const; |
1417 | |
1418 | bool isDisplayInlineType() const { return isDisplayInlineType(display()); } |
1419 | bool isOriginalDisplayInlineType() const { return isDisplayInlineType(originalDisplay()); } |
1420 | bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleOrGridBox(display()); } |
1421 | bool isDisplayRegionType() const; |
1422 | |
1423 | bool setWritingMode(WritingMode); |
1424 | |
1425 | bool hasExplicitlySetWritingMode() const { return m_nonInheritedFlags.hasExplicitlySetWritingMode; } |
1426 | void setHasExplicitlySetWritingMode(bool v) { m_nonInheritedFlags.hasExplicitlySetWritingMode = v; } |
1427 | |
1428 | bool hasExplicitlySetTextAlign() const { return m_nonInheritedFlags.hasExplicitlySetTextAlign; } |
1429 | void setHasExplicitlySetTextAlign(bool v) { m_nonInheritedFlags.hasExplicitlySetTextAlign = v; } |
1430 | |
1431 | // A unique style is one that has matches something that makes it impossible to share. |
1432 | bool unique() const { return m_nonInheritedFlags.isUnique; } |
1433 | void setUnique() { m_nonInheritedFlags.isUnique = true; } |
1434 | |
1435 | bool emptyState() const { return m_nonInheritedFlags.emptyState; } |
1436 | void setEmptyState(bool v) { setUnique(); m_nonInheritedFlags.emptyState = v; } |
1437 | bool firstChildState() const { return m_nonInheritedFlags.firstChildState; } |
1438 | void setFirstChildState() { setUnique(); m_nonInheritedFlags.firstChildState = true; } |
1439 | bool lastChildState() const { return m_nonInheritedFlags.lastChildState; } |
1440 | void setLastChildState() { setUnique(); m_nonInheritedFlags.lastChildState = true; } |
1441 | |
1442 | WEBCORE_EXPORT Color visitedDependentColor(CSSPropertyID) const; |
1443 | WEBCORE_EXPORT Color visitedDependentColorWithColorFilter(CSSPropertyID) const; |
1444 | |
1445 | WEBCORE_EXPORT Color colorByApplyingColorFilter(const Color&) const; |
1446 | |
1447 | bool backgroundColorEqualsToColorIgnoringVisited(const Color& color) const { return color == backgroundColor(); } |
1448 | |
1449 | void setHasExplicitlyInheritedProperties() { m_nonInheritedFlags.hasExplicitlyInheritedProperties = true; } |
1450 | bool hasExplicitlyInheritedProperties() const { return m_nonInheritedFlags.hasExplicitlyInheritedProperties; } |
1451 | |
1452 | // Initial values for all the properties |
1453 | static Overflow initialOverflowX() { return Overflow::Visible; } |
1454 | static Overflow initialOverflowY() { return Overflow::Visible; } |
1455 | static Clear initialClear() { return Clear::None; } |
1456 | static DisplayType initialDisplay() { return DisplayType::Inline; } |
1457 | static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } |
1458 | static PositionType initialPosition() { return PositionType::Static; } |
1459 | static VerticalAlign initialVerticalAlign() { return VerticalAlign::Baseline; } |
1460 | static Float initialFloating() { return Float::No; } |
1461 | static BreakBetween initialBreakBetween() { return BreakBetween::Auto; } |
1462 | static BreakInside initialBreakInside() { return BreakInside::Auto; } |
1463 | static OptionSet<HangingPunctuation> initialHangingPunctuation() { return OptionSet<HangingPunctuation> { }; } |
1464 | static TableLayoutType initialTableLayout() { return TableLayoutType::Auto; } |
1465 | static BorderCollapse initialBorderCollapse() { return BorderCollapse::Separate; } |
1466 | static BorderStyle initialBorderStyle() { return BorderStyle::None; } |
1467 | static OutlineIsAuto initialOutlineStyleIsAuto() { return OutlineIsAuto::Off; } |
1468 | static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } |
1469 | static LengthSize initialBorderRadius() { return { { 0, Fixed }, { 0, Fixed } }; } |
1470 | static CaptionSide initialCaptionSide() { return CaptionSide::Top; } |
1471 | static ColumnAxis initialColumnAxis() { return ColumnAxis::Auto; } |
1472 | static ColumnProgression initialColumnProgression() { return ColumnProgression::Normal; } |
1473 | static TextDirection initialDirection() { return TextDirection::LTR; } |
1474 | static WritingMode initialWritingMode() { return TopToBottomWritingMode; } |
1475 | static TextCombine initialTextCombine() { return TextCombine::None; } |
1476 | static TextOrientation initialTextOrientation() { return TextOrientation::Mixed; } |
1477 | static ObjectFit initialObjectFit() { return ObjectFit::Fill; } |
1478 | static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0f, Percent), Length(50.0f, Percent)); } |
1479 | static EmptyCell initialEmptyCells() { return EmptyCell::Show; } |
1480 | static ListStylePosition initialListStylePosition() { return ListStylePosition::Outside; } |
1481 | static ListStyleType initialListStyleType() { return ListStyleType::Disc; } |
1482 | static TextTransform initialTextTransform() { return TextTransform::None; } |
1483 | static Visibility initialVisibility() { return Visibility::Visible; } |
1484 | static WhiteSpace initialWhiteSpace() { return WhiteSpace::Normal; } |
1485 | static float initialHorizontalBorderSpacing() { return 0; } |
1486 | static float initialVerticalBorderSpacing() { return 0; } |
1487 | static CursorType initialCursor() { return CursorType::Auto; } |
1488 | static Color initialColor() { return Color::black; } |
1489 | static StyleImage* initialListStyleImage() { return 0; } |
1490 | static float initialBorderWidth() { return 3; } |
1491 | static unsigned short initialColumnRuleWidth() { return 3; } |
1492 | static float initialOutlineWidth() { return 3; } |
1493 | static float initialLetterSpacing() { return 0; } |
1494 | static Length initialWordSpacing() { return Length(Fixed); } |
1495 | static Length initialSize() { return Length(); } |
1496 | static Length initialMinSize() { return Length(); } |
1497 | static Length initialMaxSize() { return Length(Undefined); } |
1498 | static Length initialOffset() { return Length(); } |
1499 | static Length initialMargin() { return Length(Fixed); } |
1500 | static Length initialPadding() { return Length(Fixed); } |
1501 | static Length initialTextIndent() { return Length(Fixed); } |
1502 | static Length initialZeroLength() { return Length(Fixed); } |
1503 | static Length initialOneLength() { return Length(1, Fixed); } |
1504 | static short initialWidows() { return 2; } |
1505 | static short initialOrphans() { return 2; } |
1506 | static Length initialLineHeight() { return Length(-100.0f, Percent); } |
1507 | static TextAlignMode initialTextAlign() { return TextAlignMode::Start; } |
1508 | static OptionSet<TextDecoration> initialTextDecoration() { return OptionSet<TextDecoration> { }; } |
1509 | static TextDecorationStyle initialTextDecorationStyle() { return TextDecorationStyle::Solid; } |
1510 | static OptionSet<TextDecorationSkip> initialTextDecorationSkip() { return TextDecorationSkip::Auto; } |
1511 | static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnderlinePosition::Auto; } |
1512 | static TextUnderlineOffset initialTextUnderlineOffset() { return TextUnderlineOffset::createWithAuto(); } |
1513 | static TextDecorationThickness initialTextDecorationThickness() { return TextDecorationThickness::createWithAuto(); } |
1514 | static float initialZoom() { return 1.0f; } |
1515 | static TextZoom initialTextZoom() { return TextZoom::Normal; } |
1516 | static float initialOutlineOffset() { return 0; } |
1517 | static float initialOpacity() { return 1.0f; } |
1518 | static BoxAlignment initialBoxAlign() { return BoxAlignment::Stretch; } |
1519 | static BoxDecorationBreak initialBoxDecorationBreak() { return BoxDecorationBreak::Slice; } |
1520 | static BoxDirection initialBoxDirection() { return BoxDirection::Normal; } |
1521 | static BoxLines initialBoxLines() { return BoxLines::Single; } |
1522 | static BoxOrient initialBoxOrient() { return BoxOrient::Horizontal; } |
1523 | static BoxPack initialBoxPack() { return BoxPack::Start; } |
1524 | static float initialBoxFlex() { return 0.0f; } |
1525 | static unsigned initialBoxFlexGroup() { return 1; } |
1526 | static unsigned initialBoxOrdinalGroup() { return 1; } |
1527 | static BoxSizing initialBoxSizing() { return BoxSizing::ContentBox; } |
1528 | static StyleReflection* initialBoxReflect() { return 0; } |
1529 | static float initialFlexGrow() { return 0; } |
1530 | static float initialFlexShrink() { return 1; } |
1531 | static Length initialFlexBasis() { return Length(Auto); } |
1532 | static int initialOrder() { return 0; } |
1533 | static StyleSelfAlignmentData initialJustifyItems() { return StyleSelfAlignmentData(ItemPosition::Legacy, OverflowAlignment::Default); } |
1534 | static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlignmentData(ItemPosition::Auto, OverflowAlignment::Default); } |
1535 | static StyleSelfAlignmentData initialDefaultAlignment() { return StyleSelfAlignmentData(ItemPosition::Normal, OverflowAlignment::Default); } |
1536 | static StyleContentAlignmentData initialContentAlignment() { return StyleContentAlignmentData(ContentPosition::Normal, ContentDistribution::Default, OverflowAlignment::Default); } |
1537 | static FlexDirection initialFlexDirection() { return FlexDirection::Row; } |
1538 | static FlexWrap initialFlexWrap() { return FlexWrap::NoWrap; } |
1539 | static int initialMarqueeLoopCount() { return -1; } |
1540 | static int initialMarqueeSpeed() { return 85; } |
1541 | static Length initialMarqueeIncrement() { return Length(6, Fixed); } |
1542 | static MarqueeBehavior initialMarqueeBehavior() { return MarqueeBehavior::Scroll; } |
1543 | static MarqueeDirection initialMarqueeDirection() { return MarqueeDirection::Auto; } |
1544 | static UserModify initialUserModify() { return UserModify::ReadOnly; } |
1545 | static UserDrag initialUserDrag() { return UserDrag::Auto; } |
1546 | static UserSelect initialUserSelect() { return UserSelect::Text; } |
1547 | static TextOverflow initialTextOverflow() { return TextOverflow::Clip; } |
1548 | static MarginCollapse initialMarginBeforeCollapse() { return MarginCollapse::Collapse; } |
1549 | static MarginCollapse initialMarginAfterCollapse() { return MarginCollapse::Collapse; } |
1550 | static WordBreak initialWordBreak() { return WordBreak::Normal; } |
1551 | static OverflowWrap initialOverflowWrap() { return OverflowWrap::Normal; } |
1552 | static NBSPMode initialNBSPMode() { return NBSPMode::Normal; } |
1553 | static LineBreak initialLineBreak() { return LineBreak::Auto; } |
1554 | static OptionSet<SpeakAs> initialSpeakAs() { return OptionSet<SpeakAs> { }; } |
1555 | static Hyphens initialHyphens() { return Hyphens::Manual; } |
1556 | static short initialHyphenationLimitBefore() { return -1; } |
1557 | static short initialHyphenationLimitAfter() { return -1; } |
1558 | static short initialHyphenationLimitLines() { return -1; } |
1559 | static const AtomicString& initialHyphenationString() { return nullAtom(); } |
1560 | static BorderFit initialBorderFit() { return BorderFit::Border; } |
1561 | static Resize initialResize() { return Resize::None; } |
1562 | static ControlPart initialAppearance() { return NoControlPart; } |
1563 | static AspectRatioType initialAspectRatioType() { return AspectRatioType::Auto; } |
1564 | static float initialAspectRatioDenominator() { return 1; } |
1565 | static float initialAspectRatioNumerator() { return 1; } |
1566 | static Order initialRTLOrdering() { return Order::Logical; } |
1567 | static float initialTextStrokeWidth() { return 0; } |
1568 | static unsigned short initialColumnCount() { return 1; } |
1569 | static ColumnFill initialColumnFill() { return ColumnFill::Balance; } |
1570 | static ColumnSpan initialColumnSpan() { return ColumnSpan::None; } |
1571 | static GapLength initialColumnGap() { return GapLength(); } |
1572 | static GapLength initialRowGap() { return GapLength(); } |
1573 | static const TransformOperations& initialTransform() { static NeverDestroyed<TransformOperations> ops; return ops; } |
1574 | static Length initialTransformOriginX() { return Length(50.0f, Percent); } |
1575 | static Length initialTransformOriginY() { return Length(50.0f, Percent); } |
1576 | static TransformBox initialTransformBox() { return TransformBox::BorderBox; } |
1577 | static PointerEvents initialPointerEvents() { return PointerEvents::Auto; } |
1578 | static float initialTransformOriginZ() { return 0; } |
1579 | static TransformStyle3D initialTransformStyle3D() { return TransformStyle3D::Flat; } |
1580 | static BackfaceVisibility initialBackfaceVisibility() { return BackfaceVisibility::Visible; } |
1581 | static float initialPerspective() { return 0; } |
1582 | static Length initialPerspectiveOriginX() { return Length(50.0f, Percent); } |
1583 | static Length initialPerspectiveOriginY() { return Length(50.0f, Percent); } |
1584 | static Color initialBackgroundColor() { return Color::transparent; } |
1585 | static Color initialTextEmphasisColor() { return Color(); } |
1586 | static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFill::Filled; } |
1587 | static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMark::None; } |
1588 | static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom(); } |
1589 | static OptionSet<TextEmphasisPosition> initialTextEmphasisPosition() { return { TextEmphasisPosition::Over, TextEmphasisPosition::Right }; } |
1590 | static RubyPosition initialRubyPosition() { return RubyPosition::Before; } |
1591 | static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock | LineBoxContainInline | LineBoxContainReplaced; } |
1592 | static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft; } |
1593 | static ImageRendering initialImageRendering() { return ImageRendering::Auto; } |
1594 | static ImageResolutionSource initialImageResolutionSource() { return ImageResolutionSource::Specified; } |
1595 | static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolutionSnap::None; } |
1596 | static float initialImageResolution() { return 1; } |
1597 | static StyleImage* initialBorderImageSource() { return nullptr; } |
1598 | static StyleImage* initialMaskBoxImageSource() { return nullptr; } |
1599 | static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjust::Economy; } |
1600 | static QuotesData* initialQuotes() { return nullptr; } |
1601 | static const AtomicString& initialContentAltText() { return emptyAtom(); } |
1602 | |
1603 | #if ENABLE(DARK_MODE_CSS) |
1604 | static StyleColorScheme initialColorScheme() { return { }; } |
1605 | #endif |
1606 | |
1607 | #if ENABLE(CSS3_TEXT) |
1608 | static TextIndentLine initialTextIndentLine() { return TextIndentLine::FirstLine; } |
1609 | static TextIndentType initialTextIndentType() { return TextIndentType::Normal; } |
1610 | static TextAlignLast initialTextAlignLast() { return TextAlignLast::Auto; } |
1611 | static TextJustify initialTextJustify() { return TextJustify::Auto; } |
1612 | #endif |
1613 | |
1614 | #if ENABLE(CURSOR_VISIBILITY) |
1615 | static CursorVisibility initialCursorVisibility() { return CursorVisibility::Auto; } |
1616 | #endif |
1617 | |
1618 | #if ENABLE(TEXT_AUTOSIZING) |
1619 | static Length initialSpecifiedLineHeight() { return Length(-100.0f, Percent); } |
1620 | static TextSizeAdjustment initialTextSizeAdjust() { return TextSizeAdjustment(); } |
1621 | #endif |
1622 | |
1623 | static WillChangeData* initialWillChange() { return nullptr; } |
1624 | |
1625 | #if ENABLE(POINTER_EVENTS) |
1626 | static TouchAction initialTouchActions() { return TouchAction::Auto; } |
1627 | #endif |
1628 | |
1629 | #if ENABLE(CSS_SCROLL_SNAP) |
1630 | static ScrollSnapType initialScrollSnapType(); |
1631 | static ScrollSnapAlign initialScrollSnapAlign(); |
1632 | static Length initialScrollSnapMargin() { return Length(Fixed); } |
1633 | static Length initialScrollPadding() { return Length(Fixed); } |
1634 | #endif |
1635 | |
1636 | #if ENABLE(CSS_TRAILING_WORD) |
1637 | static TrailingWord initialTrailingWord() { return TrailingWord::Auto; } |
1638 | #endif |
1639 | |
1640 | #if ENABLE(APPLE_PAY) |
1641 | static ApplePayButtonStyle initialApplePayButtonStyle() { return ApplePayButtonStyle::Black; } |
1642 | static ApplePayButtonType initialApplePayButtonType() { return ApplePayButtonType::Plain; } |
1643 | #endif |
1644 | |
1645 | // The initial value is 'none' for grid tracks. |
1646 | static Vector<GridTrackSize> initialGridColumns() { return Vector<GridTrackSize>(); } |
1647 | static Vector<GridTrackSize> initialGridRows() { return Vector<GridTrackSize>(); } |
1648 | |
1649 | static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<GridTrackSize>(); } |
1650 | static unsigned initialGridAutoRepeatInsertionPoint() { return 0; } |
1651 | static AutoRepeatType initialGridAutoRepeatType() { return AutoRepeatType::None; } |
1652 | |
1653 | static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; } |
1654 | |
1655 | static Vector<GridTrackSize> initialGridAutoColumns() { return { GridTrackSize(Length(Auto)) }; } |
1656 | static Vector<GridTrackSize> initialGridAutoRows() { return { GridTrackSize(Length(Auto)) }; } |
1657 | |
1658 | static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap(); } |
1659 | static size_t initialNamedGridAreaCount() { return 0; } |
1660 | |
1661 | static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLinesMap(); } |
1662 | static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesMap(); } |
1663 | |
1664 | static OrderedNamedGridLinesMap initialOrderedNamedGridColumnLines() { return OrderedNamedGridLinesMap(); } |
1665 | static OrderedNamedGridLinesMap initialOrderedNamedGridRowLines() { return OrderedNamedGridLinesMap(); } |
1666 | |
1667 | // 'auto' is the default. |
1668 | static GridPosition initialGridItemColumnStart() { return GridPosition(); } |
1669 | static GridPosition initialGridItemColumnEnd() { return GridPosition(); } |
1670 | static GridPosition initialGridItemRowStart() { return GridPosition(); } |
1671 | static GridPosition initialGridItemRowEnd() { return GridPosition(); } |
1672 | |
1673 | static unsigned initialTabSize() { return 8; } |
1674 | |
1675 | static const AtomicString& initialLineGrid() { return nullAtom(); } |
1676 | static LineSnap initialLineSnap() { return LineSnap::None; } |
1677 | static LineAlign initialLineAlign() { return LineAlign::None; } |
1678 | |
1679 | static IntSize initialInitialLetter() { return IntSize(); } |
1680 | static LineClampValue initialLineClamp() { return LineClampValue(); } |
1681 | static TextSecurity initialTextSecurity() { return TextSecurity::None; } |
1682 | |
1683 | #if PLATFORM(IOS_FAMILY) |
1684 | static bool initialTouchCalloutEnabled() { return true; } |
1685 | #endif |
1686 | |
1687 | #if ENABLE(TOUCH_EVENTS) |
1688 | static Color initialTapHighlightColor(); |
1689 | #endif |
1690 | |
1691 | #if ENABLE(OVERFLOW_SCROLLING_TOUCH) |
1692 | static bool initialUseTouchOverflowScrolling() { return false; } |
1693 | #endif |
1694 | |
1695 | #if ENABLE(DASHBOARD_SUPPORT) |
1696 | static const Vector<StyleDashboardRegion>& initialDashboardRegions(); |
1697 | static const Vector<StyleDashboardRegion>& noneDashboardRegions(); |
1698 | #endif |
1699 | |
1700 | static const FilterOperations& initialFilter() { static NeverDestroyed<FilterOperations> ops; return ops; } |
1701 | static const FilterOperations& initialAppleColorFilter() { static NeverDestroyed<FilterOperations> ops; return ops; } |
1702 | |
1703 | #if ENABLE(FILTERS_LEVEL_2) |
1704 | static const FilterOperations& initialBackdropFilter() { static NeverDestroyed<FilterOperations> ops; return ops; } |
1705 | #endif |
1706 | |
1707 | #if ENABLE(CSS_COMPOSITING) |
1708 | static BlendMode initialBlendMode() { return BlendMode::Normal; } |
1709 | static Isolation initialIsolation() { return Isolation::Auto; } |
1710 | #endif |
1711 | |
1712 | // Indicates the style is likely to change due to a pending stylesheet load. |
1713 | bool isNotFinal() const { return m_rareNonInheritedData->isNotFinal; } |
1714 | void setIsNotFinal() { SET_VAR(m_rareNonInheritedData, isNotFinal, true); } |
1715 | |
1716 | void setVisitedLinkColor(const Color&); |
1717 | void setVisitedLinkBackgroundColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBackgroundColor, v); } |
1718 | void setVisitedLinkBorderLeftColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderLeftColor, v); } |
1719 | void setVisitedLinkBorderRightColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderRightColor, v); } |
1720 | void setVisitedLinkBorderBottomColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderBottomColor, v); } |
1721 | void setVisitedLinkBorderTopColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkBorderTopColor, v); } |
1722 | void setVisitedLinkOutlineColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkOutlineColor, v); } |
1723 | void setVisitedLinkColumnRuleColor(const Color& v) { SET_NESTED_VAR(m_rareNonInheritedData, multiCol, visitedLinkColumnRuleColor, v); } |
1724 | void setVisitedLinkTextDecorationColor(const Color& v) { SET_VAR(m_rareNonInheritedData, visitedLinkTextDecorationColor, v); } |
1725 | void setVisitedLinkTextEmphasisColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextEmphasisColor, v); } |
1726 | void setVisitedLinkTextFillColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextFillColor, v); } |
1727 | void setVisitedLinkTextStrokeColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkTextStrokeColor, v); } |
1728 | void setVisitedLinkCaretColor(const Color& v) { SET_VAR(m_rareInheritedData, visitedLinkCaretColor, v); } |
1729 | |
1730 | void inheritUnicodeBidiFrom(const RenderStyle* parent) { m_nonInheritedFlags.unicodeBidi = parent->m_nonInheritedFlags.unicodeBidi; } |
1731 | void getShadowExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const; |
1732 | void getShadowHorizontalExtent(const ShadowData*, LayoutUnit& left, LayoutUnit& right) const; |
1733 | void getShadowVerticalExtent(const ShadowData*, LayoutUnit& top, LayoutUnit& bottom) const; |
1734 | void getShadowInlineDirectionExtent(const ShadowData*, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const; |
1735 | void getShadowBlockDirectionExtent(const ShadowData*, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const; |
1736 | |
1737 | static Color invalidColor() { return Color(); } |
1738 | const Color& borderLeftColor() const { return m_surroundData->border.left().color(); } |
1739 | const Color& borderRightColor() const { return m_surroundData->border.right().color(); } |
1740 | const Color& borderTopColor() const { return m_surroundData->border.top().color(); } |
1741 | const Color& borderBottomColor() const { return m_surroundData->border.bottom().color(); } |
1742 | const Color& backgroundColor() const { return m_backgroundData->color; } |
1743 | const Color& color() const; |
1744 | const Color& columnRuleColor() const { return m_rareNonInheritedData->multiCol->rule.color(); } |
1745 | const Color& outlineColor() const { return m_backgroundData->outline.color(); } |
1746 | const Color& textEmphasisColor() const { return m_rareInheritedData->textEmphasisColor; } |
1747 | const Color& textFillColor() const { return m_rareInheritedData->textFillColor; } |
1748 | const Color& textStrokeColor() const { return m_rareInheritedData->textStrokeColor; } |
1749 | const Color& caretColor() const { return m_rareInheritedData->caretColor; } |
1750 | const Color& visitedLinkColor() const; |
1751 | const Color& visitedLinkBackgroundColor() const { return m_rareNonInheritedData->visitedLinkBackgroundColor; } |
1752 | const Color& visitedLinkBorderLeftColor() const { return m_rareNonInheritedData->visitedLinkBorderLeftColor; } |
1753 | const Color& visitedLinkBorderRightColor() const { return m_rareNonInheritedData->visitedLinkBorderRightColor; } |
1754 | const Color& visitedLinkBorderBottomColor() const { return m_rareNonInheritedData->visitedLinkBorderBottomColor; } |
1755 | const Color& visitedLinkBorderTopColor() const { return m_rareNonInheritedData->visitedLinkBorderTopColor; } |
1756 | const Color& visitedLinkOutlineColor() const { return m_rareNonInheritedData->visitedLinkOutlineColor; } |
1757 | const Color& visitedLinkColumnRuleColor() const { return m_rareNonInheritedData->multiCol->visitedLinkColumnRuleColor; } |
1758 | const Color& textDecorationColor() const { return m_rareNonInheritedData->textDecorationColor; } |
1759 | const Color& visitedLinkTextDecorationColor() const { return m_rareNonInheritedData->visitedLinkTextDecorationColor; } |
1760 | const Color& visitedLinkTextEmphasisColor() const { return m_rareInheritedData->visitedLinkTextEmphasisColor; } |
1761 | const Color& visitedLinkTextFillColor() const { return m_rareInheritedData->visitedLinkTextFillColor; } |
1762 | const Color& visitedLinkTextStrokeColor() const { return m_rareInheritedData->visitedLinkTextStrokeColor; } |
1763 | const Color& visitedLinkCaretColor() const { return m_rareInheritedData->visitedLinkCaretColor; } |
1764 | |
1765 | const Color& stopColor() const { return svgStyle().stopColor(); } |
1766 | const Color& floodColor() const { return svgStyle().floodColor(); } |
1767 | const Color& lightingColor() const { return svgStyle().lightingColor(); } |
1768 | |
1769 | private: |
1770 | struct NonInheritedFlags { |
1771 | bool operator==(const NonInheritedFlags&) const; |
1772 | bool operator!=(const NonInheritedFlags& other) const { return !(*this == other); } |
1773 | |
1774 | void copyNonInheritedFrom(const NonInheritedFlags&); |
1775 | |
1776 | bool hasAnyPublicPseudoStyles() const { return static_cast<unsigned>(PseudoId::PublicPseudoIdMask) & pseudoBits; } |
1777 | bool hasPseudoStyle(PseudoId) const; |
1778 | void setHasPseudoStyle(PseudoId); |
1779 | void setHasPseudoStyles(PseudoIdSet); |
1780 | |
1781 | unsigned effectiveDisplay : 5; // DisplayType |
1782 | unsigned originalDisplay : 5; // DisplayType |
1783 | unsigned overflowX : 3; // Overflow |
1784 | unsigned overflowY : 3; // Overflow |
1785 | unsigned verticalAlign : 4; // VerticalAlign |
1786 | unsigned clear : 2; // Clear |
1787 | unsigned position : 3; // PositionType |
1788 | unsigned unicodeBidi : 3; // EUnicodeBidi |
1789 | unsigned floating : 2; // Float |
1790 | unsigned tableLayout : 1; // TableLayoutType |
1791 | |
1792 | unsigned hasExplicitlySetDirection : 1; |
1793 | unsigned hasExplicitlySetWritingMode : 1; |
1794 | unsigned hasExplicitlySetTextAlign : 1; |
1795 | #if ENABLE(DARK_MODE_CSS) |
1796 | unsigned hasExplicitlySetColorScheme : 1; |
1797 | #endif |
1798 | unsigned hasViewportUnits : 1; |
1799 | unsigned hasExplicitlyInheritedProperties : 1; // Explicitly inherits a non-inherited property. |
1800 | unsigned isUnique : 1; // Style cannot be shared. |
1801 | unsigned emptyState : 1; |
1802 | unsigned firstChildState : 1; |
1803 | unsigned lastChildState : 1; |
1804 | unsigned affectedByHover : 1; |
1805 | unsigned affectedByActive : 1; |
1806 | unsigned affectedByDrag : 1; |
1807 | unsigned isLink : 1; |
1808 | |
1809 | unsigned styleType : 4; // PseudoId |
1810 | unsigned pseudoBits : (static_cast<unsigned>(PseudoId::FirstInternalPseudoId) - static_cast<unsigned>(PseudoId::FirstPublicPseudoId)); |
1811 | |
1812 | // If you add more style bits here, you will also need to update RenderStyle::NonInheritedFlags::copyNonInheritedFrom(). |
1813 | }; |
1814 | |
1815 | struct InheritedFlags { |
1816 | bool operator==(const InheritedFlags&) const; |
1817 | bool operator!=(const InheritedFlags& other) const { return !(*this == other); } |
1818 | |
1819 | unsigned emptyCells : 1; // EmptyCell |
1820 | unsigned captionSide : 2; // CaptionSide |
1821 | unsigned listStyleType : 7; // ListStyleType |
1822 | unsigned listStylePosition : 1; // ListStylePosition |
1823 | unsigned visibility : 2; // Visibility |
1824 | unsigned textAlign : 4; // TextAlignMode |
1825 | unsigned textTransform : 2; // TextTransform |
1826 | unsigned textDecorations : TextDecorationBits; |
1827 | unsigned cursor : 6; // CursorType |
1828 | #if ENABLE(CURSOR_VISIBILITY) |
1829 | unsigned cursorVisibility : 1; // CursorVisibility |
1830 | #endif |
1831 | unsigned direction : 1; // TextDirection |
1832 | unsigned whiteSpace : 3; // WhiteSpace |
1833 | // 35 bits |
1834 | unsigned borderCollapse : 1; // BorderCollapse |
1835 | unsigned boxDirection : 1; // BoxDirection |
1836 | |
1837 | // non CSS2 inherited |
1838 | unsigned rtlOrdering : 1; // Order |
1839 | unsigned printColorAdjust : PrintColorAdjustBits; // PrintColorAdjust |
1840 | unsigned pointerEvents : 4; // PointerEvents |
1841 | unsigned insideLink : 2; // InsideLink |
1842 | unsigned insideDefaultButton : 1; |
1843 | // 46 bits |
1844 | |
1845 | // CSS Text Layout Module Level 3: Vertical writing support |
1846 | unsigned writingMode : 2; // WritingMode |
1847 | // 48 bits |
1848 | }; |
1849 | |
1850 | // This constructor is used to implement the replace operation. |
1851 | RenderStyle(RenderStyle&, RenderStyle&&); |
1852 | |
1853 | DisplayType originalDisplay() const { return static_cast<DisplayType>(m_nonInheritedFlags.originalDisplay); } |
1854 | |
1855 | bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(); } |
1856 | bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(); } |
1857 | |
1858 | void setContent(std::unique_ptr<ContentData>, bool add); |
1859 | |
1860 | LayoutBoxExtent getShadowInsetExtent(const ShadowData*) const; |
1861 | |
1862 | static bool isDisplayReplacedType(DisplayType); |
1863 | static bool isDisplayInlineType(DisplayType); |
1864 | static bool isDisplayFlexibleBox(DisplayType); |
1865 | static bool isDisplayGridBox(DisplayType); |
1866 | static bool isDisplayFlexibleOrGridBox(DisplayType); |
1867 | |
1868 | Color colorIncludingFallback(CSSPropertyID colorProperty, bool visitedLink) const; |
1869 | |
1870 | bool changeAffectsVisualOverflow(const RenderStyle&) const; |
1871 | bool changeRequiresLayout(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1872 | bool changeRequiresPositionedLayoutOnly(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1873 | bool changeRequiresLayerRepaint(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1874 | bool changeRequiresRepaint(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1875 | bool changeRequiresRepaintIfTextOrBorderOrOutline(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1876 | bool changeRequiresRecompositeLayer(const RenderStyle&, OptionSet<StyleDifferenceContextSensitiveProperty>& changedContextSensitiveProperties) const; |
1877 | |
1878 | // non-inherited attributes |
1879 | DataRef<StyleBoxData> m_boxData; |
1880 | DataRef<StyleVisualData> m_visualData; |
1881 | DataRef<StyleBackgroundData> m_backgroundData; |
1882 | DataRef<StyleSurroundData> m_surroundData; |
1883 | DataRef<StyleRareNonInheritedData> m_rareNonInheritedData; |
1884 | NonInheritedFlags m_nonInheritedFlags; |
1885 | |
1886 | // inherited attributes |
1887 | DataRef<StyleRareInheritedData> m_rareInheritedData; |
1888 | DataRef<StyleInheritedData> m_inheritedData; |
1889 | InheritedFlags m_inheritedFlags; |
1890 | |
1891 | // list of associated pseudo styles |
1892 | std::unique_ptr<PseudoStyleCache> m_cachedPseudoStyles; |
1893 | |
1894 | DataRef<SVGRenderStyle> m_svgStyle; |
1895 | |
1896 | #if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS) |
1897 | bool m_deletionHasBegun { false }; |
1898 | #endif |
1899 | }; |
1900 | |
1901 | int adjustForAbsoluteZoom(int, const RenderStyle&); |
1902 | float adjustFloatForAbsoluteZoom(float, const RenderStyle&); |
1903 | LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit, const RenderStyle&); |
1904 | |
1905 | BorderStyle collapsedBorderStyle(BorderStyle); |
1906 | |
1907 | bool pseudoElementRendererIsNeeded(const RenderStyle*); |
1908 | |
1909 | inline bool RenderStyle::NonInheritedFlags::operator==(const NonInheritedFlags& other) const |
1910 | { |
1911 | return effectiveDisplay == other.effectiveDisplay |
1912 | && originalDisplay == other.originalDisplay |
1913 | && overflowX == other.overflowX |
1914 | && overflowY == other.overflowY |
1915 | && verticalAlign == other.verticalAlign |
1916 | && clear == other.clear |
1917 | && position == other.position |
1918 | && unicodeBidi == other.unicodeBidi |
1919 | && floating == other.floating |
1920 | && tableLayout == other.tableLayout |
1921 | && hasExplicitlySetDirection == other.hasExplicitlySetDirection |
1922 | && hasExplicitlySetWritingMode == other.hasExplicitlySetWritingMode |
1923 | && hasExplicitlySetTextAlign == other.hasExplicitlySetTextAlign |
1924 | #if ENABLE(DARK_MODE_CSS) |
1925 | && hasExplicitlySetColorScheme == other.hasExplicitlySetColorScheme |
1926 | #endif |
1927 | && hasViewportUnits == other.hasViewportUnits |
1928 | && hasExplicitlyInheritedProperties == other.hasExplicitlyInheritedProperties |
1929 | && isUnique == other.isUnique |
1930 | && emptyState == other.emptyState |
1931 | && firstChildState == other.firstChildState |
1932 | && lastChildState == other.lastChildState |
1933 | && affectedByHover == other.affectedByHover |
1934 | && affectedByActive == other.affectedByActive |
1935 | && affectedByDrag == other.affectedByDrag |
1936 | && isLink == other.isLink |
1937 | && styleType == other.styleType |
1938 | && pseudoBits == other.pseudoBits; |
1939 | } |
1940 | |
1941 | inline void RenderStyle::NonInheritedFlags::copyNonInheritedFrom(const NonInheritedFlags& other) |
1942 | { |
1943 | // Only a subset is copied because NonInheritedFlags contains a bunch of stuff other than real style data. |
1944 | effectiveDisplay = other.effectiveDisplay; |
1945 | originalDisplay = other.originalDisplay; |
1946 | overflowX = other.overflowX; |
1947 | overflowY = other.overflowY; |
1948 | verticalAlign = other.verticalAlign; |
1949 | clear = other.clear; |
1950 | position = other.position; |
1951 | unicodeBidi = other.unicodeBidi; |
1952 | floating = other.floating; |
1953 | tableLayout = other.tableLayout; |
1954 | hasViewportUnits = other.hasViewportUnits; |
1955 | hasExplicitlyInheritedProperties = other.hasExplicitlyInheritedProperties; |
1956 | } |
1957 | |
1958 | inline bool RenderStyle::NonInheritedFlags::hasPseudoStyle(PseudoId pseudo) const |
1959 | { |
1960 | ASSERT(pseudo > PseudoId::None); |
1961 | ASSERT(pseudo < PseudoId::FirstInternalPseudoId); |
1962 | return pseudoBits & (1 << (static_cast<unsigned>(pseudo) - 1 /* PseudoId::None */)); |
1963 | } |
1964 | |
1965 | inline void RenderStyle::NonInheritedFlags::setHasPseudoStyle(PseudoId pseudo) |
1966 | { |
1967 | ASSERT(pseudo > PseudoId::None); |
1968 | ASSERT(pseudo < PseudoId::FirstInternalPseudoId); |
1969 | pseudoBits |= 1 << (static_cast<unsigned>(pseudo) - 1 /* PseudoId::None */); |
1970 | } |
1971 | |
1972 | inline void RenderStyle::NonInheritedFlags::setHasPseudoStyles(PseudoIdSet pseudoIdSet) |
1973 | { |
1974 | ASSERT(pseudoIdSet); |
1975 | ASSERT((pseudoIdSet.data() & static_cast<unsigned>(PseudoId::PublicPseudoIdMask)) == pseudoIdSet.data()); |
1976 | pseudoBits |= pseudoIdSet.data() >> 1; // Shift down as we do not store a bit for PseudoId::None. |
1977 | } |
1978 | |
1979 | inline bool RenderStyle::InheritedFlags::operator==(const InheritedFlags& other) const |
1980 | { |
1981 | return emptyCells == other.emptyCells |
1982 | && captionSide == other.captionSide |
1983 | && listStyleType == other.listStyleType |
1984 | && listStylePosition == other.listStylePosition |
1985 | && visibility == other.visibility |
1986 | && textAlign == other.textAlign |
1987 | && textTransform == other.textTransform |
1988 | && textDecorations == other.textDecorations |
1989 | && cursor == other.cursor |
1990 | #if ENABLE(CURSOR_VISIBILITY) |
1991 | && cursorVisibility == other.cursorVisibility |
1992 | #endif |
1993 | && direction == other.direction |
1994 | && whiteSpace == other.whiteSpace |
1995 | && borderCollapse == other.borderCollapse |
1996 | && boxDirection == other.boxDirection |
1997 | && rtlOrdering == other.rtlOrdering |
1998 | && printColorAdjust == other.printColorAdjust |
1999 | && pointerEvents == other.pointerEvents |
2000 | && insideLink == other.insideLink |
2001 | && insideDefaultButton == other.insideDefaultButton |
2002 | && writingMode == other.writingMode; |
2003 | } |
2004 | |
2005 | inline int adjustForAbsoluteZoom(int value, const RenderStyle& style) |
2006 | { |
2007 | double zoomFactor = style.effectiveZoom(); |
2008 | if (zoomFactor == 1) |
2009 | return value; |
2010 | // Needed because computeLengthInt truncates (rather than rounds) when scaling up. |
2011 | if (zoomFactor > 1) { |
2012 | if (value < 0) |
2013 | value--; |
2014 | else |
2015 | value++; |
2016 | } |
2017 | |
2018 | return roundForImpreciseConversion<int>(value / zoomFactor); |
2019 | } |
2020 | |
2021 | inline float adjustFloatForAbsoluteZoom(float value, const RenderStyle& style) |
2022 | { |
2023 | return value / style.effectiveZoom(); |
2024 | } |
2025 | |
2026 | inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, const RenderStyle& style) |
2027 | { |
2028 | return value / style.effectiveZoom(); |
2029 | } |
2030 | |
2031 | inline BorderStyle collapsedBorderStyle(BorderStyle style) |
2032 | { |
2033 | if (style == BorderStyle::Outset) |
2034 | return BorderStyle::Groove; |
2035 | if (style == BorderStyle::Inset) |
2036 | return BorderStyle::Ridge; |
2037 | return style; |
2038 | } |
2039 | |
2040 | inline const CSSCustomPropertyValue* RenderStyle::getCustomProperty(const AtomicString& name) const |
2041 | { |
2042 | for (auto* map : { &nonInheritedCustomProperties(), &inheritedCustomProperties() }) { |
2043 | if (auto* val = map->get(name)) |
2044 | return val; |
2045 | } |
2046 | return nullptr; |
2047 | } |
2048 | |
2049 | inline bool RenderStyle::hasBackground() const |
2050 | { |
2051 | return visitedDependentColor(CSSPropertyBackgroundColor).isVisible() || hasBackgroundImage(); |
2052 | } |
2053 | |
2054 | inline bool RenderStyle::autoWrap(WhiteSpace whiteSpace) |
2055 | { |
2056 | // Nowrap and pre don't automatically wrap. |
2057 | return whiteSpace != WhiteSpace::NoWrap && whiteSpace != WhiteSpace::Pre; |
2058 | } |
2059 | |
2060 | inline bool RenderStyle::preserveNewline(WhiteSpace whiteSpace) |
2061 | { |
2062 | // Normal and nowrap do not preserve newlines. |
2063 | return whiteSpace != WhiteSpace::Normal && whiteSpace != WhiteSpace::NoWrap; |
2064 | } |
2065 | |
2066 | inline bool RenderStyle::collapseWhiteSpace(WhiteSpace ws) |
2067 | { |
2068 | // Pre and prewrap do not collapse whitespace. |
2069 | return ws != WhiteSpace::Pre && ws != WhiteSpace::PreWrap && ws != WhiteSpace::BreakSpaces; |
2070 | } |
2071 | |
2072 | inline bool RenderStyle::isCollapsibleWhiteSpace(UChar character) const |
2073 | { |
2074 | switch (character) { |
2075 | case ' ': |
2076 | case '\t': |
2077 | return collapseWhiteSpace(); |
2078 | case '\n': |
2079 | return !preserveNewline(); |
2080 | default: |
2081 | return false; |
2082 | } |
2083 | } |
2084 | |
2085 | inline bool RenderStyle::breakOnlyAfterWhiteSpace() const |
2086 | { |
2087 | return whiteSpace() == WhiteSpace::PreWrap || whiteSpace() == WhiteSpace::BreakSpaces || lineBreak() == LineBreak::AfterWhiteSpace; |
2088 | } |
2089 | |
2090 | inline bool RenderStyle::breakWords() const |
2091 | { |
2092 | return wordBreak() == WordBreak::BreakWord || overflowWrap() == OverflowWrap::Break; |
2093 | } |
2094 | |
2095 | inline bool RenderStyle::hasInlineColumnAxis() const |
2096 | { |
2097 | auto axis = columnAxis(); |
2098 | return axis == ColumnAxis::Auto || isHorizontalWritingMode() == (axis == ColumnAxis::Horizontal); |
2099 | } |
2100 | |
2101 | inline ImageOrientationEnum RenderStyle::imageOrientation() const |
2102 | { |
2103 | #if ENABLE(CSS_IMAGE_ORIENTATION) |
2104 | return static_cast<ImageOrientationEnum>(m_rareInheritedData->imageOrientation); |
2105 | #else |
2106 | return DefaultImageOrientation; |
2107 | #endif |
2108 | } |
2109 | |
2110 | inline void RenderStyle::setLogicalWidth(Length&& logicalWidth) |
2111 | { |
2112 | if (isHorizontalWritingMode()) |
2113 | setWidth(WTFMove(logicalWidth)); |
2114 | else |
2115 | setHeight(WTFMove(logicalWidth)); |
2116 | } |
2117 | |
2118 | inline void RenderStyle::setLogicalHeight(Length&& logicalHeight) |
2119 | { |
2120 | if (isHorizontalWritingMode()) |
2121 | setHeight(WTFMove(logicalHeight)); |
2122 | else |
2123 | setWidth(WTFMove(logicalHeight)); |
2124 | } |
2125 | |
2126 | inline void RenderStyle::setBorderRadius(LengthSize&& size) |
2127 | { |
2128 | auto topLeft = size; |
2129 | setBorderTopLeftRadius(WTFMove(topLeft)); |
2130 | auto topRight = size; |
2131 | setBorderTopRightRadius(WTFMove(topRight)); |
2132 | auto bottomLeft = size; |
2133 | setBorderBottomLeftRadius(WTFMove(bottomLeft)); |
2134 | setBorderBottomRightRadius(WTFMove(size)); |
2135 | } |
2136 | |
2137 | inline void RenderStyle::setBorderRadius(const IntSize& size) |
2138 | { |
2139 | setBorderRadius(LengthSize { { size.width(), Fixed }, { size.height(), Fixed } }); |
2140 | } |
2141 | |
2142 | inline bool RenderStyle::setZoom(float zoomLevel) |
2143 | { |
2144 | setEffectiveZoom(effectiveZoom() * zoomLevel); |
2145 | if (compareEqual(m_visualData->zoom, zoomLevel)) |
2146 | return false; |
2147 | m_visualData.access().zoom = zoomLevel; |
2148 | return true; |
2149 | } |
2150 | |
2151 | inline bool RenderStyle::setEffectiveZoom(float zoomLevel) |
2152 | { |
2153 | if (compareEqual(m_rareInheritedData->effectiveZoom, zoomLevel)) |
2154 | return false; |
2155 | m_rareInheritedData.access().effectiveZoom = zoomLevel; |
2156 | return true; |
2157 | } |
2158 | |
2159 | inline bool RenderStyle::setTextOrientation(TextOrientation textOrientation) |
2160 | { |
2161 | if (compareEqual(static_cast<TextOrientation>(m_rareInheritedData->textOrientation), textOrientation)) |
2162 | return false; |
2163 | m_rareInheritedData.access().textOrientation = static_cast<unsigned>(textOrientation); |
2164 | return true; |
2165 | } |
2166 | |
2167 | inline void RenderStyle::adjustBackgroundLayers() |
2168 | { |
2169 | if (backgroundLayers().next()) { |
2170 | ensureBackgroundLayers().cullEmptyLayers(); |
2171 | ensureBackgroundLayers().fillUnsetProperties(); |
2172 | } |
2173 | } |
2174 | |
2175 | inline void RenderStyle::adjustMaskLayers() |
2176 | { |
2177 | if (maskLayers().next()) { |
2178 | ensureMaskLayers().cullEmptyLayers(); |
2179 | ensureMaskLayers().fillUnsetProperties(); |
2180 | } |
2181 | } |
2182 | |
2183 | inline void RenderStyle::clearAnimations() |
2184 | { |
2185 | m_rareNonInheritedData.access().animations = nullptr; |
2186 | } |
2187 | |
2188 | inline void RenderStyle::clearTransitions() |
2189 | { |
2190 | m_rareNonInheritedData.access().transitions = nullptr; |
2191 | } |
2192 | |
2193 | inline void RenderStyle::setShapeOutside(RefPtr<ShapeValue>&& value) |
2194 | { |
2195 | if (m_rareNonInheritedData->shapeOutside == value) |
2196 | return; |
2197 | m_rareNonInheritedData.access().shapeOutside = WTFMove(value); |
2198 | } |
2199 | |
2200 | inline void RenderStyle::setShapeImageThreshold(float shapeImageThreshold) |
2201 | { |
2202 | float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0.f, 1.f); |
2203 | SET_VAR(m_rareNonInheritedData, shapeImageThreshold, clampedShapeImageThreshold); |
2204 | } |
2205 | |
2206 | inline void RenderStyle::setClipPath(RefPtr<ClipPathOperation>&& operation) |
2207 | { |
2208 | if (m_rareNonInheritedData->clipPath != operation) |
2209 | m_rareNonInheritedData.access().clipPath = WTFMove(operation); |
2210 | } |
2211 | |
2212 | inline bool RenderStyle::willChangeCreatesStackingContext() const |
2213 | { |
2214 | return willChange() && willChange()->canCreateStackingContext(); |
2215 | } |
2216 | |
2217 | inline bool RenderStyle::isDisplayRegionType() const |
2218 | { |
2219 | return display() == DisplayType::Block || display() == DisplayType::InlineBlock |
2220 | || display() == DisplayType::TableCell || display() == DisplayType::TableCaption |
2221 | || display() == DisplayType::ListItem; |
2222 | } |
2223 | |
2224 | inline bool RenderStyle::setWritingMode(WritingMode v) |
2225 | { |
2226 | if (v == writingMode()) |
2227 | return false; |
2228 | m_inheritedFlags.writingMode = v; |
2229 | return true; |
2230 | } |
2231 | |
2232 | inline void RenderStyle::getShadowInlineDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const |
2233 | { |
2234 | return isHorizontalWritingMode() ? getShadowHorizontalExtent(shadow, logicalLeft, logicalRight) : getShadowVerticalExtent(shadow, logicalLeft, logicalRight); |
2235 | } |
2236 | |
2237 | inline void RenderStyle::getShadowBlockDirectionExtent(const ShadowData* shadow, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const |
2238 | { |
2239 | return isHorizontalWritingMode() ? getShadowVerticalExtent(shadow, logicalTop, logicalBottom) : getShadowHorizontalExtent(shadow, logicalTop, logicalBottom); |
2240 | } |
2241 | |
2242 | inline bool RenderStyle::isDisplayReplacedType(DisplayType display) |
2243 | { |
2244 | return display == DisplayType::InlineBlock || display == DisplayType::InlineBox || display == DisplayType::InlineFlex |
2245 | || display == DisplayType::InlineGrid || display == DisplayType::InlineTable; |
2246 | } |
2247 | |
2248 | inline bool RenderStyle::isDisplayInlineType(DisplayType display) |
2249 | { |
2250 | return display == DisplayType::Inline || isDisplayReplacedType(display); |
2251 | } |
2252 | |
2253 | inline bool RenderStyle::isDisplayFlexibleBox(DisplayType display) |
2254 | { |
2255 | return display == DisplayType::Flex || display == DisplayType::InlineFlex; |
2256 | } |
2257 | |
2258 | inline bool RenderStyle::isDisplayGridBox(DisplayType display) |
2259 | { |
2260 | return display == DisplayType::Grid || display == DisplayType::InlineGrid; |
2261 | } |
2262 | |
2263 | inline bool RenderStyle::isDisplayFlexibleOrGridBox(DisplayType display) |
2264 | { |
2265 | return isDisplayFlexibleBox(display) || isDisplayGridBox(display); |
2266 | } |
2267 | |
2268 | inline bool RenderStyle::hasAnyPublicPseudoStyles() const |
2269 | { |
2270 | return m_nonInheritedFlags.hasAnyPublicPseudoStyles(); |
2271 | } |
2272 | |
2273 | inline bool RenderStyle::hasPseudoStyle(PseudoId pseudo) const |
2274 | { |
2275 | return m_nonInheritedFlags.hasPseudoStyle(pseudo); |
2276 | } |
2277 | |
2278 | inline void RenderStyle::setHasPseudoStyle(PseudoId pseudo) |
2279 | { |
2280 | m_nonInheritedFlags.setHasPseudoStyle(pseudo); |
2281 | } |
2282 | |
2283 | inline void RenderStyle::setHasPseudoStyles(PseudoIdSet pseudoIdSet) |
2284 | { |
2285 | m_nonInheritedFlags.setHasPseudoStyles(pseudoIdSet); |
2286 | } |
2287 | |
2288 | inline void RenderStyle::setBoxReflect(RefPtr<StyleReflection>&& reflect) |
2289 | { |
2290 | SET_VAR(m_rareNonInheritedData, boxReflect, WTFMove(reflect)); |
2291 | } |
2292 | |
2293 | inline bool pseudoElementRendererIsNeeded(const RenderStyle* style) |
2294 | { |
2295 | return style && style->display() != DisplayType::None && style->contentData(); |
2296 | } |
2297 | |
2298 | } // namespace WebCore |
2299 | |