author Tab Atkins Jr <jackalmage@gmail.com>
Tue, 05 Mar 2019 11:10:31 +0000
changeset 522405 73b5f322916e1c32d6e953912a615dabb6b6b32a
parent 522126 0883b91b63677b4ba5c44e6ec6dce2212a792f11
permissions -rw-r--r--
Bug 1527634 [wpt PR 15369] - Unclosed URL At EOF, a=testonly Automatic update from web-platform-tests Unclosed URL At EOF Verifies that a url() (specifically, one that parses to a `<url-token>`) that's unclosed at EOF is still valid. Also tests "empty" url(), because that was brought up as another source of divergence in the same issue. There's some disagreement on whether that's valid at all and how to represent it, so rather than take a stand, I just assert that it should parse the same as the closed version, whatever that is. Tests <https://github.com/w3c/csswg-drafts/issues/3598> -- Merge pull request #15369 from web-platform-tests/tabatkins-patch-1 Unclosed URL At EOF -- wpt-commits: b4f35dc6027f5e8776ac9c20f85031e0f1437233, 8dbed22314172d637582b63fc96e946e2e0dfff4 wpt-pr: 15369

<!doctype html>
<title>Unclosed URL At EOF</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<meta name=author title="Tab Atkins-Bittner">
<link rel=help href="https://drafts.csswg.org/css-syntax/#consume-url-token">

<div id=test1-control style="background-image:url(foo)"></div>
<div id=test1-experiment style="background-image:url(foo"></div>

<div id=test2-control style="background-image:url()"></div>
<div id=test2-experiment style="background-image:url("></div>


    const control = document.querySelector("#test1-control");
    const experiment = document.querySelector("#test1-experiment");
    assert_equals(control.style.backgroundImage, experiment.style.backgroundImage);
}, "Unclosed url token at EOF is valid.");

    const control = document.querySelector("#test2-control");
    const experiment = document.querySelector("#test2-experiment");
    assert_equals(control.style.backgroundImage, experiment.style.backgroundImage);
}, "Unclosed empty url token at EOF is valid.");