Changeset 50108 in webkit
- Timestamp:
- Oct 26, 2009, 3:41:45 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r50100 r50108 1 2009-10-26 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Beth Dakin. 4 5 background-size: X treated as background-size: X X, not background-size: X auto 6 https://bugs.webkit.org/show_bug.cgi?id=28440 7 8 * fast/backgrounds/size/parsing-background-size-values-expected.txt: 9 * fast/backgrounds/size/parsing-inherit-expected.txt: 10 * fast/backgrounds/size/resources/parsing-background-size-values.js: 11 (test): 12 * fast/backgrounds/size/resources/parsing-inherit.js: 13 * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt: 14 * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 15 1 16 2009-10-26 Dimitri Glazkov <dglazkov@chromium.org> 2 17 -
trunk/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt
r47716 r50108 13 13 PASS test("background-size: 30% 20%;") is "30% 20%" 14 14 PASS test("background-size: 4em auto;") is "4em " 15 PASS test("background-size: 5em ;") is "5em 5em" 15 PASS test("background-size: 5em;") is "5em " 16 PASS test("-webkit-background-size: 5em ;") is "5em 5em" 16 17 PASS test("background-size: 100 100 100;") is null 17 18 PASS test("background-size: coconut;") is null 18 19 PASS test("background-size: 100px,;") is null 19 PASS test("background-size: 100px, 50%;") is "100px 100px, 50% 50%" 20 PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em 2em, 100px 50%" 20 PASS test("background-size: 100px, 50%;") is "100px , 50% " 21 PASS test("-webkit-background-size: 100px, 50%;") is "100px 100px, 50% 50%" 22 PASS test("background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em , 100px 50%" 23 PASS test("-webkit-background-size: 50% 100px, 2em, 100px 50%;") is "50% 100px, 2em 2em, 100px 50%" 21 24 PASS successfullyParsed is true 22 25 -
trunk/LayoutTests/fast/backgrounds/size/parsing-inherit-expected.txt
r47630 r50108 13 13 PASS test("background-size: 30% 20%;") is "30% 20%" 14 14 PASS test("background-size: 4em auto;") is "64px auto" 15 PASS test("background-size: 5em ;") is "80px 80px" 15 PASS test("background-size: 5em ;") is "80px auto" 16 PASS test("-webkit-background-size: 5em ;") is "80px 80px" 16 17 PASS test("background-size: 100 100 100;") is "auto auto" 17 18 PASS test("background-size: coconut;") is "auto auto" -
trunk/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js
r47716 r50108 7 7 document.body.appendChild(div); 8 8 9 var result = div.style.getPropertyValue( "background-size");9 var result = div.style.getPropertyValue(value.substring(0, value.indexOf(":"))); 10 10 document.body.removeChild(div); 11 11 return result; … … 21 21 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"'); 22 22 shouldBe('test("background-size: 4em auto;")', '"4em "'); 23 shouldBe('test("background-size: 5em ;")', '"5em 5em"'); 23 shouldBe('test("background-size: 5em;")', '"5em "'); 24 shouldBe('test("-webkit-background-size: 5em ;")', '"5em 5em"'); 24 25 25 26 shouldBe('test("background-size: 100 100 100;")', 'null'); … … 27 28 28 29 shouldBe('test("background-size: 100px,;")', 'null'); 29 shouldBe('test("background-size: 100px, 50%;")', '"100px 100px, 50% 50%"'); 30 shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em 2em, 100px 50%"'); 30 shouldBe('test("background-size: 100px, 50%;")', '"100px , 50% "'); 31 shouldBe('test("-webkit-background-size: 100px, 50%;")', '"100px 100px, 50% 50%"'); 32 shouldBe('test("background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em , 100px 50%"'); 33 shouldBe('test("-webkit-background-size: 50% 100px, 2em, 100px 50%;")', '"50% 100px, 2em 2em, 100px 50%"'); 31 34 32 35 var successfullyParsed = true; -
trunk/LayoutTests/fast/backgrounds/size/resources/parsing-inherit.js
r47630 r50108 25 25 shouldBe('test("background-size: 30% 20%;")', '"30% 20%"'); 26 26 shouldBe('test("background-size: 4em auto;")', '"64px auto"'); 27 shouldBe('test("background-size: 5em ;")', '"80px 80px"'); 27 shouldBe('test("background-size: 5em ;")', '"80px auto"'); 28 shouldBe('test("-webkit-background-size: 5em ;")', '"80px 80px"'); 28 29 29 30 shouldBe('test("background-size: 100 100 100;")', '"auto auto"'); -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
r49959 r50108 106 106 -webkit-background-composite: source-over; 107 107 -webkit-background-origin: padding-box; 108 -webkit-background-size: auto auto; 108 109 -webkit-border-fit: border; 109 110 -webkit-border-horizontal-spacing: 0px; -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r49959 r50108 105 105 -webkit-background-composite: source-over 106 106 -webkit-background-origin: padding-box 107 -webkit-background-size: auto auto 107 108 -webkit-border-fit: border 108 109 -webkit-border-horizontal-spacing: 0px -
trunk/WebCore/ChangeLog
r50103 r50108 1 2009-10-26 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Beth Dakin. 4 5 background-size: X treated as background-size: X X, not background-size: X auto 6 https://bugs.webkit.org/show_bug.cgi?id=28440 7 8 Updated fast/backgrounds/size/resources/parsing-background-size-values.js 9 and fast/backgrounds/size/resources/parsing-inherit.js 10 11 Reinstated -webkit-background-size and kept its behavior of filling in 12 the second value with the first one; and changed background-size to have 13 the behavior of filling in the second value with 'auto'. 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (computedProperties): Re-added CSSPropertyWebkitBackgroundSize. 17 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Ditto. 18 * css/CSSParser.cpp: 19 (WebCore::CSSParser::parseValue): Ditto. 20 (WebCore::CSSParser::parseFillSize): Adapted for the new parsing rule. 21 (WebCore::CSSParser::parseFillProperty): Re-added 22 CSSPropertyWebkitBackgroundSize. 23 (WebCore::cssPropertyID): Removed mapping of -webkit-background-size to 24 background-size. 25 * css/CSSParser.h: 26 * css/CSSPropertyNames.in: Re-added -webkit-background-size. 27 * css/CSSStyleSelector.cpp: 28 (WebCore::CSSStyleSelector::applyProperty): Re-added 29 CSSPropertyWebkitBackgroundSize. 30 1 31 2009-10-26 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 32 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r49959 r50108 158 158 CSSPropertyWebkitBackgroundComposite, 159 159 CSSPropertyWebkitBackgroundOrigin, 160 CSSPropertyWebkitBackgroundSize, 160 161 CSSPropertyWebkitBorderFit, 161 162 CSSPropertyWebkitBorderHorizontalSpacing, … … 680 681 return style->backgroundImage()->cssValue(); 681 682 return CSSPrimitiveValue::createIdentifier(CSSValueNone); 682 case CSSPropertyBackgroundSize: { 683 case CSSPropertyBackgroundSize: 684 case CSSPropertyWebkitBackgroundSize: { 683 685 EFillSizeType size = style->backgroundSizeType(); 684 686 if (size == Contain) -
trunk/WebCore/css/CSSParser.cpp
r49959 r50108 874 874 case CSSPropertyBackgroundPositionY: 875 875 case CSSPropertyBackgroundSize: 876 case CSSPropertyWebkitBackgroundSize: 876 877 case CSSPropertyBackgroundRepeat: 877 878 case CSSPropertyBackgroundRepeatX: … … 2330 2331 } 2331 2332 2332 PassRefPtr<CSSValue> CSSParser::parseFillSize( bool& allowComma)2333 PassRefPtr<CSSValue> CSSParser::parseFillSize(int propId, bool& allowComma) 2333 2334 { 2334 2335 allowComma = true; … … 2339 2340 2340 2341 RefPtr<CSSPrimitiveValue> parsedValue1; 2341 2342 2342 2343 if (value->id == CSSValueAuto) 2343 2344 parsedValue1 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); … … 2347 2348 parsedValue1 = CSSPrimitiveValue::create(value->fValue, (CSSPrimitiveValue::UnitTypes)value->unit); 2348 2349 } 2349 2350 RefPtr<CSSPrimitiveValue> parsedValue2 = parsedValue1; 2350 2351 CSSPropertyID property = static_cast<CSSPropertyID>(propId); 2352 RefPtr<CSSPrimitiveValue> parsedValue2; 2351 2353 if ((value = m_valueList->next())) { 2352 2354 if (value->id == CSSValueAuto) … … 2360 2362 } 2361 2363 } 2362 2364 if (!parsedValue2) { 2365 if (property == CSSPropertyWebkitBackgroundSize || property == CSSPropertyWebkitMaskSize) 2366 parsedValue2 = parsedValue1; 2367 else 2368 parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); 2369 } 2370 2363 2371 return CSSPrimitiveValue::create(Pair::create(parsedValue1.release(), parsedValue2.release())); 2364 2372 } … … 2479 2487 break; 2480 2488 case CSSPropertyBackgroundSize: 2489 case CSSPropertyWebkitBackgroundSize: 2481 2490 case CSSPropertyWebkitMaskSize: { 2482 currValue = parseFillSize( allowComma);2491 currValue = parseFillSize(propId, allowComma); 2483 2492 if (currValue) 2484 2493 m_valueList->next(); … … 5195 5204 name = opacity; 5196 5205 length = strlen(opacity); 5197 } else if (strcmp(buffer, "-webkit-background-size") == 0) {5198 // CSS Backgrounds/Borders. -webkit-background-size worked in Safari 4 and earlier.5199 const char* const backgroundSize = "background-size";5200 name = backgroundSize;5201 length = strlen(backgroundSize);5202 5206 } else if (hasPrefix(buffer + 7, length - 7, "-border-")) { 5203 5207 // -webkit-border-*-*-radius worked in Safari 4 and earlier. -webkit-border-radius syntax -
trunk/WebCore/css/CSSParser.h
r47906 r50108 84 84 void parseFillPosition(RefPtr<CSSValue>&, RefPtr<CSSValue>&); 85 85 void parseFillRepeat(RefPtr<CSSValue>&, RefPtr<CSSValue>&); 86 PassRefPtr<CSSValue> parseFillSize( bool &allowComma);86 PassRefPtr<CSSValue> parseFillSize(int propId, bool &allowComma); 87 87 88 88 bool parseFillProperty(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&); -
trunk/WebCore/css/CSSPropertyNames.in
r49003 r50108 161 161 -webkit-background-composite 162 162 -webkit-background-origin 163 # -webkit-background-size differs from background-size only in the interpretation of 164 # a single value: -webkit-background-size: l; is equivalent to background-size: l l; 165 # whereas background-size: l; is equivalent to background-size: l auto; 166 -webkit-background-size 163 167 -webkit-binding 164 168 -webkit-border-fit -
trunk/WebCore/css/CSSStyleSelector.cpp
r49103 r50108 2962 2962 return; 2963 2963 case CSSPropertyBackgroundSize: 2964 case CSSPropertyWebkitBackgroundSize: 2964 2965 HANDLE_BACKGROUND_VALUE(size, Size, value) 2965 2966 return;
Note:
See TracChangeset
for help on using the changeset viewer.