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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 m_inheritedData.m_direction = initialDirection(); | 354 m_inheritedData.m_direction = initialDirection(); |
355 m_inheritedData.m_whiteSpace = initialWhiteSpace(); | 355 m_inheritedData.m_whiteSpace = initialWhiteSpace(); |
356 m_inheritedData.m_borderCollapse = initialBorderCollapse(); | 356 m_inheritedData.m_borderCollapse = initialBorderCollapse(); |
357 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); | 357 m_inheritedData.m_rtlOrdering = initialRTLOrdering(); |
358 m_inheritedData.m_boxDirection = initialBoxDirection(); | 358 m_inheritedData.m_boxDirection = initialBoxDirection(); |
359 m_inheritedData.m_printColorAdjust = initialPrintColorAdjust(); | 359 m_inheritedData.m_printColorAdjust = initialPrintColorAdjust(); |
360 m_inheritedData.m_pointerEvents = initialPointerEvents(); | 360 m_inheritedData.m_pointerEvents = initialPointerEvents(); |
361 m_inheritedData.m_insideLink = NotInsideLink; | 361 m_inheritedData.m_insideLink = NotInsideLink; |
362 m_inheritedData.m_writingMode = initialWritingMode(); | 362 m_inheritedData.m_writingMode = initialWritingMode(); |
363 | 363 |
364 m_nonInheritedData.m_effectiveDisplay = m_nonInheritedData.m_originalDis
play = initialDisplay(); | 364 m_nonInheritedData.m_effectiveDisplay = m_nonInheritedData.m_originalDis
play = static_cast<unsigned>(initialDisplay()); |
365 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor(); | 365 m_nonInheritedData.m_overflowAnchor = initialOverflowAnchor(); |
366 m_nonInheritedData.m_overflowX = initialOverflowX(); | 366 m_nonInheritedData.m_overflowX = initialOverflowX(); |
367 m_nonInheritedData.m_overflowY = initialOverflowY(); | 367 m_nonInheritedData.m_overflowY = initialOverflowY(); |
368 m_nonInheritedData.m_verticalAlign = initialVerticalAlign(); | 368 m_nonInheritedData.m_verticalAlign = initialVerticalAlign(); |
369 m_nonInheritedData.m_clear = initialClear(); | 369 m_nonInheritedData.m_clear = initialClear(); |
370 m_nonInheritedData.m_position = initialPosition(); | 370 m_nonInheritedData.m_position = initialPosition(); |
371 m_nonInheritedData.m_floating = static_cast<unsigned>(initialFloating())
; | 371 m_nonInheritedData.m_floating = static_cast<unsigned>(initialFloating())
; |
372 m_nonInheritedData.m_tableLayout = initialTableLayout(); | 372 m_nonInheritedData.m_tableLayout = initialTableLayout(); |
373 m_nonInheritedData.m_unicodeBidi = initialUnicodeBidi(); | 373 m_nonInheritedData.m_unicodeBidi = initialUnicodeBidi(); |
374 m_nonInheritedData.m_breakBefore = initialBreakBefore(); | 374 m_nonInheritedData.m_breakBefore = initialBreakBefore(); |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 // contain | 740 // contain |
741 static Containment initialContain() { return ContainsNone; } | 741 static Containment initialContain() { return ContainsNone; } |
742 Containment contain() const { return static_cast<Containment>(m_rareNonInher
itedData->m_contain); } | 742 Containment contain() const { return static_cast<Containment>(m_rareNonInher
itedData->m_contain); } |
743 void setContain(Containment contain) { SET_VAR(m_rareNonInheritedData, m_con
tain, contain); } | 743 void setContain(Containment contain) { SET_VAR(m_rareNonInheritedData, m_con
tain, contain); } |
744 | 744 |
745 // content | 745 // content |
746 ContentData* contentData() const { return m_rareNonInheritedData->m_content.
get(); } | 746 ContentData* contentData() const { return m_rareNonInheritedData->m_content.
get(); } |
747 void setContent(ContentData*); | 747 void setContent(ContentData*); |
748 | 748 |
749 // display | 749 // display |
750 static EDisplay initialDisplay() { return INLINE; } | 750 static EDisplay initialDisplay() { return EDisplay::Inline; } |
751 EDisplay display() const { return static_cast<EDisplay>(m_nonInheritedData.m
_effectiveDisplay); } | 751 EDisplay display() const { return static_cast<EDisplay>(m_nonInheritedData.m
_effectiveDisplay); } |
752 EDisplay originalDisplay() const { return static_cast<EDisplay>(m_nonInherit
edData.m_originalDisplay); } | 752 EDisplay originalDisplay() const { return static_cast<EDisplay>(m_nonInherit
edData.m_originalDisplay); } |
753 void setDisplay(EDisplay v) { m_nonInheritedData.m_effectiveDisplay = v; } | 753 void setDisplay(EDisplay v) { m_nonInheritedData.m_effectiveDisplay = static
_cast<unsigned>(v); } |
754 void setOriginalDisplay(EDisplay v) { m_nonInheritedData.m_originalDisplay =
v; } | 754 void setOriginalDisplay(EDisplay v) { m_nonInheritedData.m_originalDisplay =
static_cast<unsigned>(v); } |
755 | 755 |
756 // Flex properties. | 756 // Flex properties. |
757 // flex-basis (aka -webkit-flex-basis) | 757 // flex-basis (aka -webkit-flex-basis) |
758 static Length initialFlexBasis() { return Length(Auto); } | 758 static Length initialFlexBasis() { return Length(Auto); } |
759 const Length& flexBasis() const { return m_rareNonInheritedData->m_flexibleB
ox->m_flexBasis; } | 759 const Length& flexBasis() const { return m_rareNonInheritedData->m_flexibleB
ox->m_flexBasis; } |
760 void setFlexBasis(const Length& length) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_flexibleBox, m_flexBasis, length); } | 760 void setFlexBasis(const Length& length) { SET_NESTED_VAR(m_rareNonInheritedD
ata, m_flexibleBox, m_flexBasis, length); } |
761 | 761 |
762 // flex-direction (aka -webkit-flex-direction) | 762 // flex-direction (aka -webkit-flex-direction) |
763 static EFlexDirection initialFlexDirection() { return FlowRow; } | 763 static EFlexDirection initialFlexDirection() { return FlowRow; } |
764 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(m_
rareNonInheritedData->m_flexibleBox->m_flexDirection); } | 764 EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(m_
rareNonInheritedData->m_flexibleBox->m_flexDirection); } |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2462 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_NESTED_VAR(m_r
areNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); } | 2462 void setVisitedLinkColumnRuleColor(const StyleColor& v) { SET_NESTED_VAR(m_r
areNonInheritedData, m_multiCol, m_visitedLinkColumnRuleColor, v); } |
2463 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(m_rare
NonInheritedData, m_visitedLinkTextDecorationColor, v); } | 2463 void setVisitedLinkTextDecorationColor(const StyleColor& v) { SET_VAR(m_rare
NonInheritedData, m_visitedLinkTextDecorationColor, v); } |
2464 void setVisitedLinkTextEmphasisColor(const StyleColor& v) { SET_VAR_WITH_SET
TER(m_rareInheritedData, visitedLinkTextEmphasisColor, setVisitedLinkTextEmphasi
sColor, v); } | 2464 void setVisitedLinkTextEmphasisColor(const StyleColor& v) { SET_VAR_WITH_SET
TER(m_rareInheritedData, visitedLinkTextEmphasisColor, setVisitedLinkTextEmphasi
sColor, v); } |
2465 void setVisitedLinkTextFillColor(const StyleColor& v) { SET_VAR_WITH_SETTER(
m_rareInheritedData, visitedLinkTextFillColor, setVisitedLinkTextFillColor, v);
} | 2465 void setVisitedLinkTextFillColor(const StyleColor& v) { SET_VAR_WITH_SETTER(
m_rareInheritedData, visitedLinkTextFillColor, setVisitedLinkTextFillColor, v);
} |
2466 void setVisitedLinkTextStrokeColor(const StyleColor& v) { SET_VAR_WITH_SETTE
R(m_rareInheritedData, visitedLinkTextStrokeColor, setVisitedLinkTextStrokeColor
, v); } | 2466 void setVisitedLinkTextStrokeColor(const StyleColor& v) { SET_VAR_WITH_SETTE
R(m_rareInheritedData, visitedLinkTextStrokeColor, setVisitedLinkTextStrokeColor
, v); } |
2467 | 2467 |
2468 void inheritUnicodeBidiFrom(const ComputedStyle& parent) { m_nonInheritedDat
a.m_unicodeBidi = parent.m_nonInheritedData.m_unicodeBidi; } | 2468 void inheritUnicodeBidiFrom(const ComputedStyle& parent) { m_nonInheritedDat
a.m_unicodeBidi = parent.m_nonInheritedData.m_unicodeBidi; } |
2469 | 2469 |
2470 static bool isDisplayFlexibleBox(EDisplay display) | 2470 static bool isDisplayFlexibleBox(EDisplay display) |
2471 { | 2471 { |
2472 return display == FLEX || display == INLINE_FLEX; | 2472 return display == EDisplay::Flex || display == EDisplay::InlineFlex; |
2473 } | 2473 } |
2474 | 2474 |
2475 static bool isDisplayGridBox(EDisplay display) | 2475 static bool isDisplayGridBox(EDisplay display) |
2476 { | 2476 { |
2477 return display == GRID || display == INLINE_GRID; | 2477 return display == EDisplay::Grid || display == EDisplay::InlineGrid; |
2478 } | 2478 } |
2479 | 2479 |
2480 static bool isDisplayReplacedType(EDisplay display) | 2480 static bool isDisplayReplacedType(EDisplay display) |
2481 { | 2481 { |
2482 return display == INLINE_BLOCK || display == INLINE_BOX || display == IN
LINE_FLEX | 2482 return display == EDisplay::InlineBlock || display == EDisplay::InlineBo
x || display == EDisplay::InlineFlex |
2483 || display == INLINE_TABLE || display == INLINE_GRID; | 2483 || display == EDisplay::InlineTable || display == EDisplay::InlineGr
id; |
2484 } | 2484 } |
2485 | 2485 |
2486 static bool isDisplayInlineType(EDisplay display) | 2486 static bool isDisplayInlineType(EDisplay display) |
2487 { | 2487 { |
2488 return display == INLINE || isDisplayReplacedType(display); | 2488 return display == EDisplay::Inline || isDisplayReplacedType(display); |
2489 } | 2489 } |
2490 | 2490 |
2491 static bool isDisplayTableType(EDisplay display) | 2491 static bool isDisplayTableType(EDisplay display) |
2492 { | 2492 { |
2493 return display == TABLE || display == INLINE_TABLE || display == TABLE_R
OW_GROUP | 2493 return display == EDisplay::Table || display == EDisplay::InlineTable ||
display == EDisplay::TableRowGroup |
2494 || display == TABLE_HEADER_GROUP || display == TABLE_FOOTER_GROUP ||
display == TABLE_ROW | 2494 || display == EDisplay::TableHeaderGroup || display == EDisplay::Tab
leFooterGroup || display == EDisplay::TableRow |
2495 || display == TABLE_COLUMN_GROUP || display == TABLE_COLUMN || displ
ay == TABLE_CELL | 2495 || display == EDisplay::TableColumnGroup || display == EDisplay::Tab
leColumn || display == EDisplay::TableCell |
2496 || display == TABLE_CAPTION; | 2496 || display == EDisplay::TableCaption; |
2497 } | 2497 } |
2498 | 2498 |
2499 // Color accessors are all private to make sure callers use visitedDependent
Color instead to access them. | 2499 // Color accessors are all private to make sure callers use visitedDependent
Color instead to access them. |
2500 StyleColor borderLeftColor() const { return m_surround->border.left().color(
); } | 2500 StyleColor borderLeftColor() const { return m_surround->border.left().color(
); } |
2501 StyleColor borderRightColor() const { return m_surround->border.right().colo
r(); } | 2501 StyleColor borderRightColor() const { return m_surround->border.right().colo
r(); } |
2502 StyleColor borderTopColor() const { return m_surround->border.top().color();
} | 2502 StyleColor borderTopColor() const { return m_surround->border.top().color();
} |
2503 StyleColor borderBottomColor() const { return m_surround->border.bottom().co
lor(); } | 2503 StyleColor borderBottomColor() const { return m_surround->border.bottom().co
lor(); } |
2504 StyleColor backgroundColor() const { return m_background->color(); } | 2504 StyleColor backgroundColor() const { return m_background->color(); } |
2505 Color color() const; | 2505 Color color() const; |
2506 StyleColor columnRuleColor() const { return m_rareNonInheritedData->m_multiC
ol->m_rule.color(); } | 2506 StyleColor columnRuleColor() const { return m_rareNonInheritedData->m_multiC
ol->m_rule.color(); } |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2638 } | 2638 } |
2639 | 2639 |
2640 inline bool ComputedStyle::hasPseudoElementStyle() const | 2640 inline bool ComputedStyle::hasPseudoElementStyle() const |
2641 { | 2641 { |
2642 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; | 2642 return m_nonInheritedData.m_pseudoBits & ElementPseudoIdMask; |
2643 } | 2643 } |
2644 | 2644 |
2645 } // namespace blink | 2645 } // namespace blink |
2646 | 2646 |
2647 #endif // ComputedStyle_h | 2647 #endif // ComputedStyle_h |
OLD | NEW |