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

merged 1 commit into from Feb 20, 2012


None yet
2 participants

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:

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)
(no expires), -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 ")".

@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