W3C home > Mailing lists > Public > www-style@w3.org > May 2013

RE: [selectors4] Local-link, <base> and javascript

From: François REMY <francois.remy.dev@outlook.com>
Date: Tue, 7 May 2013 09:10:33 +0200
Message-ID: <DUB120-W2796B30AB6CDF33A781178A5BA0@phx.gbl>
To: Simon Sapin <simon.sapin@exyr.org>, "www-style@w3.org" <www-style@w3.org>
>    a:matches([href^="http:"], [href^="https:"], [href^="data:"])
Don't forget that links could be local, and href being an attribute matches the markup code, not the final link. How would you distinguish href="./" and href="data.html", for example? Your only option would be to use a RegExp (/^\w+:.*/i) and :not() but this is not possible, to catch all relative links, then add some exceptions to links whose protocol is known to be navigational (http(s)/ftp/data).  Also, some browsers accept to navigate to FTP locations so these would be another navigation link. It's not up to the site author to list all the supported navigation links, all the supported action links, and it depends from browser to browser anyway. For example, "res:" is a valid navigational protocol in IE, but not in Chrome. 		 	   		  
Received on Tuesday, 7 May 2013 07:11:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:29 UTC