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

Unified Diff: Source/WebCore/rendering/RenderLayer.cpp

Issue 9385018: Merge 106730 - Source/WebCore: Patch by Swapna P <spottabathini@innominds.com> on 2012-02-04 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 10 months 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
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderLayer.cpp
===================================================================
--- Source/WebCore/rendering/RenderLayer.cpp (revision 107432)
+++ Source/WebCore/rendering/RenderLayer.cpp (working copy)
@@ -67,6 +67,7 @@
#include "FrameView.h"
#include "Gradient.h"
#include "GraphicsContext.h"
+#include "HTMLFrameElement.h"
#include "HTMLFrameOwnerElement.h"
#include "HTMLNames.h"
#include "HitTestingTransformState.h"
@@ -1542,20 +1543,31 @@
}
} else if (!parentLayer && renderer()->isBox() && renderBox()->canBeProgramaticallyScrolled()) {
if (frameView) {
- if (renderer()->document() && renderer()->document()->ownerElement() && renderer()->document()->ownerElement()->renderer()) {
- LayoutRect viewRect = frameView->visibleContentRect();
- LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY);
-
- LayoutUnit xOffset = r.x();
- LayoutUnit yOffset = r.y();
- // Adjust offsets if they're outside of the allowable range.
- xOffset = max<LayoutUnit>(0, min(frameView->contentsWidth(), xOffset));
- yOffset = max<LayoutUnit>(0, min(frameView->contentsHeight(), yOffset));
+ Element* ownerElement = 0;
+ if (renderer()->document())
+ ownerElement = renderer()->document()->ownerElement();
- frameView->setScrollPosition(IntPoint(xOffset, yOffset));
- parentLayer = renderer()->document()->ownerElement()->renderer()->enclosingLayer();
- newRect.setX(rect.x() - frameView->scrollX() + frameView->x());
- newRect.setY(rect.y() - frameView->scrollY() + frameView->y());
+ if (ownerElement && ownerElement->renderer()) {
+ HTMLFrameElement* frameElement = 0;
+
+ if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag))
+ frameElement = static_cast<HTMLFrameElement*>(ownerElement);
+
+ if (frameElement && frameElement->scrollingMode() != ScrollbarAlwaysOff) {
+ LayoutRect viewRect = frameView->visibleContentRect();
+ LayoutRect exposeRect = getRectToExpose(viewRect, rect, alignX, alignY);
+
+ LayoutUnit xOffset = exposeRect.x();
+ LayoutUnit yOffset = exposeRect.y();
+ // Adjust offsets if they're outside of the allowable range.
+ xOffset = max<LayoutUnit>(0, min(frameView->contentsWidth(), xOffset));
+ yOffset = max<LayoutUnit>(0, min(frameView->contentsHeight(), yOffset));
+
+ frameView->setScrollPosition(IntPoint(xOffset, yOffset));
+ parentLayer = ownerElement->renderer()->enclosingLayer();
+ newRect.setX(rect.x() - frameView->scrollX() + frameView->x());
+ newRect.setY(rect.y() - frameView->scrollY() + frameView->y());
+ }
} else {
LayoutRect viewRect = frameView->visibleContentRect();
LayoutRect r = getRectToExpose(viewRect, rect, alignX, alignY);
« no previous file with comments | « Source/WebCore/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698