Padding in popup menu gets lost with styled <select> in Windows.
Fixes <rdar://7285538>, and <http://webkit.org/b/33235>.
Reviewed by Adele Peterson.
[Win] Support padding-right on selects when webkit-appearance is off. Added a test
case for narrow selects with -webkit-appearance: none, and padding left and right to
show that both types of padding are honored.
* manual-tests/select-webkit-appearance-off-narrow-select.html: Added.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::calculatePositionAndSize): Use clientPaddingRight instead of a hardcoded constant.
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::clientPaddingRight): If webkit-appearance is off, use padding-right instead of
the hardcoded constant.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@52958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/manual-tests/select-webkit-appearance-off-narrow-select.html b/WebCore/manual-tests/select-webkit-appearance-off-narrow-select.html
new file mode 100644
index 0000000..34e4681
--- /dev/null
+++ b/WebCore/manual-tests/select-webkit-appearance-off-narrow-select.html
@@ -0,0 +1,49 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Padding on select with webkit-appearance: off</title>
+ <style type="text/css">
+ #webkit-appearance-none {
+ -webkit-appearance: none;
+ border: 1px solid black;
+ width: 15px;
+ padding-left: 5px;
+ padding-right: 5px;
+ }
+
+ #narrow-with-border {
+ border: 1px solid black;
+ width: 40px;
+ }
+ </style>
+</head>
+
+<body>
+ <p>This is a manual test for <a href="https://bugs.webkit.org/show_bug.cgi?id=33235">Padding in popup
+ menu gets lost with styled select in Windows</a></p>
+ <p>To open the selects, click inside the select boxes below.</p>
+
+ <p>The options in this selects should have padding on both the left and the right, the edges of
+ the text should not be pressed against the edges of the opened select.</p>
+ <select id="webkit-appearance-none">
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <hr />
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ </select>
+
+ <p>The options in this select should not have too much padding on the right</p>
+ <select id="narrow-with-border">
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ <hr />
+ <option href="#">Do Action ABCDEFG</option>
+ <option href="#">Do Action ABCDEFG</option>
+ </select>
+</body>
+</html>