WebCore:
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2008 06:20:16 +0000 (06:20 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Jan 2008 06:20:16 +0000 (06:20 +0000)
        Fix for http://bugs.webkit.org/show_bug.cgi?id=16611

        Make sure vertical-align length values are offset from their parents rather than being absolute to the
        line.

        Reviewed by olliej

        Added fast/css/vertical-align-lengths.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::getVerticalPosition):

LayoutTests:

       Fix for http://bugs.webkit.org/show_bug.cgi?id=16611

       Reviewed by olliej

        * ChangeLog:
        * fast/css/vertical-align-lengths.html: Added.
        * platform/mac/fast/css/vertical-align-lengths-expected.checksum: Added.
        * platform/mac/fast/css/vertical-align-lengths-expected.png: Added.
        * platform/mac/fast/css/vertical-align-lengths-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/css/vertical-align-lengths.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index 838f351d346838f54f47fd8405e6023e23a88d0e..39d1d6fdbe90c65bfff853c2833f30eac6400f18 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-16  David Hyatt  <hyatt@apple.com>
+
+       Fix for http://bugs.webkit.org/show_bug.cgi?id=16611
+
+       Reviewed by olliej
+
+        * ChangeLog:
+        * fast/css/vertical-align-lengths.html: Added.
+        * platform/mac/fast/css/vertical-align-lengths-expected.checksum: Added.
+        * platform/mac/fast/css/vertical-align-lengths-expected.png: Added.
+        * platform/mac/fast/css/vertical-align-lengths-expected.txt: Added.
+
 2008-01-16  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
 2008-01-16  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/css/vertical-align-lengths.html b/LayoutTests/fast/css/vertical-align-lengths.html
new file mode 100644 (file)
index 0000000..fc563e5
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <title></title>
+    <meta content="">
+    <style>b{vertical-align:-40px}</style><b>___<b>___<b>___<b>___
+  </head>
+  <body></body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.checksum b/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.checksum
new file mode 100644 (file)
index 0000000..1e5a106
--- /dev/null
@@ -0,0 +1 @@
+e76541d6d60ee9e0a66eafd7782cf354
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.png b/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.png
new file mode 100644 (file)
index 0000000..ba173db
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.txt b/LayoutTests/platform/mac/fast/css/vertical-align-lengths-expected.txt
new file mode 100644 (file)
index 0000000..5befbf6
--- /dev/null
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderInline {B} at (0,0) size 96x18
+        RenderText {#text} at (0,26) size 24x18
+          text run at (0,26) width 24: "___"
+        RenderInline {B} at (0,0) size 72x18
+          RenderText {#text} at (24,66) size 24x18
+            text run at (24,66) width 24: "___"
+          RenderInline {B} at (0,0) size 48x18
+            RenderText {#text} at (48,106) size 24x18
+              text run at (48,106) width 24: "___"
+            RenderInline {B} at (0,0) size 24x18
+              RenderText {#text} at (72,146) size 24x18
+                text run at (72,146) width 24: "___"
+              RenderText {#text} at (0,0) size 0x0
+              RenderText {#text} at (0,0) size 0x0
index f8c256357e5acb2c0c412eae77efa9cdaeaf9c04..39104ecbcbcb5d822b0bf096ce4a70389e0305f9 100644 (file)
@@ -1,3 +1,17 @@
+2008-01-16  David Hyatt  <hyatt@apple.com>
+
+        Fix for http://bugs.webkit.org/show_bug.cgi?id=16611
+
+        Make sure vertical-align length values are offset from their parents rather than being absolute to the
+        line.
+
+        Reviewed by olliej
+
+        Added fast/css/vertical-align-lengths.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::getVerticalPosition):
+
 2008-01-16  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
 2008-01-16  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Dave Hyatt.
index 259fa4dc06948f5a5d2a059f0f39bdfdea3c943a..64d5a520acae200b88fcdae0059105006e95e9ea 100644 (file)
@@ -2687,8 +2687,6 @@ short RenderObject::getVerticalPosition(bool firstLine) const
         vpos = PositionTop;
     else if (va == BOTTOM)
         vpos = PositionBottom;
         vpos = PositionTop;
     else if (va == BOTTOM)
         vpos = PositionBottom;
-    else if (va == LENGTH)
-        vpos = -style()->verticalAlignLength().calcValue(lineHeight(firstLine));
     else {
         bool checkParent = parent()->isInline() && !parent()->isInlineBlockOrInlineTable() && parent()->style()->verticalAlign() != TOP && parent()->style()->verticalAlign() != BOTTOM;
         vpos = checkParent ? parent()->verticalPositionHint(firstLine) : 0;
     else {
         bool checkParent = parent()->isInline() && !parent()->isInlineBlockOrInlineTable() && parent()->style()->verticalAlign() != TOP && parent()->style()->verticalAlign() != BOTTOM;
         vpos = checkParent ? parent()->verticalPositionHint(firstLine) : 0;
@@ -2713,6 +2711,8 @@ short RenderObject::getVerticalPosition(bool firstLine) const
                 vpos -= style(firstLine)->font().descent();
         } else if (va == BASELINE_MIDDLE)
             vpos += -lineHeight(firstLine) / 2 + baselinePosition(firstLine);
                 vpos -= style(firstLine)->font().descent();
         } else if (va == BASELINE_MIDDLE)
             vpos += -lineHeight(firstLine) / 2 + baselinePosition(firstLine);
+        else if (va == LENGTH)
+            vpos -= style()->verticalAlignLength().calcValue(lineHeight(firstLine));
     }
 
     return vpos;
     }
 
     return vpos;