| Index: third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html
|
| diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html b/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html
|
| index 9b5b1ddec34e801d8833681138e6f961d8ca8997..8f23a53edabf58baa2d927b2cd9c1a15d4b407a6 100644
|
| --- a/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html
|
| +++ b/third_party/WebKit/LayoutTests/custom-elements/spec/parsing.html
|
| @@ -67,7 +67,44 @@ test_with_content((w) => {
|
| ['constructor', 'x="y"', 'connected', 'script']);
|
| });
|
| </script>
|
| +<!-- TODO: the test pass now due to the elements upgrade.
|
| + Creating synchronously built-in elements still needs to be implemented."
|
| +-->
|
| +<template data-test="the parser synchronously creates built-in elements">
|
| + <script>
|
| + 'use strict';
|
|
|
| + window.invocations = [];
|
| + customElements.define('d-d', class extends HTMLDivElement {
|
| + constructor() {
|
| + super();
|
| + invocations.push('constructor');
|
| + }
|
| + static get observedAttributes() { return ['is']; }
|
| + attributeChangedCallback(name, oldValue, newValue, nsuri) {
|
| + invocations.push(`${name}="${newValue}"`);
|
| + }
|
| + connectedCallback() {
|
| + invocations.push('connected');
|
| + }
|
| + }, {extends: 'div'});
|
| + </script>
|
| + <div is="d-d">
|
| + <script>
|
| + 'use strict';
|
| +
|
| + invocations.push('script');
|
| + </script>
|
| + </div>
|
| +</template>
|
| +<script>
|
| +'use strict';
|
| +
|
| +test_with_content((w) => {
|
| + assert_array_equals(w.invocations,
|
| + ['constructor', 'is="d-d"', 'connected', 'script']);
|
| +});
|
| +</script>
|
| <template data-test="foreign content insertion executes connected">
|
| <script>
|
| 'use strict';
|
| @@ -330,3 +367,36 @@ test_with_content((w) => {
|
| 'the second element should be un-upgraded, not failed');
|
| });
|
| </script>
|
| +
|
| +<template data-test="parsing upgrades the built-in element">
|
| + <div is="d-d"></div>
|
| + <script>
|
| + 'use strict';
|
| +
|
| + window.invocations = [];
|
| + customElements.define('d-d', class extends HTMLDivElement {
|
| + constructor() {
|
| + super();
|
| + invocations.push('constructor');
|
| + }
|
| + static get observedAttributes() { return ['is']; }
|
| + attributeChangedCallback(name, oldValue, newValue, nsuri) {
|
| + invocations.push(`${name}="${newValue}"`);
|
| + }
|
| + connectedCallback() {
|
| + invocations.push('connected');
|
| + }
|
| + }, {extends: 'div'});
|
| + </script>
|
| +</template>
|
| +<script>
|
| +'use strict';
|
| +
|
| +test_with_content((w) => {
|
| + assert_array_equals(
|
| + w.invocations,
|
| + ['constructor', 'is="d-d"', 'connected'],
|
| + 'the built-in element should be upgraded');
|
| +});
|
| +</script>
|
| +
|
|
|