Bug 1376695 - Check HasName() before CanHaveName(). r=ehsan
We should check HasName() first because HasName() should be cheaper and would typically be false. MozReview-Commit-ID: 8l7WQR7Lcxj
This commit is contained in:
@@ -487,7 +487,7 @@ nsGenericHTMLElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
|
||||
if (aDocument) {
|
||||
RegAccessKey();
|
||||
if (CanHaveName(NodeInfo()->NameAtom()) && HasName()) {
|
||||
if (HasName() && CanHaveName(NodeInfo()->NameAtom())) {
|
||||
aDocument->
|
||||
AddToNameTable(this, GetParsedAttr(nsGkAtoms::name)->GetAtomValue());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user