Closed Bug 880317 Opened 6 years ago Closed 6 years ago

Don't use nsIDOMDocument in nsScreen

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: Ms2ger, Assigned: Ms2ger)

Details

Attachments

(1 file)

Attached patch Patch v1Splinter Review
It's much nicer this way.
Attachment #759211 - Flags: review?(mounir)
Comment on attachment 759211 [details] [diff] [review]
Patch v1

Review of attachment 759211 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the cleanup.

::: dom/base/nsScreen.cpp
@@ +410,5 @@
>    nsCOMPtr<EventTarget> target = aEvent->InternalDOMEvent()->GetCurrentTarget();
> +  MOZ_ASSERT(target);
> +
> +  nsCOMPtr<nsIDocument> doc = do_QueryInterface(target);
> +  MOZ_ASSERT(doc);

I believe that you can keep the previous structure:
nsCOMPtr<EventTarget> target = ...;
nsCOMPtr<nsIDocument> doc = ...;
MOZ_ASSERT(target && doc);
Attachment #759211 - Flags: review?(mounir) → review+
Yes, but then you don't which of the two is null if the assert fires.
https://hg.mozilla.org/mozilla-central/rev/7041298aa8d9
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.