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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 2854213004: Update layer size from LayoutBox::UpdateAfterLayout (Closed)
Patch Set: Fix placement of inline comment Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 FloatRect LayoutBox::LocalBoundingBoxRectForAccessibility() const { 740 FloatRect LayoutBox::LocalBoundingBoxRectForAccessibility() const {
741 return FloatRect(0, 0, frame_rect_.Width().ToFloat(), 741 return FloatRect(0, 0, frame_rect_.Width().ToFloat(),
742 frame_rect_.Height().ToFloat()); 742 frame_rect_.Height().ToFloat());
743 } 743 }
744 744
745 void LayoutBox::UpdateAfterLayout() { 745 void LayoutBox::UpdateAfterLayout() {
746 // Transform-origin depends on box size, so we need to update the layer 746 // Transform-origin depends on box size, so we need to update the layer
747 // transform after layout. 747 // transform after layout.
748 if (HasLayer()) { 748 if (HasLayer()) {
749 Layer()->UpdateTransformationMatrix(); 749 Layer()->UpdateTransformationMatrix();
750 Layer()->UpdateScrollingAfterLayout(); 750 Layer()->UpdateSizeAndScrollingAfterLayout();
751 } 751 }
752 } 752 }
753 753
754 LayoutUnit LayoutBox::LogicalHeightWithVisibleOverflow() const { 754 LayoutUnit LayoutBox::LogicalHeightWithVisibleOverflow() const {
755 if (!overflow_ || HasOverflowClip()) 755 if (!overflow_ || HasOverflowClip())
756 return LogicalHeight(); 756 return LogicalHeight();
757 LayoutRect overflow = LayoutOverflowRect(); 757 LayoutRect overflow = LayoutOverflowRect();
758 if (Style()->IsHorizontalWritingMode()) 758 if (Style()->IsHorizontalWritingMode())
759 return overflow.MaxY(); 759 return overflow.MaxY();
760 return overflow.MaxX(); 760 return overflow.MaxX();
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 logical_height, 824 logical_height,
825 ComputeContentLogicalHeight(kMinSize, style_to_use.LogicalMinHeight(), 825 ComputeContentLogicalHeight(kMinSize, style_to_use.LogicalMinHeight(),
826 intrinsic_content_height)); 826 intrinsic_content_height));
827 } 827 }
828 828
829 return logical_height; 829 return logical_height;
830 } 830 }
831 831
832 void LayoutBox::SetLocationAndUpdateOverflowControlsIfNeeded( 832 void LayoutBox::SetLocationAndUpdateOverflowControlsIfNeeded(
833 const LayoutPoint& location) { 833 const LayoutPoint& location) {
834 if (HasOverflowClip()) { 834 IntSize old_pixel_snapped_border_rect_size =
835 IntSize old_pixel_snapped_border_rect_size = 835 PixelSnappedBorderBoxRect().Size();
836 PixelSnappedBorderBoxRect().Size(); 836 SetLocation(location);
837 SetLocation(location); 837 if (HasLayer() && PixelSnappedBorderBoxRect().Size() !=
838 if (PixelSnappedBorderBoxRect().Size() != 838 old_pixel_snapped_border_rect_size) {
839 old_pixel_snapped_border_rect_size) { 839 Layer()->UpdateSizeAndScrollingAfterLayout();
840 Layer()->UpdateScrollingAfterLayout();
841 }
842 return;
843 } 840 }
844
845 SetLocation(location);
846 } 841 }
847 842
848 IntRect LayoutBox::AbsoluteContentBox() const { 843 IntRect LayoutBox::AbsoluteContentBox() const {
849 // This is wrong with transforms and flipped writing modes. 844 // This is wrong with transforms and flipped writing modes.
850 IntRect rect = PixelSnappedIntRect(ContentBoxRect()); 845 IntRect rect = PixelSnappedIntRect(ContentBoxRect());
851 FloatPoint abs_pos = LocalToAbsolute(); 846 FloatPoint abs_pos = LocalToAbsolute();
852 rect.Move(abs_pos.X(), abs_pos.Y()); 847 rect.Move(abs_pos.X(), abs_pos.Y());
853 return rect; 848 return rect;
854 } 849 }
855 850
(...skipping 5008 matching lines...) Expand 10 before | Expand all | Expand 10 after
5864 void LayoutBox::MutableForPainting:: 5859 void LayoutBox::MutableForPainting::
5865 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5860 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5866 auto& rare_data = GetLayoutBox().EnsureRareData(); 5861 auto& rare_data = GetLayoutBox().EnsureRareData();
5867 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5862 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5868 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5863 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5869 rare_data.previous_layout_overflow_rect_ = 5864 rare_data.previous_layout_overflow_rect_ =
5870 GetLayoutBox().LayoutOverflowRect(); 5865 GetLayoutBox().LayoutOverflowRect();
5871 } 5866 }
5872 5867
5873 } // namespace blink 5868 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698