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

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: Add new test: fast/events/resize-events-count.html Created 7 years, 7 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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 // Now set our scrollbar state for the layout. 1014 // Now set our scrollbar state for the layout.
1015 ScrollbarMode currentHMode = horizontalScrollbarMode(); 1015 ScrollbarMode currentHMode = horizontalScrollbarMode();
1016 ScrollbarMode currentVMode = verticalScrollbarMode(); 1016 ScrollbarMode currentVMode = verticalScrollbarMode();
1017 1017
1018 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) { 1018 if (m_firstLayout || (hMode != currentHMode || vMode != currentVMode )) {
1019 if (m_firstLayout) { 1019 if (m_firstLayout) {
1020 setScrollbarsSuppressed(true); 1020 setScrollbarsSuppressed(true);
1021 1021
1022 m_firstLayout = false; 1022 m_firstLayout = false;
1023 m_firstLayoutCallbackPending = true; 1023 m_firstLayoutCallbackPending = true;
1024 m_lastViewportSize = visibleContentRect(IncludeScrollbars).s ize(); 1024 m_lastViewportSize = layoutSizeIncludingScrollbars();
kenneth.r.christiansen 2013/05/06 19:50:51 The layout size doesn't include scrollbars. That s
1025 m_lastZoomFactor = root->style()->zoom(); 1025 m_lastZoomFactor = root->style()->zoom();
1026 1026
1027 // Set the initial vMode to AlwaysOn if we're auto. 1027 // Set the initial vMode to AlwaysOn if we're auto.
1028 if (vMode == ScrollbarAuto) 1028 if (vMode == ScrollbarAuto)
1029 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear. 1029 setVerticalScrollbarMode(ScrollbarAlwaysOn); // This cau ses a vertical scrollbar to appear.
1030 // Set the initial hMode to AlwaysOff if we're auto. 1030 // Set the initial hMode to AlwaysOff if we're auto.
1031 if (hMode == ScrollbarAuto) 1031 if (hMode == ScrollbarAuto)
1032 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear. 1032 setHorizontalScrollbarMode(ScrollbarAlwaysOff); // This causes a horizontal scrollbar to disappear.
1033 1033
1034 setScrollbarModes(hMode, vMode); 1034 setScrollbarModes(hMode, vMode);
(...skipping 1272 matching lines...) Expand 10 before | Expand all | Expand 10 after
2307 } 2307 }
2308 2308
2309 scrollToAnchor(); 2309 scrollToAnchor();
2310 2310
2311 m_actionScheduler->resume(); 2311 m_actionScheduler->resume();
2312 2312
2313 // Refetch render view since it can be destroyed by updateWidget() 2313 // Refetch render view since it can be destroyed by updateWidget()
2314 // call above. 2314 // call above.
2315 renderView = this->renderView(); 2315 renderView = this->renderView();
2316 if (renderView && !renderView->printing()) { 2316 if (renderView && !renderView->printing()) {
2317 IntSize currentSize; 2317 IntSize currentSize = layoutSizeIncludingScrollbars();
2318 currentSize = visibleContentRect(IncludeScrollbars).size();
2319 float currentZoomFactor = renderView->style()->zoom(); 2318 float currentZoomFactor = renderView->style()->zoom();
2320 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor); 2319 bool resized = !m_firstLayout && (currentSize != m_lastViewportSize || c urrentZoomFactor != m_lastZoomFactor);
2321 m_lastViewportSize = currentSize; 2320 m_lastViewportSize = currentSize;
2322 m_lastZoomFactor = currentZoomFactor; 2321 m_lastZoomFactor = currentZoomFactor;
2323 if (resized) { 2322 if (resized) {
2324 m_frame->eventHandler()->sendResizeEvent(); 2323 m_frame->eventHandler()->sendResizeEvent();
2325 if (page && page->mainFrame() == m_frame) 2324 if (page && page->mainFrame() == m_frame)
2326 InspectorInstrumentation::didResizeMainFrame(page); 2325 InspectorInstrumentation::didResizeMainFrame(page);
2327 } 2326 }
2328 } 2327 }
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
3474 } 3473 }
3475 3474
3476 AXObjectCache* FrameView::axObjectCache() const 3475 AXObjectCache* FrameView::axObjectCache() const
3477 { 3476 {
3478 if (frame() && frame()->document()) 3477 if (frame() && frame()->document())
3479 return frame()->document()->existingAXObjectCache(); 3478 return frame()->document()->existingAXObjectCache();
3480 return 0; 3479 return 0;
3481 } 3480 }
3482 3481
3483 } // namespace WebCore 3482 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698