Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
SUMMARY element: click() for invisible SUMMARY should toggle DETAILS …
…element SUMMARY element: click() for invisible SUMMARY should toggle DETAILS element https://bugs.webkit.org/show_bug.cgi?id=245937 Reviewed by Tim Nguyen. Merge - https://chromium.googlesource.com/chromium/src.git/+/c162ebcbfa71bfbdd8e3fdba2137c382f752b4b2 This is to align Webkit behavior with Gecko (Firefox) and Blink (Chrome). We had unreasonable renderer() existence check for activate event handling. It is not defined by the standard. * Source/WebCore/html/HTMLSummaryElement.cpp: (HTMLSummaryElement::supportsFocus): Remove "renderer" condition (HTMLSummaryElement::defaultEventHandler): Simplified and removed "renderer" condition * LayoutTests/fast/html/summary-invisible-click.html: Added Test Case * LayoutTests/fast/html/summary-invisible-click-expected.txt: Added Test Case Expectations * LayoutTests/imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-summary-element/activation-behavior-expected.txt: Updated Test Expectations Canonical link: https://commits.webkit.org/255073@main
- Loading branch information
1 parent
b0d582e
commit 19b515f0605328883ede9f5dcae2c07d571dd209
Showing
4 changed files
with
40 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
PASS click() on hidden SUMMARY should toggle DETAILS. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<script src="../../resources/testharness.js"></script> | ||
<script src="../../resources/testharnessreport.js"></script> | ||
|
||
<details style="display:none"> | ||
<summary>Click me</summary> | ||
Blah, blah, ... | ||
</detail> | ||
|
||
<script> | ||
test(() => { | ||
const summary = document.querySelector('summary'); | ||
const details = document.querySelector('details'); | ||
assert_false(details.open); | ||
summary.click(); | ||
assert_true(details.open); | ||
summary.click(); | ||
assert_false(details.open); | ||
}, 'click() on hidden SUMMARY should toggle DETAILS.'); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
|
||
FAIL Should open a closed details if all conditions are met assert_equals: After activation: expected open to be true expected true but got false | ||
FAIL Should close an open details if all conditions are met assert_equals: After activation: expected open to be false expected false but got true | ||
FAIL Should open a closed details even if the details is not being rendered assert_equals: After activation: expected open to be true expected true but got false | ||
FAIL Should open a closed details even if the summary is not being rendered assert_equals: After activation: expected open to be true expected true but got false | ||
FAIL Should open a closed details if a span element precedes the summary assert_equals: After activation: expected open to be true expected true but got false | ||
PASS Should open a closed details if all conditions are met | ||
PASS Should close an open details if all conditions are met | ||
PASS Should open a closed details even if the details is not being rendered | ||
PASS Should open a closed details even if the summary is not being rendered | ||
PASS Should open a closed details if a span element precedes the summary | ||
PASS Should stay closed if another summary element precedes the summary | ||
FAIL Should open a closed details if another summary element *nested inside a span* precedes the summary assert_equals: After activation: expected open to be true expected true but got false | ||
PASS Should open a closed details if another summary element *nested inside a span* precedes the summary | ||
PASS Should stay closed if the summary element is nested inside a span element | ||
FAIL toggle events should be coalesced even when using the activation behavior of a summary assert_equals: Expected toggle to fire exactly once expected 1 but got 0 | ||
PASS toggle events should be coalesced even when using the activation behavior of a summary | ||
Summary | ||
Contents | ||
|
||
Summary | ||
Contents | ||
|
||
Summary | ||
Contents | ||
|
||
Summary 1 | ||
Summary 1 | ||
Summary 2 | ||
Contents | ||
|
||
Summary | ||
Contents |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters