| Index: third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html
|
| diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html
|
| index bc2483875d016ef2e60f3c193b58531efd0e34c7..2d437d2a34ca2f7d78151c244c2c1b7f9e37edce 100644
|
| --- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html
|
| +++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/shadow-dom/untriaged/html-elements-in-shadow-trees/html-forms/test-003.html
|
| @@ -12,47 +12,47 @@ policies and contribution forms [3].
|
| <head>
|
| <title>Shadow DOM Test: A_08_02_03</title>
|
| <link rel="author" title="Sergey G. Grekhov" href="mailto:sgrekhov@unipro.ru">
|
| -<link rel="help" href="http://www.w3.org/TR/2013/WD-shadow-dom-20130514/#inert-html-elements">
|
| -<meta name="assert" content="HTML Elements in shadow trees: form should submit elements in shadow tree">
|
| +<link rel="help" href="https://w3c.github.io/webcomponents/spec/shadow/#inertness-of-html-elements-in-a-shadow-tree">
|
| +<meta name="assert" content="HTML Elements in shadow trees: form should not submit elements in shadow tree">
|
| <script src="../../../../../../resources/testharness.js"></script>
|
| <script src="../../../../../../resources/testharnessreport.js"></script>
|
| -<script src="../../testcommon.js"></script>
|
| +<script src="../../../../html/resources/common.js"></script>
|
| </head>
|
| <body>
|
| <div id="log"></div>
|
| <script>
|
| var A_08_02_03_T01 = async_test('A_08_02_03_T01', { timeout: 5000 });
|
|
|
| -A_08_02_03_T01.checkIframeContent = A_08_02_03_T01.step_func(function () {
|
| - //remember value to check before cleaning the context (it'll destroy the iframe)
|
| - var valueToCheck = A_08_02_03_T01.iframe.contentWindow.document.URL;
|
| - cleanContext(A_08_02_03_T01.ctx);
|
| +var checkIframeContent = A_08_02_03_T01.step_func(function () {
|
| + // remember value to check before cleaning the context (it'll destroy the iframe)
|
| + var valueToCheck = A_08_02_03_T01.iframe.contentWindow.document.URL;
|
| + cleanContext(A_08_02_03_T01.ctx);
|
|
|
| - assert_true(valueToCheck.indexOf('inp1=value1') > 0,
|
| - 'html form should submit all of its fields');
|
| + assert_true(valueToCheck.indexOf('inp1=value1') > 0,
|
| + 'html form should submit all of its fields');
|
|
|
| - // Expected behavior is not quite clear. See https://www.w3.org/Bugs/Public/show_bug.cgi?id=20320
|
| - assert_true(valueToCheck.indexOf('inp2=value2') > 0,
|
| - 'html form should submit all of its fields including the shadow ones');
|
| + // Form data crossing shadow boundary should not be submitted.
|
| + // https://github.com/w3c/webcomponents/issues/65
|
| + assert_equals(valueToCheck.indexOf('inp2=value2'), -1,
|
| + 'html form should not submit fields in the shadow tree');
|
|
|
| - A_08_02_03_T01.done();
|
| + A_08_02_03_T01.done();
|
| });
|
|
|
|
|
| A_08_02_03_T01.step(function () {
|
|
|
| - A_08_02_03_T01.ctx = newContext();
|
| + A_08_02_03_T01.ctx = newContext();
|
| var d = newRenderedHTMLDocument(A_08_02_03_T01.ctx);
|
|
|
| //create iframe
|
| var iframe = document.createElement('iframe');
|
| + A_08_02_03_T01.iframe = iframe;
|
|
|
| iframe.src = '../../resources/blank.html';
|
| iframe.setAttribute('name', 'targetIframe');
|
| d.body.appendChild(iframe);
|
|
|
| - A_08_02_03_T01.iframe = iframe;
|
| -
|
| // create form
|
| var form = d.createElement('form');
|
| form.setAttribute('target', 'targetIframe');
|
| @@ -60,11 +60,10 @@ A_08_02_03_T01.step(function () {
|
| form.setAttribute('action', '../../resources/blank.html');
|
| d.body.appendChild(form);
|
|
|
| - //create Shadow root
|
| + // create shadow root
|
| var root = d.createElement('div');
|
| form.appendChild(root);
|
| - var s = root.createShadowRoot();
|
| -
|
| + var s = root.attachShadow({mode: 'open'});
|
|
|
| var input1 = d.createElement('input');
|
| input1.setAttribute('type', 'text');
|
| @@ -78,11 +77,11 @@ A_08_02_03_T01.step(function () {
|
| input2.setAttribute('value', 'value2');
|
| s.appendChild(input2);
|
|
|
| - //submit the form
|
| + // submit the form
|
| form.submit();
|
|
|
| // set timeout to give the iframe time to load content
|
| - setTimeout('A_08_02_03_T01.checkIframeContent()', 2000);
|
| + setTimeout(checkIframeContent, 2000);
|
| });
|
| </script>
|
| </body>
|
|
|