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 | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 SET_NESTED_VAR(rare_non_inherited_data_, grid_, grid_template_rows_, | 998 SET_NESTED_VAR(rare_non_inherited_data_, grid_, grid_template_rows_, |
999 lengths); | 999 lengths); |
1000 } | 1000 } |
1001 | 1001 |
1002 // image-orientation | 1002 // image-orientation |
1003 static RespectImageOrientationEnum InitialRespectImageOrientation() { | 1003 static RespectImageOrientationEnum InitialRespectImageOrientation() { |
1004 return kDoNotRespectImageOrientation; | 1004 return kDoNotRespectImageOrientation; |
1005 } | 1005 } |
1006 RespectImageOrientationEnum RespectImageOrientation() const { | 1006 RespectImageOrientationEnum RespectImageOrientation() const { |
1007 return static_cast<RespectImageOrientationEnum>( | 1007 return static_cast<RespectImageOrientationEnum>( |
1008 rare_inherited_data_->respect_image_orientation_); | 1008 RespectImageOrientationInternal()); |
1009 } | 1009 } |
1010 void SetRespectImageOrientation(RespectImageOrientationEnum v) { | 1010 void SetRespectImageOrientation(RespectImageOrientationEnum v) { |
1011 SET_VAR(rare_inherited_data_, respect_image_orientation_, v); | 1011 SetRespectImageOrientationInternal(v); |
1012 } | 1012 } |
1013 | 1013 |
1014 // isolation | 1014 // isolation |
1015 static EIsolation InitialIsolation() { return kIsolationAuto; } | 1015 static EIsolation InitialIsolation() { return kIsolationAuto; } |
1016 EIsolation Isolation() const { | 1016 EIsolation Isolation() const { |
1017 return static_cast<EIsolation>(rare_non_inherited_data_->isolation_); | 1017 return static_cast<EIsolation>(rare_non_inherited_data_->isolation_); |
1018 } | 1018 } |
1019 void SetIsolation(EIsolation v) { | 1019 void SetIsolation(EIsolation v) { |
1020 rare_non_inherited_data_.Access()->isolation_ = v; | 1020 rare_non_inherited_data_.Access()->isolation_ = v; |
1021 } | 1021 } |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 } | 1461 } |
1462 void SetTextDecorationStyle(TextDecorationStyle v) { | 1462 void SetTextDecorationStyle(TextDecorationStyle v) { |
1463 SET_VAR(rare_non_inherited_data_, text_decoration_style_, v); | 1463 SET_VAR(rare_non_inherited_data_, text_decoration_style_, v); |
1464 } | 1464 } |
1465 | 1465 |
1466 // text-underline-position | 1466 // text-underline-position |
1467 static TextUnderlinePosition InitialTextUnderlinePosition() { | 1467 static TextUnderlinePosition InitialTextUnderlinePosition() { |
1468 return TextUnderlinePosition::kAuto; | 1468 return TextUnderlinePosition::kAuto; |
1469 } | 1469 } |
1470 TextUnderlinePosition GetTextUnderlinePosition() const { | 1470 TextUnderlinePosition GetTextUnderlinePosition() const { |
1471 return static_cast<TextUnderlinePosition>( | 1471 return TextUnderlinePositionInternal(); |
1472 rare_inherited_data_->text_underline_position_); | |
1473 } | 1472 } |
1474 void SetTextUnderlinePosition(TextUnderlinePosition v) { | 1473 void SetTextUnderlinePosition(TextUnderlinePosition v) { |
1475 SET_VAR(rare_inherited_data_, text_underline_position_, | 1474 SetTextUnderlinePositionInternal(v); |
1476 static_cast<unsigned>(v)); | |
1477 } | 1475 } |
1478 | 1476 |
1479 // text-decoration-skip | 1477 // text-decoration-skip |
1480 static TextDecorationSkip InitialTextDecorationSkip() { | 1478 static TextDecorationSkip InitialTextDecorationSkip() { |
1481 return TextDecorationSkip::kObjects; | 1479 return TextDecorationSkip::kObjects; |
1482 } | 1480 } |
1483 TextDecorationSkip GetTextDecorationSkip() const { | 1481 TextDecorationSkip GetTextDecorationSkip() const { |
1484 return static_cast<TextDecorationSkip>( | 1482 return TextDecorationSkipInternal(); |
1485 rare_inherited_data_->text_decoration_skip_); | |
1486 } | 1483 } |
1487 void SetTextDecorationSkip(TextDecorationSkip v) { | 1484 void SetTextDecorationSkip(TextDecorationSkip v) { |
1488 SET_VAR(rare_inherited_data_, text_decoration_skip_, | 1485 SetTextDecorationSkipInternal(v); |
1489 static_cast<unsigned>(v)); | |
1490 } | 1486 } |
1491 | 1487 |
1492 // text-overflow | 1488 // text-overflow |
1493 static TextOverflow InitialTextOverflow() { return kTextOverflowClip; } | 1489 static TextOverflow InitialTextOverflow() { return kTextOverflowClip; } |
1494 TextOverflow GetTextOverflow() const { | 1490 TextOverflow GetTextOverflow() const { |
1495 return static_cast<TextOverflow>(rare_non_inherited_data_->text_overflow_); | 1491 return static_cast<TextOverflow>(rare_non_inherited_data_->text_overflow_); |
1496 } | 1492 } |
1497 void SetTextOverflow(TextOverflow overflow) { | 1493 void SetTextOverflow(TextOverflow overflow) { |
1498 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow); | 1494 SET_VAR(rare_non_inherited_data_, text_overflow_, overflow); |
1499 } | 1495 } |
(...skipping 27 matching lines...) Expand all Loading... |
1527 const Vector<CSSPropertyID>& WillChangeProperties() const { | 1523 const Vector<CSSPropertyID>& WillChangeProperties() const { |
1528 return rare_non_inherited_data_->will_change_->properties_; | 1524 return rare_non_inherited_data_->will_change_->properties_; |
1529 } | 1525 } |
1530 bool WillChangeContents() const { | 1526 bool WillChangeContents() const { |
1531 return rare_non_inherited_data_->will_change_->contents_; | 1527 return rare_non_inherited_data_->will_change_->contents_; |
1532 } | 1528 } |
1533 bool WillChangeScrollPosition() const { | 1529 bool WillChangeScrollPosition() const { |
1534 return rare_non_inherited_data_->will_change_->scroll_position_; | 1530 return rare_non_inherited_data_->will_change_->scroll_position_; |
1535 } | 1531 } |
1536 bool SubtreeWillChangeContents() const { | 1532 bool SubtreeWillChangeContents() const { |
1537 return rare_inherited_data_->subtree_will_change_contents_; | 1533 return SubtreeWillChangeContentsInternal(); |
1538 } | 1534 } |
1539 void SetWillChangeProperties(const Vector<CSSPropertyID>& properties) { | 1535 void SetWillChangeProperties(const Vector<CSSPropertyID>& properties) { |
1540 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, properties_, | 1536 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, properties_, |
1541 properties); | 1537 properties); |
1542 } | 1538 } |
1543 void SetWillChangeContents(bool b) { | 1539 void SetWillChangeContents(bool b) { |
1544 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, contents_, b); | 1540 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, contents_, b); |
1545 } | 1541 } |
1546 void SetWillChangeScrollPosition(bool b) { | 1542 void SetWillChangeScrollPosition(bool b) { |
1547 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, scroll_position_, b); | 1543 SET_NESTED_VAR(rare_non_inherited_data_, will_change_, scroll_position_, b); |
1548 } | 1544 } |
1549 void SetSubtreeWillChangeContents(bool b) { | 1545 void SetSubtreeWillChangeContents(bool b) { |
1550 SET_VAR(rare_inherited_data_, subtree_will_change_contents_, b); | 1546 SetSubtreeWillChangeContentsInternal(b); |
1551 } | 1547 } |
1552 | 1548 |
1553 // z-index | 1549 // z-index |
1554 int ZIndex() const { return ZIndexInternal(); } | 1550 int ZIndex() const { return ZIndexInternal(); } |
1555 bool HasAutoZIndex() const { return HasAutoZIndexInternal(); } | 1551 bool HasAutoZIndex() const { return HasAutoZIndexInternal(); } |
1556 void SetZIndex(int v) { | 1552 void SetZIndex(int v) { |
1557 SetHasAutoZIndexInternal(false); | 1553 SetHasAutoZIndexInternal(false); |
1558 SetZIndexInternal(v); | 1554 SetZIndexInternal(v); |
1559 } | 1555 } |
1560 void SetHasAutoZIndex() { | 1556 void SetHasAutoZIndex() { |
1561 SetHasAutoZIndexInternal(true); | 1557 SetHasAutoZIndexInternal(true); |
1562 SetZIndexInternal(0); | 1558 SetZIndexInternal(0); |
1563 } | 1559 } |
1564 | 1560 |
1565 // zoom | 1561 // zoom |
1566 static float InitialZoom() { return 1.0f; } | 1562 static float InitialZoom() { return 1.0f; } |
1567 float Zoom() const { return ZoomInternal(); } | 1563 float Zoom() const { return ZoomInternal(); } |
1568 float EffectiveZoom() const { return rare_inherited_data_->effective_zoom_; } | 1564 float EffectiveZoom() const { return EffectiveZoomInternal(); } |
1569 bool SetZoom(float); | 1565 bool SetZoom(float); |
1570 bool SetEffectiveZoom(float); | 1566 bool SetEffectiveZoom(float); |
1571 | 1567 |
1572 // -webkit-app-region | 1568 // -webkit-app-region |
1573 DraggableRegionMode GetDraggableRegionMode() const { | 1569 DraggableRegionMode GetDraggableRegionMode() const { |
1574 return static_cast<DraggableRegionMode>( | 1570 return static_cast<DraggableRegionMode>( |
1575 rare_non_inherited_data_->draggable_region_mode_); | 1571 rare_non_inherited_data_->draggable_region_mode_); |
1576 } | 1572 } |
1577 void SetDraggableRegionMode(DraggableRegionMode v) { | 1573 void SetDraggableRegionMode(DraggableRegionMode v) { |
1578 SET_VAR(rare_non_inherited_data_, draggable_region_mode_, | 1574 SET_VAR(rare_non_inherited_data_, draggable_region_mode_, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 void SetLineHeight(const Length& specified_line_height); | 1643 void SetLineHeight(const Length& specified_line_height); |
1648 | 1644 |
1649 // List style properties. | 1645 // List style properties. |
1650 // list-style-image | 1646 // list-style-image |
1651 static StyleImage* InitialListStyleImage() { return 0; } | 1647 static StyleImage* InitialListStyleImage() { return 0; } |
1652 StyleImage* ListStyleImage() const; | 1648 StyleImage* ListStyleImage() const; |
1653 void SetListStyleImage(StyleImage*); | 1649 void SetListStyleImage(StyleImage*); |
1654 | 1650 |
1655 // quotes | 1651 // quotes |
1656 static QuotesData* InitialQuotes() { return 0; } | 1652 static QuotesData* InitialQuotes() { return 0; } |
1657 QuotesData* Quotes() const { return rare_inherited_data_->quotes_.Get(); } | 1653 QuotesData* Quotes() const { return QuotesInternal().Get(); } |
1658 void SetQuotes(RefPtr<QuotesData>); | 1654 void SetQuotes(RefPtr<QuotesData>); |
1659 | 1655 |
1660 bool QuotesDataEquivalent(const ComputedStyle&) const; | 1656 bool QuotesDataEquivalent(const ComputedStyle&) const; |
1661 | 1657 |
1662 // text-justify | 1658 // text-justify |
1663 static TextJustify InitialTextJustify() { return kTextJustifyAuto; } | 1659 static TextJustify InitialTextJustify() { return kTextJustifyAuto; } |
1664 TextJustify GetTextJustify() const { | 1660 TextJustify GetTextJustify() const { return TextJustifyInternal(); } |
1665 return static_cast<TextJustify>(rare_inherited_data_->text_justify_); | 1661 void SetTextJustify(TextJustify v) { SetTextJustifyInternal(v); } |
1666 } | |
1667 void SetTextJustify(TextJustify v) { | |
1668 SET_VAR(rare_inherited_data_, text_justify_, v); | |
1669 } | |
1670 | |
1671 // text-orientation (aka -webkit-text-orientation, -epub-text-orientation) | |
1672 bool SetTextOrientation(ETextOrientation); | |
1673 | 1662 |
1674 // text-shadow | 1663 // text-shadow |
1675 static ShadowList* InitialTextShadow() { return 0; } | 1664 static ShadowList* InitialTextShadow() { return 0; } |
1676 ShadowList* TextShadow() const { | 1665 ShadowList* TextShadow() const { return TextShadowInternal().Get(); } |
1677 return rare_inherited_data_->text_shadow_.Get(); | |
1678 } | |
1679 void SetTextShadow(RefPtr<ShadowList>); | 1666 void SetTextShadow(RefPtr<ShadowList>); |
1680 | 1667 |
1681 bool TextShadowDataEquivalent(const ComputedStyle&) const; | 1668 bool TextShadowDataEquivalent(const ComputedStyle&) const; |
1682 | 1669 |
1683 // Text emphasis properties. | 1670 // Text emphasis properties. |
1684 static TextEmphasisMark InitialTextEmphasisMark() { | 1671 static TextEmphasisMark InitialTextEmphasisMark() { |
1685 return TextEmphasisMark::kNone; | 1672 return TextEmphasisMark::kNone; |
1686 } | 1673 } |
1687 TextEmphasisMark GetTextEmphasisMark() const; | 1674 TextEmphasisMark GetTextEmphasisMark() const; |
1688 void SetTextEmphasisMark(TextEmphasisMark mark) { | 1675 void SetTextEmphasisMark(TextEmphasisMark mark) { |
1689 SET_VAR(rare_inherited_data_, text_emphasis_mark_, | 1676 SetTextEmphasisMarkInternal(mark); |
1690 static_cast<unsigned>(mark)); | |
1691 } | 1677 } |
1692 const AtomicString& TextEmphasisMarkString() const; | 1678 const AtomicString& TextEmphasisMarkString() const; |
1693 | 1679 |
1694 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) | 1680 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) |
1695 void SetTextEmphasisColor(const StyleColor& color) { | 1681 void SetTextEmphasisColor(const StyleColor& color) { |
1696 SET_VAR(rare_inherited_data_, text_emphasis_color_, color.Resolve(Color())); | 1682 SetTextEmphasisColorInternal(color.Resolve(Color())); |
1697 SET_VAR(rare_inherited_data_, text_emphasis_color_is_current_color_, | 1683 SetTextEmphasisColorIsCurrentColorInternal(color.IsCurrentColor()); |
1698 color.IsCurrentColor()); | |
1699 } | 1684 } |
1700 | 1685 |
1701 // -webkit-line-clamp | 1686 // -webkit-line-clamp |
1702 static LineClampValue InitialLineClamp() { return LineClampValue(); } | 1687 static LineClampValue InitialLineClamp() { return LineClampValue(); } |
1703 const LineClampValue& LineClamp() const { | 1688 const LineClampValue& LineClamp() const { |
1704 return rare_non_inherited_data_->line_clamp_; | 1689 return rare_non_inherited_data_->line_clamp_; |
1705 } | 1690 } |
1706 void SetLineClamp(LineClampValue c) { | 1691 void SetLineClamp(LineClampValue c) { |
1707 SET_VAR(rare_non_inherited_data_, line_clamp_, c); | 1692 SET_VAR(rare_non_inherited_data_, line_clamp_, c); |
1708 } | 1693 } |
1709 | 1694 |
1710 // -webkit-text-fill-color | 1695 // -webkit-text-fill-color |
1711 void SetTextFillColor(const StyleColor& color) { | 1696 void SetTextFillColor(const StyleColor& color) { |
1712 SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color())); | 1697 SetTextFillColorInternal(color.Resolve(Color())); |
1713 SET_VAR(rare_inherited_data_, text_fill_color_is_current_color_, | 1698 SetTextFillColorIsCurrentColorInternal(color.IsCurrentColor()); |
1714 color.IsCurrentColor()); | |
1715 } | 1699 } |
1716 | 1700 |
1717 // -webkit-text-stroke-color | 1701 // -webkit-text-stroke-color |
1718 void SetTextStrokeColor(const StyleColor& color) { | 1702 void SetTextStrokeColor(const StyleColor& color) { |
1719 SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color())); | 1703 SetTextStrokeColorInternal(color.Resolve(Color())); |
1720 SET_VAR(rare_inherited_data_, text_stroke_color_is_current_color_, | 1704 SetTextStrokeColorIsCurrentColorInternal(color.IsCurrentColor()); |
1721 color.IsCurrentColor()); | |
1722 } | 1705 } |
1723 | 1706 |
1724 // -webkit-user-drag | 1707 // -webkit-user-drag |
1725 static EUserDrag InitialUserDrag() { return DRAG_AUTO; } | 1708 static EUserDrag InitialUserDrag() { return DRAG_AUTO; } |
1726 EUserDrag UserDrag() const { | 1709 EUserDrag UserDrag() const { |
1727 return static_cast<EUserDrag>(rare_non_inherited_data_->user_drag_); | 1710 return static_cast<EUserDrag>(rare_non_inherited_data_->user_drag_); |
1728 } | 1711 } |
1729 void SetUserDrag(EUserDrag d) { | 1712 void SetUserDrag(EUserDrag d) { |
1730 SET_VAR(rare_non_inherited_data_, user_drag_, d); | 1713 SET_VAR(rare_non_inherited_data_, user_drag_, d); |
1731 } | 1714 } |
1732 | 1715 |
1733 // caret-color | 1716 // caret-color |
1734 void SetCaretColor(const StyleAutoColor& color) { | 1717 void SetCaretColor(const StyleAutoColor& color) { |
1735 SET_VAR(rare_inherited_data_, caret_color_, color.Resolve(Color())); | 1718 SetCaretColorInternal(color.Resolve(Color())); |
1736 SET_VAR(rare_inherited_data_, caret_color_is_current_color_, | 1719 SetCaretColorIsCurrentColorInternal(color.IsCurrentColor()); |
1737 color.IsCurrentColor()); | 1720 SetCaretColorIsAutoInternal(color.IsAutoColor()); |
1738 SET_VAR(rare_inherited_data_, caret_color_is_auto_, color.IsAutoColor()); | |
1739 } | 1721 } |
1740 | 1722 |
1741 // Font properties. | 1723 // Font properties. |
1742 const Font& GetFont() const; | 1724 const Font& GetFont() const; |
1743 void SetFont(const Font&); | 1725 void SetFont(const Font&); |
1744 const FontDescription& GetFontDescription() const; | 1726 const FontDescription& GetFontDescription() const; |
1745 bool SetFontDescription(const FontDescription&); | 1727 bool SetFontDescription(const FontDescription&); |
1746 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; | 1728 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; |
1747 | 1729 |
1748 // font-size | 1730 // font-size |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 void SetIsStackingContext(bool b) { | 2001 void SetIsStackingContext(bool b) { |
2020 SET_VAR(rare_non_inherited_data_, is_stacking_context_, b); | 2002 SET_VAR(rare_non_inherited_data_, is_stacking_context_, b); |
2021 } | 2003 } |
2022 | 2004 |
2023 float TextAutosizingMultiplier() const { | 2005 float TextAutosizingMultiplier() const { |
2024 return TextAutosizingMultiplierInternal(); | 2006 return TextAutosizingMultiplierInternal(); |
2025 } | 2007 } |
2026 void SetTextAutosizingMultiplier(float); | 2008 void SetTextAutosizingMultiplier(float); |
2027 | 2009 |
2028 bool SelfOrAncestorHasDirAutoAttribute() const { | 2010 bool SelfOrAncestorHasDirAutoAttribute() const { |
2029 return rare_inherited_data_->self_or_ancestor_has_dir_auto_attribute_; | 2011 return SelfOrAncestorHasDirAutoAttributeInternal(); |
2030 } | 2012 } |
2031 void SetSelfOrAncestorHasDirAutoAttribute(bool v) { | 2013 void SetSelfOrAncestorHasDirAutoAttribute(bool v) { |
2032 SET_VAR(rare_inherited_data_, self_or_ancestor_has_dir_auto_attribute_, v); | 2014 SetSelfOrAncestorHasDirAutoAttributeInternal(v); |
2033 } | 2015 } |
2034 | 2016 |
2035 // Animation flags. | 2017 // Animation flags. |
2036 bool HasCurrentOpacityAnimation() const { | 2018 bool HasCurrentOpacityAnimation() const { |
2037 return rare_non_inherited_data_->has_current_opacity_animation_; | 2019 return rare_non_inherited_data_->has_current_opacity_animation_; |
2038 } | 2020 } |
2039 void SetHasCurrentOpacityAnimation(bool b = true) { | 2021 void SetHasCurrentOpacityAnimation(bool b = true) { |
2040 SET_VAR(rare_non_inherited_data_, has_current_opacity_animation_, b); | 2022 SET_VAR(rare_non_inherited_data_, has_current_opacity_animation_, b); |
2041 } | 2023 } |
2042 | 2024 |
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2963 } | 2945 } |
2964 bool IsDisplayFlexibleBox() const { return IsDisplayFlexibleBox(Display()); } | 2946 bool IsDisplayFlexibleBox() const { return IsDisplayFlexibleBox(Display()); } |
2965 | 2947 |
2966 // Isolation utility functions. | 2948 // Isolation utility functions. |
2967 bool HasIsolation() const { return Isolation() != kIsolationAuto; } | 2949 bool HasIsolation() const { return Isolation() != kIsolationAuto; } |
2968 | 2950 |
2969 // Content utility functions. | 2951 // Content utility functions. |
2970 bool HasContent() const { return GetContentData(); } | 2952 bool HasContent() const { return GetContentData(); } |
2971 | 2953 |
2972 // Cursor utility functions. | 2954 // Cursor utility functions. |
2973 CursorList* Cursors() const { | 2955 CursorList* Cursors() const { return CursorDataInternal().Get(); } |
2974 return rare_inherited_data_->cursor_data_.Get(); | |
2975 } | |
2976 void AddCursor(StyleImage*, | 2956 void AddCursor(StyleImage*, |
2977 bool hot_spot_specified, | 2957 bool hot_spot_specified, |
2978 const IntPoint& hot_spot = IntPoint()); | 2958 const IntPoint& hot_spot = IntPoint()); |
2979 void SetCursorList(CursorList*); | 2959 void SetCursorList(CursorList*); |
2980 void ClearCursorList(); | 2960 void ClearCursorList(); |
2981 | 2961 |
2982 // Text decoration utility functions. | 2962 // Text decoration utility functions. |
2983 void ApplyTextDecorations(const Color& parent_text_decoration_color, | 2963 void ApplyTextDecorations(const Color& parent_text_decoration_color, |
2984 bool override_existing_colors); | 2964 bool override_existing_colors); |
2985 void ClearAppliedTextDecorations(); | 2965 void ClearAppliedTextDecorations(); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3303 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); | 3283 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); |
3304 } | 3284 } |
3305 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { | 3285 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { |
3306 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, | 3286 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, |
3307 visited_link_column_rule_color_, v); | 3287 visited_link_column_rule_color_, v); |
3308 } | 3288 } |
3309 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { | 3289 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { |
3310 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); | 3290 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); |
3311 } | 3291 } |
3312 void SetVisitedLinkTextEmphasisColor(const StyleColor& color) { | 3292 void SetVisitedLinkTextEmphasisColor(const StyleColor& color) { |
3313 SET_VAR(rare_inherited_data_, visited_link_text_emphasis_color_, | 3293 SetVisitedLinkTextEmphasisColorInternal(color.Resolve(Color())); |
3314 color.Resolve(Color())); | 3294 SetVisitedLinkTextEmphasisColorIsCurrentColorInternal( |
3315 SET_VAR(rare_inherited_data_, | 3295 color.IsCurrentColor()); |
3316 visited_link_text_emphasis_color_is_current_color_, | |
3317 color.IsCurrentColor()); | |
3318 } | 3296 } |
3319 void SetVisitedLinkTextFillColor(const StyleColor& color) { | 3297 void SetVisitedLinkTextFillColor(const StyleColor& color) { |
3320 SET_VAR(rare_inherited_data_, visited_link_text_fill_color_, | 3298 SetVisitedLinkTextFillColorInternal(color.Resolve(Color())); |
3321 color.Resolve(Color())); | 3299 SetVisitedLinkTextFillColorIsCurrentColorInternal(color.IsCurrentColor()); |
3322 SET_VAR(rare_inherited_data_, | |
3323 visited_link_text_fill_color_is_current_color_, | |
3324 color.IsCurrentColor()); | |
3325 } | 3300 } |
3326 void SetVisitedLinkTextStrokeColor(const StyleColor& color) { | 3301 void SetVisitedLinkTextStrokeColor(const StyleColor& color) { |
3327 SET_VAR(rare_inherited_data_, visited_link_text_stroke_color_, | 3302 SetVisitedLinkTextStrokeColorInternal(color.Resolve(Color())); |
3328 color.Resolve(Color())); | 3303 SetVisitedLinkTextStrokeColorIsCurrentColorInternal(color.IsCurrentColor()); |
3329 SET_VAR(rare_inherited_data_, | |
3330 visited_link_text_stroke_color_is_current_color_, | |
3331 color.IsCurrentColor()); | |
3332 } | 3304 } |
3333 void SetVisitedLinkCaretColor(const StyleAutoColor& color) { | 3305 void SetVisitedLinkCaretColor(const StyleAutoColor& color) { |
3334 SET_VAR(rare_inherited_data_, visited_link_caret_color_, | 3306 SetVisitedLinkCaretColorInternal(color.Resolve(Color())); |
3335 color.Resolve(Color())); | 3307 SetVisitedLinkCaretColorIsCurrentColorInternal(color.IsCurrentColor()); |
3336 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_current_color_, | 3308 SetVisitedLinkCaretColorIsAutoInternal(color.IsAutoColor()); |
3337 color.IsCurrentColor()); | |
3338 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_auto_, | |
3339 color.IsAutoColor()); | |
3340 } | 3309 } |
3341 | 3310 |
3342 static bool IsDisplayBlockContainer(EDisplay display) { | 3311 static bool IsDisplayBlockContainer(EDisplay display) { |
3343 return display == EDisplay::kBlock || display == EDisplay::kListItem || | 3312 return display == EDisplay::kBlock || display == EDisplay::kListItem || |
3344 display == EDisplay::kInlineBlock || | 3313 display == EDisplay::kInlineBlock || |
3345 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || | 3314 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || |
3346 display == EDisplay::kTableCaption; | 3315 display == EDisplay::kTableCaption; |
3347 } | 3316 } |
3348 | 3317 |
3349 static bool IsDisplayFlexibleBox(EDisplay display) { | 3318 static bool IsDisplayFlexibleBox(EDisplay display) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3396 : StyleColor(BorderTopColorInternal()); | 3365 : StyleColor(BorderTopColorInternal()); |
3397 } | 3366 } |
3398 StyleColor BorderBottomColor() const { | 3367 StyleColor BorderBottomColor() const { |
3399 return BorderBottomColorIsCurrentColor() | 3368 return BorderBottomColorIsCurrentColor() |
3400 ? StyleColor::CurrentColor() | 3369 ? StyleColor::CurrentColor() |
3401 : StyleColor(BorderBottomColorInternal()); | 3370 : StyleColor(BorderBottomColorInternal()); |
3402 } | 3371 } |
3403 | 3372 |
3404 StyleColor BackgroundColor() const { return BackgroundColorInternal(); } | 3373 StyleColor BackgroundColor() const { return BackgroundColorInternal(); } |
3405 StyleAutoColor CaretColor() const { | 3374 StyleAutoColor CaretColor() const { |
3406 if (rare_inherited_data_->caret_color_is_current_color_) | 3375 if (CaretColorIsCurrentColorInternal()) |
3407 return StyleAutoColor::CurrentColor(); | 3376 return StyleAutoColor::CurrentColor(); |
3408 if (rare_inherited_data_->caret_color_is_auto_) | 3377 if (CaretColorIsAutoInternal()) |
3409 return StyleAutoColor::AutoColor(); | 3378 return StyleAutoColor::AutoColor(); |
3410 return StyleAutoColor(rare_inherited_data_->caret_color_); | 3379 return StyleAutoColor(CaretColorInternal()); |
3411 } | 3380 } |
3412 Color GetColor() const; | 3381 Color GetColor() const; |
3413 StyleColor ColumnRuleColor() const { | 3382 StyleColor ColumnRuleColor() const { |
3414 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); | 3383 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); |
3415 } | 3384 } |
3416 StyleColor OutlineColor() const { | 3385 StyleColor OutlineColor() const { |
3417 return rare_non_inherited_data_->outline_.GetColor(); | 3386 return rare_non_inherited_data_->outline_.GetColor(); |
3418 } | 3387 } |
3419 StyleColor TextEmphasisColor() const { | 3388 StyleColor TextEmphasisColor() const { |
3420 return rare_inherited_data_->text_emphasis_color_is_current_color_ | 3389 return TextEmphasisColorIsCurrentColorInternal() |
3421 ? StyleColor::CurrentColor() | 3390 ? StyleColor::CurrentColor() |
3422 : StyleColor(rare_inherited_data_->text_emphasis_color_); | 3391 : StyleColor(TextEmphasisColorInternal()); |
3423 } | 3392 } |
3424 StyleColor TextFillColor() const { | 3393 StyleColor TextFillColor() const { |
3425 return rare_inherited_data_->text_fill_color_is_current_color_ | 3394 return TextFillColorIsCurrentColorInternal() |
3426 ? StyleColor::CurrentColor() | 3395 ? StyleColor::CurrentColor() |
3427 : StyleColor(rare_inherited_data_->text_fill_color_); | 3396 : StyleColor(TextFillColorInternal()); |
3428 } | 3397 } |
3429 StyleColor TextStrokeColor() const { | 3398 StyleColor TextStrokeColor() const { |
3430 return rare_inherited_data_->text_stroke_color_is_current_color_ | 3399 return TextStrokeColorIsCurrentColorInternal() |
3431 ? StyleColor::CurrentColor() | 3400 ? StyleColor::CurrentColor() |
3432 : StyleColor(rare_inherited_data_->text_stroke_color_); | 3401 : StyleColor(TextStrokeColorInternal()); |
3433 } | 3402 } |
3434 StyleAutoColor VisitedLinkCaretColor() const { | 3403 StyleAutoColor VisitedLinkCaretColor() const { |
3435 if (rare_inherited_data_->visited_link_caret_color_is_current_color_) | 3404 if (VisitedLinkCaretColorIsCurrentColorInternal()) |
3436 return StyleAutoColor::CurrentColor(); | 3405 return StyleAutoColor::CurrentColor(); |
3437 if (rare_inherited_data_->visited_link_caret_color_is_auto_) | 3406 if (VisitedLinkCaretColorIsAutoInternal()) |
3438 return StyleAutoColor::AutoColor(); | 3407 return StyleAutoColor::AutoColor(); |
3439 return StyleAutoColor(rare_inherited_data_->visited_link_caret_color_); | 3408 return StyleAutoColor(VisitedLinkCaretColorInternal()); |
3440 } | 3409 } |
3441 StyleColor VisitedLinkBackgroundColor() const { | 3410 StyleColor VisitedLinkBackgroundColor() const { |
3442 return rare_non_inherited_data_->visited_link_background_color_; | 3411 return rare_non_inherited_data_->visited_link_background_color_; |
3443 } | 3412 } |
3444 StyleColor VisitedLinkBorderLeftColor() const { | 3413 StyleColor VisitedLinkBorderLeftColor() const { |
3445 return rare_non_inherited_data_->visited_link_border_left_color_; | 3414 return rare_non_inherited_data_->visited_link_border_left_color_; |
3446 } | 3415 } |
3447 StyleColor VisitedLinkBorderRightColor() const { | 3416 StyleColor VisitedLinkBorderRightColor() const { |
3448 return rare_non_inherited_data_->visited_link_border_right_color_; | 3417 return rare_non_inherited_data_->visited_link_border_right_color_; |
3449 } | 3418 } |
(...skipping 10 matching lines...) Expand all Loading... |
3460 return rare_non_inherited_data_->multi_col_ | 3429 return rare_non_inherited_data_->multi_col_ |
3461 ->visited_link_column_rule_color_; | 3430 ->visited_link_column_rule_color_; |
3462 } | 3431 } |
3463 StyleColor TextDecorationColor() const { | 3432 StyleColor TextDecorationColor() const { |
3464 return rare_non_inherited_data_->text_decoration_color_; | 3433 return rare_non_inherited_data_->text_decoration_color_; |
3465 } | 3434 } |
3466 StyleColor VisitedLinkTextDecorationColor() const { | 3435 StyleColor VisitedLinkTextDecorationColor() const { |
3467 return rare_non_inherited_data_->visited_link_text_decoration_color_; | 3436 return rare_non_inherited_data_->visited_link_text_decoration_color_; |
3468 } | 3437 } |
3469 StyleColor VisitedLinkTextEmphasisColor() const { | 3438 StyleColor VisitedLinkTextEmphasisColor() const { |
3470 return rare_inherited_data_ | 3439 return VisitedLinkTextEmphasisColorIsCurrentColorInternal() |
3471 ->visited_link_text_emphasis_color_is_current_color_ | |
3472 ? StyleColor::CurrentColor() | 3440 ? StyleColor::CurrentColor() |
3473 : StyleColor( | 3441 : StyleColor(VisitedLinkTextEmphasisColorInternal()); |
3474 rare_inherited_data_->visited_link_text_emphasis_color_); | |
3475 } | 3442 } |
3476 StyleColor VisitedLinkTextFillColor() const { | 3443 StyleColor VisitedLinkTextFillColor() const { |
3477 return rare_inherited_data_->visited_link_text_fill_color_is_current_color_ | 3444 return VisitedLinkTextFillColorIsCurrentColorInternal() |
3478 ? StyleColor::CurrentColor() | 3445 ? StyleColor::CurrentColor() |
3479 : StyleColor( | 3446 : StyleColor(VisitedLinkTextFillColorInternal()); |
3480 rare_inherited_data_->visited_link_text_fill_color_); | |
3481 } | 3447 } |
3482 StyleColor VisitedLinkTextStrokeColor() const { | 3448 StyleColor VisitedLinkTextStrokeColor() const { |
3483 return rare_inherited_data_ | 3449 return VisitedLinkTextStrokeColorIsCurrentColorInternal() |
3484 ->visited_link_text_stroke_color_is_current_color_ | |
3485 ? StyleColor::CurrentColor() | 3450 ? StyleColor::CurrentColor() |
3486 : StyleColor( | 3451 : StyleColor(VisitedLinkTextStrokeColorInternal()); |
3487 rare_inherited_data_->visited_link_text_stroke_color_); | |
3488 } | 3452 } |
3489 | 3453 |
3490 StyleColor DecorationColorIncludingFallback(bool visited_link) const; | 3454 StyleColor DecorationColorIncludingFallback(bool visited_link) const; |
3491 Color ColorIncludingFallback(int color_property, bool visited_link) const; | 3455 Color ColorIncludingFallback(int color_property, bool visited_link) const; |
3492 | 3456 |
3493 Color StopColor() const { return SvgStyle().StopColor(); } | 3457 Color StopColor() const { return SvgStyle().StopColor(); } |
3494 Color FloodColor() const { return SvgStyle().FloodColor(); } | 3458 Color FloodColor() const { return SvgStyle().FloodColor(); } |
3495 Color LightingColor() const { return SvgStyle().LightingColor(); } | 3459 Color LightingColor() const { return SvgStyle().LightingColor(); } |
3496 | 3460 |
3497 void AddAppliedTextDecoration(const AppliedTextDecoration&); | 3461 void AddAppliedTextDecoration(const AppliedTextDecoration&); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3566 return false; | 3530 return false; |
3567 SetZoomInternal(f); | 3531 SetZoomInternal(f); |
3568 SetEffectiveZoom(EffectiveZoom() * Zoom()); | 3532 SetEffectiveZoom(EffectiveZoom() * Zoom()); |
3569 return true; | 3533 return true; |
3570 } | 3534 } |
3571 | 3535 |
3572 inline bool ComputedStyle::SetEffectiveZoom(float f) { | 3536 inline bool ComputedStyle::SetEffectiveZoom(float f) { |
3573 // Clamp the effective zoom value to a smaller (but hopeful still large | 3537 // Clamp the effective zoom value to a smaller (but hopeful still large |
3574 // enough) range, to avoid overflow in derived computations. | 3538 // enough) range, to avoid overflow in derived computations. |
3575 float clamped_effective_zoom = clampTo<float>(f, 1e-6, 1e6); | 3539 float clamped_effective_zoom = clampTo<float>(f, 1e-6, 1e6); |
3576 if (compareEqual(rare_inherited_data_->effective_zoom_, | 3540 if (compareEqual(EffectiveZoomInternal(), clamped_effective_zoom)) |
3577 clamped_effective_zoom)) | |
3578 return false; | 3541 return false; |
3579 rare_inherited_data_.Access()->effective_zoom_ = clamped_effective_zoom; | 3542 SetEffectiveZoomInternal(clamped_effective_zoom); |
3580 return true; | 3543 return true; |
3581 } | 3544 } |
3582 | 3545 |
3583 inline bool ComputedStyle::IsSharable() const { | 3546 inline bool ComputedStyle::IsSharable() const { |
3584 if (Unique()) | 3547 if (Unique()) |
3585 return false; | 3548 return false; |
3586 if (HasUniquePseudoStyle()) | 3549 if (HasUniquePseudoStyle()) |
3587 return false; | 3550 return false; |
3588 return true; | 3551 return true; |
3589 } | 3552 } |
3590 | 3553 |
3591 inline bool ComputedStyle::SetTextOrientation( | |
3592 ETextOrientation text_orientation) { | |
3593 if (compareEqual(rare_inherited_data_->text_orientation_, | |
3594 static_cast<unsigned>(text_orientation))) | |
3595 return false; | |
3596 | |
3597 rare_inherited_data_.Access()->text_orientation_ = | |
3598 static_cast<unsigned>(text_orientation); | |
3599 return true; | |
3600 } | |
3601 | |
3602 inline bool ComputedStyle::HasAnyPublicPseudoStyles() const { | 3554 inline bool ComputedStyle::HasAnyPublicPseudoStyles() const { |
3603 return PseudoBitsInternal() != kPseudoIdNone; | 3555 return PseudoBitsInternal() != kPseudoIdNone; |
3604 } | 3556 } |
3605 | 3557 |
3606 inline bool ComputedStyle::HasPseudoStyle(PseudoId pseudo) const { | 3558 inline bool ComputedStyle::HasPseudoStyle(PseudoId pseudo) const { |
3607 DCHECK(pseudo >= kFirstPublicPseudoId); | 3559 DCHECK(pseudo >= kFirstPublicPseudoId); |
3608 DCHECK(pseudo < kFirstInternalPseudoId); | 3560 DCHECK(pseudo < kFirstInternalPseudoId); |
3609 return (1 << (pseudo - kFirstPublicPseudoId)) & PseudoBitsInternal(); | 3561 return (1 << (pseudo - kFirstPublicPseudoId)) & PseudoBitsInternal(); |
3610 } | 3562 } |
3611 | 3563 |
3612 inline void ComputedStyle::SetHasPseudoStyle(PseudoId pseudo) { | 3564 inline void ComputedStyle::SetHasPseudoStyle(PseudoId pseudo) { |
3613 DCHECK(pseudo >= kFirstPublicPseudoId); | 3565 DCHECK(pseudo >= kFirstPublicPseudoId); |
3614 DCHECK(pseudo < kFirstInternalPseudoId); | 3566 DCHECK(pseudo < kFirstInternalPseudoId); |
3615 // TODO: Fix up this code. It is hard to understand. | 3567 // TODO: Fix up this code. It is hard to understand. |
3616 SetPseudoBitsInternal(static_cast<PseudoId>( | 3568 SetPseudoBitsInternal(static_cast<PseudoId>( |
3617 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3569 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
3618 } | 3570 } |
3619 | 3571 |
3620 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3572 inline bool ComputedStyle::HasPseudoElementStyle() const { |
3621 return PseudoBitsInternal() & kElementPseudoIdMask; | 3573 return PseudoBitsInternal() & kElementPseudoIdMask; |
3622 } | 3574 } |
3623 | 3575 |
3624 } // namespace blink | 3576 } // namespace blink |
3625 | 3577 |
3626 #endif // ComputedStyle_h | 3578 #endif // ComputedStyle_h |
OLD | NEW |