Bug 154458 - All DOM descriptors are completely useless
Summary: All DOM descriptors are completely useless
Status: RESOLVED DUPLICATE of bug 140575
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2016-02-19 09:29 PST by Andrea Giammarchi
Modified: 2016-02-19 19:14 PST (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Giammarchi 2016-02-19 09:29:44 PST
It is currently basically impossible to patch or polyfill anything in the DOM world in WebKit.

For instance, writing this snippet produce an unexpected result:
Object.getOwnPropertyDescriptor(Element.prototype, 'id');
{get: undefined, set: undefined, enumerable: true, configurable: false} = $1


Accessors are all flagged as non configurable, and the worst part is that it's not possible to use them with custom elements or any other sort of element because getters and setters are unreachable (being undefined).

This makes patching HTMLAnchorElement and URL impossible in a polyfill like the following one:

so my only option would be to eventually fully replace the whole URL object (also why is every constructor with a prototype an object instead of a function I don't get it) which is way more obtrusive approach.

Bear in mind that polyfill already works with many other browsers, but I'll just push a version that gives up on WebKit which is quite sad because I love this browser.

Thanks for considering fixing this.

Best Regards
Comment 1 Chris Dumez 2016-02-19 19:14:51 PST
This has been fixed in Bug 140575. It should work fine in a recent WebKit nightly build:

If issues remain, please let me know.

*** This bug has been marked as a duplicate of bug 140575 ***