diff --git a/src/ecmascript/ecmascript.c b/src/ecmascript/ecmascript.c index 90f0f90c..d1083c26 100644 --- a/src/ecmascript/ecmascript.c +++ b/src/ecmascript/ecmascript.c @@ -275,7 +275,7 @@ check_for_rerender(struct ecmascript_interpreter *interpreter, const char* text) #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s %s %d\n", __FILE__, __FUNCTION__, text, interpreter->changed); #endif - if (interpreter->changed) { + if (interpreter->changed && !get_cmd_opt_bool("test")) { struct document_view *doc_view = interpreter->vs->doc_view; struct document *document = doc_view->document; struct session *ses = doc_view->session; diff --git a/test/ecmascript/console.assert.html b/test/ecmascript/assert/console.assert.html similarity index 77% rename from test/ecmascript/console.assert.html rename to test/ecmascript/assert/console.assert.html index 6cc00b38..d8d09d78 100644 --- a/test/ecmascript/console.assert.html +++ b/test/ecmascript/assert/console.assert.html @@ -1,4 +1,5 @@ + + + diff --git a/test/ecmascript/assert/document.baseURI.html b/test/ecmascript/assert/document.baseURI.html new file mode 100644 index 00000000..9362e202 --- /dev/null +++ b/test/ecmascript/assert/document.baseURI.html @@ -0,0 +1,19 @@ + + + +

Click the button to display the base URI of the document.

+ +

Note: The baseURI property is not supported in Internet Explorer.

+

+ + + \ No newline at end of file diff --git a/test/ecmascript/assert/document.body.childNodes.html b/test/ecmascript/assert/document.body.childNodes.html new file mode 100644 index 00000000..68ac719e --- /dev/null +++ b/test/ecmascript/assert/document.body.childNodes.html @@ -0,0 +1,32 @@ + + + + +

Click the button get info about the body element's child nodes.

+ + + +

Note: Whitespace inside elements is considered as text, and text +is considered as nodes. Comments are also considered as nodes.

+ +

+ + + + + diff --git a/test/ecmascript/assert/document.body.children.html b/test/ecmascript/assert/document.body.children.html new file mode 100644 index 00000000..83322859 --- /dev/null +++ b/test/ecmascript/assert/document.body.children.html @@ -0,0 +1,30 @@ + + + + +

Click the button to get the tag names of the body element's children.

+ + + +

+ + + + + \ No newline at end of file diff --git a/test/ecmascript/assert/document.body.id.html b/test/ecmascript/assert/document.body.id.html new file mode 100644 index 00000000..764ab422 --- /dev/null +++ b/test/ecmascript/assert/document.body.id.html @@ -0,0 +1,24 @@ + + + + + + +/ +/home + +

+ + + + + diff --git a/test/ecmascript/assert/document.characterSet.html b/test/ecmascript/assert/document.characterSet.html new file mode 100644 index 00000000..12803ad0 --- /dev/null +++ b/test/ecmascript/assert/document.characterSet.html @@ -0,0 +1,25 @@ + + + + +

Click the button to check the encoding of this document.

+ + + +

Note: Internet Explorer 8 and earlier does not support the characterSet property.

+ +

+ + + + + diff --git a/test/ecmascript/assert/document.doctype.html b/test/ecmascript/assert/document.doctype.html new file mode 100644 index 00000000..befb38bc --- /dev/null +++ b/test/ecmascript/assert/document.doctype.html @@ -0,0 +1,25 @@ + + + + +

Click the button to display the doctype name of the document.

+ + + +

Note: In Internet Explorer 8 and earlier, the doctype property returns null for HTML and XHTML documents, and will only work for XML documents.

+ +

+ + + + + diff --git a/test/ecmascript/assert/document.documentElement.html b/test/ecmascript/assert/document.documentElement.html new file mode 100644 index 00000000..2256c109 --- /dev/null +++ b/test/ecmascript/assert/document.documentElement.html @@ -0,0 +1,24 @@ + + + + + + +/ +/home + +

+ + + + + diff --git a/test/ecmascript/assert/document.documentURI.html b/test/ecmascript/assert/document.documentURI.html new file mode 100644 index 00000000..239f6a31 --- /dev/null +++ b/test/ecmascript/assert/document.documentURI.html @@ -0,0 +1,19 @@ + + + +

Click the button to display the location of this document

+

Note: Internet Explorer does not support the documentURI property.

+ +

+ + + \ No newline at end of file diff --git a/test/ecmascript/assert/document.domain.html b/test/ecmascript/assert/document.domain.html new file mode 100644 index 00000000..d5bc5c40 --- /dev/null +++ b/test/ecmascript/assert/document.domain.html @@ -0,0 +1,23 @@ + + + + +

Click the button to display the domain name of the server that loaded this document.

+ + + +

+ + + + + \ No newline at end of file diff --git a/test/ecmascript/assert/document.getElementsByClassName.html b/test/ecmascript/assert/document.getElementsByClassName.html new file mode 100644 index 00000000..e4138de9 --- /dev/null +++ b/test/ecmascript/assert/document.getElementsByClassName.html @@ -0,0 +1,26 @@ + + + + +First Name:
+First Name: + +

Click the button to get the tag name of the first element in the document that has a name attribute with the value "fname".

+ + + +

+ + + + + diff --git a/test/ecmascript/assert/document.getElementsByName.html b/test/ecmascript/assert/document.getElementsByName.html new file mode 100644 index 00000000..c9048398 --- /dev/null +++ b/test/ecmascript/assert/document.getElementsByName.html @@ -0,0 +1,26 @@ + + + + +First Name:
+First Name: + +

Click the button to get the tag name of the first element in the document that has a name attribute with the value "fname".

+ + + +

+ + + + + diff --git a/test/ecmascript/assert/document.getElementsByTagName.html b/test/ecmascript/assert/document.getElementsByTagName.html new file mode 100644 index 00000000..9c513ccf --- /dev/null +++ b/test/ecmascript/assert/document.getElementsByTagName.html @@ -0,0 +1,26 @@ + + + + +First Name:
+First Name: + +

Click the button to get the tag name of the first element in the document that has a name attribute with the value "fname".

+ + + +

+ + + + + diff --git a/test/ecmascript/assert/document.head.html b/test/ecmascript/assert/document.head.html new file mode 100644 index 00000000..8c405e7e --- /dev/null +++ b/test/ecmascript/assert/document.head.html @@ -0,0 +1,25 @@ + + +HEAD + + + + +/ +/home + +

+ + + + + diff --git a/test/ecmascript/assert/document.images.html b/test/ecmascript/assert/document.images.html new file mode 100644 index 00000000..284286aa --- /dev/null +++ b/test/ecmascript/assert/document.images.html @@ -0,0 +1,26 @@ + + + + + + +/ +/home + + + +

+ + + + + diff --git a/test/ecmascript/assert/document.links.html b/test/ecmascript/assert/document.links.html new file mode 100644 index 00000000..f63e0ed1 --- /dev/null +++ b/test/ecmascript/assert/document.links.html @@ -0,0 +1,38 @@ + + + + +First Name:
+First Name: + +

Click the button to get the tag name of the first element in the document that has a name attribute with the value "fname".

+ + + + +Planets + + + Sun + Mercury + Venus + + +/ +/home + +

+ + + + + diff --git a/test/ecmascript/assert/element.appendChild.html b/test/ecmascript/assert/element.appendChild.html new file mode 100644 index 00000000..9e4b4abb --- /dev/null +++ b/test/ecmascript/assert/element.appendChild.html @@ -0,0 +1,30 @@ + + + + + + +

Click the button to append an item to the end of the list.

+ + + + +

Note:
First create an LI node,
then create a Text node,
then append the Text node to the LI node.
Finally append the LI node to the list.

+ + + + diff --git a/test/ecmascript/assert/element.attributes.html b/test/ecmascript/assert/element.attributes.html new file mode 100644 index 00000000..713f3e27 --- /dev/null +++ b/test/ecmascript/assert/element.attributes.html @@ -0,0 +1,26 @@ + + + + +

Click the button to get the value of the onclick attribute of the button element.

+ + + +

Note: Internet Explorer 8 and earlier does not support the getNamedItem method.

+ +

+ + + + + diff --git a/test/ecmascript/assert/element.checked.html b/test/ecmascript/assert/element.checked.html new file mode 100644 index 00000000..1ee4378e --- /dev/null +++ b/test/ecmascript/assert/element.checked.html @@ -0,0 +1,31 @@ + + + + +

The input checked attribute

+ +
+ +
+ +
+ +

+ +
+ + + + + + + diff --git a/test/ecmascript/assert/element.childElementCount.html b/test/ecmascript/assert/element.childElementCount.html new file mode 100644 index 00000000..79256e09 --- /dev/null +++ b/test/ecmascript/assert/element.childElementCount.html @@ -0,0 +1,24 @@ + + +AAAUUU + + + + + + diff --git a/test/ecmascript/assert/element.className.html b/test/ecmascript/assert/element.className.html new file mode 100644 index 00000000..33a2a396 --- /dev/null +++ b/test/ecmascript/assert/element.className.html @@ -0,0 +1,29 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.cloneNode.html b/test/ecmascript/assert/element.cloneNode.html new file mode 100644 index 00000000..f26c3119 --- /dev/null +++ b/test/ecmascript/assert/element.cloneNode.html @@ -0,0 +1,29 @@ + + + + + + + +

Click the button to copy an item from one list to another.

+ + + +

Try changing the deep parameter to false, and only an empty LI element will be cloned.

+ + + + + \ No newline at end of file diff --git a/test/ecmascript/assert/element.closest.html b/test/ecmascript/assert/element.closest.html new file mode 100644 index 00000000..94e78426 --- /dev/null +++ b/test/ecmascript/assert/element.closest.html @@ -0,0 +1,21 @@ + + + + +
Grandparent +
Parent +
The outer HTML of closest element will be shown.
+
+
+ + + + + diff --git a/test/ecmascript/assert/element.contains.html b/test/ecmascript/assert/element.contains.html new file mode 100644 index 00000000..ce68554c --- /dev/null +++ b/test/ecmascript/assert/element.contains.html @@ -0,0 +1,39 @@ + + + + + + + +
+

I am a p element inside div, and I have a span element inside of me.

+
+ +span +

Click the button to find out if the div element contains a span element.

+ + + +

+ + + + + diff --git a/test/ecmascript/assert/element.dir.html b/test/ecmascript/assert/element.dir.html new file mode 100644 index 00000000..1904c345 --- /dev/null +++ b/test/ecmascript/assert/element.dir.html @@ -0,0 +1,32 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.firstChild.html b/test/ecmascript/assert/element.firstChild.html new file mode 100644 index 00000000..31c437c4 --- /dev/null +++ b/test/ecmascript/assert/element.firstChild.html @@ -0,0 +1,21 @@ + + +BBB +bbb +AAAUUUAAAAAAA + +BB + + + + diff --git a/test/ecmascript/assert/element.firstElementChild.html b/test/ecmascript/assert/element.firstElementChild.html new file mode 100644 index 00000000..9506d35e --- /dev/null +++ b/test/ecmascript/assert/element.firstElementChild.html @@ -0,0 +1,21 @@ + + +BBB +bbb +BBBAAAUUUAAAAAAA + +BB + + + + diff --git a/test/ecmascript/assert/element.getAttribute.html b/test/ecmascript/assert/element.getAttribute.html new file mode 100644 index 00000000..015076bc --- /dev/null +++ b/test/ecmascript/assert/element.getAttribute.html @@ -0,0 +1,30 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.getAttributeNode.html b/test/ecmascript/assert/element.getAttributeNode.html new file mode 100644 index 00000000..6c5ea26f --- /dev/null +++ b/test/ecmascript/assert/element.getAttributeNode.html @@ -0,0 +1,27 @@ + + + + + + +

Hello World

+

Click the button to display the value of the class attribute node of the h1 element.

+ +

+ + + diff --git a/test/ecmascript/assert/element.getElementsByTagName.html b/test/ecmascript/assert/element.getElementsByTagName.html new file mode 100644 index 00000000..b236cdf3 --- /dev/null +++ b/test/ecmascript/assert/element.getElementsByTagName.html @@ -0,0 +1,26 @@ + + + + +First Name:
+First Name: + +

Click the button to get the tag name of the first element in the body that has tag P.

+ + + +

+ + + + + diff --git a/test/ecmascript/assert/element.hasAttribute.html b/test/ecmascript/assert/element.hasAttribute.html new file mode 100644 index 00000000..3d3588b8 --- /dev/null +++ b/test/ecmascript/assert/element.hasAttribute.html @@ -0,0 +1,30 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.hasAttributes.html b/test/ecmascript/assert/element.hasAttributes.html new file mode 100644 index 00000000..69ccd9e1 --- /dev/null +++ b/test/ecmascript/assert/element.hasAttributes.html @@ -0,0 +1,22 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + diff --git a/test/ecmascript/assert/element.hasChildNodes.html b/test/ecmascript/assert/element.hasChildNodes.html new file mode 100644 index 00000000..ad1b52ec --- /dev/null +++ b/test/ecmascript/assert/element.hasChildNodes.html @@ -0,0 +1,32 @@ + + + + + + +

Click the button to see if the ul element has any child nodes.

+ + + +

Try removing the child nodes of the list element, and the result will be false instead of true.

+ +

Note: Whitespace inside a node is considered as text nodes, so if you leave any white space or line feeds inside an element, that element still has child nodes.

+ +

+ + + + + diff --git a/test/ecmascript/assert/element.id.html b/test/ecmascript/assert/element.id.html new file mode 100644 index 00000000..86b213d1 --- /dev/null +++ b/test/ecmascript/assert/element.id.html @@ -0,0 +1,14 @@ + + +inner + + + + + diff --git a/test/ecmascript/assert/element.innerHTML.html b/test/ecmascript/assert/element.innerHTML.html new file mode 100644 index 00000000..a43e1138 --- /dev/null +++ b/test/ecmascript/assert/element.innerHTML.html @@ -0,0 +1,33 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.insertBefore.html b/test/ecmascript/assert/element.insertBefore.html new file mode 100644 index 00000000..17526cec --- /dev/null +++ b/test/ecmascript/assert/element.insertBefore.html @@ -0,0 +1,33 @@ + + + + + + +

Click the button to insert an item to the list.

+ + + +

Example explained:
First create a LI node,
then create a Text node,
then append the Text node to the LI node.
Finally insert the LI node before the first child node in the list.

+ + + + + diff --git a/test/ecmascript/assert/element.isEqualNode.html b/test/ecmascript/assert/element.isEqualNode.html new file mode 100644 index 00000000..0c743a63 --- /dev/null +++ b/test/ecmascript/assert/element.isEqualNode.html @@ -0,0 +1,37 @@ + + + + +

Click the buttons to compare the first item in two of the lists.

+ + + +

+ +List 1: + +List 2: + +List 3: + + +

Note: Internet Explorer 8 and earlier does not support the isEqualNode method.

+ +

+ + + + + diff --git a/test/ecmascript/assert/element.isSameNode.html b/test/ecmascript/assert/element.isSameNode.html new file mode 100644 index 00000000..2ca507db --- /dev/null +++ b/test/ecmascript/assert/element.isSameNode.html @@ -0,0 +1,31 @@ + + + + +

Click the button to check if the ul element with id="myList" is the same as the document's first ul element.

+ + + + + +

Note: Firefox stopped supported this method as of version 10, Instead, use === to compare if two nodes are the same.

+ +

Note: Internet Explorer 8 and earlier does not support the isSameNode() method.

+ +

+ + + + + diff --git a/test/ecmascript/assert/element.lang.html b/test/ecmascript/assert/element.lang.html new file mode 100644 index 00000000..41359e91 --- /dev/null +++ b/test/ecmascript/assert/element.lang.html @@ -0,0 +1,30 @@ + + +BBB +bbb + +AAAUUUAAAAAAA + +BB + + + + + diff --git a/test/ecmascript/assert/element.lastChild.html b/test/ecmascript/assert/element.lastChild.html new file mode 100644 index 00000000..2a64c283 --- /dev/null +++ b/test/ecmascript/assert/element.lastChild.html @@ -0,0 +1,20 @@ + + +BBB +bbb +AAAUUUAAAAAAA +BB + + + + diff --git a/test/ecmascript/assert/element.lastElementChild.html b/test/ecmascript/assert/element.lastElementChild.html new file mode 100644 index 00000000..e5a3fdaa --- /dev/null +++ b/test/ecmascript/assert/element.lastElementChild.html @@ -0,0 +1,21 @@ + + +BBB +bbb +BBBAAAUUUAAAAAAA + +BB + + + + diff --git a/test/ecmascript/assert/element.matches.html b/test/ecmascript/assert/element.matches.html new file mode 100644 index 00000000..bd29003e --- /dev/null +++ b/test/ecmascript/assert/element.matches.html @@ -0,0 +1,21 @@ + + + diff --git a/test/ecmascript/assert/element.namedItem.html b/test/ecmascript/assert/element.namedItem.html new file mode 100644 index 00000000..9721bac9 --- /dev/null +++ b/test/ecmascript/assert/element.namedItem.html @@ -0,0 +1,27 @@ + + + + +

HTMLCollection namedItem() Method

+ +

The namedItem() method returns the element with the specified ID or name.

+ +

This example uses a shorthand method for the namedItem() method

+ +

Click the button to return the content of the P element with ID "myElement":

+ + + + + + +