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

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

Issue 2839183002: Refactor scroll updates after layout. (Closed)
Patch Set: rebase 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 LocalToAbsoluteQuad(FloatRect(0, 0, frame_rect_.Width().ToFloat(), 739 LocalToAbsoluteQuad(FloatRect(0, 0, frame_rect_.Width().ToFloat(),
740 frame_rect_.Height().ToFloat()), 740 frame_rect_.Height().ToFloat()),
741 mode)); 741 mode));
742 } 742 }
743 743
744 FloatRect LayoutBox::LocalBoundingBoxRectForAccessibility() const { 744 FloatRect LayoutBox::LocalBoundingBoxRectForAccessibility() const {
745 return FloatRect(0, 0, frame_rect_.Width().ToFloat(), 745 return FloatRect(0, 0, frame_rect_.Width().ToFloat(),
746 frame_rect_.Height().ToFloat()); 746 frame_rect_.Height().ToFloat());
747 } 747 }
748 748
749 void LayoutBox::UpdateLayerTransformAfterLayout() { 749 void LayoutBox::UpdateAfterLayout() {
750 // Transform-origin depends on box size, so we need to update the layer 750 // Transform-origin depends on box size, so we need to update the layer
751 // transform after layout. 751 // transform after layout.
752 if (HasLayer()) 752 if (HasLayer()) {
753 Layer()->UpdateTransformationMatrix(); 753 Layer()->UpdateTransformationMatrix();
754 Layer()->UpdateScrollingAfterLayout();
755 }
754 } 756 }
755 757
756 LayoutUnit LayoutBox::LogicalHeightWithVisibleOverflow() const { 758 LayoutUnit LayoutBox::LogicalHeightWithVisibleOverflow() const {
757 if (!overflow_ || HasOverflowClip()) 759 if (!overflow_ || HasOverflowClip())
758 return LogicalHeight(); 760 return LogicalHeight();
759 LayoutRect overflow = LayoutOverflowRect(); 761 LayoutRect overflow = LayoutOverflowRect();
760 if (Style()->IsHorizontalWritingMode()) 762 if (Style()->IsHorizontalWritingMode())
761 return overflow.MaxY(); 763 return overflow.MaxY();
762 return overflow.MaxX(); 764 return overflow.MaxX();
763 } 765 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 return logical_height; 833 return logical_height;
832 } 834 }
833 835
834 void LayoutBox::SetLocationAndUpdateOverflowControlsIfNeeded( 836 void LayoutBox::SetLocationAndUpdateOverflowControlsIfNeeded(
835 const LayoutPoint& location) { 837 const LayoutPoint& location) {
836 if (HasOverflowClip()) { 838 if (HasOverflowClip()) {
837 IntSize old_pixel_snapped_border_rect_size = 839 IntSize old_pixel_snapped_border_rect_size =
838 PixelSnappedBorderBoxRect().Size(); 840 PixelSnappedBorderBoxRect().Size();
839 SetLocation(location); 841 SetLocation(location);
840 if (PixelSnappedBorderBoxRect().Size() != 842 if (PixelSnappedBorderBoxRect().Size() !=
841 old_pixel_snapped_border_rect_size) 843 old_pixel_snapped_border_rect_size) {
842 GetScrollableArea()->UpdateAfterLayout(); 844 Layer()->UpdateScrollingAfterLayout();
845 }
843 return; 846 return;
844 } 847 }
845 848
846 SetLocation(location); 849 SetLocation(location);
847 } 850 }
848 851
849 IntRect LayoutBox::AbsoluteContentBox() const { 852 IntRect LayoutBox::AbsoluteContentBox() const {
850 // This is wrong with transforms and flipped writing modes. 853 // This is wrong with transforms and flipped writing modes.
851 IntRect rect = PixelSnappedIntRect(ContentBoxRect()); 854 IntRect rect = PixelSnappedIntRect(ContentBoxRect());
852 FloatPoint abs_pos = LocalToAbsolute(); 855 FloatPoint abs_pos = LocalToAbsolute();
(...skipping 5046 matching lines...) Expand 10 before | Expand all | Expand 10 after
5899 void LayoutBox::MutableForPainting:: 5902 void LayoutBox::MutableForPainting::
5900 SavePreviousContentBoxSizeAndLayoutOverflowRect() { 5903 SavePreviousContentBoxSizeAndLayoutOverflowRect() {
5901 auto& rare_data = GetLayoutBox().EnsureRareData(); 5904 auto& rare_data = GetLayoutBox().EnsureRareData();
5902 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; 5905 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true;
5903 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); 5906 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size();
5904 rare_data.previous_layout_overflow_rect_ = 5907 rare_data.previous_layout_overflow_rect_ =
5905 GetLayoutBox().LayoutOverflowRect(); 5908 GetLayoutBox().LayoutOverflowRect();
5906 } 5909 }
5907 5910
5908 } // namespace blink 5911 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.h ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698