Closed
Bug 737032
Opened 13 years ago
Closed 13 years ago
add isValidXULTab() method to ease tab checking
Categories
(Firefox Graveyard :: Panorama, defect)
Firefox Graveyard
Panorama
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 14
People
(Reporter: ttaubert, Assigned: bellindira)
Details
Attachments
(1 file, 1 obsolete file)
5.29 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
We should have some kind of isValidXULTab() method that eases checking if a given XUL tab is still valid. The first place where this can be used is:
https://hg.mozilla.org/integration/fx-team/rev/90d3b1fb284d
That's also how the check should be implemented (without the .pinned condition, of course). When dealing with asynchronous code wrt to tabs we should always check that the tab is still valid. There should already be other places where this check needs to be applied as well.
Updated•13 years ago
|
Assignee: nobody → bellindira
Assignee | ||
Comment 1•13 years ago
|
||
Attachment #613426 -
Flags: review?(ttaubert)
Reporter | ||
Comment 2•13 years ago
|
||
Comment on attachment 613426 [details] [diff] [review]
Added isValidXULTab() method
Review of attachment 613426 [details] [diff] [review]:
-----------------------------------------------------------------
This looks good but there a couple of places where we should use isValidXULTab() as well:
http://mxr.mozilla.org/mozilla-central/source/browser/components/tabview/tabview.js#63
http://mxr.mozilla.org/mozilla-central/source/browser/components/tabview/ui.js#794
http://mxr.mozilla.org/mozilla-central/source/browser/components/tabview/tabitems.js#242
Please address the comments below, use isValidXULTab() in those other three places and ask me for review again. Thanks!
::: browser/components/tabview/modules/utils.jsm
@@ +637,5 @@
> },
>
> // ----------
> + // Function: isValidXULTab
> + // Returns true if the tab is valid.
Please say what a "valid tab" exactly is (i.e. has not been closed, and not been removed from the DOM).
@@ +639,5 @@
> // ----------
> + // Function: isValidXULTab
> + // Returns true if the tab is valid.
> + isValidXULTab: function Utils_isValidXULTab(xulTab) {
> + return (!xulTab.closing && xulTab.parentNode) ? true : false;
We can make this even simpler:
return !xulTab.closing && xulTab.parentNode;
Attachment #613426 -
Flags: review?(ttaubert) → feedback+
Assignee | ||
Comment 3•13 years ago
|
||
Addressed the latest comments. Thanks!
Attachment #613691 -
Flags: review?(ttaubert)
Reporter | ||
Updated•13 years ago
|
Attachment #613426 -
Attachment is obsolete: true
Reporter | ||
Comment 4•13 years ago
|
||
Comment on attachment 613691 [details] [diff] [review]
Added isValidXULTab() method to ease tab checking and used it on places where it is useful.
Review of attachment 613691 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you! Looks good to me, will push it to try.
Attachment #613691 -
Flags: review?(ttaubert) → review+
Reporter | ||
Updated•13 years ago
|
Status: NEW → ASSIGNED
Whiteboard: [autoland-try:-b do -p linux,linux64,macosx64,win32,macosx -u mochitest-o -t none]
Reporter | ||
Comment 5•13 years ago
|
||
Forgot, that my bugzilla and LDAP ID are different :(
https://tbpl.mozilla.org/?tree=Try&rev=8a526b77d8e5
Whiteboard: [autoland-try:-b do -p linux,linux64,macosx64,win32,macosx -u mochitest-o -t none]
Reporter | ||
Comment 6•13 years ago
|
||
Try run was green.
Reporter | ||
Comment 7•13 years ago
|
||
Whiteboard: [fixed-in-fx-team]
Reporter | ||
Comment 8•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 14
Updated•9 years ago
|
Product: Firefox → Firefox Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•