Changeset 30039 in webkit


Ignore:
Timestamp:
Feb 6, 2008 8:01:09 AM (16 years ago)
Author:
mitz@apple.com
Message:

WebCore:

Reviewed by Darin Adler.

Test: fast/css/transition-color-unspecified.html

  • page/AnimationController.cpp: (WebCore::ImplicitAnimation::animate): Changed to use the value of the 'color' property in the source or destination style as the source or destination value of properties whose inital value is defined to be the computed value of 'color'.

LayoutTests:

Reviewed by Darin Adler.

  • fast/css/transition-color-unspecified.html: Added.
  • platform/mac/fast/css/transition-color-unspecified-expected.checksum: Added.
  • platform/mac/fast/css/transition-color-unspecified-expected.png: Added.
  • platform/mac/fast/css/transition-color-unspecified-expected.txt: Added.
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r30035 r30039  
     12008-02-06  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?17093
     6        'border-color' does not animate to the value of 'color' when unspecified
     7
     8        * fast/css/transition-color-unspecified.html: Added.
     9        * platform/mac/fast/css/transition-color-unspecified-expected.checksum: Added.
     10        * platform/mac/fast/css/transition-color-unspecified-expected.png: Added.
     11        * platform/mac/fast/css/transition-color-unspecified-expected.txt: Added.
     12
    1132008-02-05  Oliver Hunt  <oliver@apple.com>
    214
  • trunk/WebCore/ChangeLog

    r30038 r30039  
     12008-02-06  Dan Bernstein  <mitz@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?17093
     6        'border-color' does not animate to the value of 'color' when unspecified
     7
     8        Test: fast/css/transition-color-unspecified.html
     9
     10        * page/AnimationController.cpp:
     11        (WebCore::ImplicitAnimation::animate): Changed to use the value of the
     12        'color' property in the source or destination style as the source or
     13        destination value of properties whose inital value is defined to be the
     14        computed value of 'color'.
     15
    1162008-02-06  Dan Bernstein  <mitz@apple.com>
    217
  • trunk/WebCore/page/AnimationController.cpp

    r29663 r30039  
    327327    }\
    328328
     329#define BLEND_MAYBE_INVALID_COLOR(prop, getter, setter) \
     330    if (m_property == prop && m_toStyle->getter() != targetStyle->getter()) \
     331        reset(renderer, currentStyle, targetStyle); \
     332    \
     333    if ((m_property == cAnimateAll && !animation->hasAnimationForProperty(prop)) || m_property == prop) { \
     334        Color fromColor = m_fromStyle->getter(); \
     335        Color toColor = m_toStyle->getter(); \
     336        if (!fromColor.isValid()) \
     337            fromColor = m_fromStyle->color(); \
     338        if (!toColor.isValid()) \
     339            toColor = m_toStyle->color(); \
     340        if (fromColor != toColor) {\
     341            m_finished = false; \
     342            if (!animatedStyle) \
     343                animatedStyle = new (renderer->renderArena()) RenderStyle(*targetStyle); \
     344            animatedStyle->setter(blendFunc(fromColor, toColor, progress()));\
     345            if (m_property == prop) \
     346                return; \
     347        }\
     348    }\
     349
    329350#define BLEND_SHADOW(prop, getter, setter) \
    330351    if (m_property == prop && (!m_toStyle->getter() || !targetStyle->getter() || *m_toStyle->getter() != *targetStyle->getter())) \
     
    373394    BLEND(CSS_PROP_COLOR, color, setColor);
    374395    BLEND(CSS_PROP_BACKGROUND_COLOR, backgroundColor, setBackgroundColor);
    375     BLEND(CSS_PROP__WEBKIT_COLUMN_RULE_COLOR, columnRuleColor, setColumnRuleColor);
     396    BLEND_MAYBE_INVALID_COLOR(CSS_PROP__WEBKIT_COLUMN_RULE_COLOR, columnRuleColor, setColumnRuleColor);
    376397    BLEND(CSS_PROP__WEBKIT_COLUMN_RULE_WIDTH, columnRuleWidth, setColumnRuleWidth);
    377398    BLEND(CSS_PROP__WEBKIT_COLUMN_GAP, columnGap, setColumnGap);
    378399    BLEND(CSS_PROP__WEBKIT_COLUMN_COUNT, columnCount, setColumnCount);
    379400    BLEND(CSS_PROP__WEBKIT_COLUMN_WIDTH, columnWidth, setColumnWidth);
    380     BLEND(CSS_PROP__WEBKIT_TEXT_STROKE_COLOR, textStrokeColor, setTextStrokeColor);
    381     BLEND(CSS_PROP__WEBKIT_TEXT_FILL_COLOR, textFillColor, setTextFillColor);
     401    BLEND_MAYBE_INVALID_COLOR(CSS_PROP__WEBKIT_TEXT_STROKE_COLOR, textStrokeColor, setTextStrokeColor);
     402    BLEND_MAYBE_INVALID_COLOR(CSS_PROP__WEBKIT_TEXT_FILL_COLOR, textFillColor, setTextFillColor);
    382403    BLEND(CSS_PROP__WEBKIT_BORDER_HORIZONTAL_SPACING, horizontalBorderSpacing, setHorizontalBorderSpacing);
    383404    BLEND(CSS_PROP__WEBKIT_BORDER_VERTICAL_SPACING, verticalBorderSpacing, setVerticalBorderSpacing);
    384     BLEND(CSS_PROP_BORDER_LEFT_COLOR, borderLeftColor, setBorderLeftColor);
    385     BLEND(CSS_PROP_BORDER_RIGHT_COLOR, borderRightColor, setBorderRightColor);
    386     BLEND(CSS_PROP_BORDER_TOP_COLOR, borderTopColor, setBorderTopColor);
    387     BLEND(CSS_PROP_BORDER_BOTTOM_COLOR, borderBottomColor, setBorderBottomColor);
     405    BLEND_MAYBE_INVALID_COLOR(CSS_PROP_BORDER_LEFT_COLOR, borderLeftColor, setBorderLeftColor);
     406    BLEND_MAYBE_INVALID_COLOR(CSS_PROP_BORDER_RIGHT_COLOR, borderRightColor, setBorderRightColor);
     407    BLEND_MAYBE_INVALID_COLOR(CSS_PROP_BORDER_TOP_COLOR, borderTopColor, setBorderTopColor);
     408    BLEND_MAYBE_INVALID_COLOR(CSS_PROP_BORDER_BOTTOM_COLOR, borderBottomColor, setBorderBottomColor);
    388409    BLEND(CSS_PROP_Z_INDEX, zIndex, setZIndex);
    389410    BLEND(CSS_PROP_LINE_HEIGHT, lineHeight, setLineHeight);
    390     BLEND(CSS_PROP_OUTLINE_COLOR, outlineColor, setOutlineColor);
     411    BLEND_MAYBE_INVALID_COLOR(CSS_PROP_OUTLINE_COLOR, outlineColor, setOutlineColor);
    391412    BLEND(CSS_PROP_OUTLINE_OFFSET, outlineOffset, setOutlineOffset);
    392413    BLEND(CSS_PROP_OUTLINE_WIDTH, outlineWidth, setOutlineWidth);
Note: See TracChangeset for help on using the changeset viewer.