Index: third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
diff --git a/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp b/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
index f1cf4697b5dc3f79dea6fd54fc657d0b1f09a913..9179193270347b99934613d394d74775a71abb15 100644 |
--- a/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
+++ b/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
@@ -433,7 +433,11 @@ void DevToolsEmulator::ApplyViewportOverride(TransformationMatrix* transform) { |
transform->Scale(viewport_override_->scale); |
// Translate while taking into account current scroll offset. |
- WebSize scroll_offset = web_view_->MainFrame()->GetScrollOffset(); |
+ // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. |
+ WebSize scroll_offset = |
+ web_view_->MainFrame()->IsWebLocalFrame() |
+ ? web_view_->MainFrame()->ToWebLocalFrame()->GetScrollOffset() |
+ : WebSize(); |
WebFloatPoint visual_offset = web_view_->VisualViewportOffset(); |
float scroll_x = scroll_offset.width + visual_offset.x; |
float scroll_y = scroll_offset.height + visual_offset.y; |
@@ -522,6 +526,7 @@ bool DevToolsEmulator::HandleInputEvent(const WebInputEvent& input_event) { |
// FIXME: This workaround is required for touch emulation on Mac, where |
// compositor-side pinch handling is not enabled. See http://crbug.com/138003. |
+ // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. |
LocalFrameView* frame_view = page->DeprecatedLocalMainFrame()->View(); |
WebGestureEvent scaled_event = TransformWebGestureEvent( |
frame_view, static_cast<const WebGestureEvent&>(input_event)); |
@@ -540,8 +545,11 @@ bool DevToolsEmulator::HandleInputEvent(const WebInputEvent& input_event) { |
IntPoint anchor_css(*last_pinch_anchor_dip_.get()); |
anchor_css.Scale(1.f / new_page_scale_factor, 1.f / new_page_scale_factor); |
web_view_->SetPageScaleFactor(new_page_scale_factor); |
- web_view_->MainFrame()->SetScrollOffset( |
- ToIntSize(*last_pinch_anchor_css_.get() - ToIntSize(anchor_css))); |
+ // TODO(lukasza): https://crbug.com/734201: Add OOPIF support. |
+ if (web_view_->MainFrame()->IsWebLocalFrame()) { |
+ web_view_->MainFrame()->ToWebLocalFrame()->SetScrollOffset( |
+ ToIntSize(*last_pinch_anchor_css_.get() - ToIntSize(anchor_css))); |
+ } |
} |
if (scaled_event.GetType() == WebInputEvent::kGesturePinchEnd) { |
last_pinch_anchor_css_.reset(); |