Bug 154458

Summary: All DOM descriptors are completely useless
Product: WebKit Reporter: Andrea Giammarchi <andrea.giammarchi>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: barraclough, cdumez
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

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:
```js
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:
https://github.com/WebReflection/url-search-params#url-search-params

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:
https://nightly.webkit.org

If issues remain, please let me know.

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