Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTMLButtonElement interface to custom element test #83

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

xiaoyu3x
Copy link
Contributor

All attributes use built-in way

@xiaoyu3x xiaoyu3x force-pushed the add-custom-element-button branch 6 times, most recently from cea39f6 to cef1df4 Compare March 21, 2018 01:15
<!DOCTYPE html>
<html>
<head>
<title>Custom Elements: CEReactions on Element interface</title>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Element/HTMLButtonElement/g

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Element has been replaced.

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html>
<head>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

head, html, body labels are unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Labels head and html have been omitted.

<body>
<script>

//IDL attribute reflects the content attribute of the same name inside the parent Node
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I can't understand the comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function name is tooooo long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name is cutted

<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>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove './'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'./' 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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your suggestion is good, I has updated.

parentElement.parentNode.removeChild(parentElement);
}

//Package JS attribute with parent Node to test
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has updated.

}

//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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

parentElement.parentNode.removeChild(parentElement);
}

//Package JS attribute depends another atrribute
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

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);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move following test function calls to the beginning of <script>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move function calls to the beginning of <script>

@@ -0,0 +1,112 @@
<!DOCTYPE html>
<title>Custom Elements: CEReactions on HTMLButtonElement interface</title>
<meta name="author" title="Zhang xiaoyu" href="[email protected]">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/xiaoyu/Xiaoyu

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has updated


//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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't update the function name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name has been updated

}

//Package refect attribute with parent Node
function testReAtWithPNode(jsAtName, coAtName, jsAtValue1, jsAtValue2, name, elementName, pElementName, interfaceName) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto


//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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto


test(() => {
var element = define_build_in_custom_element([coAtName], interfaceName, elementName);
var instance = document.createElement(elementName, { is: element.name});
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need whitespace after element.name

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check other {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whitespace has updated

}

//Package reflect attribute with dependent attribute
function testReAtWithDeAt(jsAtName, coAtName, deAtName, jsAtValue1, jsAtValue2, deAtValue, name, elementName, pElementName, interfaceName) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants