[css-books] Re: [css3-gcpm] Does string-set work on elements or on boxes?

Simon Sapin wrote:

 > Example 5 says:
 > 
 > > The content is copied regardless of other settings on the element. In
 > > HTML, TITLE elements are normally not displayed, but in this example
 > > the content is copied into a named string:
 > >
 > > title {
 > >   display: none;
 > >   string-set: tittel content();
 > > }
 > 
 > This is an important point that should be specifed in normative text. I 
 > assume that "other settings" here means "value of other CSS properties".

Yes. I've added this normative text:

  <p>The textual content is copied regardless of values of other CSS properties on the element. 

  http://books.spec.whatwg.org/#setting-named-strings:-the-'string-set'-property

 > But in this case, it’s not just the properties of the same element that 
 > are relevant. In HTML, <title> is typically in a <head> element which 
 > itself has 'display: none'.
 > 
 > I understand the use case of the <title> element, but it may be a bit 
 > problematic:
 > 
 > Without 'string-set', 'display: none' means that a whole subtree of the 
 > content/DOM/element tree can be skipped when generating boxes. Even 
 > doing the cascade and computed values on these elements is not strictly 
 > necessary. With 'string-set', however, implementations need to do all 
 > that just in case somewhere in the subtree is a 'string-set' value that 
 > involves generated content.
 > 
 > Is this use case worth the cost?

I think it is. Using string-set is a way of picking up values that
would otherwise be lost, like the content of <title>. Also, browsers
typically display the <title> in the heading so they somehow remember
it.

Both Prince and AntenneHouse pass the corrensponding test case
(linked to the left of the example code).

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome

Received on Tuesday, 22 October 2013 12:11:16 UTC