Axure / ie7-js

Automatically exported from code.google.com/p/ie7-js
0 stars 0 forks source link

js error combining :not() with descendant selector (PATCH provided) #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Apply IE8-js to a stylesheet with a rule having a selector like this: 
div:not(.classA) span
2. You get an "Expected ';' javascript error".

What version of the product are you using? On what operating system?
IE8-js (SVN r29) on Internet Explorer 6

Possible solution, and probable patch:

The problem seems to reside in the ie7-cssQuery.js file.
cssQuery get called with selector (the first parameter) set to 
"div:not(.classA) span".
Then it's executed this line:

var selectors = cssParser.escape(selector).split(",");

And here's the problem: the cssParser.escape method exectues the 
cssParser.format method which apply the WITHESPACE regexp this way:

selector.replace(WHITESPACE, "$1")

By doing so the selector become "div:not(.classA)span"

Note that the space between the parenthesis and the span element is gone 
and that is why the problem happen!

Changing the WITHESPACE regexp to not remove the space after the bracket 
seem to solve the problem (I've tested and in that case the js error is not 
thrown and the rule is working fine).

To solve I've changed WHITESPACE from the current /\s*([\s>+~(),]|^|$)\s*/g 
to /\s*([\s>+~(,]|^|$)\s*/g
I've just removed the closed bracket... Anyway I don't know if this could 
cause problems in other circumstances.

Thanks for this great A-product!

Original issue reported on code.google.com by m.ep...@gmail.com on 6 Feb 2010 at 1:24

GoogleCodeExporter commented 9 years ago
This is fixed in version 2.1.

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 3:37

GoogleCodeExporter commented 9 years ago
I'm sorry, but I cannot find any 2.1 version on SVN... Where can I download it?

(Another question: Will it support the ie7-recalc? The current version does not 
work
with it... Should I open a ticket about this or will it be solved in this 2.1 
version?)

Thanks again!

Original comment by m.ep...@gmail.com on 11 Feb 2010 at 3:43

GoogleCodeExporter commented 9 years ago
Sorry, I'm currently working on version 2.1. I hope to release it early next 
week.

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 4:00

GoogleCodeExporter commented 9 years ago
Wonderful!

Sorry to insist, but is there any support for ie7-recalc.js in this new version?
I'm asking just because I'm trying myself to adapt ie7-recalc to work with the
current version and I just would like to know if I should stop waiting your 2.1
version or if I can continue to work on this because no new bundled support for
ie7-recalc will be available soon.

Thanks in advance for your answer.

Original comment by m.ep...@gmail.com on 11 Feb 2010 at 4:21

GoogleCodeExporter commented 9 years ago
I wasn't intending to work on ie7-recalc. I wish I hadn't started it in the 
first 
place. :)

If you have any specific problems with it then let me know and I'll take a look 
as part 
of this bug-busting exercise.

Original comment by dean.edw...@gmail.com on 11 Feb 2010 at 8:10

GoogleCodeExporter commented 9 years ago
Yeah, I've read that you don't officially support it (anyway I think it would 
be 
really a good feature to include officially...).

Anyway I've reported the problem I'm having with it as you've asked including 
also a 
test page. Here's the relative issue: #222

Original comment by m.ep...@gmail.com on 12 Feb 2010 at 2:59

GoogleCodeExporter commented 9 years ago
#222 : http://code.google.com/p/ie7-js/issues/detail?id=222

Original comment by m.ep...@gmail.com on 12 Feb 2010 at 2:59