« Return to Thread: [Trinidad] added browser version support in skinning TRINIDAD-799

Re: [Trinidad] added browser version support in skinning TRINIDAD-799

by Cristi Toth :: Rate this Message:

Reply to Author | View in Thread


On Thu, Apr 17, 2008 at 8:04 AM, Blake Sullivan <blake.sullivan@...> wrote:
Cristi Toth said the following On 4/16/2008 5:34 PM PT:
Hi Blake,

I wanted to be backwards compatible with what the XSS offered.
So I assumed that we's want just a list (not necessarily an interval)
And I picked the easiest to parse format.

But it's a good idea to follow a (possible) future standard.
I agree. While still only a candidate recommendation, the goal of the Trinidad CSS syntax has always been to be forward looking (thus the use of CSS3-style namespaces).  As the media query syntax is by far the most likely syntax to be specified, we should go with that syntax over one  of our own design.  That both Opera and WebKit have bothered to implement the specification is also a good sign.

I had a quick look over it's syntax, but not enough.
Isn't there a way to have a list of numbers?
smth like : @agent ie (version: 5 7)
I didn't see one, but I don't think that you really want a list here anyway.  Don't you really want all versions of IE >= 5 and < 8?

Let's say that  any list could be defined  like several  intervals, but it would have been more flexible.

I think my proposal for abusing a definition of max-version is weak (the specification discussion is pretty clear the "min-" prefix means >= and the "max-" prefix means <=).  So I think that a more explicit feature suffix would be better.  For example:

@agent ie and (min-version:5) and (max-version-less-than:8), gecko, safari

max...less-than sounds a little bit redundant
maybe something like (version-lt:8) , in general 'version-' followed by an EL comparison operator (eq, ne, lt, le, gt, ge)?
what do you say ?


@Andrew
Currently (and in the XSS format) version is compared with TrinidadAgent.getAgentMajorVersion()
it also has a getAgentVersion() method that returns the full unparsed string.
I don't know what it means, but I assume it's very browser dependent.
Determining a floating point browser version isn't a technical problem and should be supported.  The Gecko engine is an example of an engine that adds CSS features in point releases 1.8 -> 1.9 for example.
At least what I could do for now is to support Double instead of Integer
but what if some agents have versions like dates or text?
I'm not aware of how most of the browsers define their version
and I wouldn't want to mess up TrinidadAgent right now, seeing that nobody asked for this feature until now.
My goal was only to add the feature that was supported in the XSS.
Does anyone know more details about agent's versions in general?


-- Blake Sullivan

But do you see a use-case  when you would need different css for minor versions?
Like a difference between IE 5.0 and 5.5 ?

It would be nice to get to a final conclusion,
so I can update this solution before the next release.

regards,
--
Cristi Toth

-------------
Codebeat
www.codebeat.ro
On Thu, Apr 17, 2008 at 1:14 AM, Blake Sullivan <blake.sullivan@...> wrote:
Cristi,

I think that we should follow a subset of the syntax of CSS Media Queries for consistency as this is a CSS file.  If there are other standard syntaxes for CSS, we can use one of those instead.

Your rule below could be expressed in such a syntax as:

@agent ie and (min-version:5) and (max-version:7), gecko, safari

Assuming that we chose a convenient definition for ma-version (that it includes all version up to but not including an increment of the smallest specified digit.  so that max-version:7 really means version < 8,  while max-version 7.5 really means version < 7.6)

-- Blake Sullivan



Cristi Toth said the following On 4/16/2008 3:24 PM PT:
Hi guys,

I finally added browser version support in skinning, but using a different format than first suggested.
As we needed to support multiple browsers, each with multiple versions, I have chosen to use this format:

@ agent ie 5 6 7, gecko,safari {....}


So each agent definition separated by comma and the versions a space separated list following the browser type.

Also in the code I replaced :
int[] browsers
int[] versions
with :
Map <Integer, Set<Integer>> browsers

this represents browser types mapped to their versions set.


If you have any objections on this, please reopen the issue and add some comments

Regards,
--
Cristi Toth

-------------
Codebeat
www.codebeat.ro









--
Cristi Toth

-------------
Codebeat
www.codebeat.ro

 « Return to Thread: [Trinidad] added browser version support in skinning TRINIDAD-799