Bug 14536

Summary: Unnecessary layout done when mousing down in text field
Product: WebKit Reporter: Adele Peterson <adele>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, bdakin, hyatt, mitz
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
shark sample
none
testcase
none
Avoid spurious layout due to mutating inner renderer's styles
none
Avoid spurious layout due to mutating inner renderer's styles bdakin: review+

Description Adele Peterson 2007-07-05 17:13:56 PDT
Unnecessary layout done when mousing down in text field.

Adam and I were testing a text field with 500,000 characters, and we noticed some sluggishness clicking in and out of the text field.

We profiled it with Shark, and saw that the slowness is coming from laying out the large run of text.  But it seems unnecessary to have to relayout just for clicking in the field.
Comment 1 Adam Roben (:aroben) 2007-07-05 17:18:59 PDT
Created attachment 15408 [details]
shark sample

Here's a sample from clicking in a text field with many characters in it.
Comment 2 Adam Roben (:aroben) 2007-07-05 17:21:16 PDT
Created attachment 15409 [details]
testcase

Enter "500000" in the second text field and press "Test Length". That will fill the first text field with 500000 characters.
Comment 3 mitz 2007-07-06 01:47:19 PDT
Created attachment 15414 [details]
Avoid spurious layout due to mutating inner renderer's styles
Comment 4 mitz 2007-07-06 01:59:54 PDT
Comment on attachment 15414 [details]
Avoid spurious layout due to mutating inner renderer's styles

I think I actually need to preserve the current values, not reset them, in case layout doesn't get called again (which is the entire point of this exercise).
Comment 5 mitz 2007-07-06 05:40:57 PDT
Created attachment 15417 [details]
Avoid spurious layout due to mutating inner renderer's styles
Comment 6 Beth Dakin 2007-07-06 09:37:05 PDT
Comment on attachment 15417 [details]
Avoid spurious layout due to mutating inner renderer's styles

Looks good!
Comment 7 Mark Rowe (bdash) 2007-07-06 19:36:39 PDT
Landed in r24083.