惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
Lohrmann on Cybersecurity
Martin Fowler
Martin Fowler
Engineering at Meta
Engineering at Meta
腾讯CDC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Azure Blog
Microsoft Azure Blog
G
Google Developers Blog
TaoSecurity Blog
TaoSecurity Blog
博客园_首页
Vercel News
Vercel News
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Last Week in AI
Last Week in AI
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
The Exploit Database - CXSecurity.com
量子位
Project Zero
Project Zero
A
Arctic Wolf
小众软件
小众软件
NISL@THU
NISL@THU
C
CERT Recently Published Vulnerability Notes
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
N
News and Events Feed by Topic
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Troy Hunt's Blog
P
Privacy & Cybersecurity Law Blog
Security Latest
Security Latest
B
Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
D
DataBreaches.Net
Schneier on Security
Schneier on Security
The Hacker News
The Hacker News
K
Kaspersky official blog
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
人人都是产品经理
人人都是产品经理
AI
AI
Cisco Talos Blog
Cisco Talos Blog
MyScale Blog
MyScale Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
S
Schneier on Security
P
Palo Alto Networks Blog

fantasai: Weblog

Change of Affiliation Thoughts on the W3C’s May 2020 Advisory Board Election fantasai 69: Process 2020 Revision Thoughts on the W3C’s May 2019 Advisory Board Election Running for the W3C Advisory Board Designing CSS Thoughts on the May 2018 W3C Advisory Board Election Environmental Sustainability Recommendations for Mountain View Buildings fantasai 63: The Way of Music fantasai 62: How To Wash Dishes Open Letter on the Iran Nuclear Deal Recipe for a Minimum Viable Kitchen Creating a Paid Contributor Agreement for Mozilla On Brendan Eich and the Separation of Concerns fantasai 57: 2012 TAG Election Endorsements fantasai 56: Approaching UTR50 Evolution of CSS Layout Job Description of a Standards Engineer fantasai 52: about:csswg fantasai 53: W3C Process Holes fantasai 51: about:fantasai fantasai 50: Hiatus E Pluribus Unum Towards a Unified Ruby Model Creating the Future of CSS Testing (2011 Edition) Creating the Future of CSS Testing (2009 Edition) CSS2.1 and the Case for Collaborative Testing Introducing Brad Kemper, CSSWG Invited Expert fantasai 44: Layout Is Expensive CSS Working Group Charter 2008 fantasai 42: Riddle of the Universe Pulling Back the Curtain: Opening Up the CSS Working Group What is the CSS Working Group doing? The True Story of mpt and fantasai fantasai 38: Long Vacation fantasai 37: CSS3 Text Evolutions fantasai 36: What is Mozilla? fantasai 34: Empty fantasai 33: When to use PDF fantasai 32: Revised CSS3 Text fantasai 30: Travel Notes fantasai 29: Filibuster Frist fantasai 28: UTN 22 fantasai 27: SSSS fantasai 26: CSS and Multi-Script Text fantasai 25: Free As in Freedom fantasai 24: The Law of Hospitality fantasai 23: Organizing the Documentation Effort fantasai 22: Yom Kippur fantasai 21: Firefox and Switching Styles Link Types for RSS and Atom Feeds fantasai 19: An Absence of Aesthetics Sitting on the Outside, Looking Up fantasai 17: A Touch of Class fantasai 16: Task Force fantasai 15: W3 fantasai 13: A Stitch in Time fantasai 11: What Is Love Content and Hype (English Composition for Marketers) fantasai 10: Reviewer at Small fantasai 09: Losing it fantasai 08: Personality Type fantasai 07: Happiness fantasai 06: Moving fantasai 05: Black Tuesday fantasai 03: Words of Wisdom fantasai 02: Big and Small fantasai 01: Why validate your pages? fantasai 00: Experiment
fantasai 31: The Art of Semantics
2005-07-10 · via fantasai: Weblog

2005-07-09

A Romanian translation of this article is provided by Alexander Ovsov.

Horizontal Rules

Towards the end of the month of May, the WHATWG mailing list dove into a debate over the purpose of the <hr> element: whether it is purely presentational and should be dropped, whether it indicated a break between sections and should be replaced by proper sectioning, or whether indeed it had a different role to play:

Ian Hickson writes

On Sat, 21 May 2005, Anne van Kesteren wrote:
>
> Why doens't SECTION suffice? They are sections separated by decoration. 
> At least, that is how it appeals to me.

They're not really sections. The chapter is the section, these are 
paragraphs together in the same chapter, with a divider between some of 
the paragraphs.

I read a lot of fiction books and when I come across a "* * *" it reads to 
me like a paragraph, saying "Meanwhile, in a different part of the 
universe:"; it doesn't read as "end section. new section:".

IMHO.

Later on, Ian takes out his ASCII brushes to depict his point more clearly:

On Mon, 23 May 2005, Christoph Päper wrote:
> Anyhow you can still group paragraphs by wrapping them in a division 
> instead of dividing them by a separator. The latter is IMO not a very 
> markupish approach. MLs are usually about putting (informational) atoms 
> into bags and these into larger ones, iterated until you reach the top 
> one, the root.

The paragraphs are all part of the <section> (chapter). They're not 
further grouped together, IMHO. An <hr> is equivalent to a <p> with the 
content "Meanwhile, somewhere else..." or similar ("From someone else's 
point of view...", "At another time..."). In fact if a story was to be 
styled into comic form, <hr> elements would typically be presented as 
narrator-level text in the next paragraph's panel. For example:

   <p><q>No!<q> said Fred.</p>
   <hr>
   <p>The tree stood alone.</p>

In comic form:

   +----------+ +--------------+-------+
   |  _____   | | Meanwhile... |       |
   | < No! >  | +--------------+       |
   |  \/^^^   | |         /|\          |
   |  o       | |         /|\          |
   | -+-      | |          |           |
   | / \      | |          |           |
   +----------+ +----------------------+

Not that we have any user agents or stylesheet languages (short of actual 
humans) capable of that kind of interpretation and presentation today, but 
my point is that the <hr> here is a unit on par with a paragraph, it's not 
an artefact of an implied higher level grouping.

In text form:

   "No!" said Fred.

      *   *   *

   The tree stood alone.

In aural form:

   No!, said Fred. [pause] The tree stood alone.

If we didn't have <hr>, I would imagine the above example would be marked 
up as:

   <p><q>No!</q> said Fred.</p>
   <p>* * *</p>
   <p>The tree stood alone.</p>

...or some such. I really don't think:

    <p><q>No!</q> said Fred.</p>
   </plot>
   <plot>
    <p>The tree stood alone.</p>

...would be better than <hr>, in fact I think it would be unnatural from 
an authoring perspective. We mustn't fall into the trap of considering 
everything to be a hierarchy, just because that is what XML most easily 
marks up. Book authors have managed quite well for centuries without 
considering their documents to be formed of trees! (Notwithstanding what 
paper is made of, I mean.)

Meaningless Markup

Along the way, Christoph Päper and Ian also argued the semantics of <div> and <span>. As Christoph was proposing that <hr> should be replaced by deliberate use of classified <div>, he explained:

'div' is the proper HTML element type for subdivisions (of sections) 
that actually are not sections. (IMO sections always have a heading, 
'h'.) It, optionally, can be categorized with the 'class' attribute and 
be identified by an 'id' attribute.

But Ian didn't agree that the code in Christoph's example expressed his intended semantics:

Remember that class="" and <div> are meaningless. A document has
the same semantics after you strip out any class attributes and
<div> elements.

However, Christoph rejected such an extreme conception of <div>, <span>, and 'class', explaining that while such markup does not express the semantics of purpose, it still expresses the semantics of structure:

You say that and some others share that point of view, but I (and 
probably others) disagree. It is true that 'div' or 'class' don't 
provide semantics directly, but they do indirectly: Everything inside a 
'div' belongs together somehow and everything that shares a class 
(inside a document instance) is related to each other somehow. You 
cannot know /how/, but /that/.

FWIW, I share Christoph's point of view here.

x/HTML5

As Hixie reforms the Hypertext Markup Language through the WHATWG, he has subtly altered and refined the definitions of many seemingly simple elements. The new semantics are surprisingly elegant, and gracefully more powerful than before. I think if anyone is capable of taking HTML to its ideal, it's him, and I believe the language will owe Ian a great debt some years from now.