OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |