Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear team of querypath: Thanks for sharing your great work. The css function needed a correction, so that it had the expected behavior when applying the css function. I compared this behaviour with JQuery and fortunately JQuery DOES behave in the expected way, so querypath was the one behind. The error was as follows:
When making a css change, for example, if we wanted to change a color:
$qp($html, "p")->css("color", "blue");
the behaviour was unbelievable: all of the "p" tags ended up with the same styles! If, for example, one p tag had a style of "margin-bottom: 2px", then this rule would spread in ALL of the other "p" tags even though we originally wanted to change only the color (!!). This was due to the way in which the loop and the assignment of css style was done.
In this new version, now the assignment is as it should be, and as it works in JQuery: it ONLY CHANGES the specific attribute in the style of the css of each specific match element in the loop, without homogenizing the same style string for all of the matches.
If you disagree with approving the commit, do please think about it deeply, so you can see the improvement. The modifications to the original code are minimal.
I hope you apply this commit, specially for the future users of this great library.
Best regards from Colombia, South America.
David López
http://investigacionyprogramacion.com