DeCOMtaminate nsICSSPseudoComparator::PseudoMatches method signature. (Bug 576794) r=bzbarsky a2.0=bsmedberg
authorCraig Topper <craig.topper@gmail.com>
Fri, 30 Jul 2010 16:48:57 -0700
changeset 48443 43697c4a954ad329a6b58a29263f1f69df6fd5e3
parent 48442 664d5e6913fc8d4f4dac2c111a691ed6ff8834df
child 48444 06ae143d9ad887d022a52f61a74d59b5ff0b768c
push idunknown
push userunknown
push dateunknown
reviewersbzbarsky
bugs576794
milestone2.0b3pre
DeCOMtaminate nsICSSPseudoComparator::PseudoMatches method signature. (Bug 576794) r=bzbarsky a2.0=bsmedberg
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsICSSPseudoComparator.h
layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
layout/xul/base/src/tree/src/nsTreeBodyFrame.h
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -2390,20 +2390,17 @@ nsCSSRuleProcessor::RulesMatching(XULTre
   if (cascade && cascade->mXULTreeRules.entryCount) {
     RuleHashTagTableEntry* entry = static_cast<RuleHashTagTableEntry*>
       (PL_DHashTableOperate(&cascade->mXULTreeRules, aData->mPseudoTag,
                             PL_DHASH_LOOKUP));
     if (PL_DHASH_ENTRY_IS_BUSY(entry)) {
       nsTArray<RuleValue>& rules = entry->mRules;
       for (RuleValue *value = rules.Elements(), *end = value + rules.Length();
            value != end; ++value) {
-        PRBool matches = PR_TRUE;
-        aData->mComparator->PseudoMatches(aData->mPseudoTag, value->mSelector,
-                                          &matches);
-        if (matches) {
+        if (aData->mComparator->PseudoMatches(aData->mPseudoTag, value->mSelector)) {
           ContentEnumFunc(value->mRule, value->mSelector->mNext,
                           static_cast<RuleProcessorData*>(aData));
         }
       }
     }
   }
 }
 #endif
--- a/layout/style/nsICSSPseudoComparator.h
+++ b/layout/style/nsICSSPseudoComparator.h
@@ -45,12 +45,12 @@
 class nsIAtom;
 struct nsCSSSelector;
 
 class nsICSSPseudoComparator
 {
 public:
   NS_DECL_QUERYFRAME_TARGET(nsICSSPseudoComparator)
 
-  NS_IMETHOD  PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector, PRBool* aResult)=0;
+  virtual PRBool PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector)=0;
 };
 
 #endif /* nsICSSPseudoComparator_h___ */
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp
@@ -4196,37 +4196,35 @@ nsStyleContext*
 nsTreeBodyFrame::GetPseudoStyleContext(nsIAtom* aPseudoElement)
 {
   return mStyleCache.GetStyleContext(this, PresContext(), mContent,
                                      mStyleContext, aPseudoElement,
                                      mScratchArray);
 }
 
 // Our comparator for resolving our complex pseudos
-NS_IMETHODIMP
-nsTreeBodyFrame::PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector, PRBool* aResult)
+PRBool
+nsTreeBodyFrame::PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector)
 {
   NS_ABORT_IF_FALSE(aSelector->mLowercaseTag == aTag,
                    "should not have been called");
   // Iterate the pseudoclass list.  For each item in the list, see if
   // it is contained in our scratch array.  If we have a miss, then
   // we aren't a match.  If all items in the pseudoclass list are
   // present in the scratch array, then we have a match.
   nsPseudoClassList* curr = aSelector->mPseudoClassList;
   while (curr) {
     PRInt32 index;
     mScratchArray->GetIndexOf(curr->mAtom, &index);
     if (index == -1) {
-      *aResult = PR_FALSE;
-      return NS_OK;
+      return PR_FALSE;
     }
     curr = curr->mNext;
   }
-  *aResult = PR_TRUE;
-  return NS_OK;
+  return PR_TRUE;
 }
 
 nsIContent*
 nsTreeBodyFrame::GetBaseElement()
 {
   nsIFrame* parent = GetParent();
   while (parent) {
     nsIContent* content = parent->GetContent();
--- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
+++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.h
@@ -138,17 +138,17 @@ public:
   virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                          PRBool aRemoveOverflowArea = PR_FALSE);
 
   // nsIReflowCallback
   virtual PRBool ReflowFinished();
   virtual void ReflowCallbackCanceled();
 
   // nsICSSPseudoComparator
-  NS_IMETHOD PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector, PRBool* aResult);
+  virtual PRBool PseudoMatches(nsIAtom* aTag, nsCSSSelector* aSelector);
 
   // nsIScrollbarMediator
   NS_IMETHOD PositionChanged(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32& aNewIndex);
   NS_IMETHOD ScrollbarButtonPressed(nsIScrollbarFrame* aScrollbar, PRInt32 aOldIndex, PRInt32 aNewIndex);
   NS_IMETHOD VisibilityChanged(PRBool aVisible) { Invalidate(); return NS_OK; }
 
   // Overridden from nsIFrame to cache our pres context.
   NS_IMETHOD Init(nsIContent*     aContent,