Changeset 80383 in webkit


Ignore:
Timestamp:
Mar 4, 2011 3:38:47 PM (13 years ago)
Author:
tonyg@chromium.org
Message:

2011-03-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r80379.
http://trac.webkit.org/changeset/80379
https://bugs.webkit.org/show_bug.cgi?id=55799

"Breaks leopard compile (implicit conversion)" (Requested by
tonyg-cr on #webkit).

  • transitions/matched-transform-functions.html:
  • transitions/retargetted-transition.html:

2011-03-04 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r80379.
http://trac.webkit.org/changeset/80379
https://bugs.webkit.org/show_bug.cgi?id=55799

"Breaks leopard compile (implicit conversion)" (Requested by
tonyg-cr on #webkit).

  • css/CSSStyleSelector.cpp: (WebCore::convertToLength): (WebCore::CSSStyleSelector::applyProperty): (WebCore::CSSStyleSelector::createTransformOperations):
  • platform/Length.h: (WebCore::Length::Length): (WebCore::Length::operator==): (WebCore::Length::operator!=): (WebCore::Length::rawValue): (WebCore::Length::type): (WebCore::Length::quirk): (WebCore::Length::setValue): (WebCore::Length::setRawValue): (WebCore::Length::calcFloatValue): (WebCore::Length::isZero): (WebCore::Length::blend):
  • rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::recalcColumn): (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
  • rendering/FixedTableLayout.cpp: (WebCore::FixedTableLayout::calcWidthArray):
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80379 r80383  
     12011-03-04  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r80379.
     4        http://trac.webkit.org/changeset/80379
     5        https://bugs.webkit.org/show_bug.cgi?id=55799
     6
     7        "Breaks leopard compile (implicit conversion)" (Requested by
     8        tonyg-cr on #webkit).
     9
     10        * transitions/matched-transform-functions.html:
     11        * transitions/retargetted-transition.html:
     12
    1132011-03-04  Rik Cabanier  <cabanier@gmail.com>
    214
  • trunk/LayoutTests/transitions/matched-transform-functions.html

    r80379 r80383  
    2525    function test()
    2626    {
    27       var c = new WebKitCSSMatrix(window.getComputedStyle(document.getElementById('box')).webkitTransform);     
    28       var result = (c.f < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200';
     27      var t = window.getComputedStyle(document.getElementById('box')).webkitTransform;
     28      // grab the last value from the matrix()
     29      var lastValueRE = /(\d+)\)$/;
     30      var yTranslate = parseInt(lastValueRE.exec(t));
     31     
     32      var result = (yTranslate < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200';
    2933      document.getElementById('result').innerHTML = result;
    3034
  • trunk/LayoutTests/transitions/retargetted-transition.html

    r80379 r80383  
    2424    function test()
    2525    {
    26       var c = new WebKitCSSMatrix(window.getComputedStyle(document.getElementById('box')).webkitTransform);
    27       var result = (c.f < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200';
     26      var t = window.getComputedStyle(document.getElementById('box')).webkitTransform;
     27      // grab the last value from the matrix()
     28      var lastValueRE = /(\d+)\)$/;
     29      var yTranslate = parseInt(lastValueRE.exec(t));
     30
     31      var result = (yTranslate < 200) ? 'PASS' : 'FAIL: transition should still be running, so y < 200';
    2832      document.getElementById('result').innerHTML = result;
    2933
  • trunk/Source/WebCore/ChangeLog

    r80381 r80383  
     12011-03-04  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r80379.
     4        http://trac.webkit.org/changeset/80379
     5        https://bugs.webkit.org/show_bug.cgi?id=55799
     6
     7        "Breaks leopard compile (implicit conversion)" (Requested by
     8        tonyg-cr on #webkit).
     9
     10        * css/CSSStyleSelector.cpp:
     11        (WebCore::convertToLength):
     12        (WebCore::CSSStyleSelector::applyProperty):
     13        (WebCore::CSSStyleSelector::createTransformOperations):
     14        * platform/Length.h:
     15        (WebCore::Length::Length):
     16        (WebCore::Length::operator==):
     17        (WebCore::Length::operator!=):
     18        (WebCore::Length::rawValue):
     19        (WebCore::Length::type):
     20        (WebCore::Length::quirk):
     21        (WebCore::Length::setValue):
     22        (WebCore::Length::setRawValue):
     23        (WebCore::Length::calcFloatValue):
     24        (WebCore::Length::isZero):
     25        (WebCore::Length::blend):
     26        * rendering/AutoTableLayout.cpp:
     27        (WebCore::AutoTableLayout::recalcColumn):
     28        (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
     29        * rendering/FixedTableLayout.cpp:
     30        (WebCore::FixedTableLayout::calcWidthArray):
     31
    1322011-03-04  Jessie Berlin  <jberlin@apple.com>
    233
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r80379 r80383  
    33643364// this is mostly boring stuff on how to apply a certain rule to the renderstyle...
    33653365
    3366 static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, bool toFloat, double multiplier = 1, bool *ok = 0)
     3366static Length convertToLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)
    33673367{
    33683368    // This function is tolerant of a null style value. The only place style is used is in
     
    33793379            if (ok)
    33803380                *ok = false;
    3381         } else if (CSSPrimitiveValue::isUnitTypeLength(type)) {
    3382             if (toFloat)
    3383                 l = Length(primitiveValue->computeLengthDouble(style, rootStyle, multiplier), Fixed);
    3384             else
    3385                 l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed);
    3386         }
     3381        } else if (CSSPrimitiveValue::isUnitTypeLength(type))
     3382            l = Length(primitiveValue->computeLengthIntForLength(style, rootStyle, multiplier), Fixed);
    33873383        else if (type == CSSPrimitiveValue::CSS_PERCENTAGE)
    33883384            l = Length(primitiveValue->getDoubleValue(), Percent);
     
    33933389    }
    33943390    return l;
    3395 }
    3396    
    3397 static Length convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)
    3398 {
    3399     return convertToLength(primitiveValue, style, rootStyle, false, multiplier, ok);
    3400 }
    3401 
    3402 static Length convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier = 1, bool *ok = 0)
    3403 {
    3404     return convertToLength(primitiveValue, style, rootStyle, true, multiplier, ok);
    34053391}
    34063392
     
    47244710            if (!rect)
    47254711                return;
    4726             top = convertToIntLength(rect->top(), style(), m_rootElementStyle, zoomFactor);
    4727             right = convertToIntLength(rect->right(), style(), m_rootElementStyle, zoomFactor);
    4728             bottom = convertToIntLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor);
    4729             left = convertToIntLength(rect->left(), style(), m_rootElementStyle, zoomFactor);
     4712            top = convertToLength(rect->top(), style(), m_rootElementStyle, zoomFactor);
     4713            right = convertToLength(rect->right(), style(), m_rootElementStyle, zoomFactor);
     4714            bottom = convertToLength(rect->bottom(), style(), m_rootElementStyle, zoomFactor);
     4715            left = convertToLength(rect->left(), style(), m_rootElementStyle, zoomFactor);
    47304716        } else if (primitiveValue->getIdent() != CSSValueAuto) {
    47314717            return;
     
    56705656        else {
    56715657            bool ok = true;
    5672             Length marqueeLength = convertToIntLength(primitiveValue, style(), m_rootElementStyle, 1, &ok);
     5658            Length l = convertToLength(primitiveValue, style(), m_rootElementStyle, 1, &ok);
    56735659            if (ok)
    5674                 m_style->setMarqueeIncrement(marqueeLength);
     5660                m_style->setMarqueeIncrement(l);
    56755661        }
    56765662        return;
     
    58185804        DashboardRegion *first = region;
    58195805        while (region) {
    5820             Length top = convertToIntLength(region->top(), style(), m_rootElementStyle);
    5821             Length right = convertToIntLength(region->right(), style(), m_rootElementStyle);
    5822             Length bottom = convertToIntLength(region->bottom(), style(), m_rootElementStyle);
    5823             Length left = convertToIntLength(region->left(), style(), m_rootElementStyle);
     5806            Length top = convertToLength(region->top(), style(), m_rootElementStyle);
     5807            Length right = convertToLength(region->right(), style(), m_rootElementStyle);
     5808            Length bottom = convertToLength(region->bottom(), style(), m_rootElementStyle);
     5809            Length left = convertToLength(region->left(), style(), m_rootElementStyle);
    58245810            if (region->m_isCircle)
    58255811                m_style->setDashboardRegion(StyleDashboardRegion::Circle, region->m_label, top, right, bottom, left, region == first ? false : true);
     
    72797265                Length ty = Length(0, Fixed);
    72807266                if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
    7281                     ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7267                    ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    72827268                else {
    7283                     tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7269                    tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    72847270                    if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
    72857271                        if (transformValue->length() > 1) {
    72867272                            CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
    7287                             ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor, &ok);
     7273                            ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok);
    72887274                        }
    72897275                    }
     
    73037289                Length tz = Length(0, Fixed);
    73047290                if (transformValue->operationType() == WebKitCSSTransformValue::TranslateZTransformOperation)
    7305                     tz = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7291                    tz = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    73067292                else if (transformValue->operationType() == WebKitCSSTransformValue::TranslateYTransformOperation)
    7307                     ty = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7293                    ty = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    73087294                else {
    7309                     tx = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7295                    tx = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    73107296                    if (transformValue->operationType() != WebKitCSSTransformValue::TranslateXTransformOperation) {
    73117297                        if (transformValue->length() > 2) {
    73127298                            CSSPrimitiveValue* thirdValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(2));
    7313                             tz = convertToFloatLength(thirdValue, style, rootStyle, zoomFactor, &ok);
     7299                            tz = convertToLength(thirdValue, style, rootStyle, zoomFactor, &ok);
    73147300                        }
    73157301                        if (transformValue->length() > 1) {
    73167302                            CSSPrimitiveValue* secondValue = static_cast<CSSPrimitiveValue*>(transformValue->itemWithoutBoundsCheck(1));
    7317                             ty = convertToFloatLength(secondValue, style, rootStyle, zoomFactor, &ok);
     7303                            ty = convertToLength(secondValue, style, rootStyle, zoomFactor, &ok);
    73187304                        }
    73197305                    }
     
    74467432                Length p = Length(0, Fixed);
    74477433                if (CSSPrimitiveValue::isUnitTypeLength(firstValue->primitiveType()))
    7448                     p = convertToFloatLength(firstValue, style, rootStyle, zoomFactor, &ok);
     7434                    p = convertToLength(firstValue, style, rootStyle, zoomFactor, &ok);
    74497435                else {
    74507436                    // This is a quirk that should go away when 3d transforms are finalized.
  • trunk/Source/WebCore/platform/Length.h

    r80379 r80383  
    4141public:
    4242    Length()
    43         :  m_intValue(0), m_quirk(false), m_type(Auto), m_isFloat(false)
     43        : m_value(0)
    4444    {
    4545    }
    4646
    4747    Length(LengthType t)
    48         : m_intValue(0), m_quirk(false), m_type(t), m_isFloat(false)
     48        : m_value(t)
    4949    {
    5050    }
    5151
    5252    Length(int v, LengthType t, bool q = false)
    53         : m_intValue(v), m_quirk(q), m_type(t), m_isFloat(false)
     53        : m_value((v * 16) | (q << 3) | t) // FIXME: Doesn't work if the passed-in value is very large!
    5454    {
    5555        ASSERT(t != Percent);
     
    5757
    5858    Length(double v, LengthType t, bool q = false)
    59         : m_quirk(q), m_type(t), m_isFloat(false)
    60     {
    61         if (m_type == Percent)
    62             m_intValue = static_cast<int>(v*percentScaleFactor);
    63         else {
    64             m_isFloat = true;           
    65             m_floatValue = static_cast<float>(v);
    66        }
    67     }
    68 
    69     bool operator==(const Length& o) const { return (getFloatValue() == o.getFloatValue()) && (m_type == o.m_type) && (m_quirk == o.m_quirk); }
    70     bool operator!=(const Length& o) const { return (getFloatValue() != o.getFloatValue()) || (m_type != o.m_type) || (m_quirk != o.m_quirk); }
     59        : m_value(static_cast<int>(v * percentScaleFactor) * 16 | (q << 3) | t)
     60    {
     61        ASSERT(t == Percent);
     62    }
     63
     64    bool operator==(const Length& o) const { return m_value == o.m_value; }
     65    bool operator!=(const Length& o) const { return m_value != o.m_value; }
    7166
    7267    int value() const {
     
    7570    }
    7671
    77     int rawValue() const { return getIntValue(); }
     72    int rawValue() const { return (m_value & ~0xF) / 16; }
    7873
    7974    double percent() const
     
    8378    }
    8479
    85     LengthType type() const { return static_cast<LengthType>(m_type); }
    86     bool quirk() const { return m_quirk; }
     80    LengthType type() const { return static_cast<LengthType>(m_value & 7); }
     81    bool quirk() const { return (m_value >> 3) & 1; }
    8782
    8883    void setValue(LengthType t, int value)
    8984    {
    90         m_type = t;
    91         m_intValue = value;
    92         m_isFloat = false;
    93     }
     85        ASSERT(t != Percent);
     86        setRawValue(t, value);
     87    }
     88
     89    void setRawValue(LengthType t, int value) { m_value = value * 16 | (m_value & 0x8) | t; }
    9490
    9591    void setValue(int value)
    9692    {
    9793        ASSERT(!value || type() != Percent);
    98         setValue(Fixed, value);
    99     }
     94        setRawValue(value);
     95    }
     96
     97    void setRawValue(int value) { m_value = value * 16 | (m_value & 0xF); }
    10098
    10199    void setValue(LengthType t, double value)
    102100    {
    103         m_type = t;
    104         m_floatValue = value;
    105         m_isFloat = true;   
     101        ASSERT(t == Percent);
     102        m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0x8) | t;
    106103    }
    107104
    108105    void setValue(double value)
    109106    {
    110         *this = Length(value, Fixed);
     107        ASSERT(type() == Percent);
     108        m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0xF);
    111109    }
    112110
     
    147145        switch (type()) {
    148146            case Fixed:
    149                 return getFloatValue();
     147                return static_cast<float>(value());
    150148            case Percent:
    151149                return static_cast<float>(maxValue * percent() / 100.0);
     
    158156
    159157    bool isUndefined() const { return rawValue() == undefinedLength; }
    160     bool isZero() const { return !getIntValue(); }
     158    bool isZero() const { return !(m_value & ~0xF); }
    161159    bool isPositive() const { return rawValue() > 0; }
    162160    bool isNegative() const { return rawValue() < 0; }
     
    187185        }
    188186           
    189         double fromValue = from.isZero() ? 0 : from.value();
    190         double toValue = isZero() ? 0 : value();
    191         return Length(fromValue + (toValue - fromValue) * progress, resultType);
     187        int fromValue = from.isZero() ? 0 : from.value();
     188        int toValue = isZero() ? 0 : value();
     189        return Length(int(fromValue + (toValue - fromValue) * progress), resultType);
    192190    }
    193191
    194192private:
    195     int getIntValue() const
    196     {
    197         if (m_isFloat)
    198             return static_cast<int>(m_floatValue);
    199         return m_intValue;
    200     }
    201 
    202     float getFloatValue() const
    203     {
    204         if (m_isFloat)
    205                 return m_floatValue;
    206         return m_intValue;
    207     }
    208 
    209     union {
    210         int m_intValue;
    211         float m_floatValue;
    212     };
    213     bool m_quirk;
    214     unsigned char m_type;
    215     bool m_isFloat;
     193    int m_value;
    216194};
    217195
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r80379 r80383  
    8383                    // FIXME: What is this arbitrary value?
    8484                    if (cellLogicalWidth.rawValue() > 32760)
    85                         cellLogicalWidth.setValue(32760);
     85                        cellLogicalWidth.setRawValue(32760);
    8686                    if (cellLogicalWidth.isNegative())
    8787                        cellLogicalWidth.setValue(0);
     
    375375                        percentMissing -= percent;
    376376                        if (percent > 0)
    377                             m_layoutStruct[pos].effectiveLogicalWidth.setValue(Percent, percent);
     377                            m_layoutStruct[pos].effectiveLogicalWidth.setRawValue(Percent, percent);
    378378                        else
    379379                            m_layoutStruct[pos].effectiveLogicalWidth = Length();
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r80379 r80383  
    119119                }
    120120                if ((w.isFixed() || w.isPercent()) && w.isPositive()) {
    121                     m_width[currentEffectiveColumn].setValue(w.type(), w.rawValue() * spanInCurrentEffectiveColumn);
     121                    m_width[currentEffectiveColumn].setRawValue(w.type(), w.rawValue() * spanInCurrentEffectiveColumn);
    122122                    usedWidth += effWidth * spanInCurrentEffectiveColumn;
    123123                }
     
    168168                    // Only set if no col element has already set it.
    169169                    if (m_width[cCol + i].isAuto() && w.type() != Auto) {
    170                         m_width[cCol + i].setValue(w.type(), w.rawValue() * eSpan / span);
     170                        m_width[cCol + i].setRawValue(w.type(), w.rawValue() * eSpan / span);
    171171                        usedWidth += effWidth * eSpan / span;
    172172                    }
Note: See TracChangeset for help on using the changeset viewer.