[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 01:56:44 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 759d07fed3d1fc463e0a967b972afcf496d144a5
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 23 12:04:39 2010 +0000

    2010-02-23  Yuta Kitamura  <yutak at chromium.org>
    
            Reviewed by Dan Bernstein.
    
            Fix alignment of vertical-align: text-bottom inside an inline-block.
    
            This patch is based on a fix provided by Takahito Hirano.
    
            display: inline-block + vertical-align: text-bottom causes misalignment.
            https://bugs.webkit.org/show_bug.cgi?id=30846
    
            * fast/inline-block/inline-block-vertical-align-2.html: Added.
            * fast/inline-block/inline-block-vertical-align-2-expected.txt: Added.
    2010-02-23  Yuta Kitamura  <yutak at chromium.org>
    
            Reviewed by Dan Bernstein.
    
            Fix alignment of vertical-align: text-bottom inside an inline-block.
    
            This patch is based on a fix provided by Takahito Hirano.
    
            display: inline-block + vertical-align: text-bottom causes misalignment.
            https://bugs.webkit.org/show_bug.cgi?id=30846
    
            Test: fast/inline-block/inline-block-vertical-align-2.html
    
            * rendering/RenderBoxModelObject.cpp:
            (WebCore::RenderBoxModelObject::verticalPosition): Fixed vpos calculation.
            We cannot cut corners for inline blocks, since they may have their own
            text metrics.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55141 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 97b2226..ba2de77 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-23  Yuta Kitamura  <yutak at chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix alignment of vertical-align: text-bottom inside an inline-block.
+        
+        This patch is based on a fix provided by Takahito Hirano.
+
+        display: inline-block + vertical-align: text-bottom causes misalignment.
+        https://bugs.webkit.org/show_bug.cgi?id=30846
+
+        * fast/inline-block/inline-block-vertical-align-2.html: Added.
+        * fast/inline-block/inline-block-vertical-align-2-expected.txt: Added.
+
 2010-02-23  Tony Chang  <tony at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/inline-block/inline-block-vertical-align-2-expected.txt b/LayoutTests/fast/inline-block/inline-block-vertical-align-2-expected.txt
new file mode 100644
index 0000000..bc0e176
--- /dev/null
+++ b/LayoutTests/fast/inline-block/inline-block-vertical-align-2-expected.txt
@@ -0,0 +1,5 @@
+The bottom line of the green box should be above the bottom line of the blue box.
+
+[Text] [Inline Block]
+
+PASS
diff --git a/LayoutTests/fast/inline-block/inline-block-vertical-align-2.html b/LayoutTests/fast/inline-block/inline-block-vertical-align-2.html
new file mode 100644
index 0000000..c50dff9
--- /dev/null
+++ b/LayoutTests/fast/inline-block/inline-block-vertical-align-2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>inline-block + vertical-align</title>
+  </head>
+  <style type="text/css">
+#outer {
+    border: 1px solid blue;
+}
+#inner {
+    display: inline-block;
+    vertical-align: text-bottom;
+    border: 1px solid green;
+}
+  </style>
+  <body>
+    <p>The bottom line of the green box should be above the bottom line of the blue box.</p>
+    <p>
+      <span id="outer">
+        [Text]
+        <span id="inner">
+          [Inline Block]
+        </span>
+      </span>
+    </p>
+    <p id="result"></p>
+    <script type="text/javascript">
+if (window.layoutTestController)
+    window.layoutTestController.dumpAsText();
+var result = document.getElementById('result');
+var outer = document.getElementById('outer');
+var inner = document.getElementById('inner');
+var outerBottom = outer.offsetTop + outer.offsetHeight;
+var innerBottom = inner.offsetTop + inner.offsetHeight;
+if (outerBottom >= innerBottom) {
+    result.innerHTML = 'PASS';
+    result.style.color = 'green';
+} else {
+    result.innerHTML = 'FAIL (outerBottom = ' + outerBottom + ', innerBottom = ' + innerBottom + ')';
+    result.style.color = 'red';
+}
+    </script>
+  </body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8201a52..a3586fd 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-23  Yuta Kitamura  <yutak at chromium.org>
+
+        Reviewed by Dan Bernstein.
+
+        Fix alignment of vertical-align: text-bottom inside an inline-block.
+        
+        This patch is based on a fix provided by Takahito Hirano.
+
+        display: inline-block + vertical-align: text-bottom causes misalignment.
+        https://bugs.webkit.org/show_bug.cgi?id=30846
+
+        Test: fast/inline-block/inline-block-vertical-align-2.html
+
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::verticalPosition): Fixed vpos calculation.
+        We cannot cut corners for inline blocks, since they may have their own
+        text metrics.
+
 2010-02-23  Steve Block  <steveblock at google.com>
 
         Reviewed by David Levin.
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index f224f76..2408796 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -793,7 +793,8 @@ int RenderBoxModelObject::verticalPosition(bool firstLine) const
             vpos += -static_cast<int>(f.xHeight() / 2) - lineHeight(firstLine) / 2 + baselinePosition(firstLine);
         else if (va == TEXT_BOTTOM) {
             vpos += f.descent();
-            if (!isReplaced()) // lineHeight - baselinePosition is always 0 for replaced elements, so don't bother wasting time in that case.
+            // lineHeight - baselinePosition is always 0 for replaced elements (except inline blocks), so don't bother wasting time in that case.
+            if (!isReplaced() || style()->display() == INLINE_BLOCK)
                 vpos -= (lineHeight(firstLine) - baselinePosition(firstLine));
         } else if (va == BASELINE_MIDDLE)
             vpos += -lineHeight(firstLine) / 2 + baselinePosition(firstLine);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list