Changed GetInlineStyleRule so that it is invoked on styledContent instead

of htmlContent.
This commit is contained in:
hyatt%netscape.com 1999-02-27 01:35:25 +00:00
Родитель 0001d24680
Коммит e29262df04
3 изменённых файлов: 21 добавлений и 12 удалений

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

@ -15,6 +15,7 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights * Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved. * Reserved.
*/ */
#include "nsIHTMLCSSStyleSheet.h" #include "nsIHTMLCSSStyleSheet.h"
#include "nsIArena.h" #include "nsIArena.h"
#include "nsCRT.h" #include "nsCRT.h"
@ -187,11 +188,12 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
PRInt32 matchCount = 0; PRInt32 matchCount = 0;
nsIHTMLContent* htmlContent; nsIStyledContent* styledContent;
// just get the one and only style rule from the content's STYLE attribute // just get the one and only style rule from the content's STYLE attribute
if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::IID(), (void**)&styledContent))) {
nsIStyleRule* rule = nsnull; nsIStyleRule* rule = nsnull;
if (NS_SUCCEEDED(htmlContent->GetInlineStyleRule(rule))) { if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
if (nsnull != rule) { if (nsnull != rule) {
aResults->AppendElement(rule); aResults->AppendElement(rule);
matchCount++; matchCount++;
@ -208,7 +210,8 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
NS_RELEASE(rule); NS_RELEASE(rule);
} }
} }
NS_RELEASE(htmlContent);
NS_RELEASE(styledContent);
} }
return matchCount; return matchCount;

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

@ -15,6 +15,7 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights * Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved. * Reserved.
*/ */
#include "nsIHTMLCSSStyleSheet.h" #include "nsIHTMLCSSStyleSheet.h"
#include "nsIArena.h" #include "nsIArena.h"
#include "nsCRT.h" #include "nsCRT.h"
@ -187,11 +188,12 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
PRInt32 matchCount = 0; PRInt32 matchCount = 0;
nsIHTMLContent* htmlContent; nsIStyledContent* styledContent;
// just get the one and only style rule from the content's STYLE attribute // just get the one and only style rule from the content's STYLE attribute
if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::IID(), (void**)&styledContent))) {
nsIStyleRule* rule = nsnull; nsIStyleRule* rule = nsnull;
if (NS_SUCCEEDED(htmlContent->GetInlineStyleRule(rule))) { if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
if (nsnull != rule) { if (nsnull != rule) {
aResults->AppendElement(rule); aResults->AppendElement(rule);
matchCount++; matchCount++;
@ -208,7 +210,8 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
NS_RELEASE(rule); NS_RELEASE(rule);
} }
} }
NS_RELEASE(htmlContent);
NS_RELEASE(styledContent);
} }
return matchCount; return matchCount;

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

@ -15,6 +15,7 @@
* Copyright (C) 1998 Netscape Communications Corporation. All Rights * Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved. * Reserved.
*/ */
#include "nsIHTMLCSSStyleSheet.h" #include "nsIHTMLCSSStyleSheet.h"
#include "nsIArena.h" #include "nsIArena.h"
#include "nsCRT.h" #include "nsCRT.h"
@ -187,11 +188,12 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
PRInt32 matchCount = 0; PRInt32 matchCount = 0;
nsIHTMLContent* htmlContent; nsIStyledContent* styledContent;
// just get the one and only style rule from the content's STYLE attribute // just get the one and only style rule from the content's STYLE attribute
if (NS_OK == aContent->QueryInterface(kIHTMLContentIID, (void**)&htmlContent)) { if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::IID(), (void**)&styledContent))) {
nsIStyleRule* rule = nsnull; nsIStyleRule* rule = nsnull;
if (NS_SUCCEEDED(htmlContent->GetInlineStyleRule(rule))) { if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
if (nsnull != rule) { if (nsnull != rule) {
aResults->AppendElement(rule); aResults->AppendElement(rule);
matchCount++; matchCount++;
@ -208,7 +210,8 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
NS_RELEASE(rule); NS_RELEASE(rule);
} }
} }
NS_RELEASE(htmlContent);
NS_RELEASE(styledContent);
} }
return matchCount; return matchCount;