Bug 236108
| Summary: | line-height: 1px on <input type=search> is not reflected in getComputedStyle() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pieters (:zcorpan) <zcorpan> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bfulgham, cdumez, karlcow, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=203751 | ||
Simon Pieters (:zcorpan)
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Simon Pieters (:zcorpan)
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
<rdar://problem/88513265>