[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

pfeldman at chromium.org pfeldman at chromium.org
Fri Feb 26 22:20:10 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 25506f367fc2a5551f747611c5ffe6d6b8b434d7
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Feb 15 17:48:07 2010 +0000

    2010-02-15  Pavel Feldman  <pfeldman at chromium.org>
    
            Reviewed by Timothy Hatcher.
    
            Web Inspector: incorrect syntax highlighting as HTML in a script tag.
            We were preserving initial lexer state upon entering other tags while in <script>
            but were not doing it for <script tag itself. As a result, nested script
            tags were failing to highlight.
    
            https://bugs.webkit.org/show_bug.cgi?id=34934
    
            * inspector/front-end/SourceHTMLTokenizer.js:
            (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
            * inspector/front-end/SourceHTMLTokenizer.re2js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54780 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 5a06588..212eb45 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-02-15  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: incorrect syntax highlighting as HTML in a script tag.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34934
+
+        * inspector/syntax-highlight-html-expected.txt: Added.
+        * inspector/syntax-highlight-html.html: Added.
+
 2010-02-15  Robert Hogan  <robert at roberthogan.net>
 
         Reviewed by Simon Hausmann.
diff --git a/LayoutTests/inspector/syntax-highlight-html-expected.txt b/LayoutTests/inspector/syntax-highlight-html-expected.txt
new file mode 100644
index 0000000..5817c30
--- /dev/null
+++ b/LayoutTests/inspector/syntax-highlight-html-expected.txt
@@ -0,0 +1,11 @@
+Tests that SourceHTMLTokenizer detects the tokens.
+
+<html>: webkit-html-tag,webkit-html-tag,webkit-html-tag
+<table cellspacing=0>: webkit-html-tag,webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-value,webkit-html-tag
+<input checked value="foo">: webkit-html-tag,webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-name,*,webkit-html-attribute-value,webkit-html-tag
+<table cellspacing="0" cellpadding='0'>: webkit-html-tag,webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-value,*,webkit-html-attribute-name,*,webkit-html-attribute-value,webkit-html-tag
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">: webkit-html-doctype,webkit-html-doctype,webkit-html-doctype
+<!--div><div foobar-->: webkit-html-comment
+<script></script><!--div-->: webkit-html-tag,*,webkit-html-tag,webkit-html-tag,webkit-html-comment
+<script type="text/javascript">document.write('<script type="text/javascript"></' + 'script>');</script>: webkit-html-tag,*,webkit-html-attribute-name,*,webkit-html-attribute-value,*,webkit-html-tag,webkit-html-tag
+
diff --git a/LayoutTests/inspector/syntax-highlight-html.html b/LayoutTests/inspector/syntax-highlight-html.html
new file mode 100644
index 0000000..4273cfe
--- /dev/null
+++ b/LayoutTests/inspector/syntax-highlight-html.html
@@ -0,0 +1,36 @@
+<html>
+<head>
+<script src="../http/tests/inspector/inspector-test.js"></script>
+<script src="syntax-highlight.js"></script>
+<script>
+
+// Frontend functions.
+
+function frontend_dumpSyntaxHighlightHTML(str)
+{
+    return frontend_dumpSyntaxHighlight(str, "text/html");
+}
+
+function frontend_doitAndDump() {
+    var result = [];
+    result.push(frontend_dumpSyntaxHighlightHTML("<html>"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<table cellspacing=0>"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<input checked value=\"foo\">"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<table cellspacing=\"0\" cellpadding='0'>"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<!--div><div foobar-->"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<script></" + "script><!--div-->"));
+    result.push(frontend_dumpSyntaxHighlightHTML("<script type=\"text/javascript\">document.write('<script type=\"text/javascript\"></' + 'script>');</" + "script>"));
+    return result;
+}
+
+</script>
+</head>
+
+<body onload="onload()">
+<p>
+Tests that SourceHTMLTokenizer detects the tokens.
+</p>
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 47d5b82..81fd5ea 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-15  Pavel Feldman  <pfeldman at chromium.org>
+
+        Reviewed by Timothy Hatcher.
+
+        Web Inspector: incorrect syntax highlighting as HTML in a script tag.
+        We were preserving initial lexer state upon entering other tags while in <script>
+        but were not doing it for <script tag itself. As a result, nested script
+        tags were failing to highlight.
+
+        https://bugs.webkit.org/show_bug.cgi?id=34934
+
+        * inspector/front-end/SourceHTMLTokenizer.js:
+        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+        * inspector/front-end/SourceHTMLTokenizer.re2js:
+
 2010-02-15  Brady Eidson  <beidson at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 8856ff5..3c9bd8c 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 Feb  2 00:44:38 2010 */
+/* Generated by re2c 0.13.5 on Mon Feb 15 19:30:21 2010 */
 /*
  * Copyright (C) 2009 Google Inc. All rights reserved.
  *
@@ -413,6 +413,12 @@ case 66:
             ++cursor;
             this.setLexCondition(this._lexConditions.TAG);
             {
+                    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.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.SCRIPT;
                     this._setExpectingAttribute();
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index 89c535a..cfa8834 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -174,6 +174,12 @@ WebInspector.SourceHTMLTokenizer.prototype = {
 
                 <INITIAL> ScriptStart => TAG
                 {
+                    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.tokenType = "html-tag";
                     this._parseCondition = this._parseConditions.SCRIPT;
                     this._setExpectingAttribute();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list