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

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

Issue 2776563003: Only automatically promote sticky position elements which move with scroll. (Closed)
Patch Set: Merge with master Created 3 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) 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 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 1056
1057 return windowAutoscrollPoint - pointInRootFrame; 1057 return windowAutoscrollPoint - pointInRootFrame;
1058 } 1058 }
1059 1059
1060 LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* layoutObject) { 1060 LayoutBox* LayoutBox::findAutoscrollable(LayoutObject* layoutObject) {
1061 while ( 1061 while (
1062 layoutObject && 1062 layoutObject &&
1063 !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll())) { 1063 !(layoutObject->isBox() && toLayoutBox(layoutObject)->canAutoscroll())) {
1064 // Do not start autoscroll when the node is inside a fixed-position element. 1064 // Do not start autoscroll when the node is inside a fixed-position element.
1065 if (layoutObject->isBox() && toLayoutBox(layoutObject)->hasLayer() && 1065 if (layoutObject->isBox() && toLayoutBox(layoutObject)->hasLayer() &&
1066 toLayoutBox(layoutObject)->layer()->sticksToViewport()) { 1066 toLayoutBox(layoutObject)->layer()->fixedToViewport()) {
1067 return nullptr; 1067 return nullptr;
1068 } 1068 }
1069 1069
1070 if (!layoutObject->parent() && 1070 if (!layoutObject->parent() &&
1071 layoutObject->node() == layoutObject->document() && 1071 layoutObject->node() == layoutObject->document() &&
1072 layoutObject->document().localOwner()) 1072 layoutObject->document().localOwner())
1073 layoutObject = layoutObject->document().localOwner()->layoutObject(); 1073 layoutObject = layoutObject->document().localOwner()->layoutObject();
1074 else 1074 else
1075 layoutObject = layoutObject->parent(); 1075 layoutObject = layoutObject->parent();
1076 } 1076 }
(...skipping 4676 matching lines...) Expand 10 before | Expand all | Expand 10 after
5753 5753
5754 void LayoutBox::MutableForPainting:: 5754 void LayoutBox::MutableForPainting::
5755 savePreviousContentBoxSizeAndLayoutOverflowRect() { 5755 savePreviousContentBoxSizeAndLayoutOverflowRect() {
5756 auto& rareData = layoutBox().ensureRareData(); 5756 auto& rareData = layoutBox().ensureRareData();
5757 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; 5757 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true;
5758 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); 5758 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size();
5759 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); 5759 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect();
5760 } 5760 }
5761 5761
5762 } // namespace blink 5762 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698