Backing out fix for bug 349465 to see if it affects Ts/Tp (for bug 355457).

This commit is contained in:
peterv%propagandism.org 2006-10-06 15:55:30 +00:00
Родитель 9d05f93491
Коммит 95ef08a41b
8 изменённых файлов: 34 добавлений и 123 удалений

Просмотреть файл

@ -726,10 +726,6 @@ public:
return slots ? slots->mAttributeMap.get() : nsnull;
}
virtual void RecompileScriptEventListeners()
{
}
protected:
/**
* Set attribute and (if needed) notify documentobservers and fire off

Просмотреть файл

@ -366,10 +366,6 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
nodeInfo = newNodeInfo;
}
nsGenericElement *elem = aNode->IsNodeOfType(nsINode::eELEMENT) ?
NS_STATIC_CAST(nsGenericElement*, aNode) :
nsnull;
nsCOMPtr<nsINode> clone;
if (aClone) {
rv = aNode->Clone(nodeInfo, getter_AddRefs(clone));
@ -394,10 +390,6 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
else if (nodeInfoManager) {
aNode->mNodeInfo.swap(newNodeInfo);
if (elem) {
elem->RecompileScriptEventListeners();
}
if (aCx) {
nsIXPConnect *xpc = nsContentUtils::XPConnect();
if (xpc) {
@ -413,8 +405,9 @@ nsNodeUtils::CloneAndAdopt(nsINode *aNode, PRBool aClone, PRBool aDeep,
}
}
if (elem) {
if (aNode->IsNodeOfType(nsINode::eELEMENT)) {
// aNode's attributes.
nsGenericElement *elem = NS_STATIC_CAST(nsGenericElement*, aNode);
const nsDOMAttributeMap *map = elem->GetAttributeMap();
if (map) {
nsCOMPtr<nsIDOMElement> element;

Просмотреть файл

@ -4118,26 +4118,3 @@ nsGenericHTMLElement::SyncEditorsOnSubtree(nsIContent* content)
}
}
}
void
nsGenericHTMLElement::RecompileScriptEventListeners()
{
PRInt32 i, count = mAttrsAndChildren.AttrCount();
for (i = 0; i < count; ++i) {
const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
// Eventlistenener-attributes are always in the null namespace
if (!name->IsAtom()) {
continue;
}
nsIAtom *attr = name->Atom();
if (!IsEventName(attr)) {
continue;
}
nsAutoString value;
GetAttr(kNameSpaceID_None, attr, value);
AddScriptEventListener(attr, value, PR_TRUE);
}
}

Просмотреть файл

@ -537,8 +537,6 @@ public:
*/
already_AddRefed<nsIDOMHTMLFormElement> FindForm(nsIForm* aCurrentForm = nsnull);
virtual void RecompileScriptEventListeners();
/**
* See if the document being tested has nav-quirks mode enabled.
* @param doc the document

Просмотреть файл

@ -1004,26 +1004,3 @@ nsSVGElement::ReportAttributeParseFailure(nsIDocument* aDocument,
"AttributeParseWarning",
strings, NS_ARRAY_LENGTH(strings));
}
void
nsSVGElement::RecompileScriptEventListeners()
{
PRInt32 i, count = mAttrsAndChildren.AttrCount();
for (i = 0; i < count; ++i) {
const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
// Eventlistenener-attributes are always in the null namespace
if (!name->IsAtom()) {
continue;
}
nsIAtom *attr = name->Atom();
if (!IsEventName(attr)) {
continue;
}
nsAutoString value;
GetAttr(kNameSpaceID_None, attr, value);
AddScriptEventListener(GetEventNameForAttr(attr), value, PR_TRUE);
}
}

Просмотреть файл

@ -127,8 +127,6 @@ public:
void GetAnimatedLengthValues(float *aFirst, ...);
void GetAnimatedNumberValues(float *aFirst, ...);
virtual void RecompileScriptEventListeners();
protected:
virtual nsresult BeforeSetAttr(PRInt32 aNamespaceID, nsIAtom* aName,
const nsAString* aValue, PRBool aNotify);

Просмотреть файл

@ -755,6 +755,7 @@ nsXULElement::CompileEventHandler(nsIScriptContext* aContext,
return NS_OK;
}
void
nsXULElement::AddListenerFor(const nsAttrName& aName,
PRBool aCompileEventHandlers)
@ -908,7 +909,37 @@ nsXULElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
NS_ENSURE_SUCCESS(rv, rv);
}
RecompileScriptEventListeners();
// we need to (re-)initialize several attributes that are dependant on
// the document. Do that now.
PRInt32 count = mAttrsAndChildren.AttrCount();
PRBool haveLocalAttributes = (count > 0);
PRInt32 i;
for (i = 0; i < count; i++) {
AddListenerFor(*mAttrsAndChildren.AttrNameAt(i),
aCompileEventHandlers);
}
if (mPrototype) {
// If we have a prototype, the node we are binding to should
// have the same script-type - otherwise we will compile the
// event handlers incorrectly.
NS_ASSERTION(mPrototype->mScriptTypeID == GetScriptTypeID(),
"Prototype and node confused about default language?");
PRInt32 count = mPrototype->mNumAttributes;
for (i = 0; i < count; i++) {
nsXULPrototypeAttribute *protoattr =
&mPrototype->mAttributes[i];
// Don't clobber a locally modified attribute.
if (haveLocalAttributes &&
mAttrsAndChildren.GetAttr(protoattr->mName.LocalName(),
protoattr->mName.NamespaceID())) {
continue;
}
AddListenerFor(protoattr->mName, aCompileEventHandlers);
}
}
}
}
@ -2503,63 +2534,6 @@ nsXULElement::BoolAttrIsTrue(nsIAtom* aName)
attr->GetAtomValue() == nsXULAtoms::_true;
}
void
nsXULElement::RecompileScriptEventListeners()
{
PRInt32 i, count = mAttrsAndChildren.AttrCount();
PRBool haveLocalAttributes = (count > 0);
for (i = 0; i < count; ++i) {
const nsAttrName *name = mAttrsAndChildren.AttrNameAt(i);
// Eventlistenener-attributes are always in the null namespace
if (!name->IsAtom()) {
continue;
}
nsIAtom *attr = name->Atom();
if (!IsEventHandler(attr)) {
continue;
}
nsAutoString value;
GetAttr(kNameSpaceID_None, attr, value);
AddScriptEventListener(attr, value, PR_TRUE);
}
if (mPrototype) {
// If we have a prototype, the node we are binding to should
// have the same script-type - otherwise we will compile the
// event handlers incorrectly.
NS_ASSERTION(mPrototype->mScriptTypeID == GetScriptTypeID(),
"Prototype and node confused about default language?");
count = mPrototype->mNumAttributes;
for (i = 0; i < count; ++i) {
const nsAttrName &name = mPrototype->mAttributes[i].mName;
// Eventlistenener-attributes are always in the null namespace
if (!name.IsAtom()) {
continue;
}
nsIAtom *attr = name.Atom();
// Don't clobber a locally modified attribute.
if (haveLocalAttributes && mAttrsAndChildren.GetAttr(attr)) {
continue;
}
if (!IsEventHandler(attr)) {
continue;
}
nsAutoString value;
GetAttr(kNameSpaceID_None, attr, value);
AddScriptEventListener(attr, value, PR_TRUE);
}
}
}
//----------------------------------------------------------------------
//
// nsXULPrototypeAttribute

Просмотреть файл

@ -573,8 +573,6 @@ public:
nsresult GetStyle(nsIDOMCSSStyleDeclaration** aStyle);
virtual void RecompileScriptEventListeners();
protected:
nsXULElement(nsINodeInfo* aNodeInfo);
virtual ~nsXULElement(void);