Bug 195556
| Summary: | Unable to extend the DocumentFragment class | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Andrea Giammarchi <andrea.giammarchi> |
| Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED CONFIGURATION CHANGED | ||
| Severity: | Normal | CC: | ashvayka |
| Priority: | P2 | ||
| Version: | Safari Technology Preview | ||
| Hardware: | Mac | ||
| OS: | macOS 10.14 | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=174313 | ||
Andrea Giammarchi
The following code will fail the assertion that would, otherwise, pass in every other browser that implements classes.
(function () {'use strict';
class WaitWhat extends DocumentFragment {}
console.assert(
(new WaitWhat) instanceof WaitWhat,
`any instance of a DocumentFragment extend fails`
);
}());
This is true even through Reflect.construct
(function () {'use strict';
class WaitWhat extends DocumentFragment {}
console.assert(
Reflect.construct(DocumentFragment, [], WaitWhat) instanceof WaitWhat,
`any instance of a DocumentFragment extend fails`
);
}());
The expected behavior is that it is possible to extend the DocumentFragment as any other built-in class.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Shvayka
As of r256716, extending DocumentFragment (as well as other DOM constructors) works as expected.