| 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 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 SET_VAR(rare_inherited_data_, text_emphasis_fill_, fill); | 1935 SET_VAR(rare_inherited_data_, text_emphasis_fill_, fill); |
| 1936 } | 1936 } |
| 1937 void SetTextEmphasisMark(TextEmphasisMark mark) { | 1937 void SetTextEmphasisMark(TextEmphasisMark mark) { |
| 1938 SET_VAR(rare_inherited_data_, text_emphasis_mark_, mark); | 1938 SET_VAR(rare_inherited_data_, text_emphasis_mark_, mark); |
| 1939 } | 1939 } |
| 1940 void SetTextEmphasisCustomMark(const AtomicString& mark) { | 1940 void SetTextEmphasisCustomMark(const AtomicString& mark) { |
| 1941 SET_VAR(rare_inherited_data_, text_emphasis_custom_mark_, mark); | 1941 SET_VAR(rare_inherited_data_, text_emphasis_custom_mark_, mark); |
| 1942 } | 1942 } |
| 1943 | 1943 |
| 1944 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) | 1944 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) |
| 1945 void SetTextEmphasisColor(const StyleColor& c) { | 1945 void SetTextEmphasisColor(const StyleColor& color) { |
| 1946 SET_VAR_WITH_SETTER(rare_inherited_data_, TextEmphasisColor, | 1946 SET_VAR(rare_inherited_data_, text_emphasis_color_, color.Resolve(Color())); |
| 1947 SetTextEmphasisColor, c); | 1947 SET_VAR(rare_inherited_data_, text_emphasis_color_is_current_color_, |
| 1948 color.IsCurrentColor()); |
| 1948 } | 1949 } |
| 1949 | 1950 |
| 1950 // -webkit-text-emphasis-position | 1951 // -webkit-text-emphasis-position |
| 1951 static TextEmphasisPosition InitialTextEmphasisPosition() { | 1952 static TextEmphasisPosition InitialTextEmphasisPosition() { |
| 1952 return kTextEmphasisPositionOver; | 1953 return kTextEmphasisPositionOver; |
| 1953 } | 1954 } |
| 1954 TextEmphasisPosition GetTextEmphasisPosition() const { | 1955 TextEmphasisPosition GetTextEmphasisPosition() const { |
| 1955 return static_cast<TextEmphasisPosition>( | 1956 return static_cast<TextEmphasisPosition>( |
| 1956 rare_inherited_data_->text_emphasis_position_); | 1957 rare_inherited_data_->text_emphasis_position_); |
| 1957 } | 1958 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1989 // -webkit-tap-highlight-color | 1990 // -webkit-tap-highlight-color |
| 1990 static Color InitialTapHighlightColor(); | 1991 static Color InitialTapHighlightColor(); |
| 1991 Color TapHighlightColor() const { | 1992 Color TapHighlightColor() const { |
| 1992 return rare_inherited_data_->tap_highlight_color_; | 1993 return rare_inherited_data_->tap_highlight_color_; |
| 1993 } | 1994 } |
| 1994 void SetTapHighlightColor(const Color& c) { | 1995 void SetTapHighlightColor(const Color& c) { |
| 1995 SET_VAR(rare_inherited_data_, tap_highlight_color_, c); | 1996 SET_VAR(rare_inherited_data_, tap_highlight_color_, c); |
| 1996 } | 1997 } |
| 1997 | 1998 |
| 1998 // -webkit-text-fill-color | 1999 // -webkit-text-fill-color |
| 1999 void SetTextFillColor(const StyleColor& c) { | 2000 void SetTextFillColor(const StyleColor& color) { |
| 2000 SET_VAR_WITH_SETTER(rare_inherited_data_, TextFillColor, SetTextFillColor, | 2001 SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color())); |
| 2001 c); | 2002 SET_VAR(rare_inherited_data_, text_fill_color_is_current_color_, |
| 2003 color.IsCurrentColor()); |
| 2002 } | 2004 } |
| 2003 | 2005 |
| 2004 // -webkit-text-security | 2006 // -webkit-text-security |
| 2005 static ETextSecurity InitialTextSecurity() { return TSNONE; } | 2007 static ETextSecurity InitialTextSecurity() { return TSNONE; } |
| 2006 ETextSecurity TextSecurity() const { | 2008 ETextSecurity TextSecurity() const { |
| 2007 return static_cast<ETextSecurity>(rare_inherited_data_->text_security_); | 2009 return static_cast<ETextSecurity>(rare_inherited_data_->text_security_); |
| 2008 } | 2010 } |
| 2009 void SetTextSecurity(ETextSecurity a_text_security) { | 2011 void SetTextSecurity(ETextSecurity a_text_security) { |
| 2010 SET_VAR(rare_inherited_data_, text_security_, a_text_security); | 2012 SET_VAR(rare_inherited_data_, text_security_, a_text_security); |
| 2011 } | 2013 } |
| 2012 | 2014 |
| 2013 // -webkit-text-stroke-color | 2015 // -webkit-text-stroke-color |
| 2014 void SetTextStrokeColor(const StyleColor& c) { | 2016 void SetTextStrokeColor(const StyleColor& color) { |
| 2015 SET_VAR_WITH_SETTER(rare_inherited_data_, TextStrokeColor, | 2017 SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color())); |
| 2016 SetTextStrokeColor, c); | 2018 SET_VAR(rare_inherited_data_, text_stroke_color_is_current_color_, |
| 2019 color.IsCurrentColor()); |
| 2017 } | 2020 } |
| 2018 | 2021 |
| 2019 // -webkit-text-stroke-width | 2022 // -webkit-text-stroke-width |
| 2020 static float InitialTextStrokeWidth() { return 0; } | 2023 static float InitialTextStrokeWidth() { return 0; } |
| 2021 float TextStrokeWidth() const { | 2024 float TextStrokeWidth() const { |
| 2022 return rare_inherited_data_->text_stroke_width_; | 2025 return rare_inherited_data_->text_stroke_width_; |
| 2023 } | 2026 } |
| 2024 void SetTextStrokeWidth(float w) { | 2027 void SetTextStrokeWidth(float w) { |
| 2025 SET_VAR(rare_inherited_data_, text_stroke_width_, w); | 2028 SET_VAR(rare_inherited_data_, text_stroke_width_, w); |
| 2026 } | 2029 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 2046 // -webkit-user-select | 2049 // -webkit-user-select |
| 2047 static EUserSelect InitialUserSelect() { return SELECT_TEXT; } | 2050 static EUserSelect InitialUserSelect() { return SELECT_TEXT; } |
| 2048 EUserSelect UserSelect() const { | 2051 EUserSelect UserSelect() const { |
| 2049 return static_cast<EUserSelect>(rare_inherited_data_->user_select_); | 2052 return static_cast<EUserSelect>(rare_inherited_data_->user_select_); |
| 2050 } | 2053 } |
| 2051 void SetUserSelect(EUserSelect s) { | 2054 void SetUserSelect(EUserSelect s) { |
| 2052 SET_VAR(rare_inherited_data_, user_select_, s); | 2055 SET_VAR(rare_inherited_data_, user_select_, s); |
| 2053 } | 2056 } |
| 2054 | 2057 |
| 2055 // caret-color | 2058 // caret-color |
| 2056 void SetCaretColor(const StyleAutoColor& c) { | 2059 void SetCaretColor(const StyleAutoColor& color) { |
| 2057 SET_VAR_WITH_SETTER(rare_inherited_data_, CaretColor, SetCaretColor, c); | 2060 SET_VAR(rare_inherited_data_, caret_color_, color.Resolve(Color())); |
| 2061 SET_VAR(rare_inherited_data_, caret_color_is_current_color_, |
| 2062 color.IsCurrentColor()); |
| 2063 SET_VAR(rare_inherited_data_, caret_color_is_auto_, color.IsAutoColor()); |
| 2058 } | 2064 } |
| 2059 | 2065 |
| 2060 // Font properties. | 2066 // Font properties. |
| 2061 const Font& GetFont() const; | 2067 const Font& GetFont() const; |
| 2062 void SetFont(const Font&); | 2068 void SetFont(const Font&); |
| 2063 const FontDescription& GetFontDescription() const; | 2069 const FontDescription& GetFontDescription() const; |
| 2064 bool SetFontDescription(const FontDescription&); | 2070 bool SetFontDescription(const FontDescription&); |
| 2065 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; | 2071 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; |
| 2066 | 2072 |
| 2067 // font-size | 2073 // font-size |
| (...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3541 void SetVisitedLinkOutlineColor(const StyleColor& v) { | 3547 void SetVisitedLinkOutlineColor(const StyleColor& v) { |
| 3542 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); | 3548 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); |
| 3543 } | 3549 } |
| 3544 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { | 3550 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { |
| 3545 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, | 3551 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, |
| 3546 visited_link_column_rule_color_, v); | 3552 visited_link_column_rule_color_, v); |
| 3547 } | 3553 } |
| 3548 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { | 3554 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { |
| 3549 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); | 3555 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); |
| 3550 } | 3556 } |
| 3551 void SetVisitedLinkTextEmphasisColor(const StyleColor& v) { | 3557 void SetVisitedLinkTextEmphasisColor(const StyleColor& color) { |
| 3552 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextEmphasisColor, | 3558 SET_VAR(rare_inherited_data_, visited_link_text_emphasis_color_, |
| 3553 SetVisitedLinkTextEmphasisColor, v); | 3559 color.Resolve(Color())); |
| 3560 SET_VAR(rare_inherited_data_, |
| 3561 visited_link_text_emphasis_color_is_current_color_, |
| 3562 color.IsCurrentColor()); |
| 3554 } | 3563 } |
| 3555 void SetVisitedLinkTextFillColor(const StyleColor& v) { | 3564 void SetVisitedLinkTextFillColor(const StyleColor& color) { |
| 3556 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextFillColor, | 3565 SET_VAR(rare_inherited_data_, visited_link_text_fill_color_, |
| 3557 SetVisitedLinkTextFillColor, v); | 3566 color.Resolve(Color())); |
| 3567 SET_VAR(rare_inherited_data_, |
| 3568 visited_link_text_fill_color_is_current_color_, |
| 3569 color.IsCurrentColor()); |
| 3558 } | 3570 } |
| 3559 void SetVisitedLinkTextStrokeColor(const StyleColor& v) { | 3571 void SetVisitedLinkTextStrokeColor(const StyleColor& color) { |
| 3560 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextStrokeColor, | 3572 SET_VAR(rare_inherited_data_, visited_link_text_stroke_color_, |
| 3561 SetVisitedLinkTextStrokeColor, v); | 3573 color.Resolve(Color())); |
| 3574 SET_VAR(rare_inherited_data_, |
| 3575 visited_link_text_stroke_color_is_current_color_, |
| 3576 color.IsCurrentColor()); |
| 3562 } | 3577 } |
| 3563 void SetVisitedLinkCaretColor(const StyleAutoColor& v) { | 3578 void SetVisitedLinkCaretColor(const StyleAutoColor& color) { |
| 3564 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkCaretColor, | 3579 SET_VAR(rare_inherited_data_, visited_link_caret_color_, |
| 3565 SetVisitedLinkCaretColor, v); | 3580 color.Resolve(Color())); |
| 3581 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_current_color_, |
| 3582 color.IsCurrentColor()); |
| 3583 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_auto_, |
| 3584 color.IsAutoColor()); |
| 3566 } | 3585 } |
| 3567 | 3586 |
| 3568 static bool IsDisplayBlockContainer(EDisplay display) { | 3587 static bool IsDisplayBlockContainer(EDisplay display) { |
| 3569 return display == EDisplay::kBlock || display == EDisplay::kListItem || | 3588 return display == EDisplay::kBlock || display == EDisplay::kListItem || |
| 3570 display == EDisplay::kInlineBlock || | 3589 display == EDisplay::kInlineBlock || |
| 3571 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || | 3590 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || |
| 3572 display == EDisplay::kTableCaption; | 3591 display == EDisplay::kTableCaption; |
| 3573 } | 3592 } |
| 3574 | 3593 |
| 3575 static bool IsDisplayFlexibleBox(EDisplay display) { | 3594 static bool IsDisplayFlexibleBox(EDisplay display) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3624 StyleColor BorderBottomColor() const { | 3643 StyleColor BorderBottomColor() const { |
| 3625 return BorderBottomColorIsCurrentColor() | 3644 return BorderBottomColorIsCurrentColor() |
| 3626 ? StyleColor::CurrentColor() | 3645 ? StyleColor::CurrentColor() |
| 3627 : StyleColor(BorderBottomColorInternal()); | 3646 : StyleColor(BorderBottomColorInternal()); |
| 3628 } | 3647 } |
| 3629 | 3648 |
| 3630 StyleColor BackgroundColor() const { | 3649 StyleColor BackgroundColor() const { |
| 3631 return background_data_->background_color_; | 3650 return background_data_->background_color_; |
| 3632 } | 3651 } |
| 3633 StyleAutoColor CaretColor() const { | 3652 StyleAutoColor CaretColor() const { |
| 3634 return rare_inherited_data_->CaretColor(); | 3653 if (rare_inherited_data_->caret_color_is_current_color_) |
| 3654 return StyleAutoColor::CurrentColor(); |
| 3655 if (rare_inherited_data_->caret_color_is_auto_) |
| 3656 return StyleAutoColor::AutoColor(); |
| 3657 return StyleAutoColor(rare_inherited_data_->caret_color_); |
| 3635 } | 3658 } |
| 3636 Color GetColor() const; | 3659 Color GetColor() const; |
| 3637 StyleColor ColumnRuleColor() const { | 3660 StyleColor ColumnRuleColor() const { |
| 3638 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); | 3661 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); |
| 3639 } | 3662 } |
| 3640 StyleColor OutlineColor() const { | 3663 StyleColor OutlineColor() const { |
| 3641 return rare_non_inherited_data_->outline_.GetColor(); | 3664 return rare_non_inherited_data_->outline_.GetColor(); |
| 3642 } | 3665 } |
| 3643 StyleColor TextEmphasisColor() const { | 3666 StyleColor TextEmphasisColor() const { |
| 3644 return rare_inherited_data_->TextEmphasisColor(); | 3667 return rare_inherited_data_->text_emphasis_color_is_current_color_ |
| 3668 ? StyleColor::CurrentColor() |
| 3669 : StyleColor(rare_inherited_data_->text_emphasis_color_); |
| 3645 } | 3670 } |
| 3646 StyleColor TextFillColor() const { | 3671 StyleColor TextFillColor() const { |
| 3647 return rare_inherited_data_->TextFillColor(); | 3672 return rare_inherited_data_->text_fill_color_is_current_color_ |
| 3673 ? StyleColor::CurrentColor() |
| 3674 : StyleColor(rare_inherited_data_->text_fill_color_); |
| 3648 } | 3675 } |
| 3649 StyleColor TextStrokeColor() const { | 3676 StyleColor TextStrokeColor() const { |
| 3650 return rare_inherited_data_->TextStrokeColor(); | 3677 return rare_inherited_data_->text_stroke_color_is_current_color_ |
| 3678 ? StyleColor::CurrentColor() |
| 3679 : StyleColor(rare_inherited_data_->text_stroke_color_); |
| 3651 } | 3680 } |
| 3652 StyleAutoColor VisitedLinkCaretColor() const { | 3681 StyleAutoColor VisitedLinkCaretColor() const { |
| 3653 return rare_inherited_data_->VisitedLinkCaretColor(); | 3682 if (rare_inherited_data_->visited_link_caret_color_is_current_color_) |
| 3683 return StyleAutoColor::CurrentColor(); |
| 3684 if (rare_inherited_data_->visited_link_caret_color_is_auto_) |
| 3685 return StyleAutoColor::AutoColor(); |
| 3686 return StyleAutoColor(rare_inherited_data_->visited_link_caret_color_); |
| 3654 } | 3687 } |
| 3655 Color VisitedLinkColor() const; | 3688 Color VisitedLinkColor() const; |
| 3656 StyleColor VisitedLinkBackgroundColor() const { | 3689 StyleColor VisitedLinkBackgroundColor() const { |
| 3657 return rare_non_inherited_data_->visited_link_background_color_; | 3690 return rare_non_inherited_data_->visited_link_background_color_; |
| 3658 } | 3691 } |
| 3659 StyleColor VisitedLinkBorderLeftColor() const { | 3692 StyleColor VisitedLinkBorderLeftColor() const { |
| 3660 return rare_non_inherited_data_->visited_link_border_left_color_; | 3693 return rare_non_inherited_data_->visited_link_border_left_color_; |
| 3661 } | 3694 } |
| 3662 StyleColor VisitedLinkBorderRightColor() const { | 3695 StyleColor VisitedLinkBorderRightColor() const { |
| 3663 return rare_non_inherited_data_->visited_link_border_right_color_; | 3696 return rare_non_inherited_data_->visited_link_border_right_color_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3675 return rare_non_inherited_data_->multi_col_ | 3708 return rare_non_inherited_data_->multi_col_ |
| 3676 ->visited_link_column_rule_color_; | 3709 ->visited_link_column_rule_color_; |
| 3677 } | 3710 } |
| 3678 StyleColor TextDecorationColor() const { | 3711 StyleColor TextDecorationColor() const { |
| 3679 return rare_non_inherited_data_->text_decoration_color_; | 3712 return rare_non_inherited_data_->text_decoration_color_; |
| 3680 } | 3713 } |
| 3681 StyleColor VisitedLinkTextDecorationColor() const { | 3714 StyleColor VisitedLinkTextDecorationColor() const { |
| 3682 return rare_non_inherited_data_->visited_link_text_decoration_color_; | 3715 return rare_non_inherited_data_->visited_link_text_decoration_color_; |
| 3683 } | 3716 } |
| 3684 StyleColor VisitedLinkTextEmphasisColor() const { | 3717 StyleColor VisitedLinkTextEmphasisColor() const { |
| 3685 return rare_inherited_data_->VisitedLinkTextEmphasisColor(); | 3718 return rare_inherited_data_ |
| 3719 ->visited_link_text_emphasis_color_is_current_color_ |
| 3720 ? StyleColor::CurrentColor() |
| 3721 : StyleColor( |
| 3722 rare_inherited_data_->visited_link_text_emphasis_color_); |
| 3686 } | 3723 } |
| 3687 StyleColor VisitedLinkTextFillColor() const { | 3724 StyleColor VisitedLinkTextFillColor() const { |
| 3688 return rare_inherited_data_->VisitedLinkTextFillColor(); | 3725 return rare_inherited_data_->visited_link_text_fill_color_is_current_color_ |
| 3726 ? StyleColor::CurrentColor() |
| 3727 : StyleColor( |
| 3728 rare_inherited_data_->visited_link_text_fill_color_); |
| 3689 } | 3729 } |
| 3690 StyleColor VisitedLinkTextStrokeColor() const { | 3730 StyleColor VisitedLinkTextStrokeColor() const { |
| 3691 return rare_inherited_data_->VisitedLinkTextStrokeColor(); | 3731 return rare_inherited_data_ |
| 3732 ->visited_link_text_stroke_color_is_current_color_ |
| 3733 ? StyleColor::CurrentColor() |
| 3734 : StyleColor( |
| 3735 rare_inherited_data_->visited_link_text_stroke_color_); |
| 3692 } | 3736 } |
| 3693 | 3737 |
| 3694 StyleColor DecorationColorIncludingFallback(bool visited_link) const; | 3738 StyleColor DecorationColorIncludingFallback(bool visited_link) const; |
| 3695 Color ColorIncludingFallback(int color_property, bool visited_link) const; | 3739 Color ColorIncludingFallback(int color_property, bool visited_link) const; |
| 3696 | 3740 |
| 3697 Color StopColor() const { return SvgStyle().StopColor(); } | 3741 Color StopColor() const { return SvgStyle().StopColor(); } |
| 3698 Color FloodColor() const { return SvgStyle().FloodColor(); } | 3742 Color FloodColor() const { return SvgStyle().FloodColor(); } |
| 3699 Color LightingColor() const { return SvgStyle().LightingColor(); } | 3743 Color LightingColor() const { return SvgStyle().LightingColor(); } |
| 3700 | 3744 |
| 3701 void AddAppliedTextDecoration(const AppliedTextDecoration&); | 3745 void AddAppliedTextDecoration(const AppliedTextDecoration&); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3819 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3863 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
| 3820 } | 3864 } |
| 3821 | 3865 |
| 3822 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3866 inline bool ComputedStyle::HasPseudoElementStyle() const { |
| 3823 return PseudoBitsInternal() & kElementPseudoIdMask; | 3867 return PseudoBitsInternal() & kElementPseudoIdMask; |
| 3824 } | 3868 } |
| 3825 | 3869 |
| 3826 } // namespace blink | 3870 } // namespace blink |
| 3827 | 3871 |
| 3828 #endif // ComputedStyle_h | 3872 #endif // ComputedStyle_h |
| OLD | NEW |