gecko-dev/layout/reftests/details-summary/mouse-click-change-summary-to-display-none.html
Ting-Yu Lin a7ea8a84ac Bug 1245424 Part 3 - Add reftest for click events with actions in capturing phase. r=bz
These tests modify details or summary elements in the 'click' event
listener in capturing phase higher up in the DOM tree.

MozReview-Commit-ID: Lp5OzXnNgL4

--HG--
extra : rebase_source : 5772a84795b1b8b6b9bb6cbf928bfb612eb07971
2016-03-24 15:05:29 +08:00

30 lines
883 B
HTML

<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html class="reftest-wait">
<script>
function runTest() {
// Both Chrome and Safari add the 'open' attribute to the details element.
// Firefox has the same behavior.
var details = document.getElementById("details");
var summary = document.getElementById("summary");
document.body.addEventListener("click", function () {
// Change summary to display: none in capturing phase.
summary.style.display = "none";
}, true);
summary.dispatchEvent(new MouseEvent("click"));
document.documentElement.removeAttribute("class");
}
</script>
<body onload="runTest();">
<details id="details">
<summary id="summary">Summary</summary>
<p>This is the details.</p>
</details>
</body>
</html>