| Summary: | Speed up HTMLInputElement::isEmptyValue() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||
| Component: | DOM | Assignee: | Chris Dumez <cdumez> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | kling, rniwa | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 138538 | ||||||
| Attachments: |
|
||||||
|
Description
Chris Dumez
2014-11-07 13:52:57 PST
Created attachment 241212 [details]
Patch
Comment on attachment 241212 [details]
Patch
r=me
Comment on attachment 241212 [details] Patch Clearing flags on attachment: 241212 Committed r175778: <http://trac.webkit.org/changeset/175778> All reviewed patches have been landed. Closing bug. Comment on attachment 241212 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241212&action=review > Source/WebCore/html/HTMLInputElement.cpp:1684 > + if (!isTextField()) > + return true; I suggest putting this code into a virtual InputType::isEmptyValue instead of using the virtual InputType::isTextField to do a boolean check and putting the algorithm here. > Source/WebCore/html/HTMLInputElement.cpp:1691 > + if (text->length()) > + return false; There’s no whitespace collapsing rule we have to consider here? Comment on attachment 241212 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=241212&action=review >> Source/WebCore/html/HTMLInputElement.cpp:1684 >> + return true; > > I suggest putting this code into a virtual InputType::isEmptyValue instead of using the virtual InputType::isTextField to do a boolean check and putting the algorithm here. Sounds good. >> Source/WebCore/html/HTMLInputElement.cpp:1691 >> + return false; > > There’s no whitespace collapsing rule we have to consider here? I did not change behavior. It was previously calling innerTextValue().isEmpty() which returns true only of the actual empty string. This function is used to determine if the placeholder should be visible or not. I would expect the placeholder to not be visible if the input contains white spaces (and as I said, this was WebKit's behavior already). |