Closed Bug 290421 Opened 20 years ago Closed 16 years ago

Suite context menu code shouldn't rely on localname tests

Categories

(SeaMonkey :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bzbarsky, Unassigned)

Details

The Seamonkey context menu code uses the localName of DOM nodes to identify the
type of node.  It should just use the appropriate |instanceof| tests instead. 
For example, replace:

296             } else if ( this.target.localName.toUpperCase() == "TEXTAREA" ) {
297                  this.onTextInput = true;
298             } else if ( this.target.localName.toUpperCase() == "HTML" ) {

with:

  } else if ( this.target instanceof HTMLTextAreaElement ) {
      this.onTextInput = true;
  } else if ( this.target instanceof HTMLHtmlElement ) {

etc.  As things stand, the code behaves incorrectly for XML documents, and the
existing code may even be subject to spoofing or security issues (see bug 290324
for an example, though with an extension).
In which version/file is this code ?
FIXED by patch in Bug 298892
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.