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

Side by Side Diff: Source/core/testing/Internals.cpp

Issue 23185008: Reset viewport to implicit when @viewport is removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
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 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 { 973 {
974 if (!document || !document->page()) { 974 if (!document || !document->page()) {
975 es.throwDOMException(InvalidAccessError); 975 es.throwDOMException(InvalidAccessError);
976 return String(); 976 return String();
977 } 977 }
978 Page* page = document->page(); 978 Page* page = document->page();
979 979
980 // Update initial viewport size. 980 // Update initial viewport size.
981 IntSize initialViewportSize(availableWidth, availableHeight); 981 IntSize initialViewportSize(availableWidth, availableHeight);
982 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero() , initialViewportSize)); 982 document->page()->mainFrame()->view()->setFrameRect(IntRect(IntPoint::zero() , initialViewportSize));
983 document->styleResolver()->viewportStyleResolver()->resolve();
984 983
985 ViewportArguments arguments = page->viewportArguments(); 984 ViewportArguments arguments = page->viewportArguments();
986 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, 98 0 /* defaultLayoutWidthForNonMobilePages */); 985 PageScaleConstraints constraints = arguments.resolve(initialViewportSize, 98 0 /* defaultLayoutWidthForNonMobilePages */);
987 986
988 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h); 987 constraints.fitToContentsWidth(constraints.layoutSize.width(), availableWidt h);
989 988
990 StringBuilder builder; 989 StringBuilder builder;
991 990
992 builder.appendLiteral("viewport size "); 991 builder.appendLiteral("viewport size ");
993 builder.append(String::number(constraints.layoutSize.width())); 992 builder.append(String::number(constraints.layoutSize.width()));
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after
2177 return false; 2176 return false;
2178 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB); 2177 sharedContext->getExtensions()->loseContextCHROMIUM(Extensions3D::GUILTY_CON TEXT_RESET_ARB, Extensions3D::INNOCENT_CONTEXT_RESET_ARB);
2179 // To prevent tests that call loseSharedGraphicsContext3D from being 2178 // To prevent tests that call loseSharedGraphicsContext3D from being
2180 // flaky, we call finish so that the context is guaranteed to be lost 2179 // flaky, we call finish so that the context is guaranteed to be lost
2181 // synchronously (i.e. before returning). 2180 // synchronously (i.e. before returning).
2182 sharedContext->finish(); 2181 sharedContext->finish();
2183 return true; 2182 return true;
2184 } 2183 }
2185 2184
2186 } 2185 }
OLDNEW
« Source/core/css/resolver/ViewportStyleResolver.cpp ('K') | « Source/core/dom/Document.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698