Comments (5)
Thanks for looking deeper, @cdaringe! We agree with your assessment that the incompatibility is with happy-dom
using a non-prototypal instance field for isConnected
where our polyfill guard is instead looking for a prototypal property.
We agree that the spec doesn't technically demand a prototypal property here; however, it does demand that the property be read-only, which in practice leads it to be present on Node.prototype
in all of our supported environments documented in axe-core
's browser support policy. I'll also note that the Node.prototype
check is not something that axe-core
has come up with uniquely; it is based on the MDN-recommended isConnected
polyfill.
For fixing this specific incompatibility, we think it would be preferable to update happy-dom
's implementation to be closer to how browsers and JSDom implement this property, for compatibility with the MDN-recommended polyfill strategy and with the DOM spec's requirement that the property be read-only. However, if the happy-dom
folks push back on that, we'd be open to a contribution that updates our polyfill to be compatible, so long as it maintains compatibility with the existing cases it covers.
As far as an option to disable polyfills entirely: we're going to decline this feature suggestion (and so I'm going to close this issue). axe-core's polyfills are already surrounded with guards that no-op them in all supported environments that don't require them. A "no polyfills" option would only be applicable to environments that we explicitly do not support.
That said, we are interested in eventually updating axe-core
to avoid having to use polyfills at all. Right now, most polyfills we use are there because we still support IE11; we'd like to evaluate whether we can avoid using polyfills at all in the future when we eventually drop IE11 support. However, we don't have a specific timeline to commit to for that right now.
from axe-core.
Thanks for the issue. Could you help me understand a bit how the polyfill affects your code? I took a quick look through the code and saw that the Node file defines an isConnected
property. If an instance of that class is the same as the one on window.Node
, then I would assume the guard we have around our polyfill would prevent the polyfill from activating. If the Node class isn't the one on window then I'm not sure how adding an isConnected
property to Node then affects your custom classes.
from axe-core.
The field is present on instantiation, but not on the prototype. The polyfill checks the prototype, which im unclear is correct or incorrect behavior. MDN says that the field should exist on Node. The spec doesnt seem to suggest that prototype specially is guaranteed to have the field https://dom.spec.whatwg.org/#node, or that it’s even statically available. Seems like some impla do use prototypical inheritance, but im not clear if its required (appears not). My gut says the polyfill detection may be too presumptive. Tldr, happy-dom doesnt set the field on the prototype, that seems OK, but axe then mutates a getter on happy-dom and breaks happy-dom
from axe-core.
Typing from Phone, sorry for the brevity or terseness
from axe-core.
No problem, thanks for writing back with a thorough response. I think it’s a fair take.
from axe-core.
Related Issues (20)
- aria-allowed-attr should incomplete attributes with a falsey value
- Runtime issue: Result for unknown rule. You may be running mismatch axe-core versions HOT 2
- `<slot>` with `display: inline-block` causes color-contrast to be incomplete HOT 2
- False positive: scrollable-region-focusable: Elements with scrollable content must be accessible by keyboard. HOT 3
- Disable axe-linter for one line? HOT 3
- False failure: button with role of combobox fails for missing discernible text HOT 1
- Critical error of alt attribute not present is thrown even if image is wrapped inside `<figure>` element and a caption is provided in `<figcaption>` element. HOT 1
- Skip link is not detected in Keyboard IGT HOT 2
- "More Options" tooltip covers "Start Run" button HOT 1
- Possible incorrect results for `Values assigned to role="" are not valid ARIA roles.` ARIA check in Lighthouse audit HOT 8
- aria-required-attr should consider fallback values HOT 1
- axe DevTools Linter Accessibility HOT 2
- Generate an all-rules.csv file HOT 1
- Using `all-lang` option for build doesn't work
- Is there a way to detect non-accessible interactive elements on a webpage? HOT 1
- With linting, how to handle custom React object that could be transcribed into various HTML elements HOT 1
- autocomplete-valid (SC 1.3.5) triggers error for autocomplete="text" HOT 2
- `artifact@v3` actions use deprecated version of `Node.js`
- Contrast Check: Possible False Positive HOT 2
- "Certain ARIA roles must contain particular children" is inconsistent with its guidance HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axe-core.