Changeset 127557 in webkit
- Timestamp:
- Sep 4, 2012 11:28:26 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127553 r127557 1 2012-09-04 Mike Lawther <mikelawther@chromium.org> 2 3 CSS3 calc: expressions with 'em' units do not zoom correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=95705 5 6 Reviewed by Ojan Vafai. 7 8 * css3/calc/zoom-with-em-expected.txt: Added. 9 * css3/calc/zoom-with-em.html: Added. 10 1 11 2012-09-04 Keishi Hattori <keishi@webkit.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r127556 r127557 1 2012-09-04 Mike Lawther <mikelawther@chromium.org> 2 3 CSS3 calc: expressions with 'em' units do not zoom correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=95705 5 6 Reviewed by Ojan Vafai. 7 8 Each primitive value in a CSS calc expression now has (zoom) multiplier and scale factor applied 9 independently. Previously the multiplier and a single scale factor was applied to the expression 10 as a whole, but this failed to account for expressions involving font relative units. This is 11 because the multiplier should not be applied to font relative units. 12 13 Test: css3/calc/zoom-with-em.html 14 15 * css/CSSPrimitiveValue.cpp: 16 (WebCore::CSSPrimitiveValue::computeLengthDouble): 17 1 18 2012-09-04 Brian Anderson <brianderson@chromium.org> 2 19 -
trunk/Source/WebCore/css/CSSPrimitiveValue.cpp
r127224 r127557 495 495 double CSSPrimitiveValue::computeLengthDouble(RenderStyle* style, RenderStyle* rootStyle, float multiplier, bool computingFontSize) 496 496 { 497 if (m_primitiveUnitType == CSS_CALC) 498 // The multiplier and factor is applied to each value in the calc expression individually 499 return m_value.calc->computeLengthPx(style, rootStyle, multiplier, computingFontSize); 500 497 501 double factor; 498 502 … … 541 545 } 542 546 543 double computedValue;544 if (m_primitiveUnitType == CSS_CALC)545 // The multiplier is passed in as 1.0 here to ensure it is only applied once546 computedValue = m_value.calc->computeLengthPx(style, rootStyle, 1.0, computingFontSize);547 else548 computedValue = getDoubleValue();549 550 547 // We do not apply the zoom factor when we are computing the value of the font-size property. The zooming 551 548 // for font sizes is much more complicated, since we have to worry about enforcing the minimum font size preference 552 549 // as well as enforcing the implicit "smart minimum." In addition the CSS property text-size-adjust is used to 553 550 // prevent text from zooming at all. Therefore we will not apply the zoom here if we are computing font-size. 554 double result = computedValue* factor;551 double result = getDoubleValue() * factor; 555 552 if (computingFontSize || isFontRelativeLength()) 556 553 return result;
Note: See TracChangeset
for help on using the changeset viewer.