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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp

Issue 2748973002: Strictly unbreakable objects need to prevent interaction with the outside. (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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp b/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp
index 3d5310931846e5443c88bdd45413c4d0896a43ca..0062a5a7d7fa19f85abaf2804916b110b90d1b4a 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlowThread.cpp
@@ -40,7 +40,8 @@ LayoutFlowThread::LayoutFlowThread()
m_pageLogicalSizeChanged(false) {}
LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf(
- const LayoutObject& descendant) {
+ const LayoutObject& descendant,
+ AncestorSearchConstraint constraint) {
ASSERT(descendant.isInsideFlowThread());
LayoutObject* curr = const_cast<LayoutObject*>(&descendant);
while (curr) {
@@ -49,6 +50,15 @@ LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf(
if (curr->isLayoutFlowThread())
return toLayoutFlowThread(curr);
LayoutObject* container = curr->container();
+ // If we're inside something strictly unbreakable (due to having scrollbars
+ // or being writing mode roots, for instance), it's also strictly
+ // unbreakable in any outer fragmentation context. As such, what goes on
+ // inside any fragmentation context on the inside of this is completely
+ // opaque to ancestor fragmentation contexts.
+ if (constraint == IsolateUnbreakableContainers && container &&
+ container->isBox() &&
+ toLayoutBox(container)->getPaginationBreakability() == ForbidBreaks)
+ return nullptr;
curr = curr->parent();
while (curr != container) {
if (curr->isLayoutFlowThread()) {

Powered by Google App Engine
This is Rietveld 408576698