From 3fb0aa62a96f0b3a8afb016ca95a805ccd3fc5b0 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Sat, 10 Jun 2023 01:00:34 -0700 Subject: [PATCH] Handle attribute changes after changing attribute In all implementations, internal listeners for attribute changes which are run as "attribute change steps" are run after the attribute is actually changed, not before. This affects popover attribute related algorithms in HTML: https://github.com/whatwg/html/pull/9048#discussion_r1141122175. --- dom.bs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/dom.bs b/dom.bs index 6dab94dcd..86d98eb58 100644 --- a/dom.bs +++ b/dom.bs @@ -6297,10 +6297,10 @@ given a document, localName, namespace, and opt attribute attribute to value, run these steps:
    +
  1. Set attribute's value to value. +

  2. Handle attribute changes for attribute with attribute's element, attribute's value, and value. - -

  3. Set attribute's value to value.

To append an @@ -6308,36 +6308,34 @@ given a document, localName, namespace, and opt steps:

    -
  1. Handle attribute changes for attribute with element, null, and - attribute's value. -

  2. Append attribute to element's attribute list.

  3. Set attribute's element to element. + +

  4. Handle attribute changes for attribute with element, null, and + attribute's value.

To remove an attribute attribute, run these steps:

    -
  1. Handle attribute changes for attribute with attribute's - element, attribute's value, and null. +

  2. Let element be attribute's element.

  3. -
  4. Remove attribute from attribute's - element's attribute list. +
  5. Remove attribute from element's attribute + list.
  6. Set attribute's element to null. + +

  7. Handle attribute changes for attribute with element, + attribute's value, and null.

To replace an attribute oldAttr with an attribute newAttr, run these steps:

    -
  1. Handle attribute changes for oldAttr with oldAttr's - element, oldAttr's value, and newAttr's - value. -

  2. Replace oldAttr by newAttr in oldAttr's element's attribute list. @@ -6345,6 +6343,10 @@ steps: element.

  3. Set oldAttr's element to null. + +

  4. Handle attribute changes for oldAttr with newAttr's + element, oldAttr's value, and newAttr's + value.