Web Inspector: font-family names interpreted as color
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 20:51:11 +0000 (20:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jun 2015 20:51:11 +0000 (20:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123468

Patch by Devin Rousso <drousso@apple.com> on 2015-06-11
Reviewed by Timothy Hatcher.

* UserInterface/Views/CodeMirrorAdditions.js: Added logic to prevent color picker buttons from appearing before colors that come after a quote character (both " and ').

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185471 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/CodeMirrorAdditions.js

index 5df666d..8301b84 100644 (file)
@@ -1,3 +1,12 @@
+2015-06-11  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: font-family names interpreted as color
+        https://bugs.webkit.org/show_bug.cgi?id=123468
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/CodeMirrorAdditions.js: Added logic to prevent color picker buttons from appearing before colors that come after a quote character (both " and ').
+
 2015-06-11  Matt Baker  <mattbaker@apple.com>
 
         Web Inspector: Rendering Frames timeline should distinguish between layout and painting
index b2bb178..8647c4f 100644 (file)
             while (match) {
 
                 // Act as a negative look-behind and disallow the color from being prefixing with certain characters.
-                if (match.index > 0 && /[-.]/.test(lineContent[match.index - 1])) {
+                if (match.index > 0 && /[-.\"\']/.test(lineContent[match.index - 1])) {
                     match = colorRegex.exec(lineContent);
                     continue;
                 }