diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index 9420341ac110..aeef0026a68d 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -45,7 +45,6 @@ #include "nsIDocShell.h" #include "nsIDocShellTreeItem.h" #include "nsIDocument.h" -#include "nsIStyledContent.h" #include "nsIDOMAttr.h" #include "nsIDOMCharacterData.h" #include "nsIDOMDocument.h" @@ -734,8 +733,7 @@ NS_IMPL_NSIDOCUMENTOBSERVER_REFLOW_STUB(nsDocAccessible) NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(nsDocAccessible) void -nsDocAccessible::AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, +nsDocAccessible::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { diff --git a/caps/src/Makefile.in b/caps/src/Makefile.in index 5ffe73e80dd6..86d31e8afbf1 100644 --- a/caps/src/Makefile.in +++ b/caps/src/Makefile.in @@ -66,6 +66,7 @@ REQUIRES = xpcom \ docshell \ windowwatcher \ content \ + layout \ $(NULL) CPPSRCS = \ diff --git a/content/base/public/Makefile.in b/content/base/public/Makefile.in index e6ce6d8247bc..d48a6ff28048 100644 --- a/content/base/public/Makefile.in +++ b/content/base/public/Makefile.in @@ -60,7 +60,6 @@ nsINameSpaceManager.h \ nsINodeInfo.h \ nsIRangeUtils.h \ nsIScriptElement.h \ -nsIStyledContent.h \ nsIStyleSheetLinkingElement.h \ nsITextContent.h \ nsIPrivateDOMImplementation.h \ diff --git a/content/base/public/nsIContent.h b/content/base/public/nsIContent.h index e3ff3e2256e6..a3e0e139aa1f 100644 --- a/content/base/public/nsIContent.h +++ b/content/base/public/nsIContent.h @@ -46,6 +46,7 @@ #include "nsPropertyTable.h" #include "nsCaseTreatment.h" #include "nsINodeInfo.h" +#include "nsChangeHint.h" // Forward declarations class nsIAtom; @@ -58,11 +59,14 @@ class nsISupportsArray; class nsIDOMRange; class nsIEventListenerManager; class nsIURI; +class nsICSSStyleRule; +class nsRuleWalker; +class nsAttrValue; // IID for the nsIContent interface #define NS_ICONTENT_IID \ -{ 0xe5417db2, 0xfc59, 0x4b43, \ - { 0x8c, 0x9a, 0xed, 0xc3, 0x17, 0x3a, 0x85, 0x40 } } +{ 0x08b87f67, 0x2f64, 0x437b, \ + { 0x93, 0x35, 0x02, 0x60, 0x17, 0x5c, 0x0e, 0xc2 } } /** * A node of content in a document's content model. This interface @@ -762,6 +766,64 @@ public: virtual nsresult CloneContent(nsNodeInfoManager *aNodeInfoManager, PRBool aDeep, nsIContent **aResult) const = 0; + /** + * Get the ID of this content node (the atom corresponding to the + * value of the null-namespace attribute whose name is given by + * GetIDAttributeName(). This may be null if there is no ID. + */ + virtual nsIAtom* GetID() const = 0; + + /** + * Get the class list of this content node (this corresponds to the + * value of the null-namespace attribute whose name is given by + * GetClassAttributeName(). This may be null if there are no + * classes, but that's not guaranteed. + */ + virtual const nsAttrValue* GetClasses() const = 0; + + /** + * Walk aRuleWalker over the content style rules (presentational + * hint rules) for this content node. + */ + NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) = 0; + + /** + * Get the inline style rule, if any, for this content node + */ + virtual nsICSSStyleRule* GetInlineStyleRule() = 0; + + /** + * Set the inline style rule for this node. This will send an + * appropriate AttributeChanged notification if aNotify is true. + */ + NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify) = 0; + + /** + * Is the attribute named stored in the mapped attributes? + * + * // XXXbz we use this method in HasAttributeDependentStyle, so svg + * returns true here even though it stores nothing in the mapped + * attributes. + */ + NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const = 0; + + /** + * Get a hint that tells the style system what to do when + * an attribute on this node changes, if something needs to happen + * in response to the change *other* than the result of what is + * mapped into style data via any type of style rule. + */ + virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute, + PRInt32 aModType) const = 0; + + /** + * Returns an atom holding the name of the "class" attribute on this + * content node (if applicable). Returns null if there is no + * "class" attribute for this type of content node. + */ + virtual nsIAtom *GetClassAttributeName() const = 0; + + #ifdef DEBUG /** * List the content (and anything it contains) out to the given diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 0df03915ca1f..6eda978e43ac 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -57,7 +57,6 @@ #include "nsIAtom.h" class nsIContent; -class nsIStyledContent; class nsPresContext; class nsIPresShell; @@ -511,7 +510,7 @@ public: virtual void AttributeWillChange(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute) = 0; - virtual void AttributeChanged(nsIStyledContent* aChild, + virtual void AttributeChanged(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) = 0; diff --git a/content/base/public/nsIDocumentObserver.h b/content/base/public/nsIDocumentObserver.h index 127e52d08c5f..ada540e82f4c 100644 --- a/content/base/public/nsIDocumentObserver.h +++ b/content/base/public/nsIDocumentObserver.h @@ -41,7 +41,6 @@ class nsIAtom; class nsIContent; -class nsIStyledContent; class nsIPresShell; class nsIStyleSheet; class nsIStyleRule; @@ -161,11 +160,11 @@ public: * @param aModType Whether or not the attribute was added, changed, or removed. * The constants are defined in nsIDOMMutationEvent.h. */ - virtual void AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType) = 0; + virtual void AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) = 0; /** * Notifcation that the content model has had data appended to the @@ -350,7 +349,7 @@ public: nsIContent* aContent2, \ PRInt32 aStateMask); \ virtual void AttributeChanged(nsIDocument* aDocument, \ - nsIStyledContent* aContent, \ + nsIContent* aContent, \ PRInt32 aNameSpaceID, \ nsIAtom* aAttribute, \ PRInt32 aModType); \ @@ -441,7 +440,7 @@ _class::CharacterDataChanged(nsIDocument* aDocument, \ } \ void \ _class::AttributeChanged(nsIDocument* aDocument, \ - nsIStyledContent* aContent, \ + nsIContent* aContent, \ PRInt32 aNameSpaceID, \ nsIAtom* aAttribute, \ PRInt32 aModType) \ diff --git a/content/base/public/nsIStyledContent.h b/content/base/public/nsIStyledContent.h deleted file mode 100644 index 39784db48172..000000000000 --- a/content/base/public/nsIStyledContent.h +++ /dev/null @@ -1,105 +0,0 @@ -/* -*- 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 - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ -#ifndef nsIStyledContent_h___ -#define nsIStyledContent_h___ - -#include "nsIContent.h" -#include "nsChangeHint.h" - -class nsString; -class nsICSSStyleRule; -class nsISupportsArray; -class nsRuleWalker; -class nsAttrValue; - -// IID for the nsIStyledContent class -// b3edce42-2a58-4b05-a679-eae3ddbd1edd -#define NS_ISTYLEDCONTENT_IID \ -{ 0xb3edc342, 0x2a58, 0x4b05, \ - { 0xa6, 0x79, 0xea, 0xe3, 0xdd, 0xbd, 0x1e, 0xdd } } - -// Abstract interface for all styled content (that supports ID, CLASS, STYLE, and -// the ability to specify style hints on an attribute change). -class nsIStyledContent : public nsIContent { -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTYLEDCONTENT_IID) - - nsIStyledContent(nsINodeInfo *aNodeInfo) - : nsIContent(aNodeInfo) - { - } - - // XXX Currently callers (e.g., CSSStyleSheetImpl) assume that the ID - // corresponds to the attribute nsHTMLAtoms::id and that the Class - // corresponds to the attribute nsHTMLAtoms::kClass. If this becomes - // incorrect, then new methods need to be added here. - virtual nsIAtom* GetID() const = 0; - virtual const nsAttrValue* GetClasses() const = 0; - - NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) = 0; - - virtual nsICSSStyleRule* GetInlineStyleRule() = 0; - NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify) = 0; - - /** - * Is the attribute named stored in the mapped attributes? - * - * This really belongs on nsIHTMLContent instead. - */ - NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const = 0; - - - /** - * Get a hint that tells the style system what to do when - * an attribute on this node changes, if something needs to happen - * in response to the change *other* than the result of what is - * mapped into style data via any type of style rule. - */ - virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute, - PRInt32 aModType) const = 0; - - - /** - * Returns an atom holding the name of the "class" attribute on this - * content node (if applicable). Returns null for non-element - * content nodes. - */ - virtual nsIAtom *GetClassAttributeName() const = 0; - -}; - -#endif /* nsIStyledContent_h___ */ diff --git a/content/base/src/nsContentList.cpp b/content/base/src/nsContentList.cpp index cc4b521a92a9..85ffef55085a 100644 --- a/content/base/src/nsContentList.cpp +++ b/content/base/src/nsContentList.cpp @@ -37,7 +37,6 @@ #include "nsContentList.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsIDOMNode.h" #include "nsIDOM3Node.h" #include "nsIDocument.h" @@ -526,8 +525,7 @@ nsContentList::NamedItem(const nsAString& aName, nsIDOMNode** aReturn) } void -nsContentList::AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, +nsContentList::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { diff --git a/content/base/src/nsContentList.h b/content/base/src/nsContentList.h index d660ae6f0c3f..4160e660f8ee 100644 --- a/content/base/src/nsContentList.h +++ b/content/base/src/nsContentList.h @@ -196,8 +196,7 @@ public: // nsIDocumentObserver - virtual void AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void ContentAppended(nsIDocument *aDocument, nsIContent* aContainer, diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index 04f9b05dd46b..37a994d4519c 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -138,7 +138,6 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID); #include "nsDateTimeFormatCID.h" #include "nsIDateTimeFormat.h" #include "nsIComponentRegistrar.h" -#include "nsIStyledContent.h" static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID); static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID); @@ -2357,15 +2356,10 @@ nsDocument::AttributeWillChange(nsIContent* aChild, PRInt32 aNameSpaceID, } void -nsDocument::AttributeChanged(nsIStyledContent* aChild, PRInt32 aNameSpaceID, +nsDocument::AttributeChanged(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { NS_ABORT_IF_FALSE(aChild, "Null child!"); - -#ifdef DEBUG - nsCOMPtr debugContent(do_QueryInterface(aChild)); - NS_ASSERTION(debugContent == aChild, "nsIContent pointer mismatch?"); -#endif PRInt32 i; for (i = mObservers.Count() - 1; i >= 0; --i) { diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index 4ea65334408c..3a20331c7c46 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -488,7 +488,7 @@ public: virtual void AttributeWillChange(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute); - virtual void AttributeChanged(nsIStyledContent* aChild, + virtual void AttributeChanged(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); diff --git a/content/base/src/nsGenericDOMDataNode.cpp b/content/base/src/nsGenericDOMDataNode.cpp index c0794a0f6a5a..0ec16faea46c 100644 --- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -55,6 +55,7 @@ #include "nsDOMString.h" #include "nsLayoutAtoms.h" #include "nsIDOMUserDataHandler.h" +#include "nsChangeHint.h" #include "pldhash.h" #include "prprf.h" @@ -1402,3 +1403,55 @@ nsGenericDOMDataNode::CloneContent(nsNodeInfoManager *aNodeInfoManager, return NS_OK; } + +nsIAtom* +nsGenericDOMDataNode::GetID() const +{ + return nsnull; +} + +const nsAttrValue* +nsGenericDOMDataNode::GetClasses() const +{ + return nsnull; +} + +NS_IMETHODIMP +nsGenericDOMDataNode::WalkContentStyleRules(nsRuleWalker* aRuleWalker) +{ + return NS_OK; +} + +nsICSSStyleRule* +nsGenericDOMDataNode::GetInlineStyleRule() +{ + return nsnull; +} + +NS_IMETHODIMP +nsGenericDOMDataNode::SetInlineStyleRule(nsICSSStyleRule* aStyleRule, + PRBool aNotify) +{ + NS_NOTREACHED("How come we're setting inline style on a non-element?"); + return NS_ERROR_UNEXPECTED; +} + +NS_IMETHODIMP_(PRBool) +nsGenericDOMDataNode::IsAttributeMapped(const nsIAtom* aAttribute) const +{ + return PR_FALSE; +} + +nsChangeHint +nsGenericDOMDataNode::GetAttributeChangeHint(const nsIAtom* aAttribute, + PRInt32 aModType) const +{ + NS_NOTREACHED("Shouldn't be calling this!"); + return nsChangeHint(0); +} + +nsIAtom* +nsGenericDOMDataNode::GetClassAttributeName() const +{ + return nsnull; +} diff --git a/content/base/src/nsGenericDOMDataNode.h b/content/base/src/nsGenericDOMDataNode.h index 1410084e8f77..de80b77ce15e 100644 --- a/content/base/src/nsGenericDOMDataNode.h +++ b/content/base/src/nsGenericDOMDataNode.h @@ -237,8 +237,19 @@ public: * This calls Clone to do the actual cloning so that we end up with the * right class for the clone. */ - nsresult CloneContent(nsNodeInfoManager *aNodeInfoManager, PRBool aDeep, - nsIContent **aResult) const; + virtual nsresult CloneContent(nsNodeInfoManager *aNodeInfoManager, + PRBool aDeep, nsIContent **aResult) const; + + virtual nsIAtom* GetID() const; + virtual const nsAttrValue* GetClasses() const; + NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); + virtual nsICSSStyleRule* GetInlineStyleRule(); + NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify); + NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; + virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute, + PRInt32 aModType) const; + virtual nsIAtom *GetClassAttributeName() const; + // nsITextContent virtual const nsTextFragment *Text(); diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 6f5ca818bba2..c00d02ee504f 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -3709,7 +3709,6 @@ nsGenericElement::RemoveChild(nsIDOMNode *aOldChild, nsIDOMNode **aReturn) NS_INTERFACE_MAP_BEGIN(nsGenericElement) NS_INTERFACE_MAP_ENTRY(nsIContent) - NS_INTERFACE_MAP_ENTRY(nsIStyledContent) NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOM3Node, new nsNode3Tearoff(this)) NS_INTERFACE_MAP_ENTRY_TEAROFF(nsIDOMEventReceiver, nsDOMEventRTTearoff::Create(this)) diff --git a/content/base/src/nsGenericElement.h b/content/base/src/nsGenericElement.h index d86bec8706b6..456828052028 100644 --- a/content/base/src/nsGenericElement.h +++ b/content/base/src/nsGenericElement.h @@ -447,7 +447,6 @@ public: virtual void DumpContent(FILE* out, PRInt32 aIndent,PRBool aDumpAll) const; #endif - // nsIStyledContent interface methods virtual nsIAtom* GetID() const; virtual const nsAttrValue* GetClasses() const; NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); diff --git a/content/events/src/nsXMLEventsManager.cpp b/content/events/src/nsXMLEventsManager.cpp index 2d1606188699..1ed276521574 100644 --- a/content/events/src/nsXMLEventsManager.cpp +++ b/content/events/src/nsXMLEventsManager.cpp @@ -42,13 +42,11 @@ #include "nsIDOMElement.h" #include "nsIDOMDocument.h" #include "nsIDOMEventReceiver.h" -#include "nsIStyledContent.h" #include "nsNetUtil.h" #include "nsIURL.h" #include "nsIDOMEventListener.h" #include "nsINameSpaceManager.h" #include "nsINodeInfo.h" -#include "nsIStyledContent.h" #include "nsLayoutAtoms.h" PRBool nsXMLEventsListener::InitXMLEventsListener(nsIDocument * aDocument, @@ -231,7 +229,7 @@ nsXMLEventsListener::HandleEvent(nsIDOMEvent* aEvent) targetMatched = PR_FALSE; nsCOMPtr target; aEvent->GetTarget(getter_AddRefs(target)); - nsCOMPtr targetEl(do_QueryInterface(target)); + nsCOMPtr targetEl(do_QueryInterface(target)); if (targetEl && targetEl->GetID() == mTarget) targetMatched = PR_TRUE; } @@ -357,7 +355,7 @@ nsXMLEventsManager::CharacterDataChanged(nsIDocument* aDocument, PRBool aAppend) {} void nsXMLEventsManager::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/content/html/content/src/nsGenericHTMLElement.h b/content/html/content/src/nsGenericHTMLElement.h index 79c12a2c4585..134250f76fd2 100644 --- a/content/html/content/src/nsGenericHTMLElement.h +++ b/content/html/content/src/nsGenericHTMLElement.h @@ -237,7 +237,6 @@ public: } virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const; - // Implementation for nsIStyledContent virtual const nsAttrValue* GetClasses() const; virtual nsIAtom *GetIDAttributeName() const; virtual nsIAtom *GetClassAttributeName() const; diff --git a/content/html/content/src/nsHTMLTableCellElement.cpp b/content/html/content/src/nsHTMLTableCellElement.cpp index 5cec9f39f0a8..364623e67045 100644 --- a/content/html/content/src/nsHTMLTableCellElement.cpp +++ b/content/html/content/src/nsHTMLTableCellElement.cpp @@ -201,9 +201,9 @@ nsHTMLTableCellElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) // contract. However, things are OK (except for the incorrect // dependence on display type rather than tag) since tables and cells // match different, less specific, rules. - nsCOMPtr styledTable = do_QueryInterface(GetTable()); - if (styledTable) { - rv = styledTable->WalkContentStyleRules(aRuleWalker); + nsIContent* table = GetTable(); + if (table) { + rv = table->WalkContentStyleRules(aRuleWalker); } return rv; diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index 29ba4864bc8c..62a04b88fce7 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -129,7 +129,6 @@ #include "nsIEditingSession.h" #include "nsNodeInfoManager.h" -#include "nsIStyledContent.h" #define DETECTOR_CONTRACTID_MAX 127 static char g_detector_contractid[DETECTOR_CONTRACTID_MAX + 1]; @@ -1163,8 +1162,7 @@ nsHTMLDocument::AttributeWillChange(nsIContent* aContent, PRInt32 aNameSpaceID, } void -nsHTMLDocument::AttributeChanged(nsIStyledContent* aContent, - PRInt32 aNameSpaceID, +nsHTMLDocument::AttributeChanged(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { NS_ABORT_IF_FALSE(aContent, "Null content!"); diff --git a/content/html/document/src/nsHTMLDocument.h b/content/html/document/src/nsHTMLDocument.h index cff3e9f57a97..eb7edce8ec13 100644 --- a/content/html/document/src/nsHTMLDocument.h +++ b/content/html/document/src/nsHTMLDocument.h @@ -126,7 +126,7 @@ public: virtual void ContentRemoved(nsIContent* aContainer, nsIContent* aChild, PRInt32 aIndexInContainer); - virtual void AttributeChanged(nsIStyledContent* aChild, + virtual void AttributeChanged(nsIContent* aChild, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); diff --git a/content/svg/content/src/nsSVGDefsElement.cpp b/content/svg/content/src/nsSVGDefsElement.cpp index 8358f4722e6a..a5bdbcf79c4a 100644 --- a/content/svg/content/src/nsSVGDefsElement.cpp +++ b/content/svg/content/src/nsSVGDefsElement.cpp @@ -62,7 +62,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGDefsElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGDefsElementBase::) - // nsIStyledContent + // nsIContent NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: }; @@ -109,7 +109,7 @@ NS_IMPL_DOM_CLONENODE_WITH_INIT(nsSVGDefsElement) //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGDefsElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGElement.cpp b/content/svg/content/src/nsSVGElement.cpp index 57f55329e8b0..81a16513b616 100644 --- a/content/svg/content/src/nsSVGElement.cpp +++ b/content/svg/content/src/nsSVGElement.cpp @@ -93,7 +93,6 @@ NS_INTERFACE_MAP_BEGIN(nsSVGElement) NS_INTERFACE_MAP_ENTRY(nsISVGValueObserver) NS_INTERFACE_MAP_ENTRY(nsISVGContent) // provided by nsGenericElement: -// NS_INTERFACE_MAP_ENTRY(nsIStyledContent) // NS_INTERFACE_MAP_ENTRY(nsIContent) NS_INTERFACE_MAP_END_INHERITING(nsGenericElement) @@ -239,9 +238,6 @@ nsSVGElement::IsContentOfType(PRUint32 aFlags) const return !(aFlags & ~(eELEMENT | eSVG)); } -//---------------------------------------------------------------------- -// nsIStyledContent methods - NS_IMETHODIMP nsSVGElement::WalkContentStyleRules(nsRuleWalker* aRuleWalker) { diff --git a/content/svg/content/src/nsSVGElement.h b/content/svg/content/src/nsSVGElement.h index 5d1de2399cce..fb78f96b8cf8 100644 --- a/content/svg/content/src/nsSVGElement.h +++ b/content/svg/content/src/nsSVGElement.h @@ -54,7 +54,7 @@ #include "nsISVGContent.h" #include "nsICSSStyleRule.h" -class nsSVGElement : public nsGenericElement, // :nsIXMLContent:nsIStyledContent:nsIContent +class nsSVGElement : public nsGenericElement, // :nsIXMLContent:nsIContent public nsISVGValueObserver, public nsSupportsWeakReference, // :nsISupportsWeakReference public nsISVGContent diff --git a/content/svg/content/src/nsSVGGElement.cpp b/content/svg/content/src/nsSVGGElement.cpp index c9a74c03018a..51ced7bbef02 100644 --- a/content/svg/content/src/nsSVGGElement.cpp +++ b/content/svg/content/src/nsSVGGElement.cpp @@ -62,7 +62,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGGElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGGElementBase::) - // nsIStyledContent + // nsIContent NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: }; @@ -110,7 +110,7 @@ NS_IMPL_DOM_CLONENODE_WITH_INIT(nsSVGGElement) //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGGElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGGradientElement.cpp b/content/svg/content/src/nsSVGGradientElement.cpp index 8a496f8441ea..a50b10a5a31a 100644 --- a/content/svg/content/src/nsSVGGradientElement.cpp +++ b/content/svg/content/src/nsSVGGradientElement.cpp @@ -76,7 +76,7 @@ public: // nsISVGContent specializations: virtual void ParentChainChanged(); - // nsIStyledContent + // nsIContent NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: @@ -238,7 +238,7 @@ void nsSVGGradientElement::ParentChainChanged() } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGGradientElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGGraphicElement.cpp b/content/svg/content/src/nsSVGGraphicElement.cpp index 11b41e17ab33..8a86d14d151e 100644 --- a/content/svg/content/src/nsSVGGraphicElement.cpp +++ b/content/svg/content/src/nsSVGGraphicElement.cpp @@ -123,14 +123,13 @@ NS_IMETHODIMP nsSVGGraphicElement::GetBBox(nsIDOMSVGRect **_retval) NS_ASSERTION(presShell, "no presShell"); if (!presShell) return NS_ERROR_FAILURE; - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); NS_ASSERTION(frame, "can't get bounding box for element without frame"); if (frame) { nsISVGChildFrame* svgframe; - frame->QueryInterface(NS_GET_IID(nsISVGChildFrame),(void**)&svgframe); + CallQueryInterface(frame, &svgframe); NS_ASSERTION(svgframe, "wrong frame type"); if (svgframe) { svgframe->SetMatrixPropagation(PR_FALSE); @@ -277,7 +276,7 @@ NS_IMETHODIMP nsSVGGraphicElement::GetTransform(nsIDOMSVGAnimatedTransformList * //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGGraphicElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGGraphicElement.h b/content/svg/content/src/nsSVGGraphicElement.h index 7e1c5f6c5ed5..6c2b620574fc 100644 --- a/content/svg/content/src/nsSVGGraphicElement.h +++ b/content/svg/content/src/nsSVGGraphicElement.h @@ -59,7 +59,7 @@ public: NS_DECL_NSIDOMSVGLOCATABLE NS_DECL_NSIDOMSVGTRANSFORMABLE - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: diff --git a/content/svg/content/src/nsSVGLineElement.cpp b/content/svg/content/src/nsSVGLineElement.cpp index 79959de28ce4..545d0c01980c 100644 --- a/content/svg/content/src/nsSVGLineElement.cpp +++ b/content/svg/content/src/nsSVGLineElement.cpp @@ -72,7 +72,7 @@ public: // nsISVGContent specializations: virtual void ParentChainChanged(); - // nsIStyledContent interface + // nsIContent interface NS_IMETHODIMP_(PRBool) IsAttributeMapped(const nsIAtom* name) const; protected: @@ -275,7 +275,7 @@ void nsSVGLineElement::ParentChainChanged() } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGLineElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGPathElement.cpp b/content/svg/content/src/nsSVGPathElement.cpp index dfe8067e2f36..1e0d61c9f198 100644 --- a/content/svg/content/src/nsSVGPathElement.cpp +++ b/content/svg/content/src/nsSVGPathElement.cpp @@ -73,7 +73,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGPathElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPathElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHODIMP_(PRBool) IsAttributeMapped(const nsIAtom* name) const; protected: @@ -348,7 +348,7 @@ NS_IMETHODIMP nsSVGPathElement::GetAnimatedNormalizedPathSegList(nsIDOMSVGPathSe } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGPathElement::IsAttributeMapped(const nsIAtom* name) const @@ -379,9 +379,7 @@ nsSVGPathElement::GetPathFlatten() return nsnull; } - nsIFrame* frame; - frame = presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, - this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); if (!frame) { NS_ERROR("no frame"); @@ -389,7 +387,7 @@ nsSVGPathElement::GetPathFlatten() } nsISVGPathFlatten* flattener; - frame->QueryInterface(NS_GET_IID(nsISVGPathFlatten),(void**)&flattener); + CallQueryInterface(frame, &flattener); NS_ASSERTION(flattener, "wrong frame type"); return flattener; } diff --git a/content/svg/content/src/nsSVGPolygonElement.cpp b/content/svg/content/src/nsSVGPolygonElement.cpp index aae2f073ac28..e52237fd4553 100644 --- a/content/svg/content/src/nsSVGPolygonElement.cpp +++ b/content/svg/content/src/nsSVGPolygonElement.cpp @@ -68,7 +68,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGPolygonElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPolygonElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHODIMP_(PRBool) IsAttributeMapped(const nsIAtom* name) const; protected: @@ -152,7 +152,7 @@ NS_IMETHODIMP nsSVGPolygonElement::GetAnimatedPoints(nsIDOMSVGPointList * *aAnim } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGPolygonElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGPolylineElement.cpp b/content/svg/content/src/nsSVGPolylineElement.cpp index 59c431655da0..363b8010a8f8 100644 --- a/content/svg/content/src/nsSVGPolylineElement.cpp +++ b/content/svg/content/src/nsSVGPolylineElement.cpp @@ -68,7 +68,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGPolylineElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGPolylineElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHODIMP_(PRBool) IsAttributeMapped(const nsIAtom* name) const; protected: @@ -152,7 +152,7 @@ NS_IMETHODIMP nsSVGPolylineElement::GetAnimatedPoints(nsIDOMSVGPointList * *aAni } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGPolylineElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGSVGElement.cpp b/content/svg/content/src/nsSVGSVGElement.cpp index ee40597ee7d1..dc98b7963943 100644 --- a/content/svg/content/src/nsSVGSVGElement.cpp +++ b/content/svg/content/src/nsSVGSVGElement.cpp @@ -112,7 +112,7 @@ public: NS_IMETHOD_(float) GetPreviousTranslate_y(); NS_IMETHOD_(float) GetPreviousScale(); - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; // nsISVGValueObserver @@ -538,8 +538,7 @@ nsSVGSVGElement::SuspendRedraw(PRUint32 max_wait_milliseconds, PRUint32 *_retval NS_ASSERTION(presShell, "need presShell to suspend redraw"); if (!presShell) return NS_ERROR_FAILURE; - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); #ifdef DEBUG // XXX We sometimes hit this assertion when the svg:svg element is // in a binding and svg children are inserted underneath it using @@ -590,8 +589,7 @@ nsSVGSVGElement::UnsuspendRedrawAll() NS_ASSERTION(presShell, "need presShell to unsuspend redraw"); if (!presShell) return NS_ERROR_FAILURE; - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); #ifdef DEBUG NS_ASSERTION(frame, "unsuspending redraw w/o frame"); #endif @@ -984,8 +982,7 @@ nsSVGSVGElement::GetBBox(nsIDOMSVGRect **_retval) NS_ASSERTION(presShell, "no presShell"); if (!presShell) return NS_ERROR_FAILURE; - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); NS_ASSERTION(frame, "can't get bounding box for element without frame"); @@ -1428,7 +1425,7 @@ nsSVGSVGElement::GetPreviousScale() } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGSVGElement::IsAttributeMapped(const nsIAtom* name) const @@ -1519,8 +1516,7 @@ nsSVGSVGElement::DidModifySVGObservable (nsISVGValue* observable, // invalidate viewbox -> viewport xform & inform frames mViewBoxToViewportTransform = nsnull; - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); if (frame) { nsISVGSVGFrame* svgframe; CallQueryInterface(frame, &svgframe); diff --git a/content/svg/content/src/nsSVGStopElement.cpp b/content/svg/content/src/nsSVGStopElement.cpp index 33201a633dbb..2fc5b83cdcee 100644 --- a/content/svg/content/src/nsSVGStopElement.cpp +++ b/content/svg/content/src/nsSVGStopElement.cpp @@ -69,7 +69,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGStopElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGStopElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: @@ -144,7 +144,7 @@ NS_IMETHODIMP nsSVGStopElement::GetOffset(nsIDOMSVGAnimatedNumber * *aOffset) } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGStopElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGStylableElement.cpp b/content/svg/content/src/nsSVGStylableElement.cpp index cc16bc5a0451..82db2c8326aa 100644 --- a/content/svg/content/src/nsSVGStylableElement.cpp +++ b/content/svg/content/src/nsSVGStylableElement.cpp @@ -84,7 +84,7 @@ nsSVGStylableElement::Init() } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods const nsAttrValue* nsSVGStylableElement::GetClasses() const diff --git a/content/svg/content/src/nsSVGStylableElement.h b/content/svg/content/src/nsSVGStylableElement.h index d11f81c2933f..b7ed178f2fae 100644 --- a/content/svg/content/src/nsSVGStylableElement.h +++ b/content/svg/content/src/nsSVGStylableElement.h @@ -59,7 +59,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIDOMSVGSTYLABLE - // nsIStyledContent + // nsIContent virtual const nsAttrValue* GetClasses() const; protected: diff --git a/content/svg/content/src/nsSVGTSpanElement.cpp b/content/svg/content/src/nsSVGTSpanElement.cpp index dbf07a5ea9a6..3f4f768d9da7 100644 --- a/content/svg/content/src/nsSVGTSpanElement.cpp +++ b/content/svg/content/src/nsSVGTSpanElement.cpp @@ -72,7 +72,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGTSpanElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGTSpanElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; // nsISVGContent specializations: @@ -328,7 +328,7 @@ NS_IMETHODIMP nsSVGTSpanElement::SelectSubString(PRUint32 charnum, PRUint32 ncha } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGTSpanElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/svg/content/src/nsSVGTextElement.cpp b/content/svg/content/src/nsSVGTextElement.cpp index 08492c120fd2..5c95b110c11c 100644 --- a/content/svg/content/src/nsSVGTextElement.cpp +++ b/content/svg/content/src/nsSVGTextElement.cpp @@ -76,7 +76,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGTextElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGTextElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; // nsISVGContent specializations: @@ -337,7 +337,7 @@ NS_IMETHODIMP nsSVGTextElement::SelectSubString(PRUint32 charnum, PRUint32 nchar } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGTextElement::IsAttributeMapped(const nsIAtom* name) const @@ -427,8 +427,7 @@ nsSVGTextElement::GetTextContentMetrics() return nsnull; } - nsIFrame* frame = - presShell->GetPrimaryFrameFor(NS_STATIC_CAST(nsIStyledContent*, this)); + nsIFrame* frame = presShell->GetPrimaryFrameFor(this); if (!frame) { NS_ERROR("no frame"); @@ -436,7 +435,7 @@ nsSVGTextElement::GetTextContentMetrics() } nsISVGTextContentMetrics* metrics; - frame->QueryInterface(NS_GET_IID(nsISVGTextContentMetrics),(void**)&metrics); + CallQueryInterface(frame, &metrics); NS_ASSERTION(metrics, "wrong frame type"); return metrics; } diff --git a/content/svg/content/src/nsSVGTextPathElement.cpp b/content/svg/content/src/nsSVGTextPathElement.cpp index c1b9bd8efec5..c14c7565ea27 100644 --- a/content/svg/content/src/nsSVGTextPathElement.cpp +++ b/content/svg/content/src/nsSVGTextPathElement.cpp @@ -72,7 +72,7 @@ public: NS_FORWARD_NSIDOMELEMENT(nsSVGTextPathElementBase::) NS_FORWARD_NSIDOMSVGELEMENT(nsSVGTextPathElementBase::) - // nsIStyledContent interface + // nsIContent interface NS_IMETHOD_(PRBool) IsAttributeMapped(const nsIAtom* aAttribute) const; protected: @@ -315,7 +315,7 @@ NS_IMETHODIMP nsSVGTextPathElement::SelectSubString(PRUint32 charnum, PRUint32 n } //---------------------------------------------------------------------- -// nsIStyledContent methods +// nsIContent methods NS_IMETHODIMP_(PRBool) nsSVGTextPathElement::IsAttributeMapped(const nsIAtom* name) const diff --git a/content/xml/content/public/nsIXMLContent.h b/content/xml/content/public/nsIXMLContent.h index 46a162e20773..626282bcaa69 100644 --- a/content/xml/content/public/nsIXMLContent.h +++ b/content/xml/content/public/nsIXMLContent.h @@ -40,24 +40,25 @@ #define nsIXMLContent_h___ #include "nsISupports.h" -#include "nsIStyledContent.h" +#include "nsIContent.h" class nsIDocShell; -// 37eff125-80a9-49ce-a0f7-1617a21ce745 +// 226f10b8-2954-405a-b5e7-446a4fce4bf8 #define NS_IXMLCONTENT_IID \ - { 0x37eff125, 0x80a9, 0x49ce, \ - { 0xa0, 0xf7, 0x16, 0x17, 0xa2, 0x1c, 0xe7, 0x45 } } + { 0x226f10b8, 0x2954, 0x405a, \ + { 0xb5, 0xe7, 0x44, 0x6a, 0x4f, 0xce, 0x4b, 0xf8 } } /** * XML content extensions to nsIContent + * // XXXbz this interface should die, really. */ -class nsIXMLContent : public nsIStyledContent { +class nsIXMLContent : public nsIContent { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_IXMLCONTENT_IID) nsIXMLContent(nsINodeInfo *aNodeInfo) - : nsIStyledContent(aNodeInfo) + : nsIContent(aNodeInfo) { } diff --git a/content/xml/content/src/nsXMLElement.h b/content/xml/content/src/nsXMLElement.h index b36e48457ffd..0d5e713b6c87 100644 --- a/content/xml/content/src/nsXMLElement.h +++ b/content/xml/content/src/nsXMLElement.h @@ -44,7 +44,6 @@ #include "nsIDOMEventReceiver.h" #include "nsIXMLContent.h" #include "nsGenericElement.h" -#include "nsIStyledContent.h" class nsIEventListenerManager; class nsIURI; diff --git a/content/xml/document/src/nsXMLPrettyPrinter.cpp b/content/xml/document/src/nsXMLPrettyPrinter.cpp index d4c06be634bd..8f1f6958c792 100644 --- a/content/xml/document/src/nsXMLPrettyPrinter.cpp +++ b/content/xml/document/src/nsXMLPrettyPrinter.cpp @@ -54,7 +54,6 @@ #include "nsIServiceManager.h" #include "nsNetUtil.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsIDOMDocumentFragment.h" NS_IMPL_ISUPPORTS1(nsXMLPrettyPrinter, @@ -240,7 +239,7 @@ nsXMLPrettyPrinter::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) void nsXMLPrettyPrinter::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/content/xml/document/src/nsXMLPrettyPrinter.h b/content/xml/document/src/nsXMLPrettyPrinter.h index 1ca0137dffdb..356ee9807998 100644 --- a/content/xml/document/src/nsXMLPrettyPrinter.h +++ b/content/xml/document/src/nsXMLPrettyPrinter.h @@ -54,8 +54,7 @@ public: // nsIDocumentObserver virtual void BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType); virtual void EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType); - virtual void AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument* aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void ContentAppended(nsIDocument* aDocument, diff --git a/content/xtf/src/nsXTFElementWrapper.h b/content/xtf/src/nsXTFElementWrapper.h index e09d3b28f9dd..435cd43fc61f 100644 --- a/content/xtf/src/nsXTFElementWrapper.h +++ b/content/xtf/src/nsXTFElementWrapper.h @@ -156,7 +156,7 @@ class nsXTFStyledElementWrapper : public nsXTFElementWrapper public: nsXTFStyledElementWrapper(nsINodeInfo* aNodeInfo); - // for nsIStyledContent + // for nsIContent virtual nsIAtom *GetClassAttributeName() const; virtual const nsAttrValue* GetClasses() const; diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 0bfc5de6d77a..edd46b0a60ab 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -114,7 +114,6 @@ #include "nsIServiceManager.h" #include "nsICSSStyleRule.h" #include "nsIStyleSheet.h" -#include "nsIStyledContent.h" #include "nsIURL.h" #include "nsIViewManager.h" #include "nsIWidget.h" @@ -1055,7 +1054,7 @@ nsXULElement::RemoveChildAt(PRUint32 aIndex, PRBool aNotify) if (HasMutationListeners(this, NS_EVENT_BITS_MUTATION_NODEREMOVED)) { nsMutationEvent mutation(PR_TRUE, NS_MUTATION_NODEREMOVED, oldKid); mutation.mRelatedNode = - do_QueryInterface(NS_STATIC_CAST(nsIStyledContent*, this)); + do_QueryInterface(NS_STATIC_CAST(nsIContent*, this)); nsEventStatus status = nsEventStatus_eIgnore; oldKid->HandleDOMEvent(nsnull, &mutation, nsnull, NS_EVENT_FLAG_INIT, &status); @@ -2133,8 +2132,7 @@ nsXULElement::WillAddOrRemoveChild(nsIContent* aKid, return aRemove ? NS_OK : EnsureContentsGenerated(); } -// nsIStyledContent Implementation -/// XXX GetID must be defined here because nsXUL element does not inherit from nsGenericElement. +/// XXX GetID must be defined here because we have proto attrs. nsIAtom* nsXULElement::GetID() const { diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index f8213d0b92f1..ddc4d93c5f1a 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -65,7 +65,6 @@ #include "nsIRDFCompositeDataSource.h" #include "nsIRDFResource.h" #include "nsIScriptObjectOwner.h" -#include "nsIStyledContent.h" #include "nsIBindingManager.h" #include "nsIURI.h" #include "nsIXMLContent.h" @@ -517,14 +516,12 @@ public: virtual PRBool IsContentOfType(PRUint32 aFlags) const; virtual nsresult GetListenerManager(nsIEventListenerManager** aResult); virtual PRBool IsFocusable(PRInt32 *aTabIndex = nsnull); + virtual nsIAtom* GetID() const; + virtual const nsAttrValue* GetClasses() const; // nsIXMLContent NS_IMETHOD MaybeTriggerAutoLink(nsIDocShell *aShell); - // nsIStyledContent - virtual nsIAtom* GetID() const; - virtual const nsAttrValue* GetClasses() const; - NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker); virtual nsICSSStyleRule* GetInlineStyleRule(); NS_IMETHOD SetInlineStyleRule(nsICSSStyleRule* aStyleRule, PRBool aNotify); diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 10d75dd96f4d..7f9cd157ac54 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -117,7 +117,6 @@ #include "nsIParser.h" #include "nsICSSStyleSheet.h" #include "nsIScriptError.h" -#include "nsIStyledContent.h" //---------------------------------------------------------------------- // @@ -1071,15 +1070,9 @@ nsXULDocument::ExecuteOnBroadcastHandlerFor(nsIContent* aBroadcaster, } void -nsXULDocument::AttributeChanged(nsIStyledContent* aElement, - PRInt32 aNameSpaceID, +nsXULDocument::AttributeChanged(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) { -#ifdef DEBUG - nsCOMPtr debugContent(do_QueryInterface(aElement)); - NS_ASSERTION(debugContent == aElement, "nsIContent pointer mismatch?"); -#endif - nsresult rv; // XXXbz check aNameSpaceID, dammit! diff --git a/content/xul/document/src/nsXULDocument.h b/content/xul/document/src/nsXULDocument.h index 860d76ff9b05..b81b40549aa1 100644 --- a/content/xul/document/src/nsXULDocument.h +++ b/content/xul/document/src/nsXULDocument.h @@ -124,8 +124,7 @@ public: nsIContent* aChild, PRInt32 aIndexInContainer); - virtual void AttributeChanged(nsIStyledContent* aElement, - PRInt32 aNameSpaceID, + virtual void AttributeChanged(nsIContent* aElement, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); // nsIXULDocument interface diff --git a/content/xul/templates/src/nsXULContentBuilder.cpp b/content/xul/templates/src/nsXULContentBuilder.cpp index c01dffbd5e02..b74542167812 100644 --- a/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/content/xul/templates/src/nsXULContentBuilder.cpp @@ -41,7 +41,6 @@ #include "nsContentCID.h" #include "nsIDocument.h" -#include "nsIStyledContent.h" #include "nsIDOMNodeList.h" #include "nsIDOMXULDocument.h" #include "nsINodeInfo.h" @@ -127,11 +126,11 @@ public: NS_IMETHOD CreateContents(nsIContent* aElement); // nsIDocumentObserver interface - virtual void AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType); + virtual void AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType); void DocumentWillBeDestroyed(nsIDocument* aDocument); @@ -1533,11 +1532,11 @@ nsXULContentBuilder::CreateContents(nsIContent* aElement) // void -nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType) +nsXULContentBuilder::AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) { // Handle "open" and "close" cases. We do this handling before // we've notified the observer, so that content is already created diff --git a/content/xul/templates/src/nsXULTemplateBuilder.cpp b/content/xul/templates/src/nsXULTemplateBuilder.cpp index d72f54a85af2..a99ec55f354b 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.cpp +++ b/content/xul/templates/src/nsXULTemplateBuilder.cpp @@ -67,7 +67,6 @@ #include "nsCRT.h" #include "nsFixedSizeAllocator.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsIDOMElement.h" #include "nsIDOMNode.h" #include "nsIDOMDocument.h" @@ -330,11 +329,11 @@ nsXULTemplateBuilder::RemoveListener(nsIXULBuilderListener* aListener) // void -nsXULTemplateBuilder::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType) +nsXULTemplateBuilder::AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) { if (aContent == mRoot) { // Check for a change to the 'ref' attribute on an atom, in which diff --git a/content/xul/templates/src/nsXULTemplateBuilder.h b/content/xul/templates/src/nsXULTemplateBuilder.h index 9564d96fc1a9..95d4ec86bf78 100644 --- a/content/xul/templates/src/nsXULTemplateBuilder.h +++ b/content/xul/templates/src/nsXULTemplateBuilder.h @@ -91,8 +91,7 @@ public: NS_DECL_NSIXULTEMPLATEBUILDER // nsIDocumentObserver - virtual void AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void DocumentWillBeDestroyed(nsIDocument *aDocument); diff --git a/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index ab8c9f2ae23a..3f6741ce3676 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/shistory/src/nsSHEntry.cpp @@ -652,7 +652,7 @@ nsSHEntry::CharacterDataChanged(nsIDocument* aDocument, void nsSHEntry::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/extensions/inspector/base/src/inDOMView.cpp b/extensions/inspector/base/src/inDOMView.cpp index 8c3102477a15..bf28f09e875a 100644 --- a/extensions/inspector/base/src/inDOMView.cpp +++ b/extensions/inspector/base/src/inDOMView.cpp @@ -56,7 +56,6 @@ #include "nsIDocument.h" #include "nsIServiceManager.h" #include "nsITreeColumns.h" -#include "nsIStyledContent.h" //////////////////////////////////////////////////////////////////////// // inDOMViewNode @@ -647,9 +646,9 @@ NS_IMPL_NSIDOCUMENTOBSERVER_STATE_STUB(inDOMView) NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(inDOMView) void -inDOMView::AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, PRInt32 aNameSpaceID, - nsIAtom* aAttribute, PRInt32 aModType) +inDOMView::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, + PRInt32 aNameSpaceID, nsIAtom* aAttribute, + PRInt32 aModType) { if (!mTree) { return; diff --git a/extensions/permissions/Makefile.in b/extensions/permissions/Makefile.in index b7bb47b653f0..3af41839c04e 100644 --- a/extensions/permissions/Makefile.in +++ b/extensions/permissions/Makefile.in @@ -57,6 +57,7 @@ REQUIRES = xpcom \ dom \ widget \ content \ + layout \ pref \ docshell \ $(NULL) diff --git a/extensions/spellcheck/src/Makefile.in b/extensions/spellcheck/src/Makefile.in index 7fea219fb20f..0bca8f403a2b 100644 --- a/extensions/spellcheck/src/Makefile.in +++ b/extensions/spellcheck/src/Makefile.in @@ -57,6 +57,7 @@ REQUIRES = xpcom \ string \ editor \ content \ + layout \ dom \ necko \ widget \ @@ -73,13 +74,13 @@ CPPSRCS = \ mozEnglishWordUtils.cpp \ mozGenericWordUtils.cpp \ mozSpellI18NManager.cpp \ - mozInlineSpellChecker.cpp \ + mozInlineSpellChecker.cpp \ $(NULL) EXTRA_DSO_LDOPTS = \ $(LIBS_DIR) \ $(MOZ_COMPONENT_LIBS) \ - $(MOZ_UNICHARUTIL_LIBS) \ + $(MOZ_UNICHARUTIL_LIBS) \ $(NULL) include $(topsrcdir)/config/rules.mk diff --git a/extensions/transformiix/build/Makefile.in b/extensions/transformiix/build/Makefile.in index 255a62cdcf2c..e949a5b62ef8 100644 --- a/extensions/transformiix/build/Makefile.in +++ b/extensions/transformiix/build/Makefile.in @@ -58,6 +58,7 @@ REQUIRES = xpcom \ string \ dom \ content \ + layout \ widget \ necko \ js \ diff --git a/extensions/transformiix/source/base/Makefile.in b/extensions/transformiix/source/base/Makefile.in index 4fcaa90b9f32..703aaed0508b 100644 --- a/extensions/transformiix/source/base/Makefile.in +++ b/extensions/transformiix/source/base/Makefile.in @@ -54,6 +54,7 @@ ifndef TX_EXE REQUIRES += unicharutil \ dom \ content \ + layout \ widget \ necko \ caps \ diff --git a/extensions/transformiix/source/xml/Makefile.in b/extensions/transformiix/source/xml/Makefile.in index 0710ade5befa..71dbe0966a85 100644 --- a/extensions/transformiix/source/xml/Makefile.in +++ b/extensions/transformiix/source/xml/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = string \ ifndef TX_EXE REQUIRES += dom \ content \ + layout \ widget \ unicharutil \ necko \ diff --git a/extensions/transformiix/source/xml/parser/Makefile.in b/extensions/transformiix/source/xml/parser/Makefile.in index b9ac23b310ec..29589f011852 100644 --- a/extensions/transformiix/source/xml/parser/Makefile.in +++ b/extensions/transformiix/source/xml/parser/Makefile.in @@ -54,6 +54,7 @@ ifndef TX_EXE REQUIRES += necko \ dom \ content \ + layout \ widget \ js \ xpconnect \ diff --git a/extensions/transformiix/source/xpath/nsXPathResult.cpp b/extensions/transformiix/source/xpath/nsXPathResult.cpp index c57a0c9a26b1..2d3971c8c2be 100644 --- a/extensions/transformiix/source/xpath/nsXPathResult.cpp +++ b/extensions/transformiix/source/xpath/nsXPathResult.cpp @@ -212,7 +212,7 @@ nsXPathResult::CharacterDataChanged(nsIDocument* aDocument, void nsXPathResult::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/extensions/transformiix/source/xslt/functions/Makefile.in b/extensions/transformiix/source/xslt/functions/Makefile.in index c6d0884bec00..9a0fd8053ae4 100644 --- a/extensions/transformiix/source/xslt/functions/Makefile.in +++ b/extensions/transformiix/source/xslt/functions/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = string \ ifndef TX_EXE REQUIRES += dom \ content \ + layout \ widget \ unicharutil \ necko \ diff --git a/extensions/transformiix/source/xslt/txMozillaXSLTProcessor.cpp b/extensions/transformiix/source/xslt/txMozillaXSLTProcessor.cpp index 0169330af26a..778262620a7b 100644 --- a/extensions/transformiix/source/xslt/txMozillaXSLTProcessor.cpp +++ b/extensions/transformiix/source/xslt/txMozillaXSLTProcessor.cpp @@ -1014,7 +1014,7 @@ txMozillaXSLTProcessor::CharacterDataChanged(nsIDocument* aDocument, void txMozillaXSLTProcessor::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/extensions/transformiix/source/xslt/util/Makefile.in b/extensions/transformiix/source/xslt/util/Makefile.in index c019908cfb5f..5d99d001f7aa 100644 --- a/extensions/transformiix/source/xslt/util/Makefile.in +++ b/extensions/transformiix/source/xslt/util/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = string \ ifndef TX_EXE REQUIRES += dom \ content \ + layout \ widget \ locale \ unicharutil \ diff --git a/extensions/webservices/build/src/Makefile.in b/extensions/webservices/build/src/Makefile.in index 367408a0c233..c4134a10b89d 100755 --- a/extensions/webservices/build/src/Makefile.in +++ b/extensions/webservices/build/src/Makefile.in @@ -56,6 +56,7 @@ REQUIRES = xpcom \ dom \ js \ content \ + layout \ widget \ caps \ necko \ diff --git a/extensions/webservices/schema/src/Makefile.in b/extensions/webservices/schema/src/Makefile.in index 13ac40928ff9..7a043feee6fb 100644 --- a/extensions/webservices/schema/src/Makefile.in +++ b/extensions/webservices/schema/src/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = xpcom \ caps \ widget \ content \ + layout \ js \ htmlparser \ necko \ diff --git a/extensions/webservices/wsdl/src/Makefile.in b/extensions/webservices/wsdl/src/Makefile.in index b4934372bf23..8d9eeb0747d6 100644 --- a/extensions/webservices/wsdl/src/Makefile.in +++ b/extensions/webservices/wsdl/src/Makefile.in @@ -53,6 +53,7 @@ REQUIRES = xpcom \ caps \ widget \ content \ + layout \ js \ necko \ pref \ diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index b3ea0c4c31df..2a9037860de8 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -43,7 +43,6 @@ #include "nsIURL.h" #include "nsISupportsArray.h" #include "nsHashtable.h" -#include "nsIStyledContent.h" #include "nsIHTMLDocument.h" #include "nsIStyleRule.h" #include "nsIFrame.h" @@ -10643,7 +10642,7 @@ nsCSSFrameConstructor::DoContentStateChanged(nsIContent* aContent, } nsresult -nsCSSFrameConstructor::AttributeChanged(nsIStyledContent* aContent, +nsCSSFrameConstructor::AttributeChanged(nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/layout/base/nsCSSFrameConstructor.h b/layout/base/nsCSSFrameConstructor.h index 0ea475156243..c2c38d30863c 100644 --- a/layout/base/nsCSSFrameConstructor.h +++ b/layout/base/nsCSSFrameConstructor.h @@ -49,7 +49,6 @@ #include "nsIEventQueue.h" class nsIDocument; -class nsIStyledContent; struct nsFrameItems; struct nsAbsoluteItems; struct nsTableCreator; @@ -125,10 +124,10 @@ public: // WillDestroyFrameTree hasn't been called yet. void NotifyDestroyingFrame(nsIFrame* aFrame); - nsresult AttributeChanged(nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType); + nsresult AttributeChanged(nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType); void BeginUpdate() { ++mUpdateCount; } void EndUpdate(); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 7e04932a4950..6b5732fc8bf2 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -57,7 +57,6 @@ #include "nsIPresShell.h" #include "nsPresContext.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsIDocument.h" #include "nsIDOMXULDocument.h" #include "nsStubDocumentObserver.h" @@ -1216,8 +1215,7 @@ public: nsIContent* aContent1, nsIContent* aContent2, PRInt32 aStateMask); - virtual void AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument* aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void ContentAppended(nsIDocument* aDocument, nsIContent* aContainer, @@ -5090,11 +5088,11 @@ PresShell::ContentStatesChanged(nsIDocument* aDocument, void -PresShell::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType) +PresShell::AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) { NS_PRECONDITION(!mIsDocumentGone, "Unexpected AttributeChanged"); NS_PRECONDITION(aDocument == mDocument, "Unexpected aDocument"); diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 6b68ad00d99c..44bb55ce76d2 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -289,9 +289,7 @@ nsHTMLFramesetFrame::FrameResizePrefCallback(const char* aPref, void* aClosure) frame->RecalculateBorderResize(); if (doc) { - nsCOMPtr content(do_QueryInterface(frame->GetContent())); - NS_ASSERTION(content, "Expected an element here!"); - doc->AttributeChanged(content, + doc->AttributeChanged(frame->GetContent(), kNameSpaceID_None, nsHTMLAtoms::frameborder, nsIDOMMutationEvent::MODIFICATION); diff --git a/layout/generic/nsImageMap.cpp b/layout/generic/nsImageMap.cpp index 3152a09ad670..f2c0878218fc 100644 --- a/layout/generic/nsImageMap.cpp +++ b/layout/generic/nsImageMap.cpp @@ -47,7 +47,6 @@ #include "nsNetUtil.h" #include "nsTextFragment.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsIDOMHTMLElement.h" #include "nsIDOMHTMLMapElement.h" #include "nsIDOMHTMLAreaElement.h" @@ -970,11 +969,11 @@ nsImageMap::MaybeUpdateAreas(nsIContent *aContent) } void -nsImageMap::AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, - PRInt32 aNameSpaceID, - nsIAtom* aAttribute, - PRInt32 aModType) +nsImageMap::AttributeChanged(nsIDocument* aDocument, + nsIContent* aContent, + PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) { // If the parent of the changing content node is our map then update // the map. But only do this if the node is an HTML or diff --git a/layout/generic/nsImageMap.h b/layout/generic/nsImageMap.h index 3882c5a96847..d79dc23735e5 100644 --- a/layout/generic/nsImageMap.h +++ b/layout/generic/nsImageMap.h @@ -88,8 +88,7 @@ public: NS_DECL_ISUPPORTS // nsIDocumentObserver - virtual void AttributeChanged(nsIDocument* aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument* aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void ContentAppended(nsIDocument* aDocument, nsIContent* aContainer, diff --git a/layout/style/nsCSSOMFactory.cpp b/layout/style/nsCSSOMFactory.cpp index 11617edcca99..ec7fa10506e5 100644 --- a/layout/style/nsCSSOMFactory.cpp +++ b/layout/style/nsCSSOMFactory.cpp @@ -51,7 +51,7 @@ nsCSSOMFactory::~nsCSSOMFactory() NS_IMPL_ISUPPORTS1(nsCSSOMFactory, nsICSSOMFactory) NS_IMETHODIMP -nsCSSOMFactory::CreateDOMCSSAttributeDeclaration(nsIStyledContent *aContent, +nsCSSOMFactory::CreateDOMCSSAttributeDeclaration(nsIContent *aContent, nsDOMCSSDeclaration **aResult) { nsDOMCSSDeclaration *result = new nsDOMCSSAttributeDeclaration(aContent); diff --git a/layout/style/nsCSSOMFactory.h b/layout/style/nsCSSOMFactory.h index c96848ea63e3..2a339cf9264b 100644 --- a/layout/style/nsCSSOMFactory.h +++ b/layout/style/nsCSSOMFactory.h @@ -51,7 +51,7 @@ public: NS_DECL_ISUPPORTS - NS_IMETHOD CreateDOMCSSAttributeDeclaration(nsIStyledContent *aContent, + NS_IMETHOD CreateDOMCSSAttributeDeclaration(nsIContent *aContent, nsDOMCSSDeclaration **aResult); }; diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index 6c294fcbbecf..b952581fe825 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -56,7 +56,6 @@ #include "nsICSSGroupRule.h" #include "nsICSSImportRule.h" #include "nsIMediaList.h" -#include "nsIStyledContent.h" #include "nsIDocument.h" #include "nsPresContext.h" #include "nsIEventStateManager.h" @@ -2601,7 +2600,7 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext, mContentTag = nsnull; mContentID = nsnull; - mStyledContent = nsnull; + mHasAttributes = PR_FALSE; mIsHTMLContent = PR_FALSE; mIsHTMLLink = PR_FALSE; mIsSimpleXLink = PR_FALSE; @@ -2632,15 +2631,9 @@ RuleProcessorData::RuleProcessorData(nsPresContext* aPresContext, // get the event state mPresContext->EventStateManager()->GetContentState(aContent, mEventState); - // get the styledcontent interface and the ID - if (aContent->IsContentOfType(nsIContent::eELEMENT)) { - mStyledContent = NS_STATIC_CAST(nsIStyledContent*, aContent); - mContentID = mStyledContent->GetID(); - mClasses = mStyledContent->GetClasses(); - } - - NS_ASSERTION(nsCOMPtr(do_QueryInterface(aContent)) == mStyledContent, - "nsIStyledContent must agree with IsContentOfType(eELEMENT)"); + // get the ID and classes for the content + mContentID = aContent->GetID(); + mClasses = aContent->GetClasses(); // see if there are attributes for the content mHasAttributes = aContent->GetAttrCount() > 0; @@ -3000,7 +2993,7 @@ static PRBool SelectorMatches(RuleProcessorData &data, nsDependentString(pseudoClass->mString), nsCaseInsensitiveStringComparator()); } - else { + else if (data.mContent) { nsIDocument* doc = data.mContent->GetDocument(); if (doc) { // Try to get the language from the HTTP header or if this @@ -3149,6 +3142,9 @@ static PRBool SelectorMatches(RuleProcessorData &data, // if no attributes on the content, no match result = localFalse; } else { + NS_ASSERTION(data.mContent, + "Must have content if either data.mHasAttributes or " + "aAttribute is set!"); result = localTrue; nsAttrSelector* attr = aSelector->mAttrList; do { @@ -3234,7 +3230,8 @@ static PRBool SelectorMatches(RuleProcessorData &data, if (result && (aSelector->mIDList || aSelector->mClassList)) { // test for ID & class match result = localFalse; - if (data.mStyledContent) { + // No attributes means no match on class or id + if (data.mHasAttributes) { // case sensitivity: bug 93371 PRBool isCaseSensitive = data.mCompatMode != eCompatibility_NavQuirks; nsAtomList* IDList = aSelector->mIDList; @@ -3270,7 +3267,7 @@ static PRBool SelectorMatches(RuleProcessorData &data, } if (result && - (!aAttribute || aAttribute != data.mStyledContent->GetClassAttributeName())) { + (!aAttribute || aAttribute != data.mContent->GetClassAttributeName())) { nsAtomList* classList = aSelector->mClassList; const nsAttrValue *elementClasses = data.mClasses; while (nsnull != classList) { @@ -3574,8 +3571,6 @@ nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData { NS_PRECONDITION(aData->mContent->IsContentOfType(nsIContent::eELEMENT), "content must be element"); - NS_ASSERTION(aData->mStyledContent, - "elements must implement nsIStyledContent"); AttributeEnumData data(aData); @@ -3602,7 +3597,7 @@ nsCSSRuleProcessor::HasAttributeDependentStyle(AttributeRuleProcessorData* aData cascade->mIDSelectors.EnumerateForwards(AttributeEnumFunc, &data); } - if (aData->mAttribute == aData->mStyledContent->GetClassAttributeName()) { + if (aData->mAttribute == aData->mContent->GetClassAttributeName()) { cascade->mClassSelectors.EnumerateForwards(AttributeEnumFunc, &data); } diff --git a/layout/style/nsDOMCSSAttrDeclaration.cpp b/layout/style/nsDOMCSSAttrDeclaration.cpp index 35ce4c045ba8..2601728e77ec 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.cpp +++ b/layout/style/nsDOMCSSAttrDeclaration.cpp @@ -39,7 +39,6 @@ #include "nsCSSDeclaration.h" #include "nsIDocument.h" #include "nsHTMLAtoms.h" -#include "nsIStyledContent.h" #include "nsIDOMMutationEvent.h" #include "nsICSSStyleRule.h" #include "nsICSSLoader.h" @@ -48,15 +47,18 @@ #include "nsINameSpaceManager.h" #include "nsStyleConsts.h" #include "nsContentUtils.h" +#include "nsIContent.h" MOZ_DECL_CTOR_COUNTER(nsDOMCSSAttributeDeclaration) -nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIStyledContent *aContent) +nsDOMCSSAttributeDeclaration::nsDOMCSSAttributeDeclaration(nsIContent *aContent) { MOZ_COUNT_CTOR(nsDOMCSSAttributeDeclaration); // This reference is not reference-counted. The content // object tells us when its about to go away. + NS_ASSERTION(aContent && aContent->IsContentOfType(nsIContent::eELEMENT), + "Inline style for non-element content?"); mContent = aContent; } diff --git a/layout/style/nsDOMCSSAttrDeclaration.h b/layout/style/nsDOMCSSAttrDeclaration.h index 8525d528c706..7be4cc9a8ced 100644 --- a/layout/style/nsDOMCSSAttrDeclaration.h +++ b/layout/style/nsDOMCSSAttrDeclaration.h @@ -44,14 +44,13 @@ #include "nsString.h" class nsIContent; -class nsIStyledContent; class nsICSSLoader; class nsICSSParser; class nsDOMCSSAttributeDeclaration : public nsDOMCSSDeclaration { public: - nsDOMCSSAttributeDeclaration(nsIStyledContent *aContent); + nsDOMCSSAttributeDeclaration(nsIContent *aContent); ~nsDOMCSSAttributeDeclaration(); // impl AddRef/Release; QI is implemented by our parent class @@ -75,7 +74,7 @@ protected: nsAutoRefCnt mRefCnt; NS_DECL_OWNINGTHREAD - nsIStyledContent *mContent; + nsIContent *mContent; }; #endif /* nsDOMCSSAttributeDeclaration_h___ */ diff --git a/layout/style/nsHTMLCSSStyleSheet.cpp b/layout/style/nsHTMLCSSStyleSheet.cpp index 286a438df322..e430938e8f17 100644 --- a/layout/style/nsHTMLCSSStyleSheet.cpp +++ b/layout/style/nsHTMLCSSStyleSheet.cpp @@ -41,7 +41,6 @@ #include "nsIAtom.h" #include "nsIURL.h" #include "nsCSSPseudoElements.h" -#include "nsIStyledContent.h" #include "nsIStyleRule.h" #include "nsIFrame.h" #include "nsICSSStyleRule.h" @@ -414,11 +413,11 @@ NS_IMPL_ISUPPORTS3(HTMLCSSStyleSheetImpl, NS_IMETHODIMP HTMLCSSStyleSheetImpl::RulesMatching(ElementRuleProcessorData* aData) { - nsIStyledContent* styledContent = aData->mStyledContent; + nsIContent* content = aData->mContent; - if (styledContent) { + if (content) { // just get the one and only style rule from the content's STYLE attribute - nsICSSStyleRule* rule = styledContent->GetInlineStyleRule(); + nsICSSStyleRule* rule = content->GetInlineStyleRule(); if (rule) aData->mRuleWalker->Forward(rule); } diff --git a/layout/style/nsHTMLStyleSheet.cpp b/layout/style/nsHTMLStyleSheet.cpp index dec38ef612da..d875b044da8e 100644 --- a/layout/style/nsHTMLStyleSheet.cpp +++ b/layout/style/nsHTMLStyleSheet.cpp @@ -399,9 +399,9 @@ static nsresult GetBodyColor(nsPresContext* aPresContext, nscolor* aColor) NS_IMETHODIMP nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData) { - nsIStyledContent *styledContent = aData->mStyledContent; + nsIContent *content = aData->mContent; - if (styledContent) { + if (content) { nsRuleWalker *ruleWalker = aData->mRuleWalker; if (aData->mIsHTMLContent) { nsIAtom* tag = aData->mContentTag; @@ -467,7 +467,7 @@ nsHTMLStyleSheet::RulesMatching(ElementRuleProcessorData* aData) } // end html element // just get the style rules from the content - styledContent->WalkContentStyleRules(ruleWalker); + content->WalkContentStyleRules(ruleWalker); } return NS_OK; @@ -478,7 +478,7 @@ NS_IMETHODIMP nsHTMLStyleSheet::HasStateDependentStyle(StateRuleProcessorData* aData, nsReStyleHint* aResult) { - if (aData->mStyledContent && + if (aData->mContent && aData->mIsHTMLContent && aData->mIsHTMLLink && aData->mContentTag == nsHTMLAtoms::a && @@ -498,11 +498,11 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData, nsReStyleHint* aResult) { // Result is true for |href| changes on HTML links if we have link rules. - nsIStyledContent *styledContent = aData->mStyledContent; + nsIContent *content = aData->mContent; if (aData->mAttribute == nsHTMLAtoms::href && (mLinkRule || mVisitedRule || mActiveRule) && - styledContent && - styledContent->IsContentOfType(nsIContent::eHTML) && + content && + content->IsContentOfType(nsIContent::eHTML) && aData->mContentTag == nsHTMLAtoms::a) { *aResult = eReStyle_Self; return NS_OK; @@ -512,7 +512,7 @@ nsHTMLStyleSheet::HasAttributeDependentStyle(AttributeRuleProcessorData* aData, // to descendants of body, when we're already reresolving. // Handle the content style rules. - if (styledContent && styledContent->IsAttributeMapped(aData->mAttribute)) { + if (content && content->IsAttributeMapped(aData->mAttribute)) { *aResult = eReStyle_Self; return NS_OK; } diff --git a/layout/style/nsICSSOMFactory.h b/layout/style/nsICSSOMFactory.h index 112676b6b829..a737fddbebe6 100644 --- a/layout/style/nsICSSOMFactory.h +++ b/layout/style/nsICSSOMFactory.h @@ -42,12 +42,12 @@ #include "nsISupports.h" class nsDOMCSSDeclaration; -class nsIStyledContent; +class nsIContent; -// bfdd87bd-79c8-4041-ae14-91fa8536ce61 +// f2fb43bf-81a1-4b0d-907a-893fe6727dbb #define NS_ICSSOMFACTORY_IID \ - { 0xbfdd87bd, 0x79c8, 0x4041, \ - {0xae, 0x14, 0x91, 0xfa, 0x85, 0x36, 0xce, 0x61 } } + { 0xf2fb43bf, 0x81a1, 0x4b0d, \ + { 0x90, 0x7a, 0x89, 0x3f, 0xe6, 0x72, 0x7d, 0xbb } } // 5fcaa2c1-7ca4-4f73-a357-93e79d709376 #define NS_CSSOMFACTORY_CID \ @@ -58,7 +58,7 @@ class nsICSSOMFactory : public nsISupports { public: NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICSSOMFACTORY_IID) - NS_IMETHOD CreateDOMCSSAttributeDeclaration(nsIStyledContent *aContent, + NS_IMETHOD CreateDOMCSSAttributeDeclaration(nsIContent *aContent, nsDOMCSSDeclaration **aResult) = 0; }; diff --git a/layout/style/nsIStyleRuleProcessor.h b/layout/style/nsIStyleRuleProcessor.h index 30d3472d4137..22e904d7e678 100644 --- a/layout/style/nsIStyleRuleProcessor.h +++ b/layout/style/nsIStyleRuleProcessor.h @@ -48,7 +48,6 @@ class nsIStyleSheet; class nsPresContext; class nsIContent; -class nsIStyledContent; class nsIAtom; class nsICSSPseudoComparator; class nsRuleWalker; @@ -84,7 +83,6 @@ struct RuleProcessorData { nsIAtom* mContentTag; // if content, then content->GetTag() nsIAtom* mContentID; // if styled content, then weak reference to styledcontent->GetID() - nsIStyledContent* mStyledContent; // if content, content->QI(nsIStyledContent) PRPackedBool mIsHTMLContent; // if content, then does QI on HTMLContent, true or false PRPackedBool mIsHTMLLink; // if content, calls nsStyleUtil::IsHTMLLink PRPackedBool mIsSimpleXLink; // if content, calls nsStyleUtil::IsSimpleXLink diff --git a/layout/xul/base/src/tree/src/nsTreeContentView.cpp b/layout/xul/base/src/tree/src/nsTreeContentView.cpp index 5d562fbcbaf3..bb472068d9eb 100644 --- a/layout/xul/base/src/tree/src/nsTreeContentView.cpp +++ b/layout/xul/base/src/tree/src/nsTreeContentView.cpp @@ -47,7 +47,6 @@ #include "nsIDOMClassInfo.h" #include "nsIEventStateManager.h" #include "nsINodeInfo.h" -#include "nsIStyledContent.h" // A content model view implementation for the tree. @@ -733,7 +732,7 @@ nsTreeContentView::ContentStatesChanged(nsIDocument* aDocument, void nsTreeContentView::AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, + nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType) diff --git a/layout/xul/base/src/tree/src/nsTreeContentView.h b/layout/xul/base/src/tree/src/nsTreeContentView.h index 5f6ed0284212..353827440295 100644 --- a/layout/xul/base/src/tree/src/nsTreeContentView.h +++ b/layout/xul/base/src/tree/src/nsTreeContentView.h @@ -72,8 +72,7 @@ class nsTreeContentView : public nsITreeView, nsIContent* aContent1, nsIContent* aContent2, PRInt32 aStateMask); - virtual void AttributeChanged(nsIDocument *aDocument, - nsIStyledContent* aContent, + virtual void AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); virtual void ContentAppended(nsIDocument *aDocument, diff --git a/toolkit/components/passwordmgr/base/Makefile.in b/toolkit/components/passwordmgr/base/Makefile.in index 78349d543fa4..2226bee8ca4b 100644 --- a/toolkit/components/passwordmgr/base/Makefile.in +++ b/toolkit/components/passwordmgr/base/Makefile.in @@ -58,6 +58,7 @@ REQUIRES = \ intl \ dom \ content \ + layout \ widget \ autocomplete \ pipnss \ diff --git a/widget/src/cocoa/nsMenuBarX.mm b/widget/src/cocoa/nsMenuBarX.mm index 06b0190d3227..1136c587da63 100644 --- a/widget/src/cocoa/nsMenuBarX.mm +++ b/widget/src/cocoa/nsMenuBarX.mm @@ -43,7 +43,6 @@ #include "nsIMenu.h" #include "nsIMenuItem.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsMenuBarX.h" #include "nsMenuX.h" @@ -696,8 +695,7 @@ nsMenuBarX::DocumentWillBeDestroyed(nsIDocument * aDocument) void -nsMenuBarX::AttributeChanged(nsIDocument * aDocument, - nsIStyledContent * aContent, +nsMenuBarX::AttributeChanged(nsIDocument * aDocument, nsIContent * aContent, PRInt32 aNameSpaceID, nsIAtom * aAttribute, PRInt32 aModType) { diff --git a/widget/src/mac/nsMenuBarX.cpp b/widget/src/mac/nsMenuBarX.cpp index 40363775b382..eff3ef0aebfd 100644 --- a/widget/src/mac/nsMenuBarX.cpp +++ b/widget/src/mac/nsMenuBarX.cpp @@ -42,7 +42,6 @@ #include "nsIMenu.h" #include "nsIMenuItem.h" #include "nsIContent.h" -#include "nsIStyledContent.h" #include "nsMenuBarX.h" #include "nsMenuX.h" @@ -716,8 +715,7 @@ nsMenuBarX::DocumentWillBeDestroyed( nsIDocument * aDocument ) void -nsMenuBarX::AttributeChanged( nsIDocument * aDocument, - nsIStyledContent * aContent, +nsMenuBarX::AttributeChanged( nsIDocument * aDocument, nsIContent * aContent, PRInt32 aNameSpaceID, nsIAtom * aAttribute, PRInt32 aModType ) {