Bug 1829660: pass `true` for `aFireEvents` and defer hiding the popover and updating...
commit4328b1ce9373d761a89f09f84c50115b7ec95ecb
authorMirko Brodesser <mbrodesser@igalia.com>
Mon, 8 May 2023 14:08:37 +0000 (8 14:08 +0000)
committerMirko Brodesser <mbrodesser@igalia.com>
Mon, 8 May 2023 14:08:37 +0000 (8 14:08 +0000)
treebc82f28402566fb9d879c6eb3d1906ca93ba22a8
parent5ff8b82363688dc2153103533c12e4dfbdfc7292
Bug 1829660: pass `true` for `aFireEvents` and defer hiding the popover and updating the popover states. r=emilio

Pass `true` for `aFireEvents` to match the spec.
Defer hiding the popover because it may run script, which is forbidden,
because `SetAttrAndNotify` runs with a script blocker
(`mozAutoDocUpdate`).

Updated test expectations:
  The assertion count increased because
  <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/dom/base/Document.cpp#14948-14949>
  is violated more often, which was violated before. No new
  `NS_ASSERTION`s are violated.

  "[Changing a popover from auto to manual (via attr), and then auto during 'beforetoggle' works]
     expected: FAIL" still fails because
     <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#334>
     is violated, which is unrelated to this change.
  Other instances of
  <https://searchfox.org/mozilla-central/rev/4e6970cd336f1b642c0be6c9b697b4db5f7b6aeb/testing/web-platform/tests/html/semantics/popovers/popover-attribute-basic.html#339>
  still fail too, but the general mechanism of firing events seems to
  work. Therefore it seems reasonable to investigate the remaining
  failures in bug 1816851.

Differential Revision: https://phabricator.services.mozilla.com/D176660
dom/html/nsGenericHTMLElement.cpp
dom/html/nsGenericHTMLElement.h
testing/web-platform/meta/html/semantics/popovers/popover-attribute-basic.html.ini