Closed Bug 2032064 Opened 1 month ago Closed 1 month ago

Calling CSSStyleProperties#hasLonghandProperty crashes the tab

Categories

(DevTools :: Inspector, defect)

defect

Tracking

(firefox151 fixed)

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

hasLonghandProperty can be called on CSSStyleProperties object given https://searchfox.org/firefox-main/rev/23974e2d947e31e4ae42ae2758a4416c9a6d8671/dom/webidl/CSSStyleDeclaration.webidl#32-33

[ChromeOnly]
boolean hasLonghandProperty(UTF8String property);

but when doing so, it actually crashes with Mozilla crash reason: MOZ_CRASH(called nsComputedDOMStyle::GetCSSDeclaration), which I think is because of this https://searchfox.org/firefox-main/rev/23974e2d947e31e4ae42ae2758a4416c9a6d8671/layout/style/nsDOMCSSDeclaration.cpp#162

if (auto* decl = GetOrCreateCSSDeclaration(Operation::Read, nullptr)) {
Blocks: 2032068

This will be used by DevTools, in particular to know when a custom properties
is set (they can be empty, so getPropertyValue() isn't helpful here).

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Attachment #9570798 - Attachment description: Bug 2032064 - Add CSSStyleProperties::hasLonghandProperty. r=#layout-reviewers. → Bug 2032064 - Implement nsComputedDOMStyle::HasLonghandProperty. r=#layout-reviewers.
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/a62e813ba162 https://hg.mozilla.org/integration/autoland/rev/5ed9efad9a0a Implement nsComputedDOMStyle::HasLonghandProperty. r=layout-reviewers,firefox-style-system-reviewers,emilio.
Flags: needinfo?(nchevobbe)
Pushed by abutkovits@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/147d9c589d2d https://hg.mozilla.org/integration/autoland/rev/62b14f7ca566 Revert "Bug 2032064 - Implement nsComputedDOMStyle::HasLonghandProperty. r=layout-reviewers,firefox-style-system-reviewers,emilio." as per request.

I had the test manifest change in the wrong patch, I'll move it here

Flags: needinfo?(nchevobbe)
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/0652464014c3 https://hg.mozilla.org/integration/autoland/rev/eddf02a258af Implement nsComputedDOMStyle::HasLonghandProperty. r=layout-reviewers,firefox-style-system-reviewers,emilio.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
QA Whiteboard: [qa-triage-done-c152/b151]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: