Bug 1447358: Unifdef the old style system code. r=jwatt
Summary: This has been automatically generated using: http://dotat.at/prog/unifdef/ And: find $OBJDIR -type f -name '*.h' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done find $OBJDIR -type f -name '*.cpp' | while read FILE; do echo "$FILE" unifdef -m -DMOZ_STYLO -UMOZ_OLD_STYLE "$FILE"; done MozReview-Commit-ID: I4NdKqbMXzJ Reviewers: jwatt Bug #: 1447358 Differential Revision: https://phabricator.services.mozilla.com/D779
This commit is contained in:
@@ -112,11 +112,6 @@
|
||||
#include "nsView.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
#include "mozilla/css/StyleRule.h" /* For nsCSSSelectorList */
|
||||
#include "nsCSSRuleProcessor.h"
|
||||
#include "nsRuleProcessorData.h"
|
||||
#endif
|
||||
#include "nsTextNode.h"
|
||||
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
@@ -3498,30 +3493,7 @@ Element::Closest(const nsAString& aSelector, ErrorResult& aResult)
|
||||
return const_cast<Element*>(Servo_SelectorList_Closest(this, aList));
|
||||
},
|
||||
[&](nsCSSSelectorList* aList) -> Element* {
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
if (!aList) {
|
||||
// Either we failed (and aError already has the exception), or this
|
||||
// is a pseudo-element-only selector that matches nothing.
|
||||
return nullptr;
|
||||
}
|
||||
TreeMatchContext matchingContext(false,
|
||||
nsRuleWalker::eRelevantLinkUnvisited,
|
||||
OwnerDoc(),
|
||||
TreeMatchContext::eNeverMatchVisited);
|
||||
matchingContext.SetHasSpecifiedScope();
|
||||
matchingContext.AddScopeElement(this);
|
||||
for (nsINode* node = this; node; node = node->GetParentNode()) {
|
||||
if (node->IsElement() &&
|
||||
nsCSSRuleProcessor::SelectorListMatches(node->AsElement(),
|
||||
matchingContext,
|
||||
aList)) {
|
||||
return node->AsElement();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
#else
|
||||
MOZ_CRASH("old style system disabled");
|
||||
#endif
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -3539,23 +3511,7 @@ Element::Matches(const nsAString& aSelector, ErrorResult& aError)
|
||||
return Servo_SelectorList_Matches(this, aList);
|
||||
},
|
||||
[&](nsCSSSelectorList* aList) {
|
||||
#ifdef MOZ_OLD_STYLE
|
||||
if (!aList) {
|
||||
// Either we failed (and aError already has the exception), or this
|
||||
// is a pseudo-element-only selector that matches nothing.
|
||||
return false;
|
||||
}
|
||||
TreeMatchContext matchingContext(false,
|
||||
nsRuleWalker::eRelevantLinkUnvisited,
|
||||
OwnerDoc(),
|
||||
TreeMatchContext::eNeverMatchVisited);
|
||||
matchingContext.SetHasSpecifiedScope();
|
||||
matchingContext.AddScopeElement(this);
|
||||
return nsCSSRuleProcessor::SelectorListMatches(this, matchingContext,
|
||||
aList);
|
||||
#else
|
||||
MOZ_CRASH("old style system disabled");
|
||||
#endif
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -4356,7 +4312,6 @@ void
|
||||
Element::ClearServoData(nsIDocument* aDoc) {
|
||||
MOZ_ASSERT(IsStyledByServo());
|
||||
MOZ_ASSERT(aDoc);
|
||||
#ifdef MOZ_STYLO
|
||||
if (HasServoData()) {
|
||||
Servo_Element_ClearData(this);
|
||||
} else {
|
||||
@@ -4370,9 +4325,6 @@ Element::ClearServoData(nsIDocument* aDoc) {
|
||||
if (aDoc->GetServoRestyleRoot() == this) {
|
||||
aDoc->ClearServoRestyleRoot();
|
||||
}
|
||||
#else
|
||||
MOZ_CRASH("Accessing servo node data in non-stylo build");
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user