Bug 12104 - Native Slider: When the thumb's height is specified as a percentage, it is not centered properly
Summary: Native Slider: When the thumb's height is specified as a percentage, it is no...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-03 11:08 PST by mitz
Modified: 2009-05-08 13:37 PDT (History)
2 users (show)

See Also:


Attachments
Testcase (241 bytes, text/html)
2009-05-08 13:37 PDT, Simon Fraser (smfr)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2007-01-03 11:08:37 PST
When the slider thumb's height (width if the slider is vertical) is specified as a percentage, it is not centered properly. For centering purposes, the percent value is treated as a pixel value. For example, this puts the green "thumb" way too high:

<style>
	input { -webkit-appearance: none; background: silver; height: 20px; width: 200px; }
	input::-webkit-slider-thumb { -webkit-appearance: none; background: green; width: 10px; height: 50%; }
</style>
<input type="range">

Treating percentages as pixels is going to turn into an assertion failure once bug 5164 is fixed!
Comment 1 Darin Adler 2009-03-25 07:35:29 PDT
This check-in http://trac.webkit.org/changeset/41972 fixes this bug. But we should probably turn the test case attached here into a regression test and land it before closing this bug.
Comment 2 Darin Adler 2009-03-29 08:17:55 PDT
http://trac.webkit.org/changeset/42080
Comment 3 Simon Fraser (smfr) 2009-05-08 13:37:02 PDT
Created attachment 30139 [details]
Testcase