Title: [110455] trunk
Revision
110455
Author
[email protected]
Date
2012-03-12 12:20:56 -0700 (Mon, 12 Mar 2012)

Log Message

CSS3 calc: enable mixed percent/absolute for font
https://bugs.webkit.org/show_bug.cgi?id=80813

Reviewed by Ojan Vafai.

Source/WebCore:

Add support for mixed percent/absolute expressions to the font handling class.

* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyFontSize::applyValue):

LayoutTests:

* css3/calc/font-expected.txt:
* css3/calc/font-size-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110454 => 110455)


--- trunk/LayoutTests/ChangeLog	2012-03-12 19:19:18 UTC (rev 110454)
+++ trunk/LayoutTests/ChangeLog	2012-03-12 19:20:56 UTC (rev 110455)
@@ -1,3 +1,13 @@
+2012-03-12  Mike Lawther  <[email protected]>
+
+        CSS3 calc: enable mixed percent/absolute for font
+        https://bugs.webkit.org/show_bug.cgi?id=80813
+
+        Reviewed by Ojan Vafai.
+
+        * css3/calc/font-expected.txt:
+        * css3/calc/font-size-expected.txt:
+
 2012-03-12  Mike Reed  <[email protected]>
 
         update expectations in preparation for bitmap-sampling fix in skia

Modified: trunk/LayoutTests/css3/calc/font-expected.txt (110454 => 110455)


--- trunk/LayoutTests/css3/calc/font-expected.txt	2012-03-12 19:19:18 UTC (rev 110454)
+++ trunk/LayoutTests/css3/calc/font-expected.txt	2012-03-12 19:20:56 UTC (rev 110455)
@@ -10,7 +10,7 @@
 PASS getComputedStyle(document.getElementById("calc-both"), null).lineHeight is "63px"
 PASS getComputedStyle(document.getElementById("calc-both"), null).fontSize is "24px"
 PASS getComputedStyle(document.getElementById("calc-percent-size"), null).lineHeight is "63px"
-FAIL getComputedStyle(document.getElementById("calc-percent-size"), null).fontSize should be 24px. Was 16px.
+PASS getComputedStyle(document.getElementById("calc-percent-size"), null).fontSize is "24px"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/css3/calc/font-size-expected.txt (110454 => 110455)


--- trunk/LayoutTests/css3/calc/font-size-expected.txt	2012-03-12 19:19:18 UTC (rev 110454)
+++ trunk/LayoutTests/css3/calc/font-size-expected.txt	2012-03-12 19:20:56 UTC (rev 110455)
@@ -4,7 +4,7 @@
 
 
 PASS getComputedStyle(document.getElementById("calc-percent"), null).fontSize is "40px"
-FAIL getComputedStyle(document.getElementById("calc-percent-pixels"), null).fontSize should be 40px. Was 20px.
+PASS getComputedStyle(document.getElementById("calc-percent-pixels"), null).fontSize is "40px"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/WebCore/ChangeLog (110454 => 110455)


--- trunk/Source/WebCore/ChangeLog	2012-03-12 19:19:18 UTC (rev 110454)
+++ trunk/Source/WebCore/ChangeLog	2012-03-12 19:20:56 UTC (rev 110455)
@@ -1,3 +1,15 @@
+2012-03-12  Mike Lawther  <[email protected]>
+
+        CSS3 calc: enable mixed percent/absolute for font
+        https://bugs.webkit.org/show_bug.cgi?id=80813
+
+        Reviewed by Ojan Vafai.
+
+        Add support for mixed percent/absolute expressions to the font handling class.
+
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::ApplyPropertyFontSize::applyValue):
+
 2012-03-12  Andreas Kling  <[email protected]>
 
         Restore Attr::style() functionality.

Modified: trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp (110454 => 110455)


--- trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2012-03-12 19:19:18 UTC (rev 110454)
+++ trunk/Source/WebCore/css/CSSStyleApplyProperty.cpp	2012-03-12 19:20:56 UTC (rev 110455)
@@ -739,6 +739,8 @@
                 size = primitiveValue->computeLength<float>(selector->parentStyle(), selector->rootElementStyle(), 1.0, true);
             else if (primitiveValue->isPercentage())
                 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
+            else if (primitiveValue->isCalculatedPercentageWithLength())
+                size = primitiveValue->cssCalcValue()->toCalcValue(selector->parentStyle(), selector->rootElementStyle())->evaluate(parentSize);                
             else
                 return;
         }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to