Re: [whatwg] alternate ids for elements

On Wed, Dec 3, 2014 at 3:22 PM, Martin Janecke <whatwg.org@prlbr.com> wrote:
> Am .12.2014, 15:30 Uhr, schrieb Nils Dagsson Moskopp
> <nils@dieweltistgarnichtso.net>:
>
>> Julian Reschke <julian.reschke@gmx.de> writes:
>>
>>> On 2014-12-03 15:02, Jukka K. Korpela wrote:
>>>>
>>>> 2014-12-03, 15:49, Julian Reschke wrote:
>>>>
>>>>> I have a use case where a certain location in a document can have two
>>>>> anchors (or even more). For instance, in a spec, the author may have
>>>>> specified an anchor, but a section-number based anchor is required as
>>>>> well.
>>>>
>>>>
>>>> Can you elaborate on that? Why cannot you use the same id attribute
>>>> value in all references to an element?
>>>
>>>
>>> 1.) An author-supplied anchor may change, but you want to preserve
>>> existing "deep" links from other documents.
>>
>>
>> The solution seems simple to me: Do not change the anchor id,
>> ever.
>
>
> It might be useful to add a note to
> https://html.spec.whatwg.org/multipage/dom.html#the-id-attribute advising
> not to change ids, at least not when they are used for the purpose of
> linking to certain parts of the document. Rfc4287 uses the term "permanent"
> for atom:ids. That's a nice word.
>
> Martin

Also be sure to remove the feature from ReSpec and Anolis that they
generate an ID from the text of a header (e.g.
https://dom.spec.whatwg.org/#introduction-to-dom-events).
Human-readable header text changes way too often to be used as a
stable identifier. ;-)

Jeffrey

Received on Thursday, 4 December 2014 19:15:32 UTC