| 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 2017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2028 continue; | 2028 continue; |
| 2029 | 2029 |
| 2030 toLayoutCounter(layoutObject)->updateCounter(); | 2030 toLayoutCounter(layoutObject)->updateCounter(); |
| 2031 } | 2031 } |
| 2032 } | 2032 } |
| 2033 | 2033 |
| 2034 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
nst | 2034 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co
nst |
| 2035 { | 2035 { |
| 2036 ASSERT(m_frame->view() == this); | 2036 ASSERT(m_frame->view() == this); |
| 2037 | 2037 |
| 2038 // Set our clip rect to be our contents. | 2038 LayoutRect clipRect(LayoutPoint(), LayoutSize(visibleContentSize(scrollbarIn
clusion))); |
| 2039 IntRect clipRect = contentsToRootFrame(visibleContentRect(scrollbarInclusion
)); | 2039 layoutView()->mapRectToPaintInvalidationBacking(layoutView()->containerForPa
intInvalidation(), clipRect, nullptr); |
| 2040 if (!m_frame->deprecatedLocalOwner()) | 2040 return enclosingIntRect(clipRect); |
| 2041 return clipRect; | |
| 2042 | |
| 2043 // Take our owner element and get its clip rect. | |
| 2044 // FIXME: Do we need to do this for remote frames? | |
| 2045 HTMLFrameOwnerElement* ownerElement = m_frame->deprecatedLocalOwner(); | |
| 2046 FrameView* parentView = ownerElement->document().view(); | |
| 2047 if (parentView) | |
| 2048 clipRect.intersect(parentView->clipRectsForFrameOwner(ownerElement, null
ptr)); | |
| 2049 return clipRect; | |
| 2050 } | |
| 2051 | |
| 2052 IntRect FrameView::clipRectsForFrameOwner(const HTMLFrameOwnerElement* ownerElem
ent, IntRect* unobscuredRect) const | |
| 2053 { | |
| 2054 ASSERT(ownerElement); | |
| 2055 | |
| 2056 if (unobscuredRect) | |
| 2057 *unobscuredRect = IntRect(); | |
| 2058 | |
| 2059 // The layoutObject can sometimes be null when style="display:none" interact
s | |
| 2060 // with external content and plugins. | |
| 2061 if (!ownerElement->layoutObject()) | |
| 2062 return windowClipRect(); | |
| 2063 | |
| 2064 // If we have no layer, just return our window clip rect. | |
| 2065 const PaintLayer* enclosingLayer = ownerElement->layoutObject()->enclosingLa
yer(); | |
| 2066 if (!enclosingLayer) | |
| 2067 return windowClipRect(); | |
| 2068 | |
| 2069 // FIXME: childrenClipRect relies on compositingState, which is not necessar
ily up to date. | |
| 2070 // https://code.google.com/p/chromium/issues/detail?id=343769 | |
| 2071 DisableCompositingQueryAsserts disabler; | |
| 2072 | |
| 2073 // Apply the clip from the layer. | |
| 2074 IntRect elementRect = contentsToRootFrame(pixelSnappedIntRect(enclosingLayer
->clipper().childrenClipRect())); | |
| 2075 | |
| 2076 if (unobscuredRect) { | |
| 2077 *unobscuredRect = elementRect; | |
| 2078 | |
| 2079 // If element is not in root frame, clip to the local frame. | |
| 2080 // FIXME: Do we need to do this for remote frames? | |
| 2081 if (m_frame->deprecatedLocalOwner()) | |
| 2082 unobscuredRect->intersect(contentsToRootFrame(visibleContentRect()))
; | |
| 2083 } | |
| 2084 | |
| 2085 return intersection(elementRect, windowClipRect()); | |
| 2086 } | 2041 } |
| 2087 | 2042 |
| 2088 bool FrameView::shouldUseIntegerScrollOffset() const | 2043 bool FrameView::shouldUseIntegerScrollOffset() const |
| 2089 { | 2044 { |
| 2090 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE
nabled()) | 2045 if (m_frame->settings() && !m_frame->settings()->preferCompositingToLCDTextE
nabled()) |
| 2091 return true; | 2046 return true; |
| 2092 | 2047 |
| 2093 return ScrollableArea::shouldUseIntegerScrollOffset(); | 2048 return ScrollableArea::shouldUseIntegerScrollOffset(); |
| 2094 } | 2049 } |
| 2095 | 2050 |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4080 } | 4035 } |
| 4081 | 4036 |
| 4082 bool FrameView::canThrottleRendering() const | 4037 bool FrameView::canThrottleRendering() const |
| 4083 { | 4038 { |
| 4084 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) | 4039 if (!RuntimeEnabledFeatures::renderingPipelineThrottlingEnabled()) |
| 4085 return false; | 4040 return false; |
| 4086 return m_hiddenForThrottling && m_crossOriginForThrottling; | 4041 return m_hiddenForThrottling && m_crossOriginForThrottling; |
| 4087 } | 4042 } |
| 4088 | 4043 |
| 4089 } // namespace blink | 4044 } // namespace blink |
| OLD | NEW |