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 21502 - [HTML] editorial: 3.2.3.2 algorithm simplification
Summary: [HTML] editorial: 3.2.3.2 algorithm simplification
Status: RESOLVED WONTFIX
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-02 04:42 UTC by Michael Dyck
Modified: 2013-04-14 06:55 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael Dyck 2013-04-02 04:42:12 UTC
In 3.2.3.2 "The title attribute",
in the algorithm for 'advisory information',
the first two steps are:

    1 If the element is a link, style, dfn, abbr, or title element, then:
      if the element has a title attribute, return the value of that attribute,
      otherwise, return the empty string.

    2. Otherwise, if the element has a title attribute, then return its value.

It would be somewhat simpler to slice it the other way:

    1. If the element has a title attribute, return its value.
          [or, "... return the value of that attribute"]

    2. Otherwise, if the element is a link, style, dfn, abbr, or title element,
       then return the empty string.
Comment 1 Ian 'Hixie' Hickson 2013-04-10 22:23:31 UTC
The reason this isn't done that way (which I agree is intuitively more logical) is that the title="" attribute in step 2 is #attr-title (the global title="" attribute) whereas the title="" attribute in step 1 is the special attributes (#attr-dfn-title, etc). (Notice that it's not cross-referenced.) So if we switched the steps over, it would, to some pedants like myself, be ambiguous whether e.g. <dfn title=""> would be considered a match or not in the new step 1, unless we just didn't cross-reference to title=""'s definition, in which case other people would ask why we didn't cross-reference it.