Added XML display support. Split nsGenericHTMLElement into generic and HTML-specific components. Minor style modification. New XML classes and interfaces.
git-svn-id: svn://10.0.0.236/trunk@14467 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -36,6 +36,7 @@ class nsVoidArray;
|
||||
class nsXIFConverter;
|
||||
class nsIDOMEvent;
|
||||
class nsIContent;
|
||||
class nsISupportsArray;
|
||||
|
||||
// IID for the nsIContent interface
|
||||
#define NS_ICONTENT_IID \
|
||||
@@ -118,6 +119,40 @@ public:
|
||||
*/
|
||||
NS_IMETHOD GetAttribute(const nsString& aName, nsString& aResult) const = 0;
|
||||
|
||||
/**
|
||||
* Remove an attribute so that it is no longer explicitly specified.
|
||||
*
|
||||
* @param aAttribute the name of the attribute to unset
|
||||
*
|
||||
* @param aNotify specifies whether or not the document should be
|
||||
* notified of the attribute change
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD UnsetAttribute(nsIAtom* aAttribute, PRBool aNotify) = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Get the list of all specified attribute. The returned array
|
||||
* contains nsIAtom's representing the attribute names.
|
||||
*
|
||||
* @param aArray an array to be filled in with attribute names
|
||||
*
|
||||
* @param aCountResult an out parameter to be filled in with
|
||||
* the number of attributes
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD GetAllAttributeNames(nsISupportsArray* aArray,
|
||||
PRInt32& aCountResult) const = 0;
|
||||
|
||||
/**
|
||||
* Get the number of all specified attributes.
|
||||
*
|
||||
* @param aCountResult an out parameter to be filled in with
|
||||
* the number of attributes
|
||||
*
|
||||
*/
|
||||
NS_IMETHOD GetAttributeCount(PRInt32& aCountResult) const = 0;
|
||||
|
||||
/**
|
||||
* List the content (and anything it contains) out to the given
|
||||
* file stream. Use aIndent as the base indent during formatting.
|
||||
|
||||
@@ -240,6 +240,9 @@ public:
|
||||
extern NS_LAYOUT nsresult
|
||||
NS_NewHTMLDocument(nsIDocument** aInstancePtrResult);
|
||||
|
||||
extern NS_LAYOUT nsresult
|
||||
NS_NewXMLDocument(nsIDocument** aInstancePtrResult);
|
||||
|
||||
extern NS_LAYOUT nsresult
|
||||
NS_NewImageDocument(nsIDocument** aInstancePtrResult);
|
||||
|
||||
|
||||
@@ -275,6 +275,34 @@ nsIArena* nsDocument::GetArena()
|
||||
return mArena;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocument::StartDocumentLoad(nsIURL *aURL,
|
||||
nsIContentViewerContainer* aContainer,
|
||||
nsIStreamListener **aDocListener)
|
||||
{
|
||||
// Delete references to style sheets - this should be done in superclass...
|
||||
PRInt32 index = mStyleSheets.Count();
|
||||
while (--index >= 0) {
|
||||
nsIStyleSheet* sheet = (nsIStyleSheet*) mStyleSheets.ElementAt(index);
|
||||
NS_RELEASE(sheet);
|
||||
}
|
||||
mStyleSheets.Clear();
|
||||
|
||||
NS_IF_RELEASE(mDocumentURL);
|
||||
NS_IF_RELEASE(mDocumentURLGroup);
|
||||
if (nsnull != mDocumentTitle) {
|
||||
delete mDocumentTitle;
|
||||
mDocumentTitle = nsnull;
|
||||
}
|
||||
|
||||
mDocumentURL = aURL;
|
||||
NS_ADDREF(aURL);
|
||||
|
||||
mDocumentURLGroup = aURL->GetURLGroup();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
const nsString* nsDocument::GetDocumentTitle() const
|
||||
{
|
||||
return mDocumentTitle;
|
||||
|
||||
@@ -58,6 +58,10 @@ public:
|
||||
|
||||
virtual nsIArena* GetArena();
|
||||
|
||||
NS_IMETHOD StartDocumentLoad(nsIURL *aUrl,
|
||||
nsIContentViewerContainer* aContainer,
|
||||
nsIStreamListener **aDocListener);
|
||||
|
||||
/**
|
||||
* Return the title of the document. May return null.
|
||||
*/
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsIStyleFrameConstruction.h"
|
||||
|
||||
// XXX Temporary fix to make sure that ua.css only gets applied
|
||||
// to HTML content. When this removed, remember to get rid of
|
||||
// the include dependency in the makefile.
|
||||
#include "nsIHTMLContent.h"
|
||||
static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID);
|
||||
|
||||
static NS_DEFINE_IID(kIStyleSetIID, NS_ISTYLE_SET_IID);
|
||||
static NS_DEFINE_IID(kIStyleFrameConstructionIID, NS_ISTYLE_FRAME_CONSTRUCTION_IID);
|
||||
|
||||
@@ -477,7 +483,13 @@ nsIStyleContext* StyleSetImpl::ResolveStyleFor(nsIPresContext* aPresContext,
|
||||
}
|
||||
|
||||
if (nsnull != rules) {
|
||||
PRInt32 ruleCount = RulesMatching(mBackstopSheets, aPresContext, aContent, aParentContext, rules);
|
||||
nsIHTMLContent *htmlContent;
|
||||
nsresult rv = aContent->QueryInterface(kIHTMLContentIID, (void **)&htmlContent);
|
||||
PRInt32 ruleCount = 0;
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ruleCount += RulesMatching(mBackstopSheets, aPresContext, aContent, aParentContext, rules);
|
||||
NS_RELEASE(htmlContent);
|
||||
}
|
||||
PRInt32 backstopRules = ruleCount;
|
||||
ruleCount += RulesMatching(mDocSheets, aPresContext, aContent, aParentContext, rules);
|
||||
ruleCount += RulesMatching(mOverrideSheets, aPresContext, aContent, aParentContext, rules);
|
||||
|
||||
Reference in New Issue
Block a user