By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,616 Members | 1,184 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,616 IT Pros & Developers. It's quick & easy.

Linking generated content

P: n/a
Should linking generated content work? Example:

span:before{content:"foobar"}

<a href="foobar.htm"><span></span></a>

I stumbled across this bit in the CSS2 spec:
Generated content does not alter the document tree. In particular, it is
not fed back to the document language processor (e.g., for reparsing).


It works both in Opera and Mozilla, but should it?

Context: I have an alternate stylesheet switching UI widget on a page, I
don't want that widget to show up in non CSS UA's and if my author
stylesheet is ignored or disabled.
Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Headless <me@privacy.net> wrote:
Should linking generated content work?
I don't think you are linking generated content.
span:before{content:"foobar"}

<a href="foobar.htm"><span></span></a>
You have a link element with a span element with empty content as its
only content. This doesn't sound logical, and its effects on browsers
will vary. Your style sheet does not really link generated content. The
link is there, and the generated content just affects its appearance.
Generated content does not alter the document tree. In particular, it
is not fed back to the document language processor (e.g., for
reparsing).


This means that no markup in generated content is parsed, and the
document's parse tree remains the same - in this case, you still have
just empty content, with span and link markers around it.
It works both in Opera and Mozilla, but should it?
Define "works". Is the linked resource accessible through the link, and
how? Does the link participate in tabbing order? Is it traversed by
indexing robots? How does it appear in a list of all links on the page,
as generated by the browser? And what if CSS is enabled?
Context: I have an alternate stylesheet switching UI widget on a
page, I don't want that widget to show up in non CSS UA's and if my
author stylesheet is ignored or disabled.


If you want to hide something, visually, then visibility: invisible and
display: none would appear to be more logical approaches. Even then, the
question arises whether e.g. an invisible link should be treated as a
link, in the many ways that a document can be processed.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2

P: n/a
Jukka K. Korpela wrote:
Context: I have an alternate stylesheet switching UI widget on a
page, I don't want that widget to show up in non CSS UA's and if my
author stylesheet is ignored or disabled.


If you want to hide something, visually, then visibility: invisible and
display: none would appear to be more logical approaches.


How do you propose to get that to work in non CSS capable UA's or when
the author stylesheet is ignored or disabled?
Headless

--
Email and usenet filter list: http://www.headless.dna.ie/usenet.htm
Jul 20 '05 #3

P: n/a
In article <ro********************************@4ax.com>,
Headless <me@privacy.net> wrote:
Context: I have an alternate stylesheet switching UI widget on a
page, I don't want that widget to show up in non CSS UA's and if my
author stylesheet is ignored or disabled.


If you want to hide something, visually, then visibility: invisible and
display: none would appear to be more logical approaches.


How do you propose to get that to work in non CSS capable UA's or when
the author stylesheet is ignored or disabled?


As an answer to this and as an advice to the OP:

The widget is obviously reliant on JavaScript. So that is they key. Have
an embedded script generate the content needed for this widget. In the
rare occassion that JS is enabled and CSS is disabled in a DOM-compliant
browser, then no worries; it is obviously disabled for a reason and i
think it is reasonable to assume that the user is aware of this and
realizes that a styleswitcher will not work when no styles are there to
be shown. Unless of course you can detect stylesheets enabled through
JS, but I don't know how to do that.

--
Kris
kr*******@xs4all.netherlands (nl)
"We called him Tortoise because he taught us" said the Mock Turtle.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.