Bug 913292 - Make sure that nsIFrame::AttributeChanged is only called after any final changes that Element::AfterSetAttr may make. r=bz

This commit is contained in:
Jonathan Watt 2013-09-10 17:17:51 +01:00
Родитель 17392fdc76
Коммит ba91cea8e3
4 изменённых файлов: 31 добавлений и 4 удалений

Просмотреть файл

@ -1712,10 +1712,6 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
UpdateState(aNotify);
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, aModType);
}
if (aCallAfterSetAttr) {
rv = AfterSetAttr(aNamespaceID, aName, &aValueForAfterSetAttr, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
@ -1726,6 +1722,10 @@ Element::SetAttrAndNotify(int32_t aNamespaceID,
}
}
if (aNotify) {
nsNodeUtils::AttributeChanged(this, aNamespaceID, aName, aModType);
}
if (aFireMutation) {
nsMutationEvent mutation(true, NS_MUTATION_ATTRMODIFIED);

Просмотреть файл

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<input type=range value=100 max=100>
</body>
</html>

Просмотреть файл

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="reftest-wait">
<!-- Test: when changing the 'max' IDL property, the thumb of the range
should be moved to the appropriate position. This test also
sets the max to less than the current value which checks that the
rendering code handles repositioning correctly in the case that
sanitization of the value is needed for a non-value change. -->
<script type="text/javascript">
function setValue()
{
document.getElementById('i').max = "10";
document.documentElement.className = '';
}
document.addEventListener("MozReftestInvalidate", setValue);
setTimeout(setValue, 2000); // useful when not running under reftest suite
</script>
<body>
<input type=range id='i' max=100>
</body>
</html>

Просмотреть файл

@ -23,6 +23,7 @@ default-preferences pref(dom.experimental_forms_range,true)
== stepDown.html 75pct-common-ref.html
== stepUp-unthemed.html 75pct-unthemed-common-ref.html
== stepUp.html 75pct-common-ref.html
== max-prop.html 100pct-common-ref.html
# 'direction' property:
== direction-unthemed-1.html direction-unthemed-1-ref.html