Add HTMLButtonElement interface to custom element test#83
Conversation
cea39f6 to
cef1df4
Compare
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Custom Elements: CEReactions on Element interface</title> |
There was a problem hiding this comment.
Element has been replaced.
| @@ -0,0 +1,114 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
There was a problem hiding this comment.
head, html, body labels are unnecessary.
There was a problem hiding this comment.
Labels head and html have been omitted.
| <body> | ||
| <script> | ||
|
|
||
| //IDL attribute reflects the content attribute of the same name inside the parent Node |
There was a problem hiding this comment.
Actually I can't understand the comments.
There was a problem hiding this comment.
Notes are updated.
| } | ||
|
|
||
| //IDL attribute reflects the content attribute of the same name which depends another attribute inside the parent Node | ||
| function testReflectAttributeWithDepAttributeWithContentValues(subJsAttrName, subConAttrName, depAttrName, subJsAttrValue1, subConAttrValue1, subJsAttrValue2, subConAttrValue2, depAttrValue, name, subElementName, pareElementName, interfaceName) { |
There was a problem hiding this comment.
The name is cutted
cef1df4 to
58fba0d
Compare
| <script src="/tests/custom-elements/resources/testharness.js"></script> | ||
| <script src="/tests/custom-elements/resources/testharnessreport.js"></script> | ||
| <script src="./custom-elements-helpers.js"></script> | ||
| <script src="./reactions.js"></script> |
There was a problem hiding this comment.
'./' has been removed.
|
|
||
| //In parent node, sub node's observeAttribute can enqueue by changing attribute value | ||
| //Re->reflect, At->attribute, P->parent, Co->content | ||
| function testReAtWithPNodeWithCoValues(jsAtName, coAtName, jsAtValue1, coAtValue1, jsAtValue2, coAtValue2, name, elementName, pElementName, interfaceName) { |
There was a problem hiding this comment.
How about testReflectAttrWithContentValuesAndPNode? And replace the second line of comment with "Test reflect attribute with content values and parent node", not sure if I am right.
There was a problem hiding this comment.
Your suggestion is good, I has updated.
| parentElement.parentNode.removeChild(parentElement); | ||
| } | ||
|
|
||
| //Package JS attribute with parent Node to test |
| } | ||
|
|
||
| //In parent node, sub node's observeAttribute which depends another attribute can enqueue by changing attribute value | ||
| //Re->reflect, At->attribute, De->depdent, Co->content |
| parentElement.parentNode.removeChild(parentElement); | ||
| } | ||
|
|
||
| //Package JS attribute depends another atrribute |
| testReAtWithDeAtWithCoValues(jsAtName, coAtName, deAtName, jsAtValue1, jsAtValue1, jsAtValue2, jsAtValue2, deAtValue, name, elementName, pElementName, interfaceName); | ||
| } | ||
|
|
||
| testReflectAttributeWithContentValues('autofocus', 'autofocus', true, 'true', false, 'false', 'autofocus on HTMLButtonElement', 'button', HTMLButtonElement); |
There was a problem hiding this comment.
move following test function calls to the beginning of <script>
There was a problem hiding this comment.
Move function calls to the beginning of <script>
58fba0d to
56efcb3
Compare
| @@ -0,0 +1,112 @@ | |||
| <!DOCTYPE html> | |||
| <title>Custom Elements: CEReactions on HTMLButtonElement interface</title> | |||
| <meta name="author" title="Zhang xiaoyu" href="xiaoyux.zhang@intel.com"> | |||
|
|
||
| //In parent node, sub node's observeAttribute can enqueue by changing attribute value | ||
| //Test reflect attribute with content values and parent node | ||
| function testReAtWithPNodeWithCoValues(jsAtName, coAtName, jsAtValue1, coAtValue1, jsAtValue2, coAtValue2, name, elementName, pElementName, interfaceName) { |
There was a problem hiding this comment.
You didn't update the function name.
There was a problem hiding this comment.
The function name has been updated
| } | ||
|
|
||
| //Package refect attribute with parent Node | ||
| function testReAtWithPNode(jsAtName, coAtName, jsAtValue1, jsAtValue2, name, elementName, pElementName, interfaceName) { |
|
|
||
| //In parent node, sub node's observeAttribute which depends another attribute can enqueue by changing attribute value | ||
| //Test reflect attribute with content values and dependent attribute | ||
| function testReAtWithDeAtWithCoValues(jsAtName, coAtName, deAtName, jsAtValue1, coAtValue1, jsAtValue2, coAtValue2, deAtValue, name, elementName, pElementName, interfaceName) { |
|
|
||
| test(() => { | ||
| var element = define_build_in_custom_element([coAtName], interfaceName, elementName); | ||
| var instance = document.createElement(elementName, { is: element.name}); |
There was a problem hiding this comment.
need whitespace after element.name
There was a problem hiding this comment.
Whitespace has updated
| } | ||
|
|
||
| //Package reflect attribute with dependent attribute | ||
| function testReAtWithDeAt(jsAtName, coAtName, deAtName, jsAtValue1, jsAtValue2, deAtValue, name, elementName, pElementName, interfaceName) { |
56efcb3 to
a6176f6
Compare
All attributes use built-in way