Closed
Bug 179787
Opened 22 years ago
Closed 21 years ago
JavaScript strict "Warning: reference to undefined property this.mPanelContainer" in <tabbrowser.xml>
Categories
(SeaMonkey :: Tabbed Browser, defect)
SeaMonkey
Tabbed Browser
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: bugzilla, Assigned: neil)
References
Details
Attachments
(2 files, 3 obsolete files)
914 bytes,
patch
|
bugs4hj
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
2.55 KB,
patch
|
Details | Diff | Splinter Review |
I'm started to seem a bunch of these inthe console:
Warning: reference to undefined property this.mPanelContainer
They are almost flloding my console
lxr reports this as:
/xpfe/global/resources/content/bindings/tabbrowser.xml
/toolkit/content/widgets/tabbrowser.xml
![]() |
||
Comment 2•22 years ago
|
||
tabbrowser
Assignee: sgehani → jaggernaut
Component: XP Apps → Tabbed Browser
QA Contact: paw → pmac
Comment 3•22 years ago
|
||
Build 2002122608
First, these only appear when Strict JavaScript Warning are on.
Second, these only appear when a new Navigator window is created in addition to
the initial window created when Mozilla is launched.
Therefore, steps to reproduce:
1. Turn Strict JavaScript warnings on. Make sure new Navigator windows are blank.
2. Exit Mozilla
3. Launch Mozilla Navigator.
4. Open the JavaScript Console. You will see that this warning is not yet present.
5. Open a second Navigator window.
6. View the JavaScript Console. You will see a large amount of warnings
regarding the undefined property this.mPanelContainer.
For solving the issue, you can view the article about strict JavaScript warnings
at <http://www.javascriptkit.com/javatutors/serror.shtml>.
Keywords: clean-report
OS: Windows 2000 → All
Summary: JavaScript warnings: reference to undefined property this.mPanelContainer → reference to undefined property this.mPanelContainer
Updated•22 years ago
|
Summary: reference to undefined property this.mPanelContainer → JavaScript strict warning: reference to undefined property this.mPanelContainer in tabbrowser.xml
This also happens on every tab switch using FizzillaMach/2003040103. Setting
Hardware=All.
Hardware: PC → All
So either all those references to this.mPanelContainer need to use the fail-safe
detection method referred to in the article, or this.mPanelContainer need to be
explicitly defined somewhere.
I'm going to suggest this be fixed for 1.4 final by setting blocking1.4?. This
clutters up the JS Console with lots of warnings that reduce its' usability for
other purposes, and I imagine it's probably easy to fix.
Flags: blocking1.4?
Seemingly introduced between 2002110808 and 2002112208 FizzillaCFM builds. If we
assume it was introduced prior to the date/time of this bug being filed, that
narrows it down to approximately four days, represented by these check-ins:
<http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=SeaMonkeyAll&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=11%2F08%2F2002+08%3A46%3A00&maxdate=11%2F12%2F2002+12%3A50%3A00&cvsroot=%2Fcvsroot>.
Could bug 168807 or bug 173703 be involved?
Comment 7•22 years ago
|
||
If we see a fix for this we'll consider it for 1.4 but not going to block 1.4
for noise in the JS console (which isn't there for default profiles and most
milestone users, right?)
Flags: blocking1.4? → blocking1.4-
Comment 8•22 years ago
|
||
I get the same problem opening a popup window from javascript width
window.open(...
Casues a lot of searching when developing pages since I use the javascript
consol alot to debug scripts.
Comment 9•22 years ago
|
||
AFAICT from some very excessive dump session in
mozilla\kddev\dist\bin\chrome\toolkit\content\global\bindings\tabbrowser.xml,
<field name="mStrip">
this.mTabBox.firstChild
</field>
is to blame: it cause the
<handler event="select" action="if (event.originalTarget ==
this.mPanelContainer) this.updateCurrentBrowser();"/>
to be called, but mPanelContainer hasn't been initialized yet (it's initialized
two fields after mStrip)...
A simple patch might be checking the validity of mPanelContainer first:
<handler event="select">
<![CDATA[
if (("mPanelContainer" in this) && (event.originalTarget ==
this.mPanelContainer))
this.updateCurrentBrowser();
]]>
</handler>
(Moving the mPanelContainer field before mStrip doesn't help, because
updateCurrentBrowser would be still unknown.)
Comment 10•22 years ago
|
||
Path should be \mozilla\xpfe\global\resources\content\bindings\tabbrowser.xml,
of course.
Comment 11•22 years ago
|
||
Correction to comment 9:
The "select" event handler invocation is caused not by |mStrip|, but by
<field name="mTabContainer">
this.mStrip.childNodes[2]
</field>
The event handler is called twice, each time causing 9 error messages (this is
bug 104549, I guess).
The correction above has no effect on the suggested patch.
Updated•22 years ago
|
Attachment #127077 -
Flags: review?(jaggernaut)
Comment 12•22 years ago
|
||
Erh, but why does that cause that handler to be called?
Comment 13•22 years ago
|
||
> why does that cause that handler to be called?
Good question, that can't answer (yet).
The changes to the select handler are actually just a workaround - and as such
something I'm not quite happy with, since the real problem is still hidden.
I can try to dig further into this, but maybe some 'wizard' can give me hint...
Comment 14•22 years ago
|
||
Comment on attachment 127077 [details] [diff] [review]
patch as per comment 9
I'm not sure you can do any better than this, as the updateCurrentBrowser()
method calls on other properties of its "this" object a lot. To properly fix
it might involve rearranging a good part of the file; I think this solution is
adequate.
>+ <handler event="select"/>
Um, if you check that in you'll get an XML parse error, due to the closing
slash inside the tag. Otherwise, it looks good.
Comment 15•22 years ago
|
||
>+ <handler event="select"/>
I had this error in my tree, but wasn't aware that it was in the patch also (I
thought I had just screwed up my local file later).
Sorry; corrected patch attached.
Attachment #127077 -
Attachment is obsolete: true
Comment 16•22 years ago
|
||
Lets speedup the event handler a bit, no more useless deck/tabpanel and other
events.
- <handler event="select" action="if (event.originalTarget ==
this.mPanelContainer) this.updateCurrentBrowser();"/>
+ <handler event="select" action="if (event.originalTarget.nodeName ==
'tabs') this.updateCurrentBrowser();"/>
Note: I didn't check Menu/View/Site Navigation Navbar, any takers?
Comment 17•22 years ago
|
||
CC'ing Neil.
Neil, I guess you still remember bug 179787, right?
Comment 18•22 years ago
|
||
Woops, make that bug 173703
Assignee | ||
Comment 19•22 years ago
|
||
Yes and I also remember that my original patch used
<xul:tabpanels flex="1" class="plain" onselect="event.preventBubble();">
so thet only the <tabs> select events hit the event handler, which simply calls
updateCurrentBrowser() in my tree.
Comment 20•22 years ago
|
||
|event.originalTarget.nodeName == 'tabs'| is basically the same thing, with one
exeption, it works without the strict warning ;)
Assignee | ||
Comment 21•22 years ago
|
||
Ah, but you're not blocking tabs in content that way...
Updated•21 years ago
|
Attachment #127077 -
Flags: review?(jag)
Comment 22•21 years ago
|
||
This is almost certainly my fault (although i blame our xbl implementation for
not having a strict processing order). I'm fairly certain someone can take the
following and figure out what's happening.
<?xml version="1.0"?><!DOCTYPE bindings><bindings id="x"
xmlns="http://www.mozilla.org/xbl">
<binding id="y"><implementation>
<field name="z">1</field>
<constructor><![CDATA[ this.z = this.z; ]]></constructor>
</implementation></binding></bindings>
bz mentioned bug 63370.
Assignee: jag → timeless
Component: Tabbed Browser → XBL
![]() |
||
Comment 23•21 years ago
|
||
To answer comment 12, here is the sequence of events:
1) The mTabContainer field is compiled and evaluated
2) This causes this.mStrip.childNodes[2] to be accessed (per comment 11). That
node is the xul:tabs in the tabbox.
3) Accessing a node like this causes a XPConnect wrapper to be created for it.
nsElementSH::PostCreate ensures that any relevant XBL bindings are attached
to the node (in this case the
"chrome://global/content/bindings/tabbox.xml#tabs" binding).
4) The constructor of the #tabs binding sets selectedIndex to 0 (see
http://lxr.mozilla.org/seamonkey/source/xpfe/global/resources/content/bindings/tabbox.xml#194)
on the tabs.
5) The selectedIndex setter for #tabs synchronously dispatches a onselect event
on the <xul:tabs> element (see
http://lxr.mozilla.org/seamonkey/source/xpfe/global/resources/content/bindings/tabbox.xml#251)
6) This event bubbles up to the <tabbrowser>, triggering its onselect handler.
At this point, note, mPanelContainer is NOT initialized yet. Hence the
warnings.
This is not an XBL bug, as far as I can tell....
Assignee: timeless → tabbed-browser
Component: XBL → Tabbed Browser
Assignee | ||
Comment 24•21 years ago
|
||
We prefer the tabs constructor to select tabs, because some themes depend on
the additional attributes being set on adjacent tabs. However in this case
there are no adjacent tabs so this should be a reasonably safe fix.
Comment 25•21 years ago
|
||
Comment on attachment 136860 [details] [diff] [review]
Proposed patch
This works for me, r+ HJ
Attachment #136860 -
Flags: review+
Updated•21 years ago
|
Attachment #128061 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #136860 -
Flags: superreview?(bz-vacation)
![]() |
||
Comment 26•21 years ago
|
||
Comment on attachment 136860 [details] [diff] [review]
Proposed patch
So why does this work? May I suggest adding a comment explaining why that
attribute is necessary?
Comment 27•21 years ago
|
||
Because it skips step 5.
Comment 28•21 years ago
|
||
![]() |
||
Comment 29•21 years ago
|
||
Comment on attachment 136860 [details] [diff] [review]
Proposed patch
I see. sr=bzbarsky with a nice comment explaining that added.
Attachment #136860 -
Flags: superreview?(bz-vacation) → superreview+
Assignee | ||
Comment 30•21 years ago
|
||
Sorry, you can't add comments to XBL <content>, because they'd get cloned and
mess up the child node counts.
![]() |
||
Comment 31•21 years ago
|
||
<sigh>... That's ridiculous. No wonder XBL bindings are totally undocumented
and unreadable... We should change the XBL sink to ignore comment nodes inside
<content>, maybe?
Comment 32•21 years ago
|
||
bz: bug 112842 was filed for comments in bindings. No one's touched it since
it was filed.
![]() |
||
Comment 33•21 years ago
|
||
Very well. Marking dependency so we can remember to come back here and deal
with it once that bug is fixed...
Depends on: 112842
Assignee | ||
Comment 34•21 years ago
|
||
We don't actually need this urgently, right?
Assignee: tabbed-browser → neil.parkwaycc.co.uk
Target Milestone: --- → mozilla1.7alpha
Comment 35•21 years ago
|
||
Neil, did you receive my e-mail about the MultiZilla crasher?
note: I keep crashing on program exits when I add selected="true" but only when
MultiZilla is installed so I guess something strange is going on.
Assignee | ||
Comment 36•21 years ago
|
||
HJ: yeah, but I couldn't install MultiZilla (mozdev wasn't responding); in the
meantime I tried to reply to you too - I suggested changing tabbox.xml's
_selectedPanel default to this.firstChild instead of null
Assignee | ||
Comment 37•21 years ago
|
||
Well I couldn't reproduce the crash... now all I have to figure out is how to
uninstall Multizilla...
Assignee | ||
Comment 38•21 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment 39•21 years ago
|
||
Just for the record. Is the proposed patch checked in now, because that's the
one I keep crashing with (:
![]() |
||
Comment 40•21 years ago
|
||
Please file a bug on documenting this change; make it depend on the "comments in
XBL should be dropped" bug.
Comment 41•21 years ago
|
||
Neil, your patch introduced bug 229105
Comment 42•21 years ago
|
||
*** Bug 231531 has been marked as a duplicate of this bug. ***
Updated•21 years ago
|
Summary: JavaScript strict warning: reference to undefined property this.mPanelContainer in tabbrowser.xml → JavaScript strict "Warning: reference to undefined property this.mPanelContainer" in <tabbrowser.xml>
Comment 43•20 years ago
|
||
includes bug 229105's fix
Updated•20 years ago
|
Attachment #167213 -
Flags: review?(mconnor)
Updated•20 years ago
|
Attachment #167213 -
Flags: review?(mconnor) → review+
Comment 44•20 years ago
|
||
Attachment #167213 -
Attachment is obsolete: true
Comment 45•20 years ago
|
||
Comment on attachment 167952 [details] [diff] [review]
port to toolkit, merged to trunk (checked in)
toookit port checked in.
Attachment #167952 -
Attachment description: port to toolkit, merged to trunk → port to toolkit, merged to trunk (checked in)
Updated•17 years ago
|
Product: Core → SeaMonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•