mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1089463 - Clear an element's restyle bits when inserting into a shadow tree. r=bzbarsky
This commit is contained in:
parent
8fe06c507c
commit
1c25371123
@ -1469,7 +1469,17 @@ Element::BindToTree(nsIDocument* aDocument, nsIContent* aParent,
|
||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES |
|
||||
// And the restyle bits
|
||||
ELEMENT_ALL_RESTYLE_FLAGS);
|
||||
} else if (!IsInShadowTree()) {
|
||||
} else if (IsInShadowTree()) {
|
||||
// We're not in a document, but we did get inserted into a shadow tree.
|
||||
// Since we won't have any restyle data in the document's restyle trackers,
|
||||
// don't let us get inserted with restyle bits set incorrectly.
|
||||
//
|
||||
// Also clear all the other flags that are cleared above when we do get
|
||||
// inserted into a document.
|
||||
UnsetFlags(NODE_FORCE_XBL_BINDINGS |
|
||||
NODE_NEEDS_FRAME | NODE_DESCENDANTS_NEED_FRAMES |
|
||||
ELEMENT_ALL_RESTYLE_FLAGS);
|
||||
} else {
|
||||
// If we're not in the doc and not in a shadow tree,
|
||||
// update our subtree pointer.
|
||||
SetSubtreeRootPointer(aParent->SubtreeRoot());
|
||||
|
20
layout/style/crashtests/1089463-1.html
Normal file
20
layout/style/crashtests/1089463-1.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<div></div>
|
||||
<script>
|
||||
window.onload = function() {
|
||||
var div = document.querySelector("div");
|
||||
var shadow = div.createShadowRoot();
|
||||
shadow.innerHTML = "<p style='display: none'><span><i>x</i></span></p>";
|
||||
var p = shadow.lastChild;
|
||||
var span = p.firstChild;
|
||||
var i = span.firstChild;
|
||||
|
||||
span.style.color = 'blue';
|
||||
p.remove();
|
||||
|
||||
document.body.offsetTop;
|
||||
|
||||
shadow.appendChild(p);
|
||||
i.style.color = 'red';
|
||||
};
|
||||
</script>
|
@ -109,5 +109,6 @@ pref(dom.webcomponents.enabled,true) load 1017798-1.html
|
||||
load 1028514-1.html
|
||||
load 1066089-1.html
|
||||
load 1074651-1.html
|
||||
pref(dom.webcomponents.enabled,true) load 1089463-1.html
|
||||
load large_border_image_width.html
|
||||
load border-image-visited-link.html
|
||||
|
Loading…
Reference in New Issue
Block a user