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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1520 m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(*this)); | 1520 m_scrollableArea = adoptPtr(new RenderLayerScrollableArea(*this)); |
1521 else | 1521 else |
1522 m_scrollableArea = nullptr; | 1522 m_scrollableArea = nullptr; |
1523 } | 1523 } |
1524 | 1524 |
1525 bool RenderLayer::hasOverflowControls() const | 1525 bool RenderLayer::hasOverflowControls() const |
1526 { | 1526 { |
1527 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->scrollCorner() || renderer()->style()->resize() != RESIZE_NONE); | 1527 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->scrollCorner() || renderer()->style()->resize() != RESIZE_NONE); |
1528 } | 1528 } |
1529 | 1529 |
| 1530 void RenderLayer::appendSingleFragmentIgnoringPagination(LayerFragments& fragmen
ts, const RenderLayer* rootLayer, const LayoutRect& dirtyRect, ClipRectsCacheSlo
t clipRectsCacheSlot, OverlayScrollbarSizeRelevancy inOverlayScrollbarSizeReleva
ncy, ShouldRespectOverflowClip respectOverflowClip, const LayoutPoint* offsetFro
mRoot, const LayoutSize& subPixelAccumulation) |
| 1531 { |
| 1532 LayerFragment fragment; |
| 1533 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverlaySc
rollbarSizeRelevancy, subPixelAccumulation); |
| 1534 if (respectOverflowClip == IgnoreOverflowClip) |
| 1535 clipRectsContext.setIgnoreOverflowClip(); |
| 1536 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds,
fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offsetFr
omRoot); |
| 1537 fragments.append(fragment); |
| 1538 } |
| 1539 |
1530 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, const LayoutRect& dirtyRect, | 1540 void RenderLayer::collectFragments(LayerFragments& fragments, const RenderLayer*
rootLayer, const LayoutRect& dirtyRect, |
1531 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelevancy inOverl
ayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const L
ayoutPoint* offsetFromRoot, | 1541 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelevancy inOverl
ayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const L
ayoutPoint* offsetFromRoot, |
1532 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) | 1542 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) |
1533 { | 1543 { |
1534 if (!enclosingPaginationLayer() || hasTransformRelatedProperty()) { | 1544 if (!enclosingPaginationLayer()) { |
1535 // For unpaginated layers, there is only one fragment. | 1545 // For unpaginated layers, there is only one fragment. |
1536 LayerFragment fragment; | 1546 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect,
clipRectsCacheSlot, inOverlayScrollbarSizeRelevancy, respectOverflowClip, offset
FromRoot, subPixelAccumulation); |
1537 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverl
ayScrollbarSizeRelevancy, subPixelAccumulation); | |
1538 if (respectOverflowClip == IgnoreOverflowClip) | |
1539 clipRectsContext.setIgnoreOverflowClip(); | |
1540 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBoun
ds, fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offs
etFromRoot); | |
1541 fragments.append(fragment); | |
1542 return; | 1547 return; |
1543 } | 1548 } |
1544 | 1549 |
1545 // Compute our offset within the enclosing pagination layer. | 1550 // Compute our offset within the enclosing pagination layer. |
1546 LayoutPoint offsetWithinPaginatedLayer; | 1551 LayoutPoint offsetWithinPaginatedLayer; |
1547 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; | 1552 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; |
1548 | 1553 |
1549 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate | 1554 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate |
1550 // 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. | 1555 // 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. |
1551 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsCacheSlot, inOverlayScrollbarSizeRelevancy); | 1556 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsCacheSlot, inOverlayScrollbarSizeRelevancy); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1848 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, | 1853 hitLayer = hitTestChildren(NormalFlowChildren, rootLayer, request, result, h
itTestRect, hitTestLocation, |
1849 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); | 1854 localTransformState.get(), zOffsetForDescendantsPtr,
zOffset, unflattenedTransformState.get(), depthSortDescendants); |
1850 if (hitLayer) { | 1855 if (hitLayer) { |
1851 if (!depthSortDescendants) | 1856 if (!depthSortDescendants) |
1852 return hitLayer; | 1857 return hitLayer; |
1853 candidateLayer = hitLayer; | 1858 candidateLayer = hitLayer; |
1854 } | 1859 } |
1855 | 1860 |
1856 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. | 1861 // Collect the fragments. This will compute the clip rectangles for each lay
er fragment. |
1857 LayerFragments layerFragments; | 1862 LayerFragments layerFragments; |
1858 collectFragments(layerFragments, rootLayer, hitTestRect, RootRelativeClipRec
ts, IncludeOverlayScrollbarSize); | 1863 if (appliedTransform) |
| 1864 appendSingleFragmentIgnoringPagination(layerFragments, rootLayer, hitTes
tRect, RootRelativeClipRects, IncludeOverlayScrollbarSize); |
| 1865 else |
| 1866 collectFragments(layerFragments, rootLayer, hitTestRect, RootRelativeCli
pRects, IncludeOverlayScrollbarSize); |
1859 | 1867 |
1860 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { | 1868 if (m_scrollableArea && m_scrollableArea->hitTestResizerInFragments(layerFra
gments, hitTestLocation)) { |
1861 renderer()->updateHitTestResult(result, hitTestLocation.point()); | 1869 renderer()->updateHitTestResult(result, hitTestLocation.point()); |
1862 return this; | 1870 return this; |
1863 } | 1871 } |
1864 | 1872 |
1865 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check | 1873 // Next we want to see if the mouse pos is inside the child RenderObjects of
the layer. Check |
1866 // every fragment in reverse order. | 1874 // every fragment in reverse order. |
1867 if (isSelfPaintingLayer()) { | 1875 if (isSelfPaintingLayer()) { |
1868 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. | 1876 // Hit test with a temporary HitTestResult, because we only want to comm
it to 'result' if we know we're frontmost. |
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 } | 2914 } |
2907 } | 2915 } |
2908 | 2916 |
2909 void showLayerTree(const blink::RenderObject* renderer) | 2917 void showLayerTree(const blink::RenderObject* renderer) |
2910 { | 2918 { |
2911 if (!renderer) | 2919 if (!renderer) |
2912 return; | 2920 return; |
2913 showLayerTree(renderer->enclosingLayer()); | 2921 showLayerTree(renderer->enclosingLayer()); |
2914 } | 2922 } |
2915 #endif | 2923 #endif |
OLD | NEW |