Bug 562698 - Part b: Pass Elements to nsNodeUtils::AttributeChanged; r=bzbarsky, a=dbaron

This commit is contained in:
Ms2ger 2010-08-10 14:25:36 +02:00
parent e0dc6046da
commit 323b15cea8
5 changed files with 12 additions and 11 deletions

View File

@ -117,12 +117,11 @@ nsNodeUtils::AttributeWillChange(nsIContent* aContent,
}
void
nsNodeUtils::AttributeChanged(nsIContent* aContent,
nsNodeUtils::AttributeChanged(Element* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType)
{
Element* aElement = aContent->AsElement();
nsIDocument* doc = aElement->GetOwnerDoc();
IMPL_MUTATION_NOTIFICATION(AttributeChanged, aElement,
(doc, aElement, aNameSpaceID, aAttribute,

View File

@ -85,13 +85,13 @@ public:
/**
* Send AttributeChanged notifications to nsIMutationObservers.
* @param aContent Node whose data changed
* @param aElement Element whose data changed
* @param aNameSpaceID Namespace of changed attribute
* @param aAttribute Local-name of changed attribute
* @param aModType Type of change (add/change/removal)
* @see nsIMutationObserver::AttributeChanged
*/
static void AttributeChanged(nsIContent* aContent,
static void AttributeChanged(mozilla::dom::Element* aElement,
PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);

View File

@ -1,6 +1,5 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -70,7 +69,7 @@
#include "nsCSSAnonBoxes.h"
#include "nsAutoPtr.h"
#include "nsStyleSet.h"
#include "nsIContent.h"
#include "mozilla/dom/Element.h"
#include "nsDisplayList.h"
#include "nsNodeUtils.h"
#include "mozAutoDocUpdate.h"
@ -270,7 +269,7 @@ nsHTMLFramesetFrame::FrameResizePrefCallback(const char* aPref, void* aClosure)
frame->RecalculateBorderResize();
if (doc) {
nsNodeUtils::AttributeChanged(frame->GetContent(),
nsNodeUtils::AttributeChanged(frame->GetContent()->AsElement(),
kNameSpaceID_None,
nsGkAtoms::frameborder,
nsIDOMMutationEvent::MODIFICATION);

View File

@ -61,11 +61,14 @@
#include "nsIFormProcessor.h"
#include "nsIServiceManager.h"
#include "nsEscape.h"
#include "mozilla/dom/Element.h"
#ifdef MOZ_SVG
#include "nsHtml5SVGLoadDispatcher.h"
#endif
namespace dom = mozilla::dom;
static NS_DEFINE_CID(kFormProcessorCID, NS_FORMPROCESSOR_CID);
/**
@ -313,7 +316,7 @@ nsHtml5TreeOperation::Perform(nsHtml5TreeOpExecutor* aBuilder,
return AppendToDocument(node, aBuilder);
}
case eTreeOpAddAttributes: {
nsIContent* node = *(mOne.node);
dom::Element* node = (*(mOne.node))->AsElement();
nsHtml5HtmlAttributes* attributes = mTwo.attributes;
nsHtml5OtherDocUpdate update(node->GetOwnerDoc(),

View File

@ -38,11 +38,11 @@
#ifndef nsHtml5TreeOperation_h__
#define nsHtml5TreeOperation_h__
#include "nsIContent.h"
#include "nsHtml5DocumentMode.h"
#include "nsHtml5HtmlAttributes.h"
#include "nsXPCOMStrings.h"
class nsIContent;
class nsHtml5TreeOpExecutor;
class nsHtml5StateSnapshot;