Bug 1022741 - Use CrossShadowCurrentDoc() in Element::UpdateState. r=smaug

This commit is contained in:
William Chen 2014-06-10 14:41:31 -07:00
parent d0501e85e9
commit 4ea70e9814
5 changed files with 32 additions and 2 deletions

View File

@ -216,7 +216,7 @@ Element::UpdateState(bool aNotify)
if (aNotify) {
EventStates changedStates = oldState ^ mState;
if (!changedStates.IsEmpty()) {
nsIDocument* doc = GetCurrentDoc();
nsIDocument* doc = GetCrossShadowCurrentDoc();
if (doc) {
nsAutoScriptBlocker scriptBlocker;
doc->ContentStateChanged(this, changedStates);

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<input type="checkbox" checked><div style="height: 50px; width: 50px; background: green;"></div>
</body>
</html>

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
</head>
<body>
<div id="host"></div>
<script>
var host = document.getElementById("host");
var root = host.createShadowRoot();
root.innerHTML = '<style>input ~ div { background: red; transition: background 100ms; } input:checked ~ div { background: green; }</style><input id="one" type="checkbox"><div style="height: 50px; width: 50px;"></div>';
function tweak() {
var el = root.getElementById("one");
el.checked = true;
el.nextSibling.addEventListener("transitionend", function() {
document.documentElement.removeAttribute("class");
}, false);
}
window.addEventListener("MozReftestInvalidate", tweak, false);
</script>
</body>
</html>

View File

@ -13,3 +13,4 @@ pref(dom.webcomponents.enabled,true) == nested-insertion-point-1.html nested-ins
pref(dom.webcomponents.enabled,true) == basic-shadow-element-1.html basic-shadow-element-1-ref.html
pref(dom.webcomponents.enabled,true) == nested-shadow-element-1.html nested-shadow-element-1-ref.html
pref(dom.webcomponents.enabled,true) == update-dist-node-descendants-1.html update-dist-node-descendants-1-ref.html
pref(dom.webcomponents.enabled,true) random-if(B2G&&browserIsRemote) == input-transition-1.html input-transition-1-ref.html # Failure on B2G emulator due to Bug 1018381

View File

@ -943,7 +943,7 @@ nsTransitionManager::FlushTransitions(FlushFlags aFlags)
CommonElementAnimationData::CanAnimateFlags(0)) &&
et->CanThrottleAnimation(now);
NS_ABORT_IF_FALSE(et->mElement->GetCurrentDoc() ==
NS_ABORT_IF_FALSE(et->mElement->GetCrossShadowCurrentDoc() ==
mPresContext->Document(),
"Element::UnbindFromTree should have "
"destroyed the element transitions object");