зеркало из https://github.com/mozilla/gecko-dev.git
Bug 575462 - Crash [@ nsDocument::AddToIdTable] with mutation events. r=sicking a2.0=blocking
This commit is contained in:
Родитель
3535a09d4b
Коммит
072da93f46
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
|
||||
<g id="a"><g id="b"/></g>
|
||||
|
||||
<script type="text/javascript">
|
||||
<![CDATA[
|
||||
|
||||
function j()
|
||||
{
|
||||
var a = document.getElementById("a");
|
||||
var b = document.getElementById("b");
|
||||
window.addEventListener("DOMAttrModified", k, true);
|
||||
function k()
|
||||
{
|
||||
window.removeEventListener("DOMAttrModified", k, true);
|
||||
a.appendChild(b);
|
||||
}
|
||||
b.removeAttribute("id");
|
||||
}
|
||||
|
||||
window.addEventListener("load", j, false);
|
||||
|
||||
]]>
|
||||
</script>
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 485 B |
|
@ -69,3 +69,4 @@ load 564079-1.html
|
|||
load 564114.html
|
||||
load 565125-1.html
|
||||
load 582601.html
|
||||
load 575462.svg
|
||||
|
|
|
@ -131,23 +131,28 @@ nsresult
|
|||
nsStyledElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify)
|
||||
{
|
||||
PRBool isId = PR_FALSE;
|
||||
if (aAttribute == nsGkAtoms::id && aNameSpaceID == kNameSpaceID_None) {
|
||||
// Have to do this before clearing flag. See RemoveFromIdTable
|
||||
RemoveFromIdTable();
|
||||
isId = PR_TRUE;
|
||||
}
|
||||
|
||||
nsMutationGuard guard;
|
||||
|
||||
nsresult rv = nsGenericElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
|
||||
return nsGenericElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
|
||||
}
|
||||
|
||||
if (isId &&
|
||||
(!guard.Mutated(0) || !HasAttr(kNameSpaceID_None, nsGkAtoms::id))) {
|
||||
nsresult
|
||||
nsStyledElement::AfterSetAttr(PRInt32 aNamespaceID, nsIAtom* aAttribute,
|
||||
const nsAString* aValue, PRBool aNotify)
|
||||
{
|
||||
if (aNamespaceID == kNameSpaceID_None && !aValue &&
|
||||
aAttribute == nsGkAtoms::id) {
|
||||
// The id has been removed when calling UnsetAttr but we kept it because
|
||||
// the id is used for some layout stuff between UnsetAttr and AfterSetAttr.
|
||||
// Now. the id is really removed so it would not be safe to keep this flag.
|
||||
UnsetFlags(NODE_HAS_ID);
|
||||
}
|
||||
|
||||
return rv;
|
||||
return nsGenericElement::AfterSetAttr(aNamespaceID, aAttribute, aValue,
|
||||
aNotify);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -80,6 +80,8 @@ public:
|
|||
|
||||
virtual nsresult UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
PRBool aNotify);
|
||||
virtual nsresult AfterSetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
|
||||
const nsAString* aValue, PRBool aNotify);
|
||||
|
||||
nsIDOMCSSStyleDeclaration* GetStyle(nsresult* retval);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче