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 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 if (view && requiresRepaint) | 2173 if (view && requiresRepaint) |
2174 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(
m_repaintRect)); | 2174 renderer()->repaintUsingContainer(repaintContainer, pixelSnappedIntRect(
m_repaintRect)); |
2175 | 2175 |
2176 // Schedule the scroll DOM event. | 2176 // Schedule the scroll DOM event. |
2177 if (renderer()->node()) | 2177 if (renderer()->node()) |
2178 renderer()->node()->document()->eventQueue()->enqueueOrDispatchScrollEve
nt(renderer()->node(), DocumentEventQueue::ScrollEventElementTarget); | 2178 renderer()->node()->document()->eventQueue()->enqueueOrDispatchScrollEve
nt(renderer()->node(), DocumentEventQueue::ScrollEventElementTarget); |
2179 | 2179 |
2180 InspectorInstrumentation::didScrollLayer(frame); | 2180 InspectorInstrumentation::didScrollLayer(frame); |
2181 } | 2181 } |
2182 | 2182 |
2183 static inline bool frameElementAndViewPermitScroll(HTMLFrameElement* frameElemen
t, FrameView* frameView) | 2183 static inline bool frameElementAndViewPermitScroll(HTMLFrameElementBase* frameEl
ementBase, FrameView* frameView) |
2184 { | 2184 { |
2185 // If scrollbars aren't explicitly forbidden, permit scrolling. | 2185 // If scrollbars aren't explicitly forbidden, permit scrolling. |
2186 if (frameElement && frameElement->scrollingMode() != ScrollbarAlwaysOff) | 2186 if (frameElementBase && frameElementBase->scrollingMode() != ScrollbarAlways
Off) |
2187 return true; | 2187 return true; |
2188 | 2188 |
2189 // If scrollbars are forbidden, user initiated scrolls should obviously be i
gnored. | 2189 // If scrollbars are forbidden, user initiated scrolls should obviously be i
gnored. |
2190 if (frameView->wasScrolledByUser()) | 2190 if (frameView->wasScrolledByUser()) |
2191 return false; | 2191 return false; |
2192 | 2192 |
2193 // Forbid autoscrolls when scrollbars are off, but permits other programmati
c scrolls, | 2193 // Forbid autoscrolls when scrollbars are off, but permits other programmati
c scrolls, |
2194 // like navigation to an anchor. | 2194 // like navigation to an anchor. |
2195 Page* page = frameView->frame()->page(); | 2195 Page* page = frameView->frame()->page(); |
2196 if (!page) | 2196 if (!page) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2232 localExposeRect.move(-scrollOffsetDifference); | 2232 localExposeRect.move(-scrollOffsetDifference); |
2233 newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(lo
calExposeRect)), UseTransforms).boundingBox()); | 2233 newRect = LayoutRect(box->localToAbsoluteQuad(FloatQuad(FloatRect(lo
calExposeRect)), UseTransforms).boundingBox()); |
2234 } | 2234 } |
2235 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma
ticallyScrolled()) { | 2235 } else if (!parentLayer && renderer()->isBox() && renderBox()->canBePrograma
ticallyScrolled()) { |
2236 if (frameView) { | 2236 if (frameView) { |
2237 Element* ownerElement = 0; | 2237 Element* ownerElement = 0; |
2238 if (renderer()->document()) | 2238 if (renderer()->document()) |
2239 ownerElement = renderer()->document()->ownerElement(); | 2239 ownerElement = renderer()->document()->ownerElement(); |
2240 | 2240 |
2241 if (ownerElement && ownerElement->renderer()) { | 2241 if (ownerElement && ownerElement->renderer()) { |
2242 HTMLFrameElement* frameElement = 0; | 2242 HTMLFrameElementBase* frameElementBase = 0; |
2243 | 2243 |
2244 if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagNa
me(iframeTag)) | 2244 if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagNa
me(iframeTag)) |
2245 frameElement = static_cast<HTMLFrameElement*>(ownerElement); | 2245 frameElementBase = static_cast<HTMLFrameElementBase*>(ownerE
lement); |
2246 | 2246 |
2247 if (frameElementAndViewPermitScroll(frameElement, frameView)) { | 2247 if (frameElementAndViewPermitScroll(frameElementBase, frameView)
) { |
2248 LayoutRect viewRect = frameView->visibleContentRect(); | 2248 LayoutRect viewRect = frameView->visibleContentRect(); |
2249 LayoutRect exposeRect = getRectToExpose(viewRect, rect, alig
nX, alignY); | 2249 LayoutRect exposeRect = getRectToExpose(viewRect, rect, alig
nX, alignY); |
2250 | 2250 |
2251 int xOffset = roundToInt(exposeRect.x()); | 2251 int xOffset = roundToInt(exposeRect.x()); |
2252 int yOffset = roundToInt(exposeRect.y()); | 2252 int yOffset = roundToInt(exposeRect.y()); |
2253 // Adjust offsets if they're outside of the allowable range. | 2253 // Adjust offsets if they're outside of the allowable range. |
2254 xOffset = max(0, min(frameView->contentsWidth(), xOffset)); | 2254 xOffset = max(0, min(frameView->contentsWidth(), xOffset)); |
2255 yOffset = max(0, min(frameView->contentsHeight(), yOffset)); | 2255 yOffset = max(0, min(frameView->contentsHeight(), yOffset)); |
2256 | 2256 |
2257 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); | 2257 frameView->setScrollPosition(IntPoint(xOffset, yOffset)); |
(...skipping 4108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6366 } | 6366 } |
6367 } | 6367 } |
6368 | 6368 |
6369 void showLayerTree(const WebCore::RenderObject* renderer) | 6369 void showLayerTree(const WebCore::RenderObject* renderer) |
6370 { | 6370 { |
6371 if (!renderer) | 6371 if (!renderer) |
6372 return; | 6372 return; |
6373 showLayerTree(renderer->enclosingLayer()); | 6373 showLayerTree(renderer->enclosingLayer()); |
6374 } | 6374 } |
6375 #endif | 6375 #endif |
OLD | NEW |