The browser crashes when document.fonts.values() is used as a WeakMap key
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | verified |
People
(Reporter: jonco, Assigned: smaug)
References
Details
Crash Data
Attachments
(1 file)
If you type the following into the console:
new WeakMap().set(document.fonts.values(), undefined);
This assertion fails: https://searchfox.org/mozilla-central/source/dom/bindings/BindingUtils.cpp#1147
Assignee | ||
Updated•4 years ago
|
Reporter | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
Isn't the assertion just too strict.
https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/layout/style/FontFaceSetIterator.h#17,21
https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/dom/bindings/Bindings.conf#298
The object is cycle collectable, but only JS can ever own it.
Similar case to when nsISupports object isn't wrappercached
https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/dom/canvas/ImageData.h#25,34-35
https://searchfox.org/mozilla-central/rev/598e50d2c3cd81cd616654f16af811adceb08f9f/dom/bindings/BindingUtils.cpp#1121,1128-1129,1133
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
The method lets one to have nsISupports objects not supporting nsWrapperCache, but non-nsISupports objects are
required to inherit nsWrapperCache because of the assertion.
jonco is adding tests in https://bugzilla.mozilla.org/show_bug.cgi?id=1642974
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
•
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=1351501#c11 requested the assertion, and the patch should still check that
"We should also assert that addProperty is non-null if and only if domClass->mParticipant is non-null, right?"
Updated•4 years ago
|
Updated•4 years ago
|
Comment 7•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 8•4 years ago
|
||
I can't seem to be able to reproduce this issue. Can you provide me with more specific steps or could you please check if the issue is reproducing on the Firedox 79.0b2?
Reporter | ||
Comment 9•4 years ago
|
||
(In reply to Oana Botisan, Desktop Release QA from comment #8)
It's fixed on 79 but it reproduces on 78.
Comment 10•4 years ago
|
||
Thank you, Jon, for verifying the fix. That is fine because only 79 was fixed and the milestone is firefox79. I will mark this bug as verified fixed according to comment 9.
Description
•