Bug 1407843 part 3 - Remove nsICSSPseudoComparator. r=heycam
authorXidorn Quan <me@upsuper.org>
Fri, 13 Oct 2017 13:50:04 +1100
changeset 386206 408f93434478a98b943baee0a29b69a997333589
parent 386205 39713e51fe82aa7e43d1ac7ea63829d13183c065
child 386207 a01135b451a4efbeecb1e8e2f53d4c8dd1f80a33
push id32678
push userarchaeopteryx@coole-files.de
push dateSat, 14 Oct 2017 09:40:07 +0000
treeherdermozilla-central@0dd64d5842e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1407843
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1407843 part 3 - Remove nsICSSPseudoComparator. r=heycam MozReview-Commit-ID: Ct3zUoiSIA4
layout/style/moz.build
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsICSSPseudoComparator.h
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeBodyFrame.h
layout/xul/tree/nsTreeStyleCache.cpp
layout/xul/tree/nsTreeStyleCache.h
--- a/layout/style/moz.build
+++ b/layout/style/moz.build
@@ -50,17 +50,16 @@ EXPORTS += [
     'nsCSSRuleProcessor.h',
     'nsCSSScanner.h',
     'nsCSSValue.h',
     'nsDOMCSSAttrDeclaration.h',
     'nsDOMCSSDeclaration.h',
     'nsDOMCSSRGBColor.h',
     'nsICSSDeclaration.h',
     'nsICSSLoaderObserver.h',
-    'nsICSSPseudoComparator.h',
     'nsICSSStyleRuleDOMWrapper.h',
     'nsIStyleRule.h',
     'nsIStyleRuleProcessor.h',
     'nsLayoutStylesheetCache.h',
     'nsMediaFeatures.h',
     'nsMediaList.h',
     'nsRuleData.h',
     'nsRuleNode.h',
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -11,17 +11,16 @@
 
 #include "nsCSSRuleProcessor.h"
 
 #include "nsAutoPtr.h"
 #include "nsRuleProcessorData.h"
 #include <algorithm>
 #include "nsAtom.h"
 #include "PLDHashTable.h"
-#include "nsICSSPseudoComparator.h"
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/css/ImportRule.h"
 #include "mozilla/css/StyleRule.h"
 #include "mozilla/css/GroupRule.h"
 #include "nsIDocument.h"
 #include "nsPresContext.h"
 #include "nsGkAtoms.h"
 #include "nsUnicharUtils.h"
deleted file mode 100644
--- a/layout/style/nsICSSPseudoComparator.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* internal interface for implementing complex pseudo-classes */
-
-#ifndef nsICSSPseudoComparator_h___
-#define nsICSSPseudoComparator_h___
-
-struct nsCSSSelector;
-
-class nsICSSPseudoComparator
-{
-public:
-  virtual bool PseudoMatches(nsCSSSelector* aSelector)=0;
-};
-
-#endif /* nsICSSPseudoComparator_h___ */
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -4470,28 +4470,21 @@ nsTreeBodyFrame::ThumbMoved(nsScrollbarF
     UpdateScrollbars(parts);
   }
 }
 
 // The style cache.
 nsStyleContext*
 nsTreeBodyFrame::GetPseudoStyleContext(nsICSSAnonBoxPseudo* aPseudoElement)
 {
-  return mStyleCache.GetStyleContext(this, PresContext(), mContent,
+  return mStyleCache.GetStyleContext(PresContext(), mContent,
                                      mStyleContext, aPseudoElement,
                                      mScratchArray);
 }
 
-// Our comparator for resolving our complex pseudos
-bool
-nsTreeBodyFrame::PseudoMatches(nsCSSSelector* aSelector)
-{
-  return true;
-}
-
 nsIContent*
 nsTreeBodyFrame::GetBaseElement()
 {
   nsIFrame* parent = GetParent();
   while (parent) {
     nsIContent* content = parent->GetContent();
     if (content) {
       dom::NodeInfo* ni = content->NodeInfo();
--- a/layout/xul/tree/nsTreeBodyFrame.h
+++ b/layout/xul/tree/nsTreeBodyFrame.h
@@ -6,17 +6,16 @@
 #ifndef nsTreeBodyFrame_h
 #define nsTreeBodyFrame_h
 
 #include "mozilla/AtomArray.h"
 #include "mozilla/Attributes.h"
 
 #include "nsLeafBoxFrame.h"
 #include "nsITreeView.h"
-#include "nsICSSPseudoComparator.h"
 #include "nsIScrollbarMediator.h"
 #include "nsITimer.h"
 #include "nsIReflowCallback.h"
 #include "nsTArray.h"
 #include "nsTreeStyleCache.h"
 #include "nsTreeColumns.h"
 #include "nsDataHashtable.h"
 #include "imgIRequest.h"
@@ -44,17 +43,16 @@ struct nsTreeImageCacheEntry
 
   nsCOMPtr<imgIRequest> request;
   nsCOMPtr<imgINotificationObserver> listener;
 };
 
 // The actual frame that paints the cells and rows.
 class nsTreeBodyFrame final
   : public nsLeafBoxFrame
-  , public nsICSSPseudoComparator
   , public nsIScrollbarMediator
   , public nsIReflowCallback
 {
   typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
   typedef mozilla::image::DrawResult DrawResult;
 
 public:
   explicit nsTreeBodyFrame(nsStyleContext* aContext);
@@ -127,19 +125,16 @@ public:
   virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual void SetXULBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                             bool aRemoveOverflowArea = false) override;
 
   // nsIReflowCallback
   virtual bool ReflowFinished() override;
   virtual void ReflowCallbackCanceled() override;
 
-  // nsICSSPseudoComparator
-  virtual bool PseudoMatches(nsCSSSelector* aSelector) override;
-
   // nsIScrollbarMediator
   virtual void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                             nsIScrollbarMediator::ScrollSnapMode aSnap
                               = nsIScrollbarMediator::DISABLE_SNAP) override;
   virtual void ScrollByWhole(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                              nsIScrollbarMediator::ScrollSnapMode aSnap
                                = nsIScrollbarMediator::DISABLE_SNAP) override;
   virtual void ScrollByLine(nsScrollbarFrame* aScrollbar, int32_t aDirection,
--- a/layout/xul/tree/nsTreeStyleCache.cpp
+++ b/layout/xul/tree/nsTreeStyleCache.cpp
@@ -27,18 +27,17 @@ nsTreeStyleCache::Transition::Hash() con
   uint32_t hb = mState << 16;
   uint32_t lb = (NS_PTR_TO_UINT32(mInputSymbol.get()) << 16) >> 16;
   return hb+lb;
 }
 
 
 // The style context cache impl
 nsStyleContext*
-nsTreeStyleCache::GetStyleContext(nsICSSPseudoComparator* aComparator,
-                                  nsPresContext* aPresContext,
+nsTreeStyleCache::GetStyleContext(nsPresContext* aPresContext,
                                   nsIContent* aContent,
                                   nsStyleContext* aContext,
                                   nsICSSAnonBoxPseudo* aPseudoElement,
                                   const AtomArray & aInputWord)
 {
   MOZ_ASSERT(nsCSSAnonBoxes::IsTreePseudoElement(aPseudoElement));
 
   uint32_t count = aInputWord.Length();
--- a/layout/xul/tree/nsTreeStyleCache.h
+++ b/layout/xul/tree/nsTreeStyleCache.h
@@ -5,17 +5,16 @@
 
 #ifndef nsTreeStyleCache_h__
 #define nsTreeStyleCache_h__
 
 #include "mozilla/AtomArray.h"
 #include "mozilla/Attributes.h"
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
-#include "nsICSSPseudoComparator.h"
 #include "nsRefPtrHashtable.h"
 #include "nsStyleContext.h"
 
 class nsTreeStyleCache
 {
 public:
   nsTreeStyleCache()
     : mNextState(0)
@@ -29,18 +28,17 @@ public:
 
   void Clear()
   {
     mTransitionTable = nullptr;
     mCache = nullptr;
     mNextState = 0;
   }
 
-  nsStyleContext* GetStyleContext(nsICSSPseudoComparator* aComparator,
-                                  nsPresContext* aPresContext,
+  nsStyleContext* GetStyleContext(nsPresContext* aPresContext,
                                   nsIContent* aContent,
                                   nsStyleContext* aContext,
                                   nsICSSAnonBoxPseudo* aPseudoElement,
                                   const mozilla::AtomArray& aInputWord);
 
 protected:
   typedef uint32_t DFAState;