Bug 1396073: Simplify and remove some more code. r=xidorn

MozReview-Commit-ID: Ec9pfQw7U6W
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
Emilio Cobos Álvarez 2017-09-27 16:48:46 +02:00
parent b550117c8d
commit 371f0cc42f
4 changed files with 4 additions and 40 deletions

View File

@ -866,13 +866,12 @@ Gecko_GetLookAndFeelSystemColor(int32_t aId,
bool
Gecko_MatchStringArgPseudo(RawGeckoElementBorrowed aElement,
CSSPseudoClassType aType,
const char16_t* aIdent,
bool* aSetSlowSelectorFlag)
const char16_t* aIdent)
{
EventStates dummyMask; // mask is never read because we pass aDependence=nullptr
return nsCSSRuleProcessor::StringPseudoMatches(aElement, aType, aIdent,
aElement->OwnerDoc(), true,
dummyMask, aSetSlowSelectorFlag, nullptr);
aElement->OwnerDoc(),
dummyMask, nullptr);
}
bool

View File

@ -634,8 +634,7 @@ nscolor Gecko_GetLookAndFeelSystemColor(int32_t color_id,
bool Gecko_MatchStringArgPseudo(RawGeckoElementBorrowed element,
mozilla::CSSPseudoClassType type,
const char16_t* ident,
bool* set_slow_selector);
const char16_t* ident);
void Gecko_AddPropertyToSet(nsCSSPropertyIDSetBorrowedMut, nsCSSPropertyID);

View File

@ -1670,25 +1670,6 @@ StateSelectorMatches(Element* aElement,
return true;
}
// Chooses the thread safe version in Servo mode, and
// the non-thread safe one in Gecko mode. The non thread safe one does
// some extra caching, and is preferred when possible.
static inline bool
IsSignificantChildMaybeThreadSafe(const nsIContent* aContent,
bool aTextIsSignificant,
bool aWhitespaceIsSignificant)
{
if (ServoStyleSet::IsInServoTraversal()) {
// See bug 1349100 for optimizing this
return nsStyleUtil::ThreadSafeIsSignificantChild(aContent,
aTextIsSignificant,
aWhitespaceIsSignificant);
} else {
auto content = const_cast<nsIContent*>(aContent);
return IsSignificantChild(content, aTextIsSignificant, aWhitespaceIsSignificant);
}
}
/* static */ bool
nsCSSRuleProcessor::LangPseudoMatches(const mozilla::dom::Element* aElement,
const nsIAtom* aOverrideLang,
@ -1749,12 +1730,9 @@ nsCSSRuleProcessor::StringPseudoMatches(const mozilla::dom::Element* aElement,
CSSPseudoClassType aPseudo,
const char16_t* aString,
const nsIDocument* aDocument,
bool aForStyling,
EventStates aStateMask,
bool* aSetSlowSelectorFlag,
bool* const aDependence)
{
MOZ_ASSERT(aSetSlowSelectorFlag);
switch (aPseudo) {
case CSSPseudoClassType::mozLocaleDir:
@ -2177,18 +2155,12 @@ static bool SelectorMatches(Element* aElement,
default:
{
MOZ_ASSERT(nsCSSPseudoClasses::HasStringArg(pseudoClass->mType));
bool setSlowSelectorFlag = false;
bool matched = nsCSSRuleProcessor::StringPseudoMatches(aElement,
pseudoClass->mType,
pseudoClass->u.mString,
aTreeMatchContext.mDocument,
aTreeMatchContext.mForStyling,
aNodeMatchContext.mStateMask,
&setSlowSelectorFlag,
aDependence);
if (setSlowSelectorFlag) {
aElement->SetFlags(NODE_HAS_SLOW_SELECTOR);
}
if (!matched) {
return false;

View File

@ -154,12 +154,8 @@ public:
* @param aPseudo The name of the pseudoselector
* @param aString The identifier inside the pseudoselector (cannot be null)
* @param aDocument The document
* @param aForStyling Is this matching operation for the creation of a style context?
* (For setting the slow selector flag)
* @param aStateMask Mask containing states which we should exclude.
* Ignored if aDependence is null
* @param aSetSlowSelectorFlag Outparam, set if the caller is
* supposed to set the slow selector flag.
* @param aDependence Pointer to be set to true if we ignored a state due to
* aStateMask. Can be null.
*/
@ -167,9 +163,7 @@ public:
mozilla::CSSPseudoClassType aPseudo,
const char16_t* aString,
const nsIDocument* aDocument,
bool aForStyling,
mozilla::EventStates aStateMask,
bool* aSetSlowSelectorFlag,
bool* const aDependence = nullptr);
static bool LangPseudoMatches(const mozilla::dom::Element* aElement,