Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7b9979fd0f4c740b2efa12b14589050450748963
https://github.com/WebKit/WebKit/commit/7b9979fd0f4c740b2efa12b14589050450748963
Author: Chris Dumez <[email protected]>
Date: 2026-10-12 (Mon, 12 Oct 2026)
Changed paths:
A
LayoutTests/fast/css/custom-properties/at-property-initial-value-crash-expected.txt
A
LayoutTests/fast/css/custom-properties/at-property-initial-value-crash.html
M Source/WebCore/css/CSSToLengthConversionData.cpp
M Source/WebCore/style/StyleBuilderState.h
Log Message:
-----------
REGRESSION(323422@main): WebContent crashes in CSSToLengthConversionData
constructor when registering an @property with an initial-value
https://bugs.webkit.org/show_bug.cgi?id=327230
Reviewed by Ryosuke Niwa.
CustomPropertyRegistry::parseInitialValue() creates a placeholder BuilderState
with no parent style. CSSToLengthConversionData's constructor initialized
m_parentStyle from &builderState.parentStyle(), which takes the address of
*m_context.parentStyle. Now that m_parentStyle is a CheckedPtr, optimized
builds drop the null check before incrementing the checked pointer count,
because the pointer comes from a reference and is assumed non-null. This
crashes on a null pointer dereference.
Add BuilderState::parentStyleIfExists(), which returns the pointer directly,
and use it in the constructor.
Test: fast/css/custom-properties/at-property-initial-value-crash.html
*
LayoutTests/fast/css/custom-properties/at-property-initial-value-crash-expected.txt:
Added.
* LayoutTests/fast/css/custom-properties/at-property-initial-value-crash.html:
Added.
* Source/WebCore/css/CSSToLengthConversionData.cpp:
(WebCore::CSSToLengthConversionData::CSSToLengthConversionData):
* Source/WebCore/style/StyleBuilderState.h:
(WebCore::Style::BuilderState::parentStyleIfExists const):
Canonical link: https://commits.webkit.org/323452@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications