HTMLMenuItemElement.label doesn't follow the specification |
||
Issue description
Chrome Version: 60 canary
OS: All but iOS
What steps will reproduce the problem?
(1) Enable chrome://flags/#enable-experimental-web-platform-features
(2) Open the following URL:
data:text/html;charset=utf-8,<menuitem>foo</menuitem><script>alert(document.querySelector('menuitem').label)</script>
What is the expected result?
A dialog shows "foo"
What happens instead?
A dialog shows nothing.
Please use labels and text to provide additional information.
https://html.spec.whatwg.org/multipage/forms.html#dom-menuitem-label
https://html.spec.whatwg.org/multipage/forms.html#concept-menuitem-label
> The label of a menuitem element is the value of the label content attribute, if there is one and its value is not the empty string, or, otherwise, the result of stripping and collapsing ASCII whitespace from the child text content of the menuitem element.
,
Apr 26 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ae4d8f00071215f9dfe05e1d762f34833c0eec9b commit ae4d8f00071215f9dfe05e1d762f34833c0eec9b Author: yuzus <yuzus@chromium.org> Date: Wed Apr 26 22:40:44 2017 Implement HTMLMenuItemElement.label This CL implements HTMLMenuItemElement.label so that the behavior matches the current spec. The label of a menuitem element is the value of the label content attribute, if there is one and its value is not the empty string, or, otherwise, the result of stripping and collapsing ASCII whitespace from the child text content of the menuitem element. https://html.spec.whatwg.org/multipage/forms.html#dom-menuitem-label https://html.spec.whatwg.org/multipage/forms.html#concept-menuitem-label BUG= 713431 Review-Url: https://codereview.chromium.org/2841473002 Cr-Commit-Position: refs/heads/master@{#467487} [add] https://crrev.com/ae4d8f00071215f9dfe05e1d762f34833c0eec9b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/interactive-elements/the-menu-element/menuitem-label.html [modify] https://crrev.com/ae4d8f00071215f9dfe05e1d762f34833c0eec9b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.cpp [modify] https://crrev.com/ae4d8f00071215f9dfe05e1d762f34833c0eec9b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.h [modify] https://crrev.com/ae4d8f00071215f9dfe05e1d762f34833c0eec9b/third_party/WebKit/Source/core/html/HTMLMenuItemElement.idl [modify] https://crrev.com/ae4d8f00071215f9dfe05e1d762f34833c0eec9b/third_party/WebKit/Source/core/page/CustomContextMenuProvider.cpp
,
Apr 27 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by yuzus@chromium.org
, Apr 24 2017