[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:36:47 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit ec5a48380b1b6f5f7d672cae8fff40aacf28d011
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Feb 2 13:59:20 2010 +0000

    2010-02-02  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: URLs are not syntax-higlighted as links in source view.
    
            This change enables linkifier in the NativeTextViewer. It adds
            "linkify" and "a_node" parse states into the highlighter in order
            to detect links and distinguish between resource and external ones.
            Contains drive-by fix for the webkit-html-* styles and moves them to the
            common location.
    
            https://bugs.webkit.org/show_bug.cgi?id=34364
    
            * inspector/front-end/NativeTextViewer.js:
            (WebInspector.NativeTextViewer):
            (WebInspector.NativeTextViewer.prototype._createSpan):
            (WebInspector.NativeTextViewer.prototype._createLink):
            (WebInspector.NativeTextViewer.prototype._rewriteHref):
            * inspector/front-end/SourceFrame.js:
            (WebInspector.SourceFrame.prototype.setContent):
            (WebInspector.SourceFrame.prototype._createEditorIfNeeded):
            * inspector/front-end/SourceHTMLTokenizer.js:
            (WebInspector.SourceHTMLTokenizer):
            (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttribute):
            (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttributeValue):
            (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttribute):
            (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttributeValue):
            (WebInspector.SourceHTMLTokenizer.prototype._stringToken):
            (WebInspector.SourceHTMLTokenizer.prototype._attrValueTokenType):
            (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
            * inspector/front-end/SourceHTMLTokenizer.re2js:
            * inspector/front-end/SourceView.js:
            (WebInspector.SourceView.prototype._contentLoaded):
            * inspector/front-end/TextEditorHighlighter.js:
            (WebInspector.TextEditorHighlighter):
            * inspector/front-end/inspector.css:
            * inspector/front-end/inspectorSyntaxHighlight.css:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9843554..a4b6454 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,42 @@
+2010-02-02  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: URLs are not syntax-higlighted as links in source view.
+
+        This change enables linkifier in the NativeTextViewer. It adds
+        "linkify" and "a_node" parse states into the highlighter in order
+        to detect links and distinguish between resource and external ones.
+        Contains drive-by fix for the webkit-html-* styles and moves them to the
+        common location.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34364
+
+        * inspector/front-end/NativeTextViewer.js:
+        (WebInspector.NativeTextViewer):
+        (WebInspector.NativeTextViewer.prototype._createSpan):
+        (WebInspector.NativeTextViewer.prototype._createLink):
+        (WebInspector.NativeTextViewer.prototype._rewriteHref):
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype.setContent):
+        (WebInspector.SourceFrame.prototype._createEditorIfNeeded):
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        (WebInspector.SourceHTMLTokenizer):
+        (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttribute):
+        (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttributeValue):
+        (WebInspector.SourceHTMLTokenizer.prototype._stringToken):
+        (WebInspector.SourceHTMLTokenizer.prototype._attrValueTokenType):
+        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView.prototype._contentLoaded):
+        * inspector/front-end/TextEditorHighlighter.js:
+        (WebInspector.TextEditorHighlighter):
+        * inspector/front-end/inspector.css:
+        * inspector/front-end/inspectorSyntaxHighlight.css:
+
 2010-02-02  Simon Hausmann  <simon.hausmann at nokia.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index d38a7bb..8d8d5db 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -898,29 +898,18 @@ WebInspector.ElementsTreeElement.prototype = {
         if (!hrefValue || hrefValue.indexOf("://") > 0)
             return hrefValue;
 
-        var match;
-        var documentURL;
         for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) {
             if (frameOwnerCandidate.documentURL) {
-                documentURL = frameOwnerCandidate.documentURL;
+                var result = WebInspector.completeURL(frameOwnerCandidate.documentURL, hrefValue);
+                if (result)
+                    return result;
                 break;
             }
         }
-        if (documentURL) {
-            match = documentURL.match(WebInspector.URLRegExp);
-            if (match) {
-                var path = hrefValue;
-                if (path.charAt(0) !== "/") {
-                    var documentPath = match[4] || "/";
-                    path = documentPath.substring(0, documentPath.lastIndexOf("/")) + "/" + path;
-                }
-                return match[1] + "://" + match[2] + (match[3] ? (":" + match[3]) : "") + path;
-            }
-        }
 
         // documentURL not found or has bad value
         for (var url in WebInspector.resourceURLMap) {
-            match = url.match(WebInspector.URLRegExp);
+            var match = url.match(WebInspector.URLRegExp);
             if (match && match[4] === hrefValue)
                 return url;
         }
diff --git a/WebCore/inspector/front-end/NativeTextViewer.js b/WebCore/inspector/front-end/NativeTextViewer.js
index 80d303c..5e7db27 100644
--- a/WebCore/inspector/front-end/NativeTextViewer.js
+++ b/WebCore/inspector/front-end/NativeTextViewer.js
@@ -28,12 +28,13 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-WebInspector.NativeTextViewer = function(textModel, platform)
+WebInspector.NativeTextViewer = function(textModel, platform, url)
 {
     WebInspector.TextEditor.call(this, textModel, platform);
     this._sheet.tabIndex = 0;
     this._canvas.style.zIndex = 0;
     this._createLineDivs();
+    this._url = url;
     this._selectionColor = "rgb(241, 234, 0)";
 }
 
@@ -190,12 +191,41 @@ WebInspector.NativeTextViewer.prototype = {
 
     _createSpan: function(content, className)
     {
+        if (className === "html-resource-link" || className === "html-external-link")
+            return this._createLink(content, className === "html-external-link");
+
         var span = document.createElement("span");
         span.className = "webkit-" + className;
         span.appendChild(document.createTextNode(content));
         return span;
     },
 
+    _createLink: function(content, isExternal)
+    {
+        var quote = content.charAt(0);
+        if (content.length > 1 && (quote === "\"" ||   quote === "'"))
+            content = content.substring(1, content.length - 1);
+        else
+            quote = null;
+
+        var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, null, isExternal);
+        var span = document.createElement("span");
+        span.className = "webkit-html-attribute-value";
+        if (quote)
+            span.appendChild(document.createTextNode(quote));
+        span.appendChild(a);
+        if (quote)
+            span.appendChild(document.createTextNode(quote));
+        return span;
+    },
+
+    _rewriteHref: function(hrefValue, isExternal)
+    {
+        if (!this._url || !hrefValue || hrefValue.indexOf("://") > 0)
+            return hrefValue;
+        return WebInspector.completeURL(this._url, hrefValue);
+    },
+
     setDivDecoration: function(lineNumber, element)
     {
         var existingElement = this._textModel.getAttribute(lineNumber, "div-decoration");
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index a806606..e30dbdb 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -123,11 +123,12 @@ WebInspector.SourceFrame.prototype = {
             this._editor.revalidateDecorationsAndPaint();
     },
 
-    setContent: function(mimeType, content)
+    setContent: function(mimeType, content, url)
     {
         this._loaded = true;
         this._textModel.setText(null, content);
         this._mimeType = mimeType;
+        this._url = url;
         this._createEditorIfNeeded();
     },
 
@@ -137,7 +138,7 @@ WebInspector.SourceFrame.prototype = {
             return;
 
         var editorConstructor = Preferences.useCanvasBasedEditor ? WebInspector.TextEditor : WebInspector.NativeTextViewer;
-        this._editor = new editorConstructor(this._textModel, WebInspector.platform);
+        this._editor = new editorConstructor(this._textModel, WebInspector.platform, this._url);
         this._editor.lineNumberDecorator = new WebInspector.BreakpointLineNumberDecorator(this, this._editor.textModel);
         this._editor.lineDecorator = new WebInspector.ExecutionLineDecorator(this);
         this._editor.readOnly = true;
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 31fd0b8..8856ff5 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 Mon Feb  1 19:13:12 2010 */
+/* Generated by re2c 0.13.5 on Tue Feb  2 00:44:38 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -49,13 +49,15 @@ WebInspector.SourceHTMLTokenizer = function()
     this._lexConditions = {
         INITIAL: 0,
         COMMENT: 1,
-        TAG: 2,
+        DOCTYPE: 2,
+        TAG: 3,
         DSTRING: 4,
         SSTRING: 5
     };
     this.case_INITIAL = 1000;
     this.case_COMMENT = 1001;
-    this.case_TAG = 1002;
+    this.case_DOCTYPE = 1002;
+    this.case_TAG = 1003;
     this.case_DSTRING = 1004;
     this.case_SSTRING = 1005;
 
@@ -63,55 +65,61 @@ WebInspector.SourceHTMLTokenizer = function()
         INITIAL: 0,
         ATTRIBUTE: 1,
         ATTRIBUTE_VALUE: 2,
-        SCRIPT: 3,
-        SCRIPT_ATTRIBUTE: 4,
-        SCRIPT_ATTRIBUTE_VALUE: 5,
-        DOCTYPE: 6
+        LINKIFY: 4,
+        A_NODE: 8,
+        SCRIPT: 16
     };
 
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
-    _isAttribute: function()
+    _isExpectingAttribute: function()
     {
-        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
+        return this._parseCondition & this._parseConditions.ATTRIBUTE;
     },
 
-    _isAttributeValue: function()
+    _isExpectingAttributeValue: function()
     {
-        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+        return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
     },
 
-    _setAttributeValue: function()
+    _setExpectingAttribute: 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;
+        if (this._isExpectingAttributeValue())
+            this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
+        this._parseCondition |= this._parseConditions.ATTRIBUTE;
     },
 
-    _setAttribute: function()
+    _setExpectingAttributeValue: 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;
+        if (this._isExpectingAttribute())
+            this._parseCondition ^= this._parseConditions.ATTRIBUTE;
+        this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _stringToken: function(cursor, stringEnds)
     {
-        if (this._isAttributeValue()) {
-            this.tokenType = "html-attr-value";
-            if (stringEnds)
-                this._setAttribute();
-        } else if (this._parseCondition === this._parseConditions.DOCTYPE)
-            this.tokenType = "html-doctype";
-        else
+        if (!this._isExpectingAttributeValue()) {
             this.tokenType = null;
+            return cursor;
+        }
+        this.tokenType = this._attrValueTokenType();
+        if (stringEnds)
+            this._setExpectingAttribute();
         return cursor;
     },
 
+    _attrValueTokenType: function()
+    {
+        if (this._parseCondition & this._parseConditions.LINKIFY) {
+            if (this._parseCondition & this._parseConditions.A_NODE)
+                return "html-external-link";
+            return "html-resource-link";
+        }
+        return "html-attribute-value";
+    },
+
     nextToken: function(cursor)
     {
         var cursorOnEnter = cursor;
@@ -123,17 +131,21 @@ WebInspector.SourceHTMLTokenizer.prototype = {
         {
             case 1: var yych;
             var yyaccept = 0;
-            if (this.getLexCondition() < 2) {
+            if (this.getLexCondition() < 3) {
                 if (this.getLexCondition() < 1) {
                     { gotoCase = this.case_INITIAL; continue; };
                 } else {
-                    { gotoCase = this.case_COMMENT; continue; };
+                    if (this.getLexCondition() < 2) {
+                        { gotoCase = this.case_COMMENT; continue; };
+                    } else {
+                        { gotoCase = this.case_DOCTYPE; continue; };
+                    }
                 }
             } else {
-                if (this.getLexCondition() < 3) {
+                if (this.getLexCondition() < 4) {
                     { gotoCase = this.case_TAG; continue; };
                 } else {
-                    if (this.getLexCondition() < 4) {
+                    if (this.getLexCondition() < 5) {
                         { gotoCase = this.case_DSTRING; continue; };
                     } else {
                         { gotoCase = this.case_SSTRING; continue; };
@@ -198,202 +210,235 @@ case 12:
                 { gotoCase = 5; continue; };
             }
 /* *********************************** */
-case this.case_DSTRING:
+case this.case_DOCTYPE:
             yych = this._charAt(cursor);
             if (yych <= '\f') {
                 if (yych == '\n') { gotoCase = 18; continue; };
                 { gotoCase = 17; continue; };
             } else {
                 if (yych <= '\r') { gotoCase = 18; continue; };
-                if (yych == '"') { gotoCase = 20; continue; };
+                if (yych == '>') { gotoCase = 20; continue; };
                 { gotoCase = 17; continue; };
             }
 case 16:
-            { return this._stringToken(cursor); }
+            { this.tokenType = "html-doctype"; return cursor; }
 case 17:
             yych = this._charAt(++cursor);
-            { gotoCase = 24; continue; };
+            { gotoCase = 23; continue; };
 case 18:
             ++cursor;
             { this.tokenType = null; return cursor; }
 case 20:
             ++cursor;
-case 21:
-            this.setLexCondition(this._lexConditions.TAG);
-            { return this._stringToken(cursor, true); }
+            this.setLexCondition(this._lexConditions.INITIAL);
+            { this.tokenType = "html-doctype"; return cursor; }
 case 22:
-            yych = this._charAt(++cursor);
-            { gotoCase = 21; continue; };
-case 23:
             ++cursor;
             yych = this._charAt(cursor);
-case 24:
+case 23:
             if (yych <= '\f') {
                 if (yych == '\n') { gotoCase = 16; continue; };
-                { gotoCase = 23; continue; };
+                { gotoCase = 22; continue; };
             } else {
                 if (yych <= '\r') { gotoCase = 16; continue; };
-                if (yych == '"') { gotoCase = 22; continue; };
-                { gotoCase = 23; continue; };
+                if (yych == '>') { gotoCase = 16; continue; };
+                { gotoCase = 22; continue; };
+            }
+/* *********************************** */
+case this.case_DSTRING:
+            yych = this._charAt(cursor);
+            if (yych <= '\f') {
+                if (yych == '\n') { gotoCase = 28; continue; };
+                { gotoCase = 27; continue; };
+            } else {
+                if (yych <= '\r') { gotoCase = 28; continue; };
+                if (yych == '"') { gotoCase = 30; continue; };
+                { gotoCase = 27; continue; };
+            }
+case 26:
+            { return this._stringToken(cursor); }
+case 27:
+            yych = this._charAt(++cursor);
+            { gotoCase = 34; continue; };
+case 28:
+            ++cursor;
+            { this.tokenType = null; return cursor; }
+case 30:
+            ++cursor;
+case 31:
+            this.setLexCondition(this._lexConditions.TAG);
+            { return this._stringToken(cursor, true); }
+case 32:
+            yych = this._charAt(++cursor);
+            { gotoCase = 31; continue; };
+case 33:
+            ++cursor;
+            yych = this._charAt(cursor);
+case 34:
+            if (yych <= '\f') {
+                if (yych == '\n') { gotoCase = 26; continue; };
+                { gotoCase = 33; continue; };
+            } else {
+                if (yych <= '\r') { gotoCase = 26; continue; };
+                if (yych == '"') { gotoCase = 32; continue; };
+                { gotoCase = 33; continue; };
             }
 /* *********************************** */
 case this.case_INITIAL:
             yych = this._charAt(cursor);
-            if (yych == '<') { gotoCase = 29; continue; };
+            if (yych == '<') { gotoCase = 39; continue; };
             ++cursor;
             { this.tokenType = null; return cursor; }
-case 29:
+case 39:
             yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
             if (yych <= '/') {
-                if (yych == '!') { gotoCase = 34; continue; };
-                if (yych >= '/') { gotoCase = 31; continue; };
+                if (yych == '!') { gotoCase = 44; continue; };
+                if (yych >= '/') { gotoCase = 41; continue; };
             } else {
                 if (yych <= 'S') {
-                    if (yych >= 'S') { gotoCase = 32; continue; };
+                    if (yych >= 'S') { gotoCase = 42; continue; };
                 } else {
-                    if (yych == 's') { gotoCase = 32; continue; };
+                    if (yych == 's') { gotoCase = 42; continue; };
                 }
             }
-case 30:
+case 40:
+            this.setLexCondition(this._lexConditions.TAG);
             {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                        // Do not tokenize script tag contents, keep lexer state although processing "<".
+                        this.setLexCondition(this._lexConditions.INITIAL);
                         this.tokenType = null;
                         return cursor;
                     }
 
-                    this.setLexCondition(this._lexConditions.TAG);
-
-                    this.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.INITIAL;
+                    this.tokenType = "html-tag";
                     return cursor;
                 }
-case 31:
+case 41:
             yyaccept = 0;
             yych = this._charAt(YYMARKER = ++cursor);
-            if (yych == 'S') { gotoCase = 58; continue; };
-            if (yych == 's') { gotoCase = 58; continue; };
-            { gotoCase = 30; continue; };
-case 32:
+            if (yych == 'S') { gotoCase = 68; continue; };
+            if (yych == 's') { gotoCase = 68; continue; };
+            { gotoCase = 40; continue; };
+case 42:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 52; continue; };
-            if (yych == 'c') { gotoCase = 52; continue; };
-case 33:
+            if (yych == 'C') { gotoCase = 62; continue; };
+            if (yych == 'c') { gotoCase = 62; continue; };
+case 43:
             cursor = YYMARKER;
-            { gotoCase = 30; continue; };
-case 34:
+            { gotoCase = 40; continue; };
+case 44:
             yych = this._charAt(++cursor);
             if (yych <= 'C') {
-                if (yych != '-') { gotoCase = 33; continue; };
+                if (yych != '-') { gotoCase = 43; continue; };
             } else {
-                if (yych <= 'D') { gotoCase = 36; continue; };
-                if (yych == 'd') { gotoCase = 36; continue; };
-                { gotoCase = 33; continue; };
+                if (yych <= 'D') { gotoCase = 46; continue; };
+                if (yych == 'd') { gotoCase = 46; continue; };
+                { gotoCase = 43; continue; };
             }
             yych = this._charAt(++cursor);
-            if (yych == '-') { gotoCase = 44; continue; };
-            { gotoCase = 33; continue; };
-case 36:
+            if (yych == '-') { gotoCase = 54; continue; };
+            { gotoCase = 43; continue; };
+case 46:
             yych = this._charAt(++cursor);
-            if (yych == 'O') { gotoCase = 37; continue; };
-            if (yych != 'o') { gotoCase = 33; continue; };
-case 37:
+            if (yych == 'O') { gotoCase = 47; continue; };
+            if (yych != 'o') { gotoCase = 43; continue; };
+case 47:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 38; continue; };
-            if (yych != 'c') { gotoCase = 33; continue; };
-case 38:
+            if (yych == 'C') { gotoCase = 48; continue; };
+            if (yych != 'c') { gotoCase = 43; continue; };
+case 48:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 39; continue; };
-            if (yych != 't') { gotoCase = 33; continue; };
-case 39:
+            if (yych == 'T') { gotoCase = 49; continue; };
+            if (yych != 't') { gotoCase = 43; continue; };
+case 49:
             yych = this._charAt(++cursor);
-            if (yych == 'Y') { gotoCase = 40; continue; };
-            if (yych != 'y') { gotoCase = 33; continue; };
-case 40:
+            if (yych == 'Y') { gotoCase = 50; continue; };
+            if (yych != 'y') { gotoCase = 43; continue; };
+case 50:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 41; continue; };
-            if (yych != 'p') { gotoCase = 33; continue; };
-case 41:
+            if (yych == 'P') { gotoCase = 51; continue; };
+            if (yych != 'p') { gotoCase = 43; continue; };
+case 51:
             yych = this._charAt(++cursor);
-            if (yych == 'E') { gotoCase = 42; continue; };
-            if (yych != 'e') { gotoCase = 33; continue; };
-case 42:
+            if (yych == 'E') { gotoCase = 52; continue; };
+            if (yych != 'e') { gotoCase = 43; continue; };
+case 52:
             ++cursor;
-            this.setLexCondition(this._lexConditions.TAG);
-            {
-                    this.tokenType = "html-doctype";
-                    this._parseCondition = this._parseConditions.DOCTYPE;
-                    return cursor;
-                }
-case 44:
+            this.setLexCondition(this._lexConditions.DOCTYPE);
+            { this.tokenType = "html-doctype"; return cursor; }
+case 54:
             ++cursor;
             yych = this._charAt(cursor);
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 47; continue; };
-                { gotoCase = 44; continue; };
+                if (yych == '\n') { gotoCase = 57; continue; };
+                { gotoCase = 54; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 47; continue; };
-                if (yych != '-') { gotoCase = 44; continue; };
+                if (yych <= '\r') { gotoCase = 57; continue; };
+                if (yych != '-') { gotoCase = 54; continue; };
             }
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych == '-') { gotoCase = 49; continue; };
-            { gotoCase = 33; continue; };
-case 47:
+            if (yych == '-') { gotoCase = 59; continue; };
+            { gotoCase = 43; continue; };
+case 57:
             ++cursor;
             this.setLexCondition(this._lexConditions.COMMENT);
             { this.tokenType = "html-comment"; return cursor; }
-case 49:
+case 59:
             ++cursor;
             yych = this._charAt(cursor);
-            if (yych != '>') { gotoCase = 44; continue; };
+            if (yych != '>') { gotoCase = 54; continue; };
             ++cursor;
             { this.tokenType = "html-comment"; return cursor; }
-case 52:
+case 62:
             yych = this._charAt(++cursor);
-            if (yych == 'R') { gotoCase = 53; continue; };
-            if (yych != 'r') { gotoCase = 33; continue; };
-case 53:
+            if (yych == 'R') { gotoCase = 63; continue; };
+            if (yych != 'r') { gotoCase = 43; continue; };
+case 63:
             yych = this._charAt(++cursor);
-            if (yych == 'I') { gotoCase = 54; continue; };
-            if (yych != 'i') { gotoCase = 33; continue; };
-case 54:
+            if (yych == 'I') { gotoCase = 64; continue; };
+            if (yych != 'i') { gotoCase = 43; continue; };
+case 64:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 55; continue; };
-            if (yych != 'p') { gotoCase = 33; continue; };
-case 55:
+            if (yych == 'P') { gotoCase = 65; continue; };
+            if (yych != 'p') { gotoCase = 43; continue; };
+case 65:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 56; continue; };
-            if (yych != 't') { gotoCase = 33; continue; };
-case 56:
+            if (yych == 'T') { gotoCase = 66; continue; };
+            if (yych != 't') { gotoCase = 43; continue; };
+case 66:
             ++cursor;
             this.setLexCondition(this._lexConditions.TAG);
             {
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+                    this._parseCondition = this._parseConditions.SCRIPT;
+                    this._setExpectingAttribute();
                     return cursor;
                 }
-case 58:
+case 68:
             yych = this._charAt(++cursor);
-            if (yych == 'C') { gotoCase = 59; continue; };
-            if (yych != 'c') { gotoCase = 33; continue; };
-case 59:
+            if (yych == 'C') { gotoCase = 69; continue; };
+            if (yych != 'c') { gotoCase = 43; continue; };
+case 69:
             yych = this._charAt(++cursor);
-            if (yych == 'R') { gotoCase = 60; continue; };
-            if (yych != 'r') { gotoCase = 33; continue; };
-case 60:
+            if (yych == 'R') { gotoCase = 70; continue; };
+            if (yych != 'r') { gotoCase = 43; continue; };
+case 70:
             yych = this._charAt(++cursor);
-            if (yych == 'I') { gotoCase = 61; continue; };
-            if (yych != 'i') { gotoCase = 33; continue; };
-case 61:
+            if (yych == 'I') { gotoCase = 71; continue; };
+            if (yych != 'i') { gotoCase = 43; continue; };
+case 71:
             yych = this._charAt(++cursor);
-            if (yych == 'P') { gotoCase = 62; continue; };
-            if (yych != 'p') { gotoCase = 33; continue; };
-case 62:
+            if (yych == 'P') { gotoCase = 72; continue; };
+            if (yych != 'p') { gotoCase = 43; continue; };
+case 72:
             yych = this._charAt(++cursor);
-            if (yych == 'T') { gotoCase = 63; continue; };
-            if (yych != 't') { gotoCase = 33; continue; };
-case 63:
+            if (yych == 'T') { gotoCase = 73; continue; };
+            if (yych != 't') { gotoCase = 43; continue; };
+case 73:
             ++cursor;
             this.setLexCondition(this._lexConditions.TAG);
             {
@@ -405,190 +450,199 @@ case 63:
 case this.case_SSTRING:
             yych = this._charAt(cursor);
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 69; continue; };
-                { gotoCase = 68; continue; };
+                if (yych == '\n') { gotoCase = 79; continue; };
+                { gotoCase = 78; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 69; continue; };
-                if (yych == '\'') { gotoCase = 71; continue; };
-                { gotoCase = 68; continue; };
+                if (yych <= '\r') { gotoCase = 79; continue; };
+                if (yych == '\'') { gotoCase = 81; continue; };
+                { gotoCase = 78; continue; };
             }
-case 67:
+case 77:
             { return this._stringToken(cursor); }
-case 68:
+case 78:
             yych = this._charAt(++cursor);
-            { gotoCase = 75; continue; };
-case 69:
+            { gotoCase = 85; continue; };
+case 79:
             ++cursor;
             { this.tokenType = null; return cursor; }
-case 71:
+case 81:
             ++cursor;
-case 72:
+case 82:
             this.setLexCondition(this._lexConditions.TAG);
             { return this._stringToken(cursor, true); }
-case 73:
+case 83:
             yych = this._charAt(++cursor);
-            { gotoCase = 72; continue; };
-case 74:
+            { gotoCase = 82; continue; };
+case 84:
             ++cursor;
             yych = this._charAt(cursor);
-case 75:
+case 85:
             if (yych <= '\f') {
-                if (yych == '\n') { gotoCase = 67; continue; };
-                { gotoCase = 74; continue; };
+                if (yych == '\n') { gotoCase = 77; continue; };
+                { gotoCase = 84; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 67; continue; };
-                if (yych == '\'') { gotoCase = 73; continue; };
-                { gotoCase = 74; continue; };
+                if (yych <= '\r') { gotoCase = 77; continue; };
+                if (yych == '\'') { gotoCase = 83; continue; };
+                { gotoCase = 84; continue; };
             }
 /* *********************************** */
 case this.case_TAG:
             yych = this._charAt(cursor);
-            if (yych <= '=') {
-                if (yych <= '\'') {
-                    if (yych == '"') { gotoCase = 80; continue; };
-                    if (yych >= '\'') { gotoCase = 81; continue; };
+            if (yych <= '&') {
+                if (yych <= '\r') {
+                    if (yych == '\n') { gotoCase = 90; continue; };
+                    if (yych >= '\r') { gotoCase = 90; continue; };
                 } else {
-                    if (yych <= '/') { gotoCase = 78; continue; };
-                    if (yych <= '9') { gotoCase = 82; continue; };
-                    if (yych >= '=') { gotoCase = 84; continue; };
+                    if (yych <= ' ') {
+                        if (yych >= ' ') { gotoCase = 90; continue; };
+                    } else {
+                        if (yych == '"') { gotoCase = 92; continue; };
+                    }
                 }
             } else {
-                if (yych <= '^') {
-                    if (yych <= '>') { gotoCase = 86; continue; };
-                    if (yych <= '@') { gotoCase = 78; continue; };
-                    if (yych <= 'Z') { gotoCase = 82; continue; };
+                if (yych <= '>') {
+                    if (yych <= ';') {
+                        if (yych <= '\'') { gotoCase = 93; continue; };
+                    } else {
+                        if (yych <= '<') { gotoCase = 90; continue; };
+                        if (yych <= '=') { gotoCase = 94; continue; };
+                        { gotoCase = 96; continue; };
+                    }
                 } else {
-                    if (yych <= '`') {
-                        if (yych <= '_') { gotoCase = 82; continue; };
+                    if (yych <= '[') {
+                        if (yych >= '[') { gotoCase = 90; continue; };
                     } else {
-                        if (yych <= 'z') { gotoCase = 82; continue; };
-                        if (yych >= 0x80) { gotoCase = 82; continue; };
+                        if (yych == ']') { gotoCase = 90; continue; };
                     }
                 }
             }
-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);
-            { gotoCase = 89; continue; };
-case 83:
+            { gotoCase = 109; continue; };
+case 89:
             {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        // Fall through if expecting attributes.
                         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";
+                        this._setExpectingAttribute();
+                        var token = this._line.substring(cursorOnEnter, cursor);
+                        if (token === "a")
+                            this._parseCondition |= this._parseConditions.A_NODE;
+                        else if (this._parseCondition & this._parseConditions.A_NODE)
+                            this._parseCondition ^= this._parseConditions.A_NODE;
+                    } else if (this._isExpectingAttribute()) {
+                        var token = this._line.substring(cursorOnEnter, cursor);
+                        if (token === "href" || token === "src")
+                            this._parseCondition |= this._parseConditions.LINKIFY;
+                        else if (this._parseCondition |= this._parseConditions.LINKIFY)
+                            this._parseCondition ^= this._parseConditions.LINKIFY;
+                        this.tokenType = "html-attribute-name";
+                    } else if (this._isExpectingAttributeValue())
+                        this.tokenType = this._attrValueTokenType();
                     else
                         this.tokenType = null;
                     return cursor;
                 }
-case 84:
+case 90:
+            ++cursor;
+            { this.tokenType = null; return cursor; }
+case 92:
+            yyaccept = 0;
+            yych = this._charAt(YYMARKER = ++cursor);
+            { gotoCase = 105; continue; };
+case 93:
+            yyaccept = 0;
+            yych = this._charAt(YYMARKER = ++cursor);
+            { gotoCase = 99; continue; };
+case 94:
             ++cursor;
             {
-                    if (this._isAttribute()) {
-                        this.tokenType = null;
-                        this._setAttributeValue();
-                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
-                        this.tokenType = "html-doctype";
-                    else
-                        this.tokenType = null;
+                    if (this._isExpectingAttribute())
+                        this._setExpectingAttributeValue();
+                    this.tokenType = null;
                     return cursor;
                 }
-case 86:
+case 96:
             ++cursor;
             this.setLexCondition(this._lexConditions.INITIAL);
             {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                        // Do not tokenize script tag contents.
                         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;
+                    this._parseCondition = this._parseConditions.INITIAL;
+                    this.tokenType = "html-tag";
                     return cursor;
                 }
-case 88:
-            ++cursor;
-            yych = this._charAt(cursor);
-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 <= '`') {
-                    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 90:
+case 98:
             ++cursor;
             yych = this._charAt(cursor);
-case 91:
+case 99:
             if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 90; continue; };
+                if (yych != '\n') { gotoCase = 98; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 92; continue; };
-                if (yych == '\'') { gotoCase = 94; continue; };
-                { gotoCase = 90; continue; };
+                if (yych <= '\r') { gotoCase = 100; continue; };
+                if (yych == '\'') { gotoCase = 102; continue; };
+                { gotoCase = 98; continue; };
             }
-case 92:
+case 100:
             ++cursor;
             this.setLexCondition(this._lexConditions.SSTRING);
             { return this._stringToken(cursor); }
-case 94:
+case 102:
             ++cursor;
             { return this._stringToken(cursor, true); }
-case 96:
+case 104:
             ++cursor;
             yych = this._charAt(cursor);
-case 97:
+case 105:
             if (yych <= '\f') {
-                if (yych != '\n') { gotoCase = 96; continue; };
+                if (yych != '\n') { gotoCase = 104; continue; };
             } else {
-                if (yych <= '\r') { gotoCase = 98; continue; };
-                if (yych == '"') { gotoCase = 94; continue; };
-                { gotoCase = 96; continue; };
+                if (yych <= '\r') { gotoCase = 106; continue; };
+                if (yych == '"') { gotoCase = 102; continue; };
+                { gotoCase = 104; continue; };
             }
-case 98:
+case 106:
             ++cursor;
             this.setLexCondition(this._lexConditions.DSTRING);
             { return this._stringToken(cursor); }
+case 108:
+            ++cursor;
+            yych = this._charAt(cursor);
+case 109:
+            if (yych <= '"') {
+                if (yych <= '\r') {
+                    if (yych == '\n') { gotoCase = 89; continue; };
+                    if (yych <= '\f') { gotoCase = 108; continue; };
+                    { gotoCase = 89; continue; };
+                } else {
+                    if (yych == ' ') { gotoCase = 89; continue; };
+                    if (yych <= '!') { gotoCase = 108; continue; };
+                    { gotoCase = 89; continue; };
+                }
+            } else {
+                if (yych <= '>') {
+                    if (yych == '\'') { gotoCase = 89; continue; };
+                    if (yych <= ';') { gotoCase = 108; continue; };
+                    { gotoCase = 89; continue; };
+                } else {
+                    if (yych <= '[') {
+                        if (yych <= 'Z') { gotoCase = 108; continue; };
+                        { gotoCase = 89; continue; };
+                    } else {
+                        if (yych == ']') { gotoCase = 89; continue; };
+                        { gotoCase = 108; continue; };
+                    }
+                }
+            }
         }
 
         }
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index 17d1e2a..89c535a 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -48,13 +48,15 @@ WebInspector.SourceHTMLTokenizer = function()
     this._lexConditions = {
         INITIAL: 0,
         COMMENT: 1,
-        TAG: 2,
+        DOCTYPE: 2,
+        TAG: 3,
         DSTRING: 4,
         SSTRING: 5
     };
     this.case_INITIAL = 1000;
     this.case_COMMENT = 1001;
-    this.case_TAG = 1002;
+    this.case_DOCTYPE = 1002;
+    this.case_TAG = 1003;
     this.case_DSTRING = 1004;
     this.case_SSTRING = 1005;
 
@@ -62,55 +64,61 @@ WebInspector.SourceHTMLTokenizer = function()
         INITIAL: 0,
         ATTRIBUTE: 1,
         ATTRIBUTE_VALUE: 2,
-        SCRIPT: 3,
-        SCRIPT_ATTRIBUTE: 4,
-        SCRIPT_ATTRIBUTE_VALUE: 5,
-        DOCTYPE: 6
+        LINKIFY: 4,
+        A_NODE: 8,
+        SCRIPT: 16
     };
 
     this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL };
 }
 
 WebInspector.SourceHTMLTokenizer.prototype = {
-    _isAttribute: function()
+    _isExpectingAttribute: function()
     {
-        return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;
+        return this._parseCondition & this._parseConditions.ATTRIBUTE;
     },
 
-    _isAttributeValue: function()
+    _isExpectingAttributeValue: function()
     {
-        return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;
+        return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE;
     },
 
-    _setAttributeValue: function()
+    _setExpectingAttribute: 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;
+        if (this._isExpectingAttributeValue())
+            this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE;
+        this._parseCondition |= this._parseConditions.ATTRIBUTE;
     },
 
-    _setAttribute: function()
+    _setExpectingAttributeValue: 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;
+        if (this._isExpectingAttribute())
+            this._parseCondition ^= this._parseConditions.ATTRIBUTE;
+        this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE;
     },
 
     _stringToken: function(cursor, stringEnds)
     {
-        if (this._isAttributeValue()) {
-            this.tokenType = "html-attr-value";
-            if (stringEnds)
-                this._setAttribute();
-        } else if (this._parseCondition === this._parseConditions.DOCTYPE)
-            this.tokenType = "html-doctype";
-        else
+        if (!this._isExpectingAttributeValue()) {
             this.tokenType = null;
+            return cursor;
+        }
+        this.tokenType = this._attrValueTokenType();
+        if (stringEnds)
+            this._setExpectingAttribute();
         return cursor;
     },
 
+    _attrValueTokenType: function()
+    {
+        if (this._parseCondition & this._parseConditions.LINKIFY) {
+            if (this._parseCondition & this._parseConditions.A_NODE)
+                return "html-external-link";
+            return "html-resource-link";
+        }
+        return "html-attribute-value";
+    },
+
     nextToken: function(cursor)
     {
         var cursorOnEnter = cursor;
@@ -135,7 +143,9 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 CommentStart = "<!--" CommentContent [\r\n];
                 CommentEnd = CommentContent "-->";
 
-                DocTypeLT = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];
+                DocTypeStart = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee];
+                DocTypeContent = [^\r\n>]*;
+
                 ScriptStart = "<" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
                 ScriptEnd = "</" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
 
@@ -151,24 +161,22 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                 SingleStringStart = "'" SingleStringContent [\r\n];
                 SingleStringEnd = SingleStringContent "'";
 
-                Identifier = [_a-zA-Z0-9\x80-\xFF]+;
+                Identifier = [^ \r\n"'<>\[\]=]+;
 
                 <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; }
                 <INITIAL> CommentStart => COMMENT { this.tokenType = "html-comment"; return cursor; }
                 <COMMENT> CommentContent => COMMENT { this.tokenType = "html-comment"; return cursor; }
                 <COMMENT> CommentEnd => INITIAL { this.tokenType = "html-comment"; return cursor; }
 
-                <INITIAL> DocTypeLT => TAG
-                {
-                    this.tokenType = "html-doctype";
-                    this._parseCondition = this._parseConditions.DOCTYPE;
-                    return cursor;
-                }
+                <INITIAL> DocTypeStart => DOCTYPE { this.tokenType = "html-doctype"; return cursor; }
+                <DOCTYPE> DocTypeContent => DOCTYPE { this.tokenType = "html-doctype"; return cursor; }
+                <DOCTYPE> GT => INITIAL { this.tokenType = "html-doctype"; return cursor; }
 
                 <INITIAL> ScriptStart => TAG
                 {
                     this.tokenType = "html-tag";
-                    this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE;
+                    this._parseCondition = this._parseConditions.SCRIPT;
+                    this._setExpectingAttribute();
                     return cursor;
                 }
 
@@ -179,37 +187,30 @@ WebInspector.SourceHTMLTokenizer.prototype = {
                     return cursor;
                 }
 
-                <INITIAL> LT
+                <INITIAL> LT => TAG
                 {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                        // Do not tokenize script tag contents, keep lexer state although processing "<".
+                        this.setLexCondition(this._lexConditions.INITIAL);
                         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.INITIAL;
+                    this.tokenType = "html-tag";
                     return cursor;
                 }
 
                 <TAG> GT => INITIAL
                 {
-                    if (this._parseCondition === this._parseConditions.SCRIPT) {
+                    if (this._parseCondition & this._parseConditions.SCRIPT) {
+                        // Do not tokenize script tag contents.
                         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;
+                    this._parseCondition = this._parseConditions.INITIAL;
+                    this.tokenType = "html-tag";
                     return cursor;
                 }
 
@@ -223,32 +224,37 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <TAG> EqualSign => TAG
                 {
-                    if (this._isAttribute()) {
-                        this.tokenType = null;
-                        this._setAttributeValue();
-                    } else if (this._parseCondition === this._parseConditions.DOCTYPE)
-                        this.tokenType = "html-doctype";
-                    else
-                        this.tokenType = null;
+                    if (this._isExpectingAttribute())
+                        this._setExpectingAttributeValue();
+                    this.tokenType = null;
                     return cursor;
                 }
 
                 <TAG> Identifier
                 {
                     if (this._parseCondition === this._parseConditions.SCRIPT) {
+                        // Fall through if expecting attributes.
                         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";
+                        this._setExpectingAttribute();
+                        var token = this._line.substring(cursorOnEnter, cursor);
+                        if (token === "a")
+                            this._parseCondition |= this._parseConditions.A_NODE;
+                        else if (this._parseCondition & this._parseConditions.A_NODE)
+                            this._parseCondition ^= this._parseConditions.A_NODE;
+                    } else if (this._isExpectingAttribute()) {
+                        var token = this._line.substring(cursorOnEnter, cursor);
+                        if (token === "href" || token === "src")
+                            this._parseCondition |= this._parseConditions.LINKIFY;
+                        else if (this._parseCondition |= this._parseConditions.LINKIFY)
+                            this._parseCondition ^= this._parseConditions.LINKIFY;
+                        this.tokenType = "html-attribute-name";
+                    } else if (this._isExpectingAttributeValue())
+                        this.tokenType = this._attrValueTokenType();
                     else
                         this.tokenType = null;
                     return cursor;
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index d2eb699..7fc8499 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -86,7 +86,7 @@ WebInspector.SourceView.prototype = {
 
     _contentLoaded: function(content)
     {
-        this.sourceFrame.setContent(this.resource.mimeType, content);
+        this.sourceFrame.setContent(this.resource.mimeType, content, this.resource.url);
         this._sourceFrameSetupFinished();
     },
 
diff --git a/WebCore/inspector/front-end/TextEditorHighlighter.js b/WebCore/inspector/front-end/TextEditorHighlighter.js
index 9a7a050..c73e036 100644
--- a/WebCore/inspector/front-end/TextEditorHighlighter.js
+++ b/WebCore/inspector/front-end/TextEditorHighlighter.js
@@ -47,10 +47,12 @@ WebInspector.TextEditorHighlighter = function(textModel, damageCallback)
 
     /* Keep this in sync with inspector.css and view-source.css */
     this._styles["html-tag"] = "rgb(136, 18, 128)";
-    this._styles["html-attr-name"] = "rgb(153, 69, 0)";
-    this._styles["html-attr-value"] = "rgb(26, 26, 166)";
+    this._styles["html-attribute-name"] = "rgb(153, 69, 0)";
+    this._styles["html-attribute-value"] = "rgb(26, 26, 166)";
     this._styles["html-comment"] = "rgb(35, 110, 37)";
     this._styles["html-doctype"] = "rgb(192, 192, 192)";
+    this._styles["html-external-link"] = "#00e";
+    this._styles["html-resource-link"] = "#00e";
 
     this._styles["javascript-comment"] = "rgb(0, 116, 0)";
     this._styles["javascript-string"] = "rgb(196, 26, 22)";
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 55804f3..42e213a 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -1187,46 +1187,6 @@ body.platform-windows .source-code, body.platform-windows-vista-or-later .source
     display: block;
 }
 
-.webkit-html-comment {
-    /* Keep this in sync with view-source.css (.webkit-html-comment) */
-    color: rgb(35, 110, 37);
-}
-
-.webkit-html-tag {
-    /* Keep this in sync with view-source.css (.webkit-html-tag) */
-    color: rgb(136, 18, 128);
-}
-
-.webkit-html-doctype {
-    /* Keep this in sync with view-source.css (.webkit-html-doctype) */
-    color: rgb(192, 192, 192);
-}
-
-.webkit-html-attribute-name {
-    /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */
-    color: rgb(153, 69, 0);
-}
-
-.webkit-html-attribute-value {
-    /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */
-    color: rgb(26, 26, 166);
-}
-
-.webkit-html-external-link, .webkit-html-resource-link {
-    /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */
-    color: #00e;
-}
-
-.webkit-html-external-link {
-    /* Keep this in sync with view-source.css (.webkit-html-external-link) */
-    text-decoration: none;
-}
-
-.webkit-html-external-link:hover {
-    /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */
-    text-decoration: underline;
-}
-
 .add-attribute {
     margin-left: 1px;
     margin-right: 1px;
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index c637f37..f28d975 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1528,6 +1528,20 @@ WebInspector.linkifyURL = function(url, linkText, classes, isExternal, tooltipTe
     return WebInspector.linkifyURLAsNode(url, linkText, classes, isExternal, tooltipText).outerHTML;
 }
 
+WebInspector.completeURL = function(baseURL, href)
+{
+    var match = baseURL.match(WebInspector.URLRegExp);
+    if (match) {
+        var path = href;
+        if (path.charAt(0) !== "/") {
+            var basePath = match[4] || "/";
+            path = basePath.substring(0, basePath.lastIndexOf("/")) + "/" + path;
+        }
+        return match[1] + "://" + match[2] + (match[3] ? (":" + match[3]) : "") + path;
+    }
+    return null;
+}
+
 WebInspector.addMainEventListeners = function(doc)
 {
     doc.defaultView.addEventListener("focus", this.windowFocused.bind(this), false);
diff --git a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
index 58904c9..1292f00 100644
--- a/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
+++ b/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
@@ -66,23 +66,42 @@
     color: rgb(196, 26, 22);
 }
 
-/* Keep this in sync with view-source.css */
+.webkit-html-comment {
+    /* Keep this in sync with view-source.css (.webkit-html-comment) */
+    color: rgb(35, 110, 37);
+}
+
 .webkit-html-tag {
+    /* Keep this in sync with view-source.css (.webkit-html-tag) */
     color: rgb(136, 18, 128);
 }
 
-.webkit-html-attr-name {
+.webkit-html-doctype {
+    /* Keep this in sync with view-source.css (.webkit-html-doctype) */
+    color: rgb(192, 192, 192);
+}
+
+.webkit-html-attribute-name {
+    /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */
     color: rgb(153, 69, 0);
 }
 
-.webkit-html-attr-value {
+.webkit-html-attribute-value {
+    /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */
     color: rgb(26, 26, 166);
 }
 
-.webkit-html-comment {
-    color: rgb(35, 110, 37);
+.webkit-html-external-link, .webkit-html-resource-link {
+    /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */
+    color: #00e;
 }
 
-.webkit-html-doctype {
-    color: rgb(192, 192, 192);
+.webkit-html-external-link {
+    /* Keep this in sync with view-source.css (.webkit-html-external-link) */
+    text-decoration: none;
+}
+
+.webkit-html-external-link:hover {
+    /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */
+    text-decoration: underline;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list