зеркало из https://github.com/mozilla/gecko-dev.git
sync to nsIStyledContent API change
This commit is contained in:
Родитель
f548cec11d
Коммит
6c150bc6c8
|
@ -429,9 +429,13 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
// just get the one and only style rule from the content's STYLE attribute
|
||||
if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::GetIID(), (void**)&styledContent))) {
|
||||
nsIStyleRule* rule = nsnull;
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
PRUint32 index = 0;
|
||||
aResults->Count(&index);
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRules(aResults))) {
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&postCount);
|
||||
while (index < postCount) {
|
||||
nsIStyleRule* rule = (nsIStyleRule*)aResults->ElementAt(index++);
|
||||
matchCount++;
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
|
||||
|
|
|
@ -506,13 +506,12 @@ PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
} // end html namespace
|
||||
|
||||
// just get the one and only style rule from the content
|
||||
nsIStyleRule* rule;
|
||||
styledContent->GetContentStyleRule(rule);
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
NS_RELEASE(rule);
|
||||
matchCount++;
|
||||
}
|
||||
PRUint32 preCount = 0;
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&preCount);
|
||||
styledContent->GetContentStyleRules(aResults);
|
||||
aResults->Count(&postCount);
|
||||
matchCount += (postCount - preCount);
|
||||
|
||||
NS_RELEASE(styledContent);
|
||||
}
|
||||
|
|
|
@ -429,9 +429,13 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
// just get the one and only style rule from the content's STYLE attribute
|
||||
if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::GetIID(), (void**)&styledContent))) {
|
||||
nsIStyleRule* rule = nsnull;
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
PRUint32 index = 0;
|
||||
aResults->Count(&index);
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRules(aResults))) {
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&postCount);
|
||||
while (index < postCount) {
|
||||
nsIStyleRule* rule = (nsIStyleRule*)aResults->ElementAt(index++);
|
||||
matchCount++;
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
|
||||
|
|
|
@ -506,13 +506,12 @@ PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
} // end html namespace
|
||||
|
||||
// just get the one and only style rule from the content
|
||||
nsIStyleRule* rule;
|
||||
styledContent->GetContentStyleRule(rule);
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
NS_RELEASE(rule);
|
||||
matchCount++;
|
||||
}
|
||||
PRUint32 preCount = 0;
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&preCount);
|
||||
styledContent->GetContentStyleRules(aResults);
|
||||
aResults->Count(&postCount);
|
||||
matchCount += (postCount - preCount);
|
||||
|
||||
NS_RELEASE(styledContent);
|
||||
}
|
||||
|
|
|
@ -429,9 +429,13 @@ PRInt32 HTMLCSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
// just get the one and only style rule from the content's STYLE attribute
|
||||
if (NS_SUCCEEDED(aContent->QueryInterface(nsIStyledContent::GetIID(), (void**)&styledContent))) {
|
||||
nsIStyleRule* rule = nsnull;
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRule(rule))) {
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
PRUint32 index = 0;
|
||||
aResults->Count(&index);
|
||||
if (NS_SUCCEEDED(styledContent->GetInlineStyleRules(aResults))) {
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&postCount);
|
||||
while (index < postCount) {
|
||||
nsIStyleRule* rule = (nsIStyleRule*)aResults->ElementAt(index++);
|
||||
matchCount++;
|
||||
nsICSSStyleRule* cssRule;
|
||||
if (NS_SUCCEEDED(rule->QueryInterface(kICSSStyleRuleIID, (void**)&cssRule))) {
|
||||
|
|
|
@ -506,13 +506,12 @@ PRInt32 HTMLStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
|
|||
} // end html namespace
|
||||
|
||||
// just get the one and only style rule from the content
|
||||
nsIStyleRule* rule;
|
||||
styledContent->GetContentStyleRule(rule);
|
||||
if (nsnull != rule) {
|
||||
aResults->AppendElement(rule);
|
||||
NS_RELEASE(rule);
|
||||
matchCount++;
|
||||
}
|
||||
PRUint32 preCount = 0;
|
||||
PRUint32 postCount = 0;
|
||||
aResults->Count(&preCount);
|
||||
styledContent->GetContentStyleRules(aResults);
|
||||
aResults->Count(&postCount);
|
||||
matchCount += (postCount - preCount);
|
||||
|
||||
NS_RELEASE(styledContent);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче