OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | |
7 * | |
8 * This library is free software; you can redistribute it and/or | |
9 * modify it under the terms of the GNU Library General Public | |
10 * License as published by the Free Software Foundation; either | |
11 * version 2 of the License, or (at your option) any later version. | |
12 * | |
13 * This library is distributed in the hope that it will be useful, | |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 * Library General Public License for more details. | |
17 * | |
18 * You should have received a copy of the GNU Library General Public License | |
19 * along with this library; see the file COPYING.LIB. If not, write to | |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
21 * Boston, MA 02110-1301, USA. | |
22 * | |
23 */ | |
24 | |
25 #ifndef LayoutStyle_h | |
26 #define LayoutStyle_h | |
27 | |
28 #include "core/CSSPropertyNames.h" | |
29 #include "core/CoreExport.h" | |
30 #include "core/animation/css/CSSAnimationData.h" | |
31 #include "core/animation/css/CSSTransitionData.h" | |
32 #include "core/css/CSSLineBoxContainValue.h" | |
33 #include "core/css/CSSPrimitiveValue.h" | |
34 #include "core/layout/style/BorderValue.h" | |
35 #include "core/layout/style/CounterDirectives.h" | |
36 #include "core/layout/style/DataRef.h" | |
37 #include "core/layout/style/LayoutStyleConstants.h" | |
38 #include "core/layout/style/LineClampValue.h" | |
39 #include "core/layout/style/NinePieceImage.h" | |
40 #include "core/layout/style/OutlineValue.h" | |
41 #include "core/layout/style/SVGLayoutStyle.h" | |
42 #include "core/layout/style/ShapeValue.h" | |
43 #include "core/layout/style/StyleBackgroundData.h" | |
44 #include "core/layout/style/StyleBoxData.h" | |
45 #include "core/layout/style/StyleDeprecatedFlexibleBoxData.h" | |
46 #include "core/layout/style/StyleDifference.h" | |
47 #include "core/layout/style/StyleFilterData.h" | |
48 #include "core/layout/style/StyleFlexibleBoxData.h" | |
49 #include "core/layout/style/StyleGridData.h" | |
50 #include "core/layout/style/StyleGridItemData.h" | |
51 #include "core/layout/style/StyleInheritedData.h" | |
52 #include "core/layout/style/StyleMotionPath.h" | |
53 #include "core/layout/style/StyleMultiColData.h" | |
54 #include "core/layout/style/StyleRareInheritedData.h" | |
55 #include "core/layout/style/StyleRareNonInheritedData.h" | |
56 #include "core/layout/style/StyleReflection.h" | |
57 #include "core/layout/style/StyleSurroundData.h" | |
58 #include "core/layout/style/StyleTransformData.h" | |
59 #include "core/layout/style/StyleVisualData.h" | |
60 #include "core/layout/style/StyleWillChangeData.h" | |
61 #include "core/layout/style/TransformOrigin.h" | |
62 #include "platform/Length.h" | |
63 #include "platform/LengthBox.h" | |
64 #include "platform/LengthPoint.h" | |
65 #include "platform/LengthSize.h" | |
66 #include "platform/ThemeTypes.h" | |
67 #include "platform/fonts/FontBaseline.h" | |
68 #include "platform/fonts/FontDescription.h" | |
69 #include "platform/geometry/FloatRoundedRect.h" | |
70 #include "platform/geometry/LayoutRectOutsets.h" | |
71 #include "platform/graphics/Color.h" | |
72 #include "platform/graphics/GraphicsTypes.h" | |
73 #include "platform/scroll/ScrollableArea.h" | |
74 #include "platform/text/TextDirection.h" | |
75 #include "platform/text/UnicodeBidi.h" | |
76 #include "platform/transforms/TransformOperations.h" | |
77 #include "public/platform/WebScrollBlocksOn.h" | |
78 #include "wtf/Forward.h" | |
79 #include "wtf/OwnPtr.h" | |
80 #include "wtf/RefCounted.h" | |
81 #include "wtf/StdLibExtras.h" | |
82 #include "wtf/Vector.h" | |
83 | |
84 template<typename T, typename U> inline bool compareEqual(const T& t, const U& u
) { return t == static_cast<T>(u); } | |
85 | |
86 #define SET_VAR(group, variable, value) \ | |
87 if (!compareEqual(group->variable, value)) \ | |
88 group.access()->variable = value | |
89 | |
90 #define SET_VAR_WITH_SETTER(group, getter, setter, value) \ | |
91 if (!compareEqual(group->getter(), value)) \ | |
92 group.access()->setter(value) | |
93 | |
94 #define SET_BORDERVALUE_COLOR(group, variable, value) \ | |
95 if (!compareEqual(group->variable.color(), value)) \ | |
96 group.access()->variable.setColor(value) | |
97 | |
98 namespace blink { | |
99 | |
100 using std::max; | |
101 | |
102 class FilterOperations; | |
103 | |
104 class AppliedTextDecoration; | |
105 class BorderData; | |
106 struct BorderEdge; | |
107 class CounterContent; | |
108 class Font; | |
109 class FontMetrics; | |
110 class ShadowList; | |
111 class StyleImage; | |
112 class StyleInheritedData; | |
113 class StyleResolver; | |
114 class TransformationMatrix; | |
115 | |
116 class ContentData; | |
117 | |
118 typedef Vector<RefPtr<LayoutStyle>, 4> PseudoStyleCache; | |
119 | |
120 class CORE_EXPORT LayoutStyle: public RefCounted<LayoutStyle> { | |
121 friend class AnimatedStyleBuilder; // Used by Web Animations CSS. Sets the c
olor styles | |
122 friend class CSSAnimatableValueFactory; // Used by Web Animations CSS. Gets
visited and unvisited colors separately. | |
123 friend class CSSPropertyEquality; // Used by CSS animations. We can't allow
them to animate based off visited colors. | |
124 friend class ApplyStyleCommand; // Editing has to only reveal unvisited info
. | |
125 friend class EditingStyle; // Editing has to only reveal unvisited info. | |
126 friend class LayoutStyleCSSValueMapping; // Needs to be able to see visited
and unvisited colors for devtools. | |
127 friend class StyleBuilderFunctions; // Sets color styles | |
128 friend class CachedUAStyle; // Saves Border/Background information for later
comparison. | |
129 | |
130 // FIXME: When we stop resolving currentColor at style time, these can be re
moved. | |
131 friend class CSSToStyleMap; | |
132 friend class FilterOperationResolver; | |
133 friend class StyleBuilderConverter; | |
134 friend class StyleResolverState; | |
135 friend class StyleResolver; | |
136 protected: | |
137 | |
138 // non-inherited attributes | |
139 DataRef<StyleBoxData> m_box; | |
140 DataRef<StyleVisualData> visual; | |
141 DataRef<StyleBackgroundData> m_background; | |
142 DataRef<StyleSurroundData> surround; | |
143 DataRef<StyleRareNonInheritedData> rareNonInheritedData; | |
144 | |
145 // inherited attributes | |
146 DataRef<StyleRareInheritedData> rareInheritedData; | |
147 DataRef<StyleInheritedData> inherited; | |
148 | |
149 // list of associated pseudo styles | |
150 OwnPtr<PseudoStyleCache> m_cachedPseudoStyles; | |
151 | |
152 DataRef<SVGLayoutStyle> m_svgStyle; | |
153 | |
154 // !START SYNC!: Keep this in sync with the copy constructor in LayoutStyle.cpp
and implicitlyInherited() in StyleResolver.cpp | |
155 | |
156 // inherit | |
157 struct InheritedFlags { | |
158 bool operator==(const InheritedFlags& other) const | |
159 { | |
160 return (_empty_cells == other._empty_cells) | |
161 && (_caption_side == other._caption_side) | |
162 && (_list_style_type == other._list_style_type) | |
163 && (_list_style_position == other._list_style_position) | |
164 && (_visibility == other._visibility) | |
165 && (_text_align == other._text_align) | |
166 && (_text_transform == other._text_transform) | |
167 && (m_textUnderline == other.m_textUnderline) | |
168 && (_cursor_style == other._cursor_style) | |
169 && (_direction == other._direction) | |
170 && (_white_space == other._white_space) | |
171 && (_border_collapse == other._border_collapse) | |
172 && (_box_direction == other._box_direction) | |
173 && (m_rtlOrdering == other.m_rtlOrdering) | |
174 && (m_printColorAdjust == other.m_printColorAdjust) | |
175 && (_pointerEvents == other._pointerEvents) | |
176 && (_insideLink == other._insideLink) | |
177 && (m_writingMode == other.m_writingMode); | |
178 } | |
179 | |
180 bool operator!=(const InheritedFlags& other) const { return !(*this == o
ther); } | |
181 | |
182 unsigned _empty_cells : 1; // EEmptyCell | |
183 unsigned _caption_side : 2; // ECaptionSide | |
184 unsigned _list_style_type : 7; // EListStyleType | |
185 unsigned _list_style_position : 1; // EListStylePosition | |
186 unsigned _visibility : 2; // EVisibility | |
187 unsigned _text_align : 4; // ETextAlign | |
188 unsigned _text_transform : 2; // ETextTransform | |
189 unsigned m_textUnderline : 1; | |
190 unsigned _cursor_style : 6; // ECursor | |
191 unsigned _direction : 1; // TextDirection | |
192 unsigned _white_space : 3; // EWhiteSpace | |
193 unsigned _border_collapse : 1; // EBorderCollapse | |
194 unsigned _box_direction : 1; // EBoxDirection (CSS3 box_direction proper
ty, flexible box layout module) | |
195 // 32 bits | |
196 | |
197 // non CSS2 inherited | |
198 unsigned m_rtlOrdering : 1; // Order | |
199 unsigned m_printColorAdjust : PrintColorAdjustBits; | |
200 unsigned _pointerEvents : 4; // EPointerEvents | |
201 unsigned _insideLink : 2; // EInsideLink | |
202 | |
203 // CSS Text Layout Module Level 3: Vertical writing support | |
204 unsigned m_writingMode : 2; // WritingMode | |
205 // 42 bits | |
206 } inherited_flags; | |
207 | |
208 // don't inherit | |
209 struct NonInheritedFlags { | |
210 // Compare computed styles, differences in other flags should not cause
an inequality. | |
211 bool operator==(const NonInheritedFlags& other) const | |
212 { | |
213 return effectiveDisplay == other.effectiveDisplay | |
214 && originalDisplay == other.originalDisplay | |
215 && overflowX == other.overflowX | |
216 && overflowY == other.overflowY | |
217 && verticalAlign == other.verticalAlign | |
218 && clear == other.clear | |
219 && position == other.position | |
220 && floating == other.floating | |
221 && tableLayout == other.tableLayout | |
222 && unicodeBidi == other.unicodeBidi | |
223 // hasViewportUnits | |
224 && pageBreakBefore == other.pageBreakBefore | |
225 && pageBreakAfter == other.pageBreakAfter | |
226 && pageBreakInside == other.pageBreakInside; | |
227 // styleType | |
228 // pseudoBits | |
229 // explicitInheritance | |
230 // unique | |
231 // emptyState | |
232 // affectedByFocus | |
233 // affectedByHover | |
234 // affectedByActive | |
235 // affectedByDrag | |
236 // isLink | |
237 } | |
238 | |
239 bool operator!=(const NonInheritedFlags& other) const { return !(*this =
= other); } | |
240 | |
241 unsigned effectiveDisplay : 5; // EDisplay | |
242 unsigned originalDisplay : 5; // EDisplay | |
243 unsigned overflowX : 3; // EOverflow | |
244 unsigned overflowY : 3; // EOverflow | |
245 unsigned verticalAlign : 4; // EVerticalAlign | |
246 unsigned clear : 2; // EClear | |
247 unsigned position : 3; // EPosition | |
248 unsigned floating : 2; // EFloat | |
249 unsigned tableLayout : 1; // ETableLayout | |
250 unsigned unicodeBidi : 3; // EUnicodeBidi | |
251 | |
252 // This is set if we used viewport units when resolving a length. | |
253 // It is mutable so we can pass around const LayoutStyles to resolve len
gths. | |
254 mutable unsigned hasViewportUnits : 1; | |
255 | |
256 // 32 bits | |
257 | |
258 unsigned pageBreakBefore : 2; // EPageBreak | |
259 unsigned pageBreakAfter : 2; // EPageBreak | |
260 unsigned pageBreakInside : 2; // EPageBreak | |
261 | |
262 unsigned styleType : 6; // PseudoId | |
263 unsigned pseudoBits : 8; | |
264 unsigned explicitInheritance : 1; // Explicitly inherits a non-inherited
property | |
265 unsigned unique : 1; // Style can not be shared. | |
266 | |
267 unsigned emptyState : 1; | |
268 | |
269 unsigned affectedByFocus : 1; | |
270 unsigned affectedByHover : 1; | |
271 unsigned affectedByActive : 1; | |
272 unsigned affectedByDrag : 1; | |
273 | |
274 unsigned isLink : 1; | |
275 // If you add more style bits here, you will also need to update LayoutS
tyle::copyNonInheritedFromCached() | |
276 // 62 bits | |
277 } noninherited_flags; | |
278 | |
279 // !END SYNC! | |
280 | |
281 protected: | |
282 void setBitDefaults() | |
283 { | |
284 inherited_flags._empty_cells = initialEmptyCells(); | |
285 inherited_flags._caption_side = initialCaptionSide(); | |
286 inherited_flags._list_style_type = initialListStyleType(); | |
287 inherited_flags._list_style_position = initialListStylePosition(); | |
288 inherited_flags._visibility = initialVisibility(); | |
289 inherited_flags._text_align = initialTextAlign(); | |
290 inherited_flags._text_transform = initialTextTransform(); | |
291 inherited_flags.m_textUnderline = false; | |
292 inherited_flags._cursor_style = initialCursor(); | |
293 inherited_flags._direction = initialDirection(); | |
294 inherited_flags._white_space = initialWhiteSpace(); | |
295 inherited_flags._border_collapse = initialBorderCollapse(); | |
296 inherited_flags.m_rtlOrdering = initialRTLOrdering(); | |
297 inherited_flags._box_direction = initialBoxDirection(); | |
298 inherited_flags.m_printColorAdjust = initialPrintColorAdjust(); | |
299 inherited_flags._pointerEvents = initialPointerEvents(); | |
300 inherited_flags._insideLink = NotInsideLink; | |
301 inherited_flags.m_writingMode = initialWritingMode(); | |
302 | |
303 noninherited_flags.effectiveDisplay = noninherited_flags.originalDisplay
= initialDisplay(); | |
304 noninherited_flags.overflowX = initialOverflowX(); | |
305 noninherited_flags.overflowY = initialOverflowY(); | |
306 noninherited_flags.verticalAlign = initialVerticalAlign(); | |
307 noninherited_flags.clear = initialClear(); | |
308 noninherited_flags.position = initialPosition(); | |
309 noninherited_flags.floating = initialFloating(); | |
310 noninherited_flags.tableLayout = initialTableLayout(); | |
311 noninherited_flags.unicodeBidi = initialUnicodeBidi(); | |
312 noninherited_flags.pageBreakBefore = initialPageBreak(); | |
313 noninherited_flags.pageBreakAfter = initialPageBreak(); | |
314 noninherited_flags.pageBreakInside = initialPageBreak(); | |
315 noninherited_flags.styleType = NOPSEUDO; | |
316 noninherited_flags.pseudoBits = 0; | |
317 noninherited_flags.explicitInheritance = false; | |
318 noninherited_flags.unique = false; | |
319 noninherited_flags.emptyState = false; | |
320 noninherited_flags.hasViewportUnits = false; | |
321 noninherited_flags.affectedByFocus = false; | |
322 noninherited_flags.affectedByHover = false; | |
323 noninherited_flags.affectedByActive = false; | |
324 noninherited_flags.affectedByDrag = false; | |
325 noninherited_flags.isLink = false; | |
326 } | |
327 | |
328 private: | |
329 ALWAYS_INLINE LayoutStyle(); | |
330 | |
331 enum InitialStyleTag { | |
332 InitialStyle | |
333 }; | |
334 ALWAYS_INLINE explicit LayoutStyle(InitialStyleTag); | |
335 ALWAYS_INLINE LayoutStyle(const LayoutStyle&); | |
336 | |
337 static PassRefPtr<LayoutStyle> createInitialStyle(); | |
338 static inline LayoutStyle* initialStyle() | |
339 { | |
340 DEFINE_STATIC_REF(LayoutStyle, s_initialStyle, (LayoutStyle::createIniti
alStyle())); | |
341 return s_initialStyle; | |
342 } | |
343 | |
344 public: | |
345 static PassRefPtr<LayoutStyle> create(); | |
346 static PassRefPtr<LayoutStyle> createAnonymousStyleWithDisplay(const LayoutS
tyle& parentStyle, EDisplay); | |
347 static PassRefPtr<LayoutStyle> clone(const LayoutStyle&); | |
348 | |
349 // Computes how the style change should be propagated down the tree. | |
350 static StyleRecalcChange stylePropagationDiff(const LayoutStyle* oldStyle, c
onst LayoutStyle* newStyle); | |
351 | |
352 static ItemPosition resolveAlignment(const LayoutStyle& parentStyle, const L
ayoutStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject); | |
353 static ItemPosition resolveJustification(const LayoutStyle& parentStyle, con
st LayoutStyle& childStyle, ItemPosition resolvedAutoPositionForLayoutObject); | |
354 | |
355 StyleDifference visualInvalidationDiff(const LayoutStyle&) const; | |
356 | |
357 enum IsAtShadowBoundary { | |
358 AtShadowBoundary, | |
359 NotAtShadowBoundary, | |
360 }; | |
361 | |
362 void inheritFrom(const LayoutStyle& inheritParent, IsAtShadowBoundary = NotA
tShadowBoundary); | |
363 void copyNonInheritedFromCached(const LayoutStyle&); | |
364 | |
365 PseudoId styleType() const { return static_cast<PseudoId>(noninherited_flags
.styleType); } | |
366 void setStyleType(PseudoId styleType) { noninherited_flags.styleType = style
Type; } | |
367 | |
368 LayoutStyle* getCachedPseudoStyle(PseudoId) const; | |
369 LayoutStyle* addCachedPseudoStyle(PassRefPtr<LayoutStyle>); | |
370 void removeCachedPseudoStyle(PseudoId); | |
371 | |
372 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt
yles.get(); } | |
373 | |
374 void setHasViewportUnits(bool hasViewportUnits = true) const { noninherited_
flags.hasViewportUnits = hasViewportUnits; } | |
375 bool hasViewportUnits() const { return noninherited_flags.hasViewportUnits;
} | |
376 | |
377 bool affectedByFocus() const { return noninherited_flags.affectedByFocus; } | |
378 bool affectedByHover() const { return noninherited_flags.affectedByHover; } | |
379 bool affectedByActive() const { return noninherited_flags.affectedByActive;
} | |
380 bool affectedByDrag() const { return noninherited_flags.affectedByDrag; } | |
381 | |
382 void setAffectedByFocus() { noninherited_flags.affectedByFocus = true; } | |
383 void setAffectedByHover() { noninherited_flags.affectedByHover = true; } | |
384 void setAffectedByActive() { noninherited_flags.affectedByActive = true; } | |
385 void setAffectedByDrag() { noninherited_flags.affectedByDrag = true; } | |
386 | |
387 bool operator==(const LayoutStyle& other) const; | |
388 bool operator!=(const LayoutStyle& other) const { return !(*this == other);
} | |
389 bool isFloating() const { return noninherited_flags.floating != NoFloat; } | |
390 bool hasMargin() const { return surround->margin.nonZero(); } | |
391 bool hasBorder() const { return surround->border.hasBorder(); } | |
392 bool hasPadding() const { return surround->padding.nonZero(); } | |
393 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } | |
394 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } | |
395 | |
396 bool hasBackgroundImage() const { return m_background->background().hasImage
(); } | |
397 bool hasFixedBackgroundImage() const { return m_background->background().has
FixedImage(); } | |
398 | |
399 bool hasEntirelyFixedBackground() const; | |
400 | |
401 bool hasAppearance() const { return appearance() != NoControlPart; } | |
402 | |
403 bool hasBackground() const | |
404 { | |
405 Color color = visitedDependentColor(CSSPropertyBackgroundColor); | |
406 if (color.alpha()) | |
407 return true; | |
408 return hasBackgroundImage(); | |
409 } | |
410 | |
411 LayoutRectOutsets imageOutsets(const NinePieceImage&) const; | |
412 bool hasBorderImageOutsets() const | |
413 { | |
414 return borderImage().hasImage() && borderImage().outset().nonZero(); | |
415 } | |
416 LayoutRectOutsets borderImageOutsets() const | |
417 { | |
418 return imageOutsets(borderImage()); | |
419 } | |
420 | |
421 bool hasFilterOutsets() const { return hasFilter() && filter().hasOutsets();
} | |
422 FilterOutsets filterOutsets() const { return hasFilter() ? filter().outsets(
) : FilterOutsets(); } | |
423 | |
424 Order rtlOrdering() const { return static_cast<Order>(inherited_flags.m_rtlO
rdering); } | |
425 void setRTLOrdering(Order o) { inherited_flags.m_rtlOrdering = o; } | |
426 | |
427 bool isStyleAvailable() const; | |
428 | |
429 bool hasAnyPublicPseudoStyles() const; | |
430 bool hasPseudoStyle(PseudoId) const; | |
431 void setHasPseudoStyle(PseudoId); | |
432 bool hasUniquePseudoStyle() const; | |
433 bool hasPseudoElementStyle() const; | |
434 | |
435 // attribute getter methods | |
436 | |
437 EDisplay display() const { return static_cast<EDisplay>(noninherited_flags.e
ffectiveDisplay); } | |
438 EDisplay originalDisplay() const { return static_cast<EDisplay>(noninherited
_flags.originalDisplay); } | |
439 | |
440 const Length& left() const { return surround->offset.left(); } | |
441 const Length& right() const { return surround->offset.right(); } | |
442 const Length& top() const { return surround->offset.top(); } | |
443 const Length& bottom() const { return surround->offset.bottom(); } | |
444 | |
445 // Accessors for positioned object edges that take into account writing mode
. | |
446 const Length& logicalLeft() const { return surround->offset.logicalLeft(writ
ingMode()); } | |
447 const Length& logicalRight() const { return surround->offset.logicalRight(wr
itingMode()); } | |
448 const Length& logicalTop() const { return surround->offset.before(writingMod
e()); } | |
449 const Length& logicalBottom() const { return surround->offset.after(writingM
ode()); } | |
450 | |
451 // Whether or not a positioned element requires normal flow x/y to be comput
ed | |
452 // to determine its position. | |
453 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(
); } | |
454 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(
); } | |
455 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? ha
sAutoLeftAndRight() : hasAutoTopAndBottom(); } | |
456 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? has
AutoTopAndBottom() : hasAutoLeftAndRight(); } | |
457 | |
458 EPosition position() const { return static_cast<EPosition>(noninherited_flag
s.position); } | |
459 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition ||
position() == FixedPosition; } | |
460 bool hasInFlowPosition() const { return position() == RelativePosition; } | |
461 bool hasViewportConstrainedPosition() const { return position() == FixedPosi
tion; } | |
462 EFloat floating() const { return static_cast<EFloat>(noninherited_flags.floa
ting); } | |
463 | |
464 const Length& width() const { return m_box->width(); } | |
465 const Length& height() const { return m_box->height(); } | |
466 const Length& minWidth() const { return m_box->minWidth(); } | |
467 const Length& maxWidth() const { return m_box->maxWidth(); } | |
468 const Length& minHeight() const { return m_box->minHeight(); } | |
469 const Length& maxHeight() const { return m_box->maxHeight(); } | |
470 | |
471 const Length& logicalWidth() const { return isHorizontalWritingMode() ? widt
h() : height(); } | |
472 const Length& logicalHeight() const { return isHorizontalWritingMode() ? hei
ght() : width(); } | |
473 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? m
inWidth() : minHeight(); } | |
474 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? m
axWidth() : maxHeight(); } | |
475 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ?
minHeight() : minWidth(); } | |
476 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ?
maxHeight() : maxWidth(); } | |
477 | |
478 const BorderData& border() const { return surround->border; } | |
479 const BorderValue& borderLeft() const { return surround->border.left(); } | |
480 const BorderValue& borderRight() const { return surround->border.right(); } | |
481 const BorderValue& borderTop() const { return surround->border.top(); } | |
482 const BorderValue& borderBottom() const { return surround->border.bottom();
} | |
483 | |
484 const BorderValue& borderBefore() const; | |
485 const BorderValue& borderAfter() const; | |
486 const BorderValue& borderStart() const; | |
487 const BorderValue& borderEnd() const; | |
488 | |
489 const NinePieceImage& borderImage() const { return surround->border.image();
} | |
490 StyleImage* borderImageSource() const { return surround->border.image().imag
e(); } | |
491 const LengthBox& borderImageSlices() const { return surround->border.image()
.imageSlices(); } | |
492 bool borderImageSlicesFill() const { return surround->border.image().fill();
} | |
493 const BorderImageLengthBox& borderImageWidth() const { return surround->bord
er.image().borderSlices(); } | |
494 const BorderImageLengthBox& borderImageOutset() const { return surround->bor
der.image().outset(); } | |
495 | |
496 const LengthSize& borderTopLeftRadius() const { return surround->border.topL
eft(); } | |
497 const LengthSize& borderTopRightRadius() const { return surround->border.top
Right(); } | |
498 const LengthSize& borderBottomLeftRadius() const { return surround->border.b
ottomLeft(); } | |
499 const LengthSize& borderBottomRightRadius() const { return surround->border.
bottomRight(); } | |
500 bool hasBorderRadius() const { return surround->border.hasBorderRadius(); } | |
501 | |
502 unsigned borderLeftWidth() const { return surround->border.borderLeftWidth()
; } | |
503 EBorderStyle borderLeftStyle() const { return surround->border.left().style(
); } | |
504 bool borderLeftIsTransparent() const { return surround->border.left().isTran
sparent(); } | |
505 unsigned borderRightWidth() const { return surround->border.borderRightWidth
(); } | |
506 EBorderStyle borderRightStyle() const { return surround->border.right().styl
e(); } | |
507 bool borderRightIsTransparent() const { return surround->border.right().isTr
ansparent(); } | |
508 unsigned borderTopWidth() const { return surround->border.borderTopWidth();
} | |
509 EBorderStyle borderTopStyle() const { return surround->border.top().style();
} | |
510 bool borderTopIsTransparent() const { return surround->border.top().isTransp
arent(); } | |
511 unsigned borderBottomWidth() const { return surround->border.borderBottomWid
th(); } | |
512 EBorderStyle borderBottomStyle() const { return surround->border.bottom().st
yle(); } | |
513 bool borderBottomIsTransparent() const { return surround->border.bottom().is
Transparent(); } | |
514 | |
515 unsigned short borderBeforeWidth() const; | |
516 unsigned short borderAfterWidth() const; | |
517 unsigned short borderStartWidth() const; | |
518 unsigned short borderEndWidth() const; | |
519 | |
520 unsigned short outlineSize() const { return max(0, outlineWidth() + outlineO
ffset()); } | |
521 unsigned short outlineWidth() const | |
522 { | |
523 if (m_background->outline().style() == BNONE) | |
524 return 0; | |
525 return m_background->outline().width(); | |
526 } | |
527 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > BHID
DEN; } | |
528 EBorderStyle outlineStyle() const { return m_background->outline().style();
} | |
529 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>
(m_background->outline().isAuto()); } | |
530 | |
531 EOverflow overflowX() const { return static_cast<EOverflow>(noninherited_fla
gs.overflowX); } | |
532 EOverflow overflowY() const { return static_cast<EOverflow>(noninherited_fla
gs.overflowY); } | |
533 // It's sufficient to just check one direction, since it's illegal to have v
isible on only one overflow value. | |
534 bool isOverflowVisible() const { ASSERT(overflowX() != OVISIBLE || overflowX
() == overflowY()); return overflowX() == OVISIBLE; } | |
535 bool isOverflowPaged() const { return overflowY() == OPAGEDX || overflowY()
== OPAGEDY; } | |
536 | |
537 EVisibility visibility() const { return static_cast<EVisibility>(inherited_f
lags._visibility); } | |
538 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(no
ninherited_flags.verticalAlign); } | |
539 const Length& verticalAlignLength() const { return m_box->verticalAlign(); } | |
540 | |
541 const Length& clipLeft() const { return visual->clip.left(); } | |
542 const Length& clipRight() const { return visual->clip.right(); } | |
543 const Length& clipTop() const { return visual->clip.top(); } | |
544 const Length& clipBottom() const { return visual->clip.bottom(); } | |
545 const LengthBox& clip() const { return visual->clip; } | |
546 bool hasAutoClip() const { return visual->hasAutoClip; } | |
547 | |
548 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(noninher
ited_flags.unicodeBidi); } | |
549 | |
550 EClear clear() const { return static_cast<EClear>(noninherited_flags.clear);
} | |
551 ETableLayout tableLayout() const { return static_cast<ETableLayout>(noninher
ited_flags.tableLayout); } | |
552 bool isFixedTableLayout() const { return tableLayout() == TFIXED && !logical
Width().isAuto(); } | |
553 | |
554 const Font& font() const; | |
555 const FontMetrics& fontMetrics() const; | |
556 const FontDescription& fontDescription() const; | |
557 float specifiedFontSize() const; | |
558 float computedFontSize() const; | |
559 int fontSize() const; | |
560 float fontSizeAdjust() const; | |
561 bool hasFontSizeAdjust() const; | |
562 FontWeight fontWeight() const; | |
563 FontStretch fontStretch() const; | |
564 | |
565 float textAutosizingMultiplier() const { return inherited->textAutosizingMul
tiplier; } | |
566 | |
567 const Length& textIndent() const { return rareInheritedData->indent; } | |
568 TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(r
areInheritedData->m_textIndentLine); } | |
569 TextIndentType textIndentType() const { return static_cast<TextIndentType>(r
areInheritedData->m_textIndentType); } | |
570 ETextAlign textAlign() const { return static_cast<ETextAlign>(inherited_flag
s._text_align); } | |
571 TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(rare
InheritedData->m_textAlignLast); } | |
572 TextJustify textJustify() const { return static_cast<TextJustify>(rareInheri
tedData->m_textJustify); } | |
573 ETextTransform textTransform() const { return static_cast<ETextTransform>(in
herited_flags._text_transform); } | |
574 TextDecoration textDecorationsInEffect() const; | |
575 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; | |
576 TextDecoration textDecoration() const { return static_cast<TextDecoration>(v
isual->textDecoration); } | |
577 TextUnderlinePosition textUnderlinePosition() const { return static_cast<Tex
tUnderlinePosition>(rareInheritedData->m_textUnderlinePosition); } | |
578 TextDecorationStyle textDecorationStyle() const { return static_cast<TextDec
orationStyle>(rareNonInheritedData->m_textDecorationStyle); } | |
579 float wordSpacing() const; | |
580 float letterSpacing() const; | |
581 | |
582 float zoom() const { return visual->m_zoom; } | |
583 float effectiveZoom() const { return rareInheritedData->m_effectiveZoom; } | |
584 | |
585 TextDirection direction() const { return static_cast<TextDirection>(inherite
d_flags._direction); } | |
586 bool isLeftToRightDirection() const { return direction() == LTR; } | |
587 bool selfOrAncestorHasDirAutoAttribute() const { return rareInheritedData->m
_selfOrAncestorHasDirAutoAttribute; } | |
588 | |
589 const Length& specifiedLineHeight() const; | |
590 Length lineHeight() const; | |
591 int computedLineHeight() const; | |
592 | |
593 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(inherited_f
lags._white_space); } | |
594 static bool autoWrap(EWhiteSpace ws) | |
595 { | |
596 // Nowrap and pre don't automatically wrap. | |
597 return ws != NOWRAP && ws != PRE; | |
598 } | |
599 | |
600 bool autoWrap() const | |
601 { | |
602 return autoWrap(whiteSpace()); | |
603 } | |
604 | |
605 static bool preserveNewline(EWhiteSpace ws) | |
606 { | |
607 // Normal and nowrap do not preserve newlines. | |
608 return ws != NORMAL && ws != NOWRAP; | |
609 } | |
610 | |
611 bool preserveNewline() const | |
612 { | |
613 return preserveNewline(whiteSpace()); | |
614 } | |
615 | |
616 static bool collapseWhiteSpace(EWhiteSpace ws) | |
617 { | |
618 // Pre and prewrap do not collapse whitespace. | |
619 return ws != PRE && ws != PRE_WRAP; | |
620 } | |
621 | |
622 bool collapseWhiteSpace() const | |
623 { | |
624 return collapseWhiteSpace(whiteSpace()); | |
625 } | |
626 | |
627 bool isCollapsibleWhiteSpace(UChar c) const | |
628 { | |
629 switch (c) { | |
630 case ' ': | |
631 case '\t': | |
632 return collapseWhiteSpace(); | |
633 case '\n': | |
634 return !preserveNewline(); | |
635 } | |
636 return false; | |
637 } | |
638 | |
639 bool breakOnlyAfterWhiteSpace() const | |
640 { | |
641 return whiteSpace() == PRE_WRAP || lineBreak() == LineBreakAfterWhiteSpa
ce; | |
642 } | |
643 | |
644 bool breakWords() const | |
645 { | |
646 return wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflowW
rap; | |
647 } | |
648 | |
649 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background-
>background().clip()); } | |
650 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr
ound; } | |
651 const FillLayer& backgroundLayers() const { return m_background->background(
); } | |
652 | |
653 StyleImage* maskImage() const { return rareNonInheritedData->m_mask.image();
} | |
654 FillLayer& accessMaskLayers() { return rareNonInheritedData.access()->m_mask
; } | |
655 const FillLayer& maskLayers() const { return rareNonInheritedData->m_mask; } | |
656 | |
657 const NinePieceImage& maskBoxImage() const { return rareNonInheritedData->m_
maskBoxImage; } | |
658 StyleImage* maskBoxImageSource() const { return rareNonInheritedData->m_mask
BoxImage.image(); } | |
659 const LengthBox& maskBoxImageSlices() const { return rareNonInheritedData->m
_maskBoxImage.imageSlices(); } | |
660 bool maskBoxImageSlicesFill() const { return rareNonInheritedData->m_maskBox
Image.fill(); } | |
661 const BorderImageLengthBox& maskBoxImageWidth() const { return rareNonInheri
tedData->m_maskBoxImage.borderSlices(); } | |
662 const BorderImageLengthBox& maskBoxImageOutset() const { return rareNonInher
itedData->m_maskBoxImage.outset(); } | |
663 | |
664 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>
(inherited_flags._border_collapse); } | |
665 short horizontalBorderSpacing() const; | |
666 short verticalBorderSpacing() const; | |
667 EEmptyCell emptyCells() const { return static_cast<EEmptyCell>(inherited_fla
gs._empty_cells); } | |
668 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(inherite
d_flags._caption_side); } | |
669 | |
670 EListStyleType listStyleType() const { return static_cast<EListStyleType>(in
herited_flags._list_style_type); } | |
671 StyleImage* listStyleImage() const; | |
672 EListStylePosition listStylePosition() const { return static_cast<EListStyle
Position>(inherited_flags._list_style_position); } | |
673 | |
674 const Length& marginTop() const { return surround->margin.top(); } | |
675 const Length& marginBottom() const { return surround->margin.bottom(); } | |
676 const Length& marginLeft() const { return surround->margin.left(); } | |
677 const Length& marginRight() const { return surround->margin.right(); } | |
678 const Length& marginBefore() const { return surround->margin.before(writingM
ode()); } | |
679 const Length& marginAfter() const { return surround->margin.after(writingMod
e()); } | |
680 const Length& marginStart() const { return surround->margin.start(writingMod
e(), direction()); } | |
681 const Length& marginEnd() const { return surround->margin.end(writingMode(),
direction()); } | |
682 const Length& marginStartUsing(const LayoutStyle* otherStyle) const { return
surround->margin.start(otherStyle->writingMode(), otherStyle->direction()); } | |
683 const Length& marginEndUsing(const LayoutStyle* otherStyle) const { return s
urround->margin.end(otherStyle->writingMode(), otherStyle->direction()); } | |
684 const Length& marginBeforeUsing(const LayoutStyle* otherStyle) const { retur
n surround->margin.before(otherStyle->writingMode()); } | |
685 const Length& marginAfterUsing(const LayoutStyle* otherStyle) const { return
surround->margin.after(otherStyle->writingMode()); } | |
686 | |
687 const LengthBox& paddingBox() const { return surround->padding; } | |
688 const Length& paddingTop() const { return surround->padding.top(); } | |
689 const Length& paddingBottom() const { return surround->padding.bottom(); } | |
690 const Length& paddingLeft() const { return surround->padding.left(); } | |
691 const Length& paddingRight() const { return surround->padding.right(); } | |
692 const Length& paddingBefore() const { return surround->padding.before(writin
gMode()); } | |
693 const Length& paddingAfter() const { return surround->padding.after(writingM
ode()); } | |
694 const Length& paddingStart() const { return surround->padding.start(writingM
ode(), direction()); } | |
695 const Length& paddingEnd() const { return surround->padding.end(writingMode(
), direction()); } | |
696 | |
697 ECursor cursor() const { return static_cast<ECursor>(inherited_flags._cursor
_style); } | |
698 CursorList* cursors() const { return rareInheritedData->cursorData.get(); } | |
699 | |
700 EInsideLink insideLink() const { return static_cast<EInsideLink>(inherited_f
lags._insideLink); } | |
701 bool isLink() const { return noninherited_flags.isLink; } | |
702 | |
703 short widows() const { return rareInheritedData->widows; } | |
704 short orphans() const { return rareInheritedData->orphans; } | |
705 bool hasAutoWidows() const { return rareInheritedData->widows == 1; } | |
706 bool hasAutoOrphans() const { return rareInheritedData->m_hasAutoOrphans; } | |
707 EPageBreak pageBreakInside() const { return static_cast<EPageBreak>(noninher
ited_flags.pageBreakInside); } | |
708 EPageBreak pageBreakBefore() const { return static_cast<EPageBreak>(noninher
ited_flags.pageBreakBefore); } | |
709 EPageBreak pageBreakAfter() const { return static_cast<EPageBreak>(noninheri
ted_flags.pageBreakAfter); } | |
710 | |
711 // CSS3 Getter Methods | |
712 | |
713 int outlineOffset() const | |
714 { | |
715 if (m_background->outline().style() == BNONE) | |
716 return 0; | |
717 return m_background->outline().offset(); | |
718 } | |
719 | |
720 ShadowList* textShadow() const { return rareInheritedData->textShadow.get();
} | |
721 | |
722 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } | |
723 float opacity() const { return rareNonInheritedData->opacity; } | |
724 bool hasOpacity() const { return opacity() < 1.0f; } | |
725 ControlPart appearance() const { return static_cast<ControlPart>(rareNonInhe
ritedData->m_appearance); } | |
726 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(rareNonIn
heritedData->m_deprecatedFlexibleBox->align); } | |
727 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(inher
ited_flags._box_direction); } | |
728 float boxFlex() const { return rareNonInheritedData->m_deprecatedFlexibleBox
->flex; } | |
729 unsigned boxFlexGroup() const { return rareNonInheritedData->m_deprecatedFle
xibleBox->flexGroup; } | |
730 EBoxLines boxLines() const { return static_cast<EBoxLines>(rareNonInheritedD
ata->m_deprecatedFlexibleBox->lines); } | |
731 unsigned boxOrdinalGroup() const { return rareNonInheritedData->m_deprecated
FlexibleBox->ordinalGroup; } | |
732 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(rareNonInherit
edData->m_deprecatedFlexibleBox->orient); } | |
733 EBoxPack boxPack() const { return static_cast<EBoxPack>(rareNonInheritedData
->m_deprecatedFlexibleBox->pack); } | |
734 | |
735 int order() const { return rareNonInheritedData->m_order; } | |
736 const Vector<String>& callbackSelectors() const { return rareNonInheritedDat
a->m_callbackSelectors; } | |
737 float flexGrow() const { return rareNonInheritedData->m_flexibleBox->m_flexG
row; } | |
738 float flexShrink() const { return rareNonInheritedData->m_flexibleBox->m_fle
xShrink; } | |
739 const Length& flexBasis() const { return rareNonInheritedData->m_flexibleBox
->m_flexBasis; } | |
740 ContentPosition alignContent() const { return static_cast<ContentPosition>(r
areNonInheritedData->m_alignContent); } | |
741 ContentDistributionType alignContentDistribution() const { return static_cas
t<ContentDistributionType>(rareNonInheritedData->m_alignContentDistribution); } | |
742 OverflowAlignment alignContentOverflowAlignment() const { return static_cast
<OverflowAlignment>(rareNonInheritedData->m_alignContentOverflowAlignment); } | |
743 ItemPosition alignItems() const { return static_cast<ItemPosition>(rareNonIn
heritedData->m_alignItems); } | |
744 OverflowAlignment alignItemsOverflowAlignment() const { return static_cast<O
verflowAlignment>(rareNonInheritedData->m_alignItemsOverflowAlignment); } | |
745 ItemPosition alignSelf() const { return static_cast<ItemPosition>(rareNonInh
eritedData->m_alignSelf); } | |
746 OverflowAlignment alignSelfOverflowAlignment() const { return static_cast<Ov
erflowAlignment>(rareNonInheritedData->m_alignSelfOverflowAlignment); } | |
747 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(ra
reNonInheritedData->m_flexibleBox->m_flexDirection); } | |
748 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn ||
flexDirection() == FlowColumnReverse; } | |
749 bool isReverseFlexDirection() const { return flexDirection() == FlowRowRever
se || flexDirection() == FlowColumnReverse; } | |
750 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedD
ata->m_flexibleBox->m_flexWrap); } | |
751 ContentPosition justifyContent() const { return static_cast<ContentPosition>
(rareNonInheritedData->m_justifyContent); } | |
752 ContentDistributionType justifyContentDistribution() const { return static_c
ast<ContentDistributionType>(rareNonInheritedData->m_justifyContentDistribution)
; } | |
753 OverflowAlignment justifyContentOverflowAlignment() const { return static_ca
st<OverflowAlignment>(rareNonInheritedData->m_justifyContentOverflowAlignment);
} | |
754 ItemPosition justifyItems() const { return static_cast<ItemPosition>(rareNon
InheritedData->m_justifyItems); } | |
755 OverflowAlignment justifyItemsOverflowAlignment() const { return static_cast
<OverflowAlignment>(rareNonInheritedData->m_justifyItemsOverflowAlignment); } | |
756 ItemPositionType justifyItemsPositionType() const { return static_cast<ItemP
ositionType>(rareNonInheritedData->m_justifyItemsPositionType); } | |
757 ItemPosition justifySelf() const { return static_cast<ItemPosition>(rareNonI
nheritedData->m_justifySelf); } | |
758 OverflowAlignment justifySelfOverflowAlignment() const { return static_cast<
OverflowAlignment>(rareNonInheritedData->m_justifySelfOverflowAlignment); } | |
759 | |
760 const Vector<GridTrackSize>& gridTemplateColumns() const { return rareNonInh
eritedData->m_grid->m_gridTemplateColumns; } | |
761 const Vector<GridTrackSize>& gridTemplateRows() const { return rareNonInheri
tedData->m_grid->m_gridTemplateRows; } | |
762 const NamedGridLinesMap& namedGridColumnLines() const { return rareNonInheri
tedData->m_grid->m_namedGridColumnLines; } | |
763 const NamedGridLinesMap& namedGridRowLines() const { return rareNonInherited
Data->m_grid->m_namedGridRowLines; } | |
764 const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return ra
reNonInheritedData->m_grid->m_orderedNamedGridColumnLines; } | |
765 const OrderedNamedGridLines& orderedNamedGridRowLines() const { return rareN
onInheritedData->m_grid->m_orderedNamedGridRowLines; } | |
766 const NamedGridAreaMap& namedGridArea() const { return rareNonInheritedData-
>m_grid->m_namedGridArea; } | |
767 size_t namedGridAreaRowCount() const { return rareNonInheritedData->m_grid->
m_namedGridAreaRowCount; } | |
768 size_t namedGridAreaColumnCount() const { return rareNonInheritedData->m_gri
d->m_namedGridAreaColumnCount; } | |
769 GridAutoFlow gridAutoFlow() const { return static_cast<GridAutoFlow>(rareNon
InheritedData->m_grid->m_gridAutoFlow); } | |
770 bool isGridAutoFlowDirectionRow() const { return (rareNonInheritedData->m_gr
id->m_gridAutoFlow & InternalAutoFlowDirectionRow) == InternalAutoFlowDirectionR
ow; } | |
771 bool isGridAutoFlowDirectionColumn() const { return (rareNonInheritedData->m
_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn) == InternalAutoFlowDire
ctionColumn; } | |
772 bool isGridAutoFlowAlgorithmSparse() const { return (rareNonInheritedData->m
_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse) == InternalAutoFlowAlgo
rithmSparse; } | |
773 bool isGridAutoFlowAlgorithmDense() const { return (rareNonInheritedData->m_
grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense) == InternalAutoFlowAlgori
thmDense; } | |
774 const GridTrackSize& gridAutoColumns() const { return rareNonInheritedData->
m_grid->m_gridAutoColumns; } | |
775 const GridTrackSize& gridAutoRows() const { return rareNonInheritedData->m_g
rid->m_gridAutoRows; } | |
776 | |
777 const GridPosition& gridColumnStart() const { return rareNonInheritedData->m
_gridItem->m_gridColumnStart; } | |
778 const GridPosition& gridColumnEnd() const { return rareNonInheritedData->m_g
ridItem->m_gridColumnEnd; } | |
779 const GridPosition& gridRowStart() const { return rareNonInheritedData->m_gr
idItem->m_gridRowStart; } | |
780 const GridPosition& gridRowEnd() const { return rareNonInheritedData->m_grid
Item->m_gridRowEnd; } | |
781 | |
782 ShadowList* boxShadow() const { return rareNonInheritedData->m_boxShadow.get
(); } | |
783 | |
784 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecoration
Break(); } | |
785 StyleReflection* boxReflect() const { return rareNonInheritedData->m_boxRefl
ect.get(); } | |
786 bool reflectionDataEquivalent(const LayoutStyle* otherStyle) const { return
rareNonInheritedData->reflectionDataEquivalent(*otherStyle->rareNonInheritedData
); } | |
787 | |
788 // FIXME: reflections should belong to this helper function but they are cur
rently handled | |
789 // through their self-painting layers. So the layout code doesn't account fo
r them. | |
790 bool hasVisualOverflowingEffect() const { return boxShadow() || hasBorderIma
geOutsets() || hasOutline(); } | |
791 | |
792 EBoxSizing boxSizing() const { return m_box->boxSizing(); } | |
793 EUserModify userModify() const { return static_cast<EUserModify>(rareInherit
edData->userModify); } | |
794 EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedD
ata->userDrag); } | |
795 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInherit
edData->userSelect); } | |
796 TextOverflow textOverflow() const { return static_cast<TextOverflow>(rareNon
InheritedData->textOverflow); } | |
797 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCol
lapse>(rareNonInheritedData->marginBeforeCollapse); } | |
798 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginColl
apse>(rareNonInheritedData->marginAfterCollapse); } | |
799 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedD
ata->wordBreak); } | |
800 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(rareI
nheritedData->overflowWrap); } | |
801 LineBreak lineBreak() const { return static_cast<LineBreak>(rareInheritedDat
a->lineBreak); } | |
802 const AtomicString& highlight() const { return rareInheritedData->highlight;
} | |
803 const AtomicString& hyphenationString() const { return rareInheritedData->hy
phenationString; } | |
804 const AtomicString& locale() const { return rareInheritedData->locale; } | |
805 EResize resize() const { return static_cast<EResize>(rareNonInheritedData->m
_resize); } | |
806 bool hasInlinePaginationAxis() const | |
807 { | |
808 // If the pagination axis is parallel with the writing mode inline axis,
columns may be laid | |
809 // out along the inline axis, just like for regular multicol. Otherwise,
we need to lay out | |
810 // along the block axis. | |
811 if (isOverflowPaged()) | |
812 return (overflowY() == OPAGEDX) == isHorizontalWritingMode(); | |
813 return false; | |
814 } | |
815 float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width
; } | |
816 bool hasAutoColumnWidth() const { return rareNonInheritedData->m_multiCol->m
_autoWidth; } | |
817 unsigned short columnCount() const { return rareNonInheritedData->m_multiCol
->m_count; } | |
818 bool hasAutoColumnCount() const { return rareNonInheritedData->m_multiCol->m
_autoCount; } | |
819 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColu
mnWidth(); } | |
820 ColumnFill columnFill() const { return static_cast<ColumnFill>(rareNonInheri
tedData->m_multiCol->m_fill); } | |
821 float columnGap() const { return rareNonInheritedData->m_multiCol->m_gap; } | |
822 bool hasNormalColumnGap() const { return rareNonInheritedData->m_multiCol->m
_normalGap; } | |
823 EBorderStyle columnRuleStyle() const { return rareNonInheritedData->m_multiC
ol->m_rule.style(); } | |
824 unsigned short columnRuleWidth() const { return rareNonInheritedData->m_mult
iCol->ruleWidth(); } | |
825 bool columnRuleIsTransparent() const { return rareNonInheritedData->m_multiC
ol->m_rule.isTransparent(); } | |
826 bool columnRuleEquivalent(const LayoutStyle* otherStyle) const; | |
827 ColumnSpan columnSpan() const { return static_cast<ColumnSpan>(rareNonInheri
tedData->m_multiCol->m_columnSpan); } | |
828 EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNo
nInheritedData->m_multiCol->m_breakBefore); } | |
829 EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNo
nInheritedData->m_multiCol->m_breakInside); } | |
830 EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNon
InheritedData->m_multiCol->m_breakAfter); } | |
831 bool hasInlineTransform() const { return rareNonInheritedData->m_hasInlineTr
ansform; } | |
832 const TransformOperations& transform() const { return rareNonInheritedData->
m_transform->m_operations; } | |
833 const TransformOrigin& transformOrigin() const { return rareNonInheritedData
->m_transform->m_origin; } | |
834 const Length& transformOriginX() const { return transformOrigin().x(); } | |
835 const Length& transformOriginY() const { return transformOrigin().y(); } | |
836 float transformOriginZ() const { return transformOrigin().z(); } | |
837 bool hasTransform() const { return hasTransformOperations() || hasMotionPath
() || hasCurrentTransformAnimation(); } | |
838 bool transformDataEquivalent(const LayoutStyle& otherStyle) const { return r
areNonInheritedData->m_transform == otherStyle.rareNonInheritedData->m_transform
; } | |
839 | |
840 StyleMotionPath* motionPath() const { return rareNonInheritedData->m_transfo
rm->m_motion.m_path.get(); } | |
841 bool hasMotionPath() const { return rareNonInheritedData->m_transform->m_mot
ion.m_path; } | |
842 const Length& motionOffset() const { return rareNonInheritedData->m_transfor
m->m_motion.m_offset; } | |
843 float motionRotation() const { return rareNonInheritedData->m_transform->m_m
otion.m_rotation; } | |
844 MotionRotationType motionRotationType() const { return rareNonInheritedData-
>m_transform->m_motion.m_rotationType; } | |
845 | |
846 TextEmphasisFill textEmphasisFill() const { return static_cast<TextEmphasisF
ill>(rareInheritedData->textEmphasisFill); } | |
847 TextEmphasisMark textEmphasisMark() const; | |
848 const AtomicString& textEmphasisCustomMark() const { return rareInheritedDat
a->textEmphasisCustomMark; } | |
849 TextEmphasisPosition textEmphasisPosition() const { return static_cast<TextE
mphasisPosition>(rareInheritedData->textEmphasisPosition); } | |
850 const AtomicString& textEmphasisMarkString() const; | |
851 | |
852 RubyPosition rubyPosition() const { return static_cast<RubyPosition>(rareInh
eritedData->m_rubyPosition); } | |
853 | |
854 TextOrientation textOrientation() const { return static_cast<TextOrientation
>(rareInheritedData->m_textOrientation); } | |
855 | |
856 ObjectFit objectFit() const { return static_cast<ObjectFit>(rareNonInherited
Data->m_objectFit); } | |
857 LengthPoint objectPosition() const { return rareNonInheritedData->m_objectPo
sition; } | |
858 | |
859 // Return true if any transform related property (currently transform/motion
Path, transformStyle3D or perspective) | |
860 // indicates that we are transforming | |
861 bool hasTransformRelatedProperty() const { return hasTransform() || preserve
s3D() || hasPerspective(); } | |
862 | |
863 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }
; | |
864 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; | |
865 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize,
ApplyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPa
th) const; | |
866 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, App
lyTransformOrigin = IncludeTransformOrigin, ApplyMotionPath = IncludeMotionPath)
const; | |
867 | |
868 bool hasMask() const { return rareNonInheritedData->m_mask.hasImage() || rar
eNonInheritedData->m_maskBoxImage.hasImage(); } | |
869 | |
870 TextCombine textCombine() const { return static_cast<TextCombine>(rareNonInh
eritedData->m_textCombine); } | |
871 bool hasTextCombine() const { return textCombine() != TextCombineNone; } | |
872 | |
873 TabSize tabSize() const { return rareInheritedData->m_tabSize; } | |
874 | |
875 // End CSS3 Getters | |
876 | |
877 // Apple-specific property getter methods | |
878 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(in
herited_flags._pointerEvents); } | |
879 const CSSAnimationData* animations() const { return rareNonInheritedData->m_
animations.get(); } | |
880 const CSSTransitionData* transitions() const { return rareNonInheritedData->
m_transitions.get(); } | |
881 | |
882 CSSAnimationData& accessAnimations(); | |
883 CSSTransitionData& accessTransitions(); | |
884 | |
885 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformSt
yle3D>(rareNonInheritedData->m_transformStyle3D); } | |
886 bool preserves3D() const { return rareNonInheritedData->m_transformStyle3D =
= TransformStyle3DPreserve3D; } | |
887 | |
888 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfac
eVisibility>(rareNonInheritedData->m_backfaceVisibility); } | |
889 float perspective() const { return rareNonInheritedData->m_perspective; } | |
890 bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0
; } | |
891 const LengthPoint& perspectiveOrigin() const { return rareNonInheritedData->
m_perspectiveOrigin; } | |
892 const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); } | |
893 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } | |
894 const LengthSize& pageSize() const { return rareNonInheritedData->m_pageSize
; } | |
895 PageSizeType pageSizeType() const { return static_cast<PageSizeType>(rareNon
InheritedData->m_pageSizeType); } | |
896 | |
897 bool hasCurrentOpacityAnimation() const { return rareNonInheritedData->m_has
CurrentOpacityAnimation; } | |
898 bool hasCurrentTransformAnimation() const { return rareNonInheritedData->m_h
asCurrentTransformAnimation; } | |
899 bool hasCurrentFilterAnimation() const { return rareNonInheritedData->m_hasC
urrentFilterAnimation; } | |
900 bool shouldCompositeForCurrentAnimations() const { return hasCurrentOpacityA
nimation() || hasCurrentTransformAnimation() || hasCurrentFilterAnimation(); } | |
901 | |
902 bool isRunningOpacityAnimationOnCompositor() const { return rareNonInherited
Data->m_runningOpacityAnimationOnCompositor; } | |
903 bool isRunningTransformAnimationOnCompositor() const { return rareNonInherit
edData->m_runningTransformAnimationOnCompositor; } | |
904 bool isRunningFilterAnimationOnCompositor() const { return rareNonInheritedD
ata->m_runningFilterAnimationOnCompositor; } | |
905 bool isRunningAnimationOnCompositor() const { return isRunningOpacityAnimati
onOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilter
AnimationOnCompositor(); } | |
906 | |
907 LineBoxContain lineBoxContain() const { return rareInheritedData->m_lineBoxC
ontain; } | |
908 const LineClampValue& lineClamp() const { return rareNonInheritedData->lineC
lamp; } | |
909 Color tapHighlightColor() const { return rareInheritedData->tapHighlightColo
r; } | |
910 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(rareI
nheritedData->textSecurity); } | |
911 | |
912 WritingMode writingMode() const { return static_cast<WritingMode>(inherited_
flags.m_writingMode); } | |
913 bool isHorizontalWritingMode() const { return blink::isHorizontalWritingMode
(writingMode()); } | |
914 bool isFlippedLinesWritingMode() const { return blink::isFlippedLinesWriting
Mode(writingMode()); } | |
915 bool isFlippedBlocksWritingMode() const { return blink::isFlippedBlocksWriti
ngMode(writingMode()); } | |
916 | |
917 EImageRendering imageRendering() const { return static_cast<EImageRendering>
(rareInheritedData->m_imageRendering); } | |
918 | |
919 ESpeak speak() const { return static_cast<ESpeak>(rareInheritedData->speak);
} | |
920 | |
921 FilterOperations& mutableFilter() { return rareNonInheritedData.access()->m_
filter.access()->m_operations; } | |
922 const FilterOperations& filter() const { return rareNonInheritedData->m_filt
er->m_operations; } | |
923 bool hasFilter() const { return !rareNonInheritedData->m_filter->m_operation
s.operations().isEmpty(); } | |
924 | |
925 WebBlendMode blendMode() const { return static_cast<WebBlendMode>(rareNonInh
eritedData->m_effectiveBlendMode); } | |
926 void setBlendMode(WebBlendMode v) { rareNonInheritedData.access()->m_effecti
veBlendMode = v; } | |
927 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } | |
928 | |
929 EIsolation isolation() const { return static_cast<EIsolation>(rareNonInherit
edData->m_isolation); } | |
930 void setIsolation(EIsolation v) { rareNonInheritedData.access()->m_isolation
= v; } | |
931 bool hasIsolation() const { return isolation() != IsolationAuto; } | |
932 | |
933 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLef
tToRightDirection() && isHorizontalWritingMode(); } | |
934 | |
935 TouchAction touchAction() const { return static_cast<TouchAction>(rareNonInh
eritedData->m_touchAction); } | |
936 | |
937 ScrollBehavior scrollBehavior() const { return static_cast<ScrollBehavior>(r
areNonInheritedData->m_scrollBehavior); } | |
938 WebScrollBlocksOn scrollBlocksOn() const { return static_cast<WebScrollBlock
sOn>(rareNonInheritedData->m_scrollBlocksOn); } | |
939 bool hasScrollBlocksOn() const { return scrollBlocksOn() != WebScrollBlocksO
nNone; } | |
940 | |
941 const Vector<CSSPropertyID>& willChangeProperties() const { return rareNonIn
heritedData->m_willChange->m_properties; } | |
942 bool willChangeContents() const { return rareNonInheritedData->m_willChange-
>m_contents; } | |
943 bool willChangeScrollPosition() const { return rareNonInheritedData->m_willC
hange->m_scrollPosition; } | |
944 bool hasWillChangeCompositingHint() const; | |
945 bool subtreeWillChangeContents() const { return rareInheritedData->m_subtree
WillChangeContents; } | |
946 | |
947 // attribute setter methods | |
948 | |
949 void setDisplay(EDisplay v) { noninherited_flags.effectiveDisplay = v; } | |
950 void setOriginalDisplay(EDisplay v) { noninherited_flags.originalDisplay = v
; } | |
951 void setPosition(EPosition v) { noninherited_flags.position = v; } | |
952 void setFloating(EFloat v) { noninherited_flags.floating = v; } | |
953 | |
954 void setLeft(const Length& v) { SET_VAR(surround, offset.m_left, v); } | |
955 void setRight(const Length& v) { SET_VAR(surround, offset.m_right, v); } | |
956 void setTop(const Length& v) { SET_VAR(surround, offset.m_top, v); } | |
957 void setBottom(const Length& v) { SET_VAR(surround, offset.m_bottom, v); } | |
958 | |
959 void setWidth(const Length& v) { SET_VAR(m_box, m_width, v); } | |
960 void setHeight(const Length& v) { SET_VAR(m_box, m_height, v); } | |
961 | |
962 void setLogicalWidth(const Length& v) | |
963 { | |
964 if (isHorizontalWritingMode()) { | |
965 SET_VAR(m_box, m_width, v); | |
966 } else { | |
967 SET_VAR(m_box, m_height, v); | |
968 } | |
969 } | |
970 | |
971 void setLogicalHeight(const Length& v) | |
972 { | |
973 if (isHorizontalWritingMode()) { | |
974 SET_VAR(m_box, m_height, v); | |
975 } else { | |
976 SET_VAR(m_box, m_width, v); | |
977 } | |
978 } | |
979 | |
980 void setMinWidth(const Length& v) { SET_VAR(m_box, m_minWidth, v); } | |
981 void setMaxWidth(const Length& v) { SET_VAR(m_box, m_maxWidth, v); } | |
982 void setMinHeight(const Length& v) { SET_VAR(m_box, m_minHeight, v); } | |
983 void setMaxHeight(const Length& v) { SET_VAR(m_box, m_maxHeight, v); } | |
984 | |
985 DraggableRegionMode getDraggableRegionMode() const { return rareNonInherited
Data->m_draggableRegionMode; } | |
986 void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(rareNonInherite
dData, m_draggableRegionMode, v); } | |
987 | |
988 void resetBorder() | |
989 { | |
990 resetBorderImage(); | |
991 resetBorderTop(); | |
992 resetBorderRight(); | |
993 resetBorderBottom(); | |
994 resetBorderLeft(); | |
995 resetBorderTopLeftRadius(); | |
996 resetBorderTopRightRadius(); | |
997 resetBorderBottomLeftRadius(); | |
998 resetBorderBottomRightRadius(); | |
999 } | |
1000 void resetBorderTop() { SET_VAR(surround, border.m_top, BorderValue()); } | |
1001 void resetBorderRight() { SET_VAR(surround, border.m_right, BorderValue());
} | |
1002 void resetBorderBottom() { SET_VAR(surround, border.m_bottom, BorderValue())
; } | |
1003 void resetBorderLeft() { SET_VAR(surround, border.m_left, BorderValue()); } | |
1004 void resetBorderImage() { SET_VAR(surround, border.m_image, NinePieceImage()
); } | |
1005 void resetBorderTopLeftRadius() { SET_VAR(surround, border.m_topLeft, initia
lBorderRadius()); } | |
1006 void resetBorderTopRightRadius() { SET_VAR(surround, border.m_topRight, init
ialBorderRadius()); } | |
1007 void resetBorderBottomLeftRadius() { SET_VAR(surround, border.m_bottomLeft,
initialBorderRadius()); } | |
1008 void resetBorderBottomRightRadius() { SET_VAR(surround, border.m_bottomRight
, initialBorderRadius()); } | |
1009 | |
1010 void setBackgroundColor(const StyleColor& v) { SET_VAR(m_background, m_color
, v); } | |
1011 | |
1012 void setBorderImage(const NinePieceImage& b) { SET_VAR(surround, border.m_im
age, b); } | |
1013 void setBorderImageSource(PassRefPtr<StyleImage>); | |
1014 void setBorderImageSlices(const LengthBox&); | |
1015 void setBorderImageSlicesFill(bool); | |
1016 void setBorderImageWidth(const BorderImageLengthBox&); | |
1017 void setBorderImageOutset(const BorderImageLengthBox&); | |
1018 | |
1019 void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(surround, border.
m_topLeft, s); } | |
1020 void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(surround, border
.m_topRight, s); } | |
1021 void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(surround, bord
er.m_bottomLeft, s); } | |
1022 void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(surround, bor
der.m_bottomRight, s); } | |
1023 | |
1024 void setBorderRadius(const LengthSize& s) | |
1025 { | |
1026 setBorderTopLeftRadius(s); | |
1027 setBorderTopRightRadius(s); | |
1028 setBorderBottomLeftRadius(s); | |
1029 setBorderBottomRightRadius(s); | |
1030 } | |
1031 void setBorderRadius(const IntSize& s) | |
1032 { | |
1033 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(),
Fixed))); | |
1034 } | |
1035 | |
1036 FloatRoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool incl
udeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; | |
1037 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool
includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; | |
1038 | |
1039 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, | |
1040 int topWidth, int bottomWidth, int leftWidth, int rightWidth, bool inclu
deLogicalLeftEdge, bool includeLogicalRightEdge) const; | |
1041 | |
1042 void setBorderLeftWidth(unsigned v) { SET_VAR(surround, border.m_left.m_widt
h, v); } | |
1043 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(surround, border.m_left.m_
style, v); } | |
1044 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surroun
d, border.m_left, v); } | |
1045 void setBorderRightWidth(unsigned v) { SET_VAR(surround, border.m_right.m_wi
dth, v); } | |
1046 void setBorderRightStyle(EBorderStyle v) { SET_VAR(surround, border.m_right.
m_style, v); } | |
1047 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surrou
nd, border.m_right, v); } | |
1048 void setBorderTopWidth(unsigned v) { SET_VAR(surround, border.m_top.m_width,
v); } | |
1049 void setBorderTopStyle(EBorderStyle v) { SET_VAR(surround, border.m_top.m_st
yle, v); } | |
1050 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surround
, border.m_top, v); } | |
1051 void setBorderBottomWidth(unsigned v) { SET_VAR(surround, border.m_bottom.m_
width, v); } | |
1052 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(surround, border.m_botto
m.m_style, v); } | |
1053 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(surro
und, border.m_bottom, v); } | |
1054 | |
1055 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_w
idth, v); } | |
1056 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_o
utline.m_isAuto, isAuto); } | |
1057 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_sty
le, v); } | |
1058 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_backgrou
nd, m_outline, v); } | |
1059 bool isOutlineEquivalent(const LayoutStyle* otherStyle) const | |
1060 { | |
1061 // No other style, so we don't have an outline then we consider them to
be the same. | |
1062 if (!otherStyle) | |
1063 return !hasOutline(); | |
1064 return m_background->outline().visuallyEqual(otherStyle->m_background->o
utline()); | |
1065 } | |
1066 void setOutlineFromStyle(const LayoutStyle& o) | |
1067 { | |
1068 ASSERT(!isOutlineEquivalent(&o)); | |
1069 m_background.access()->m_outline = o.m_background->m_outline; | |
1070 } | |
1071 | |
1072 void setOverflowX(EOverflow v) { noninherited_flags.overflowX = v; } | |
1073 void setOverflowY(EOverflow v) { noninherited_flags.overflowY = v; } | |
1074 void setVisibility(EVisibility v) { inherited_flags._visibility = v; } | |
1075 void setVerticalAlign(EVerticalAlign v) { noninherited_flags.verticalAlign =
v; } | |
1076 void setVerticalAlignLength(const Length& length) { setVerticalAlign(LENGTH)
; SET_VAR(m_box, m_verticalAlign, length); } | |
1077 | |
1078 void setHasAutoClip() { SET_VAR(visual, hasAutoClip, true); SET_VAR(visual,
clip, LayoutStyle::initialClip()); } | |
1079 void setClip(const LengthBox& box) { SET_VAR(visual, hasAutoClip, false); SE
T_VAR(visual, clip, box); } | |
1080 | |
1081 void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags.unicodeBidi = b; } | |
1082 | |
1083 void setClear(EClear v) { noninherited_flags.clear = v; } | |
1084 void setTableLayout(ETableLayout v) { noninherited_flags.tableLayout = v; } | |
1085 | |
1086 bool setFontDescription(const FontDescription&); | |
1087 | |
1088 void setTextAutosizingMultiplier(float); | |
1089 | |
1090 void setColor(const Color&); | |
1091 void setTextIndent(const Length& v) { SET_VAR(rareInheritedData, indent, v);
} | |
1092 void setTextIndentLine(TextIndentLine v) { SET_VAR(rareInheritedData, m_text
IndentLine, v); } | |
1093 void setTextIndentType(TextIndentType v) { SET_VAR(rareInheritedData, m_text
IndentType, v); } | |
1094 void setTextAlign(ETextAlign v) { inherited_flags._text_align = v; } | |
1095 void setTextAlignLast(TextAlignLast v) { SET_VAR(rareInheritedData, m_textAl
ignLast, v); } | |
1096 void setTextJustify(TextJustify v) { SET_VAR(rareInheritedData, m_textJustif
y, v); } | |
1097 void setTextTransform(ETextTransform v) { inherited_flags._text_transform =
v; } | |
1098 void applyTextDecorations(); | |
1099 void clearAppliedTextDecorations(); | |
1100 void setTextDecoration(TextDecoration v) { SET_VAR(visual, textDecoration, v
); } | |
1101 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(rareInherit
edData, m_textUnderlinePosition, v); } | |
1102 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(rareNonInherite
dData, m_textDecorationStyle, v); } | |
1103 void setDirection(TextDirection v) { inherited_flags._direction = v; } | |
1104 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(rareInheritedDat
a, m_selfOrAncestorHasDirAutoAttribute, v); } | |
1105 void setLineHeight(const Length& specifiedLineHeight); | |
1106 bool setZoom(float); | |
1107 bool setEffectiveZoom(float); | |
1108 void clearMultiCol(); | |
1109 | |
1110 void setImageRendering(EImageRendering v) { SET_VAR(rareInheritedData, m_ima
geRendering, v); } | |
1111 | |
1112 void setWhiteSpace(EWhiteSpace v) { inherited_flags._white_space = v; } | |
1113 | |
1114 // FIXME: Remove these two and replace them with respective FontBuilder call
s. | |
1115 void setWordSpacing(float); | |
1116 void setLetterSpacing(float); | |
1117 | |
1118 void adjustBackgroundLayers() | |
1119 { | |
1120 if (backgroundLayers().next()) { | |
1121 accessBackgroundLayers().cullEmptyLayers(); | |
1122 accessBackgroundLayers().fillUnsetProperties(); | |
1123 } | |
1124 } | |
1125 | |
1126 void adjustMaskLayers() | |
1127 { | |
1128 if (maskLayers().next()) { | |
1129 accessMaskLayers().cullEmptyLayers(); | |
1130 accessMaskLayers().fillUnsetProperties(); | |
1131 } | |
1132 } | |
1133 | |
1134 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(rareNonInheritedData
, m_maskBoxImage, b); } | |
1135 void setMaskBoxImageSource(PassRefPtr<StyleImage> v) { rareNonInheritedData.
access()->m_maskBoxImage.setImage(v); } | |
1136 void setMaskBoxImageSlices(const LengthBox& slices) | |
1137 { | |
1138 rareNonInheritedData.access()->m_maskBoxImage.setImageSlices(slices); | |
1139 } | |
1140 void setMaskBoxImageSlicesFill(bool fill) | |
1141 { | |
1142 rareNonInheritedData.access()->m_maskBoxImage.setFill(fill); | |
1143 } | |
1144 void setMaskBoxImageWidth(const BorderImageLengthBox& slices) | |
1145 { | |
1146 rareNonInheritedData.access()->m_maskBoxImage.setBorderSlices(slices); | |
1147 } | |
1148 void setMaskBoxImageOutset(const BorderImageLengthBox& outset) | |
1149 { | |
1150 rareNonInheritedData.access()->m_maskBoxImage.setOutset(outset); | |
1151 } | |
1152 | |
1153 void setBorderCollapse(EBorderCollapse collapse) { inherited_flags._border_c
ollapse = collapse; } | |
1154 void setHorizontalBorderSpacing(short); | |
1155 void setVerticalBorderSpacing(short); | |
1156 void setEmptyCells(EEmptyCell v) { inherited_flags._empty_cells = v; } | |
1157 void setCaptionSide(ECaptionSide v) { inherited_flags._caption_side = v; } | |
1158 | |
1159 void setListStyleType(EListStyleType v) { inherited_flags._list_style_type =
v; } | |
1160 void setListStyleImage(PassRefPtr<StyleImage>); | |
1161 void setListStylePosition(EListStylePosition v) { inherited_flags._list_styl
e_position = v; } | |
1162 | |
1163 void setMarginTop(const Length& v) { SET_VAR(surround, margin.m_top, v); } | |
1164 void setMarginBottom(const Length& v) { SET_VAR(surround, margin.m_bottom, v
); } | |
1165 void setMarginLeft(const Length& v) { SET_VAR(surround, margin.m_left, v); } | |
1166 void setMarginRight(const Length& v) { SET_VAR(surround, margin.m_right, v);
} | |
1167 void setMarginStart(const Length&); | |
1168 void setMarginEnd(const Length&); | |
1169 | |
1170 void resetPadding() { SET_VAR(surround, padding, LengthBox(Fixed)); } | |
1171 void setPaddingBox(const LengthBox& b) { SET_VAR(surround, padding, b); } | |
1172 void setPaddingTop(const Length& v) { SET_VAR(surround, padding.m_top, v); } | |
1173 void setPaddingBottom(const Length& v) { SET_VAR(surround, padding.m_bottom,
v); } | |
1174 void setPaddingLeft(const Length& v) { SET_VAR(surround, padding.m_left, v);
} | |
1175 void setPaddingRight(const Length& v) { SET_VAR(surround, padding.m_right, v
); } | |
1176 | |
1177 void setCursor(ECursor c) { inherited_flags._cursor_style = c; } | |
1178 void addCursor(PassRefPtr<StyleImage>, bool hotSpotSpecified, const IntPoint
& hotSpot = IntPoint()); | |
1179 void setCursorList(PassRefPtr<CursorList>); | |
1180 void clearCursorList(); | |
1181 | |
1182 void setInsideLink(EInsideLink insideLink) { inherited_flags._insideLink = i
nsideLink; } | |
1183 void setIsLink(bool b) { noninherited_flags.isLink = b; } | |
1184 | |
1185 PrintColorAdjust printColorAdjust() const { return static_cast<PrintColorAdj
ust>(inherited_flags.m_printColorAdjust); } | |
1186 void setPrintColorAdjust(PrintColorAdjust value) { inherited_flags.m_printCo
lorAdjust = value; } | |
1187 | |
1188 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } | |
1189 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_b
ox, m_zIndex, 0); } | |
1190 int zIndex() const { return m_box->zIndex(); } | |
1191 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo
x, m_zIndex, v); } | |
1192 | |
1193 void setHasAutoWidows() { SET_VAR(rareInheritedData, widows, initialWidows()
); } | |
1194 void setWidows(short w) { SET_VAR(rareInheritedData, widows, w); } | |
1195 | |
1196 void setHasAutoOrphans() { SET_VAR(rareInheritedData, m_hasAutoOrphans, true
); SET_VAR(rareInheritedData, orphans, initialOrphans()); } | |
1197 void setOrphans(short o) { SET_VAR(rareInheritedData, m_hasAutoOrphans, fals
e); SET_VAR(rareInheritedData, orphans, o); } | |
1198 | |
1199 // For valid values of page-break-inside see http://www.w3.org/TR/CSS21/page
.html#page-break-props | |
1200 void setPageBreakInside(EPageBreak b) { ASSERT(b == PBAUTO || b == PBAVOID);
noninherited_flags.pageBreakInside = b; } | |
1201 void setPageBreakBefore(EPageBreak b) { noninherited_flags.pageBreakBefore =
b; } | |
1202 void setPageBreakAfter(EPageBreak b) { noninherited_flags.pageBreakAfter = b
; } | |
1203 | |
1204 // CSS3 Setters | |
1205 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v);
} | |
1206 void setTextShadow(PassRefPtr<ShadowList>); | |
1207 void setTextStrokeColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInher
itedData, textStrokeColor, setTextStrokeColor, c); } | |
1208 void setTextStrokeWidth(float w) { SET_VAR(rareInheritedData, textStrokeWidt
h, w); } | |
1209 void setTextFillColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInherit
edData, textFillColor, setTextFillColor, c); } | |
1210 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(rareNo
nInheritedData, opacity, v); } | |
1211 void setAppearance(ControlPart a) { SET_VAR(rareNonInheritedData, m_appearan
ce, a); } | |
1212 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexb
ox-20090723/#alignment | |
1213 void setBoxAlign(EBoxAlignment a) { SET_VAR(rareNonInheritedData.access()->m
_deprecatedFlexibleBox, align, a); } | |
1214 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDeco
rationBreak, b); } | |
1215 void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d;
} | |
1216 void setBoxFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_deprecat
edFlexibleBox, flex, f); } | |
1217 void setBoxFlexGroup(unsigned fg) { SET_VAR(rareNonInheritedData.access()->m
_deprecatedFlexibleBox, flexGroup, fg); } | |
1218 void setBoxLines(EBoxLines l) { SET_VAR(rareNonInheritedData.access()->m_dep
recatedFlexibleBox, lines, l); } | |
1219 void setBoxOrdinalGroup(unsigned og) { SET_VAR(rareNonInheritedData.access()
->m_deprecatedFlexibleBox, ordinalGroup, og); } | |
1220 void setBoxOrient(EBoxOrient o) { SET_VAR(rareNonInheritedData.access()->m_d
eprecatedFlexibleBox, orient, o); } | |
1221 void setBoxPack(EBoxPack p) { SET_VAR(rareNonInheritedData.access()->m_depre
catedFlexibleBox, pack, p); } | |
1222 void setBoxShadow(PassRefPtr<ShadowList>); | |
1223 void setBoxReflect(PassRefPtr<StyleReflection> reflect) { if (rareNonInherit
edData->m_boxReflect != reflect) rareNonInheritedData.access()->m_boxReflect = r
eflect; } | |
1224 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); } | |
1225 void setFlexGrow(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibl
eBox, m_flexGrow, f); } | |
1226 void setFlexShrink(float f) { SET_VAR(rareNonInheritedData.access()->m_flexi
bleBox, m_flexShrink, f); } | |
1227 void setFlexBasis(const Length& length) { SET_VAR(rareNonInheritedData.acces
s()->m_flexibleBox, m_flexBasis, length); } | |
1228 // We restrict the smallest value to int min + 2 because we use int min and
int min + 1 as special values in a hash set. | |
1229 void setOrder(int o) { SET_VAR(rareNonInheritedData, m_order, max(std::numer
ic_limits<int>::min() + 2, o)); } | |
1230 void addCallbackSelector(const String& selector); | |
1231 void setAlignContent(ContentPosition p) { SET_VAR(rareNonInheritedData, m_al
ignContent, p); } | |
1232 void setAlignContentDistribution(ContentDistributionType p) { SET_VAR(rareNo
nInheritedData, m_alignContentDistribution, p); } | |
1233 void setAlignContentOverflowAlignment(OverflowAlignment overflowAlignment) {
SET_VAR(rareNonInheritedData, m_alignContentOverflowAlignment, overflowAlignmen
t); } | |
1234 void setAlignItems(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignIt
ems, a); } | |
1235 void setAlignItemsOverflowAlignment(OverflowAlignment overflowAlignment) { S
ET_VAR(rareNonInheritedData, m_alignItemsOverflowAlignment, overflowAlignment);
} | |
1236 void setAlignSelf(ItemPosition a) { SET_VAR(rareNonInheritedData, m_alignSel
f, a); } | |
1237 void setAlignSelfOverflowAlignment(OverflowAlignment overflowAlignment) { SE
T_VAR(rareNonInheritedData, m_alignSelfOverflowAlignment, overflowAlignment); } | |
1238 void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedDa
ta.access()->m_flexibleBox, m_flexDirection, direction); } | |
1239 void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_fle
xibleBox, m_flexWrap, w); } | |
1240 void setJustifyContent(ContentPosition p) { SET_VAR(rareNonInheritedData, m_
justifyContent, p); } | |
1241 void setJustifyContentDistribution(ContentDistributionType p) { SET_VAR(rare
NonInheritedData, m_justifyContentDistribution, p); } | |
1242 void setJustifyContentOverflowAlignment(OverflowAlignment overflowAlignment)
{ SET_VAR(rareNonInheritedData, m_justifyContentOverflowAlignment, overflowAlig
nment); } | |
1243 void setJustifyItems(ItemPosition justifyItems) { SET_VAR(rareNonInheritedDa
ta, m_justifyItems, justifyItems); } | |
1244 void setJustifyItemsOverflowAlignment(OverflowAlignment overflowAlignment) {
SET_VAR(rareNonInheritedData, m_justifyItemsOverflowAlignment, overflowAlignmen
t); } | |
1245 void setJustifyItemsPositionType(ItemPositionType positionType) { SET_VAR(ra
reNonInheritedData, m_justifyItemsPositionType, positionType); } | |
1246 void setJustifySelf(ItemPosition justifySelf) { SET_VAR(rareNonInheritedData
, m_justifySelf, justifySelf); } | |
1247 void setJustifySelfOverflowAlignment(OverflowAlignment overflowAlignment) {
SET_VAR(rareNonInheritedData, m_justifySelfOverflowAlignment, overflowAlignment)
; } | |
1248 void setGridAutoColumns(const GridTrackSize& length) { SET_VAR(rareNonInheri
tedData.access()->m_grid, m_gridAutoColumns, length); } | |
1249 void setGridAutoRows(const GridTrackSize& length) { SET_VAR(rareNonInherited
Data.access()->m_grid, m_gridAutoRows, length); } | |
1250 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_VAR(
rareNonInheritedData.access()->m_grid, m_gridTemplateColumns, lengths); } | |
1251 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_VAR(rar
eNonInheritedData.access()->m_grid, m_gridTemplateRows, lengths); } | |
1252 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines)
{ SET_VAR(rareNonInheritedData.access()->m_grid, m_namedGridColumnLines, namedGr
idColumnLines); } | |
1253 void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_
VAR(rareNonInheritedData.access()->m_grid, m_namedGridRowLines, namedGridRowLine
s); } | |
1254 void setOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedName
dGridColumnLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_orderedName
dGridColumnLines, orderedNamedGridColumnLines); } | |
1255 void setOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGr
idRowLines) { SET_VAR(rareNonInheritedData.access()->m_grid, m_orderedNamedGridR
owLines, orderedNamedGridRowLines); } | |
1256 void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_VAR(rareN
onInheritedData.access()->m_grid, m_namedGridArea, namedGridArea); } | |
1257 void setNamedGridAreaRowCount(size_t rowCount) { SET_VAR(rareNonInheritedDat
a.access()->m_grid, m_namedGridAreaRowCount, rowCount); } | |
1258 void setNamedGridAreaColumnCount(size_t columnCount) { SET_VAR(rareNonInheri
tedData.access()->m_grid, m_namedGridAreaColumnCount, columnCount); } | |
1259 void setGridAutoFlow(GridAutoFlow flow) { SET_VAR(rareNonInheritedData.acces
s()->m_grid, m_gridAutoFlow, flow); } | |
1260 | |
1261 void setGridColumnStart(const GridPosition& columnStartPosition) { SET_VAR(r
areNonInheritedData.access()->m_gridItem, m_gridColumnStart, columnStartPosition
); } | |
1262 void setGridColumnEnd(const GridPosition& columnEndPosition) { SET_VAR(rareN
onInheritedData.access()->m_gridItem, m_gridColumnEnd, columnEndPosition); } | |
1263 void setGridRowStart(const GridPosition& rowStartPosition) { SET_VAR(rareNon
InheritedData.access()->m_gridItem, m_gridRowStart, rowStartPosition); } | |
1264 void setGridRowEnd(const GridPosition& rowEndPosition) { SET_VAR(rareNonInhe
ritedData.access()->m_gridItem, m_gridRowEnd, rowEndPosition); } | |
1265 | |
1266 void setUserModify(EUserModify u) { SET_VAR(rareInheritedData, userModify, u
); } | |
1267 void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d);
} | |
1268 void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s
); } | |
1269 void setTextOverflow(TextOverflow overflow) { SET_VAR(rareNonInheritedData,
textOverflow, overflow); } | |
1270 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedDa
ta, marginBeforeCollapse, c); } | |
1271 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedDat
a, marginAfterCollapse, c); } | |
1272 void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b);
} | |
1273 void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowW
rap, b); } | |
1274 void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); } | |
1275 void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highli
ght, h); } | |
1276 void setHyphenationString(const AtomicString& h) { SET_VAR(rareInheritedData
, hyphenationString, h); } | |
1277 void setLocale(const AtomicString& locale) { SET_VAR(rareInheritedData, loca
le, locale); } | |
1278 void setResize(EResize r) { SET_VAR(rareNonInheritedData, m_resize, r); } | |
1279 void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_mult
iCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_
width, f); } | |
1280 void setHasAutoColumnWidth() { SET_VAR(rareNonInheritedData.access()->m_mult
iCol, m_autoWidth, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_w
idth, 0); } | |
1281 void setColumnCount(unsigned short c) { SET_VAR(rareNonInheritedData.access(
)->m_multiCol, m_autoCount, false); SET_VAR(rareNonInheritedData.access()->m_mul
tiCol, m_count, c); } | |
1282 void setHasAutoColumnCount() { SET_VAR(rareNonInheritedData.access()->m_mult
iCol, m_autoCount, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_c
ount, 0); } | |
1283 void setColumnFill(ColumnFill columnFill) { SET_VAR(rareNonInheritedData.acc
ess()->m_multiCol, m_fill, columnFill); } | |
1284 void setColumnGap(float f) { SET_VAR(rareNonInheritedData.access()->m_multiC
ol, m_normalGap, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_ga
p, f); } | |
1285 void setHasNormalColumnGap() { SET_VAR(rareNonInheritedData.access()->m_mult
iCol, m_normalGap, true); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_g
ap, 0); } | |
1286 void setColumnRuleColor(const StyleColor& c) { SET_BORDERVALUE_COLOR(rareNon
InheritedData.access()->m_multiCol, m_rule, c); } | |
1287 void setColumnRuleStyle(EBorderStyle b) { SET_VAR(rareNonInheritedData.acces
s()->m_multiCol, m_rule.m_style, b); } | |
1288 void setColumnRuleWidth(unsigned short w) { SET_VAR(rareNonInheritedData.acc
ess()->m_multiCol, m_rule.m_width, w); } | |
1289 void setColumnSpan(ColumnSpan columnSpan) { SET_VAR(rareNonInheritedData.acc
ess()->m_multiCol, m_columnSpan, columnSpan); } | |
1290 void setColumnBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData.acces
s()->m_multiCol, m_breakBefore, p); } | |
1291 // For valid values of column-break-inside see http://www.w3.org/TR/css3-mul
ticol/#break-before-break-after-break-inside | |
1292 void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID
); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); } | |
1293 void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access
()->m_multiCol, m_breakAfter, p); } | |
1294 void inheritColumnPropertiesFrom(const LayoutStyle& parent) { rareNonInherit
edData.access()->m_multiCol = parent.rareNonInheritedData->m_multiCol; } | |
1295 void setHasInlineTransform(bool b) { SET_VAR(rareNonInheritedData, m_hasInli
neTransform, b); } | |
1296 void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInherited
Data.access()->m_transform, m_operations, ops); } | |
1297 void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrig
in(v, transformOriginY(), transformOriginZ())); } | |
1298 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig
in(transformOriginX(), v, transformOriginZ())); } | |
1299 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans
formOriginX(), transformOriginY(), f)); } | |
1300 void setTransformOrigin(const TransformOrigin& o) { SET_VAR(rareNonInherited
Data.access()->m_transform, m_origin, o); } | |
1301 void setSpeak(ESpeak s) { SET_VAR(rareInheritedData, speak, s); } | |
1302 void setTextCombine(TextCombine v) { SET_VAR(rareNonInheritedData, m_textCom
bine, v); } | |
1303 void setTextDecorationColor(const StyleColor& c) { SET_VAR(rareNonInheritedD
ata, m_textDecorationColor, c); } | |
1304 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(rareInh
eritedData, textEmphasisColor, setTextEmphasisColor, c); } | |
1305 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(rareInheritedData,
textEmphasisFill, fill); } | |
1306 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(rareInheritedData,
textEmphasisMark, mark); } | |
1307 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(rareInher
itedData, textEmphasisCustomMark, mark); } | |
1308 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(rareIn
heritedData, textEmphasisPosition, position); } | |
1309 bool setTextOrientation(TextOrientation); | |
1310 | |
1311 void setMotionPath(PassRefPtr<StyleMotionPath>); | |
1312 void resetMotionPath(); | |
1313 void setMotionOffset(const Length& motionOffset) { SET_VAR(rareNonInheritedD
ata.access()->m_transform, m_motion.m_offset, motionOffset); } | |
1314 void setMotionRotation(float motionRotation) { SET_VAR(rareNonInheritedData.
access()->m_transform, m_motion.m_rotation, motionRotation); } | |
1315 void setMotionRotationType(MotionRotationType motionRotationType) { SET_VAR(
rareNonInheritedData.access()->m_transform, m_motion.m_rotationType, motionRotat
ionType); } | |
1316 | |
1317 void setObjectFit(ObjectFit f) { SET_VAR(rareNonInheritedData, m_objectFit,
f); } | |
1318 void setObjectPosition(LengthPoint position) { SET_VAR(rareNonInheritedData,
m_objectPosition, position); } | |
1319 | |
1320 void setRubyPosition(RubyPosition position) { SET_VAR(rareInheritedData, m_r
ubyPosition, position); } | |
1321 | |
1322 void setFilter(const FilterOperations& ops) { SET_VAR(rareNonInheritedData.a
ccess()->m_filter, m_operations, ops); } | |
1323 | |
1324 void setTabSize(TabSize size) { SET_VAR(rareInheritedData, m_tabSize, size);
} | |
1325 | |
1326 // End CSS3 Setters | |
1327 | |
1328 void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(rareNonInheritedData, m_wrapFl
ow, wrapFlow); } | |
1329 void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(rareNonInheritedData,
m_wrapThrough, wrapThrough); } | |
1330 | |
1331 // Apple-specific property setters | |
1332 void setPointerEvents(EPointerEvents p) { inherited_flags._pointerEvents = p
; } | |
1333 | |
1334 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(rareNonInheritedData
, m_transformStyle3D, b); } | |
1335 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(rareNonInherited
Data, m_backfaceVisibility, b); } | |
1336 void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective,
p); } | |
1337 void setPerspectiveOriginX(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(v, perspectiveOriginY())); } | |
1338 void setPerspectiveOriginY(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(perspectiveOriginX(), v)); } | |
1339 void setPerspectiveOrigin(const LengthPoint& p) { SET_VAR(rareNonInheritedDa
ta, m_perspectiveOrigin, p); } | |
1340 void setPageSize(const LengthSize& s) { SET_VAR(rareNonInheritedData, m_page
Size, s); } | |
1341 void setPageSizeType(PageSizeType t) { SET_VAR(rareNonInheritedData, m_pageS
izeType, t); } | |
1342 void resetPageSizeType() { SET_VAR(rareNonInheritedData, m_pageSizeType, PAG
E_SIZE_AUTO); } | |
1343 | |
1344 void setHasCurrentOpacityAnimation(bool b = true) { SET_VAR(rareNonInherited
Data, m_hasCurrentOpacityAnimation, b); } | |
1345 void setHasCurrentTransformAnimation(bool b = true) { SET_VAR(rareNonInherit
edData, m_hasCurrentTransformAnimation, b); } | |
1346 void setHasCurrentFilterAnimation(bool b = true) { SET_VAR(rareNonInheritedD
ata, m_hasCurrentFilterAnimation, b); } | |
1347 | |
1348 void setIsRunningOpacityAnimationOnCompositor(bool b = true) { SET_VAR(rareN
onInheritedData, m_runningOpacityAnimationOnCompositor, b); } | |
1349 void setIsRunningTransformAnimationOnCompositor(bool b = true) { SET_VAR(rar
eNonInheritedData, m_runningTransformAnimationOnCompositor, b); } | |
1350 void setIsRunningFilterAnimationOnCompositor(bool b = true) { SET_VAR(rareNo
nInheritedData, m_runningFilterAnimationOnCompositor, b); } | |
1351 | |
1352 void setLineBoxContain(LineBoxContain c) { SET_VAR(rareInheritedData, m_line
BoxContain, c); } | |
1353 void setLineClamp(LineClampValue c) { SET_VAR(rareNonInheritedData, lineClam
p, c); } | |
1354 void setTapHighlightColor(const Color& c) { SET_VAR(rareInheritedData, tapHi
ghlightColor, c); } | |
1355 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(rareInheritedDat
a, textSecurity, aTextSecurity); } | |
1356 void setTouchAction(TouchAction t) { SET_VAR(rareNonInheritedData, m_touchAc
tion, t); } | |
1357 | |
1358 void setScrollBehavior(ScrollBehavior b) { SET_VAR(rareNonInheritedData, m_s
crollBehavior, b); } | |
1359 void setScrollBlocksOn(WebScrollBlocksOn b) { SET_VAR(rareNonInheritedData,
m_scrollBlocksOn, b); } | |
1360 | |
1361 void setWillChangeProperties(const Vector<CSSPropertyID>& properties) { SET_
VAR(rareNonInheritedData.access()->m_willChange, m_properties, properties); } | |
1362 void setWillChangeContents(bool b) { SET_VAR(rareNonInheritedData.access()->
m_willChange, m_contents, b); } | |
1363 void setWillChangeScrollPosition(bool b) { SET_VAR(rareNonInheritedData.acce
ss()->m_willChange, m_scrollPosition, b); } | |
1364 void setSubtreeWillChangeContents(bool b) { SET_VAR(rareInheritedData, m_sub
treeWillChangeContents, b); } | |
1365 | |
1366 bool requiresAcceleratedCompositingForExternalReasons(bool b) { return rareN
onInheritedData->m_requiresAcceleratedCompositingForExternalReasons; } | |
1367 void setRequiresAcceleratedCompositingForExternalReasons(bool b) { SET_VAR(r
areNonInheritedData, m_requiresAcceleratedCompositingForExternalReasons, b); } | |
1368 | |
1369 const SVGLayoutStyle& svgStyle() const { return *m_svgStyle.get(); } | |
1370 SVGLayoutStyle& accessSVGStyle() { return *m_svgStyle.access(); } | |
1371 | |
1372 const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(
); } | |
1373 Color fillPaintColor() const { return svgStyle().fillPaintColor(); } | |
1374 float fillOpacity() const { return svgStyle().fillOpacity(); } | |
1375 void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); } | |
1376 | |
1377 const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintT
ype(); } | |
1378 Color strokePaintColor() const { return svgStyle().strokePaintColor(); } | |
1379 float strokeOpacity() const { return svgStyle().strokeOpacity(); } | |
1380 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } | |
1381 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth();
} | |
1382 void setStrokeWidth(const UnzoomedLength& w) { accessSVGStyle().setStrokeWid
th(w); } | |
1383 SVGDashArray* strokeDashArray() const { return svgStyle().strokeDashArray();
} | |
1384 void setStrokeDashArray(PassRefPtr<SVGDashArray> array) { accessSVGStyle().s
etStrokeDashArray(array); } | |
1385 const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(
); } | |
1386 void setStrokeDashOffset(const Length& d) { accessSVGStyle().setStrokeDashOf
fset(d); } | |
1387 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); } | |
1388 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f);
} | |
1389 | |
1390 void setCx(const Length& cx) { accessSVGStyle().setCx(cx); } | |
1391 void setCy(const Length& cy) { accessSVGStyle().setCy(cy); } | |
1392 void setX(const Length& x) { accessSVGStyle().setX(x); } | |
1393 void setY(const Length& y) { accessSVGStyle().setY(y); } | |
1394 void setR(const Length& r) { accessSVGStyle().setR(r); } | |
1395 void setRx(const Length& rx) { accessSVGStyle().setRx(rx); } | |
1396 void setRy(const Length& ry) { accessSVGStyle().setRy(ry); } | |
1397 | |
1398 float floodOpacity() const { return svgStyle().floodOpacity(); } | |
1399 void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); } | |
1400 | |
1401 float stopOpacity() const { return svgStyle().stopOpacity(); } | |
1402 void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); } | |
1403 | |
1404 void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); } | |
1405 void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); } | |
1406 void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c)
; } | |
1407 | |
1408 const Length& baselineShiftValue() const { return svgStyle().baselineShiftVa
lue(); } | |
1409 void setBaselineShiftValue(const Length& s) { accessSVGStyle().setBaselineSh
iftValue(s); } | |
1410 | |
1411 void setShapeOutside(PassRefPtr<ShapeValue> value) | |
1412 { | |
1413 if (rareNonInheritedData->m_shapeOutside == value) | |
1414 return; | |
1415 rareNonInheritedData.access()->m_shapeOutside = value; | |
1416 } | |
1417 ShapeValue* shapeOutside() const { return rareNonInheritedData->m_shapeOutsi
de.get(); } | |
1418 | |
1419 static ShapeValue* initialShapeOutside() { return 0; } | |
1420 | |
1421 void setClipPath(PassRefPtr<ClipPathOperation> operation) | |
1422 { | |
1423 if (rareNonInheritedData->m_clipPath != operation) | |
1424 rareNonInheritedData.access()->m_clipPath = operation; | |
1425 } | |
1426 ClipPathOperation* clipPath() const { return rareNonInheritedData->m_clipPat
h.get(); } | |
1427 | |
1428 static ClipPathOperation* initialClipPath() { return 0; } | |
1429 | |
1430 const Length& shapeMargin() const { return rareNonInheritedData->m_shapeMarg
in; } | |
1431 void setShapeMargin(const Length& shapeMargin) { SET_VAR(rareNonInheritedDat
a, m_shapeMargin, shapeMargin); } | |
1432 static Length initialShapeMargin() { return Length(0, Fixed); } | |
1433 | |
1434 float shapeImageThreshold() const { return rareNonInheritedData->m_shapeImag
eThreshold; } | |
1435 void setShapeImageThreshold(float shapeImageThreshold) | |
1436 { | |
1437 float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0
, 1); | |
1438 SET_VAR(rareNonInheritedData, m_shapeImageThreshold, clampedShapeImageTh
reshold); | |
1439 } | |
1440 static float initialShapeImageThreshold() { return 0; } | |
1441 | |
1442 bool hasContent() const { return contentData(); } | |
1443 const ContentData* contentData() const { return rareNonInheritedData->m_cont
ent.get(); } | |
1444 bool contentDataEquivalent(const LayoutStyle* otherStyle) const { return con
st_cast<LayoutStyle*>(this)->rareNonInheritedData->contentDataEquivalent(*const_
cast<LayoutStyle*>(otherStyle)->rareNonInheritedData); } | |
1445 void clearContent(); | |
1446 void setContent(const String&, bool add = false); | |
1447 void setContent(PassRefPtr<StyleImage>, bool add = false); | |
1448 void setContent(PassOwnPtr<CounterContent>, bool add = false); | |
1449 void setContent(QuoteType, bool add = false); | |
1450 | |
1451 const CounterDirectiveMap* counterDirectives() const; | |
1452 CounterDirectiveMap& accessCounterDirectives(); | |
1453 const CounterDirectives getCounterDirectives(const AtomicString& identifier)
const; | |
1454 void clearIncrementDirectives(); | |
1455 void clearResetDirectives(); | |
1456 | |
1457 QuotesData* quotes() const { return rareInheritedData->quotes.get(); } | |
1458 void setQuotes(PassRefPtr<QuotesData>); | |
1459 | |
1460 const AtomicString& hyphenString() const; | |
1461 | |
1462 bool inheritedNotEqual(const LayoutStyle&) const; | |
1463 bool inheritedDataShared(const LayoutStyle&) const; | |
1464 | |
1465 bool isDisplayReplacedType() const { return isDisplayReplacedType(display())
; } | |
1466 bool isDisplayInlineType() const { return isDisplayInlineType(display()); } | |
1467 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(origin
alDisplay()); } | |
1468 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleBox(displa
y()) || isDisplayGridBox(display()); } | |
1469 bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display());
} | |
1470 | |
1471 | |
1472 bool setWritingMode(WritingMode v) | |
1473 { | |
1474 if (v == writingMode()) | |
1475 return false; | |
1476 | |
1477 inherited_flags.m_writingMode = v; | |
1478 return true; | |
1479 } | |
1480 | |
1481 // A unique style is one that has matches something that makes it impossible
to share. | |
1482 bool unique() const { return noninherited_flags.unique; } | |
1483 void setUnique() { noninherited_flags.unique = true; } | |
1484 | |
1485 bool isSharable() const; | |
1486 | |
1487 bool emptyState() const { return noninherited_flags.emptyState; } | |
1488 void setEmptyState(bool b) { setUnique(); noninherited_flags.emptyState = b;
} | |
1489 | |
1490 Color visitedDependentColor(int colorProperty) const; | |
1491 | |
1492 void setHasExplicitlyInheritedProperties() { noninherited_flags.explicitInhe
ritance = true; } | |
1493 bool hasExplicitlyInheritedProperties() const { return noninherited_flags.ex
plicitInheritance; } | |
1494 | |
1495 bool hasBoxDecorations() const { return hasBorder() || hasBorderRadius() ||
hasOutline() || hasAppearance() || boxShadow() || hasFilter() || resize() != RES
IZE_NONE; } | |
1496 | |
1497 bool borderObscuresBackground() const; | |
1498 void getBorderEdgeInfo(BorderEdge edges[], bool includeLogicalLeftEdge = tru
e, bool includeLogicalRightEdge = true) const; | |
1499 | |
1500 // Initial values for all the properties | |
1501 static EBorderCollapse initialBorderCollapse() { return BSEPARATE; } | |
1502 static EBorderStyle initialBorderStyle() { return BNONE; } | |
1503 static OutlineIsAuto initialOutlineStyleIsAuto() { return AUTO_OFF; } | |
1504 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } | |
1505 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed)
, Length(0, Fixed)); } | |
1506 static ECaptionSide initialCaptionSide() { return CAPTOP; } | |
1507 static EClear initialClear() { return CNONE; } | |
1508 static LengthBox initialClip() { return LengthBox(); } | |
1509 static TextDirection initialDirection() { return LTR; } | |
1510 static WritingMode initialWritingMode() { return TopToBottomWritingMode; } | |
1511 static TextCombine initialTextCombine() { return TextCombineNone; } | |
1512 static TextOrientation initialTextOrientation() { return TextOrientationVert
icalRight; } | |
1513 static ObjectFit initialObjectFit() { return ObjectFitFill; } | |
1514 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } | |
1515 static EDisplay initialDisplay() { return INLINE; } | |
1516 static EEmptyCell initialEmptyCells() { return SHOW; } | |
1517 static EFloat initialFloating() { return NoFloat; } | |
1518 static EListStylePosition initialListStylePosition() { return OUTSIDE; } | |
1519 static EListStyleType initialListStyleType() { return Disc; } | |
1520 static EOverflow initialOverflowX() { return OVISIBLE; } | |
1521 static EOverflow initialOverflowY() { return OVISIBLE; } | |
1522 static EPageBreak initialPageBreak() { return PBAUTO; } | |
1523 static EPosition initialPosition() { return StaticPosition; } | |
1524 static ETableLayout initialTableLayout() { return TAUTO; } | |
1525 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } | |
1526 static ETextTransform initialTextTransform() { return TTNONE; } | |
1527 static EVisibility initialVisibility() { return VISIBLE; } | |
1528 static EWhiteSpace initialWhiteSpace() { return NORMAL; } | |
1529 static short initialHorizontalBorderSpacing() { return 0; } | |
1530 static short initialVerticalBorderSpacing() { return 0; } | |
1531 static ECursor initialCursor() { return CURSOR_AUTO; } | |
1532 static Color initialColor() { return Color::black; } | |
1533 static StyleImage* initialListStyleImage() { return 0; } | |
1534 static unsigned initialBorderWidth() { return 3; } | |
1535 static unsigned short initialColumnRuleWidth() { return 3; } | |
1536 static unsigned short initialOutlineWidth() { return 3; } | |
1537 static float initialLetterWordSpacing() { return 0.0f; } | |
1538 static Length initialSize() { return Length(); } | |
1539 static Length initialMinSize() { return Length(Fixed); } | |
1540 static Length initialMaxSize() { return Length(MaxSizeNone); } | |
1541 static Length initialOffset() { return Length(); } | |
1542 static Length initialMargin() { return Length(Fixed); } | |
1543 static Length initialPadding() { return Length(Fixed); } | |
1544 static Length initialTextIndent() { return Length(Fixed); } | |
1545 static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine;
} | |
1546 static TextIndentType initialTextIndentType() { return TextIndentNormal; } | |
1547 static EVerticalAlign initialVerticalAlign() { return BASELINE; } | |
1548 static short initialWidows() { return 1; } | |
1549 static short initialOrphans() { return 2; } | |
1550 static Length initialLineHeight() { return Length(-100.0, Percent); } | |
1551 static ETextAlign initialTextAlign() { return TASTART; } | |
1552 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } | |
1553 static TextJustify initialTextJustify() { return TextJustifyAuto; } | |
1554 static TextDecoration initialTextDecoration() { return TextDecorationNone; } | |
1555 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnd
erlinePositionAuto; } | |
1556 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorat
ionStyleSolid; } | |
1557 static float initialZoom() { return 1.0f; } | |
1558 static int initialOutlineOffset() { return 0; } | |
1559 static float initialOpacity() { return 1.0f; } | |
1560 static EBoxAlignment initialBoxAlign() { return BSTRETCH; } | |
1561 static EBoxDecorationBreak initialBoxDecorationBreak() { return DSLICE; } | |
1562 static EBoxDirection initialBoxDirection() { return BNORMAL; } | |
1563 static EBoxLines initialBoxLines() { return SINGLE; } | |
1564 static EBoxOrient initialBoxOrient() { return HORIZONTAL; } | |
1565 static EBoxPack initialBoxPack() { return Start; } | |
1566 static float initialBoxFlex() { return 0.0f; } | |
1567 static unsigned initialBoxFlexGroup() { return 1; } | |
1568 static unsigned initialBoxOrdinalGroup() { return 1; } | |
1569 static EBoxSizing initialBoxSizing() { return CONTENT_BOX; } | |
1570 static StyleReflection* initialBoxReflect() { return 0; } | |
1571 static float initialFlexGrow() { return 0; } | |
1572 static float initialFlexShrink() { return 1; } | |
1573 static Length initialFlexBasis() { return Length(Auto); } | |
1574 static int initialOrder() { return 0; } | |
1575 static ContentPosition initialAlignContent() { return ContentPositionAuto; } | |
1576 static ContentDistributionType initialAlignContentDistribution() { return Co
ntentDistributionDefault; } | |
1577 static OverflowAlignment initialAlignContentOverflowAlignment() { return Ove
rflowAlignmentDefault; } | |
1578 static ItemPosition initialAlignItems() { return ItemPositionAuto; } | |
1579 static OverflowAlignment initialAlignItemsOverflowAlignment() { return Overf
lowAlignmentDefault; } | |
1580 static ItemPosition initialAlignSelf() { return ItemPositionAuto; } | |
1581 static OverflowAlignment initialAlignSelfOverflowAlignment() { return Overfl
owAlignmentDefault; } | |
1582 static EFlexDirection initialFlexDirection() { return FlowRow; } | |
1583 static EFlexWrap initialFlexWrap() { return FlexNoWrap; } | |
1584 static ContentPosition initialJustifyContent() { return ContentPositionAuto;
} | |
1585 static ContentDistributionType initialJustifyContentDistribution() { return
ContentDistributionDefault; } | |
1586 static OverflowAlignment initialJustifyContentOverflowAlignment() { return O
verflowAlignmentDefault; } | |
1587 static ItemPosition initialJustifyItems() { return ItemPositionAuto; } | |
1588 static OverflowAlignment initialJustifyItemsOverflowAlignment() { return Ove
rflowAlignmentDefault; } | |
1589 static ItemPositionType initialJustifyItemsPositionType() { return NonLegacy
Position; } | |
1590 static ItemPosition initialJustifySelf() { return ItemPositionAuto; } | |
1591 static OverflowAlignment initialJustifySelfOverflowAlignment() { return Over
flowAlignmentDefault; } | |
1592 static EUserModify initialUserModify() { return READ_ONLY; } | |
1593 static EUserDrag initialUserDrag() { return DRAG_AUTO; } | |
1594 static EUserSelect initialUserSelect() { return SELECT_TEXT; } | |
1595 static TextOverflow initialTextOverflow() { return TextOverflowClip; } | |
1596 static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; } | |
1597 static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; } | |
1598 static EWordBreak initialWordBreak() { return NormalWordBreak; } | |
1599 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; } | |
1600 static LineBreak initialLineBreak() { return LineBreakAuto; } | |
1601 static const AtomicString& initialHighlight() { return nullAtom; } | |
1602 static ESpeak initialSpeak() { return SpeakNormal; } | |
1603 static const AtomicString& initialHyphenationString() { return nullAtom; } | |
1604 static const AtomicString& initialLocale() { return nullAtom; } | |
1605 static EResize initialResize() { return RESIZE_NONE; } | |
1606 static ControlPart initialAppearance() { return NoControlPart; } | |
1607 static Order initialRTLOrdering() { return LogicalOrder; } | |
1608 static float initialTextStrokeWidth() { return 0; } | |
1609 static unsigned short initialColumnCount() { return 1; } | |
1610 static ColumnFill initialColumnFill() { return ColumnFillBalance; } | |
1611 static ColumnSpan initialColumnSpan() { return ColumnSpanNone; } | |
1612 static const TransformOperations& initialTransform() { DEFINE_STATIC_LOCAL(T
ransformOperations, ops, ()); return ops; } | |
1613 static Length initialTransformOriginX() { return Length(50.0, Percent); } | |
1614 static Length initialTransformOriginY() { return Length(50.0, Percent); } | |
1615 static float initialTransformOriginZ() { return 0; } | |
1616 static TransformOrigin initialTransformOrigin() { return TransformOrigin(Len
gth(50.0, Percent), Length(50.0, Percent), 0); } | |
1617 static EPointerEvents initialPointerEvents() { return PE_AUTO; } | |
1618 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3D
Flat; } | |
1619 static const StyleMotionPath* initialMotionPath() { return nullptr; } | |
1620 static Length initialMotionOffset() { return Length(0, Fixed); } | |
1621 static float initialMotionRotation() { return 0; } | |
1622 static MotionRotationType initialMotionRotationType() { return MotionRotatio
nAuto; } | |
1623 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisi
bilityVisible; } | |
1624 static float initialPerspective() { return 0; } | |
1625 static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } | |
1626 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } | |
1627 static LengthPoint initialPerspectiveOrigin() { return LengthPoint(Length(50
.0, Percent), Length(50.0, Percent)); } | |
1628 static Color initialBackgroundColor() { return Color::transparent; } | |
1629 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillF
illed; } | |
1630 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkN
one; } | |
1631 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom
; } | |
1632 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmpha
sisPositionOver; } | |
1633 static RubyPosition initialRubyPosition() { return RubyPositionBefore; } | |
1634 static LineBoxContain initialLineBoxContain() { return LineBoxContainBlock |
LineBoxContainInline | LineBoxContainReplaced; } | |
1635 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft
; } | |
1636 static EImageRendering initialImageRendering() { return ImageRenderingAuto;
} | |
1637 static ImageResolutionSource initialImageResolutionSource() { return ImageRe
solutionSpecified; } | |
1638 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolu
tionNoSnap; } | |
1639 static float initialImageResolution() { return 1; } | |
1640 static StyleImage* initialBorderImageSource() { return 0; } | |
1641 static StyleImage* initialMaskBoxImageSource() { return 0; } | |
1642 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustE
conomy; } | |
1643 static TouchAction initialTouchAction() { return TouchActionAuto; } | |
1644 static ShadowList* initialBoxShadow() { return 0; } | |
1645 static ShadowList* initialTextShadow() { return 0; } | |
1646 static ScrollBehavior initialScrollBehavior() { return ScrollBehaviorAuto; } | |
1647 static WebScrollBlocksOn initialScrollBlocksOn() { return WebScrollBlocksOnN
one; } | |
1648 | |
1649 // The initial value is 'none' for grid tracks. | |
1650 static Vector<GridTrackSize> initialGridTemplateColumns() { return Vector<Gr
idTrackSize>(); } | |
1651 static Vector<GridTrackSize> initialGridTemplateRows() { return Vector<GridT
rackSize>(); } | |
1652 | |
1653 static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; } | |
1654 | |
1655 static GridTrackSize initialGridAutoColumns() { return GridTrackSize(Length(
Auto)); } | |
1656 static GridTrackSize initialGridAutoRows() { return GridTrackSize(Length(Aut
o)); } | |
1657 | |
1658 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLin
esMap(); } | |
1659 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesM
ap(); } | |
1660 | |
1661 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return O
rderedNamedGridLines(); } | |
1662 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return Orde
redNamedGridLines(); } | |
1663 | |
1664 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap();
} | |
1665 static size_t initialNamedGridAreaCount() { return 0; } | |
1666 | |
1667 // 'auto' is the default. | |
1668 static GridPosition initialGridColumnStart() { return GridPosition(); } | |
1669 static GridPosition initialGridColumnEnd() { return GridPosition(); } | |
1670 static GridPosition initialGridRowStart() { return GridPosition(); } | |
1671 static GridPosition initialGridRowEnd() { return GridPosition(); } | |
1672 | |
1673 static TabSize initialTabSize() { return TabSize(8); } | |
1674 | |
1675 static WrapFlow initialWrapFlow() { return WrapFlowAuto; } | |
1676 static WrapThrough initialWrapThrough() { return WrapThroughWrap; } | |
1677 | |
1678 static QuotesData* initialQuotes() { return 0; } | |
1679 | |
1680 // Keep these at the end. | |
1681 // FIXME: Why? Seems these should all be one big sorted list. | |
1682 static LineClampValue initialLineClamp() { return LineClampValue(); } | |
1683 static ETextSecurity initialTextSecurity() { return TSNONE; } | |
1684 static Color initialTapHighlightColor(); | |
1685 #if ENABLE(OILPAN) | |
1686 static const FilterOperations& initialFilter(); | |
1687 #else | |
1688 static const FilterOperations& initialFilter() { DEFINE_STATIC_LOCAL(FilterO
perations, ops, ()); return ops; } | |
1689 #endif | |
1690 static WebBlendMode initialBlendMode() { return WebBlendModeNormal; } | |
1691 static EIsolation initialIsolation() { return IsolationAuto; } | |
1692 private: | |
1693 void setVisitedLinkColor(const Color&); | |
1694 void setVisitedLinkBackgroundColor(const StyleColor& v) { SET_VAR(rareNonInh
eritedData, m_visitedLinkBackgroundColor, v); } | |
1695 void setVisitedLinkBorderLeftColor(const StyleColor& v) { SET_VAR(rareNonInh
eritedData, m_visitedLinkBorderLeftColor, v); } | |
1696 void setVisitedLinkBorderRightColor(const StyleColor& v) { SET_VAR(rareNonIn
heritedData, m_visitedLinkBorderRightColor, v); } | |
1697 void setVisitedLinkBorderBottomColor(const StyleColor& v) { SET_VAR(rareNonI
nheritedData, m_visitedLinkBorderBottomColor, v); } | |
1698 void setVisitedLinkBorderTopColor(const StyleColor& v) { SET_VAR(rareNonInhe
ritedData, m_visitedLinkBorderTopColor, v); } | |
1699 void setVisitedLinkOutlineColor(const StyleColor& v) { SET_VAR(rareNonInheri
tedData, m_visitedLinkOutlineColor, v); } | |
1700 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_VAR(rareNonInh
eritedData.access()->m_multiCol, m_visitedLinkColumnRuleColor, v); } | |
1701 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(rareNo
nInheritedData, m_visitedLinkTextDecorationColor, v); } | |
1702 void setVisitedLinkTextEmphasisColor(const StyleColor& v) { SET_VAR_WITH_SET
TER(rareInheritedData, visitedLinkTextEmphasisColor, setVisitedLinkTextEmphasisC
olor, v); } | |
1703 void setVisitedLinkTextFillColor(const StyleColor& v) { SET_VAR_WITH_SETTER(
rareInheritedData, visitedLinkTextFillColor, setVisitedLinkTextFillColor, v); } | |
1704 void setVisitedLinkTextStrokeColor(const StyleColor& v) { SET_VAR_WITH_SETTE
R(rareInheritedData, visitedLinkTextStrokeColor, setVisitedLinkTextStrokeColor,
v); } | |
1705 | |
1706 void inheritUnicodeBidiFrom(const LayoutStyle& parent) { noninherited_flags.
unicodeBidi = parent.noninherited_flags.unicodeBidi; } | |
1707 | |
1708 bool isDisplayFlexibleBox(EDisplay display) const | |
1709 { | |
1710 return display == FLEX || display == INLINE_FLEX; | |
1711 } | |
1712 | |
1713 bool isDisplayGridBox(EDisplay display) const | |
1714 { | |
1715 return display == GRID || display == INLINE_GRID; | |
1716 } | |
1717 | |
1718 bool isDisplayReplacedType(EDisplay display) const | |
1719 { | |
1720 return display == INLINE_BLOCK || display == INLINE_BOX || display == IN
LINE_FLEX | |
1721 || display == INLINE_TABLE || display == INLINE_GRID; | |
1722 } | |
1723 | |
1724 bool isDisplayInlineType(EDisplay display) const | |
1725 { | |
1726 return display == INLINE || isDisplayReplacedType(display); | |
1727 } | |
1728 | |
1729 // Color accessors are all private to make sure callers use visitedDependent
Color instead to access them. | |
1730 StyleColor borderLeftColor() const { return surround->border.left().color();
} | |
1731 StyleColor borderRightColor() const { return surround->border.right().color(
); } | |
1732 StyleColor borderTopColor() const { return surround->border.top().color(); } | |
1733 StyleColor borderBottomColor() const { return surround->border.bottom().colo
r(); } | |
1734 StyleColor backgroundColor() const { return m_background->color(); } | |
1735 Color color() const; | |
1736 StyleColor columnRuleColor() const { return rareNonInheritedData->m_multiCol
->m_rule.color(); } | |
1737 StyleColor outlineColor() const { return m_background->outline().color(); } | |
1738 StyleColor textEmphasisColor() const { return rareInheritedData->textEmphasi
sColor(); } | |
1739 StyleColor textFillColor() const { return rareInheritedData->textFillColor()
; } | |
1740 StyleColor textStrokeColor() const { return rareInheritedData->textStrokeCol
or(); } | |
1741 Color visitedLinkColor() const; | |
1742 StyleColor visitedLinkBackgroundColor() const { return rareNonInheritedData-
>m_visitedLinkBackgroundColor; } | |
1743 StyleColor visitedLinkBorderLeftColor() const { return rareNonInheritedData-
>m_visitedLinkBorderLeftColor; } | |
1744 StyleColor visitedLinkBorderRightColor() const { return rareNonInheritedData
->m_visitedLinkBorderRightColor; } | |
1745 StyleColor visitedLinkBorderBottomColor() const { return rareNonInheritedDat
a->m_visitedLinkBorderBottomColor; } | |
1746 StyleColor visitedLinkBorderTopColor() const { return rareNonInheritedData->
m_visitedLinkBorderTopColor; } | |
1747 StyleColor visitedLinkOutlineColor() const { return rareNonInheritedData->m_
visitedLinkOutlineColor; } | |
1748 StyleColor visitedLinkColumnRuleColor() const { return rareNonInheritedData-
>m_multiCol->m_visitedLinkColumnRuleColor; } | |
1749 StyleColor textDecorationColor() const { return rareNonInheritedData->m_text
DecorationColor; } | |
1750 StyleColor visitedLinkTextDecorationColor() const { return rareNonInheritedD
ata->m_visitedLinkTextDecorationColor; } | |
1751 StyleColor visitedLinkTextEmphasisColor() const { return rareInheritedData->
visitedLinkTextEmphasisColor(); } | |
1752 StyleColor visitedLinkTextFillColor() const { return rareInheritedData->visi
tedLinkTextFillColor(); } | |
1753 StyleColor visitedLinkTextStrokeColor() const { return rareInheritedData->vi
sitedLinkTextStrokeColor(); } | |
1754 | |
1755 StyleColor decorationColorIncludingFallback(bool visitedLink) const; | |
1756 Color colorIncludingFallback(int colorProperty, bool visitedLink) const; | |
1757 | |
1758 Color stopColor() const { return svgStyle().stopColor(); } | |
1759 Color floodColor() const { return svgStyle().floodColor(); } | |
1760 Color lightingColor() const { return svgStyle().lightingColor(); } | |
1761 | |
1762 void appendContent(PassOwnPtr<ContentData>); | |
1763 void addAppliedTextDecoration(const AppliedTextDecoration&); | |
1764 bool hasTransformOperations() const { return !rareNonInheritedData->m_transf
orm->m_operations.operations().isEmpty(); } | |
1765 void applyMotionPathTransform(TransformationMatrix&) const; | |
1766 | |
1767 bool diffNeedsFullLayoutAndPaintInvalidation(const LayoutStyle& other) const
; | |
1768 bool diffNeedsFullLayout(const LayoutStyle& other) const; | |
1769 bool diffNeedsPaintInvalidationLayer(const LayoutStyle& other) const; | |
1770 bool diffNeedsPaintInvalidationObject(const LayoutStyle& other) const; | |
1771 void updatePropertySpecificDifferences(const LayoutStyle& other, StyleDiffer
ence&) const; | |
1772 }; | |
1773 | |
1774 // FIXME: Reduce/remove the dependency on zoom adjusted int values. | |
1775 // The float or LayoutUnit versions of layout values should be used. | |
1776 inline int adjustForAbsoluteZoom(int value, float zoomFactor) | |
1777 { | |
1778 if (zoomFactor == 1) | |
1779 return value; | |
1780 // Needed because computeLengthInt truncates (rather than rounds) when scali
ng up. | |
1781 float fvalue = value; | |
1782 if (zoomFactor > 1) { | |
1783 if (value < 0) | |
1784 fvalue -= 0.5f; | |
1785 else | |
1786 fvalue += 0.5f; | |
1787 } | |
1788 | |
1789 return roundForImpreciseConversion<int>(fvalue / zoomFactor); | |
1790 } | |
1791 | |
1792 inline int adjustForAbsoluteZoom(int value, const LayoutStyle* style) | |
1793 { | |
1794 return adjustForAbsoluteZoom(value, style->effectiveZoom()); | |
1795 } | |
1796 | |
1797 inline float adjustFloatForAbsoluteZoom(float value, const LayoutStyle& style) | |
1798 { | |
1799 return value / style.effectiveZoom(); | |
1800 } | |
1801 | |
1802 inline double adjustDoubleForAbsoluteZoom(double value, const LayoutStyle& style
) | |
1803 { | |
1804 return value / style.effectiveZoom(); | |
1805 } | |
1806 | |
1807 inline LayoutUnit adjustLayoutUnitForAbsoluteZoom(LayoutUnit value, const Layout
Style& style) | |
1808 { | |
1809 return value / style.effectiveZoom(); | |
1810 } | |
1811 | |
1812 inline double adjustScrollForAbsoluteZoom(double scrollOffset, float zoomFactor) | |
1813 { | |
1814 return scrollOffset / zoomFactor; | |
1815 } | |
1816 | |
1817 inline double adjustScrollForAbsoluteZoom(double scrollOffset, const LayoutStyle
& style) | |
1818 { | |
1819 return adjustScrollForAbsoluteZoom(scrollOffset, style.effectiveZoom()); | |
1820 } | |
1821 | |
1822 inline bool LayoutStyle::setZoom(float f) | |
1823 { | |
1824 if (compareEqual(visual->m_zoom, f)) | |
1825 return false; | |
1826 visual.access()->m_zoom = f; | |
1827 setEffectiveZoom(effectiveZoom() * zoom()); | |
1828 return true; | |
1829 } | |
1830 | |
1831 inline bool LayoutStyle::setEffectiveZoom(float f) | |
1832 { | |
1833 if (compareEqual(rareInheritedData->m_effectiveZoom, f)) | |
1834 return false; | |
1835 rareInheritedData.access()->m_effectiveZoom = f; | |
1836 return true; | |
1837 } | |
1838 | |
1839 inline bool LayoutStyle::isSharable() const | |
1840 { | |
1841 if (unique()) | |
1842 return false; | |
1843 if (hasUniquePseudoStyle()) | |
1844 return false; | |
1845 return true; | |
1846 } | |
1847 | |
1848 inline bool LayoutStyle::setTextOrientation(TextOrientation textOrientation) | |
1849 { | |
1850 if (compareEqual(rareInheritedData->m_textOrientation, textOrientation)) | |
1851 return false; | |
1852 | |
1853 rareInheritedData.access()->m_textOrientation = textOrientation; | |
1854 return true; | |
1855 } | |
1856 | |
1857 inline bool LayoutStyle::hasAnyPublicPseudoStyles() const | |
1858 { | |
1859 return PUBLIC_PSEUDOID_MASK & noninherited_flags.pseudoBits; | |
1860 } | |
1861 | |
1862 inline bool LayoutStyle::hasPseudoStyle(PseudoId pseudo) const | |
1863 { | |
1864 ASSERT(pseudo > NOPSEUDO); | |
1865 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID); | |
1866 return (1 << (pseudo - 1)) & noninherited_flags.pseudoBits; | |
1867 } | |
1868 | |
1869 inline void LayoutStyle::setHasPseudoStyle(PseudoId pseudo) | |
1870 { | |
1871 ASSERT(pseudo > NOPSEUDO); | |
1872 ASSERT(pseudo < FIRST_INTERNAL_PSEUDOID); | |
1873 noninherited_flags.pseudoBits |= 1 << (pseudo - 1); | |
1874 } | |
1875 | |
1876 inline bool LayoutStyle::hasPseudoElementStyle() const | |
1877 { | |
1878 return noninherited_flags.pseudoBits & PSEUDO_ELEMENT_MASK; | |
1879 } | |
1880 | |
1881 } // namespace blink | |
1882 | |
1883 #endif // LayoutStyle_h | |
OLD | NEW |