mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 897491 - Update the display when the alt attribute of an image is added or removed. r=bz
This commit is contained in:
parent
e1a0ab9d61
commit
a5fb538393
@ -13,6 +13,7 @@
|
||||
#include "nsMappedAttributes.h"
|
||||
#include "nsSize.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIIOService.h"
|
||||
@ -251,6 +252,11 @@ HTMLImageElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
|
||||
if (aAttribute == nsGkAtoms::usemap ||
|
||||
aAttribute == nsGkAtoms::ismap) {
|
||||
NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
|
||||
} else if (aAttribute == nsGkAtoms::alt) {
|
||||
if (aModType == nsIDOMMutationEvent::ADDITION ||
|
||||
aModType == nsIDOMMutationEvent::REMOVAL) {
|
||||
NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
7
layout/reftests/bugs/897491-1-ref.html
Normal file
7
layout/reftests/bugs/897491-1-ref.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<body>
|
||||
<img id="img1" src="about:blank" alt="alt1">
|
||||
<img id="img2" src="about:blank">
|
||||
</body>
|
||||
</html>
|
15
layout/reftests/bugs/897491-1.html
Normal file
15
layout/reftests/bugs/897491-1.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html class="reftest-wait">
|
||||
<body>
|
||||
<img id="img1" src="about:blank">
|
||||
<img id="img2" src="about:blank" alt="alt2">
|
||||
<script>
|
||||
function doTest() {
|
||||
document.getElementById("img1").setAttribute("alt", "alt1");
|
||||
document.getElementById("img2").removeAttribute("alt");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
window.addEventListener("load", doTest, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
7
layout/reftests/bugs/897491-2-ref.html
Normal file
7
layout/reftests/bugs/897491-2-ref.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!--quirks mode test-->
|
||||
<html>
|
||||
<body>
|
||||
<img id="img1" src="about:blank" alt="alt1">
|
||||
<img id="img2" src="about:blank">
|
||||
</body>
|
||||
</html>
|
15
layout/reftests/bugs/897491-2.html
Normal file
15
layout/reftests/bugs/897491-2.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!--quirks mode test-->
|
||||
<html class="reftest-wait">
|
||||
<body>
|
||||
<img id="img1" src="about:blank">
|
||||
<img id="img2" src="about:blank" alt="alt2">
|
||||
<script>
|
||||
function doTest() {
|
||||
document.getElementById("img1").setAttribute("alt", "alt1");
|
||||
document.getElementById("img2").removeAttribute("alt");
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
window.addEventListener("load", doTest, false);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1772,3 +1772,5 @@ test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
|
||||
== 883987-1f.html 883987-1-ref.html
|
||||
== 890495-1.html 890495-1-ref.html
|
||||
== 894931-1.html 894931-1-ref.html
|
||||
== 897491-1.html 897491-1-ref.html
|
||||
== 897491-2.html 897491-2-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user