Changeset 117694 in webkit
- Timestamp:
- May 19, 2012 11:25:34 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r117693 r117694 1 2012-05-19 Joe Thomas <joethomas@motorola.com> 2 3 The order of CSS properties is wrong in background shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=86152 5 6 Reviewed by Ryosuke Niwa. 7 8 Corrected the order of properties returned in StylePropertySet::getPropertyValue for background shorthand property to match the specification 9 http://www.w3.org/TR/css3-background/#background. 10 11 * fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt: 12 * fast/backgrounds/background-shorthand-with-backgroundSize-style.html: 13 * fast/dom/background-shorthand-csstext-expected.txt: 14 * fast/dom/background-shorthand-csstext.html: 15 1 16 2012-05-19 Zan Dobersek <zandobersek@gmail.com> 2 17 -
trunk/LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt
r117622 r117694 4 4 5 5 6 PASS e.style.background is ' red url(dummy://test.png) no-repeat border-box border-box 50% 50% / cover'6 PASS e.style.background is 'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red' 7 7 PASS e.style.backgroundSize is 'cover' 8 8 PASS checkStyle() is true … … 11 11 PASS checkComputedStyleValue() is true 12 12 13 PASS e.style.background is ' red url(dummy://test.png) no-repeat padding-box padding-box 20px 50% / contain'13 PASS e.style.background is 'url(dummy://test.png) 20px 50% / contain no-repeat padding-box padding-box red' 14 14 PASS e.style.backgroundSize is 'contain' 15 15 PASS checkStyle() is true … … 18 18 PASS checkComputedStyleValue() is true 19 19 20 PASS e.style.background is ' red url(dummy://test.png) no-repeat 50px 60px / 50% 75%'20 PASS e.style.background is 'url(dummy://test.png) 50px 60px / 50% 75% no-repeat red' 21 21 PASS e.style.backgroundSize is '50% 75%' 22 22 PASS checkStyle() is true … … 25 25 PASS checkComputedStyleValue() is true 26 26 27 PASS e.style.background is ' red url(dummy://test.png) repeat border-box border-box 0% 0% / 100px 200px'27 PASS e.style.background is 'url(dummy://test.png) 0% 0% / 100px 200px repeat border-box content-box red' 28 28 PASS e.style.backgroundSize is '100px 200px' 29 29 PASS checkStyle() is true … … 32 32 PASS checkComputedStyleValue() is true 33 33 34 PASS e.style.background is ' red url(dummy://test.png) repeat content-box content-box 50% 50% / auto'34 PASS e.style.background is 'url(dummy://test.png) 50% 50% / auto repeat content-box padding-box red' 35 35 PASS e.style.backgroundSize is 'auto' 36 36 PASS checkStyle() is true … … 39 39 PASS checkComputedStyleValue() is true 40 40 41 PASS e.style.background is ' red url(dummy://test.png) no-repeat fixed 50px 60px / 50%'41 PASS e.style.background is 'url(dummy://test.png) 50px 60px / 50% no-repeat fixed red' 42 42 PASS e.style.backgroundSize is '50%' 43 43 PASS checkStyle() is true … … 46 46 PASS checkComputedStyleValue() is true 47 47 48 PASS e.style.background is ' red url(dummy://test.png) repeat scroll padding-box padding-box 0% 0% / 100px'48 PASS e.style.background is 'url(dummy://test.png) 0% 0% / 100px repeat scroll padding-box border-box red' 49 49 PASS e.style.backgroundSize is '100px' 50 50 PASS checkStyle() is true … … 53 53 PASS checkComputedStyleValue() is true 54 54 55 PASS e.style.background is ' red url(dummy://test.png) repeat fixed content-box content-box 50% 50% / auto'55 PASS e.style.background is 'url(dummy://test.png) 50% 50% / auto repeat fixed content-box content-box red' 56 56 PASS e.style.backgroundSize is 'auto' 57 57 PASS checkStyle() is true 58 58 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) repeat fixed 50% 50% / auto' 59 PASS computedStyle.getPropertyValue("background-size") is 'auto' 60 PASS checkComputedStyleValue() is true 61 62 PASS e.style.background is '0% 0% / 50%' 63 PASS e.style.backgroundSize is '50%' 64 PASS checkStyle() is true 65 PASS computedStyle.getPropertyValue("background") is 'rgba(0, 0, 0, 0) none repeat scroll 0% 0% / 50%' 66 PASS computedStyle.getPropertyValue("background-size") is '50%' 67 PASS checkComputedStyleValue() is true 68 69 PASS e.style.background is 'fixed red' 70 PASS e.style.backgroundSize is 'initial' 71 PASS checkStyle() is true 72 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) none repeat fixed 0% 0% / auto' 59 73 PASS computedStyle.getPropertyValue("background-size") is 'auto' 60 74 PASS checkComputedStyleValue() is true -
trunk/LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style.html
r117641 r117694 24 24 25 25 e.style.background = "center / cover red url(dummy://test.png) no-repeat border-box"; 26 shouldBe("e.style.background", "' red url(dummy://test.png) no-repeat border-box border-box 50% 50% / cover'");26 shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red'"); 27 27 shouldBe("e.style.backgroundSize", "'cover'"); 28 28 shouldBe("checkStyle()", "true"); … … 33 33 34 34 e.style.background = "red 20px / contain url(dummy://test.png) no-repeat padding-box"; 35 shouldBe("e.style.background", "' red url(dummy://test.png) no-repeat padding-box padding-box 20px 50% / contain'");35 shouldBe("e.style.background", "'url(dummy://test.png) 20px 50% / contain no-repeat padding-box padding-box red'"); 36 36 shouldBe("e.style.backgroundSize", "'contain'"); 37 37 shouldBe("checkStyle()", "true"); … … 42 42 43 43 e.style.background = "red url(dummy://test.png) 50px 60px / 50% 75% no-repeat"; 44 shouldBe("e.style.background", "' red url(dummy://test.png) no-repeat 50px 60px / 50% 75%'");44 shouldBe("e.style.background", "'url(dummy://test.png) 50px 60px / 50% 75% no-repeat red'"); 45 45 shouldBe("e.style.backgroundSize", "'50% 75%'"); 46 46 shouldBe("checkStyle()", "true"); … … 50 50 debug("") 51 51 52 e.style.background = "red url(dummy://test.png) repeat top left / 100px 200px border-box border-box";53 shouldBe("e.style.background", "' red url(dummy://test.png) repeat border-box border-box 0% 0% / 100px 200px'");52 e.style.background = "red url(dummy://test.png) repeat top left / 100px 200px border-box content-box"; 53 shouldBe("e.style.background", "'url(dummy://test.png) 0% 0% / 100px 200px repeat border-box content-box red'"); 54 54 shouldBe("e.style.backgroundSize", "'100px 200px'"); 55 55 shouldBe("checkStyle()", "true"); … … 59 59 debug("") 60 60 61 e.style.background = "red url(dummy://test.png) repeat 50% / auto auto content-box content-box";62 shouldBe("e.style.background", "' red url(dummy://test.png) repeat content-box content-box 50% 50% / auto'");61 e.style.background = "red url(dummy://test.png) repeat 50% / auto auto content-box padding-box"; 62 shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / auto repeat content-box padding-box red'"); 63 63 shouldBe("e.style.backgroundSize", "'auto'"); 64 64 shouldBe("checkStyle()", "true"); … … 69 69 70 70 e.style.background = "url(dummy://test.png) red 50px 60px / 50% no-repeat fixed"; 71 shouldBe("e.style.background", "' red url(dummy://test.png) no-repeat fixed 50px 60px / 50%'");71 shouldBe("e.style.background", "'url(dummy://test.png) 50px 60px / 50% no-repeat fixed red'"); 72 72 shouldBe("e.style.backgroundSize", "'50%'"); 73 73 shouldBe("checkStyle()", "true"); … … 77 77 debug("") 78 78 79 e.style.background = "red repeat scroll padding-box padding-box top left / 100px url(dummy://test.png)";80 shouldBe("e.style.background", "' red url(dummy://test.png) repeat scroll padding-box padding-box 0% 0% / 100px'");79 e.style.background = "red repeat scroll padding-box border-box top left / 100px url(dummy://test.png)"; 80 shouldBe("e.style.background", "'url(dummy://test.png) 0% 0% / 100px repeat scroll padding-box border-box red'"); 81 81 shouldBe("e.style.backgroundSize", "'100px'"); 82 82 shouldBe("checkStyle()", "true"); … … 87 87 88 88 e.style.background = "50% / auto fixed url(dummy://test.png) repeat content-box red"; 89 shouldBe("e.style.background", "' red url(dummy://test.png) repeat fixed content-box content-box 50% 50% / auto'");89 shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / auto repeat fixed content-box content-box red'"); 90 90 shouldBe("e.style.backgroundSize", "'auto'"); 91 91 shouldBe("checkStyle()", "true"); 92 92 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) repeat fixed 50% 50% / auto'"); 93 shouldBe('computedStyle.getPropertyValue("background-size")', "'auto'"); 94 shouldBe("checkComputedStyleValue()", "true"); 95 debug("") 96 97 e.style.background = "top left / 50%"; 98 shouldBe("e.style.background", "'0% 0% / 50%'"); 99 shouldBe("e.style.backgroundSize", "'50%'"); 100 shouldBe("checkStyle()", "true"); 101 shouldBe('computedStyle.getPropertyValue("background")', "'rgba(0, 0, 0, 0) none repeat scroll 0% 0% / 50%'"); 102 shouldBe('computedStyle.getPropertyValue("background-size")', "'50%'"); 103 shouldBe("checkComputedStyleValue()", "true"); 104 debug("") 105 106 e.style.background = "red fixed"; 107 shouldBe("e.style.background", "'fixed red'"); 108 shouldBe("e.style.backgroundSize", "'initial'"); 109 shouldBe("checkStyle()", "true"); 110 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) none repeat fixed 0% 0% / auto'"); 93 111 shouldBe('computedStyle.getPropertyValue("background-size")', "'auto'"); 94 112 shouldBe("checkComputedStyleValue()", "true"); -
trunk/LayoutTests/fast/dom/background-shorthand-csstext-expected.txt
r48040 r117694 2 2 3 3 PASS: document.body.style.background == 'green' should be true and is. 4 PASS: document.getElementById('div1').style.background == 'repeat-x, white repeat-y' should be true and is.5 PASS: document.getElementById('div2').style.background == ' blue 50% 50%' should be true and is.6 PASS: document.getElementById('div3').style.background == ' rgb(255, 255, 255) none repeat scroll' should be true and is.4 PASS: document.getElementById('div1').style.background == 'repeat-x, repeat-y white' should be true and is. 5 PASS: document.getElementById('div2').style.background == '50% 50% blue' should be true and is. 6 PASS: document.getElementById('div3').style.background == 'none repeat scroll rgb(255, 255, 255)' should be true and is. -
trunk/LayoutTests/fast/dom/background-shorthand-csstext.html
r48040 r117694 33 33 34 34 shouldBe("document.body.style.background == 'green'", true); 35 shouldBe("document.getElementById('div1').style.background == 'repeat-x, white repeat-y'", true);36 shouldBe("document.getElementById('div2').style.background == ' blue 50% 50%'", true);37 shouldBe("document.getElementById('div3').style.background == ' rgb(255, 255, 255) none repeat scroll'", true);35 shouldBe("document.getElementById('div1').style.background == 'repeat-x, repeat-y white'", true); 36 shouldBe("document.getElementById('div2').style.background == '50% 50% blue'", true); 37 shouldBe("document.getElementById('div3').style.background == 'none repeat scroll rgb(255, 255, 255)'", true); 38 38 } 39 39 </script> -
trunk/Source/WebCore/ChangeLog
r117684 r117694 1 2012-05-19 Joe Thomas <joethomas@motorola.com> 2 3 The order of CSS properties is wrong in background shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=86152 5 6 Reviewed by Ryosuke Niwa. 7 8 Corrected the order of properties returned in StylePropertySet::getPropertyValue for background shorthand property to match the specification 9 http://www.w3.org/TR/css3-background/#background. 10 11 * css/StylePropertyShorthand.cpp: 12 (WebCore::backgroundShorthand): 13 1 14 2012-05-19 Ryosuke Niwa <rniwa@webkit.org> 2 15 -
trunk/Source/WebCore/css/StylePropertyShorthand.cpp
r116645 r117694 29 29 { 30 30 static const CSSPropertyID backgroundProperties[] = { 31 CSSPropertyBackgroundColor,32 31 CSSPropertyBackgroundImage, 32 CSSPropertyBackgroundPositionX, 33 CSSPropertyBackgroundPositionY, 34 CSSPropertyBackgroundSize, 33 35 CSSPropertyBackgroundRepeatX, 34 36 CSSPropertyBackgroundRepeatY, 35 37 CSSPropertyBackgroundAttachment, 38 CSSPropertyBackgroundOrigin, 36 39 CSSPropertyBackgroundClip, 37 CSSPropertyBackgroundOrigin, 38 CSSPropertyBackgroundPositionX, 39 CSSPropertyBackgroundPositionY, 40 CSSPropertyBackgroundSize 40 CSSPropertyBackgroundColor 41 41 }; 42 42 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (backgroundProperties, WTF_ARRAY_LENGTH(backgroundProperties)));
Note: See TracChangeset
for help on using the changeset viewer.