OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@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. | 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) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 285 |
286 unsigned m_isLink : 1; | 286 unsigned m_isLink : 1; |
287 | 287 |
288 mutable unsigned m_hasRemUnits : 1; | 288 mutable unsigned m_hasRemUnits : 1; |
289 // If you add more style bits here, you will also need to update Compute
dStyle::copyNonInheritedFromCached() | 289 // If you add more style bits here, you will also need to update Compute
dStyle::copyNonInheritedFromCached() |
290 // 66 bits | 290 // 66 bits |
291 } m_nonInheritedData; | 291 } m_nonInheritedData; |
292 | 292 |
293 // !END SYNC! | 293 // !END SYNC! |
294 | 294 |
295 protected: | |
296 void setBitDefaults() | 295 void setBitDefaults() |
297 { | 296 { |
298 m_inheritedData.m_emptyCells = initialEmptyCells(); | 297 m_inheritedData.m_emptyCells = initialEmptyCells(); |
299 m_inheritedData.m_captionSide = initialCaptionSide(); | 298 m_inheritedData.m_captionSide = initialCaptionSide(); |
300 m_inheritedData.m_listStyleType = initialListStyleType(); | 299 m_inheritedData.m_listStyleType = initialListStyleType(); |
301 m_inheritedData.m_listStylePosition = initialListStylePosition(); | 300 m_inheritedData.m_listStylePosition = initialListStylePosition(); |
302 m_inheritedData.m_visibility = initialVisibility(); | 301 m_inheritedData.m_visibility = initialVisibility(); |
303 m_inheritedData.m_textAlign = initialTextAlign(); | 302 m_inheritedData.m_textAlign = initialTextAlign(); |
304 m_inheritedData.m_textTransform = initialTextTransform(); | 303 m_inheritedData.m_textTransform = initialTextTransform(); |
305 m_inheritedData.m_textUnderline = false; | 304 m_inheritedData.m_textUnderline = false; |
(...skipping 30 matching lines...) Expand all Loading... |
336 m_nonInheritedData.m_hasViewportUnits = false; | 335 m_nonInheritedData.m_hasViewportUnits = false; |
337 m_nonInheritedData.m_affectedByFocus = false; | 336 m_nonInheritedData.m_affectedByFocus = false; |
338 m_nonInheritedData.m_affectedByHover = false; | 337 m_nonInheritedData.m_affectedByHover = false; |
339 m_nonInheritedData.m_affectedByActive = false; | 338 m_nonInheritedData.m_affectedByActive = false; |
340 m_nonInheritedData.m_affectedByDrag = false; | 339 m_nonInheritedData.m_affectedByDrag = false; |
341 m_nonInheritedData.m_isLink = false; | 340 m_nonInheritedData.m_isLink = false; |
342 m_nonInheritedData.m_hasRemUnits = false; | 341 m_nonInheritedData.m_hasRemUnits = false; |
343 } | 342 } |
344 | 343 |
345 private: | 344 private: |
| 345 // TODO(sashab): Move these to the bottom of ComputedStyle. |
346 ALWAYS_INLINE ComputedStyle(); | 346 ALWAYS_INLINE ComputedStyle(); |
347 | 347 |
348 enum InitialStyleTag { | 348 enum InitialStyleTag { |
349 InitialStyle | 349 InitialStyle |
350 }; | 350 }; |
351 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); | 351 ALWAYS_INLINE explicit ComputedStyle(InitialStyleTag); |
352 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); | 352 ALWAYS_INLINE ComputedStyle(const ComputedStyle&); |
353 | 353 |
354 static PassRefPtr<ComputedStyle> createInitialStyle(); | 354 static PassRefPtr<ComputedStyle> createInitialStyle(); |
355 static inline ComputedStyle& mutableInitialStyle() | 355 static inline ComputedStyle& mutableInitialStyle() |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 PseudoId styleType() const { return static_cast<PseudoId>(m_nonInheritedData
.m_styleType); } | 390 PseudoId styleType() const { return static_cast<PseudoId>(m_nonInheritedData
.m_styleType); } |
391 void setStyleType(PseudoId styleType) { m_nonInheritedData.m_styleType = sty
leType; } | 391 void setStyleType(PseudoId styleType) { m_nonInheritedData.m_styleType = sty
leType; } |
392 | 392 |
393 ComputedStyle* getCachedPseudoStyle(PseudoId) const; | 393 ComputedStyle* getCachedPseudoStyle(PseudoId) const; |
394 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>); | 394 ComputedStyle* addCachedPseudoStyle(PassRefPtr<ComputedStyle>); |
395 void removeCachedPseudoStyle(PseudoId); | 395 void removeCachedPseudoStyle(PseudoId); |
396 | 396 |
397 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt
yles.get(); } | 397 const PseudoStyleCache* cachedPseudoStyles() const { return m_cachedPseudoSt
yles.get(); } |
398 | 398 |
399 void setHasViewportUnits(bool hasViewportUnits = true) const { m_nonInherite
dData.m_hasViewportUnits = hasViewportUnits; } | 399 /** |
400 bool hasViewportUnits() const { return m_nonInheritedData.m_hasViewportUnits
; } | 400 * ComputedStyle properties |
401 | 401 * |
402 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; } | 402 * Each property stored in ComputedStyle is made up of fields. Fields have |
403 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; } | 403 * initial value functions, getters and setters. A field is preferably a |
404 | 404 * basic data type or enum, but can be any type. A set of fields should be |
405 bool affectedByFocus() const { return m_nonInheritedData.m_affectedByFocus;
} | 405 * preceded by the property the field is stored for. |
406 bool affectedByHover() const { return m_nonInheritedData.m_affectedByHover;
} | 406 * |
407 bool affectedByActive() const { return m_nonInheritedData.m_affectedByActive
; } | 407 * Field method naming should be done like so: |
408 bool affectedByDrag() const { return m_nonInheritedData.m_affectedByDrag; } | 408 * // name-of-property |
409 | 409 * static int initialNameOfProperty(); |
410 void setAffectedByFocus() { m_nonInheritedData.m_affectedByFocus = true; } | 410 * int nameOfProperty() const; |
411 void setAffectedByHover() { m_nonInheritedData.m_affectedByHover = true; } | 411 * void setNameOfProperty(int); |
412 void setAffectedByActive() { m_nonInheritedData.m_affectedByActive = true; } | 412 * If the property has multiple fields, add the field name to the end of the |
413 void setAffectedByDrag() { m_nonInheritedData.m_affectedByDrag = true; } | 413 * method name. |
414 | 414 * |
415 bool operator==(const ComputedStyle& other) const; | 415 * Avoid nested types by splitting up fields where possible, e.g.: |
416 bool operator!=(const ComputedStyle& other) const { return !(*this == other)
; } | 416 * int getBorderTopWidth(); |
417 bool isFloating() const { return m_nonInheritedData.m_floating != NoFloat; } | 417 * int getBorderBottomWidth(); |
418 bool hasMargin() const { return m_surround->margin.nonZero(); } | 418 * int getBorderLeftWidth(); |
419 bool hasBorderFill() const { return m_surround->border.hasBorderFill(); } | 419 * int getBorderRightWidth(); |
420 bool hasBorder() const { return m_surround->border.hasBorder(); } | 420 * is preferable to: |
421 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } | 421 * BorderWidths getBorderWidths(); |
422 bool hasPadding() const { return m_surround->padding.nonZero(); } | 422 * |
423 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } | 423 * Utility functions should go in a separate section at the end of the |
424 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } | 424 * class, and be kept to a minimum. |
425 | 425 */ |
| 426 |
| 427 // Non-Inherited properties. |
| 428 |
| 429 // Content alignment properties. |
| 430 static StyleContentAlignmentData initialContentAlignment() { return StyleCon
tentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAli
gnmentDefault); } |
| 431 |
| 432 // align-content (aka -webkit-align-content) |
| 433 const StyleContentAlignmentData& alignContent() const { return m_rareNonInhe
ritedData->m_alignContent; } |
| 434 ContentPosition alignContentPosition() const { return m_rareNonInheritedData
->m_alignContent.position(); } |
| 435 ContentDistributionType alignContentDistribution() const { return m_rareNonI
nheritedData->m_alignContent.distribution(); } |
| 436 OverflowAlignment alignContentOverflowAlignment() const { return m_rareNonIn
heritedData->m_alignContent.overflow(); } |
| 437 void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(m_rare
NonInheritedData, m_alignContent, data); } |
| 438 void setAlignContentPosition(ContentPosition position) { m_rareNonInheritedD
ata.access()->m_alignContent.setPosition(position); } |
| 439 void setAlignContentDistribution(ContentDistributionType distribution) { m_r
areNonInheritedData.access()->m_alignContent.setDistribution(distribution); } |
| 440 void setAlignContentOverflow(OverflowAlignment overflow) { m_rareNonInherite
dData.access()->m_alignContent.setOverflow(overflow); } |
| 441 |
| 442 // justify-content (aka -webkit-justify-content) |
| 443 const StyleContentAlignmentData& justifyContent() const { return m_rareNonIn
heritedData->m_justifyContent; } |
| 444 ContentPosition justifyContentPosition() const { return m_rareNonInheritedDa
ta->m_justifyContent.position(); } |
| 445 ContentDistributionType justifyContentDistribution() const { return m_rareNo
nInheritedData->m_justifyContent.distribution(); } |
| 446 OverflowAlignment justifyContentOverflowAlignment() const { return m_rareNon
InheritedData->m_justifyContent.overflow(); } |
| 447 void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(m_ra
reNonInheritedData, m_justifyContent, data); } |
| 448 void setJustifyContentPosition(ContentPosition position) { m_rareNonInherite
dData.access()->m_justifyContent.setPosition(position); } |
| 449 void setJustifyContentDistribution(ContentDistributionType distribution) { m
_rareNonInheritedData.access()->m_justifyContent.setDistribution(distribution);
} |
| 450 void setJustifyContentOverflow(OverflowAlignment overflow) { m_rareNonInheri
tedData.access()->m_justifyContent.setOverflow(overflow); } |
| 451 |
| 452 // Alignment properties. |
| 453 static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlign
mentData(ItemPositionAuto, OverflowAlignmentDefault); } |
| 454 // align-items (aka -webkit-align-items) |
| 455 const StyleSelfAlignmentData& alignItems() const { return m_rareNonInherited
Data->m_alignItems; } |
| 456 ItemPosition alignItemsPosition() const { return m_rareNonInheritedData->m_a
lignItems.position(); } |
| 457 OverflowAlignment alignItemsOverflowAlignment() const { return m_rareNonInhe
ritedData->m_alignItems.overflow(); } |
| 458 void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonIn
heritedData, m_alignItems, data); } |
| 459 void setAlignItemsPosition(ItemPosition position) { m_rareNonInheritedData.a
ccess()->m_alignItems.setPosition(position); } |
| 460 void setAlignItemsOverflow(OverflowAlignment overflow) { m_rareNonInheritedD
ata.access()->m_alignItems.setOverflow(overflow); } |
| 461 |
| 462 // align-self (aka -webkit-align-self) |
| 463 const StyleSelfAlignmentData& alignSelf() const { return m_rareNonInheritedD
ata->m_alignSelf; } |
| 464 ItemPosition alignSelfPosition() const { return m_rareNonInheritedData->m_al
ignSelf.position(); } |
| 465 OverflowAlignment alignSelfOverflowAlignment() const { return m_rareNonInher
itedData->m_alignSelf.overflow(); } |
| 466 void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInh
eritedData, m_alignSelf, data); } |
| 467 void setAlignSelfPosition(ItemPosition position) { m_rareNonInheritedData.ac
cess()->m_alignSelf.setPosition(position); } |
| 468 void setAlignSelfOverflow(OverflowAlignment overflow) { m_rareNonInheritedDa
ta.access()->m_alignSelf.setOverflow(overflow); } |
| 469 |
| 470 // Filter properties. |
| 471 |
| 472 // backdrop-filter |
| 473 static const FilterOperations& initialBackdropFilter(); |
| 474 const FilterOperations& backdropFilter() const { return m_rareNonInheritedDa
ta->m_backdropFilter->m_operations; } |
| 475 FilterOperations& mutableBackdropFilter() { return m_rareNonInheritedData.ac
cess()->m_backdropFilter.access()->m_operations; } |
| 476 bool hasBackdropFilter() const { return !m_rareNonInheritedData->m_backdropF
ilter->m_operations.operations().isEmpty(); } |
| 477 void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareN
onInheritedData, m_backdropFilter, m_operations, ops); } |
| 478 |
| 479 // filter (aka -webkit-filter) |
| 480 static const FilterOperations& initialFilter(); |
| 481 FilterOperations& mutableFilter() { return m_rareNonInheritedData.access()->
m_filter.access()->m_operations; } |
| 482 const FilterOperations& filter() const { return m_rareNonInheritedData->m_fi
lter->m_operations; } |
| 483 bool hasFilter() const { return !m_rareNonInheritedData->m_filter->m_operati
ons.operations().isEmpty(); } |
| 484 void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheri
tedData, m_filter, m_operations, ops); } |
| 485 |
| 486 // backface-visibility (aka -webkit-backface-visibility) |
| 487 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisi
bilityVisible; } |
| 488 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfac
eVisibility>(m_rareNonInheritedData->m_backfaceVisibility); } |
| 489 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(m_rareNonInherit
edData, m_backfaceVisibility, b); } |
| 490 |
| 491 // Background properties. |
| 492 // background-color |
| 493 static Color initialBackgroundColor() { return Color::transparent; } |
| 494 void setBackgroundColor(const StyleColor& v) { SET_VAR(m_background, m_color
, v); } |
| 495 |
| 496 // background-image |
426 bool hasBackgroundImage() const { return m_background->background().hasImage
(); } | 497 bool hasBackgroundImage() const { return m_background->background().hasImage
(); } |
427 bool hasFixedBackgroundImage() const { return m_background->background().has
FixedImage(); } | 498 bool hasFixedBackgroundImage() const { return m_background->background().has
FixedImage(); } |
428 | |
429 bool hasEntirelyFixedBackground() const; | 499 bool hasEntirelyFixedBackground() const; |
430 | 500 |
431 bool hasAppearance() const { return appearance() != NoControlPart; } | 501 // background-clip |
432 | 502 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background-
>background().clip()); } |
433 bool hasBackgroundRelatedColorReferencingCurrentColor() const | 503 |
434 { | 504 // Border properties. |
435 if (backgroundColor().isCurrentColor() || visitedLinkBackgroundColor().i
sCurrentColor()) | 505 // -webkit-border-image |
436 return true; | 506 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } |
437 if (!boxShadow()) | 507 const NinePieceImage& borderImage() const { return m_surround->border.image(
); } |
438 return false; | 508 void setBorderImage(const NinePieceImage& b) { SET_VAR(m_surround, border.m_
image, b); } |
439 return shadowListHasCurrentColor(boxShadow()); | 509 |
440 } | 510 // border-image-slice |
441 | 511 const LengthBox& borderImageSlices() const { return m_surround->border.image
().imageSlices(); } |
442 bool hasBackground() const | 512 void setBorderImageSlices(const LengthBox&); |
443 { | 513 |
444 Color color = visitedDependentColor(CSSPropertyBackgroundColor); | 514 // border-image-source |
445 if (color.alpha()) | 515 static StyleImage* initialBorderImageSource() { return 0; } |
446 return true; | 516 StyleImage* borderImageSource() const { return m_surround->border.image().im
age(); } |
447 return hasBackgroundImage(); | 517 void setBorderImageSource(StyleImage*); |
448 } | 518 |
449 | 519 // border-image-width |
450 LayoutRectOutsets imageOutsets(const NinePieceImage&) const; | 520 const BorderImageLengthBox& borderImageWidth() const { return m_surround->bo
rder.image().borderSlices(); } |
451 bool hasBorderImageOutsets() const | 521 void setBorderImageWidth(const BorderImageLengthBox&); |
452 { | 522 |
453 return borderImage().hasImage() && borderImage().outset().nonZero(); | 523 // border-image-outset |
454 } | 524 const BorderImageLengthBox& borderImageOutset() const { return m_surround->b
order.image().outset(); } |
455 LayoutRectOutsets borderImageOutsets() const | 525 void setBorderImageOutset(const BorderImageLengthBox&); |
456 { | 526 |
457 return imageOutsets(borderImage()); | 527 // Border width properties. |
458 } | 528 static unsigned initialBorderWidth() { return 3; } |
459 | 529 |
460 // Returns |true| if any property that renders using filter operations is | 530 // border-top-width |
461 // used (including, but not limited to, 'filter'). | 531 int borderTopWidth() const { return m_surround->border.borderTopWidth(); } |
462 bool hasFilterInducingProperty() const { return hasFilter() || (RuntimeEnabl
edFeatures::cssBoxReflectFilterEnabled() && hasBoxReflect()); } | 532 void setBorderTopWidth(unsigned v) { SET_VAR(m_surround, border.m_top.m_widt
h, v); } |
463 | 533 |
464 // Returns |true| if opacity should be considered to have non-initial value
for the purpose | 534 // border-bottom-width |
465 // of creating stacking contexts. | 535 int borderBottomWidth() const { return m_surround->border.borderBottomWidth(
); } |
466 bool hasNonInitialOpacity() const { return hasOpacity() || hasWillChangeOpac
ityHint() || hasCurrentOpacityAnimation(); } | 536 void setBorderBottomWidth(unsigned v) { SET_VAR(m_surround, border.m_bottom.
m_width, v); } |
467 | 537 |
468 // Returns whether this style contains any grouping property as defined by [
css-transforms]. | 538 // border-left-width |
469 // The main purpose of this is to adjust the used value of transform-style p
roperty. | 539 int borderLeftWidth() const { return m_surround->border.borderLeftWidth(); } |
470 // Note: We currently don't include every grouping property on the spec to m
aintain | 540 void setBorderLeftWidth(unsigned v) { SET_VAR(m_surround, border.m_left.m_wi
dth, v); } |
471 // backward compatibility. | 541 |
472 // [css-transforms] https://drafts.csswg.org/css-transforms/#grouping-proper
ty-values | 542 // border-right-width |
473 bool hasGroupingProperty() const { return !isOverflowVisible() || hasFilterI
nducingProperty() || hasNonInitialOpacity(); } | 543 int borderRightWidth() const { return m_surround->border.borderRightWidth();
} |
474 | 544 void setBorderRightWidth(unsigned v) { SET_VAR(m_surround, border.m_right.m_
width, v); } |
475 Order rtlOrdering() const { return static_cast<Order>(m_inheritedData.m_rtlO
rdering); } | 545 |
476 void setRTLOrdering(Order o) { m_inheritedData.m_rtlOrdering = o; } | 546 // Border style properties. |
477 | 547 static EBorderStyle initialBorderStyle() { return BorderStyleNone; } |
478 bool isStyleAvailable() const; | 548 |
479 | 549 // border-top-style |
480 bool hasAnyPublicPseudoStyles() const; | 550 EBorderStyle borderTopStyle() const { return m_surround->border.top().style(
); } |
481 bool hasPseudoStyle(PseudoId) const; | 551 void setBorderTopStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_top.m_
style, v); } |
482 void setHasPseudoStyle(PseudoId); | 552 |
483 bool hasUniquePseudoStyle() const; | 553 // border-right-style |
484 bool hasPseudoElementStyle() const; | 554 EBorderStyle borderRightStyle() const { return m_surround->border.right().st
yle(); } |
485 | 555 void setBorderRightStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_righ
t.m_style, v); } |
486 // Note: canContainAbsolutePositionObjects should return true if canContainF
ixedPositionObjects. | 556 |
487 // We currently never use this value directly, always OR'ing it with canCont
ainFixedPositionObjects. | 557 // border-left-style |
488 bool canContainAbsolutePositionObjects() const { return position() != Static
Position; } | 558 EBorderStyle borderLeftStyle() const { return m_surround->border.left().styl
e(); } |
489 bool canContainFixedPositionObjects() const { return hasTransformRelatedProp
erty() || containsPaint();} | 559 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_left.
m_style, v); } |
490 | 560 |
491 // attribute getter methods | 561 // border-bottom-style |
492 | 562 EBorderStyle borderBottomStyle() const { return m_surround->border.bottom().
style(); } |
| 563 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_bot
tom.m_style, v); } |
| 564 |
| 565 // Border color properties. |
| 566 // border-left-color |
| 567 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surro
und, border.m_left, v); } |
| 568 |
| 569 // border-right-color |
| 570 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surr
ound, border.m_right, v); } |
| 571 |
| 572 // border-top-color |
| 573 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surrou
nd, border.m_top, v); } |
| 574 |
| 575 // border-bottom-color |
| 576 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_sur
round, border.m_bottom, v); } |
| 577 |
| 578 // Border radius properties. |
| 579 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed)
, Length(0, Fixed)); } |
| 580 |
| 581 // border-top-left-radius (aka -webkit-border-top-left-radius) |
| 582 const LengthSize& borderTopLeftRadius() const { return m_surround->border.to
pLeft(); } |
| 583 void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(m_surround, borde
r.m_topLeft, s); } |
| 584 |
| 585 // border-top-right-radius (aka -webkit-border-top-right-radius) |
| 586 const LengthSize& borderTopRightRadius() const { return m_surround->border.t
opRight(); } |
| 587 void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(m_surround, bord
er.m_topRight, s); } |
| 588 |
| 589 // border-bottom-left-radius (aka -webkit-border-bottom-left-radius) |
| 590 const LengthSize& borderBottomLeftRadius() const { return m_surround->border
.bottomLeft(); } |
| 591 void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(m_surround, bo
rder.m_bottomLeft, s); } |
| 592 |
| 593 // border-bottom-right-radius (aka -webkit-border-bottom-right-radius) |
| 594 const LengthSize& borderBottomRightRadius() const { return m_surround->borde
r.bottomRight(); } |
| 595 void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(m_surround, b
order.m_bottomRight, s); } |
| 596 |
| 597 // Offset properties. |
| 598 static Length initialOffset() { return Length(); } |
| 599 |
| 600 // left |
| 601 const Length& left() const { return m_surround->offset.left(); } |
| 602 void setLeft(const Length& v) { SET_VAR(m_surround, offset.m_left, v); } |
| 603 |
| 604 // right |
| 605 const Length& right() const { return m_surround->offset.right(); } |
| 606 void setRight(const Length& v) { SET_VAR(m_surround, offset.m_right, v); } |
| 607 |
| 608 // top |
| 609 const Length& top() const { return m_surround->offset.top(); } |
| 610 void setTop(const Length& v) { SET_VAR(m_surround, offset.m_top, v); } |
| 611 |
| 612 // bottom |
| 613 const Length& bottom() const { return m_surround->offset.bottom(); } |
| 614 void setBottom(const Length& v) { SET_VAR(m_surround, offset.m_bottom, v); } |
| 615 |
| 616 // box-shadow (aka -webkit-box-shadow) |
| 617 static ShadowList* initialBoxShadow() { return 0; } |
| 618 ShadowList* boxShadow() const { return m_rareNonInheritedData->m_boxShadow.g
et(); } |
| 619 void setBoxShadow(PassRefPtr<ShadowList>); |
| 620 |
| 621 // box-sizing (aka -webkit-box-sizing) |
| 622 static EBoxSizing initialBoxSizing() { return BoxSizingContentBox; } |
| 623 EBoxSizing boxSizing() const { return m_box->boxSizing(); } |
| 624 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); } |
| 625 |
| 626 // clear |
| 627 static EClear initialClear() { return ClearNone; } |
| 628 EClear clear() const { return static_cast<EClear>(m_nonInheritedData.m_clear
); } |
| 629 void setClear(EClear v) { m_nonInheritedData.m_clear = v; } |
| 630 |
| 631 // Page break properties. |
| 632 // break-after (shorthand for page-break-after and -webkit-column-break-afte
r) |
| 633 static EBreak initialBreakAfter() { return BreakAuto; } |
| 634 EBreak breakAfter() const { return static_cast<EBreak>(m_nonInheritedData.m_
breakAfter); } |
| 635 void setBreakAfter(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakAft
erAndBefore); m_nonInheritedData.m_breakAfter = b; } |
| 636 |
| 637 // break-before (shorthand for page-break-before and -webkit-column-break-be
fore) |
| 638 static EBreak initialBreakBefore() { return BreakAuto; } |
| 639 EBreak breakBefore() const { return static_cast<EBreak>(m_nonInheritedData.m
_breakBefore); } |
| 640 void setBreakBefore(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakAf
terAndBefore); m_nonInheritedData.m_breakBefore = b; } |
| 641 |
| 642 // break-inside (shorthand for page-break-inside and -webkit-column-break-in
side) |
| 643 static EBreak initialBreakInside() { return BreakAuto; } |
| 644 EBreak breakInside() const { return static_cast<EBreak>(m_nonInheritedData.m
_breakInside); } |
| 645 void setBreakInside(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakIn
side); m_nonInheritedData.m_breakInside = b; } |
| 646 |
| 647 // clip |
| 648 static LengthBox initialClip() { return LengthBox(); } |
| 649 const LengthBox& clip() const { return m_visual->clip; } |
| 650 void setClip(const LengthBox& box) { SET_VAR(m_visual, hasAutoClip, false);
SET_VAR(m_visual, clip, box); } |
| 651 bool hasAutoClip() const { return m_visual->hasAutoClip; } |
| 652 void setHasAutoClip() { SET_VAR(m_visual, hasAutoClip, true); SET_VAR(m_visu
al, clip, ComputedStyle::initialClip()); } |
| 653 |
| 654 // Column properties. |
| 655 // column-count (aka -webkit-column-count) |
| 656 static unsigned short initialColumnCount() { return 1; } |
| 657 unsigned short columnCount() const { return m_rareNonInheritedData->m_multiC
ol->m_count; } |
| 658 void setColumnCount(unsigned short c) { SET_NESTED_VAR(m_rareNonInheritedDat
a, m_multiCol, m_autoCount, false); SET_NESTED_VAR(m_rareNonInheritedData, m_mul
tiCol, m_count, c); } |
| 659 bool hasAutoColumnCount() const { return m_rareNonInheritedData->m_multiCol-
>m_autoCount; } |
| 660 void setHasAutoColumnCount() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoCount, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_c
ount, initialColumnCount()); } |
| 661 |
| 662 // column-fill |
| 663 static ColumnFill initialColumnFill() { return ColumnFillBalance; } |
| 664 ColumnFill getColumnFill() const { return static_cast<ColumnFill>(m_rareNonI
nheritedData->m_multiCol->m_fill); } |
| 665 void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_fill, columnFill); } |
| 666 |
| 667 // column-gap (aka -webkit-column-gap) |
| 668 float columnGap() const { return m_rareNonInheritedData->m_multiCol->m_gap;
} |
| 669 void setColumnGap(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_multiC
ol, m_normalGap, false); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_ga
p, f); } |
| 670 bool hasNormalColumnGap() const { return m_rareNonInheritedData->m_multiCol-
>m_normalGap; } |
| 671 void setHasNormalColumnGap() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_normalGap, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_g
ap, 0); } |
| 672 |
| 673 // column-rule-color (aka -webkit-column-rule-color) |
| 674 void setColumnRuleColor(const StyleColor& c) { SET_BORDERVALUE_COLOR(m_rareN
onInheritedData.access()->m_multiCol, m_rule, c); } |
| 675 |
| 676 // column-rule-style (aka -webkit-column-rule-style) |
| 677 EBorderStyle columnRuleStyle() const { return m_rareNonInheritedData->m_mult
iCol->m_rule.style(); } |
| 678 void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_multiCol, m_rule.m_style, b); } |
| 679 |
| 680 // column-rule-width (aka -webkit-column-rule-width) |
| 681 static unsigned short initialColumnRuleWidth() { return 3; } |
| 682 unsigned short columnRuleWidth() const { return m_rareNonInheritedData->m_mu
ltiCol->ruleWidth(); } |
| 683 void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_rule.m_width, w); } |
| 684 |
| 685 // column-span (aka -webkit-column-span) |
| 686 static ColumnSpan initialColumnSpan() { return ColumnSpanNone; } |
| 687 ColumnSpan getColumnSpan() const { return static_cast<ColumnSpan>(m_rareNonI
nheritedData->m_multiCol->m_columnSpan); } |
| 688 void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_columnSpan, columnSpan); } |
| 689 |
| 690 // column-width (aka -webkit-column-width) |
| 691 float columnWidth() const { return m_rareNonInheritedData->m_multiCol->m_wid
th; } |
| 692 void setColumnWidth(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoWidth, false); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_
width, f); } |
| 693 bool hasAutoColumnWidth() const { return m_rareNonInheritedData->m_multiCol-
>m_autoWidth; } |
| 694 void setHasAutoColumnWidth() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoWidth, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_w
idth, 0); } |
| 695 |
| 696 // contain |
| 697 static Containment initialContain() { return ContainsNone; } |
| 698 Containment contain() const { return static_cast<Containment>(m_rareNonInher
itedData->m_contain); } |
| 699 void setContain(Containment contain) { SET_VAR(m_rareNonInheritedData, m_con
tain, contain); } |
| 700 |
| 701 // content |
| 702 ContentData* contentData() const { return m_rareNonInheritedData->m_content.
get(); } |
| 703 void setContent(ContentData*); |
| 704 |
| 705 // display |
| 706 static EDisplay initialDisplay() { return INLINE; } |
493 EDisplay display() const { return static_cast<EDisplay>(m_nonInheritedData.m
_effectiveDisplay); } | 707 EDisplay display() const { return static_cast<EDisplay>(m_nonInheritedData.m
_effectiveDisplay); } |
494 EDisplay originalDisplay() const { return static_cast<EDisplay>(m_nonInherit
edData.m_originalDisplay); } | 708 EDisplay originalDisplay() const { return static_cast<EDisplay>(m_nonInherit
edData.m_originalDisplay); } |
495 | 709 void setDisplay(EDisplay v) { m_nonInheritedData.m_effectiveDisplay = v; } |
496 const Length& left() const { return m_surround->offset.left(); } | 710 void setOriginalDisplay(EDisplay v) { m_nonInheritedData.m_originalDisplay =
v; } |
497 const Length& right() const { return m_surround->offset.right(); } | 711 |
498 const Length& top() const { return m_surround->offset.top(); } | 712 // Flex properties. |
499 const Length& bottom() const { return m_surround->offset.bottom(); } | 713 // flex-basis (aka -webkit-flex-basis) |
500 | 714 static Length initialFlexBasis() { return Length(Auto); } |
501 // Accessors for positioned object edges that take into account writing mode
. | 715 const Length& flexBasis() const { return m_rareNonInheritedData->m_flexibleB
ox->m_flexBasis; } |
502 const Length& logicalLeft() const { return m_surround->offset.logicalLeft(ge
tWritingMode()); } | 716 void setFlexBasis(const Length& length) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_flexibleBox, m_flexBasis, length); } |
503 const Length& logicalRight() const { return m_surround->offset.logicalRight(
getWritingMode()); } | 717 |
504 const Length& logicalTop() const { return m_surround->offset.before(getWriti
ngMode()); } | 718 // flex-direction (aka -webkit-flex-direction) |
505 const Length& logicalBottom() const { return m_surround->offset.after(getWri
tingMode()); } | 719 static EFlexDirection initialFlexDirection() { return FlowRow; } |
506 | 720 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(m_
rareNonInheritedData->m_flexibleBox->m_flexDirection); } |
507 // Whether or not a positioned element requires normal flow x/y to be comput
ed | 721 void setFlexDirection(EFlexDirection direction) { SET_NESTED_VAR(m_rareNonIn
heritedData, m_flexibleBox, m_flexDirection, direction); } |
508 // to determine its position. | 722 |
509 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(
); } | 723 // flex-grow (aka -webkit-flex-grow) |
510 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(
); } | 724 static float initialFlexGrow() { return 0; } |
511 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? ha
sAutoLeftAndRight() : hasAutoTopAndBottom(); } | 725 float flexGrow() const { return m_rareNonInheritedData->m_flexibleBox->m_fle
xGrow; } |
512 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? has
AutoTopAndBottom() : hasAutoLeftAndRight(); } | 726 void setFlexGrow(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_flexibl
eBox, m_flexGrow, f); } |
513 | 727 |
514 EPosition position() const { return static_cast<EPosition>(m_nonInheritedDat
a.m_position); } | 728 // flex-shrink (aka -webkit-flex-shrink) |
515 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition ||
position() == FixedPosition; } | 729 static float initialFlexShrink() { return 1; } |
516 bool hasInFlowPosition() const { return position() == RelativePosition || po
sition() == StickyPosition; } | 730 float flexShrink() const { return m_rareNonInheritedData->m_flexibleBox->m_f
lexShrink; } |
517 bool hasViewportConstrainedPosition() const { return position() == FixedPosi
tion || position() == StickyPosition; } | 731 void setFlexShrink(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_flexi
bleBox, m_flexShrink, f); } |
| 732 |
| 733 // flex-wrap (aka -webkit-flex-wrap) |
| 734 static EFlexWrap initialFlexWrap() { return FlexNoWrap; } |
| 735 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(m_rareNonInherite
dData->m_flexibleBox->m_flexWrap); } |
| 736 void setFlexWrap(EFlexWrap w) { SET_NESTED_VAR(m_rareNonInheritedData, m_fle
xibleBox, m_flexWrap, w); } |
| 737 |
| 738 // -webkit-box-flex |
| 739 static float initialBoxFlex() { return 0.0f; } |
| 740 float boxFlex() const { return m_rareNonInheritedData->m_deprecatedFlexibleB
ox->flex; } |
| 741 void setBoxFlex(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_deprecat
edFlexibleBox, flex, f); } |
| 742 |
| 743 // -webkit-box-flex-group |
| 744 static unsigned initialBoxFlexGroup() { return 1; } |
| 745 unsigned boxFlexGroup() const { return m_rareNonInheritedData->m_deprecatedF
lexibleBox->flexGroup; } |
| 746 void setBoxFlexGroup(unsigned fg) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, flexGroup, fg); } |
| 747 |
| 748 // -webkit-box-align |
| 749 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexb
ox-20090723/#alignment |
| 750 static EBoxAlignment initialBoxAlign() { return BSTRETCH; } |
| 751 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(m_rareNon
InheritedData->m_deprecatedFlexibleBox->align); } |
| 752 void setBoxAlign(EBoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, align, a); } |
| 753 |
| 754 // -webkit-box-decoration-break |
| 755 static EBoxDecorationBreak initialBoxDecorationBreak() { return BoxDecoratio
nBreakSlice; } |
| 756 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecoration
Break(); } |
| 757 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDeco
rationBreak, b); } |
| 758 |
| 759 // -webkit-box-lines |
| 760 static EBoxLines initialBoxLines() { return SINGLE; } |
| 761 EBoxLines boxLines() const { return static_cast<EBoxLines>(m_rareNonInherite
dData->m_deprecatedFlexibleBox->lines); } |
| 762 void setBoxLines(EBoxLines lines) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, lines, lines); } |
| 763 |
| 764 // -webkit-box-ordinal-group |
| 765 static unsigned initialBoxOrdinalGroup() { return 1; } |
| 766 unsigned boxOrdinalGroup() const { return m_rareNonInheritedData->m_deprecat
edFlexibleBox->ordinalGroup; } |
| 767 void setBoxOrdinalGroup(unsigned og) { SET_NESTED_VAR(m_rareNonInheritedData
, m_deprecatedFlexibleBox, ordinalGroup, og); } |
| 768 |
| 769 // -webkit-box-orient |
| 770 static EBoxOrient initialBoxOrient() { return HORIZONTAL; } |
| 771 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(m_rareNonInher
itedData->m_deprecatedFlexibleBox->orient); } |
| 772 void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(m_rareNonInheritedData, m_d
eprecatedFlexibleBox, orient, o); } |
| 773 |
| 774 // -webkit-box-pack |
| 775 static EBoxPack initialBoxPack() { return BoxPackStart; } |
| 776 EBoxPack boxPack() const { return static_cast<EBoxPack>(m_rareNonInheritedDa
ta->m_deprecatedFlexibleBox->pack); } |
| 777 void setBoxPack(EBoxPack p) { SET_NESTED_VAR(m_rareNonInheritedData, m_depre
catedFlexibleBox, pack, p); } |
| 778 |
| 779 // -webkit-box-reflect |
| 780 static StyleReflection* initialBoxReflect() { return 0; } |
| 781 StyleReflection* boxReflect() const { return m_rareNonInheritedData->m_boxRe
flect.get(); } |
| 782 void setBoxReflect(PassRefPtr<StyleReflection> reflect) |
| 783 { |
| 784 if (m_rareNonInheritedData->m_boxReflect != reflect) |
| 785 m_rareNonInheritedData.access()->m_boxReflect = reflect; |
| 786 } |
| 787 |
| 788 // float |
| 789 static EFloat initialFloating() { return NoFloat; } |
518 EFloat floating() const { return static_cast<EFloat>(m_nonInheritedData.m_fl
oating); } | 790 EFloat floating() const { return static_cast<EFloat>(m_nonInheritedData.m_fl
oating); } |
519 | 791 void setFloating(EFloat v) { m_nonInheritedData.m_floating = v; } |
| 792 |
| 793 // Grid properties. |
| 794 static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<G
ridTrackSize>(); /* none */ } |
| 795 static size_t initialGridAutoRepeatInsertionPoint() { return 0; } |
| 796 static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; } |
| 797 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLin
esMap(); } |
| 798 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesM
ap(); } |
| 799 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return O
rderedNamedGridLines(); } |
| 800 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return Orde
redNamedGridLines(); } |
| 801 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap();
} |
| 802 static size_t initialNamedGridAreaCount() { return 0; } |
| 803 |
| 804 // grid-auto-columns |
| 805 static Vector<GridTrackSize> initialGridAutoColumns(); |
| 806 const Vector<GridTrackSize>& gridAutoColumns() const { return m_rareNonInher
itedData->m_grid->m_gridAutoColumns; } |
| 807 void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoColumns, trackSizeList); } |
| 808 |
| 809 // grid-auto-flow |
| 810 static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; } |
| 811 void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_grid, m_gridAutoFlow, flow); } |
| 812 |
| 813 // grid-auto-rows |
| 814 static Vector<GridTrackSize> initialGridAutoRows(); |
| 815 const Vector<GridTrackSize>& gridAutoRows() const { return m_rareNonInherite
dData->m_grid->m_gridAutoRows; } |
| 816 void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTE
D_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRows, trackSizeList); } |
| 817 |
| 818 // grid-column-gap |
| 819 static Length initialGridColumnGap() { return Length(Fixed); } |
| 820 const Length& gridColumnGap() const { return m_rareNonInheritedData->m_grid-
>m_gridColumnGap; } |
| 821 void setGridColumnGap(const Length& v) { SET_NESTED_VAR(m_rareNonInheritedDa
ta, m_grid, m_gridColumnGap, v); } |
| 822 |
| 823 // grid-column-start |
| 824 static GridPosition initialGridColumnStart() { return GridPosition(); /* aut
o */ } |
| 825 const GridPosition& gridColumnStart() const { return m_rareNonInheritedData-
>m_gridItem->m_gridColumnStart; } |
| 826 void setGridColumnStart(const GridPosition& columnStartPosition) { SET_NESTE
D_VAR(m_rareNonInheritedData, m_gridItem, m_gridColumnStart, columnStartPosition
); } |
| 827 |
| 828 // grid-column-end |
| 829 static GridPosition initialGridColumnEnd() { return GridPosition(); /* auto
*/ } |
| 830 const GridPosition& gridColumnEnd() const { return m_rareNonInheritedData->m
_gridItem->m_gridColumnEnd; } |
| 831 void setGridColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VA
R(m_rareNonInheritedData, m_gridItem, m_gridColumnEnd, columnEndPosition); } |
| 832 |
| 833 // grid-row-gap |
| 834 static Length initialGridRowGap() { return Length(Fixed); } |
| 835 const Length& gridRowGap() const { return m_rareNonInheritedData->m_grid->m_
gridRowGap; } |
| 836 void setGridRowGap(const Length& v) { SET_NESTED_VAR(m_rareNonInheritedData,
m_grid, m_gridRowGap, v); } |
| 837 |
| 838 // grid-row-start |
| 839 static GridPosition initialGridRowStart() { return GridPosition(); /* auto
*/ } |
| 840 const GridPosition& gridRowStart() const { return m_rareNonInheritedData->m_
gridItem->m_gridRowStart; } |
| 841 void setGridRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(
m_rareNonInheritedData, m_gridItem, m_gridRowStart, rowStartPosition); } |
| 842 |
| 843 // grid-row-end |
| 844 static GridPosition initialGridRowEnd() { return GridPosition(); /* auto */
} |
| 845 const GridPosition& gridRowEnd() const { return m_rareNonInheritedData->m_gr
idItem->m_gridRowEnd; } |
| 846 void setGridRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(m_ra
reNonInheritedData, m_gridItem, m_gridRowEnd, rowEndPosition); } |
| 847 |
| 848 // grid-template-columns |
| 849 static Vector<GridTrackSize> initialGridTemplateColumns() { return Vector<Gr
idTrackSize>(); /* none */ } |
| 850 const Vector<GridTrackSize>& gridTemplateColumns() const { return m_rareNonI
nheritedData->m_grid->m_gridTemplateColumns; } |
| 851 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_grid, m_gridTemplateColumns, lengths); } |
| 852 |
| 853 // grid-template-rows |
| 854 static Vector<GridTrackSize> initialGridTemplateRows() { return Vector<GridT
rackSize>(); /* none */ } |
| 855 const Vector<GridTrackSize>& gridTemplateRows() const { return m_rareNonInhe
ritedData->m_grid->m_gridTemplateRows; } |
| 856 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_
VAR(m_rareNonInheritedData, m_grid, m_gridTemplateRows, lengths); } |
| 857 |
| 858 // justify-self |
| 859 const StyleSelfAlignmentData& justifySelf() const { return m_rareNonInherite
dData->m_justifySelf; } |
| 860 void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonI
nheritedData, m_justifySelf, data); } |
| 861 |
| 862 // justify-items |
| 863 const StyleSelfAlignmentData& justifyItems() const { return m_rareNonInherit
edData->m_justifyItems; } |
| 864 void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNon
InheritedData, m_justifyItems, data); } |
| 865 |
| 866 |
| 867 // Width/height properties. |
| 868 static Length initialSize() { return Length(); } |
| 869 static Length initialMaxSize() { return Length(MaxSizeNone); } |
| 870 static Length initialMinSize() { return Length(); } |
| 871 |
| 872 // width |
520 const Length& width() const { return m_box->width(); } | 873 const Length& width() const { return m_box->width(); } |
| 874 void setWidth(const Length& v) { SET_VAR(m_box, m_width, v); } |
| 875 |
| 876 // height |
521 const Length& height() const { return m_box->height(); } | 877 const Length& height() const { return m_box->height(); } |
| 878 void setHeight(const Length& v) { SET_VAR(m_box, m_height, v); } |
| 879 |
| 880 // max-width |
| 881 const Length& maxWidth() const { return m_box->maxWidth(); } |
| 882 void setMaxWidth(const Length& v) { SET_VAR(m_box, m_maxWidth, v); } |
| 883 |
| 884 // max-height |
| 885 const Length& maxHeight() const { return m_box->maxHeight(); } |
| 886 void setMaxHeight(const Length& v) { SET_VAR(m_box, m_maxHeight, v); } |
| 887 |
| 888 // min-width |
522 const Length& minWidth() const { return m_box->minWidth(); } | 889 const Length& minWidth() const { return m_box->minWidth(); } |
523 const Length& maxWidth() const { return m_box->maxWidth(); } | 890 void setMinWidth(const Length& v) { SET_VAR(m_box, m_minWidth, v); } |
| 891 |
| 892 // min-height |
524 const Length& minHeight() const { return m_box->minHeight(); } | 893 const Length& minHeight() const { return m_box->minHeight(); } |
525 const Length& maxHeight() const { return m_box->maxHeight(); } | 894 void setMinHeight(const Length& v) { SET_VAR(m_box, m_minHeight, v); } |
526 | 895 |
527 const Length& logicalWidth() const { return isHorizontalWritingMode() ? widt
h() : height(); } | 896 // image-orientation |
528 const Length& logicalHeight() const { return isHorizontalWritingMode() ? hei
ght() : width(); } | 897 static RespectImageOrientationEnum initialRespectImageOrientation() { return
DoNotRespectImageOrientation; } |
529 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? m
inWidth() : minHeight(); } | 898 RespectImageOrientationEnum respectImageOrientation() const { return static_
cast<RespectImageOrientationEnum>(m_rareInheritedData->m_respectImageOrientation
); } |
530 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? m
axWidth() : maxHeight(); } | 899 void setRespectImageOrientation(RespectImageOrientationEnum v) { SET_VAR(m_r
areInheritedData, m_respectImageOrientation, v); } |
531 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ?
minHeight() : minWidth(); } | 900 |
532 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ?
maxHeight() : maxWidth(); } | 901 // image-rendering |
533 | 902 static EImageRendering initialImageRendering() { return ImageRenderingAuto;
} |
534 const BorderData& border() const { return m_surround->border; } | 903 EImageRendering imageRendering() const { return static_cast<EImageRendering>
(m_rareInheritedData->m_imageRendering); } |
535 const BorderValue& borderLeft() const { return m_surround->border.left(); } | 904 void setImageRendering(EImageRendering v) { SET_VAR(m_rareInheritedData, m_i
mageRendering, v); } |
536 const BorderValue& borderRight() const { return m_surround->border.right();
} | 905 |
537 const BorderValue& borderTop() const { return m_surround->border.top(); } | 906 // isolation |
538 const BorderValue& borderBottom() const { return m_surround->border.bottom()
; } | 907 static EIsolation initialIsolation() { return IsolationAuto; } |
539 | 908 EIsolation isolation() const { return static_cast<EIsolation>(m_rareNonInher
itedData->m_isolation); } |
540 const BorderValue& borderBefore() const; | 909 void setIsolation(EIsolation v) { m_rareNonInheritedData.access()->m_isolati
on = v; } |
541 const BorderValue& borderAfter() const; | 910 |
542 const BorderValue& borderStart() const; | 911 // Margin properties. |
543 const BorderValue& borderEnd() const; | 912 static Length initialMargin() { return Length(Fixed); } |
544 | 913 |
545 const NinePieceImage& borderImage() const { return m_surround->border.image(
); } | 914 // margin-top |
546 StyleImage* borderImageSource() const { return m_surround->border.image().im
age(); } | 915 const Length& marginTop() const { return m_surround->margin.top(); } |
547 const LengthBox& borderImageSlices() const { return m_surround->border.image
().imageSlices(); } | 916 void setMarginTop(const Length& v) { SET_VAR(m_surround, margin.m_top, v); } |
548 bool borderImageSlicesFill() const { return m_surround->border.image().fill(
); } | 917 |
549 const BorderImageLengthBox& borderImageWidth() const { return m_surround->bo
rder.image().borderSlices(); } | 918 // margin-bottom |
550 const BorderImageLengthBox& borderImageOutset() const { return m_surround->b
order.image().outset(); } | 919 const Length& marginBottom() const { return m_surround->margin.bottom(); } |
551 | 920 void setMarginBottom(const Length& v) { SET_VAR(m_surround, margin.m_bottom,
v); } |
552 const LengthSize& borderTopLeftRadius() const { return m_surround->border.to
pLeft(); } | 921 |
553 const LengthSize& borderTopRightRadius() const { return m_surround->border.t
opRight(); } | 922 // margin-left |
554 const LengthSize& borderBottomLeftRadius() const { return m_surround->border
.bottomLeft(); } | 923 const Length& marginLeft() const { return m_surround->margin.left(); } |
555 const LengthSize& borderBottomRightRadius() const { return m_surround->borde
r.bottomRight(); } | 924 void setMarginLeft(const Length& v) { SET_VAR(m_surround, margin.m_left, v);
} |
556 bool hasBorderRadius() const { return m_surround->border.hasBorderRadius();
} | 925 |
557 | 926 // margin-right |
558 int borderLeftWidth() const { return m_surround->border.borderLeftWidth(); } | 927 const Length& marginRight() const { return m_surround->margin.right(); } |
559 EBorderStyle borderLeftStyle() const { return m_surround->border.left().styl
e(); } | 928 void setMarginRight(const Length& v) { SET_VAR(m_surround, margin.m_right, v
); } |
560 int borderRightWidth() const { return m_surround->border.borderRightWidth();
} | 929 |
561 EBorderStyle borderRightStyle() const { return m_surround->border.right().st
yle(); } | 930 // -webkit-margin-before-collapse (aka -webkit-margin-top-collapse) |
562 int borderTopWidth() const { return m_surround->border.borderTopWidth(); } | 931 static EMarginCollapse initialMarginBeforeCollapse() { return MarginCollapse
Collapse; } |
563 EBorderStyle borderTopStyle() const { return m_surround->border.top().style(
); } | 932 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginColl
apse>(m_rareNonInheritedData->marginAfterCollapse); } |
564 int borderBottomWidth() const { return m_surround->border.borderBottomWidth(
); } | 933 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInherited
Data, marginBeforeCollapse, c); } |
565 EBorderStyle borderBottomStyle() const { return m_surround->border.bottom().
style(); } | 934 |
566 | 935 // -webkit-margin-after-collapse (aka -webkit-margin-bottom-collapse) |
567 int borderBeforeWidth() const; | 936 static EMarginCollapse initialMarginAfterCollapse() { return MarginCollapseC
ollapse; } |
568 int borderAfterWidth() const; | 937 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCol
lapse>(m_rareNonInheritedData->marginBeforeCollapse); } |
569 int borderStartWidth() const; | 938 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedD
ata, marginAfterCollapse, c); } |
570 int borderEndWidth() const; | 939 |
571 int borderOverWidth() const; | 940 // mix-blend-mode |
572 int borderUnderWidth() const; | 941 static WebBlendMode initialBlendMode() { return WebBlendModeNormal; } |
573 | 942 WebBlendMode blendMode() const { return static_cast<WebBlendMode>(m_rareNonI
nheritedData->m_effectiveBlendMode); } |
| 943 void setBlendMode(WebBlendMode v) { m_rareNonInheritedData.access()->m_effec
tiveBlendMode = v; } |
| 944 |
| 945 // motion-path |
| 946 static StylePath* initialMotionPath() { return nullptr; } |
| 947 StylePath* motionPath() const { return m_rareNonInheritedData->m_transform->
m_motion.m_path.get(); } |
| 948 void setMotionPath(PassRefPtr<StylePath>); |
| 949 |
| 950 // motion-offset |
| 951 static Length initialMotionOffset() { return Length(0, Fixed); } |
| 952 const Length& motionOffset() const { return m_rareNonInheritedData->m_transf
orm->m_motion.m_offset; } |
| 953 void setMotionOffset(const Length& motionOffset) { SET_NESTED_VAR(m_rareNonI
nheritedData, m_transform, m_motion.m_offset, motionOffset); } |
| 954 |
| 955 // motion-rotation |
| 956 static StyleMotionRotation initialMotionRotation() { return StyleMotionRotat
ion(0, MotionRotationAuto); } |
| 957 const StyleMotionRotation& motionRotation() const { return m_rareNonInherite
dData->m_transform->m_motion.m_rotation; } |
| 958 void setMotionRotation(const StyleMotionRotation& motionRotation) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_transform, m_motion.m_rotation, motionRotation)
; } |
| 959 |
| 960 // object-fit |
| 961 static ObjectFit initialObjectFit() { return ObjectFitFill; } |
| 962 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe
ritedData->m_objectFit); } |
| 963 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit
, f); } |
| 964 |
| 965 // object-position |
| 966 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } |
| 967 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object
Position; } |
| 968 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat
a, m_objectPosition, position); } |
| 969 |
| 970 // opacity (aka -webkit-opacity) |
| 971 static float initialOpacity() { return 1.0f; } |
| 972 float opacity() const { return m_rareNonInheritedData->opacity; } |
| 973 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(m_rare
NonInheritedData, opacity, v); } |
| 974 |
| 975 // order (aka -webkit-order) |
| 976 static int initialOrder() { return 0; } |
| 977 int order() const { return m_rareNonInheritedData->m_order; } |
| 978 // 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. |
| 979 void setOrder(int o) { SET_VAR(m_rareNonInheritedData, m_order, max(std::num
eric_limits<int>::min() + 2, o)); } |
| 980 |
| 981 // Outline properties. |
| 982 // outline-color |
| 983 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_backgrou
nd, m_outline, v); } |
| 984 |
| 985 // outline-style |
| 986 EBorderStyle outlineStyle() const { return m_background->outline().style();
} |
| 987 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_sty
le, v); } |
| 988 static OutlineIsAuto initialOutlineStyleIsAuto() { return OutlineIsAutoOff;
} |
| 989 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>
(m_background->outline().isAuto()); } |
| 990 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_o
utline.m_isAuto, isAuto); } |
| 991 |
| 992 // outline-width |
| 993 static unsigned short initialOutlineWidth() { return 3; } |
574 int outlineWidth() const | 994 int outlineWidth() const |
575 { | 995 { |
576 if (m_background->outline().style() == BorderStyleNone) | 996 if (m_background->outline().style() == BorderStyleNone) |
577 return 0; | 997 return 0; |
578 return m_background->outline().width(); | 998 return m_background->outline().width(); |
579 } | 999 } |
580 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > Bord
erStyleHidden; } | 1000 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_w
idth, v); } |
581 EBorderStyle outlineStyle() const { return m_background->outline().style();
} | 1001 |
582 OutlineIsAuto outlineStyleIsAuto() const { return static_cast<OutlineIsAuto>
(m_background->outline().isAuto()); } | 1002 // outline-offset |
583 int outlineOutsetExtent() const; | 1003 static int initialOutlineOffset() { return 0; } |
584 | |
585 EOverflowAnchor overflowAnchor() const { return static_cast<EOverflowAnchor>
(m_nonInheritedData.m_overflowAnchor); } | |
586 EOverflow overflowX() const { return static_cast<EOverflow>(m_nonInheritedDa
ta.m_overflowX); } | |
587 EOverflow overflowY() const { return static_cast<EOverflow>(m_nonInheritedDa
ta.m_overflowY); } | |
588 // It's sufficient to just check one direction, since it's illegal to have v
isible on only one overflow value. | |
589 bool isOverflowVisible() const { ASSERT(overflowX() != OverflowVisible || ov
erflowX() == overflowY()); return overflowX() == OverflowVisible; } | |
590 bool isOverflowPaged() const { return overflowY() == OverflowPagedX || overf
lowY() == OverflowPagedY; } | |
591 | |
592 EVisibility visibility() const { return static_cast<EVisibility>(m_inherited
Data.m_visibility); } | |
593 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(m_
nonInheritedData.m_verticalAlign); } | |
594 const Length& getVerticalAlignLength() const { return m_box->verticalAlign()
; } | |
595 | |
596 const Length& clipLeft() const { return m_visual->clip.left(); } | |
597 const Length& clipRight() const { return m_visual->clip.right(); } | |
598 const Length& clipTop() const { return m_visual->clip.top(); } | |
599 const Length& clipBottom() const { return m_visual->clip.bottom(); } | |
600 const LengthBox& clip() const { return m_visual->clip; } | |
601 bool hasAutoClip() const { return m_visual->hasAutoClip; } | |
602 | |
603 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(m_nonInh
eritedData.m_unicodeBidi); } | |
604 | |
605 EClear clear() const { return static_cast<EClear>(m_nonInheritedData.m_clear
); } | |
606 ETableLayout tableLayout() const { return static_cast<ETableLayout>(m_nonInh
eritedData.m_tableLayout); } | |
607 bool isFixedTableLayout() const { return tableLayout() == TableLayoutFixed &
& !logicalWidth().isAuto(); } | |
608 | |
609 const Font& font() const; | |
610 const FontMetrics& getFontMetrics() const; | |
611 const FontDescription& getFontDescription() const; | |
612 float specifiedFontSize() const; | |
613 float computedFontSize() const; | |
614 int fontSize() const; | |
615 float fontSizeAdjust() const; | |
616 bool hasFontSizeAdjust() const; | |
617 FontWeight fontWeight() const; | |
618 FontStretch fontStretch() const; | |
619 | |
620 float textAutosizingMultiplier() const { return m_styleInheritedData->textAu
tosizingMultiplier; } | |
621 | |
622 const Length& textIndent() const { return m_rareInheritedData->indent; } | |
623 TextIndentLine getTextIndentLine() const { return static_cast<TextIndentLine
>(m_rareInheritedData->m_textIndentLine); } | |
624 TextIndentType getTextIndentType() const { return static_cast<TextIndentType
>(m_rareInheritedData->m_textIndentType); } | |
625 ETextAlign textAlign() const { return static_cast<ETextAlign>(m_inheritedDat
a.m_textAlign); } | |
626 TextAlignLast getTextAlignLast() const { return static_cast<TextAlignLast>(m
_rareInheritedData->m_textAlignLast); } | |
627 TextJustify getTextJustify() const { return static_cast<TextJustify>(m_rareI
nheritedData->m_textJustify); } | |
628 ETextTransform textTransform() const { return static_cast<ETextTransform>(m_
inheritedData.m_textTransform); } | |
629 TextDecoration textDecorationsInEffect() const; | |
630 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; | |
631 TextDecoration getTextDecoration() const { return static_cast<TextDecoration
>(m_visual->textDecoration); } | |
632 TextUnderlinePosition getTextUnderlinePosition() const { return static_cast<
TextUnderlinePosition>(m_rareInheritedData->m_textUnderlinePosition); } | |
633 TextDecorationStyle getTextDecorationStyle() const { return static_cast<Text
DecorationStyle>(m_rareNonInheritedData->m_textDecorationStyle); } | |
634 float wordSpacing() const; | |
635 float letterSpacing() const; | |
636 StyleVariableData* variables() const; | |
637 | |
638 void setVariable(const AtomicString&, PassRefPtr<CSSVariableData>); | |
639 void removeVariable(const AtomicString&); | |
640 | |
641 float zoom() const { return m_visual->m_zoom; } | |
642 float effectiveZoom() const { return m_rareInheritedData->m_effectiveZoom; } | |
643 | |
644 TextDirection direction() const { return static_cast<TextDirection>(m_inheri
tedData.m_direction); } | |
645 bool isLeftToRightDirection() const { return direction() == LTR; } | |
646 bool selfOrAncestorHasDirAutoAttribute() const { return m_rareInheritedData-
>m_selfOrAncestorHasDirAutoAttribute; } | |
647 | |
648 const Length& specifiedLineHeight() const; | |
649 Length lineHeight() const; | |
650 int computedLineHeight() const; | |
651 | |
652 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(m_inherited
Data.m_whiteSpace); } | |
653 static bool autoWrap(EWhiteSpace ws) | |
654 { | |
655 // Nowrap and pre don't automatically wrap. | |
656 return ws != NOWRAP && ws != PRE; | |
657 } | |
658 | |
659 bool autoWrap() const | |
660 { | |
661 return autoWrap(whiteSpace()); | |
662 } | |
663 | |
664 static bool preserveNewline(EWhiteSpace ws) | |
665 { | |
666 // Normal and nowrap do not preserve newlines. | |
667 return ws != NORMAL && ws != NOWRAP; | |
668 } | |
669 | |
670 bool preserveNewline() const | |
671 { | |
672 return preserveNewline(whiteSpace()); | |
673 } | |
674 | |
675 static bool collapseWhiteSpace(EWhiteSpace ws) | |
676 { | |
677 // Pre and prewrap do not collapse whitespace. | |
678 return ws != PRE && ws != PRE_WRAP; | |
679 } | |
680 | |
681 bool collapseWhiteSpace() const | |
682 { | |
683 return collapseWhiteSpace(whiteSpace()); | |
684 } | |
685 | |
686 bool isCollapsibleWhiteSpace(UChar c) const | |
687 { | |
688 switch (c) { | |
689 case ' ': | |
690 case '\t': | |
691 return collapseWhiteSpace(); | |
692 case '\n': | |
693 return !preserveNewline(); | |
694 } | |
695 return false; | |
696 } | |
697 | |
698 bool breakOnlyAfterWhiteSpace() const | |
699 { | |
700 return whiteSpace() == PRE_WRAP || getLineBreak() == LineBreakAfterWhite
Space; | |
701 } | |
702 | |
703 bool breakWords() const | |
704 { | |
705 return (wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflow
Wrap) | |
706 && whiteSpace() != PRE && whiteSpace() != NOWRAP; | |
707 } | |
708 | |
709 EFillBox backgroundClip() const { return static_cast<EFillBox>(m_background-
>background().clip()); } | |
710 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr
ound; } | |
711 const FillLayer& backgroundLayers() const { return m_background->background(
); } | |
712 | |
713 StyleImage* maskImage() const { return m_rareNonInheritedData->m_mask.image(
); } | |
714 FillLayer& accessMaskLayers() { return m_rareNonInheritedData.access()->m_ma
sk; } | |
715 const FillLayer& maskLayers() const { return m_rareNonInheritedData->m_mask;
} | |
716 | |
717 const NinePieceImage& maskBoxImage() const { return m_rareNonInheritedData->
m_maskBoxImage; } | |
718 StyleImage* maskBoxImageSource() const { return m_rareNonInheritedData->m_ma
skBoxImage.image(); } | |
719 const LengthBox& maskBoxImageSlices() const { return m_rareNonInheritedData-
>m_maskBoxImage.imageSlices(); } | |
720 bool maskBoxImageSlicesFill() const { return m_rareNonInheritedData->m_maskB
oxImage.fill(); } | |
721 const BorderImageLengthBox& maskBoxImageWidth() const { return m_rareNonInhe
ritedData->m_maskBoxImage.borderSlices(); } | |
722 const BorderImageLengthBox& maskBoxImageOutset() const { return m_rareNonInh
eritedData->m_maskBoxImage.outset(); } | |
723 | |
724 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>
(m_inheritedData.m_borderCollapse); } | |
725 short horizontalBorderSpacing() const; | |
726 short verticalBorderSpacing() const; | |
727 EEmptyCells emptyCells() const { return static_cast<EEmptyCells>(m_inherited
Data.m_emptyCells); } | |
728 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(m_inheri
tedData.m_captionSide); } | |
729 | |
730 EListStyleType listStyleType() const { return static_cast<EListStyleType>(m_
inheritedData.m_listStyleType); } | |
731 StyleImage* listStyleImage() const; | |
732 EListStylePosition listStylePosition() const { return static_cast<EListStyle
Position>(m_inheritedData.m_listStylePosition); } | |
733 | |
734 const Length& marginTop() const { return m_surround->margin.top(); } | |
735 const Length& marginBottom() const { return m_surround->margin.bottom(); } | |
736 const Length& marginLeft() const { return m_surround->margin.left(); } | |
737 const Length& marginRight() const { return m_surround->margin.right(); } | |
738 const Length& marginBefore() const { return m_surround->margin.before(getWri
tingMode()); } | |
739 const Length& marginAfter() const { return m_surround->margin.after(getWriti
ngMode()); } | |
740 const Length& marginStart() const { return m_surround->margin.start(getWriti
ngMode(), direction()); } | |
741 const Length& marginEnd() const { return m_surround->margin.end(getWritingMo
de(), direction()); } | |
742 const Length& marginOver() const { return m_surround->margin.over(getWriting
Mode()); } | |
743 const Length& marginUnder() const { return m_surround->margin.under(getWriti
ngMode()); } | |
744 const Length& marginStartUsing(const ComputedStyle* otherStyle) const { retu
rn m_surround->margin.start(otherStyle->getWritingMode(), otherStyle->direction(
)); } | |
745 const Length& marginEndUsing(const ComputedStyle* otherStyle) const { return
m_surround->margin.end(otherStyle->getWritingMode(), otherStyle->direction());
} | |
746 const Length& marginBeforeUsing(const ComputedStyle* otherStyle) const { ret
urn m_surround->margin.before(otherStyle->getWritingMode()); } | |
747 const Length& marginAfterUsing(const ComputedStyle* otherStyle) const { retu
rn m_surround->margin.after(otherStyle->getWritingMode()); } | |
748 | |
749 const LengthBox& paddingBox() const { return m_surround->padding; } | |
750 const Length& paddingTop() const { return m_surround->padding.top(); } | |
751 const Length& paddingBottom() const { return m_surround->padding.bottom(); } | |
752 const Length& paddingLeft() const { return m_surround->padding.left(); } | |
753 const Length& paddingRight() const { return m_surround->padding.right(); } | |
754 const Length& paddingBefore() const { return m_surround->padding.before(getW
ritingMode()); } | |
755 const Length& paddingAfter() const { return m_surround->padding.after(getWri
tingMode()); } | |
756 const Length& paddingStart() const { return m_surround->padding.start(getWri
tingMode(), direction()); } | |
757 const Length& paddingEnd() const { return m_surround->padding.end(getWriting
Mode(), direction()); } | |
758 const Length& paddingOver() const { return m_surround->padding.over(getWriti
ngMode()); } | |
759 const Length& paddingUnder() const { return m_surround->padding.under(getWri
tingMode()); } | |
760 | |
761 ECursor cursor() const { return static_cast<ECursor>(m_inheritedData.m_curso
rStyle); } | |
762 CursorList* cursors() const { return m_rareInheritedData->cursorData.get();
} | |
763 | |
764 EInsideLink insideLink() const { return static_cast<EInsideLink>(m_inherited
Data.m_insideLink); } | |
765 bool isLink() const { return m_nonInheritedData.m_isLink; } | |
766 | |
767 short widows() const { return m_rareInheritedData->widows; } | |
768 short orphans() const { return m_rareInheritedData->orphans; } | |
769 EBreak breakAfter() const { return static_cast<EBreak>(m_nonInheritedData.m_
breakAfter); } | |
770 EBreak breakBefore() const { return static_cast<EBreak>(m_nonInheritedData.m
_breakBefore); } | |
771 EBreak breakInside() const { return static_cast<EBreak>(m_nonInheritedData.m
_breakInside); } | |
772 | |
773 TextSizeAdjust getTextSizeAdjust() const { return m_rareInheritedData->m_tex
tSizeAdjust; } | |
774 | |
775 // CSS3 Getter Methods | |
776 | |
777 int outlineOffset() const | 1004 int outlineOffset() const |
778 { | 1005 { |
779 if (m_background->outline().style() == BorderStyleNone) | 1006 if (m_background->outline().style() == BorderStyleNone) |
780 return 0; | 1007 return 0; |
781 return m_background->outline().offset(); | 1008 return m_background->outline().offset(); |
782 } | 1009 } |
783 | 1010 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v);
} |
| 1011 |
| 1012 // Overflow properties. |
| 1013 // overflow-anchor |
| 1014 static EOverflowAnchor initialOverflowAnchor() { return AnchorAuto; } |
| 1015 EOverflowAnchor overflowAnchor() const { return static_cast<EOverflowAnchor>
(m_nonInheritedData.m_overflowAnchor); } |
| 1016 void setOverflowAnchor(EOverflowAnchor v) { m_nonInheritedData.m_overflowAnc
hor = v; } |
| 1017 |
| 1018 // overflow-x |
| 1019 static EOverflow initialOverflowX() { return OverflowVisible; } |
| 1020 EOverflow overflowX() const { return static_cast<EOverflow>(m_nonInheritedDa
ta.m_overflowX); } |
| 1021 void setOverflowX(EOverflow v) { m_nonInheritedData.m_overflowX = v; } |
| 1022 |
| 1023 // overflow-y |
| 1024 static EOverflow initialOverflowY() { return OverflowVisible; } |
| 1025 EOverflow overflowY() const { return static_cast<EOverflow>(m_nonInheritedDa
ta.m_overflowY); } |
| 1026 void setOverflowY(EOverflow v) { m_nonInheritedData.m_overflowY = v; } |
| 1027 |
| 1028 // Padding properties. |
| 1029 static Length initialPadding() { return Length(Fixed); } |
| 1030 |
| 1031 // padding-bottom |
| 1032 const Length& paddingBottom() const { return m_surround->padding.bottom(); } |
| 1033 void setPaddingBottom(const Length& v) { SET_VAR(m_surround, padding.m_botto
m, v); } |
| 1034 |
| 1035 // padding-left |
| 1036 const Length& paddingLeft() const { return m_surround->padding.left(); } |
| 1037 void setPaddingLeft(const Length& v) { SET_VAR(m_surround, padding.m_left, v
); } |
| 1038 |
| 1039 // padding-right |
| 1040 const Length& paddingRight() const { return m_surround->padding.right(); } |
| 1041 void setPaddingRight(const Length& v) { SET_VAR(m_surround, padding.m_right,
v); } |
| 1042 |
| 1043 // padding-top |
| 1044 const Length& paddingTop() const { return m_surround->padding.top(); } |
| 1045 void setPaddingTop(const Length& v) { SET_VAR(m_surround, padding.m_top, v);
} |
| 1046 |
| 1047 // perspective (aka -webkit-perspective) |
| 1048 static float initialPerspective() { return 0; } |
| 1049 float perspective() const { return m_rareNonInheritedData->m_perspective; } |
| 1050 void setPerspective(float p) { SET_VAR(m_rareNonInheritedData, m_perspective
, p); } |
| 1051 |
| 1052 // perspective-origin (aka -webkit-perspective-origin) |
| 1053 static LengthPoint initialPerspectiveOrigin() { return LengthPoint(Length(50
.0, Percent), Length(50.0, Percent)); } |
| 1054 const LengthPoint& perspectiveOrigin() const { return m_rareNonInheritedData
->m_perspectiveOrigin; } |
| 1055 void setPerspectiveOrigin(const LengthPoint& p) { SET_VAR(m_rareNonInherited
Data, m_perspectiveOrigin, p); } |
| 1056 |
| 1057 // -webkit-perspective-origin-x |
| 1058 static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } |
| 1059 const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); } |
| 1060 void setPerspectiveOriginX(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(v, perspectiveOriginY())); } |
| 1061 |
| 1062 // -webkit-perspective-origin-y |
| 1063 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } |
| 1064 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } |
| 1065 void setPerspectiveOriginY(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(perspectiveOriginX(), v)); } |
| 1066 |
| 1067 // position |
| 1068 static EPosition initialPosition() { return StaticPosition; } |
| 1069 EPosition position() const { return static_cast<EPosition>(m_nonInheritedDat
a.m_position); } |
| 1070 void setPosition(EPosition v) { m_nonInheritedData.m_position = v; } |
| 1071 |
| 1072 // resize |
| 1073 static EResize initialResize() { return RESIZE_NONE; } |
| 1074 EResize resize() const { return static_cast<EResize>(m_rareNonInheritedData-
>m_resize); } |
| 1075 void setResize(EResize r) { SET_VAR(m_rareNonInheritedData, m_resize, r); } |
| 1076 |
| 1077 // Transform properties. |
| 1078 // transform (aka -webkit-transform) |
| 1079 static EmptyTransformOperations initialTransform() { return EmptyTransformOp
erations(); } |
| 1080 const TransformOperations& transform() const { return m_rareNonInheritedData
->m_transform->m_operations; } |
| 1081 void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(m_rareNon
InheritedData, m_transform, m_operations, ops); } |
| 1082 |
| 1083 // transform-origin (aka -webkit-transform-origin) |
| 1084 static TransformOrigin initialTransformOrigin() { return TransformOrigin(Len
gth(50.0, Percent), Length(50.0, Percent), 0); } |
| 1085 const TransformOrigin& transformOrigin() const { return m_rareNonInheritedDa
ta->m_transform->m_origin; } |
| 1086 void setTransformOrigin(const TransformOrigin& o) { SET_NESTED_VAR(m_rareNon
InheritedData, m_transform, m_origin, o); } |
| 1087 |
| 1088 // transform-style (aka -webkit-transform-style) |
| 1089 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3D
Flat; } |
| 1090 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformSt
yle3D>(m_rareNonInheritedData->m_transformStyle3D); } |
| 1091 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(m_rareNonInheritedDa
ta, m_transformStyle3D, b); } |
| 1092 |
| 1093 // -webkit-transform-origin-x |
| 1094 static Length initialTransformOriginX() { return Length(50.0, Percent); } |
| 1095 const Length& transformOriginX() const { return transformOrigin().x(); } |
| 1096 void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrig
in(v, transformOriginY(), transformOriginZ())); } |
| 1097 |
| 1098 // -webkit-transform-origin-y |
| 1099 static Length initialTransformOriginY() { return Length(50.0, Percent); } |
| 1100 const Length& transformOriginY() const { return transformOrigin().y(); } |
| 1101 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig
in(transformOriginX(), v, transformOriginZ())); } |
| 1102 |
| 1103 // -webkit-transform-origin-z |
| 1104 static float initialTransformOriginZ() { return 0; } |
| 1105 float transformOriginZ() const { return transformOrigin().z(); } |
| 1106 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans
formOriginX(), transformOriginY(), f)); } |
| 1107 |
| 1108 // Independent transform properties. |
| 1109 // translate |
| 1110 static PassRefPtr<TranslateTransformOperation> initialTranslate() { return T
ranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), 0, Transf
ormOperation::Translate3D); } |
| 1111 TranslateTransformOperation* translate() const { return m_rareNonInheritedDa
ta->m_transform->m_translate.get(); } |
| 1112 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { m_rareNonInhe
ritedData.access()->m_transform.access()->m_translate = v; } |
| 1113 |
| 1114 // rotate |
| 1115 static PassRefPtr<RotateTransformOperation> initialRotate() { return RotateT
ransformOperation::create(0, 0, 1, 0, TransformOperation::Rotate3D); } |
| 1116 RotateTransformOperation* rotate() const { return m_rareNonInheritedData->m_
transform->m_rotate.get(); } |
| 1117 void setRotate(PassRefPtr<RotateTransformOperation> v) { m_rareNonInheritedD
ata.access()->m_transform.access()->m_rotate = v; } |
| 1118 |
| 1119 // scale |
| 1120 static PassRefPtr<ScaleTransformOperation> initialScale() { return ScaleTran
sformOperation::create(1, 1, 1, TransformOperation::Scale3D); } |
| 1121 ScaleTransformOperation* scale() const { return m_rareNonInheritedData->m_tr
ansform->m_scale.get(); } |
| 1122 void setScale(PassRefPtr<ScaleTransformOperation> v) { m_rareNonInheritedDat
a.access()->m_transform.access()->m_scale = v; } |
| 1123 |
| 1124 // Scroll properties. |
| 1125 // scroll-behavior |
| 1126 static ScrollBehavior initialScrollBehavior() { return ScrollBehaviorAuto; } |
| 1127 ScrollBehavior getScrollBehavior() const { return static_cast<ScrollBehavior
>(m_rareNonInheritedData->m_scrollBehavior); } |
| 1128 void setScrollBehavior(ScrollBehavior b) { SET_VAR(m_rareNonInheritedData, m
_scrollBehavior, b); } |
| 1129 |
| 1130 // scroll-snap-coordinate |
| 1131 static Vector<LengthPoint> initialScrollSnapCoordinate() { return Vector<Len
gthPoint>(); } |
| 1132 const Vector<LengthPoint>& scrollSnapCoordinate() const { return m_rareNonIn
heritedData->m_scrollSnap->m_coordinates; } |
| 1133 void setScrollSnapCoordinate(const Vector<LengthPoint>& b) { SET_NESTED_VAR(
m_rareNonInheritedData, m_scrollSnap, m_coordinates, b); } |
| 1134 |
| 1135 // scroll-snap-destination |
| 1136 static LengthPoint initialScrollSnapDestination() { return LengthPoint(Lengt
h(0, Fixed), Length(0, Fixed)); } |
| 1137 const LengthPoint& scrollSnapDestination() const { return m_rareNonInherited
Data->m_scrollSnap->m_destination; } |
| 1138 void setScrollSnapDestination(const LengthPoint& b) { SET_NESTED_VAR(m_rareN
onInheritedData, m_scrollSnap, m_destination, b); } |
| 1139 |
| 1140 // scroll-snap-points-x |
| 1141 static ScrollSnapPoints initialScrollSnapPointsX() { return ScrollSnapPoints
(); } |
| 1142 const ScrollSnapPoints& scrollSnapPointsX() const { return m_rareNonInherite
dData->m_scrollSnap->m_xPoints; } |
| 1143 void setScrollSnapPointsX(const ScrollSnapPoints& b) { SET_NESTED_VAR(m_rare
NonInheritedData, m_scrollSnap, m_xPoints, b); } |
| 1144 |
| 1145 // scroll-snap-points-y |
| 1146 static ScrollSnapPoints initialScrollSnapPointsY() { return ScrollSnapPoints
(); } |
| 1147 const ScrollSnapPoints& scrollSnapPointsY() const { return m_rareNonInherite
dData->m_scrollSnap->m_yPoints; } |
| 1148 void setScrollSnapPointsY(const ScrollSnapPoints& b) { SET_NESTED_VAR(m_rare
NonInheritedData, m_scrollSnap, m_yPoints, b); } |
| 1149 |
| 1150 // scroll-snap-type |
| 1151 static ScrollSnapType initialScrollSnapType() { return ScrollSnapTypeNone; } |
| 1152 ScrollSnapType getScrollSnapType() const { return static_cast<ScrollSnapType
>(m_rareNonInheritedData->m_scrollSnapType); } |
| 1153 void setScrollSnapType(ScrollSnapType b) { SET_VAR(m_rareNonInheritedData, m
_scrollSnapType, b); } |
| 1154 |
| 1155 // shape-image-threshold (aka -webkit-shape-image-threshold) |
| 1156 static float initialShapeImageThreshold() { return 0; } |
| 1157 float shapeImageThreshold() const { return m_rareNonInheritedData->m_shapeIm
ageThreshold; } |
| 1158 void setShapeImageThreshold(float shapeImageThreshold) |
| 1159 { |
| 1160 float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0
, 1); |
| 1161 SET_VAR(m_rareNonInheritedData, m_shapeImageThreshold, clampedShapeImage
Threshold); |
| 1162 } |
| 1163 |
| 1164 // shape-margin (aka -webkit-shape-margin) |
| 1165 static Length initialShapeMargin() { return Length(0, Fixed); } |
| 1166 const Length& shapeMargin() const { return m_rareNonInheritedData->m_shapeMa
rgin; } |
| 1167 void setShapeMargin(const Length& shapeMargin) { SET_VAR(m_rareNonInheritedD
ata, m_shapeMargin, shapeMargin); } |
| 1168 |
| 1169 // shape-outside (aka -webkit-shape-outside) |
| 1170 static ShapeValue* initialShapeOutside() { return 0; } |
| 1171 ShapeValue* shapeOutside() const { return m_rareNonInheritedData->m_shapeOut
side.get(); } |
| 1172 void setShapeOutside(ShapeValue* value) |
| 1173 { |
| 1174 if (m_rareNonInheritedData->m_shapeOutside == value) |
| 1175 return; |
| 1176 m_rareNonInheritedData.access()->m_shapeOutside = value; |
| 1177 } |
| 1178 |
| 1179 // size |
| 1180 const FloatSize& pageSize() const { return m_rareNonInheritedData->m_pageSiz
e; } |
| 1181 PageSizeType getPageSizeType() const { return static_cast<PageSizeType>(m_ra
reNonInheritedData->m_pageSizeType); } |
| 1182 void setPageSize(const FloatSize& s) { SET_VAR(m_rareNonInheritedData, m_pag
eSize, s); } |
| 1183 void setPageSizeType(PageSizeType t) { SET_VAR(m_rareNonInheritedData, m_pag
eSizeType, t); } |
| 1184 // table-layout |
| 1185 static ETableLayout initialTableLayout() { return TableLayoutAuto; } |
| 1186 ETableLayout tableLayout() const { return static_cast<ETableLayout>(m_nonInh
eritedData.m_tableLayout); } |
| 1187 void setTableLayout(ETableLayout v) { m_nonInheritedData.m_tableLayout = v;
} |
| 1188 |
| 1189 // Text decoration properties. |
| 1190 // text-decoration-line |
| 1191 static TextDecoration initialTextDecoration() { return TextDecorationNone; } |
| 1192 TextDecoration getTextDecoration() const { return static_cast<TextDecoration
>(m_visual->textDecoration); } |
| 1193 void setTextDecoration(TextDecoration v) { SET_VAR(m_visual, textDecoration,
v); } |
| 1194 |
| 1195 // text-decoration-color |
| 1196 void setTextDecorationColor(const StyleColor& c) { SET_VAR(m_rareNonInherite
dData, m_textDecorationColor, c); } |
| 1197 |
| 1198 // text-decoration-style |
| 1199 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorat
ionStyleSolid; } |
| 1200 TextDecorationStyle getTextDecorationStyle() const { return static_cast<Text
DecorationStyle>(m_rareNonInheritedData->m_textDecorationStyle); } |
| 1201 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(m_rareNonInheri
tedData, m_textDecorationStyle, v); } |
| 1202 |
| 1203 // text-underline-position |
| 1204 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnd
erlinePositionAuto; } |
| 1205 TextUnderlinePosition getTextUnderlinePosition() const { return static_cast<
TextUnderlinePosition>(m_rareInheritedData->m_textUnderlinePosition); } |
| 1206 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(m_rareInher
itedData, m_textUnderlinePosition, v); } |
| 1207 |
| 1208 // text-overflow |
| 1209 static TextOverflow initialTextOverflow() { return TextOverflowClip; } |
| 1210 TextOverflow getTextOverflow() const { return static_cast<TextOverflow>(m_ra
reNonInheritedData->textOverflow); } |
| 1211 void setTextOverflow(TextOverflow overflow) { SET_VAR(m_rareNonInheritedData
, textOverflow, overflow); } |
| 1212 |
| 1213 // touch-action |
| 1214 static TouchAction initialTouchAction() { return TouchActionAuto; } |
| 1215 TouchAction getTouchAction() const { return static_cast<TouchAction>(m_rareN
onInheritedData->m_touchAction); } |
| 1216 void setTouchAction(TouchAction t) { SET_VAR(m_rareNonInheritedData, m_touch
Action, t); } |
| 1217 |
| 1218 // unicode-bidi |
| 1219 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } |
| 1220 EUnicodeBidi unicodeBidi() const { return static_cast<EUnicodeBidi>(m_nonInh
eritedData.m_unicodeBidi); } |
| 1221 void setUnicodeBidi(EUnicodeBidi b) { m_nonInheritedData.m_unicodeBidi = b;
} |
| 1222 |
| 1223 // vertical-align |
| 1224 static EVerticalAlign initialVerticalAlign() { return VerticalAlignBaseline;
} |
| 1225 EVerticalAlign verticalAlign() const { return static_cast<EVerticalAlign>(m_
nonInheritedData.m_verticalAlign); } |
| 1226 const Length& getVerticalAlignLength() const { return m_box->verticalAlign()
; } |
| 1227 void setVerticalAlign(EVerticalAlign v) { m_nonInheritedData.m_verticalAlign
= v; } |
| 1228 void setVerticalAlignLength(const Length& length) { setVerticalAlign(Vertica
lAlignLength); SET_VAR(m_box, m_verticalAlign, length); } |
| 1229 |
| 1230 // Exclusions properties. |
| 1231 // wrap-flow |
| 1232 static WrapFlow initialWrapFlow() { return WrapFlowAuto; } |
| 1233 |
| 1234 // wrap-through |
| 1235 static WrapThrough initialWrapThrough() { return WrapThroughWrap; } |
| 1236 |
| 1237 // will-change |
| 1238 const Vector<CSSPropertyID>& willChangeProperties() const { return m_rareNon
InheritedData->m_willChange->m_properties; } |
| 1239 bool willChangeContents() const { return m_rareNonInheritedData->m_willChang
e->m_contents; } |
| 1240 bool willChangeScrollPosition() const { return m_rareNonInheritedData->m_wil
lChange->m_scrollPosition; } |
| 1241 bool subtreeWillChangeContents() const { return m_rareInheritedData->m_subtr
eeWillChangeContents; } |
| 1242 void setWillChangeProperties(const Vector<CSSPropertyID>& properties) { SET_
NESTED_VAR(m_rareNonInheritedData, m_willChange, m_properties, properties); } |
| 1243 void setWillChangeContents(bool b) { SET_NESTED_VAR(m_rareNonInheritedData,
m_willChange, m_contents, b); } |
| 1244 void setWillChangeScrollPosition(bool b) { SET_NESTED_VAR(m_rareNonInherited
Data, m_willChange, m_scrollPosition, b); } |
| 1245 void setSubtreeWillChangeContents(bool b) { SET_VAR(m_rareInheritedData, m_s
ubtreeWillChangeContents, b); } |
| 1246 |
| 1247 // z-index |
| 1248 int zIndex() const { return m_box->zIndex(); } |
| 1249 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } |
| 1250 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo
x, m_zIndex, v); } |
| 1251 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_b
ox, m_zIndex, 0); } |
| 1252 |
| 1253 // zoom |
| 1254 static float initialZoom() { return 1.0f; } |
| 1255 float zoom() const { return m_visual->m_zoom; } |
| 1256 float effectiveZoom() const { return m_rareInheritedData->m_effectiveZoom; } |
| 1257 bool setZoom(float); |
| 1258 bool setEffectiveZoom(float); |
| 1259 |
| 1260 // -webkit-app-region |
| 1261 DraggableRegionMode getDraggableRegionMode() const { return m_rareNonInherit
edData->m_draggableRegionMode; } |
| 1262 void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(m_rareNonInheri
tedData, m_draggableRegionMode, v); } |
| 1263 |
| 1264 // -webkit-appearance |
| 1265 static ControlPart initialAppearance() { return NoControlPart; } |
| 1266 ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonIn
heritedData->m_appearance); } |
| 1267 void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, m_appear
ance, a); } |
| 1268 |
| 1269 // -webkit-clip-path |
| 1270 static ClipPathOperation* initialClipPath() { return 0; } |
| 1271 ClipPathOperation* clipPath() const { return m_rareNonInheritedData->m_clipP
ath.get(); } |
| 1272 void setClipPath(PassRefPtr<ClipPathOperation> operation) |
| 1273 { |
| 1274 if (m_rareNonInheritedData->m_clipPath != operation) |
| 1275 m_rareNonInheritedData.access()->m_clipPath = operation; |
| 1276 } |
| 1277 |
| 1278 // Mask properties. |
| 1279 // -webkit-mask-box-image-outset |
| 1280 const BorderImageLengthBox& maskBoxImageOutset() const { return m_rareNonInh
eritedData->m_maskBoxImage.outset(); } |
| 1281 void setMaskBoxImageOutset(const BorderImageLengthBox& outset) |
| 1282 { |
| 1283 m_rareNonInheritedData.access()->m_maskBoxImage.setOutset(outset); |
| 1284 } |
| 1285 |
| 1286 // -webkit-mask-box-image-slice |
| 1287 const LengthBox& maskBoxImageSlices() const { return m_rareNonInheritedData-
>m_maskBoxImage.imageSlices(); } |
| 1288 void setMaskBoxImageSlices(const LengthBox& slices) |
| 1289 { |
| 1290 m_rareNonInheritedData.access()->m_maskBoxImage.setImageSlices(slices); |
| 1291 } |
| 1292 |
| 1293 // -webkit-mask-box-image-source |
| 1294 static StyleImage* initialMaskBoxImageSource() { return 0; } |
| 1295 StyleImage* maskBoxImageSource() const { return m_rareNonInheritedData->m_ma
skBoxImage.image(); } |
| 1296 void setMaskBoxImageSource(StyleImage* v) { m_rareNonInheritedData.access()-
>m_maskBoxImage.setImage(v); } |
| 1297 |
| 1298 // -webkit-mask-box-image-width |
| 1299 const BorderImageLengthBox& maskBoxImageWidth() const { return m_rareNonInhe
ritedData->m_maskBoxImage.borderSlices(); } |
| 1300 void setMaskBoxImageWidth(const BorderImageLengthBox& slices) |
| 1301 { |
| 1302 m_rareNonInheritedData.access()->m_maskBoxImage.setBorderSlices(slices); |
| 1303 } |
| 1304 |
| 1305 // Inherited properties. |
| 1306 |
| 1307 // border-collapse |
| 1308 static EBorderCollapse initialBorderCollapse() { return BorderCollapseSepara
te; } |
| 1309 EBorderCollapse borderCollapse() const { return static_cast<EBorderCollapse>
(m_inheritedData.m_borderCollapse); } |
| 1310 void setBorderCollapse(EBorderCollapse collapse) { m_inheritedData.m_borderC
ollapse = collapse; } |
| 1311 |
| 1312 // Border-spacing properties. |
| 1313 // -webkit-border-horizontal-spacing |
| 1314 static short initialHorizontalBorderSpacing() { return 0; } |
| 1315 short horizontalBorderSpacing() const; |
| 1316 void setHorizontalBorderSpacing(short); |
| 1317 |
| 1318 // -webkit-border-vertical-spacing |
| 1319 static short initialVerticalBorderSpacing() { return 0; } |
| 1320 short verticalBorderSpacing() const; |
| 1321 void setVerticalBorderSpacing(short); |
| 1322 |
| 1323 // caption-side (aka -epub-caption-side) |
| 1324 static ECaptionSide initialCaptionSide() { return CaptionSideTop; } |
| 1325 ECaptionSide captionSide() const { return static_cast<ECaptionSide>(m_inheri
tedData.m_captionSide); } |
| 1326 void setCaptionSide(ECaptionSide v) { m_inheritedData.m_captionSide = v; } |
| 1327 |
| 1328 // cursor |
| 1329 static ECursor initialCursor() { return CURSOR_AUTO; } |
| 1330 ECursor cursor() const { return static_cast<ECursor>(m_inheritedData.m_curso
rStyle); } |
| 1331 void setCursor(ECursor c) { m_inheritedData.m_cursorStyle = c; } |
| 1332 |
| 1333 // direction |
| 1334 static TextDirection initialDirection() { return LTR; } |
| 1335 TextDirection direction() const { return static_cast<TextDirection>(m_inheri
tedData.m_direction); } |
| 1336 void setDirection(TextDirection v) { m_inheritedData.m_direction = v; } |
| 1337 |
| 1338 // empty-cells |
| 1339 static EEmptyCells initialEmptyCells() { return EmptyCellsShow; } |
| 1340 EEmptyCells emptyCells() const { return static_cast<EEmptyCells>(m_inherited
Data.m_emptyCells); } |
| 1341 void setEmptyCells(EEmptyCells v) { m_inheritedData.m_emptyCells = v; } |
| 1342 |
| 1343 // color |
| 1344 static Color initialColor() { return Color::black; } |
| 1345 void setColor(const Color&); |
| 1346 |
| 1347 // hyphens |
| 1348 static Hyphens initialHyphens() { return HyphensManual; } |
| 1349 Hyphens getHyphens() const { return static_cast<Hyphens>(m_rareInheritedData
->hyphens); } |
| 1350 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); } |
| 1351 |
| 1352 // -webkit-hyphenate-character |
| 1353 static const AtomicString& initialHyphenationString() { return nullAtom; } |
| 1354 const AtomicString& hyphenationString() const { return m_rareInheritedData->
hyphenationString; } |
| 1355 void setHyphenationString(const AtomicString& h) { SET_VAR(m_rareInheritedDa
ta, hyphenationString, h); } |
| 1356 |
| 1357 // line-height |
| 1358 static Length initialLineHeight() { return Length(-100.0, Percent); } |
| 1359 Length lineHeight() const; |
| 1360 void setLineHeight(const Length& specifiedLineHeight); |
| 1361 |
| 1362 // List style properties. |
| 1363 // list-style-type |
| 1364 static EListStyleType initialListStyleType() { return Disc; } |
| 1365 EListStyleType listStyleType() const { return static_cast<EListStyleType>(m_
inheritedData.m_listStyleType); } |
| 1366 void setListStyleType(EListStyleType v) { m_inheritedData.m_listStyleType =
v; } |
| 1367 |
| 1368 // list-style-position |
| 1369 static EListStylePosition initialListStylePosition() { return ListStylePosit
ionOutside; } |
| 1370 EListStylePosition listStylePosition() const { return static_cast<EListStyle
Position>(m_inheritedData.m_listStylePosition); } |
| 1371 void setListStylePosition(EListStylePosition v) { m_inheritedData.m_listStyl
ePosition = v; } |
| 1372 |
| 1373 // list-style-image |
| 1374 static StyleImage* initialListStyleImage() { return 0; } |
| 1375 StyleImage* listStyleImage() const; |
| 1376 void setListStyleImage(StyleImage*); |
| 1377 |
| 1378 // orphans |
| 1379 static short initialOrphans() { return 2; } |
| 1380 short orphans() const { return m_rareInheritedData->orphans; } |
| 1381 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); } |
| 1382 |
| 1383 // widows |
| 1384 static short initialWidows() { return 2; } |
| 1385 short widows() const { return m_rareInheritedData->widows; } |
| 1386 void setWidows(short w) { SET_VAR(m_rareInheritedData, widows, w); } |
| 1387 |
| 1388 // overflow-wrap (aka word-wrap) |
| 1389 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; } |
| 1390 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(m_rar
eInheritedData->overflowWrap); } |
| 1391 void setOverflowWrap(EOverflowWrap b) { SET_VAR(m_rareInheritedData, overflo
wWrap, b); } |
| 1392 |
| 1393 // pointer-events |
| 1394 static EPointerEvents initialPointerEvents() { return PE_AUTO; } |
| 1395 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(m_
inheritedData.m_pointerEvents); } |
| 1396 void setPointerEvents(EPointerEvents p) { m_inheritedData.m_pointerEvents =
p; } |
| 1397 |
| 1398 // quotes |
| 1399 static QuotesData* initialQuotes() { return 0; } |
| 1400 QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); } |
| 1401 void setQuotes(PassRefPtr<QuotesData>); |
| 1402 |
| 1403 // snap-height |
| 1404 uint8_t snapHeightPosition() const { return m_rareInheritedData->m_snapHeigh
tPosition; } |
| 1405 uint8_t snapHeightUnit() const { return m_rareInheritedData->m_snapHeightUni
t; } |
| 1406 void setSnapHeightPosition(uint8_t position) { SET_VAR(m_rareInheritedData,
m_snapHeightPosition, position); } |
| 1407 void setSnapHeightUnit(uint8_t unit) { SET_VAR(m_rareInheritedData, m_snapHe
ightUnit, unit); } |
| 1408 |
| 1409 // speak |
| 1410 static ESpeak initialSpeak() { return SpeakNormal; } |
| 1411 ESpeak speak() const { return static_cast<ESpeak>(m_rareInheritedData->speak
); } |
| 1412 void setSpeak(ESpeak s) { SET_VAR(m_rareInheritedData, speak, s); } |
| 1413 |
| 1414 // tab-size |
| 1415 static TabSize initialTabSize() { return TabSize(8); } |
| 1416 TabSize getTabSize() const { return m_rareInheritedData->m_tabSize; } |
| 1417 void setTabSize(TabSize size) { SET_VAR(m_rareInheritedData, m_tabSize, size
); } |
| 1418 |
| 1419 // text-align |
| 1420 static ETextAlign initialTextAlign() { return TASTART; } |
| 1421 ETextAlign textAlign() const { return static_cast<ETextAlign>(m_inheritedDat
a.m_textAlign); } |
| 1422 void setTextAlign(ETextAlign v) { m_inheritedData.m_textAlign = v; } |
| 1423 |
| 1424 // text-align-last |
| 1425 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } |
| 1426 TextAlignLast getTextAlignLast() const { return static_cast<TextAlignLast>(m
_rareInheritedData->m_textAlignLast); } |
| 1427 void setTextAlignLast(TextAlignLast v) { SET_VAR(m_rareInheritedData, m_text
AlignLast, v); } |
| 1428 |
| 1429 // text-combine-upright (aka -webkit-text-combine, -epub-text-combine) |
| 1430 static TextCombine initialTextCombine() { return TextCombineNone; } |
| 1431 TextCombine getTextCombine() const { return static_cast<TextCombine>(m_rareI
nheritedData->m_textCombine); } |
| 1432 void setTextCombine(TextCombine v) { SET_VAR(m_rareInheritedData, m_textComb
ine, v); } |
| 1433 |
| 1434 // text-indent |
| 1435 static Length initialTextIndent() { return Length(Fixed); } |
| 1436 static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine;
} |
| 1437 static TextIndentType initialTextIndentType() { return TextIndentNormal; } |
| 1438 const Length& textIndent() const { return m_rareInheritedData->indent; } |
| 1439 TextIndentLine getTextIndentLine() const { return static_cast<TextIndentLine
>(m_rareInheritedData->m_textIndentLine); } |
| 1440 TextIndentType getTextIndentType() const { return static_cast<TextIndentType
>(m_rareInheritedData->m_textIndentType); } |
| 1441 void setTextIndent(const Length& v) { SET_VAR(m_rareInheritedData, indent, v
); } |
| 1442 void setTextIndentLine(TextIndentLine v) { SET_VAR(m_rareInheritedData, m_te
xtIndentLine, v); } |
| 1443 void setTextIndentType(TextIndentType v) { SET_VAR(m_rareInheritedData, m_te
xtIndentType, v); } |
| 1444 |
| 1445 // text-justify |
| 1446 static TextJustify initialTextJustify() { return TextJustifyAuto; } |
| 1447 TextJustify getTextJustify() const { return static_cast<TextJustify>(m_rareI
nheritedData->m_textJustify); } |
| 1448 void setTextJustify(TextJustify v) { SET_VAR(m_rareInheritedData, m_textJust
ify, v); } |
| 1449 |
| 1450 // text-orientation (aka -webkit-text-orientation, -epub-text-orientation) |
| 1451 static TextOrientation initialTextOrientation() { return TextOrientationMixe
d; } |
| 1452 TextOrientation getTextOrientation() const { return static_cast<TextOrientat
ion>(m_rareInheritedData->m_textOrientation); } |
| 1453 bool setTextOrientation(TextOrientation); |
| 1454 |
| 1455 // text-shadow |
| 1456 static ShadowList* initialTextShadow() { return 0; } |
784 ShadowList* textShadow() const { return m_rareInheritedData->textShadow.get(
); } | 1457 ShadowList* textShadow() const { return m_rareInheritedData->textShadow.get(
); } |
785 | 1458 void setTextShadow(PassRefPtr<ShadowList>); |
| 1459 |
| 1460 // text-size-adjust (aka -webkit-text-size-adjust) |
| 1461 static TextSizeAdjust initialTextSizeAdjust() { return TextSizeAdjust::adjus
tAuto(); } |
| 1462 TextSizeAdjust getTextSizeAdjust() const { return m_rareInheritedData->m_tex
tSizeAdjust; } |
| 1463 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) { SET_VAR(m_rareInheritedD
ata, m_textSizeAdjust, sizeAdjust); } |
| 1464 |
| 1465 // text-transform (aka -epub-text-transform) |
| 1466 static ETextTransform initialTextTransform() { return TTNONE; } |
| 1467 ETextTransform textTransform() const { return static_cast<ETextTransform>(m_
inheritedData.m_textTransform); } |
| 1468 void setTextTransform(ETextTransform v) { m_inheritedData.m_textTransform =
v; } |
| 1469 |
| 1470 // visibility |
| 1471 static EVisibility initialVisibility() { return VISIBLE; } |
| 1472 EVisibility visibility() const { return static_cast<EVisibility>(m_inherited
Data.m_visibility); } |
| 1473 void setVisibility(EVisibility v) { m_inheritedData.m_visibility = v; } |
| 1474 |
| 1475 // white-space inherited |
| 1476 static EWhiteSpace initialWhiteSpace() { return NORMAL; } |
| 1477 EWhiteSpace whiteSpace() const { return static_cast<EWhiteSpace>(m_inherited
Data.m_whiteSpace); } |
| 1478 void setWhiteSpace(EWhiteSpace v) { m_inheritedData.m_whiteSpace = v; } |
| 1479 |
| 1480 // word-break inherited (aka -epub-word-break) |
| 1481 static EWordBreak initialWordBreak() { return NormalWordBreak; } |
| 1482 EWordBreak wordBreak() const { return static_cast<EWordBreak>(m_rareInherite
dData->wordBreak); } |
| 1483 void setWordBreak(EWordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, b)
; } |
| 1484 |
| 1485 // -webkit-line-break |
| 1486 static LineBreak initialLineBreak() { return LineBreakAuto; } |
| 1487 LineBreak getLineBreak() const { return static_cast<LineBreak>(m_rareInherit
edData->lineBreak); } |
| 1488 void setLineBreak(LineBreak b) { SET_VAR(m_rareInheritedData, lineBreak, b);
} |
| 1489 |
| 1490 // writing-mode (aka -webkit-writing-mode, -epub-writing-mode) |
| 1491 static WritingMode initialWritingMode() { return TopToBottomWritingMode; } |
| 1492 WritingMode getWritingMode() const { return static_cast<WritingMode>(m_inher
itedData.m_writingMode); } |
| 1493 bool setWritingMode(WritingMode v) |
| 1494 { |
| 1495 if (v == getWritingMode()) |
| 1496 return false; |
| 1497 |
| 1498 m_inheritedData.m_writingMode = v; |
| 1499 return true; |
| 1500 } |
| 1501 |
| 1502 // Text emphasis properties. |
| 1503 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillF
illed; } |
| 1504 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkN
one; } |
| 1505 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom
; } |
| 1506 TextEmphasisFill getTextEmphasisFill() const { return static_cast<TextEmphas
isFill>(m_rareInheritedData->textEmphasisFill); } |
| 1507 TextEmphasisMark getTextEmphasisMark() const; |
| 1508 const AtomicString& textEmphasisCustomMark() const { return m_rareInheritedD
ata->textEmphasisCustomMark; } |
| 1509 const AtomicString& textEmphasisMarkString() const; |
| 1510 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(m_rareInheritedDat
a, textEmphasisFill, fill); } |
| 1511 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(m_rareInheritedDat
a, textEmphasisMark, mark); } |
| 1512 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(m_rareInh
eritedData, textEmphasisCustomMark, mark); } |
| 1513 |
| 1514 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) |
| 1515 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareI
nheritedData, textEmphasisColor, setTextEmphasisColor, c); } |
| 1516 |
| 1517 // -webkit-text-emphasis-position |
| 1518 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmpha
sisPositionOver; } |
| 1519 TextEmphasisPosition getTextEmphasisPosition() const { return static_cast<Te
xtEmphasisPosition>(m_rareInheritedData->textEmphasisPosition); } |
| 1520 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(m_rare
InheritedData, textEmphasisPosition, position); } |
| 1521 |
| 1522 // -webkit-box-direction |
| 1523 static EBoxDirection initialBoxDirection() { return BNORMAL; } |
| 1524 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(m_inh
eritedData.m_boxDirection); } |
| 1525 void setBoxDirection(EBoxDirection d) { m_inheritedData.m_boxDirection = d;
} |
| 1526 |
| 1527 // -webkit-highlight |
| 1528 static const AtomicString& initialHighlight() { return nullAtom; } |
| 1529 const AtomicString& highlight() const { return m_rareInheritedData->highligh
t; } |
| 1530 void setHighlight(const AtomicString& h) { SET_VAR(m_rareInheritedData, high
light, h); } |
| 1531 |
| 1532 // -webkit-line-clamp |
| 1533 static LineClampValue initialLineClamp() { return LineClampValue(); } |
| 1534 const LineClampValue& lineClamp() const { return m_rareNonInheritedData->lin
eClamp; } |
| 1535 void setLineClamp(LineClampValue c) { SET_VAR(m_rareNonInheritedData, lineCl
amp, c); } |
| 1536 |
| 1537 // -webkit-print-color-adjust |
| 1538 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustE
conomy; } |
| 1539 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor
Adjust>(m_inheritedData.m_printColorAdjust); } |
| 1540 void setPrintColorAdjust(PrintColorAdjust value) { m_inheritedData.m_printCo
lorAdjust = value; } |
| 1541 |
| 1542 // -webkit-rtl-ordering |
| 1543 static Order initialRTLOrdering() { return LogicalOrder; } |
| 1544 Order rtlOrdering() const { return static_cast<Order>(m_inheritedData.m_rtlO
rdering); } |
| 1545 void setRTLOrdering(Order o) { m_inheritedData.m_rtlOrdering = o; } |
| 1546 |
| 1547 // -webkit-ruby-position |
| 1548 static RubyPosition initialRubyPosition() { return RubyPositionBefore; } |
| 1549 RubyPosition getRubyPosition() const { return static_cast<RubyPosition>(m_ra
reInheritedData->m_rubyPosition); } |
| 1550 void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, m
_rubyPosition, position); } |
| 1551 |
| 1552 // -webkit-tap-highlight-color |
| 1553 static Color initialTapHighlightColor(); |
| 1554 Color tapHighlightColor() const { return m_rareInheritedData->tapHighlightCo
lor; } |
| 1555 void setTapHighlightColor(const Color& c) { SET_VAR(m_rareInheritedData, tap
HighlightColor, c); } |
| 1556 |
| 1557 // -webkit-text-fill-color |
| 1558 void setTextFillColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareInher
itedData, textFillColor, setTextFillColor, c); } |
| 1559 |
| 1560 // -webkit-text-security |
| 1561 static ETextSecurity initialTextSecurity() { return TSNONE; } |
| 1562 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(m_rar
eInheritedData->textSecurity); } |
| 1563 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(m_rareInheritedD
ata, textSecurity, aTextSecurity); } |
| 1564 |
| 1565 // -webkit-text-stroke-color |
| 1566 void setTextStrokeColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareInh
eritedData, textStrokeColor, setTextStrokeColor, c); } |
| 1567 |
| 1568 // -webkit-text-stroke-width |
| 1569 static float initialTextStrokeWidth() { return 0; } |
786 float textStrokeWidth() const { return m_rareInheritedData->textStrokeWidth;
} | 1570 float textStrokeWidth() const { return m_rareInheritedData->textStrokeWidth;
} |
787 float opacity() const { return m_rareNonInheritedData->opacity; } | 1571 void setTextStrokeWidth(float w) { SET_VAR(m_rareInheritedData, textStrokeWi
dth, w); } |
788 bool hasOpacity() const { return opacity() < 1.0f; } | 1572 |
789 ControlPart appearance() const { return static_cast<ControlPart>(m_rareNonIn
heritedData->m_appearance); } | 1573 // -webkit-user-drag |
790 EBoxAlignment boxAlign() const { return static_cast<EBoxAlignment>(m_rareNon
InheritedData->m_deprecatedFlexibleBox->align); } | 1574 static EUserDrag initialUserDrag() { return DRAG_AUTO; } |
791 EBoxDirection boxDirection() const { return static_cast<EBoxDirection>(m_inh
eritedData.m_boxDirection); } | 1575 EUserDrag userDrag() const { return static_cast<EUserDrag>(m_rareNonInherite
dData->userDrag); } |
792 float boxFlex() const { return m_rareNonInheritedData->m_deprecatedFlexibleB
ox->flex; } | 1576 void setUserDrag(EUserDrag d) { SET_VAR(m_rareNonInheritedData, userDrag, d)
; } |
793 unsigned boxFlexGroup() const { return m_rareNonInheritedData->m_deprecatedF
lexibleBox->flexGroup; } | 1577 |
794 EBoxLines boxLines() const { return static_cast<EBoxLines>(m_rareNonInherite
dData->m_deprecatedFlexibleBox->lines); } | 1578 // -webkit-user-modify |
795 unsigned boxOrdinalGroup() const { return m_rareNonInheritedData->m_deprecat
edFlexibleBox->ordinalGroup; } | 1579 static EUserModify initialUserModify() { return READ_ONLY; } |
796 EBoxOrient boxOrient() const { return static_cast<EBoxOrient>(m_rareNonInher
itedData->m_deprecatedFlexibleBox->orient); } | 1580 EUserModify userModify() const { return static_cast<EUserModify>(m_rareInher
itedData->userModify); } |
797 EBoxPack boxPack() const { return static_cast<EBoxPack>(m_rareNonInheritedDa
ta->m_deprecatedFlexibleBox->pack); } | 1581 void setUserModify(EUserModify u) { SET_VAR(m_rareInheritedData, userModify,
u); } |
798 | 1582 |
799 int order() const { return m_rareNonInheritedData->m_order; } | 1583 // -webkit-user-select |
| 1584 static EUserSelect initialUserSelect() { return SELECT_TEXT; } |
| 1585 EUserSelect userSelect() const { return static_cast<EUserSelect>(m_rareInher
itedData->userSelect); } |
| 1586 void setUserSelect(EUserSelect s) { SET_VAR(m_rareInheritedData, userSelect,
s); } |
| 1587 |
| 1588 // Font properties. |
| 1589 const Font& font() const; |
| 1590 void setFont(const Font&); |
| 1591 const FontMetrics& getFontMetrics() const; |
| 1592 const FontDescription& getFontDescription() const; |
| 1593 bool setFontDescription(const FontDescription&); |
| 1594 |
| 1595 // font-size |
| 1596 int fontSize() const; |
| 1597 float specifiedFontSize() const; |
| 1598 float computedFontSize() const; |
| 1599 |
| 1600 // font-size-adjust |
| 1601 float fontSizeAdjust() const; |
| 1602 bool hasFontSizeAdjust() const; |
| 1603 |
| 1604 // font-weight |
| 1605 FontWeight fontWeight() const; |
| 1606 |
| 1607 // font-stretch |
| 1608 FontStretch fontStretch() const; |
| 1609 |
| 1610 // -webkit-locale |
| 1611 const AtomicString& locale() const { return LayoutLocale::localeString(getFo
ntDescription().locale()); } |
| 1612 |
| 1613 // FIXME: Remove letter-spacing/word-spacing and replace them with respectiv
e FontBuilder calls. |
| 1614 // letter-spacing |
| 1615 static float initialLetterWordSpacing() { return 0.0f; } |
| 1616 float letterSpacing() const; |
| 1617 void setLetterSpacing(float); |
| 1618 |
| 1619 // word-spacing |
| 1620 float wordSpacing() const; |
| 1621 void setWordSpacing(float); |
| 1622 |
| 1623 // SVG properties. |
| 1624 const SVGComputedStyle& svgStyle() const { return *m_svgStyle.get(); } |
| 1625 SVGComputedStyle& accessSVGStyle() { return *m_svgStyle.access(); } |
| 1626 |
| 1627 // baseline-shift |
| 1628 EBaselineShift baselineShift() const { return svgStyle().baselineShift(); } |
| 1629 const Length& baselineShiftValue() const { return svgStyle().baselineShiftVa
lue(); } |
| 1630 void setBaselineShiftValue(const Length& value) |
| 1631 { |
| 1632 SVGComputedStyle& svgStyle = accessSVGStyle(); |
| 1633 svgStyle.setBaselineShift(BS_LENGTH); |
| 1634 svgStyle.setBaselineShiftValue(value); |
| 1635 } |
| 1636 |
| 1637 // cx |
| 1638 void setCx(const Length& cx) { accessSVGStyle().setCx(cx); } |
| 1639 |
| 1640 // cy |
| 1641 void setCy(const Length& cy) { accessSVGStyle().setCy(cy); } |
| 1642 |
| 1643 // d |
| 1644 void setD(PassRefPtr<StylePath> d) { accessSVGStyle().setD(d); } |
| 1645 |
| 1646 // x |
| 1647 void setX(const Length& x) { accessSVGStyle().setX(x); } |
| 1648 |
| 1649 // y |
| 1650 void setY(const Length& y) { accessSVGStyle().setY(y); } |
| 1651 |
| 1652 // r |
| 1653 void setR(const Length& r) { accessSVGStyle().setR(r); } |
| 1654 |
| 1655 // rx |
| 1656 void setRx(const Length& rx) { accessSVGStyle().setRx(rx); } |
| 1657 |
| 1658 // ry |
| 1659 void setRy(const Length& ry) { accessSVGStyle().setRy(ry); } |
| 1660 |
| 1661 // fill-opacity |
| 1662 float fillOpacity() const { return svgStyle().fillOpacity(); } |
| 1663 void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); } |
| 1664 |
| 1665 // Fill utiltiy functions. |
| 1666 const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(
); } |
| 1667 Color fillPaintColor() const { return svgStyle().fillPaintColor(); } |
| 1668 |
| 1669 // stop-color |
| 1670 void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); } |
| 1671 |
| 1672 // flood-color |
| 1673 void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); } |
| 1674 |
| 1675 // lighting-color |
| 1676 void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c)
; } |
| 1677 |
| 1678 // flood-opacity |
| 1679 float floodOpacity() const { return svgStyle().floodOpacity(); } |
| 1680 void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); } |
| 1681 |
| 1682 // stop-opacity |
| 1683 float stopOpacity() const { return svgStyle().stopOpacity(); } |
| 1684 void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); } |
| 1685 |
| 1686 // stroke |
| 1687 const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintT
ype(); } |
| 1688 Color strokePaintColor() const { return svgStyle().strokePaintColor(); } |
| 1689 |
| 1690 // stroke-dasharray |
| 1691 SVGDashArray* strokeDashArray() const { return svgStyle().strokeDashArray();
} |
| 1692 void setStrokeDashArray(PassRefPtr<SVGDashArray> array) { accessSVGStyle().s
etStrokeDashArray(array); } |
| 1693 |
| 1694 // stroke-dashoffset |
| 1695 const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(
); } |
| 1696 void setStrokeDashOffset(const Length& d) { accessSVGStyle().setStrokeDashOf
fset(d); } |
| 1697 |
| 1698 // stroke-miterlimit |
| 1699 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); } |
| 1700 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f);
} |
| 1701 |
| 1702 // stroke-opacity |
| 1703 float strokeOpacity() const { return svgStyle().strokeOpacity(); } |
| 1704 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } |
| 1705 |
| 1706 // stroke-width |
| 1707 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth();
} |
| 1708 void setStrokeWidth(const UnzoomedLength& w) { accessSVGStyle().setStrokeWid
th(w); } |
| 1709 |
| 1710 // Comparison operators |
| 1711 bool operator==(const ComputedStyle& other) const; |
| 1712 bool operator!=(const ComputedStyle& other) const { return !(*this == other)
; } |
| 1713 |
| 1714 bool inheritedEqual(const ComputedStyle&) const; |
| 1715 bool nonInheritedEqual(const ComputedStyle&) const; |
| 1716 bool loadingCustomFontsEqual(const ComputedStyle&) const; |
| 1717 bool inheritedDataShared(const ComputedStyle&) const; |
| 1718 |
| 1719 bool hasChildDependentFlags() const { return emptyState() || hasExplicitlyIn
heritedProperties(); } |
| 1720 void copyChildDependentFlagsFrom(const ComputedStyle&); |
| 1721 |
| 1722 // Counters. |
| 1723 const CounterDirectiveMap* counterDirectives() const; |
| 1724 CounterDirectiveMap& accessCounterDirectives(); |
| 1725 const CounterDirectives getCounterDirectives(const AtomicString& identifier)
const; |
| 1726 void clearIncrementDirectives(); |
| 1727 void clearResetDirectives(); |
| 1728 |
| 1729 // Variables. |
| 1730 static StyleVariableData* initialVariables() { return nullptr; } |
| 1731 StyleVariableData* variables() const; |
| 1732 void setVariable(const AtomicString&, PassRefPtr<CSSVariableData>); |
| 1733 void removeVariable(const AtomicString&); |
| 1734 void setHasVariableReferenceFromNonInheritedProperty() { m_nonInheritedData.
m_variableReference = true; } |
| 1735 bool hasVariableReferenceFromNonInheritedProperty() const { return m_nonInhe
ritedData.m_variableReference; } |
| 1736 |
| 1737 // Animations. |
| 1738 CSSAnimationData& accessAnimations(); |
| 1739 const CSSAnimationData* animations() const { return m_rareNonInheritedData->
m_animations.get(); } |
| 1740 |
| 1741 // Transitions. |
| 1742 const CSSTransitionData* transitions() const { return m_rareNonInheritedData
->m_transitions.get(); } |
| 1743 CSSTransitionData& accessTransitions(); |
| 1744 |
| 1745 // Callback selectors. |
800 const Vector<String>& callbackSelectors() const { return m_rareNonInheritedD
ata->m_callbackSelectors; } | 1746 const Vector<String>& callbackSelectors() const { return m_rareNonInheritedD
ata->m_callbackSelectors; } |
801 float flexGrow() const { return m_rareNonInheritedData->m_flexibleBox->m_fle
xGrow; } | 1747 void addCallbackSelector(const String& selector); |
802 float flexShrink() const { return m_rareNonInheritedData->m_flexibleBox->m_f
lexShrink; } | 1748 |
803 const Length& flexBasis() const { return m_rareNonInheritedData->m_flexibleB
ox->m_flexBasis; } | 1749 // Non-property flags. |
804 const StyleContentAlignmentData& alignContent() const { return m_rareNonInhe
ritedData->m_alignContent; } | 1750 bool hasViewportUnits() const { return m_nonInheritedData.m_hasViewportUnits
; } |
805 ContentPosition alignContentPosition() const { return m_rareNonInheritedData
->m_alignContent.position(); } | 1751 void setHasViewportUnits(bool hasViewportUnits = true) const { m_nonInherite
dData.m_hasViewportUnits = hasViewportUnits; } |
806 ContentDistributionType alignContentDistribution() const { return m_rareNonI
nheritedData->m_alignContent.distribution(); } | 1752 |
807 OverflowAlignment alignContentOverflowAlignment() const { return m_rareNonIn
heritedData->m_alignContent.overflow(); } | 1753 bool hasRemUnits() const { return m_nonInheritedData.m_hasRemUnits; } |
808 const StyleSelfAlignmentData& alignItems() const { return m_rareNonInherited
Data->m_alignItems; } | 1754 void setHasRemUnits() const { m_nonInheritedData.m_hasRemUnits = true; } |
809 ItemPosition alignItemsPosition() const { return m_rareNonInheritedData->m_a
lignItems.position(); } | 1755 |
810 OverflowAlignment alignItemsOverflowAlignment() const { return m_rareNonInhe
ritedData->m_alignItems.overflow(); } | 1756 bool affectedByFocus() const { return m_nonInheritedData.m_affectedByFocus;
} |
811 const StyleSelfAlignmentData& alignSelf() const { return m_rareNonInheritedD
ata->m_alignSelf; } | 1757 void setAffectedByFocus() { m_nonInheritedData.m_affectedByFocus = true; } |
812 ItemPosition alignSelfPosition() const { return m_rareNonInheritedData->m_al
ignSelf.position(); } | 1758 |
813 OverflowAlignment alignSelfOverflowAlignment() const { return m_rareNonInher
itedData->m_alignSelf.overflow(); } | 1759 bool affectedByHover() const { return m_nonInheritedData.m_affectedByHover;
} |
814 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(m_
rareNonInheritedData->m_flexibleBox->m_flexDirection); } | 1760 void setAffectedByHover() { m_nonInheritedData.m_affectedByHover = true; } |
| 1761 |
| 1762 bool affectedByActive() const { return m_nonInheritedData.m_affectedByActive
; } |
| 1763 void setAffectedByActive() { m_nonInheritedData.m_affectedByActive = true; } |
| 1764 |
| 1765 bool affectedByDrag() const { return m_nonInheritedData.m_affectedByDrag; } |
| 1766 void setAffectedByDrag() { m_nonInheritedData.m_affectedByDrag = true; } |
| 1767 |
| 1768 bool emptyState() const { return m_nonInheritedData.m_emptyState; } |
| 1769 void setEmptyState(bool b) { setUnique(); m_nonInheritedData.m_emptyState =
b; } |
| 1770 |
| 1771 bool hasInlineTransform() const { return m_rareNonInheritedData->m_hasInline
Transform; } |
| 1772 void setHasInlineTransform(bool b) { SET_VAR(m_rareNonInheritedData, m_hasIn
lineTransform, b); } |
| 1773 |
| 1774 bool hasCompositorProxy() const { return m_rareNonInheritedData->m_hasCompos
itorProxy; } |
| 1775 void setHasCompositorProxy(bool b) { SET_VAR(m_rareNonInheritedData, m_hasCo
mpositorProxy, b); } |
| 1776 |
| 1777 bool isLink() const { return m_nonInheritedData.m_isLink; } |
| 1778 void setIsLink(bool b) { m_nonInheritedData.m_isLink = b; } |
| 1779 |
| 1780 EInsideLink insideLink() const { return static_cast<EInsideLink>(m_inherited
Data.m_insideLink); } |
| 1781 void setInsideLink(EInsideLink insideLink) { m_inheritedData.m_insideLink =
insideLink; } |
| 1782 |
| 1783 bool hasExplicitlyInheritedProperties() const { return m_nonInheritedData.m_
explicitInheritance; } |
| 1784 void setHasExplicitlyInheritedProperties() { m_nonInheritedData.m_explicitIn
heritance = true; } |
| 1785 |
| 1786 bool requiresAcceleratedCompositingForExternalReasons(bool b) { return m_rar
eNonInheritedData->m_requiresAcceleratedCompositingForExternalReasons; } |
| 1787 void setRequiresAcceleratedCompositingForExternalReasons(bool b) { SET_VAR(m
_rareNonInheritedData, m_requiresAcceleratedCompositingForExternalReasons, b); } |
| 1788 |
| 1789 bool hasAuthorBackground() const { return m_rareNonInheritedData->m_hasAutho
rBackground; }; |
| 1790 void setHasAuthorBackground(bool authorBackground) { SET_VAR(m_rareNonInheri
tedData, m_hasAuthorBackground, authorBackground); } |
| 1791 |
| 1792 bool hasAuthorBorder() const { return m_rareNonInheritedData->m_hasAuthorBor
der; }; |
| 1793 void setHasAuthorBorder(bool authorBorder) { SET_VAR(m_rareNonInheritedData,
m_hasAuthorBorder, authorBorder); } |
| 1794 |
| 1795 // A stacking context is painted atomically and defines a stacking order, wh
ereas |
| 1796 // a containing stacking context defines in which order the stacking context
s |
| 1797 // below are painted. |
| 1798 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor
e details. |
| 1799 bool isStackingContext() const { return m_rareNonInheritedData->m_isStacking
Context; } |
| 1800 void setIsStackingContext(bool b) { SET_VAR(m_rareNonInheritedData, m_isStac
kingContext, b); } |
| 1801 |
| 1802 // A unique style is one that has matches something that makes it impossible
to share. |
| 1803 bool unique() const { return m_nonInheritedData.m_unique; } |
| 1804 void setUnique() { m_nonInheritedData.m_unique = true; } |
| 1805 |
| 1806 float textAutosizingMultiplier() const { return m_styleInheritedData->textAu
tosizingMultiplier; } |
| 1807 void setTextAutosizingMultiplier(float); |
| 1808 |
| 1809 bool selfOrAncestorHasDirAutoAttribute() const { return m_rareInheritedData-
>m_selfOrAncestorHasDirAutoAttribute; } |
| 1810 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(m_rareInheritedD
ata, m_selfOrAncestorHasDirAutoAttribute, v); } |
| 1811 |
| 1812 // Animation flags. |
| 1813 bool hasCurrentOpacityAnimation() const { return m_rareNonInheritedData->m_h
asCurrentOpacityAnimation; } |
| 1814 void setHasCurrentOpacityAnimation(bool b = true) { SET_VAR(m_rareNonInherit
edData, m_hasCurrentOpacityAnimation, b); } |
| 1815 |
| 1816 bool hasCurrentTransformAnimation() const { return m_rareNonInheritedData->m
_hasCurrentTransformAnimation; } |
| 1817 void setHasCurrentTransformAnimation(bool b = true) { SET_VAR(m_rareNonInher
itedData, m_hasCurrentTransformAnimation, b); } |
| 1818 |
| 1819 bool hasCurrentFilterAnimation() const { return m_rareNonInheritedData->m_ha
sCurrentFilterAnimation; } |
| 1820 void setHasCurrentFilterAnimation(bool b = true) { SET_VAR(m_rareNonInherite
dData, m_hasCurrentFilterAnimation, b); } |
| 1821 |
| 1822 bool hasCurrentBackdropFilterAnimation() const { return m_rareNonInheritedDa
ta->m_hasCurrentBackdropFilterAnimation; } |
| 1823 void setHasCurrentBackdropFilterAnimation(bool b = true) { SET_VAR(m_rareNon
InheritedData, m_hasCurrentBackdropFilterAnimation, b); } |
| 1824 |
| 1825 bool isRunningOpacityAnimationOnCompositor() const { return m_rareNonInherit
edData->m_runningOpacityAnimationOnCompositor; } |
| 1826 void setIsRunningOpacityAnimationOnCompositor(bool b = true) { SET_VAR(m_rar
eNonInheritedData, m_runningOpacityAnimationOnCompositor, b); } |
| 1827 |
| 1828 bool isRunningTransformAnimationOnCompositor() const { return m_rareNonInher
itedData->m_runningTransformAnimationOnCompositor; } |
| 1829 void setIsRunningTransformAnimationOnCompositor(bool b = true) { SET_VAR(m_r
areNonInheritedData, m_runningTransformAnimationOnCompositor, b); } |
| 1830 |
| 1831 bool isRunningFilterAnimationOnCompositor() const { return m_rareNonInherite
dData->m_runningFilterAnimationOnCompositor; } |
| 1832 void setIsRunningFilterAnimationOnCompositor(bool b = true) { SET_VAR(m_rare
NonInheritedData, m_runningFilterAnimationOnCompositor, b); } |
| 1833 |
| 1834 bool isRunningBackdropFilterAnimationOnCompositor() const { return m_rareNon
InheritedData->m_runningBackdropFilterAnimationOnCompositor; } |
| 1835 void setIsRunningBackdropFilterAnimationOnCompositor(bool b = true) { SET_VA
R(m_rareNonInheritedData, m_runningBackdropFilterAnimationOnCompositor, b); } |
| 1836 |
| 1837 // Column utility functions. |
| 1838 void clearMultiCol(); |
| 1839 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColu
mnWidth(); } |
| 1840 bool columnRuleIsTransparent() const { return m_rareNonInheritedData->m_mult
iCol->m_rule.isTransparent(); } |
| 1841 bool columnRuleEquivalent(const ComputedStyle* otherStyle) const; |
| 1842 void inheritColumnPropertiesFrom(const ComputedStyle& parent) { m_rareNonInh
eritedData.access()->m_multiCol = parent.m_rareNonInheritedData->m_multiCol; } |
| 1843 |
| 1844 // Flex utility functions. |
815 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn ||
flexDirection() == FlowColumnReverse; } | 1845 bool isColumnFlexDirection() const { return flexDirection() == FlowColumn ||
flexDirection() == FlowColumnReverse; } |
816 bool isReverseFlexDirection() const { return flexDirection() == FlowRowRever
se || flexDirection() == FlowColumnReverse; } | 1846 bool isReverseFlexDirection() const { return flexDirection() == FlowRowRever
se || flexDirection() == FlowColumnReverse; } |
817 EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(m_rareNonInherite
dData->m_flexibleBox->m_flexWrap); } | 1847 bool hasBoxReflect() const { return boxReflect(); } |
818 const StyleContentAlignmentData& justifyContent() const { return m_rareNonIn
heritedData->m_justifyContent; } | 1848 bool reflectionDataEquivalent(const ComputedStyle* otherStyle) const { retur
n m_rareNonInheritedData->reflectionDataEquivalent(*otherStyle->m_rareNonInherit
edData); } |
819 ContentPosition justifyContentPosition() const { return m_rareNonInheritedDa
ta->m_justifyContent.position(); } | 1849 |
820 ContentDistributionType justifyContentDistribution() const { return m_rareNo
nInheritedData->m_justifyContent.distribution(); } | 1850 // Mask utility functions. |
821 OverflowAlignment justifyContentOverflowAlignment() const { return m_rareNon
InheritedData->m_justifyContent.overflow(); } | 1851 bool hasMask() const { return m_rareNonInheritedData->m_mask.hasImage() || m
_rareNonInheritedData->m_maskBoxImage.hasImage(); } |
822 const StyleSelfAlignmentData& justifyItems() const { return m_rareNonInherit
edData->m_justifyItems; } | 1852 StyleImage* maskImage() const { return m_rareNonInheritedData->m_mask.image(
); } |
823 ItemPosition justifyItemsPosition() const { return m_rareNonInheritedData->m
_justifyItems.position(); } | 1853 FillLayer& accessMaskLayers() { return m_rareNonInheritedData.access()->m_ma
sk; } |
824 OverflowAlignment justifyItemsOverflowAlignment() const { return m_rareNonIn
heritedData->m_justifyItems.overflow(); } | 1854 const FillLayer& maskLayers() const { return m_rareNonInheritedData->m_mask;
} |
825 ItemPositionType justifyItemsPositionType() const { return m_rareNonInherite
dData->m_justifyItems.positionType(); } | 1855 const NinePieceImage& maskBoxImage() const { return m_rareNonInheritedData->
m_maskBoxImage; } |
826 const StyleSelfAlignmentData& justifySelf() const { return m_rareNonInherite
dData->m_justifySelf; } | 1856 bool maskBoxImageSlicesFill() const { return m_rareNonInheritedData->m_maskB
oxImage.fill(); } |
827 ItemPosition justifySelfPosition() const { return m_rareNonInheritedData->m_
justifySelf.position(); } | 1857 void adjustMaskLayers() |
828 OverflowAlignment justifySelfOverflowAlignment() const { return m_rareNonInh
eritedData->m_justifySelf.overflow(); } | 1858 { |
829 | 1859 if (maskLayers().next()) { |
830 const Vector<GridTrackSize>& gridTemplateColumns() const { return m_rareNonI
nheritedData->m_grid->m_gridTemplateColumns; } | 1860 accessMaskLayers().cullEmptyLayers(); |
831 const Vector<GridTrackSize>& gridTemplateRows() const { return m_rareNonInhe
ritedData->m_grid->m_gridTemplateRows; } | 1861 accessMaskLayers().fillUnsetProperties(); |
| 1862 } |
| 1863 } |
| 1864 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(m_rareNonInheritedDa
ta, m_maskBoxImage, b); } |
| 1865 void setMaskBoxImageSlicesFill(bool fill) |
| 1866 { |
| 1867 m_rareNonInheritedData.access()->m_maskBoxImage.setFill(fill); |
| 1868 } |
| 1869 |
| 1870 // Text-combine utility functions. |
| 1871 bool hasTextCombine() const { return getTextCombine() != TextCombineNone; } |
| 1872 |
| 1873 // Grid utility functions. |
832 const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return m_rareNo
nInheritedData->m_grid->m_gridAutoRepeatColumns; } | 1874 const Vector<GridTrackSize>& gridAutoRepeatColumns() const { return m_rareNo
nInheritedData->m_grid->m_gridAutoRepeatColumns; } |
833 const Vector<GridTrackSize>& gridAutoRepeatRows() const { return m_rareNonIn
heritedData->m_grid->m_gridAutoRepeatRows; } | 1875 const Vector<GridTrackSize>& gridAutoRepeatRows() const { return m_rareNonIn
heritedData->m_grid->m_gridAutoRepeatRows; } |
834 size_t gridAutoRepeatColumnsInsertionPoint() const { return m_rareNonInherit
edData->m_grid->m_autoRepeatColumnsInsertionPoint; } | 1876 size_t gridAutoRepeatColumnsInsertionPoint() const { return m_rareNonInherit
edData->m_grid->m_autoRepeatColumnsInsertionPoint; } |
835 size_t gridAutoRepeatRowsInsertionPoint() const { return m_rareNonInheritedD
ata->m_grid->m_autoRepeatRowsInsertionPoint; } | 1877 size_t gridAutoRepeatRowsInsertionPoint() const { return m_rareNonInheritedD
ata->m_grid->m_autoRepeatRowsInsertionPoint; } |
836 AutoRepeatType gridAutoRepeatColumnsType() const { return m_rareNonInherite
dData->m_grid->m_autoRepeatColumnsType; } | 1878 AutoRepeatType gridAutoRepeatColumnsType() const { return m_rareNonInherite
dData->m_grid->m_autoRepeatColumnsType; } |
837 AutoRepeatType gridAutoRepeatRowsType() const { return m_rareNonInheritedDa
ta->m_grid->m_autoRepeatRowsType; } | 1879 AutoRepeatType gridAutoRepeatRowsType() const { return m_rareNonInheritedDa
ta->m_grid->m_autoRepeatRowsType; } |
838 const NamedGridLinesMap& namedGridColumnLines() const { return m_rareNonInhe
ritedData->m_grid->m_namedGridColumnLines; } | 1880 const NamedGridLinesMap& namedGridColumnLines() const { return m_rareNonInhe
ritedData->m_grid->m_namedGridColumnLines; } |
839 const NamedGridLinesMap& namedGridRowLines() const { return m_rareNonInherit
edData->m_grid->m_namedGridRowLines; } | 1881 const NamedGridLinesMap& namedGridRowLines() const { return m_rareNonInherit
edData->m_grid->m_namedGridRowLines; } |
840 const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return m_
rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; } | 1882 const OrderedNamedGridLines& orderedNamedGridColumnLines() const { return m_
rareNonInheritedData->m_grid->m_orderedNamedGridColumnLines; } |
841 const OrderedNamedGridLines& orderedNamedGridRowLines() const { return m_rar
eNonInheritedData->m_grid->m_orderedNamedGridRowLines; } | 1883 const OrderedNamedGridLines& orderedNamedGridRowLines() const { return m_rar
eNonInheritedData->m_grid->m_orderedNamedGridRowLines; } |
842 const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return m_r
areNonInheritedData->m_grid->m_autoRepeatNamedGridColumnLines; } | 1884 const NamedGridLinesMap& autoRepeatNamedGridColumnLines() const { return m_r
areNonInheritedData->m_grid->m_autoRepeatNamedGridColumnLines; } |
843 const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return m_rare
NonInheritedData->m_grid->m_autoRepeatNamedGridRowLines; } | 1885 const NamedGridLinesMap& autoRepeatNamedGridRowLines() const { return m_rare
NonInheritedData->m_grid->m_autoRepeatNamedGridRowLines; } |
844 const OrderedNamedGridLines& autoRepeatOrderedNamedGridColumnLines() const {
return m_rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridColumnLines;
} | 1886 const OrderedNamedGridLines& autoRepeatOrderedNamedGridColumnLines() const {
return m_rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridColumnLines;
} |
845 const OrderedNamedGridLines& autoRepeatOrderedNamedGridRowLines() const { re
turn m_rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridRowLines; } | 1887 const OrderedNamedGridLines& autoRepeatOrderedNamedGridRowLines() const { re
turn m_rareNonInheritedData->m_grid->m_autoRepeatOrderedNamedGridRowLines; } |
846 const NamedGridAreaMap& namedGridArea() const { return m_rareNonInheritedDat
a->m_grid->m_namedGridArea; } | 1888 const NamedGridAreaMap& namedGridArea() const { return m_rareNonInheritedDat
a->m_grid->m_namedGridArea; } |
847 size_t namedGridAreaRowCount() const { return m_rareNonInheritedData->m_grid
->m_namedGridAreaRowCount; } | 1889 size_t namedGridAreaRowCount() const { return m_rareNonInheritedData->m_grid
->m_namedGridAreaRowCount; } |
848 size_t namedGridAreaColumnCount() const { return m_rareNonInheritedData->m_g
rid->m_namedGridAreaColumnCount; } | 1890 size_t namedGridAreaColumnCount() const { return m_rareNonInheritedData->m_g
rid->m_namedGridAreaColumnCount; } |
849 GridAutoFlow getGridAutoFlow() const { return static_cast<GridAutoFlow>(m_ra
reNonInheritedData->m_grid->m_gridAutoFlow); } | 1891 GridAutoFlow getGridAutoFlow() const { return static_cast<GridAutoFlow>(m_ra
reNonInheritedData->m_grid->m_gridAutoFlow); } |
850 bool isGridAutoFlowDirectionRow() const { return (m_rareNonInheritedData->m_
grid->m_gridAutoFlow & InternalAutoFlowDirectionRow) == InternalAutoFlowDirectio
nRow; } | 1892 bool isGridAutoFlowDirectionRow() const { return (m_rareNonInheritedData->m_
grid->m_gridAutoFlow & InternalAutoFlowDirectionRow) == InternalAutoFlowDirectio
nRow; } |
851 bool isGridAutoFlowDirectionColumn() const { return (m_rareNonInheritedData-
>m_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn) == InternalAutoFlowDi
rectionColumn; } | 1893 bool isGridAutoFlowDirectionColumn() const { return (m_rareNonInheritedData-
>m_grid->m_gridAutoFlow & InternalAutoFlowDirectionColumn) == InternalAutoFlowDi
rectionColumn; } |
852 bool isGridAutoFlowAlgorithmSparse() const { return (m_rareNonInheritedData-
>m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse) == InternalAutoFlowAl
gorithmSparse; } | 1894 bool isGridAutoFlowAlgorithmSparse() const { return (m_rareNonInheritedData-
>m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmSparse) == InternalAutoFlowAl
gorithmSparse; } |
853 bool isGridAutoFlowAlgorithmDense() const { return (m_rareNonInheritedData->
m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense) == InternalAutoFlowAlgo
rithmDense; } | 1895 bool isGridAutoFlowAlgorithmDense() const { return (m_rareNonInheritedData->
m_grid->m_gridAutoFlow & InternalAutoFlowAlgorithmDense) == InternalAutoFlowAlgo
rithmDense; } |
854 const Vector<GridTrackSize>& gridAutoColumns() const { return m_rareNonInher
itedData->m_grid->m_gridAutoColumns; } | |
855 const Vector<GridTrackSize>& gridAutoRows() const { return m_rareNonInherite
dData->m_grid->m_gridAutoRows; } | |
856 const Length& gridColumnGap() const { return m_rareNonInheritedData->m_grid-
>m_gridColumnGap; } | |
857 const Length& gridRowGap() const { return m_rareNonInheritedData->m_grid->m_
gridRowGap; } | |
858 | |
859 const GridPosition& gridColumnStart() const { return m_rareNonInheritedData-
>m_gridItem->m_gridColumnStart; } | |
860 const GridPosition& gridColumnEnd() const { return m_rareNonInheritedData->m
_gridItem->m_gridColumnEnd; } | |
861 const GridPosition& gridRowStart() const { return m_rareNonInheritedData->m_
gridItem->m_gridRowStart; } | |
862 const GridPosition& gridRowEnd() const { return m_rareNonInheritedData->m_gr
idItem->m_gridRowEnd; } | |
863 | |
864 ShadowList* boxShadow() const { return m_rareNonInheritedData->m_boxShadow.g
et(); } | |
865 | |
866 EBoxDecorationBreak boxDecorationBreak() const { return m_box->boxDecoration
Break(); } | |
867 StyleReflection* boxReflect() const { return m_rareNonInheritedData->m_boxRe
flect.get(); } | |
868 bool hasBoxReflect() const { return boxReflect(); } | |
869 bool reflectionDataEquivalent(const ComputedStyle* otherStyle) const { retur
n m_rareNonInheritedData->reflectionDataEquivalent(*otherStyle->m_rareNonInherit
edData); } | |
870 | |
871 // FIXME: reflections should belong to this helper function but they are cur
rently handled | |
872 // through their self-painting layers. So the layout code doesn't account fo
r them. | |
873 bool hasVisualOverflowingEffect() const { return boxShadow() || hasBorderIma
geOutsets() || hasOutline(); } | |
874 | |
875 Containment contain() const { return static_cast<Containment>(m_rareNonInher
itedData->m_contain); } | |
876 bool containsPaint() const { return m_rareNonInheritedData->m_contain & Cont
ainsPaint; } | |
877 bool containsStyle() const { return m_rareNonInheritedData->m_contain & Cont
ainsStyle; } | |
878 bool containsLayout() const { return m_rareNonInheritedData->m_contain & Con
tainsLayout; } | |
879 bool containsSize() const { return m_rareNonInheritedData->m_contain & Conta
insSize; } | |
880 | |
881 EBoxSizing boxSizing() const { return m_box->boxSizing(); } | |
882 EUserModify userModify() const { return static_cast<EUserModify>(m_rareInher
itedData->userModify); } | |
883 EUserDrag userDrag() const { return static_cast<EUserDrag>(m_rareNonInherite
dData->userDrag); } | |
884 EUserSelect userSelect() const { return static_cast<EUserSelect>(m_rareInher
itedData->userSelect); } | |
885 TextOverflow getTextOverflow() const { return static_cast<TextOverflow>(m_ra
reNonInheritedData->textOverflow); } | |
886 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCol
lapse>(m_rareNonInheritedData->marginBeforeCollapse); } | |
887 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginColl
apse>(m_rareNonInheritedData->marginAfterCollapse); } | |
888 EWordBreak wordBreak() const { return static_cast<EWordBreak>(m_rareInherite
dData->wordBreak); } | |
889 EOverflowWrap overflowWrap() const { return static_cast<EOverflowWrap>(m_rar
eInheritedData->overflowWrap); } | |
890 LineBreak getLineBreak() const { return static_cast<LineBreak>(m_rareInherit
edData->lineBreak); } | |
891 const AtomicString& highlight() const { return m_rareInheritedData->highligh
t; } | |
892 Hyphens getHyphens() const { return static_cast<Hyphens>(m_rareInheritedData
->hyphens); } | |
893 const AtomicString& hyphenationString() const { return m_rareInheritedData->
hyphenationString; } | |
894 const AtomicString& locale() const { return LayoutLocale::localeString(getFo
ntDescription().locale()); } | |
895 EResize resize() const { return static_cast<EResize>(m_rareNonInheritedData-
>m_resize); } | |
896 bool hasInlinePaginationAxis() const | |
897 { | |
898 // If the pagination axis is parallel with the writing mode inline axis,
columns may be laid | |
899 // out along the inline axis, just like for regular multicol. Otherwise,
we need to lay out | |
900 // along the block axis. | |
901 if (isOverflowPaged()) | |
902 return (overflowY() == OverflowPagedX) == isHorizontalWritingMode(); | |
903 return false; | |
904 } | |
905 float columnWidth() const { return m_rareNonInheritedData->m_multiCol->m_wid
th; } | |
906 bool hasAutoColumnWidth() const { return m_rareNonInheritedData->m_multiCol-
>m_autoWidth; } | |
907 unsigned short columnCount() const { return m_rareNonInheritedData->m_multiC
ol->m_count; } | |
908 bool hasAutoColumnCount() const { return m_rareNonInheritedData->m_multiCol-
>m_autoCount; } | |
909 bool specifiesColumns() const { return !hasAutoColumnCount() || !hasAutoColu
mnWidth(); } | |
910 ColumnFill getColumnFill() const { return static_cast<ColumnFill>(m_rareNonI
nheritedData->m_multiCol->m_fill); } | |
911 float columnGap() const { return m_rareNonInheritedData->m_multiCol->m_gap;
} | |
912 bool hasNormalColumnGap() const { return m_rareNonInheritedData->m_multiCol-
>m_normalGap; } | |
913 EBorderStyle columnRuleStyle() const { return m_rareNonInheritedData->m_mult
iCol->m_rule.style(); } | |
914 unsigned short columnRuleWidth() const { return m_rareNonInheritedData->m_mu
ltiCol->ruleWidth(); } | |
915 bool columnRuleIsTransparent() const { return m_rareNonInheritedData->m_mult
iCol->m_rule.isTransparent(); } | |
916 bool columnRuleEquivalent(const ComputedStyle* otherStyle) const; | |
917 ColumnSpan getColumnSpan() const { return static_cast<ColumnSpan>(m_rareNonI
nheritedData->m_multiCol->m_columnSpan); } | |
918 bool hasInlineTransform() const { return m_rareNonInheritedData->m_hasInline
Transform; } | |
919 bool hasCompositorProxy() const { return m_rareNonInheritedData->m_hasCompos
itorProxy; } | |
920 const TransformOperations& transform() const { return m_rareNonInheritedData
->m_transform->m_operations; } | |
921 const TransformOrigin& transformOrigin() const { return m_rareNonInheritedDa
ta->m_transform->m_origin; } | |
922 const Length& transformOriginX() const { return transformOrigin().x(); } | |
923 const Length& transformOriginY() const { return transformOrigin().y(); } | |
924 TranslateTransformOperation* translate() const { return m_rareNonInheritedDa
ta->m_transform->m_translate.get(); } | |
925 RotateTransformOperation* rotate() const { return m_rareNonInheritedData->m_
transform->m_rotate.get(); } | |
926 ScaleTransformOperation* scale() const { return m_rareNonInheritedData->m_tr
ansform->m_scale.get(); } | |
927 float transformOriginZ() const { return transformOrigin().z(); } | |
928 bool has3DTransform() const { return m_rareNonInheritedData->m_transform->ha
s3DTransform(); } | |
929 bool hasTransform() const { return hasTransformOperations() || hasMotionPath
() || hasCurrentTransformAnimation() || translate() || rotate() || scale(); } | |
930 bool hasTransformOperations() const { return !m_rareNonInheritedData->m_tran
sform->m_operations.operations().isEmpty(); } | |
931 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return
m_rareNonInheritedData->m_transform == otherStyle.m_rareNonInheritedData->m_tra
nsform; } | |
932 | |
933 StylePath* motionPath() const { return m_rareNonInheritedData->m_transform->
m_motion.m_path.get(); } | |
934 bool hasMotionPath() const { return motionPath(); } | |
935 const Length& motionOffset() const { return m_rareNonInheritedData->m_transf
orm->m_motion.m_offset; } | |
936 const StyleMotionRotation& motionRotation() const { return m_rareNonInherite
dData->m_transform->m_motion.m_rotation; } | |
937 | |
938 TextEmphasisFill getTextEmphasisFill() const { return static_cast<TextEmphas
isFill>(m_rareInheritedData->textEmphasisFill); } | |
939 TextEmphasisMark getTextEmphasisMark() const; | |
940 const AtomicString& textEmphasisCustomMark() const { return m_rareInheritedD
ata->textEmphasisCustomMark; } | |
941 TextEmphasisPosition getTextEmphasisPosition() const { return static_cast<Te
xtEmphasisPosition>(m_rareInheritedData->textEmphasisPosition); } | |
942 const AtomicString& textEmphasisMarkString() const; | |
943 | |
944 RubyPosition getRubyPosition() const { return static_cast<RubyPosition>(m_ra
reInheritedData->m_rubyPosition); } | |
945 | |
946 TextOrientation getTextOrientation() const { return static_cast<TextOrientat
ion>(m_rareInheritedData->m_textOrientation); } | |
947 | |
948 ObjectFit getObjectFit() const { return static_cast<ObjectFit>(m_rareNonInhe
ritedData->m_objectFit); } | |
949 LengthPoint objectPosition() const { return m_rareNonInheritedData->m_object
Position; } | |
950 | |
951 // Return true if any transform related property (currently transform/motion
Path, transformStyle3D, perspective, | |
952 // or will-change:transform) indicates that we are transforming. will-change
:transform should result in | |
953 // the same rendering behavior as having a transform, including the creation
of a containing block | |
954 // for fixed position descendants. | |
955 bool hasTransformRelatedProperty() const { return hasTransform() || preserve
s3D() || hasPerspective() || hasWillChangeTransformHint(); } | |
956 | |
957 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }
; | |
958 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; | |
959 enum ApplyIndependentTransformProperties { IncludeIndependentTransformProper
ties , ExcludeIndependentTransformProperties }; | |
960 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize,
ApplyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) cons
t; | |
961 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, App
lyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) const; | |
962 bool hasMask() const { return m_rareNonInheritedData->m_mask.hasImage() || m
_rareNonInheritedData->m_maskBoxImage.hasImage(); } | |
963 | |
964 TextCombine getTextCombine() const { return static_cast<TextCombine>(m_rareI
nheritedData->m_textCombine); } | |
965 bool hasTextCombine() const { return getTextCombine() != TextCombineNone; } | |
966 | |
967 uint8_t snapHeightPosition() const { return m_rareInheritedData->m_snapHeigh
tPosition; } | |
968 uint8_t snapHeightUnit() const { return m_rareInheritedData->m_snapHeightUni
t; } | |
969 | |
970 TabSize getTabSize() const { return m_rareInheritedData->m_tabSize; } | |
971 | |
972 RespectImageOrientationEnum respectImageOrientation() const { return static_
cast<RespectImageOrientationEnum>(m_rareInheritedData->m_respectImageOrientation
); } | |
973 | |
974 // End CSS3 Getters | |
975 | |
976 // Apple-specific property getter methods | |
977 EPointerEvents pointerEvents() const { return static_cast<EPointerEvents>(m_
inheritedData.m_pointerEvents); } | |
978 const CSSAnimationData* animations() const { return m_rareNonInheritedData->
m_animations.get(); } | |
979 const CSSTransitionData* transitions() const { return m_rareNonInheritedData
->m_transitions.get(); } | |
980 | |
981 CSSAnimationData& accessAnimations(); | |
982 CSSTransitionData& accessTransitions(); | |
983 | |
984 ETransformStyle3D transformStyle3D() const { return static_cast<ETransformSt
yle3D>(m_rareNonInheritedData->m_transformStyle3D); } | |
985 ETransformStyle3D usedTransformStyle3D() const { return hasGroupingProperty(
) ? TransformStyle3DFlat : transformStyle3D(); } | |
986 bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3D
Flat; } | |
987 | |
988 EBackfaceVisibility backfaceVisibility() const { return static_cast<EBackfac
eVisibility>(m_rareNonInheritedData->m_backfaceVisibility); } | |
989 float perspective() const { return m_rareNonInheritedData->m_perspective; } | |
990 bool hasPerspective() const { return m_rareNonInheritedData->m_perspective >
0; } | |
991 const LengthPoint& perspectiveOrigin() const { return m_rareNonInheritedData
->m_perspectiveOrigin; } | |
992 const Length& perspectiveOriginX() const { return perspectiveOrigin().x(); } | |
993 const Length& perspectiveOriginY() const { return perspectiveOrigin().y(); } | |
994 const FloatSize& pageSize() const { return m_rareNonInheritedData->m_pageSiz
e; } | |
995 PageSizeType getPageSizeType() const { return static_cast<PageSizeType>(m_ra
reNonInheritedData->m_pageSizeType); } | |
996 | |
997 bool hasCurrentOpacityAnimation() const { return m_rareNonInheritedData->m_h
asCurrentOpacityAnimation; } | |
998 bool hasCurrentTransformAnimation() const { return m_rareNonInheritedData->m
_hasCurrentTransformAnimation; } | |
999 bool hasCurrentFilterAnimation() const { return m_rareNonInheritedData->m_ha
sCurrentFilterAnimation; } | |
1000 bool hasCurrentBackdropFilterAnimation() const { return m_rareNonInheritedDa
ta->m_hasCurrentBackdropFilterAnimation; } | |
1001 bool shouldCompositeForCurrentAnimations() const { return hasCurrentOpacityA
nimation() || hasCurrentTransformAnimation() || hasCurrentFilterAnimation() || h
asCurrentBackdropFilterAnimation(); } | |
1002 | |
1003 bool isRunningOpacityAnimationOnCompositor() const { return m_rareNonInherit
edData->m_runningOpacityAnimationOnCompositor; } | |
1004 bool isRunningTransformAnimationOnCompositor() const { return m_rareNonInher
itedData->m_runningTransformAnimationOnCompositor; } | |
1005 bool isRunningFilterAnimationOnCompositor() const { return m_rareNonInherite
dData->m_runningFilterAnimationOnCompositor; } | |
1006 bool isRunningBackdropFilterAnimationOnCompositor() const { return m_rareNon
InheritedData->m_runningBackdropFilterAnimationOnCompositor; } | |
1007 bool isRunningAnimationOnCompositor() const { return isRunningOpacityAnimati
onOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilter
AnimationOnCompositor() || isRunningBackdropFilterAnimationOnCompositor(); } | |
1008 | |
1009 const LineClampValue& lineClamp() const { return m_rareNonInheritedData->lin
eClamp; } | |
1010 Color tapHighlightColor() const { return m_rareInheritedData->tapHighlightCo
lor; } | |
1011 ETextSecurity textSecurity() const { return static_cast<ETextSecurity>(m_rar
eInheritedData->textSecurity); } | |
1012 | |
1013 WritingMode getWritingMode() const { return static_cast<WritingMode>(m_inher
itedData.m_writingMode); } | |
1014 bool isHorizontalWritingMode() const { return blink::isHorizontalWritingMode
(getWritingMode()); } | |
1015 bool isFlippedLinesWritingMode() const { return blink::isFlippedLinesWriting
Mode(getWritingMode()); } | |
1016 bool isFlippedBlocksWritingMode() const { return blink::isFlippedBlocksWriti
ngMode(getWritingMode()); } | |
1017 | |
1018 EImageRendering imageRendering() const { return static_cast<EImageRendering>
(m_rareInheritedData->m_imageRendering); } | |
1019 | |
1020 ESpeak speak() const { return static_cast<ESpeak>(m_rareInheritedData->speak
); } | |
1021 | |
1022 FilterOperations& mutableFilter() { return m_rareNonInheritedData.access()->
m_filter.access()->m_operations; } | |
1023 const FilterOperations& filter() const { return m_rareNonInheritedData->m_fi
lter->m_operations; } | |
1024 bool hasFilter() const { return !m_rareNonInheritedData->m_filter->m_operati
ons.operations().isEmpty(); } | |
1025 | |
1026 FilterOperations& mutableBackdropFilter() { return m_rareNonInheritedData.ac
cess()->m_backdropFilter.access()->m_operations; } | |
1027 const FilterOperations& backdropFilter() const { return m_rareNonInheritedDa
ta->m_backdropFilter->m_operations; } | |
1028 bool hasBackdropFilter() const { return !m_rareNonInheritedData->m_backdropF
ilter->m_operations.operations().isEmpty(); } | |
1029 | |
1030 WebBlendMode blendMode() const { return static_cast<WebBlendMode>(m_rareNonI
nheritedData->m_effectiveBlendMode); } | |
1031 void setBlendMode(WebBlendMode v) { m_rareNonInheritedData.access()->m_effec
tiveBlendMode = v; } | |
1032 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } | |
1033 | |
1034 EIsolation isolation() const { return static_cast<EIsolation>(m_rareNonInher
itedData->m_isolation); } | |
1035 void setIsolation(EIsolation v) { m_rareNonInheritedData.access()->m_isolati
on = v; } | |
1036 bool hasIsolation() const { return isolation() != IsolationAuto; } | |
1037 | |
1038 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLef
tToRightDirection() && isHorizontalWritingMode(); } | |
1039 | |
1040 TouchAction getTouchAction() const { return static_cast<TouchAction>(m_rareN
onInheritedData->m_touchAction); } | |
1041 | |
1042 ScrollBehavior getScrollBehavior() const { return static_cast<ScrollBehavior
>(m_rareNonInheritedData->m_scrollBehavior); } | |
1043 | |
1044 ScrollSnapType getScrollSnapType() const { return static_cast<ScrollSnapType
>(m_rareNonInheritedData->m_scrollSnapType); } | |
1045 const ScrollSnapPoints& scrollSnapPointsX() const { return m_rareNonInherite
dData->m_scrollSnap->m_xPoints; } | |
1046 const ScrollSnapPoints& scrollSnapPointsY() const { return m_rareNonInherite
dData->m_scrollSnap->m_yPoints; } | |
1047 const Vector<LengthPoint>& scrollSnapCoordinate() const { return m_rareNonIn
heritedData->m_scrollSnap->m_coordinates; } | |
1048 const LengthPoint& scrollSnapDestination() const { return m_rareNonInherited
Data->m_scrollSnap->m_destination; } | |
1049 | |
1050 const Vector<CSSPropertyID>& willChangeProperties() const { return m_rareNon
InheritedData->m_willChange->m_properties; } | |
1051 bool willChangeContents() const { return m_rareNonInheritedData->m_willChang
e->m_contents; } | |
1052 bool willChangeScrollPosition() const { return m_rareNonInheritedData->m_wil
lChange->m_scrollPosition; } | |
1053 bool hasWillChangeCompositingHint() const; | |
1054 bool hasWillChangeOpacityHint() const { return willChangeProperties().contai
ns(CSSPropertyOpacity); } | |
1055 bool hasWillChangeTransformHint() const; | |
1056 bool subtreeWillChangeContents() const { return m_rareInheritedData->m_subtr
eeWillChangeContents; } | |
1057 | |
1058 // attribute setter methods | |
1059 | |
1060 void setDisplay(EDisplay v) { m_nonInheritedData.m_effectiveDisplay = v; } | |
1061 void setOriginalDisplay(EDisplay v) { m_nonInheritedData.m_originalDisplay =
v; } | |
1062 void setPosition(EPosition v) { m_nonInheritedData.m_position = v; } | |
1063 void setFloating(EFloat v) { m_nonInheritedData.m_floating = v; } | |
1064 | |
1065 void setLeft(const Length& v) { SET_VAR(m_surround, offset.m_left, v); } | |
1066 void setRight(const Length& v) { SET_VAR(m_surround, offset.m_right, v); } | |
1067 void setTop(const Length& v) { SET_VAR(m_surround, offset.m_top, v); } | |
1068 void setBottom(const Length& v) { SET_VAR(m_surround, offset.m_bottom, v); } | |
1069 | |
1070 void setWidth(const Length& v) { SET_VAR(m_box, m_width, v); } | |
1071 void setHeight(const Length& v) { SET_VAR(m_box, m_height, v); } | |
1072 | |
1073 void setLogicalWidth(const Length& v) | |
1074 { | |
1075 if (isHorizontalWritingMode()) { | |
1076 SET_VAR(m_box, m_width, v); | |
1077 } else { | |
1078 SET_VAR(m_box, m_height, v); | |
1079 } | |
1080 } | |
1081 | |
1082 void setLogicalHeight(const Length& v) | |
1083 { | |
1084 if (isHorizontalWritingMode()) { | |
1085 SET_VAR(m_box, m_height, v); | |
1086 } else { | |
1087 SET_VAR(m_box, m_width, v); | |
1088 } | |
1089 } | |
1090 | |
1091 void setMinWidth(const Length& v) { SET_VAR(m_box, m_minWidth, v); } | |
1092 void setMaxWidth(const Length& v) { SET_VAR(m_box, m_maxWidth, v); } | |
1093 void setMinHeight(const Length& v) { SET_VAR(m_box, m_minHeight, v); } | |
1094 void setMaxHeight(const Length& v) { SET_VAR(m_box, m_maxHeight, v); } | |
1095 | |
1096 DraggableRegionMode getDraggableRegionMode() const { return m_rareNonInherit
edData->m_draggableRegionMode; } | |
1097 void setDraggableRegionMode(DraggableRegionMode v) { SET_VAR(m_rareNonInheri
tedData, m_draggableRegionMode, v); } | |
1098 | |
1099 void resetBorder() | |
1100 { | |
1101 resetBorderImage(); | |
1102 resetBorderTop(); | |
1103 resetBorderRight(); | |
1104 resetBorderBottom(); | |
1105 resetBorderLeft(); | |
1106 resetBorderTopLeftRadius(); | |
1107 resetBorderTopRightRadius(); | |
1108 resetBorderBottomLeftRadius(); | |
1109 resetBorderBottomRightRadius(); | |
1110 } | |
1111 void resetBorderTop() { SET_VAR(m_surround, border.m_top, BorderValue()); } | |
1112 void resetBorderRight() { SET_VAR(m_surround, border.m_right, BorderValue())
; } | |
1113 void resetBorderBottom() { SET_VAR(m_surround, border.m_bottom, BorderValue(
)); } | |
1114 void resetBorderLeft() { SET_VAR(m_surround, border.m_left, BorderValue());
} | |
1115 void resetBorderImage() { SET_VAR(m_surround, border.m_image, NinePieceImage
()); } | |
1116 void resetBorderTopLeftRadius() { SET_VAR(m_surround, border.m_topLeft, init
ialBorderRadius()); } | |
1117 void resetBorderTopRightRadius() { SET_VAR(m_surround, border.m_topRight, in
itialBorderRadius()); } | |
1118 void resetBorderBottomLeftRadius() { SET_VAR(m_surround, border.m_bottomLeft
, initialBorderRadius()); } | |
1119 void resetBorderBottomRightRadius() { SET_VAR(m_surround, border.m_bottomRig
ht, initialBorderRadius()); } | |
1120 | |
1121 void setBackgroundColor(const StyleColor& v) { SET_VAR(m_background, m_color
, v); } | |
1122 | |
1123 void setBorderImage(const NinePieceImage& b) { SET_VAR(m_surround, border.m_
image, b); } | |
1124 void setBorderImageSource(StyleImage*); | |
1125 void setBorderImageSlices(const LengthBox&); | |
1126 void setBorderImageSlicesFill(bool); | |
1127 void setBorderImageWidth(const BorderImageLengthBox&); | |
1128 void setBorderImageOutset(const BorderImageLengthBox&); | |
1129 | |
1130 void setBorderTopLeftRadius(const LengthSize& s) { SET_VAR(m_surround, borde
r.m_topLeft, s); } | |
1131 void setBorderTopRightRadius(const LengthSize& s) { SET_VAR(m_surround, bord
er.m_topRight, s); } | |
1132 void setBorderBottomLeftRadius(const LengthSize& s) { SET_VAR(m_surround, bo
rder.m_bottomLeft, s); } | |
1133 void setBorderBottomRightRadius(const LengthSize& s) { SET_VAR(m_surround, b
order.m_bottomRight, s); } | |
1134 | |
1135 void setBorderRadius(const LengthSize& s) | |
1136 { | |
1137 setBorderTopLeftRadius(s); | |
1138 setBorderTopRightRadius(s); | |
1139 setBorderBottomLeftRadius(s); | |
1140 setBorderBottomRightRadius(s); | |
1141 } | |
1142 void setBorderRadius(const IntSize& s) | |
1143 { | |
1144 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(),
Fixed))); | |
1145 } | |
1146 | |
1147 FloatRoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool incl
udeLogicalLeftEdge = true, | |
1148 bool includeLogicalRightEdge = true) const; | |
1149 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool
includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; | |
1150 | |
1151 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, | |
1152 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ
eLogicalRightEdge) const; | |
1153 | |
1154 void setBorderLeftWidth(unsigned v) { SET_VAR(m_surround, border.m_left.m_wi
dth, v); } | |
1155 void setBorderLeftStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_left.
m_style, v); } | |
1156 void setBorderLeftColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surro
und, border.m_left, v); } | |
1157 void setBorderRightWidth(unsigned v) { SET_VAR(m_surround, border.m_right.m_
width, v); } | |
1158 void setBorderRightStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_righ
t.m_style, v); } | |
1159 void setBorderRightColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surr
ound, border.m_right, v); } | |
1160 void setBorderTopWidth(unsigned v) { SET_VAR(m_surround, border.m_top.m_widt
h, v); } | |
1161 void setBorderTopStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_top.m_
style, v); } | |
1162 void setBorderTopColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_surrou
nd, border.m_top, v); } | |
1163 void setBorderBottomWidth(unsigned v) { SET_VAR(m_surround, border.m_bottom.
m_width, v); } | |
1164 void setBorderBottomStyle(EBorderStyle v) { SET_VAR(m_surround, border.m_bot
tom.m_style, v); } | |
1165 void setBorderBottomColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_sur
round, border.m_bottom, v); } | |
1166 | |
1167 void setOutlineWidth(unsigned short v) { SET_VAR(m_background, m_outline.m_w
idth, v); } | |
1168 void setOutlineStyleIsAuto(OutlineIsAuto isAuto) { SET_VAR(m_background, m_o
utline.m_isAuto, isAuto); } | |
1169 void setOutlineStyle(EBorderStyle v) { SET_VAR(m_background, m_outline.m_sty
le, v); } | |
1170 void setOutlineColor(const StyleColor& v) { SET_BORDERVALUE_COLOR(m_backgrou
nd, m_outline, v); } | |
1171 bool isOutlineEquivalent(const ComputedStyle* otherStyle) const | |
1172 { | |
1173 // No other style, so we don't have an outline then we consider them to
be the same. | |
1174 if (!otherStyle) | |
1175 return !hasOutline(); | |
1176 return m_background->outline().visuallyEqual(otherStyle->m_background->o
utline()); | |
1177 } | |
1178 void setOutlineFromStyle(const ComputedStyle& o) | |
1179 { | |
1180 ASSERT(!isOutlineEquivalent(&o)); | |
1181 m_background.access()->m_outline = o.m_background->m_outline; | |
1182 } | |
1183 | |
1184 void setOverflowAnchor(EOverflowAnchor v) { m_nonInheritedData.m_overflowAnc
hor = v; } | |
1185 void setOverflowX(EOverflow v) { m_nonInheritedData.m_overflowX = v; } | |
1186 void setOverflowY(EOverflow v) { m_nonInheritedData.m_overflowY = v; } | |
1187 void setVisibility(EVisibility v) { m_inheritedData.m_visibility = v; } | |
1188 void setVerticalAlign(EVerticalAlign v) { m_nonInheritedData.m_verticalAlign
= v; } | |
1189 void setVerticalAlignLength(const Length& length) { setVerticalAlign(Vertica
lAlignLength); SET_VAR(m_box, m_verticalAlign, length); } | |
1190 | |
1191 void setHasAutoClip() { SET_VAR(m_visual, hasAutoClip, true); SET_VAR(m_visu
al, clip, ComputedStyle::initialClip()); } | |
1192 void setClip(const LengthBox& box) { SET_VAR(m_visual, hasAutoClip, false);
SET_VAR(m_visual, clip, box); } | |
1193 | |
1194 void setUnicodeBidi(EUnicodeBidi b) { m_nonInheritedData.m_unicodeBidi = b;
} | |
1195 | |
1196 void setClear(EClear v) { m_nonInheritedData.m_clear = v; } | |
1197 void setTableLayout(ETableLayout v) { m_nonInheritedData.m_tableLayout = v;
} | |
1198 | |
1199 bool setFontDescription(const FontDescription&); | |
1200 void setFont(const Font&); | |
1201 | |
1202 void setTextAutosizingMultiplier(float); | |
1203 | |
1204 void setColor(const Color&); | |
1205 void setTextIndent(const Length& v) { SET_VAR(m_rareInheritedData, indent, v
); } | |
1206 void setTextIndentLine(TextIndentLine v) { SET_VAR(m_rareInheritedData, m_te
xtIndentLine, v); } | |
1207 void setTextIndentType(TextIndentType v) { SET_VAR(m_rareInheritedData, m_te
xtIndentType, v); } | |
1208 void setTextAlign(ETextAlign v) { m_inheritedData.m_textAlign = v; } | |
1209 void setTextAlignLast(TextAlignLast v) { SET_VAR(m_rareInheritedData, m_text
AlignLast, v); } | |
1210 void setTextJustify(TextJustify v) { SET_VAR(m_rareInheritedData, m_textJust
ify, v); } | |
1211 void setTextTransform(ETextTransform v) { m_inheritedData.m_textTransform =
v; } | |
1212 void applyTextDecorations(); | |
1213 void clearAppliedTextDecorations(); | |
1214 void setTextDecoration(TextDecoration v) { SET_VAR(m_visual, textDecoration,
v); } | |
1215 void setTextUnderlinePosition(TextUnderlinePosition v) { SET_VAR(m_rareInher
itedData, m_textUnderlinePosition, v); } | |
1216 void setTextDecorationStyle(TextDecorationStyle v) { SET_VAR(m_rareNonInheri
tedData, m_textDecorationStyle, v); } | |
1217 void setDirection(TextDirection v) { m_inheritedData.m_direction = v; } | |
1218 void setSelfOrAncestorHasDirAutoAttribute(bool v) { SET_VAR(m_rareInheritedD
ata, m_selfOrAncestorHasDirAutoAttribute, v); } | |
1219 void setLineHeight(const Length& specifiedLineHeight); | |
1220 bool setZoom(float); | |
1221 bool setEffectiveZoom(float); | |
1222 void clearMultiCol(); | |
1223 | |
1224 void setImageRendering(EImageRendering v) { SET_VAR(m_rareInheritedData, m_i
mageRendering, v); } | |
1225 | |
1226 void setWhiteSpace(EWhiteSpace v) { m_inheritedData.m_whiteSpace = v; } | |
1227 | |
1228 // FIXME: Remove these two and replace them with respective FontBuilder call
s. | |
1229 void setWordSpacing(float); | |
1230 void setLetterSpacing(float); | |
1231 | |
1232 void adjustBackgroundLayers() | |
1233 { | |
1234 if (backgroundLayers().next()) { | |
1235 accessBackgroundLayers().cullEmptyLayers(); | |
1236 accessBackgroundLayers().fillUnsetProperties(); | |
1237 } | |
1238 } | |
1239 | |
1240 void adjustMaskLayers() | |
1241 { | |
1242 if (maskLayers().next()) { | |
1243 accessMaskLayers().cullEmptyLayers(); | |
1244 accessMaskLayers().fillUnsetProperties(); | |
1245 } | |
1246 } | |
1247 | |
1248 void setMaskBoxImage(const NinePieceImage& b) { SET_VAR(m_rareNonInheritedDa
ta, m_maskBoxImage, b); } | |
1249 void setMaskBoxImageSource(StyleImage* v) { m_rareNonInheritedData.access()-
>m_maskBoxImage.setImage(v); } | |
1250 void setMaskBoxImageSlices(const LengthBox& slices) | |
1251 { | |
1252 m_rareNonInheritedData.access()->m_maskBoxImage.setImageSlices(slices); | |
1253 } | |
1254 void setMaskBoxImageSlicesFill(bool fill) | |
1255 { | |
1256 m_rareNonInheritedData.access()->m_maskBoxImage.setFill(fill); | |
1257 } | |
1258 void setMaskBoxImageWidth(const BorderImageLengthBox& slices) | |
1259 { | |
1260 m_rareNonInheritedData.access()->m_maskBoxImage.setBorderSlices(slices); | |
1261 } | |
1262 void setMaskBoxImageOutset(const BorderImageLengthBox& outset) | |
1263 { | |
1264 m_rareNonInheritedData.access()->m_maskBoxImage.setOutset(outset); | |
1265 } | |
1266 | |
1267 void setBorderCollapse(EBorderCollapse collapse) { m_inheritedData.m_borderC
ollapse = collapse; } | |
1268 void setHorizontalBorderSpacing(short); | |
1269 void setVerticalBorderSpacing(short); | |
1270 void setEmptyCells(EEmptyCells v) { m_inheritedData.m_emptyCells = v; } | |
1271 void setCaptionSide(ECaptionSide v) { m_inheritedData.m_captionSide = v; } | |
1272 | |
1273 void setListStyleType(EListStyleType v) { m_inheritedData.m_listStyleType =
v; } | |
1274 void setListStyleImage(StyleImage*); | |
1275 void setListStylePosition(EListStylePosition v) { m_inheritedData.m_listStyl
ePosition = v; } | |
1276 | |
1277 void setMarginTop(const Length& v) { SET_VAR(m_surround, margin.m_top, v); } | |
1278 void setMarginBottom(const Length& v) { SET_VAR(m_surround, margin.m_bottom,
v); } | |
1279 void setMarginLeft(const Length& v) { SET_VAR(m_surround, margin.m_left, v);
} | |
1280 void setMarginRight(const Length& v) { SET_VAR(m_surround, margin.m_right, v
); } | |
1281 void setMarginStart(const Length&); | |
1282 void setMarginEnd(const Length&); | |
1283 | |
1284 void resetPadding() { SET_VAR(m_surround, padding, LengthBox(Fixed)); } | |
1285 void setPaddingBox(const LengthBox& b) { SET_VAR(m_surround, padding, b); } | |
1286 void setPaddingTop(const Length& v) { SET_VAR(m_surround, padding.m_top, v);
} | |
1287 void setPaddingBottom(const Length& v) { SET_VAR(m_surround, padding.m_botto
m, v); } | |
1288 void setPaddingLeft(const Length& v) { SET_VAR(m_surround, padding.m_left, v
); } | |
1289 void setPaddingRight(const Length& v) { SET_VAR(m_surround, padding.m_right,
v); } | |
1290 | |
1291 void setCursor(ECursor c) { m_inheritedData.m_cursorStyle = c; } | |
1292 void addCursor(StyleImage*, bool hotSpotSpecified, const IntPoint& hotSpot =
IntPoint()); | |
1293 void setCursorList(CursorList*); | |
1294 void clearCursorList(); | |
1295 | |
1296 void setInsideLink(EInsideLink insideLink) { m_inheritedData.m_insideLink =
insideLink; } | |
1297 void setIsLink(bool b) { m_nonInheritedData.m_isLink = b; } | |
1298 | |
1299 PrintColorAdjust getPrintColorAdjust() const { return static_cast<PrintColor
Adjust>(m_inheritedData.m_printColorAdjust); } | |
1300 void setPrintColorAdjust(PrintColorAdjust value) { m_inheritedData.m_printCo
lorAdjust = value; } | |
1301 | |
1302 // A stacking context is painted atomically and defines a stacking order, wh
ereas | |
1303 // a containing stacking context defines in which order the stacking context
s | |
1304 // below are painted. | |
1305 // See CSS 2.1, Appendix E (https://www.w3.org/TR/CSS21/zindex.html) for mor
e details. | |
1306 bool isStackingContext() const { return m_rareNonInheritedData->m_isStacking
Context; } | |
1307 | |
1308 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer); | |
1309 void setIsStackingContext(bool b) { SET_VAR(m_rareNonInheritedData, m_isStac
kingContext, b); } | |
1310 | |
1311 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO
rderList | |
1312 // and posZOrderList) in their enclosing stacking contexts. | |
1313 // | |
1314 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind
ex.html), | |
1315 // positioned elements with 'z-index: auto' are "treated as if it created a
new | |
1316 // stacking context" and z-ordered together with other elements with 'z-inde
x: 0'. | |
1317 // The difference of them from normal stacking contexts is that they don't d
etermine | |
1318 // the stacking of the elements underneath them. | |
1319 // (Note: There are also other elements treated as stacking context during p
ainting, | |
1320 // but not managed in stacks. See ObjectPainter::paintAllPhasesAtomically().
) | |
1321 bool isStacked() const { return isStackingContext() || position() != StaticP
osition; } | |
1322 | |
1323 bool hasAutoZIndex() const { return m_box->hasAutoZIndex(); } | |
1324 void setHasAutoZIndex() { SET_VAR(m_box, m_hasAutoZIndex, true); SET_VAR(m_b
ox, m_zIndex, 0); } | |
1325 int zIndex() const { return m_box->zIndex(); } | |
1326 void setZIndex(int v) { SET_VAR(m_box, m_hasAutoZIndex, false); SET_VAR(m_bo
x, m_zIndex, v); } | |
1327 void setWidows(short w) { SET_VAR(m_rareInheritedData, widows, w); } | |
1328 void setOrphans(short o) { SET_VAR(m_rareInheritedData, orphans, o); } | |
1329 void setBreakAfter(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakAft
erAndBefore); m_nonInheritedData.m_breakAfter = b; } | |
1330 void setBreakBefore(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakAf
terAndBefore); m_nonInheritedData.m_breakBefore = b; } | |
1331 void setBreakInside(EBreak b) { DCHECK_LE(b, BreakValueLastAllowedForBreakIn
side); m_nonInheritedData.m_breakInside = b; } | |
1332 | |
1333 void setTextSizeAdjust(TextSizeAdjust sizeAdjust) { SET_VAR(m_rareInheritedD
ata, m_textSizeAdjust, sizeAdjust); } | |
1334 | |
1335 // CSS3 Setters | |
1336 void setOutlineOffset(int v) { SET_VAR(m_background, m_outline.m_offset, v);
} | |
1337 void setTextShadow(PassRefPtr<ShadowList>); | |
1338 void setTextStrokeColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareInh
eritedData, textStrokeColor, setTextStrokeColor, c); } | |
1339 void setTextStrokeWidth(float w) { SET_VAR(m_rareInheritedData, textStrokeWi
dth, w); } | |
1340 void setTextFillColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareInher
itedData, textFillColor, setTextFillColor, c); } | |
1341 void setOpacity(float f) { float v = clampTo<float>(f, 0, 1); SET_VAR(m_rare
NonInheritedData, opacity, v); } | |
1342 void setAppearance(ControlPart a) { SET_VAR(m_rareNonInheritedData, m_appear
ance, a); } | |
1343 // For valid values of box-align see http://www.w3.org/TR/2009/WD-css3-flexb
ox-20090723/#alignment | |
1344 void setBoxAlign(EBoxAlignment a) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, align, a); } | |
1345 void setBoxDecorationBreak(EBoxDecorationBreak b) { SET_VAR(m_box, m_boxDeco
rationBreak, b); } | |
1346 void setBoxDirection(EBoxDirection d) { m_inheritedData.m_boxDirection = d;
} | |
1347 void setBoxFlex(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_deprecat
edFlexibleBox, flex, f); } | |
1348 void setBoxFlexGroup(unsigned fg) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, flexGroup, fg); } | |
1349 void setBoxLines(EBoxLines lines) { SET_NESTED_VAR(m_rareNonInheritedData, m
_deprecatedFlexibleBox, lines, lines); } | |
1350 void setBoxOrdinalGroup(unsigned og) { SET_NESTED_VAR(m_rareNonInheritedData
, m_deprecatedFlexibleBox, ordinalGroup, og); } | |
1351 void setBoxOrient(EBoxOrient o) { SET_NESTED_VAR(m_rareNonInheritedData, m_d
eprecatedFlexibleBox, orient, o); } | |
1352 void setBoxPack(EBoxPack p) { SET_NESTED_VAR(m_rareNonInheritedData, m_depre
catedFlexibleBox, pack, p); } | |
1353 void setBoxShadow(PassRefPtr<ShadowList>); | |
1354 void setBoxReflect(PassRefPtr<StyleReflection> reflect) | |
1355 { | |
1356 if (m_rareNonInheritedData->m_boxReflect != reflect) | |
1357 m_rareNonInheritedData.access()->m_boxReflect = reflect; | |
1358 } | |
1359 void setBoxSizing(EBoxSizing s) { SET_VAR(m_box, m_boxSizing, s); } | |
1360 void setContain(Containment contain) { SET_VAR(m_rareNonInheritedData, m_con
tain, contain); } | |
1361 void setFlexGrow(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_flexibl
eBox, m_flexGrow, f); } | |
1362 void setFlexShrink(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_flexi
bleBox, m_flexShrink, f); } | |
1363 void setFlexBasis(const Length& length) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_flexibleBox, m_flexBasis, length); } | |
1364 // 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. | |
1365 void setOrder(int o) { SET_VAR(m_rareNonInheritedData, m_order, max(std::num
eric_limits<int>::min() + 2, o)); } | |
1366 void addCallbackSelector(const String& selector); | |
1367 void setAlignContent(const StyleContentAlignmentData& data) { SET_VAR(m_rare
NonInheritedData, m_alignContent, data); } | |
1368 void setAlignContentPosition(ContentPosition position) { m_rareNonInheritedD
ata.access()->m_alignContent.setPosition(position); } | |
1369 void setAlignContentDistribution(ContentDistributionType distribution) { m_r
areNonInheritedData.access()->m_alignContent.setDistribution(distribution); } | |
1370 void setAlignContentOverflow(OverflowAlignment overflow) { m_rareNonInherite
dData.access()->m_alignContent.setOverflow(overflow); } | |
1371 void setAlignItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonIn
heritedData, m_alignItems, data); } | |
1372 void setAlignItemsPosition(ItemPosition position) { m_rareNonInheritedData.a
ccess()->m_alignItems.setPosition(position); } | |
1373 void setAlignItemsOverflow(OverflowAlignment overflow) { m_rareNonInheritedD
ata.access()->m_alignItems.setOverflow(overflow); } | |
1374 void setAlignSelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonInh
eritedData, m_alignSelf, data); } | |
1375 void setAlignSelfPosition(ItemPosition position) { m_rareNonInheritedData.ac
cess()->m_alignSelf.setPosition(position); } | |
1376 void setAlignSelfOverflow(OverflowAlignment overflow) { m_rareNonInheritedDa
ta.access()->m_alignSelf.setOverflow(overflow); } | |
1377 void setFlexDirection(EFlexDirection direction) { SET_NESTED_VAR(m_rareNonIn
heritedData, m_flexibleBox, m_flexDirection, direction); } | |
1378 void setFlexWrap(EFlexWrap w) { SET_NESTED_VAR(m_rareNonInheritedData, m_fle
xibleBox, m_flexWrap, w); } | |
1379 void setJustifyContent(const StyleContentAlignmentData& data) { SET_VAR(m_ra
reNonInheritedData, m_justifyContent, data); } | |
1380 void setJustifyContentPosition(ContentPosition position) { m_rareNonInherite
dData.access()->m_justifyContent.setPosition(position); } | |
1381 void setJustifyContentDistribution(ContentDistributionType distribution) { m
_rareNonInheritedData.access()->m_justifyContent.setDistribution(distribution);
} | |
1382 void setJustifyContentOverflow(OverflowAlignment overflow) { m_rareNonInheri
tedData.access()->m_justifyContent.setOverflow(overflow); } | |
1383 void setJustifyItems(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNon
InheritedData, m_justifyItems, data); } | |
1384 void setJustifyItemsPosition(ItemPosition position) { m_rareNonInheritedData
.access()->m_justifyItems.setPosition(position); } | |
1385 void setJustifyItemsOverflow(OverflowAlignment overflow) { m_rareNonInherite
dData.access()->m_justifyItems.setOverflow(overflow); } | |
1386 void setJustifyItemsPositionType(ItemPositionType positionType) { m_rareNonI
nheritedData.access()->m_justifyItems.setPositionType(positionType); } | |
1387 void setJustifySelf(const StyleSelfAlignmentData& data) { SET_VAR(m_rareNonI
nheritedData, m_justifySelf, data); } | |
1388 void setJustifySelfPosition(ItemPosition position) { m_rareNonInheritedData.
access()->m_justifySelf.setPosition(position); } | |
1389 void setJustifySelfOverflow(OverflowAlignment overflow) { m_rareNonInherited
Data.access()->m_justifySelf.setOverflow(overflow); } | |
1390 void setGridAutoColumns(const Vector<GridTrackSize>& trackSizeList) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoColumns, trackSizeList); } | |
1391 void setGridAutoRows(const Vector<GridTrackSize>& trackSizeList) { SET_NESTE
D_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRows, trackSizeList); } | |
1392 void setGridTemplateColumns(const Vector<GridTrackSize>& lengths) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_grid, m_gridTemplateColumns, lengths); } | |
1393 void setGridTemplateRows(const Vector<GridTrackSize>& lengths) { SET_NESTED_
VAR(m_rareNonInheritedData, m_grid, m_gridTemplateRows, lengths); } | |
1394 void setGridAutoRepeatColumns(const Vector<GridTrackSize>& trackSizes) { SET
_NESTED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRepeatColumns, trackSizes)
; } | 1896 void setGridAutoRepeatColumns(const Vector<GridTrackSize>& trackSizes) { SET
_NESTED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRepeatColumns, trackSizes)
; } |
1395 void setGridAutoRepeatRows(const Vector<GridTrackSize>& trackSizes) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRepeatRows, trackSizes); } | 1897 void setGridAutoRepeatRows(const Vector<GridTrackSize>& trackSizes) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_gridAutoRepeatRows, trackSizes); } |
1396 void setGridAutoRepeatColumnsInsertionPoint(const size_t insertionPoint) { S
ET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatColumnsInsertionPoint,
insertionPoint); } | 1898 void setGridAutoRepeatColumnsInsertionPoint(const size_t insertionPoint) { S
ET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatColumnsInsertionPoint,
insertionPoint); } |
1397 void setGridAutoRepeatRowsInsertionPoint(const size_t insertionPoint) { SET_
NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatRowsInsertionPoint, inser
tionPoint); } | 1899 void setGridAutoRepeatRowsInsertionPoint(const size_t insertionPoint) { SET_
NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatRowsInsertionPoint, inser
tionPoint); } |
1398 void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET
_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatColumnsType, autoRepeatT
ype); } | 1900 void setGridAutoRepeatColumnsType(const AutoRepeatType autoRepeatType) { SET
_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatColumnsType, autoRepeatT
ype); } |
1399 void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatRowsType, autoRepeatType);
} | 1901 void setGridAutoRepeatRowsType(const AutoRepeatType autoRepeatType) { SET_NE
STED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatRowsType, autoRepeatType);
} |
1400 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines)
{ SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_namedGridColumnLines, namedGr
idColumnLines); } | 1902 void setNamedGridColumnLines(const NamedGridLinesMap& namedGridColumnLines)
{ SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_namedGridColumnLines, namedGr
idColumnLines); } |
1401 void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_
NESTED_VAR(m_rareNonInheritedData, m_grid, m_namedGridRowLines, namedGridRowLine
s); } | 1903 void setNamedGridRowLines(const NamedGridLinesMap& namedGridRowLines) { SET_
NESTED_VAR(m_rareNonInheritedData, m_grid, m_namedGridRowLines, namedGridRowLine
s); } |
1402 void setOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedName
dGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_orderedName
dGridColumnLines, orderedNamedGridColumnLines); } | 1904 void setOrderedNamedGridColumnLines(const OrderedNamedGridLines& orderedName
dGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_orderedName
dGridColumnLines, orderedNamedGridColumnLines); } |
1403 void setOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGr
idRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_orderedNamedGridR
owLines, orderedNamedGridRowLines); } | 1905 void setOrderedNamedGridRowLines(const OrderedNamedGridLines& orderedNamedGr
idRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_orderedNamedGridR
owLines, orderedNamedGridRowLines); } |
1404 void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridCol
umnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatNamedGrid
ColumnLines, namedGridColumnLines); } | 1906 void setAutoRepeatNamedGridColumnLines(const NamedGridLinesMap& namedGridCol
umnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatNamedGrid
ColumnLines, namedGridColumnLines); } |
1405 void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLin
es) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatNamedGridRowLin
es, namedGridRowLines); } | 1907 void setAutoRepeatNamedGridRowLines(const NamedGridLinesMap& namedGridRowLin
es) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRepeatNamedGridRowLin
es, namedGridRowLines); } |
1406 void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLines& o
rderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_a
utoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); } | 1908 void setAutoRepeatOrderedNamedGridColumnLines(const OrderedNamedGridLines& o
rderedNamedGridColumnLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_a
utoRepeatOrderedNamedGridColumnLines, orderedNamedGridColumnLines); } |
1407 void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLines& orde
redNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRep
eatOrderedNamedGridRowLines, orderedNamedGridRowLines); } | 1909 void setAutoRepeatOrderedNamedGridRowLines(const OrderedNamedGridLines& orde
redNamedGridRowLines) { SET_NESTED_VAR(m_rareNonInheritedData, m_grid, m_autoRep
eatOrderedNamedGridRowLines, orderedNamedGridRowLines); } |
1408 void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VA
R(m_rareNonInheritedData, m_grid, m_namedGridArea, namedGridArea); } | 1910 void setNamedGridArea(const NamedGridAreaMap& namedGridArea) { SET_NESTED_VA
R(m_rareNonInheritedData, m_grid, m_namedGridArea, namedGridArea); } |
1409 void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(m_rareNonInh
eritedData, m_grid, m_namedGridAreaRowCount, rowCount); } | 1911 void setNamedGridAreaRowCount(size_t rowCount) { SET_NESTED_VAR(m_rareNonInh
eritedData, m_grid, m_namedGridAreaRowCount, rowCount); } |
1410 void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(m_rare
NonInheritedData, m_grid, m_namedGridAreaColumnCount, columnCount); } | 1912 void setNamedGridAreaColumnCount(size_t columnCount) { SET_NESTED_VAR(m_rare
NonInheritedData, m_grid, m_namedGridAreaColumnCount, columnCount); } |
1411 void setGridAutoFlow(GridAutoFlow flow) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_grid, m_gridAutoFlow, flow); } | 1913 |
1412 | 1914 // Justify-self utility functions. |
1413 void setGridColumnStart(const GridPosition& columnStartPosition) { SET_NESTE
D_VAR(m_rareNonInheritedData, m_gridItem, m_gridColumnStart, columnStartPosition
); } | 1915 ItemPosition justifySelfPosition() const { return m_rareNonInheritedData->m_
justifySelf.position(); } |
1414 void setGridColumnEnd(const GridPosition& columnEndPosition) { SET_NESTED_VA
R(m_rareNonInheritedData, m_gridItem, m_gridColumnEnd, columnEndPosition); } | 1916 OverflowAlignment justifySelfOverflowAlignment() const { return m_rareNonInh
eritedData->m_justifySelf.overflow(); } |
1415 void setGridRowStart(const GridPosition& rowStartPosition) { SET_NESTED_VAR(
m_rareNonInheritedData, m_gridItem, m_gridRowStart, rowStartPosition); } | 1917 void setJustifySelfPosition(ItemPosition position) { m_rareNonInheritedData.
access()->m_justifySelf.setPosition(position); } |
1416 void setGridRowEnd(const GridPosition& rowEndPosition) { SET_NESTED_VAR(m_ra
reNonInheritedData, m_gridItem, m_gridRowEnd, rowEndPosition); } | 1918 void setJustifySelfOverflow(OverflowAlignment overflow) { m_rareNonInherited
Data.access()->m_justifySelf.setOverflow(overflow); } |
1417 void setGridColumnGap(const Length& v) { SET_NESTED_VAR(m_rareNonInheritedDa
ta, m_grid, m_gridColumnGap, v); } | 1919 |
1418 void setGridRowGap(const Length& v) { SET_NESTED_VAR(m_rareNonInheritedData,
m_grid, m_gridRowGap, v); } | 1920 // Justify-items utility functions. |
1419 | 1921 ItemPosition justifyItemsPosition() const { return m_rareNonInheritedData->m
_justifyItems.position(); } |
1420 void setUserModify(EUserModify u) { SET_VAR(m_rareInheritedData, userModify,
u); } | 1922 OverflowAlignment justifyItemsOverflowAlignment() const { return m_rareNonIn
heritedData->m_justifyItems.overflow(); } |
1421 void setUserDrag(EUserDrag d) { SET_VAR(m_rareNonInheritedData, userDrag, d)
; } | 1923 ItemPositionType justifyItemsPositionType() const { return m_rareNonInherite
dData->m_justifyItems.positionType(); } |
1422 void setUserSelect(EUserSelect s) { SET_VAR(m_rareInheritedData, userSelect,
s); } | 1924 void setJustifyItemsPosition(ItemPosition position) { m_rareNonInheritedData
.access()->m_justifyItems.setPosition(position); } |
1423 void setTextOverflow(TextOverflow overflow) { SET_VAR(m_rareNonInheritedData
, textOverflow, overflow); } | 1925 void setJustifyItemsOverflow(OverflowAlignment overflow) { m_rareNonInherite
dData.access()->m_justifyItems.setOverflow(overflow); } |
1424 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInherited
Data, marginBeforeCollapse, c); } | 1926 void setJustifyItemsPositionType(ItemPositionType positionType) { m_rareNonI
nheritedData.access()->m_justifyItems.setPositionType(positionType); } |
1425 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(m_rareNonInheritedD
ata, marginAfterCollapse, c); } | 1927 |
1426 void setWordBreak(EWordBreak b) { SET_VAR(m_rareInheritedData, wordBreak, b)
; } | 1928 // Writing mode utility functions. |
1427 void setOverflowWrap(EOverflowWrap b) { SET_VAR(m_rareInheritedData, overflo
wWrap, b); } | 1929 bool isHorizontalWritingMode() const { return blink::isHorizontalWritingMode
(getWritingMode()); } |
1428 void setLineBreak(LineBreak b) { SET_VAR(m_rareInheritedData, lineBreak, b);
} | 1930 bool isFlippedLinesWritingMode() const { return blink::isFlippedLinesWriting
Mode(getWritingMode()); } |
1429 void setHighlight(const AtomicString& h) { SET_VAR(m_rareInheritedData, high
light, h); } | 1931 bool isFlippedBlocksWritingMode() const { return blink::isFlippedBlocksWriti
ngMode(getWritingMode()); } |
1430 void setHyphens(Hyphens h) { SET_VAR(m_rareInheritedData, hyphens, h); } | 1932 |
1431 void setHyphenationString(const AtomicString& h) { SET_VAR(m_rareInheritedDa
ta, hyphenationString, h); } | 1933 // Will-change utility functions. |
1432 void setResize(EResize r) { SET_VAR(m_rareNonInheritedData, m_resize, r); } | 1934 bool hasWillChangeCompositingHint() const; |
1433 void setColumnWidth(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoWidth, false); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_
width, f); } | 1935 bool hasWillChangeOpacityHint() const { return willChangeProperties().contai
ns(CSSPropertyOpacity); } |
1434 void setHasAutoColumnWidth() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoWidth, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_w
idth, 0); } | 1936 bool hasWillChangeTransformHint() const; |
1435 void setColumnCount(unsigned short c) { SET_NESTED_VAR(m_rareNonInheritedDat
a, m_multiCol, m_autoCount, false); SET_NESTED_VAR(m_rareNonInheritedData, m_mul
tiCol, m_count, c); } | 1937 |
1436 void setHasAutoColumnCount() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_autoCount, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_c
ount, initialColumnCount()); } | 1938 // Hyphen utility functions. |
1437 void setColumnFill(ColumnFill columnFill) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_fill, columnFill); } | |
1438 void setColumnGap(float f) { SET_NESTED_VAR(m_rareNonInheritedData, m_multiC
ol, m_normalGap, false); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_ga
p, f); } | |
1439 void setHasNormalColumnGap() { SET_NESTED_VAR(m_rareNonInheritedData, m_mult
iCol, m_normalGap, true); SET_NESTED_VAR(m_rareNonInheritedData, m_multiCol, m_g
ap, 0); } | |
1440 void setColumnRuleColor(const StyleColor& c) { SET_BORDERVALUE_COLOR(m_rareN
onInheritedData.access()->m_multiCol, m_rule, c); } | |
1441 void setColumnRuleStyle(EBorderStyle b) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_multiCol, m_rule.m_style, b); } | |
1442 void setColumnRuleWidth(unsigned short w) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_rule.m_width, w); } | |
1443 void setColumnSpan(ColumnSpan columnSpan) { SET_NESTED_VAR(m_rareNonInherite
dData, m_multiCol, m_columnSpan, columnSpan); } | |
1444 void inheritColumnPropertiesFrom(const ComputedStyle& parent) { m_rareNonInh
eritedData.access()->m_multiCol = parent.m_rareNonInheritedData->m_multiCol; } | |
1445 void setHasInlineTransform(bool b) { SET_VAR(m_rareNonInheritedData, m_hasIn
lineTransform, b); } | |
1446 void setHasCompositorProxy(bool b) { SET_VAR(m_rareNonInheritedData, m_hasCo
mpositorProxy, b); } | |
1447 void setTransform(const TransformOperations& ops) { SET_NESTED_VAR(m_rareNon
InheritedData, m_transform, m_operations, ops); } | |
1448 void setTransformOriginX(const Length& v) { setTransformOrigin(TransformOrig
in(v, transformOriginY(), transformOriginZ())); } | |
1449 void setTransformOriginY(const Length& v) { setTransformOrigin(TransformOrig
in(transformOriginX(), v, transformOriginZ())); } | |
1450 void setTransformOriginZ(float f) { setTransformOrigin(TransformOrigin(trans
formOriginX(), transformOriginY(), f)); } | |
1451 void setTransformOrigin(const TransformOrigin& o) { SET_NESTED_VAR(m_rareNon
InheritedData, m_transform, m_origin, o); } | |
1452 void setTranslate(PassRefPtr<TranslateTransformOperation> v) { m_rareNonInhe
ritedData.access()->m_transform.access()->m_translate = v; } | |
1453 void setRotate(PassRefPtr<RotateTransformOperation> v) { m_rareNonInheritedD
ata.access()->m_transform.access()->m_rotate = v; } | |
1454 void setScale(PassRefPtr<ScaleTransformOperation> v) { m_rareNonInheritedDat
a.access()->m_transform.access()->m_scale = v; } | |
1455 | |
1456 void setSpeak(ESpeak s) { SET_VAR(m_rareInheritedData, speak, s); } | |
1457 void setTextCombine(TextCombine v) { SET_VAR(m_rareInheritedData, m_textComb
ine, v); } | |
1458 void setTextDecorationColor(const StyleColor& c) { SET_VAR(m_rareNonInherite
dData, m_textDecorationColor, c); } | |
1459 void setTextEmphasisColor(const StyleColor& c) { SET_VAR_WITH_SETTER(m_rareI
nheritedData, textEmphasisColor, setTextEmphasisColor, c); } | |
1460 void setTextEmphasisFill(TextEmphasisFill fill) { SET_VAR(m_rareInheritedDat
a, textEmphasisFill, fill); } | |
1461 void setTextEmphasisMark(TextEmphasisMark mark) { SET_VAR(m_rareInheritedDat
a, textEmphasisMark, mark); } | |
1462 void setTextEmphasisCustomMark(const AtomicString& mark) { SET_VAR(m_rareInh
eritedData, textEmphasisCustomMark, mark); } | |
1463 void setTextEmphasisPosition(TextEmphasisPosition position) { SET_VAR(m_rare
InheritedData, textEmphasisPosition, position); } | |
1464 bool setTextOrientation(TextOrientation); | |
1465 | |
1466 void setMotionPath(PassRefPtr<StylePath>); | |
1467 void setMotionOffset(const Length& motionOffset) { SET_NESTED_VAR(m_rareNonI
nheritedData, m_transform, m_motion.m_offset, motionOffset); } | |
1468 void setMotionRotation(const StyleMotionRotation& motionRotation) { SET_NEST
ED_VAR(m_rareNonInheritedData, m_transform, m_motion.m_rotation, motionRotation)
; } | |
1469 | |
1470 void setObjectFit(ObjectFit f) { SET_VAR(m_rareNonInheritedData, m_objectFit
, f); } | |
1471 void setObjectPosition(LengthPoint position) { SET_VAR(m_rareNonInheritedDat
a, m_objectPosition, position); } | |
1472 | |
1473 void setRubyPosition(RubyPosition position) { SET_VAR(m_rareInheritedData, m
_rubyPosition, position); } | |
1474 | |
1475 void setFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareNonInheri
tedData, m_filter, m_operations, ops); } | |
1476 void setBackdropFilter(const FilterOperations& ops) { SET_NESTED_VAR(m_rareN
onInheritedData, m_backdropFilter, m_operations, ops); } | |
1477 | |
1478 void setSnapHeightPosition(uint8_t position) { SET_VAR(m_rareInheritedData,
m_snapHeightPosition, position); } | |
1479 void setSnapHeightUnit(uint8_t unit) { SET_VAR(m_rareInheritedData, m_snapHe
ightUnit, unit); } | |
1480 | |
1481 void setTabSize(TabSize size) { SET_VAR(m_rareInheritedData, m_tabSize, size
); } | |
1482 | |
1483 void setRespectImageOrientation(RespectImageOrientationEnum v) { SET_VAR(m_r
areInheritedData, m_respectImageOrientation, v); } | |
1484 | |
1485 // End CSS3 Setters | |
1486 | |
1487 void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(m_rareNonInheritedData, m_wrap
Flow, wrapFlow); } | |
1488 void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(m_rareNonInheritedDat
a, m_wrapThrough, wrapThrough); } | |
1489 | |
1490 // Apple-specific property setters | |
1491 void setPointerEvents(EPointerEvents p) { m_inheritedData.m_pointerEvents =
p; } | |
1492 | |
1493 void setTransformStyle3D(ETransformStyle3D b) { SET_VAR(m_rareNonInheritedDa
ta, m_transformStyle3D, b); } | |
1494 void setBackfaceVisibility(EBackfaceVisibility b) { SET_VAR(m_rareNonInherit
edData, m_backfaceVisibility, b); } | |
1495 void setPerspective(float p) { SET_VAR(m_rareNonInheritedData, m_perspective
, p); } | |
1496 void setPerspectiveOriginX(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(v, perspectiveOriginY())); } | |
1497 void setPerspectiveOriginY(const Length& v) { setPerspectiveOrigin(LengthPoi
nt(perspectiveOriginX(), v)); } | |
1498 void setPerspectiveOrigin(const LengthPoint& p) { SET_VAR(m_rareNonInherited
Data, m_perspectiveOrigin, p); } | |
1499 void setPageSize(const FloatSize& s) { SET_VAR(m_rareNonInheritedData, m_pag
eSize, s); } | |
1500 void setPageSizeType(PageSizeType t) { SET_VAR(m_rareNonInheritedData, m_pag
eSizeType, t); } | |
1501 void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, m_pageSizeType, P
AGE_SIZE_AUTO); } | |
1502 | |
1503 void setHasCurrentOpacityAnimation(bool b = true) { SET_VAR(m_rareNonInherit
edData, m_hasCurrentOpacityAnimation, b); } | |
1504 void setHasCurrentTransformAnimation(bool b = true) { SET_VAR(m_rareNonInher
itedData, m_hasCurrentTransformAnimation, b); } | |
1505 void setHasCurrentFilterAnimation(bool b = true) { SET_VAR(m_rareNonInherite
dData, m_hasCurrentFilterAnimation, b); } | |
1506 void setHasCurrentBackdropFilterAnimation(bool b = true) { SET_VAR(m_rareNon
InheritedData, m_hasCurrentBackdropFilterAnimation, b); } | |
1507 | |
1508 void setIsRunningOpacityAnimationOnCompositor(bool b = true) { SET_VAR(m_rar
eNonInheritedData, m_runningOpacityAnimationOnCompositor, b); } | |
1509 void setIsRunningTransformAnimationOnCompositor(bool b = true) { SET_VAR(m_r
areNonInheritedData, m_runningTransformAnimationOnCompositor, b); } | |
1510 void setIsRunningFilterAnimationOnCompositor(bool b = true) { SET_VAR(m_rare
NonInheritedData, m_runningFilterAnimationOnCompositor, b); } | |
1511 void setIsRunningBackdropFilterAnimationOnCompositor(bool b = true) { SET_VA
R(m_rareNonInheritedData, m_runningBackdropFilterAnimationOnCompositor, b); } | |
1512 | |
1513 void setLineClamp(LineClampValue c) { SET_VAR(m_rareNonInheritedData, lineCl
amp, c); } | |
1514 void setTapHighlightColor(const Color& c) { SET_VAR(m_rareInheritedData, tap
HighlightColor, c); } | |
1515 void setTextSecurity(ETextSecurity aTextSecurity) { SET_VAR(m_rareInheritedD
ata, textSecurity, aTextSecurity); } | |
1516 void setTouchAction(TouchAction t) { SET_VAR(m_rareNonInheritedData, m_touch
Action, t); } | |
1517 | |
1518 void setScrollBehavior(ScrollBehavior b) { SET_VAR(m_rareNonInheritedData, m
_scrollBehavior, b); } | |
1519 | |
1520 void setScrollSnapType(ScrollSnapType b) { SET_VAR(m_rareNonInheritedData, m
_scrollSnapType, b); } | |
1521 void setScrollSnapPointsX(const ScrollSnapPoints& b) { SET_NESTED_VAR(m_rare
NonInheritedData, m_scrollSnap, m_xPoints, b); } | |
1522 void setScrollSnapPointsY(const ScrollSnapPoints& b) { SET_NESTED_VAR(m_rare
NonInheritedData, m_scrollSnap, m_yPoints, b); } | |
1523 void setScrollSnapDestination(const LengthPoint& b) { SET_NESTED_VAR(m_rareN
onInheritedData, m_scrollSnap, m_destination, b); } | |
1524 void setScrollSnapCoordinate(const Vector<LengthPoint>& b) { SET_NESTED_VAR(
m_rareNonInheritedData, m_scrollSnap, m_coordinates, b); } | |
1525 | |
1526 void setWillChangeProperties(const Vector<CSSPropertyID>& properties) { SET_
NESTED_VAR(m_rareNonInheritedData, m_willChange, m_properties, properties); } | |
1527 void setWillChangeContents(bool b) { SET_NESTED_VAR(m_rareNonInheritedData,
m_willChange, m_contents, b); } | |
1528 void setWillChangeScrollPosition(bool b) { SET_NESTED_VAR(m_rareNonInherited
Data, m_willChange, m_scrollPosition, b); } | |
1529 void setSubtreeWillChangeContents(bool b) { SET_VAR(m_rareInheritedData, m_s
ubtreeWillChangeContents, b); } | |
1530 | |
1531 bool requiresAcceleratedCompositingForExternalReasons(bool b) { return m_rar
eNonInheritedData->m_requiresAcceleratedCompositingForExternalReasons; } | |
1532 void setRequiresAcceleratedCompositingForExternalReasons(bool b) { SET_VAR(m
_rareNonInheritedData, m_requiresAcceleratedCompositingForExternalReasons, b); } | |
1533 | |
1534 const SVGComputedStyle& svgStyle() const { return *m_svgStyle.get(); } | |
1535 SVGComputedStyle& accessSVGStyle() { return *m_svgStyle.access(); } | |
1536 | |
1537 const SVGPaintType& fillPaintType() const { return svgStyle().fillPaintType(
); } | |
1538 Color fillPaintColor() const { return svgStyle().fillPaintColor(); } | |
1539 float fillOpacity() const { return svgStyle().fillOpacity(); } | |
1540 void setFillOpacity(float f) { accessSVGStyle().setFillOpacity(f); } | |
1541 | |
1542 const SVGPaintType& strokePaintType() const { return svgStyle().strokePaintT
ype(); } | |
1543 Color strokePaintColor() const { return svgStyle().strokePaintColor(); } | |
1544 float strokeOpacity() const { return svgStyle().strokeOpacity(); } | |
1545 void setStrokeOpacity(float f) { accessSVGStyle().setStrokeOpacity(f); } | |
1546 const UnzoomedLength& strokeWidth() const { return svgStyle().strokeWidth();
} | |
1547 void setStrokeWidth(const UnzoomedLength& w) { accessSVGStyle().setStrokeWid
th(w); } | |
1548 SVGDashArray* strokeDashArray() const { return svgStyle().strokeDashArray();
} | |
1549 void setStrokeDashArray(PassRefPtr<SVGDashArray> array) { accessSVGStyle().s
etStrokeDashArray(array); } | |
1550 const Length& strokeDashOffset() const { return svgStyle().strokeDashOffset(
); } | |
1551 void setStrokeDashOffset(const Length& d) { accessSVGStyle().setStrokeDashOf
fset(d); } | |
1552 float strokeMiterLimit() const { return svgStyle().strokeMiterLimit(); } | |
1553 void setStrokeMiterLimit(float f) { accessSVGStyle().setStrokeMiterLimit(f);
} | |
1554 | |
1555 void setD(PassRefPtr<StylePath> d) { accessSVGStyle().setD(d); } | |
1556 void setCx(const Length& cx) { accessSVGStyle().setCx(cx); } | |
1557 void setCy(const Length& cy) { accessSVGStyle().setCy(cy); } | |
1558 void setX(const Length& x) { accessSVGStyle().setX(x); } | |
1559 void setY(const Length& y) { accessSVGStyle().setY(y); } | |
1560 void setR(const Length& r) { accessSVGStyle().setR(r); } | |
1561 void setRx(const Length& rx) { accessSVGStyle().setRx(rx); } | |
1562 void setRy(const Length& ry) { accessSVGStyle().setRy(ry); } | |
1563 | |
1564 float floodOpacity() const { return svgStyle().floodOpacity(); } | |
1565 void setFloodOpacity(float f) { accessSVGStyle().setFloodOpacity(f); } | |
1566 | |
1567 float stopOpacity() const { return svgStyle().stopOpacity(); } | |
1568 void setStopOpacity(float f) { accessSVGStyle().setStopOpacity(f); } | |
1569 | |
1570 void setStopColor(const Color& c) { accessSVGStyle().setStopColor(c); } | |
1571 void setFloodColor(const Color& c) { accessSVGStyle().setFloodColor(c); } | |
1572 void setLightingColor(const Color& c) { accessSVGStyle().setLightingColor(c)
; } | |
1573 | |
1574 EBaselineShift baselineShift() const { return svgStyle().baselineShift(); } | |
1575 const Length& baselineShiftValue() const { return svgStyle().baselineShiftVa
lue(); } | |
1576 void setBaselineShiftValue(const Length& value) | |
1577 { | |
1578 SVGComputedStyle& svgStyle = accessSVGStyle(); | |
1579 svgStyle.setBaselineShift(BS_LENGTH); | |
1580 svgStyle.setBaselineShiftValue(value); | |
1581 } | |
1582 | |
1583 void setShapeOutside(ShapeValue* value) | |
1584 { | |
1585 if (m_rareNonInheritedData->m_shapeOutside == value) | |
1586 return; | |
1587 m_rareNonInheritedData.access()->m_shapeOutside = value; | |
1588 } | |
1589 ShapeValue* shapeOutside() const { return m_rareNonInheritedData->m_shapeOut
side.get(); } | |
1590 | |
1591 static ShapeValue* initialShapeOutside() { return 0; } | |
1592 | |
1593 void setClipPath(PassRefPtr<ClipPathOperation> operation) | |
1594 { | |
1595 if (m_rareNonInheritedData->m_clipPath != operation) | |
1596 m_rareNonInheritedData.access()->m_clipPath = operation; | |
1597 } | |
1598 ClipPathOperation* clipPath() const { return m_rareNonInheritedData->m_clipP
ath.get(); } | |
1599 | |
1600 static ClipPathOperation* initialClipPath() { return 0; } | |
1601 | |
1602 const Length& shapeMargin() const { return m_rareNonInheritedData->m_shapeMa
rgin; } | |
1603 void setShapeMargin(const Length& shapeMargin) { SET_VAR(m_rareNonInheritedD
ata, m_shapeMargin, shapeMargin); } | |
1604 static Length initialShapeMargin() { return Length(0, Fixed); } | |
1605 | |
1606 float shapeImageThreshold() const { return m_rareNonInheritedData->m_shapeIm
ageThreshold; } | |
1607 void setShapeImageThreshold(float shapeImageThreshold) | |
1608 { | |
1609 float clampedShapeImageThreshold = clampTo<float>(shapeImageThreshold, 0
, 1); | |
1610 SET_VAR(m_rareNonInheritedData, m_shapeImageThreshold, clampedShapeImage
Threshold); | |
1611 } | |
1612 static float initialShapeImageThreshold() { return 0; } | |
1613 | |
1614 bool hasContent() const { return contentData(); } | |
1615 ContentData* contentData() const { return m_rareNonInheritedData->m_content.
get(); } | |
1616 bool contentDataEquivalent(const ComputedStyle* otherStyle) const { return c
onst_cast<ComputedStyle*>(this)->m_rareNonInheritedData->contentDataEquivalent(*
const_cast<ComputedStyle*>(otherStyle)->m_rareNonInheritedData); } | |
1617 void setContent(ContentData*); | |
1618 | |
1619 const CounterDirectiveMap* counterDirectives() const; | |
1620 CounterDirectiveMap& accessCounterDirectives(); | |
1621 const CounterDirectives getCounterDirectives(const AtomicString& identifier)
const; | |
1622 void clearIncrementDirectives(); | |
1623 void clearResetDirectives(); | |
1624 | |
1625 QuotesData* quotes() const { return m_rareInheritedData->quotes.get(); } | |
1626 void setQuotes(PassRefPtr<QuotesData>); | |
1627 | |
1628 Hyphenation* getHyphenation() const; | 1939 Hyphenation* getHyphenation() const; |
1629 const AtomicString& hyphenString() const; | 1940 const AtomicString& hyphenString() const; |
1630 | 1941 |
1631 bool inheritedEqual(const ComputedStyle&) const; | 1942 // Line-height utility functions. |
1632 bool nonInheritedEqual(const ComputedStyle&) const; | 1943 const Length& specifiedLineHeight() const; |
1633 bool loadingCustomFontsEqual(const ComputedStyle&) const; | 1944 int computedLineHeight() const; |
1634 bool inheritedDataShared(const ComputedStyle&) const; | 1945 |
1635 | 1946 // Width/height utility functions. |
| 1947 const Length& logicalWidth() const { return isHorizontalWritingMode() ? widt
h() : height(); } |
| 1948 const Length& logicalHeight() const { return isHorizontalWritingMode() ? hei
ght() : width(); } |
| 1949 void setLogicalWidth(const Length& v) |
| 1950 { |
| 1951 if (isHorizontalWritingMode()) { |
| 1952 SET_VAR(m_box, m_width, v); |
| 1953 } else { |
| 1954 SET_VAR(m_box, m_height, v); |
| 1955 } |
| 1956 } |
| 1957 |
| 1958 void setLogicalHeight(const Length& v) |
| 1959 { |
| 1960 if (isHorizontalWritingMode()) { |
| 1961 SET_VAR(m_box, m_height, v); |
| 1962 } else { |
| 1963 SET_VAR(m_box, m_width, v); |
| 1964 } |
| 1965 } |
| 1966 const Length& logicalMaxWidth() const { return isHorizontalWritingMode() ? m
axWidth() : maxHeight(); } |
| 1967 const Length& logicalMaxHeight() const { return isHorizontalWritingMode() ?
maxHeight() : maxWidth(); } |
| 1968 const Length& logicalMinWidth() const { return isHorizontalWritingMode() ? m
inWidth() : minHeight(); } |
| 1969 const Length& logicalMinHeight() const { return isHorizontalWritingMode() ?
minHeight() : minWidth(); } |
| 1970 |
| 1971 // Margin utility functions. |
| 1972 bool hasMargin() const { return m_surround->margin.nonZero(); } |
| 1973 bool hasMarginBeforeQuirk() const { return marginBefore().quirk(); } |
| 1974 bool hasMarginAfterQuirk() const { return marginAfter().quirk(); } |
| 1975 const Length& marginBefore() const { return m_surround->margin.before(getWri
tingMode()); } |
| 1976 const Length& marginAfter() const { return m_surround->margin.after(getWriti
ngMode()); } |
| 1977 const Length& marginStart() const { return m_surround->margin.start(getWriti
ngMode(), direction()); } |
| 1978 const Length& marginEnd() const { return m_surround->margin.end(getWritingMo
de(), direction()); } |
| 1979 const Length& marginOver() const { return m_surround->margin.over(getWriting
Mode()); } |
| 1980 const Length& marginUnder() const { return m_surround->margin.under(getWriti
ngMode()); } |
| 1981 const Length& marginStartUsing(const ComputedStyle* otherStyle) const { retu
rn m_surround->margin.start(otherStyle->getWritingMode(), otherStyle->direction(
)); } |
| 1982 const Length& marginEndUsing(const ComputedStyle* otherStyle) const { return
m_surround->margin.end(otherStyle->getWritingMode(), otherStyle->direction());
} |
| 1983 const Length& marginBeforeUsing(const ComputedStyle* otherStyle) const { ret
urn m_surround->margin.before(otherStyle->getWritingMode()); } |
| 1984 const Length& marginAfterUsing(const ComputedStyle* otherStyle) const { retu
rn m_surround->margin.after(otherStyle->getWritingMode()); } |
| 1985 void setMarginStart(const Length&); |
| 1986 void setMarginEnd(const Length&); |
| 1987 |
| 1988 // Padding utility functions. |
| 1989 const LengthBox& paddingBox() const { return m_surround->padding; } |
| 1990 const Length& paddingBefore() const { return m_surround->padding.before(getW
ritingMode()); } |
| 1991 const Length& paddingAfter() const { return m_surround->padding.after(getWri
tingMode()); } |
| 1992 const Length& paddingStart() const { return m_surround->padding.start(getWri
tingMode(), direction()); } |
| 1993 const Length& paddingEnd() const { return m_surround->padding.end(getWriting
Mode(), direction()); } |
| 1994 const Length& paddingOver() const { return m_surround->padding.over(getWriti
ngMode()); } |
| 1995 const Length& paddingUnder() const { return m_surround->padding.under(getWri
tingMode()); } |
| 1996 bool hasPadding() const { return m_surround->padding.nonZero(); } |
| 1997 void resetPadding() { SET_VAR(m_surround, padding, LengthBox(Fixed)); } |
| 1998 void setPaddingBox(const LengthBox& b) { SET_VAR(m_surround, padding, b); } |
| 1999 |
| 2000 // Border utility functions |
| 2001 LayoutRectOutsets imageOutsets(const NinePieceImage&) const; |
| 2002 bool hasBorderImageOutsets() const |
| 2003 { |
| 2004 return borderImage().hasImage() && borderImage().outset().nonZero(); |
| 2005 } |
| 2006 LayoutRectOutsets borderImageOutsets() const |
| 2007 { |
| 2008 return imageOutsets(borderImage()); |
| 2009 } |
| 2010 bool borderImageSlicesFill() const { return m_surround->border.image().fill(
); } |
| 2011 |
| 2012 void setBorderImageSlicesFill(bool); |
| 2013 const BorderData& border() const { return m_surround->border; } |
| 2014 const BorderValue& borderLeft() const { return m_surround->border.left(); } |
| 2015 const BorderValue& borderRight() const { return m_surround->border.right();
} |
| 2016 const BorderValue& borderTop() const { return m_surround->border.top(); } |
| 2017 const BorderValue& borderBottom() const { return m_surround->border.bottom()
; } |
| 2018 const BorderValue& borderBefore() const; |
| 2019 const BorderValue& borderAfter() const; |
| 2020 const BorderValue& borderStart() const; |
| 2021 const BorderValue& borderEnd() const; |
| 2022 int borderAfterWidth() const; |
| 2023 int borderBeforeWidth() const; |
| 2024 int borderEndWidth() const; |
| 2025 int borderStartWidth() const; |
| 2026 int borderOverWidth() const; |
| 2027 int borderUnderWidth() const; |
| 2028 |
| 2029 bool hasBorderFill() const { return m_surround->border.hasBorderFill(); } |
| 2030 bool hasBorder() const { return m_surround->border.hasBorder(); } |
| 2031 bool hasBorderDecoration() const { return hasBorder() || hasBorderFill(); } |
| 2032 bool hasBorderRadius() const { return m_surround->border.hasBorderRadius();
} |
| 2033 |
| 2034 void resetBorder() |
| 2035 { |
| 2036 resetBorderImage(); |
| 2037 resetBorderTop(); |
| 2038 resetBorderRight(); |
| 2039 resetBorderBottom(); |
| 2040 resetBorderLeft(); |
| 2041 resetBorderTopLeftRadius(); |
| 2042 resetBorderTopRightRadius(); |
| 2043 resetBorderBottomLeftRadius(); |
| 2044 resetBorderBottomRightRadius(); |
| 2045 } |
| 2046 void resetBorderTop() { SET_VAR(m_surround, border.m_top, BorderValue()); } |
| 2047 void resetBorderRight() { SET_VAR(m_surround, border.m_right, BorderValue())
; } |
| 2048 void resetBorderBottom() { SET_VAR(m_surround, border.m_bottom, BorderValue(
)); } |
| 2049 void resetBorderLeft() { SET_VAR(m_surround, border.m_left, BorderValue());
} |
| 2050 void resetBorderImage() { SET_VAR(m_surround, border.m_image, NinePieceImage
()); } |
| 2051 void resetBorderTopLeftRadius() { SET_VAR(m_surround, border.m_topLeft, init
ialBorderRadius()); } |
| 2052 void resetBorderTopRightRadius() { SET_VAR(m_surround, border.m_topRight, in
itialBorderRadius()); } |
| 2053 void resetBorderBottomLeftRadius() { SET_VAR(m_surround, border.m_bottomLeft
, initialBorderRadius()); } |
| 2054 void resetBorderBottomRightRadius() { SET_VAR(m_surround, border.m_bottomRig
ht, initialBorderRadius()); } |
| 2055 |
| 2056 void setBorderRadius(const LengthSize& s) |
| 2057 { |
| 2058 setBorderTopLeftRadius(s); |
| 2059 setBorderTopRightRadius(s); |
| 2060 setBorderBottomLeftRadius(s); |
| 2061 setBorderBottomRightRadius(s); |
| 2062 } |
| 2063 void setBorderRadius(const IntSize& s) |
| 2064 { |
| 2065 setBorderRadius(LengthSize(Length(s.width(), Fixed), Length(s.height(),
Fixed))); |
| 2066 } |
| 2067 |
| 2068 FloatRoundedRect getRoundedBorderFor(const LayoutRect& borderRect, bool incl
udeLogicalLeftEdge = true, |
| 2069 bool includeLogicalRightEdge = true) const; |
| 2070 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, bool
includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true) const; |
| 2071 FloatRoundedRect getRoundedInnerBorderFor(const LayoutRect& borderRect, |
| 2072 const LayoutRectOutsets insets, bool includeLogicalLeftEdge, bool includ
eLogicalRightEdge) const; |
| 2073 |
| 2074 // Float utility functions. |
| 2075 bool isFloating() const { return m_nonInheritedData.m_floating != NoFloat; } |
| 2076 |
| 2077 // Mix-blend-mode utility functions. |
| 2078 bool hasBlendMode() const { return blendMode() != WebBlendModeNormal; } |
| 2079 |
| 2080 // Motion utility functions. |
| 2081 bool hasMotionPath() const { return motionPath(); } |
| 2082 |
| 2083 // Direction utility functions. |
| 2084 bool isLeftToRightDirection() const { return direction() == LTR; } |
| 2085 |
| 2086 // Perspective utility functions. |
| 2087 bool hasPerspective() const { return m_rareNonInheritedData->m_perspective >
0; } |
| 2088 |
| 2089 // Page size utility functions. |
| 2090 void resetPageSizeType() { SET_VAR(m_rareNonInheritedData, m_pageSizeType, P
AGE_SIZE_AUTO); } |
| 2091 |
| 2092 // Outline utility functions. |
| 2093 bool hasOutline() const { return outlineWidth() > 0 && outlineStyle() > Bord
erStyleHidden; } |
| 2094 int outlineOutsetExtent() const; |
| 2095 bool isOutlineEquivalent(const ComputedStyle* otherStyle) const |
| 2096 { |
| 2097 // No other style, so we don't have an outline then we consider them to
be the same. |
| 2098 if (!otherStyle) |
| 2099 return !hasOutline(); |
| 2100 return m_background->outline().visuallyEqual(otherStyle->m_background->o
utline()); |
| 2101 } |
| 2102 void setOutlineFromStyle(const ComputedStyle& o) |
| 2103 { |
| 2104 DCHECK(!isOutlineEquivalent(&o)); |
| 2105 m_background.access()->m_outline = o.m_background->m_outline; |
| 2106 } |
| 2107 |
| 2108 // Position utility functions. |
| 2109 bool hasOutOfFlowPosition() const { return position() == AbsolutePosition ||
position() == FixedPosition; } |
| 2110 bool hasInFlowPosition() const { return position() == RelativePosition || po
sition() == StickyPosition; } |
| 2111 bool hasViewportConstrainedPosition() const { return position() == FixedPosi
tion || position() == StickyPosition; } |
| 2112 |
| 2113 // Clip utility functions. |
| 2114 const Length& clipLeft() const { return m_visual->clip.left(); } |
| 2115 const Length& clipRight() const { return m_visual->clip.right(); } |
| 2116 const Length& clipTop() const { return m_visual->clip.top(); } |
| 2117 const Length& clipBottom() const { return m_visual->clip.bottom(); } |
| 2118 |
| 2119 // Offset utility functions. |
| 2120 // Accessors for positioned object edges that take into account writing mode
. |
| 2121 const Length& logicalLeft() const { return m_surround->offset.logicalLeft(ge
tWritingMode()); } |
| 2122 const Length& logicalRight() const { return m_surround->offset.logicalRight(
getWritingMode()); } |
| 2123 const Length& logicalTop() const { return m_surround->offset.before(getWriti
ngMode()); } |
| 2124 const Length& logicalBottom() const { return m_surround->offset.after(getWri
tingMode()); } |
| 2125 |
| 2126 // Whether or not a positioned element requires normal flow x/y to be comput
ed |
| 2127 // to determine its position. |
| 2128 bool hasAutoLeftAndRight() const { return left().isAuto() && right().isAuto(
); } |
| 2129 bool hasAutoTopAndBottom() const { return top().isAuto() && bottom().isAuto(
); } |
| 2130 bool hasStaticInlinePosition(bool horizontal) const { return horizontal ? ha
sAutoLeftAndRight() : hasAutoTopAndBottom(); } |
| 2131 bool hasStaticBlockPosition(bool horizontal) const { return horizontal ? has
AutoTopAndBottom() : hasAutoLeftAndRight(); } |
| 2132 |
| 2133 // Content utility functions. |
| 2134 bool contentDataEquivalent(const ComputedStyle* otherStyle) const { return c
onst_cast<ComputedStyle*>(this)->m_rareNonInheritedData->contentDataEquivalent(*
const_cast<ComputedStyle*>(otherStyle)->m_rareNonInheritedData); } |
| 2135 |
| 2136 // Contain utility functions. |
| 2137 bool containsPaint() const { return m_rareNonInheritedData->m_contain & Cont
ainsPaint; } |
| 2138 bool containsStyle() const { return m_rareNonInheritedData->m_contain & Cont
ainsStyle; } |
| 2139 bool containsLayout() const { return m_rareNonInheritedData->m_contain & Con
tainsLayout; } |
| 2140 bool containsSize() const { return m_rareNonInheritedData->m_contain & Conta
insSize; } |
| 2141 |
| 2142 // Display utility functions. |
1636 bool isDisplayReplacedType() const { return isDisplayReplacedType(display())
; } | 2143 bool isDisplayReplacedType() const { return isDisplayReplacedType(display())
; } |
1637 bool isDisplayInlineType() const { return isDisplayInlineType(display()); } | 2144 bool isDisplayInlineType() const { return isDisplayInlineType(display()); } |
1638 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(origin
alDisplay()); } | 2145 bool isOriginalDisplayInlineType() const { return isDisplayInlineType(origin
alDisplay()); } |
1639 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleBox(displa
y()) || isDisplayGridBox(display()); } | 2146 bool isDisplayFlexibleOrGridBox() const { return isDisplayFlexibleBox(displa
y()) || isDisplayGridBox(display()); } |
1640 bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display());
} | 2147 bool isDisplayFlexibleBox() const { return isDisplayFlexibleBox(display());
} |
1641 | 2148 |
1642 | 2149 // Isolation utility functions. |
1643 bool setWritingMode(WritingMode v) | 2150 bool hasIsolation() const { return isolation() != IsolationAuto; } |
1644 { | 2151 |
1645 if (v == getWritingMode()) | 2152 // Content utility functions. |
1646 return false; | 2153 bool hasContent() const { return contentData(); } |
1647 | 2154 |
1648 m_inheritedData.m_writingMode = v; | 2155 // Cursor utility functions. |
1649 return true; | 2156 CursorList* cursors() const { return m_rareInheritedData->cursorData.get();
} |
1650 } | 2157 void addCursor(StyleImage*, bool hotSpotSpecified, const IntPoint& hotSpot =
IntPoint()); |
1651 | 2158 void setCursorList(CursorList*); |
1652 // A unique style is one that has matches something that makes it impossible
to share. | 2159 void clearCursorList(); |
1653 bool unique() const { return m_nonInheritedData.m_unique; } | 2160 |
1654 void setUnique() { m_nonInheritedData.m_unique = true; } | 2161 // Text decoration utility functions. |
1655 | 2162 void applyTextDecorations(); |
1656 bool isSharable() const; | 2163 void clearAppliedTextDecorations(); |
1657 | 2164 const Vector<AppliedTextDecoration>& appliedTextDecorations() const; |
1658 bool emptyState() const { return m_nonInheritedData.m_emptyState; } | 2165 TextDecoration textDecorationsInEffect() const; |
1659 void setEmptyState(bool b) { setUnique(); m_nonInheritedData.m_emptyState =
b; } | 2166 |
1660 | 2167 // Overflow utility functions. |
1661 Color visitedDependentColor(int colorProperty) const; | 2168 |
1662 | 2169 // It's sufficient to just check one direction, since it's illegal to have v
isible on only one overflow value. |
1663 void setHasExplicitlyInheritedProperties() { m_nonInheritedData.m_explicitIn
heritance = true; } | 2170 bool isOverflowVisible() const { DCHECK(overflowX() != OverflowVisible || ov
erflowX() == overflowY()); return overflowX() == OverflowVisible; } |
1664 bool hasExplicitlyInheritedProperties() const { return m_nonInheritedData.m_
explicitInheritance; } | 2171 bool isOverflowPaged() const { return overflowY() == OverflowPagedX || overf
lowY() == OverflowPagedY; } |
1665 | 2172 |
1666 void setHasVariableReferenceFromNonInheritedProperty() { m_nonInheritedData.
m_variableReference = true; } | 2173 // Animation utility functions. |
1667 bool hasVariableReferenceFromNonInheritedProperty() const { return m_nonInhe
ritedData.m_variableReference; } | 2174 bool shouldCompositeForCurrentAnimations() const { return hasCurrentOpacityA
nimation() || hasCurrentTransformAnimation() || hasCurrentFilterAnimation() || h
asCurrentBackdropFilterAnimation(); } |
1668 | 2175 bool isRunningAnimationOnCompositor() const { return isRunningOpacityAnimati
onOnCompositor() || isRunningTransformAnimationOnCompositor() || isRunningFilter
AnimationOnCompositor() || isRunningBackdropFilterAnimationOnCompositor(); } |
1669 bool hasChildDependentFlags() const { return emptyState() || hasExplicitlyIn
heritedProperties(); } | 2176 |
1670 void copyChildDependentFlagsFrom(const ComputedStyle&); | 2177 // Opacity utility functions. |
1671 | 2178 bool hasOpacity() const { return opacity() < 1.0f; } |
| 2179 |
| 2180 // Table layout utility functions. |
| 2181 bool isFixedTableLayout() const { return tableLayout() == TableLayoutFixed &
& !logicalWidth().isAuto(); } |
| 2182 |
| 2183 // Filter/transform utility functions. |
| 2184 bool has3DTransform() const { return m_rareNonInheritedData->m_transform->ha
s3DTransform(); } |
| 2185 bool hasTransform() const { return hasTransformOperations() || hasMotionPath
() || hasCurrentTransformAnimation() || translate() || rotate() || scale(); } |
| 2186 bool hasTransformOperations() const { return !m_rareNonInheritedData->m_tran
sform->m_operations.operations().isEmpty(); } |
| 2187 ETransformStyle3D usedTransformStyle3D() const { return hasGroupingProperty(
) ? TransformStyle3DFlat : transformStyle3D(); } |
| 2188 bool transformDataEquivalent(const ComputedStyle& otherStyle) const { return
m_rareNonInheritedData->m_transform == otherStyle.m_rareNonInheritedData->m_tra
nsform; } |
| 2189 bool preserves3D() const { return usedTransformStyle3D() != TransformStyle3D
Flat; } |
| 2190 enum ApplyTransformOrigin { IncludeTransformOrigin, ExcludeTransformOrigin }
; |
| 2191 enum ApplyMotionPath { IncludeMotionPath, ExcludeMotionPath }; |
| 2192 enum ApplyIndependentTransformProperties { IncludeIndependentTransformProper
ties , ExcludeIndependentTransformProperties }; |
| 2193 void applyTransform(TransformationMatrix&, const LayoutSize& borderBoxSize,
ApplyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) cons
t; |
| 2194 void applyTransform(TransformationMatrix&, const FloatRect& boundingBox, App
lyTransformOrigin, ApplyMotionPath, ApplyIndependentTransformProperties) const; |
| 2195 |
| 2196 // Returns |true| if any property that renders using filter operations is |
| 2197 // used (including, but not limited to, 'filter'). |
| 2198 bool hasFilterInducingProperty() const { return hasFilter() || (RuntimeEnabl
edFeatures::cssBoxReflectFilterEnabled() && hasBoxReflect()); } |
| 2199 |
| 2200 // Returns |true| if opacity should be considered to have non-initial value
for the purpose |
| 2201 // of creating stacking contexts. |
| 2202 bool hasNonInitialOpacity() const { return hasOpacity() || hasWillChangeOpac
ityHint() || hasCurrentOpacityAnimation(); } |
| 2203 |
| 2204 // Returns whether this style contains any grouping property as defined by [
css-transforms]. |
| 2205 // The main purpose of this is to adjust the used value of transform-style p
roperty. |
| 2206 // Note: We currently don't include every grouping property on the spec to m
aintain |
| 2207 // backward compatibility. |
| 2208 // [css-transforms] https://drafts.csswg.org/css-transforms/#grouping-proper
ty-values |
| 2209 bool hasGroupingProperty() const { return !isOverflowVisible() || hasFilterI
nducingProperty() || hasNonInitialOpacity(); } |
| 2210 |
| 2211 // Return true if any transform related property (currently transform/motion
Path, transformStyle3D, perspective, |
| 2212 // or will-change:transform) indicates that we are transforming. will-change
:transform should result in |
| 2213 // the same rendering behavior as having a transform, including the creation
of a containing block |
| 2214 // for fixed position descendants. |
| 2215 bool hasTransformRelatedProperty() const { return hasTransform() || preserve
s3D() || hasPerspective() || hasWillChangeTransformHint(); } |
| 2216 |
| 2217 // Paint utility functions. |
| 2218 void addPaintImage(StyleImage*); |
| 2219 |
| 2220 // FIXME: reflections should belong to this helper function but they are cur
rently handled |
| 2221 // through their self-painting layers. So the layout code doesn't account fo
r them. |
| 2222 bool hasVisualOverflowingEffect() const { return boxShadow() || hasBorderIma
geOutsets() || hasOutline(); } |
| 2223 |
| 2224 // Stacking contexts and positioned elements[1] are stacked (sorted in negZO
rderList |
| 2225 // and posZOrderList) in their enclosing stacking contexts. |
| 2226 // |
| 2227 // [1] According to CSS2.1, Appendix E.2.8 (https://www.w3.org/TR/CSS21/zind
ex.html), |
| 2228 // positioned elements with 'z-index: auto' are "treated as if it created a
new |
| 2229 // stacking context" and z-ordered together with other elements with 'z-inde
x: 0'. |
| 2230 // The difference of them from normal stacking contexts is that they don't d
etermine |
| 2231 // the stacking of the elements underneath them. |
| 2232 // (Note: There are also other elements treated as stacking context during p
ainting, |
| 2233 // but not managed in stacks. See ObjectPainter::paintAllPhasesAtomically().
) |
| 2234 void updateIsStackingContext(bool isDocumentElement, bool isInTopLayer); |
| 2235 bool isStacked() const { return isStackingContext() || position() != StaticP
osition; } |
| 2236 |
| 2237 // Pseudo-styles |
| 2238 bool hasAnyPublicPseudoStyles() const; |
| 2239 bool hasPseudoStyle(PseudoId) const; |
| 2240 void setHasPseudoStyle(PseudoId); |
| 2241 bool hasUniquePseudoStyle() const; |
| 2242 bool hasPseudoElementStyle() const; |
| 2243 |
| 2244 // Note: canContainAbsolutePositionObjects should return true if canContainF
ixedPositionObjects. |
| 2245 // We currently never use this value directly, always OR'ing it with canCont
ainFixedPositionObjects. |
| 2246 bool canContainAbsolutePositionObjects() const { return position() != Static
Position; } |
| 2247 bool canContainFixedPositionObjects() const { return hasTransformRelatedProp
erty() || containsPaint();} |
| 2248 |
| 2249 // Whitespace utility functions. |
| 2250 static bool autoWrap(EWhiteSpace ws) |
| 2251 { |
| 2252 // Nowrap and pre don't automatically wrap. |
| 2253 return ws != NOWRAP && ws != PRE; |
| 2254 } |
| 2255 |
| 2256 bool autoWrap() const |
| 2257 { |
| 2258 return autoWrap(whiteSpace()); |
| 2259 } |
| 2260 |
| 2261 static bool preserveNewline(EWhiteSpace ws) |
| 2262 { |
| 2263 // Normal and nowrap do not preserve newlines. |
| 2264 return ws != NORMAL && ws != NOWRAP; |
| 2265 } |
| 2266 |
| 2267 bool preserveNewline() const |
| 2268 { |
| 2269 return preserveNewline(whiteSpace()); |
| 2270 } |
| 2271 |
| 2272 static bool collapseWhiteSpace(EWhiteSpace ws) |
| 2273 { |
| 2274 // Pre and prewrap do not collapse whitespace. |
| 2275 return ws != PRE && ws != PRE_WRAP; |
| 2276 } |
| 2277 |
| 2278 bool collapseWhiteSpace() const |
| 2279 { |
| 2280 return collapseWhiteSpace(whiteSpace()); |
| 2281 } |
| 2282 |
| 2283 bool isCollapsibleWhiteSpace(UChar c) const |
| 2284 { |
| 2285 switch (c) { |
| 2286 case ' ': |
| 2287 case '\t': |
| 2288 return collapseWhiteSpace(); |
| 2289 case '\n': |
| 2290 return !preserveNewline(); |
| 2291 } |
| 2292 return false; |
| 2293 } |
| 2294 bool breakOnlyAfterWhiteSpace() const |
| 2295 { |
| 2296 return whiteSpace() == PRE_WRAP || getLineBreak() == LineBreakAfterWhite
Space; |
| 2297 } |
| 2298 |
| 2299 bool breakWords() const |
| 2300 { |
| 2301 return (wordBreak() == BreakWordBreak || overflowWrap() == BreakOverflow
Wrap) |
| 2302 && whiteSpace() != PRE && whiteSpace() != NOWRAP; |
| 2303 } |
| 2304 |
| 2305 // Text direction utility functions. |
| 2306 bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { return !isLef
tToRightDirection() && isHorizontalWritingMode(); } |
| 2307 bool hasInlinePaginationAxis() const |
| 2308 { |
| 2309 // If the pagination axis is parallel with the writing mode inline axis,
columns may be laid |
| 2310 // out along the inline axis, just like for regular multicol. Otherwise,
we need to lay out |
| 2311 // along the block axis. |
| 2312 if (isOverflowPaged()) |
| 2313 return (overflowY() == OverflowPagedX) == isHorizontalWritingMode(); |
| 2314 return false; |
| 2315 } |
| 2316 |
| 2317 // Border utility functions. |
| 2318 bool borderObscuresBackground() const; |
| 2319 void getBorderEdgeInfo(BorderEdge edges[], bool includeLogicalLeftEdge = tru
e, bool includeLogicalRightEdge = true) const; |
1672 bool hasBoxDecorations() const | 2320 bool hasBoxDecorations() const |
1673 { | 2321 { |
1674 return hasBorderDecoration() | 2322 return hasBorderDecoration() |
1675 || hasBorderRadius() | 2323 || hasBorderRadius() |
1676 || hasOutline() | 2324 || hasOutline() |
1677 || hasAppearance() | 2325 || hasAppearance() |
1678 || boxShadow() | 2326 || boxShadow() |
1679 || hasFilterInducingProperty() | 2327 || hasFilterInducingProperty() |
1680 || hasBackdropFilter() | 2328 || hasBackdropFilter() |
1681 || resize() != RESIZE_NONE; | 2329 || resize() != RESIZE_NONE; |
1682 } | 2330 } |
1683 | 2331 |
1684 bool borderObscuresBackground() const; | 2332 // Background utility functions. |
1685 void getBorderEdgeInfo(BorderEdge edges[], bool includeLogicalLeftEdge = tru
e, bool includeLogicalRightEdge = true) const; | 2333 FillLayer& accessBackgroundLayers() { return m_background.access()->m_backgr
ound; } |
| 2334 const FillLayer& backgroundLayers() const { return m_background->background(
); } |
| 2335 void adjustBackgroundLayers() |
| 2336 { |
| 2337 if (backgroundLayers().next()) { |
| 2338 accessBackgroundLayers().cullEmptyLayers(); |
| 2339 accessBackgroundLayers().fillUnsetProperties(); |
| 2340 } |
| 2341 } |
| 2342 bool hasBackgroundRelatedColorReferencingCurrentColor() const |
| 2343 { |
| 2344 if (backgroundColor().isCurrentColor() || visitedLinkBackgroundColor().i
sCurrentColor()) |
| 2345 return true; |
| 2346 if (!boxShadow()) |
| 2347 return false; |
| 2348 return shadowListHasCurrentColor(boxShadow()); |
| 2349 } |
| 2350 bool hasBackground() const |
| 2351 { |
| 2352 Color color = visitedDependentColor(CSSPropertyBackgroundColor); |
| 2353 if (color.alpha()) |
| 2354 return true; |
| 2355 return hasBackgroundImage(); |
| 2356 } |
1686 | 2357 |
1687 void setHasAuthorBackground(bool authorBackground) { SET_VAR(m_rareNonInheri
tedData, m_hasAuthorBackground, authorBackground); } | |
1688 void setHasAuthorBorder(bool authorBorder) { SET_VAR(m_rareNonInheritedData,
m_hasAuthorBorder, authorBorder); } | |
1689 bool hasAuthorBackground() const { return m_rareNonInheritedData->m_hasAutho
rBackground; }; | |
1690 bool hasAuthorBorder() const { return m_rareNonInheritedData->m_hasAuthorBor
der; }; | |
1691 | 2358 |
1692 void addPaintImage(StyleImage*); | 2359 // Color utility functions. |
| 2360 // TODO(sashab): Rename this to just getColor(), and add a comment explainin
g how it works. |
| 2361 Color visitedDependentColor(int colorProperty) const; |
1693 | 2362 |
1694 // Initial values for all the properties | 2363 // -webkit-appearance utility functions. |
1695 static EBorderCollapse initialBorderCollapse() { return BorderCollapseSepara
te; } | 2364 bool hasAppearance() const { return appearance() != NoControlPart; } |
1696 static EBorderStyle initialBorderStyle() { return BorderStyleNone; } | 2365 |
1697 static OutlineIsAuto initialOutlineStyleIsAuto() { return OutlineIsAutoOff;
} | 2366 // Other utility functions. |
1698 static NinePieceImage initialNinePieceImage() { return NinePieceImage(); } | 2367 bool isStyleAvailable() const; |
1699 static LengthSize initialBorderRadius() { return LengthSize(Length(0, Fixed)
, Length(0, Fixed)); } | 2368 bool isSharable() const; |
1700 static ECaptionSide initialCaptionSide() { return CaptionSideTop; } | 2369 |
1701 static EClear initialClear() { return ClearNone; } | 2370 // TODO(sashab) Remove these. |
1702 static LengthBox initialClip() { return LengthBox(); } | |
1703 static Containment initialContain() { return ContainsNone; } | |
1704 static TextDirection initialDirection() { return LTR; } | |
1705 static WritingMode initialWritingMode() { return TopToBottomWritingMode; } | |
1706 static TextCombine initialTextCombine() { return TextCombineNone; } | |
1707 static TextOrientation initialTextOrientation() { return TextOrientationMixe
d; } | |
1708 static ObjectFit initialObjectFit() { return ObjectFitFill; } | |
1709 static LengthPoint initialObjectPosition() { return LengthPoint(Length(50.0,
Percent), Length(50.0, Percent)); } | |
1710 static EDisplay initialDisplay() { return INLINE; } | |
1711 static EEmptyCells initialEmptyCells() { return EmptyCellsShow; } | |
1712 static EFloat initialFloating() { return NoFloat; } | |
1713 static EListStylePosition initialListStylePosition() { return ListStylePosit
ionOutside; } | |
1714 static EListStyleType initialListStyleType() { return Disc; } | |
1715 static EOverflowAnchor initialOverflowAnchor() { return AnchorAuto; } | |
1716 static EOverflow initialOverflowX() { return OverflowVisible; } | |
1717 static EOverflow initialOverflowY() { return OverflowVisible; } | |
1718 static EBreak initialBreakAfter() { return BreakAuto; } | |
1719 static EBreak initialBreakBefore() { return BreakAuto; } | |
1720 static EBreak initialBreakInside() { return BreakAuto; } | |
1721 static EPosition initialPosition() { return StaticPosition; } | |
1722 static ETableLayout initialTableLayout() { return TableLayoutAuto; } | |
1723 static EUnicodeBidi initialUnicodeBidi() { return UBNormal; } | |
1724 static ETextTransform initialTextTransform() { return TTNONE; } | |
1725 static EVisibility initialVisibility() { return VISIBLE; } | |
1726 static EWhiteSpace initialWhiteSpace() { return NORMAL; } | |
1727 static short initialHorizontalBorderSpacing() { return 0; } | |
1728 static short initialVerticalBorderSpacing() { return 0; } | |
1729 static ECursor initialCursor() { return CURSOR_AUTO; } | |
1730 static Color initialColor() { return Color::black; } | |
1731 static StyleImage* initialListStyleImage() { return 0; } | |
1732 static unsigned initialBorderWidth() { return 3; } | |
1733 static unsigned short initialColumnRuleWidth() { return 3; } | |
1734 static unsigned short initialOutlineWidth() { return 3; } | |
1735 static float initialLetterWordSpacing() { return 0.0f; } | |
1736 static Length initialSize() { return Length(); } | |
1737 static Length initialMinSize() { return Length(); } | |
1738 static Length initialMaxSize() { return Length(MaxSizeNone); } | |
1739 static Length initialOffset() { return Length(); } | |
1740 static Length initialMargin() { return Length(Fixed); } | |
1741 static Length initialPadding() { return Length(Fixed); } | |
1742 static Length initialTextIndent() { return Length(Fixed); } | |
1743 static TextIndentLine initialTextIndentLine() { return TextIndentFirstLine;
} | |
1744 static TextIndentType initialTextIndentType() { return TextIndentNormal; } | |
1745 static EVerticalAlign initialVerticalAlign() { return VerticalAlignBaseline;
} | |
1746 static short initialWidows() { return 2; } | |
1747 static short initialOrphans() { return 2; } | |
1748 static Length initialLineHeight() { return Length(-100.0, Percent); } | |
1749 static ETextAlign initialTextAlign() { return TASTART; } | |
1750 static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } | |
1751 static TextJustify initialTextJustify() { return TextJustifyAuto; } | |
1752 static TextDecoration initialTextDecoration() { return TextDecorationNone; } | |
1753 static TextUnderlinePosition initialTextUnderlinePosition() { return TextUnd
erlinePositionAuto; } | |
1754 static TextDecorationStyle initialTextDecorationStyle() { return TextDecorat
ionStyleSolid; } | |
1755 static float initialZoom() { return 1.0f; } | |
1756 static int initialOutlineOffset() { return 0; } | |
1757 static float initialOpacity() { return 1.0f; } | |
1758 static EBoxAlignment initialBoxAlign() { return BSTRETCH; } | |
1759 static EBoxDecorationBreak initialBoxDecorationBreak() { return BoxDecoratio
nBreakSlice; } | |
1760 static EBoxDirection initialBoxDirection() { return BNORMAL; } | |
1761 static EBoxLines initialBoxLines() { return SINGLE; } | |
1762 static EBoxOrient initialBoxOrient() { return HORIZONTAL; } | |
1763 static EBoxPack initialBoxPack() { return BoxPackStart; } | |
1764 static float initialBoxFlex() { return 0.0f; } | |
1765 static unsigned initialBoxFlexGroup() { return 1; } | |
1766 static unsigned initialBoxOrdinalGroup() { return 1; } | |
1767 static EBoxSizing initialBoxSizing() { return BoxSizingContentBox; } | |
1768 static StyleReflection* initialBoxReflect() { return 0; } | |
1769 static float initialFlexGrow() { return 0; } | |
1770 static float initialFlexShrink() { return 1; } | |
1771 static Length initialFlexBasis() { return Length(Auto); } | |
1772 static int initialOrder() { return 0; } | |
1773 static StyleContentAlignmentData initialContentAlignment() { return StyleCon
tentAlignmentData(ContentPositionNormal, ContentDistributionDefault, OverflowAli
gnmentDefault); } | |
1774 static StyleSelfAlignmentData initialSelfAlignment() { return StyleSelfAlign
mentData(ItemPositionAuto, OverflowAlignmentDefault); } | |
1775 static EFlexDirection initialFlexDirection() { return FlowRow; } | |
1776 static EFlexWrap initialFlexWrap() { return FlexNoWrap; } | |
1777 static EUserModify initialUserModify() { return READ_ONLY; } | |
1778 static EUserDrag initialUserDrag() { return DRAG_AUTO; } | |
1779 static EUserSelect initialUserSelect() { return SELECT_TEXT; } | |
1780 static TextOverflow initialTextOverflow() { return TextOverflowClip; } | |
1781 static EMarginCollapse initialMarginBeforeCollapse() { return MarginCollapse
Collapse; } | |
1782 static EMarginCollapse initialMarginAfterCollapse() { return MarginCollapseC
ollapse; } | |
1783 static EWordBreak initialWordBreak() { return NormalWordBreak; } | |
1784 static EOverflowWrap initialOverflowWrap() { return NormalOverflowWrap; } | |
1785 static LineBreak initialLineBreak() { return LineBreakAuto; } | |
1786 static const AtomicString& initialHighlight() { return nullAtom; } | |
1787 static ESpeak initialSpeak() { return SpeakNormal; } | |
1788 static Hyphens initialHyphens() { return HyphensManual; } | |
1789 static const AtomicString& initialHyphenationString() { return nullAtom; } | |
1790 static EResize initialResize() { return RESIZE_NONE; } | |
1791 static ControlPart initialAppearance() { return NoControlPart; } | |
1792 static Order initialRTLOrdering() { return LogicalOrder; } | |
1793 static float initialTextStrokeWidth() { return 0; } | |
1794 static unsigned short initialColumnCount() { return 1; } | |
1795 static ColumnFill initialColumnFill() { return ColumnFillBalance; } | |
1796 static ColumnSpan initialColumnSpan() { return ColumnSpanNone; } | |
1797 static EmptyTransformOperations initialTransform() { return EmptyTransformOp
erations(); } | |
1798 static PassRefPtr<TranslateTransformOperation> initialTranslate() { return T
ranslateTransformOperation::create(Length(0, Fixed), Length(0, Fixed), 0, Transf
ormOperation::Translate3D); } | |
1799 static PassRefPtr<RotateTransformOperation> initialRotate() { return RotateT
ransformOperation::create(0, 0, 1, 0, TransformOperation::Rotate3D); } | |
1800 static PassRefPtr<ScaleTransformOperation> initialScale() { return ScaleTran
sformOperation::create(1, 1, 1, TransformOperation::Scale3D); } | |
1801 static Length initialTransformOriginX() { return Length(50.0, Percent); } | |
1802 static Length initialTransformOriginY() { return Length(50.0, Percent); } | |
1803 static float initialTransformOriginZ() { return 0; } | |
1804 static TransformOrigin initialTransformOrigin() { return TransformOrigin(Len
gth(50.0, Percent), Length(50.0, Percent), 0); } | |
1805 static EPointerEvents initialPointerEvents() { return PE_AUTO; } | |
1806 static ETransformStyle3D initialTransformStyle3D() { return TransformStyle3D
Flat; } | |
1807 static StylePath* initialMotionPath() { return nullptr; } | |
1808 static Length initialMotionOffset() { return Length(0, Fixed); } | |
1809 static StyleMotionRotation initialMotionRotation() { return StyleMotionRotat
ion(0, MotionRotationAuto); } | |
1810 static EBackfaceVisibility initialBackfaceVisibility() { return BackfaceVisi
bilityVisible; } | |
1811 static float initialPerspective() { return 0; } | |
1812 static Length initialPerspectiveOriginX() { return Length(50.0, Percent); } | |
1813 static Length initialPerspectiveOriginY() { return Length(50.0, Percent); } | |
1814 static LengthPoint initialPerspectiveOrigin() { return LengthPoint(Length(50
.0, Percent), Length(50.0, Percent)); } | |
1815 static Color initialBackgroundColor() { return Color::transparent; } | |
1816 static TextEmphasisFill initialTextEmphasisFill() { return TextEmphasisFillF
illed; } | |
1817 static TextEmphasisMark initialTextEmphasisMark() { return TextEmphasisMarkN
one; } | |
1818 static const AtomicString& initialTextEmphasisCustomMark() { return nullAtom
; } | |
1819 static TextEmphasisPosition initialTextEmphasisPosition() { return TextEmpha
sisPositionOver; } | |
1820 static RubyPosition initialRubyPosition() { return RubyPositionBefore; } | |
1821 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft
; } | 2371 static ImageOrientationEnum initialImageOrientation() { return OriginTopLeft
; } |
1822 static RespectImageOrientationEnum initialRespectImageOrientation() { return
DoNotRespectImageOrientation; } | |
1823 static EImageRendering initialImageRendering() { return ImageRenderingAuto;
} | |
1824 static ImageResolutionSource initialImageResolutionSource() { return ImageRe
solutionSpecified; } | 2372 static ImageResolutionSource initialImageResolutionSource() { return ImageRe
solutionSpecified; } |
1825 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolu
tionNoSnap; } | 2373 static ImageResolutionSnap initialImageResolutionSnap() { return ImageResolu
tionNoSnap; } |
1826 static float initialImageResolution() { return 1; } | 2374 static float initialImageResolution() { return 1; } |
1827 static StyleImage* initialBorderImageSource() { return 0; } | 2375 void setWrapFlow(WrapFlow wrapFlow) { SET_VAR(m_rareNonInheritedData, m_wrap
Flow, wrapFlow); } |
1828 static StyleImage* initialMaskBoxImageSource() { return 0; } | 2376 void setWrapThrough(WrapThrough wrapThrough) { SET_VAR(m_rareNonInheritedDat
a, m_wrapThrough, wrapThrough); } |
1829 static PrintColorAdjust initialPrintColorAdjust() { return PrintColorAdjustE
conomy; } | |
1830 static TouchAction initialTouchAction() { return TouchActionAuto; } | |
1831 static ShadowList* initialBoxShadow() { return 0; } | |
1832 static ShadowList* initialTextShadow() { return 0; } | |
1833 static StyleVariableData* initialVariables() { return nullptr; } | |
1834 static ScrollBehavior initialScrollBehavior() { return ScrollBehaviorAuto; } | |
1835 static ScrollSnapType initialScrollSnapType() { return ScrollSnapTypeNone; } | |
1836 static ScrollSnapPoints initialScrollSnapPointsX() { return ScrollSnapPoints
(); } | |
1837 static ScrollSnapPoints initialScrollSnapPointsY() { return ScrollSnapPoints
(); } | |
1838 static LengthPoint initialScrollSnapDestination() { return LengthPoint(Lengt
h(0, Fixed), Length(0, Fixed)); } | |
1839 static Vector<LengthPoint> initialScrollSnapCoordinate() { return Vector<Len
gthPoint>(); } | |
1840 | 2377 |
1841 // The initial value is 'none' for grid tracks. | |
1842 static Vector<GridTrackSize> initialGridTemplateColumns() { return Vector<Gr
idTrackSize>(); } | |
1843 static Vector<GridTrackSize> initialGridTemplateRows() { return Vector<GridT
rackSize>(); } | |
1844 static Vector<GridTrackSize> initialGridAutoRepeatTracks() { return Vector<G
ridTrackSize>(); } | |
1845 static size_t initialGridAutoRepeatInsertionPoint() { return 0; } | |
1846 static AutoRepeatType initialGridAutoRepeatType() { return NoAutoRepeat; } | |
1847 | |
1848 static GridAutoFlow initialGridAutoFlow() { return AutoFlowRow; } | |
1849 | |
1850 static Vector<GridTrackSize> initialGridAutoColumns(); | |
1851 static Vector<GridTrackSize> initialGridAutoRows(); | |
1852 | |
1853 static NamedGridLinesMap initialNamedGridColumnLines() { return NamedGridLin
esMap(); } | |
1854 static NamedGridLinesMap initialNamedGridRowLines() { return NamedGridLinesM
ap(); } | |
1855 | |
1856 static OrderedNamedGridLines initialOrderedNamedGridColumnLines() { return O
rderedNamedGridLines(); } | |
1857 static OrderedNamedGridLines initialOrderedNamedGridRowLines() { return Orde
redNamedGridLines(); } | |
1858 | |
1859 static NamedGridAreaMap initialNamedGridArea() { return NamedGridAreaMap();
} | |
1860 static size_t initialNamedGridAreaCount() { return 0; } | |
1861 | |
1862 static Length initialGridColumnGap() { return Length(Fixed); } | |
1863 static Length initialGridRowGap() { return Length(Fixed); } | |
1864 | |
1865 // 'auto' is the default. | |
1866 static GridPosition initialGridColumnStart() { return GridPosition(); } | |
1867 static GridPosition initialGridColumnEnd() { return GridPosition(); } | |
1868 static GridPosition initialGridRowStart() { return GridPosition(); } | |
1869 static GridPosition initialGridRowEnd() { return GridPosition(); } | |
1870 | |
1871 static TabSize initialTabSize() { return TabSize(8); } | |
1872 | |
1873 static TextSizeAdjust initialTextSizeAdjust() { return TextSizeAdjust::adjus
tAuto(); } | |
1874 | |
1875 static WrapFlow initialWrapFlow() { return WrapFlowAuto; } | |
1876 static WrapThrough initialWrapThrough() { return WrapThroughWrap; } | |
1877 | |
1878 static QuotesData* initialQuotes() { return 0; } | |
1879 | |
1880 // Keep these at the end. | |
1881 // FIXME: Why? Seems these should all be one big sorted list. | |
1882 static LineClampValue initialLineClamp() { return LineClampValue(); } | |
1883 static ETextSecurity initialTextSecurity() { return TSNONE; } | |
1884 static Color initialTapHighlightColor(); | |
1885 static const FilterOperations& initialFilter(); | |
1886 static const FilterOperations& initialBackdropFilter(); | |
1887 static WebBlendMode initialBlendMode() { return WebBlendModeNormal; } | |
1888 static EIsolation initialIsolation() { return IsolationAuto; } | |
1889 private: | 2378 private: |
1890 void setVisitedLinkColor(const Color&); | 2379 void setVisitedLinkColor(const Color&); |
1891 void setVisitedLinkBackgroundColor(const StyleColor& v) { SET_VAR(m_rareNonI
nheritedData, m_visitedLinkBackgroundColor, v); } | 2380 void setVisitedLinkBackgroundColor(const StyleColor& v) { SET_VAR(m_rareNonI
nheritedData, m_visitedLinkBackgroundColor, v); } |
1892 void setVisitedLinkBorderLeftColor(const StyleColor& v) { SET_VAR(m_rareNonI
nheritedData, m_visitedLinkBorderLeftColor, v); } | 2381 void setVisitedLinkBorderLeftColor(const StyleColor& v) { SET_VAR(m_rareNonI
nheritedData, m_visitedLinkBorderLeftColor, v); } |
1893 void setVisitedLinkBorderRightColor(const StyleColor& v) { SET_VAR(m_rareNon
InheritedData, m_visitedLinkBorderRightColor, v); } | 2382 void setVisitedLinkBorderRightColor(const StyleColor& v) { SET_VAR(m_rareNon
InheritedData, m_visitedLinkBorderRightColor, v); } |
1894 void setVisitedLinkBorderBottomColor(const StyleColor& v) { SET_VAR(m_rareNo
nInheritedData, m_visitedLinkBorderBottomColor, v); } | 2383 void setVisitedLinkBorderBottomColor(const StyleColor& v) { SET_VAR(m_rareNo
nInheritedData, m_visitedLinkBorderBottomColor, v); } |
1895 void setVisitedLinkBorderTopColor(const StyleColor& v) { SET_VAR(m_rareNonIn
heritedData, m_visitedLinkBorderTopColor, v); } | 2384 void setVisitedLinkBorderTopColor(const StyleColor& v) { SET_VAR(m_rareNonIn
heritedData, m_visitedLinkBorderTopColor, v); } |
1896 void setVisitedLinkOutlineColor(const StyleColor& v) { SET_VAR(m_rareNonInhe
ritedData, m_visitedLinkOutlineColor, v); } | 2385 void setVisitedLinkOutlineColor(const StyleColor& v) { SET_VAR(m_rareNonInhe
ritedData, m_visitedLinkOutlineColor, v); } |
1897 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_NESTED_VAR(m_r
areNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); } | 2386 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_NESTED_VAR(m_r
areNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); } |
1898 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(m_rare
NonInheritedData, m_visitedLinkTextDecorationColor, v); } | 2387 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(m_rare
NonInheritedData, m_visitedLinkTextDecorationColor, v); } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2065 } | 2554 } |
2066 | 2555 |
2067 inline bool ComputedStyle::hasPseudoElementStyle() const | 2556 inline bool ComputedStyle::hasPseudoElementStyle() const |
2068 { | 2557 { |
2069 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 2558 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
2070 } | 2559 } |
2071 | 2560 |
2072 } // namespace blink | 2561 } // namespace blink |
2073 | 2562 |
2074 #endif // ComputedStyle_h | 2563 #endif // ComputedStyle_h |
OLD | NEW |