Closed Bug 489223 Opened 12 years ago Closed 6 years ago

avoid having to dispatch ValueChange events manually in download manager

Categories

(Firefox for Android Graveyard :: General, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: mfinkle, Unassigned)

Details

Follow bug for work in bug 474492:

>+    for each (let attr in searchAttributes)
>+      combinedSearch += aItem.getAttribute(attr).toLowerCase() + " ";

Could we store combinedSearch as a JS prop on the item in createItem? Or at
least cache it here for subsequent matchesSearch calls? I suppose "status" and
"datetime" can change, but we should be able to also update the cache in
_updateStatus and _updateTime. Followup, perhaps.

>+    // Make sure each of the terms are found
>+    for each (let term in this._searchTerms)
>+      if (combinedSearch.search(term) == -1)

I think indexOf should be preferred over search for the string constant case,
though it probably doesn't matter that much. Doesn't matter as much if we do
the cache of combinedSearch, but this method could shortcircuit if
this._searchTerms.length==0 right?

----------------------------------------------

>+  onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress, aDownload) {

>+    // Dispatch ValueChange for a11y
>+    var event = document.createEvent("Events");
>+    event.initEvent("ValueChange", true, true);
>+    document.getAnonymousElementByAttribute(element, "anonid", "progressmeter").dispatchEvent(event);

Hmm... perhaps the binding should instead have setters that map to its
progressmeter's "value" and "mode" properties, which take care of this event
firing for you.
I think we can close this bug. 2 of the 3 comments are obsolete now that the search code has been removed. The 3rd comment is a nice-to-have, but not really needed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Can we get a verification that this is unnecessary, stuart?
I think we should still fix the third issue. Hardly critical, though.
Severity: normal → minor
Status: RESOLVED → REOPENED
OS: Windows XP → All
Hardware: x86 → All
Resolution: WONTFIX → ---
Summary: Cleanup in download manager → avoid having to dispatch progress events manually in download manager
Summary: avoid having to dispatch progress events manually in download manager → avoid having to dispatch ValueChange events manually in download manager
This bug has been buried in the graveyard and has not been updated in over 5 years. It is probably safe to assume that it will never be fixed, so resolving as WONTFIX.

[Mass-change filter: graveyard-wontfix-2014-09-24]
Status: REOPENED → RESOLVED
Closed: 11 years ago6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.