mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 703186 Use system event listener for focus/blur event handling for <area> element r=smaug
This commit is contained in:
parent
f3899264c7
commit
b65aeee9ac
@ -738,10 +738,10 @@ nsImageMap::FreeAreas()
|
||||
"Unexpected primary frame");
|
||||
area->mArea->SetPrimaryFrame(nsnull);
|
||||
|
||||
area->mArea->RemoveEventListener(NS_LITERAL_STRING("focus"), this,
|
||||
false);
|
||||
area->mArea->RemoveEventListener(NS_LITERAL_STRING("blur"), this,
|
||||
false);
|
||||
area->mArea->RemoveSystemEventListener(NS_LITERAL_STRING("focus"), this,
|
||||
false);
|
||||
area->mArea->RemoveSystemEventListener(NS_LITERAL_STRING("blur"), this,
|
||||
false);
|
||||
delete area;
|
||||
}
|
||||
mAreas.Clear();
|
||||
@ -859,10 +859,10 @@ nsImageMap::AddArea(nsIContent* aArea)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
//Add focus listener to track area focus changes
|
||||
aArea->AddEventListener(NS_LITERAL_STRING("focus"), this, false,
|
||||
false);
|
||||
aArea->AddEventListener(NS_LITERAL_STRING("blur"), this, false,
|
||||
false);
|
||||
aArea->AddSystemEventListener(NS_LITERAL_STRING("focus"), this, false,
|
||||
false);
|
||||
aArea->AddSystemEventListener(NS_LITERAL_STRING("blur"), this, false,
|
||||
false);
|
||||
|
||||
// This is a nasty hack. It needs to go away: see bug 135040. Once this is
|
||||
// removed, the code added to nsCSSFrameConstructor::RestyleElement,
|
||||
|
23
layout/reftests/bugs/703186-1-ref.html
Normal file
23
layout/reftests/bugs/703186-1-ref.html
Normal file
@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function init()
|
||||
{
|
||||
document.getElementById("link").focus();
|
||||
setTimeout(finish, 0);
|
||||
}
|
||||
|
||||
function finish()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(init, 0);">
|
||||
<img src="100x80-white-rect-top-right.png" usemap="#map">
|
||||
<map name="map">
|
||||
<area id="link" shape="rect" coords="10,10,30,30" href="about:blank">
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
25
layout/reftests/bugs/703186-1.html
Normal file
25
layout/reftests/bugs/703186-1.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function init()
|
||||
{
|
||||
window.addEventListener("focus", function (e) { e.stopPropagation(); },
|
||||
true);
|
||||
document.getElementById("link").focus();
|
||||
setTimeout(finish, 0);
|
||||
}
|
||||
|
||||
function finish()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(init, 0);">
|
||||
<img src="100x80-white-rect-top-right.png" usemap="#map">
|
||||
<map name="map">
|
||||
<area id="link" shape="rect" coords="10,10,30,30" href="about:blank">
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
29
layout/reftests/bugs/703186-2-ref.html
Normal file
29
layout/reftests/bugs/703186-2-ref.html
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function init()
|
||||
{
|
||||
document.getElementById("link").focus();
|
||||
setTimeout(doTest, 0);
|
||||
}
|
||||
|
||||
function doTest()
|
||||
{
|
||||
document.getElementById("link").blur();
|
||||
setTimeout(finish, 0);
|
||||
}
|
||||
|
||||
function finish()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(init, 0);">
|
||||
<img src="100x80-white-rect-top-right.png" usemap="#map">
|
||||
<map name="map">
|
||||
<area id="link" shape="rect" coords="10,10,30,30" href="about:blank">
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
31
layout/reftests/bugs/703186-2.html
Normal file
31
layout/reftests/bugs/703186-2.html
Normal file
@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
function init()
|
||||
{
|
||||
window.addEventListener("blur", function (e) { e.stopPropagation(); },
|
||||
true);
|
||||
document.getElementById("link").focus();
|
||||
setTimeout(doTest, 0);
|
||||
}
|
||||
|
||||
function doTest()
|
||||
{
|
||||
document.getElementById("link").blur();
|
||||
setTimeout(finish, 0);
|
||||
}
|
||||
|
||||
function finish()
|
||||
{
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="setTimeout(init, 0);">
|
||||
<img src="100x80-white-rect-top-right.png" usemap="#map">
|
||||
<map name="map">
|
||||
<area id="link" shape="rect" coords="10,10,30,30" href="about:blank">
|
||||
</map>
|
||||
</body>
|
||||
</html>
|
@ -1673,3 +1673,6 @@ fails-if(layersGPUAccelerated&&cocoaWidget) == 654950-1.html 654950-1-ref.html #
|
||||
== 691571-1.html 691571-1-ref.html
|
||||
== 696307-1.html 696307-1-ref.html
|
||||
== 696739-1.html 696739-1-ref.html
|
||||
needs-focus == 703186-1.html 703186-1-ref.html
|
||||
needs-focus == 703186-2.html 703186-2-ref.html
|
||||
needs-focus != 703186-1.html 703186-2.html
|
||||
|
Loading…
Reference in New Issue
Block a user