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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp

Issue 1850153002: Make top-layer elements work also when the viewport is paginated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/pagination/modal-dialog-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 25 matching lines...) Expand all
36 * licenses (the MPL or the GPL) and not to allow others to use your 36 * licenses (the MPL or the GPL) and not to allow others to use your
37 * version of this file under the LGPL, indicate your decision by 37 * version of this file under the LGPL, indicate your decision by
38 * deletingthe provisions above and replace them with the notice and 38 * deletingthe provisions above and replace them with the notice and
39 * other provisions required by the MPL or the GPL, as the case may be. 39 * other provisions required by the MPL or the GPL, as the case may be.
40 * If you do not delete the provisions above, a recipient may use your 40 * If you do not delete the provisions above, a recipient may use your
41 * version of this file under any of the LGPL, the MPL or the GPL. 41 * version of this file under any of the LGPL, the MPL or the GPL.
42 */ 42 */
43 43
44 #include "core/paint/PaintLayerStackingNode.h" 44 #include "core/paint/PaintLayerStackingNode.h"
45 45
46 #include "core/layout/LayoutMultiColumnFlowThread.h"
46 #include "core/layout/LayoutView.h" 47 #include "core/layout/LayoutView.h"
47 #include "core/layout/compositing/PaintLayerCompositor.h" 48 #include "core/layout/compositing/PaintLayerCompositor.h"
48 #include "core/paint/PaintLayer.h" 49 #include "core/paint/PaintLayer.h"
49 #include "public/platform/Platform.h" 50 #include "public/platform/Platform.h"
50 #include <algorithm> 51 #include <algorithm>
51 52
52 namespace blink { 53 namespace blink {
53 54
54 // FIXME: This should not require PaintLayer. There is currently a cycle where 55 // FIXME: This should not require PaintLayer. There is currently a cycle where
55 // in order to determine if we isStacked() we have to ask the paint 56 // in order to determine if we isStacked() we have to ask the paint
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // Sort the two lists. 130 // Sort the two lists.
130 if (m_posZOrderList) 131 if (m_posZOrderList)
131 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa reZIndex); 132 std::stable_sort(m_posZOrderList->begin(), m_posZOrderList->end(), compa reZIndex);
132 133
133 if (m_negZOrderList) 134 if (m_negZOrderList)
134 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa reZIndex); 135 std::stable_sort(m_negZOrderList->begin(), m_negZOrderList->end(), compa reZIndex);
135 136
136 // Append layers for top layer elements after normal layer collection, to en sure they are on top regardless of z-indexes. 137 // Append layers for top layer elements after normal layer collection, to en sure they are on top regardless of z-indexes.
137 // The layoutObjects of top layer elements are children of the view, sorted in top layer stacking order. 138 // The layoutObjects of top layer elements are children of the view, sorted in top layer stacking order.
138 if (layer()->isRootLayer()) { 139 if (layer()->isRootLayer()) {
139 LayoutView* view = layoutObject()->view(); 140 LayoutBlockFlow* rootBlock = layoutObject()->view();
140 for (LayoutObject* child = view->firstChild(); child; child = child->nex tSibling()) { 141 // If the viewport is paginated, everything (including "top-layer" eleme nts) gets
142 // redirected to the flow thread. So that's where we have to look, in th at case.
143 if (LayoutBlockFlow* multiColumnFlowThread = rootBlock->multiColumnFlowT hread())
144 rootBlock = multiColumnFlowThread;
145 for (LayoutObject* child = rootBlock->firstChild(); child; child = child ->nextSibling()) {
141 Element* childElement = (child->node() && child->node()->isElementNo de()) ? toElement(child->node()) : 0; 146 Element* childElement = (child->node() && child->node()->isElementNo de()) ? toElement(child->node()) : 0;
142 if (childElement && childElement->isInTopLayer()) { 147 if (childElement && childElement->isInTopLayer()) {
143 PaintLayer* layer = toLayoutBoxModelObject(child)->layer(); 148 PaintLayer* layer = toLayoutBoxModelObject(child)->layer();
144 // Create the buffer if it doesn't exist yet. 149 // Create the buffer if it doesn't exist yet.
145 if (!m_posZOrderList) 150 if (!m_posZOrderList)
146 m_posZOrderList = adoptPtr(new Vector<PaintLayerStackingNode *>); 151 m_posZOrderList = adoptPtr(new Vector<PaintLayerStackingNode *>);
147 m_posZOrderList->append(layer->stackingNode()); 152 m_posZOrderList->append(layer->stackingNode());
148 } 153 }
149 } 154 }
150 } 155 }
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 } 255 }
251 return 0; 256 return 0;
252 } 257 }
253 258
254 LayoutBoxModelObject* PaintLayerStackingNode::layoutObject() const 259 LayoutBoxModelObject* PaintLayerStackingNode::layoutObject() const
255 { 260 {
256 return m_layer->layoutObject(); 261 return m_layer->layoutObject();
257 } 262 }
258 263
259 } // namespace blink 264 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/pagination/modal-dialog-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698