value-class-pattern-brainstorming

(Difference between revisions)

Jump to: navigation, search
(separated out verbosity criticism vs. misconception and misunderstanding of authoring friendliness. new syntax(es) = more author unfriendly than more markup)
(documented valuetitle brainstorm)
Line 12: Line 12:
: <span class="fn">[[User:Tantek|Tantek Çelik]]</span>
: <span class="fn">[[User:Tantek|Tantek Çelik]]</span>
</div>
</div>
 +
 +
== valuetitle ==
 +
Numerous proposals over the years have advocated expanding the use of the title attribute beyond the abbr tag for storing microformat property values.  One simple mechanism for doing so would be to introduce a new value excerption class name and rule.
 +
 +
'''valuetitle''': before "normal" value excerption handling, first look (in the same manner as value-excerption) for the class name "valuetitle", if it is found, use the value of the title attribute on that element and do no further value excerption or other parsing for that property value.
 +
 +
E.g.
 +
 +
<code><nowiki>
 +
<span class="type">
 +
<span class="valuetitle" title="cell">mobile</span>
 +
</span>
 +
</nowiki></code>
 +
 +
In addition to first looking for "valuetitle" where a parser would look for "value", it seems reasonable to also allow "valuetitle" on the property element itself in order to minimize the markup necessary, e.g.:
 +
 +
<code><nowiki>
 +
<span class="type" class="valuetitle" title="cell">mobile</span>
 +
</nowiki></code>
 +
 +
Naming reasoning/methodology: by using the prefix "value-" it is clear that this is part of the value excerption pattern.  By using the suffix "-title", it is clear that the "title" attribute is involved.  Thus the name "valuetitle" is a good mnemonic for its functionality.  See related [[naming-principles]].
 +
 +
"valuetitle" was suggested on 2008-08-30 by [[User:Tantek|Tantek]] in a discussion with [[User:BenWard|Ben Ward]].
 +
 +
=== previous similar proposals ===
 +
I believe there may have been a proposal for "usetitle"(link+citation needed) in the past that would function similarly.  I think "valuetitle" is better than "usetitle" as "valuetitle" is more *descriptive*, i.e. meaning "the title is the value", as opposed to "usetitle", which is more *prescriptive*, i.e. "use the title". [[User:Tantek|Tantek]] 08:13, 1 Sep 2008 (PDT)
== object param handling ==
== object param handling ==

Revision as of 15:13, 1 September 2008

value excerption pattern brainstorming

Contents


The value-excerption-pattern is derived from value-excerpting in hCard. The precise parsing behavior is not yet finalized, so the pattern should be used only with extreme caution.

This brainstorming page is for exploring ideas related to specifying the value-excerption-pattern in more detail and ideas for special case handling of the value-excerption-pattern in combination with specific semantic HTML elements per those elements' particular semantics.

These are merely explorations for now, and should NOT be used in actual content publishing, nor implemented in any production code.

Editor
Tantek Çelik

valuetitle

Numerous proposals over the years have advocated expanding the use of the title attribute beyond the abbr tag for storing microformat property values. One simple mechanism for doing so would be to introduce a new value excerption class name and rule.

valuetitle: before "normal" value excerption handling, first look (in the same manner as value-excerption) for the class name "valuetitle", if it is found, use the value of the title attribute on that element and do no further value excerption or other parsing for that property value.

E.g.

<span class="type"> <span class="valuetitle" title="cell">mobile</span> </span>

In addition to first looking for "valuetitle" where a parser would look for "value", it seems reasonable to also allow "valuetitle" on the property element itself in order to minimize the markup necessary, e.g.:

<span class="type" class="valuetitle" title="cell">mobile</span>

Naming reasoning/methodology: by using the prefix "value-" it is clear that this is part of the value excerption pattern. By using the suffix "-title", it is clear that the "title" attribute is involved. Thus the name "valuetitle" is a good mnemonic for its functionality. See related naming-principles.

"valuetitle" was suggested on 2008-08-30 by Tantek in a discussion with Ben Ward.

previous similar proposals

I believe there may have been a proposal for "usetitle"(link+citation needed) in the past that would function similarly. I think "valuetitle" is better than "usetitle" as "valuetitle" is more *descriptive*, i.e. meaning "the title is the value", as opposed to "usetitle", which is more *prescriptive*, i.e. "use the title". Tantek 08:13, 1 Sep 2008 (PDT)

object param handling

2008-08-23 Ben Ward and Tantek Çelik brainstormed the following possible special case markup handling for the use of the value-excerption-pattern with the <object> element. Modified 2008-08-26.

The following markup example documents one way the hCard tel property's type subproperty could be specified with the enumerated value of "cell" while providing the UK English "mobile" as the human visible object text contents:

<object class="type" lang="en-GB">
 <param name="value" value="cell" />
 mobile
</object>

summary

notes

Note that the param element does not have a 'class' attribute and thus its 'name' attribute (which has a compatible semantic) is used instead to invoke the value excerption pattern.

advantages

neutral

disadvantages

criticisms

to do

Browser Testing

Using the following simple, HTML4 hcard:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

<title>&lt;object> value excerption pattern: hCard Telephone Type Test Case</title>

<body class="vcard">
    <h1 class="fn"><a class="url" href="http://ben-ward.co.uk">Ben Ward</a></h1>
    <p class="tel">
        <object class="type">
            <param name="value" value="cell">
            Mobile:
        </object>
        <span class="value">415-123-567</span>
    </p>
</body>

Results

A pass is to display a heading level one ‘Ben Ward’ with hyperlink, followed by a paragraph displaying the text ‘Mobile: 415-123-567’ Browsers selected based on YUI Graded Browser Support (August 2008), plus some others.

Safari 2 Tweak

The example is tweaked as follows to affect Safari 2 rendering:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

<title>&lt;object> value excerption pattern: hCard Telephone Type Test Case</title>

<body class="vcard">
    <h1 class="fn"><a class="url" href="http://ben-ward.co.uk">Ben Ward</a></h1>
    <p class="tel">
        <object data="data://" class="type">
            <param name="value" value="cell">
            Mobile:
        </object>
        <span class="value">415-123-567</span>
    </p>
</body>

A data="data://" URL attribute is added to the object element.

Safari 2 Result

† Safari 2 renders the object correctly on first page load, *however*, upon using the browser ‘Refresh’ function, the object element reverts to the broken rendering described in the original test.

Current Conclusion

--BenWard 20:17, 26 Aug 2008 (PDT)

--Tantek 03:07, 27 Aug 2008 (PDT)

misconceptions

misunderstanding of authoring unfriendliness

previous iterations

20080823

<object class="type" lang="en-GB">
 <param class="value" name="value" value="cell" />
 mobile
</object>
disadvantages

related pages

value-class-pattern-brainstorming was last modified: Wednesday, December 31st, 1969

Views