B2G/gecko/browser/components/tabview/search.js
// Given a <TabItem> or a <xul:tab>, focuses it and it's window.
Given a  or a , focuses it and it's window.
Given a or a focuses it and it ' s window .
function TabUtils_focus(tab) {
    if ("tab" in tab)
      tab = tab.tab;
    tab.ownerDocument.defaultView.gBrowser.selectedTab = tab;
    tab.ownerDocument.defaultView.focus();
  }
function TabUtils_focus ( tab ) { if ( "tab" in tab ) tab = tab . tab ; tab . ownerDocument . defaultView . gBrowser . selectedTab = tab ; tab . ownerDocument . defaultView . focus ( ) ; }
Given a <TabItem> or a <xul:tab>, focuses it and it's window.
Given a <TabItem > or a <xul : tab > focuses it and it ' s window .
// Convert a <TabItem> to a <xul:tab>