Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8a698682da3e868496db05075809520b666f44db
https://github.com/WebKit/WebKit/commit/8a698682da3e868496db05075809520b666f44db
Author: Alan Baradlay <[email protected]>
Date: 2024-07-08 (Mon, 08 Jul 2024)
Changed paths:
A LayoutTests/fast/inline/positioned-content-inside-inline-box-expected.txt
A LayoutTests/fast/inline/positioned-content-inside-inline-box.html
M Source/WebCore/rendering/RenderBoxModelObject.cpp
M Source/WebCore/rendering/RenderInline.h
Log Message:
-----------
Make offsetTop/Left handle a relative positioned inline offsetParent correctly
https://bugs.webkit.org/show_bug.cgi?id=276275
Reviewed by Antti Koivisto.
Let's take relatively positioned inline box into account when computing
a descendant's offsetTop/Left.
In case of inline formatting context, the incoming "startPoint" is always
relative to
the root block container, however offsetTop/Left is supposed to be relative to
the positioned ancestor (offsetParent)
which is also relative to the root block container.
e.g. <div>text<span style="position: relative"><img>
b________________________ root block container (<div>)
| i__________________ relatively positioned inline box (<span
style="position: relative;">) -> offsetParent
|text |x_____
| || img |
| ||_____|
|
Where [x] point is relative to [b] but what we are looking for here is [x]
relative to [i] as <span> is relatively positioned.
(Test case credit goes to
https://chromium.googlesource.com/chromium/src.git/+/f903f01899c880f15af678b6e44404a7d9b1735f)
* LayoutTests/fast/inline/positioned-content-inside-inline-box-expected.txt:
Added.
* LayoutTests/fast/inline/positioned-content-inside-inline-box.html: Added.
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::adjustedPositionRelativeToOffsetParent const):
* Source/WebCore/rendering/RenderInline.h:
Canonical link: https://commits.webkit.org/280748@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes