Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| index 122d51da837519544bd8f1ec9b499d41e5c6477b..5456808e938a3a40725aadc938927836fca49aa4 100644 |
| --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp |
| @@ -6,6 +6,7 @@ |
| #include "core/frame/FrameView.h" |
| #include "core/frame/Settings.h" |
| +#include "core/layout/LayoutInline.h" |
| #include "core/layout/LayoutPart.h" |
| #include "core/paint/ObjectPaintProperties.h" |
| #include "core/paint/PaintLayer.h" |
| @@ -333,6 +334,20 @@ void PaintPropertyTreeBuilder::updateOutOfFlowContext(LayoutObject& object, Pain |
| context.transformForAbsolutePosition = context.currentTransform; |
| context.paintOffsetForAbsolutePosition = context.paintOffset; |
| context.clipForAbsolutePosition = context.currentClip; |
| + |
| + // Absolutely positioned content in an inline should be positioned relative to the first |
| + // inline box. See: LayoutInline::offsetForInFlowPositionedInline. |
| + // FIXME(pdr): There is a special case when the descendant has static position where this |
| + // offset should be removed and an offset based on the inline position should be used instead. |
| + if (object.isInline() && object.isLayoutInline()) { |
| + const LayoutInline& layoutInline = toLayoutInline(object); |
| + if (layoutInline.firstLineBox()) { |
| + LayoutPoint inlineOffset = layoutInline.firstLineBox()->topLeft(); |
| + if (!object.styleRef().isHorizontalWritingMode()) |
| + inlineOffset = inlineOffset.transposedPoint(); |
| + context.paintOffsetForAbsolutePosition += inlineOffset; |
| + } |
| + } |
|
Xianzhu
2016/05/26 18:02:27
It's better to use the same algorithm as in PaintI
|
| } |
| // TODO(pdr): Remove the !object.isLayoutView() condition when removing FrameView |