Changeset 116645 in webkit


Ignore:
Timestamp:
May 10, 2012 8:10:11 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[CSS3 Backgrounds and Borders] Add background-size to the background shorthand
https://bugs.webkit.org/show_bug.cgi?id=27577

Patch by Joe Thomas <joethomas@motorola.com> on 2012-05-10
Reviewed by Alexis Menard.

Added CSSPropertyBackgroundSize to the background shorthand propery. Added the logic for parsing background-size.
bakground-size appears after background-position followed by a '/'.
The specification related to this change is http://www.w3.org/TR/css3-background/#the-background

Source/WebCore:

Tests: fast/backgrounds/background-shorthand-with-backgroundSize-style.html

fast/backgrounds/size/backgroundSize-in-background-shorthand.html

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::getBackgroundShorthandValue):
(WebCore):

  • css/CSSComputedStyleDeclaration.h:

(CSSComputedStyleDeclaration):

  • css/CSSParser.cpp:

(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseFillShorthand):

  • css/StylePropertySet.cpp:

(WebCore::StylePropertySet::getLayeredShorthandValue):

  • css/StylePropertyShorthand.cpp:

(WebCore):
(WebCore::backgroundShorthand):

LayoutTests:

  • fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt: Added.
  • fast/backgrounds/background-shorthand-with-backgroundSize-style.html: Added.
  • fast/backgrounds/size/backgroundSize-in-background-shorthand-expected.html: Added.
  • fast/backgrounds/size/backgroundSize-in-background-shorthand.html: Added.
  • fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt:
  • fast/css/getComputedStyle/getComputedStyle-background-shorthand.html:
  • fast/inspector-support/style-expected.txt:
  • inspector/styles/lazy-computed-style-expected.txt:
  • inspector/styles/styles-computed-trace-expected.txt:
  • inspector/styles/styles-new-API-expected.txt:
Location:
trunk
Files:
4 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116639 r116645  
     12012-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
    1232012-05-10  Sheriff Bot  <webkit.review.bot@gmail.com>
    224
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt

    r104169 r116645  
    44
    55
    6 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) none repeat scroll 0% 0%'
     6PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'
    77PASS 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
     8PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'
     9PASS computedStyle.getPropertyCSSValue('background').length is 2
     10PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     11PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     12PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     13PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     14PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'none'
     15PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat'
     16PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll'
     17PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     18PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     19PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     20PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto'
    1921PASS checkComputedStyleValue() is true
    20 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'
     22PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'
    2123PASS 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
     24PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'
     25PASS computedStyle.getPropertyCSSValue('background').length is 2
     26PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     27PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     28PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     29PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     30PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     31PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat'
     32PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll'
     33PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     34PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     35PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     36PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto'
    3337PASS checkComputedStyleValue() is true
    34 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'
     38PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'
    3539PASS 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
     40PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'
     41PASS computedStyle.getPropertyCSSValue('background').length is 2
     42PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     43PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     44PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     45PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     46PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     47PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
     48PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll'
     49PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     50PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     51PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     52PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto'
    4753PASS checkComputedStyleValue() is true
    48 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'
     54PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'
    4955PASS 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
     56PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'
     57PASS computedStyle.getPropertyCSSValue('background').length is 2
     58PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     59PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     60PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     61PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     62PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     63PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
     64PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     65PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     66PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     67PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
     68PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto'
    6169PASS checkComputedStyleValue() is true
    62 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'
     70PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'
    6371PASS 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
     72PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'
     73PASS computedStyle.getPropertyCSSValue('background').length is 2
     74PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     75PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     76PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     77PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     78PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     79PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
     80PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     81PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     82PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
     83PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
     84PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'auto'
    7585PASS checkComputedStyleValue() is true
    76 PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'
     86PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'
    7787PASS 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
     88PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'
     89PASS computedStyle.getPropertyCSSValue('background').length is 2
     90PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     91PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
     92PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     93PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     94PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     95PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
     96PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     97PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     98PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
     99PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
     100PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'cover'
     101PASS checkComputedStyleValue() is true
     102PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'
     103PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
     104PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'
     105PASS computedStyle.getPropertyCSSValue('background').length is 2
     106PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     107PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     108PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
     109PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
     110PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
     111PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat'
     112PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     113PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).toString() is '[object CSSValueList]'
     114PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 45
     115PASS computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 50
     116PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'contain'
    89117PASS checkComputedStyleValue() is true
    90118PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html

    r104169 r116645  
    2727
    2828e.style.background = "red";
    29 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) none repeat scroll 0% 0%'");
     29shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'");
    3030shouldBe("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");
     31shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) none repeat scroll 0% 0% / auto'");
     32shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     33shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     34shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     35shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     36shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     37shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'none'");
     38shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'");
     39shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'");
     40shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     41shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     42shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     43shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'");
    4244shouldBe("checkComputedStyleValue()", "true");
    4345
    4446e.style.backgroundImage = "url(dummy://test.png)";
    45 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'");
     47shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'");
    4648shouldBe("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");
     49shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto'");
     50shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     51shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     52shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     53shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     54shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     55shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     56shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'");
     57shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'");
     58shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     59shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     60shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     61shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'");
    5862shouldBe("checkComputedStyleValue()", "true");
    5963
    6064e.style.backgroundRepeat = "no-repeat";
    61 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'");
     65shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'");
    6266shouldBe("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");
     67shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto'");
     68shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     69shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     70shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     71shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     72shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     73shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     74shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
     75shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'");
     76shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     77shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     78shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     79shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'");
    7480shouldBe("checkComputedStyleValue()", "true");
    7581
    7682e.style.backgroundAttachment = "fixed";
    77 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'");
     83shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'");
    7884shouldBe("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");
     85shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto'");
     86shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     87shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     88shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     89shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     90shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     91shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     92shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
     93shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     94shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     95shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     96shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
     97shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'");
    9098shouldBe("checkComputedStyleValue()", "true");
    9199
    92100e.style.backgroundPosition = "right bottom";
    93 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'");
     101shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'");
    94102shouldBe("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");
     103shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto'");
     104shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     105shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     106shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     107shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     108shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     109shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     110shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
     111shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     112shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     113shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
     114shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
     115shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'auto'");
    106116shouldBe("checkComputedStyleValue()", "true");
    107117
    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%'");
     118e.style.backgroundSize = "cover";
     119shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'");
    110120shouldBe("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");
     121shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover'");
     122shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     123shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     124shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     125shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     126shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     127shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     128shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
     129shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     130shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     131shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
     132shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
     133shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'cover'");
     134shouldBe("checkComputedStyleValue()", "true");
     135
     136e.style.background = "url(dummy://test.png) green 45% / contain repeat fixed";
     137shouldBe("computedStyle.getPropertyValue('background')", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'");
     138shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     139shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain'");
     140shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     141shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     142shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     143shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "128");
     144shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     145shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
     146shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'");
     147shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     148shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).toString()", "'[object CSSValueList]'");
     149shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "45");
     150shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "50");
     151shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'contain'");
    122152shouldBe("checkComputedStyleValue()", "true");
    123153
  • trunk/LayoutTests/fast/inspector-support/style-expected.txt

    r114895 r116645  
    1010background-clip: initial (original property was background)
    1111background-color: purple (original property was background)
     12background-size: initial (original property was background)
    1213margin-top: 1em (original property was margin)
    1314margin-right: 1em (original property was margin and property was implicitly set.)
  • trunk/LayoutTests/inspector/styles/lazy-computed-style-expected.txt

    r107055 r116645  
    2020    background-clip: initial;
    2121    background-color: gray;
     22    background-size: initial;
    2223
    2324[expanded]
     
    5051background-origin: padding-box;
    5152    #inspected - initial lazy-computed-style.html:15
     53background-size: auto;
     54    #inspected - initial lazy-computed-style.html:15
    5255display: block;
    5356    div - block user agent stylesheet
     
    7275    background-clip: initial;
    7376    background-color: gray;
     77    background-size: initial;
    7478
    7579[expanded]
  • trunk/LayoutTests/inspector/styles/styles-computed-trace-expected.txt

    r107220 r116645  
    1414    #id1 - initial styles-computed-trace.html:23
    1515background-origin: padding-box;
     16    #id1 - initial styles-computed-trace.html:23
     17background-size: auto;
    1618    #id1 - initial styles-computed-trace.html:23
    1719display: block;
  • trunk/LayoutTests/inspector/styles/styles-new-API-expected.txt

    r112387 r116645  
    5454['background-clip':'initial' is-important] @[undefined-undefined] style
    5555['background-color':'green' is-important] @[undefined-undefined] style
     56['background-size':'initial' is-important] @[undefined-undefined] style
    5657
    5758rule
     
    165166['background-clip':'initial' is-important] @[undefined-undefined] style
    166167['background-color':'green' is-important] @[undefined-undefined] style
     168['background-size':'initial' is-important] @[undefined-undefined] style
    167169
    168170rule
     
    332334['background-clip':'initial'] @[undefined-undefined] style
    333335['background-color':'black'] @[undefined-undefined] style
     336['background-size':'initial'] @[undefined-undefined] style
    334337
    335338rule
     
    380383['background-clip':'initial'] @[undefined-undefined] style
    381384['background-color':'black'] @[undefined-undefined] style
     385['background-size':'initial'] @[undefined-undefined] style
    382386
    383387rule
     
    406410['background-clip':'initial' is-important] @[undefined-undefined] style
    407411['background-color':'green' is-important] @[undefined-undefined] style
     412['background-size':'initial' is-important] @[undefined-undefined] style
    408413
    409414=== After property manipulations ===
  • trunk/Source/WebCore/ChangeLog

    r116644 r116645  
     12012-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
    1302012-05-10  MORITA Hajime <morrita@google.com>
    231
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r116166 r116645  
    23442344            return valueForFilter(style.get());
    23452345#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();
    23522348        case CSSPropertyBorder: {
    23532349            RefPtr<CSSValue> value = getPropertyCSSValue(CSSPropertyBorderTop, DoNotUpdateLayout);
     
    26962692}
    26972693
     2694PassRefPtr<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
    26982707} // namespace WebCore
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h

    r113647 r116645  
    112112    PassRefPtr<CSSValueList> getCSSPropertyValuesForShorthandProperties(const StylePropertyShorthand&) const;
    113113    PassRefPtr<CSSValueList> getCSSPropertyValuesForSidesShorthand(const StylePropertyShorthand&) const;
     114    PassRefPtr<CSSValueList> getBackgroundShorthandValue() const;
    114115
    115116    RefPtr<Node> m_node;
  • trunk/Source/WebCore/css/CSSParser.cpp

    r116540 r116645  
    22912291        // Position must come before color in this array because a plain old "0" is a legal color
    22922292        // in quirks mode but it's usually the X coordinate of a position.
    2293         // FIXME: Add CSSPropertyBackgroundSize to the shorthand.
    22942293        const CSSPropertyID properties[] = { CSSPropertyBackgroundImage, CSSPropertyBackgroundRepeat,
    22952294                                   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);
    22982297    }
    22992298    case CSSPropertyWebkitMask: {
     
    25852584    bool foundClip = false;
    25862585    int i;
     2586    bool foundBackgroundPositionCSSProperty = false;
    25872587
    25882588    while (m_valueList->current()) {
     
    26142614        }
    26152615
     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;
    26162623        bool found = false;
    26172624        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
    26182631            if (!parsedProperty[i]) {
    26192632                RefPtr<CSSValue> val1;
     
    26402653                        foundClip = true;
    26412654                    }
     2655                    if (properties[i] == CSSPropertyBackgroundPosition)
     2656                        foundBackgroundPositionCSSProperty =  true;
    26422657                }
    26432658            }
  • trunk/Source/WebCore/css/StylePropertySet.cpp

    r116291 r116645  
    310310        bool useRepeatYShorthand = false;
    311311        bool useSingleWordShorthand = false;
     312        bool foundBackgroundPositionYCSSProperty = false;
    312313        for (unsigned j = 0; j < size; j++) {
    313314            RefPtr<CSSValue> value;
     
    361362                if (!layerRes.isNull())
    362363                    layerRes += " ";
     364                if (foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
     365                    layerRes += "/ ";
     366                if (!foundBackgroundPositionYCSSProperty && shorthand.properties()[j] == CSSPropertyBackgroundSize)
     367                    continue;
     368
    363369                if (useRepeatXShorthand) {
    364370                    useRepeatXShorthand = false;
     
    372378                } else
    373379                    layerRes += value->cssText();
     380
     381                if (shorthand.properties()[j] == CSSPropertyBackgroundPositionY)
     382                    foundBackgroundPositionYCSSProperty = true;
    374383            }
    375384        }
  • trunk/Source/WebCore/css/StylePropertyShorthand.cpp

    r113031 r116645  
    2626namespace WebCore {
    2727
    28 // FIXME: Add CSSPropertyBackgroundSize to the shorthand.
    2928const StylePropertyShorthand& backgroundShorthand()
    3029{
     
    3534        CSSPropertyBackgroundRepeatY,
    3635        CSSPropertyBackgroundAttachment,
     36        CSSPropertyBackgroundClip,
     37        CSSPropertyBackgroundOrigin,
    3738        CSSPropertyBackgroundPositionX,
    3839        CSSPropertyBackgroundPositionY,
    39         CSSPropertyBackgroundClip,
    40         CSSPropertyBackgroundOrigin
     40        CSSPropertyBackgroundSize
    4141    };
    4242    DEFINE_STATIC_LOCAL(StylePropertyShorthand, backgroundShorthand, (backgroundProperties, WTF_ARRAY_LENGTH(backgroundProperties)));
Note: See TracChangeset for help on using the changeset viewer.