Changeset 81103 in webkit
- Timestamp:
- Mar 14, 2011 8:56:29 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r81101 r81103 8 8 * editing/pasteboard/drop-file-svg.html: Added. 9 9 * 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 WebKit16 https://bugs.webkit.org/show_bug.cgi?id=5605217 18 * platform/mac/fast/css/percentage-non-integer-expected.txt:19 10 20 11 2011-03-14 Anton Muhin <antonm@chromium.org> -
trunk/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.checksum
r81097 r81103 1 c6d9055341a9904929ccc49476c7bd9e 1 414caaa2ee09823fcc6b1200d30ec127 -
trunk/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt
r81097 r81103 30 30 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] 31 31 RenderBlock {DIV} at (0,48) size 910x4 32 RenderBlock {DIV} at (0,0) size 10 1x4 [bgcolor=#0000007F]32 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] 33 33 RenderBlock {DIV} at (0,52) size 900x4 34 34 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] … … 50 50 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] 51 51 RenderBlock {DIV} at (0,88) size 835x4 52 RenderBlock {DIV} at (0,0) size 10 1x4 [bgcolor=#0000007F]52 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] 53 53 RenderBlock {DIV} at (0,92) size 825x4 54 54 RenderBlock {DIV} at (0,0) size 100x4 [bgcolor=#0000007F] … … 85 85 RenderTableSection {TBODY} at (0,0) size 1000x20 86 86 RenderTableRow {TR} at (0,0) size 1000x20 87 RenderTableCell {TD} at (0,1) size 1 2x18 [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] 88 88 RenderText {#text} at (0,0) size 4x18 89 89 text run at (0,0) width 4: " " 90 RenderTableCell {TD} at (1 2,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] 91 91 RenderText {#text} at (0,0) size 4x18 92 92 text run at (0,0) width 4: " " 93 RenderTableCell {TD} at (2 2,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] 94 94 RenderText {#text} at (0,0) size 4x18 95 95 text run at (0,0) width 4: " " 96 RenderTableCell {TD} at (3 5,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] 97 97 RenderText {#text} at (0,0) size 4x18 98 98 text run at (0,0) width 4: " " 99 RenderTableCell {TD} at (4 5,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] 100 100 RenderText {#text} at (0,0) size 4x18 101 101 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] 103 103 RenderText {#text} at (0,0) size 4x18 104 104 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] 106 106 RenderText {#text} at (0,0) size 4x18 107 107 text run at (0,0) width 4: " " 108 RenderTableCell {TD} at (8 8,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] 109 109 RenderText {#text} at (0,0) size 4x18 110 110 text run at (0,0) width 4: " " 111 RenderTableCell {TD} at (9 8,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] 112 112 RenderText {#text} at (0,0) size 4x18 113 113 text run at (0,0) width 4: " " 114 RenderTableCell {TD} at (11 8,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] 115 115 RenderText {#text} at (0,0) size 4x18 116 116 text run at (0,0) width 4: " " 117 RenderTableCell {TD} at (12 8,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] 118 118 RenderText {#text} at (0,0) size 4x18 119 119 text run at (0,0) width 4: " " 120 RenderTableCell {TD} at (1 50,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] 121 121 RenderText {#text} at (0,0) size 4x18 122 122 text run at (0,0) width 4: " " 123 RenderTableCell {TD} at (1 60,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] 124 124 RenderText {#text} at (0,0) size 4x18 125 125 text run at (0,0) width 4: " " 126 RenderTableCell {TD} at (18 4,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]127 RenderTableCell {TD} at (19 4,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] 128 128 RenderText {#text} at (0,0) size 4x18 129 129 text run at (0,0) width 4: " " 130 RenderTableCell {TD} at (21 9,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] 131 131 RenderText {#text} at (0,0) size 4x18 132 132 text run at (0,0) width 4: " " 133 RenderTableCell {TD} at (22 9,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] 134 134 RenderText {#text} at (0,0) size 4x18 135 135 text run at (0,0) width 4: " " 136 RenderTableCell {TD} at (25 6,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] 137 137 RenderText {#text} at (0,0) size 4x18 138 138 text run at (0,0) width 4: " " 139 RenderTableCell {TD} at (26 6,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] 140 140 RenderText {#text} at (0,0) size 4x18 141 141 text run at (0,0) width 4: " " 142 RenderTableCell {TD} at (29 6,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] 143 143 RenderText {#text} at (0,0) size 4x18 144 144 text run at (0,0) width 4: " " -
trunk/Source/WebCore/ChangeLog
r81101 r81103 41 41 42 42 * 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 WebKit49 https://bugs.webkit.org/show_bug.cgi?id=5605250 51 test: fast/css/percentage-non-integer.html52 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):82 43 83 44 2011-03-14 Adam Barth <abarth@webkit.org> -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r81097 r81103 5266 5266 else 5267 5267 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(); 5270 5270 if (width < 0 || height < 0) 5271 5271 return; -
trunk/Source/WebCore/page/PrintContext.cpp
r81097 r81103 283 283 if (style->marginLeft().isAuto()) 284 284 return String("auto"); 285 return String::number(style->marginLeft(). value());285 return String::number(style->marginLeft().rawValue()); 286 286 } 287 287 if (!strcmp(propertyName, "line-height")) 288 return String::number(style->lineHeight(). value());288 return String::number(style->lineHeight().rawValue()); 289 289 if (!strcmp(propertyName, "font-size")) 290 290 return String::number(style->fontDescription().computedPixelSize()); … … 292 292 return style->fontDescription().family().family().string(); 293 293 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())); 295 295 296 296 return makeString("pageProperty() unimplemented for: ", propertyName); -
trunk/Source/WebCore/platform/Length.h
r81097 r81103 2 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)5 4 6 5 This library is free software; you can redistribute it and/or … … 32 31 33 32 const int undefinedLength = -1; 33 const int percentScaleFactor = 128; 34 34 const int intMaxForLength = 0x7ffffff; // max value for a 28-bit int 35 35 const int intMinForLength = (-0x7ffffff - 1); // min value for a 28-bit int … … 53 53 : m_intValue(v), m_quirk(q), m_type(t), m_isFloat(false) 54 54 { 55 ASSERT(t != Percent); 55 56 } 56 57 57 58 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 } 61 67 } 62 68 … … 64 70 bool operator!=(const Length& o) const { return (getFloatValue() != o.getFloatValue()) || (m_type != o.m_type) || (m_quirk != o.m_quirk); } 65 71 66 const Length& operator*=(double v)67 {68 if (m_isFloat)69 m_floatValue *= v;70 else71 m_intValue *= v;72 73 return *this;74 }75 76 72 int value() const { 77 return getIntValue(); 78 } 73 ASSERT(type() != Percent); 74 return rawValue(); 75 } 76 77 int rawValue() const { return getIntValue(); } 79 78 80 79 double percent() const 81 80 { 82 81 ASSERT(type() == Percent); 83 return static_cast<double>( getFloatValue());82 return static_cast<double>(rawValue()) / percentScaleFactor; 84 83 } 85 84 … … 89 88 void setValue(LengthType t, int value) 90 89 { 91 ASSERT(type() != Percent);92 90 m_type = t; 93 91 m_intValue = value; … … 97 95 void setValue(int value) 98 96 { 97 ASSERT(!value || type() != Percent); 99 98 setValue(Fixed, value); 100 99 } … … 121 120 if (roundPercentages) 122 121 return static_cast<int>(round(maxValue * percent() / 100.0)); 123 return static_cast<int>(maxValue * percent() / 100.0);122 return maxValue * rawValue() / (100 * percentScaleFactor); 124 123 case Auto: 125 124 return maxValue; … … 137 136 if (roundPercentages) 138 137 return static_cast<int>(round(maxValue * percent() / 100.0)); 139 return static_cast<int>(maxValue * percent() / 100.0);138 return maxValue * rawValue() / (100 * percentScaleFactor); 140 139 case Auto: 141 140 default: … … 158 157 } 159 158 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; } 170 163 171 164 bool isAuto() const { return type() == Auto; } -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r81097 r81103 82 82 Length cellLogicalWidth = cell->styleOrColLogicalWidth(); 83 83 // FIXME: What is this arbitrary value? 84 if (cellLogicalWidth. value() > 32760)84 if (cellLogicalWidth.rawValue() > 32760) 85 85 cellLogicalWidth.setValue(32760); 86 86 if (cellLogicalWidth.isNegative()) … … 106 106 case Percent: 107 107 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())) 109 109 columnLayout.logicalWidth = cellLogicalWidth; 110 110 break; … … 112 112 // FIXME: Need to understand this case and whether it makes sense to compare values 113 113 // 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())) 115 115 columnLayout.logicalWidth = cellLogicalWidth; 116 116 default: … … 233 233 // We substitute 0 percent by (epsilon / percentScaleFactor) percent in two places below to avoid division by zero. 234 234 // 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; 238 238 for (size_t i = 0; i < m_layoutStruct.size(); ++i) { 239 239 minWidth += m_layoutStruct[i].effectiveMinLogicalWidth; … … 241 241 if (scaleColumns) { 242 242 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); 245 245 maxPercent = max(logicalWidth, maxPercent); 246 246 remainingPercent -= percent; … … 251 251 252 252 if (scaleColumns) { 253 maxNonPercent = maxNonPercent * 100 / max(remainingPercent, epsilon);253 maxNonPercent = maxNonPercent * 100 * percentScaleFactor / max(remainingPercent, epsilon); 254 254 maxWidth = max(maxWidth, static_cast<int>(min(maxNonPercent, INT_MAX / 2.0f))); 255 255 maxWidth = max(maxWidth, static_cast<int>(min(maxPercent, INT_MAX / 2.0f))); … … 267 267 maxWidth = minWidth; 268 268 } 269 270 // if there was no remaining percent, maxWidth is invalid.271 if (!remainingPercent && maxNonPercent)272 maxWidth = intMaxForLength;273 269 } 274 270 … … 305 301 int cellMinLogicalWidth = cell->minPreferredLogicalWidth() + spacingInRowDirection; 306 302 float cellMaxLogicalWidth = cell->maxPreferredLogicalWidth() + spacingInRowDirection; 307 float totalPercent = 0;303 int totalPercent = 0; 308 304 int spanMinLogicalWidth = 0; 309 305 float spanMaxLogicalWidth = 0; … … 317 313 switch (columnLayout.logicalWidth.type()) { 318 314 case Percent: 319 totalPercent += columnLayout.logicalWidth. percent();315 totalPercent += columnLayout.logicalWidth.rawValue(); 320 316 allColsAreFixed = false; 321 317 break; … … 344 340 allColsArePercent = false; 345 341 } else 346 totalPercent += columnLayout.effectiveLogicalWidth. percent();342 totalPercent += columnLayout.effectiveLogicalWidth.rawValue(); 347 343 allColsAreFixed = false; 348 344 } … … 359 355 // adjust table max width if needed 360 356 if (cellLogicalWidth.isPercent()) { 361 if (totalPercent > cellLogicalWidth. percent() || allColsArePercent) {357 if (totalPercent > cellLogicalWidth.rawValue() || allColsArePercent) { 362 358 // can't satify this condition, treat as variable 363 359 cellLogicalWidth = Length(); 364 360 } 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()); 366 362 367 363 // 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; 369 365 float totalWidth = 0; 370 366 for (unsigned pos = effCol; pos < lastCol; ++pos) { … … 375 371 for (unsigned pos = effCol; pos < lastCol && totalWidth > 0; ++pos) { 376 372 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); 378 374 totalWidth -= m_layoutStruct[pos].effectiveMaxLogicalWidth; 379 375 percentMissing -= percent; … … 496 492 float totalAuto = 0; 497 493 float totalFixed = 0; 498 float totalPercent = 0;494 int totalPercent = 0; 499 495 int allocAuto = 0; 500 496 unsigned numAutoEmptyCellsOnly = 0; … … 509 505 case Percent: 510 506 havePercent = true; 511 totalPercent += logicalWidth. percent();507 totalPercent += logicalWidth.rawValue(); 512 508 break; 513 509 case Relative: … … 543 539 } 544 540 } 545 if (totalPercent > 100 ) {541 if (totalPercent > 100 * percentScaleFactor) { 546 542 // remove overallocated space from the last columns 547 int excess = tableLogicalWidth * (totalPercent - 100 ) / 100;543 int excess = tableLogicalWidth * (totalPercent - 100 * percentScaleFactor) / (100 * percentScaleFactor); 548 544 for (int i = nEffCols - 1; i >= 0; --i) { 549 545 if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) { … … 612 608 613 609 // spread over percent colums 614 if (available > 0 && m_hasPercent && totalPercent < 100 ) {610 if (available > 0 && m_hasPercent && totalPercent < 100 * percentScaleFactor) { 615 611 for (size_t i = 0; i < nEffCols; ++i) { 616 612 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth; 617 613 if (logicalWidth.isPercent()) { 618 int cellLogicalWidth = available * logicalWidth. percent() / totalPercent;614 int cellLogicalWidth = available * logicalWidth.rawValue() / totalPercent; 619 615 available -= cellLogicalWidth; 620 totalPercent -= logicalWidth. percent();616 totalPercent -= logicalWidth.rawValue(); 621 617 m_layoutStruct[i].computedLogicalWidth += cellLogicalWidth; 622 618 if (!available || !totalPercent) -
trunk/Source/WebCore/rendering/FixedTableLayout.cpp
r81097 r81103 119 119 } 120 120 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); 123 122 usedWidth += effWidth * spanInCurrentEffectiveColumn; 124 123 } … … 166 165 int i = 0; 167 166 while (usedSpan < span && cCol + i < nEffCols) { 168 float eSpan = m_table->spanOfEffCol(cCol + i);167 int eSpan = m_table->spanOfEffCol(cCol + i); 169 168 // Only set if no col element has already set it. 170 169 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); 173 171 usedWidth += effWidth * eSpan / span; 174 172 } … … 237 235 int totalFixedWidth = 0; 238 236 int totalPercentWidth = 0; 239 float totalPercent = 0;237 int totalRawPercent = 0; 240 238 241 239 // Compute requirements and try to satisfy fixed and percent widths. … … 250 248 calcWidth[i] = m_width[i].calcValue(tableLogicalWidth); 251 249 totalPercentWidth += calcWidth[i]; 252 total Percent += m_width[i].percent();250 totalRawPercent += m_width[i].rawValue(); 253 251 } else if (m_width[i].isAuto()) { 254 252 numAuto++; … … 273 271 } 274 272 } 275 if (total Percent) {273 if (totalRawPercent) { 276 274 totalPercentWidth = 0; 277 275 for (int i = 0; i < nEffCols; i++) { 278 276 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; 280 278 totalPercentWidth += calcWidth[i]; 281 279 } -
trunk/Source/WebCore/rendering/RenderTableSection.cpp
r81097 r81103 200 200 case Percent: 201 201 if (!(cRowLogicalHeight.isPercent()) || 202 (cRowLogicalHeight.isPercent() && cRowLogicalHeight. percent() < logicalHeight.percent()))202 (cRowLogicalHeight.isPercent() && cRowLogicalHeight.rawValue() < logicalHeight.rawValue())) 203 203 m_grid[m_cRow].logicalHeight = logicalHeight; 204 204 break; … … 435 435 numAuto++; 436 436 else if (m_grid[r].logicalHeight.isPercent()) 437 totalPercent += m_grid[r].logicalHeight. percent();437 totalPercent += m_grid[r].logicalHeight.rawValue(); 438 438 } 439 439 if (totalPercent) { 440 440 // try to satisfy percent 441 441 int add = 0; 442 totalPercent = min(totalPercent, 100 );442 totalPercent = min(totalPercent, 100 * percentScaleFactor); 443 443 int rh = m_rowPos[1] - m_rowPos[0]; 444 444 for (int r = 0; r < totalRows; r++) { 445 445 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); 447 447 // If toAdd is negative, then we don't want to shrink the row (this bug 448 448 // affected Outlook Web Access). … … 450 450 add += toAdd; 451 451 dh -= toAdd; 452 totalPercent -= m_grid[r].logicalHeight. percent();452 totalPercent -= m_grid[r].logicalHeight.rawValue(); 453 453 } 454 454 if (r < totalRows - 1) -
trunk/Source/WebCore/rendering/style/BorderData.h
r81097 r81103 50 50 bool hasBorderRadius() const 51 51 { 52 if ( !m_topLeft.width().isZero())52 if (m_topLeft.width().rawValue() > 0) 53 53 return true; 54 if ( !m_topRight.width().isZero())54 if (m_topRight.width().rawValue() > 0) 55 55 return true; 56 if ( !m_bottomLeft.width().isZero())56 if (m_bottomLeft.width().rawValue() > 0) 57 57 return true; 58 if ( !m_bottomRight.width().isZero())58 if (m_bottomRight.width().rawValue() > 0) 59 59 return true; 60 60 return false;
Note: See TracChangeset
for help on using the changeset viewer.