Bug 388422 - Avoid checks for editability in BindToTree, r+sr=peterv

--HG--
extra : rebase_source : 06eae0083f9b620e6a7ee2fe63a22c974b29608c
This commit is contained in:
Olli Pettay 2009-06-23 15:57:56 +03:00
parent a887393a34
commit 6541f33eec
3 changed files with 8 additions and 1 deletions

View File

@ -143,8 +143,11 @@ enum {
NODE_HAS_EDGE_CHILD_SELECTOR |
NODE_HAS_SLOW_SELECTOR_NOAPPEND,
NODE_MAY_HAVE_CONTENT_EDITABLE_ATTR
= 0x00040000U,
// Four bits for the script-type ID
NODE_SCRIPT_TYPE_OFFSET = 18,
NODE_SCRIPT_TYPE_OFFSET = 19,
NODE_SCRIPT_TYPE_SIZE = 4,

View File

@ -1114,6 +1114,7 @@ nsGenericHTMLElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom* aName,
PRInt32 change;
if (contentEditable) {
change = GetContentEditableValue() == eTrue ? -1 : 0;
SetFlags(NODE_MAY_HAVE_CONTENT_EDITABLE_ATTR);
}
nsresult rv = nsGenericElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,

View File

@ -753,6 +753,9 @@ protected:
static const nsIContent::AttrValuesArray values[] =
{ &nsGkAtoms::_false, &nsGkAtoms::_true, &nsGkAtoms::_empty, nsnull };
if (!HasFlag(NODE_MAY_HAVE_CONTENT_EDITABLE_ATTR))
return eInherit;
PRInt32 value = FindAttrValueIn(kNameSpaceID_None,
nsGkAtoms::contenteditable, values,
eIgnoreCase);