Closed Bug 914450 Opened 11 years ago Closed 11 years ago

TabSelect event listener can cause exceptions due to not finding an element with view id

Categories

(Firefox for Metro Graveyard :: Pan and Zoom, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 26

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

This causes test failures once we xpconnect eating those exceptions.
Attachment #801972 - Flags: review?(netzen)
Comment on attachment 801972 [details] [diff] [review]
findElementWithViewId can throw if it finds nothing, so be careful to catch that exception.

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

::: browser/metro/base/content/apzc.js
@@ +57,3 @@
>          windowUtils.setDisplayPortForElement(0, 0, ContentAreaObserver.width,
>                                               ContentAreaObserver.height,
> +                                             element);

Doesn't windowUtils.setDisplayPortFor uElement also throw if passed in an undefined element?
Attachment #801972 - Flags: review?(netzen)
Comment on attachment 801972 [details] [diff] [review]
findElementWithViewId can throw if it finds nothing, so be careful to catch that exception.

It would if that actually happened, sure.

But findElementWithViewId will never return a null element if the passed-in id is 1.  So in this case, if we didn't throw an exception and break we know we have an actual element.
Attachment #801972 - Flags: review?(netzen)
Comment on attachment 801972 [details] [diff] [review]
findElementWithViewId can throw if it finds nothing, so be careful to catch that exception.

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

r+ given that the root element will always implement nsIDOMElement and so findElementWithViewId won't return undefined.
Attachment #801972 - Flags: review?(netzen) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e1c03f7953a
Flags: in-testsuite+
Whiteboard: [need review]
Target Milestone: --- → Firefox 26
https://hg.mozilla.org/mozilla-central/rev/9e1c03f7953a
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: