Title: [211973] trunk/Source/WebInspectorUI
Revision
211973
Author
[email protected]
Date
2017-02-09 11:29:05 -0800 (Thu, 09 Feb 2017)

Log Message

Web Inspector: Option+hover on -webkit-transform in Styles sidebar underlines only half the property
https://bugs.webkit.org/show_bug.cgi?id=167949

Patch by Devin Rousso <[email protected]> on 2017-02-09
Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
Attempt to merge tokens (specifically the `text` and `start` values) if the either the
previous or next token is of the type "meta".

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (211972 => 211973)


--- trunk/Source/WebInspectorUI/ChangeLog	2017-02-09 19:23:40 UTC (rev 211972)
+++ trunk/Source/WebInspectorUI/ChangeLog	2017-02-09 19:29:05 UTC (rev 211973)
@@ -1,3 +1,15 @@
+2017-02-09  Devin Rousso  <[email protected]>
+
+        Web Inspector: Option+hover on -webkit-transform in Styles sidebar underlines only half the property
+        https://bugs.webkit.org/show_bug.cgi?id=167949
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
+        (WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
+        Attempt to merge tokens (specifically the `text` and `start` values) if the either the 
+        previous or next token is of the type "meta".
+
 2017-02-09  Eric Carlson  <[email protected]>
 
         [MediaStream] Remove legacy Navigator.webkitGetUserMedia

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js (211972 => 211973)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2017-02-09 19:23:40 UTC (rev 211972)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/CodeMirrorTokenTrackingController.js	2017-02-09 19:29:05 UTC (rev 211973)
@@ -347,6 +347,31 @@
         // We have a new hovered token.
         var tokenInfo = this._previousTokenInfo = this._getTokenInfoForPosition(position);
 
+        if (/\bmeta\b/.test(token.type)) {
+            let nextTokenPosition = Object.shallowCopy(position);
+            nextTokenPosition.ch = tokenInfo.token.end + 1;
+
+            let nextToken = this._codeMirror.getTokenAt(nextTokenPosition);
+            if (nextToken && nextToken.type && !/\bmeta\b/.test(nextToken.type)) {
+                console.assert(tokenInfo.token.end === nextToken.start);
+
+                tokenInfo.token.type = nextToken.type;
+                tokenInfo.token.string = tokenInfo.token.string + nextToken.string;
+                tokenInfo.token.end = nextToken.end;
+            }
+        } else {
+            let previousTokenPosition = Object.shallowCopy(position);
+            previousTokenPosition.ch = tokenInfo.token.start - 1;
+
+            let previousToken = this._codeMirror.getTokenAt(previousTokenPosition);
+            if (previousToken && previousToken.type && /\bmeta\b/.test(previousToken.type)) {
+                console.assert(tokenInfo.token.start === previousToken.end);
+
+                tokenInfo.token.string = previousToken.string + tokenInfo.token.string;
+                tokenInfo.token.start = previousToken.start;
+            }
+        }
+
         if (this._tokenHoverTimer)
             clearTimeout(this._tokenHoverTimer);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to