Changeset 18574 in webkit
- Timestamp:
- Jan 3, 2007 9:28:35 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r18572 r18574 1 2007-01-03 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Hyatt. 4 5 - test and updated results for http://bugs.webkit.org/show_bug.cgi?id=5164 6 Non-integer percentages are incorrectly rounded down in Safari 7 8 * css2.1/t0804-c5507-padn-r-00-c-ag-expected.checksum: 9 * css2.1/t0804-c5507-padn-r-00-c-ag-expected.png: 10 * css2.1/t0804-c5507-padn-r-00-c-ag-expected.txt: 11 * css2.1/t0804-c5509-padn-l-00-b-ag-expected.checksum: 12 * css2.1/t0804-c5509-padn-l-00-b-ag-expected.png: 13 * css2.1/t0804-c5509-padn-l-00-b-ag-expected.txt: 14 * css2.1/t09-c5526c-display-00-e-expected.checksum: 15 * css2.1/t09-c5526c-display-00-e-expected.png: 16 * css2.1/t09-c5526c-display-00-e-expected.txt: 17 * fast/block/basic/011-expected.checksum: 18 * fast/block/basic/011-expected.png: 19 * fast/block/basic/011-expected.txt: 20 * fast/css/percentage-non-integer-expected.checksum: Added. 21 * fast/css/percentage-non-integer-expected.png: Added. 22 * fast/css/percentage-non-integer-expected.txt: Added. 23 * fast/css/percentage-non-integer.html: Added. 24 * tables/mozilla/bugs/bug4385-expected.checksum: 25 * tables/mozilla/bugs/bug4385-expected.png: 26 * tables/mozilla/bugs/bug4385-expected.txt: 27 * tables/mozilla_expected_failures/core/col_span2-expected.checksum: 28 * tables/mozilla_expected_failures/core/col_span2-expected.txt: 29 1 30 2007-01-03 Mitz Pettel <mitz@webkit.org> 2 31 -
trunk/LayoutTests/css2.1/t0804-c5507-padn-r-00-c-ag-expected.checksum
r14231 r18574 1 7 711ab1b2502c95d804d4dfba8796ae01 7f7132b79b97bb2b06e2727a324edecc -
trunk/LayoutTests/css2.1/t0804-c5507-padn-r-00-c-ag-expected.txt
r14684 r18574 21 21 text run at (48,0) width 10: "x" 22 22 RenderBlock {P} at (0,80) size 106x10 [bgcolor=#000080] 23 RenderText {#text} at (4 9,0) size 10x1024 text run at (4 9,0) width 10: "x"23 RenderText {#text} at (48,0) size 10x10 24 text run at (48,0) width 10: "x" -
trunk/LayoutTests/css2.1/t0804-c5509-padn-l-00-b-ag-expected.checksum
r14231 r18574 1 2b7595d0d1513f162454186d04d583bd 1 7f7132b79b97bb2b06e2727a324edecc -
trunk/LayoutTests/css2.1/t0804-c5509-padn-l-00-b-ag-expected.txt
r14684 r18574 21 21 text run at (48,0) width 10: "x" 22 22 RenderBlock {P} at (0,80) size 106x10 [bgcolor=#000080] 23 RenderText {#text} at (4 7,0) size 10x1024 text run at (4 7,0) width 10: "x"23 RenderText {#text} at (48,0) size 10x10 24 text run at (48,0) width 10: "x" -
trunk/LayoutTests/css2.1/t09-c5526c-display-00-e-expected.checksum
r14231 r18574 1 9d0299b6d59c126fb7c9c410f535e55f 1 25ed9975af1d56ff395d80fc87bacaac -
trunk/LayoutTests/css2.1/t09-c5526c-display-00-e-expected.txt
r14684 r18574 5 5 RenderBody {BODY} at (15,15) size 490x390 [bgcolor=#FFFFFF] [border: (5px solid #000000)] 6 6 RenderBlock {DL} at (5,5) size 480x10 7 RenderBlock (floating) {DT} at (5,5) size 7 7x310 [bgcolor=#CC0000] [border: (5px solid #000000)]7 RenderBlock (floating) {DT} at (5,5) size 79x310 [bgcolor=#CC0000] [border: (5px solid #000000)] 8 8 RenderText {#text} at (15,14) size 31x12 9 9 text run at (15,14) width 31: "toggle" -
trunk/LayoutTests/fast/block/basic/011-expected.checksum
r11995 r18574 1 dc8e164fe2bf66b76a68b84faea8a7e7 1 7b35526e2db3a84ab2cf05332f3c1c12 -
trunk/LayoutTests/fast/block/basic/011-expected.txt
r14684 r18574 5 5 RenderBody {BODY} at (15,15) size 490x390 [bgcolor=#FFFFFF] [border: (5px solid #000000)] 6 6 RenderBlock {DL} at (5,5) size 480x10 7 RenderBlock (floating) {DT} at (5,5) size 7 7x310 [bgcolor=#CC0000] [border: (5px solid #000000)]7 RenderBlock (floating) {DT} at (5,5) size 79x310 [bgcolor=#CC0000] [border: (5px solid #000000)] 8 8 RenderText {#text} at (15,14) size 31x12 9 9 text run at (15,14) width 31: "toggle" -
trunk/LayoutTests/tables/mozilla/bugs/bug4385-expected.checksum
r16428 r18574 1 ff5c33d0a2ce20927f83a1b91b20c392 1 6707f72f5237fc83cb3b9964a9d36a65 -
trunk/LayoutTests/tables/mozilla/bugs/bug4385-expected.txt
r14684 r18574 11 11 text run at (2,2) width 12: "A" 12 12 RenderTableRow {TR} at (0,26) size 782x22 13 RenderTableCell {TD} at (2,35) size 8x4 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]14 RenderTableCell {TD} at ( 12,26) size 768x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]13 RenderTableCell {TD} at (2,35) size 16x4 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 14 RenderTableCell {TD} at (20,26) size 760x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 15 15 RenderText {#text} at (2,2) size 195x18 16 16 text run at (2,2) width 195: "This text is invariably wrapped" -
trunk/LayoutTests/tables/mozilla_expected_failures/core/col_span2-expected.checksum
r16432 r18574 1 c73a41b72a58b7019bf7365514617012 1 2a4b3675cb2c398069a47c7fb891d24a -
trunk/LayoutTests/tables/mozilla_expected_failures/core/col_span2-expected.txt
r14684 r18574 493 493 text run at (2,2) width 27: "auto" 494 494 RenderTableRow {TR} at (0,32) size 498x22 495 RenderTableCell {TD} at (5,32) size 29 1x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]496 RenderText {#text} at (2,2) size 24x18 497 text run at (2,2) width 24: "100" 498 RenderTableCell {TD} at (30 1,32) size 90x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]495 RenderTableCell {TD} at (5,32) size 294x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 496 RenderText {#text} at (2,2) size 24x18 497 text run at (2,2) width 24: "100" 498 RenderTableCell {TD} at (304,32) size 87x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 499 499 RenderText {#text} at (2,2) size 27x18 500 500 text run at (2,2) width 27: "auto" … … 514 514 text run at (2,2) width 27: "auto" 515 515 RenderTableRow {TR} at (0,32) size 498x22 516 RenderTableCell {TD} at (5,32) size 9 5x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]517 RenderText {#text} at (2,2) size 24x18 518 text run at (2,2) width 24: "100" 519 RenderTableCell {TD} at (10 5,32) size 286x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]516 RenderTableCell {TD} at (5,32) size 97x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 517 RenderText {#text} at (2,2) size 24x18 518 text run at (2,2) width 24: "100" 519 RenderTableCell {TD} at (107,32) size 284x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 520 520 RenderText {#text} at (2,2) size 24x18 521 521 text run at (2,2) width 24: "300" … … 644 644 text run at (2,2) width 27: "auto" 645 645 RenderTableRow {TR} at (0,32) size 498x58 646 RenderTableCell {TD} at (5,50) size 66x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]647 RenderText {#text} at (2,2) size 27x18 648 text run at (2,2) width 27: "auto" 649 RenderTableCell {TD} at ( 76,50) size 141x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]646 RenderTableCell {TD} at (5,50) size 70x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 647 RenderText {#text} at (2,2) size 27x18 648 text run at (2,2) width 27: "auto" 649 RenderTableCell {TD} at (80,50) size 143x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 650 650 RenderText {#text} at (2,2) size 59x18 651 651 text run at (2,2) width 59: "auto-auto" 652 RenderTableCell {TD} at (22 2,50) size 217x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]652 RenderTableCell {TD} at (228,50) size 211x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1] 653 653 RenderText {#text} at (2,2) size 89x18 654 654 text run at (2,2) width 89: "auto auto auto" … … 670 670 text run at (2,2) width 27: "auto" 671 671 RenderTableRow {TR} at (0,32) size 498x22 672 RenderTableCell {TD} at (5,32) size 12 2x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]673 RenderText {#text} at (2,2) size 27x18 674 text run at (2,2) width 27: "auto" 675 RenderTableCell {TD} at (13 2,32) size 125x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]672 RenderTableCell {TD} at (5,32) size 124x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 673 RenderText {#text} at (2,2) size 27x18 674 text run at (2,2) width 27: "auto" 675 RenderTableCell {TD} at (134,32) size 123x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 676 676 RenderText {#text} at (2,2) size 27x18 677 677 text run at (2,2) width 27: "auto" … … 680 680 text run at (2,2) width 27: "auto" 681 681 RenderTableRow {TR} at (0,59) size 498x22 682 RenderTableCell {TD} at (5,59) size 12 2x22 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1]683 RenderText {#text} at (2,2) size 27x18 684 text run at (2,2) width 27: "auto" 685 RenderTableCell {TD} at (13 2,59) size 361x22 [border: (1px inset #808080)] [r=2 c=1 rs=1 cs=2]682 RenderTableCell {TD} at (5,59) size 124x22 [border: (1px inset #808080)] [r=2 c=0 rs=1 cs=1] 683 RenderText {#text} at (2,2) size 27x18 684 text run at (2,2) width 27: "auto" 685 RenderTableCell {TD} at (134,59) size 359x22 [border: (1px inset #808080)] [r=2 c=1 rs=1 cs=2] 686 686 RenderText {#text} at (2,2) size 95x18 687 687 text run at (2,2) width 95: "90% 90% 90%" … … 797 797 text run at (2,2) width 27: "auto" 798 798 RenderTableRow {TR} at (0,32) size 498x22 799 RenderTableCell {TD} at (5,32) size 1 39x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]800 RenderText {#text} at (2,2) size 27x18 801 text run at (2,2) width 27: "auto" 802 RenderTableCell {TD} at (1 49,32) size 291x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]799 RenderTableCell {TD} at (5,32) size 142x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 800 RenderText {#text} at (2,2) size 27x18 801 text run at (2,2) width 27: "auto" 802 RenderTableCell {TD} at (152,32) size 288x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 803 803 RenderText {#text} at (2,2) size 59x18 804 804 text run at (2,2) width 59: "auto-auto" … … 878 878 RenderTableSection {TBODY} at (1,1) size 498x59 879 879 RenderTableRow {TR} at (0,5) size 498x22 880 RenderTableCell {TD} at (5,5) size 43 5x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2]880 RenderTableCell {TD} at (5,5) size 434x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] 881 881 RenderText {#text} at (2,2) size 194x18 882 882 text run at (2,2) width 194: "90% 90% 90% 90% 90% 90%" 883 RenderTableCell {TD} at (44 5,5) size 48x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]883 RenderTableCell {TD} at (444,5) size 49x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1] 884 884 RenderText {#text} at (2,2) size 27x18 885 885 text run at (2,2) width 27: "auto" 886 886 RenderTableRow {TR} at (0,32) size 498x22 887 RenderTableCell {TD} at (5,32) size 19 1x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]887 RenderTableCell {TD} at (5,32) size 195x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 888 888 RenderText {#text} at (2,2) size 16x18 889 889 text run at (2,2) width 16: "10" 890 RenderTableCell {TD} at (20 1,32) size 239x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]890 RenderTableCell {TD} at (205,32) size 234x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 891 891 RenderText {#text} at (2,2) size 16x18 892 892 text run at (2,2) width 16: "20" 893 RenderTableCell {TD} at (44 5,32) size 48x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]893 RenderTableCell {TD} at (444,32) size 49x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1] 894 894 RenderText {#text} at (2,2) size 27x18 895 895 text run at (2,2) width 27: "auto" … … 921 921 RenderTableSection {TBODY} at (1,1) size 498x59 922 922 RenderTableRow {TR} at (0,5) size 498x22 923 RenderTableCell {TD} at (5,5) size 43 4x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2]923 RenderTableCell {TD} at (5,5) size 435x22 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=2] 924 924 RenderText {#text} at (2,2) size 161x18 925 925 text run at (2,2) width 161: "90% 50% 50% 50% 50%" 926 RenderTableCell {TD} at (44 4,5) size 49x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1]926 RenderTableCell {TD} at (445,5) size 48x22 [border: (1px inset #808080)] [r=0 c=2 rs=1 cs=1] 927 927 RenderText {#text} at (2,2) size 27x18 928 928 text run at (2,2) width 27: "auto" 929 929 RenderTableRow {TR} at (0,32) size 498x22 930 RenderTableCell {TD} at (5,32) size 22 4x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1]931 RenderText {#text} at (2,2) size 24x18 932 text run at (2,2) width 24: "100" 933 RenderTableCell {TD} at (23 4,32) size 205x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1]930 RenderTableCell {TD} at (5,32) size 227x22 [border: (1px inset #808080)] [r=1 c=0 rs=1 cs=1] 931 RenderText {#text} at (2,2) size 24x18 932 text run at (2,2) width 24: "100" 933 RenderTableCell {TD} at (237,32) size 203x22 [border: (1px inset #808080)] [r=1 c=1 rs=1 cs=1] 934 934 RenderText {#text} at (2,2) size 89x18 935 935 text run at (2,2) width 89: "auto auto auto" 936 RenderTableCell {TD} at (44 4,32) size 49x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1]936 RenderTableCell {TD} at (445,32) size 48x22 [border: (1px inset #808080)] [r=1 c=2 rs=1 cs=1] 937 937 RenderText {#text} at (2,2) size 27x18 938 938 text run at (2,2) width 27: "auto" -
trunk/WebCore/ChangeLog
r18572 r18574 1 2007-01-03 Mitz Pettel <mitz@webkit.org> 2 3 Reviewed by Hyatt. 4 5 - fix http://bugs.webkit.org/show_bug.cgi?id=5164 6 Non-integer percentages are incorrectly rounded down in Safari 7 8 Test: fast/css/percentage-non-integer.html 9 10 Added floating point constructor and accessors to Length for use with 11 Percent lengths only. The raw value of a percent length is the integer 12 part of a constant multiple of the original double value. The constant 13 is percentScaleFactor, which is currently 128. 14 15 Added assertions that the correct constructors and accessors are used 16 depending on the type: the double-based percent(), setValue() and Length() 17 for the Percent type, and the integer-based value(), setValue() and Length() 18 for all other types. 19 20 calcValue() and calcMinValue() work the same as before, regardless of the 21 type. 22 23 Added helpers for testing if the value is 0, positive, negative or undefined 24 without having to check the type first. 25 26 Added raw value accessors. These are useful for doing integer math and 27 comparisons with scaled percent values or doing Length type-agnostic math. 28 29 Changed the rest of the code to use the appropriate accessors and helpers. 30 31 * css/CSSComputedStyleDeclaration.cpp: 32 (WebCore::valueForLength): 33 (WebCore::primitiveValueFromLength): 34 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 35 * css/cssstyleselector.cpp: 36 (WebCore::convertToLength): 37 (WebCore::CSSStyleSelector::applyProperty): 38 (WebCore::CSSStyleSelector::mapBackgroundSize): 39 (WebCore::CSSStyleSelector::mapBackgroundXPosition): 40 (WebCore::CSSStyleSelector::mapBackgroundYPosition): 41 * platform/StringImpl.cpp: 42 (WebCore::parseLength): 43 * rendering/AutoTableLayout.cpp: 44 (WebCore::AutoTableLayout::recalcColumn): 45 (WebCore::AutoTableLayout::fullRecalc): 46 (WebCore::AutoTableLayout::calcMinMaxWidth): 47 (WebCore::AutoTableLayout::calcEffectiveWidth): 48 (WebCore::AutoTableLayout::layout): 49 (WebCore::AutoTableLayout::calcPercentages): 50 * rendering/FixedTableLayout.cpp: 51 (WebCore::FixedTableLayout::calcWidthArray): 52 (WebCore::FixedTableLayout::layout): 53 * rendering/Length.h: 54 (WebCore::Length::Length): 55 (WebCore::Length::value): 56 (WebCore::Length::rawValue): 57 (WebCore::Length::percent): 58 (WebCore::Length::setValue): 59 (WebCore::Length::setRawValue): 60 (WebCore::Length::calcValue): 61 (WebCore::Length::calcMinValue): 62 (WebCore::Length::isUndefined): 63 (WebCore::Length::isZero): 64 (WebCore::Length::isPositive): 65 (WebCore::Length::isNegative): 66 * rendering/RenderBR.cpp: 67 (WebCore::RenderBR::lineHeight): 68 * rendering/RenderBlock.cpp: 69 (WebCore::RenderBlock::isSelfCollapsingBlock): 70 * rendering/RenderBox.cpp: 71 (WebCore::cacluateBackgroundSize): 72 (WebCore::RenderBox::calcWidth): 73 (WebCore::RenderBox::calcHeight): 74 (WebCore::RenderBox::calcReplacedWidth): 75 (WebCore::RenderBox::calcReplacedHeight): 76 (WebCore::RenderBox::calcAbsoluteHorizontal): 77 (WebCore::RenderBox::calcAbsoluteVertical): 78 * rendering/RenderFlexibleBox.cpp: 79 (WebCore::RenderFlexibleBox::allowedChildFlex): 80 * rendering/RenderFlow.cpp: 81 (WebCore::RenderFlow::lineHeight): 82 * rendering/RenderImage.cpp: 83 (WebCore::RenderImage::calcReplacedWidth): 84 (WebCore::RenderImage::calcReplacedHeight): 85 * rendering/RenderLayer.cpp: 86 (WebCore::Marquee::direction): 87 (WebCore::Marquee::start): 88 * rendering/RenderObject.cpp: 89 (WebCore::RenderObject::mustRepaintBackgroundOrBorder): 90 (WebCore::RenderObject::lineHeight): 91 * rendering/RenderSlider.cpp: 92 (WebCore::RenderSlider::layout): Added FIXMEs. 93 * rendering/RenderStyle.h: 94 (WebCore::LengthBox::nonZero): 95 (WebCore::RenderStyle::initialLineHeight): 96 * rendering/RenderTable.cpp: 97 (WebCore::RenderTable::calcWidth): 98 * rendering/RenderTableSection.cpp: 99 (WebCore::RenderTableSection::addCell): 100 (WebCore::RenderTableSection::layoutRows): 101 1 102 2007-01-03 Mitz Pettel <mitz@webkit.org> 2 103 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r18557 r18574 169 169 return new CSSPrimitiveValue(CSS_VAL_MIN_INTRINSIC); 170 170 case Percent: 171 return new CSSPrimitiveValue(length. value(), CSSPrimitiveValue::CSS_PERCENTAGE);171 return new CSSPrimitiveValue(length.percent(), CSSPrimitiveValue::CSS_PERCENTAGE); 172 172 case Relative: 173 173 case Static: … … 339 339 String string; 340 340 if (length.isPercent()) 341 string = numberAsString(length. value()) + "%";341 string = numberAsString(length.percent()) + "%"; 342 342 else if (length.isFixed()) 343 343 string = numberAsString(length.calcMinValue(0)); … … 445 445 Length length(style->backgroundXPosition()); 446 446 if (length.isPercent()) 447 string = numberAsString(length. value()) + "%";447 string = numberAsString(length.percent()) + "%"; 448 448 else 449 449 string = numberAsString(length.calcMinValue(renderer->contentWidth())); … … 451 451 length = style->backgroundYPosition(); 452 452 if (length.isPercent()) 453 string += numberAsString(length. value()) + "%";453 string += numberAsString(length.percent()) + "%"; 454 454 else 455 455 string += numberAsString(length.calcMinValue(renderer->contentWidth())); … … 858 858 case CSS_PROP_LINE_HEIGHT: { 859 859 Length length(style->lineHeight()); 860 if (length. value() < 0)860 if (length.isNegative()) 861 861 return new CSSPrimitiveValue(CSS_VAL_NORMAL); 862 862 if (length.isPercent()) { … … 866 866 // that here either. 867 867 float fontSize = style->fontDescription().specifiedSize(); 868 return new CSSPrimitiveValue((int)(length. value() * fontSize) / 100, CSSPrimitiveValue::CSS_PX);868 return new CSSPrimitiveValue((int)(length.percent() * fontSize) / 100, CSSPrimitiveValue::CSS_PX); 869 869 } 870 870 else { -
trunk/WebCore/css/cssstyleselector.cpp
r18557 r18574 1779 1779 l = Length(primitiveValue->computeLengthIntForLength(style), Fixed); 1780 1780 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE) 1781 l = Length( int(primitiveValue->getFloatValue()), Percent);1781 l = Length(primitiveValue->getFloatValue(), Percent); 1782 1782 else if(type == CSSPrimitiveValue::CSS_NUMBER) 1783 l = Length( int(primitiveValue->getFloatValue() * 100), Percent);1783 l = Length(primitiveValue->getFloatValue() * 100.0, Percent); 1784 1784 else if (ok) 1785 1785 *ok = false; … … 2856 2856 primitiveValue->isQuirkValue()); 2857 2857 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE) 2858 l = Length( (int)primitiveValue->getFloatValue(), Percent);2858 l = Length(primitiveValue->getFloatValue(), Percent); 2859 2859 else 2860 2860 return; … … 2939 2939 l = Length(primitiveValue->computeLengthIntForLength(style), Fixed); 2940 2940 else if (type == CSSPrimitiveValue::CSS_PERCENTAGE) 2941 l = Length( (int)primitiveValue->getFloatValue(), Percent);2941 l = Length(primitiveValue->getFloatValue(), Percent); 2942 2942 else 2943 2943 return; … … 2995 2995 l = Length(primitiveValue->computeLengthIntForLength(style), Fixed); 2996 2996 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE) 2997 l = Length( int(primitiveValue->getFloatValue()), Percent);2997 l = Length(primitiveValue->getFloatValue(), Percent); 2998 2998 2999 2999 style->setVerticalAlign(LENGTH); … … 3123 3123 int type = primitiveValue->primitiveType(); 3124 3124 if (primitiveValue->getIdent() == CSS_VAL_NORMAL) 3125 lineHeight = Length(-100 , Percent);3125 lineHeight = Length(-100.0, Percent); 3126 3126 else if (type > CSSPrimitiveValue::CSS_PERCENTAGE && type < CSSPrimitiveValue::CSS_DEG) { 3127 3127 double multiplier = 1.0; … … 3135 3135 lineHeight = Length((style->fontSize() * int(primitiveValue->getFloatValue())) / 100, Fixed); 3136 3136 else if (type == CSSPrimitiveValue::CSS_NUMBER) 3137 lineHeight = Length( int(primitiveValue->getFloatValue() * 100), Percent);3137 lineHeight = Length(primitiveValue->getFloatValue() * 100.0, Percent); 3138 3138 else 3139 3139 return; … … 3634 3634 RectImpl* r = borderImage->m_imageSliceRect.get(); 3635 3635 if (r->top()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 3636 l.top = Length( (int)r->top()->getFloatValue(), Percent);3636 l.top = Length(r->top()->getFloatValue(), Percent); 3637 3637 else 3638 3638 l.top = Length((int)r->top()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed); 3639 3639 if (r->bottom()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 3640 l.bottom = Length( (int)r->bottom()->getFloatValue(), Percent);3640 l.bottom = Length(r->bottom()->getFloatValue(), Percent); 3641 3641 else 3642 3642 l.bottom = Length((int)r->bottom()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed); 3643 3643 if (r->left()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 3644 l.left = Length( (int)r->left()->getFloatValue(), Percent);3644 l.left = Length(r->left()->getFloatValue(), Percent); 3645 3645 else 3646 3646 l.left = Length((int)r->left()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed); 3647 3647 if (r->right()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 3648 l.right = Length( (int)r->right()->getFloatValue(), Percent);3648 l.right = Length(r->right()->getFloatValue(), Percent); 3649 3649 else 3650 3650 l.right = Length((int)r->right()->getFloatValue(CSSPrimitiveValue::CSS_NUMBER), Fixed); … … 4414 4414 firstLength = Length(first->computeLengthIntForLength(style), Fixed); 4415 4415 else if (firstType == CSSPrimitiveValue::CSS_PERCENTAGE) 4416 firstLength = Length( (int)first->getFloatValue(), Percent);4416 firstLength = Length(first->getFloatValue(), Percent); 4417 4417 else 4418 4418 return; … … 4423 4423 secondLength = Length(second->computeLengthIntForLength(style), Fixed); 4424 4424 else if (secondType == CSSPrimitiveValue::CSS_PERCENTAGE) 4425 secondLength = Length( (int)second->getFloatValue(), Percent);4425 secondLength = Length(second->getFloatValue(), Percent); 4426 4426 else 4427 4427 return; … … 4447 4447 l = Length(primitiveValue->computeLengthIntForLength(style), Fixed); 4448 4448 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE) 4449 l = Length( (int)primitiveValue->getFloatValue(), Percent);4449 l = Length(primitiveValue->getFloatValue(), Percent); 4450 4450 else 4451 4451 return; … … 4468 4468 l = Length(primitiveValue->computeLengthIntForLength(style), Fixed); 4469 4469 else if(type == CSSPrimitiveValue::CSS_PERCENTAGE) 4470 l = Length( (int)primitiveValue->getFloatValue(), Percent);4470 l = Length(primitiveValue->getFloatValue(), Percent); 4471 4471 else 4472 4472 return; -
trunk/WebCore/platform/StringImpl.cpp
r18453 r18574 302 302 UChar next = m_data[i]; 303 303 if (next == '%') 304 return Length( r, Percent);304 return Length(static_cast<double>(r), Percent); 305 305 if (next == '*') 306 306 return Length(r, Relative); -
trunk/WebCore/rendering/AutoTableLayout.cpp
r17338 r18574 87 87 88 88 Length w = cell->styleOrColWidth(); 89 if (w.value() > 32760) 90 w.setValue(32760); 91 if (w.value() < 0) 89 // FIXME: What is this arbitrary value? 90 if (w.rawValue() > 32760) 91 w.setRawValue(32760); 92 if (w.isNegative()) 92 93 w.setValue(0); 93 94 switch(w.type()) { … … 111 112 case Percent: 112 113 m_hasPercent = true; 113 if (w. value() > 0 && (!l.width.isPercent() || w.value() > l.width.value()))114 if (w.isPositive() && (!l.width.isPercent() || w.rawValue() > l.width.rawValue())) 114 115 l.width = w; 115 116 break; 116 117 case Relative: 117 if (w.isAuto() || (w.isRelative() && w.value() > l.width.value())) 118 // FIXME: Need to understand this case and whether it makes sense to compare values 119 // which are not necessarily of the same type. 120 if (w.isAuto() || (w.isRelative() && w.value() > l.width.rawValue())) 118 121 l.width = w; 119 122 default: … … 175 178 if (w.isAuto()) 176 179 w = grpWidth; 177 if ((w.isFixed() && w.value() == 0) || (w.isPercent() && w.value() == 0))180 if ((w.isFixed() || w.isPercent()) && w.isZero()) 178 181 w = Length(); 179 182 int cEffCol = m_table->colToEffCol(cCol); … … 255 258 int maxNonPercent = 0; 256 259 257 int remainingPercent = 100 ;260 int remainingPercent = 100 * percentScaleFactor; 258 261 for (unsigned int i = 0; i < m_layoutStruct.size(); i++) { 259 262 minWidth += m_layoutStruct[i].effMinWidth; 260 263 maxWidth += m_layoutStruct[i].effMaxWidth; 261 264 if (m_layoutStruct[i].effWidth.isPercent()) { 262 int percent = min(m_layoutStruct[i].effWidth. value(), remainingPercent);263 int pw = (m_layoutStruct[i].effMaxWidth * 100 ) / max(percent, 1);265 int percent = min(m_layoutStruct[i].effWidth.rawValue(), remainingPercent); 266 int pw = (m_layoutStruct[i].effMaxWidth * 100 * percentScaleFactor) / max(percent, percentScaleFactor); 264 267 remainingPercent -= percent; 265 268 maxPercent = max(pw, maxPercent); … … 270 273 271 274 if (shouldScaleColumns(m_table)) { 272 maxNonPercent = (maxNonPercent * 100 + 50) / max(remainingPercent, 1); 275 // FIXME: Why 50? 276 maxNonPercent = (maxNonPercent * 100 + 50) * percentScaleFactor / max(remainingPercent, percentScaleFactor); 273 277 maxWidth = max(maxNonPercent, maxWidth); 274 278 maxWidth = max(maxWidth, maxPercent); … … 320 324 321 325 Length w = cell->styleOrColWidth(); 322 if (!w.isRelative() && w. value() == 0)326 if (!w.isRelative() && w.isZero()) 323 327 w = Length(); // make it Auto 324 328 … … 340 344 switch (m_layoutStruct[lastCol].width.type()) { 341 345 case Percent: 342 totalPercent += m_layoutStruct[lastCol].width. value();346 totalPercent += m_layoutStruct[lastCol].width.rawValue(); 343 347 allColsAreFixed = false; 344 348 break; … … 368 372 } 369 373 else 370 totalPercent += m_layoutStruct[lastCol].effWidth. value();374 totalPercent += m_layoutStruct[lastCol].effWidth.rawValue(); 371 375 allColsAreFixed = false; 372 376 } … … 384 388 // adjust table max width if needed 385 389 if (w.isPercent()) { 386 if (totalPercent > w. value() || allColsArePercent) {390 if (totalPercent > w.rawValue() || allColsArePercent) { 387 391 // can't satify this condition, treat as variable 388 392 w = Length(); … … 392 396 qDebug(" adjusting tMaxWidth (%d): spanMax=%d, value=%d, totalPercent=%d", tMaxWidth, spanMax, w.value, totalPercent); 393 397 #endif 394 tMaxWidth = max(tMaxWidth, spanMax * 100 / w.value());398 tMaxWidth = max(tMaxWidth, spanMax * 100 * percentScaleFactor / w.rawValue()); 395 399 396 400 // all non percent columns in the span get percent vlaues to sum up correctly. 397 int percentMissing = w. value() - totalPercent;401 int percentMissing = w.rawValue() - totalPercent; 398 402 int totalWidth = 0; 399 403 for (unsigned int pos = col; pos < lastCol; pos++) { … … 411 415 percentMissing -= percent; 412 416 if (percent > 0) 413 m_layoutStruct[pos].effWidth = Length(percent, Percent);417 m_layoutStruct[pos].effWidth.setRawValue(Percent, percent); 414 418 else 415 419 m_layoutStruct[pos].effWidth = Length(); … … 574 578 case Percent: 575 579 havePercent = true; 576 totalPercent += width. value();580 totalPercent += width.rawValue(); 577 581 break; 578 582 case Relative: … … 605 609 } 606 610 } 607 if (totalPercent > 100 ) {611 if (totalPercent > 100 * percentScaleFactor) { 608 612 // remove overallocated space from the last columns 609 int excess = tableWidth*(totalPercent -100)/100;613 int excess = tableWidth*(totalPercent - 100 * percentScaleFactor) / (100 * percentScaleFactor); 610 614 for (int i = nEffCols-1; i >= 0; i--) { 611 615 if (m_layoutStruct[i].effWidth.isPercent()) { … … 688 692 689 693 // spread over percent colums 690 if (available > 0 && m_hasPercent && totalPercent < 100 ) {694 if (available > 0 && m_hasPercent && totalPercent < 100 * percentScaleFactor) { 691 695 // still have some width to spread, distribute weighted to percent columns 692 696 for (int i = 0; i < nEffCols; i++) { 693 697 Length &width = m_layoutStruct[i].effWidth; 694 698 if (width.isPercent()) { 695 int w = available * width. value() / totalPercent;699 int w = available * width.rawValue() / totalPercent; 696 700 available -= w; 697 totalPercent -= width. value();701 totalPercent -= width.rawValue(); 698 702 m_layoutStruct[i].calcWidth += w; 699 703 if (!available || !totalPercent) break; … … 834 838 void AutoTableLayout::calcPercentages() const 835 839 { 836 m_totalPercent = 0;840 unsigned totalPercent = 0; 837 841 for (unsigned i = 0; i < m_layoutStruct.size(); i++) { 838 842 if (m_layoutStruct[i].width.isPercent()) 839 m_totalPercent += m_layoutStruct[i].width.value(); 840 } 843 totalPercent += m_layoutStruct[i].width.rawValue(); 844 } 845 m_totalPercent = totalPercent / percentScaleFactor; 841 846 m_percentagesDirty = false; 842 847 } -
trunk/WebCore/rendering/FixedTableLayout.cpp
r17338 r18574 136 136 } 137 137 int eSpan = m_table->spanOfEffCol(cCol+i); 138 if ((w.isFixed() || w.isPercent()) && w. value() > 0) {139 m_width[cCol+i] = Length(w.value() * eSpan, w.type());138 if ((w.isFixed() || w.isPercent()) && w.isPositive()) { 139 m_width[cCol+i].setRawValue(w.type(), w.rawValue() * eSpan); 140 140 usedWidth += effWidth * eSpan; 141 141 #ifdef DEBUG_LAYOUT … … 184 184 int span = cell->colSpan(); 185 185 int effWidth = 0; 186 if ((w.isFixed() || w.isPercent()) && w.value() > 0) 187 effWidth = w.value(); 186 // FIXME: This does not make sense (mixing percentages with absolute length) 187 if ((w.isFixed() || w.isPercent()) && w.isPositive()) 188 effWidth = w.isPercent() ? w.rawValue() / percentScaleFactor : w.value(); 188 189 189 190 #ifdef DEBUG_LAYOUT … … 197 198 // only set if no col element has already set it. 198 199 if (m_width[cCol+i].isAuto() && w.type() != Auto) { 199 m_width[cCol+i] = Length(w.value() * eSpan, w.type());200 m_width[cCol+i].setRawValue(w.type(), w.rawValue() * eSpan); 200 201 usedWidth += effWidth*eSpan; 201 202 #ifdef DEBUG_LAYOUT … … 260 261 for (int i = 0; i < nEffCols; i++) 261 262 if (m_width[i].isPercent()) 262 totalPercent += m_width[i]. value();263 totalPercent += m_width[i].rawValue(); 263 264 264 265 // calculate how much to distribute to percent cells. 265 int base = tableWidth * totalPercent / 100;266 int base = tableWidth * totalPercent / (100 * percentScaleFactor); 266 267 if (base > available) 267 268 base = available; 268 269 else 269 totalPercent = 100 ;270 totalPercent = 100 * percentScaleFactor; 270 271 271 272 #ifdef DEBUG_LAYOUT … … 274 275 for (int i = 0; available > 0 && i < nEffCols; i++) { 275 276 if (m_width[i].isPercent()) { 276 int w = base * m_width[i]. value() / totalPercent;277 int w = base * m_width[i].rawValue() / totalPercent; 277 278 available -= w; 278 279 calcWidth[i] = w; -
trunk/WebCore/rendering/Length.h
r17338 r18574 24 24 #define Length_H 25 25 26 #include <wtf/Assertions.h> 27 26 28 namespace WebCore { 27 29 28 30 const int undefinedLength = -1; 31 const int percentScaleFactor = 128; 29 32 30 33 enum LengthType { Auto, Relative, Percent, Fixed, Static, Intrinsic, MinIntrinsic }; … … 44 47 : m_value((v * 16) | (q << 3) | t) // FIXME: Doesn't work if the passed-in value is very large! 45 48 { 49 ASSERT(t != Percent); 50 } 51 52 Length(double v, LengthType t, bool q = false) 53 : m_value(static_cast<int>(v * percentScaleFactor) * 16 | (q << 3) | t) 54 { 55 ASSERT(t == Percent); 46 56 } 47 57 … … 49 59 bool operator!=(const Length& o) const { return m_value != o.m_value; } 50 60 51 int value() const { return (m_value & ~0xF) / 16; } 61 int value() const { 62 ASSERT(type() != Percent); 63 return rawValue(); 64 } 65 66 int rawValue() const { return (m_value & ~0xF) / 16; } 67 68 double percent() const 69 { 70 ASSERT(type() == Percent); 71 return static_cast<double>(rawValue()) / percentScaleFactor; 72 } 73 52 74 LengthType type() const { return static_cast<LengthType>(m_value & 7); } 53 75 bool quirk() const { return (m_value >> 3) & 1; } 54 76 55 void setValue(LengthType t, int value) { m_value = value * 16 | (m_value & 0x8) | t; } 56 void setValue(int value) { m_value = value * 16 | (m_value & 0xF); } 77 void setValue(LengthType t, int value) 78 { 79 ASSERT(t != Percent); 80 setRawValue(t, value); 81 } 82 83 void setRawValue(LengthType t, int value) { m_value = value * 16 | (m_value & 0x8) | t; } 84 85 void setValue(int value) 86 { 87 ASSERT(!value || type() != Percent); 88 setRawValue(value); 89 } 90 91 void setRawValue(int value) { m_value = value * 16 | (m_value & 0xF); } 92 93 void setValue(LengthType t, double value) 94 { 95 ASSERT(t == Percent); 96 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0x8) | t; 97 } 98 99 void setValue(double value) 100 { 101 ASSERT(type() == Percent); 102 m_value = static_cast<int>(value * percentScaleFactor) * 16 | (m_value & 0xF); 103 } 57 104 58 105 // note: works only for certain types, returns undefinedLength otherwise … … 63 110 return value(); 64 111 case Percent: 65 return maxValue * value() / 100;112 return maxValue * rawValue() / (100 * percentScaleFactor); 66 113 case Auto: 67 114 return maxValue; … … 77 124 return value(); 78 125 case Percent: 79 return maxValue * value() / 100;126 return maxValue * rawValue() / (100 * percentScaleFactor); 80 127 case Auto: 81 128 default: … … 83 130 } 84 131 } 132 133 bool isUndefined() const { return rawValue() == undefinedLength; } 134 bool isZero() const { return !(m_value & ~0xF); } 135 bool isPositive() const { return rawValue() > 0; } 136 bool isNegative() const { return rawValue() < 0; } 85 137 86 138 bool isAuto() const { return type() == Auto; } -
trunk/WebCore/rendering/RenderBR.cpp
r17448 r18574 65 65 RenderStyle* s = style(firstLine); 66 66 Length lh = s->lineHeight(); 67 if (lh. value() < 0) {67 if (lh.isNegative()) { 68 68 if (s == style()) { 69 69 if (m_lineHeight == -1) -
trunk/WebCore/rendering/RenderBlock.cpp
r18559 r18574 393 393 if (m_height > 0 || 394 394 isTable() || (borderBottom() + paddingBottom() + borderTop() + paddingTop()) != 0 || 395 style()->minHeight(). value() > 0||395 style()->minHeight().isPositive() || 396 396 style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE) 397 397 return false; … … 408 408 // If the height is 0 or auto, then whether or not we are a self-collapsing block depends 409 409 // on whether we have content that is all self-collapsing or not. 410 if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height(). value() == 0)) {410 if (hasAutoHeight || ((style()->height().isFixed() || style()->height().isPercent()) && style()->height().isZero())) { 411 411 // If the block has inline children, see if we generated any line boxes. If we have any 412 412 // line boxes, then we can't be self-collapsing, since we have content. -
trunk/WebCore/rendering/RenderBox.cpp
r18490 r18574 401 401 402 402 if (bgWidth.isPercent()) 403 scaledWidth = scaledWidth * bgWidth.value() / 100;403 scaledWidth = bgWidth.calcValue(scaledWidth); 404 404 else if (bgWidth.isFixed()) 405 405 scaledWidth = bgWidth.value(); … … 408 408 // scale to maintain our aspect ratio. 409 409 if (bgHeight.isPercent()) { 410 int scaledH = scaledHeight * bgHeight.value() / 100;410 int scaledH = bgHeight.calcValue(scaledHeight); 411 411 scaledWidth = bg->imageSize().width() * scaledH / bg->imageSize().height(); 412 412 } else if (bgHeight.isFixed()) … … 415 415 416 416 if (bgHeight.isPercent()) 417 scaledHeight = scaledHeight * bgHeight.value() / 100;417 scaledHeight = bgHeight.calcValue(scaledHeight); 418 418 else if (bgHeight.isFixed()) 419 419 scaledHeight = bgHeight.value(); … … 1047 1047 1048 1048 // Calculate MaxWidth 1049 if ( style()->maxWidth().value() != undefinedLength) {1049 if (!style()->maxWidth().isUndefined()) { 1050 1050 int maxW = calcWidthUsing(MaxWidth, containerWidth); 1051 1051 if (m_width > maxW) { … … 1228 1228 height = m_height; 1229 1229 int minH = calcHeightUsing(style()->minHeight()); // Leave as -1 if unset. 1230 int maxH = style()->maxHeight(). value() == undefinedLength? height : calcHeightUsing(style()->maxHeight());1230 int maxH = style()->maxHeight().isUndefined() ? height : calcHeightUsing(style()->maxHeight()); 1231 1231 if (maxH == -1) 1232 1232 maxH = height; … … 1356 1356 int width = calcReplacedWidthUsing(style()->width()); 1357 1357 int minW = calcReplacedWidthUsing(style()->minWidth()); 1358 int maxW = style()->maxWidth(). value() == undefinedLength? width : calcReplacedWidthUsing(style()->maxWidth());1358 int maxW = style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth()); 1359 1359 1360 1360 return max(minW, min(width, maxW)); … … 1381 1381 int height = calcReplacedHeightUsing(style()->height()); 1382 1382 int minH = calcReplacedHeightUsing(style()->minHeight()); 1383 int maxH = style()->maxHeight(). value() == undefinedLength? height : calcReplacedHeightUsing(style()->maxHeight());1383 int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight()); 1384 1384 1385 1385 return max(minH, min(height, maxH)); … … 1597 1597 1598 1598 // Calculate constraint equation values for 'max-width' case.calcContentBoxWidth(width.calcValue(containerWidth)); 1599 if ( style()->maxWidth().value() != undefinedLength) {1599 if (!style()->maxWidth().isUndefined()) { 1600 1600 int maxWidth; 1601 1601 int maxMarginLeft; … … 1617 1617 1618 1618 // Calculate constraint equation values for 'min-width' case. 1619 if ( style()->minWidth().value()) {1619 if (!style()->minWidth().isZero()) { 1620 1620 int minWidth; 1621 1621 int minMarginLeft; … … 1878 1878 1879 1879 // Calculate constraint equation values for 'max-height' case. 1880 if ( style()->maxHeight().value() != undefinedLength) {1880 if (!style()->maxHeight().isUndefined()) { 1881 1881 int maxHeight; 1882 1882 int maxMarginTop; … … 1897 1897 1898 1898 // Calculate constraint equation values for 'min-height' case. 1899 if ( style()->minHeight().value()) {1899 if (!style()->minHeight().isZero()) { 1900 1900 int minHeight; 1901 1901 int minMarginTop; -
trunk/WebCore/rendering/RenderFlexibleBox.cpp
r17824 r18574 1079 1079 int maxW = INT_MAX; 1080 1080 int w = child->overrideWidth() - (child->borderLeft() + child->borderRight() + child->paddingLeft() + child->paddingRight()); 1081 if ( child->style()->maxWidth().value() != undefinedLength&&1081 if (!child->style()->maxWidth().isUndefined() && 1082 1082 child->style()->maxWidth().isFixed()) 1083 1083 maxW = child->style()->maxWidth().value(); … … 1093 1093 int maxH = INT_MAX; 1094 1094 int h = child->overrideHeight() - (child->borderTop() + child->borderBottom() + child->paddingTop() + child->paddingBottom()); 1095 if ( child->style()->maxHeight().value() != undefinedLength&&1095 if (!child->style()->maxHeight().isUndefined() && 1096 1096 child->style()->maxHeight().isFixed()) 1097 1097 maxH = child->style()->maxHeight().value(); -
trunk/WebCore/rendering/RenderFlow.cpp
r17782 r18574 282 282 RenderStyle* s = style(firstLine); 283 283 Length lh = s->lineHeight(); 284 if (lh. value() < 0) {284 if (lh.isNegative()) { 285 285 if (s == style()) { 286 286 if (m_lineHeight == -1) -
trunk/WebCore/rendering/RenderImage.cpp
r18446 r18574 380 380 381 381 int minW = calcReplacedWidthUsing(style()->minWidth()); 382 int maxW = style()->maxWidth(). value() == undefinedLength? width : calcReplacedWidthUsing(style()->maxWidth());382 int maxW = style()->maxWidth().isUndefined() ? width : calcReplacedWidthUsing(style()->maxWidth()); 383 383 384 384 return max(minW, min(width, maxW)); … … 394 394 395 395 int minH = calcReplacedHeightUsing(style()->minHeight()); 396 int maxH = style()->maxHeight(). value() == undefinedLength? height : calcReplacedHeightUsing(style()->maxHeight());396 int maxH = style()->maxHeight().isUndefined() ? height : calcReplacedHeightUsing(style()->maxHeight()); 397 397 398 398 return max(minH, min(height, maxH)); -
trunk/WebCore/rendering/RenderLayer.cpp
r18491 r18574 2080 2080 // If so, then we reverse the direction. 2081 2081 Length increment = m_layer->renderer()->style()->marqueeIncrement(); 2082 if (increment. value() < 0)2082 if (increment.isNegative()) 2083 2083 result = static_cast<EMarqueeDirection>(-result); 2084 2084 … … 2145 2145 void Marquee::start() 2146 2146 { 2147 if (m_timer.isActive() || m_layer->renderer()->style()->marqueeIncrement(). value() == 0)2147 if (m_timer.isActive() || m_layer->renderer()->style()->marqueeIncrement().isZero()) 2148 2148 return; 2149 2149 -
trunk/WebCore/rendering/RenderObject.cpp
r18534 r18574 837 837 // These are always percents or auto. 838 838 if (shouldPaintBackgroundImage && 839 ( bgLayer->backgroundXPosition().value() != 0 || bgLayer->backgroundYPosition().value() != 0||839 (!bgLayer->backgroundXPosition().isZero() || !bgLayer->backgroundYPosition().isZero() || 840 840 bgLayer->backgroundSize().width.isPercent() || bgLayer->backgroundSize().height.isPercent())) 841 841 // The background image will shift unpredictably if the size changes. … … 2663 2663 2664 2664 // its "unset", choose nice default 2665 if (lh. value() < 0)2665 if (lh.isNegative()) 2666 2666 return s->font().lineSpacing(); 2667 2667 -
trunk/WebCore/rendering/RenderSlider.cpp
r18293 r18574 212 212 theme()->adjustSliderThumbSize(m_thumb->renderer()); 213 213 214 if (style()->appearance() == SliderVerticalAppearance) 214 if (style()->appearance() == SliderVerticalAppearance) { 215 // FIXME: Handle percentage widths correctly. See http://bugs.webkit.org/show_bug.cgi?id=12104 215 216 m_thumb->renderer()->style()->setLeft(Length(m_width / 2 - m_thumb->renderer()->style()->width().value() / 2, Fixed)); 216 else 217 } else { 218 // FIXME: Handle percentage heights correctly. See http://bugs.webkit.org/show_bug.cgi?id=12104 217 219 m_thumb->renderer()->style()->setTop(Length(m_height / 2 - m_thumb->renderer()->style()->height().value() / 2, Fixed)); 220 } 218 221 219 222 if (relayoutChildren) -
trunk/WebCore/rendering/RenderStyle.h
r18557 r18574 108 108 109 109 110 bool nonZero() const { return left.value() || right.value() || top.value() || bottom.value(); }110 bool nonZero() const { return !(left.isZero() && right.isZero() && top.isZero() && bottom.isZero()); } 111 111 }; 112 112 … … 1771 1771 static int initialWidows() { return 2; } 1772 1772 static int initialOrphans() { return 2; } 1773 static Length initialLineHeight() { return Length(-100 , Percent); }1773 static Length initialLineHeight() { return Length(-100.0, Percent); } 1774 1774 static ETextAlign initialTextAlign() { return TAAUTO; } 1775 1775 static ETextDecoration initialTextDecoration() { return TDNONE; } -
trunk/WebCore/rendering/RenderTable.cpp
r18294 r18574 210 210 211 211 LengthType widthType = style()->width().type(); 212 if (widthType > Relative && style()->width(). value() > 0) {212 if (widthType > Relative && style()->width().isPositive()) { 213 213 // Percent or fixed table 214 214 m_width = style()->width().calcMinValue(availableWidth); -
trunk/WebCore/rendering/RenderTableSection.cpp
r17824 r18574 191 191 // we ignore height settings on rowspan cells 192 192 Length height = cell->style()->height(); 193 if (height. value() > 0|| (height.isRelative() && height.value() >= 0)) {193 if (height.isPositive() || (height.isRelative() && height.value() >= 0)) { 194 194 Length cRowHeight = grid[cRow].height; 195 195 switch (height.type()) { 196 196 case Percent: 197 197 if (!(cRowHeight.isPercent()) || 198 (cRowHeight.isPercent() && cRowHeight. value() < height.value()))198 (cRowHeight.isPercent() && cRowHeight.rawValue() < height.rawValue())) 199 199 grid[cRow].height = height; 200 200 break; … … 398 398 numAuto++; 399 399 else if (grid[r].height.isPercent()) 400 totalPercent += grid[r].height. value();400 totalPercent += grid[r].height.rawValue(); 401 401 } 402 402 if (totalPercent) { 403 403 // try to satisfy percent 404 404 int add = 0; 405 if (totalPercent > 100 )406 totalPercent = 100 ;405 if (totalPercent > 100 * percentScaleFactor) 406 totalPercent = 100 * percentScaleFactor; 407 407 int rh = rowPos[1] - rowPos[0]; 408 408 for (int r = 0; r < totalRows; r++) { 409 409 if (totalPercent > 0 && grid[r].height.isPercent()) { 410 int toAdd = min(dh, (totalHeight * grid[r].height. value() / 100) - rh);410 int toAdd = min(dh, (totalHeight * grid[r].height.rawValue() / (100 * percentScaleFactor)) - rh); 411 411 // If toAdd is negative, then we don't want to shrink the row (this bug 412 412 // affected Outlook Web Access). … … 414 414 add += toAdd; 415 415 dh -= toAdd; 416 totalPercent -= grid[r].height. value();416 totalPercent -= grid[r].height.rawValue(); 417 417 } 418 418 if (r < totalRows - 1)
Note: See TracChangeset
for help on using the changeset viewer.