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 2146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2157 | 2157 |
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 IntRect elementClipRect; |
2169 parentView->getClipRectsForFrameOwner(ownerElement, &elementClipRect, nu llptr); | |
2170 clipRect.intersect(elementClipRect); | |
2171 } | |
2169 return clipRect; | 2172 return clipRect; |
2170 } | 2173 } |
2171 | 2174 |
2172 IntRect FrameView::windowClipRectForFrameOwner(const HTMLFrameOwnerElement* owne rElement) const | 2175 void FrameView::getClipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElem ent, IntRect* clipRect, IntRect* unobscuredRect) const |
Julien - ping for review
2015/03/27 21:26:07
In Blink, we don't prefix getters with get so it s
tommycli
2015/03/27 22:42:51
Done.
| |
2173 { | 2176 { |
2177 ASSERT(ownerElement); | |
2178 ASSERT(clipRect); | |
2179 | |
2180 *clipRect = windowClipRect(); | |
2181 if (unobscuredRect) | |
2182 *unobscuredRect = IntRect(); | |
2183 | |
2174 // The renderer can sometimes be null when style="display:none" interacts | 2184 // The renderer can sometimes be null when style="display:none" interacts |
2175 // with external content and plugins. | 2185 // with external content and plugins. |
2176 if (!ownerElement->layoutObject()) | 2186 if (!ownerElement->layoutObject()) |
2177 return windowClipRect(); | 2187 return; |
2178 | 2188 |
2179 // If we have no layer, just return our window clip rect. | 2189 // If we have no layer, just return our window clip rect. |
2180 const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->e nclosingLayer(); | 2190 const DeprecatedPaintLayer* enclosingLayer = ownerElement->layoutObject()->e nclosingLayer(); |
2181 if (!enclosingLayer) | 2191 if (!enclosingLayer) |
2182 return windowClipRect(); | 2192 return; |
2183 | 2193 |
2184 // FIXME: childrenClipRect relies on compositingState, which is not necessar ily up to date. | 2194 // FIXME: childrenClipRect relies on compositingState, which is not necessar ily up to date. |
2185 // https://code.google.com/p/chromium/issues/detail?id=343769 | 2195 // https://code.google.com/p/chromium/issues/detail?id=343769 |
2186 DisableCompositingQueryAsserts disabler; | 2196 DisableCompositingQueryAsserts disabler; |
2187 | 2197 |
2188 // Apply the clip from the layer. | 2198 // Apply the clip from the layer. |
2189 IntRect clipRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer->c lipper().childrenClipRect())); | 2199 IntRect elementRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer ->clipper().childrenClipRect())); |
2190 return intersection(clipRect, windowClipRect()); | 2200 |
2201 clipRect->intersect(elementRect); | |
2202 | |
2203 if (unobscuredRect) { | |
2204 *unobscuredRect = elementRect; | |
2205 | |
2206 // If element is not in root frame, clip to the local frame. | |
2207 // FIXME: Do we need to do this for remote frames? | |
2208 if (m_frame->deprecatedLocalOwner()) | |
2209 unobscuredRect->intersect(contentsToRootFrame(visibleContentRect())) ; | |
2210 } | |
2191 } | 2211 } |
2192 | 2212 |
2193 bool FrameView::shouldUseIntegerScrollOffset() const | 2213 bool FrameView::shouldUseIntegerScrollOffset() const |
2194 { | 2214 { |
2195 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE nabled()) | 2215 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE nabled()) |
2196 return true; | 2216 return true; |
2197 return false; | 2217 return false; |
2198 } | 2218 } |
2199 | 2219 |
2200 bool FrameView::isActive() const | 2220 bool FrameView::isActive() const |
(...skipping 1847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4048 { | 4068 { |
4049 Settings* settings = frame().settings(); | 4069 Settings* settings = frame().settings(); |
4050 if (!settings || !settings->rootLayerScrolls()) | 4070 if (!settings || !settings->rootLayerScrolls()) |
4051 return this; | 4071 return this; |
4052 | 4072 |
4053 LayoutView* layoutView = this->layoutView(); | 4073 LayoutView* layoutView = this->layoutView(); |
4054 return layoutView ? layoutView->scrollableArea() : nullptr; | 4074 return layoutView ? layoutView->scrollableArea() : nullptr; |
4055 } | 4075 } |
4056 | 4076 |
4057 } // namespace blink | 4077 } // namespace blink |
OLD | NEW |