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

Side by Side Diff: Source/core/css/LengthFunctions.cpp

Issue 19632002: Support 'extend-to-zoom' viewport descriptor value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed isExtendToZoom() 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
« no previous file with comments | « Source/core/css/CSSValueKeywords.in ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('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) 1999 Lars Knoll (knoll@kde.org) 2 Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 3 Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com) 4 Copyright (C) 2011 Rik Cabanier (cabanier@adobe.com)
5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 5 Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved. 6 Copyright (C) 2012 Motorola Mobility, Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return 0; 74 return 0;
75 case FillAvailable: 75 case FillAvailable:
76 case Auto: 76 case Auto:
77 return 0; 77 return 0;
78 case Relative: 78 case Relative:
79 case Intrinsic: 79 case Intrinsic:
80 case MinIntrinsic: 80 case MinIntrinsic:
81 case MinContent: 81 case MinContent:
82 case MaxContent: 82 case MaxContent:
83 case FitContent: 83 case FitContent:
84 case ExtendToZoom:
84 case Undefined: 85 case Undefined:
85 ASSERT_NOT_REACHED(); 86 ASSERT_NOT_REACHED();
86 return 0; 87 return 0;
87 } 88 }
88 ASSERT_NOT_REACHED(); 89 ASSERT_NOT_REACHED();
89 return 0; 90 return 0;
90 } 91 }
91 92
92 LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue, RenderV iew* renderView, bool roundPercentages) 93 LayoutUnit valueForLength(const Length& length, LayoutUnit maximumValue, RenderV iew* renderView, bool roundPercentages)
93 { 94 {
94 switch (length.type()) { 95 switch (length.type()) {
95 case Fixed: 96 case Fixed:
96 case Percent: 97 case Percent:
97 case Calculated: 98 case Calculated:
98 case ViewportPercentageWidth: 99 case ViewportPercentageWidth:
99 case ViewportPercentageHeight: 100 case ViewportPercentageHeight:
100 case ViewportPercentageMin: 101 case ViewportPercentageMin:
101 case ViewportPercentageMax: 102 case ViewportPercentageMax:
102 return minimumValueForLength(length, maximumValue, renderView, roundPerc entages); 103 return minimumValueForLength(length, maximumValue, renderView, roundPerc entages);
103 case FillAvailable: 104 case FillAvailable:
104 case Auto: 105 case Auto:
105 return maximumValue; 106 return maximumValue;
106 case Relative: 107 case Relative:
107 case Intrinsic: 108 case Intrinsic:
108 case MinIntrinsic: 109 case MinIntrinsic:
109 case MinContent: 110 case MinContent:
110 case MaxContent: 111 case MaxContent:
111 case FitContent: 112 case FitContent:
113 case ExtendToZoom:
112 case Undefined: 114 case Undefined:
113 ASSERT_NOT_REACHED(); 115 ASSERT_NOT_REACHED();
114 return 0; 116 return 0;
115 } 117 }
116 ASSERT_NOT_REACHED(); 118 ASSERT_NOT_REACHED();
117 return 0; 119 return 0;
118 } 120 }
119 121
120 float floatValueForLength(const Length& length, float maximumValue, RenderView* renderView) 122 float floatValueForLength(const Length& length, float maximumValue, RenderView* renderView)
121 { 123 {
(...skipping 26 matching lines...) Expand all
148 IntSize viewportSize = renderView->viewportSize(); 150 IntSize viewportSize = renderView->viewportSize();
149 return static_cast<int>(std::max(viewportSize.width(), viewportSize. height()) * length.viewportPercentageLength() / 100.0f); 151 return static_cast<int>(std::max(viewportSize.width(), viewportSize. height()) * length.viewportPercentageLength() / 100.0f);
150 } 152 }
151 return 0; 153 return 0;
152 case Relative: 154 case Relative:
153 case Intrinsic: 155 case Intrinsic:
154 case MinIntrinsic: 156 case MinIntrinsic:
155 case MinContent: 157 case MinContent:
156 case MaxContent: 158 case MaxContent:
157 case FitContent: 159 case FitContent:
160 case ExtendToZoom:
158 case Undefined: 161 case Undefined:
159 ASSERT_NOT_REACHED(); 162 ASSERT_NOT_REACHED();
160 return 0; 163 return 0;
161 } 164 }
162 ASSERT_NOT_REACHED(); 165 ASSERT_NOT_REACHED();
163 return 0; 166 return 0;
164 } 167 }
165 168
166 } // namespace WebCore 169 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSValueKeywords.in ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698