Changeset 47716 in webkit
- Timestamp:
- Aug 24, 2009, 9:26:47 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LayoutTests/ChangeLog ¶
r47711 r47716 1 2009-08-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 background-size fails to parse if a single length/percentage/auto is followed by a comma 6 https://bugs.webkit.org/show_bug.cgi?id=28674 7 8 * fast/backgrounds/size/parsing-background-size-values-expected.txt: 9 * fast/backgrounds/size/resources/parsing-background-size-values.js: 10 1 11 2009-08-24 Kenneth Rohde Christiansen <kenneth@webkit.org> 2 12 -
TabularUnified trunk/LayoutTests/fast/backgrounds/size/parsing-background-size-values-expected.txt ¶
r47630 r47716 16 16 PASS test("background-size: 100 100 100;") is null 17 17 PASS test("background-size: coconut;") is null 18 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%" 18 21 PASS successfullyParsed is true 19 22 -
TabularUnified trunk/LayoutTests/fast/backgrounds/size/resources/parsing-background-size-values.js ¶
r47630 r47716 26 26 shouldBe('test("background-size: coconut;")', 'null'); 27 27 28 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%"'); 31 28 32 var successfullyParsed = true; -
TabularUnified trunk/WebCore/ChangeLog ¶
r47712 r47716 1 2009-08-24 Dan Bernstein <mitz@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 background-size fails to parse if a single length/percentage/auto is followed by a comma 6 https://bugs.webkit.org/show_bug.cgi?id=28674 7 8 * css/CSSParser.cpp: 9 (WebCore::CSSParser::parseFillSize): Added an allowComma parameter, 10 which is set to false when this method consumes a comma. Moved 11 handling of 'contain' and 'cover' from parseFillProperty into this 12 method. 13 (WebCore::CSSParser::parseFillProperty): Set allowComma to true before 14 processing the next value, and pass allowComma to parseFillSize. 15 * css/CSSParser.h: 16 1 17 2009-08-17 Martin Robinson <martin.james.robinson@gmail.com> 2 18 -
TabularUnified trunk/WebCore/css/CSSParser.cpp ¶
r47648 r47716 2237 2237 } 2238 2238 2239 PassRefPtr<CSSValue> CSSParser::parseFillSize() 2240 { 2239 PassRefPtr<CSSValue> CSSParser::parseFillSize(bool& allowComma) 2240 { 2241 allowComma = true; 2241 2242 CSSParserValue* value = m_valueList->current(); 2243 2244 if (value->id == CSSValueContain || value->id == CSSValueCover) 2245 return CSSPrimitiveValue::createIdentifier(value->id); 2246 2242 2247 RefPtr<CSSPrimitiveValue> parsedValue1; 2243 2248 … … 2254 2259 if (value->id == CSSValueAuto) 2255 2260 parsedValue2 = CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_UNKNOWN); 2261 else if (value->unit == CSSParserValue::Operator && value->iValue == ',') 2262 allowComma = false; 2256 2263 else { 2257 2264 if (!validUnit(value, FLength|FPercent, m_strict)) … … 2296 2303 allowComma = false; 2297 2304 } else { 2305 allowComma = true; 2298 2306 switch (propId) { 2299 2307 case CSSPropertyBackgroundColor: … … 2378 2386 case CSSPropertyBackgroundSize: 2379 2387 case CSSPropertyWebkitMaskSize: { 2380 if (val->id == CSSValueContain || val->id == CSSValueCover) {2381 currValue = CSSPrimitiveValue::createIdentifier(val->id);2388 currValue = parseFillSize(allowComma); 2389 if (currValue) 2382 2390 m_valueList->next(); 2383 } else {2384 currValue = parseFillSize();2385 if (currValue)2386 m_valueList->next();2387 }2388 2391 break; 2389 2392 } … … 2412 2415 value2 = currValue2.release(); 2413 2416 } 2414 allowComma = true;2415 2417 } 2416 2418 -
TabularUnified trunk/WebCore/css/CSSParser.h ¶
r46547 r47716 83 83 PassRefPtr<CSSValue> parseFillPositionXY(bool& xFound, bool& yFound); 84 84 void parseFillPosition(RefPtr<CSSValue>&, RefPtr<CSSValue>&); 85 PassRefPtr<CSSValue> parseFillSize( );85 PassRefPtr<CSSValue> parseFillSize(bool &allowComma); 86 86 87 87 bool parseFillProperty(int propId, int& propId1, int& propId2, RefPtr<CSSValue>&, RefPtr<CSSValue>&);
Note:
See TracChangeset
for help on using the changeset viewer.