This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17946 - html anchor tags 1) Did I miss it, or did you forget to mention name= attribute? (You did mention href='#name", so I suppose it is still valid) 2) To lessen need for JavaScript could you give an option that makes it work like location.replace so a new ent
Summary: html anchor tags 1) Did I miss it, or did you forget to mention name= attribu...
Status: RESOLVED NEEDSINFO
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard: *
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-18 07:21 UTC by contributor
Modified: 2012-12-31 05:48 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2012-07-18 07:21:37 UTC
This was was cloned from bug 17118 as part of operation convergence.
Originally filed: 2012-05-20 00:30:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-05-20 00:30:28 +0000 
--------------------------------------------------------------------------------
Specification: http://www.w3.org/TR/2012/WD-html5-20120329/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
html anchor tags
1) Did I miss it, or did you forget to mention name= attribute? (You did
mention href='#name", so I suppose it is still valid)
2) To lessen need for JavaScript could you give an option that makes it work
like location.replace so a new entry is not added to history object.
3) To lessen need for JavaScript, when using Target could give an option
essential can refocus the cursor to inside the target window?

Howard_Cary_Morris@hotmail.com

Posted from: 98.66.7.23
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0
================================================================================
Comment 1 Ian 'Hixie' Hickson 2012-09-23 23:26:30 UTC
Could you elaborate on which name="" attribute you mean?

Could you elaborate on the use cases for #2 and #3?
Comment 2 Howard Cary Morris 2012-09-24 04:11:28 UTC
1) <a name="_here" /> - did not see that mention in html5 documentation
2) instead of <a href='javascript:location:replace("http://go.com")'> which uses javascript, I'd rather have an html syntax like <a href='http://go.com' replace=yes> which would be pure html instead. (Main advantage: still works if javascript is disabled).
3) Instead of <a href='javascript:parent.IF.location="go.com";parent.IF.focus()' > (not sure if that is correct syntax) I would prefer to use an html  syntax like
<a href='http://go.com' target='IF' focus=_target> - again this would eliminate the need for javascript. An alternate idea might be a syntax like 
<a href='http://go.com/#aname' target='IF'> which implies specifying a location in the URL says to move the focus to that frame and location. (with maybe _top reserved to top of page).
Comment 3 Ian 'Hixie' Hickson 2012-10-10 02:32:25 UTC
For 1), I think what you're looking for is now just called id="". If I recall correctly, HTML4 already was suggesting that authors should use id="" rather than name="".

For 2 and 3 I'm still not sure I understand the use cases. Could you elaborate further? Why do you want to replace the current session history entry? Why do you want to move the focus?
Comment 4 Howard Cary Morris 2012-10-10 05:36:15 UTC
Reply in reverse order:
3) When user clicks on link to change what is in frame or I-frame it makes sense to switch the focus to that frame.

2) I don't want to replace the current history as eliminate the old screen from the browser history. There are times one does not need to add to the clutter. I see no reason why it has to be done using JAVASCRIPT when it would make more sense to do it in html instead.

1) OK, found reference in http://dev.w3.org/html5/spec/textFieldSelection.html#attr-hyperlink-href where you indicate to use id instead of old <a name='whatever'>. However, in http://dev.w3.org/html5/spec/the-a-element.html#the-a-element, there is no reference to using #id as a href which I think needs adding. Those type of anchors can also clutter up the browser history (another reason for 2). However, having it in history makes a little more sense than the footnote example. Having an anchor to go to the footnote makes sense. Having another anchor to go back to where you came from doesn't make sense if there is more than one reference to the footnote. Using the browser button to go back makes more sense (or JAVASCRIPT that goes back in history for you). Now that I look at it, <a href='javascript: ...'> and <a href='mailto:...'> seem to be missing from the manual also. There is some reference to it in http://dev.w3.org/html5/spec/urls.html#processing-model but I think it needs repeating for description of the <a> tag
Comment 5 Ian 'Hixie' Hickson 2012-11-19 18:34:19 UTC
(In reply to comment #4)
> Reply in reverse order:
> 3) When user clicks on link to change what is in frame or I-frame it makes
> sense to switch the focus to that frame.

I think that's basically something the user agents should do of their own accord, I don't think it needs spec work or explicit features in the markup.


> 2) I don't want to replace the current history as eliminate the old screen
> from the browser history. There are times one does not need to add to the
> clutter. I see no reason why it has to be done using JAVASCRIPT when it
> would make more sense to do it in html instead.

Could you give an example of when this makes sense at all? I'm not sure it makes sense for JavaScript either, but it's possible for historical reasons that we can't do much about now. Could you elaborate on the precise use case?


> 1) OK, found reference in
> http://dev.w3.org/html5/spec/textFieldSelection.html#attr-hyperlink-href

Note that the spec I'm editing is not that one, it's: http://whatwg.org/#html
(The one above does tend to copy whatever I write into the WHATWG one, but it's always going to be somewhat behind and they don't adopt everything and make their own weird changes.)


> where you indicate to use id instead of old <a name='whatever'>. However, in
> http://dev.w3.org/html5/spec/the-a-element.html#the-a-element, there is no
> reference to using #id as a href which I think needs adding.

It's not specific to <a>. Why would it be in the <a> section?


> Those type of
> anchors can also clutter up the browser history (another reason for 2).

You call it clutter, but I think it's important as a user that I be able to navigate back to where I was before I jumped around the document!


> However, having it in history makes a little more sense than the footnote
> example. Having an anchor to go to the footnote makes sense. Having another
> anchor to go back to where you came from doesn't make sense if there is more
> than one reference to the footnote. Using the browser button to go back
> makes more sense (or JAVASCRIPT that goes back in history for you).

I'm not sure what you are saying here.


> Now that
> I look at it, <a href='javascript: ...'> and <a href='mailto:...'> seem to
> be missing from the manual also.

Are you saying you think the <a> element section should list every URL scheme out there? I don't think that scales. It just allows any URL.


> There is some reference to it in
> http://dev.w3.org/html5/spec/urls.html#processing-model but I think it needs
> repeating for description of the <a> tag

Why?
Comment 6 Ian 'Hixie' Hickson 2012-12-31 05:48:59 UTC
Please reopen the bug if you respond to comment 5, thanks!