Re: [css3-layout] First :current tab

On Saturday 18 August 2007 01:36, Matthew Raymond wrote:
> Bert Bos wrote:
> > On Friday 10 August 2007 02:44, Matthew Raymond wrote:
> >>    Perhaps I missed it, but I didn't see any thing in the CSS3
> >> Advanced Layout Module that specifies how to determine the initial
> >>
> >> :current tab.
> >
> > The current proposal says that initially the first tab is open,
> > unless there is a fragment ID on the URL that points to an element
> > in some other tab, in which case that other tab is open. (It is
> > still an open question how tabs are printed.)
>
>    Could you quote from the spec where it says this? (Just want to be
> sure it's in there, although it's generally a matter of common
> sense.)

Section 4:

    Initially, the first child is visible (but see “fragment IDs”
    below).
    -- http://www.w3.org/TR/2007/WD-css3-layout-20070809/#tabbed

where “fragment IDs” links to section 4.7:

    UAs should attempt to make elements visible that match the ‘:target’
    pseudo-class.
    -- http://www.w3.org/TR/2007/WD-css3-layout-20070809/#fragment-id

> >> Also, how does one determine which tab is currently
> >> selected through scripting? Does one use the CSSOM, or do you use
> >> the Selectors API?
> >
> > I don't know, but I guess there will be a way to check if an
> > element matches ':current' or not.
>
>    That really needs to be resolved before the spec goes to a call
> for implementation.

More dependencies generally mean a longer time to standardization, so I 
prefer not to add any unless there is a really good reason.

>
> > I assume there is also already a function
> > that tells you if an element's boxes are (partially) visible, and
> > if so, which part. After all, tabs are just one of many ways to
> > hide boxes behind other boxes.
>
>    Is a tab "visibility: hidden" or "display: none" when it's not the
> current tab? What scripting APIs would one use to determine this?

The 'display' would be 'card' so it can't be 'none' at the same time. 
And 'visibility' is an independent property: you can have an invisible 
card just as you can have an invisible list item.

I don't know what the APIs are, but I'd be surprised if any new ones 
were needed. What do you currently do if you want to know if something 
is visible? In other words, given this document:

    <div style="height: 1em; background: red">...</div>
    <div style="margin-top:-1em; height: 1em; background: green">X</div>

what do you write to find out that the first DIV is not visible?



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Monday, 20 August 2007 14:30:29 UTC