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

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

Issue 1007013002: Make scrollWidth and scrollHeight match other DOM measurement APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add additional test expectation Created 5 years, 8 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 | « Source/core/layout/LayoutTextControlSingleLine.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 3357 matching lines...) Expand 10 before | Expand all | Expand 10 after
3368 return IntSize(); 3368 return IntSize();
3369 LayoutView* root = page()->deprecatedLocalMainFrame()->contentRenderer(); 3369 LayoutView* root = page()->deprecatedLocalMainFrame()->contentRenderer();
3370 if (!root) 3370 if (!root)
3371 return IntSize(); 3371 return IntSize();
3372 return root->documentRect().size(); 3372 return root->documentRect().size();
3373 } 3373 }
3374 3374
3375 WebSize WebViewImpl::contentsPreferredMinimumSize() 3375 WebSize WebViewImpl::contentsPreferredMinimumSize()
3376 { 3376 {
3377 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate dLocalMainFrame()->document() : 0; 3377 Document* document = m_page->mainFrame()->isLocalFrame() ? m_page->deprecate dLocalMainFrame()->document() : 0;
3378 if (!document || !document->layoutView() || !document->documentElement()) 3378 if (!document || !document->layoutView() || !document->documentElement() || !document->documentElement()->layoutBox())
3379 return WebSize(); 3379 return WebSize();
3380 3380
3381 layout(); 3381 layout();
3382 int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Alr eady accounts for zoom. 3382 int widthScaled = document->layoutView()->minPreferredLogicalWidth(); // Alr eady accounts for zoom.
3383 int heightScaled = static_cast<int>(document->documentElement()->scrollHeigh t() * zoomLevelToZoomFactor(zoomLevel())); 3383 LayoutBox* documentBox = document->documentElement()->layoutBox();
3384 // TODO(leviw): We truncate then zoom the height instead of rounding to matc h the width behavior. We
3385 // should be able to call documentElement's scrollHeight() method. crbug.com /471336
3386 int heightScaled = adjustLayoutUnitForAbsoluteZoom(documentBox->scrollHeight (), *documentBox).toInt() * zoomLevelToZoomFactor(zoomLevel());
3384 return IntSize(widthScaled, heightScaled); 3387 return IntSize(widthScaled, heightScaled);
3385 } 3388 }
3386 3389
3387 void WebViewImpl::enableViewport() 3390 void WebViewImpl::enableViewport()
3388 { 3391 {
3389 settings()->setViewportEnabled(true); 3392 settings()->setViewportEnabled(true);
3390 } 3393 }
3391 3394
3392 void WebViewImpl::disableViewport() 3395 void WebViewImpl::disableViewport()
3393 { 3396 {
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
4523 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4526 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4524 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4527 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4525 } 4528 }
4526 4529
4527 void WebViewImpl::forceNextWebGLContextCreationToFail() 4530 void WebViewImpl::forceNextWebGLContextCreationToFail()
4528 { 4531 {
4529 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4532 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4530 } 4533 }
4531 4534
4532 } // namespace blink 4535 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTextControlSingleLine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698