Changeset 116645 in webkit
- Timestamp:
- May 10, 2012 8:10:11 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116639 r116645 1 2012-05-10 Joe Thomas <joethomas@motorola.com> 2 3 [CSS3 Backgrounds and Borders] Add background-size to the background shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=27577 5 6 Reviewed by Alexis Menard. 7 8 Added CSSPropertyBackgroundSize to the background shorthand propery. Added the logic for parsing background-size. 9 bakground-size appears after background-position followed by a '/'. 10 The specification related to this change is http://www.w3.org/TR/css3-background/#the-background 11 12 * fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt: Added. 13 * fast/backgrounds/background-shorthand-with-backgroundSize-style.html: Added. 14 * fast/backgrounds/size/backgroundSize-in-background-shorthand-expected.html: Added. 15 * fast/backgrounds/size/backgroundSize-in-background-shorthand.html: Added. 16 * fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt: 17 * fast/css/getComputedStyle/getComputedStyle-background-shorthand.html: 18 * fast/inspector-support/style-expected.txt: 19 * inspector/styles/lazy-computed-style-expected.txt: 20 * inspector/styles/styles-computed-trace-expected.txt: 21 * inspector/styles/styles-new-API-expected.txt: 22 1 23 2012-05-10 Sheriff Bot <webkit.review.bot@gmail.com> 2 24 -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt
r104169 r116645 4 4 5 5 6 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) none repeat scroll 0% 0% '6 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) none repeat scroll 0% 0% / auto' 7 7 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 8 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) none repeat scroll 0% 0%' 9 PASS computedStyle.getPropertyCSSValue('background').length is 5 10 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 11 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 12 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 13 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'none' 14 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat' 15 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll' 16 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 17 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 18 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 8 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) none repeat scroll 0% 0% / auto' 9 PASS computedStyle.getPropertyCSSValue('background').length is 2 10 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 11 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 12 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 13 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 14 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'none' 15 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat' 16 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll' 17 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 18 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 19 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 20 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto' 19 21 PASS checkComputedStyleValue() is true 20 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% '22 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto' 21 23 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 22 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%' 23 PASS computedStyle.getPropertyCSSValue('background').length is 5 24 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 25 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 26 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 27 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png' 28 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat' 29 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll' 30 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 31 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 32 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 24 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto' 25 PASS computedStyle.getPropertyCSSValue('background').length is 2 26 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 27 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 28 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 29 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 30 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 31 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat' 32 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll' 33 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 34 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 35 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 36 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto' 33 37 PASS checkComputedStyleValue() is true 34 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% '38 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto' 35 39 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 36 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%' 37 PASS computedStyle.getPropertyCSSValue('background').length is 5 38 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 39 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 40 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 41 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png' 42 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat' 43 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll' 44 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 45 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 46 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 40 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto' 41 PASS computedStyle.getPropertyCSSValue('background').length is 2 42 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 43 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 44 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 45 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 46 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 47 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat' 48 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll' 49 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 50 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 51 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 52 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto' 47 53 PASS checkComputedStyleValue() is true 48 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% '54 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto' 49 55 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 50 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%' 51 PASS computedStyle.getPropertyCSSValue('background').length is 5 52 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 53 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 54 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 55 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png' 56 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat' 57 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed' 58 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 59 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 60 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 56 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto' 57 PASS computedStyle.getPropertyCSSValue('background').length is 2 58 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 59 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 60 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 61 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 62 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 63 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat' 64 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed' 65 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 66 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 67 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0 68 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto' 61 69 PASS checkComputedStyleValue() is true 62 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% '70 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto' 63 71 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 64 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%' 65 PASS computedStyle.getPropertyCSSValue('background').length is 5 66 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 67 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 68 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 69 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png' 70 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat' 71 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed' 72 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 73 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 74 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 72 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto' 73 PASS computedStyle.getPropertyCSSValue('background').length is 2 74 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 75 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 76 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 77 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 78 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 79 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat' 80 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed' 81 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 82 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 83 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 84 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto' 75 85 PASS checkComputedStyleValue() is true 76 PASS computedStyle.getPropertyValue('background') is 'rgb( 0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'86 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover' 77 87 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 78 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%' 79 PASS computedStyle.getPropertyCSSValue('background').length is 5 80 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 81 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 82 PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 83 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png' 84 PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat' 85 PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed' 86 PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]' 87 PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 45 88 PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 50 88 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover' 89 PASS computedStyle.getPropertyCSSValue('background').length is 2 90 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 91 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255 92 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 93 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 94 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 95 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat' 96 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed' 97 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 98 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 99 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100 100 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'cover' 101 PASS checkComputedStyleValue() is true 102 PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain' 103 PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]' 104 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain' 105 PASS computedStyle.getPropertyCSSValue('background').length is 2 106 PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5 107 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 108 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128 109 PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0 110 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png' 111 PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat' 112 PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed' 113 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]' 114 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 45 115 PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 50 116 PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'contain' 89 117 PASS checkComputedStyleValue() is true 90 118 PASS successfullyParsed is true -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html
r104169 r116645 27 27 28 28 e.style.background = "red"; 29 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) none repeat scroll 0% 0% '");29 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'"); 30 30 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 31 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) none repeat scroll 0% 0%'"); 32 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 33 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 34 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 35 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 36 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'none'"); 37 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'"); 38 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'"); 39 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 40 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 41 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 31 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'"); 32 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 33 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 34 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 35 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 36 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 37 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'none'"); 38 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'"); 39 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'"); 40 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 41 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 42 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 43 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'"); 42 44 shouldBe("checkComputedStyleValue()", "true"); 43 45 44 46 e.style.backgroundImage = "url(dummy://test.png)"; 45 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% '");47 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'"); 46 48 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 47 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'"); 48 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 49 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 50 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 51 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 52 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'"); 53 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'"); 54 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'"); 55 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 56 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 57 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 49 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'"); 50 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 51 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 52 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 53 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 54 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 55 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 56 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'"); 57 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'"); 58 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 59 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 60 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 61 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'"); 58 62 shouldBe("checkComputedStyleValue()", "true"); 59 63 60 64 e.style.backgroundRepeat = "no-repeat"; 61 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% '");65 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'"); 62 66 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 63 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'"); 64 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 65 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 66 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 67 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 68 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'"); 69 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'"); 70 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'"); 71 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 72 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 73 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 67 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'"); 68 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 69 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 70 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 71 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 72 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 73 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 74 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'"); 75 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'"); 76 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 77 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 78 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 79 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'"); 74 80 shouldBe("checkComputedStyleValue()", "true"); 75 81 76 82 e.style.backgroundAttachment = "fixed"; 77 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% '");83 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'"); 78 84 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 79 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'"); 80 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 81 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 82 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 83 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 84 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'"); 85 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'"); 86 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'"); 87 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 88 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 89 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 85 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'"); 86 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 87 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 88 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 89 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 90 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 91 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 92 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'"); 93 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'"); 94 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 95 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 96 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0"); 97 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'"); 90 98 shouldBe("checkComputedStyleValue()", "true"); 91 99 92 100 e.style.backgroundPosition = "right bottom"; 93 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% '");101 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'"); 94 102 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 95 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'"); 96 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 97 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 98 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 99 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 100 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'"); 101 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'"); 102 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'"); 103 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 104 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 105 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 103 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'"); 104 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 105 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 106 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 107 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 108 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 109 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 110 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'"); 111 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'"); 112 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 113 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 114 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 115 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'"); 106 116 shouldBe("checkComputedStyleValue()", "true"); 107 117 108 e.style.background = "url(dummy://test.png) green 45% repeat fixed";109 shouldBe("computedStyle.getPropertyValue('background')", "'rgb( 0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'");118 e.style.backgroundSize = "cover"; 119 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'"); 110 120 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 111 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'"); 112 shouldBe("computedStyle.getPropertyCSSValue('background').length", "5"); 113 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 114 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "128"); 115 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 116 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'"); 117 shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'"); 118 shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'"); 119 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'"); 120 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "45"); 121 shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "50"); 121 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'"); 122 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 123 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 124 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255"); 125 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 126 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 127 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 128 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'"); 129 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'"); 130 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 131 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 132 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100"); 133 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'cover'"); 134 shouldBe("checkComputedStyleValue()", "true"); 135 136 e.style.background = "url(dummy://test.png) green 45% / contain repeat fixed"; 137 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'"); 138 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'"); 139 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'"); 140 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2"); 141 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5"); 142 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 143 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "128"); 144 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0"); 145 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'"); 146 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'"); 147 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'"); 148 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'"); 149 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "45"); 150 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "50"); 151 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'contain'"); 122 152 shouldBe("checkComputedStyleValue()", "true"); 123 153 -
trunk/LayoutTests/fast/inspector-support/style-expected.txt
r114895 r116645 10 10 background-clip: initial (original property was background) 11 11 background-color: purple (original property was background) 12 background-size: initial (original property was background) 12 13 margin-top: 1em (original property was margin) 13 14 margin-right: 1em (original property was margin and property was implicitly set.) -
trunk/LayoutTests/inspector/styles/lazy-computed-style-expected.txt
r107055 r116645 20 20 background-clip: initial; 21 21 background-color: gray; 22 background-size: initial; 22 23 23 24 [expanded] … … 50 51 background-origin: padding-box; 51 52 #inspected - initial lazy-computed-style.html:15 53 background-size: auto; 54 #inspected - initial lazy-computed-style.html:15 52 55 display: block; 53 56 div - block user agent stylesheet … … 72 75 background-clip: initial; 73 76 background-color: gray; 77 background-size: initial; 74 78 75 79 [expanded] -
trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt
r107220 r116645 14 14 #id1 - initial styles-computed-trace.html:23 15 15 background-origin: padding-box; 16 #id1 - initial styles-computed-trace.html:23 17 background-size: auto; 16 18 #id1 - initial styles-computed-trace.html:23 17 19 display: block; -
trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt
r112387 r116645 54 54 ['background-clip':'initial' is-important] @[undefined-undefined] style 55 55 ['background-color':'green' is-important] @[undefined-undefined] style 56 ['background-size':'initial' is-important] @[undefined-undefined] style 56 57 57 58 rule … … 165 166 ['background-clip':'initial' is-important] @[undefined-undefined] style 166 167 ['background-color':'green' is-important] @[undefined-undefined] style 168 ['background-size':'initial' is-important] @[undefined-undefined] style 167 169 168 170 rule … … 332 334 ['background-clip':'initial'] @[undefined-undefined] style 333 335 ['background-color':'black'] @[undefined-undefined] style 336 ['background-size':'initial'] @[undefined-undefined] style 334 337 335 338 rule … … 380 383 ['background-clip':'initial'] @[undefined-undefined] style 381 384 ['background-color':'black'] @[undefined-undefined] style 385 ['background-size':'initial'] @[undefined-undefined] style 382 386 383 387 rule … … 406 410 ['background-clip':'initial' is-important] @[undefined-undefined] style 407 411 ['background-color':'green' is-important] @[undefined-undefined] style 412 ['background-size':'initial' is-important] @[undefined-undefined] style 408 413 409 414 === After property manipulations === -
trunk/Source/WebCore/ChangeLog
r116644 r116645 1 2012-05-10 Joe Thomas <joethomas@motorola.com> 2 3 [CSS3 Backgrounds and Borders] Add background-size to the background shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=27577 5 6 Reviewed by Alexis Menard. 7 8 Added CSSPropertyBackgroundSize to the background shorthand propery. Added the logic for parsing background-size. 9 bakground-size appears after background-position followed by a '/'. 10 The specification related to this change is http://www.w3.org/TR/css3-background/#the-background 11 12 Tests: fast/backgrounds/background-shorthand-with-backgroundSize-style.html 13 fast/backgrounds/size/backgroundSize-in-background-shorthand.html 14 15 * css/CSSComputedStyleDeclaration.cpp: 16 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 17 (WebCore::CSSComputedStyleDeclaration::getBackgroundShorthandValue): 18 (WebCore): 19 * css/CSSComputedStyleDeclaration.h: 20 (CSSComputedStyleDeclaration): 21 * css/CSSParser.cpp: 22 (WebCore::CSSParser::parseValue): 23 (WebCore::CSSParser::parseFillShorthand): 24 * css/StylePropertySet.cpp: 25 (WebCore::StylePropertySet::getLayeredShorthandValue): 26 * css/StylePropertyShorthand.cpp: 27 (WebCore): 28 (WebCore::backgroundShorthand): 29 1 30 2012-05-10 MORITA Hajime <morrita@google.com> 2 31 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r116166 r116645 2344 2344 return valueForFilter(style.get()); 2345 2345 #endif 2346 case CSSPropertyBackground: { 2347 const CSSPropertyID properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage, 2348 CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment, 2349 CSSPropertyBackgroundPosition }; 2350 return getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(properties, WTF_ARRAY_LENGTH(properties))); 2351 } 2346 case CSSPropertyBackground: 2347 return getBackgroundShorthandValue(); 2352 2348 case CSSPropertyBorder: { 2353 2349 RefPtr<CSSValue> value = getPropertyCSSValue(CSSPropertyBorderTop, DoNotUpdateLayout); … … 2696 2692 } 2697 2693 2694 PassRefPtr<CSSValueList> CSSComputedStyleDeclaration::getBackgroundShorthandValue() const 2695 { 2696 // CSSPropertyBackgroundPosition should be at the end of the array so that CSSPropertyBackgroundSize can be appended followed by '/'. 2697 static const CSSPropertyID properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage, 2698 CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment, 2699 CSSPropertyBackgroundPosition }; 2700 2701 RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated(); 2702 list->append(getCSSPropertyValuesForShorthandProperties(StylePropertyShorthand(properties, WTF_ARRAY_LENGTH(properties)))); 2703 list->append(getPropertyCSSValue(CSSPropertyBackgroundSize, DoNotUpdateLayout)); 2704 return list.release(); 2705 } 2706 2698 2707 } // namespace WebCore -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h
r113647 r116645 112 112 PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const; 113 113 PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const; 114 PassRefPtr<CSSValueList> getBackgroundShorthandValue() const; 114 115 115 116 RefPtr<Node> m_node; -
trunk/Source/WebCore/css/CSSParser.cpp
r116540 r116645 2291 2291 // Position must come before color in this array because a plain old "0" is a legal color 2292 2292 // in quirks mode but it's usually the X coordinate of a position. 2293 // FIXME: Add CSSPropertyBackgroundSize to the shorthand.2294 2293 const CSSPropertyID properties[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat, 2295 2294 CSSPropertyBackgroundAttachment, CSSPropertyBackgroundPosition, CSSPropertyBackgroundOrigin, 2296 CSSPropertyBackgroundClip, CSSPropertyBackgroundColor };2297 return parseFillShorthand(propId, properties, 7, important);2295 CSSPropertyBackgroundClip, CSSPropertyBackgroundColor, CSSPropertyBackgroundSize }; 2296 return parseFillShorthand(propId, properties, WTF_ARRAY_LENGTH(properties), important); 2298 2297 } 2299 2298 case CSSPropertyWebkitMask: { … … 2585 2584 bool foundClip = false; 2586 2585 int i; 2586 bool foundBackgroundPositionCSSProperty = false; 2587 2587 2588 2588 while (m_valueList->current()) { … … 2614 2614 } 2615 2615 2616 bool backgroundSizeCSSPropertyExpected = false; 2617 if ((val->unit == CSSParserValue::Operator && val->iValue == '/') && foundBackgroundPositionCSSProperty) { 2618 backgroundSizeCSSPropertyExpected = true; 2619 m_valueList->next(); 2620 } 2621 2622 foundBackgroundPositionCSSProperty = false; 2616 2623 bool found = false; 2617 2624 for (i = 0; !found && i < numProperties; ++i) { 2625 2626 if (backgroundSizeCSSPropertyExpected && properties[i] != CSSPropertyBackgroundSize) 2627 continue; 2628 if (!backgroundSizeCSSPropertyExpected && properties[i] == CSSPropertyBackgroundSize) 2629 continue; 2630 2618 2631 if (!parsedProperty[i]) { 2619 2632 RefPtr<CSSValue> val1; … … 2640 2653 foundClip = true; 2641 2654 } 2655 if (properties[i] == CSSPropertyBackgroundPosition) 2656 foundBackgroundPositionCSSProperty = true; 2642 2657 } 2643 2658 } -
trunk/Source/WebCore/css/StylePropertySet.cpp
r116291 r116645 310 310 bool useRepeatYShorthand = false; 311 311 bool useSingleWordShorthand = false; 312 bool foundBackgroundPositionYCSSProperty = false; 312 313 for (unsigned j = 0; j < size; j++) { 313 314 RefPtr<CSSValue> value; … … 361 362 if (!layerRes.isNull()) 362 363 layerRes += " "; 364 if (foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize) 365 layerRes += "/ "; 366 if (!foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize) 367 continue; 368 363 369 if (useRepeatXShorthand) { 364 370 useRepeatXShorthand = false; … … 372 378 } else 373 379 layerRes += value->cssText(); 380 381 if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY) 382 foundBackgroundPositionYCSSProperty = true; 374 383 } 375 384 } -
trunk/Source/WebCore/css/StylePropertyShorthand.cpp
r113031 r116645 26 26 namespace WebCore { 27 27 28 // FIXME: Add CSSPropertyBackgroundSize to the shorthand.29 28 const StylePropertyShorthand& backgroundShorthand() 30 29 { … … 35 34 CSSPropertyBackgroundRepeatY, 36 35 CSSPropertyBackgroundAttachment, 36 CSSPropertyBackgroundClip, 37 CSSPropertyBackgroundOrigin, 37 38 CSSPropertyBackgroundPositionX, 38 39 CSSPropertyBackgroundPositionY, 39 CSSPropertyBackgroundClip, 40 CSSPropertyBackgroundOrigin 40 CSSPropertyBackgroundSize 41 41 }; 42 42 DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (backgroundProperties, WTF_ARRAY_LENGTH(backgroundProperties)));
Note: See TracChangeset
for help on using the changeset viewer.