Closed Bug 730587 Opened 12 years ago Closed 12 years ago

Stash pointer to the subtree parent on nodes in disconnected subtrees

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16
Tracking Status
firefox14 - ---
firefox15 - ---

People

(Reporter: khuey, Assigned: khuey)

References

Details

Attachments

(1 file, 1 obsolete file)

Being able to always quickly get the subtree parent will make some CC optimizations more performant.
Attached patch Patch (obsolete) — Splinter Review
Attachment #601012 - Flags: superreview?(jst)
Attachment #601012 - Flags: review?(bugs)
Comment on attachment 601012 [details] [diff] [review]
Patch


>-  nsIFrame* GetPrimaryFrame() const { return mPrimaryFrame; }
>+  nsIFrame* GetPrimaryFrame() const {
{ should be in the next line.

>+  void SetSubtreeRootPointer(nsINode* aSubtreeRoot) {
ditto

>+  void ClearSubtreeRootPointer() {
And here.

> nsINode::~nsINode()
> {
>   NS_ASSERTION(!HasSlots(), "nsNodeUtils::LastRelease was not called?");
>+  NS_ASSERTION(mSubtreeRoot == this, "Didn't restore state properly?");
> }
Use stronger MOZ_ASSERT here?
Attached patch PatchSplinter Review
Attachment #601012 - Attachment is obsolete: true
Attachment #601033 - Flags: superreview?(jst)
Attachment #601033 - Flags: review?(bugs)
Attachment #601012 - Flags: superreview?(jst)
Attachment #601012 - Flags: review?(bugs)
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 601012 [details] [diff] [review]
> Patch
> 
> 
> >-  nsIFrame* GetPrimaryFrame() const { return mPrimaryFrame; }
> >+  nsIFrame* GetPrimaryFrame() const {
> { should be in the next line.

Done.

> >+  void SetSubtreeRootPointer(nsINode* aSubtreeRoot) {
> ditto

Done.

> >+  void ClearSubtreeRootPointer() {
> And here.

Done.

> > nsINode::~nsINode()
> > {
> >   NS_ASSERTION(!HasSlots(), "nsNodeUtils::LastRelease was not called?");
> >+  NS_ASSERTION(mSubtreeRoot == this, "Didn't restore state properly?");
> > }
> Use stronger MOZ_ASSERT here?

It seems odd to have one fatal assert when we use NS_ASSERTION all over the DOM code.
Well, we haven't had MOZ_ASSERT for a long time.
In this case I really want debug builds to crash asap if something goes wrong.
Comment on attachment 601033 [details] [diff] [review]
Patch

>+  nsIFrame* GetPrimaryFrame() const
>+  {
>+    return IsInDoc() ? mPrimaryFrame : nsnull;
I wonder if this shows up in the profiles. Probably not.


>+  union {
I think { should be in the next line.
Attachment #601033 - Flags: review?(bugs) → review+
Comment on attachment 601033 [details] [diff] [review]
Patch

Looks good.
Attachment #601033 - Flags: superreview?(jst) → superreview+
http://hg.mozilla.org/mozilla-central/rev/5280e98d2d77
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
Pushed a followup to make OwnerDocAsNode non-inline, with rs=khuey:
  https://hg.mozilla.org/integration/mozilla-inbound/rev/f2bacfc9013c
Version: unspecified → Trunk
Depends on: 736695
Depends on: 745494
We should consider backing this out of Aurora 14 due to bug 736695.
Although backing this out will probably end up being the solution, we'll instead continue to track bug 736695 since it's the actual regression.
We need to back this out of Aurora 15 as well....
We have this backout tracked already in bug 736695 so not tracking here.
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: