W3C home > Mailing lists > Public > public-html-comments@w3.org > September 2010

HTML5 - 7.4.2 Focus management

From: Guilherme Johansson Tramontina <guilherme.tramontina@gmail.com>
Date: Thu, 23 Sep 2010 23:22:57 -0300
Message-ID: <AANLkTin+dF3hoW+M54+pH2vrxpbGPbMhZ+Y1nafYsVqn@mail.gmail.com>
To: public-html-comments@w3.org, whatwg@whatwg.org
Hi,
Trying to find some answers for my questions regarding
"contenteditable='true' and focus management", I went through the
documentation and couldn't find anything about it.
I saw that elements with the "draggable" attribute become focusable.
But what about "contenteditable"?
My main questions/suggestions are:
 - Should the contenteditable element be focusable?
 - And its children elements?
 - How about events (like onChange) for the editable element and/or
for its children?

Here is a simple HTML example:
<ol contenteditable='true'>
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ol>

By default none of this elements are focusable, correct?
If I bind an onFocus/onBlur event handlers on the OL element, both get
triggered when I click on it and off it... Which means that it became
focusable due to the contenteditable attribute!
Going further, if I turn the LI elements focusable by adding the
"tabindex='-1'" attribute and also bind onFocus/onBlue event handlers
on them, when I click any LI item, here is what is currently
happening:
 - In Chrome (can't remeber version), this is the event order: LI's
onFocus -> LI's onBlur -> OL's onFocus;
 - In Firefox (can't remeber version), the only event triggered is LI's onFocus;

This is more like a big forum question, but it would be nice to have
some specification around this behavior. :-)

Hope to hear back from you!

Thank you,
Guilherme Johansson Tramontina
Consultant Developer at ThoughtWorks Brazil
Received on Friday, 24 September 2010 15:55:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:05 GMT