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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2431613002: Initial viewport is not the same as FrameView rect. (Closed)
Patch Set: DCHECK that initial viewport size is read from main frame only. Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 1899
1900 pageScaleConstraintsSet().didChangeInitialContainingBlockSize(ICBSize); 1900 pageScaleConstraintsSet().didChangeInitialContainingBlockSize(ICBSize);
1901 1901
1902 updatePageDefinedViewportConstraints( 1902 updatePageDefinedViewportConstraints(
1903 mainFrameImpl()->frame()->document()->viewportDescription()); 1903 mainFrameImpl()->frame()->document()->viewportDescription());
1904 updateMainFrameLayoutSize(); 1904 updateMainFrameLayoutSize();
1905 1905
1906 page()->frameHost().visualViewport().setSize(m_size); 1906 page()->frameHost().visualViewport().setSize(m_size);
1907 1907
1908 if (mainFrameImpl()->frameView()) { 1908 if (mainFrameImpl()->frameView()) {
1909 mainFrameImpl()->frameView()->setInitialViewportSize(ICBSize);
1909 if (!mainFrameImpl()->frameView()->needsLayout()) 1910 if (!mainFrameImpl()->frameView()->needsLayout())
1910 postLayoutResize(mainFrameImpl()); 1911 postLayoutResize(mainFrameImpl());
1911 } 1912 }
1912 } 1913 }
1913 1914
1914 void WebViewImpl::updateTopControlsState(WebTopControlsState constraint, 1915 void WebViewImpl::updateTopControlsState(WebTopControlsState constraint,
1915 WebTopControlsState current, 1916 WebTopControlsState current,
1916 bool animate) { 1917 bool animate) {
1917 topControls().updateConstraintsAndState(constraint, current, animate); 1918 topControls().updateConstraintsAndState(constraint, current, animate);
1918 1919
(...skipping 2083 matching lines...) Expand 10 before | Expand all | Expand 10 after
4002 if (!m_client || !frame->isLocalRoot()) 4003 if (!m_client || !frame->isLocalRoot())
4003 return; 4004 return;
4004 4005
4005 if (m_shouldAutoResize) { 4006 if (m_shouldAutoResize) {
4006 WebSize frameSize = frame->view()->frameRect().size(); 4007 WebSize frameSize = frame->view()->frameRect().size();
4007 if (frameSize != m_size) { 4008 if (frameSize != m_size) {
4008 m_size = frameSize; 4009 m_size = frameSize;
4009 4010
4010 page()->frameHost().visualViewport().setSize(m_size); 4011 page()->frameHost().visualViewport().setSize(m_size);
4011 pageScaleConstraintsSet().didChangeInitialContainingBlockSize(m_size); 4012 pageScaleConstraintsSet().didChangeInitialContainingBlockSize(m_size);
4013 frame->view()->setInitialViewportSize(m_size);
4012 4014
4013 m_client->didAutoResize(m_size); 4015 m_client->didAutoResize(m_size);
4014 sendResizeEventAndRepaint(); 4016 sendResizeEventAndRepaint();
4015 } 4017 }
4016 } 4018 }
4017 4019
4018 if (pageScaleConstraintsSet().constraintsDirty()) 4020 if (pageScaleConstraintsSet().constraintsDirty())
4019 refreshPageScaleFactorAfterLayout(); 4021 refreshPageScaleFactorAfterLayout();
4020 4022
4021 FrameView* view = webframe->frame()->view(); 4023 FrameView* view = webframe->frame()->view();
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
4548 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4550 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4549 return nullptr; 4551 return nullptr;
4550 return focusedFrame; 4552 return focusedFrame;
4551 } 4553 }
4552 4554
4553 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4555 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4554 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4556 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4555 } 4557 }
4556 4558
4557 } // namespace blink 4559 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698