<!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="../../resources/js-test-pre.js"></script>
<style>
#test-root * {
    background-color: red;
}
</style>
<style id="style">
</style>
</head>
<body>
    <div style="display:none" id="test-root">
        <div data-attribute="Web-É-Kit" multiple="WEB-é-KIT" id="target1"></div>
        <div data-attribute="web-É-kit" multiple="Web-é-Kit" id="target2"></div>
        <div data-attribute="WEB-É-KIT" multiple="Web-é-kit" id="target3"></div>
        <div data-attribute="Web-é-Kit" multiple="web-É-kit" id="target4"></div>
        <div data-attribute="web-é-kit" multiple="web-É-Kit" id="target5"></div>
    </div>
</body>
<script>
description('When matching attributes case insensitively, it should be ASCII case insensitive. This test verifies the behavior when matching the start of the values (e.g. [a^="b"])');

function testQuerySelector(selector, expectedIds) {
    shouldBe("document.querySelectorAll('" + selector + "').length", '' + expectedIds.length);
    for (var i = 0; i < expectedIds.length; ++i)
        shouldBeEqualToString("document.querySelectorAll('" + selector + "')[" + i + "].id", 'target' + expectedIds[i]);
}

function testStyling(selector, expectedIds) {
    var stylingElement = document.getElementById("style");
    stylingElement.innerHTML = '' + selector + ' { background-color: rgb(10, 100, 200); }';

    var allTestCases = document.querySelectorAll("#test-root *");
    for (var i = 0; i < allTestCases.length; ++i) {
        var expectMatch = expectedIds.indexOf(parseInt(allTestCases[i].id.replace('target', ''))) >= 0;
        shouldBeEqualToString('getComputedStyle(document.querySelectorAll("#test-root *")[' + i + ']).backgroundColor', expectMatch ? 'rgb(10, 100, 200)' : 'rgb(255, 0, 0)');
    }

    stylingElement.innerHTML = '';
}

function testSelector(selector, expectedIds) {
    debug("Testing \"" + selector + "\"");
    testQuerySelector("#test-root " + selector, expectedIds);
    testStyling("#test-root " + selector, expectedIds);
    debug("");
}

var testCases = [
    // Regular attribute matching is case sensitive.
    ['[data-attribute^=Web-É-Kit]', [1]],
    ['[data-attribute^=Web-É]', [1]],

    ['[data-attribute^=web-É-kit]', [2]],
    ['[data-attribute^=web-É]', [2]],

    ['[data-attribute^=WEB-É-KIT]', [3]],
    ['[data-attribute^=WEB-É]', [3]],

    ['[data-attribute^=Web-é-Kit]', [4]],
    ['[data-attribute^=Web-é]', [4]],

    ['[data-attribute^=web-é-kit]', [5]],
    ['[data-attribute^=web-é]', [5]],

    // Same selectors with the case-insensitive flag.
    ['[data-attribute^=Web-É-Kit i]', [1, 2, 3]],
    ['[data-attribute^=Web-É i]', [1, 2, 3]],

    ['[data-attribute^=web-É-kit i]', [1, 2, 3]],
    ['[data-attribute^=web-É i]', [1, 2, 3]],

    ['[data-attribute^=WEB-É-KIT i]', [1, 2, 3]],
    ['[data-attribute^=WEB-É i]', [1, 2, 3]],

    ['[data-attribute^=Web-é-Kit i]', [4, 5]],
    ['[data-attribute^=Web-é i]', [4, 5]],

    ['[data-attribute^=web-é-kit i]', [4, 5]],
    ['[data-attribute^=web-é i]', [4, 5]],

    // "multiple" is one of those weird legacy exception: it is always case insensitive in HTML.
    ['[multiple^=WEB-é-KIT]', [1, 2, 3]],
    ['[multiple^=WEB-é]', [1, 2, 3]],

    ['[multiple^=Web-é-Kit]', [1, 2, 3]],
    ['[multiple^=Web-é]', [1, 2, 3]],

    ['[multiple^=Web-é-kit]', [1, 2, 3]],
    ['[multiple^=Web-é]', [1, 2, 3]],

    ['[multiple^=web-É-kit]', [4, 5]],
    ['[multiple^=web-É]', [4, 5]],

    ['[multiple^=web-É-Kit]', [4, 5]],
    ['[multiple^=web-É]', [4, 5]],

    ['[multiple^=WEB-é-KIT i]', [1, 2, 3]],
    ['[multiple^=WEB-é i]', [1, 2, 3]],

    ['[multiple^=Web-é-Kit i]', [1, 2, 3]],
    ['[multiple^=Web-é i]', [1, 2, 3]],

    ['[multiple^=Web-é-kit i]', [1, 2, 3]],
    ['[multiple^=Web-é i]', [1, 2, 3]],

    ['[multiple^=web-É-kit i]', [4, 5]],
    ['[multiple^=web-É i]', [4, 5]],

    ['[multiple^=web-É-Kit i]', [4, 5]],
    ['[multiple^=web-É i]', [4, 5]],
];

for (var testCase of testCases) {
    testSelector(testCase[0], testCase[1]);
}
</script>
<script src="../../resources/js-test-post.js"></script>
</html>
