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 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 } else if (m_reflectionInfo) { | 1359 } else if (m_reflectionInfo) { |
1360 m_reflectionInfo->destroy(); | 1360 m_reflectionInfo->destroy(); |
1361 m_reflectionInfo = nullptr; | 1361 m_reflectionInfo = nullptr; |
1362 } | 1362 } |
1363 } | 1363 } |
1364 | 1364 |
1365 void DeprecatedPaintLayer::updateStackingNode() | 1365 void DeprecatedPaintLayer::updateStackingNode() |
1366 { | 1366 { |
1367 ASSERT(!m_stackingNode); | 1367 ASSERT(!m_stackingNode); |
1368 if (requiresStackingNode()) | 1368 if (requiresStackingNode()) |
1369 m_stackingNode = adoptPtr(new DeprecatedPaintLayerStackingNode(*layoutOb
ject())); | 1369 m_stackingNode = adoptPtr(new DeprecatedPaintLayerStackingNode(this)); |
| 1370 else |
| 1371 m_stackingNode = nullptr; |
1370 } | 1372 } |
1371 | 1373 |
1372 void DeprecatedPaintLayer::updateScrollableArea() | 1374 void DeprecatedPaintLayer::updateScrollableArea() |
1373 { | 1375 { |
1374 ASSERT(!m_scrollableArea); | 1376 ASSERT(!m_scrollableArea); |
1375 if (requiresScrollableArea()) | 1377 if (requiresScrollableArea()) |
1376 m_scrollableArea = DeprecatedPaintLayerScrollableArea::create(*this); | 1378 m_scrollableArea = DeprecatedPaintLayerScrollableArea::create(*this); |
1377 } | 1379 } |
1378 | 1380 |
1379 bool DeprecatedPaintLayer::hasOverflowControls() const | 1381 bool DeprecatedPaintLayer::hasOverflowControls() const |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1542 Node* DeprecatedPaintLayer::enclosingElement() const | 1544 Node* DeprecatedPaintLayer::enclosingElement() const |
1543 { | 1545 { |
1544 for (LayoutObject* r = layoutObject(); r; r = r->parent()) { | 1546 for (LayoutObject* r = layoutObject(); r; r = r->parent()) { |
1545 if (Node* e = r->node()) | 1547 if (Node* e = r->node()) |
1546 return e; | 1548 return e; |
1547 } | 1549 } |
1548 ASSERT_NOT_REACHED(); | 1550 ASSERT_NOT_REACHED(); |
1549 return 0; | 1551 return 0; |
1550 } | 1552 } |
1551 | 1553 |
| 1554 bool DeprecatedPaintLayer::isInTopLayer() const |
| 1555 { |
| 1556 Node* node = layoutObject()->node(); |
| 1557 return node && node->isElementNode() && toElement(node)->isInTopLayer(); |
| 1558 } |
| 1559 |
1552 // Compute the z-offset of the point in the transformState. | 1560 // Compute the z-offset of the point in the transformState. |
1553 // This is effectively projecting a ray normal to the plane of ancestor, finding
where that | 1561 // This is effectively projecting a ray normal to the plane of ancestor, finding
where that |
1554 // ray intersects target, and computing the z delta between those two points. | 1562 // ray intersects target, and computing the z delta between those two points. |
1555 static double computeZOffset(const HitTestingTransformState& transformState) | 1563 static double computeZOffset(const HitTestingTransformState& transformState) |
1556 { | 1564 { |
1557 // We got an affine transform, so no z-offset | 1565 // We got an affine transform, so no z-offset |
1558 if (transformState.m_accumulatedTransform.isAffine()) | 1566 if (transformState.m_accumulatedTransform.isAffine()) |
1559 return 0; | 1567 return 0; |
1560 | 1568 |
1561 // Flatten the point into the target plane | 1569 // Flatten the point into the target plane |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2715 | 2723 |
2716 void showLayerTree(const blink::LayoutObject* layoutObject) | 2724 void showLayerTree(const blink::LayoutObject* layoutObject) |
2717 { | 2725 { |
2718 if (!layoutObject) { | 2726 if (!layoutObject) { |
2719 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2727 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2720 return; | 2728 return; |
2721 } | 2729 } |
2722 showLayerTree(layoutObject->enclosingLayer()); | 2730 showLayerTree(layoutObject->enclosingLayer()); |
2723 } | 2731 } |
2724 #endif | 2732 #endif |
OLD | NEW |