зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset f66cb1530f75 (bug 1407952) for build failure (bug 1408622). r=backout a=backout
MozReview-Commit-ID: 3h4oDHbvmes --HG-- extra : amend_source : 9e9e1bb348b7e2434f3388cf97580172348e769a
This commit is contained in:
Родитель
caf5b99a30
Коммит
a46c92c8b7
|
@ -3467,38 +3467,27 @@ Element::GetTokenList(nsAtom* aAtom,
|
|||
Element*
|
||||
Element::Closest(const nsAString& aSelector, ErrorResult& aResult)
|
||||
{
|
||||
return WithSelectorList<Element*>(
|
||||
aSelector,
|
||||
aResult,
|
||||
[&](const RawServoSelectorList* aList) -> Element* {
|
||||
if (!aList) {
|
||||
return nullptr;
|
||||
}
|
||||
return const_cast<Element*>(Servo_SelectorList_Closest(this, aList));
|
||||
},
|
||||
[&](nsCSSSelectorList* aList) -> Element* {
|
||||
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;
|
||||
nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult);
|
||||
if (!selectorList) {
|
||||
// Either we failed (and aResult 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,
|
||||
selectorList)) {
|
||||
return node->AsElement();
|
||||
}
|
||||
);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -136,8 +136,6 @@ SERVO_BINDING_FUNC(Servo_SelectorList_Parse,
|
|||
const nsACString* selector_list)
|
||||
SERVO_BINDING_FUNC(Servo_SelectorList_Matches, bool,
|
||||
RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
|
||||
SERVO_BINDING_FUNC(Servo_SelectorList_Closest, RawGeckoElementBorrowedOrNull,
|
||||
RawGeckoElementBorrowed, RawServoSelectorListBorrowed)
|
||||
SERVO_BINDING_FUNC(Servo_StyleSet_AddSizeOfExcludingThis, void,
|
||||
mozilla::MallocSizeOf malloc_size_of,
|
||||
mozilla::MallocSizeOf malloc_enclosing_size_of,
|
||||
|
|
Загрузка…
Ссылка в новой задаче