Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread Mathew Robertson
On 29 October 2010 16:56, David Dorward da...@dorward.me.uk wrote:


 On 28 Oct 2010, at 17:31, Foskett, Mike wrote:

  Since querying here I've had difficulty validating code with a class on
 the html element.
 Am I incorrect in the belief that it should actually be valid?


 The class http://www.w3.org/TR/html4/struct/global.html#adef-class 
 attribute,
 in the latest, stable version of HTML is available for All 
 elementshttp://www.w3.org/TR/html4/index/elements.htmlbut
 BASE http://www.w3.org/TR/html4/struct/links.html#edef-BASE, 
 BASEFONThttp://www.w3.org/TR/html4/present/graphics.html#edef-BASEFONT,
 HEAD http://www.w3.org/TR/html4/struct/global.html#edef-HEAD, 
 HTMLhttp://www.w3.org/TR/html4/struct/global.html#edef-HTML,
 META http://www.w3.org/TR/html4/struct/global.html#edef-META, 
 PARAMhttp://www.w3.org/TR/html4/struct/objects.html#edef-PARAM,
 SCRIPT http://www.w3.org/TR/html4/interact/scripts.html#edef-SCRIPT,
 STYLE http://www.w3.org/TR/html4/present/styles.html#edef-STYLE, 
 TITLEhttp://www.w3.org/TR/html4/struct/global.html#edef-TITLE

 http://www.w3.org/TR/html4/struct/global.html#edef-TITLESource:
 http://www.w3.org/TR/html4/index/attributes.html


That isn't necessarily correct. or at least, that is only required for
document validation.

Browsers support expando elements (aka, you can bind properties into the DOM
object), so adding a class attribute is valid... and a browser will
CSS-render according to the class attribute, as the spec doesn't say that it
shouldn't if being manipulated by the scripting engine.

So technically speaking, adding a class to the html element, is perfectly
valid.

... whether expando elements need to be spec-validated, after the document
has already been parsed, would be a separate discussion...

cheers,
Mathew Robertson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread Mathew Robertson
On 29 October 2010 16:21, David Hucklesby huckle...@gmail.com wrote:

 On 10/28/10 5:25 PM, Mathew Robertson wrote:

 I'll stick my neck out and say... dont do it for the CSS bit...
 specifically, you should be asking - What is the point of adding a
 specific class to html/body for a specific browser?  In particular,
 using this technique discourages the whole graceful degradation
 thing. And it adds complexity to the markup too, which doesn't
 necessarily help your brain.

 Its an idea which can be used, but that doesn't mean all ideas are
 good ideas...


 Okay. A specific scenario:
 I use RGBa backgrounds quite a lot. IE prior to v.9 supports RGBa
 backgrounds via its gradient filter. How, without using conditional
 comments at all, do I target IE 6,7, and 8, bearing in mind that the
 solid background color I give very old browsers must be removed from
 these versions of IE?

 IMHO, adding classes to the HTML tag this way is far cleaner than using
 a number of IE-only style sheets, and the complexity all those
 conditional comments add to the markup as well...


Hi David,

I didn't actually say dont use conditional comments... I just said dont do
it for the html or body tags.

The reasoning being to keep the IE-specific logic all in one place (aka:
target the element using existing selectors), rather than putting some logic
in your main document (ie: adding a class) and some in one or more external
files.

Whether using distinct stylesheets for each browser or not, is an separate
albeit related, discussion on how separation of logic/code/ideas works for a
given person.

regards,
Mathew Robertson


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread David Dorward
 
On 29 Oct 2010, at 09:49, Mathew Robertson wrote:

 Browsers support expando elements (aka, you can bind properties into the DOM 
 object), so adding a class attribute is valid

Valid has a specific technical meaning when dealing with SGML and XML. What 
browsers supports isn't it.

-- 
David Dorward
http://dorward.me.uk



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread Mathew Robertson
On 29 October 2010 20:01, David Dorward da...@dorward.me.uk wrote:


 On 29 Oct 2010, at 09:49, Mathew Robertson wrote:

  Browsers support expando elements (aka, you can bind properties into the
 DOM object), so adding a class attribute is valid

 Valid has a specific technical meaning when dealing with SGML and XML.
 What browsers supports isn't it.


Once it is parsed into a DOM, it isn't SGML or XML.


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***

RE: [WSG] A simple IE and JS detection method?

2010-10-29 Thread Foskett, Mike
Thanks David,

My impression that it's valid to add a class to the html element was true.
I know that you should not  actually apply a style to it though.




Hi  Kurtis,

 I think that it's positively Byzantine.
 Why do you need or want to do this?

I manage, create and update hundreds of unique content pages.
I must assume that every developer uses Firefox / Firebug combination to build 
/ hack / test pages.
Having separate overriding style sheets is a nightmare for maintenance.
A single sheet, or even better in the document head, improves efficiency.




Hi Thierry,

 how far people are willing to go to have their styles sheets validate.

Couldn't agree more.


 goes against the separation of the three layers

No it doesn't, it's purely presentational.
No better or worse than li class=last


 What's wrong with the *property and _property hack?

Nothing at all in my eyes.
I prefer this technique compared to the more correct  * html and *+html.
And your argument is sound.
Though increased specificity is the whole point.




David,

 How, without using conditional comments at all, do I target IE 6,7, and 8

From the example:
bg {background: #fff}
.IE6 bg,
.IE7 bg { filter:  progid: etc...}
.IE8 bg { -ms-filter: progid: etc}

Though I personally for what you're asking I'd do it in one style rule like 
this:

.gradientBg {
background:#f1f0f3;
background-image: -webkit-gradient(linear, left top, left bottom, 
color-stop(0, #f8f7fa), color-stop(1, #cfcbd8));
background-image: -moz-linear-gradient(rgba(248,247,250, 1) 0%, 
rgba(207,203,216, 1) 100%);
filter:  
progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFf8f7fa, 
endColorstr=#FFcfcbd8);
-ms-filter: 
progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFf8f7fa, 
endColorstr=#FFcfcbd8));
  }

Covers everything you ask plus Firefox, Safari and IE8+.




Mathew,

 What is the point of adding a specific class to html/body for a specific 
 browser?

Purely to tweak presentation for IE6 mostly but yesterday I had to tweak IEv8.
Try and tweak IE8 specifically without the suggested method.
Example:
  a.closeLink  {display:block; font:bold large/1 arial,sans-serif; 
padding:0 0.23em; position:absolute; right:4px; text-decoration:none; top:4px;}
  .IE8 a.closeLink {top:14px; right:-4px}

Because the div has a drop shadow, via -ms-filter in IEv8. The placement of the 
close link was messed up.

 Its an idea which can be used, but that doesn't mean all ideas are good ideas.

Very true hence the posting.




Grant,

 Would you need to style every element in the document

Certainly not, just the styles which require tweaking




Regards

Mike Foskett
http://websemantics.co.uk/



This is a confidential email. Tesco may monitor and record all emails. The 
views expressed in this email are those of the sender and not Tesco.

Tesco Stores Limited
Company Number: 519500
Registered in England
Registered Office: Tesco House, Delamare Road, Cheshunt, Hertfordshire EN8 9SL
VAT Registration Number: GB 220 4302 31


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***


[WSG] Out of Office Re: WSG Digest

2010-10-29 Thread Julien Viard
Hi,

I'm currently out of the office and will be returning tough and strong
on Wednesday 3rd of November.

For all urgent inquiries, please call Georgie Carpenter at the office
on 03 9935 9409.

I will attend to all emails when I return.
Cheers
Julien


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



[WSG] Out of Office AutoReply: WSG Digest

2010-10-29 Thread Carbis, Che
Thanks for your email,

I am currently on leave and will be back in the office on Wednesday 3rd 
November.

If you are a client of Hitwise and require imediate technical assistance, 
please contact our support team support...@hitwise.com.

Otherwise I will respond to your email as soon as I can

Regards,

Ché Carbis
Director - Client Services


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread cat soul

why did I get this set of 5 replies to this thread 12 times?

did any body else get it 12 times, too?

cs


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread David Hucklesby

On 10/29/10 2:13 AM, Foskett, Mike wrote:
[...]

David,


How, without using conditional comments at all, do I target IE 6,7,
and 8


From the example:

bg {background: #fff}

.IE6 bg,

.IE7 bg { filter: progid: etc...}

.IE8 bg { -ms-filter: progid: etc}



Precisely. I was asking how I'd be able to target all three *without*
any CCs.



Though I personally for what you're asking I'd do it in one style
rule like this:

.gradientBg {

background:#f1f0f3;

background-image: -webkit-gradient(linear, left top, left bottom,
color-stop(0, #f8f7fa), color-stop(1, #cfcbd8));

background-image: -moz-linear-gradient(rgba(248,247,250, 1) 0%,
rgba(207,203,216, 1) 100%);

filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFf8f7fa,
endColorstr=#FFcfcbd8);

-ms-filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr=#FFf8f7fa,
endColorstr=#FFcfcbd8));

}

Covers everything you ask plus Firefox, Safari and IE8+.



Sorry, mate. That won't work. All IEs will get the solid background with
the filter image on top. Not what you'd want at all... :(

(FWIW - I actually tried this.)

And what about my browser of choice, Opera. Not popular in the US or UK,
I know, but has an equal presence with Safari and Chrome in Europe, an
even bigger presence in other parts of the world, and a major browser on
small devices like phones. RGBa() has my money...

Cordially,
David
--


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



RE: [WSG] A simple IE and JS detection method?

2010-10-29 Thread Thierry Koblentz
 goes against the separation of the three layers

 No it doesn't, it's purely presentational.
 No better or worse than li class=last

imho, CCs have nothing to do with the presentational layer, they are part of
the structural layer and they are junk markup if you ask me :)

--
Regards,
Thierry
www.tjkdesign.com | www.ez-css.org | @thierrykoblentz







***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread David Hucklesby

On 10/29/10 12:05 PM, Thierry Koblentz wrote:

goes against the separation of the three layers



No it doesn't, it's purely presentational. No better or worse
thanli class=last


imho, CCs have nothing to do with the presentational layer, they are
part of the structural layer and they are junk markup if you ask me
:)



In principle, I entirely agree. But this does not help me target IE6,
IE7, and IE8, each of which has its own needs for which I know no other
work-around. Yes, I can and do use underscore and star filters. But IE8???

Perhaps you know of a browser-safe filter for IE8? My source for CSS
filters is this Wikipedia page...

http://en.wikipedia.org/wiki/CSS_filters

Cordially,
David
--


***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***



Re: [WSG] A simple IE and JS detection method?

2010-10-29 Thread G.Sørtun

On 29.10.2010 23:33, David Hucklesby wrote:

Perhaps you know of a browser-safe filter for IE8?


Don't know about safe, but maybe you can find what you need here...
http://www.gunlaug.no/contents/styles/target-browser.css

regards
Georg



***
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: memberh...@webstandardsgroup.org
***