Closed Bug 779616 Opened 12 years ago Closed 12 years ago

Stop using DOMAttrModified events

Categories

(SeaMonkey :: MailNews: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
seamonkey2.14

People

(Reporter: neil, Assigned: neil)

Details

Attachments

(1 file)

Instead we should use the new HTML5 mutation observers.
Attached patch Proposed patchSplinter Review
Assignee: nobody → neil
Status: NEW → ASSIGNED
Attachment #648059 - Flags: review?(iann_bugzilla)
Attachment #648059 - Flags: feedback?(mnyromyr)
Thu Aug 02 2012 23:00:23
Warning: Use of Mutation Events is deprecated. Use MutationObserver instead.
Source file: chrome://navigator/content/navigator.xul
Ignore that. Extension problem.
Comment on attachment 648059 [details] [diff] [review]
Proposed patch

>+function AddMutationObserver(callback)
> {
>+  new MutationObserver(callback).observe(callback(), {attributes: true, attributeFilter: ["hidden"]});
> }
> 
>+function UpdateFolderUnreadCol()
> {
>+  var folderUnreadCol = document.getElementById("folderUnreadCol");
>+  var hidden = folderUnreadCol.getAttribute("hidden");
>+  var folderNameCell = document.getElementById("folderNameCell");
>+  var label = {true: "?folderTreeName", false: "?folderTreeSimpleName"};
>+  folderNameCell.setAttribute("label", label[folderUnreadCol.hidden]);
Do you really mean folderUnreadCol.hidden here or just hidden? Either there is an unused variable or the above line needs fixing.

r=me with that fixed.
Attachment #648059 - Flags: review?(iann_bugzilla) → review+
(In reply to Ian Neal from comment #4)
>(From update of attachment 648059 [details] [diff] [review])
>>+  var folderUnreadCol = document.getElementById("folderUnreadCol");
>>+  var hidden = folderUnreadCol.getAttribute("hidden");
>>+  var folderNameCell = document.getElementById("folderNameCell");
>>+  var label = {true: "?folderTreeName", false: "?folderTreeSimpleName"};
>>+  folderNameCell.setAttribute("label", label[folderUnreadCol.hidden]);
>Do you really mean folderUnreadCol.hidden here or just hidden? Either there
>is an unused variable or the above line needs fixing.
Yeah, hidden is redundant, thanks for catching that.
(Don't you need a moa from Karsten at least?)
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/423cb0440fca
Target Milestone: --- → seamonkey2.14
Comment on attachment 648059 [details] [diff] [review]
Proposed patch

>+function AddMutationObserver(callback)

I would have preferred "aCallback" …
Attachment #648059 - Flags: feedback?(mnyromyr) → feedback+
I guess this is fixed, as bm-props.js should have its own bug.
Status: ASSIGNED → RESOLVED
Closed: 12 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: