`<details>` element not updated on `<summary>` click
Reported by
m...@bocoup.com,
Jan 16 2017
|
||||
Issue description
Chrome Version : Chromium 57.0.2979.0 (Developer Build) (64-bit)
Revision 5a213ac08a1ea69d04c2fc9e4f21fe53c109ff52-refs/heads/master@{#442975}
OS Version: Ubuntu 16.04.1 LTS
URLs (if applicable) : https://bl.ocks.org/jugglinmike/e5f13288f675836e2cca8aec8d2a2424 https://bl.ocks.org/jugglinmike/661f878cc5448a86072c40c3d3336a93
Other browsers tested:
Safari:
Firefox: OK -- 50.1.0; 53.0a1 (2017-01-12) (64-bit)
IE:
What steps will reproduce the problem?
(1) During initial page load trigger a `click` event on a `<summary>` element
nested within a `<details>` element
What is the expected result?
The user agent adds an attribute named `open` to the `<details>` element.
What happens instead?
Nothing
Please provide any additional information below. Attach a screenshot if
possible.
It looks like Chromium does not update the `<details>` element when a `click`
event is triggered during initial page rendering:
```html
<details>
<summary id="d">Summary</summary>
Content
</details>
<script>document.getElementById('d').click();</script>
```
Demo: https://bl.ocks.org/jugglinmike/e5f13288f675836e2cca8aec8d2a2424
Note that the `click` event is still created and propagated as expected.
A DOM with more elements occasionally prompts Chromium to honor the click.
Demo: https://bl.ocks.org/jugglinmike/661f878cc5448a86072c40c3d3336a93
The flakyness may be more prominent when the document is loaded directly (in
other words, not from within an `<iframe>`):
https://bl.ocks.org/jugglinmike/raw/661f878cc5448a86072c40c3d3336a93
,
Jan 17 2017
Note that this is causing problems for effectively testing details/summary in a cross-browser way: https://github.com/w3c/web-platform-tests/pull/4539 My guess is that this is due to the layoutObject() test at https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp?q=HTMLSummaryElement.cpp&sq=package:chromium&l=143 : Note that Firefox does not implement this test and it's unusual in the web platform, so we are not including it in the spec: https://github.com/whatwg/html/pull/2256 I'd suggest removing that test for spec compliance reasons anyway, and hopefully that will un-flake the tests as well.
,
Jan 19 2017
,
Jan 19 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c162ebcbfa71bfbdd8e3fdba2137c382f752b4b2 commit c162ebcbfa71bfbdd8e3fdba2137c382f752b4b2 Author: tkent <tkent@chromium.org> Date: Thu Jan 19 08:17:00 2017 SUMMARY element: click() for invisible SUMMARY should toggle DETAILS element. We had unreasonable layoutObject() existence check for DOMActivate event handling. It's not defined by the stadard. BUG= 681711 Review-Url: https://codereview.chromium.org/2644693003 Cr-Commit-Position: refs/heads/master@{#444679} [add] https://crrev.com/c162ebcbfa71bfbdd8e3fdba2137c382f752b4b2/third_party/WebKit/LayoutTests/fast/html/summary-invisible-click.html [modify] https://crrev.com/c162ebcbfa71bfbdd8e3fdba2137c382f752b4b2/third_party/WebKit/Source/core/html/HTMLSummaryElement.cpp
,
Jan 19 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by ajha@chromium.org
, Jan 17 2017