Closed Bug 743421 Opened 12 years ago Closed 12 years ago

Anchor navigation resets click-to-play state

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 15
Tracking Status
firefox14 --- fixed

People

(Reporter: Felipe, Assigned: jaws)

References

Details

Attachments

(2 files, 2 obsolete files)

Anchor navigation or history.pushState resets the click-to-play state because OnLocationChange gets called. That causes subsequent plugins added to the page to not be activated and the doorhanger to show again for the same page
Attached patch Patch for bug (obsolete) (deleted) — Splinter Review
This patch fixes the case where anchor navigation and history.push/pop/replaceState.
Assignee: nobody → jwein
Status: NEW → ASSIGNED
Attachment #617990 - Flags: review?(felipc)
Attachment #617990 - Flags: review?(felipc) → review+
Comment on attachment 617990 [details] [diff] [review]
Patch for bug

New patches on the way that will come with tests.
Attachment #617990 - Flags: review+
Attached patch Tests for patch (obsolete) (deleted) — Splinter Review
Pushed to tryserver: https://tbpl.mozilla.org/?tree=Try&rev=c7eb352d46c5
Attachment #620810 - Flags: review?(felipc)
Attached patch Patch for bug v2 (deleted) — Splinter Review
I haven't found a scenario where parsing the URL for location changes does a better job than checking for a null aRequest. Running the browser-chrome tests locally didn't show any issues with it, and the push to try should shake out anything potentially wrong with this change.
Attachment #617990 - Attachment is obsolete: true
Attachment #620811 - Flags: review?(felipc)
Comment on attachment 620810 [details] [diff] [review]
Tests for patch

forgot to hg add
Attachment #620810 - Flags: review?(felipc)
Attached patch Tests for patch v2 (deleted) — Splinter Review
Repushed to tryserver: https://tbpl.mozilla.org/?tree=Try&rev=745fe786c531
Attachment #620810 - Attachment is obsolete: true
Attachment #620835 - Flags: review?
Attachment #620835 - Flags: review? → review?(felipc)
Attachment #620811 - Flags: review?(felipc) → review+
Attachment #620835 - Flags: review?(felipc) → review+
Comment on attachment 620811 [details] [diff] [review]
Patch for bug v2

It might be nice to add a comment explaining why you're null-checking aRequest (to filter out onLocationChanges triggered by anchor navigation, AIUI), since that isn't obvious from quickly glancing at the code.
Comment on attachment 620811 [details] [diff] [review]
Patch for bug v2

[Approval Request Comment]
Regression caused by (bug #): bug 711552

User impact if declined: 
Clicking on an anchor link within the page or if the page uses history.pushState API then the state of click-to-play plugins is reset. This is not a super high priority to get on Aurora, but it would be a nice-to-have since the feature is being introduced (preffed-off) on Aurora.

Testing completed (on m-c, etc.): Baked on m-c for a couple days
Risk to taking this patch (and alternatives if risky): None expected, there are tests that accompany this patch.
String changes made by this patch: none
Attachment #620811 - Flags: approval-mozilla-aurora?
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #9)
> Comment on attachment 620811 [details] [diff] [review]
> Patch for bug v2
> 
> It might be nice to add a comment explaining why you're null-checking
> aRequest (to filter out onLocationChanges triggered by anchor navigation,
> AIUI), since that isn't obvious from quickly glancing at the code.

Thanks for the feedback Gavin. I've added a comment and pushed it to inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/991d6c9dc2d9
Comment on attachment 620811 [details] [diff] [review]
Patch for bug v2

[Triage Comment]
We don't typically take fixes for pref'd off features, but since we've widely communicated how to enable it and this shouldn't cause any new regressions, approving for Aurora 14.
Attachment #620811 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment on attachment 620811 [details] [diff] [review]
Patch for bug v2

>   onLocationChange: function (aBrowser, aWebProgress, aRequest, aLocationURI,
>                               aFlags) {
>     // Filter out any sub-frame loads
>     if (aBrowser.contentWindow == aWebProgress.DOMWindow) {
>+      if (aRequest) {
I'm not sure that checking aRequest was ever a good way to detect an anchor scroll but for your information bug 311007 added a flag to do it properly.
Thanks Neil.
Depends on: 788584
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: