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

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

Issue 23101004: Make configurationForViewport match production code (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed configurationForViewport to viewportAsText 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
« no previous file with comments | « Source/core/dom/ViewportArguments.cpp ('k') | Source/core/testing/Internals.h » ('j') | 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 m_finalConstraints = defaultConstraints(); 44 m_finalConstraints = defaultConstraints();
45 } 45 }
46 46
47 PageScaleConstraints PageScaleConstraintsSet::defaultConstraints() const 47 PageScaleConstraints PageScaleConstraintsSet::defaultConstraints() const
48 { 48 {
49 return PageScaleConstraints(-1, defaultMinimumScale, defaultMaximumScale); 49 return PageScaleConstraints(-1, defaultMinimumScale, defaultMaximumScale);
50 } 50 }
51 51
52 void PageScaleConstraintsSet::updatePageDefinedConstraints(const ViewportArgumen ts& arguments, IntSize viewSize, int layoutFallbackWidth) 52 void PageScaleConstraintsSet::updatePageDefinedConstraints(const ViewportArgumen ts& arguments, IntSize viewSize, int layoutFallbackWidth)
53 { 53 {
54 m_pageDefinedConstraints = arguments.resolve(viewSize, viewSize, layoutFallb ackWidth); 54 m_pageDefinedConstraints = arguments.resolve(viewSize, layoutFallbackWidth);
55 55
56 m_constraintsDirty = true; 56 m_constraintsDirty = true;
57 } 57 }
58 58
59 void PageScaleConstraintsSet::setUserAgentConstraints(const PageScaleConstraints & userAgentConstraints) 59 void PageScaleConstraintsSet::setUserAgentConstraints(const PageScaleConstraints & userAgentConstraints)
60 { 60 {
61 m_userAgentConstraints = userAgentConstraints; 61 m_userAgentConstraints = userAgentConstraints;
62 m_constraintsDirty = true; 62 m_constraintsDirty = true;
63 } 63 }
64 64
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 adjustedLayoutSizeWidth /= targetDensityDPIFactor; 143 adjustedLayoutSizeWidth /= targetDensityDPIFactor;
144 } 144 }
145 145
146 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0); 146 ASSERT(m_pageDefinedConstraints.layoutSize.width() > 0);
147 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width(); 147 float adjustedLayoutSizeHeight = (adjustedLayoutSizeWidth * m_pageDefinedCon straints.layoutSize.height()) / m_pageDefinedConstraints.layoutSize.width();
148 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth); 148 m_pageDefinedConstraints.layoutSize.setWidth(adjustedLayoutSizeWidth);
149 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight); 149 m_pageDefinedConstraints.layoutSize.setHeight(adjustedLayoutSizeHeight);
150 } 150 }
151 151
152 } // namespace WebCore 152 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ViewportArguments.cpp ('k') | Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698