[whatwg/dom] Refactor toggle attribute (#663)

Solves:
https://github.com/whatwg/dom/issues/657
https://github.com/whatwg/html/issues/3779

As I understand it vars are not mutable and are instead copied, right? This mean I still have to copy from `"get an attribute by name"` the code.

Would there be a way to simplify this further perhaps? I could copy out the two common steps in the body of `"get an attribute by name"` and `"get valid an attribute by name"` into another concept?

Are there better names for the concept?

You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/663

-- Commit Summary --

  * Simplify boolean logic for toggleAttribute()
  * Abstract away comon logic in toggleAttribute() and setAttribute() to be simpler

-- File Changes --

    M dom.bs (55)

-- Patch Links --

https://github.com/whatwg/dom/pull/663.patch
https://github.com/whatwg/dom/pull/663.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/663

Received on Friday, 29 June 2018 20:52:52 UTC