CSS3 calc: mixed percent/absolute support for vertical-align
authormikelawther@chromium.org <mikelawther@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 17:45:20 +0000 (17:45 +0000)
committermikelawther@chromium.org <mikelawther@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 Mar 2012 17:45:20 +0000 (17:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82152

Reviewed by Ojan Vafai.

Source/WebCore:

Tests: css3/calc/vertical-align-expected.html
       css3/calc/vertical-align.html

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

LayoutTests:

* css3/calc/vertical-align-expected.html: Added.
* css3/calc/vertical-align.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/css3/calc/vertical-align-expected.html [new file with mode: 0644]
LayoutTests/css3/calc/vertical-align.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleApplyProperty.cpp

index 671262a..9ee31db 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-26  Mike Lawther  <mikelawther@chromium.org>
+
+        CSS3 calc: mixed percent/absolute support for vertical-align
+        https://bugs.webkit.org/show_bug.cgi?id=82152
+
+        Reviewed by Ojan Vafai.
+
+        * css3/calc/vertical-align-expected.html: Added.
+        * css3/calc/vertical-align.html: Added.
+
 2012-03-26  Stephen Chenney  <schenney@chromium.org>
 
         Failure to invalidate text position attributes when DOM changes 
diff --git a/LayoutTests/css3/calc/vertical-align-expected.html b/LayoutTests/css3/calc/vertical-align-expected.html
new file mode 100644 (file)
index 0000000..4489a36
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+.aligntest {
+    line-height: 16px;
+    vertical-align: -webkit-calc(9px);
+}
+</style>
+<hr/>
+<span class="aligntest">The first four words</span> in this sentence should have a line-height of 16px; they are also (25%+5px)-aligned, which should raise them 9px relative to the natural baseline.
+<hr/>
\ No newline at end of file
diff --git a/LayoutTests/css3/calc/vertical-align.html b/LayoutTests/css3/calc/vertical-align.html
new file mode 100644 (file)
index 0000000..faf6d3c
--- /dev/null
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<style>
+.aligntest {
+    line-height: 16px;
+    vertical-align: -webkit-calc(25% + 5px);
+}
+</style>
+<hr/>
+<span class="aligntest">The first four words</span> in this sentence should have a line-height of 16px; they are also (25%+5px)-aligned, which should raise them 9px relative to the natural baseline.
+<hr/>
\ No newline at end of file
index 9891d4e..72781e8 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-26  Mike Lawther  <mikelawther@chromium.org>
+
+        CSS3 calc: mixed percent/absolute support for vertical-align
+        https://bugs.webkit.org/show_bug.cgi?id=82152
+
+        Reviewed by Ojan Vafai.
+
+        Tests: css3/calc/vertical-align-expected.html
+               css3/calc/vertical-align.html
+
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::ApplyPropertyVerticalAlign::applyValue):
+
 2012-03-26  Filip Spacek  <fspacek@rim.com>
 
         [BlackBerry] Accelerated compositing updates
index 5a1ec71..836f722 100644 (file)
@@ -1567,7 +1567,7 @@ public:
         if (primitiveValue->getIdent())
             return selector->style()->setVerticalAlign(*primitiveValue);
 
-        selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));
+        selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));
     }
 
     static PropertyHandler createHandler()