| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
| 9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
| 10 * disclaimer. | 10 * disclaimer. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/layout/LayoutMultiColumnSet.h" | 33 #include "core/layout/LayoutMultiColumnSet.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 LayoutFlowThread::LayoutFlowThread() | 37 LayoutFlowThread::LayoutFlowThread() |
| 38 : LayoutBlockFlow(nullptr), | 38 : LayoutBlockFlow(nullptr), |
| 39 m_columnSetsInvalidated(false), | 39 m_columnSetsInvalidated(false), |
| 40 m_pageLogicalSizeChanged(false) {} | 40 m_pageLogicalSizeChanged(false) {} |
| 41 | 41 |
| 42 LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf( | 42 LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf( |
| 43 const LayoutObject& descendant) { | 43 const LayoutObject& descendant, |
| 44 AncestorSearchConstraint constraint) { |
| 44 ASSERT(descendant.isInsideFlowThread()); | 45 ASSERT(descendant.isInsideFlowThread()); |
| 45 LayoutObject* curr = const_cast<LayoutObject*>(&descendant); | 46 LayoutObject* curr = const_cast<LayoutObject*>(&descendant); |
| 46 while (curr) { | 47 while (curr) { |
| 47 if (curr->isSVGChild()) | 48 if (curr->isSVGChild()) |
| 48 return nullptr; | 49 return nullptr; |
| 49 if (curr->isLayoutFlowThread()) | 50 if (curr->isLayoutFlowThread()) |
| 50 return toLayoutFlowThread(curr); | 51 return toLayoutFlowThread(curr); |
| 51 LayoutObject* container = curr->container(); | 52 LayoutObject* container = curr->container(); |
| 53 // If we're inside something strictly unbreakable (due to having scrollbars |
| 54 // or being writing mode roots, for instance), it's also strictly |
| 55 // unbreakable in any outer fragmentation context. As such, what goes on |
| 56 // inside any fragmentation context on the inside of this is completely |
| 57 // opaque to ancestor fragmentation contexts. |
| 58 if (constraint == IsolateUnbreakableContainers && container && |
| 59 container->isBox() && |
| 60 toLayoutBox(container)->getPaginationBreakability() == ForbidBreaks) |
| 61 return nullptr; |
| 52 curr = curr->parent(); | 62 curr = curr->parent(); |
| 53 while (curr != container) { | 63 while (curr != container) { |
| 54 if (curr->isLayoutFlowThread()) { | 64 if (curr->isLayoutFlowThread()) { |
| 55 // The nearest ancestor flow thread isn't in our containing block chain. | 65 // The nearest ancestor flow thread isn't in our containing block chain. |
| 56 // Then we aren't really part of any flow thread, and we should stop | 66 // Then we aren't really part of any flow thread, and we should stop |
| 57 // looking. This happens when there are out-of-flow objects or column | 67 // looking. This happens when there are out-of-flow objects or column |
| 58 // spanners. | 68 // spanners. |
| 59 return nullptr; | 69 return nullptr; |
| 60 } | 70 } |
| 61 curr = curr->parent(); | 71 curr = curr->parent(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 242 |
| 233 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded( | 243 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded( |
| 234 const MultiColumnSetInterval& interval) { | 244 const MultiColumnSetInterval& interval) { |
| 235 if (m_result) | 245 if (m_result) |
| 236 return; | 246 return; |
| 237 if (interval.low() <= m_offset && interval.high() > m_offset) | 247 if (interval.low() <= m_offset && interval.high() > m_offset) |
| 238 m_result = interval.data(); | 248 m_result = interval.data(); |
| 239 } | 249 } |
| 240 | 250 |
| 241 } // namespace blink | 251 } // namespace blink |
| OLD | NEW |