Title: [155324] trunk
Revision
155324
Author
[email protected]
Date
2013-09-08 23:55:18 -0700 (Sun, 08 Sep 2013)

Log Message

defining line height affects height of text box
https://bugs.webkit.org/show_bug.cgi?id=17619

Patch by Gurpreet Kaur <[email protected]> on 2013-09-08
Reviewed by Darin Adler.

Source/WebCore:

Giving line height to input elements increase the height
of the element. To make it work similiar as Mozilla and IE
line-height :normal should be applied for input elements.

Test: fast/dom/HTMLInputElement/input-line-height.html

* css/html.css:
(input):
Made the line-height: normal as !important so that it does not
consider any other line-height specified through internal or
external styles.

LayoutTests:

* fast/dom/HTMLInputElement/input-line-height-expected.txt: Added.
* fast/dom/HTMLInputElement/input-line-height.html: Added.

Added new test for verifying that giving line-height to input element
has no affect on its height.

* fast/forms/placeholder-position-expected.txt:
* platform/mac/fast/forms/placeholder-position-expected.png:

Rebaselining existing tests as per the new behavior. The position
of input elements have been modified since line-height is not being
considered.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (155323 => 155324)


--- trunk/LayoutTests/ChangeLog	2013-09-09 06:54:02 UTC (rev 155323)
+++ trunk/LayoutTests/ChangeLog	2013-09-09 06:55:18 UTC (rev 155324)
@@ -1,5 +1,25 @@
 2013-09-08  Gurpreet Kaur  <[email protected]>
 
+        defining line height affects height of text box
+        https://bugs.webkit.org/show_bug.cgi?id=17619
+
+        Reviewed by Darin Adler.
+
+        * fast/dom/HTMLInputElement/input-line-height-expected.txt: Added.
+        * fast/dom/HTMLInputElement/input-line-height.html: Added.
+
+        Added new test for verifying that giving line-height to input element
+        has no affect on its height.
+
+        * fast/forms/placeholder-position-expected.txt:
+        * platform/mac/fast/forms/placeholder-position-expected.png:
+
+        Rebaselining existing tests as per the new behavior. The position
+        of input elements have been modified since line-height is not being 
+        considered.
+
+2013-09-08  Gurpreet Kaur  <[email protected]>
+
         Scrollbar width is not applied when element hidden
         https://bugs.webkit.org/show_bug.cgi?id=90546
 

Added: trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height-expected.txt (0 => 155324)


--- trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height-expected.txt	2013-09-09 06:55:18 UTC (rev 155324)
@@ -0,0 +1,61 @@
+Tests that line-height is not applied for input element
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS window.getComputedStyle(document.getElementById('tagButton'),null).getPropertyValue('line-height') is document.getElementById('tagButton').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputButton'),null).getPropertyValue('line-height') is not document.getElementById('inputButton').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputText'),null).getPropertyValue('line-height') is not document.getElementById('inputText').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputSubmit'),null).getPropertyValue('line-height') is not document.getElementById('inputSubmit').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputReset'),null).getPropertyValue('line-height') is not document.getElementById('inputReset').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputPassword'),null).getPropertyValue('line-height') is not document.getElementById('inputPassword').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputSearch'),null).getPropertyValue('line-height') is not document.getElementById('inputSearch').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputHidden'),null).getPropertyValue('line-height') is not document.getElementById('inputHidden').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputDate'),null).getPropertyValue('line-height') is not document.getElementById('inputDate').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputDateTime'),null).getPropertyValue('line-height') is not document.getElementById('inputDateTime').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputDateTimeLocal'),null).getPropertyValue('line-height') is not document.getElementById('inputDateTimeLocal').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputMonth'),null).getPropertyValue('line-height') is not document.getElementById('inputMonth').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputTime'),null).getPropertyValue('line-height') is not document.getElementById('inputTime').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputWeek'),null).getPropertyValue('line-height') is not document.getElementById('inputWeek').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputImage'),null).getPropertyValue('line-height') is not document.getElementById('inputImage').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputFile'),null).getPropertyValue('line-height') is not document.getElementById('inputFile').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputRadio'),null).getPropertyValue('line-height') is not document.getElementById('inputRadio').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputCheckbox'),null).getPropertyValue('line-height') is not document.getElementById('inputCheckbox').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputRange'),null).getPropertyValue('line-height') is not document.getElementById('inputRange').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputColor'),null).getPropertyValue('line-height') is not document.getElementById('inputColor').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputEmail'),null).getPropertyValue('line-height') is not document.getElementById('inputEmail').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputUrl'),null).getPropertyValue('line-height') is not document.getElementById('inputUrl').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputTel'),null).getPropertyValue('line-height') is not document.getElementById('inputTel').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('inputNumber'),null).getPropertyValue('line-height') is not document.getElementById('inputNumber').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('tagSelect'),null).getPropertyValue('line-height') is not document.getElementById('tagSelect').style.lineHeight
+PASS window.getComputedStyle(document.getElementById('tagTextarea'),null).getPropertyValue('line-height') is document.getElementById('tagTextarea').style.lineHeight
+PASS successfullyParsed is true
+
+TEST COMPLETE
+Button
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Property changes on: trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height-expected.txt
___________________________________________________________________

Added: svn:executable

Added: trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height.html (0 => 155324)


--- trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height.html	2013-09-09 06:55:18 UTC (rev 155324)
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script>
+		    function runTest() {
+                description('Tests that line-height is not applied for input element');
+                                
+                shouldBe("window.getComputedStyle(document.getElementById('tagButton'),null).getPropertyValue('line-height')","document.getElementById('tagButton').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputButton'),null).getPropertyValue('line-height')","document.getElementById('inputButton').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputText'),null).getPropertyValue('line-height')","document.getElementById('inputText').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputSubmit'),null).getPropertyValue('line-height')","document.getElementById('inputSubmit').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputReset'),null).getPropertyValue('line-height')","document.getElementById('inputReset').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputPassword'),null).getPropertyValue('line-height')","document.getElementById('inputPassword').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputSearch'),null).getPropertyValue('line-height')","document.getElementById('inputSearch').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputHidden'),null).getPropertyValue('line-height')","document.getElementById('inputHidden').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputDate'),null).getPropertyValue('line-height')","document.getElementById('inputDate').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputDateTime'),null).getPropertyValue('line-height')","document.getElementById('inputDateTime').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputDateTimeLocal'),null).getPropertyValue('line-height')","document.getElementById('inputDateTimeLocal').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputMonth'),null).getPropertyValue('line-height')","document.getElementById('inputMonth').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputTime'),null).getPropertyValue('line-height')","document.getElementById('inputTime').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputWeek'),null).getPropertyValue('line-height')","document.getElementById('inputWeek').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputImage'),null).getPropertyValue('line-height')","document.getElementById('inputImage').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputFile'),null).getPropertyValue('line-height')","document.getElementById('inputFile').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputRadio'),null).getPropertyValue('line-height')","document.getElementById('inputRadio').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputCheckbox'),null).getPropertyValue('line-height')","document.getElementById('inputCheckbox').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputRange'),null).getPropertyValue('line-height')","document.getElementById('inputRange').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputColor'),null).getPropertyValue('line-height')","document.getElementById('inputColor').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputEmail'),null).getPropertyValue('line-height')","document.getElementById('inputEmail').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputUrl'),null).getPropertyValue('line-height')","document.getElementById('inputUrl').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputTel'),null).getPropertyValue('line-height')","document.getElementById('inputTel').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('inputNumber'),null).getPropertyValue('line-height')","document.getElementById('inputNumber').style.lineHeight");
+                shouldNotBe("window.getComputedStyle(document.getElementById('tagSelect'),null).getPropertyValue('line-height')","document.getElementById('tagSelect').style.lineHeight");
+                shouldBe("window.getComputedStyle(document.getElementById('tagTextarea'),null).getPropertyValue('line-height')","document.getElementById('tagTextarea').style.lineHeight");
+				isSuccessfullyParsed();
+            }
+        </script>
+    </head>
+    <body _onload_="runTest()">
+        <form>
+            <button id="tagButton" style="line-height: 50px">Button</button><br>
+            <input id="inputButton" style="line-height: 50px" type="button" value="Button"/><br>
+            <input id="inputText" style="line-height: 50px" type="text"/><br>
+            <input id="inputSubmit" style="line-height: 50px" type="submit" value="Submit"/><br>
+            <input id="inputReset" style="line-height: 50px" type="reset" value="Reset"/><br>
+            <input id="inputPassword" style="line-height: 50px" type="password"/><br>
+            <input id="inputSearch" style="line-height: 50px" type="search"/><br>
+            <input id="inputHidden" style="line-height: 50px" type="hidden"/><br>
+            <input id="inputDate" style="line-height: 50px" type="date"/><br>
+            <input id="inputDateTime" style="line-height: 50px" type="datetime"/><br>
+            <input id="inputDateTimeLocal" style="line-height: 50px" type="datetime-local"/><br>
+            <input id="inputMonth" style="line-height: 50px" type="month"/><br>
+            <input id="inputTime" style="line-height: 50px" type="time"/><br>
+            <input id="inputWeek" style="line-height: 50px" type="week"/><br>
+            <input id="inputImage" style="line-height: 50px" type="image"/><br>
+            <input id="inputFile" style="line-height: 50px" type="file"/><br>
+            <input id="inputRadio" style="line-height: 50px" type="radio"/><br>
+            <input id="inputCheckbox" style="line-height: 50px" type="checkbox"/><br>
+            <input id="inputRange" style="line-height: 50px" type="range"/><br>
+            <input id="inputColor" style="line-height: 50px" type="color"/><br>
+            <input id="inputEmail" style="line-height: 50px" type="email"/><br>
+            <input id="inputUrl" style="line-height: 50px" type="url"/><br>
+            <input id="inputTel" style="line-height: 50px" type="tel"/><br>
+            <input id="inputNumber" style="line-height: 50px" type="number"/><br>
+            <select id="tagSelect" style="line-height: 50px">
+                <option>A select</option>
+                <option>An option</option>
+            </select><br>
+            <textarea id="tagTextarea" style="line-height: 50px"></textarea><br>
+        </form>       
+    </body>
+</html>
\ No newline at end of file
Property changes on: trunk/LayoutTests/fast/dom/HTMLInputElement/input-line-height.html
___________________________________________________________________

Added: svn:executable

Modified: trunk/LayoutTests/fast/forms/placeholder-position-expected.txt (155323 => 155324)


--- trunk/LayoutTests/fast/forms/placeholder-position-expected.txt	2013-09-09 06:54:02 UTC (rev 155323)
+++ trunk/LayoutTests/fast/forms/placeholder-position-expected.txt	2013-09-09 06:55:18 UTC (rev 155324)
@@ -29,24 +29,24 @@
       RenderBR {BR} at (165,214) size 0x0
       RenderTextControl {INPUT} at (5,219) size 174x30 [bgcolor=#FFFFFF] [border: (5px solid #000000)]
       RenderBR {BR} at (184,240) size 0x0
-      RenderTextControl {INPUT} at (2,256) size 123x31 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-      RenderText {#text} at (127,262) size 4x18
-        text run at (127,262) width 4: " "
-      RenderTextControl {INPUT} at (133,256) size 123x31 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-      RenderText {#text} at (258,262) size 4x18
-        text run at (258,262) width 4: " "
-      RenderBR {BR} at (262,276) size 0x0
-      RenderTextControl {INPUT} at (2,291) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-      RenderText {#text} at (127,291) size 4x18
-        text run at (127,291) width 4: " "
-      RenderTextControl {INPUT} at (133,291) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-      RenderText {#text} at (258,291) size 4x18
-        text run at (258,291) width 4: " "
-      RenderTextControl {INPUT} at (264,291) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-      RenderText {#text} at (389,291) size 4x18
-        text run at (389,291) width 4: " "
-      RenderBR {BR} at (393,305) size 0x0
-      RenderBR {BR} at (127,342) size 0x0
+      RenderTextControl {INPUT} at (2,256) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (127,256) size 4x18
+        text run at (127,256) width 4: " "
+      RenderTextControl {INPUT} at (133,256) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (258,256) size 4x18
+        text run at (258,256) width 4: " "
+      RenderBR {BR} at (262,270) size 0x0
+      RenderTextControl {INPUT} at (2,279) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (127,279) size 4x18
+        text run at (127,279) width 4: " "
+      RenderTextControl {INPUT} at (133,279) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (258,279) size 4x18
+        text run at (258,279) width 4: " "
+      RenderTextControl {INPUT} at (264,279) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+      RenderText {#text} at (389,279) size 4x18
+        text run at (389,279) width 4: " "
+      RenderBR {BR} at (393,293) size 0x0
+      RenderBR {BR} at (127,330) size 0x0
 layer at (21,13) size 117x13
   RenderBlock {DIV} at (11,3) size 117x13 [color=#A9A9A9]
     RenderText {#text} at (0,0) size 63x13
@@ -95,37 +95,37 @@
       text run at (0,0) width 85: "placeholder"
 layer at (19,233) size 162x18
   RenderBlock {DIV} at (6,6) size 162x18
-layer at (13,267) size 117x25
-  RenderBlock {DIV} at (3,3) size 117x25
-    RenderText {#text} at (0,6) size 30x13
-      text run at (0,6) width 30: "Value"
-layer at (144,267) size 117x25
-  RenderBlock {DIV} at (3,3) size 117x25 [color=#A9A9A9]
-    RenderText {#text} at (0,6) size 63x13
-      text run at (0,6) width 63: "placeholder"
-layer at (144,267) size 117x25
-  RenderBlock {DIV} at (3,3) size 117x25
-layer at (13,302) size 117x13
+layer at (13,267) size 117x13
   RenderBlock {DIV} at (3,3) size 117x13
+    RenderText {#text} at (0,0) size 30x13
+      text run at (0,0) width 30: "Value"
+layer at (144,267) size 117x13
+  RenderBlock {DIV} at (3,3) size 117x13 [color=#A9A9A9]
+    RenderText {#text} at (0,0) size 63x13
+      text run at (0,0) width 63: "placeholder"
+layer at (144,267) size 117x13
+  RenderBlock {DIV} at (3,3) size 117x13
+layer at (13,290) size 117x13
+  RenderBlock {DIV} at (3,3) size 117x13
     RenderText {#text} at (43,0) size 31x13
       text run at (43,0) width 31: "Value"
-layer at (144,302) size 117x13
+layer at (144,290) size 117x13
   RenderBlock {DIV} at (3,3) size 117x13 [color=#A9A9A9]
     RenderText {#text} at (27,0) size 63x13
       text run at (27,0) width 63: "placeholder"
-layer at (144,302) size 117x13
+layer at (144,290) size 117x13
   RenderBlock {DIV} at (3,3) size 117x13
-layer at (275,302) size 117x13
+layer at (275,290) size 117x13
   RenderBlock {DIV} at (3,3) size 117x13 [color=#A9A9A9]
     RenderText {#text} at (27,0) size 63x13
       text run at (27,0) width 63: "placeholder"
-layer at (275,302) size 117x13
+layer at (275,290) size 117x13
   RenderBlock {DIV} at (3,3) size 117x13
-layer at (10,322) size 123x33
-  RenderTextControl {INPUT} at (2,314) size 123x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
-layer at (13,339) size 117x13
+layer at (10,310) size 123x33
+  RenderTextControl {INPUT} at (2,302) size 123x33 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+layer at (13,327) size 117x13
   RenderBlock {DIV} at (3,17) size 117x13 [color=#A9A9A9]
     RenderText {#text} at (0,0) size 63x13
       text run at (0,0) width 63: "placeholder"
-layer at (13,339) size 117x13
+layer at (13,327) size 117x13
   RenderBlock {DIV} at (3,17) size 117x13

Modified: trunk/LayoutTests/platform/mac/fast/forms/placeholder-position-expected.png


(Binary files differ)

Modified: trunk/Source/WebCore/ChangeLog (155323 => 155324)


--- trunk/Source/WebCore/ChangeLog	2013-09-09 06:54:02 UTC (rev 155323)
+++ trunk/Source/WebCore/ChangeLog	2013-09-09 06:55:18 UTC (rev 155324)
@@ -1,5 +1,24 @@
 2013-09-08  Gurpreet Kaur  <[email protected]>
 
+        defining line height affects height of text box
+        https://bugs.webkit.org/show_bug.cgi?id=17619
+
+        Reviewed by Darin Adler.
+
+        Giving line height to input elements increase the height
+        of the element. To make it work similiar as Mozilla and IE
+        line-height :normal should be applied for input elements.
+
+        Test: fast/dom/HTMLInputElement/input-line-height.html
+
+        * css/html.css:
+        (input):
+        Made the line-height: normal as !important so that it does not
+        consider any other line-height specified through internal or 
+        external styles.
+
+2013-09-08  Gurpreet Kaur  <[email protected]>
+
         Scrollbar width is not applied when element hidden
         https://bugs.webkit.org/show_bug.cgi?id=90546
 

Modified: trunk/Source/WebCore/css/html.css (155323 => 155324)


--- trunk/Source/WebCore/css/html.css	2013-09-09 06:54:02 UTC (rev 155323)
+++ trunk/Source/WebCore/css/html.css	2013-09-09 06:55:18 UTC (rev 155324)
@@ -411,6 +411,10 @@
     text-align: start;
 }
 
+input {
+    line-height: normal !important;
+}
+
 input[type="hidden"] {
     display: none
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to