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

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

Issue 1867693002: Better scrolling fix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refined Created 4 years, 8 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 void LayoutBlock::startDelayUpdateScrollInfo() 809 void LayoutBlock::startDelayUpdateScrollInfo()
810 { 810 {
811 if (gDelayUpdateScrollInfo == 0) { 811 if (gDelayUpdateScrollInfo == 0) {
812 ASSERT(!gDelayedUpdateScrollInfoSet); 812 ASSERT(!gDelayedUpdateScrollInfoSet);
813 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet; 813 gDelayedUpdateScrollInfoSet = new DelayedUpdateScrollInfoSet;
814 } 814 }
815 ASSERT(gDelayedUpdateScrollInfoSet); 815 ASSERT(gDelayedUpdateScrollInfoSet);
816 ++gDelayUpdateScrollInfo; 816 ++gDelayUpdateScrollInfo;
817 } 817 }
818 818
819 bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope, S crollPositionMap* scrollMap) 819 bool LayoutBlock::finishDelayUpdateScrollInfo(SubtreeLayoutScope* layoutScope)
820 { 820 {
821 bool childrenMarkedForRelayout = false; 821 bool childrenMarkedForRelayout = false;
822 822
823 --gDelayUpdateScrollInfo; 823 --gDelayUpdateScrollInfo;
824 ASSERT(gDelayUpdateScrollInfo >= 0); 824 ASSERT(gDelayUpdateScrollInfo >= 0);
825 if (gDelayUpdateScrollInfo == 0) { 825 if (gDelayUpdateScrollInfo == 0) {
826 ASSERT(gDelayedUpdateScrollInfoSet); 826 ASSERT(gDelayedUpdateScrollInfoSet);
827 827
828 OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScroll InfoSet)); 828 OwnPtr<DelayedUpdateScrollInfoSet> infoSet(adoptPtr(gDelayedUpdateScroll InfoSet));
829 gDelayedUpdateScrollInfoSet = nullptr; 829 gDelayedUpdateScrollInfoSet = nullptr;
830 830
831 for (auto* block : *infoSet) { 831 for (auto* block : *infoSet) {
832 if (block->hasOverflowClip()) { 832 if (block->hasOverflowClip()) {
833 PaintLayerScrollableArea* scrollableArea = block->layer()->getSc rollableArea(); 833 childrenMarkedForRelayout |= block->layer()->getScrollableArea() ->updateAfterLayout(layoutScope);
834 if (scrollMap)
835 scrollMap->add(scrollableArea, scrollableArea->scrollPositio nDouble());
836 childrenMarkedForRelayout |= scrollableArea->updateAfterLayout(l ayoutScope);
837 } 834 }
838 } 835 }
839 } 836 }
840 return childrenMarkedForRelayout; 837 return childrenMarkedForRelayout;
841 } 838 }
842 839
843 void LayoutBlock::updateScrollInfoAfterLayout() 840 void LayoutBlock::updateScrollInfoAfterLayout()
844 { 841 {
845 if (hasOverflowClip()) { 842 if (hasOverflowClip()) {
846 if (style()->isFlippedBlocksWritingMode()) { 843 if (style()->isFlippedBlocksWritingMode()) {
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2826 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const 2823 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout Object* obj) const
2827 { 2824 {
2828 showLayoutObject(); 2825 showLayoutObject();
2829 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 2826 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
2830 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 2827 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
2831 } 2828 }
2832 2829
2833 #endif 2830 #endif
2834 2831
2835 } // namespace blink 2832 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698