[whatwg] [WA1] The a element could be empty

Matthew Raymond mattraymond at earthlink.net
Sat Sep 3 17:55:19 PDT 2005

Jim Ley wrote:
> On 9/3/05, Matthew Raymond <mattraymond at earthlink.net> wrote:
>>Jim Ley wrote:
>>>Not particularly wanting to support the OP's issue - I don't see a
>>>problem with the change to the content model of a to require content,
>>>it's a good thing.  However styling a link to print away is not a good
>>>idea, as it means those without css get a link which does nothing,
>>  Nothing in a print out does anything.
> The relevance to the button doing nothing, is the button on the page
> that if script is enabled and appropriate vendor API's are available
> will print the document, so the the OP only adds the link once he
> knows script and a window.print method are available, not after
> printing.

   This would be accomplished by something like the following?...

| if (window) {
|   if (window.print) {
|     // Insert the print button.
|   }
| }

>>  How many user agents support Javascript but not CSS1? Does Lynx or
>>some other text-mode browser support Javascript? I'll have to look into
> Loads, IE, Mozilla Family, Opera and Safari perhaps being the
> commonest - ie CSS can be disabled in all of them distinct from
> disabling script.

   You're not entirely correct about how these browsers support turning
off CSS. IE actually doesn't support it. It lets you turn off specific
aspects of styling, but not everything. You'd have to use a user
stylesheet to override everything, and that's not really turning it off
so much as using your own conflicting style. Mozilla Firefox allows you
to turn off styling for the screen media, but not the print media. It
prints using the last stylesheet you chose. I don't have a Mac, so I
can't text Safari.

   Of course, I asked about browsers that don't SUPPORT both Javascript
and CSS, not about browser that allow you to turn it off if you so desire.

>>  Makes sense. Personally, I'm wondering why you want to print from a
>>link at all unless you want to perform a special print operation.
> Oh absolutely, it's silly (without having things like ScriptX to
> provide real printing support in restricted environments) but you
> can't hide scripted things via CSS, CSS and Script can be disabled
> seperately in all modern browsers.

   Wrong. CSS can't be disabled for Firefox. I don't thing IE overrides
the "display" property for CSS unless you use a user stylesheet. In any
event, 99.999% of people viewing web pages will not be disabling CSS on
a page they want to print. And if the page is really that critical with
regards to printing in the first place, it should probably be opened as
a PDF in a separate window.

More information about the whatwg mailing list