Changeset 106704 in webkit


Ignore:
Timestamp:
Feb 3, 2012 4:10:18 PM (12 years ago)
Author:
tony@chromium.org
Message:

positive and negative flex values are not being cleared on style changes
https://bugs.webkit.org/show_bug.cgi?id=77771

Reviewed by Ojan Vafai.

Source/WebCore:

If the width or height was a flex() value, but is no longer a flex
value, we weren't clearing the positive and negative flex values in
RenderStyle.

Test: css3/flexbox/flex-no-flex.html

  • css/CSSStyleApplyProperty.cpp:

(WebCore::ApplyPropertyLength::applyValue):

LayoutTests:

  • css3/flexbox/flex-no-flex-expected.txt: Added.
  • css3/flexbox/flex-no-flex.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r106694 r106704  
     12012-02-03  Tony Chang  <tony@chromium.org>
     2
     3        positive and negative flex values are not being cleared on style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=77771
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * css3/flexbox/flex-no-flex-expected.txt: Added.
     9        * css3/flexbox/flex-no-flex.html: Added.
     10
    1112012-02-03  Mihnea Ovidenie  <mihnea@adobe.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r106700 r106704  
     12012-02-03  Tony Chang  <tony@chromium.org>
     2
     3        positive and negative flex values are not being cleared on style changes
     4        https://bugs.webkit.org/show_bug.cgi?id=77771
     5
     6        Reviewed by Ojan Vafai.
     7
     8        If the width or height was a flex() value, but is no longer a flex
     9        value, we weren't clearing the positive and negative flex values in
     10        RenderStyle.
     11
     12        Test: css3/flexbox/flex-no-flex.html
     13
     14        * css/CSSStyleApplyProperty.cpp:
     15        (WebCore::ApplyPropertyLength::applyValue):
     16
    1172012-02-03  James Robinson  <jamesr@chromium.org>
    218
  • trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp

    r105901 r106704  
    350350    static void applyValue(CSSStyleSelector* selector, CSSValue* value)
    351351    {
     352        float positiveFlex = 0;
     353        float negativeFlex = 0;
    352354        if (!value->isPrimitiveValue()) {
    353355            if (!flexDirection || !value->isFlexValue())
     
    357359            value = flexValue->preferredSize();
    358360
    359             if (flexDirection == FlexWidth) {
    360                 selector->style()->setFlexboxWidthPositiveFlex(flexValue->positiveFlex());
    361                 selector->style()->setFlexboxWidthNegativeFlex(flexValue->negativeFlex());
    362             } else if (flexDirection == FlexHeight) {
    363                 selector->style()->setFlexboxHeightPositiveFlex(flexValue->positiveFlex());
    364                 selector->style()->setFlexboxHeightNegativeFlex(flexValue->negativeFlex());
    365             }
     361            positiveFlex = flexValue->positiveFlex();
     362            negativeFlex = flexValue->negativeFlex();
     363        }
     364
     365        if (flexDirection == FlexWidth) {
     366            selector->style()->setFlexboxWidthPositiveFlex(positiveFlex);
     367            selector->style()->setFlexboxWidthNegativeFlex(negativeFlex);
     368        } else if (flexDirection == FlexHeight) {
     369            selector->style()->setFlexboxHeightPositiveFlex(positiveFlex);
     370            selector->style()->setFlexboxHeightNegativeFlex(negativeFlex);
    366371        }
    367372
Note: See TracChangeset for help on using the changeset viewer.