зеркало из https://github.com/mozilla/gecko-dev.git
Bug 989965 - Resolve style for pseudo-elements correctly when style rules that have user action pseudo-classes on them are present. r=bzbarsky
This commit is contained in:
Родитель
281ddc537e
Коммит
b40f160398
|
@ -0,0 +1,9 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<style>
|
||||
::-moz-placeholder { color: red; }
|
||||
::-moz-placeholder:focus { color: green; }
|
||||
</style>
|
||||
<script>
|
||||
window.getComputedStyle(document.body, "::-moz-placeholder").color;
|
||||
</script>
|
|
@ -102,4 +102,5 @@ load 930270-1.html
|
|||
load 930270-2.html
|
||||
load 945048-1.html
|
||||
load 972199-1.html
|
||||
load 989965-1.html
|
||||
load large_border_image_width.html
|
||||
|
|
|
@ -2435,6 +2435,19 @@ void ContentEnumFunc(const RuleValue& value, nsCSSSelector* aSelector,
|
|||
if (selector->IsPseudoElement()) {
|
||||
PseudoElementRuleProcessorData* pdata =
|
||||
static_cast<PseudoElementRuleProcessorData*>(data);
|
||||
if (!pdata->mPseudoElement && selector->mPseudoClassList) {
|
||||
// We can get here when calling getComputedStyle(aElt, aPseudo) if:
|
||||
//
|
||||
// * aPseudo is a pseudo-element that supports a user action
|
||||
// pseudo-class, like "::-moz-placeholder";
|
||||
// * there is a style rule that uses a pseudo-class on this
|
||||
// pseudo-element in the document, like ::-moz-placeholder:hover; and
|
||||
// * aElt does not have such a pseudo-element.
|
||||
//
|
||||
// We know that the selector can't match, since there is no element for
|
||||
// the user action pseudo-class to match against.
|
||||
return;
|
||||
}
|
||||
if (!StateSelectorMatches(pdata->mPseudoElement, aSelector, nodeContext,
|
||||
data->mTreeMatchContext)) {
|
||||
return;
|
||||
|
|
|
@ -491,11 +491,6 @@ struct MOZ_STACK_CLASS PseudoElementRuleProcessorData :
|
|||
"invalid aPseudoType value");
|
||||
NS_PRECONDITION(aTreeMatchContext.mForStyling, "Styling here!");
|
||||
NS_PRECONDITION(aRuleWalker, "Must have rule walker");
|
||||
NS_PRECONDITION(!(!aPseudoElement &&
|
||||
nsCSSPseudoElements::PseudoElementSupportsUserActionState
|
||||
(aPseudoType)),
|
||||
"aPseudoElement must be specified if the pseudo supports "
|
||||
":hover and :active");
|
||||
}
|
||||
|
||||
nsCSSPseudoElements::Type mPseudoType;
|
||||
|
|
Загрузка…
Ссылка в новой задаче