OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "FloatConversion.h" | 60 #include "FloatConversion.h" |
61 #include "FloatPoint3D.h" | 61 #include "FloatPoint3D.h" |
62 #include "FloatRect.h" | 62 #include "FloatRect.h" |
63 #include "FocusController.h" | 63 #include "FocusController.h" |
64 #include "Frame.h" | 64 #include "Frame.h" |
65 #include "FrameSelection.h" | 65 #include "FrameSelection.h" |
66 #include "FrameTree.h" | 66 #include "FrameTree.h" |
67 #include "FrameView.h" | 67 #include "FrameView.h" |
68 #include "Gradient.h" | 68 #include "Gradient.h" |
69 #include "GraphicsContext.h" | 69 #include "GraphicsContext.h" |
| 70 #include "HTMLFrameElement.h" |
70 #include "HTMLFrameOwnerElement.h" | 71 #include "HTMLFrameOwnerElement.h" |
71 #include "HTMLNames.h" | 72 #include "HTMLNames.h" |
72 #include "HitTestingTransformState.h" | 73 #include "HitTestingTransformState.h" |
73 #include "HitTestRequest.h" | 74 #include "HitTestRequest.h" |
74 #include "HitTestResult.h" | 75 #include "HitTestResult.h" |
75 #include "OverflowEvent.h" | 76 #include "OverflowEvent.h" |
76 #include "OverlapTestRequestClient.h" | 77 #include "OverlapTestRequestClient.h" |
77 #include "Page.h" | 78 #include "Page.h" |
78 #include "PlatformMouseEvent.h" | 79 #include "PlatformMouseEvent.h" |
79 #include "RenderArena.h" | 80 #include "RenderArena.h" |
(...skipping 1455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1535 LayoutUnit diffX = scrollXOffset(); | 1536 LayoutUnit diffX = scrollXOffset(); |
1536 LayoutUnit diffY = scrollYOffset(); | 1537 LayoutUnit diffY = scrollYOffset(); |
1537 scrollToOffset(xOffset, yOffset); | 1538 scrollToOffset(xOffset, yOffset); |
1538 diffX = scrollXOffset() - diffX; | 1539 diffX = scrollXOffset() - diffX; |
1539 diffY = scrollYOffset() - diffY; | 1540 diffY = scrollYOffset() - diffY; |
1540 newRect.setX(rect.x() - diffX); | 1541 newRect.setX(rect.x() - diffX); |
1541 newRect.setY(rect.y() - diffY); | 1542 newRect.setY(rect.y() - diffY); |
1542 } | 1543 } |
1543 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma
ticallyScrolled()) { | 1544 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma
ticallyScrolled()) { |
1544 if (frameView) { | 1545 if (frameView) { |
1545 if (renderer()->document() && renderer()->document()->ownerElement()
&& renderer()->document()->ownerElement()->renderer()) { | 1546 Element* ownerElement = 0; |
1546 LayoutRect viewRect = frameView->visibleContentRect(); | 1547 if (renderer()->document()) |
1547 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY); | 1548 ownerElement = renderer()->document()->ownerElement(); |
1548 | |
1549 LayoutUnit xOffset = r.x(); | |
1550 LayoutUnit yOffset = r.y(); | |
1551 // Adjust offsets if they're outside of the allowable range. | |
1552 xOffset = max<LayoutUnit>(0, min(frameView->contentsWidth(), xOf
fset)); | |
1553 yOffset = max<LayoutUnit>(0, min(frameView->contentsHeight(), yO
ffset)); | |
1554 | 1549 |
1555 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); | 1550 if (ownerElement && ownerElement->renderer()) { |
1556 parentLayer = renderer()->document()->ownerElement()->renderer()
->enclosingLayer(); | 1551 HTMLFrameElement* frameElement = 0; |
1557 newRect.setX(rect.x() - frameView->scrollX() + frameView->x()); | 1552 |
1558 newRect.setY(rect.y() - frameView->scrollY() + frameView->y()); | 1553 if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagNa
me(iframeTag)) |
| 1554 frameElement = static_cast<HTMLFrameElement*>(ownerElement); |
| 1555 |
| 1556 if (frameElement && frameElement->scrollingMode() != ScrollbarAl
waysOff) { |
| 1557 LayoutRect viewRect = frameView->visibleContentRect(); |
| 1558 LayoutRect exposeRect = getRectToExpose(viewRect, rect, alig
nX, alignY); |
| 1559 |
| 1560 LayoutUnit xOffset = exposeRect.x(); |
| 1561 LayoutUnit yOffset = exposeRect.y(); |
| 1562 // Adjust offsets if they're outside of the allowable range. |
| 1563 xOffset = max<LayoutUnit>(0, min(frameView->contentsWidth(),
xOffset)); |
| 1564 yOffset = max<LayoutUnit>(0, min(frameView->contentsHeight()
, yOffset)); |
| 1565 |
| 1566 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); |
| 1567 parentLayer = ownerElement->renderer()->enclosingLayer(); |
| 1568 newRect.setX(rect.x() - frameView->scrollX() + frameView->x(
)); |
| 1569 newRect.setY(rect.y() - frameView->scrollY() + frameView->y(
)); |
| 1570 } |
1559 } else { | 1571 } else { |
1560 LayoutRect viewRect = frameView->visibleContentRect(); | 1572 LayoutRect viewRect = frameView->visibleContentRect(); |
1561 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY); | 1573 LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY); |
1562 | 1574 |
1563 frameView->setScrollPosition(r.location()); | 1575 frameView->setScrollPosition(r.location()); |
1564 | 1576 |
1565 // This is the outermost view of a web page, so after scrolling
this view we | 1577 // This is the outermost view of a web page, so after scrolling
this view we |
1566 // scroll its container by calling Page::scrollRectIntoView. | 1578 // scroll its container by calling Page::scrollRectIntoView. |
1567 // This only has an effect on the Mac platform in applications | 1579 // This only has an effect on the Mac platform in applications |
1568 // that put web views into scrolling containers, such as Mac OS
X Mail. | 1580 // that put web views into scrolling containers, such as Mac OS
X Mail. |
(...skipping 2919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 } | 4500 } |
4489 } | 4501 } |
4490 | 4502 |
4491 void showLayerTree(const WebCore::RenderObject* renderer) | 4503 void showLayerTree(const WebCore::RenderObject* renderer) |
4492 { | 4504 { |
4493 if (!renderer) | 4505 if (!renderer) |
4494 return; | 4506 return; |
4495 showLayerTree(renderer->enclosingLayer()); | 4507 showLayerTree(renderer->enclosingLayer()); |
4496 } | 4508 } |
4497 #endif | 4509 #endif |
OLD | NEW |