CSS 選擇器作為片段標識符 W3C 社群小組開張(原: CSS Selectors for Fragment Identifiers now a W3C Community Group)

這是一個新開張的 W3C 社群小組(W3C Community Group),討論的是在目標文件
沒有片段標識符的錨(@id)的時候可以,還是可以靠 CSS 選擇器連到文件的一部
分,例如:

http://www.example.com/#css(.content:nth-child(2))

這個提案的草案在下面。其實在 WHATWG 或是 HTML 工作組的郵件群都討論過很多
類似的概念,包括用在跨域 <iframe> 裡[1]、連到某網頁裡第一個出現某字串的
地方[2]等等[3][4][5]。

總之,歡迎大家參加這個社區小組,社區小組的首頁也在下面,只要有 W3C 帳號
(有在我們 wiki 寫過的朋友,那個就是 W3C 帳號)的都可以參加(列在參加名
單的意思)。另外,直接透過郵件群討論[6]也可以。

[1]《cross-domain scrollIntoView on frames and iframes》
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-April/thread.html#19145
[2]《Idea: Links w/o end anchors (is possible)》
http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-July/thread.html#21279
[3]《Making it possible to do an anchor link to any DOM node》
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2008-June/thread.html#15130
[4]《X(HT)ML Fragment Identifiers》
http://lists.w3.org/Archives/Public/public-html/2008May/0509
[5]《How to refer to place of document, which is not marked by author!?》
http://lists.w3.org/Archives/Public/public-html/2007Apr/thread#msg1477
[6] http://lists.w3.org/Archives/Public/public-cssselfrags/

-------- Original Message --------
Subject: CSS Selectors for Fragment Identifiers now a W3C Community Group
Resent-Date: Fri, 02 Mar 2012 19:26:58 +0000
Resent-From: www-style@w3.org
Date: Fri, 2 Mar 2012 14:26:30 -0500
From: Eric A. Meyer <eric@meyerweb.com>
To: www-style@w3.org

   CSS Selectors are a powerful tool for precisely identifying any
piece (or pieces) of a document.  It's always seemed like they might
be useful in contexts beyond applying style information.  For
example, hypertext anchors desperately need a toolset with that kind
of power.  Right now, the vast majority of links point to a document
as a whole, even when referring to a specific piece of the document.
Unless there's an ID to address with a fragment, you can't point to a
specific element within a linked document, let alone a set of
elements.
   That train of thought led Simon St.Laurent and me, with helpful
input from several smart folks, to write "CSS Selectors for Fragment
Identifiers":

http://simonstl.com/articles/cssFragID.html

Basically, this combines CSS selectors with a touch of XPointer
syntax to create an approach for linking to (or potentially from) any
point or points in a document.  After a couple of decades of hoping
document maintainers might put in anchors, it's time to try something
more flexible.  Note that this doesn't modify, extend, or otherwise
alter CSS Selectors!  It simply proposes that we put them to work in
another context.
   We're happy to say that as of this morning there is now (finally!)
a W3C Community Group to talk about the idea:

http://www.w3.org/community/cssselfrags/

We're just getting started, so please join the conversation!

-- 
Eric A. Meyer (eric@meyerweb.com)     http://meyerweb.com/

Received on Saturday, 3 March 2012 21:49:22 UTC