Changeset 32421 in webkit
- Timestamp:
- Apr 22, 2008, 8:42:31 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r32417 r32421 1 2008-04-22 Anatoli Papirovski <apapirovski@mac.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=18584 6 Add a test case for border-color inheritance. 7 8 * fast/borders/border-color-inherit.html: Added. 9 * platform/mac/fast/borders/border-color-inherit-expected.checksum: Added. 10 * platform/mac/fast/borders/border-color-inherit-expected.png: Added. 11 * platform/mac/fast/borders/border-color-inherit-expected.txt: Added. 12 1 13 2008-04-22 David Hyatt <hyatt@apple.com> 2 14 -
trunk/WebCore/ChangeLog
r32418 r32421 1 2008-04-22 Anatoli Papirovski <apapirovski@mac.com> 2 3 Reviewed by Dan Bernstein. 4 5 - fix https://bugs.webkit.org/show_bug.cgi?id=18584 6 border-color, outline-color, column-color, -webkit-text-stroke-color, 7 and -webkit-text-fill-color inheritance to correctly use parent's color 8 if the parent's corresponding (border, outline, etc.)-color property 9 wasn't set. 10 11 Test: fast/borders/border-color-inherit.html 12 13 * css/CSSStyleSelector.cpp: 14 (WebCore::CSSStyleSelector::applyProperty): 15 1 16 2008-04-22 Alp Toker <alp@nuanti.com> 2 17 -
trunk/WebCore/css/CSSStyleSelector.cpp
r32417 r32421 235 235 if (id == propID) { \ 236 236 m_style->set##Prop(m_parentStyle->prop()); \ 237 return; \ 238 } 239 240 #define HANDLE_INHERIT_COND_WITH_BACKUP(propID, prop, propAlt, Prop) \ 241 if (id == propID) { \ 242 if (m_parentStyle->prop().isValid()) \ 243 m_style->set##Prop(m_parentStyle->prop()); \ 244 else \ 245 m_style->set##Prop(m_parentStyle->propAlt()); \ 237 246 return; \ 238 247 } … … 2785 2794 if (isInherit) { 2786 2795 HANDLE_INHERIT_COND(CSSPropertyBackgroundColor, backgroundColor, BackgroundColor) 2787 HANDLE_INHERIT_COND (CSSPropertyBorderTopColor, borderTopColor, BorderTopColor)2788 HANDLE_INHERIT_COND (CSSPropertyBorderBottomColor, borderBottomColor, BorderBottomColor)2789 HANDLE_INHERIT_COND (CSSPropertyBorderRightColor, borderRightColor, BorderRightColor)2790 HANDLE_INHERIT_COND (CSSPropertyBorderLeftColor, borderLeftColor, BorderLeftColor)2796 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyBorderTopColor, borderTopColor, color, BorderTopColor) 2797 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyBorderBottomColor, borderBottomColor, color, BorderBottomColor) 2798 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyBorderRightColor, borderRightColor, color, BorderRightColor) 2799 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyBorderLeftColor, borderLeftColor, color, BorderLeftColor) 2791 2800 HANDLE_INHERIT_COND(CSSPropertyColor, color, Color) 2792 HANDLE_INHERIT_COND (CSSPropertyOutlineColor, outlineColor, OutlineColor)2793 HANDLE_INHERIT_COND (CSSPropertyWebkitColumnRuleColor, columnRuleColor, ColumnRuleColor)2794 HANDLE_INHERIT_COND (CSSPropertyWebkitTextStrokeColor, textStrokeColor, TextStrokeColor)2795 HANDLE_INHERIT_COND (CSSPropertyWebkitTextFillColor, textFillColor, TextFillColor)2801 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyOutlineColor, outlineColor, color, OutlineColor) 2802 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitColumnRuleColor, columnRuleColor, color, ColumnRuleColor) 2803 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitTextStrokeColor, textStrokeColor, color, TextStrokeColor) 2804 HANDLE_INHERIT_COND_WITH_BACKUP(CSSPropertyWebkitTextFillColor, textFillColor, color, TextFillColor) 2796 2805 return; 2797 2806 } … … 3709 3718 { 3710 3719 if (isInherit) { 3711 m_style->setBorderTopColor(m_parentStyle->borderTopColor() );3712 m_style->setBorderBottomColor(m_parentStyle->borderBottomColor() );3713 m_style->setBorderLeftColor(m_parentStyle->borderLeftColor() );3714 m_style->setBorderRightColor(m_parentStyle->borderRightColor() );3720 m_style->setBorderTopColor(m_parentStyle->borderTopColor().isValid() ? m_parentStyle->borderTopColor() : m_parentStyle->color()); 3721 m_style->setBorderBottomColor(m_parentStyle->borderBottomColor().isValid() ? m_parentStyle->borderBottomColor() : m_parentStyle->color()); 3722 m_style->setBorderLeftColor(m_parentStyle->borderLeftColor().isValid() ? m_parentStyle->borderLeftColor() : m_parentStyle->color()); 3723 m_style->setBorderRightColor(m_parentStyle->borderRightColor().isValid() ? m_parentStyle->borderRightColor(): m_parentStyle->color()); 3715 3724 } 3716 3725 else if (isInitial) { … … 3754 3763 case CSSPropertyBorderTop: 3755 3764 if (isInherit) { 3756 m_style->setBorderTopColor(m_parentStyle->borderTopColor() );3765 m_style->setBorderTopColor(m_parentStyle->borderTopColor().isValid() ? m_parentStyle->borderTopColor() : m_parentStyle->color()); 3757 3766 m_style->setBorderTopStyle(m_parentStyle->borderTopStyle()); 3758 3767 m_style->setBorderTopWidth(m_parentStyle->borderTopWidth()); … … 3763 3772 case CSSPropertyBorderRight: 3764 3773 if (isInherit) { 3765 m_style->setBorderRightColor(m_parentStyle->borderRightColor() );3774 m_style->setBorderRightColor(m_parentStyle->borderRightColor().isValid() ? m_parentStyle->borderRightColor() : m_parentStyle->color()); 3766 3775 m_style->setBorderRightStyle(m_parentStyle->borderRightStyle()); 3767 3776 m_style->setBorderRightWidth(m_parentStyle->borderRightWidth()); … … 3772 3781 case CSSPropertyBorderBottom: 3773 3782 if (isInherit) { 3774 m_style->setBorderBottomColor(m_parentStyle->borderBottomColor() );3783 m_style->setBorderBottomColor(m_parentStyle->borderBottomColor().isValid() ? m_parentStyle->borderBottomColor() : m_parentStyle->color()); 3775 3784 m_style->setBorderBottomStyle(m_parentStyle->borderBottomStyle()); 3776 3785 m_style->setBorderBottomWidth(m_parentStyle->borderBottomWidth()); … … 3781 3790 case CSSPropertyBorderLeft: 3782 3791 if (isInherit) { 3783 m_style->setBorderLeftColor(m_parentStyle->borderLeftColor() );3792 m_style->setBorderLeftColor(m_parentStyle->borderLeftColor().isValid() ? m_parentStyle->borderLeftColor() : m_parentStyle->color()); 3784 3793 m_style->setBorderLeftStyle(m_parentStyle->borderLeftStyle()); 3785 3794 m_style->setBorderLeftWidth(m_parentStyle->borderLeftWidth()); … … 3875 3884 if (isInherit) { 3876 3885 m_style->setOutlineWidth(m_parentStyle->outlineWidth()); 3877 m_style->setOutlineColor(m_parentStyle->outlineColor() );3886 m_style->setOutlineColor(m_parentStyle->outlineColor().isValid() ? m_parentStyle->outlineColor() : m_parentStyle->color()); 3878 3887 m_style->setOutlineStyle(m_parentStyle->outlineStyle()); 3879 3888 } … … 4230 4239 case CSSPropertyWebkitColumnRule: 4231 4240 if (isInherit) { 4232 m_style->setColumnRuleColor(m_parentStyle->columnRuleColor() );4241 m_style->setColumnRuleColor(m_parentStyle->columnRuleColor().isValid() ? m_parentStyle->columnRuleColor() : m_parentStyle->color()); 4233 4242 m_style->setColumnRuleStyle(m_parentStyle->columnRuleStyle()); 4234 4243 m_style->setColumnRuleWidth(m_parentStyle->columnRuleWidth());
Note:
See TracChangeset
for help on using the changeset viewer.