Re: Setting focus (Re: [Bulk] Re: [BECS] CSSS! - CSS script)

Bert Bos wrote:
 >
 > Andrew Fedoniouk wrote:
 >
 >> Speaking about functions. set-focus() for example can be useful for
 >> implementing <label for> functionality but for any type of element.
 >
 > Setting focus to some element in a Web page is a bad idea. It means that
 > the keyboard works differently depending on whether the page has a
 > focusable element or not.

Bert, I am not sure I understand you well here.
In my sample I've reproduced standard functionality of <label for>.
It is not anyhow different from what UA already do.

 >
 > In a typical browser, keys like the arrows, the tab and the space bar
 > navigate through the page. Some browsers offer even more handy keys,
 > e.g. to jump to the next <Hn> element. It would be very confusing for a
 > user if the keys worked in some pages and not in others.

Bert, have you seen such thing as @autofocus?

http://www.whatwg.org/specs/web-forms/current-work/#autofocus0

All that nice wording under the link above is just one declaration:

[autofocus]
{
   when-assigned: self.set-focus();
}

I mean that such things shall really be a part of
default style sheet of HTML5 but not to pollute HTML5 specification.
That behavioral styling can be applied to many input languages -
not to only HTML.

 >
 > It's different in an application (such as a "widget"). Whatever UIDL is
 > used to design the (G)UI of that application, one would hope that it
 > provides control over the initial focus.
 >
 > CSS is meant for layout of documents, not for (G)UIs. The assumption
 > behind style sheet languages is that the document viewer (browser)
 > already has a UI and we neither need nor should interfere with that UI.

Beg my pardon but that is a bit idealistic.

This simple behavioral (sic!) declaration:

   div { overflow:scroll; }

will make all DIV elements a) focusable and b) will change (G)UI.

 >
 > Turning CSS into a language that is both a style sheet language and a
 > UIDL can only lead to an ugly language that is neither very well.
 >

CSSS! is not a procedural language in the common sense. It is rather
declarative - it defines set of triggers.
And it is not a replacement of general procedural/imperative languages 
like JS and the like.

One of goals of proposed CSSS! is to solve some fundamental limitations 
of CSS selectors. Some desired CSS selectors like (:has-child(), 
:root-has-child()) may lead to combinatorial explosion when they are 
used as pure static declarations.

 >
 >
 > Bert

-- 
Andrew Fedoniouk.

http://terrainformatica.com

Received on Friday, 9 May 2008 17:10:09 UTC