NEW 236108
line-height: 1px on <input type=search> is not reflected in getComputedStyle()
https://bugs.webkit.org/show_bug.cgi?id=236108
Summary line-height: 1px on <input type=search> is not reflected in getComputedStyle()
Simon Pieters (:zcorpan)
Reported 2022-02-03 15:40:45 PST
What steps will reproduce the problem? (1) Apply a 'line-height' that is smaller than 'normal' on <input type=search> (2) Call getComputedStyle(input).lineHeight (3) What is the expected result? 1px What happens instead? assert_equals: expected "1px" but got "normal" There's some magic for text entry widgets to change the used value of 'line-height' to 'normal' if it was smaller than 'normal', but the computed value should not be affected by this. Only used value. This doesn't happen with the type=text, type=url, type=email, type=password. Spec change: https://github.com/whatwg/html/pull/5462 Test: https://github.com/web-platform-tests/wpt/pull/32684 (Maybe related: https://bugs.webkit.org/show_bug.cgi?id=203751 )
Attachments
Simon Pieters (:zcorpan)
Comment 1 2022-02-04 00:47:25 PST
dholbert pointed out that the test was incorrect, since getComputedStyle returns the resolved value, which for line-height will be the used value. So the used value should be something like 16px (depending on font metrics). I've now fixed the test. I also tested computedStyleMap() although it seems it is not yet supported in WebKit. (https://bugs.webkit.org/show_bug.cgi?id=175733) This bug thus applies to all text entry widgets, although <input type=search> is different from the others and returns 'normal'.
Radar WebKit Bug Importer
Comment 2 2022-02-04 16:15:31 PST
Note You need to log in before you can comment on or make changes to this bug.