Closed
Bug 243588
Opened 21 years ago
Closed 21 years ago
Consider optimizing the inline style stuff in nsTextControlFrame
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(1 file)
6.16 KB,
patch
|
dbaron
:
review+
dbaron
:
superreview+
|
Details | Diff | Splinter Review |
On testcases with lots of inputs, we're spending up to 10% of the time parsing the inline style on the anonymous div inside the input.... I wonder whether we can parse that once and then have a CSS rule that we just apply to all such divs. It seems like we should be able to have a (static, say) nsICSSStyleRule about and just use SetInlineStyleRule to set it. Thoughts? This should work pretty decently, right?
We could just add two items to nsCSSAnonBoxList.h
![]() |
Assignee | |
Comment 3•21 years ago
|
||
So basically, we'd need to create a frame ourselves in nsTextControlFrame::CreateFrameFor and make sure to init it with the right style context? Note that ::-moz-singleline-textcontrol-frame is already in nsCSSAnonBoxList (though unused in our code). I was also looking at the overflow stuff, and it seems like the right way to do overflow is to set it to inherit on the div and to auto on textarea and that way pages that want to override overflow can...
![]() |
Assignee | |
Comment 4•21 years ago
|
||
Although, doing it right (with scrollframe and all that jazz could be hard). It may be better to modify anonymous frame construction to allow the callee to pass out a style context from CreateFrameFor() or another function on nsIAnonymousContentCreator (to be added).
![]() |
Assignee | |
Comment 5•21 years ago
|
||
Another option is to use rules like: textarea > .anonymous-div { /* whatever */ } In forms.css and not bother with an anon box name. If we use a class there it shouldn't affect most style resolution very much at at all. This approach has the benefit of not requiring changes to the nsIAnonymousContentCreator interface and the like.
![]() |
Assignee | |
Comment 6•21 years ago
|
||
![]() |
Assignee | |
Comment 7•21 years ago
|
||
Comment on attachment 148536 [details] [diff] [review] Like so David, what do you think? If you prefer, I'll work on the pseudo-element approach instead.
Attachment #148536 -
Flags: superreview?(dbaron)
Attachment #148536 -
Flags: review?(dbaron)
Comment on attachment 148536 [details] [diff] [review] Like so sure, but also remove the unneeded pseudo-element from xbl-forms.css
Attachment #148536 -
Flags: superreview?(dbaron)
Attachment #148536 -
Flags: superreview+
Attachment #148536 -
Flags: review?(dbaron)
Attachment #148536 -
Flags: review+
![]() |
Assignee | |
Updated•21 years ago
|
Assignee: nobody → bzbarsky
![]() |
Assignee | |
Comment 9•21 years ago
|
||
Fixed. No Tp impact that I can see, saves 600 bytes codesize...
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•