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

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: Fixed broken rebase. Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0d12a673395dcd43c5503c5373bd9e0b63a24f96..fb209ce555db2ecd8be18a8b9f24630a1a6b82a4 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,
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698