Closed Bug 325644 Opened 19 years ago Closed 19 years ago

window.blur() fails on popup window in gtkmozembed

Categories

(Core Graveyard :: Embedding: GTK Widget, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ernstp, Assigned: benjamin)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.8) Gecko/20060130 Ubuntu/1.5.dfsg-4ubuntu6 Firefox/1.5 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; sv-SE; rv:1.8) Gecko/20060130 Ubuntu/1.5.dfsg-4ubuntu6 Firefox/1.5 window.blur() throws an exception in gtkmozembed which is not caught and kills the script, breaking webpages. is it implemented? the worst problem is on pages like this: window.blur() document.myForm.submit(); submit is never run. maybe just implement blur as a dummy? uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMWindowInternal.blur]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: http://helgon.net/guestbook/QuickMessage.asp?UserID=589312&UserName=BlaBlaBla&GuestBookID=17669269 :: SendGuestbook :: line 29" data: no] Reproducible: Always Steps to Reproduce: javascript:window.blur() in epiphany for example
Bug 149307 suggests that gtkmozembed's EmbedWindow class needs to implement nsIEmbeddingSiteWindow2, whose only method is ::Blur.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: mpgritti → benjamin
Status: NEW → ASSIGNED
Attachment #210518 - Flags: review?(jst)
Comment on attachment 210518 [details] [diff] [review] Don't throw on unimplemented blur(), rev. 1 - In nsGlobalWindow::Blur(): nsresult rv = NS_ERROR_FAILURE; nsCOMPtr<nsIDocShellTreeOwner> treeOwner; GetTreeOwner(getter_AddRefs(treeOwner)); nsCOMPtr<nsIEmbeddingSiteWindow2> siteWindow(do_GetInterface(treeOwner)); if (siteWindow) rv = siteWindow->Blur(); if (NS_SUCCEEDED(rv)) mDocShell->SetHasFocus(PR_FALSE); - return rv; + // If embedding apps don't implement nsIEmbeddingSiteWindow2, we + // shouldn't throw to web content. + return NS_OK; I'd recommend simply just changing what rv is initialized to instead, that way if the blur() function *does* throw an exception it'd make it out to JS rather than getting lost. r=jst with that change.
Attachment #210518 - Flags: review?(jst) → review+
Fixed on trunk. If somebody wants to make gtkmozembed implement nsIEmbeddingSiteWindow2 please file a separate bug.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: