Open
Bug 186066
Opened 23 years ago
Updated 3 years ago
Typing in textareas causes redundant view resizing
Categories
(Core :: Web Painting, defect)
Core
Web Painting
Tracking
()
NEW
People
(Reporter: sfraser_bugs, Unassigned)
Details
(Keywords: perf)
Attachments
(1 file)
|
1.38 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
When typing in textareas (like this one), we invalidate the entire textarea for
each keypress.
Some investigation shows that this happens because of a couple of view resizes.
nsScrollBoxFrame::DoLayout calls Layout on its child box with the
NS_FRAME_NO_SIZE_VIEW flag (since we have a nsIBoxToBlockAdaptor in this case).
Down in that Layout call, nsBoxToBlockAdaptor::Reflow() calls
nsContainerFrame::FinishReflowChild() with flags NS_FRAME_NO_MOVE_FRAME. This
results in a call to nsContainerFrame::SyncFrameViewAfterReflow() that resizes
the view (line 695 of nsContainerFrame.cpp). Back up the stack, we continue in
nsScrollBoxFrame::DoLayout, which calls vm->ResizeView() again, putting the view
back to its original size.
The bug here seems to be that the call to nsContainerFrame::FinishReflowChild()
throws away the flags passed in, and hard-codes NS_FRAME_NO_MOVE_FRAME, which
results in a view resize. If it looked at the incoming flags, it would see the
NS_FRAME_NO_SIZE_VIEW flag and not resize the view.
| Reporter | ||
Comment 1•23 years ago
|
||
| Reporter | ||
Comment 2•23 years ago
|
||
I verified that with this patch, we no longer redraw the entire contents of the
textarea for each keypress.
See also bug 151682.
Comment on attachment 109682 [details] [diff] [review]
Proposed patch to nsBoxToBlockAdapter.cpp
r+sr=roc+moz
This makes total sense.
Attachment #109682 -
Flags: superreview+
Attachment #109682 -
Flags: review+
Note that this could expose bugs where reflowing doesn't repaint everything it
needs to. But we should just fix those bugs.
Also note that we'll still see full repaints when the scrolled area grows (e.g.
when a new line is added to the textarea). To fix that, we should make the
(hidden) aRepaintExposedAreaOnly parameter to ResizeView() always be PR_TRUE and
fix any "insufficient repaint" bugs that arise.
| Reporter | ||
Comment 5•23 years ago
|
||
We still do view resizing with this patch, as soon as there is enough content to
show scrollbars (even when typing doesn't change the contents size).
| Reporter | ||
Comment 6•23 years ago
|
||
In the case where the textarea has enough content to scroll, the view resizing
is happening via the call to PlaceFrameView() in nsBlockFrame::ReflowDirtyLines.
PlaceFrameView() ignores any reflow flags, and, anyway, the
NS_FRAME_NO_SIZE_VIEW flag doesn't make it into the nsHTMLReflowMetrics. So more
work is required to fix this case.
Are you going to check this in, or am I? I guess I'll check it in if you don't
get to it first.
Fix checked in. Leaving open to handle the remaining case.
| Reporter | ||
Comment 9•23 years ago
|
||
Thanks. I was waiting to get a fix for the other case, but having it in is OK.
Updated•22 years ago
|
Component: Layout → Layout: View Rendering
Comment 10•19 years ago
|
||
So is this still an issue?
Updated•16 years ago
|
QA Contact: ian → layout.view-rendering
Assignee: roc → nobody
Comment 11•15 years ago
|
||
Is this still an issue?
| Assignee | ||
Updated•7 years ago
|
Component: Layout: View Rendering → Layout: Web Painting
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•