Changeset 81103 in webkit


Ignore:
Timestamp:
Mar 14, 2011 8:56:29 PM (13 years ago)
Author:
mrowe@apple.com
Message:

Roll out r81097. It broke the 32-bit Mac build and caused assertion failures on the Windows Debug bots.

Location:
trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r81101 r81103  
    88        * editing/pasteboard/drop-file-svg.html: Added.
    99        * editing/pasteboard/resources/drop-file-svg.svg: Added.
    10 
    11 2011-03-14  Rik Cabanier  <cabanier@gmail.com>
    12 
    13         Reviewed by David Hyatt.
    14 
    15         bug 56052: percentages are incorrectly rounded in WebKit
    16         https://bugs.webkit.org/show_bug.cgi?id=56052
    17 
    18         * platform/mac/fast/css/percentage-non-integer-expected.txt:
    1910
    20112011-03-14  Anton Muhin  <antonm@chromium.org>
  • trunk/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.checksum

    r81097 r81103  
    1 c6d9055341a9904929ccc49476c7bd9e
     1414caaa2ee09823fcc6b1200d30ec127
  • trunk/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt

    r81097 r81103  
    3030          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
    3131        RenderBlock {DIV} at (0,48) size 910x4
    32           RenderBlock {DIV} at (0,0) size 101x4 [bgcolor=#0000007F]
     32          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
    3333        RenderBlock {DIV} at (0,52) size 900x4
    3434          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
     
    5050          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
    5151        RenderBlock {DIV} at (0,88) size 835x4
    52           RenderBlock {DIV} at (0,0) size 101x4 [bgcolor=#0000007F]
     52          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
    5353        RenderBlock {DIV} at (0,92) size 825x4
    5454          RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
     
    8585    RenderTableSection {TBODY} at (0,0) size 1000x20
    8686      RenderTableRow {TR} at (0,0) size 1000x20
    87         RenderTableCell {TD} at (0,1) size 12x18 [bgcolor=#0000007F] [r=0 c=0 rs=1 cs=1]
     87        RenderTableCell {TD} at (0,1) size 11x18 [bgcolor=#0000007F] [r=0 c=0 rs=1 cs=1]
    8888          RenderText {#text} at (0,0) size 4x18
    8989            text run at (0,0) width 4: " "
    90         RenderTableCell {TD} at (12,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=1 rs=1 cs=1]
     90        RenderTableCell {TD} at (11,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=1 rs=1 cs=1]
    9191          RenderText {#text} at (0,0) size 4x18
    9292            text run at (0,0) width 4: " "
    93         RenderTableCell {TD} at (22,1) size 13x18 [bgcolor=#0000007F] [r=0 c=2 rs=1 cs=1]
     93        RenderTableCell {TD} at (21,1) size 13x18 [bgcolor=#0000007F] [r=0 c=2 rs=1 cs=1]
    9494          RenderText {#text} at (0,0) size 4x18
    9595            text run at (0,0) width 4: " "
    96         RenderTableCell {TD} at (35,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=3 rs=1 cs=1]
     96        RenderTableCell {TD} at (34,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=3 rs=1 cs=1]
    9797          RenderText {#text} at (0,0) size 4x18
    9898            text run at (0,0) width 4: " "
    99         RenderTableCell {TD} at (45,1) size 16x18 [bgcolor=#0000007F] [r=0 c=4 rs=1 cs=1]
     99        RenderTableCell {TD} at (44,1) size 15x18 [bgcolor=#0000007F] [r=0 c=4 rs=1 cs=1]
    100100          RenderText {#text} at (0,0) size 4x18
    101101            text run at (0,0) width 4: " "
    102         RenderTableCell {TD} at (61,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=5 rs=1 cs=1]
     102        RenderTableCell {TD} at (59,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=5 rs=1 cs=1]
    103103          RenderText {#text} at (0,0) size 4x18
    104104            text run at (0,0) width 4: " "
    105         RenderTableCell {TD} at (71,1) size 17x18 [bgcolor=#0000007F] [r=0 c=6 rs=1 cs=1]
     105        RenderTableCell {TD} at (69,1) size 17x18 [bgcolor=#0000007F] [r=0 c=6 rs=1 cs=1]
    106106          RenderText {#text} at (0,0) size 4x18
    107107            text run at (0,0) width 4: " "
    108         RenderTableCell {TD} at (88,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=7 rs=1 cs=1]
     108        RenderTableCell {TD} at (86,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=7 rs=1 cs=1]
    109109          RenderText {#text} at (0,0) size 4x18
    110110            text run at (0,0) width 4: " "
    111         RenderTableCell {TD} at (98,1) size 20x18 [bgcolor=#0000007F] [r=0 c=8 rs=1 cs=1]
     111        RenderTableCell {TD} at (96,1) size 20x18 [bgcolor=#0000007F] [r=0 c=8 rs=1 cs=1]
    112112          RenderText {#text} at (0,0) size 4x18
    113113            text run at (0,0) width 4: " "
    114         RenderTableCell {TD} at (118,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=9 rs=1 cs=1]
     114        RenderTableCell {TD} at (116,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=9 rs=1 cs=1]
    115115          RenderText {#text} at (0,0) size 4x18
    116116            text run at (0,0) width 4: " "
    117         RenderTableCell {TD} at (128,1) size 22x18 [bgcolor=#0000007F] [r=0 c=10 rs=1 cs=1]
     117        RenderTableCell {TD} at (126,1) size 21x18 [bgcolor=#0000007F] [r=0 c=10 rs=1 cs=1]
    118118          RenderText {#text} at (0,0) size 4x18
    119119            text run at (0,0) width 4: " "
    120         RenderTableCell {TD} at (150,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=11 rs=1 cs=1]
     120        RenderTableCell {TD} at (147,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=11 rs=1 cs=1]
    121121          RenderText {#text} at (0,0) size 4x18
    122122            text run at (0,0) width 4: " "
    123         RenderTableCell {TD} at (160,1) size 24x18 [bgcolor=#0000007F] [r=0 c=12 rs=1 cs=1]
     123        RenderTableCell {TD} at (157,1) size 23x18 [bgcolor=#0000007F] [r=0 c=12 rs=1 cs=1]
    124124          RenderText {#text} at (0,0) size 4x18
    125125            text run at (0,0) width 4: " "
    126         RenderTableCell {TD} at (184,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]
    127         RenderTableCell {TD} at (194,1) size 25x18 [bgcolor=#0000007F] [r=0 c=14 rs=1 cs=1]
     126        RenderTableCell {TD} at (180,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]
     127        RenderTableCell {TD} at (190,1) size 25x18 [bgcolor=#0000007F] [r=0 c=14 rs=1 cs=1]
    128128          RenderText {#text} at (0,0) size 4x18
    129129            text run at (0,0) width 4: " "
    130         RenderTableCell {TD} at (219,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=15 rs=1 cs=1]
     130        RenderTableCell {TD} at (215,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=15 rs=1 cs=1]
    131131          RenderText {#text} at (0,0) size 4x18
    132132            text run at (0,0) width 4: " "
    133         RenderTableCell {TD} at (229,1) size 27x18 [bgcolor=#0000007F] [r=0 c=16 rs=1 cs=1]
     133        RenderTableCell {TD} at (225,1) size 27x18 [bgcolor=#0000007F] [r=0 c=16 rs=1 cs=1]
    134134          RenderText {#text} at (0,0) size 4x18
    135135            text run at (0,0) width 4: " "
    136         RenderTableCell {TD} at (256,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=17 rs=1 cs=1]
     136        RenderTableCell {TD} at (252,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=17 rs=1 cs=1]
    137137          RenderText {#text} at (0,0) size 4x18
    138138            text run at (0,0) width 4: " "
    139         RenderTableCell {TD} at (266,1) size 30x18 [bgcolor=#0000007F] [r=0 c=18 rs=1 cs=1]
     139        RenderTableCell {TD} at (262,1) size 30x18 [bgcolor=#0000007F] [r=0 c=18 rs=1 cs=1]
    140140          RenderText {#text} at (0,0) size 4x18
    141141            text run at (0,0) width 4: " "
    142         RenderTableCell {TD} at (296,1) size 704x18 [r=0 c=19 rs=1 cs=1]
     142        RenderTableCell {TD} at (292,1) size 708x18 [r=0 c=19 rs=1 cs=1]
    143143          RenderText {#text} at (0,0) size 4x18
    144144            text run at (0,0) width 4: " "
  • trunk/Source/WebCore/ChangeLog

    r81101 r81103  
    4141
    4242        * WebCore.gyp/WebCore.gyp:
    43 
    44 2011-03-14  Rik Cabanier  <cabanier@adobe.com>
    45 
    46         Reviewed by David Hyatt.
    47 
    48         bug 56052: percentages are incorrectly rounded in WebKit
    49         https://bugs.webkit.org/show_bug.cgi?id=56052
    50 
    51         test: fast/css/percentage-non-integer.html
    52 
    53         * css/CSSStyleSelector.cpp:
    54         (WebCore::CSSStyleSelector::applyProperty):
    55         * page/PrintContext.cpp:
    56         (WebCore::PrintContext::pageProperty):
    57         * platform/Length.h:
    58         (WebCore::Length::Length):
    59         (WebCore::Length::operator*=):
    60         (WebCore::Length::value):
    61         (WebCore::Length::percent):
    62         (WebCore::Length::setValue):
    63         (WebCore::Length::calcValue):
    64         (WebCore::Length::calcMinValue):
    65         (WebCore::Length::isUndefined):
    66         (WebCore::Length::isZero):
    67         (WebCore::Length::isPositive):
    68         (WebCore::Length::isNegative):
    69         * rendering/AutoTableLayout.cpp:
    70         (WebCore::AutoTableLayout::recalcColumn):
    71         (WebCore::AutoTableLayout::computePreferredLogicalWidths):
    72         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
    73         (WebCore::AutoTableLayout::layout):
    74         * rendering/FixedTableLayout.cpp:
    75         (WebCore::FixedTableLayout::calcWidthArray):
    76         (WebCore::FixedTableLayout::layout):
    77         * rendering/RenderTableSection.cpp:
    78         (WebCore::RenderTableSection::addCell):
    79         (WebCore::RenderTableSection::layoutRows):
    80         * rendering/style/BorderData.h:
    81         (WebCore::BorderData::hasBorderRadius):
    8243
    83442011-03-14  Adam Barth  <abarth@webkit.org>
  • trunk/Source/WebCore/css/CSSStyleSelector.cpp

    r81097 r81103  
    52665266        else
    52675267            radiusHeight = Length(max(intMinForLength, min(intMaxForLength, pair->second()->computeLengthInt(style(), m_rootElementStyle, zoomFactor))), Fixed);
    5268         int width = radiusWidth.value();
    5269         int height = radiusHeight.value();
     5268        int width = radiusWidth.rawValue();
     5269        int height = radiusHeight.rawValue();
    52705270        if (width < 0 || height < 0)
    52715271            return;
  • trunk/Source/WebCore/page/PrintContext.cpp

    r81097 r81103  
    283283        if (style->marginLeft().isAuto())
    284284            return String("auto");
    285         return String::number(style->marginLeft().value());
     285        return String::number(style->marginLeft().rawValue());
    286286    }
    287287    if (!strcmp(propertyName, "line-height"))
    288         return String::number(style->lineHeight().value());
     288        return String::number(style->lineHeight().rawValue());
    289289    if (!strcmp(propertyName, "font-size"))
    290290        return String::number(style->fontDescription().computedPixelSize());
     
    292292        return style->fontDescription().family().family().string();
    293293    if (!strcmp(propertyName, "size"))
    294         return makeString(String::number(style->pageSize().width().value()), ' ', String::number(style->pageSize().height().value()));
     294        return makeString(String::number(style->pageSize().width().rawValue()), ' ', String::number(style->pageSize().height().rawValue()));
    295295
    296296    return makeString("pageProperty() unimplemented for: ", propertyName);
  • trunk/Source/WebCore/platform/Length.h

    r81097 r81103  
    22    Copyright (C) 1999 Lars Knoll (knoll@kde.org)
    33    Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
    4     Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
    54
    65    This library is free software; you can redistribute it and/or
     
    3231
    3332const int undefinedLength = -1;
     33const int percentScaleFactor = 128;
    3434const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int
    3535const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int
     
    5353        : m_intValue(v), m_quirk(q), m_type(t), m_isFloat(false)
    5454    {
     55        ASSERT(t != Percent);
    5556    }
    5657
    5758    Length(double v, LengthType t, bool q = false)
    58         : m_quirk(q), m_type(t), m_isFloat(true)
    59     {           
    60         m_floatValue = static_cast<float>(v);   
     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       }
    6167    }
    6268
     
    6470    bool operator!=(const Length& o) const { return (getFloatValue() != o.getFloatValue()) || (m_type != o.m_type) || (m_quirk != o.m_quirk); }
    6571
    66     const Length& operator*=(double v)
    67     {       
    68         if (m_isFloat)
    69             m_floatValue *= v;
    70         else       
    71             m_intValue *= v;
    72        
    73         return *this;
    74     }
    75    
    7672    int value() const {
    77         return getIntValue();
    78     }
     73        ASSERT(type() != Percent);
     74        return rawValue();
     75    }
     76
     77    int rawValue() const { return getIntValue(); }
    7978
    8079    double percent() const
    8180    {
    8281        ASSERT(type() == Percent);
    83         return static_cast<double>(getFloatValue());
     82        return static_cast<double>(rawValue()) / percentScaleFactor;
    8483    }
    8584
     
    8988    void setValue(LengthType t, int value)
    9089    {
    91         ASSERT(type() != Percent);
    9290        m_type = t;
    9391        m_intValue = value;
     
    9795    void setValue(int value)
    9896    {
     97        ASSERT(!value || type() != Percent);
    9998        setValue(Fixed, value);
    10099    }
     
    121120                if (roundPercentages)
    122121                    return static_cast<int>(round(maxValue * percent() / 100.0));
    123                 return static_cast<int>(maxValue * percent() / 100.0);
     122                return maxValue * rawValue() / (100 * percentScaleFactor);
    124123            case Auto:
    125124                return maxValue;
     
    137136                if (roundPercentages)
    138137                    return static_cast<int>(round(maxValue * percent() / 100.0));
    139                 return static_cast<int>(maxValue * percent() / 100.0);
     138                return maxValue * rawValue() / (100 * percentScaleFactor);
    140139            case Auto:
    141140            default:
     
    158157    }
    159158
    160     bool isUndefined() const { return value() == undefinedLength; }
    161     bool isZero() const
    162     {
    163         if (m_isFloat)
    164             return !m_floatValue;
    165        
    166         return !m_intValue;
    167     }
    168     bool isPositive() const { return getFloatValue() > 0; }
    169     bool isNegative() const { return getFloatValue() < 0; }
     159    bool isUndefined() const { return rawValue() == undefinedLength; }
     160    bool isZero() const { return !getIntValue(); }
     161    bool isPositive() const { return rawValue() > 0; }
     162    bool isNegative() const { return rawValue() < 0; }
    170163
    171164    bool isAuto() const { return type() == Auto; }
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r81097 r81103  
    8282                    Length cellLogicalWidth = cell->styleOrColLogicalWidth();
    8383                    // FIXME: What is this arbitrary value?
    84                     if (cellLogicalWidth.value() > 32760)
     84                    if (cellLogicalWidth.rawValue() > 32760)
    8585                        cellLogicalWidth.setValue(32760);
    8686                    if (cellLogicalWidth.isNegative())
     
    106106                    case Percent:
    107107                        m_hasPercent = true;
    108                         if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.value() > columnLayout.logicalWidth.value()))
     108                        if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.rawValue() > columnLayout.logicalWidth.rawValue()))
    109109                            columnLayout.logicalWidth = cellLogicalWidth;
    110110                        break;
     
    112112                        // FIXME: Need to understand this case and whether it makes sense to compare values
    113113                        // which are not necessarily of the same type.
    114                         if (cellLogicalWidth.isAuto() || (cellLogicalWidth.isRelative() && cellLogicalWidth.value() > columnLayout.logicalWidth.value()))
     114                        if (cellLogicalWidth.isAuto() || (cellLogicalWidth.isRelative() && cellLogicalWidth.value() > columnLayout.logicalWidth.rawValue()))
    115115                            columnLayout.logicalWidth = cellLogicalWidth;
    116116                    default:
     
    233233    // We substitute 0 percent by (epsilon / percentScaleFactor) percent in two places below to avoid division by zero.
    234234    // FIXME: Handle the 0% cases properly.
    235     const float epsilon = 1 / 128.0;
    236 
    237     float remainingPercent = 100;
     235    const int epsilon = 1;
     236
     237    int remainingPercent = 100 * percentScaleFactor;
    238238    for (size_t i = 0; i < m_layoutStruct.size(); ++i) {
    239239        minWidth += m_layoutStruct[i].effectiveMinLogicalWidth;
     
    241241        if (scaleColumns) {
    242242            if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
    243                 float percent = min(static_cast<float>(m_layoutStruct[i].effectiveLogicalWidth.percent()), remainingPercent);
    244                 float logicalWidth = static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) * 100 / max(percent, epsilon);
     243                int percent = min(m_layoutStruct[i].effectiveLogicalWidth.rawValue(), remainingPercent);
     244                float logicalWidth = static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) * 100 * percentScaleFactor / max(percent, epsilon);
    245245                maxPercent = max(logicalWidth,  maxPercent);
    246246                remainingPercent -= percent;
     
    251251
    252252    if (scaleColumns) {
    253         maxNonPercent = maxNonPercent * 100 / max(remainingPercent, epsilon);
     253        maxNonPercent = maxNonPercent * 100 * percentScaleFactor / max(remainingPercent, epsilon);
    254254        maxWidth = max(maxWidth, static_cast<int>(min(maxNonPercent, INT_MAX / 2.0f)));
    255255        maxWidth = max(maxWidth, static_cast<int>(min(maxPercent, INT_MAX / 2.0f)));
     
    267267        maxWidth = minWidth;
    268268    }
    269    
    270     // if there was no remaining percent, maxWidth is invalid.
    271     if (!remainingPercent && maxNonPercent)
    272         maxWidth = intMaxForLength;       
    273269}
    274270
     
    305301        int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRowDirection;
    306302        float cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection;
    307         float totalPercent = 0;
     303        int totalPercent = 0;
    308304        int spanMinLogicalWidth = 0;
    309305        float spanMaxLogicalWidth = 0;
     
    317313            switch (columnLayout.logicalWidth.type()) {
    318314            case Percent:
    319                 totalPercent += columnLayout.logicalWidth.percent();
     315                totalPercent += columnLayout.logicalWidth.rawValue();
    320316                allColsAreFixed = false;
    321317                break;
     
    344340                    allColsArePercent = false;
    345341                } else
    346                     totalPercent += columnLayout.effectiveLogicalWidth.percent();
     342                    totalPercent += columnLayout.effectiveLogicalWidth.rawValue();
    347343                allColsAreFixed = false;
    348344            }
     
    359355        // adjust table max width if needed
    360356        if (cellLogicalWidth.isPercent()) {
    361             if (totalPercent > cellLogicalWidth.percent() || allColsArePercent) {
     357            if (totalPercent > cellLogicalWidth.rawValue() || allColsArePercent) {
    362358                // can't satify this condition, treat as variable
    363359                cellLogicalWidth = Length();
    364360            } else {
    365                 maxLogicalWidth = max(maxLogicalWidth, static_cast<float>(max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100  / cellLogicalWidth.percent()));
     361                maxLogicalWidth = max(maxLogicalWidth, max(spanMaxLogicalWidth, cellMaxLogicalWidth) * 100 * percentScaleFactor / cellLogicalWidth.rawValue());
    366362
    367363                // all non percent columns in the span get percent values to sum up correctly.
    368                 float percentMissing = cellLogicalWidth.percent() - totalPercent;
     364                int percentMissing = cellLogicalWidth.rawValue() - totalPercent;
    369365                float totalWidth = 0;
    370366                for (unsigned pos = effCol; pos < lastCol; ++pos) {
     
    375371                for (unsigned pos = effCol; pos < lastCol && totalWidth > 0; ++pos) {
    376372                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent()) {
    377                         float percent = percentMissing * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / totalWidth;
     373                        int percent = static_cast<int>(percentMissing * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / totalWidth);
    378374                        totalWidth -= m_layoutStruct[pos].effectiveMaxLogicalWidth;
    379375                        percentMissing -= percent;
     
    496492    float totalAuto = 0;
    497493    float totalFixed = 0;
    498     float totalPercent = 0;
     494    int totalPercent = 0;
    499495    int allocAuto = 0;
    500496    unsigned numAutoEmptyCellsOnly = 0;
     
    509505        case Percent:
    510506            havePercent = true;
    511             totalPercent += logicalWidth.percent();
     507            totalPercent += logicalWidth.rawValue();
    512508            break;
    513509        case Relative:
     
    543539            }
    544540        }
    545         if (totalPercent > 100) {
     541        if (totalPercent > 100 * percentScaleFactor) {
    546542            // remove overallocated space from the last columns
    547             int excess = tableLogicalWidth * (totalPercent - 100) / 100;
     543            int excess = tableLogicalWidth * (totalPercent - 100 * percentScaleFactor) / (100 * percentScaleFactor);
    548544            for (int i = nEffCols - 1; i >= 0; --i) {
    549545                if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
     
    612608
    613609    // spread over percent colums
    614     if (available > 0 && m_hasPercent && totalPercent < 100) {
     610    if (available > 0 && m_hasPercent && totalPercent < 100 * percentScaleFactor) {
    615611        for (size_t i = 0; i < nEffCols; ++i) {
    616612            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    617613            if (logicalWidth.isPercent()) {
    618                 int cellLogicalWidth = available * logicalWidth.percent() / totalPercent;
     614                int cellLogicalWidth = available * logicalWidth.rawValue() / totalPercent;
    619615                available -= cellLogicalWidth;
    620                 totalPercent -= logicalWidth.percent();
     616                totalPercent -= logicalWidth.rawValue();
    621617                m_layoutStruct[i].computedLogicalWidth += cellLogicalWidth;
    622618                if (!available || !totalPercent)
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r81097 r81103  
    119119                }
    120120                if ((w.isFixed() || w.isPercent()) && w.isPositive()) {
    121                     m_width[currentEffectiveColumn] = w;
    122                     m_width[currentEffectiveColumn] *= spanInCurrentEffectiveColumn;
     121                    m_width[currentEffectiveColumn].setValue(w.type(), w.rawValue() * spanInCurrentEffectiveColumn);
    123122                    usedWidth += effWidth * spanInCurrentEffectiveColumn;
    124123                }
     
    166165                int i = 0;
    167166                while (usedSpan < span && cCol + i < nEffCols) {
    168                     float eSpan = m_table->spanOfEffCol(cCol + i);
     167                    int eSpan = m_table->spanOfEffCol(cCol + i);
    169168                    // Only set if no col element has already set it.
    170169                    if (m_width[cCol + i].isAuto() && w.type() != Auto) {
    171                         m_width[cCol + i] = w;
    172                         m_width[cCol + i] *= eSpan / span;
     170                        m_width[cCol + i].setValue(w.type(), w.rawValue() * eSpan / span);
    173171                        usedWidth += effWidth * eSpan / span;
    174172                    }
     
    237235    int totalFixedWidth = 0;
    238236    int totalPercentWidth = 0;
    239     float totalPercent = 0;
     237    int totalRawPercent = 0;
    240238
    241239    // Compute requirements and try to satisfy fixed and percent widths.
     
    250248            calcWidth[i] = m_width[i].calcValue(tableLogicalWidth);
    251249            totalPercentWidth += calcWidth[i];
    252             totalPercent += m_width[i].percent();
     250            totalRawPercent += m_width[i].rawValue();
    253251        } else if (m_width[i].isAuto()) {
    254252            numAuto++;
     
    273271                }
    274272            }
    275             if (totalPercent) {
     273            if (totalRawPercent) {
    276274                totalPercentWidth = 0;
    277275                for (int i = 0; i < nEffCols; i++) {
    278276                    if (m_width[i].isPercent()) {
    279                         calcWidth[i] = m_width[i].percent() * (tableLogicalWidth - totalFixedWidth) / totalPercent;
     277                        calcWidth[i] = m_width[i].rawValue() * (tableLogicalWidth - totalFixedWidth) / totalRawPercent;
    280278                        totalPercentWidth += calcWidth[i];
    281279                    }
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r81097 r81103  
    200200                case Percent:
    201201                    if (!(cRowLogicalHeight.isPercent()) ||
    202                         (cRowLogicalHeight.isPercent() && cRowLogicalHeight.percent() < logicalHeight.percent()))
     202                        (cRowLogicalHeight.isPercent() && cRowLogicalHeight.rawValue() < logicalHeight.rawValue()))
    203203                        m_grid[m_cRow].logicalHeight = logicalHeight;
    204204                        break;
     
    435435                numAuto++;
    436436            else if (m_grid[r].logicalHeight.isPercent())
    437                 totalPercent += m_grid[r].logicalHeight.percent();
     437                totalPercent += m_grid[r].logicalHeight.rawValue();
    438438        }
    439439        if (totalPercent) {
    440440            // try to satisfy percent
    441441            int add = 0;
    442             totalPercent = min(totalPercent, 100);
     442            totalPercent = min(totalPercent, 100 * percentScaleFactor);
    443443            int rh = m_rowPos[1] - m_rowPos[0];
    444444            for (int r = 0; r < totalRows; r++) {
    445445                if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
    446                     int toAdd = min(dh, static_cast<int>((totalHeight * m_grid[r].logicalHeight.percent() / 100) - rh));
     446                    int toAdd = min(dh, (totalHeight * m_grid[r].logicalHeight.rawValue() / (100 * percentScaleFactor)) - rh);
    447447                    // If toAdd is negative, then we don't want to shrink the row (this bug
    448448                    // affected Outlook Web Access).
     
    450450                    add += toAdd;
    451451                    dh -= toAdd;
    452                     totalPercent -= m_grid[r].logicalHeight.percent();
     452                    totalPercent -= m_grid[r].logicalHeight.rawValue();
    453453                }
    454454                if (r < totalRows - 1)
  • trunk/Source/WebCore/rendering/style/BorderData.h

    r81097 r81103  
    5050    bool hasBorderRadius() const
    5151    {
    52         if (!m_topLeft.width().isZero())
     52        if (m_topLeft.width().rawValue() > 0)
    5353            return true;
    54         if (!m_topRight.width().isZero())
     54        if (m_topRight.width().rawValue() > 0)
    5555            return true;
    56         if (!m_bottomLeft.width().isZero())
     56        if (m_bottomLeft.width().rawValue() > 0)
    5757            return true;
    58         if (!m_bottomRight.width().isZero())
     58        if (m_bottomRight.width().rawValue() > 0)
    5959            return true;
    6060        return false;
Note: See TracChangeset for help on using the changeset viewer.