Bug 113845 - Input value/placeholder is not redrawn when the input height grows
Summary: Input value/placeholder is not redrawn when the input height grows
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kent Tamura
URL:
Keywords:
Depends on:
Blocks: 117747
  Show dependency treegraph
 
Reported: 2013-04-02 22:09 PDT by Kent Tamura
Modified: 2013-06-18 12:08 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.46 KB, patch)
2013-04-02 22:10 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff
Patch 2 (3.51 KB, patch)
2013-04-02 22:48 PDT, Kent Tamura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Tamura 2013-04-02 22:09:03 PDT
https://code.google.com/p/chromium/issues/detail?id=126395

<input value=foo style="height:0.5em;">
<input placeholder=foo style="height:0.5em;">
<script>
document.getElementsByTagName('input')[0].style.height = 'initial';
document.getElementsByTagName('input')[1].style.height = 'initial';
</script>

The value/placeholder keeps the initial height after setting input height.
Comment 1 Kent Tamura 2013-04-02 22:10:52 PDT
Created attachment 196278 [details]
Patch
Comment 2 Ojan Vafai 2013-04-02 22:39:12 PDT
Comment on attachment 196278 [details]
Patch

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

> Source/WebCore/rendering/RenderTextControlSingleLine.cpp:256
> +    if (RenderObject* innerTextRenderer = innerTextElement()->renderer())
> +        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);

I think we only need this if stye StyleDifference is a Layout difference.
Comment 3 Kent Tamura 2013-04-02 22:48:03 PDT
Created attachment 196282 [details]
Patch 2

StyleDifferenceLayout
Comment 4 Kent Tamura 2013-04-02 22:48:43 PDT
Comment on attachment 196278 [details]
Patch

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

>> Source/WebCore/rendering/RenderTextControlSingleLine.cpp:256
>> +        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);
> 
> I think we only need this if stye StyleDifference is a Layout difference.

That's right!
Comment 5 Ojan Vafai 2013-04-03 10:23:03 PDT
Comment on attachment 196282 [details]
Patch 2

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

> Source/WebCore/rendering/RenderTextControlSingleLine.cpp:257
> +        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);

You shouldn't MarkOnlyThis. I'm trying to get rid of all of our uses of MarkOnlyThis. There are a couple cases where we need it right now to avoid hitting asserts, but setNeedsLayout in styleDidChange/styleWillChange it should be safe to leave out the MarkOnlyThis.
Comment 6 Kent Tamura 2013-04-03 18:04:51 PDT
Comment on attachment 196282 [details]
Patch 2

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

>> Source/WebCore/rendering/RenderTextControlSingleLine.cpp:257
>> +        innerTextRenderer->setNeedsLayout(true, MarkOnlyThis);
> 
> You shouldn't MarkOnlyThis. I'm trying to get rid of all of our uses of MarkOnlyThis. There are a couple cases where we need it right now to avoid hitting asserts, but setNeedsLayout in styleDidChange/styleWillChange it should be safe to leave out the MarkOnlyThis.

Yeah, I agree it.  This is a hack.
I think we can remove many hacks in RenderTextControlSingleLine by using flexible box with align-items:center.
Comment 7 WebKit Review Bot 2013-04-03 18:15:22 PDT
Comment on attachment 196282 [details]
Patch 2

Clearing flags on attachment: 196282

Committed r147602: <http://trac.webkit.org/changeset/147602>
Comment 8 WebKit Review Bot 2013-04-03 18:15:26 PDT
All reviewed patches have been landed.  Closing bug.