Bug 179020

Summary: [Touch Bar Web API] Add support for menuitem tag
Product: WebKit Reporter: Aishwarya Nirmal <anirmal>
Component: WebCore Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, cdumez, commit-queue, darin, esprehn+autocc, gyuyoung.kim, kondapallykalyan, rniwa, sam, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 178736    
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews103 for mac-elcapitan
none
Archive of layout-test-results from ews105 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews116 for mac-elcapitan
none
Archive of layout-test-results from ews123 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews100 for mac-elcapitan
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews115 for mac-elcapitan
none
Archive of layout-test-results from ews124 for ios-simulator-wk2
none
Patch
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Patch
none
Patch
none
Patch
none
Archive of layout-test-results from ews103 for mac-elcapitan
none
Archive of layout-test-results from ews112 for mac-elcapitan
none
Patch
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 none

Description Aishwarya Nirmal 2017-10-30 10:47:38 PDT
The Touch Bar API will make use of the HTML tags for menu and menuitem. Currently WebKit does not support menuitem, so this changes adds support for that tag.
Comment 1 Aishwarya Nirmal 2017-10-30 11:27:18 PDT
Created attachment 325362 [details]
Patch
Comment 2 Build Bot 2017-10-30 11:28:24 PDT
Attachment 325362 [details] did not pass style-queue:


ERROR: Source/WebCore/JSHTMLMenuitemElement.h:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
Total errors found: 1 in 11 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2017-10-30 11:34:49 PDT
Comment on attachment 325362 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325362&action=review

> Source/WebCore/ChangeLog:7
> +

I think it should be possible to write a simple test for this. I'll look for one to mimic.

> Source/WebCore/JSHTMLMenuitemElement.h:1
> +/*

This doesn't seem right. The generated file shouldn't be in the WebKit source tree, it should get generated into the build directory (and not show up in your patch). You may need help getting Xcode to do the right thing, it's not exactly straightforward.
Comment 4 Tim Horton 2017-10-30 11:37:16 PDT
(In reply to Tim Horton from comment #3)
> Comment on attachment 325362 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=325362&action=review
> 
> > Source/WebCore/ChangeLog:7
> > +
> 
> I think it should be possible to write a simple test for this. I'll look for
> one to mimic.

Maybe something in LayoutTests/fast/html? There are a bunch that end in -element that seem like sensible starting points.
Comment 5 Aishwarya Nirmal 2017-10-30 11:44:11 PDT
Created attachment 325364 [details]
Patch
Comment 6 Aishwarya Nirmal 2017-10-30 11:45:58 PDT
(In reply to Tim Horton from comment #4)
> (In reply to Tim Horton from comment #3)
> > Comment on attachment 325362 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=325362&action=review
> > 
> > > Source/WebCore/ChangeLog:7
> > > +
> > 
> > I think it should be possible to write a simple test for this. I'll look for
> > one to mimic.
> 
> Maybe something in LayoutTests/fast/html? There are a bunch that end in
> -element that seem like sensible starting points.

Sounds good! I think I fixed the issue with the JSHTML file, so I'll look into creating some tests.
Comment 7 Build Bot 2017-10-30 12:46:43 PDT
Comment on attachment 325364 [details]
Patch

Attachment 325364 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5042101

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 8 Build Bot 2017-10-30 12:46:45 PDT
Created attachment 325368 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 9 Build Bot 2017-10-30 12:51:37 PDT
Comment on attachment 325364 [details]
Patch

Attachment 325364 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5042110

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 10 Build Bot 2017-10-30 12:51:39 PDT
Created attachment 325370 [details]
Archive of layout-test-results from ews105 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 11 Build Bot 2017-10-30 13:04:54 PDT
Comment on attachment 325364 [details]
Patch

Attachment 325364 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/5042140

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 12 Build Bot 2017-10-30 13:04:56 PDT
Created attachment 325371 [details]
Archive of layout-test-results from ews116 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 13 Build Bot 2017-10-30 13:14:17 PDT
Comment on attachment 325364 [details]
Patch

Attachment 325364 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/5042152

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 14 Build Bot 2017-10-30 13:14:18 PDT
Created attachment 325373 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 15 Ryosuke Niwa 2017-10-30 13:33:31 PDT
Comment on attachment 325364 [details]
Patch

r- since the patch is failing to build.
Comment 16 Tim Horton 2017-10-30 13:36:29 PDT
(In reply to Ryosuke Niwa from comment #15)
> Comment on attachment 325364 [details]
> Patch
> 
> r- since the patch is failing to build.

It's not, the test is failing.

Aishwarya, you'll want to find out why imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical asserts that HTMLMenuItemElement *doesn't* exist :P
Comment 17 Ryosuke Niwa 2017-10-30 13:38:03 PDT
(In reply to Tim Horton from comment #16)
> (In reply to Ryosuke Niwa from comment #15)
> > Comment on attachment 325364 [details]
> > Patch
> > 
> > r- since the patch is failing to build.
> 
> It's not, the test is failing.
> 
> Aishwarya, you'll want to find out why
> imported/w3c/web-platform-tests/html/semantics/interactive-elements/
> contextmenu-historical asserts that HTMLMenuItemElement *doesn't* exist :P

GTK+, Windows, and WPE seem to be failing to build? Have you confirmed that they build locally somehow?
Comment 18 Aishwarya Nirmal 2017-10-30 14:06:16 PDT
It builds locally for me.

Looking at that file, imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical, it seems that there are some tests ensuring that HTMLMenuItemElement does not exist. We probably don't want to check for this anymore, so I can work on editing the test.
Comment 19 Tim Horton 2017-10-30 14:41:57 PDT
(In reply to Aishwarya Nirmal from comment #18)
> It builds locally for me.

rniwa is right, something is up with the CMake build. I think it doesn't use DerivedSources.make, so maybe look for other files that mention an adjacent derived source to find out what mechanism it does use.
Comment 20 Aishwarya Nirmal 2017-10-30 17:15:42 PDT
Created attachment 325391 [details]
Patch
Comment 21 Build Bot 2017-10-30 18:08:26 PDT
Comment on attachment 325391 [details]
Patch

Attachment 325391 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5044601

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 22 Build Bot 2017-10-30 18:08:27 PDT
Created attachment 325398 [details]
Archive of layout-test-results from ews100 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 23 Build Bot 2017-10-30 18:23:11 PDT
Comment on attachment 325391 [details]
Patch

Attachment 325391 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5044716

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 24 Build Bot 2017-10-30 18:23:13 PDT
Created attachment 325401 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 25 Build Bot 2017-10-30 18:36:37 PDT
Comment on attachment 325391 [details]
Patch

Attachment 325391 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/5044751

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 26 Build Bot 2017-10-30 18:36:39 PDT
Created attachment 325404 [details]
Archive of layout-test-results from ews115 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews115  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 27 Build Bot 2017-10-30 18:44:20 PDT
Comment on attachment 325391 [details]
Patch

Attachment 325391 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/5044815

New failing tests:
imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html
Comment 28 Build Bot 2017-10-30 18:44:22 PDT
Created attachment 325406 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.12.6
Comment 29 Ryosuke Niwa 2017-10-30 19:00:23 PDT
The test is failing because it's expecting HTMLMenuItemElement to be not defined in the global scope. You have run "run-webkit-tests LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/contextmenu-historical.html --reset" to reset the expected results.

This is because the feature had been removed from the HTML specification in https://github.com/whatwg/html/pull/2742.
Comment 30 Ryosuke Niwa 2017-10-30 19:01:20 PDT
Comment on attachment 325391 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325391&action=review

> Source/WebCore/ChangeLog:6
> +        Reviewed by NOBODY (OOPS!).

You need to describe what kind of API you're implementing and what code changes you're making for it.
r- due to the lack of change log descriptions and the test failures.

> Source/WebCore/ChangeLog:8
> +        * CMakeLists.txt:

Given the feature has been removed from the HTML specification, we should put this under a runtime flag.
Comment 31 Aishwarya Nirmal 2017-10-31 13:38:16 PDT
Created attachment 325482 [details]
Patch
Comment 32 Build Bot 2017-10-31 14:44:31 PDT
Comment on attachment 325482 [details]
Patch

Attachment 325482 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5054553

New failing tests:
imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox_032.htm
Comment 33 Build Bot 2017-10-31 14:44:33 PDT
Created attachment 325501 [details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 34 Aishwarya Nirmal 2017-11-01 13:10:19 PDT
The test that is failing seems to be unrelated to my changes. When I run run-webkit-tests LayoutTests/imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/sandbox_032.htm --debug locally, the test passes.
Comment 35 Ryosuke Niwa 2017-11-01 14:12:48 PDT
Comment on attachment 325482 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325482&action=review

> Source/WebCore/ChangeLog:12
> +        is set to false by default.  

Nits: There are two trailing spaces here.

> Source/WebCore/ChangeLog:13
> +

Please add some references to old HTML specifications like https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html.

> Source/WebKit/ChangeLog:8
> +        Adds in the MenuItemEnabled flag and default value. 

Nit: A trailing space at the end.

> Source/WebCore/html/HTMLMenuItemElement.idl:27
> +] interface HTMLMenuItemElement : HTMLElement {

So the idea is to implement more attributes of https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html in the future patches?
Comment 36 Aishwarya Nirmal 2017-11-01 14:28:07 PDT
Yes! I will add those details to the change log.
Comment 37 Aishwarya Nirmal 2017-11-01 14:29:24 PDT
Created attachment 325633 [details]
Patch
Comment 38 Aishwarya Nirmal 2017-11-01 14:40:12 PDT
Created attachment 325635 [details]
Patch
Comment 39 Ryosuke Niwa 2017-11-01 15:10:51 PDT
Comment on attachment 325635 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325635&action=review

> LayoutTests/fast/html/menuitem-element.html:1
> +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">

Please use <!DOCTYPE html>

> LayoutTests/fast/html/menuitem-element.html:12
> +

You either need to skip this test in TestExpectations or enable the feature using settings, etc...
Comment 40 Aishwarya Nirmal 2017-11-02 14:10:59 PDT
Created attachment 325768 [details]
Patch
Comment 41 Build Bot 2017-11-02 15:13:38 PDT
Comment on attachment 325768 [details]
Patch

Attachment 325768 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/5080207

New failing tests:
fast/html/menuitem-element.html
Comment 42 Build Bot 2017-11-02 15:13:39 PDT
Created attachment 325776 [details]
Archive of layout-test-results from ews103 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews103  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 43 Build Bot 2017-11-02 15:29:54 PDT
Comment on attachment 325768 [details]
Patch

Attachment 325768 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/5080229

New failing tests:
fast/html/menuitem-element.html
Comment 44 Build Bot 2017-11-02 15:29:56 PDT
Created attachment 325778 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 45 Aishwarya Nirmal 2017-11-02 15:31:16 PDT
Created attachment 325779 [details]
Patch
Comment 46 Build Bot 2017-11-02 16:37:35 PDT
Comment on attachment 325779 [details]
Patch

Attachment 325779 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/5081414

New failing tests:
imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html
Comment 47 Build Bot 2017-11-02 16:37:37 PDT
Created attachment 325795 [details]
Archive of layout-test-results from ews104 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 48 Darin Adler 2017-11-03 08:00:18 PDT
Comment on attachment 325779 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=325779&action=review

> Source/WebCore/ChangeLog:16
> +        A specification for the menuitem element can be found at
> +        https://www.w3.org/TR/2013/WD-html51-20130528/interactive-elements.html#the-menuitem-element.
> +        More attributes of this element will be implemented in future patches.

Should we be adding this? This is obsolete. More recent HTML specifications do not include this. See <https://html.spec.whatwg.org/#non-conforming-features>.
Comment 49 Aishwarya Nirmal 2017-11-03 11:19:00 PDT
Menuitem is noncorforming because Mozilla is the only implementor, but it does not seem to be entirely obsolete. The w3 folks seem to be willing to reconsider the removal of the menuitem if multiple browsers were to support it https://github.com/whatwg/html/issues/2929. 

We are aiming to use menuitem to represent the touch bar menu items for the touch bar web API. The API is experimental, so we are planning to use any information gathered to better inform a web standard for menuitem.
Comment 50 Darin Adler 2017-11-03 12:58:18 PDT
(In reply to Aishwarya Nirmal from comment #49)
> Menuitem is noncorforming because Mozilla is the only implementor, but it
> does not seem to be entirely obsolete. The w3 folks seem to be willing to
> reconsider the removal of the menuitem if multiple browsers were to support
> it https://github.com/whatwg/html/issues/2929.

OK, makes sense.
Comment 51 Ryosuke Niwa 2017-11-04 00:59:22 PDT
Comment on attachment 325779 [details]
Patch

r=me since this patch can't possibly cause the service worker test failure.

Sorry for the delay. In the future, please also set cq? flag so that the committer can set cq+ flag to land the patch via commit queue.
Comment 52 WebKit Commit Bot 2017-11-04 01:20:07 PDT
Comment on attachment 325779 [details]
Patch

Clearing flags on attachment: 325779

Committed r224457: <https://trac.webkit.org/changeset/224457>
Comment 53 WebKit Commit Bot 2017-11-04 01:20:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 54 Radar WebKit Bug Importer 2017-11-15 12:33:03 PST
<rdar://problem/35567759>