XPCOM'ized nsIContent and nsIHTMLContent

git-svn-id: svn://10.0.0.236/trunk@8824 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-08-29 20:20:38 +00:00
parent 96b63db44c
commit 29e64a354f
132 changed files with 3019 additions and 2333 deletions

View File

@@ -402,15 +402,18 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
nsCSSSelector* aSelector, nsIContent* aContent)
{
PRBool result = PR_FALSE;
nsIAtom* contentTag = aContent->GetTag();
nsIAtom* contentTag;
aContent->GetTag(contentTag);
if ((nsnull == aSelector->mTag) || (aSelector->mTag == contentTag)) {
if ((nsnull != aSelector->mClass) || (nsnull != aSelector->mID) ||
(nsnull != aSelector->mPseudoClass)) {
nsIHTMLContent* htmlContent;
if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) {
nsIAtom* contentClass = htmlContent->GetClass();
nsIAtom* contentID = htmlContent->GetID();
nsIAtom* contentClass;
htmlContent->GetClass(contentClass);
nsIAtom* contentID;
htmlContent->GetID(contentID);
if ((nsnull == aSelector->mClass) || (aSelector->mClass == contentClass)) {
if ((nsnull == aSelector->mID) || (aSelector->mID == contentID)) {
if ((contentTag == nsHTMLAtoms::a) && (nsnull != aSelector->mPseudoClass)) {
@@ -420,9 +423,9 @@ static PRBool SelectorMatches(nsIPresContext* aPresContext,
if ((NS_OK == aPresContext->GetLinkHandler(&linkHandler)) &&
(nsnull != linkHandler)) {
nsAutoString base, href; // XXX base??
nsContentAttr attrState = htmlContent->GetAttribute("href", href);
nsresult attrState = htmlContent->GetAttribute("href", href);
if (eContentAttr_HasValue == attrState) {
if (NS_CONTENT_ATTR_HAS_VALUE == attrState) {
nsIURL* docURL = nsnull;
nsIDocument* doc = nsnull;
aContent->GetDocument(doc);
@@ -563,14 +566,15 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
BuildHash();
}
ContentEnumData data(aPresContext, aContent, aParentFrame, aResults);
nsIAtom* tagAtom = aContent->GetTag();
nsIAtom* tagAtom;
aContent->GetTag(tagAtom);
nsIAtom* idAtom = nsnull;
nsIAtom* classAtom = nsnull;
nsIHTMLContent* htmlContent;
if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) {
idAtom = htmlContent->GetID();
classAtom = htmlContent->GetClass();
htmlContent->GetID(idAtom);
htmlContent->GetClass(classAtom);
NS_RELEASE(htmlContent);
}