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

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

Issue 2716583005: Do not promote position sticky or fixed elements unless they move with scroll. (Closed)
Patch Set: Created 3 years, 9 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 4653 matching lines...) Expand 10 before | Expand all | Expand 10 after
5730 5730
5731 void LayoutBox::MutableForPainting:: 5731 void LayoutBox::MutableForPainting::
5732 savePreviousContentBoxSizeAndLayoutOverflowRect() { 5732 savePreviousContentBoxSizeAndLayoutOverflowRect() {
5733 auto& rareData = layoutBox().ensureRareData(); 5733 auto& rareData = layoutBox().ensureRareData();
5734 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true; 5734 rareData.m_hasPreviousContentBoxSizeAndLayoutOverflowRect = true;
5735 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size(); 5735 rareData.m_previousContentBoxSize = layoutBox().contentBoxRect().size();
5736 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect(); 5736 rareData.m_previousLayoutOverflowRect = layoutBox().layoutOverflowRect();
5737 } 5737 }
5738 5738
5739 } // namespace blink 5739 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698