Bug 113845

Summary: Input value/placeholder is not redrawn when the input height grows
Product: WebKit Reporter: Kent Tamura <tkent>
Component: FormsAssignee: Kent Tamura <tkent>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, eric, esprehn+autocc, jchaffraix, mifenton, ojan.autocc, ojan, tony, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 117747    
Attachments:
Description Flags
Patch
none
Patch 2 none

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.