Bug 112410 - A placeholder renderer should not be taken to imply the existence of a text renderer in single line text controls
Summary: A placeholder renderer should not be taken to imply the existence of a text r...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dominic Cooney
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-14 23:30 PDT by Dominic Cooney
Modified: 2013-03-18 01:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.82 KB, patch)
2013-03-14 23:43 PDT, Dominic Cooney
no flags Details | Formatted Diff | Diff
Patch for CQ (6.31 KB, patch)
2013-03-17 23:52 PDT, Dominic Cooney
no flags Details | Formatted Diff | Diff
Patch for CQ (with "Reviewed by" this time) (6.31 KB, patch)
2013-03-18 00:21 PDT, Dominic Cooney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Cooney 2013-03-14 23:30:25 PDT
There are a couple of places in the rendering of text inputs with placeholders that assume that if the placeholder is rendered, a renderer for the text must exist too. However this is not the case if ::-webkit-textfield-decoration-controller is set it to display: none; (or possibly other unusual values like display: table-cell;) which hides the text renderer's container.

This can be reproduced by adding a placeholder="x" attribute to the input element in the fast/forms/search/search-hide-decoration-container-crash.html layout test.

I think at least HTMLTextFormControlElement::fixPlaceholderRenderer and RenderTextControlSingleLine::layout need to be fixed.
Comment 1 Dominic Cooney 2013-03-14 23:43:27 PDT
Created attachment 193242 [details]
Patch
Comment 2 Dominic Cooney 2013-03-14 23:45:21 PDT
Comment on attachment 193242 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=193242&action=review

> Source/WebCore/html/HTMLTextFormControlElement.cpp:176
>          return;

I wonder if it would be possible to do this renderer swizzle using another layer of Shadow DOM instead of these renderer-level hacks. Shadow DOM could certainly swap the order of a couple of renderers.
Comment 3 Tony Chang 2013-03-15 10:09:57 PDT
Comment on attachment 193242 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=193242&action=review

> LayoutTests/fast/forms/search/search-hide-decoration-container-crash.html:11
> -<input type="search">
> +<input type="search" placeholder="x">

Rather than replacing the old test, can we add a second <input> with placeholder?
Comment 4 Dominic Cooney 2013-03-17 23:52:40 PDT
Created attachment 193493 [details]
Patch for CQ
Comment 5 Dominic Cooney 2013-03-17 23:53:19 PDT
Comment on attachment 193493 [details]
Patch for CQ

Patch updates test based on reviewer's suggestion.
Comment 6 WebKit Review Bot 2013-03-17 23:56:09 PDT
Comment on attachment 193493 [details]
Patch for CQ

Rejecting attachment 193493 [details] from commit-queue.

Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=webkit-commit-queue.appspot.com', '--bot-id=gce-cq-03', 'validate-changelog', '--non-interactive', 193493, '--port=chromium-xvfb']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue

/mnt/git/webkit-commit-queue/LayoutTests/ChangeLog neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).

Full output: http://webkit-commit-queue.appspot.com/results/17114921
Comment 7 Dominic Cooney 2013-03-18 00:21:50 PDT
Created attachment 193496 [details]
Patch for CQ (with "Reviewed by" this time)
Comment 8 WebKit Review Bot 2013-03-18 01:04:18 PDT
Comment on attachment 193496 [details]
Patch for CQ (with "Reviewed by" this time)

Clearing flags on attachment: 193496

Committed r146038: <http://trac.webkit.org/changeset/146038>
Comment 9 WebKit Review Bot 2013-03-18 01:04:23 PDT
All reviewed patches have been landed.  Closing bug.