OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 2533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2544 // The layer created for the LayoutFlowThread is just a helper for painting | 2544 // The layer created for the LayoutFlowThread is just a helper for painting |
2545 // and hit-testing, and should not contribute to the bounding box. The | 2545 // and hit-testing, and should not contribute to the bounding box. The |
2546 // LayoutMultiColumnSets will contribute the correct size for the layout | 2546 // LayoutMultiColumnSets will contribute the correct size for the layout |
2547 // content of the multicol container. | 2547 // content of the multicol container. |
2548 if (layoutObject()->isLayoutFlowThread()) | 2548 if (layoutObject()->isLayoutFlowThread()) |
2549 return LayoutRect(); | 2549 return LayoutRect(); |
2550 | 2550 |
2551 const_cast<PaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); | 2551 const_cast<PaintLayer*>(this)->stackingNode()->updateLayerListsIfNeeded(); |
2552 | 2552 |
2553 // If there is a clip applied by an ancestor to this PaintLayer but below or | 2553 // If there is a clip applied by an ancestor to this PaintLayer but below or |
2554 // equal to |ancestorLayer|, use that clip as the bounds rather than the | 2554 // equal to |ancestorLayer|, apply that clip. |
2555 // recursive bounding boxes, since the latter may be larger than the actual | |
2556 // size. See https://bugs.webkit.org/show_bug.cgi?id=80372 for examples. | |
2557 LayoutRect result = clipper().localClipRect(compositedLayer); | 2555 LayoutRect result = clipper().localClipRect(compositedLayer); |
2558 // TODO(chrishtr): avoid converting to IntRect and back. | 2556 |
2559 if (result == LayoutRect(LayoutRect::infiniteIntRect())) | 2557 result.intersect(physicalBoundingBox(LayoutPoint())); |
2560 result = physicalBoundingBox(LayoutPoint()); | |
2561 | 2558 |
2562 expandRectForStackingChildren(compositedLayer, result, options); | 2559 expandRectForStackingChildren(compositedLayer, result, options); |
2563 | 2560 |
2564 // Only enlarge by the filter outsets if we know the filter is going to be | 2561 // Only enlarge by the filter outsets if we know the filter is going to be |
2565 // rendered in software. Accelerated filters will handle their own outsets. | 2562 // rendered in software. Accelerated filters will handle their own outsets. |
2566 if (paintsWithFilters()) | 2563 if (paintsWithFilters()) |
2567 result = mapLayoutRectForFilter(result); | 2564 result = mapLayoutRectForFilter(result); |
2568 | 2565 |
2569 if (transform() && (options == IncludeTransformsAndCompositedChildLayers || | 2566 if (transform() && (options == IncludeTransformsAndCompositedChildLayers || |
2570 ((paintsWithTransform(GlobalPaintNormalPhase) && | 2567 ((paintsWithTransform(GlobalPaintNormalPhase) && |
2571 (this != compositedLayer || | 2568 (this != compositedLayer || |
2572 options == MaybeIncludeTransformForAncestorLayer))))) | 2569 options == MaybeIncludeTransformForAncestorLayer))))) |
2573 result = transform()->mapRect(result); | 2570 result = transform()->mapRect(result); |
chrishtr
2016/12/28 23:56:38
Before this patch, the input to this mapRect call
Xianzhu
2016/12/29 00:09:01
How does the larger rect cause wrong position of t
chrishtr
2016/12/29 01:08:35
The entire graphics layer has an incorrect offsetF
| |
2574 | 2571 |
2575 if (shouldFragmentCompositedBounds(compositedLayer)) { | 2572 if (shouldFragmentCompositedBounds(compositedLayer)) { |
2576 convertFromFlowThreadToVisualBoundingBoxInAncestor(compositedLayer, result); | 2573 convertFromFlowThreadToVisualBoundingBoxInAncestor(compositedLayer, result); |
2577 return result; | 2574 return result; |
2578 } | 2575 } |
2579 | 2576 |
2580 if (stackingParent) { | 2577 if (stackingParent) { |
2581 LayoutPoint delta; | 2578 LayoutPoint delta; |
2582 convertToLayerCoords(stackingParent, delta); | 2579 convertToLayerCoords(stackingParent, delta); |
2583 result.moveBy(delta); | 2580 result.moveBy(delta); |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3251 } | 3248 } |
3252 | 3249 |
3253 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3250 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3254 if (!layoutObject) { | 3251 if (!layoutObject) { |
3255 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3252 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
3256 return; | 3253 return; |
3257 } | 3254 } |
3258 showLayerTree(layoutObject->enclosingLayer()); | 3255 showLayerTree(layoutObject->enclosingLayer()); |
3259 } | 3256 } |
3260 #endif | 3257 #endif |
OLD | NEW |