| Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| index 1f9148f70c35bc50321b277d0a6b01410f2b6fb7..e8d59f6adaca83a83d3914004422a831e59c9e77 100644
|
| --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
|
| @@ -786,17 +786,13 @@ void PaintLayer::Update3DTransformedDescendantStatus() {
|
| }
|
|
|
| void PaintLayer::UpdateLayerPosition() {
|
| + // LayoutBoxes will call UpdateSizeAndScrollingAfterLayout() from
|
| + // LayoutBox::UpdateAfterLayout, but LayoutInlines will still need to update
|
| + // their size.
|
| + if (GetLayoutObject().IsInline() && GetLayoutObject().IsLayoutInline())
|
| + UpdateSizeAndScrollingAfterLayout();
|
| LayoutPoint local_point;
|
| -
|
| - bool did_resize = false;
|
| - if (GetLayoutObject().IsInline() && GetLayoutObject().IsLayoutInline()) {
|
| - LayoutInline& inline_flow = ToLayoutInline(GetLayoutObject());
|
| - IntRect line_box = EnclosingIntRect(inline_flow.LinesBoundingBox());
|
| - size_ = line_box.Size();
|
| - } else if (LayoutBox* box = GetLayoutBox()) {
|
| - IntSize new_size = PixelSnappedIntSize(box->Size(), box->Location());
|
| - did_resize = new_size != size_;
|
| - size_ = new_size;
|
| + if (LayoutBox* box = GetLayoutBox()) {
|
| local_point.MoveBy(box->PhysicalLocation());
|
| }
|
|
|
| @@ -847,14 +843,34 @@ void PaintLayer::UpdateLayerPosition() {
|
|
|
| location_ = local_point;
|
|
|
| - if (scrollable_area_ && did_resize)
|
| - scrollable_area_->VisibleSizeChanged();
|
| -
|
| #if DCHECK_IS_ON()
|
| needs_position_update_ = false;
|
| #endif
|
| }
|
|
|
| +void PaintLayer::UpdateSizeAndScrollingAfterLayout() {
|
| + bool did_resize = false;
|
| + if (IsRootLayer() && RuntimeEnabledFeatures::rootLayerScrollingEnabled()) {
|
| + const IntSize new_size = GetLayoutObject().GetDocument().View()->Size();
|
| + did_resize = new_size != size_;
|
| + size_ = new_size;
|
| + } else if (GetLayoutObject().IsInline() &&
|
| + GetLayoutObject().IsLayoutInline()) {
|
| + LayoutInline& inline_flow = ToLayoutInline(GetLayoutObject());
|
| + IntRect line_box = EnclosingIntRect(inline_flow.LinesBoundingBox());
|
| + size_ = line_box.Size();
|
| + } else if (LayoutBox* box = GetLayoutBox()) {
|
| + IntSize new_size = PixelSnappedIntSize(box->Size(), box->Location());
|
| + did_resize = new_size != size_;
|
| + size_ = new_size;
|
| + }
|
| + if (GetLayoutObject().HasOverflowClip()) {
|
| + scrollable_area_->UpdateAfterLayout();
|
| + if (did_resize)
|
| + scrollable_area_->VisibleSizeChanged();
|
| + }
|
| +}
|
| +
|
| TransformationMatrix PaintLayer::PerspectiveTransform() const {
|
| if (!GetLayoutObject().HasTransformRelatedProperty())
|
| return TransformationMatrix();
|
|
|