Dictionary Search extension uses bogus code to tell the type of node

RESOLVED INCOMPLETE

Status

Tech Evangelism Graveyard
Other
RESOLVED INCOMPLETE
13 years ago
3 years ago

People

(Reporter: bz, Unassigned)

Tracking

Details

From bug 290324, this extension does, in dictionarySearchGetSelectedText():

  var node = document.popupNode;
  var selection = "";
  var nodeLocalName = node.localName.toUpperCase();
  if ((nodeLocalName == "TEXTAREA") || (nodeLocalName == "INPUT" && node.type ==
"text")) {
      selection = node.value.substring(node.selectionStart, node.selectionEnd);
  }

This is clearly modeled on our very own context menu code, which is naturally
buggy for anything that's not HTML.  What it _should_ be doing if it wants to do
this right is something more like:

if ((node instanceof HTMLTextAreaElement) || 
    ((node instanceof HTMLInputElement) && node.type == "text"))
  ...
}

And probably using XPCWrappedNative stuff for getting the type and value...

Comment 1

7 years ago
INCOMPLETE due to lack of activity since the end of 2009.

If someone is willing to investigate the issues raised in this bug to determine whether they still exist, *and* work with the site in question to fix any existing issues, please feel free to re-open and assign to yourself.

Sorry for the bugspam; filter on "NO MORE PRE-2010 TE BUGS" to remove.
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INCOMPLETE
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.