Closed Bug 1244462 Opened 8 years ago Closed 8 years ago

"Save Page to Pocket" menu should not appear at the top of selected text menu

Categories

(Firefox :: Pocket, defect)

46 Branch
x86_64
Windows 10
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 47
Tracking Status
firefox45 --- ?
firefox46 + fixed
firefox47 --- fixed

People

(Reporter: jack, Unassigned)

References

Details

(Keywords: regression)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160128004012

Steps to reproduce:

Right click after selecting some text on any webpage. The context menu opens, with the 'Save Page to Pocket' button at the top, which breaks my workflow.


Actual results:

The 'Save Page to Pocket' option appeared at the top of the menu.


Expected results:

The 'Copy' button should be on top, and the 'Save Page To Pocket' button should either be lower down, or not appear at all (I'm copying text, I doubt I'll want to save a webpage at that point).
Severity: normal → enhancement
Component: Untriaged → Pocket
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
GIF Demonstration of issue
Blocks: 1215694
Severity: enhancement → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
See Also: → 1241264
Summary: Save Page to Pocket appears when copying text and at top of menu → "Save Page to Pocket" menu should not appear at the top of selected text menu
Tracking since this is a regression likely in 46.
This is a result of using the "on-build-contextmenu" observer to add/update menu items for the addon.  It relies on this.isContentSelected, which is used before it is set.  Patch coming.
See Also: 1241264
This should probably not remove the current location of the setter because the observers might change the selection.
good point.  though it would be PITA to have your selection change in the midst of a context click.
(In reply to Shane Caraveo (:mixedpuppy) from comment #7)
> good point.  though it would be PITA to have your selection change in the
> midst of a context click.

I agree that doing it intentionally would be broken. I would just not be surprised if add-ons did it unintentionally and also if code did not like it if that flag was set but there was no selection.

Could even just define it as a getter, tbh... so it always accurately reflects what's going on with the document.
... though the document itself may in some cases also go away. For more such fun see bug 1025568.
Attachment #8717598 - Flags: review?(jaws) → review?(gijskruitbosch+bugs)
Comment on attachment 8717598 [details]
MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs

https://reviewboard.mozilla.org/r/34237/#review31033

::: browser/base/content/nsContextMenu.js
(Diff revision 1)
> -    this.isContentSelected = !this.selectionInfo.docSelectionIsCollapsed;

r=me with this left in.
Attachment #8717598 - Flags: review?(gijskruitbosch+bugs) → review+
Attachment #8717598 - Attachment description: MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r?jaws → MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs
Comment on attachment 8717598 [details]
MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/34237/diff/1-2/
Comment on attachment 8717598 [details]
MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs

https://reviewboard.mozilla.org/r/34237/#review31093
Attachment #8717598 - Flags: review+
https://hg.mozilla.org/integration/fx-team/rev/e0409d9febb6cfb7bbaca11563ce96bde6e38c64
Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs
https://hg.mozilla.org/mozilla-central/rev/e0409d9febb6
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47
Comment on attachment 8717598 [details]
MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs

Approval Request Comment
[Feature/regressing bug #]: 1190667
[User impact if declined]: users could get context menus that may not work
[Describe test coverage new/current, TreeHerder]: manual
[Risks and why]: low
[String/UUID change made/needed]: none
Attachment #8717598 - Flags: approval-mozilla-aurora?
Comment on attachment 8717598 [details]
MozReview Request: Bug 1244462 set isContentSelected before using it for the on-build-contextmenu notification, r=gijs

Recent regression, fix for menus. Please uplift to aurora.
Attachment #8717598 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
[bugday-20160323]

Status: RESOLVED,FIXED -> VERIFIED

Comments:
Test Successful

Component: 
Name			Firefox
Version			46.0b9
Build ID		20160322075646
Update Channel          beta
User Agent		Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
OS			Windows 7 SP1 x86_64

Expected Results: 
Yes

Actual Results: 
As expected
QA Whiteboard: [good first verify]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: