Open Bug 1452059 Opened 6 years ago Updated 5 years ago

Replace usages of statusText and maybe other properties with attribute getters and setters

Categories

(SeaMonkey :: General, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

People

(Reporter: Paolo, Unassigned)

References

(Blocks 1 open bug)

Details

In bug 1451782 we're removing statusText and a few other properties of XULElement which are just wrappers on existing attributes. The SeaMonkey code may need to be updated accordingly.
I tried the patch and see no issue with TB. The status bar shows links and activities. Also when the bar is hidden, the links are shown in statusbar panel.
Looks like flexGroup, persist and statusText got removed.

Since these are very plain names, it's hard to see whether this is used or now. Boris pointed to im/content/newtab.xml and some stuff in suite/ for SeaMonkey. How did you come up with this result?

Looking for target.statusText yields this:
https://dxr.mozilla.org/comm-central/search?q=target.statustext&redirect=false

So I'd say, at least
common/bindings/toolbar.xml
584 <handler event="DOMMenuItemActive">this._updateStatusText(event.target.statusText);</handler>
is affected.

BTW, everything below im/ is dead code since Instantbird was discontinued.

Boris, do you have any "search tips"?

Richard, can you please port the changes to common/bindings/toolbar.xml, best in another bug.
Flags: needinfo?(richard.marti)
Flags: needinfo?(bzbarsky)
> How did you come up with this result?

I looked at https://searchfox.org/comm-central/search?q=%5C.statusText%5B%5Ea-zA-Z%5D&case=true&regexp=true&path= and then skimmed...
Flags: needinfo?(bzbarsky)
As I wrote in comment 1, I tried the patch and saw no change. You could also try the patch and check. As you know C++ a lot better than I you may see the difference.
Flags: needinfo?(richard.marti)
What does this do:
common/bindings/toolbar.xml
584 <handler event="DOMMenuItemActive">this._updateStatusText(event.target.statusText);</handler>

The method called is this:
       <method name="_updateStatusText">
          <parameter name="itemText"/>
          <body>
           <![CDATA[
            if (!this._active)
                return;
            var newText = itemText ? itemText : this._originalStatusText;
            if (newText != this._statusbar.label)
                this._statusbar.label = newText;
           ]]>
          </body>
        </method>

Boris, event.target.statusText is one of the ones that were removed? I don't think so since the same code is in
mozilla/toolkit/content/widgets/toolbar.xml
<handler event="DOMMenuItemActive">this._updateStatusText(event.target.statusText);</handler>
Flags: needinfo?(bzbarsky)
> Boris, event.target.statusText is one of the ones that were removed?

_May_ be one of them.  It depends on what event.target is...  If it's a XUL element, then yes.

> since the same code is in mozilla/toolkit/content/widgets/toolbar.xml

It's possible that that code is now buggy!  Paolo, do you know?
Flags: needinfo?(bzbarsky) → needinfo?(paolo.mozmail)
I missed that particular use in mozilla-central, however it's surely dead code, since the related "statusbar" binding was removed in bug 1419170. The patch here can certainly replace it with a getAttribute call for completeness, but the "menubar" binding will also go away at some point, so it doesn't matter too much.
Flags: needinfo?(paolo.mozmail)
Note that the log in bug 1453379 has:

JavaScript strict warning: chrome://global/content/bindings/toolbar.xml, line 168: ReferenceError: reference to undefined property "statusText"

So this is in fact being a problem for Thunderbird, not just SeaMonkey..
In fact we're just removing the "menubar" binding from mozilla-central entirely in bug 1453281.
As mentioned, I get heaps of these now:
JavaScript strict warning: chrome://global/content/bindings/toolbar.xml, line 168: ReferenceError: reference to undefined property "statusText"

Aceman, can you please take a look.
Flags: needinfo?(acelists)
We moved the menubar binding to c-c, but I do not see the error message any longer.
I got it where opening the main menu, but no longer.
Is DOMMenuItemActive event still called?
Flags: needinfo?(acelists)

The version of toolbar.xml in comm/common/bindings no longer contains any DOmMenuItemActive and any reference to statusText.
It seems there still exists a copy in Seamonkey:
https://searchfox.org/comm-central/source/suite/components/bindings/toolbar.xml#532

You need to log in before you can comment on or make changes to this bug.