OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> | 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> |
3 * 1999 Lars Knoll <knoll@kde.org> | 3 * 1999 Lars Knoll <knoll@kde.org> |
4 * 1999 Antti Koivisto <koivisto@kde.org> | 4 * 1999 Antti Koivisto <koivisto@kde.org> |
5 * 2000 Dirk Mueller <mueller@kde.org> | 5 * 2000 Dirk Mueller <mueller@kde.org> |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
9 * Copyright (C) 2009 Google Inc. All rights reserved. | 9 * Copyright (C) 2009 Google Inc. All rights reserved. |
10 * | 10 * |
(...skipping 2147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 // Set our clip rect to be our contents. | 2158 // Set our clip rect to be our contents. |
2159 IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion
)); | 2159 IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion
)); |
2160 if (!m_frame->deprecatedLocalOwner()) | 2160 if (!m_frame->deprecatedLocalOwner()) |
2161 return clipRect; | 2161 return clipRect; |
2162 | 2162 |
2163 // Take our owner element and get its clip rect. | 2163 // Take our owner element and get its clip rect. |
2164 // FIXME: Do we need to do this for remote frames? | 2164 // FIXME: Do we need to do this for remote frames? |
2165 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); | 2165 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); |
2166 FrameView* parentView = ownerElement->document().view(); | 2166 FrameView* parentView = ownerElement->document().view(); |
2167 if (parentView) | 2167 if (parentView) |
2168 clipRect.intersect(parentView->windowClipRectForFrameOwner(ownerElement)
); | 2168 clipRect.intersect(parentView->clipRectsForFrameOwner(ownerElement, null
ptr)); |
2169 return clipRect; | 2169 return clipRect; |
2170 } | 2170 } |
2171 | 2171 |
2172 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne
rElement) const | 2172 IntRect FrameView::clipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElem
ent, IntRect* unobscuredRect) const |
2173 { | 2173 { |
| 2174 ASSERT(ownerElement); |
| 2175 |
| 2176 if (unobscuredRect) |
| 2177 *unobscuredRect = IntRect(); |
| 2178 |
2174 // The renderer can sometimes be null when style="display:none" interacts | 2179 // The renderer can sometimes be null when style="display:none" interacts |
2175 // with external content and plugins. | 2180 // with external content and plugins. |
2176 if (!ownerElement->layoutObject()) | 2181 if (!ownerElement->layoutObject()) |
2177 return windowClipRect(); | 2182 return windowClipRect(); |
2178 | 2183 |
2179 // If we have no layer, just return our window clip rect. | 2184 // If we have no layer, just return our window clip rect. |
2180 const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->e
nclosingLayer(); | 2185 const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->e
nclosingLayer(); |
2181 if (!enclosingLayer) | 2186 if (!enclosingLayer) |
2182 return windowClipRect(); | 2187 return windowClipRect(); |
2183 | 2188 |
2184 // FIXME: childrenClipRect relies on compositingState, which is not necessar
ily up to date. | 2189 // FIXME: childrenClipRect relies on compositingState, which is not necessar
ily up to date. |
2185 // https://code.google.com/p/chromium/issues/detail?id=343769 | 2190 // https://code.google.com/p/chromium/issues/detail?id=343769 |
2186 DisableCompositingQueryAsserts disabler; | 2191 DisableCompositingQueryAsserts disabler; |
2187 | 2192 |
2188 // Apply the clip from the layer. | 2193 // Apply the clip from the layer. |
2189 IntRect clipRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->c
lipper().childrenClipRect())); | 2194 IntRect elementRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer
->clipper().childrenClipRect())); |
2190 return intersection(clipRect, windowClipRect()); | 2195 |
| 2196 if (unobscuredRect) { |
| 2197 *unobscuredRect = elementRect; |
| 2198 |
| 2199 // If element is not in root frame, clip to the local frame. |
| 2200 // FIXME: Do we need to do this for remote frames? |
| 2201 if (m_frame->deprecatedLocalOwner()) |
| 2202 unobscuredRect->intersect(contentsToRootFrame(visibleContentRect()))
; |
| 2203 } |
| 2204 |
| 2205 return intersection(elementRect, windowClipRect()); |
2191 } | 2206 } |
2192 | 2207 |
2193 bool FrameView::shouldUseIntegerScrollOffset() const | 2208 bool FrameView::shouldUseIntegerScrollOffset() const |
2194 { | 2209 { |
2195 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE
nabled()) | 2210 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE
nabled()) |
2196 return true; | 2211 return true; |
2197 return false; | 2212 return false; |
2198 } | 2213 } |
2199 | 2214 |
2200 bool FrameView::isActive() const | 2215 bool FrameView::isActive() const |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4048 { | 4063 { |
4049 Settings* settings = frame().settings(); | 4064 Settings* settings = frame().settings(); |
4050 if (!settings || !settings->rootLayerScrolls()) | 4065 if (!settings || !settings->rootLayerScrolls()) |
4051 return this; | 4066 return this; |
4052 | 4067 |
4053 LayoutView* layoutView = this->layoutView(); | 4068 LayoutView* layoutView = this->layoutView(); |
4054 return layoutView ? layoutView->scrollableArea() : nullptr; | 4069 return layoutView ? layoutView->scrollableArea() : nullptr; |
4055 } | 4070 } |
4056 | 4071 |
4057 } // namespace blink | 4072 } // namespace blink |
OLD | NEW |