Revision 0c874a2e11885dc750902ae6c119f20affc6b49e authored by Matt Falkenhagen on 09 February 2018, 04:17:57 UTC, committed by Blink WPT Bot on 09 February 2018, 04:27:24 UTC
WebVTT loading code was determining if a response was cross-origin by looking
at request URL. But a service worker may have intercepted the request and
provided a response from cross-origin.

Bug: 808825
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: Ia121c0a8eae782de93d9777603426500a9709f8c
Reviewed-on: https://chromium-review.googlesource.com/907013
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535625}
1 parent e472f40
Raw File
Document-prototype-adoptNode.html
<!DOCTYPE html>
<html>
<head>
<title>DOM and Shadow DOM: Document.prototype.adoptNode</title>
<meta name="author" title="Ryosuke Niwa" href="mailto:rniwa@webkit.org">
<meta name="assert" content="The adoptNode(node) method must throw a HierarchyRequestError exception if node is a shadow root.">
<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-adoptnode">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>

function testAdoptNode(mode) {
    test(function () {
        var newDocument = document.implementation.createHTMLDocument();
        assert_throws({'name': 'HierarchyRequestError'}, function () {
            var element = document.createElement('div');
            var shadowRoot = element.attachShadow({mode: mode});
            newDocument.adoptNode(shadowRoot);
        });
    }, 'adoptNode on a shadow root in ' + mode + ' mode must throw a HierarchyRequestError');
}

testAdoptNode('open');
testAdoptNode('closed');

</script>
</body>
</html>
back to top