Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Issue 243403006: Implement contextmenu attribute with basic support of <menu> (Closed)

Created:
6 years, 8 months ago by pals
Modified:
6 years, 4 months ago
Reviewers:
tkent, esprehn, Inactive
CC:
adamk+blink_chromium.org, arv+blink, blink-reviews, dglazkov+blink, watchdog-blink-watchlist_google.com, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Implement contextmenu attribute with basic support of <menu>. This CL implements <menu> element of popup type. The rest of the specification will be implemented as follow up CLs. contextmenu attribute which enables web pages to specify custom context menu along with or in place of default platform context menu for a particular element. The value of the contextmenu attribute must be the ID of menu element with type popup. Specifications: http://www.whatwg.org/specs/web-apps/current-work/#context-menus Link to "Intent to implement": http://goo.gl/UtWWY8 BUG=87553

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Patch Set 3 : #

Total comments: 58

Patch Set 4 : #

Patch Set 5 : Added unit tests #

Total comments: 30

Patch Set 6 : #

Total comments: 8

Patch Set 7 : Added RuntimeEnabledFeature flag #

Total comments: 4

Patch Set 8 : Added runtime enabled checks #

Total comments: 36

Patch Set 9 : Fixed nits #

Patch Set 10 : Rebased #

Patch Set 11 : Rebased global-constructors-listing-expected.txt #

Total comments: 68

Patch Set 12 : Move to oilpan #

Total comments: 54

Patch Set 13 : Addressed review comments #

Total comments: 56

Patch Set 14 : Added few more tests and fixed comments #

Patch Set 15 : Oilpan #

Patch Set 16 : Added test for RelatedEvent constructors #

Total comments: 11

Patch Set 17 : Reflect HTMLMenuElement as per spec #

Unified diffs Side-by-side diffs Delta from patch set Stats (+767 lines, -3 lines) Patch
A LayoutTests/fast/dom/HTMLElement/contextmenu.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/HTMLElement/contextmenu-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +25 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/HTMLElement/script-tests/contextmenu.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +52 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +12 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/domstring-attribute-reflection.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +120 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/script-tests/boolean-attribute-reflection.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/constructors/related-event-constructor.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +56 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/constructors/related-event-constructor-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +36 lines, -0 lines 0 comments Download
M LayoutTests/webexposed/global-constructors-listing-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +10 lines, -0 lines 0 comments Download
M Source/core/events/Event.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/events/Event.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -0 lines 0 comments Download
A Source/core/events/RelatedEvent.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +46 lines, -0 lines 0 comments Download
A Source/core/events/RelatedEvent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +58 lines, -0 lines 0 comments Download
A Source/core/events/RelatedEvent.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M Source/core/html/HTMLAttributeNames.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/html/HTMLElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +20 lines, -0 lines 0 comments Download
M Source/core/html/HTMLElement.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLMenuElement.idl View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
A Source/core/html/HTMLMenuItemElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +22 lines, -0 lines 0 comments Download
A Source/core/html/HTMLMenuItemElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +20 lines, -0 lines 0 comments Download
A Source/core/html/HTMLMenuItemElement.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -0 lines 0 comments Download
M Source/core/html/HTMLTagNames.in View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/page/ContextMenuController.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/page/ContextMenuController.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +28 lines, -2 lines 0 comments Download
A Source/core/page/ContextMenuControllerTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +79 lines, -0 lines 0 comments Download
A Source/core/page/CustomContextMenuProvider.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +42 lines, -0 lines 0 comments Download
A Source/core/page/CustomContextMenuProvider.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +81 lines, -0 lines 0 comments Download
M Source/platform/RuntimeEnabledFeatures.in View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 55 (0 generated)
pals
This is a initial WIP patch. https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp File Source/core/page/ContextMenuController.cpp (right): https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp#newcode97 Source/core/page/ContextMenuController.cpp:97: m_menuProvider = menuElement->getCustomProvider(); ...
6 years, 8 months ago (2014-04-21 11:17:46 UTC) #1
esprehn
https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp File Source/core/page/ContextMenuController.cpp (right): https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp#newcode93 Source/core/page/ContextMenuController.cpp:93: if (menuElement && menuElement->hasTagName(HTMLNames::menuTag)) { This code doesn't make ...
6 years, 8 months ago (2014-04-21 16:42:01 UTC) #2
pals
please review the rest of the patch. https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp File Source/core/page/ContextMenuController.cpp (right): https://codereview.chromium.org/243403006/diff/1/Source/core/page/ContextMenuController.cpp#newcode93 Source/core/page/ContextMenuController.cpp:93: if (menuElement ...
6 years, 8 months ago (2014-04-22 13:52:53 UTC) #3
pals
Friendly ping. PTAL.
6 years, 7 months ago (2014-04-30 12:41:58 UTC) #4
esprehn
On 2014/04/30 12:41:58, sanjoy.pal wrote: > Friendly ping. PTAL. This needs a more detailed description. ...
6 years, 7 months ago (2014-05-20 04:54:34 UTC) #5
pals
On 2014/05/20 04:54:34, esprehn wrote: > On 2014/04/30 12:41:58, sanjoy.pal wrote: > > Friendly ping. ...
6 years, 7 months ago (2014-05-20 05:17:49 UTC) #6
esprehn
This needs tests, it also contains a bunch of bad casts (security bugs). https://codereview.chromium.org/243403006/diff/60001/Source/core/events/RelatedEvent.cpp File ...
6 years, 7 months ago (2014-05-20 05:51:34 UTC) #7
pals
Updated the patch. Tests are pending. Please review. https://codereview.chromium.org/243403006/diff/60001/Source/core/events/RelatedEvent.cpp File Source/core/events/RelatedEvent.cpp (right): https://codereview.chromium.org/243403006/diff/60001/Source/core/events/RelatedEvent.cpp#newcode21 Source/core/events/RelatedEvent.cpp:21: */ ...
6 years, 7 months ago (2014-05-21 07:55:11 UTC) #8
ojan
On 2014/05/21 07:55:11, sanjoy.pal wrote: > Updated the patch. Tests are pending. Please review. Reviewers ...
6 years, 7 months ago (2014-05-22 03:02:10 UTC) #9
pals
Added both unit tests and browser tests in chromium side https://codereview.chromium.org/296153008/. PTAL.
6 years, 7 months ago (2014-05-23 15:18:17 UTC) #10
pals
On 2014/05/23 15:18:17, sanjoy.pal wrote: > Added both unit tests and browser tests in chromium ...
6 years, 6 months ago (2014-06-03 13:58:57 UTC) #11
esprehn
https://codereview.chromium.org/243403006/diff/120001/Source/core/events/RelatedEvent.cpp File Source/core/events/RelatedEvent.cpp (right): https://codereview.chromium.org/243403006/diff/120001/Source/core/events/RelatedEvent.cpp#newcode11 Source/core/events/RelatedEvent.cpp:11: : relatedTarget(nullptr) You don't need this, RefPtr initializes itself ...
6 years, 6 months ago (2014-06-06 22:30:42 UTC) #12
pals
Updated the patch after addressing the review comments. Please take another look. https://codereview.chromium.org/243403006/diff/120001/Source/core/events/RelatedEvent.cpp File Source/core/events/RelatedEvent.cpp ...
6 years, 6 months ago (2014-06-10 10:42:40 UTC) #13
pals
On 2014/06/10 10:42:40, sanjoy.pal wrote: > Updated the patch after addressing the review comments. Please ...
6 years, 6 months ago (2014-06-11 05:16:38 UTC) #14
esprehn
This is looking better, but you're missing a lot of stuff from the spec. Also ...
6 years, 6 months ago (2014-06-20 08:39:57 UTC) #15
pals
Updated the patch as per comments. Please check. https://codereview.chromium.org/243403006/diff/220001/Source/core/html/CustomContextMenuProvider.cpp File Source/core/html/CustomContextMenuProvider.cpp (right): https://codereview.chromium.org/243403006/diff/220001/Source/core/html/CustomContextMenuProvider.cpp#newcode22 Source/core/html/CustomContextMenuProvider.cpp:22: if ...
6 years, 6 months ago (2014-06-20 14:22:11 UTC) #16
pals
Hi Esprehn, Please take another look. It has only one minor change from last patch.
6 years, 5 months ago (2014-07-03 06:47:03 UTC) #17
esprehn
https://codereview.chromium.org/243403006/diff/280001/Source/core/html/HTMLTagNames.in File Source/core/html/HTMLTagNames.in (right): https://codereview.chromium.org/243403006/diff/280001/Source/core/html/HTMLTagNames.in#newcode85 Source/core/html/HTMLTagNames.in:85: menuitem interfaceName=HTMLMenuItemElement This needs runtimeEnabled otherwise the parser will ...
6 years, 5 months ago (2014-07-14 08:56:48 UTC) #18
esprehn
https://codereview.chromium.org/243403006/diff/280001/Source/core/page/ContextMenuController.cpp File Source/core/page/ContextMenuController.cpp (right): https://codereview.chromium.org/243403006/diff/280001/Source/core/page/ContextMenuController.cpp#newcode90 Source/core/page/ContextMenuController.cpp:90: if (node && node->isHTMLElement()) { This needs to be ...
6 years, 5 months ago (2014-07-14 08:57:51 UTC) #19
pals
Fixed the comments. Please review. https://codereview.chromium.org/243403006/diff/280001/Source/core/html/HTMLTagNames.in File Source/core/html/HTMLTagNames.in (right): https://codereview.chromium.org/243403006/diff/280001/Source/core/html/HTMLTagNames.in#newcode85 Source/core/html/HTMLTagNames.in:85: menuitem interfaceName=HTMLMenuItemElement On 2014/07/14 ...
6 years, 5 months ago (2014-07-14 13:10:41 UTC) #20
pals
Rebased and fixed the review comments. Please review.
6 years, 5 months ago (2014-07-14 13:11:52 UTC) #21
pals
The CQ bit was checked by sanjoy.pal@samsung.com
6 years, 5 months ago (2014-07-16 03:54:19 UTC) #22
pals
The CQ bit was unchecked by sanjoy.pal@samsung.com
6 years, 5 months ago (2014-07-16 03:54:21 UTC) #23
esprehn
All the builders went red?
6 years, 5 months ago (2014-07-16 19:37:59 UTC) #24
Inactive
On 2014/07/16 19:37:59, esprehn wrote: > All the builders went red? webexposed/global-constructors-listing.html needs rebaselining.
6 years, 5 months ago (2014-07-16 19:40:46 UTC) #25
Inactive
A few drive-by comments. https://codereview.chromium.org/243403006/diff/300001/Source/core/events/RelatedEvent.h File Source/core/events/RelatedEvent.h (right): https://codereview.chromium.org/243403006/diff/300001/Source/core/events/RelatedEvent.h#newcode27 Source/core/events/RelatedEvent.h:27: virtual ~RelatedEvent() { } nit: ...
6 years, 5 months ago (2014-07-16 20:07:27 UTC) #26
pals
Fixed the review comments. Please review. https://codereview.chromium.org/243403006/diff/300001/Source/core/events/RelatedEvent.h File Source/core/events/RelatedEvent.h (right): https://codereview.chromium.org/243403006/diff/300001/Source/core/events/RelatedEvent.h#newcode27 Source/core/events/RelatedEvent.h:27: virtual ~RelatedEvent() { ...
6 years, 5 months ago (2014-07-17 15:35:48 UTC) #27
pals
Esprehn, Chris: Please take another look.
6 years, 5 months ago (2014-07-22 06:07:27 UTC) #28
esprehn
Your bubbles are still all red.
6 years, 5 months ago (2014-07-23 01:27:29 UTC) #29
pals
Now all are green.
6 years, 5 months ago (2014-07-23 06:49:54 UTC) #30
Inactive
+tkent (instead of Ojan who is doing code yellow) as reviewer.
6 years, 5 months ago (2014-07-23 13:46:32 UTC) #31
Inactive
https://codereview.chromium.org/243403006/diff/380001/Source/core/events/RelatedEvent.cpp File Source/core/events/RelatedEvent.cpp (right): https://codereview.chromium.org/243403006/diff/380001/Source/core/events/RelatedEvent.cpp#newcode8 Source/core/events/RelatedEvent.cpp:8: namespace WebCore { s/WebCore/blink https://codereview.chromium.org/243403006/diff/380001/Source/core/events/RelatedEvent.cpp#newcode18 Source/core/events/RelatedEvent.cpp:18: PassRefPtr<RelatedEvent> RelatedEvent::create(const AtomicString& ...
6 years, 5 months ago (2014-07-23 14:19:09 UTC) #32
pals
Moved to oilpan types. PTAL. https://codereview.chromium.org/243403006/diff/380001/Source/core/events/RelatedEvent.cpp File Source/core/events/RelatedEvent.cpp (right): https://codereview.chromium.org/243403006/diff/380001/Source/core/events/RelatedEvent.cpp#newcode8 Source/core/events/RelatedEvent.cpp:8: namespace WebCore { On ...
6 years, 5 months ago (2014-07-24 10:49:27 UTC) #33
tkent
What's your plan about |icon| and |command| IDL attributes of HMTLMenuItem element?
6 years, 5 months ago (2014-07-25 00:58:29 UTC) #34
tkent
On 2014/07/25 00:58:29, tkent wrote: > What's your plan about |icon| and |command| IDL attributes ...
6 years, 5 months ago (2014-07-25 01:03:47 UTC) #35
pals
On 2014/07/25 01:03:47, tkent wrote: > On 2014/07/25 00:58:29, tkent wrote: > > What's your ...
6 years, 5 months ago (2014-07-25 01:51:24 UTC) #36
tkent
On 2014/07/25 01:51:24, sanjoy.pal wrote: > On 2014/07/25 01:03:47, tkent wrote: > > On 2014/07/25 ...
6 years, 5 months ago (2014-07-25 02:16:38 UTC) #37
pals
On 2014/07/25 02:16:38, tkent wrote: > On 2014/07/25 01:51:24, sanjoy.pal wrote: > > On 2014/07/25 ...
6 years, 5 months ago (2014-07-25 03:37:39 UTC) #38
tkent
> Updated the description and showing icons in context menu are supported on all > ...
6 years, 5 months ago (2014-07-25 03:41:40 UTC) #39
tkent
https://codereview.chromium.org/243403006/diff/440001/Source/core/events/RelatedEvent.h File Source/core/events/RelatedEvent.h (right): https://codereview.chromium.org/243403006/diff/440001/Source/core/events/RelatedEvent.h#newcode20 Source/core/events/RelatedEvent.h:20: { The function implementation should be moved to RelatedEvent.cpp ...
6 years, 5 months ago (2014-07-25 04:42:39 UTC) #40
tkent
https://codereview.chromium.org/243403006/diff/440001/Source/core/html/HTMLElement.h File Source/core/html/HTMLElement.h (right): https://codereview.chromium.org/243403006/diff/440001/Source/core/html/HTMLElement.h#newcode99 Source/core/html/HTMLElement.h:99: HTMLMenuElement* menuElement() const; On 2014/07/25 04:42:38, tkent wrote: > ...
6 years, 5 months ago (2014-07-25 04:46:58 UTC) #41
pals
Fixed the review comments as suggested. PTAL. https://codereview.chromium.org/243403006/diff/440001/Source/core/events/RelatedEvent.h File Source/core/events/RelatedEvent.h (right): https://codereview.chromium.org/243403006/diff/440001/Source/core/events/RelatedEvent.h#newcode20 Source/core/events/RelatedEvent.h:20: { On ...
6 years, 4 months ago (2014-07-30 09:47:45 UTC) #42
tkent
It looks you're working with old checkout. Please rebase. https://codereview.chromium.org/243403006/diff/470001/Source/core/events/RelatedEvent.idl File Source/core/events/RelatedEvent.idl (right): https://codereview.chromium.org/243403006/diff/470001/Source/core/events/RelatedEvent.idl#newcode6 Source/core/events/RelatedEvent.idl:6: ...
6 years, 4 months ago (2014-07-31 06:07:57 UTC) #43
tkent
https://codereview.chromium.org/243403006/diff/440001/Source/core/html/CustomContextMenuProvider.cpp File Source/core/html/CustomContextMenuProvider.cpp (right): https://codereview.chromium.org/243403006/diff/440001/Source/core/html/CustomContextMenuProvider.cpp#newcode39 Source/core/html/CustomContextMenuProvider.cpp:39: RefPtrWillBeRawPtr<SimulatedMouseEvent> click = SimulatedMouseEvent::create(EventTypeNames::click, m_menu->document().domWindow(), Event::create()); On 2014/07/30 09:47:43, ...
6 years, 4 months ago (2014-07-31 06:10:47 UTC) #44
pals
On 2014/07/31 06:10:47, tkent wrote: > https://codereview.chromium.org/243403006/diff/440001/Source/core/html/CustomContextMenuProvider.cpp > File Source/core/html/CustomContextMenuProvider.cpp (right): > > https://codereview.chromium.org/243403006/diff/440001/Source/core/html/CustomContextMenuProvider.cpp#newcode39 > ...
6 years, 4 months ago (2014-07-31 09:29:21 UTC) #45
tkent
On 2014/07/31 09:29:21, sanjoy.pal wrote: > > I'm asking why 'click'. We should not dispatch ...
6 years, 4 months ago (2014-07-31 12:51:30 UTC) #46
pals
On 2014/07/31 12:51:30, tkent wrote: > On 2014/07/31 09:29:21, sanjoy.pal wrote: > > > I'm ...
6 years, 4 months ago (2014-08-01 05:33:14 UTC) #47
pals
Fixed the comments and added few more test cases. Please review. https://codereview.chromium.org/243403006/diff/470001/Source/core/events/RelatedEvent.idl File Source/core/events/RelatedEvent.idl (right): ...
6 years, 4 months ago (2014-08-01 10:03:08 UTC) #48
tkent
https://codereview.chromium.org/243403006/diff/470001/Source/core/events/RelatedEvent.idl File Source/core/events/RelatedEvent.idl (right): https://codereview.chromium.org/243403006/diff/470001/Source/core/events/RelatedEvent.idl#newcode6 Source/core/events/RelatedEvent.idl:6: EventConstructor, On 2014/08/01 10:03:07, sanjoy.pal wrote: > On 2014/07/31 ...
6 years, 4 months ago (2014-08-04 02:26:12 UTC) #49
pals
I am not sure if it still conforms to spec. Can you please point me ...
6 years, 4 months ago (2014-08-04 08:58:27 UTC) #50
tkent
On 2014/08/04 08:58:27, sanjoy.pal wrote: > I am not sure if it still conforms to ...
6 years, 4 months ago (2014-08-04 09:02:06 UTC) #51
pals
On 2014/08/04 09:02:06, tkent wrote: > On 2014/08/04 08:58:27, sanjoy.pal wrote: > > I am ...
6 years, 4 months ago (2014-08-04 09:34:33 UTC) #52
tkent
Before this CL, I recommend to update MakeMenuItemStringsFor() in event_sender.cc so that it appends actual ...
6 years, 4 months ago (2014-08-05 02:33:23 UTC) #53
tkent
> Can you please tell me some test which would fail with the current > ...
6 years, 4 months ago (2014-08-05 02:34:37 UTC) #54
tkent
6 years, 4 months ago (2014-08-05 22:34:06 UTC) #55
This CL still needs a lot of work.  I recommend to split this to multiple CLs to
proceed smoothly.

1. RuntimeEnabledFeatures.in

2. RelatedEvent and its tests

3. Addition of <menuitem>, HTMLMenuItemElement, new HTMLMenuElement IDL
attributes, and their tests

4. Remaining

Powered by Google App Engine
This is Rietveld 408576698