Element Prototype Extension - W3C Tests
The code is tested by a combination of automated and manual tests.
The automated tests were originally written for JsUnit and were part of work commissioned by the W3C. The tests have been changed. Some of the changes reflect browser dependencies that EPE will never (probably) fix.
JSLab tests are not to be considered definitive tests of browser compliance with W3C recommendations. We cannot take responsibility for undetected differences in user agent behaviors, mistakes in the tests that erroneously mark a browser as non-compliant, and undetected deviations from the W3C recommendations that are browser-independent. We cannot even take responsibility for browser compliance with the W3C recommendations.
- Test bugs have been fixed. The applet tests needed fixing for the suite to run at all.
- All the tests were changed to run under Selenium using 'Selenese'.
- Tests that assumed an initial empty population of attributes were altered. HTMLElements on Internet Explorer do not start off empty.
- Tests for exceptions were changed so that they no longer check the DOMException type.
- Tests that counted DOM nodes needed to be changed to be insensitive to browser differences in the number of text nodes.
The tests are organized into sections for core, html, and events.
Significant html test failures:
- HTMLButtonElement.value is truncated on Internet Explorer to the first word in the label.
- document.referrer is empty on Internet Explorer.
- HTMLFrameElement.ownerDocument is not implemented on Internet Explorer. This is supposed to change in version 8. Fixing ownerDocument on Internet Explorer versions 6 and 7 should be a priority for future versions of EPE.
- HTMLInputElement.alignLink is empty, presumably because it's behavior is not supported on Internet Explorer.
- The form attribute of controls that are not within a form is not null on Internet Explorer.
- The charoff attribute of HTMLTableCellElement is not available on Internet Explorer, presumably because alignment characters are not supported.
- The charoff attribute of HTMLTableColElement is not available on Internet Explorer, presumably because alignment characters are not supported.
- The chOff attribute of HTMLTableRowElement is not available on Internet Explorer, presumably because alignment characters are not supported.
Core test failures are more numerous and harder to analyze.
- The DOM recommendations for element Attr nodes were never completely implemented. For instance, the attribute nodes do not contain a child node that is a text node on Internet Explorer. There are many tests that are sensitive to this structural difference.
- The 'attributes' collection of a DOM element has a different list of values on Internet Explorer than it does on W3C browsers. There is a different set of behaviors, too. Some of the test failures are still being evaluated and the tests may be rewritten.
- The W3C specifies that DOM methods fed illegitimate arguments should throw exceptions. Examples of methods that do not check are insertData(offset,arg), replaceData(offset,count,arg), substringData(offset,count), createAttribute(tagName), createElement(tagName), setAttribute(name,value), appendChild(newChild), insertBefore(newChild, refChild), replaceChild(newChild, oldChild).
- document.doctype is not implemented on Internet Explorer.
- document.getElementsByTagName(*) does not retrieve all nodes on Firefox.
- Normalization of document and document fragment text nodes does not work on Internet Explorer. normalize() is not implemented.
The W3C event tests are incomplete. Selenium support for events is good for some event types and sketchy for others. The tests that fail:
- dispatchEvent(evt) should throw an exception when the evt is uninitialized.
One event test that passes on Internet Explorer needs special attention, because it fails on Firefox. "When an event is dispatched to the document with a capture listener attached, a capturing EventListener should not be triggered by events dispatched directly to the EventTarget upon which it is registered."
