| OLD | NEW |
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "core/page/Page.h" | 58 #include "core/page/Page.h" |
| 59 #include "core/frame/Settings.h" | 59 #include "core/frame/Settings.h" |
| 60 #include "core/frame/animation/AnimationController.h" | 60 #include "core/frame/animation/AnimationController.h" |
| 61 #include "core/page/scrolling/ScrollingCoordinator.h" | 61 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 62 #include "core/rendering/ColumnInfo.h" | 62 #include "core/rendering/ColumnInfo.h" |
| 63 #include "core/rendering/CompositedLayerMapping.h" | 63 #include "core/rendering/CompositedLayerMapping.h" |
| 64 #include "core/rendering/FilterEffectRenderer.h" | 64 #include "core/rendering/FilterEffectRenderer.h" |
| 65 #include "core/rendering/HitTestRequest.h" | 65 #include "core/rendering/HitTestRequest.h" |
| 66 #include "core/rendering/HitTestResult.h" | 66 #include "core/rendering/HitTestResult.h" |
| 67 #include "core/rendering/HitTestingTransformState.h" | 67 #include "core/rendering/HitTestingTransformState.h" |
| 68 #include "core/rendering/RenderFlowThread.h" | |
| 69 #include "core/rendering/RenderGeometryMap.h" | 68 #include "core/rendering/RenderGeometryMap.h" |
| 70 #include "core/rendering/RenderInline.h" | 69 #include "core/rendering/RenderInline.h" |
| 71 #include "core/rendering/RenderLayerCompositor.h" | 70 #include "core/rendering/RenderLayerCompositor.h" |
| 72 #include "core/rendering/RenderReplica.h" | 71 #include "core/rendering/RenderReplica.h" |
| 73 #include "core/rendering/RenderScrollbar.h" | 72 #include "core/rendering/RenderScrollbar.h" |
| 74 #include "core/rendering/RenderScrollbarPart.h" | 73 #include "core/rendering/RenderScrollbarPart.h" |
| 75 #include "core/rendering/RenderTreeAsText.h" | 74 #include "core/rendering/RenderTreeAsText.h" |
| 76 #include "core/rendering/RenderView.h" | 75 #include "core/rendering/RenderView.h" |
| 77 #include "core/rendering/svg/ReferenceFilterBuilder.h" | 76 #include "core/rendering/svg/ReferenceFilterBuilder.h" |
| 78 #include "core/rendering/svg/RenderSVGResourceClipper.h" | 77 #include "core/rendering/svg/RenderSVGResourceClipper.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 279 |
| 281 // Go ahead and update the reflection's position and size. | 280 // Go ahead and update the reflection's position and size. |
| 282 if (m_reflectionInfo) | 281 if (m_reflectionInfo) |
| 283 m_reflectionInfo->reflection()->layout(); | 282 m_reflectionInfo->reflection()->layout(); |
| 284 | 283 |
| 285 // Clear the IsCompositingUpdateRoot flag once we've found the first composi
ting layer in this update. | 284 // Clear the IsCompositingUpdateRoot flag once we've found the first composi
ting layer in this update. |
| 286 bool isUpdateRoot = (flags & IsCompositingUpdateRoot); | 285 bool isUpdateRoot = (flags & IsCompositingUpdateRoot); |
| 287 if (hasCompositedLayerMapping()) | 286 if (hasCompositedLayerMapping()) |
| 288 flags &= ~IsCompositingUpdateRoot; | 287 flags &= ~IsCompositingUpdateRoot; |
| 289 | 288 |
| 290 if (useRegionBasedColumns() && renderer()->isInFlowRenderFlowThread()) { | |
| 291 updatePagination(); | |
| 292 flags |= UpdatePagination; | |
| 293 } | |
| 294 | |
| 295 if (renderer()->hasColumns()) | 289 if (renderer()->hasColumns()) |
| 296 flags |= UpdatePagination; | 290 flags |= UpdatePagination; |
| 297 | 291 |
| 298 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) | 292 for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) |
| 299 child->updateLayerPositions(geometryMap, flags); | 293 child->updateLayerPositions(geometryMap, flags); |
| 300 | 294 |
| 301 if ((flags & UpdateCompositingLayers) && hasCompositedLayerMapping()) { | 295 if ((flags & UpdateCompositingLayers) && hasCompositedLayerMapping()) { |
| 302 CompositedLayerMapping::UpdateAfterLayoutFlags updateFlags = CompositedL
ayerMapping::CompositingChildrenOnly; | 296 CompositedLayerMapping::UpdateAfterLayoutFlags updateFlags = CompositedL
ayerMapping::CompositingChildrenOnly; |
| 303 if (flags & NeedsFullRepaintInBacking) | 297 if (flags & NeedsFullRepaintInBacking) |
| 304 updateFlags |= CompositedLayerMapping::NeedsFullRepaint; | 298 updateFlags |= CompositedLayerMapping::NeedsFullRepaint; |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 return false; | 585 return false; |
| 592 | 586 |
| 593 // If the previous block is absolutely positioned, then we can't be paginate
d by the columns block. | 587 // If the previous block is absolutely positioned, then we can't be paginate
d by the columns block. |
| 594 if (prevBlock->isOutOfFlowPositioned()) | 588 if (prevBlock->isOutOfFlowPositioned()) |
| 595 return false; | 589 return false; |
| 596 | 590 |
| 597 // Otherwise we are paginated by the columns block. | 591 // Otherwise we are paginated by the columns block. |
| 598 return true; | 592 return true; |
| 599 } | 593 } |
| 600 | 594 |
| 601 bool RenderLayer::useRegionBasedColumns() const | |
| 602 { | |
| 603 const Settings* settings = renderer()->document().settings(); | |
| 604 return settings && settings->regionBasedColumnsEnabled(); | |
| 605 } | |
| 606 | |
| 607 void RenderLayer::updatePagination() | 595 void RenderLayer::updatePagination() |
| 608 { | 596 { |
| 609 m_isPaginated = false; | 597 m_isPaginated = false; |
| 610 m_enclosingPaginationLayer = 0; | 598 m_enclosingPaginationLayer = 0; |
| 611 | 599 |
| 612 if (hasCompositedLayerMapping() || !parent()) | 600 if (hasCompositedLayerMapping() || !parent()) |
| 613 return; // FIXME: We will have to deal with paginated compositing layers
someday. | 601 return; // FIXME: We will have to deal with paginated compositing layers
someday. |
| 614 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. | 602 // FIXME: For now the RenderView can't be paginated. Eventually
printing will move to a model where it is though. |
| 615 | 603 |
| 616 // The main difference between the paginated booleans for the old column cod
e and the new column code | 604 if (m_stackingNode->isNormalFlowOnly()) { |
| 617 // is that each paginated layer has to paint on its own with the new code. T
here is no | 605 m_isPaginated = parent()->renderer()->hasColumns(); |
| 618 // recurring into child layers. This means that the m_isPaginated bits for t
he new column code can't just be set on | |
| 619 // "roots" that get split and paint all their descendants. Instead each laye
r has to be checked individually and | |
| 620 // genuinely know if it is going to have to split itself up when painting on
ly its contents (and not any other descendant | |
| 621 // layers). We track an enclosingPaginationLayer instead of using a simple b
it, since we want to be able to get back | |
| 622 // to that layer easily. | |
| 623 bool regionBasedColumnsUsed = useRegionBasedColumns(); | |
| 624 if (regionBasedColumnsUsed && renderer()->isInFlowRenderFlowThread()) { | |
| 625 m_enclosingPaginationLayer = this; | |
| 626 return; | 606 return; |
| 627 } | 607 } |
| 628 | 608 |
| 629 if (m_stackingNode->isNormalFlowOnly()) { | |
| 630 if (regionBasedColumnsUsed) { | |
| 631 // Content inside a transform is not considered to be paginated, sin
ce we simply | |
| 632 // paint the transform multiple times in each column, so we don't ha
ve to use | |
| 633 // fragments for the transformed content. | |
| 634 m_enclosingPaginationLayer = parent()->enclosingPaginationLayer(); | |
| 635 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->hasTra
nsform()) | |
| 636 m_enclosingPaginationLayer = 0; | |
| 637 } else | |
| 638 m_isPaginated = parent()->renderer()->hasColumns(); | |
| 639 return; | |
| 640 } | |
| 641 | |
| 642 // For the new columns code, we want to walk up our containing block chain l
ooking for an enclosing layer. Once | |
| 643 // we find one, then we just check its pagination status. | |
| 644 if (regionBasedColumnsUsed) { | |
| 645 RenderView* view = renderer()->view(); | |
| 646 RenderBlock* containingBlock; | |
| 647 for (containingBlock = renderer()->containingBlock(); | |
| 648 containingBlock && containingBlock != view; | |
| 649 containingBlock = containingBlock->containingBlock()) { | |
| 650 if (containingBlock->hasLayer()) { | |
| 651 // Content inside a transform is not considered to be paginated,
since we simply | |
| 652 // paint the transform multiple times in each column, so we don'
t have to use | |
| 653 // fragments for the transformed content. | |
| 654 m_enclosingPaginationLayer = containingBlock->layer()->enclosing
PaginationLayer(); | |
| 655 if (m_enclosingPaginationLayer && m_enclosingPaginationLayer->ha
sTransform()) | |
| 656 m_enclosingPaginationLayer = 0; | |
| 657 return; | |
| 658 } | |
| 659 } | |
| 660 return; | |
| 661 } | |
| 662 | |
| 663 // If we're not normal flow, then we need to look for a multi-column object
between us and our stacking container. | 609 // If we're not normal flow, then we need to look for a multi-column object
between us and our stacking container. |
| 664 RenderLayerStackingNode* ancestorStackingContainerNode = m_stackingNode->anc
estorStackingContainerNode(); | 610 RenderLayerStackingNode* ancestorStackingContainerNode = m_stackingNode->anc
estorStackingContainerNode(); |
| 665 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 611 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
| 666 if (curr->renderer()->hasColumns()) { | 612 if (curr->renderer()->hasColumns()) { |
| 667 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); | 613 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); |
| 668 return; | 614 return; |
| 669 } | 615 } |
| 670 if (curr->stackingNode() == ancestorStackingContainerNode) | 616 if (curr->stackingNode() == ancestorStackingContainerNode) |
| 671 return; | 617 return; |
| 672 } | 618 } |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 | 1186 |
| 1241 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always | 1187 // We don't use fragment boxes when collecting a transformed layer's bou
nding box, since it always |
| 1242 // paints unfragmented. | 1188 // paints unfragmented. |
| 1243 LayoutRect clipRect = layer->boundingBox(layer); | 1189 LayoutRect clipRect = layer->boundingBox(layer); |
| 1244 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, paintBehavior); | 1190 expandClipRectForDescendantsAndReflection(clipRect, layer, layer, transp
arencyBehavior, paintBehavior); |
| 1245 layer->renderer()->style()->filterOutsets().expandRect(clipRect); | 1191 layer->renderer()->style()->filterOutsets().expandRect(clipRect); |
| 1246 LayoutRect result = transform.mapRect(clipRect); | 1192 LayoutRect result = transform.mapRect(clipRect); |
| 1247 if (!paginationLayer) | 1193 if (!paginationLayer) |
| 1248 return result; | 1194 return result; |
| 1249 | 1195 |
| 1250 // We have to break up the transformed extent across our columns. | |
| 1251 // Split our box up into the actual fragment boxes that render in the co
lumns/pages and unite those together to | |
| 1252 // get our true bounding box. | |
| 1253 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(paginationLay
er->renderer()); | |
| 1254 result = enclosingFlowThread->fragmentsBoundingBox(result); | |
| 1255 | |
| 1256 LayoutPoint rootLayerDelta; | 1196 LayoutPoint rootLayerDelta; |
| 1257 paginationLayer->convertToLayerCoords(rootLayer, rootLayerDelta); | 1197 paginationLayer->convertToLayerCoords(rootLayer, rootLayerDelta); |
| 1258 result.moveBy(rootLayerDelta); | 1198 result.moveBy(rootLayerDelta); |
| 1259 return result; | 1199 return result; |
| 1260 } | 1200 } |
| 1261 | 1201 |
| 1262 LayoutRect clipRect = layer->boundingBox(rootLayer, RenderLayer::UseFragment
Boxes); | 1202 LayoutRect clipRect = layer->boundingBox(rootLayer, RenderLayer::UseFragment
Boxes); |
| 1263 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transp
arencyBehavior, paintBehavior); | 1203 expandClipRectForDescendantsAndReflection(clipRect, layer, rootLayer, transp
arencyBehavior, paintBehavior); |
| 1264 layer->renderer()->style()->filterOutsets().expandRect(clipRect); | 1204 layer->renderer()->style()->filterOutsets().expandRect(clipRect); |
| 1265 return clipRect; | 1205 return clipRect; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 } | 1423 } |
| 1484 | 1424 |
| 1485 // Returns the layer reached on the walk up towards the ancestor. | 1425 // Returns the layer reached on the walk up towards the ancestor. |
| 1486 static inline const RenderLayer* accumulateOffsetTowardsAncestor(const RenderLay
er* layer, const RenderLayer* ancestorLayer, LayoutPoint& location) | 1426 static inline const RenderLayer* accumulateOffsetTowardsAncestor(const RenderLay
er* layer, const RenderLayer* ancestorLayer, LayoutPoint& location) |
| 1487 { | 1427 { |
| 1488 ASSERT(ancestorLayer != layer); | 1428 ASSERT(ancestorLayer != layer); |
| 1489 | 1429 |
| 1490 const RenderLayerModelObject* renderer = layer->renderer(); | 1430 const RenderLayerModelObject* renderer = layer->renderer(); |
| 1491 EPosition position = renderer->style()->position(); | 1431 EPosition position = renderer->style()->position(); |
| 1492 | 1432 |
| 1493 // FIXME: Special casing RenderFlowThread so much for fixed positioning here
is not great. | 1433 if (position == FixedPosition && (!ancestorLayer || ancestorLayer == rendere
r->view()->layer())) { |
| 1494 RenderFlowThread* fixedFlowThreadContainer = position == FixedPosition ? ren
derer->flowThreadContainingBlock() : 0; | |
| 1495 if (fixedFlowThreadContainer && !fixedFlowThreadContainer->isOutOfFlowPositi
oned()) | |
| 1496 fixedFlowThreadContainer = 0; | |
| 1497 | |
| 1498 // FIXME: Positioning of out-of-flow(fixed, absolute) elements collected in
a RenderFlowThread | |
| 1499 // may need to be revisited in a future patch. | |
| 1500 // If the fixed renderer is inside a RenderFlowThread, we should not compute
location using localToAbsolute, | |
| 1501 // since localToAbsolute maps the coordinates from named flow to regions coo
rdinates and regions can be | |
| 1502 // positioned in a completely different place in the viewport (RenderView). | |
| 1503 if (position == FixedPosition && !fixedFlowThreadContainer && (!ancestorLaye
r || ancestorLayer == renderer->view()->layer())) { | |
| 1504 // If the fixed layer's container is the root, just add in the offset of
the view. We can obtain this by calling | 1434 // If the fixed layer's container is the root, just add in the offset of
the view. We can obtain this by calling |
| 1505 // localToAbsolute() on the RenderView. | 1435 // localToAbsolute() on the RenderView. |
| 1506 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), IsFixed); | 1436 FloatPoint absPos = renderer->localToAbsolute(FloatPoint(), IsFixed); |
| 1507 location += LayoutSize(absPos.x(), absPos.y()); | 1437 location += LayoutSize(absPos.x(), absPos.y()); |
| 1508 return ancestorLayer; | 1438 return ancestorLayer; |
| 1509 } | 1439 } |
| 1510 | 1440 |
| 1511 // For the fixed positioned elements inside a render flow thread, we should
also skip the code path below | 1441 if (position == FixedPosition) { |
| 1512 // Otherwise, for the case of ancestorLayer == rootLayer and fixed positione
d element child of a transformed | |
| 1513 // element in render flow thread, we will hit the fixed positioned container
before hitting the ancestor layer. | |
| 1514 if (position == FixedPosition && !fixedFlowThreadContainer) { | |
| 1515 // For a fixed layers, we need to walk up to the root to see if there's
a fixed position container | 1442 // For a fixed layers, we need to walk up to the root to see if there's
a fixed position container |
| 1516 // (e.g. a transformed layer). It's an error to call convertToLayerCoord
s() across a layer with a transform, | 1443 // (e.g. a transformed layer). It's an error to call convertToLayerCoord
s() across a layer with a transform, |
| 1517 // so we should always find the ancestor at or before we find the fixed
position container. | 1444 // so we should always find the ancestor at or before we find the fixed
position container. |
| 1518 RenderLayer* fixedPositionContainerLayer = 0; | 1445 RenderLayer* fixedPositionContainerLayer = 0; |
| 1519 bool foundAncestor = false; | 1446 bool foundAncestor = false; |
| 1520 for (RenderLayer* currLayer = layer->parent(); currLayer; currLayer = cu
rrLayer->parent()) { | 1447 for (RenderLayer* currLayer = layer->parent(); currLayer; currLayer = cu
rrLayer->parent()) { |
| 1521 if (currLayer == ancestorLayer) | 1448 if (currLayer == ancestorLayer) |
| 1522 foundAncestor = true; | 1449 foundAncestor = true; |
| 1523 | 1450 |
| 1524 if (isFixedPositionedContainer(currLayer)) { | 1451 if (isFixedPositionedContainer(currLayer)) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1557 break; | 1484 break; |
| 1558 | 1485 |
| 1559 if (parentLayer == ancestorLayer) { | 1486 if (parentLayer == ancestorLayer) { |
| 1560 foundAncestorFirst = true; | 1487 foundAncestorFirst = true; |
| 1561 break; | 1488 break; |
| 1562 } | 1489 } |
| 1563 | 1490 |
| 1564 parentLayer = parentLayer->parent(); | 1491 parentLayer = parentLayer->parent(); |
| 1565 } | 1492 } |
| 1566 | 1493 |
| 1567 // We should not reach RenderView layer past the RenderFlowThread layer
for any | |
| 1568 // children of the RenderFlowThread. | |
| 1569 if (renderer->flowThreadContainingBlock() && !layer->isOutOfFlowRenderFl
owThread()) | |
| 1570 ASSERT(parentLayer != renderer->view()->layer()); | |
| 1571 | |
| 1572 if (foundAncestorFirst) { | 1494 if (foundAncestorFirst) { |
| 1573 // Found ancestorLayer before the abs. positioned container, so comp
ute offset of both relative | 1495 // Found ancestorLayer before the abs. positioned container, so comp
ute offset of both relative |
| 1574 // to enclosingPositionedAncestor and subtract. | 1496 // to enclosingPositionedAncestor and subtract. |
| 1575 RenderLayer* positionedAncestor = parentLayer->enclosingPositionedAn
cestor(); | 1497 RenderLayer* positionedAncestor = parentLayer->enclosingPositionedAn
cestor(); |
| 1576 | 1498 |
| 1577 LayoutPoint thisCoords; | 1499 LayoutPoint thisCoords; |
| 1578 layer->convertToLayerCoords(positionedAncestor, thisCoords); | 1500 layer->convertToLayerCoords(positionedAncestor, thisCoords); |
| 1579 | 1501 |
| 1580 LayoutPoint ancestorCoords; | 1502 LayoutPoint ancestorCoords; |
| 1581 ancestorLayer->convertToLayerCoords(positionedAncestor, ancestorCoor
ds); | 1503 ancestorLayer->convertToLayerCoords(positionedAncestor, ancestorCoor
ds); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 if (hasCompositedLayerMapping()) | 1630 if (hasCompositedLayerMapping()) |
| 1709 return compositedLayerMapping()->collectTrackedRepaintRects(); | 1631 return compositedLayerMapping()->collectTrackedRepaintRects(); |
| 1710 return nullptr; | 1632 return nullptr; |
| 1711 } | 1633 } |
| 1712 | 1634 |
| 1713 bool RenderLayer::hasOverflowControls() const | 1635 bool RenderLayer::hasOverflowControls() const |
| 1714 { | 1636 { |
| 1715 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); | 1637 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->hasScrollCorner() || renderer()->style()->resize() != RESIZE_NONE); |
| 1716 } | 1638 } |
| 1717 | 1639 |
| 1718 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, RenderRegion* region, P
aintLayerFlags paintFlags) | 1640 void RenderLayer::paint(GraphicsContext* context, const LayoutRect& damageRect,
PaintBehavior paintBehavior, RenderObject* paintingRoot, PaintLayerFlags paintFl
ags) |
| 1719 { | 1641 { |
| 1720 OverlapTestRequestMap overlapTestRequests; | 1642 OverlapTestRequestMap overlapTestRequests; |
| 1721 | 1643 |
| 1722 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot, region, &overlapTestRequests); | 1644 LayerPaintingInfo paintingInfo(this, enclosingIntRect(damageRect), paintBeha
vior, LayoutSize(), paintingRoot, &overlapTestRequests); |
| 1723 paintLayer(context, paintingInfo, paintFlags); | 1645 paintLayer(context, paintingInfo, paintFlags); |
| 1724 | 1646 |
| 1725 OverlapTestRequestMap::iterator end = overlapTestRequests.end(); | 1647 OverlapTestRequestMap::iterator end = overlapTestRequests.end(); |
| 1726 for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it !=
end; ++it) | 1648 for (OverlapTestRequestMap::iterator it = overlapTestRequests.begin(); it !=
end; ++it) |
| 1727 it->key->setIsOverlapped(false); | 1649 it->key->setIsOverlapped(false); |
| 1728 } | 1650 } |
| 1729 | 1651 |
| 1730 void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
ect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) | 1652 void RenderLayer::paintOverlayScrollbars(GraphicsContext* context, const LayoutR
ect& damageRect, PaintBehavior paintBehavior, RenderObject* paintingRoot) |
| 1731 { | 1653 { |
| 1732 if (!m_containsDirtyOverlayScrollbars) | 1654 if (!m_containsDirtyOverlayScrollbars) |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1872 } | 1794 } |
| 1873 | 1795 |
| 1874 if (enclosingPaginationLayer()) { | 1796 if (enclosingPaginationLayer()) { |
| 1875 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags
); | 1797 paintTransformedLayerIntoFragments(context, paintingInfo, paintFlags
); |
| 1876 return; | 1798 return; |
| 1877 } | 1799 } |
| 1878 | 1800 |
| 1879 // Make sure the parent's clip rects have been calculated. | 1801 // Make sure the parent's clip rects have been calculated. |
| 1880 ClipRect clipRect = paintingInfo.paintDirtyRect; | 1802 ClipRect clipRect = paintingInfo.paintDirtyRect; |
| 1881 if (parent()) { | 1803 if (parent()) { |
| 1882 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, paintingIn
fo.region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Pa
intingClipRects, | 1804 ClipRectsContext clipRectsContext(paintingInfo.rootLayer, (paintFlag
s & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, |
| 1883 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); | 1805 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); |
| 1884 clipRect = clipper().backgroundClipRect(clipRectsContext); | 1806 clipRect = clipper().backgroundClipRect(clipRectsContext); |
| 1885 clipRect.intersect(paintingInfo.paintDirtyRect); | 1807 clipRect.intersect(paintingInfo.paintDirtyRect); |
| 1886 | 1808 |
| 1887 // Push the parent coordinate space's clip. | 1809 // Push the parent coordinate space's clip. |
| 1888 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.p
aintDirtyRect, clipRect); | 1810 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.p
aintDirtyRect, clipRect); |
| 1889 } | 1811 } |
| 1890 | 1812 |
| 1891 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); | 1813 paintLayerByApplyingTransform(context, paintingInfo, paintFlags); |
| 1892 | 1814 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2065 PaintBehavior paintBehavior = PaintBehaviorNormal; | 1987 PaintBehavior paintBehavior = PaintBehaviorNormal; |
| 2066 if (paintFlags & PaintLayerPaintingSkipRootBackground) | 1988 if (paintFlags & PaintLayerPaintingSkipRootBackground) |
| 2067 paintBehavior |= PaintBehaviorSkipRootBackground; | 1989 paintBehavior |= PaintBehaviorSkipRootBackground; |
| 2068 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) | 1990 else if (paintFlags & PaintLayerPaintingRootBackgroundOnly) |
| 2069 paintBehavior |= PaintBehaviorRootBackgroundOnly; | 1991 paintBehavior |= PaintBehaviorRootBackgroundOnly; |
| 2070 | 1992 |
| 2071 LayerFragments layerFragments; | 1993 LayerFragments layerFragments; |
| 2072 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ | 1994 if (shouldPaintContent || shouldPaintOutline || isPaintingOverlayScrollbars)
{ |
| 2073 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment, as well as whether or not the content of each | 1995 // Collect the fragments. This will compute the clip rectangles and pain
t offsets for each layer fragment, as well as whether or not the content of each |
| 2074 // fragment should paint. | 1996 // fragment should paint. |
| 2075 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaint
ingInfo.region, localPaintingInfo.paintDirtyRect, | 1997 collectFragments(layerFragments, localPaintingInfo.rootLayer, localPaint
ingInfo.paintDirtyRect, |
| 2076 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : P
aintingClipRects, IgnoreOverlayScrollbarSize, | 1998 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : P
aintingClipRects, IgnoreOverlayScrollbarSize, |
| 2077 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowC
lip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); | 1999 (isPaintingOverflowContents) ? IgnoreOverflowClip : RespectOverflowC
lip, &offsetFromRoot, localPaintingInfo.subPixelAccumulation); |
| 2078 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF
lags, shouldPaintContent, &offsetFromRoot); | 2000 updatePaintingInfoForFragments(layerFragments, localPaintingInfo, paintF
lags, shouldPaintContent, &offsetFromRoot); |
| 2079 } | 2001 } |
| 2080 | 2002 |
| 2081 if (shouldPaintBackground) | 2003 if (shouldPaintBackground) |
| 2082 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo
ntext, paintingInfo.paintDirtyRect, haveTransparency, | 2004 paintBackgroundForFragments(layerFragments, context, transparencyLayerCo
ntext, paintingInfo.paintDirtyRect, haveTransparency, |
| 2083 localPaintingInfo, paintBehavior, paintingRootForRenderer); | 2005 localPaintingInfo, paintBehavior, paintingRootForRenderer); |
| 2084 | 2006 |
| 2085 if (shouldPaintNegZOrderList) | 2007 if (shouldPaintNegZOrderList) |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2143 IntPoint roundedDelta = roundedIntPoint(delta); | 2065 IntPoint roundedDelta = roundedIntPoint(delta); |
| 2144 transform.translateRight(roundedDelta.x(), roundedDelta.y()); | 2066 transform.translateRight(roundedDelta.x(), roundedDelta.y()); |
| 2145 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); | 2067 LayoutSize adjustedSubPixelAccumulation = paintingInfo.subPixelAccumulation
+ (delta - roundedDelta); |
| 2146 | 2068 |
| 2147 // Apply the transform. | 2069 // Apply the transform. |
| 2148 GraphicsContextStateSaver stateSaver(*context); | 2070 GraphicsContextStateSaver stateSaver(*context); |
| 2149 context->concatCTM(transform.toAffineTransform()); | 2071 context->concatCTM(transform.toAffineTransform()); |
| 2150 | 2072 |
| 2151 // Now do a paint with the root layer shifted to be us. | 2073 // Now do a paint with the root layer shifted to be us. |
| 2152 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i
nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, | 2074 LayerPaintingInfo transformedPaintingInfo(this, enclosingIntRect(transform.i
nverse().mapRect(paintingInfo.paintDirtyRect)), paintingInfo.paintBehavior, |
| 2153 adjustedSubPixelAccumulation, paintingInfo.paintingRoot, paintingInfo.re
gion, paintingInfo.overlapTestRequests); | 2075 adjustedSubPixelAccumulation, paintingInfo.paintingRoot, paintingInfo.ov
erlapTestRequests); |
| 2154 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags
); | 2076 paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags
); |
| 2155 } | 2077 } |
| 2156 | 2078 |
| 2157 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte
xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | 2079 void RenderLayer::paintChildren(unsigned childrenToVisit, GraphicsContext* conte
xt, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) |
| 2158 { | 2080 { |
| 2159 if (!hasSelfPaintingLayerDescendant()) | 2081 if (!hasSelfPaintingLayerDescendant()) |
| 2160 return; | 2082 return; |
| 2161 | 2083 |
| 2162 #if !ASSERT_DISABLED | 2084 #if !ASSERT_DISABLED |
| 2163 LayerListMutationDetector mutationChecker(m_stackingNode.get()); | 2085 LayerListMutationDetector mutationChecker(m_stackingNode.get()); |
| 2164 #endif | 2086 #endif |
| 2165 | 2087 |
| 2166 RenderLayerStackingNodeIterator iterator(*m_stackingNode, childrenToVisit); | 2088 RenderLayerStackingNodeIterator iterator(*m_stackingNode, childrenToVisit); |
| 2167 while (RenderLayerStackingNode* child = iterator.next()) { | 2089 while (RenderLayerStackingNode* child = iterator.next()) { |
| 2168 RenderLayer* childLayer = child->layer(); | 2090 RenderLayer* childLayer = child->layer(); |
| 2169 | 2091 |
| 2170 // Squashed RenderLayers should not paint into their ancestor. | 2092 // Squashed RenderLayers should not paint into their ancestor. |
| 2171 if (childLayer->compositingState() == PaintsIntoGroupedBacking) | 2093 if (childLayer->compositingState() == PaintsIntoGroupedBacking) |
| 2172 continue; | 2094 continue; |
| 2173 | 2095 |
| 2174 if (!childLayer->isPaginated()) | 2096 if (!childLayer->isPaginated()) |
| 2175 childLayer->paintLayer(context, paintingInfo, paintFlags); | 2097 childLayer->paintLayer(context, paintingInfo, paintFlags); |
| 2176 else | 2098 else |
| 2177 paintPaginatedChildLayer(childLayer, context, paintingInfo, paintFla
gs); | 2099 paintPaginatedChildLayer(childLayer, context, paintingInfo, paintFla
gs); |
| 2178 } | 2100 } |
| 2179 } | 2101 } |
| 2180 | 2102 |
| 2181 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, RenderRegion* region, const LayoutRect& dirtyRect, | 2103 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, const LayoutRect& dirtyRect, |
| 2182 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollba
rSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint
* offsetFromRoot, | 2104 ClipRectsType clipRectsType, OverlayScrollbarSizeRelevancy inOverlayScrollba
rSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint
* offsetFromRoot, |
| 2183 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) | 2105 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) |
| 2184 { | 2106 { |
| 2185 if (!enclosingPaginationLayer() || hasTransform()) { | 2107 if (!enclosingPaginationLayer() || hasTransform()) { |
| 2186 // For unpaginated layers, there is only one fragment. | 2108 // For unpaginated layers, there is only one fragment. |
| 2187 LayerFragment fragment; | 2109 LayerFragment fragment; |
| 2188 ClipRectsContext clipRectsContext(rootLayer, region, clipRectsType, inOv
erlayScrollbarSizeRelevancy, respectOverflowClip, subPixelAccumulation); | 2110 ClipRectsContext clipRectsContext(rootLayer, clipRectsType, inOverlayScr
ollbarSizeRelevancy, respectOverflowClip, subPixelAccumulation); |
| 2189 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBoun
ds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offs
etFromRoot); | 2111 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBoun
ds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offs
etFromRoot); |
| 2190 fragments.append(fragment); | 2112 fragments.append(fragment); |
| 2191 return; | 2113 return; |
| 2192 } | 2114 } |
| 2193 | 2115 |
| 2194 // Compute our offset within the enclosing pagination layer. | 2116 // Compute our offset within the enclosing pagination layer. |
| 2195 LayoutPoint offsetWithinPaginatedLayer; | 2117 LayoutPoint offsetWithinPaginatedLayer; |
| 2196 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; | 2118 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; |
| 2197 | 2119 |
| 2198 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate | 2120 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate |
| 2199 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. | 2121 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. |
| 2200 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), regi
on, clipRectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); | 2122 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsType, inOverlayScrollbarSizeRelevancy, respectOverflowClip); |
| 2201 LayoutRect layerBoundsInFlowThread; | 2123 LayoutRect layerBoundsInFlowThread; |
| 2202 ClipRect backgroundRectInFlowThread; | 2124 ClipRect backgroundRectInFlowThread; |
| 2203 ClipRect foregroundRectInFlowThread; | 2125 ClipRect foregroundRectInFlowThread; |
| 2204 ClipRect outlineRectInFlowThread; | 2126 ClipRect outlineRectInFlowThread; |
| 2205 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect
(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr
ead, | 2127 clipper().calculateRects(paginationClipRectsContext, PaintInfo::infiniteRect
(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlowThr
ead, |
| 2206 outlineRectInFlowThread, &offsetWithinPaginatedLayer); | 2128 outlineRectInFlowThread, &offsetWithinPaginatedLayer); |
| 2207 | 2129 |
| 2208 // Take our bounding box within the flow thread and clip it. | 2130 // Take our bounding box within the flow thread and clip it. |
| 2209 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : boundingBox(enclosingPaginationLayer(), 0, &offsetWithinPaginatedLayer); | 2131 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : boundingBox(enclosingPaginationLayer(), 0, &offsetWithinPaginatedLayer); |
| 2210 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); | 2132 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
| 2211 | 2133 |
| 2212 // Shift the dirty rect into flow thread coordinates. | 2134 // Shift the dirty rect into flow thread coordinates. |
| 2213 LayoutPoint offsetOfPaginationLayerFromRoot; | 2135 LayoutPoint offsetOfPaginationLayerFromRoot; |
| 2214 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginati
onLayerFromRoot); | 2136 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOfPaginati
onLayerFromRoot); |
| 2215 LayoutRect dirtyRectInFlowThread(dirtyRect); | 2137 LayoutRect dirtyRectInFlowThread(dirtyRect); |
| 2216 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); | 2138 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); |
| 2217 | |
| 2218 // Tell the flow thread to collect the fragments. We pass enough information
to create a minimal number of fragments based off the pages/columns | |
| 2219 // that intersect the actual dirtyRect as well as the pages/columns that int
ersect our layer's bounding box. | |
| 2220 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); | |
| 2221 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow
Thread, dirtyRectInFlowThread); | |
| 2222 | |
| 2223 if (fragments.isEmpty()) | |
| 2224 return; | |
| 2225 | |
| 2226 // Get the parent clip rects of the pagination layer, since we need to inter
sect with that when painting column contents. | |
| 2227 ClipRect ancestorClipRect = dirtyRect; | |
| 2228 if (enclosingPaginationLayer()->parent()) { | |
| 2229 ClipRectsContext clipRectsContext(rootLayer, region, clipRectsType, inOv
erlayScrollbarSizeRelevancy, respectOverflowClip); | |
| 2230 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR
ect(clipRectsContext); | |
| 2231 ancestorClipRect.intersect(dirtyRect); | |
| 2232 } | |
| 2233 | |
| 2234 for (size_t i = 0; i < fragments.size(); ++i) { | |
| 2235 LayerFragment& fragment = fragments.at(i); | |
| 2236 | |
| 2237 // Set our four rects with all clipping applied that was internal to the
flow thread. | |
| 2238 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); | |
| 2239 | |
| 2240 // Shift to the root-relative physical position used when painting the f
low thread in this fragment. | |
| 2241 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR
oot); | |
| 2242 | |
| 2243 // Intersect the fragment with our ancestor's background clip so that e.
g., columns in an overflow:hidden block are | |
| 2244 // properly clipped by the overflow. | |
| 2245 fragment.intersect(ancestorClipRect.rect()); | |
| 2246 | |
| 2247 // Now intersect with our pagination clip. This will typically mean we'r
e just intersecting the dirty rect with the column | |
| 2248 // clip, so the column clip ends up being all we apply. | |
| 2249 fragment.intersect(fragment.paginationClip); | |
| 2250 } | |
| 2251 } | 2139 } |
| 2252 | 2140 |
| 2253 void RenderLayer::updatePaintingInfoForFragments(LayerFragments& fragments, cons
t LayerPaintingInfo& localPaintingInfo, PaintLayerFlags localPaintFlags, | 2141 void RenderLayer::updatePaintingInfoForFragments(LayerFragments& fragments, cons
t LayerPaintingInfo& localPaintingInfo, PaintLayerFlags localPaintFlags, |
| 2254 bool shouldPaintContent, const LayoutPoint* offsetFromRoot) | 2142 bool shouldPaintContent, const LayoutPoint* offsetFromRoot) |
| 2255 { | 2143 { |
| 2256 ASSERT(offsetFromRoot); | 2144 ASSERT(offsetFromRoot); |
| 2257 for (size_t i = 0; i < fragments.size(); ++i) { | 2145 for (size_t i = 0; i < fragments.size(); ++i) { |
| 2258 LayerFragment& fragment = fragments.at(i); | 2146 LayerFragment& fragment = fragments.at(i); |
| 2259 fragment.shouldPaintContent = shouldPaintContent; | 2147 fragment.shouldPaintContent = shouldPaintContent; |
| 2260 if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLaye
rPaintingOverflowContents)) { | 2148 if (this != localPaintingInfo.rootLayer || !(localPaintFlags & PaintLaye
rPaintingOverflowContents)) { |
| 2261 LayoutPoint newOffsetFromRoot = *offsetFromRoot + fragment.paginatio
nOffset; | 2149 LayoutPoint newOffsetFromRoot = *offsetFromRoot + fragment.paginatio
nOffset; |
| 2262 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBo
unds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFro
mRoot); | 2150 fragment.shouldPaintContent &= intersectsDamageRect(fragment.layerBo
unds, fragment.backgroundRect.rect(), localPaintingInfo.rootLayer, &newOffsetFro
mRoot); |
| 2263 } | 2151 } |
| 2264 } | 2152 } |
| 2265 } | 2153 } |
| 2266 | 2154 |
| 2267 void RenderLayer::paintTransformedLayerIntoFragments(GraphicsContext* context, c
onst LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) | 2155 void RenderLayer::paintTransformedLayerIntoFragments(GraphicsContext* context, c
onst LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) |
| 2268 { | 2156 { |
| 2269 LayerFragments enclosingPaginationFragments; | 2157 LayerFragments enclosingPaginationFragments; |
| 2270 LayoutPoint offsetOfPaginationLayerFromRoot; | 2158 LayoutPoint offsetOfPaginationLayerFromRoot; |
| 2271 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.pa
intBehavior); | 2159 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), PaintingTransparencyClipBox, RootOfTransparencyClipBox, paintingInfo.pa
intBehavior); |
| 2272 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, p
aintingInfo.rootLayer, paintingInfo.region, paintingInfo.paintDirtyRect, | 2160 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, p
aintingInfo.rootLayer, paintingInfo.paintDirtyRect, |
| 2273 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Paint
ingClipRects, IgnoreOverlayScrollbarSize, | 2161 (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : Paint
ingClipRects, IgnoreOverlayScrollbarSize, |
| 2274 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip :
RespectOverflowClip, &offsetOfPaginationLayerFromRoot, paintingInfo.subPixelAcc
umulation, &transformedExtent); | 2162 (paintFlags & PaintLayerPaintingOverflowContents) ? IgnoreOverflowClip :
RespectOverflowClip, &offsetOfPaginationLayerFromRoot, paintingInfo.subPixelAcc
umulation, &transformedExtent); |
| 2275 | 2163 |
| 2276 for (size_t i = 0; i < enclosingPaginationFragments.size(); ++i) { | 2164 for (size_t i = 0; i < enclosingPaginationFragments.size(); ++i) { |
| 2277 const LayerFragment& fragment = enclosingPaginationFragments.at(i); | 2165 const LayerFragment& fragment = enclosingPaginationFragments.at(i); |
| 2278 | 2166 |
| 2279 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and | 2167 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and |
| 2280 // the enclosing pagination layer. | 2168 // the enclosing pagination layer. |
| 2281 LayoutRect clipRect = fragment.backgroundRect.rect(); | 2169 LayoutRect clipRect = fragment.backgroundRect.rect(); |
| 2282 | 2170 |
| 2283 // Now compute the clips within a given fragment | 2171 // Now compute the clips within a given fragment |
| 2284 if (parent() != enclosingPaginationLayer()) { | 2172 if (parent() != enclosingPaginationLayer()) { |
| 2285 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLa
yer, offsetOfPaginationLayerFromRoot); | 2173 enclosingPaginationLayer()->convertToLayerCoords(paintingInfo.rootLa
yer, offsetOfPaginationLayerFromRoot); |
| 2286 | 2174 |
| 2287 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), painti
ngInfo.region, (paintFlags & PaintLayerTemporaryClipRects) ? TemporaryClipRects
: PaintingClipRects, | 2175 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), (paint
Flags & PaintLayerTemporaryClipRects) ? TemporaryClipRects : PaintingClipRects, |
| 2288 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); | 2176 IgnoreOverlayScrollbarSize, (paintFlags & PaintLayerPaintingOver
flowContents) ? IgnoreOverflowClip : RespectOverflowClip); |
| 2289 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); | 2177 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); |
| 2290 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); | 2178 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); |
| 2291 clipRect.intersect(parentClipRect); | 2179 clipRect.intersect(parentClipRect); |
| 2292 } | 2180 } |
| 2293 | 2181 |
| 2294 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.paint
DirtyRect, clipRect); | 2182 parent()->clipToRect(paintingInfo.rootLayer, context, paintingInfo.paint
DirtyRect, clipRect); |
| 2295 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); | 2183 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen
t.paginationOffset); |
| 2296 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); | 2184 parent()->restoreClip(context, paintingInfo.paintDirtyRect, clipRect); |
| 2297 } | 2185 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 2320 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.
rootLayer, transparencyPaintDirtyRect, localPaintingInfo.paintBehavior); | 2208 beginTransparencyLayers(transparencyLayerContext, localPaintingInfo.
rootLayer, transparencyPaintDirtyRect, localPaintingInfo.paintBehavior); |
| 2321 | 2209 |
| 2322 if (localPaintingInfo.clipToDirtyRect) { | 2210 if (localPaintingInfo.clipToDirtyRect) { |
| 2323 // Paint our background first, before painting any child layers. | 2211 // Paint our background first, before painting any child layers. |
| 2324 // Establish the clip used to paint our background. | 2212 // Establish the clip used to paint our background. |
| 2325 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Bac
kground painting will handle clipping to self. | 2213 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Bac
kground painting will handle clipping to self. |
| 2326 } | 2214 } |
| 2327 | 2215 |
| 2328 // Paint the background. | 2216 // Paint the background. |
| 2329 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 2217 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
| 2330 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, loc
alPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2218 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0,
0, localPaintingInfo.rootLayer->renderer()); |
| 2331 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2219 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
| 2332 | 2220 |
| 2333 if (localPaintingInfo.clipToDirtyRect) | 2221 if (localPaintingInfo.clipToDirtyRect) |
| 2334 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); | 2222 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); |
| 2335 } | 2223 } |
| 2336 } | 2224 } |
| 2337 | 2225 |
| 2338 void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
ts, GraphicsContext* context, GraphicsContext* transparencyLayerContext, | 2226 void RenderLayer::paintForegroundForFragments(const LayerFragments& layerFragmen
ts, GraphicsContext* context, GraphicsContext* transparencyLayerContext, |
| 2339 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L
ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, | 2227 const LayoutRect& transparencyPaintDirtyRect, bool haveTransparency, const L
ayerPaintingInfo& localPaintingInfo, PaintBehavior paintBehavior, |
| 2340 RenderObject* paintingRootForRenderer, bool selectionOnly, bool forceBlackTe
xt) | 2228 RenderObject* paintingRootForRenderer, bool selectionOnly, bool forceBlackTe
xt) |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2378 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
> 1; | 2266 bool shouldClip = localPaintingInfo.clipToDirtyRect && layerFragments.size()
> 1; |
| 2379 | 2267 |
| 2380 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2268 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 2381 const LayerFragment& fragment = layerFragments.at(i); | 2269 const LayerFragment& fragment = layerFragments.at(i); |
| 2382 if (!fragment.shouldPaintContent || fragment.foregroundRect.isEmpty()) | 2270 if (!fragment.shouldPaintContent || fragment.foregroundRect.isEmpty()) |
| 2383 continue; | 2271 continue; |
| 2384 | 2272 |
| 2385 if (shouldClip) | 2273 if (shouldClip) |
| 2386 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect); | 2274 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect); |
| 2387 | 2275 |
| 2388 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect
.rect()), phase, paintBehavior, paintingRootForRenderer, localPaintingInfo.regio
n, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2276 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.foregroundRect
.rect()), phase, paintBehavior, paintingRootForRenderer, 0, 0, localPaintingInfo
.rootLayer->renderer()); |
| 2389 if (phase == PaintPhaseForeground) | 2277 if (phase == PaintPhaseForeground) |
| 2390 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequest
s; | 2278 paintInfo.overlapTestRequests = localPaintingInfo.overlapTestRequest
s; |
| 2391 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2279 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
| 2392 | 2280 |
| 2393 if (shouldClip) | 2281 if (shouldClip) |
| 2394 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); | 2282 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); |
| 2395 } | 2283 } |
| 2396 } | 2284 } |
| 2397 | 2285 |
| 2398 void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2286 void RenderLayer::paintOutlineForFragments(const LayerFragments& layerFragments,
GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
| 2399 PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer) | 2287 PaintBehavior paintBehavior, RenderObject* paintingRootForRenderer) |
| 2400 { | 2288 { |
| 2401 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2289 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 2402 const LayerFragment& fragment = layerFragments.at(i); | 2290 const LayerFragment& fragment = layerFragments.at(i); |
| 2403 if (fragment.outlineRect.isEmpty()) | 2291 if (fragment.outlineRect.isEmpty()) |
| 2404 continue; | 2292 continue; |
| 2405 | 2293 |
| 2406 // Paint our own outline | 2294 // Paint our own outline |
| 2407 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, localPaint
ingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2295 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.outlineRect.re
ct()), PaintPhaseSelfOutline, paintBehavior, paintingRootForRenderer, 0, 0, loca
lPaintingInfo.rootLayer->renderer()); |
| 2408 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); | 2296 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.paint
DirtyRect, fragment.outlineRect, DoNotIncludeSelfForBorderRadius); |
| 2409 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2297 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
| 2410 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); | 2298 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.outlineR
ect); |
| 2411 } | 2299 } |
| 2412 } | 2300 } |
| 2413 | 2301 |
| 2414 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2302 void RenderLayer::paintMaskForFragments(const LayerFragments& layerFragments, Gr
aphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
| 2415 RenderObject* paintingRootForRenderer) | 2303 RenderObject* paintingRootForRenderer) |
| 2416 { | 2304 { |
| 2417 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2305 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 2418 const LayerFragment& fragment = layerFragments.at(i); | 2306 const LayerFragment& fragment = layerFragments.at(i); |
| 2419 if (!fragment.shouldPaintContent) | 2307 if (!fragment.shouldPaintContent) |
| 2420 continue; | 2308 continue; |
| 2421 | 2309 |
| 2422 if (localPaintingInfo.clipToDirtyRect) | 2310 if (localPaintingInfo.clipToDirtyRect) |
| 2423 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. | 2311 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.backgroundRect, DoNotIncludeSelfForBorderRadius); // Mas
k painting will handle clipping to self. |
| 2424 | 2312 |
| 2425 // Paint the mask. | 2313 // Paint the mask. |
| 2426 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. | 2314 // FIXME: Eventually we will collect the region from the fragment itself
instead of just from the paint info. |
| 2427 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, localPai
ntingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2315 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseMask, PaintBehaviorNormal, paintingRootForRenderer, 0, 0, lo
calPaintingInfo.rootLayer->renderer()); |
| 2428 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2316 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
| 2429 | 2317 |
| 2430 if (localPaintingInfo.clipToDirtyRect) | 2318 if (localPaintingInfo.clipToDirtyRect) |
| 2431 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); | 2319 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.back
groundRect); |
| 2432 } | 2320 } |
| 2433 } | 2321 } |
| 2434 | 2322 |
| 2435 void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layer
Fragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, | 2323 void RenderLayer::paintChildClippingMaskForFragments(const LayerFragments& layer
Fragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, |
| 2436 RenderObject* paintingRootForRenderer) | 2324 RenderObject* paintingRootForRenderer) |
| 2437 { | 2325 { |
| 2438 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2326 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| 2439 const LayerFragment& fragment = layerFragments.at(i); | 2327 const LayerFragment& fragment = layerFragments.at(i); |
| 2440 if (!fragment.shouldPaintContent) | 2328 if (!fragment.shouldPaintContent) |
| 2441 continue; | 2329 continue; |
| 2442 | 2330 |
| 2443 if (localPaintingInfo.clipToDirtyRect) | 2331 if (localPaintingInfo.clipToDirtyRect) |
| 2444 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child cl
ipping mask painting will handle clipping to self. | 2332 clipToRect(localPaintingInfo.rootLayer, context, localPaintingInfo.p
aintDirtyRect, fragment.foregroundRect, IncludeSelfForBorderRadius); // Child cl
ipping mask painting will handle clipping to self. |
| 2445 | 2333 |
| 2446 // Paint the the clipped mask. | 2334 // Paint the the clipped mask. |
| 2447 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer,
localPaintingInfo.region, 0, 0, localPaintingInfo.rootLayer->renderer()); | 2335 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect
.rect()), PaintPhaseClippingMask, PaintBehaviorNormal, paintingRootForRenderer,
0, 0, localPaintingInfo.rootLayer->renderer()); |
| 2448 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); | 2336 renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - r
enderBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccu
mulation, compositingState()))); |
| 2449 | 2337 |
| 2450 if (localPaintingInfo.clipToDirtyRect) | 2338 if (localPaintingInfo.clipToDirtyRect) |
| 2451 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); | 2339 restoreClip(context, localPaintingInfo.paintDirtyRect, fragment.fore
groundRect); |
| 2452 } | 2340 } |
| 2453 } | 2341 } |
| 2454 | 2342 |
| 2455 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) | 2343 void RenderLayer::paintOverflowControlsForFragments(const LayerFragments& layerF
ragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo) |
| 2456 { | 2344 { |
| 2457 for (size_t i = 0; i < layerFragments.size(); ++i) { | 2345 for (size_t i = 0; i < layerFragments.size(); ++i) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2595 } | 2483 } |
| 2596 | 2484 |
| 2597 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) | 2485 bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation&
hitTestLocation, HitTestResult& result) |
| 2598 { | 2486 { |
| 2599 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); | 2487 ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); |
| 2600 | 2488 |
| 2601 // RenderView should make sure to update layout before entering hit testing | 2489 // RenderView should make sure to update layout before entering hit testing |
| 2602 ASSERT(!renderer()->frame()->view()->layoutPending()); | 2490 ASSERT(!renderer()->frame()->view()->layoutPending()); |
| 2603 ASSERT(!renderer()->document().renderer()->needsLayout()); | 2491 ASSERT(!renderer()->document().renderer()->needsLayout()); |
| 2604 | 2492 |
| 2605 LayoutRect hitTestArea = isOutOfFlowRenderFlowThread() ? toRenderFlowThread(
renderer())->borderBoxRect() : renderer()->view()->documentRect(); | 2493 LayoutRect hitTestArea = renderer()->view()->documentRect(); |
| 2606 if (!request.ignoreClipping()) | 2494 if (!request.ignoreClipping()) |
| 2607 hitTestArea.intersect(frameVisibleRect(renderer())); | 2495 hitTestArea.intersect(frameVisibleRect(renderer())); |
| 2608 | 2496 |
| 2609 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); | 2497 RenderLayer* insideLayer = hitTestLayer(this, 0, request, result, hitTestAre
a, hitTestLocation, false); |
| 2610 if (!insideLayer) { | 2498 if (!insideLayer) { |
| 2611 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, | 2499 // We didn't hit any layer. If we are the root layer and the mouse is --
or just was -- down, |
| 2612 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has | 2500 // return ourselves. We do this so mouse events continue getting deliver
ed after a drag has |
| 2613 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. | 2501 // exited the WebView, and so hit testing over a scrollbar hits the cont
ent document. |
| 2614 if (!request.isChildFrameHitTest() && (request.active() || request.relea
se()) && isRootLayer()) { | 2502 if (!request.isChildFrameHitTest() && (request.active() || request.relea
se()) && isRootLayer()) { |
| 2615 renderer()->updateHitTestResult(result, toRenderView(renderer())->fl
ipForWritingMode(hitTestLocation.point())); | 2503 renderer()->updateHitTestResult(result, toRenderView(renderer())->fl
ipForWritingMode(hitTestLocation.point())); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2742 | 2630 |
| 2743 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. | 2631 // The natural thing would be to keep HitTestingTransformState on the stack,
but it's big, so we heap-allocate. |
| 2744 | 2632 |
| 2745 // Apply a transform if we have one. | 2633 // Apply a transform if we have one. |
| 2746 if (transform() && !appliedTransform) { | 2634 if (transform() && !appliedTransform) { |
| 2747 if (enclosingPaginationLayer()) | 2635 if (enclosingPaginationLayer()) |
| 2748 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
request, result, hitTestRect, hitTestLocation, transformState, zOffset); | 2636 return hitTestTransformedLayerInFragments(rootLayer, containerLayer,
request, result, hitTestRect, hitTestLocation, transformState, zOffset); |
| 2749 | 2637 |
| 2750 // Make sure the parent's clip rects have been calculated. | 2638 // Make sure the parent's clip rects have been calculated. |
| 2751 if (parent()) { | 2639 if (parent()) { |
| 2752 ClipRectsContext clipRectsContext(rootLayer, hitTestLocation.region(
), RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2640 ClipRectsContext clipRectsContext(rootLayer, RootRelativeClipRects,
IncludeOverlayScrollbarSize); |
| 2753 ClipRect clipRect = clipper().backgroundClipRect(clipRectsContext); | 2641 ClipRect clipRect = clipper().backgroundClipRect(clipRectsContext); |
| 2754 // Go ahead and test the enclosing clip now. | 2642 // Go ahead and test the enclosing clip now. |
| 2755 if (!clipRect.intersects(hitTestLocation)) | 2643 if (!clipRect.intersects(hitTestLocation)) |
| 2756 return 0; | 2644 return 0; |
| 2757 } | 2645 } |
| 2758 | 2646 |
| 2759 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, reques
t, result, hitTestRect, hitTestLocation, transformState, zOffset); | 2647 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, reques
t, result, hitTestRect, hitTestLocation, transformState, zOffset); |
| 2760 } | 2648 } |
| 2761 | 2649 |
| 2762 // Ensure our lists and 3d status are up-to-date. | 2650 // Ensure our lists and 3d status are up-to-date. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2828 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, | 2716 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, |
| 2829 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); | 2717 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); |
| 2830 if (hitLayer) { | 2718 if (hitLayer) { |
| 2831 if (!depthSortDescendants) | 2719 if (!depthSortDescendants) |
| 2832 return hitLayer; | 2720 return hitLayer; |
| 2833 candidateLayer = hitLayer; | 2721 candidateLayer = hitLayer; |
| 2834 } | 2722 } |
| 2835 | 2723 |
| 2836 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. | 2724 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. |
| 2837 LayerFragments layerFragments; | 2725 LayerFragments layerFragments; |
| 2838 collectFragments(layerFragments, rootLayer, hitTestLocation.region(), hitTes
tRect, RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2726 collectFragments(layerFragments, rootLayer, hitTestRect, RootRelativeClipRec
ts, IncludeOverlayScrollbarSize); |
| 2839 | 2727 |
| 2840 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { | 2728 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { |
| 2841 renderer()->updateHitTestResult(result, hitTestLocation.point()); | 2729 renderer()->updateHitTestResult(result, hitTestLocation.point()); |
| 2842 return this; | 2730 return this; |
| 2843 } | 2731 } |
| 2844 | 2732 |
| 2845 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check | 2733 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check |
| 2846 // every fragment in reverse order. | 2734 // every fragment in reverse order. |
| 2847 if (isSelfPaintingLayer()) { | 2735 if (isSelfPaintingLayer()) { |
| 2848 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. | 2736 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2911 | 2799 |
| 2912 return false; | 2800 return false; |
| 2913 } | 2801 } |
| 2914 | 2802 |
| 2915 RenderLayer* RenderLayer::hitTestTransformedLayerInFragments(RenderLayer* rootLa
yer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult&
result, | 2803 RenderLayer* RenderLayer::hitTestTransformedLayerInFragments(RenderLayer* rootLa
yer, RenderLayer* containerLayer, const HitTestRequest& request, HitTestResult&
result, |
| 2916 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const
HitTestingTransformState* transformState, double* zOffset) | 2804 const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, const
HitTestingTransformState* transformState, double* zOffset) |
| 2917 { | 2805 { |
| 2918 LayerFragments enclosingPaginationFragments; | 2806 LayerFragments enclosingPaginationFragments; |
| 2919 LayoutPoint offsetOfPaginationLayerFromRoot; | 2807 LayoutPoint offsetOfPaginationLayerFromRoot; |
| 2920 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), HitTestingTransparencyClipBox, RootOfTransparencyClipBox); | 2808 LayoutRect transformedExtent = transparencyClipBox(this, enclosingPagination
Layer(), HitTestingTransparencyClipBox, RootOfTransparencyClipBox); |
| 2921 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, r
ootLayer, hitTestLocation.region(), hitTestRect, | 2809 enclosingPaginationLayer()->collectFragments(enclosingPaginationFragments, r
ootLayer, hitTestRect, |
| 2922 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip,
&offsetOfPaginationLayerFromRoot, LayoutSize(), &transformedExtent); | 2810 RootRelativeClipRects, IncludeOverlayScrollbarSize, RespectOverflowClip,
&offsetOfPaginationLayerFromRoot, LayoutSize(), &transformedExtent); |
| 2923 | 2811 |
| 2924 for (int i = enclosingPaginationFragments.size() - 1; i >= 0; --i) { | 2812 for (int i = enclosingPaginationFragments.size() - 1; i >= 0; --i) { |
| 2925 const LayerFragment& fragment = enclosingPaginationFragments.at(i); | 2813 const LayerFragment& fragment = enclosingPaginationFragments.at(i); |
| 2926 | 2814 |
| 2927 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and | 2815 // Apply the page/column clip for this fragment, as well as any clips es
tablished by layers in between us and |
| 2928 // the enclosing pagination layer. | 2816 // the enclosing pagination layer. |
| 2929 LayoutRect clipRect = fragment.backgroundRect.rect(); | 2817 LayoutRect clipRect = fragment.backgroundRect.rect(); |
| 2930 | 2818 |
| 2931 // Now compute the clips within a given fragment | 2819 // Now compute the clips within a given fragment |
| 2932 if (parent() != enclosingPaginationLayer()) { | 2820 if (parent() != enclosingPaginationLayer()) { |
| 2933 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOf
PaginationLayerFromRoot); | 2821 enclosingPaginationLayer()->convertToLayerCoords(rootLayer, offsetOf
PaginationLayerFromRoot); |
| 2934 | 2822 |
| 2935 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), hitTes
tLocation.region(), RootRelativeClipRects, IncludeOverlayScrollbarSize); | 2823 ClipRectsContext clipRectsContext(enclosingPaginationLayer(), RootRe
lativeClipRects, IncludeOverlayScrollbarSize); |
| 2936 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); | 2824 LayoutRect parentClipRect = clipper().backgroundClipRect(clipRectsCo
ntext).rect(); |
| 2937 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); | 2825 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination
LayerFromRoot); |
| 2938 clipRect.intersect(parentClipRect); | 2826 clipRect.intersect(parentClipRect); |
| 2939 } | 2827 } |
| 2940 | 2828 |
| 2941 if (!hitTestLocation.intersects(clipRect)) | 2829 if (!hitTestLocation.intersects(clipRect)) |
| 2942 continue; | 2830 continue; |
| 2943 | 2831 |
| 2944 RenderLayer* hitLayer = hitTestLayerByApplyingTransform(rootLayer, conta
inerLayer, request, result, hitTestRect, hitTestLocation, | 2832 RenderLayer* hitLayer = hitTestLayerByApplyingTransform(rootLayer, conta
inerLayer, request, result, hitTestRect, hitTestLocation, |
| 2945 transformState, zOffset, fragment.paginationOffset); | 2833 transformState, zOffset, fragment.paginationOffset); |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3183 child->repaintBlockSelectionGaps(); | 3071 child->repaintBlockSelectionGaps(); |
| 3184 | 3072 |
| 3185 if (m_blockSelectionGapsBounds.isEmpty()) | 3073 if (m_blockSelectionGapsBounds.isEmpty()) |
| 3186 return; | 3074 return; |
| 3187 | 3075 |
| 3188 LayoutRect rect = m_blockSelectionGapsBounds; | 3076 LayoutRect rect = m_blockSelectionGapsBounds; |
| 3189 if (renderer()->hasOverflowClip()) { | 3077 if (renderer()->hasOverflowClip()) { |
| 3190 RenderBox* box = renderBox(); | 3078 RenderBox* box = renderBox(); |
| 3191 rect.move(-box->scrolledContentOffset()); | 3079 rect.move(-box->scrolledContentOffset()); |
| 3192 if (!scrollableArea()->usesCompositedScrolling()) | 3080 if (!scrollableArea()->usesCompositedScrolling()) |
| 3193 rect.intersect(box->overflowClipRect(LayoutPoint(), 0)); // FIXME: R
egions not accounted for. | 3081 rect.intersect(box->overflowClipRect(LayoutPoint())); |
| 3194 } | 3082 } |
| 3195 if (renderer()->hasClip()) | 3083 if (renderer()->hasClip()) |
| 3196 rect.intersect(toRenderBox(renderer())->clipRect(LayoutPoint(), 0)); //
FIXME: Regions not accounted for. | 3084 rect.intersect(toRenderBox(renderer())->clipRect(LayoutPoint())); |
| 3197 if (!rect.isEmpty()) | 3085 if (!rect.isEmpty()) |
| 3198 renderer()->repaintRectangle(rect); | 3086 renderer()->repaintRectangle(rect); |
| 3199 } | 3087 } |
| 3200 | 3088 |
| 3201 bool RenderLayer::hasBlockSelectionGapBounds() const | 3089 bool RenderLayer::hasBlockSelectionGapBounds() const |
| 3202 { | 3090 { |
| 3203 return !m_blockSelectionGapsBounds.isEmpty(); | 3091 return !m_blockSelectionGapsBounds.isEmpty(); |
| 3204 } | 3092 } |
| 3205 | 3093 |
| 3206 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const Layo
utRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromR
oot) const | 3094 bool RenderLayer::intersectsDamageRect(const LayoutRect& layerBounds, const Layo
utRect& damageRect, const RenderLayer* rootLayer, const LayoutPoint* offsetFromR
oot) const |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3276 } | 3164 } |
| 3277 | 3165 |
| 3278 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, CalculateL
ayerBoundsFlags flags, const LayoutPoint* offsetFromRoot) const | 3166 LayoutRect RenderLayer::boundingBox(const RenderLayer* ancestorLayer, CalculateL
ayerBoundsFlags flags, const LayoutPoint* offsetFromRoot) const |
| 3279 { | 3167 { |
| 3280 LayoutRect result = localBoundingBox(flags); | 3168 LayoutRect result = localBoundingBox(flags); |
| 3281 if (renderer()->isBox()) | 3169 if (renderer()->isBox()) |
| 3282 renderBox()->flipForWritingMode(result); | 3170 renderBox()->flipForWritingMode(result); |
| 3283 else | 3171 else |
| 3284 renderer()->containingBlock()->flipForWritingMode(result); | 3172 renderer()->containingBlock()->flipForWritingMode(result); |
| 3285 | 3173 |
| 3286 if (enclosingPaginationLayer() && (flags & UseFragmentBoxes)) { | |
| 3287 // Split our box up into the actual fragment boxes that render in the co
lumns/pages and unite those together to | |
| 3288 // get our true bounding box. | |
| 3289 LayoutPoint offsetWithinPaginationLayer; | |
| 3290 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginationL
ayer); | |
| 3291 result.moveBy(offsetWithinPaginationLayer); | |
| 3292 | |
| 3293 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPagi
nationLayer()->renderer()); | |
| 3294 result = enclosingFlowThread->fragmentsBoundingBox(result); | |
| 3295 | |
| 3296 LayoutPoint delta; | |
| 3297 if (offsetFromRoot) | |
| 3298 delta = *offsetFromRoot; | |
| 3299 else | |
| 3300 enclosingPaginationLayer()->convertToLayerCoords(ancestorLayer, delt
a); | |
| 3301 result.moveBy(delta); | |
| 3302 return result; | |
| 3303 } | |
| 3304 | |
| 3305 LayoutPoint delta; | 3174 LayoutPoint delta; |
| 3306 if (offsetFromRoot) | 3175 if (offsetFromRoot) |
| 3307 delta = *offsetFromRoot; | 3176 delta = *offsetFromRoot; |
| 3308 else | 3177 else |
| 3309 convertToLayerCoords(ancestorLayer, delta); | 3178 convertToLayerCoords(ancestorLayer, delta); |
| 3310 | 3179 |
| 3311 result.moveBy(delta); | 3180 result.moveBy(delta); |
| 3312 return result; | 3181 return result; |
| 3313 } | 3182 } |
| 3314 | 3183 |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3941 } | 3810 } |
| 3942 } | 3811 } |
| 3943 | 3812 |
| 3944 void showLayerTree(const WebCore::RenderObject* renderer) | 3813 void showLayerTree(const WebCore::RenderObject* renderer) |
| 3945 { | 3814 { |
| 3946 if (!renderer) | 3815 if (!renderer) |
| 3947 return; | 3816 return; |
| 3948 showLayerTree(renderer->enclosingLayer()); | 3817 showLayerTree(renderer->enclosingLayer()); |
| 3949 } | 3818 } |
| 3950 #endif | 3819 #endif |
| OLD | NEW |