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

Side by Side Diff: Source/core/page/FrameView.cpp

Issue 14766010: Clarify the size of a document view (a.k.a layout size) that causes FrameView to emit the resize ev… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Apply aellas's review Created 7 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 // Now set our scrollbar state for the layout. 987 // Now set our scrollbar state for the layout.
988 ScrollbarMode currentHMode = horizontalScrollbarMode(); 988 ScrollbarMode currentHMode = horizontalScrollbarMode();
989 ScrollbarMode currentVMode = verticalScrollbarMode(); 989 ScrollbarMode currentVMode = verticalScrollbarMode();
990 990
991 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) { 991 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) {
992 if (m_firstLayout) { 992 if (m_firstLayout) {
993 setScrollbarsSuppressed(true); 993 setScrollbarsSuppressed(true);
994 994
995 m_firstLayout = false; 995 m_firstLayout = false;
996 m_firstLayoutCallbackPending = true; 996 m_firstLayoutCallbackPending = true;
997 m_lastViewportSize = visibleContentRect(IncludeScrollbars).s ize(); 997 m_lastViewportSize = layoutSize(IncludeScrollbars);
998 m_lastZoomFactor = root->style()->zoom(); 998 m_lastZoomFactor = root->style()->zoom();
999 999
1000 // Set the initial vMode to AlwaysOn if we're auto. 1000 // Set the initial vMode to AlwaysOn if we're auto.
1001 if (vMode == ScrollbarAuto) 1001 if (vMode == ScrollbarAuto)
1002 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear. 1002 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear.
1003 // Set the initial hMode to AlwaysOff if we're auto. 1003 // Set the initial hMode to AlwaysOff if we're auto.
1004 if (hMode == ScrollbarAuto) 1004 if (hMode == ScrollbarAuto)
1005 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. 1005 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear.
1006 1006
1007 setScrollbarModes(hMode, vMode); 1007 setScrollbarModes(hMode, vMode);
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
2295 2295
2296 // Viewport-dependent media queries may cause us to need completely differen t style information. 2296 // Viewport-dependent media queries may cause us to need completely differen t style information.
2297 if (m_frame->document()->styleResolver()->affectedByViewportChange()) { 2297 if (m_frame->document()->styleResolver()->affectedByViewportChange()) {
2298 m_frame->document()->styleResolverChanged(DeferRecalcStyle); 2298 m_frame->document()->styleResolverChanged(DeferRecalcStyle);
2299 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document()); 2299 InspectorInstrumentation::mediaQueryResultChanged(m_frame->document());
2300 } 2300 }
2301 2301
2302 // Refetch render view since it can be destroyed by updateWidget() call abov e. 2302 // Refetch render view since it can be destroyed by updateWidget() call abov e.
2303 renderView = this->renderView(); 2303 renderView = this->renderView();
2304 if (renderView && !renderView->printing()) { 2304 if (renderView && !renderView->printing()) {
2305 IntSize currentSize; 2305 IntSize currentSize = layoutSize(IncludeScrollbars);
2306 currentSize = visibleContentRect(IncludeScrollbars).size();
2307 float currentZoomFactor = renderView->style()->zoom(); 2306 float currentZoomFactor = renderView->style()->zoom();
2308 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor); 2307 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor);
2309 m_lastViewportSize = currentSize; 2308 m_lastViewportSize = currentSize;
2310 m_lastZoomFactor = currentZoomFactor; 2309 m_lastZoomFactor = currentZoomFactor;
2311 if (resized) { 2310 if (resized) {
2312 m_frame->eventHandler()->sendResizeEvent(); 2311 m_frame->eventHandler()->sendResizeEvent();
2313 if (page && page->mainFrame() == m_frame) 2312 if (page && page->mainFrame() == m_frame)
2314 InspectorInstrumentation::didResizeMainFrame(page); 2313 InspectorInstrumentation::didResizeMainFrame(page);
2315 } 2314 }
2316 } 2315 }
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
3416 } 3415 }
3417 3416
3418 AXObjectCache* FrameView::axObjectCache() const 3417 AXObjectCache* FrameView::axObjectCache() const
3419 { 3418 {
3420 if (frame() && frame()->document()) 3419 if (frame() && frame()->document())
3421 return frame()->document()->existingAXObjectCache(); 3420 return frame()->document()->existingAXObjectCache();
3422 return 0; 3421 return 0;
3423 } 3422 }
3424 3423
3425 } // namespace WebCore 3424 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698