Closed Bug 888145 Opened 11 years ago Closed 11 years ago

onLocationChange top level window check doesn't work for "browser" webapps

Categories

(Firefox for Android Graveyard :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 25

People

(Reporter: wesj, Assigned: wesj)

Details

Attachments

(1 file, 1 obsolete file)

Attached file Patch v1 (obsolete) —
While looking at running Gaia in Fennec, I ran into an issue where mouse click events were never being fired. Turns out the problem was that we have a check in onLocationChange for

if (window != window.top)
  return;

This incorrectly passes here because I'm running all of the Gaia apps inside the Gaia "System" app, which essentially acts as a browser/window manager. B2G has added protections so that apps loaded inside the system app (or other browser like apps) can not reach across this new "chrome-content" boundary.

We have a better check for "Is this window the top level window in one of our tabs?". Its likely a little more expensive, but we could just use it instead.
Attachment #768735 - Flags: review?(mark.finkle)
To explain why this kills clicks, if we fall through here we set tab.contentDocumentIsDisplayed = false (who named that variable?). That would normally be unset on first-paint of the page, but because its embedded inside a different page, that never fires. We apparently don't send mouse events to content before first paint anymore, so this bustage keeps them from ever firing (although we don't apply the same filter to touch events, so they work fine).
Attached patch Patch v2Splinter Review
Whoops. Wrong function.
Attachment #768735 - Attachment is obsolete: true
Attachment #768735 - Flags: review?(mark.finkle)
Attachment #768773 - Flags: review?(mark.finkle)
Comment on attachment 768773 [details] [diff] [review]
Patch v2

Do we have other checks that could be hosed because of this?
Attachment #768773 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/d1747bb1054c
Assignee: nobody → wjohnston
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: