473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

SlickSpeed CSS Selector TestSuite

The link below is to a CSS selector test suite that tests 6 popular
libraries:

<URL: http://ajaxian.com/archives/slickspe...ctor-testsuite
>
It might be of interest to some.
--
Rob

Jun 21 '07 #1
3 1977
RobG wrote:
The link below is to a CSS selector test suite that tests 6 popular
libraries:

<URL: http://ajaxian.com/archives/slickspe...ctor-testsuite

It might be of interest to some.
Very cool. A supposedly neutral look at the various mainstream
libraries and their CSS abilities.

I wonder though, on a precursory glance, dojo had 15 green blocks
(fastest), 3 black (errors), where MooTools had 7 green, and 1 black.

MooTools also had more "found the wrong things."

Whatever algorithm is being used determined that MooTools was then
*twice* as fast as dojo.

*sigh* Prototype was the fastest. Hehe.

Thanks for the link.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 21 '07 #2
On Jun 22, 5:46 am, -Lost <maventheextrawo...@techie.comwrote:
RobG wrote:
The link below is to a CSS selector test suite that tests 6 popular
libraries:
<URL:http://ajaxian.com/archives/slickspe...ctor-testsuite
It might be of interest to some.

Very cool. A supposedly neutral look at the various mainstream
libraries and their CSS abilities.

I wonder though, on a precursory glance, dojo had 15 green blocks
(fastest), 3 black (errors), where MooTools had 7 green, and 1 black.

MooTools also had more "found the wrong things."

Whatever algorithm is being used determined that MooTools was then
*twice* as fast as dojo.

*sigh* Prototype was the fastest. Hehe.
I don't think absolute speed is necessarily the key - IE takes 10
times longer than Firefox overall and which library is "fastest" is
browser dependent.

Using Firefox or Safari, Prototype.js is not only fast, but the only
one to get no errors (though whether it gets "correct" results every
time I can't say). I haven't looked the different libraries too
closely, but Prototype.js uses XPath where it can, which probably
explains its good results in browsers that support it well.

A big issue with CSS or XPath selectors is that they tend to be used
badly, I've seen plenty of examples of code where programmers have
used a lengthy selector to get a reference to a sibling or parent.
--
Rob

Jun 21 '07 #3
RobG wrote:
On Jun 22, 5:46 am, -Lost <maventheextrawo...@techie.comwrote:
>RobG wrote:
>>The link below is to a CSS selector test suite that tests 6 popular
libraries:
<URL:http://ajaxian.com/archives/slickspe...ctor-testsuite
It might be of interest to some.
Very cool. A supposedly neutral look at the various mainstream
libraries and their CSS abilities.

I wonder though, on a precursory glance, dojo had 15 green blocks
(fastest), 3 black (errors), where MooTools had 7 green, and 1 black.

MooTools also had more "found the wrong things."

Whatever algorithm is being used determined that MooTools was then
*twice* as fast as dojo.

*sigh* Prototype was the fastest. Hehe.

I don't think absolute speed is necessarily the key - IE takes 10
times longer than Firefox overall and which library is "fastest" is
browser dependent.

Using Firefox or Safari, Prototype.js is not only fast, but the only
one to get no errors (though whether it gets "correct" results every
time I can't say). I haven't looked the different libraries too
closely, but Prototype.js uses XPath where it can, which probably
explains its good results in browsers that support it well.
I guess this is really where jQuery's "basic XPath support" comes into play.
A big issue with CSS or XPath selectors is that they tend to be used
badly, I've seen plenty of examples of code where programmers have
used a lengthy selector to get a reference to a sibling or parent.
I think I have seen examples of this. Instead of employing (in jQuery
for example) parent(), children(), and siblings(), I have seen:

$('body/div/div/p').eq(1).css('font-size', '2em');
$('body/div/div/p:eq(2)').css('font-size', '4em');

That might do for a one-off solution, but definitely not extensible.
But somehow people focus on the XPath shite, and forget native functions.

As is the nature of JavaScript though, jQuery introduces the ability to
write really crappy code or really great code. For example, in order of
worst to best (in my opinion):

function change_class()
{
$('p').each(function()
{
if (this.className == 'foo')
{
this.className = 'bar';
}
});
}
function change_class2()
{
$('p.foo').each(function()
{
this.className = 'bar'
});
}
function change_class3()
{
$('p.foo').removeClass('foo').addClass('bar');
}

Then again, knowing me, there is probably an even cleaner method. (I
purposely ignored toggling.)

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Jun 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alex Vinokur | last post by:
An algorithm which computes very long Fibonacci numbers http://groups.google.com/groups?selm=bnni5p%2412i47o%241%40ID-79865.news.uni-berlin.de was used as a performance testsuite to compare speed...
6
by: Richard Barnet | last post by:
Dear CSS gurus, My question regarding 'the cascade' is a simple one, but one that I haven't heard anyone talk about before: When cascading (for instance, when applying two linked stylesheets),...
4
by: Zane | last post by:
Hi, I am having some grieve with the following part of my CSS, basically when using a composite selector using an ID as the first element the it doesn't display the expected results. Am I doing...
3
by: Lian Liming | last post by:
Hi, The language in my web site may be Simplified Chinese or English. I want to define different styles for each language. For each language, the http header is different. <meta name="language"...
2
by: Chris Sharman | last post by:
See http://services.ccagroup.co.uk/testform.htm Looks as intended in firefox, is valid (bulk of inputs centred in a div occupying the left half of the page). ie ignores the child selector,...
8
by: sajid | last post by:
The CSS 2.1 Specification describes how to sort a list of selectors in order of specificity, but it doesn't provide a method to calculate the specificity of a single selector in isolation. I've...
3
by: JakDaniel | last post by:
is it possible, create a selector as alias of another selector... (maybe) in another stylesheet file? ex: html page .... <link rel="stylesheet" type="text/css" href="style1.css" /> <link...
6
by: _googlepost | last post by:
I have some CSS that goes something like this: table.TableStyle {font-family: "Helvetica", "Ariel"; background- color:white; border-collapse:collapse;} table.TableStyle COLGROUP { background-...
1
by: billiejoex | last post by:
Hi there, into a module of mine I 'warn' a message if a certain situation occurs: def add_anonymous_user(permissions=('r'): if 'w' in p: import warnings warnings.warn("it's not rencommended...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.