Title: [206888] trunk/Source/WebInspectorUI
Revision
206888
Author
commit-qu...@webkit.org
Date
2016-10-06 16:11:01 -0700 (Thu, 06 Oct 2016)

Log Message

Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
https://bugs.webkit.org/show_bug.cgi?id=162792

Patch by Devin Rousso <dcrousso+web...@gmail.com> on 2016-10-06
Reviewed by Matt Baker.

* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
Changed regular _expression_ for matching CSS rules to allow newlines in pasted text.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (206887 => 206888)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-10-06 23:05:17 UTC (rev 206887)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-10-06 23:11:01 UTC (rev 206888)
@@ -1,3 +1,14 @@
+2016-10-06  Devin Rousso  <dcrousso+web...@gmail.com>
+
+        Inspector exception in `parseTextForRule()` when pasting into CSS rule selector
+        https://bugs.webkit.org/show_bug.cgi?id=162792
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/CSSStyleDeclarationSection.js:
+        (WebInspector.CSSStyleDeclarationSection.prototype._handleSelectorPaste.parseTextForRule):
+        Changed regular _expression_ for matching CSS rules to allow newlines in pasted text.
+
 2016-10-02  Devin Rousso  <dcrousso+web...@gmail.com>
 
         Web Inspector: Clicking twice on the color swatch square should hide the color picker

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js (206887 => 206888)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js	2016-10-06 23:05:17 UTC (rev 206887)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CSSStyleDeclarationSection.js	2016-10-06 23:11:01 UTC (rev 206888)
@@ -423,11 +423,11 @@
         {
             let containsBraces = /[\{\}]/;
             if (!containsBraces.test(text))
-                return null;
+                return [];
 
-            let match = text.match(/([^{]+){(.*)}/);
+            let match = text.match(/([^{]+){([\s\S]*)}/);
             if (!match)
-                return null;
+                return [];
 
             // If the match "body" contains braces, parse that body as if it were a rule.
             // This will usually happen if the user includes a media query in the copied text.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to