Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 2414683002: Make offsetTop/Left handle a relative positioned inline offsetParent correctly. (Closed)
Patch Set: Added one more test for abspos with relpos inline offsetParent. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutInline.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 19ac47476b6db7945f4398c23c95b8de0474d753..6c284fe55d51afbe22d214a6e49dfbf94f7cde69 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -782,20 +782,18 @@ void LayoutInline::absoluteQuadsForSelf(Vector<FloatQuad>& quads) const {
context(FloatRect());
}
+LayoutPoint LayoutInline::firstLineBoxTopLeft() const {
+ if (InlineBox* firstBox = firstLineBoxIncludingCulling())
+ return firstBox->topLeft();
+ return LayoutPoint();
+}
+
LayoutUnit LayoutInline::offsetLeft(const Element* parent) const {
- LayoutPoint topLeft;
- if (InlineBox* firstBox = firstLineBoxIncludingCulling()) {
- topLeft = firstBox->topLeft();
- }
- return adjustedPositionRelativeTo(topLeft, parent).x();
+ return adjustedPositionRelativeTo(firstLineBoxTopLeft(), parent).x();
}
LayoutUnit LayoutInline::offsetTop(const Element* parent) const {
- LayoutPoint topLeft;
- if (InlineBox* firstBox = firstLineBoxIncludingCulling()) {
- topLeft = firstBox->topLeft();
- }
- return adjustedPositionRelativeTo(topLeft, parent).y();
+ return adjustedPositionRelativeTo(firstLineBoxTopLeft(), parent).y();
}
static LayoutUnit computeMargin(const LayoutInline* layoutObject,

Powered by Google App Engine
This is Rietveld 408576698