Changeset 207321 in webkit


Ignore:
Timestamp:
Oct 13, 2016 9:09:33 PM (8 years ago)
Author:
achristensen@apple.com
Message:

Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
https://bugs.webkit.org/show_bug.cgi?id=163413

Reviewed by Tim Horton.

LayoutTests/imported/w3c:

  • web-platform-tests/url/url-setters-expected.txt:

Update results. Some more tests are failing, but if my proposal in https://github.com/whatwg/url/issues/148 is accepted,
then these web platform tests will need to be changed. These web platform tests were also failing with the old URL::parse.

Source/WebCore:

This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
in the hosts of URLs with unrecognized schemes. Safari treats such characters as the host, while Firefox
and Chrome treat such characters as part of the path, starting with the "" after the ':'
Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.

This solution was proposed to the spec in https://github.com/whatwg/url/issues/148

Covered by updated API and layout tests.

  • platform/URLParser.cpp:

(WebCore::URLParser::parse):
(WebCore::URLParser::percentDecode):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::hasInvalidDomainCharacter):
(WebCore::URLParser::parseHostAndPort):
(WebCore::URLParser::formURLDecode):
(WebCore::percentDecode): Deleted.
(WebCore::domainToASCII): Deleted.
(WebCore::hasInvalidDomainCharacter): Deleted.
(WebCore::formURLDecode): Deleted.

  • platform/URLParser.h:

Tools:

  • TestWebKitAPI/Tests/WebCore/URLParser.cpp:

(TestWebKitAPI::TEST_F):
Update parsing results. There are now fewer differences between the new URLParser and the old URL::parse.

LayoutTests:

  • contentfiltering/block-after-add-data-then-allow-unblock-expected.txt:
  • contentfiltering/block-after-add-data-then-deny-unblock-expected.txt:
  • contentfiltering/block-after-finished-adding-data-then-allow-unblock-expected.txt:
  • contentfiltering/block-after-finished-adding-data-then-deny-unblock-expected.txt:
  • contentfiltering/block-after-response-then-allow-unblock-expected.txt:
  • contentfiltering/block-after-response-then-deny-unblock-expected.txt:
  • contentfiltering/block-after-will-send-request-then-allow-unblock-expected.txt:
  • contentfiltering/block-after-will-send-request-then-deny-unblock-expected.txt:
  • fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt:
  • fast/backgrounds/background-shorthand-after-set-backgroundSize.html:
  • fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt:
  • fast/backgrounds/background-shorthand-with-backgroundSize-style.html:
  • fast/css/getComputedStyle/computed-style-border-image-expected.txt:
  • fast/css/getComputedStyle/computed-style-border-image.html:
  • fast/css/getComputedStyle/computed-style-cross-fade-expected.txt:
  • fast/css/getComputedStyle/computed-style-cross-fade.html:
  • fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt:
  • fast/css/getComputedStyle/getComputedStyle-background-shorthand.html:
  • fast/css/getComputedStyle/getComputedStyle-list-style-shorthand-expected.txt:
  • fast/css/getComputedStyle/getComputedStyle-list-style-shorthand.html:
  • fast/loader/url-parse-1-expected.txt:
  • fast/url/host-lowercase-per-scheme-expected.txt:
  • fast/url/safari-extension-expected.txt:
  • http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:

Update test expectations. This is how they were before r207162, showing that this change to the URLParser increases compatibility.

Location:
trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207319 r207321  
     12016-10-13  Alex Christensen  <achristensen@webkit.org>
     2
     3        Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
     4        https://bugs.webkit.org/show_bug.cgi?id=163413
     5
     6        Reviewed by Tim Horton.
     7
     8        * contentfiltering/block-after-add-data-then-allow-unblock-expected.txt:
     9        * contentfiltering/block-after-add-data-then-deny-unblock-expected.txt:
     10        * contentfiltering/block-after-finished-adding-data-then-allow-unblock-expected.txt:
     11        * contentfiltering/block-after-finished-adding-data-then-deny-unblock-expected.txt:
     12        * contentfiltering/block-after-response-then-allow-unblock-expected.txt:
     13        * contentfiltering/block-after-response-then-deny-unblock-expected.txt:
     14        * contentfiltering/block-after-will-send-request-then-allow-unblock-expected.txt:
     15        * contentfiltering/block-after-will-send-request-then-deny-unblock-expected.txt:
     16        * fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt:
     17        * fast/backgrounds/background-shorthand-after-set-backgroundSize.html:
     18        * fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt:
     19        * fast/backgrounds/background-shorthand-with-backgroundSize-style.html:
     20        * fast/css/getComputedStyle/computed-style-border-image-expected.txt:
     21        * fast/css/getComputedStyle/computed-style-border-image.html:
     22        * fast/css/getComputedStyle/computed-style-cross-fade-expected.txt:
     23        * fast/css/getComputedStyle/computed-style-cross-fade.html:
     24        * fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt:
     25        * fast/css/getComputedStyle/getComputedStyle-background-shorthand.html:
     26        * fast/css/getComputedStyle/getComputedStyle-list-style-shorthand-expected.txt:
     27        * fast/css/getComputedStyle/getComputedStyle-list-style-shorthand.html:
     28        * fast/loader/url-parse-1-expected.txt:
     29        * fast/url/host-lowercase-per-scheme-expected.txt:
     30        * fast/url/safari-extension-expected.txt:
     31        * http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt:
     32        Update test expectations.  This is how they were before r207162, showing that this change to the URLParser increases compatibility.
     33
    1342016-10-13  Chris Dumez  <cdumez@apple.com>
    235
  • trunk/LayoutTests/contentfiltering/block-after-add-data-then-allow-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-add-data-then-deny-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-allow-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-finished-adding-data-then-deny-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-response-then-allow-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-response-then-deny-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-allow-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/contentfiltering/block-after-will-send-request-then-deny-unblock-expected.txt

    r207162 r207321  
    1414frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
    1515frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
    16 frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock/
     16frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: x-apple-content-filter://mock-unblock
    1717frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
    1818frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
  • trunk/LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize-expected.txt

    r207162 r207321  
    44
    55
    6 PASS e.style.background is 'url(dummy://test.png/) 50% 50% / cover no-repeat border-box border-box red'
     6PASS e.style.background is 'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red'
    77PASS e.style.backgroundSize is 'cover'
    88
  • trunk/LayoutTests/fast/backgrounds/background-shorthand-after-set-backgroundSize.html

    r207162 r207321  
    1313    e.style.backgroundSize = "cover";
    1414    e.style.background = "center red url(dummy://test.png) no-repeat border-box";
    15     shouldBe("e.style.background", "'url(dummy://test.png/) 50% 50% / cover no-repeat border-box border-box red'")
     15    shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red'")
    1616    shouldBe("e.style.backgroundSize", "'cover'");
    1717    debug("")
  • trunk/LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style-expected.txt

    r207162 r207321  
    44
    55
    6 PASS e.style.background is 'url(dummy://test.png/) 50% 50% / cover no-repeat border-box border-box red'
     6PASS e.style.background is 'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red'
    77PASS e.style.backgroundSize is 'cover'
    88PASS checkStyle() is true
    9 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 50% 50% / cover border-box border-box'
     9PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 50% 50% / cover border-box border-box'
    1010PASS computedStyle.getPropertyValue("background-size") is 'cover'
    1111PASS checkComputedStyleValue() is true
    1212
    13 PASS e.style.background is 'url(dummy://test.png/) 20px 50% / contain no-repeat padding-box padding-box red'
     13PASS e.style.background is 'url(dummy://test.png) 20px 50% / contain no-repeat padding-box padding-box red'
    1414PASS e.style.backgroundSize is 'contain'
    1515PASS checkStyle() is true
    16 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 20px 50% / contain padding-box padding-box'
     16PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 20px 50% / contain padding-box padding-box'
    1717PASS computedStyle.getPropertyValue("background-size") is 'contain'
    1818PASS checkComputedStyleValue() is true
    1919
    20 PASS e.style.background is 'url(dummy://test.png/) 50px 60px / 50% 75% no-repeat red'
     20PASS e.style.background is 'url(dummy://test.png) 50px 60px / 50% 75% no-repeat red'
    2121PASS e.style.backgroundSize is '50% 75%'
    2222PASS checkStyle() is true
    23 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 50px 60px / 50% 75% padding-box border-box'
     23PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 50px 60px / 50% 75% padding-box border-box'
    2424PASS computedStyle.getPropertyValue("background-size") is '50% 75%'
    2525PASS checkComputedStyleValue() is true
    2626
    27 PASS e.style.background is 'url(dummy://test.png/) 0% 0% / 100px 200px repeat border-box content-box red'
     27PASS e.style.background is 'url(dummy://test.png) 0% 0% / 100px 200px repeat border-box content-box red'
    2828PASS e.style.backgroundSize is '100px 200px'
    2929PASS checkStyle() is true
    30 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / 100px 200px border-box content-box'
     30PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / 100px 200px border-box content-box'
    3131PASS computedStyle.getPropertyValue("background-size") is '100px 200px'
    3232PASS checkComputedStyleValue() is true
    3333
    34 PASS e.style.background is 'url(dummy://test.png/) 50% 50% / auto repeat content-box padding-box red'
     34PASS e.style.background is 'url(dummy://test.png) 50% 50% / auto repeat content-box padding-box red'
    3535PASS e.style.backgroundSize is 'auto'
    3636PASS checkStyle() is true
    37 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 50% 50% / auto content-box padding-box'
     37PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 50% 50% / auto content-box padding-box'
    3838PASS computedStyle.getPropertyValue("background-size") is 'auto'
    3939PASS checkComputedStyleValue() is true
    4040
    41 PASS e.style.background is 'url(dummy://test.png/) 50px 60px / 50% no-repeat fixed red'
     41PASS e.style.background is 'url(dummy://test.png) 50px 60px / 50% no-repeat fixed red'
    4242PASS e.style.backgroundSize is '50%'
    4343PASS checkStyle() is true
    44 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 50px 60px / 50% padding-box border-box'
     44PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 50px 60px / 50% padding-box border-box'
    4545PASS computedStyle.getPropertyValue("background-size") is '50%'
    4646PASS checkComputedStyleValue() is true
    4747
    48 PASS e.style.background is 'url(dummy://test.png/) 0% 0% / 100px repeat scroll padding-box border-box red'
     48PASS e.style.background is 'url(dummy://test.png) 0% 0% / 100px repeat scroll padding-box border-box red'
    4949PASS e.style.backgroundSize is '100px'
    5050PASS checkStyle() is true
    51 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / 100px padding-box border-box'
     51PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / 100px padding-box border-box'
    5252PASS computedStyle.getPropertyValue("background-size") is '100px'
    5353PASS checkComputedStyleValue() is true
    5454
    55 PASS e.style.background is 'url(dummy://test.png/) 50% 50% / auto repeat fixed content-box content-box red'
     55PASS e.style.background is 'url(dummy://test.png) 50% 50% / auto repeat fixed content-box content-box red'
    5656PASS e.style.backgroundSize is 'auto'
    5757PASS checkStyle() is true
    58 PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png/) repeat fixed 50% 50% / auto content-box content-box'
     58PASS computedStyle.getPropertyValue("background") is 'rgb(255, 0, 0) url(dummy://test.png) repeat fixed 50% 50% / auto content-box content-box'
    5959PASS computedStyle.getPropertyValue("background-size") is 'auto'
    6060PASS checkComputedStyleValue() is true
  • trunk/LayoutTests/fast/backgrounds/background-shorthand-with-backgroundSize-style.html

    r207162 r207321  
    2424
    2525e.style.background = "center / cover red url(dummy://test.png) no-repeat border-box";
    26 shouldBe("e.style.background", "'url(dummy://test.png/) 50% 50% / cover no-repeat border-box border-box red'");
     26shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / cover no-repeat border-box border-box red'");
    2727shouldBe("e.style.backgroundSize", "'cover'");
    2828shouldBe("checkStyle()", "true");
    29 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 50% 50% / cover border-box border-box'");
     29shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 50% 50% / cover border-box border-box'");
    3030shouldBe('computedStyle.getPropertyValue("background-size")', "'cover'");
    3131shouldBe("checkComputedStyleValue()", "true");
    3232debug("")
    3333
    34 e.style.background = "red 20px / contain url(dummy://test.png/) no-repeat padding-box";
    35 shouldBe("e.style.background", "'url(dummy://test.png/) 20px 50% / contain no-repeat padding-box padding-box red'");
     34e.style.background = "red 20px / contain url(dummy://test.png) no-repeat padding-box";
     35shouldBe("e.style.background", "'url(dummy://test.png) 20px 50% / contain no-repeat padding-box padding-box red'");
    3636shouldBe("e.style.backgroundSize", "'contain'");
    3737shouldBe("checkStyle()", "true");
    38 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 20px 50% / contain padding-box padding-box'");
     38shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 20px 50% / contain padding-box padding-box'");
    3939shouldBe('computedStyle.getPropertyValue("background-size")', "'contain'");
    4040shouldBe("checkComputedStyleValue()", "true");
     
    4242
    4343e.style.background = "red url(dummy://test.png) 50px 60px / 50% 75% no-repeat";
    44 shouldBe("e.style.background", "'url(dummy://test.png/) 50px 60px / 50% 75% no-repeat red'");
     44shouldBe("e.style.background", "'url(dummy://test.png) 50px 60px / 50% 75% no-repeat red'");
    4545shouldBe("e.style.backgroundSize", "'50% 75%'");
    4646shouldBe("checkStyle()", "true");
    47 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 50px 60px / 50% 75% padding-box border-box'");
     47shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 50px 60px / 50% 75% padding-box border-box'");
    4848shouldBe('computedStyle.getPropertyValue("background-size")', "'50% 75%'");
    4949shouldBe("checkComputedStyleValue()", "true");
     
    5151
    5252e.style.background = "red url(dummy://test.png) repeat top left / 100px 200px border-box content-box";
    53 shouldBe("e.style.background", "'url(dummy://test.png/) 0% 0% / 100px 200px repeat border-box content-box red'");
     53shouldBe("e.style.background", "'url(dummy://test.png) 0% 0% / 100px 200px repeat border-box content-box red'");
    5454shouldBe("e.style.backgroundSize", "'100px 200px'");
    5555shouldBe("checkStyle()", "true");
    56 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / 100px 200px border-box content-box'");
     56shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / 100px 200px border-box content-box'");
    5757shouldBe('computedStyle.getPropertyValue("background-size")', "'100px 200px'");
    5858shouldBe("checkComputedStyleValue()", "true");
     
    6060
    6161e.style.background = "red url(dummy://test.png) repeat 50% / auto auto content-box padding-box";
    62 shouldBe("e.style.background", "'url(dummy://test.png/) 50% 50% / auto repeat content-box padding-box red'");
     62shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / auto repeat content-box padding-box red'");
    6363shouldBe("e.style.backgroundSize", "'auto'");
    6464shouldBe("checkStyle()", "true");
    65 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 50% 50% / auto content-box padding-box'");
     65shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 50% 50% / auto content-box padding-box'");
    6666shouldBe('computedStyle.getPropertyValue("background-size")', "'auto'");
    6767shouldBe("checkComputedStyleValue()", "true");
     
    6969
    7070e.style.background = "url(dummy://test.png) red 50px 60px / 50% no-repeat fixed";
    71 shouldBe("e.style.background", "'url(dummy://test.png/) 50px 60px / 50% no-repeat fixed red'");
     71shouldBe("e.style.background", "'url(dummy://test.png) 50px 60px / 50% no-repeat fixed red'");
    7272shouldBe("e.style.backgroundSize", "'50%'");
    7373shouldBe("checkStyle()", "true");
    74 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 50px 60px / 50% padding-box border-box'");
     74shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 50px 60px / 50% padding-box border-box'");
    7575shouldBe('computedStyle.getPropertyValue("background-size")', "'50%'");
    7676shouldBe("checkComputedStyleValue()", "true");
    7777debug("")
    7878
    79 e.style.background = "red repeat scroll padding-box border-box top left / 100px url(dummy://test.png/)";
    80 shouldBe("e.style.background", "'url(dummy://test.png/) 0% 0% / 100px repeat scroll padding-box border-box red'");
     79e.style.background = "red repeat scroll padding-box border-box top left / 100px url(dummy://test.png)";
     80shouldBe("e.style.background", "'url(dummy://test.png) 0% 0% / 100px repeat scroll padding-box border-box red'");
    8181shouldBe("e.style.backgroundSize", "'100px'");
    8282shouldBe("checkStyle()", "true");
    83 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / 100px padding-box border-box'");
     83shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / 100px padding-box border-box'");
    8484shouldBe('computedStyle.getPropertyValue("background-size")', "'100px'");
    8585shouldBe("checkComputedStyleValue()", "true");
     
    8787
    8888e.style.background = "50% / auto fixed url(dummy://test.png) repeat content-box red";
    89 shouldBe("e.style.background", "'url(dummy://test.png/) 50% 50% / auto repeat fixed content-box content-box red'");
     89shouldBe("e.style.background", "'url(dummy://test.png) 50% 50% / auto repeat fixed content-box content-box red'");
    9090shouldBe("e.style.backgroundSize", "'auto'");
    9191shouldBe("checkStyle()", "true");
    92 shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png/) repeat fixed 50% 50% / auto content-box content-box'");
     92shouldBe('computedStyle.getPropertyValue("background")', "'rgb(255, 0, 0) url(dummy://test.png) repeat fixed 50% 50% / auto content-box content-box'");
    9393shouldBe('computedStyle.getPropertyValue("background-size")', "'auto'");
    9494shouldBe("checkComputedStyleValue()", "true");
     
    114114
    115115e.style.background = "";
    116 e.style.background = "red / cover url(dummy://test.png/) repeat";
     116e.style.background = "red / cover url(dummy://test.png) repeat";
    117117shouldBe("e.style.background", "''");
    118118shouldBe("e.style.backgroundSize", "''");
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-border-image-expected.txt

    r207162 r207321  
    55PASS checkComputedStyleValue() is true
    66PASS computedBorderImageStyle('url(test.png) 12 11 repeat stretch', 'border-image-slice') is '12 11'
    7 PASS computedBorderImageStyle('url(dummy://test.png/) 12 11 repeat stretch', 'border-image') is 'url(dummy://test.png/) 12 11 / 1 / 0px repeat stretch'
     7PASS computedBorderImageStyle('url(dummy://test.png) 12 11 repeat stretch', 'border-image') is 'url(dummy://test.png) 12 11 / 1 / 0px repeat stretch'
    88PASS checkComputedStyleValue() is true
    99PASS computedBorderImageStyle('url(test.png) 1 2 3 4 repeat stretch', 'border-image-slice') is '1 2 3 4'
    10 PASS computedBorderImageStyle('url(dummy://test.png) 1 2 3 4 repeat stretch', 'border-image') is 'url(dummy://test.png/) 1 2 3 4 / 1 / 0px repeat stretch'
     10PASS computedBorderImageStyle('url(dummy://test.png) 1 2 3 4 repeat stretch', 'border-image') is 'url(dummy://test.png) 1 2 3 4 / 1 / 0px repeat stretch'
    1111PASS checkComputedStyleValue() is true
    1212PASS computedBorderImageStyle('url(test.png) 12 repeat stretch', 'border-image-slice') is '12'
     
    1616PASS checkComputedStyleValue() is true
    1717PASS computedBorderImageStyle('url(test.png) 10 20 fill', 'border-image-slice') is '10 20 fill'
    18 PASS computedBorderImageStyle('url(dummy://test.png) 10 20 fill', 'border-image') is 'url(dummy://test.png/) 10 20 fill / 1 / 0px stretch'
     18PASS computedBorderImageStyle('url(dummy://test.png) 10 20 fill', 'border-image') is 'url(dummy://test.png) 10 20 fill / 1 / 0px stretch'
    1919PASS checkComputedStyleValue() is true
    20 PASS computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image-source') is 'url(dummy://test.png/)'
    21 PASS computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image') is 'url(dummy://test.png/) 10 / 1 / 0px repeat stretch'
     20PASS computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image-source') is 'url(dummy://test.png)'
     21PASS computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image') is 'url(dummy://test.png) 10 / 1 / 0px repeat stretch'
    2222PASS checkComputedStyleValue() is true
    2323PASS computedBorderImageStyle('url(test.png) 10', 'border-image-repeat') is 'stretch'
    24 PASS computedBorderImageStyle('url(dummy://test.png) 10', 'border-image') is 'url(dummy://test.png/) 10 / 1 / 0px stretch'
     24PASS computedBorderImageStyle('url(dummy://test.png) 10', 'border-image') is 'url(dummy://test.png) 10 / 1 / 0px stretch'
    2525PASS checkComputedStyleValue() is true
    2626PASS computedBorderImageStyle('url(test.png) 10 stretch', 'border-image-repeat') is 'stretch'
    27 PASS computedBorderImageStyle('url(dummy://test.png) 10 stretch', 'border-image') is 'url(dummy://test.png/) 10 / 1 / 0px stretch'
     27PASS computedBorderImageStyle('url(dummy://test.png) 10 stretch', 'border-image') is 'url(dummy://test.png) 10 / 1 / 0px stretch'
    2828PASS checkComputedStyleValue() is true
    2929PASS computedBorderImageStyle('url(test.png) 10 kittens', 'border-image-repeat') is 'stretch'
     
    3434PASS checkComputedStyleValue() is true
    3535PASS computedBorderImageStyle('url(test.png) 10 repeat stretch', 'border-image-repeat') is 'repeat stretch'
    36 PASS computedBorderImageStyle('url(dummy://test.png) 10 repeat stretch', 'border-image') is 'url(dummy://test.png/) 10 / 1 / 0px repeat stretch'
     36PASS computedBorderImageStyle('url(dummy://test.png) 10 repeat stretch', 'border-image') is 'url(dummy://test.png) 10 / 1 / 0px repeat stretch'
    3737PASS checkComputedStyleValue() is true
    3838PASS computedBorderImageStyle('url(test.png) 10 round space', 'border-image-repeat') is 'round space'
    39 PASS computedBorderImageStyle('url(dummy://test.png) 10 round space', 'border-image') is 'url(dummy://test.png/) 10 / 1 / 0px round space'
     39PASS computedBorderImageStyle('url(dummy://test.png) 10 round space', 'border-image') is 'url(dummy://test.png) 10 / 1 / 0px round space'
    4040PASS checkComputedStyleValue() is true
    4141PASS computedBorderImageStyle('url(test.png) 10 / 13px 1.5em 1em 10px', 'border-image-width') is '13px 24px 16px 10px'
    42 PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px 1.5em 1em 10px', 'border-image') is 'url(dummy://test.png/) 10 / 13px 24px 16px 10px / 0px stretch'
     42PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px 1.5em 1em 10px', 'border-image') is 'url(dummy://test.png) 10 / 13px 24px 16px 10px / 0px stretch'
    4343PASS checkComputedStyleValue() is true
    4444PASS computedBorderImageStyle('url(test.png) 10 / 14px 10%', 'border-image-width') is '14px 10%'
    45 PASS computedBorderImageStyle('url(dummy://test.png) 10 / 14px 10%', 'border-image') is 'url(dummy://test.png/) 10 / 14px 10% / 0px stretch'
     45PASS computedBorderImageStyle('url(dummy://test.png) 10 / 14px 10%', 'border-image') is 'url(dummy://test.png) 10 / 14px 10% / 0px stretch'
    4646PASS checkComputedStyleValue() is true
    4747PASS computedBorderImageStyle('url(test.png) 10 / 13px / 11px', 'border-image-outset') is '11px'
    48 PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px', 'border-image') is 'url(dummy://test.png/) 10 / 13px / 11px stretch'
     48PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px', 'border-image') is 'url(dummy://test.png) 10 / 13px / 11px stretch'
    4949PASS checkComputedStyleValue() is true
    5050PASS computedBorderImageStyle('url(test.png) 10 / 13px / 11px repeat stretch', 'border-image-outset') is '11px'
    51 PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px repeat stretch', 'border-image') is 'url(dummy://test.png/) 10 / 13px / 11px repeat stretch'
     51PASS computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px repeat stretch', 'border-image') is 'url(dummy://test.png) 10 / 13px / 11px repeat stretch'
    5252PASS checkComputedStyleValue() is true
    5353PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-border-image.html

    r207162 r207321  
    3131shouldBe("checkComputedStyleValue()", "true");
    3232shouldBe("computedBorderImageStyle('url(test.png) 12 11 repeat stretch', 'border-image-slice')", "'12 11'");
    33 shouldBe("computedBorderImageStyle('url(dummy://test.png/) 12 11 repeat stretch', 'border-image')", "'url(dummy://test.png/) 12 11 / 1 / 0px repeat stretch'");
     33shouldBe("computedBorderImageStyle('url(dummy://test.png) 12 11 repeat stretch', 'border-image')", "'url(dummy://test.png) 12 11 / 1 / 0px repeat stretch'");
    3434shouldBe("checkComputedStyleValue()", "true");
    3535shouldBe("computedBorderImageStyle('url(test.png) 1 2 3 4 repeat stretch', 'border-image-slice')", "'1 2 3 4'");
    36 shouldBe("computedBorderImageStyle('url(dummy://test.png) 1 2 3 4 repeat stretch', 'border-image')", "'url(dummy://test.png/) 1 2 3 4 / 1 / 0px repeat stretch'");
     36shouldBe("computedBorderImageStyle('url(dummy://test.png) 1 2 3 4 repeat stretch', 'border-image')", "'url(dummy://test.png) 1 2 3 4 / 1 / 0px repeat stretch'");
    3737shouldBe("checkComputedStyleValue()", "true");
    3838shouldBe("computedBorderImageStyle('url(test.png) 12 repeat stretch', 'border-image-slice')", "'12'");
     
    4242shouldBe("checkComputedStyleValue()", "true");
    4343shouldBe("computedBorderImageStyle('url(test.png) 10 20 fill', 'border-image-slice')", "'10 20 fill'");
    44 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 20 fill', 'border-image')", "'url(dummy://test.png/) 10 20 fill / 1 / 0px stretch'");
     44shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 20 fill', 'border-image')", "'url(dummy://test.png) 10 20 fill / 1 / 0px stretch'");
    4545shouldBe("checkComputedStyleValue()", "true");
    4646
    47 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image-source')", "'url(dummy://test.png/)'");
    48 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image')", "'url(dummy://test.png/) 10 / 1 / 0px repeat stretch'");
     47shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image-source')", "'url(dummy://test.png)'");
     48shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 10 10 10 repeat stretch', 'border-image')", "'url(dummy://test.png) 10 / 1 / 0px repeat stretch'");
    4949shouldBe("checkComputedStyleValue()", "true");
    5050
    5151shouldBe("computedBorderImageStyle('url(test.png) 10', 'border-image-repeat')", "'stretch'");
    52 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10', 'border-image')", "'url(dummy://test.png/) 10 / 1 / 0px stretch'");
     52shouldBe("computedBorderImageStyle('url(dummy://test.png) 10', 'border-image')", "'url(dummy://test.png) 10 / 1 / 0px stretch'");
    5353shouldBe("checkComputedStyleValue()", "true");
    5454shouldBe("computedBorderImageStyle('url(test.png) 10 stretch', 'border-image-repeat')", "'stretch'");
    55 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 stretch', 'border-image')", "'url(dummy://test.png/) 10 / 1 / 0px stretch'");
     55shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 stretch', 'border-image')", "'url(dummy://test.png) 10 / 1 / 0px stretch'");
    5656shouldBe("checkComputedStyleValue()", "true");
    5757shouldBe("computedBorderImageStyle('url(test.png) 10 kittens', 'border-image-repeat')", "'stretch'");
     
    6262shouldBe("checkComputedStyleValue()", "true");
    6363shouldBe("computedBorderImageStyle('url(test.png) 10 repeat stretch', 'border-image-repeat')", "'repeat stretch'");
    64 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 repeat stretch', 'border-image')", "'url(dummy://test.png/) 10 / 1 / 0px repeat stretch'");
     64shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 repeat stretch', 'border-image')", "'url(dummy://test.png) 10 / 1 / 0px repeat stretch'");
    6565shouldBe("checkComputedStyleValue()", "true");
    6666shouldBe("computedBorderImageStyle('url(test.png) 10 round space', 'border-image-repeat')", "'round space'");
    67 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 round space', 'border-image')", "'url(dummy://test.png/) 10 / 1 / 0px round space'");
     67shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 round space', 'border-image')", "'url(dummy://test.png) 10 / 1 / 0px round space'");
    6868shouldBe("checkComputedStyleValue()", "true");
    6969
    7070shouldBe("computedBorderImageStyle('url(test.png) 10 / 13px 1.5em 1em 10px', 'border-image-width')", "'13px 24px 16px 10px'");
    71 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px 1.5em 1em 10px', 'border-image')", "'url(dummy://test.png/) 10 / 13px 24px 16px 10px / 0px stretch'");
     71shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px 1.5em 1em 10px', 'border-image')", "'url(dummy://test.png) 10 / 13px 24px 16px 10px / 0px stretch'");
    7272shouldBe("checkComputedStyleValue()", "true");
    7373shouldBe("computedBorderImageStyle('url(test.png) 10 / 14px 10%', 'border-image-width')", "'14px 10%'");
    74 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 14px 10%', 'border-image')", "'url(dummy://test.png/) 10 / 14px 10% / 0px stretch'");
     74shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 14px 10%', 'border-image')", "'url(dummy://test.png) 10 / 14px 10% / 0px stretch'");
    7575shouldBe("checkComputedStyleValue()", "true");
    7676shouldBe("computedBorderImageStyle('url(test.png) 10 / 13px / 11px', 'border-image-outset')", "'11px'");
    77 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px', 'border-image')", "'url(dummy://test.png/) 10 / 13px / 11px stretch'");
     77shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px', 'border-image')", "'url(dummy://test.png) 10 / 13px / 11px stretch'");
    7878shouldBe("checkComputedStyleValue()", "true");
    7979
    8080shouldBe("computedBorderImageStyle('url(test.png) 10 / 13px / 11px repeat stretch', 'border-image-outset')", "'11px'");
    81 shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px repeat stretch', 'border-image')", "'url(dummy://test.png/) 10 / 13px / 11px repeat stretch'");
     81shouldBe("computedBorderImageStyle('url(dummy://test.png) 10 / 13px / 11px repeat stretch', 'border-image')", "'url(dummy://test.png) 10 / 13px / 11px repeat stretch'");
    8282shouldBe("checkComputedStyleValue()", "true");
    8383
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade-expected.txt

    r207162 r207321  
    44PASS testCrossfade("opacity: 500%", "opacity") is "1"
    55Prefixed
    6 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 50%)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"
    7 PASS testCrossfade("background-image: -webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), url(dummy://example.png/), 50%)", "background-image") is "-webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), url(dummy://example.png/), 0.5)"
    8 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://c.png/), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png/), 25%), 50%)", "background-image") is "-webkit-cross-fade(url(dummy://c.png/), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"
    9 PASS testCrossfade("background-image: -webkit-cross-fade(-webkit-linear-gradient(black, white), url(dummy://example.png), 10%)", "background-image") is "-webkit-cross-fade(-webkit-linear-gradient(top, black, white), url(dummy://example.png/), 0.1)"
    10 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png/), 1.0)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"
    11 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"
    12 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 5.0)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"
    13 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 700%)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"
    14 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), -20)", "background-image") is "-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0)"
     6PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"
     7PASS testCrossfade("background-image: -webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), url(dummy://example.png), 50%)", "background-image") is "-webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), url(dummy://example.png), 0.5)"
     8PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://c.png), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image") is "-webkit-cross-fade(url(dummy://c.png), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"
     9PASS testCrossfade("background-image: -webkit-cross-fade(-webkit-linear-gradient(black, white), url(dummy://example.png), 10%)", "background-image") is "-webkit-cross-fade(-webkit-linear-gradient(top, black, white), url(dummy://example.png), 0.1)"
     10PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"
     11PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"
     12PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 5.0)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"
     13PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 700%)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"
     14PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), -20)", "background-image") is "-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0)"
    1515Unprefixed
    1616
    1717
    18 PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png/), 50%)", "background-image") is "cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"
    19 PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image") is "cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"
     18PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "background-image") is "cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"
     19PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image") is "cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"
    2020Mixed
    2121
    2222
    23 PASS testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png/), 25%), url(dummy://example.png), 50%)", "background-image") is "-webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), url(dummy://example.png/), 0.5)"
    24 PASS testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), 50%)", "background-image") is "-webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"
    25 PASS testCrossfade("background-image: cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), 50%)", "background-image") is "cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"
     23PASS testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), url(dummy://example.png), 50%)", "background-image") is "-webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), url(dummy://example.png), 0.5)"
     24PASS testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image") is "-webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"
     25PASS testCrossfade("background-image: cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image") is "cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"
    2626Invalid values
    2727
    2828
    29 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/))", "background-image") is "none"
    30 PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png),)", "background-image") is "none"
    31 PASS testCrossfade("background-image: cross-fade(url(dummy://example.png/), url(dummy://example.png))", "background-image") is "none"
    32 PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png/),)", "background-image") is "none"
     29PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png))", "background-image") is "none"
     30PASS testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png),)", "background-image") is "none"
     31PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png))", "background-image") is "none"
     32PASS testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png),)", "background-image") is "none"
    3333PASS testCrossfade("background-image: cross-fade(url(dummy://example.png))", "background-image") is "none"
    3434PASS testCrossfade("background-image: cross-fade(), url(dummy://example.png))", "background-image") is "none"
     
    3636PASS testCrossfade("background-image: cross-fade(10px 20% 5px #bbb)", "background-image") is "none"
    3737PASS testCrossfade("background-image: cross-fade(cross-fade(cross-fade()))", "background-image") is "none"
    38 PASS testCrossfade("background-image: cross-fade(20%, url(dummy://a.png/), url(dummy://b.png/))", "background-image") is "none"
    39 PASS testCrossfade("background-image: cross-fade(url(dummy://a.png/),)", "background-image") is "none"
     38PASS testCrossfade("background-image: cross-fade(20%, url(dummy://a.png), url(dummy://b.png))", "background-image") is "none"
     39PASS testCrossfade("background-image: cross-fade(url(dummy://a.png),)", "background-image") is "none"
    4040PASS testCrossfade("background-image: cross-fade(,)", "background-image") is "none"
    41 PASS testCrossfade("background-image: cross-fade(,url(dummy://a.png/))", "background-image") is "none"
     41PASS testCrossfade("background-image: cross-fade(,url(dummy://a.png))", "background-image") is "none"
    4242PASS testCrossfade("background-image: cross-fade(,,,,,)", "background-image") is "none"
    4343PASS successfullyParsed is true
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade.html

    r207162 r207321  
    2626debug('Prefixed');
    2727
    28 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 50%)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"');
    29 shouldBe('testCrossfade("background-image: -webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), url(dummy://example.png/), 50%)", "background-image")', '"-webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), url(dummy://example.png/), 0.5)"');
    30 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://c.png/), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png/), 25%), 50%)", "background-image")',
    31     '"-webkit-cross-fade(url(dummy://c.png/), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"');
    32 shouldBe('testCrossfade("background-image: -webkit-cross-fade(-webkit-linear-gradient(black, white), url(dummy://example.png), 10%)", "background-image")', '"-webkit-cross-fade(-webkit-linear-gradient(top, black, white), url(dummy://example.png/), 0.1)"');
    33 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png/), 1.0)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"');
    34 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"');
     28shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"');
     29shouldBe('testCrossfade("background-image: -webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), url(dummy://example.png), 50%)", "background-image")', '"-webkit-cross-fade(-webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), url(dummy://example.png), 0.5)"');
     30shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://c.png), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image")',
     31    '"-webkit-cross-fade(url(dummy://c.png), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"');
     32shouldBe('testCrossfade("background-image: -webkit-cross-fade(-webkit-linear-gradient(black, white), url(dummy://example.png), 10%)", "background-image")', '"-webkit-cross-fade(-webkit-linear-gradient(top, black, white), url(dummy://example.png), 0.1)"');
     33shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"');
     34shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"');
    3535
    36 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 5.0)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"');
    37 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 700%)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"');
     36shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 5.0)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"');
     37shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 700%)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"');
    3838
    39 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), -20)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0)"');
     39shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), -20)", "background-image")', '"-webkit-cross-fade(url(dummy://example.png), url(dummy://example.png), 0)"');
    4040
    4141debug('<h2>Unprefixed</h2>');
    4242
    43 shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png/), 50%)", "background-image")', '"cross-fade(url(dummy://example.png/), url(dummy://example.png/), 0.5)"');
    44 shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image")', '"cross-fade(url(dummy://example.png/), url(dummy://example.png/), 1)"');
     43shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 50%)", "background-image")', '"cross-fade(url(dummy://example.png), url(dummy://example.png), 0.5)"');
     44shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png), 1.0)", "background-image")', '"cross-fade(url(dummy://example.png), url(dummy://example.png), 1)"');
    4545
    4646debug('<h2>Mixed</h2>');
    4747
    48 shouldBe('testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png/), 25%), url(dummy://example.png), 50%)", "background-image")',
    49     '"-webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), url(dummy://example.png/), 0.5)"');
    50 shouldBe('testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), 50%)", "background-image")',
    51     '"-webkit-cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"');
    52 shouldBe('testCrossfade("background-image: cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 25%), 50%)", "background-image")',
    53         '"cross-fade(cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), -webkit-cross-fade(url(dummy://a.png/), url(dummy://b.png/), 0.25), 0.5)"');
     48shouldBe('testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), url(dummy://example.png), 50%)", "background-image")',
     49    '"-webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), url(dummy://example.png), 0.5)"');
     50shouldBe('testCrossfade("background-image: -webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image")',
     51    '"-webkit-cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"');
     52shouldBe('testCrossfade("background-image: cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 25%), 50%)", "background-image")',
     53        '"cross-fade(cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), -webkit-cross-fade(url(dummy://a.png), url(dummy://b.png), 0.25), 0.5)"');
    5454
    5555debug('<h2>Invalid values</h2>');
    5656
    57 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png/))", "background-image")', '"none"');
    58 shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png/), url(dummy://example.png),)", "background-image")', '"none"');
     57shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png))", "background-image")', '"none"');
     58shouldBe('testCrossfade("background-image: -webkit-cross-fade(url(dummy://example.png), url(dummy://example.png),)", "background-image")', '"none"');
    5959
    60 shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png/), url(dummy://example.png))", "background-image")', '"none"');
    61 shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png/),)", "background-image")', '"none"');
     60shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png))", "background-image")', '"none"');
     61shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png), url(dummy://example.png),)", "background-image")', '"none"');
    6262shouldBe('testCrossfade("background-image: cross-fade(url(dummy://example.png))", "background-image")', '"none"');
    6363shouldBe('testCrossfade("background-image: cross-fade(), url(dummy://example.png))", "background-image")', '"none"');
     
    6565shouldBe('testCrossfade("background-image: cross-fade(10px 20% 5px #bbb)", "background-image")', '"none"');
    6666shouldBe('testCrossfade("background-image: cross-fade(cross-fade(cross-fade()))", "background-image")', '"none"');
    67 shouldBe('testCrossfade("background-image: cross-fade(20%, url(dummy://a.png/), url(dummy://b.png/))", "background-image")', '"none"');
    68 shouldBe('testCrossfade("background-image: cross-fade(url(dummy://a.png/),)", "background-image")', '"none"');
     67shouldBe('testCrossfade("background-image: cross-fade(20%, url(dummy://a.png), url(dummy://b.png))", "background-image")', '"none"');
     68shouldBe('testCrossfade("background-image: cross-fade(url(dummy://a.png),)", "background-image")', '"none"');
    6969shouldBe('testCrossfade("background-image: cross-fade(,)", "background-image")', '"none"');
    70 shouldBe('testCrossfade("background-image: cross-fade(,url(dummy://a.png/))", "background-image")', '"none"');
     70shouldBe('testCrossfade("background-image: cross-fade(,url(dummy://a.png))", "background-image")', '"none"');
    7171shouldBe('testCrossfade("background-image: cross-fade(,,,,,)", "background-image")', '"none"');
    7272
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt

    r207162 r207321  
    2323PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    2424PASS checkComputedStyleValue() is true
    25 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / auto padding-box border-box'
     25PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto padding-box border-box'
    2626PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    27 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / auto padding-box border-box'
     27PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto padding-box border-box'
    2828PASS computedStyle.getPropertyCSSValue('background').length is 2
    2929PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    3232PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    3333PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    34 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     34PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    3535PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat'
    3636PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll'
     
    4242PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    4343PASS checkComputedStyleValue() is true
    44 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 0% 0% / auto padding-box border-box'
     44PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto padding-box border-box'
    4545PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    46 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 0% 0% / auto padding-box border-box'
     46PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto padding-box border-box'
    4747PASS computedStyle.getPropertyCSSValue('background').length is 2
    4848PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    5151PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    5252PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    53 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     53PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    5454PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    5555PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'scroll'
     
    6161PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    6262PASS checkComputedStyleValue() is true
    63 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 0% 0% / auto padding-box border-box'
     63PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto padding-box border-box'
    6464PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    65 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 0% 0% / auto padding-box border-box'
     65PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto padding-box border-box'
    6666PASS computedStyle.getPropertyCSSValue('background').length is 2
    6767PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    7070PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    7171PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    72 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     72PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    7373PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    7474PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     
    8080PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    8181PASS checkComputedStyleValue() is true
    82 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / auto padding-box border-box'
     82PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto padding-box border-box'
    8383PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    84 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / auto padding-box border-box'
     84PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto padding-box border-box'
    8585PASS computedStyle.getPropertyCSSValue('background').length is 2
    8686PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    8989PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    9090PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    91 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     91PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    9292PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    9393PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     
    9999PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    100100PASS checkComputedStyleValue() is true
    101 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover padding-box border-box'
     101PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover padding-box border-box'
    102102PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    103 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover padding-box border-box'
     103PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover padding-box border-box'
    104104PASS computedStyle.getPropertyCSSValue('background').length is 2
    105105PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    108108PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    109109PASS 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/'
     110PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    111111PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    112112PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     
    118118PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    119119PASS checkComputedStyleValue() is true
    120 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box border-box'
     120PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box border-box'
    121121PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    122 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box border-box'
     122PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box border-box'
    123123PASS computedStyle.getPropertyCSSValue('background').length is 2
    124124PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    127127PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    128128PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    129 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     129PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    130130PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    131131PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     
    137137PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'border-box'
    138138PASS checkComputedStyleValue() is true
    139 PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box padding-box'
     139PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box padding-box'
    140140PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    141 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box padding-box'
     141PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box padding-box'
    142142PASS computedStyle.getPropertyCSSValue('background').length is 2
    143143PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    146146PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    147147PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    148 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     148PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    149149PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'no-repeat'
    150150PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
     
    156156PASS computedStyle.getPropertyCSSValue('background').item(1).item(2).getStringValue() is 'padding-box'
    157157PASS checkComputedStyleValue() is true
    158 PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png/) repeat fixed 45% 50% / contain border-box padding-box'
     158PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain border-box padding-box'
    159159PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
    160 PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png/) repeat fixed 45% 50% / contain border-box padding-box'
     160PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain border-box padding-box'
    161161PASS computedStyle.getPropertyCSSValue('background').length is 2
    162162PASS computedStyle.getPropertyCSSValue('background').item(0).length is 5
     
    165165PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
    166166PASS computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
    167 PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png/'
     167PASS computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue() is 'dummy://test.png'
    168168PASS computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue() is 'repeat'
    169169PASS computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue() is 'fixed'
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html

    r207162 r207321  
    4848
    4949e.style.backgroundImage = "url(dummy://test.png)";
    50 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / auto padding-box border-box'");
    51 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    52 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) repeat scroll 0% 0% / auto padding-box border-box'");
    53 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    54 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    55 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    56 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    57 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    58 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    59 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     50shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto padding-box border-box'");
     51shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     52shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0% / auto padding-box border-box'");
     53shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     54shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     55shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     56shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     57shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     58shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     59shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    6060shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'");
    6161shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'");
     
    6969
    7070e.style.backgroundRepeat = "no-repeat";
    71 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 0% 0% / auto padding-box border-box'");
    72 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    73 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat scroll 0% 0% / auto padding-box border-box'");
    74 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    75 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    76 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    77 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    78 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    79 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    80 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     71shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto padding-box border-box'");
     72shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     73shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0% / auto padding-box border-box'");
     74shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     75shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     76shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     77shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     78shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     79shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     80shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    8181shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    8282shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'scroll'");
     
    9090
    9191e.style.backgroundAttachment = "fixed";
    92 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 0% 0% / auto padding-box border-box'");
    93 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    94 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 0% 0% / auto padding-box border-box'");
    95 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    96 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    97 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    98 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    99 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    100 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    101 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     92shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto padding-box border-box'");
     93shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     94shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0% / auto padding-box border-box'");
     95shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     96shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     97shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     98shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     99shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     100shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     101shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    102102shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    103103shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     
    111111
    112112e.style.backgroundPosition = "right bottom";
    113 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / auto padding-box border-box'");
    114 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    115 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / auto padding-box border-box'");
    116 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    117 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    118 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    119 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    120 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    121 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    122 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     113shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto padding-box border-box'");
     114shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     115shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / auto padding-box border-box'");
     116shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     117shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     118shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     119shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     120shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     121shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     122shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    123123shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    124124shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     
    132132
    133133e.style.backgroundSize = "cover";
    134 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover padding-box border-box'");
    135 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    136 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover padding-box border-box'");
    137 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    138 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    139 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    140 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    141 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    142 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    143 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     134shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover padding-box border-box'");
     135shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     136shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover padding-box border-box'");
     137shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     138shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     139shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     140shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     141shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     142shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     143shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    144144shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    145145shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     
    153153
    154154e.style.backgroundOrigin = "content-box";
    155 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box border-box'");
    156 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    157 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box border-box'");
    158 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    159 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    160 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    161 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    162 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    163 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    164 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     155shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box border-box'");
     156shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     157shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box border-box'");
     158shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     159shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     160shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     161shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     162shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     163shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     164shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    165165shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    166166shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     
    174174
    175175e.style.backgroundClip = "padding-box";
    176 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box padding-box'");
    177 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    178 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png/) no-repeat fixed 100% 100% / cover content-box padding-box'");
    179 shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    180 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
    181 shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
    182 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
    183 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    184 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    185 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     176shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box padding-box'");
     177shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     178shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100% / cover content-box padding-box'");
     179shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
     180shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     181shouldBe("computedStyle.getPropertyCSSValue('background').item(1).length", "3");
     182shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
     183shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     184shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
     185shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    186186shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'no-repeat'");
    187187shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
     
    194194shouldBe("checkComputedStyleValue()", "true");
    195195
    196 e.style.background = "border-box padding-box url(dummy://test.png/) green 45% / contain repeat fixed";
    197 shouldBe("computedStyle.getPropertyValue('background')", "'rgb(0, 128, 0) url(dummy://test.png/) repeat fixed 45% 50% / contain border-box padding-box'");
    198 shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
    199 shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png/) repeat fixed 45% 50% / contain border-box padding-box'");
     196e.style.background = "border-box padding-box url(dummy://test.png) green 45% / contain repeat fixed";
     197shouldBe("computedStyle.getPropertyValue('background')", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain border-box padding-box'");
     198shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
     199shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50% / contain border-box padding-box'");
    200200shouldBe("computedStyle.getPropertyCSSValue('background').length", "2");
    201201shouldBe("computedStyle.getPropertyCSSValue('background').item(0).length", "5");
     
    204204shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "128");
    205205shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
    206 shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png/'");
     206shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(1).getStringValue()", "'dummy://test.png'");
    207207shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(2).getStringValue()", "'repeat'");
    208208shouldBe("computedStyle.getPropertyCSSValue('background').item(0).item(3).getStringValue()", "'fixed'");
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-list-style-shorthand-expected.txt

    r207162 r207321  
    44
    55
    6 PASS computedStyle.getPropertyValue('list-style') is 'circle outside url(dummy://test.png/)'
     6PASS computedStyle.getPropertyValue('list-style') is 'circle outside url(dummy://test.png)'
    77PASS computedStyle.getPropertyCSSValue('list-style').toString() is '[object CSSValueList]'
    88PASS computedStyle.getPropertyCSSValue('list-style').length is 3
    9 PASS computedStyle.getPropertyCSSValue('list-style').cssText is 'circle outside url(dummy://test.png/)'
     9PASS computedStyle.getPropertyCSSValue('list-style').cssText is 'circle outside url(dummy://test.png)'
    1010PASS computedStyle.getPropertyCSSValue('list-style').item(0).getStringValue() is 'circle'
    1111PASS computedStyle.getPropertyCSSValue('list-style').item(1).getStringValue() is 'outside'
    12 PASS computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue() is 'dummy://test.png/'
     12PASS computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue() is 'dummy://test.png'
    1313PASS computedStyle.getPropertyValue('list-style') is 'disc outside none'
    1414PASS computedStyle.getPropertyCSSValue('list-style').toString() is '[object CSSValueList]'
     
    3232PASS computedStyle.getPropertyCSSValue('list-style').item(1).getStringValue() is 'outside'
    3333PASS computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue() is 'none'
    34 PASS computedStyle.getPropertyValue('list-style') is 'circle outside url(dummy://test.png/)'
     34PASS computedStyle.getPropertyValue('list-style') is 'circle outside url(dummy://test.png)'
    3535PASS computedStyle.getPropertyCSSValue('list-style').toString() is '[object CSSValueList]'
    3636PASS computedStyle.getPropertyCSSValue('list-style').length is 3
    37 PASS computedStyle.getPropertyCSSValue('list-style').cssText is 'circle outside url(dummy://test.png/)'
     37PASS computedStyle.getPropertyCSSValue('list-style').cssText is 'circle outside url(dummy://test.png)'
    3838PASS computedStyle.getPropertyCSSValue('list-style').item(0).getStringValue() is 'circle'
    3939PASS computedStyle.getPropertyCSSValue('list-style').item(1).getStringValue() is 'outside'
    40 PASS computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue() is 'dummy://test.png/'
     40PASS computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue() is 'dummy://test.png'
    4141PASS successfullyParsed is true
    4242
  • trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-list-style-shorthand.html

    r207162 r207321  
    2020
    2121e.style.listStyle = "circle outside url(dummy://test.png)";
    22 shouldBe("computedStyle.getPropertyValue('list-style')", "'circle outside url(dummy://test.png/)'");
     22shouldBe("computedStyle.getPropertyValue('list-style')", "'circle outside url(dummy://test.png)'");
    2323shouldBe("computedStyle.getPropertyCSSValue('list-style').toString()", "'[object CSSValueList]'");
    2424shouldBe("computedStyle.getPropertyCSSValue('list-style').length", "3");
    25 shouldBe("computedStyle.getPropertyCSSValue('list-style').cssText", "'circle outside url(dummy://test.png/)'");
     25shouldBe("computedStyle.getPropertyCSSValue('list-style').cssText", "'circle outside url(dummy://test.png)'");
    2626shouldBe("computedStyle.getPropertyCSSValue('list-style').item(0).getStringValue()", "'circle'");
    2727shouldBe("computedStyle.getPropertyCSSValue('list-style').item(1).getStringValue()", "'outside'");
    28 shouldBe("computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue()", "'dummy://test.png/'");
     28shouldBe("computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue()", "'dummy://test.png'");
    2929
    3030e.style.listStyle = ""
     
    6060e.style.listStylePosition = "outside";
    6161e.style.listStyleImage = "url(dummy://test.png)";
    62 shouldBe("computedStyle.getPropertyValue('list-style')", "'circle outside url(dummy://test.png/)'");
     62shouldBe("computedStyle.getPropertyValue('list-style')", "'circle outside url(dummy://test.png)'");
    6363shouldBe("computedStyle.getPropertyCSSValue('list-style').toString()", "'[object CSSValueList]'");
    6464shouldBe("computedStyle.getPropertyCSSValue('list-style').length", "3");
    65 shouldBe("computedStyle.getPropertyCSSValue('list-style').cssText", "'circle outside url(dummy://test.png/)'");
     65shouldBe("computedStyle.getPropertyCSSValue('list-style').cssText", "'circle outside url(dummy://test.png)'");
    6666shouldBe("computedStyle.getPropertyCSSValue('list-style').item(0).getStringValue()", "'circle'");
    6767shouldBe("computedStyle.getPropertyCSSValue('list-style').item(1).getStringValue()", "'outside'");
    68 shouldBe("computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue()", "'dummy://test.png/'");
     68shouldBe("computedStyle.getPropertyCSSValue('list-style').item(2).getStringValue()", "'dummy://test.png'");
    6969
    7070document.body.removeChild(testContainer);
  • trunk/LayoutTests/fast/loader/url-parse-1-expected.txt

    r207162 r207321  
    4242x-webkit:/test  x-webkit:/test          /test
    4343x-webkit://     x-webkit://             //
    44 x-webkit://test x-webkit://test/        test    /
     44x-webkit://test x-webkit://test test   
    4545x-webkit:///    x-webkit:///            ///
    4646x-webkit:///test        x-webkit:///test                ///test
  • trunk/LayoutTests/fast/url/host-lowercase-per-scheme-expected.txt

    r207162 r207321  
    2626PASS src is expected
    2727PASS src is expected
    28 FAIL src should be ghost://CamelCase/. Was ghost://camelcase/.
     28PASS src is expected
    2929FAIL src should be ghost://UnicodeF%C3%AAte/. Was ghost://xn--unicodefte-t7a/.
    3030PASS successfullyParsed is true
  • trunk/LayoutTests/fast/url/safari-extension-expected.txt

    r207162 r207321  
    66PASS src is expected
    77PASS src is expected
    8 FAIL src should be safari-extension://com.ApPlE/. Was safari-extension://com.apple/.
     8PASS src is expected
    99FAIL src should be safari-extension://com.f%C3%AAte/. Was safari-extension://com.xn--fte-fma/.
    1010PASS successfullyParsed is true
  • trunk/LayoutTests/http/tests/xmlhttprequest/access-control-and-redirects-async-expected.txt

    r207162 r207321  
    11CONSOLE MESSAGE: Cross-origin redirection to http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi denied by Cross-Origin Resource Sharing policy: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
    22CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi due to access control checks.
    3 CONSOLE MESSAGE: Cross-origin redirection to foo://bar.cgi/ denied by Cross-Origin Resource Sharing policy: URL is either a non-HTTP URL or contains credentials.
     3CONSOLE MESSAGE: Cross-origin redirection to foo://bar.cgi denied by Cross-Origin Resource Sharing policy: URL is either a non-HTTP URL or contains credentials.
    44CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?url=foo://bar.cgi&%20%20access-control-allow-origin=http://127.0.0.1:8000 due to access control checks.
    55CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/redirect-cors.php?redirect-preflight=true&%20%20url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi&%20%20access-control-allow-origin=*. Preflight response is not successful
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r207181 r207321  
     12016-10-13  Alex Christensen  <achristensen@webkit.org>
     2
     3        Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
     4        https://bugs.webkit.org/show_bug.cgi?id=163413
     5
     6        Reviewed by Tim Horton.
     7
     8        * web-platform-tests/url/url-setters-expected.txt:
     9        Update results.  Some more tests are failing, but if my proposal in https://github.com/whatwg/url/issues/148 is accepted,
     10        then these web platform tests will need to be changed.  These web platform tests were also failing with the old URL::parse.
     11
    1122016-10-11  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/url/url-setters-expected.txt

    r207162 r207321  
    11
    22PASS Loading data…
    3 PASS Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.
    4 PASS Setting <a://example.net>.protocol = 'b'
    5 PASS Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased
    6 PASS Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected
    7 PASS Setting <a://example.net>.protocol = '0b' No leading digit
    8 PASS Setting <a://example.net>.protocol = '+b' No leading punctuation
    9 PASS Setting <a://example.net>.protocol = 'bC0+-.'
    10 PASS Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable
    11 PASS Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected
     3FAIL Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged. assert_equals: expected "a://example.net/" but got "a://example.net"
     4FAIL Setting <a://example.net>.protocol = 'b' assert_equals: expected "b://example.net/" but got "b://example.net"
     5FAIL Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased assert_equals: expected "b://example.net/" but got "b://example.net"
     6FAIL Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected assert_equals: expected "a://example.net/" but got "a://example.net"
     7FAIL Setting <a://example.net>.protocol = '0b' No leading digit assert_equals: expected "a://example.net/" but got "a://example.net"
     8FAIL Setting <a://example.net>.protocol = '+b' No leading punctuation assert_equals: expected "a://example.net/" but got "a://example.net"
     9FAIL Setting <a://example.net>.protocol = 'bC0+-.' assert_equals: expected "bc0+-.://example.net/" but got "bc0+-.://example.net"
     10FAIL Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable assert_equals: expected "a://example.net/" but got "a://example.net"
     11FAIL Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected assert_equals: expected "a://example.net/" but got "a://example.net"
    1212FAIL Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104 assert_equals: expected "http://example.net/" but got "b://example.net/"
    1313FAIL Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must. assert_equals: expected "mailto:me@example.net" but got "http://me@example.net/"
     
    1717FAIL Setting <file:///home/you/index.html>.username = 'me' No host means no username assert_equals: expected "file:///home/you/index.html" but got "file://me@/home/you/index.html"
    1818FAIL Setting <unix:/run/foo.socket>.username = 'me' No host means no username assert_equals: expected "unix:/run/foo.socket" but got "unix://me@/run/foo.socket"
    19 FAIL Setting <mailto:you@example.net>.username = 'me' Cannot-be-a-base means no username assert_equals: expected "mailto:you@example.net" but got "mailto://me%40you@example.net/"
     19FAIL Setting <mailto:you@example.net>.username = 'me' Cannot-be-a-base means no username assert_equals: expected "mailto:you@example.net" but got "mailto://me%40you@example.net"
    2020PASS Setting <http://example.net>.username = 'me'
    2121PASS Setting <http://:secret@example.net>.username = 'me'
  • trunk/Source/WebCore/ChangeLog

    r207319 r207321  
     12016-10-13  Alex Christensen  <achristensen@webkit.org>
     2
     3        Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
     4        https://bugs.webkit.org/show_bug.cgi?id=163413
     5
     6        Reviewed by Tim Horton.
     7
     8        This retains compatibility with the canonicalization Chrome, Firefox, and Safari with uppercase characters
     9        in the hosts of URLs with unrecognized schemes.  Safari treats such characters as the host, while Firefox
     10        and Chrome treat such characters as part of the path, starting with the "//" after the ':'
     11        Behavior of non-ASCII characters is inconsistent, and since we need to have a host, we should punycode-encode
     12        the host to be consistent with special schemes because percent-encoding hosts sometimes is inconsistent.
     13       
     14        This solution was proposed to the spec in https://github.com/whatwg/url/issues/148
     15
     16        Covered by updated API and layout tests.
     17
     18        * platform/URLParser.cpp:
     19        (WebCore::URLParser::parse):
     20        (WebCore::URLParser::percentDecode):
     21        (WebCore::URLParser::domainToASCII):
     22        (WebCore::URLParser::hasInvalidDomainCharacter):
     23        (WebCore::URLParser::parseHostAndPort):
     24        (WebCore::URLParser::formURLDecode):
     25        (WebCore::percentDecode): Deleted.
     26        (WebCore::domainToASCII): Deleted.
     27        (WebCore::hasInvalidDomainCharacter): Deleted.
     28        (WebCore::formURLDecode): Deleted.
     29        * platform/URLParser.h:
     30
    1312016-10-13  Chris Dumez  <cdumez@apple.com>
    232
  • trunk/Source/WebCore/platform/URLParser.cpp

    r207305 r207321  
    18721872            return;
    18731873        } else {
    1874             syntaxViolation(c);
    1875             appendToASCIIBuffer('/');
    1876             m_url.m_pathEnd = m_url.m_portEnd + 1;
     1874            if (m_urlIsSpecial) {
     1875                syntaxViolation(c);
     1876                appendToASCIIBuffer('/');
     1877                m_url.m_pathEnd = m_url.m_portEnd + 1;
     1878            } else
     1879                m_url.m_pathEnd = m_url.m_portEnd;
    18771880        }
    18781881        m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
     
    18861889            return;
    18871890        }
    1888         syntaxViolation(c);
    1889         appendToASCIIBuffer('/');
    1890         m_url.m_pathEnd = m_url.m_portEnd + 1;
     1891        if (m_urlIsSpecial) {
     1892            syntaxViolation(c);
     1893            appendToASCIIBuffer('/');
     1894            m_url.m_pathEnd = m_url.m_portEnd + 1;
     1895        } else
     1896            m_url.m_pathEnd = m_url.m_portEnd;
    18911897        m_url.m_pathAfterLastSlash = m_url.m_pathEnd;
    18921898        m_url.m_queryEnd = m_url.m_pathEnd;
     
    24232429}
    24242430
    2425 const size_t defaultInlineBufferSize = 2048;
    2426 
    2427 static Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar* input, size_t length)
     2431template<typename CharacterType>
     2432Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const LChar* input, size_t length, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
     2433{
     2434    Vector<LChar, defaultInlineBufferSize> output;
     2435    output.reserveInitialCapacity(length);
     2436   
     2437    for (size_t i = 0; i < length; ++i) {
     2438        uint8_t byte = input[i];
     2439        if (byte != '%')
     2440            output.uncheckedAppend(byte);
     2441        else if (length > 2 && i < length - 2) {
     2442            if (isASCIIHexDigit(input[i + 1]) && isASCIIHexDigit(input[i + 2])) {
     2443                syntaxViolation(iteratorForSyntaxViolationPosition);
     2444                output.uncheckedAppend(toASCIIHexValue(input[i + 1], input[i + 2]));
     2445                i += 2;
     2446            } else
     2447                output.uncheckedAppend(byte);
     2448        } else
     2449            output.uncheckedAppend(byte);
     2450    }
     2451    return output;
     2452}
     2453   
     2454Vector<LChar, URLParser::defaultInlineBufferSize> URLParser::percentDecode(const LChar* input, size_t length)
    24282455{
    24292456    Vector<LChar, defaultInlineBufferSize> output;
     
    24532480}
    24542481
    2455 static Optional<Vector<LChar, defaultInlineBufferSize>> domainToASCII(const String& domain)
     2482template<typename CharacterType>
     2483Optional<Vector<LChar, URLParser::defaultInlineBufferSize>> URLParser::domainToASCII(const String& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
    24562484{
    24572485    Vector<LChar, defaultInlineBufferSize> ascii;
     
    24612489            const LChar* characters = domain.characters8();
    24622490            ascii.reserveInitialCapacity(length);
    2463             for (size_t i = 0; i < length; ++i)
    2464                 ascii.uncheckedAppend(toASCIILower(characters[i]));
     2491            if (m_urlIsSpecial) {
     2492                for (size_t i = 0; i < length; ++i) {
     2493                    if (UNLIKELY(isASCIIUpper(characters[i])))
     2494                        syntaxViolation(iteratorForSyntaxViolationPosition);
     2495                    ascii.uncheckedAppend(toASCIILower(characters[i]));
     2496                }
     2497            } else {
     2498                for (size_t i = 0; i < length; ++i)
     2499                    ascii.uncheckedAppend(characters[i]);
     2500            }
    24652501        } else {
    24662502            const UChar* characters = domain.characters16();
    24672503            ascii.reserveInitialCapacity(length);
    2468             for (size_t i = 0; i < length; ++i)
    2469                 ascii.uncheckedAppend(toASCIILower(characters[i]));
     2504            if (m_urlIsSpecial) {
     2505                for (size_t i = 0; i < length; ++i) {
     2506                    if (UNLIKELY(isASCIIUpper(characters[i])))
     2507                        syntaxViolation(iteratorForSyntaxViolationPosition);
     2508                    ascii.uncheckedAppend(toASCIILower(characters[i]));
     2509                }
     2510            } else {
     2511                for (size_t i = 0; i < length; ++i)
     2512                    ascii.uncheckedAppend(characters[i]);
     2513            }
    24702514        }
    24712515        return ascii;
     
    24922536        }
    24932537        ascii.append(hostnameBuffer, numCharactersConverted);
     2538        if (domain != StringView(ascii.data(), ascii.size()))
     2539            syntaxViolation(iteratorForSyntaxViolationPosition);
    24942540        return ascii;
    24952541    }
     
    24992545}
    25002546
    2501 static bool hasInvalidDomainCharacter(const Vector<LChar, defaultInlineBufferSize>& asciiDomain)
     2547bool URLParser::hasInvalidDomainCharacter(const Vector<LChar, URLParser::defaultInlineBufferSize>& asciiDomain)
    25022548{
    25032549    for (size_t i = 0; i < asciiDomain.size(); ++i) {
     
    26072653        for (; hostIterator != iterator; ++hostIterator) {
    26082654            if (LIKELY(!isTabOrNewline(*hostIterator))) {
    2609                 if (UNLIKELY(isASCIIUpper(*hostIterator)))
    2610                     syntaxViolation(hostIterator);
    2611                 appendToASCIIBuffer(toASCIILower(*hostIterator));
     2655                if (m_urlIsSpecial) {
     2656                    if (UNLIKELY(isASCIIUpper(*hostIterator)))
     2657                        syntaxViolation(hostIterator);
     2658                    appendToASCIIBuffer(toASCIILower(*hostIterator));
     2659                } else
     2660                    appendToASCIIBuffer(*hostIterator);
    26122661            } else
    26132662                syntaxViolation(hostIterator);
     
    26202669    }
    26212670   
    2622     syntaxViolation(iterator);
     2671    auto hostBegin = iterator;
    26232672   
    26242673    Vector<LChar, defaultInlineBufferSize> utf8Encoded;
    26252674    for (; !iterator.atEnd(); ++iterator) {
    2626         if (isTabOrNewline(*iterator))
     2675        if (UNLIKELY(isTabOrNewline(*iterator))) {
     2676            syntaxViolation(hostBegin);
    26272677            continue;
     2678        }
    26282679        if (*iterator == ':')
    26292680            break;
     2681        if (UNLIKELY(!isASCII(*iterator)))
     2682            syntaxViolation(hostBegin);
     2683
    26302684        uint8_t buffer[U8_MAX_LENGTH];
    26312685        int32_t offset = 0;
     
    26362690        utf8Encoded.append(buffer, offset);
    26372691    }
    2638     Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size());
     2692    Vector<LChar, defaultInlineBufferSize> percentDecoded = percentDecode(utf8Encoded.data(), utf8Encoded.size(), hostBegin);
    26392693    String domain = String::fromUTF8(percentDecoded.data(), percentDecoded.size());
    2640     auto asciiDomain = domainToASCII(domain);
     2694    if (domain != StringView(percentDecoded.data(), percentDecoded.size()))
     2695        syntaxViolation(hostBegin);
     2696    auto asciiDomain = domainToASCII(domain, hostBegin);
    26412697    if (!asciiDomain || hasInvalidDomainCharacter(asciiDomain.value()))
    26422698        return false;
     
    26622718}
    26632719
    2664 static Optional<String> formURLDecode(StringView input)
     2720Optional<String> URLParser::formURLDecode(StringView input)
    26652721{
    26662722    auto utf8 = input.utf8(StrictConversion);
  • trunk/Source/WebCore/platform/URLParser.h

    r207305 r207321  
    5858
    5959    bool m_didSeeSyntaxViolation { false };
     60    const static size_t defaultInlineBufferSize = 2048;
    6061
    6162    template<typename CharacterType> void parse(const CharacterType*, const unsigned length, const URL&, const TextEncoding&);
     
    8788    template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&);
    8889    template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&);
     90    template<typename CharacterType> Optional<Vector<LChar, defaultInlineBufferSize>> domainToASCII(const String&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
     91    template<typename CharacterType> Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
     92    static Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t);
     93    static Optional<String> formURLDecode(StringView input);
     94    static bool hasInvalidDomainCharacter(const Vector<LChar, defaultInlineBufferSize>&);
    8995    void percentEncodeByte(uint8_t);
    9096    void appendToASCIIBuffer(UChar32);
  • trunk/Tools/ChangeLog

    r207315 r207321  
     12016-10-13  Alex Christensen  <achristensen@webkit.org>
     2
     3        Hosts of URLs with non-special schemes should be case-sensitive, and non-ASCII characters in such hosts should be punycode-encoded
     4        https://bugs.webkit.org/show_bug.cgi?id=163413
     5
     6        Reviewed by Tim Horton.
     7
     8        * TestWebKitAPI/Tests/WebCore/URLParser.cpp:
     9        (TestWebKitAPI::TEST_F):
     10        Update parsing results.  There are now fewer differences between the new URLParser and the old URL::parse.
     11
    1122016-10-13  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp

    r207273 r207321  
    657657        {"notspecial", "", "", "example.org", 0, "/foo/:foo.com\\", "", "", "notspecial://example.org/foo/:foo.com\\"},
    658658        {"notspecial", "", "", "example.org", 0, "/foo/:foo.com/", "", "", "notspecial://example.org/foo/:foo.com/"});
    659     checkURLDifferences("sc://pa",
    660         {"sc", "", "", "pa", 0, "/", "", "", "sc://pa/"},
    661         {"sc", "", "", "pa", 0, "", "", "", "sc://pa"});
     659    checkURL("sc://pa", {"sc", "", "", "pa", 0, "", "", "", "sc://pa"});
    662660    checkRelativeURLDifferences("notspecial:\\\\foo.com\\", "http://example.org/foo/bar",
    663661        {"notspecial", "", "", "", 0, "\\\\foo.com\\", "", "", "notspecial:\\\\foo.com\\"},
     
    790788        {"", "", "", "", 0, "", "", "", "notspecial://@test@test@example:800/path@end"});
    791789    checkURLDifferences("notspecial://@test@test@example:800\\path@end",
    792         {"notspecial", "@test@test@example", "800\\path", "end", 0, "/", "", "", "notspecial://%40test%40test%40example:800%5Cpath@end/"},
     790        {"notspecial", "@test@test@example", "800\\path", "end", 0, "", "", "", "notspecial://%40test%40test%40example:800%5Cpath@end"},
    793791        {"", "", "", "", 0, "", "", "", "notspecial://@test@test@example:800\\path@end"});
    794792    checkURLDifferences("http://%48OsT",
     
    894892        {"http", "", "", "f", 10, "/c", "", "", "http://f:10/c"},
    895893        {"http", "", "", "f", 10, "/c", "", "", "http://f:010/c"});
    896     checkURLDifferences("notspecial://HoSt",
    897         {"notspecial", "", "", "host", 0, "/", "", "", "notspecial://host/"},
    898         {"notspecial", "", "", "HoSt", 0, "", "", "", "notspecial://HoSt"});
     894    checkURL("notspecial://HoSt", {"notspecial", "", "", "HoSt", 0, "", "", "", "notspecial://HoSt"});
     895    checkURLDifferences("notspecial://H%6FSt",
     896        {"notspecial", "", "", "HoSt", 0, "", "", "", "notspecial://HoSt"},
     897        {"notspecial", "", "", "H%6FSt", 0, "", "", "", "notspecial://H%6FSt"});
    899898    checkURLDifferences("notspecial://H%4fSt",
    900         {"notspecial", "", "", "host", 0, "/", "", "", "notspecial://host/"},
     899        {"notspecial", "", "", "HOSt", 0, "", "", "", "notspecial://HOSt"},
    901900        {"notspecial", "", "", "H%4fSt", 0, "", "", "", "notspecial://H%4fSt"});
    902     checkURLDifferences(utf16String(u"notspecial://H😍ßt"),
    903         {"notspecial", "", "", "xn--hsst-qc83c", 0, "/", "", "", "notspecial://xn--hsst-qc83c/"},
    904         {"notspecial", "", "", "xn--hsst-qc83c", 0, "", "", "", "notspecial://xn--hsst-qc83c"}, testTabsValueForSurrogatePairs);
     901    checkURL(utf16String(u"notspecial://H😍ßt"), {"notspecial", "", "", "xn--hsst-qc83c", 0, "", "", "", "notspecial://xn--hsst-qc83c"}, testTabsValueForSurrogatePairs);
    905902    checkURLDifferences("http://[ffff:aaaa:cccc:eeee:bbbb:dddd:255.255.255.255]/",
    906903        {"http", "", "", "[ffff:aaaa:cccc:eeee:bbbb:dddd:ffff:ffff]", 0, "/", "", "", "http://[ffff:aaaa:cccc:eeee:bbbb:dddd:ffff:ffff]/"},
     
    10471044        {"wss", "", "", "host", 444, "", "", "", "wss://host:444"});
    10481045
    1049     // 990 is the default ftps port in URL::parse, but it's not in the URL spec. Maybe it should be.
    10501046    checkURL("fTpS://host:990/", {"ftps", "", "", "host", 990, "/", "", "", "ftps://host:990/"});
    10511047    checkURL("ftps://host:990/", {"ftps", "", "", "host", 990, "/", "", "", "ftps://host:990/"});
    10521048    checkURL("ftps://host:991/", {"ftps", "", "", "host", 991, "/", "", "", "ftps://host:991/"});
    1053     checkURLDifferences("ftps://host:990",
    1054         {"ftps", "", "", "host", 990, "/", "", "", "ftps://host:990/"},
    1055         {"ftps", "", "", "host", 990, "", "", "", "ftps://host:990"});
    1056     checkURLDifferences("ftps://host:991",
    1057         {"ftps", "", "", "host", 991, "/", "", "", "ftps://host:991/"},
    1058         {"ftps", "", "", "host", 991, "", "", "", "ftps://host:991"});
     1049    checkURL("ftps://host:990", {"ftps", "", "", "host", 990, "", "", "", "ftps://host:990"});
     1050    checkURL("ftps://host:991", {"ftps", "", "", "host", 991, "", "", "", "ftps://host:991"});
    10591051
    10601052    checkURL("uNkNoWn://host:80/", {"unknown", "", "", "host", 80, "/", "", "", "unknown://host:80/"});
    10611053    checkURL("unknown://host:80/", {"unknown", "", "", "host", 80, "/", "", "", "unknown://host:80/"});
    10621054    checkURL("unknown://host:81/", {"unknown", "", "", "host", 81, "/", "", "", "unknown://host:81/"});
    1063     checkURLDifferences("unknown://host:80",
    1064         {"unknown", "", "", "host", 80, "/", "", "", "unknown://host:80/"},
    1065         {"unknown", "", "", "host", 80, "", "", "", "unknown://host:80"});
    1066     checkURLDifferences("unknown://host:81",
    1067         {"unknown", "", "", "host", 81, "/", "", "", "unknown://host:81/"},
    1068         {"unknown", "", "", "host", 81, "", "", "", "unknown://host:81"});
     1055    checkURL("unknown://host:80", {"unknown", "", "", "host", 80, "", "", "", "unknown://host:80"});
     1056    checkURL("unknown://host:81", {"unknown", "", "", "host", 81, "", "", "", "unknown://host:81"});
    10691057
    10701058    checkURL("file://host:0", {"file", "", "", "host", 0, "/", "", "", "file://host:0/"});
     
    11421130    shouldFail("http://[a:b:c:d:e:f:127.0.0.0x11]"); // Chrome treats this as hex, Firefox and the spec fail
    11431131    shouldFail("http://[a:b:c:d:e:f:127.0.-0.1]");
     1132    shouldFail("asdf://space InHost");
    11441133}
    11451134
     
    11491138    checkURL("about:\a\aabc", {"about", "", "", "", 0, "%07%07abc", "", "", "about:%07%07abc"});
    11501139    checkURL("notspecial:\t\t\n\t", {"notspecial", "", "", "", 0, "", "", "", "notspecial:"});
    1151     checkURLDifferences("notspecial\t\t\n\t:\t\t\n\t/\t\t\n\t/\t\t\n\thost",
    1152         {"notspecial", "", "", "host", 0, "/", "", "", "notspecial://host/"},
    1153         {"notspecial", "", "", "host", 0, "", "", "", "notspecial://host"});
     1140    checkURL("notspecial\t\t\n\t:\t\t\n\t/\t\t\n\t/\t\t\n\thost", {"notspecial", "", "", "host", 0, "", "", "", "notspecial://host"});
    11541141    checkRelativeURL("http:", "http://example.org/foo/bar?query#fragment", {"http", "", "", "example.org", 0, "/foo/bar", "query", "", "http://example.org/foo/bar?query"});
    11551142    checkRelativeURLDifferences("ws:", "http://example.org/foo/bar",
Note: See TracChangeset for help on using the changeset viewer.