mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 748803. Don't autofocus the Try Again button in error pages if the error page is not a toplevel page. r=mounir
This commit is contained in:
parent
c96eedd250
commit
6908ac2ac3
@ -394,7 +394,22 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Retry Button -->
|
<!-- Retry Button -->
|
||||||
<button id="errorTryAgain" autocomplete="off" onclick="retryThis(this);" autofocus="true">&retry.label;</button>
|
<button id="errorTryAgain" autocomplete="off" onclick="retryThis(this);">&retry.label;</button>
|
||||||
|
<script>
|
||||||
|
// Only do autofocus if we're the toplevel frame; otherwise we
|
||||||
|
// don't want to call attention to ourselves! The key part is
|
||||||
|
// that autofocus happens on insertion into the tree, so we
|
||||||
|
// can remove the button, add @autofocus, and reinsert the
|
||||||
|
// button.
|
||||||
|
if (window.top == window) {
|
||||||
|
var button = document.getElementById("errorTryAgain");
|
||||||
|
var nextSibling = button.nextSibling;
|
||||||
|
var parent = button.parentNode;
|
||||||
|
parent.removeChild(button);
|
||||||
|
button.setAttribute("autofocus", "true");
|
||||||
|
parent.insertBefore(button, nextSibling);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
8
layout/reftests/bugs/748803-1-ref.html
Normal file
8
layout/reftests/bugs/748803-1-ref.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="height: 100%;">
|
||||||
|
<body style="height: 100%;">
|
||||||
|
<!-- Make sure the div forces the frame off the screen by default -->
|
||||||
|
<div style="height: 200%"></div>
|
||||||
|
<iframe></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
8
layout/reftests/bugs/748803-1.html
Normal file
8
layout/reftests/bugs/748803-1.html
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html style="height: 100%;">
|
||||||
|
<body style="height: 100%;">
|
||||||
|
<!-- Make sure the div forces the frame off the screen by default -->
|
||||||
|
<div style="height: 200%"></div>
|
||||||
|
<iframe src="about:neterror"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1700,3 +1700,4 @@ fuzzy-if(d2d,1,19) fuzzy-if(cocoaWidget,1,170) == 718521.html 718521-ref.html
|
|||||||
needs-focus == 731726-1.html 731726-1-ref.html
|
needs-focus == 731726-1.html 731726-1-ref.html
|
||||||
== 735481-1.html 735481-1-ref.html
|
== 735481-1.html 735481-1-ref.html
|
||||||
== 745934-1.html 745934-1-ref.html
|
== 745934-1.html 745934-1-ref.html
|
||||||
|
== 748803-1.html 748803-1-ref.html
|
||||||
|
Loading…
Reference in New Issue
Block a user