Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: Source/core/frame/FrameView.cpp

Issue 103583007: Ensure that if FrameView::isScrollable() is false, the assoc WebLayer is, too. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 91a37524021e1d8c599965b0db2654ebe5726af7..90ef138b631e8c15ec027cc4e30f7b6e73d843e4 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2598,6 +2598,19 @@ IntRect FrameView::scrollableAreaBoundingBox() const
return ownerRenderer->absoluteContentQuad().enclosingBoundingBox();
}
+bool FrameView::hasOverflow() const
+{
+ IntSize contentsSize = this->contentsSize();
+ IntSize visibleContentSize = visibleContentRect().size();
+ return contentsSize.height() > visibleContentSize.height() || contentsSize.width() > visibleContentSize.width();
+}
+
+bool FrameView::isVisibleToHitTesting() const
+{
+ HTMLFrameOwnerElement* owner = m_frame->ownerElement();
+ return !owner || (owner->renderer() && owner->renderer()->visibleToHitTesting());
+}
+
bool FrameView::isScrollable()
{
// Check for:
@@ -2607,14 +2620,11 @@ bool FrameView::isScrollable()
// 4) scrolling: no;
// Covers #1
- IntSize contentsSize = this->contentsSize();
- IntSize visibleContentSize = visibleContentRect().size();
- if ((contentsSize.height() <= visibleContentSize.height() && contentsSize.width() <= visibleContentSize.width()))
+ if (!hasOverflow())
return false;
// Covers #2.
- HTMLFrameOwnerElement* owner = m_frame->ownerElement();
- if (owner && (!owner->renderer() || !owner->renderer()->visibleToHitTesting()))
+ if (!isVisibleToHitTesting())
return false;
// Cover #3 and #4.

Powered by Google App Engine
This is Rietveld 408576698