Closed Bug 725867 Opened 13 years ago Closed 13 years ago

Optimize anon content in BBP

Categories

(Core :: DOM: Core & HTML, defect)

12 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached patch wip (deleted) — Splinter Review
No description provided.
Blocks: 716598
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 595898 [details] [diff] [review] wip This is still reasonable conservative, but helps with XUL based chrome UI which has plenty of elements in anonymous content. I'd like to find better way to ensure that anonymous elements in a document are certainly alive, but haven't found that yet. (document keeps non-anonymous elements alive)
Attachment #595898 - Flags: review?(jst)
Attachment #595898 - Flags: feedback?(continuation)
Comment on attachment 595898 [details] [diff] [review] wip Review of attachment 595898 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/base/src/nsGenericElement.cpp @@ +4537,4 @@ > nsIDocument* currentDoc = aNode->GetCurrentDoc(); > if (currentDoc && > + nsCCUncollectableMarker::InGeneration(currentDoc->GetMarkedCCGeneration()) && > + // If aNode is not optimizable, but it is still an element "but it is still" should probably be "but is" @@ +4542,5 @@ > + // we can act as if it was optimizable. When the primary frame dies, node > + // will end up to the purple buffer because of the refcount change. > + (!unoptimizable || > + (currentDoc->GetShell() && aNode->IsElement() && > + aNode->AsElement()->GetPrimaryFrame()))) { Maybe turn these two lines into a separate function with a descriptive name, then move the comment up there? I don't understand any of the unoptimizable stuff so I can't really comment on that.
Attachment #595898 - Flags: feedback?(continuation) → feedback+
Comment on attachment 595898 [details] [diff] [review] wip + // If aNode is not optimizable, but it is still an element + // with a frame in a document which has currently active presshell, + // we can act as if it was optimizable. When the primary frame dies, node "the node", or "aNode". + // will end up to the purple buffer because of the refcount change. + (!unoptimizable || + (currentDoc->GetShell() && aNode->IsElement() && + aNode->AsElement()->GetPrimaryFrame()))) { What Andrew said. Maybe put the code after || in a static inlined helper named NodeHasFrame() or somesuch? r=jst with that.
Attachment #595898 - Flags: review?(jst) → review+
Attached patch patch (deleted) — Splinter Review
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: