LayoutTests:
authoradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2007 23:48:58 +0000 (23:48 +0000)
committeradele <adele@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jan 2007 23:48:58 +0000 (23:48 +0000)
        Reviewed by Hyatt.

        Test for <rdar://problem/4760280> REGRESSION: Bottom portion of text hangs off edge of SELECT element at http://macreviewzone.com/index.php

        * fast/forms/control-restrict-line-height-expected.checksum: Added.
        * fast/forms/control-restrict-line-height-expected.png: Added.
        * fast/forms/control-restrict-line-height-expected.txt: Added.
        * fast/forms/control-restrict-line-height.html: Added.

WebCore:

        Reviewed by Hyatt.

        Fix for <rdar://problem/4760280> REGRESSION: Bottom portion of text hangs off edge of SELECT element at http://macreviewzone.com/index.php

        Test: fast/forms/control-restrict-line-height.html

        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize): Don't honor line-height for controls that
          have restricted font size.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/control-restrict-line-height-expected.checksum [new file with mode: 0644]
LayoutTests/fast/forms/control-restrict-line-height-expected.png [new file with mode: 0644]
LayoutTests/fast/forms/control-restrict-line-height-expected.txt [new file with mode: 0644]
LayoutTests/fast/forms/control-restrict-line-height.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderThemeMac.mm

index 2780f6f..8044b2d 100644 (file)
@@ -1,3 +1,14 @@
+2007-01-19  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Hyatt.
+
+        Test for <rdar://problem/4760280> REGRESSION: Bottom portion of text hangs off edge of SELECT element at http://macreviewzone.com/index.php
+
+        * fast/forms/control-restrict-line-height-expected.checksum: Added.
+        * fast/forms/control-restrict-line-height-expected.png: Added.
+        * fast/forms/control-restrict-line-height-expected.txt: Added.
+        * fast/forms/control-restrict-line-height.html: Added.
+
 2007-01-19  Darin Adler  <darin@apple.com>
 
         Reviewed by Adele.
diff --git a/LayoutTests/fast/forms/control-restrict-line-height-expected.checksum b/LayoutTests/fast/forms/control-restrict-line-height-expected.checksum
new file mode 100644 (file)
index 0000000..aae2de7
--- /dev/null
@@ -0,0 +1 @@
+ee2bc86eb2f43790d4c2d8b8c714e02d
\ No newline at end of file
diff --git a/LayoutTests/fast/forms/control-restrict-line-height-expected.png b/LayoutTests/fast/forms/control-restrict-line-height-expected.png
new file mode 100644 (file)
index 0000000..a35657c
Binary files /dev/null and b/LayoutTests/fast/forms/control-restrict-line-height-expected.png differ
diff --git a/LayoutTests/fast/forms/control-restrict-line-height-expected.txt b/LayoutTests/fast/forms/control-restrict-line-height-expected.txt
new file mode 100644 (file)
index 0000000..8a9fdcc
--- /dev/null
@@ -0,0 +1,32 @@
+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
+      RenderText {#text} at (0,0) size 519x18
+        text run at (0,0) width 519: "This tests that we don't honor line-height for controls that have restricted font size. "
+      RenderBR {BR} at (0,0) size 0x0
+      RenderMenuList {SELECT} at (2,20) size 309x18 [bgcolor=#FFFFFF]
+        RenderBlock (anonymous) at (8,2) size 278x13
+          RenderText at (0,0) size 280x13
+            text run at (0,0) width 280: "This text should be centered vertically in the button"
+      RenderText {#text} at (313,19) size 4x18
+        text run at (313,19) width 4: " "
+      RenderBR {BR} at (0,0) size 0x0
+      RenderButton {INPUT} at (2,42) size 296x18 [bgcolor=#C0C0C0]
+        RenderBlock (anonymous) at (8,2) size 280x13
+          RenderText at (0,0) size 280x13
+            text run at (0,0) width 280: "This text should be centered vertically in the button"
+      RenderText {#text} at (300,41) size 4x18
+        text run at (300,41) width 4: " "
+      RenderBR {BR} at (0,0) size 0x0
+      RenderTextControl {INPUT} at (2,64) size 148x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+        RenderBlock {DIV} at (3,3) size 142x13
+          RenderBlock {DIV} at (0,0) size 8x11
+          RenderBlock {DIV} at (129,0) size 13x11
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+layer at (21,75) size 121x13 scrollWidth 282
+  RenderBlock {DIV} at (8,0) size 121x13
+    RenderText {#text} at (1,0) size 280x13
+      text run at (1,0) width 280: "This text should be centered vertically in the button"
diff --git a/LayoutTests/fast/forms/control-restrict-line-height.html b/LayoutTests/fast/forms/control-restrict-line-height.html
new file mode 100644 (file)
index 0000000..5d4d23f
--- /dev/null
@@ -0,0 +1,21 @@
+<html>
+<head>
+<style>
+.tall {
+    line-height: 20pt;
+}
+</style>
+</head>
+<body>
+    This tests that we don't honor line-height for controls that have restricted font size.
+    <br>
+    <select class="tall">
+    <option selected="selected">This text should be centered vertically in the button</option>
+    </select>
+    <br>
+    <input type="button" class="tall" value="This text should be centered vertically in the button"></input>
+    <br>
+    <input type="search" class="tall" value="This text should be centered vertically in the button"></input>
+        
+</body>
+</html>
index 9ec1a27..52663c3 100644 (file)
@@ -1,3 +1,14 @@
+2007-01-19  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Hyatt.
+
+        Fix for <rdar://problem/4760280> REGRESSION: Bottom portion of text hangs off edge of SELECT element at http://macreviewzone.com/index.php
+        
+        Test: fast/forms/control-restrict-line-height.html
+
+        * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize): Don't honor line-height for controls that
+          have restricted font size.
+
 2007-01-19  Darin Adler  <darin@apple.com>
 
         Reviewed by Adele.
index cb39015..d0a2935 100644 (file)
@@ -352,6 +352,9 @@ void RenderThemeMac::setFontFromControlSize(CSSStyleSelector* selector, RenderSt
     fontDescription.setComputedSize([font pointSize]);
     fontDescription.setSpecifiedSize([font pointSize]);
 
+    // Reset line height
+    style->setLineHeight(RenderStyle::initialLineHeight());
+
     if (style->setFontDescription(fontDescription))
         style->font().update();
 }