Changeset 27581 in webkit
- Timestamp:
- Nov 7, 2007 1:54:57 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 7 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r27579 r27581 1 2007-11-07 David Kilzer <ddkilzer@apple.com> 2 3 WebKit confuses width/height for Media Queries device-aspect-ratio evaluation 4 <http://bugs.webkit.org/show_bug.cgi?id=14893> 5 <rdar://problem/5380295> 6 7 Reviewed by Darin. 8 9 Each of the following tests creates a <link> element and dynamically sets its 10 media query based on the aspect ratio (width/height) of the current screen. 11 When the <link> element is attached to the <head> node, the test expects the 12 stylesheet to be loaded for the test to pass. 13 14 * fast/css/device-aspect-ratio-expected.txt: Added. 15 * fast/css/device-aspect-ratio.html: Added. 16 17 This test sets the device-aspect-ratio to the current size of the screen. 18 NOTE: This test passed before the fix. 19 20 * fast/css/max-device-aspect-ratio-expected.txt: Added. 21 * fast/css/max-device-aspect-ratio.html: Added. 22 23 This test sets the max-device-aspect ratio to 100/1 for landscape monitors or 24 1/1 for portrait (or square) monitors. 25 NOTE: This test failed before the fix. 26 27 * fast/css/min-device-aspect-ratio-expected.txt: Added. 28 * fast/css/min-device-aspect-ratio.html: Added. 29 30 This test sets the min-device-aspect ratio to 1/1 for landscape monitors or 31 1/100 for portrait (or square) monitors. 32 NOTE: This test failed before the fix. 33 34 * fast/css/resources/device-aspect-ratio.css: Added. 35 1 36 2007-11-07 Dan Bernstein <mitz@apple.com> 2 37 -
trunk/WebCore/ChangeLog
r27580 r27581 1 2007-11-07 David Kilzer <ddkilzer@apple.com> 2 3 WebKit confuses width/height for Media Queries device-aspect-ratio evaluation 4 <http://bugs.webkit.org/show_bug.cgi?id=14893> 5 <rdar://problem/5380295> 6 7 Reviewed by Darin. 8 9 Tests: fast/css/device-aspect-ratio.html 10 fast/css/max-device-aspect-ratio.html 11 fast/css/min-device-aspect-ratio.html 12 13 * css/MediaQueryEvaluator.cpp: 14 (WebCore::parseAspectRatio): Renamed method parameters from a/b to h/v. 15 (WebCore::device_aspect_ratioMediaFeatureEval): Renamed local variables from 16 a/b to h/v. Switched first two arguments of the call to cmpvalue() to fix 17 the bug. 18 1 19 2007-11-07 Dan Bernstein <mitz@apple.com> 2 20 -
trunk/WebCore/css/MediaQueryEvaluator.cpp
r23916 r27581 155 155 } 156 156 157 static bool parseAspectRatio(CSSValue* value, int& a, int& b)157 static bool parseAspectRatio(CSSValue* value, int& h, int& v) 158 158 { 159 159 if (value->isValueList()){ … … 168 168 String str = static_cast<CSSPrimitiveValue*>(i1)->getStringValue(); 169 169 if (!str.isNull() && str.length() == 1 && str[0] == DeprecatedChar('/')) { 170 a= static_cast<CSSPrimitiveValue*>(i0)->getIntValue(CSSPrimitiveValue::CSS_NUMBER);171 b= static_cast<CSSPrimitiveValue*>(i2)->getIntValue(CSSPrimitiveValue::CSS_NUMBER);170 h = static_cast<CSSPrimitiveValue*>(i0)->getIntValue(CSSPrimitiveValue::CSS_NUMBER); 171 v = static_cast<CSSPrimitiveValue*>(i2)->getIntValue(CSSPrimitiveValue::CSS_NUMBER); 172 172 return true; 173 173 } … … 236 236 if (value) { 237 237 FloatRect sg = screenRect(page->mainFrame()->view()); 238 int a= 0;239 int b= 0;240 if (parseAspectRatio(value, a, b))241 return b != 0 && cmpvalue(a * (int)sg.height(), b * (int)sg.width(), op);238 int h = 0; 239 int v = 0; 240 if (parseAspectRatio(value, h, v)) 241 return v != 0 && cmpvalue((int)sg.width() * v, (int)sg.height() * h, op); 242 242 return false; 243 243 }
Note: See TracChangeset
for help on using the changeset viewer.