[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

pfeldman at chromium.org pfeldman at chromium.org
Thu Feb 4 21:35:29 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 34701ee02adedde7bcbac68df6ae439a52360096
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 1 18:44:48 2010 +0000

    2010-02-01  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Syntax highlighting in source view of
            Resources pane stops half-way.
    
            There were two problems here: (1) styles for html highlighter were not
            added into the css file (they used to be injected manually in the
            SourceFrame before). (2) 'Tag' needed to be lexer's state, not parser's.
            Otherwise unbalanced quotes in the text nodes were matching too match
            into the string tokens.
    
            https://bugs.webkit.org/show_bug.cgi?id=34359
    
            * inspector/front-end/NativeTextViewer.js:
            (WebInspector.NativeTextViewer.prototype._createLineDivs):
            (WebInspector.NativeTextViewer.prototype._lineHeight):
            (WebInspector.NativeTextViewer.prototype.initFontMetrics):
            * inspector/front-end/SourceFrame.js:
            (WebInspector.SourceFrame.prototype._createEditorIfNeeded):
            * inspector/front-end/SourceHTMLTokenizer.js:
            (WebInspector.SourceHTMLTokenizer):
            (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
            * inspector/front-end/SourceHTMLTokenizer.re2js:
            * inspector/front-end/TextEditor.js:
            (WebInspector.TextEditor.prototype.initFontMetrics):
            (WebInspector.TextEditor.prototype._registerShortcuts):
            * inspector/front-end/inspectorSyntaxHighlight.css:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c8d4a15..f29e0cc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,33 @@
+2010-02-01  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: Syntax highlighting in source view of
+        Resources pane stops half-way.
+
+        There were two problems here: (1) styles for html highlighter were not
+        added into the css file (they used to be injected manually in the
+        SourceFrame before). (2) 'Tag' needed to be lexer's state, not parser's.
+        Otherwise unbalanced quotes in the text nodes were matching too match
+        into the string tokens.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34359
+
+        * inspector/front-end/NativeTextViewer.js:
+        (WebInspector.NativeTextViewer.prototype._createLineDivs):
+        (WebInspector.NativeTextViewer.prototype._lineHeight):
+        (WebInspector.NativeTextViewer.prototype.initFontMetrics):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._createEditorIfNeeded):
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        (WebInspector.SourceHTMLTokenizer):
+        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+        * inspector/front-end/TextEditor.js:
+        (WebInspector.TextEditor.prototype.initFontMetrics):
+        (WebInspector.TextEditor.prototype._registerShortcuts):
+        * inspector/front-end/inspectorSyntaxHighlight.css:
+
 2010-02-01  Ben Murdoch  <benm at google.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/inspector/front-end/NativeTextViewer.js b/WebCore/inspector/front-end/NativeTextViewer.js
index 3b9650c..80d303c 100644
--- a/WebCore/inspector/front-end/NativeTextViewer.js
+++ b/WebCore/inspector/front-end/NativeTextViewer.js
@@ -58,6 +58,7 @@ WebInspector.NativeTextViewer.prototype = {
                 lineDiv.style.minHeight = this._textLineHeight + "px";
             this._sheet.appendChild(lineDiv);
             this._textModel.setAttribute(i, "line-div", lineDiv);
+            this._textModel.removeAttribute(i, "div-highlighted");
         }
         this._container.appendChild(this._sheet);
     },
@@ -143,8 +144,8 @@ WebInspector.NativeTextViewer.prototype = {
         if (lineNumber + 1 < this._textModel.linesCount) {
             var nextElement = this._textModel.getAttribute(lineNumber + 1, "line-div");
             return nextElement.offsetTop - element.offsetTop;
-        } else
-            return element.parentElement.offsetHeight - element.offsetTop;
+        }
+        return element.parentElement.offsetHeight - element.offsetTop;
     },
 
     _paintLine: function(lineNumber, lineOffset)
@@ -213,9 +214,9 @@ WebInspector.NativeTextViewer.prototype = {
         this.revalidateDecorationsAndPaint();
     },
 
-    _initFontMetrics: function()
+    initFontMetrics: function()
     {
-        WebInspector.TextEditor.prototype._initFontMetrics.call(this);
+        WebInspector.TextEditor.prototype.initFontMetrics.call(this);
         for (var i = 0; i < this._textModel.linesCount; ++i) {
             var lineDiv = this._textModel.getAttribute(i, "line-div");
             if (!this._textModel.line(i))
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index ffb2bc3..a806606 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -144,7 +144,7 @@ WebInspector.SourceFrame.prototype = {
         this._element = this._editor.element;
         this._element.addEventListener("keydown", this._keyDown.bind(this), true);
         this._parentElement.appendChild(this._element);
-        this._editor._initFontMetrics();
+        this._editor.initFontMetrics();
 
         this._editor.mimeType = this._mimeType;
 
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 1212ffe..31fd0b8 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
+/* Generated by re2c 0.13.5 on Mon Feb  1 19:13:12 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -45,29 +45,30 @@ WebInspector.SourceHTMLTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
 
+    // The order is determined by the generated code.
     this._lexConditions = {
         INITIAL: 0,
         COMMENT: 1,
-        DSTRING: 2,
-        SSTRING: 3
+        TAG: 2,
+        DSTRING: 4,
+        SSTRING: 5
     };
+    this.case_INITIAL = 1000;
+    this.case_COMMENT = 1001;
+    this.case_TAG = 1002;
+    this.case_DSTRING = 1004;
+    this.case_SSTRING = 1005;
 
     this._parseConditions = {
         INITIAL: 0,
-        TAG: 1,
-        ATTRIBUTE: 2,
-        ATTRIBUTE_VALUE: 3,
-        SCRIPT: 4,
-        SCRIPT_ATTRIBUTE: 5,
-        SCRIPT_ATTRIBUTE_VALUE: 6,
-        DOCTYPE: 7
+        ATTRIBUTE: 1,
+        ATTRIBUTE_VALUE: 2,
+        SCRIPT: 3,
+        SCRIPT_ATTRIBUTE: 4,
+        SCRIPT_ATTRIBUTE_VALUE: 5,
+        DOCTYPE: 6
     };
 
-    this.case_INITIAL = 1000;
-    this.case_COMMENT = 1001;
-    this.case_DSTRING = 1002;
-    this.case_SSTRING = 1003;
-
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
 }
 
@@ -130,9 +131,13 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 }
             } else {
                 if (this.getLexCondition() < 3) {
-                    { gotoCase = this.case_DSTRING; continue; };
+                    { gotoCase = this.case_TAG; continue; };
                 } else {
-                    { gotoCase = this.case_SSTRING; continue; };
+                    if (this.getLexCondition() < 4) {
+                        { gotoCase = this.case_DSTRING; continue; };
+                    } else {
+                        { gotoCase = this.case_SSTRING; continue; };
+                    }
                 }
             }
 /* *********************************** */
@@ -214,7 +219,7 @@ case 18:
 case 20:
             ++cursor;
 case 21:
-            this.setLexCondition(this._lexConditions.INITIAL);
+            this.setLexCondition(this._lexConditions.TAG);
             { return this._stringToken(cursor, true); }
 case 22:
             yych = this._charAt(++cursor);
@@ -234,353 +239,356 @@ case 24:
 /* *********************************** */
 case this.case_INITIAL:
             yych = this._charAt(cursor);
-            if (yych <= '=') {
-                if (yych <= '\'') {
-                    if (yych == '"') { gotoCase = 29; continue; };
-                    if (yych >= '\'') { gotoCase = 30; continue; };
-                } else {
-                    if (yych <= '9') {
-                        if (yych >= '0') { gotoCase = 31; continue; };
-                    } else {
-                        if (yych <= ';') { gotoCase = 27; continue; };
-                        if (yych <= '<') { gotoCase = 33; continue; };
-                        { gotoCase = 35; continue; };
-                    }
-                }
-            } else {
-                if (yych <= '^') {
-                    if (yych <= '>') { gotoCase = 37; continue; };
-                    if (yych <= '@') { gotoCase = 27; continue; };
-                    if (yych <= 'Z') { gotoCase = 31; continue; };
-                } else {
-                    if (yych <= '`') {
-                        if (yych <= '_') { gotoCase = 31; continue; };
-                    } else {
-                        if (yych <= 'z') { gotoCase = 31; continue; };
-                        if (yych >= 0x80) { gotoCase = 31; continue; };
-                    }
-                }
-            }
-case 27:
+            if (yych == '<') { gotoCase = 29; continue; };
             ++cursor;
-case 28:
             { this.tokenType = null; return cursor; }
 case 29:
             yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
-            { gotoCase = 82; continue; };
-case 30:
-            yyaccept = 0;
-            yych = this._charAt(YYMARKER = ++cursor);
-            { gotoCase = 76; continue; };
-case 31:
-            ++cursor;
-            yych = this._charAt(cursor);
-            { gotoCase = 74; continue; };
-case 32:
-            {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
-                        this.tokenType = null;
-                        return cursor;
-                    }
-
-                    if (this._parseCondition === this._parseConditions.TAG) {
-                        this.tokenType = "html-tag";
-                        this._parseCondition = this._parseConditions.ATTRIBUTE;
-                    } else if (this._isAttribute())
-                        this.tokenType = "html-attr-name";
-                    else if (this._isAttributeValue())
-                        this.tokenType = "html-attr-value";
-                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
-                        this.tokenType = "html-doctype";
-                    else
-                        this.tokenType = null;
-                    return cursor;
-                }
-case 33:
-            yyaccept = 1;
-            yych = this._charAt(YYMARKER = ++cursor);
             if (yych <= '/') {
-                if (yych == '!') { gotoCase = 42; continue; };
-                if (yych >= '/') { gotoCase = 39; continue; };
+                if (yych == '!') { gotoCase = 34; continue; };
+                if (yych >= '/') { gotoCase = 31; continue; };
             } else {
                 if (yych <= 'S') {
-                    if (yych >= 'S') { gotoCase = 40; continue; };
+                    if (yych >= 'S') { gotoCase = 32; continue; };
                 } else {
-                    if (yych == 's') { gotoCase = 40; continue; };
+                    if (yych == 's') { gotoCase = 32; continue; };
                 }
             }
-case 34:
-            {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
-                        this.tokenType = null;
-                        return cursor;
-                    }
-
-                    this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.TAG;
-                    return cursor;
-                }
-case 35:
-            ++cursor;
-            {
-                    if (this._isAttribute()) {
-                        this.tokenType = null;
-                        this._setAttributeValue();
-                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
-                        this.tokenType = "html-doctype";
-                    else
-                        this.tokenType = null;
-                    return cursor;
-                }
-case 37:
-            ++cursor;
+case 30:
             {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    if (this._parseCondition === this._parseConditions.DOCTYPE)
-                        this.tokenType = "html-doctype";
-                    else
-                        this.tokenType = "html-tag";
+                    this.setLexCondition(this._lexConditions.TAG);
 
-                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
-                        this._parseCondition = this._parseConditions.SCRIPT;
-                    else
-                        this._parseCondition = this._parseConditions.INITIAL;
+                    this.tokenType = "html-tag";
+                    this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
-case 39:
-            yyaccept = 1;
+case 31:
+            yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
-            if (yych == 'S') { gotoCase = 66; continue; };
-            if (yych == 's') { gotoCase = 66; continue; };
-            { gotoCase = 34; continue; };
-case 40:
+            if (yych == 'S') { gotoCase = 58; continue; };
+            if (yych == 's') { gotoCase = 58; continue; };
+            { gotoCase = 30; continue; };
+case 32:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 60; continue; };
-            if (yych == 'c') { gotoCase = 60; continue; };
-case 41:
+            if (yych == 'C') { gotoCase = 52; continue; };
+            if (yych == 'c') { gotoCase = 52; continue; };
+case 33:
             cursor = YYMARKER;
-            if (yyaccept <= 0) {
-                { gotoCase = 28; continue; };
-            } else {
-                { gotoCase = 34; continue; };
-            }
-case 42:
+            { gotoCase = 30; continue; };
+case 34:
             yych = this._charAt(++cursor);
             if (yych <= 'C') {
-                if (yych != '-') { gotoCase = 41; continue; };
+                if (yych != '-') { gotoCase = 33; continue; };
             } else {
-                if (yych <= 'D') { gotoCase = 44; continue; };
-                if (yych == 'd') { gotoCase = 44; continue; };
-                { gotoCase = 41; continue; };
+                if (yych <= 'D') { gotoCase = 36; continue; };
+                if (yych == 'd') { gotoCase = 36; continue; };
+                { gotoCase = 33; continue; };
             }
             yych = this._charAt(++cursor);
-            if (yych == '-') { gotoCase = 52; continue; };
-            { gotoCase = 41; continue; };
-case 44:
+            if (yych == '-') { gotoCase = 44; continue; };
+            { gotoCase = 33; continue; };
+case 36:
             yych = this._charAt(++cursor);
-            if (yych == 'O') { gotoCase = 45; continue; };
-            if (yych != 'o') { gotoCase = 41; continue; };
-case 45:
+            if (yych == 'O') { gotoCase = 37; continue; };
+            if (yych != 'o') { gotoCase = 33; continue; };
+case 37:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 46; continue; };
-            if (yych != 'c') { gotoCase = 41; continue; };
-case 46:
+            if (yych == 'C') { gotoCase = 38; continue; };
+            if (yych != 'c') { gotoCase = 33; continue; };
+case 38:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 47; continue; };
-            if (yych != 't') { gotoCase = 41; continue; };
-case 47:
+            if (yych == 'T') { gotoCase = 39; continue; };
+            if (yych != 't') { gotoCase = 33; continue; };
+case 39:
             yych = this._charAt(++cursor);
-            if (yych == 'Y') { gotoCase = 48; continue; };
-            if (yych != 'y') { gotoCase = 41; continue; };
-case 48:
+            if (yych == 'Y') { gotoCase = 40; continue; };
+            if (yych != 'y') { gotoCase = 33; continue; };
+case 40:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 49; continue; };
-            if (yych != 'p') { gotoCase = 41; continue; };
-case 49:
+            if (yych == 'P') { gotoCase = 41; continue; };
+            if (yych != 'p') { gotoCase = 33; continue; };
+case 41:
             yych = this._charAt(++cursor);
-            if (yych == 'E') { gotoCase = 50; continue; };
-            if (yych != 'e') { gotoCase = 41; continue; };
-case 50:
+            if (yych == 'E') { gotoCase = 42; continue; };
+            if (yych != 'e') { gotoCase = 33; continue; };
+case 42:
             ++cursor;
+            this.setLexCondition(this._lexConditions.TAG);
             {
                     this.tokenType = "html-doctype";
                     this._parseCondition = this._parseConditions.DOCTYPE;
                     return cursor;
                 }
-case 52:
+case 44:
             ++cursor;
             yych = this._charAt(cursor);
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 55; continue; };
-                { gotoCase = 52; continue; };
+                if (yych == '\n') { gotoCase = 47; continue; };
+                { gotoCase = 44; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 55; continue; };
-                if (yych != '-') { gotoCase = 52; continue; };
+                if (yych <= '\r') { gotoCase = 47; continue; };
+                if (yych != '-') { gotoCase = 44; continue; };
             }
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych == '-') { gotoCase = 57; continue; };
-            { gotoCase = 41; continue; };
-case 55:
+            if (yych == '-') { gotoCase = 49; continue; };
+            { gotoCase = 33; continue; };
+case 47:
             ++cursor;
             this.setLexCondition(this._lexConditions.COMMENT);
             { this.tokenType = "html-comment"; return cursor; }
-case 57:
+case 49:
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych != '>') { gotoCase = 52; continue; };
+            if (yych != '>') { gotoCase = 44; continue; };
             ++cursor;
             { this.tokenType = "html-comment"; return cursor; }
-case 60:
+case 52:
             yych = this._charAt(++cursor);
-            if (yych == 'R') { gotoCase = 61; continue; };
-            if (yych != 'r') { gotoCase = 41; continue; };
-case 61:
+            if (yych == 'R') { gotoCase = 53; continue; };
+            if (yych != 'r') { gotoCase = 33; continue; };
+case 53:
             yych = this._charAt(++cursor);
-            if (yych == 'I') { gotoCase = 62; continue; };
-            if (yych != 'i') { gotoCase = 41; continue; };
-case 62:
+            if (yych == 'I') { gotoCase = 54; continue; };
+            if (yych != 'i') { gotoCase = 33; continue; };
+case 54:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 63; continue; };
-            if (yych != 'p') { gotoCase = 41; continue; };
-case 63:
+            if (yych == 'P') { gotoCase = 55; continue; };
+            if (yych != 'p') { gotoCase = 33; continue; };
+case 55:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 64; continue; };
-            if (yych != 't') { gotoCase = 41; continue; };
-case 64:
+            if (yych == 'T') { gotoCase = 56; continue; };
+            if (yych != 't') { gotoCase = 33; continue; };
+case 56:
             ++cursor;
+            this.setLexCondition(this._lexConditions.TAG);
             {
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
                     return cursor;
                 }
-case 66:
+case 58:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 67; continue; };
-            if (yych != 'c') { gotoCase = 41; continue; };
-case 67:
+            if (yych == 'C') { gotoCase = 59; continue; };
+            if (yych != 'c') { gotoCase = 33; continue; };
+case 59:
             yych = this._charAt(++cursor);
-            if (yych == 'R') { gotoCase = 68; continue; };
-            if (yych != 'r') { gotoCase = 41; continue; };
-case 68:
+            if (yych == 'R') { gotoCase = 60; continue; };
+            if (yych != 'r') { gotoCase = 33; continue; };
+case 60:
             yych = this._charAt(++cursor);
-            if (yych == 'I') { gotoCase = 69; continue; };
-            if (yych != 'i') { gotoCase = 41; continue; };
-case 69:
+            if (yych == 'I') { gotoCase = 61; continue; };
+            if (yych != 'i') { gotoCase = 33; continue; };
+case 61:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 70; continue; };
-            if (yych != 'p') { gotoCase = 41; continue; };
-case 70:
+            if (yych == 'P') { gotoCase = 62; continue; };
+            if (yych != 'p') { gotoCase = 33; continue; };
+case 62:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 71; continue; };
-            if (yych != 't') { gotoCase = 41; continue; };
-case 71:
+            if (yych == 'T') { gotoCase = 63; continue; };
+            if (yych != 't') { gotoCase = 33; continue; };
+case 63:
             ++cursor;
+            this.setLexCondition(this._lexConditions.TAG);
             {
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
+/* *********************************** */
+case this.case_SSTRING:
+            yych = this._charAt(cursor);
+            if (yych <= '\f') {
+                if (yych == '\n') { gotoCase = 69; continue; };
+                { gotoCase = 68; continue; };
+            } else {
+                if (yych <= '\r') { gotoCase = 69; continue; };
+                if (yych == '\'') { gotoCase = 71; continue; };
+                { gotoCase = 68; continue; };
+            }
+case 67:
+            { return this._stringToken(cursor); }
+case 68:
+            yych = this._charAt(++cursor);
+            { gotoCase = 75; continue; };
+case 69:
+            ++cursor;
+            { this.tokenType = null; return cursor; }
+case 71:
+            ++cursor;
+case 72:
+            this.setLexCondition(this._lexConditions.TAG);
+            { return this._stringToken(cursor, true); }
 case 73:
+            yych = this._charAt(++cursor);
+            { gotoCase = 72; continue; };
+case 74:
             ++cursor;
             yych = this._charAt(cursor);
-case 74:
-            if (yych <= '^') {
-                if (yych <= '9') {
-                    if (yych <= '/') { gotoCase = 32; continue; };
-                    { gotoCase = 73; continue; };
+case 75:
+            if (yych <= '\f') {
+                if (yych == '\n') { gotoCase = 67; continue; };
+                { gotoCase = 74; continue; };
+            } else {
+                if (yych <= '\r') { gotoCase = 67; continue; };
+                if (yych == '\'') { gotoCase = 73; continue; };
+                { gotoCase = 74; continue; };
+            }
+/* *********************************** */
+case this.case_TAG:
+            yych = this._charAt(cursor);
+            if (yych <= '=') {
+                if (yych <= '\'') {
+                    if (yych == '"') { gotoCase = 80; continue; };
+                    if (yych >= '\'') { gotoCase = 81; continue; };
                 } else {
-                    if (yych <= '@') { gotoCase = 32; continue; };
-                    if (yych <= 'Z') { gotoCase = 73; continue; };
-                    { gotoCase = 32; continue; };
+                    if (yych <= '/') { gotoCase = 78; continue; };
+                    if (yych <= '9') { gotoCase = 82; continue; };
+                    if (yych >= '=') { gotoCase = 84; continue; };
                 }
             } else {
-                if (yych <= '`') {
-                    if (yych <= '_') { gotoCase = 73; continue; };
-                    { gotoCase = 32; continue; };
+                if (yych <= '^') {
+                    if (yych <= '>') { gotoCase = 86; continue; };
+                    if (yych <= '@') { gotoCase = 78; continue; };
+                    if (yych <= 'Z') { gotoCase = 82; continue; };
                 } else {
-                    if (yych <= 'z') { gotoCase = 73; continue; };
-                    if (yych <= 0x7F) { gotoCase = 32; continue; };
-                    { gotoCase = 73; continue; };
+                    if (yych <= '`') {
+                        if (yych <= '_') { gotoCase = 82; continue; };
+                    } else {
+                        if (yych <= 'z') { gotoCase = 82; continue; };
+                        if (yych >= 0x80) { gotoCase = 82; continue; };
+                    }
                 }
             }
-case 75:
+case 78:
+            ++cursor;
+            { this.tokenType = null; return cursor; }
+case 80:
+            yyaccept = 0;
+            yych = this._charAt(YYMARKER = ++cursor);
+            { gotoCase = 97; continue; };
+case 81:
+            yyaccept = 0;
+            yych = this._charAt(YYMARKER = ++cursor);
+            { gotoCase = 91; continue; };
+case 82:
             ++cursor;
             yych = this._charAt(cursor);
-case 76:
-            if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 75; continue; };
-            } else {
-                if (yych <= '\r') { gotoCase = 77; continue; };
-                if (yych == '\'') { gotoCase = 79; continue; };
-                { gotoCase = 75; continue; };
-            }
-case 77:
+            { gotoCase = 89; continue; };
+case 83:
+            {
+                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        this.tokenType = null;
+                        return cursor;
+                    }
+
+                    if (this._parseCondition === this._parseConditions.INITIAL) {
+                        this.tokenType = "html-tag";
+                        this._parseCondition = this._parseConditions.ATTRIBUTE;
+                    } else if (this._isAttribute())
+                        this.tokenType = "html-attr-name";
+                    else if (this._isAttributeValue())
+                        this.tokenType = "html-attr-value";
+                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
+                        this.tokenType = "html-doctype";
+                    else
+                        this.tokenType = null;
+                    return cursor;
+                }
+case 84:
             ++cursor;
-            this.setLexCondition(this._lexConditions.SSTRING);
-            { return this._stringToken(cursor); }
-case 79:
+            {
+                    if (this._isAttribute()) {
+                        this.tokenType = null;
+                        this._setAttributeValue();
+                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
+                        this.tokenType = "html-doctype";
+                    else
+                        this.tokenType = null;
+                    return cursor;
+                }
+case 86:
             ++cursor;
-            { return this._stringToken(cursor, true); }
-case 81:
+            this.setLexCondition(this._lexConditions.INITIAL);
+            {
+                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        this.tokenType = null;
+                        return cursor;
+                    }
+
+                    if (this._parseCondition === this._parseConditions.DOCTYPE)
+                        this.tokenType = "html-doctype";
+                    else
+                        this.tokenType = "html-tag";
+
+                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
+                        this._parseCondition = this._parseConditions.SCRIPT;
+                    else
+                        this._parseCondition = this._parseConditions.INITIAL;
+                    return cursor;
+                }
+case 88:
             ++cursor;
             yych = this._charAt(cursor);
-case 82:
-            if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 81; continue; };
+case 89:
+            if (yych <= '^') {
+                if (yych <= '9') {
+                    if (yych <= '/') { gotoCase = 83; continue; };
+                    { gotoCase = 88; continue; };
+                } else {
+                    if (yych <= '@') { gotoCase = 83; continue; };
+                    if (yych <= 'Z') { gotoCase = 88; continue; };
+                    { gotoCase = 83; continue; };
+                }
             } else {
-                if (yych <= '\r') { gotoCase = 83; continue; };
-                if (yych == '"') { gotoCase = 79; continue; };
-                { gotoCase = 81; continue; };
+                if (yych <= '`') {
+                    if (yych <= '_') { gotoCase = 88; continue; };
+                    { gotoCase = 83; continue; };
+                } else {
+                    if (yych <= 'z') { gotoCase = 88; continue; };
+                    if (yych <= 0x7F) { gotoCase = 83; continue; };
+                    { gotoCase = 88; continue; };
+                }
             }
-case 83:
+case 90:
             ++cursor;
-            this.setLexCondition(this._lexConditions.DSTRING);
-            { return this._stringToken(cursor); }
-/* *********************************** */
-case this.case_SSTRING:
             yych = this._charAt(cursor);
+case 91:
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 89; continue; };
-                { gotoCase = 88; continue; };
+                if (yych != '\n') { gotoCase = 90; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 89; continue; };
-                if (yych == '\'') { gotoCase = 91; continue; };
-                { gotoCase = 88; continue; };
+                if (yych <= '\r') { gotoCase = 92; continue; };
+                if (yych == '\'') { gotoCase = 94; continue; };
+                { gotoCase = 90; continue; };
             }
-case 87:
-            { return this._stringToken(cursor); }
-case 88:
-            yych = this._charAt(++cursor);
-            { gotoCase = 95; continue; };
-case 89:
+case 92:
             ++cursor;
-            { this.tokenType = null; return cursor; }
-case 91:
+            this.setLexCondition(this._lexConditions.SSTRING);
+            { return this._stringToken(cursor); }
+case 94:
             ++cursor;
-case 92:
-            this.setLexCondition(this._lexConditions.INITIAL);
             { return this._stringToken(cursor, true); }
-case 93:
-            yych = this._charAt(++cursor);
-            { gotoCase = 92; continue; };
-case 94:
+case 96:
             ++cursor;
             yych = this._charAt(cursor);
-case 95:
+case 97:
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 87; continue; };
-                { gotoCase = 94; continue; };
+                if (yych != '\n') { gotoCase = 96; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 87; continue; };
-                if (yych == '\'') { gotoCase = 93; continue; };
-                { gotoCase = 94; continue; };
+                if (yych <= '\r') { gotoCase = 98; continue; };
+                if (yych == '"') { gotoCase = 94; continue; };
+                { gotoCase = 96; continue; };
             }
+case 98:
+            ++cursor;
+            this.setLexCondition(this._lexConditions.DSTRING);
+            { return this._stringToken(cursor); }
         }
 
         }
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index e56f3ff..17d1e2a 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -44,29 +44,30 @@ WebInspector.SourceHTMLTokenizer = function()
 {
     WebInspector.SourceTokenizer.call(this);
 
+    // The order is determined by the generated code.
     this._lexConditions = {
         INITIAL: 0,
         COMMENT: 1,
-        DSTRING: 2,
-        SSTRING: 3
+        TAG: 2,
+        DSTRING: 4,
+        SSTRING: 5
     };
+    this.case_INITIAL = 1000;
+    this.case_COMMENT = 1001;
+    this.case_TAG = 1002;
+    this.case_DSTRING = 1004;
+    this.case_SSTRING = 1005;
 
     this._parseConditions = {
         INITIAL: 0,
-        TAG: 1,
-        ATTRIBUTE: 2,
-        ATTRIBUTE_VALUE: 3,
-        SCRIPT: 4,
-        SCRIPT_ATTRIBUTE: 5,
-        SCRIPT_ATTRIBUTE_VALUE: 6,
-        DOCTYPE: 7
+        ATTRIBUTE: 1,
+        ATTRIBUTE_VALUE: 2,
+        SCRIPT: 3,
+        SCRIPT_ATTRIBUTE: 4,
+        SCRIPT_ATTRIBUTE_VALUE: 5,
+        DOCTYPE: 6
     };
 
-    this.case_INITIAL = 1000;
-    this.case_COMMENT = 1001;
-    this.case_DSTRING = 1002;
-    this.case_SSTRING = 1003;
-
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
 }
 
@@ -157,40 +158,43 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 <COMMENT> CommentContent => COMMENT { this.tokenType = "html-comment"; return cursor; }
                 <COMMENT> CommentEnd => INITIAL { this.tokenType = "html-comment"; return cursor; }
 
-                <INITIAL> DocTypeLT => INITIAL
+                <INITIAL> DocTypeLT => TAG
                 {
                     this.tokenType = "html-doctype";
                     this._parseCondition = this._parseConditions.DOCTYPE;
                     return cursor;
                 }
 
-                <INITIAL> ScriptStart => INITIAL
+                <INITIAL> ScriptStart => TAG
                 {
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
                     return cursor;
                 }
 
-                <INITIAL> ScriptEnd => INITIAL
+                <INITIAL> ScriptEnd => TAG
                 {
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
-                <INITIAL> LT => INITIAL
+                <INITIAL> LT
                 {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
                         this.tokenType = null;
                         return cursor;
                     }
 
+                    // Only make lexer transition if not in script tag.
+                    this.setLexCondition(this._lexConditions.TAG);
+
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.TAG;
+                    this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
-                <INITIAL> GT => INITIAL
+                <TAG> GT => INITIAL
                 {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
                         this.tokenType = null;
@@ -209,15 +213,15 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                     return cursor;
                 }
 
-                <INITIAL> StringLiteral { return this._stringToken(cursor, true); }
-                <INITIAL> DoubleStringStart => DSTRING { return this._stringToken(cursor); }
+                <TAG> StringLiteral { return this._stringToken(cursor, true); }
+                <TAG> DoubleStringStart => DSTRING { return this._stringToken(cursor); }
                 <DSTRING> DoubleStringContent => DSTRING { return this._stringToken(cursor); }
-                <DSTRING> DoubleStringEnd => INITIAL { return this._stringToken(cursor, true); }
-                <INITIAL> SingleStringStart => SSTRING { return this._stringToken(cursor); }
+                <DSTRING> DoubleStringEnd => TAG { return this._stringToken(cursor, true); }
+                <TAG> SingleStringStart => SSTRING { return this._stringToken(cursor); }
                 <SSTRING> SingleStringContent => SSTRING { return this._stringToken(cursor); }
-                <SSTRING> SingleStringEnd => INITIAL { return this._stringToken(cursor, true); }
+                <SSTRING> SingleStringEnd => TAG { return this._stringToken(cursor, true); }
 
-                <INITIAL> EqualSign => INITIAL
+                <TAG> EqualSign => TAG
                 {
                     if (this._isAttribute()) {
                         this.tokenType = null;
@@ -229,14 +233,14 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                     return cursor;
                 }
 
-                <INITIAL> Identifier
+                <TAG> Identifier
                 {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    if (this._parseCondition === this._parseConditions.TAG) {
+                    if (this._parseCondition === this._parseConditions.INITIAL) {
                         this.tokenType = "html-tag";
                         this._parseCondition = this._parseConditions.ATTRIBUTE;
                     } else if (this._isAttribute())
diff --git a/WebCore/inspector/front-end/TextEditor.js b/WebCore/inspector/front-end/TextEditor.js
index 73b5aab..9268280 100644
--- a/WebCore/inspector/front-end/TextEditor.js
+++ b/WebCore/inspector/front-end/TextEditor.js
@@ -976,7 +976,7 @@ WebInspector.TextEditor.prototype = {
         this._updateCursor(this._selection.endLine, this._selection.endColumn);
     },
 
-    _initFontMetrics: function()
+    initFontMetrics: function()
     {
         var computedStyle = window.getComputedStyle(this.element);
         this._font = computedStyle.fontSize + " " + computedStyle.fontFamily;
@@ -998,7 +998,6 @@ WebInspector.TextEditor.prototype = {
 
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey("d", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleDebugMode.bind(this);
         this._shortcuts[WebInspector.KeyboardShortcut.makeKey("h", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleHighlightMode.bind(this);
-        this._shortcuts[WebInspector.KeyboardShortcut.makeKey("m", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleMonospaceMode.bind(this);
     },
 
     _handleUndo: function()
diff --git a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
index e3e3074..58904c9 100644
--- a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
+++ b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
@@ -65,3 +65,24 @@
 .webkit-javascript-string, .webkit-javascript-regexp {
     color: rgb(196, 26, 22);
 }
+
+/* Keep this in sync with view-source.css */
+.webkit-html-tag {
+    color: rgb(136, 18, 128);
+}
+
+.webkit-html-attr-name {
+    color: rgb(153, 69, 0);
+}
+
+.webkit-html-attr-value {
+    color: rgb(26, 26, 166);
+}
+
+.webkit-html-comment {
+    color: rgb(35, 110, 37);
+}
+
+.webkit-html-doctype {
+    color: rgb(192, 192, 192);
+}

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list