| 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 1837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1848 SET_VAR(rare_inherited_data_, text_emphasis_fill, fill); | 1848 SET_VAR(rare_inherited_data_, text_emphasis_fill, fill); |
| 1849 } | 1849 } |
| 1850 void SetTextEmphasisMark(TextEmphasisMark mark) { | 1850 void SetTextEmphasisMark(TextEmphasisMark mark) { |
| 1851 SET_VAR(rare_inherited_data_, text_emphasis_mark, mark); | 1851 SET_VAR(rare_inherited_data_, text_emphasis_mark, mark); |
| 1852 } | 1852 } |
| 1853 void SetTextEmphasisCustomMark(const AtomicString& mark) { | 1853 void SetTextEmphasisCustomMark(const AtomicString& mark) { |
| 1854 SET_VAR(rare_inherited_data_, text_emphasis_custom_mark, mark); | 1854 SET_VAR(rare_inherited_data_, text_emphasis_custom_mark, mark); |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) | 1857 // -webkit-text-emphasis-color (aka -epub-text-emphasis-color) |
| 1858 void SetTextEmphasisColor(const StyleColor& c) { | 1858 void SetTextEmphasisColor(const StyleColor& color) { |
| 1859 SET_VAR_WITH_SETTER(rare_inherited_data_, TextEmphasisColor, | 1859 SET_VAR(rare_inherited_data_, text_emphasis_color_, color.Resolve(Color())); |
| 1860 SetTextEmphasisColor, c); | 1860 SET_VAR(rare_inherited_data_, text_emphasis_color_is_current_color_, |
| 1861 color.IsCurrentColor()); |
| 1861 } | 1862 } |
| 1862 | 1863 |
| 1863 // -webkit-text-emphasis-position | 1864 // -webkit-text-emphasis-position |
| 1864 static TextEmphasisPosition InitialTextEmphasisPosition() { | 1865 static TextEmphasisPosition InitialTextEmphasisPosition() { |
| 1865 return kTextEmphasisPositionOver; | 1866 return kTextEmphasisPositionOver; |
| 1866 } | 1867 } |
| 1867 TextEmphasisPosition GetTextEmphasisPosition() const { | 1868 TextEmphasisPosition GetTextEmphasisPosition() const { |
| 1868 return static_cast<TextEmphasisPosition>( | 1869 return static_cast<TextEmphasisPosition>( |
| 1869 rare_inherited_data_->text_emphasis_position); | 1870 rare_inherited_data_->text_emphasis_position); |
| 1870 } | 1871 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1902 // -webkit-tap-highlight-color | 1903 // -webkit-tap-highlight-color |
| 1903 static Color InitialTapHighlightColor(); | 1904 static Color InitialTapHighlightColor(); |
| 1904 Color TapHighlightColor() const { | 1905 Color TapHighlightColor() const { |
| 1905 return rare_inherited_data_->tap_highlight_color; | 1906 return rare_inherited_data_->tap_highlight_color; |
| 1906 } | 1907 } |
| 1907 void SetTapHighlightColor(const Color& c) { | 1908 void SetTapHighlightColor(const Color& c) { |
| 1908 SET_VAR(rare_inherited_data_, tap_highlight_color, c); | 1909 SET_VAR(rare_inherited_data_, tap_highlight_color, c); |
| 1909 } | 1910 } |
| 1910 | 1911 |
| 1911 // -webkit-text-fill-color | 1912 // -webkit-text-fill-color |
| 1912 void SetTextFillColor(const StyleColor& c) { | 1913 void SetTextFillColor(const StyleColor& color) { |
| 1913 SET_VAR_WITH_SETTER(rare_inherited_data_, TextFillColor, SetTextFillColor, | 1914 SET_VAR(rare_inherited_data_, text_fill_color_, color.Resolve(Color())); |
| 1914 c); | 1915 SET_VAR(rare_inherited_data_, text_fill_color_is_current_color_, |
| 1916 color.IsCurrentColor()); |
| 1915 } | 1917 } |
| 1916 | 1918 |
| 1917 // -webkit-text-security | 1919 // -webkit-text-security |
| 1918 static ETextSecurity InitialTextSecurity() { return TSNONE; } | 1920 static ETextSecurity InitialTextSecurity() { return TSNONE; } |
| 1919 ETextSecurity TextSecurity() const { | 1921 ETextSecurity TextSecurity() const { |
| 1920 return static_cast<ETextSecurity>(rare_inherited_data_->text_security); | 1922 return static_cast<ETextSecurity>(rare_inherited_data_->text_security); |
| 1921 } | 1923 } |
| 1922 void SetTextSecurity(ETextSecurity a_text_security) { | 1924 void SetTextSecurity(ETextSecurity a_text_security) { |
| 1923 SET_VAR(rare_inherited_data_, text_security, a_text_security); | 1925 SET_VAR(rare_inherited_data_, text_security, a_text_security); |
| 1924 } | 1926 } |
| 1925 | 1927 |
| 1926 // -webkit-text-stroke-color | 1928 // -webkit-text-stroke-color |
| 1927 void SetTextStrokeColor(const StyleColor& c) { | 1929 void SetTextStrokeColor(const StyleColor& color) { |
| 1928 SET_VAR_WITH_SETTER(rare_inherited_data_, TextStrokeColor, | 1930 SET_VAR(rare_inherited_data_, text_stroke_color_, color.Resolve(Color())); |
| 1929 SetTextStrokeColor, c); | 1931 SET_VAR(rare_inherited_data_, text_stroke_color_is_current_color_, |
| 1932 color.IsCurrentColor()); |
| 1930 } | 1933 } |
| 1931 | 1934 |
| 1932 // -webkit-text-stroke-width | 1935 // -webkit-text-stroke-width |
| 1933 static float InitialTextStrokeWidth() { return 0; } | 1936 static float InitialTextStrokeWidth() { return 0; } |
| 1934 float TextStrokeWidth() const { | 1937 float TextStrokeWidth() const { |
| 1935 return rare_inherited_data_->text_stroke_width; | 1938 return rare_inherited_data_->text_stroke_width; |
| 1936 } | 1939 } |
| 1937 void SetTextStrokeWidth(float w) { | 1940 void SetTextStrokeWidth(float w) { |
| 1938 SET_VAR(rare_inherited_data_, text_stroke_width, w); | 1941 SET_VAR(rare_inherited_data_, text_stroke_width, w); |
| 1939 } | 1942 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 1959 // -webkit-user-select | 1962 // -webkit-user-select |
| 1960 static EUserSelect InitialUserSelect() { return SELECT_TEXT; } | 1963 static EUserSelect InitialUserSelect() { return SELECT_TEXT; } |
| 1961 EUserSelect UserSelect() const { | 1964 EUserSelect UserSelect() const { |
| 1962 return static_cast<EUserSelect>(rare_inherited_data_->user_select); | 1965 return static_cast<EUserSelect>(rare_inherited_data_->user_select); |
| 1963 } | 1966 } |
| 1964 void SetUserSelect(EUserSelect s) { | 1967 void SetUserSelect(EUserSelect s) { |
| 1965 SET_VAR(rare_inherited_data_, user_select, s); | 1968 SET_VAR(rare_inherited_data_, user_select, s); |
| 1966 } | 1969 } |
| 1967 | 1970 |
| 1968 // caret-color | 1971 // caret-color |
| 1969 void SetCaretColor(const StyleAutoColor& c) { | 1972 void SetCaretColor(const StyleAutoColor& color) { |
| 1970 SET_VAR_WITH_SETTER(rare_inherited_data_, CaretColor, SetCaretColor, c); | 1973 SET_VAR(rare_inherited_data_, caret_color_, color.Resolve(Color())); |
| 1974 SET_VAR(rare_inherited_data_, caret_color_is_current_color_, |
| 1975 color.IsCurrentColor()); |
| 1976 SET_VAR(rare_inherited_data_, caret_color_is_auto_, color.IsAutoColor()); |
| 1971 } | 1977 } |
| 1972 | 1978 |
| 1973 // Font properties. | 1979 // Font properties. |
| 1974 const Font& GetFont() const; | 1980 const Font& GetFont() const; |
| 1975 void SetFont(const Font&); | 1981 void SetFont(const Font&); |
| 1976 const FontDescription& GetFontDescription() const; | 1982 const FontDescription& GetFontDescription() const; |
| 1977 bool SetFontDescription(const FontDescription&); | 1983 bool SetFontDescription(const FontDescription&); |
| 1978 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; | 1984 bool HasIdenticalAscentDescentAndLineGap(const ComputedStyle& other) const; |
| 1979 | 1985 |
| 1980 // font-size | 1986 // font-size |
| (...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3385 void SetVisitedLinkOutlineColor(const StyleColor& v) { | 3391 void SetVisitedLinkOutlineColor(const StyleColor& v) { |
| 3386 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); | 3392 SET_VAR(rare_non_inherited_data_, visited_link_outline_color_, v); |
| 3387 } | 3393 } |
| 3388 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { | 3394 void SetVisitedLinkColumnRuleColor(const StyleColor& v) { |
| 3389 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, | 3395 SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, |
| 3390 visited_link_column_rule_color_, v); | 3396 visited_link_column_rule_color_, v); |
| 3391 } | 3397 } |
| 3392 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { | 3398 void SetVisitedLinkTextDecorationColor(const StyleColor& v) { |
| 3393 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); | 3399 SET_VAR(rare_non_inherited_data_, visited_link_text_decoration_color_, v); |
| 3394 } | 3400 } |
| 3395 void SetVisitedLinkTextEmphasisColor(const StyleColor& v) { | 3401 void SetVisitedLinkTextEmphasisColor(const StyleColor& color) { |
| 3396 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextEmphasisColor, | 3402 SET_VAR(rare_inherited_data_, visited_link_text_emphasis_color_, |
| 3397 SetVisitedLinkTextEmphasisColor, v); | 3403 color.Resolve(Color())); |
| 3404 SET_VAR(rare_inherited_data_, |
| 3405 visited_link_text_emphasis_color_is_current_color_, |
| 3406 color.IsCurrentColor()); |
| 3398 } | 3407 } |
| 3399 void SetVisitedLinkTextFillColor(const StyleColor& v) { | 3408 void SetVisitedLinkTextFillColor(const StyleColor& color) { |
| 3400 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextFillColor, | 3409 SET_VAR(rare_inherited_data_, visited_link_text_fill_color_, |
| 3401 SetVisitedLinkTextFillColor, v); | 3410 color.Resolve(Color())); |
| 3411 SET_VAR(rare_inherited_data_, |
| 3412 visited_link_text_fill_color_is_current_color_, |
| 3413 color.IsCurrentColor()); |
| 3402 } | 3414 } |
| 3403 void SetVisitedLinkTextStrokeColor(const StyleColor& v) { | 3415 void SetVisitedLinkTextStrokeColor(const StyleColor& color) { |
| 3404 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkTextStrokeColor, | 3416 SET_VAR(rare_inherited_data_, visited_link_text_stroke_color_, |
| 3405 SetVisitedLinkTextStrokeColor, v); | 3417 color.Resolve(Color())); |
| 3418 SET_VAR(rare_inherited_data_, |
| 3419 visited_link_text_stroke_color_is_current_color_, |
| 3420 color.IsCurrentColor()); |
| 3406 } | 3421 } |
| 3407 void SetVisitedLinkCaretColor(const StyleAutoColor& v) { | 3422 void SetVisitedLinkCaretColor(const StyleAutoColor& color) { |
| 3408 SET_VAR_WITH_SETTER(rare_inherited_data_, VisitedLinkCaretColor, | 3423 SET_VAR(rare_inherited_data_, visited_link_caret_color_, |
| 3409 SetVisitedLinkCaretColor, v); | 3424 color.Resolve(Color())); |
| 3425 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_current_color_, |
| 3426 color.IsCurrentColor()); |
| 3427 SET_VAR(rare_inherited_data_, visited_link_caret_color_is_auto_, |
| 3428 color.IsAutoColor()); |
| 3410 } | 3429 } |
| 3411 | 3430 |
| 3412 static bool IsDisplayBlockContainer(EDisplay display) { | 3431 static bool IsDisplayBlockContainer(EDisplay display) { |
| 3413 return display == EDisplay::kBlock || display == EDisplay::kListItem || | 3432 return display == EDisplay::kBlock || display == EDisplay::kListItem || |
| 3414 display == EDisplay::kInlineBlock || | 3433 display == EDisplay::kInlineBlock || |
| 3415 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || | 3434 display == EDisplay::kFlowRoot || display == EDisplay::kTableCell || |
| 3416 display == EDisplay::kTableCaption; | 3435 display == EDisplay::kTableCaption; |
| 3417 } | 3436 } |
| 3418 | 3437 |
| 3419 static bool IsDisplayFlexibleBox(EDisplay display) { | 3438 static bool IsDisplayFlexibleBox(EDisplay display) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3459 StyleColor BorderTopColor() const { | 3478 StyleColor BorderTopColor() const { |
| 3460 return surround_data_->border_.Top().GetColor(); | 3479 return surround_data_->border_.Top().GetColor(); |
| 3461 } | 3480 } |
| 3462 StyleColor BorderBottomColor() const { | 3481 StyleColor BorderBottomColor() const { |
| 3463 return surround_data_->border_.Bottom().GetColor(); | 3482 return surround_data_->border_.Bottom().GetColor(); |
| 3464 } | 3483 } |
| 3465 StyleColor BackgroundColor() const { | 3484 StyleColor BackgroundColor() const { |
| 3466 return background_data_->background_color_; | 3485 return background_data_->background_color_; |
| 3467 } | 3486 } |
| 3468 StyleAutoColor CaretColor() const { | 3487 StyleAutoColor CaretColor() const { |
| 3469 return rare_inherited_data_->CaretColor(); | 3488 if (rare_inherited_data_->caret_color_is_current_color_) |
| 3489 return StyleAutoColor::CurrentColor(); |
| 3490 if (rare_inherited_data_->caret_color_is_auto_) |
| 3491 return StyleAutoColor::AutoColor(); |
| 3492 return StyleAutoColor(rare_inherited_data_->caret_color_); |
| 3470 } | 3493 } |
| 3471 Color GetColor() const; | 3494 Color GetColor() const; |
| 3472 StyleColor ColumnRuleColor() const { | 3495 StyleColor ColumnRuleColor() const { |
| 3473 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); | 3496 return rare_non_inherited_data_->multi_col_->rule_.GetColor(); |
| 3474 } | 3497 } |
| 3475 StyleColor OutlineColor() const { | 3498 StyleColor OutlineColor() const { |
| 3476 return rare_non_inherited_data_->outline_.GetColor(); | 3499 return rare_non_inherited_data_->outline_.GetColor(); |
| 3477 } | 3500 } |
| 3478 StyleColor TextEmphasisColor() const { | 3501 StyleColor TextEmphasisColor() const { |
| 3479 return rare_inherited_data_->TextEmphasisColor(); | 3502 return rare_inherited_data_->text_emphasis_color_is_current_color_ |
| 3503 ? StyleColor::CurrentColor() |
| 3504 : StyleColor(rare_inherited_data_->text_emphasis_color_); |
| 3480 } | 3505 } |
| 3481 StyleColor TextFillColor() const { | 3506 StyleColor TextFillColor() const { |
| 3482 return rare_inherited_data_->TextFillColor(); | 3507 return rare_inherited_data_->text_fill_color_is_current_color_ |
| 3508 ? StyleColor::CurrentColor() |
| 3509 : StyleColor(rare_inherited_data_->text_fill_color_); |
| 3483 } | 3510 } |
| 3484 StyleColor TextStrokeColor() const { | 3511 StyleColor TextStrokeColor() const { |
| 3485 return rare_inherited_data_->TextStrokeColor(); | 3512 return rare_inherited_data_->text_stroke_color_is_current_color_ |
| 3513 ? StyleColor::CurrentColor() |
| 3514 : StyleColor(rare_inherited_data_->text_stroke_color_); |
| 3486 } | 3515 } |
| 3487 StyleAutoColor VisitedLinkCaretColor() const { | 3516 StyleAutoColor VisitedLinkCaretColor() const { |
| 3488 return rare_inherited_data_->VisitedLinkCaretColor(); | 3517 if (rare_inherited_data_->visited_link_caret_color_is_current_color_) |
| 3518 return StyleAutoColor::CurrentColor(); |
| 3519 if (rare_inherited_data_->visited_link_caret_color_is_auto_) |
| 3520 return StyleAutoColor::AutoColor(); |
| 3521 return StyleAutoColor(rare_inherited_data_->visited_link_caret_color_); |
| 3489 } | 3522 } |
| 3490 Color VisitedLinkColor() const; | 3523 Color VisitedLinkColor() const; |
| 3491 StyleColor VisitedLinkBackgroundColor() const { | 3524 StyleColor VisitedLinkBackgroundColor() const { |
| 3492 return rare_non_inherited_data_->visited_link_background_color_; | 3525 return rare_non_inherited_data_->visited_link_background_color_; |
| 3493 } | 3526 } |
| 3494 StyleColor VisitedLinkBorderLeftColor() const { | 3527 StyleColor VisitedLinkBorderLeftColor() const { |
| 3495 return rare_non_inherited_data_->visited_link_border_left_color_; | 3528 return rare_non_inherited_data_->visited_link_border_left_color_; |
| 3496 } | 3529 } |
| 3497 StyleColor VisitedLinkBorderRightColor() const { | 3530 StyleColor VisitedLinkBorderRightColor() const { |
| 3498 return rare_non_inherited_data_->visited_link_border_right_color_; | 3531 return rare_non_inherited_data_->visited_link_border_right_color_; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3510 return rare_non_inherited_data_->multi_col_ | 3543 return rare_non_inherited_data_->multi_col_ |
| 3511 ->visited_link_column_rule_color_; | 3544 ->visited_link_column_rule_color_; |
| 3512 } | 3545 } |
| 3513 StyleColor TextDecorationColor() const { | 3546 StyleColor TextDecorationColor() const { |
| 3514 return rare_non_inherited_data_->text_decoration_color_; | 3547 return rare_non_inherited_data_->text_decoration_color_; |
| 3515 } | 3548 } |
| 3516 StyleColor VisitedLinkTextDecorationColor() const { | 3549 StyleColor VisitedLinkTextDecorationColor() const { |
| 3517 return rare_non_inherited_data_->visited_link_text_decoration_color_; | 3550 return rare_non_inherited_data_->visited_link_text_decoration_color_; |
| 3518 } | 3551 } |
| 3519 StyleColor VisitedLinkTextEmphasisColor() const { | 3552 StyleColor VisitedLinkTextEmphasisColor() const { |
| 3520 return rare_inherited_data_->VisitedLinkTextEmphasisColor(); | 3553 return rare_inherited_data_ |
| 3554 ->visited_link_text_emphasis_color_is_current_color_ |
| 3555 ? StyleColor::CurrentColor() |
| 3556 : StyleColor( |
| 3557 rare_inherited_data_->visited_link_text_emphasis_color_); |
| 3521 } | 3558 } |
| 3522 StyleColor VisitedLinkTextFillColor() const { | 3559 StyleColor VisitedLinkTextFillColor() const { |
| 3523 return rare_inherited_data_->VisitedLinkTextFillColor(); | 3560 return rare_inherited_data_->visited_link_text_fill_color_is_current_color_ |
| 3561 ? StyleColor::CurrentColor() |
| 3562 : StyleColor( |
| 3563 rare_inherited_data_->visited_link_text_fill_color_); |
| 3524 } | 3564 } |
| 3525 StyleColor VisitedLinkTextStrokeColor() const { | 3565 StyleColor VisitedLinkTextStrokeColor() const { |
| 3526 return rare_inherited_data_->VisitedLinkTextStrokeColor(); | 3566 return rare_inherited_data_ |
| 3567 ->visited_link_text_stroke_color_is_current_color_ |
| 3568 ? StyleColor::CurrentColor() |
| 3569 : StyleColor( |
| 3570 rare_inherited_data_->visited_link_text_stroke_color_); |
| 3527 } | 3571 } |
| 3528 | 3572 |
| 3529 StyleColor DecorationColorIncludingFallback(bool visited_link) const; | 3573 StyleColor DecorationColorIncludingFallback(bool visited_link) const; |
| 3530 Color ColorIncludingFallback(int color_property, bool visited_link) const; | 3574 Color ColorIncludingFallback(int color_property, bool visited_link) const; |
| 3531 | 3575 |
| 3532 Color StopColor() const { return SvgStyle().StopColor(); } | 3576 Color StopColor() const { return SvgStyle().StopColor(); } |
| 3533 Color FloodColor() const { return SvgStyle().FloodColor(); } | 3577 Color FloodColor() const { return SvgStyle().FloodColor(); } |
| 3534 Color LightingColor() const { return SvgStyle().LightingColor(); } | 3578 Color LightingColor() const { return SvgStyle().LightingColor(); } |
| 3535 | 3579 |
| 3536 void AddAppliedTextDecoration(const AppliedTextDecoration&); | 3580 void AddAppliedTextDecoration(const AppliedTextDecoration&); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3654 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); | 3698 PseudoBitsInternal() | 1 << (pseudo - kFirstPublicPseudoId))); |
| 3655 } | 3699 } |
| 3656 | 3700 |
| 3657 inline bool ComputedStyle::HasPseudoElementStyle() const { | 3701 inline bool ComputedStyle::HasPseudoElementStyle() const { |
| 3658 return PseudoBitsInternal() & kElementPseudoIdMask; | 3702 return PseudoBitsInternal() & kElementPseudoIdMask; |
| 3659 } | 3703 } |
| 3660 | 3704 |
| 3661 } // namespace blink | 3705 } // namespace blink |
| 3662 | 3706 |
| 3663 #endif // ComputedStyle_h | 3707 #endif // ComputedStyle_h |
| OLD | NEW |