Bug 295801
Summary: | [css-anchor-position-1] Scroll compensation transform should be applied before any other transforms | ||
---|---|---|---|
Product: | WebKit | Reporter: | Kiet Ho <kiet.ho> |
Component: | Layout and Rendering | Assignee: | Jonathan Bedard <jbedard> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | bfulgham, fantasai.bugs, kiet.ho, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://github.com/web-platform-tests/wpt/pull/53796 | ||
Bug Depends on: | |||
Bug Blocks: | 291856 |
Kiet Ho
Per spec (https://drafts.csswg.org/css-anchor-position-1/#default-scroll-shift)
> After layout has been performed for abspos, it is additionally shifted by the default scroll shift, as if affected by a transform (before any other transforms).
But currently, it seems we're applying the scroll compensation transform after other transforms:
void RenderLayer::updateTransformFromStyle(TransformationMatrix& transform, const RenderStyle& style, OptionSet<RenderStyle::TransformOperationOption> options) const
{
auto referenceBoxRect = snapRectToDevicePixelsIfNeeded(renderer().transformReferenceBoxRect(style), renderer());
renderer().applyTransform(transform, style, referenceBoxRect, options);
// https://drafts.csswg.org/css-anchor-position-1/#anchor-pos
// "The positioned element is additionally visually shifted by its snapshotted scroll offset, as if by an additional translate() transform."
if (m_snapshottedScrollOffsetForAnchorPositioning)
transform.translate(m_snapshottedScrollOffsetForAnchorPositioning->width(), m_snapshottedScrollOffsetForAnchorPositioning->height());
makeMatrixRenderable(transform, canRender3DTransforms());
}
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/155637149>
Kiet Ho
Pull request: https://github.com/WebKit/WebKit/pull/48086
Kiet Ho
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/53796
EWS
Committed 297483@main (cda2ef22872d): <https://commits.webkit.org/297483@main>
Reviewed commits have been landed. Closing PR #48086 and removing active labels.
Jonathan Bedard
Re-opening for pull request https://github.com/apple/WebKit/pull/3250
fantasai
https://github.com/apple/WebKit/pull/3250 has been merged.