edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev]  document.removeAttribute
Date: Tue, 24 Jan 2017 20:50:48 -0500	[thread overview]
Message-ID: <20170024205048.eklhad@comcast.net> (raw)
In-Reply-To: <alpine.LRH.2.03.1701241554130.10456@carhart.net>

Kevin, the last line you quoted from the spec...

> although they may be accessed by an index as in an array.

Ok, if so, then the only practical way to implement that is as an array,
which I did in domLink() in decorate.c,
but we don't do that when creating nodes dynamically from js.
So c. attributes should be new Array, not new Object, but there's more.
In setAttribute() line 635 is either unnecessary or not enough.
We need to preserve the array essence.
Don't we need this?

this.attributes.push(name.toLowerCase());

And in removeAttribute it's fine to delete foo from attributes,
where we had set attributes.foo = bar, but we must also splice foo out of position i in the array.

I'm guessing that if c is the node then there are really three actions to foo = bar.

c.foo = bar
c.attributes.foo = bar
c.attributes.push("foo")

I'm not sure of this, I only know what we have is inconsistent,
and will definitely cause trouble at some point.
If you can confirm that my understanding of this is correct I can clean it up,
or perhaps Kevin or Adam can take it on.

Karl Dahlke

  reply	other threads:[~2017-01-25  1:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-19 20:04 Adam Thompson
2017-01-19 20:32 ` Chris Brannon
2017-01-19 21:34   ` Kevin Carhart
2017-01-24  8:43     ` Adam Thompson
2017-01-24 19:08       ` Adam Thompson
2017-01-24 20:48         ` Karl Dahlke
2017-01-24 22:08           ` Kevin Carhart
     [not found]             ` <20170024174651.eklhad@comcast.net>
2017-01-24 23:57               ` Kevin Carhart
2017-01-25  1:50                 ` Karl Dahlke [this message]
2017-01-21  0:27 ` Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170024205048.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).