diff options
Diffstat (limited to 'WebCore/rendering/RenderLayer.cpp')
-rw-r--r-- | WebCore/rendering/RenderLayer.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp index da6fad1..63233e5 100644 --- a/WebCore/rendering/RenderLayer.cpp +++ b/WebCore/rendering/RenderLayer.cpp @@ -468,6 +468,28 @@ TransformationMatrix RenderLayer::renderableTransform(PaintBehavior paintBehavio return *m_transform; } +static bool checkContainingBlockChainForPagination(RenderBoxModelObject* renderer, RenderBox* ancestorColumnsRenderer) +{ + RenderView* view = renderer->view(); + RenderBoxModelObject* prevBlock = renderer; + RenderBlock* containingBlock; + for (containingBlock = renderer->containingBlock(); + containingBlock && containingBlock != view && containingBlock != ancestorColumnsRenderer; + containingBlock = containingBlock->containingBlock()) + prevBlock = containingBlock; + + // If the columns block wasn't in our containing block chain, then we aren't paginated by it. + if (containingBlock != ancestorColumnsRenderer) + return false; + + // If the previous block is absolutely positioned, then we can't be paginated by the columns block. + if (prevBlock->isPositioned()) + return false; + + // Otherwise we are paginated by the columns block. + return true; +} + void RenderLayer::updatePagination() { m_isPaginated = false; @@ -484,10 +506,10 @@ void RenderLayer::updatePagination() RenderLayer* ancestorStackingContext = stackingContext(); for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { if (curr->renderer()->hasColumns()) { - m_isPaginated = true; + m_isPaginated = checkContainingBlockChainForPagination(renderer(), curr->renderBox()); return; } - if (curr == ancestorStackingContext || (curr->parent() && curr->parent()->renderer()->isPositioned())) + if (curr == ancestorStackingContext) return; } } @@ -2912,7 +2934,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont // Next we want to see if the mouse pos is inside the child RenderObjects of the layer. if (fgRect.intersects(hitTestArea) && isSelfPaintingLayer()) { // Hit test with a temporary HitTestResult, because we only want to commit to 'result' if we know we're frontmost. - HitTestResult tempResult(result.point(), result.padding()); + HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding()); if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestDescendants) && isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) { if (result.isRectBasedTest()) @@ -2941,7 +2963,7 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont return candidateLayer; if (bgRect.intersects(hitTestArea) && isSelfPaintingLayer()) { - HitTestResult tempResult(result.point(), result.padding()); + HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding()); if (hitTestContents(request, tempResult, layerBounds, hitTestPoint, HitTestSelf) && isHitCandidate(this, false, zOffsetForContentsPtr, unflattenedTransformState.get())) { if (result.isRectBasedTest()) @@ -2998,7 +3020,7 @@ RenderLayer* RenderLayer::hitTestList(Vector<RenderLayer*>* list, RenderLayer* r for (int i = list->size() - 1; i >= 0; --i) { RenderLayer* childLayer = list->at(i); RenderLayer* hitLayer = 0; - HitTestResult tempResult(result.point(), result.padding()); + HitTestResult tempResult(result.point(), result.topPadding(), result.rightPadding(), result.bottomPadding(), result.leftPadding()); if (childLayer->isPaginated()) hitLayer = hitTestPaginatedChildLayer(childLayer, rootLayer, request, tempResult, hitTestRect, hitTestPoint, transformState, zOffsetForDescendants); else |