Closed Bug 157851 Opened 18 years ago Closed 18 years ago

Function AddAttrToElem() not needed...

Categories

(SeaMonkey :: Composer, defect)

defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.1beta

People

(Reporter: jst, Assigned: Brade)

Details

Attachments

(1 file)

The function AddAttrToElem() in editor.js is making a simple and fast thing
complicated and slow, it currently does:

function AddAttrToElem(dom, attr_name, attr_value, elem)
{
  var a = dom.createAttribute(attr_name);
  if ( a )
  {
    a.value = attr_value;
    elem.setAttributeNode(a);
  }
}

when it could simply do:

function AddAttrToElem(dom, attr_name, attr_value, elem)
{
  elem.setAttribute(attr_name, attr_value);
}

or better yet, remove the method all together and make the callers call
elem.setAtribute() directly.
-->brade
Assignee: syd → brade
Attached patch patchSplinter Review
Comment on attachment 91702 [details] [diff] [review]
patch

sr=jst
Attachment #91702 - Flags: superreview+
fix checked in for respin
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.1beta
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.