зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1315889 - stylo: don't try to restyle elements that have been removed from the document. r=emilio
MozReview-Commit-ID: EiFS1KAKAj6
This commit is contained in:
Родитель
1b5c96f9f7
Коммит
ff10ad8bc2
|
@ -366,6 +366,15 @@ ServoRestyleManager::ProcessPendingRestyles()
|
||||||
ServoElementSnapshot* snapshot = iter.UserData();
|
ServoElementSnapshot* snapshot = iter.UserData();
|
||||||
Element* element = iter.Key();
|
Element* element = iter.Key();
|
||||||
|
|
||||||
|
// The element is no longer in the document, so don't bother computing
|
||||||
|
// a final restyle hint for it.
|
||||||
|
//
|
||||||
|
// XXXheycam RestyleTracker checks that the element's GetComposedDoc()
|
||||||
|
// matches the document we're restyling. Do we need to do that too?
|
||||||
|
if (!element->IsInComposedDoc()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: avoid the ComputeRestyleHint call if we already have the highest
|
// TODO: avoid the ComputeRestyleHint call if we already have the highest
|
||||||
// explicit restyle hint?
|
// explicit restyle hint?
|
||||||
nsRestyleHint hint = styleSet->ComputeRestyleHint(element, snapshot);
|
nsRestyleHint hint = styleSet->ComputeRestyleHint(element, snapshot);
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
.x { color: blue; }
|
||||||
|
</style>
|
||||||
|
<div class=x>hello</div>
|
||||||
|
<script>
|
||||||
|
document.body.offsetWidth;
|
||||||
|
var x = document.querySelector(".x");
|
||||||
|
x.className = "";
|
||||||
|
x.remove();
|
||||||
|
document.body.offsetWidth;
|
||||||
|
</script>
|
|
@ -160,4 +160,5 @@ pref(dom.animations-api.core.enabled,true) load 1290994-2.html
|
||||||
pref(dom.animations-api.core.enabled,true) load 1290994-3.html
|
pref(dom.animations-api.core.enabled,true) load 1290994-3.html
|
||||||
load 1290994-4.html
|
load 1290994-4.html
|
||||||
load 1314531.html
|
load 1314531.html
|
||||||
|
load 1315889-1.html
|
||||||
load 1315894-1.html
|
load 1315894-1.html
|
||||||
|
|
Загрузка…
Ссылка в новой задаче