Intent to Implement and Ship: Element.toggleAttribute

89 views
Skip to first unread message

Rakina Zata Amni

unread,
Jun 22, 2018, 3:16:19 AM6/22/18
to blink-dev

Contact emails

rak...@chromium.org


Spec

https://dom.spec.whatwg.org/#dom-element-toggleattribute

Discussion: https://github.com/whatwg/dom/issues/461


Summary

Add a new method Element.toggleAttribute(string qualifiedName, optional bool force) that allow toggling the existence of an element’s attribute, similar to Element.classList.toggle.


Motivation

Developers often wants to control existence of attributes of an element, but need to do different actions on boolean vs non-boolean attributes. Some libraries provide convenience functions that are based upon the type or the attribute being set.


Risks

Interoperability and Compatibility

Low


Edge: Public support https://github.com/whatwg/dom/issues/461#issuecomment-398206390

Firefox: In development https://bugzilla.mozilla.org/show_bug.cgi?id=1469592

Safari: No signals

Web developers: Positive, seen on github discussion above


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


Is this feature fully tested by web-platform-tests?

Yes. https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/attributes.html


Link to entry on the feature dashboard

https://www.chromestatus.com/feature/5676852374929408


Requesting approval to ship?

Yes



Hayato Ito

unread,
Jun 22, 2018, 3:31:54 AM6/22/18
to Rakina Zata Amni, blink-dev
Non-Owner LGTM.
This would make DOM & HTML more pleasant to use.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACPC1r68VPpRk%3D%3D0T3p7n3abwzvnat_OLO2ozNW4su1CgjEn7w%40mail.gmail.com.


--
Hayato

Chris Harrelson

unread,
Jun 22, 2018, 7:05:56 PM6/22/18
to Hayato Ito, Rakina Zata Amni, blink-dev
LGTM1

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFpjS_0a0cvcYh3th5vf7w0RT%3DimTASLaJU4J-4zdwxQcoeA1A%40mail.gmail.com.

TAMURA, Kent

unread,
Jun 24, 2018, 7:54:29 PM6/24/18
to Chris Harrelson, Hayato Ito, rak...@chromium.org, blink-dev
LGTM2




--
TAMURA Kent
Software Engineer, Google


Daniel Bratell

unread,
Jun 25, 2018, 8:18:35 AM6/25/18
to Chris Harrelson, TAMURA, Kent, Hayato Ito, rak...@chromium.org, blink-dev
LGTM3

/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAGH7WqGt%3DKXC9Scieb%3DBXbJPZKrrCD29xUP990rjnOFonDuezA%40mail.gmail.com.



--
/* Opera Software, Linköping, Sweden: CEST (UTC+2) */
Reply all
Reply to author
Forward
0 new messages