WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
297033
[css-anchor-position-1] Changing window focus causes relayout on anchor() tests
https://bugs.webkit.org/show_bug.cgi?id=297033
Summary
[css-anchor-position-1] Changing window focus causes relayout on anchor() tests
fantasai
Reported
2025-08-06 20:04:18 PDT
For some reason, we are triggering relayout when the window changes focus on anchor positioning tests such as
https://wpt.live/css/css-anchor-position/anchor-scope-scroll.html
This is noticeable if you turn on logging. Seems like an excessive amount of work given nothing is supposed to change?
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2025-08-06 20:04:26 PDT
<
rdar://problem/157715763
>
alan
Comment 2
2025-08-06 20:10:18 PDT
It looks like the anchored element's inset value goes from fixed to auto on window focus (which then triggers layout). in RenderStyle::changeRequiresLayout (lldb) expr a.m_sides[0] (const std::array<WebCore::Style::InsetEdge, 4>::value_type) $5 = { WebCore::Style::LengthWrapperBase<WebCore::Style::LengthPercentage<WebCore::CSS::Range, float>, WebCore::Constant<WebCore::CSSValueAuto> > = { m_value = { = (m_intValue = 1126105088, m_floatValue = 159, m_calculationValueHandle = 1126105088) m_type = Fixed m_hasQuirk = false m_isFloat = true m_isEmptyValue = false } } } (lldb) expr b.m_sides[0] (const std::array<WebCore::Style::InsetEdge, 4>::value_type) $6 = { WebCore::Style::LengthWrapperBase<WebCore::Style::LengthPercentage<WebCore::CSS::Range, float>, WebCore::Constant<WebCore::CSSValueAuto> > = { m_value = { = (m_intValue = 0, m_floatValue = 0, m_calculationValueHandle = 0) m_type = Auto m_hasQuirk = false m_isFloat = true m_isEmptyValue = false } } }
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug