From Microformats Wiki
Revision as of 19:39, 3 January 2007 by Bob Jonkman (talk | contribs) (→‎Parsing for include-pattern: Link to IRC of 2007-01-03)
Jump to navigation Jump to search

Include Pattern Feedback

Feedback about include-pattern.

Objects and Browser Behavior

Over at Yahoo! Local, we were using the object include pattern for all our hReviews on business detail pages and review listings. That is, until we realized that Safari and Internet Explorer both try to embed the entire page with every OBJECT call. (Firefox correctly recognizes that it's a local object and doesn't reload anything.)

On a page with 20+ reviews, this means a substantial increase in load time and memory consumption. As a result of this (bad) browser behavior, we removed the objects entirely.

Any suggestions for workarounds or modifications to the pattern?

-- AndyBaio 29 Jun 2006

Can you use the hyperlink option with DHMTL/Ajax to perform replacements in advanced browsers? (Simon Willison's getElementsBySelector() may be helpful)

 <a href="#id" class="include" title=""></a>

with something like:

 //Works only for linked include-pattern definition at
 //Requires Simon Willison's getElementsBySelector()
 //  and normal IE workaround for addEventListener()
 addEventListener( window, 'load', function() {
   var myIncludes = document.getElementsBySelector( 'a[href].include' ), a, e;
   for( var i=0; a=myIncludes[i]; i++ ) if (a.href.charAt(0)=='#') {
     e = document.getElementsBySelector( a.href )[0].cloneNode( true );
     a.parentNode.replaceChild( e, a );

--RichHall 00:51, 23 Oct 2006 (PDT)

My hResume page seen here caused Safari 2.0 some major issues. The page was jumping between object elements when a link was hovered eventually causing the browser to crash. You can follow the thread on the WSG mail archive.

It seems that while the object element may be more semantically appropriate it is not may not be usable in lieu of the issues raised in Safari.

--Robert O'Rourke 12:08, 3 Nov 2006 (PST)

Which version of Safari? Please be specific as many Safari OBJECT bugs were fixed in Safari 2.x.

-- Tantek 13:39, 3 Nov 2006 (PST)

Hyperlink Include - Screen Reader Testing

Some concerns have been raised over the implications using empty hyperlinks may have on assistive devices such as screen readers. One concern is that an empty link may be read out, partially read out or result in some other confusing scenario for the user.

In response, a test page consisting of a number of empty hyperlinks in the style suggested by the pattern has been created. A 'good' result is that none of the links be read out.

Test Results: JAWS 7.0 with Firefox 1.5/Win

Tested by Frances Berriman 2006-07-21.

  • 31 dash include dash Mozilla Firefox
  • Page has no links
  • 31 dash include

Conclusion: the hyperlink include pattern presented no usability issues for this screen reader.

Proprietary attribute

HTML tidy on the test page gives:

Warning: <a> proprietary attribute "data"

The W3C validator is similarly unimpressed.

AndyMabbett 14:22, 22 Oct 2006 (PDT)

Use href

To clarify, links on the test page should be changed to use the href attribute as described at include-pattern (without href attributes, the elements probably won't register as hyperlinks, but anchors). Set title="" to fix empty link behavior for many assistive devices. --RichHall 23:31, 22 Oct 2006 (PDT)

Test page corrected

2006-10-25: This error has been corrected on the test page. Any tests should probably be re-run in light of this.

Unclear status

It's not clear, either from the main Wiki page or include-pattern, whether this is an agreed standard, a draft, or just a proposal. AndyMabbett 03:14, 18 Oct 2006 (PDT)

  • include-pattern is not its own proposal, draft, or spec. It is a design pattern, as listed on the wiki home page that is included in other proposals, drafts. and specs. Recommend for adding to the include-pattern-faq.
    • And that is not clear, either from the main Wiki page or include-pattern. AndyMabbett 16:40, 18 Oct 2006 (PDT)
      • ACCEPTED. Will further clarify relationship between patterns and formats. Tantek 16:48, 18 Oct 2006 (PDT)

Parsing for include-pattern

Note: this issue is obsolete. On a IRC conversation 2007-01-03, Mike Kaply admitted that he figured this out, which is to apply all includes first into the parse tree before looking for any properties. -Tantek

To be more specific, what finally occurred to me is that the object pattern is simply about grabbing nodes from another vcard and using them in this vcard. So the implementor responsibility is just to clone the dom node from the other vcard and replace the object with the corresponding nodes. Works great. (of course I also had to clone the entire vcard since I can't manipulate the DOM like that without changing the page) -mkaply

In an IRC discussion with Mike Kaply (author of the Operator extension for Firefox) we discussed the difficulty of parsing for an include-pattern in hResume. Mike asks:

I'm really wondering why the object stuff doesn't point back to the entire vCard. I don't understand why the spec has it point to individual items.

The problem was thought to be a weakness in the specification, which doesn't specify what part of the data is in the content that is pointed to by the object.

Currently, to overcome this a parser needs to follow this logic:

IF I don't find an fn, look for an object. IF there is an object, do a getelementbyid on that ID, but yet there was nothing about that object that said that the content I was looking for in the other card was an fn

Two things may help in overcoming this difficulty:

  1. Change the spec to have the include-pattern reference the entire vCard, with the intent that any data not found in this vCard use the other vCard
  2. Include the element of the reference, where the class attribute on <object> has "include" plus the element that needs to be included. For example:
class="include fn" data="#vcard-name">myname</object> 

Additionally, I pointed out that using the <object> element to contain the reference makes Microsoft's Internet Explorer throw an error "Your current security settings prohibit ActiveX controls on this page. As a result, the page may not display correctly." Of course, there is no ActiveX content on an include-pattern.

Bob Jonkman 21:15, 2 Jan 2007 (PST)