nsDOMCSSDeclaration::GetCSSParsingEnvironment should not AddRef its output

RESOLVED FIXED in mozilla6

Status

()

Core
CSS Parsing and Computation
P1
normal
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: dbaron, Assigned: bz)

Tracking

Trunk
mozilla6
Points:
---
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
Filed per request in bug 435442 comment 37:

nsDOMCSSDeclaration::GetCSSParsingEnvironment (a pure virtual function) and its implementations currently AddRef all the out-parameters.  However, this is probably unnecessary, and it should be changed to fill in weak pointers.
Created attachment 528613 [details] [diff] [review]
Stop refcounting the return values from GetCSSParsingEnvironment, where possible.
Attachment #528613 - Flags: review?(dbaron)
Priority: -- → P1
Whiteboard: [need review]
(Reporter)

Comment 2

6 years ago
Comment on attachment 528613 [details] [diff] [review]
Stop refcounting the return values from GetCSSParsingEnvironment, where possible.

>@@ -120,17 +120,17 @@ nsDOMCSSAttributeDeclaration::DocToUpdat
>...
>   // We need GetOwnerDoc() rather than GetCurrentDoc() because it might
>   // be the BeginUpdate call that inserts mElement into the document.
>-  return mElement->GetOwnerDoc();
>+  return mElement->GetCurrentDoc();
> }

Were you just experimenting with something here?  I'm guessing this
wasn't intended to be part of the patch.  If it was, please explain.

r=dbaron assuming that wasn't supposed to be here
Attachment #528613 - Flags: review?(dbaron) → review+
> Were you just experimenting with something here?

Yes.  I was sure I'd reverted that change, but clearly not.  Thank you for catching it!

Reverted locally.
Whiteboard: [need review] → [need landing]
Created attachment 528705 [details] [diff] [review]
With that change reverted
Attachment #528613 - Attachment is obsolete: true
This was pushed as http://hg.mozilla.org/mozilla-central/rev/27987cc4f4bb
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Whiteboard: [need landing]
Target Milestone: --- → mozilla6
You need to log in before you can comment on or make changes to this bug.