Summary: | input element with placeholder text and width set to 100% on focus causes overflow even after losing focus | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Masataka Yakura <myakura.web> | ||||||||||
Component: | Layout and Rendering | Assignee: | Robert Hogan <robert> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | eric, esprehn+autocc, forms-bugs, mifenton, ojan.autocc, robert, syoichi, tkent, webkit.review.bot | ||||||||||
Priority: | P2 | ||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | PC | ||||||||||||
OS: | Windows 7 | ||||||||||||
Attachments: |
|
Created attachment 188703 [details]
Patch
Comment on attachment 188703 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=188703&action=review > Source/WebCore/rendering/RenderBlock.cpp:1698 > + if (block->node() && block->node()->toInputElement() && block->node()->toInputElement()->placeholderElement() && block->node()->toInputElement()->placeholderElement()->renderer() == child) > + return false; There has to be some better way of doing this than hard-coding the placeholder. Is a placeholder element really the only place in all of WebKit that we have block child that does not affect layout or size of the parent? Is there a better way to set up the render tree so we don’t need this very-specific hack? Created attachment 188928 [details]
Patch
Comment on attachment 188928 [details]
Patch
This seems ok. Other approaches you could take would be to simply recompute overflow if the placeholder box does a relayout. This would be better if the placeholder needs to contribute to overflow and doing this causes it to be wrong. It seems like a bug that the placeholder is getting resized but nobody recomputes overflow?
Created attachment 188931 [details]
Patch
Comment on attachment 188931 [details]
Patch
r=me
Comment on attachment 188931 [details] Patch Rejecting attachment 188931 [details] from commit-queue. New failing tests: platform/chromium/fast/forms/calendar-picker/calendar-picker-appearance-required.html Full output: http://queues.webkit.org/results/16621955 Comment on attachment 188931 [details] Patch Clearing flags on attachment: 188931 Committed r143475: <http://trac.webkit.org/changeset/143475> All reviewed patches have been landed. Closing bug. |
Created attachment 186775 [details] test case Steps to reproduce: 1. open the attachment 2. hit Tab key to focus the input element 3. hit Tab again to move focus out from the input element Expected results: there is no horizontal scrollbar. What happened instead: there is a horizontal scrollbar. This neither happens on input elements with no placeholder text (or blank placeholder text) nor textarea elements with or without placeholder text.