RESOLVED FIXED 80529
Web Inspector: Creating a selector for class names with trailing spaces results with two dots instead of one
https://bugs.webkit.org/show_bug.cgi?id=80529
Summary Web Inspector: Creating a selector for class names with trailing spaces resul...
Nikita Vasilyev
Reported 2012-03-07 12:21:47 PST
Screencast http://www.screenr.com/Ug78 Expected selector: ".dummy" Actual: "..dummy"
Attachments
Patch (1.41 KB, patch)
2012-03-08 09:53 PST, Vivek Galatage
webkit.review.bot: review-
webkit.review.bot: commit-queue-
Patch (1.41 KB, patch)
2012-03-08 10:53 PST, Vivek Galatage
no flags
Vivek Galatage
Comment 1 2012-03-08 02:46:26 PST
The problem is with Source/WebCore/inspector/front-end/DOMAgent.js file's method appropriateSelectorFor. This is the method which chooses the appropriate selector for the currently selected node in the Element view. So now as the existing class has a trailing spaces i.e. " dummy" the function misses to remove this space at the beginning and goes on prefixing the . before the className variable. Also the regular expression removes the white spaces with "." so it appears twice when added. So this has to be trimmed before using. The change is on the line no 348 and change it as below - var selector = "." + className.trim().replace(/\s+/, "."); Will upload the patch for this fix soon. Thank you, Vivek
Vivek Galatage
Comment 2 2012-03-08 09:53:29 PST
WebKit Review Bot
Comment 3 2012-03-08 10:50:29 PST
Comment on attachment 130834 [details] Patch Rejecting attachment 130834 [details] from review queue. vivekgalatage@gmail.com does not have reviewer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py. - If you do not have reviewer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have reviewer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your reviewer rights.
WebKit Review Bot
Comment 4 2012-03-08 10:51:23 PST
Comment on attachment 130834 [details] Patch Rejecting attachment 130834 [details] from commit-queue. vivekgalatage@gmail.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/committers.py. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in Tools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.
Vivek Galatage
Comment 5 2012-03-08 10:53:35 PST
Adam Roben (:aroben)
Comment 6 2012-03-08 11:53:37 PST
Comment on attachment 130851 [details] Patch Is there a way to create an automated test for this?
Pavel Feldman
Comment 7 2012-03-08 11:54:45 PST
Comment on attachment 130851 [details] Patch Nit: this could have a test.
Pavel Feldman
Comment 8 2012-03-08 11:57:30 PST
@aroben: either Alexander or myself will follow up with the test.
WebKit Review Bot
Comment 9 2012-03-08 13:40:48 PST
Comment on attachment 130851 [details] Patch Clearing flags on attachment: 130851 Committed r110198: <http://trac.webkit.org/changeset/110198>
WebKit Review Bot
Comment 10 2012-03-08 13:40:53 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.