Closed Bug 290417 Opened 19 years ago Closed 13 years ago

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

Categories

(Tech Evangelism Graveyard :: Other, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: bzbarsky, Unassigned)

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...
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
Closed: 13 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.