nsCSSFrameConstructor::ContentAppended() calls nsDocument::GetLayoutHistoryState() needlessly in most cases

RESOLVED INVALID

Status

()

enhancement
P3
normal
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: Ehsan, Unassigned)

Tracking

(Blocks 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

Reporter

Description

2 years ago
This is used to initialize nsFrameConstructorState::mFrameState, but as far as I can tell, this information is only ever used when creating select frames, and nothing else, so it seems like we should be able to initialize this members lazily.

This wasn't a huge cost under Speedometer profiles, but I kept noticing it.  The fact that this is called from ContentAppended() makes this hurt us a lot every time a node is added, for example under HTMLInputElement.value setter.
Since I have landed bug 1375910, we keep text node even if input.value sets empty.  It means that we don't create and insert text node every time on addItem-sync tests.
Reporter

Comment 2

2 years ago
Interesting!  This would be worth re-measuring I think.
Priority: -- → P3
Reporter

Comment 3

2 years ago
This is now a very insignificant part of nsCSSFrameConstructor::ContentAppended().
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.