-
Notifications
You must be signed in to change notification settings - Fork 294
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
Attribute lowercasing does not appear to match browsers or web-platform-tests #31
Comments
Thinking about this further it seems very unlikely the current spec is correct, since it's very natural that |
domenic
added a commit
to jsdom/jsdom
that referenced
this issue
May 3, 2015
This re-does everything related to attributes in jsdom, except for the Attr class itself. It is now much more spec-compliant, as it follows the spec algorithms almost exactly. The new living/attributes.js file contains line-by-line translations of the spec algorithms, including the abstract operations referenced from elsewhere in the spec. The new living/element.js adds the appropriate Element.prototype methods, which mostly delegate to these operations. This allows us to remove a lot of crufty and often non-compliant code spread throughout jsdom. Notable highlights include: - Our NamedNodeMap and AttributeList implementations in level1/core (and some in level2/core); see #922 - Our dual buildup of attribute-related methods in level1/core and level2/core - The DOMAttrModified mutation event code in level2/events, including its AttributeList monkeypatches; it was simplified and moved to Element.prototype._attrModified in level1/core - The StyleAttr class and many monkeypatches in level2/style; instead some tweaks were made to HTMLElement in level2/html Fixes #922. Fixes #1109. Almost passes web-platform-tests at https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/attributes.html, but that includes tests for Attr being a non-Node, and also has the issue referenced at whatwg/dom#31.
domenic
added a commit
to jsdom/jsdom
that referenced
this issue
May 3, 2015
This re-does everything related to attributes in jsdom, except for the Attr class itself. It is now much more spec-compliant, as it follows the spec algorithms almost exactly. The new living/attributes.js file contains line-by-line translations of the spec algorithms, including the abstract operations referenced from elsewhere in the spec. The new living/element.js adds the appropriate Element.prototype methods, which mostly delegate to these operations. This allows us to remove a lot of crufty and often non-compliant code spread throughout jsdom. Notable highlights include: - Our NamedNodeMap and AttributeList implementations in level1/core (and some in level2/core); see #922 - Our dual buildup of attribute-related methods in level1/core and level2/core - The DOMAttrModified mutation event code in level2/events, including its AttributeList monkeypatches; it was simplified and moved to Element.prototype._attrModified in level1/core - The StyleAttr class and many monkeypatches in level2/style; instead some tweaks were made to HTMLElement in level2/html Fixes #922. Fixes #1109. Almost passes web-platform-tests at https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/attributes.html, but that includes tests for Attr being a non-Node, and also has the issue referenced at whatwg/dom#31.
Yeah, as far as I can see the spec is wrong here. It should be lowercasing the name at least in some cases. |
domenic
added a commit
to jsdom/jsdom
that referenced
this issue
May 10, 2015
This re-does everything related to attributes in jsdom, except for the Attr class itself. It is now much more spec-compliant, as it follows the spec algorithms almost exactly. The new living/attributes.js file contains line-by-line translations of the spec algorithms, including the abstract operations referenced from elsewhere in the spec. The new living/element.js adds the appropriate Element.prototype methods, which mostly delegate to these operations. This allows us to remove a lot of crufty and often non-compliant code spread throughout jsdom. Notable highlights include: - Our NamedNodeMap and AttributeList implementations in level1/core (and some in level2/core); see #922 - Our dual buildup of attribute-related methods in level1/core and level2/core - The DOMAttrModified mutation event code in level2/events, including its AttributeList monkeypatches; it was simplified and moved to Element.prototype._attrModified in level1/core - The StyleAttr class and many monkeypatches in level2/style; instead some tweaks were made to HTMLElement in level2/html Fixes #922. Fixes #1109. Almost passes web-platform-tests at https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/attributes.html, but that includes tests for Attr being a non-Node, and also has the issue referenced at whatwg/dom#31.
domenic
added a commit
to jsdom/jsdom
that referenced
this issue
May 10, 2015
akhaku
pushed a commit
to akhaku/jsdom
that referenced
this issue
May 12, 2015
This re-does everything related to attributes in jsdom, except for the Attr class itself. It is now much more spec-compliant, as it follows the spec algorithms almost exactly. The new living/attributes.js file contains line-by-line translations of the spec algorithms, including the abstract operations referenced from elsewhere in the spec. The new living/element.js adds the appropriate Element.prototype methods, which mostly delegate to these operations. This allows us to remove a lot of crufty and often non-compliant code spread throughout jsdom. Notable highlights include: - Our NamedNodeMap and AttributeList implementations in level1/core (and some in level2/core); see jsdom#922 - Our dual buildup of attribute-related methods in level1/core and level2/core - The DOMAttrModified mutation event code in level2/events, including its AttributeList monkeypatches; it was simplified and moved to Element.prototype._attrModified in level1/core - The StyleAttr class and many monkeypatches in level2/style; instead some tweaks were made to HTMLElement in level2/html Fixes jsdom#922. Fixes jsdom#1109. Almost passes web-platform-tests at https://github.com/w3c/web-platform-tests/blob/master/dom/nodes/attributes.html, but that includes tests for Attr being a non-Node, and also has the issue referenced at whatwg/dom#31.
akhaku
pushed a commit
to akhaku/jsdom
that referenced
this issue
May 12, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I implemented the current attribute spec in jsdom pretty exactly. However, it failed the following web-platform-test (source):
In my implementation
null
is returned for all three calls, because per specsetAttribute
doesn't actually do any lowercasing.If this is intentional we can just update web-platform-tests. I was unclear.
The text was updated successfully, but these errors were encountered: