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

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

Issue 19272007: Update parent layout when child frame requests innerHeight/innerWidth. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Only force layout in innerWidth/innerHeight Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/frames/frame-dimensions-before-parent-layout-expected.txt ('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) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 1007 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 1018
1019 int DOMWindow::innerHeight() const 1019 int DOMWindow::innerHeight() const
1020 { 1020 {
1021 if (!m_frame) 1021 if (!m_frame)
1022 return 0; 1022 return 0;
1023 1023
1024 FrameView* view = m_frame->view(); 1024 FrameView* view = m_frame->view();
1025 if (!view) 1025 if (!view)
1026 return 0; 1026 return 0;
1027 1027
1028 // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer.
esprehn 2013/07/16 02:58:50 I don't think you need the fixme, this is true of
1029 if (Frame* parent = m_frame->tree()->parent())
1030 parent->document()->updateLayoutIgnorePendingStylesheets();
1031
1028 // If the device height is overridden, do not include the horizontal scrollb ar into the innerHeight (since it is absent on the real device). 1032 // If the device height is overridden, do not include the horizontal scrollb ar into the innerHeight (since it is absent on the real device).
1029 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightO verride(m_frame); 1033 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenHeightO verride(m_frame);
1030 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRe ct(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::Exclu deScrollbars).height())); 1034 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRe ct(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::Exclu deScrollbars).height()));
1031 } 1035 }
1032 1036
1033 int DOMWindow::innerWidth() const 1037 int DOMWindow::innerWidth() const
1034 { 1038 {
1035 if (!m_frame) 1039 if (!m_frame)
1036 return 0; 1040 return 0;
1037 1041
1038 FrameView* view = m_frame->view(); 1042 FrameView* view = m_frame->view();
1039 if (!view) 1043 if (!view)
1040 return 0; 1044 return 0;
1041 1045
1046 // FIXME: This is potentially too much work. We really only need to know the dimensions of the parent frame's renderer.
1047 if (Frame* parent = m_frame->tree()->parent())
1048 parent->document()->updateLayoutIgnorePendingStylesheets();
1049
1042 // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device). 1050 // If the device width is overridden, do not include the vertical scrollbar into the innerWidth (since it is absent on the real device).
1043 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOv erride(m_frame); 1051 bool includeScrollbars = !InspectorInstrumentation::shouldApplyScreenWidthOv erride(m_frame);
1044 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRe ct(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::Exclu deScrollbars).width())); 1052 return view->mapFromLayoutToCSSUnits(static_cast<int>(view->visibleContentRe ct(includeScrollbars ? ScrollableArea::IncludeScrollbars : ScrollableArea::Exclu deScrollbars).width()));
1045 } 1053 }
1046 1054
1047 int DOMWindow::screenX() const 1055 int DOMWindow::screenX() const
1048 { 1056 {
1049 if (!m_frame) 1057 if (!m_frame)
1050 return 0; 1058 return 0;
1051 1059
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
1954 1962
1955 Frame* child = frame->tree()->scopedChild(index); 1963 Frame* child = frame->tree()->scopedChild(index);
1956 if (child) 1964 if (child)
1957 return child->document()->domWindow(); 1965 return child->document()->domWindow();
1958 1966
1959 return 0; 1967 return 0;
1960 } 1968 }
1961 1969
1962 1970
1963 } // namespace WebCore 1971 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/frames/frame-dimensions-before-parent-layout-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698