Skip to content

Instantly share code, notes, and snippets.

@jjgod
Created December 4, 2014 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjgod/d05084dc487e59470d98 to your computer and use it in GitHub Desktop.
Save jjgod/d05084dc487e59470d98 to your computer and use it in GitHub Desktop.
From 0ae9d7914b44353fdc90c8dff0ef174e91d9f475 Mon Sep 17 00:00:00 2001
From: Jiang Jiang <jiangj@opera.com>
Date: Wed, 3 Dec 2014 16:43:47 +0100
Subject: [PATCH] DNA-30730: Backport WebKit patch to fix input button paddings
It's a backport of the following patch by zalan@apple.com:
Subpixel Layout: Align <input type="button", submit> etc (PushButtonPart) top and bottom paddings with <button>
https://bugs.webkit.org/show_bug.cgi?id=127640
Reviewed by Simon Fraser.
<button> sets padding-top: 2px and padding-bottom: 3px as default values (html.css),
while <input type="button" (submit, etc) has the hardcoded values of 0, 0 and we center the text using the available space.
This results in different baseline text position in normal cases. This adjustment puts the <input type='button'
rendering back to the pre-subpixel layout state.
---
third_party/WebKit/Source/platform/mac/ThemeMac.mm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/third_party/WebKit/Source/platform/mac/ThemeMac.mm b/third_party/WebKit/Source/platform/mac/ThemeMac.mm
index bf3d483..1a4c401 100644
--- a/third_party/WebKit/Source/platform/mac/ThemeMac.mm
+++ b/third_party/WebKit/Source/platform/mac/ThemeMac.mm
@@ -658,7 +658,7 @@ LengthBox ThemeMac::controlPadding(ControlPart part, const FontDescription& font
// This also guarantees the HTML <button> will match our rendering by default, since we're using a consistent
// padding.
const int padding = 8 * zoomFactor;
- return LengthBox(0, padding, 0, padding);
+ return LengthBox(2, padding, 3, padding);
}
default:
return Theme::controlPadding(part, fontDescription, zoomedBox, zoomFactor);
--
2.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment