Fixed parsing of urls from url(...) tokens in CSS values #7

Merged
merged 1 commit into from Feb 20, 2012

Conversation

Projects
None yet
2 participants
Contributor

papandreou commented Feb 20, 2012

The YSLOW.util.getComputedStyle function produces the wrong result when a CSS value contains more than one end parenthesis after url( and get_url is set to true.

The bug is demonstrated by running this page through YSlow for Firefox or Chrome: http://gofish.dk/yslowbug/

Under the "Add Expires headers" rule in the "Grade" tab it says:

Grade C on Add Expires headers
There are 2 static components without a far-future expiration date.
(no expires) http://gofish.dk/favicon.ico
(no expires) http://gofish.dk/yslowbug/foo.png), -webkit-linear-gradient(top, rgb(0, 0, 0), rgb(255, 255, 255)
@papandreou papandreou Fixed parsing of urls from url(...) tokens in CSS values.
Use a non-greedy regexp rather than pulling out everything between the first occurence of "url(" and the last occurrence of ")".
cf807aa

@marcelduran marcelduran pushed a commit that referenced this pull request Feb 20, 2012

Marcel Duran [css url parser issue #7] moved var declaration to top 2dd47bb

marcelduran merged commit cf807aa into marcelduran:master Feb 20, 2012

@sajal sajal pushed a commit to sajal/yslow that referenced this pull request Feb 27, 2012

Marcel Duran just fixed issue #7 35437c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment