[css-properties-values-api] DOMWindowUtils.computeAnimationDistance causes tab crash when called with a registered property
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr115 | --- | unaffected |
firefox122 | --- | unaffected |
firefox123 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: zrhoffman)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Calling DOMWindowUtils.computeAnimationDistance
with a registered property name, e.g. DOMWindowUtils.computeAnimationDistance(el, "--my-registered-css-property", "red", "blue")
causes a tab crash.
Reporter | ||
Comment 1•1 year ago
|
||
Looks like this is caused by https://searchfox.org/mozilla-central/rev/47b65cbe249613b9af936cd4660789bb642a8e30/layout/style/StyleAnimationValue.cpp#217-220
RefPtr<StyleLockedDeclarationBlock> declarations =
ServoCSSParser::ParseProperty(property, aValue,
ServoCSSParser::GetParsingEnvironment(doc),
StyleParsingMode::DEFAULT);
Reporter | ||
Comment 2•1 year ago
|
||
and this might be because of https://searchfox.org/mozilla-central/rev/47b65cbe249613b9af936cd4660789bb642a8e30/servo/components/style/properties/mod.rs#437
Self::Custom(unsafe { crate::Atom::from_raw(property.mCustomName.mRawPtr) })
Assignee | ||
Comment 3•1 year ago
|
||
Adding a crashtest using Nicolas's reproduction instructions in comment 0.
Stack trace:
Mozilla crash reason: MOZ_ASSERT(aProperty != eCSSPropertyExtra_variable) (Cannot create an AnimatedPropertyID from only a eCSSPropertyExtra_variable.)
#01: mozilla::AnimatedPropertyID::AnimatedPropertyID(nsCSSPropertyID) (obj-x86_64-pc-linux-gnu/dist/include/mozilla/AnimatedPropertyID.h:20)
#02: mozilla::AnimationValue::FromString(nsCSSPropertyID, nsTSubstring<char> const&, mozilla::dom::Element*) (layout/style/StyleAnimationValue.cpp:217)
#03: nsDOMWindowUtils::ComputeAnimationDistance(mozilla::dom::Element*, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, nsTSubstring<char16_t> const&, double*) (dom/base/nsDOMWindowUtils.cpp:3155)
#04: ??? (obj-x86_64-pc-linux-gnu/dist/bin/libxul.so + 0x8dd2f12)
#05: CallMethodHelper::Invoke() (js/xpconnect/src/XPCWrappedNative.cpp:1627)
#06: CallMethodHelper::Call() (js/xpconnect/src/XPCWrappedNative.cpp:1180)
#07: XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) (js/xpconnect/src/XPCWrappedNative.cpp:1126)
#08: XPC_WN_CallMethod(JSContext*, unsigned int, JS::Value*) (js/xpconnect/src/XPCWrappedNativeJSOps.cpp:966)
#09: CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), js::CallReason, JS::CallArgs const&) (js/src/vm/Interpreter.cpp:479)
#10: js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct, js::CallReason) (js/src/vm/Interpreter.cpp:573)
Assignee | ||
Comment 4•1 year ago
|
||
When only an nsCSSPropertyID was passed, AnimationValue::FromString
would create an AnimatedPropertyID anyway, sometimes from
eCSSPropertyExtra_variable without a custom name.
Also removed an unused argument from AnimationValue::ComputeDistance.
Drive-by: Remove an unnecessary include and forward declaration.
Updated•1 year ago
|
Comment 6•1 year ago
|
||
bugherder |
Assignee | ||
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Set release status flags based on info from the regressing bug 1846516
Description
•