Chromium Code Reviews| 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..05c50a83ae0dfae4596ac7a8be42c44b3da1404e 100644 |
| --- a/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/DevToolsEmulator.cpp |
| @@ -433,7 +433,10 @@ 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(); |
| + WebSize scroll_offset = |
| + web_view_->MainFrame()->IsWebLocalFrame() |
| + ? web_view_->MainFrame()->ToWebLocalFrame()->GetScrollOffset() |
| + : WebSize(); |
|
dcheng
2017/06/16 00:03:41
Do we need TODOs here for OOPIFs?
Łukasz Anforowicz
2017/06/16 21:28:13
Done.
|
| WebFloatPoint visual_offset = web_view_->VisualViewportOffset(); |
| float scroll_x = scroll_offset.width + visual_offset.x; |
| float scroll_y = scroll_offset.height + visual_offset.y; |
| @@ -540,8 +543,10 @@ 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))); |
| + 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(); |