[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:29:14 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit be9c866f6fbebc4a3a737f1b588558b92f3e327e
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 27 11:18:55 2010 +0000

    2010-01-27  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: Improve SourceHTMLTokenizer so that it treats script tag well.
    
            https://bugs.webkit.org/show_bug.cgi?id=34177
    
            * inspector/front-end/SourceHTMLTokenizer.js:
            (WebInspector.SourceHTMLTokenizer):
            (WebInspector.SourceHTMLTokenizer.prototype._isAttribute):
            (WebInspector.SourceHTMLTokenizer.prototype._isAttributeValue):
            (WebInspector.SourceHTMLTokenizer.prototype._setAttributeValue):
            (WebInspector.SourceHTMLTokenizer.prototype._setAttribute):
            (WebInspector.SourceHTMLTokenizer.prototype._stringToken):
            (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
            * inspector/front-end/SourceHTMLTokenizer.re2js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53916 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 752224b..b022c75 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,24 @@
 
         Reviewed by Timothy Hatcher.
 
+        Web Inspector: Improve SourceHTMLTokenizer so that it treats script tag well.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34177
+
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        (WebInspector.SourceHTMLTokenizer):
+        (WebInspector.SourceHTMLTokenizer.prototype._isAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._isAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._setAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._setAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._stringToken):
+        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+
+2010-01-26  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
         Web Inspector: nuke quarantine wrappers.
 
         https://bugs.webkit.org/show_bug.cgi?id=34203
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 4b3f141..41664af 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 Tue Jan 26 01:16:33 2010 */
+/* Generated by re2c 0.13.5 on Tue Jan 26 23:10:38 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -57,7 +57,10 @@ WebInspector.SourceHTMLTokenizer = function()
         TAG: 1,
         ATTRIBUTE: 2,
         ATTRIBUTE_VALUE: 3,
-        DOCTYPE: 4
+        SCRIPT: 4,
+        SCRIPT_ATTRIBUTE: 5,
+        SCRIPT_ATTRIBUTE_VALUE: 6,
+        DOCTYPE: 7
     };
 
     this.case_INITIAL = 1000;
@@ -69,12 +72,38 @@ WebInspector.SourceHTMLTokenizer = function()
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
+    _isAttribute: function()
+    {
+        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
+    },
+
+    _isAttributeValue: function()
+    {
+        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+    },
+
+    _setAttributeValue: function()
+    {
+        if (this._parseCondition === this._parseConditions.ATTRIBUTE)
+            this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
+        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
+            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+    },
+
+    _setAttribute: function()
+    {
+        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE)
+            this._parseCondition = this._parseConditions.ATTRIBUTE;
+        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE)
+            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+    },
+
     _stringToken: function(cursor, stringEnds)
     {
-        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
+        if (this._isAttributeValue()) {
             this.tokenType = "html-attr-value";
             if (stringEnds)
-                this._parseCondition = this._parseConditions.ATTRIBUTE;
+                this._setAttribute();
         } else if (this._parseCondition === this._parseConditions.DOCTYPE)
             this.tokenType = "html-doctype";
         else
@@ -233,18 +262,31 @@ case 28:
 case 29:
             yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
-            { gotoCase = 68; continue; };
+            { gotoCase = 82; continue; };
 case 30:
             yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
-            { gotoCase = 62; continue; };
+            { gotoCase = 76; continue; };
 case 31:
             yyaccept = 1;
             yych = this._charAt(YYMARKER = ++cursor);
-            if (yych == '!') { gotoCase = 42; continue; };
-            if (yych == '/') { gotoCase = 41; continue; };
+            if (yych <= '/') {
+                if (yych == '!') { gotoCase = 44; continue; };
+                if (yych >= '/') { gotoCase = 41; continue; };
+            } else {
+                if (yych <= 'S') {
+                    if (yych >= 'S') { gotoCase = 42; continue; };
+                } else {
+                    if (yych == 's') { gotoCase = 42; continue; };
+                }
+            }
 case 32:
             {
+                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        this.tokenType = null;
+                        return cursor;
+                    }
+
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.TAG;
                     return cursor;
@@ -252,9 +294,9 @@ case 32:
 case 33:
             ++cursor;
             {
-                    if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
+                    if (this._isAttribute()) {
                         this.tokenType = null;
-                        this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
+                        this._setAttributeValue();
                     } else if (this._parseCondition === this._parseConditions.DOCTYPE)
                         this.tokenType = "html-doctype";
                     else
@@ -264,11 +306,20 @@ case 33:
 case 35:
             ++cursor;
             {
+                    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._parseCondition = this._parseConditions.INITIAL;
+
+                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
+                        this._parseCondition = this._parseConditions.SCRIPT;
+                    else
+                        this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 case 37:
@@ -277,16 +328,19 @@ case 37:
             { gotoCase = 40; continue; };
 case 38:
             {
+                    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._parseCondition === this._parseConditions.ATTRIBUTE) {
+                    } else if (this._isAttribute())
                         this.tokenType = "html-attr-name";
-                        this._parseCondition = this._parseConditions.ATTRIBUTE;
-                    } else if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
+                    else if (this._isAttributeValue())
                         this.tokenType = "html-attr-value";
-                        this._parseCondition = this._parseConditions.ATTRIBUTE;
-                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
+                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
                         this.tokenType = "html-doctype";
                     else
                         this.tokenType = null;
@@ -308,16 +362,15 @@ case 40:
                 { gotoCase = 39; continue; };
             }
 case 41:
-            yych = this._charAt(++cursor);
+            yyaccept = 1;
+            yych = this._charAt(YYMARKER = ++cursor);
+            if (yych == 'S') { gotoCase = 68; continue; };
+            if (yych == 's') { gotoCase = 68; continue; };
             { gotoCase = 32; continue; };
 case 42:
             yych = this._charAt(++cursor);
-            if (yych <= 'C') {
-                if (yych == '-') { gotoCase = 44; continue; };
-            } else {
-                if (yych <= 'D') { gotoCase = 45; continue; };
-                if (yych == 'd') { gotoCase = 45; continue; };
-            }
+            if (yych == 'C') { gotoCase = 62; continue; };
+            if (yych == 'c') { gotoCase = 62; continue; };
 case 43:
             cursor = YYMARKER;
             if (yyaccept <= 0) {
@@ -327,94 +380,151 @@ case 43:
             }
 case 44:
             yych = this._charAt(++cursor);
-            if (yych == '-') { gotoCase = 53; continue; };
+            if (yych <= 'C') {
+                if (yych != '-') { gotoCase = 43; continue; };
+            } else {
+                if (yych <= 'D') { gotoCase = 46; continue; };
+                if (yych == 'd') { gotoCase = 46; continue; };
+                { gotoCase = 43; continue; };
+            }
+            yych = this._charAt(++cursor);
+            if (yych == '-') { gotoCase = 54; continue; };
             { gotoCase = 43; continue; };
-case 45:
+case 46:
             yych = this._charAt(++cursor);
-            if (yych == 'O') { gotoCase = 46; continue; };
+            if (yych == 'O') { gotoCase = 47; continue; };
             if (yych != 'o') { gotoCase = 43; continue; };
-case 46:
+case 47:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 47; continue; };
+            if (yych == 'C') { gotoCase = 48; continue; };
             if (yych != 'c') { gotoCase = 43; continue; };
-case 47:
+case 48:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 48; continue; };
+            if (yych == 'T') { gotoCase = 49; continue; };
             if (yych != 't') { gotoCase = 43; continue; };
-case 48:
+case 49:
             yych = this._charAt(++cursor);
-            if (yych == 'Y') { gotoCase = 49; continue; };
+            if (yych == 'Y') { gotoCase = 50; continue; };
             if (yych != 'y') { gotoCase = 43; continue; };
-case 49:
+case 50:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 50; continue; };
+            if (yych == 'P') { gotoCase = 51; continue; };
             if (yych != 'p') { gotoCase = 43; continue; };
-case 50:
+case 51:
             yych = this._charAt(++cursor);
-            if (yych == 'E') { gotoCase = 51; continue; };
+            if (yych == 'E') { gotoCase = 52; continue; };
             if (yych != 'e') { gotoCase = 43; continue; };
-case 51:
+case 52:
             ++cursor;
             {
-                    var token = this._line.substring(cursorOnEnter, cursor);
                     this.tokenType = "html-doctype";
                     this._parseCondition = this._parseConditions.DOCTYPE;
                     return cursor;
                 }
-case 53:
+case 54:
             ++cursor;
             yych = this._charAt(cursor);
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 56; continue; };
-                { gotoCase = 53; continue; };
+                if (yych == '\n') { gotoCase = 57; continue; };
+                { gotoCase = 54; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 56; continue; };
-                if (yych != '-') { gotoCase = 53; continue; };
+                if (yych <= '\r') { gotoCase = 57; continue; };
+                if (yych != '-') { gotoCase = 54; continue; };
             }
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych == '-') { gotoCase = 58; continue; };
+            if (yych == '-') { gotoCase = 59; continue; };
             { gotoCase = 43; continue; };
-case 56:
+case 57:
             ++cursor;
             this.setLexCondition(this._lexConditions.COMMENT);
             { this.tokenType = "html-comment"; return cursor; }
-case 58:
+case 59:
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych != '>') { gotoCase = 53; continue; };
+            if (yych != '>') { gotoCase = 54; continue; };
             ++cursor;
             { this.tokenType = "html-comment"; return cursor; }
-case 61:
+case 62:
+            yych = this._charAt(++cursor);
+            if (yych == 'R') { gotoCase = 63; continue; };
+            if (yych != 'r') { gotoCase = 43; continue; };
+case 63:
+            yych = this._charAt(++cursor);
+            if (yych == 'I') { gotoCase = 64; continue; };
+            if (yych != 'i') { gotoCase = 43; continue; };
+case 64:
+            yych = this._charAt(++cursor);
+            if (yych == 'P') { gotoCase = 65; continue; };
+            if (yych != 'p') { gotoCase = 43; continue; };
+case 65:
+            yych = this._charAt(++cursor);
+            if (yych == 'T') { gotoCase = 66; continue; };
+            if (yych != 't') { gotoCase = 43; continue; };
+case 66:
+            ++cursor;
+            {
+                    this.tokenType = "html-tag";
+                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+                    return cursor;
+                }
+case 68:
+            yych = this._charAt(++cursor);
+            if (yych == 'C') { gotoCase = 69; continue; };
+            if (yych != 'c') { gotoCase = 43; continue; };
+case 69:
+            yych = this._charAt(++cursor);
+            if (yych == 'R') { gotoCase = 70; continue; };
+            if (yych != 'r') { gotoCase = 43; continue; };
+case 70:
+            yych = this._charAt(++cursor);
+            if (yych == 'I') { gotoCase = 71; continue; };
+            if (yych != 'i') { gotoCase = 43; continue; };
+case 71:
+            yych = this._charAt(++cursor);
+            if (yych == 'P') { gotoCase = 72; continue; };
+            if (yych != 'p') { gotoCase = 43; continue; };
+case 72:
+            yych = this._charAt(++cursor);
+            if (yych == 'T') { gotoCase = 73; continue; };
+            if (yych != 't') { gotoCase = 43; continue; };
+case 73:
+            ++cursor;
+            {
+                    this.tokenType = "html-tag";
+                    this._parseCondition = this._parseConditions.INITIAL;
+                    return cursor;
+                }
+case 75:
             ++cursor;
             yych = this._charAt(cursor);
-case 62:
+case 76:
             if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 61; continue; };
+                if (yych != '\n') { gotoCase = 75; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 63; continue; };
-                if (yych == '\'') { gotoCase = 65; continue; };
-                { gotoCase = 61; continue; };
+                if (yych <= '\r') { gotoCase = 77; continue; };
+                if (yych == '\'') { gotoCase = 79; continue; };
+                { gotoCase = 75; continue; };
             }
-case 63:
+case 77:
             ++cursor;
             this.setLexCondition(this._lexConditions.SSTRING);
             { return this._stringToken(cursor); }
-case 65:
+case 79:
             ++cursor;
             { return this._stringToken(cursor, true); }
-case 67:
+case 81:
             ++cursor;
             yych = this._charAt(cursor);
-case 68:
+case 82:
             if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 67; continue; };
+                if (yych != '\n') { gotoCase = 81; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 69; continue; };
-                if (yych == '"') { gotoCase = 65; continue; };
-                { gotoCase = 67; continue; };
+                if (yych <= '\r') { gotoCase = 83; continue; };
+                if (yych == '"') { gotoCase = 79; continue; };
+                { gotoCase = 81; continue; };
             }
-case 69:
+case 83:
             ++cursor;
             this.setLexCondition(this._lexConditions.DSTRING);
             { return this._stringToken(cursor); }
@@ -422,40 +532,40 @@ case 69:
 case this.case_SSTRING:
             yych = this._charAt(cursor);
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 75; continue; };
-                { gotoCase = 74; continue; };
+                if (yych == '\n') { gotoCase = 89; continue; };
+                { gotoCase = 88; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 75; continue; };
-                if (yych == '\'') { gotoCase = 77; continue; };
-                { gotoCase = 74; continue; };
+                if (yych <= '\r') { gotoCase = 89; continue; };
+                if (yych == '\'') { gotoCase = 91; continue; };
+                { gotoCase = 88; continue; };
             }
-case 73:
+case 87:
             { return this._stringToken(cursor); }
-case 74:
+case 88:
             yych = this._charAt(++cursor);
-            { gotoCase = 81; continue; };
-case 75:
+            { gotoCase = 95; continue; };
+case 89:
             ++cursor;
             { this.tokenType = null; return cursor; }
-case 77:
+case 91:
             ++cursor;
-case 78:
+case 92:
             this.setLexCondition(this._lexConditions.INITIAL);
             { return this._stringToken(cursor, true); }
-case 79:
+case 93:
             yych = this._charAt(++cursor);
-            { gotoCase = 78; continue; };
-case 80:
+            { gotoCase = 92; continue; };
+case 94:
             ++cursor;
             yych = this._charAt(cursor);
-case 81:
+case 95:
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 73; continue; };
-                { gotoCase = 80; continue; };
+                if (yych == '\n') { gotoCase = 87; continue; };
+                { gotoCase = 94; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 73; continue; };
-                if (yych == '\'') { gotoCase = 79; continue; };
-                { gotoCase = 80; continue; };
+                if (yych <= '\r') { gotoCase = 87; continue; };
+                if (yych == '\'') { gotoCase = 93; continue; };
+                { gotoCase = 94; continue; };
             }
         }
 
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index 1a8333c..55d41a2 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -56,7 +56,10 @@ WebInspector.SourceHTMLTokenizer = function()
         TAG: 1,
         ATTRIBUTE: 2,
         ATTRIBUTE_VALUE: 3,
-        DOCTYPE: 4
+        SCRIPT: 4,
+        SCRIPT_ATTRIBUTE: 5,
+        SCRIPT_ATTRIBUTE_VALUE: 6,
+        DOCTYPE: 7
     };
 
     this.case_INITIAL = 1000;
@@ -68,12 +71,38 @@ WebInspector.SourceHTMLTokenizer = function()
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
+    _isAttribute: function()
+    {
+        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
+    },
+
+    _isAttributeValue: function()
+    {
+        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+    },
+
+    _setAttributeValue: function()
+    {
+        if (this._parseCondition === this._parseConditions.ATTRIBUTE)
+            this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
+        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
+            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+    },
+
+    _setAttribute: function()
+    {
+        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE)
+            this._parseCondition = this._parseConditions.ATTRIBUTE;
+        else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE)
+            this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+    },
+
     _stringToken: function(cursor, stringEnds)
     {
-        if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
+        if (this._isAttributeValue()) {
             this.tokenType = "html-attr-value";
             if (stringEnds)
-                this._parseCondition = this._parseConditions.ATTRIBUTE;
+                this._setAttribute();
         } else if (this._parseCondition === this._parseConditions.DOCTYPE)
             this.tokenType = "html-doctype";
         else
@@ -105,13 +134,14 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 CommentStart = "<!--" CommentContent [\r\n];
                 CommentEnd = CommentContent "-->";
 
-                LT = "<" | "</";
                 DocTypeLT = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];
+                ScriptStart = "<" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
+                ScriptEnd = "</" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
+
+                LT = "<" | "</";
                 GT = ">";
                 EqualSign = "=";
 
-                Letter = [_a-zA-Z\x80-\xFF];
-
                 DoubleStringContent = [^\r\n\"]*;
                 SingleStringContent = [^\r\n\']*;
                 StringLiteral = "\"" DoubleStringContent "\"" | "'" SingleStringContent "'";
@@ -120,7 +150,7 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 SingleStringStart = "'" SingleStringContent [\r\n];
                 SingleStringEnd = SingleStringContent "'";
 
-                Identifier = Letter+;
+                Identifier = [_a-zA-Z\x80-\xFF]+;
 
                 <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; }
                 <INITIAL> CommentStart => COMMENT { this.tokenType = "html-comment"; return cursor; }
@@ -129,14 +159,32 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <INITIAL> DocTypeLT => INITIAL
                 {
-                    var token = this._line.substring(cursorOnEnter, cursor);
                     this.tokenType = "html-doctype";
                     this._parseCondition = this._parseConditions.DOCTYPE;
                     return cursor;
                 }
 
+                <INITIAL> ScriptStart => INITIAL
+                {
+                    this.tokenType = "html-tag";
+                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+                    return cursor;
+                }
+
+                <INITIAL> ScriptEnd => INITIAL
+                {
+                    this.tokenType = "html-tag";
+                    this._parseCondition = this._parseConditions.INITIAL;
+                    return cursor;
+                }
+
                 <INITIAL> LT => INITIAL
                 {
+                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        this.tokenType = null;
+                        return cursor;
+                    }
+
                     this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.TAG;
                     return cursor;
@@ -144,11 +192,20 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <INITIAL> GT => 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";
-                    this._parseCondition = this._parseConditions.INITIAL;
+
+                    if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE)
+                        this._parseCondition = this._parseConditions.SCRIPT;
+                    else
+                        this._parseCondition = this._parseConditions.INITIAL;
                     return cursor;
                 }
 
@@ -162,9 +219,9 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <INITIAL> EqualSign => INITIAL
                 {
-                    if (this._parseCondition === this._parseConditions.ATTRIBUTE) {
+                    if (this._isAttribute()) {
                         this.tokenType = null;
-                        this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE;
+                        this._setAttributeValue();
                     } else if (this._parseCondition === this._parseConditions.DOCTYPE)
                         this.tokenType = "html-doctype";
                     else
@@ -174,16 +231,19 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <INITIAL> Identifier
                 {
+                    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._parseCondition === this._parseConditions.ATTRIBUTE) {
+                    } else if (this._isAttribute())
                         this.tokenType = "html-attr-name";
-                        this._parseCondition = this._parseConditions.ATTRIBUTE;
-                    } else if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) {
+                    else if (this._isAttributeValue())
                         this.tokenType = "html-attr-value";
-                        this._parseCondition = this._parseConditions.ATTRIBUTE;
-                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
+                    else if (this._parseCondition === this._parseConditions.DOCTYPE)
                         this.tokenType = "html-doctype";
                     else
                         this.tokenType = null;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list