Bug 267569
Summary: | Quirks: ceac.state.gov requires document.activeElement to be HTMLInputElement | ||
---|---|---|---|
Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
Component: | WebKit Misc. | Assignee: | Karl Dubost <karlcow> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | akeerthi, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 17 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
URL: | http://ceac.state.gov/ | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=267623 https://bugs.webkit.org/show_bug.cgi?id=276709 https://bugs.webkit.org/show_bug.cgi?id=22261 |
||
Bug Depends on: | 193478, 267449 | ||
Bug Blocks: |
Karl Dubost
There is a webcompat issue created by a different behavior in between Firefox/Chrome on one side and Safari on the other side related to the way the OS is built.
It would be great if ceac.state.gov fixes the issue, but in the mean time, there is probably a need for a Quirk to solve it.
This is related to Bug 267449
`document.activeElement` for an `onclick` on a `<input type=checkbox>` returns HTMLBodyElement instead of HTMLInputElement
There is a beforeunload
if (window.addEventListener) {
window.addEventListener("beforeunload", ClearSession, false);
} else if (window.attachEvent) {
window.attachEvent("onbeforeunload", ClearSession)
}
It fires a ClearSession.
Which triggers
else if (document.location.pathname.indexOf("Default.aspx") < 0 &&
typeof document.activeElement != "undefined" &&
document.activeElement.toString().indexOf("HTMLBodyElement") > 0 ||
document.activeElement.toString().indexOf("HTMLInputElement") > 0) {
validNavigation = false;
}
And triggers:
this.ExitClearSession()
Which triggers the e.preventDefault()
if (validNavigation == false &&
e != undefined) {
if (ieMode == "True") {
e.returnValue = undefined;
} else {
e.preventDefault();
}
And when the return is happening at the end of ClearSession it opens the alert.
Firefox in the clear session is
} else if ((typeof document.activeElement != "undefined" &&
document.activeElement != "object" &&
typeof document.activeElement.name != "undefined") && (
document.activeElement.toString().indexOf("aspx") > 0 || //for the left menu exclusion
document.activeElement.name.indexOf("btn") > 0 || //check for button click
document.activeElement.name.indexOf("Button") > 0 ||
document.activeElement.type == "button") ||
document.activeElement.id.indexOf("cbx") > 0 ||
document.activeElement.id.indexOf("Radio") > 0 ||
document.activeElement.id.indexOf("radio") > 0 ||
document.activeElement.id.indexOf("chkbx") > 0 ||
document.activeElement.id.indexOf("Button") > 0 ||
document.activeElement.id.indexOf("button") > 0) { // for button
validNavigation = true;
Firefox: document.activeElement is input
Safari: document.activeElement is body
This will decide if validNavigation is true or false
And then will make WebKit fail for the next step.
For the purpose of this quirk, it is necessary that the document.activeElement returns HTMLInputElement at this stage.
This is not the first time that there is an issue with this site.
And probably the previous Quirks was done to solve this issue but this is not working anymore.
See Bug 193478
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/page/Quirks.cpp#130-141
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Karl Dubost
<rdar://110953808>
Karl Dubost
Pull request: https://github.com/WebKit/WebKit/pull/22854
EWS
Committed 273282@main (0b543cc9ff31): <https://commits.webkit.org/273282@main>
Reviewed commits have been landed. Closing PR #22854 and removing active labels.