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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp b/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
index a37c621510e2a31d5398449dfcf255c9ba1bcaa8..8489a694dcb1f477305d41cefd0760f5124543e9 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerStackingNode.cpp
@@ -43,6 +43,7 @@
#include "core/paint/PaintLayerStackingNode.h"
+#include "core/layout/LayoutMultiColumnFlowThread.h"
#include "core/layout/LayoutView.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
#include "core/paint/PaintLayer.h"
@@ -136,8 +137,12 @@ void PaintLayerStackingNode::rebuildZOrderLists()
// Append layers for top layer elements after normal layer collection, to ensure they are on top regardless of z-indexes.
// The layoutObjects of top layer elements are children of the view, sorted in top layer stacking order.
if (layer()->isRootLayer()) {
- LayoutView* view = layoutObject()->view();
- for (LayoutObject* child = view->firstChild(); child; child = child->nextSibling()) {
+ LayoutBlockFlow* rootBlock = layoutObject()->view();
+ // If the viewport is paginated, everything (including "top-layer" elements) gets
+ // redirected to the flow thread. So that's where we have to look, in that case.
+ if (LayoutBlockFlow* multiColumnFlowThread = rootBlock->multiColumnFlowThread())
+ rootBlock = multiColumnFlowThread;
+ for (LayoutObject* child = rootBlock->firstChild(); child; child = child->nextSibling()) {
Element* childElement = (child->node() && child->node()->isElementNode()) ? toElement(child->node()) : 0;
if (childElement && childElement->isInTopLayer()) {
PaintLayer* layer = toLayoutBoxModelObject(child)->layer();
« 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