[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:32:03 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 28b43ba945cb85147b523de2b10c3c92cbc81d82
Author: pfeldman at chromium.org <pfeldman at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 29 11:04:09 2010 +0000
2010-01-29 Pavel Feldman <pfeldman at chromium.org>
Reviewed by Timothy Hatcher.
Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.
https://bugs.webkit.org/show_bug.cgi?id=34273
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/front-end/CSSSourceSyntaxHighlighter.js: Removed.
* inspector/front-end/DOMSyntaxHighlighter.js: Added.
(WebInspector.DOMSyntaxHighlighter):
(WebInspector.DOMSyntaxHighlighter.prototype.createSpan):
(WebInspector.DOMSyntaxHighlighter.prototype.syntaxHighlightNode):
* inspector/front-end/ElementsTreeOutline.js:
* inspector/front-end/JavaScriptSourceSyntaxHighlighter.js: Removed.
* inspector/front-end/SourceCSSTokenizer.js:
(WebInspector.SourceCSSTokenizer):
(WebInspector.SourceCSSTokenizer.prototype.nextToken):
* inspector/front-end/SourceCSSTokenizer.re2js:
* inspector/front-end/SourceHTMLTokenizer.js:
(WebInspector.SourceHTMLTokenizer):
(WebInspector.SourceHTMLTokenizer.prototype.nextToken):
* inspector/front-end/SourceHTMLTokenizer.re2js:
* inspector/front-end/SourceJavaScriptTokenizer.js:
(WebInspector.SourceJavaScriptTokenizer):
(WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
* inspector/front-end/SourceJavaScriptTokenizer.re2js:
* inspector/front-end/SourceSyntaxHighlighter.js: Removed.
* inspector/front-end/SourceTokenizer.js: Added.
(WebInspector.SourceTokenizer):
(WebInspector.SourceTokenizer.prototype.set line):
(WebInspector.SourceTokenizer.prototype.set condition):
(WebInspector.SourceTokenizer.prototype.get condition):
(WebInspector.SourceTokenizer.prototype.hasCondition):
(WebInspector.SourceTokenizer.prototype.getLexCondition):
(WebInspector.SourceTokenizer.prototype.setLexCondition):
(WebInspector.SourceTokenizer.prototype._charAt):
(WebInspector.SourceTokenizer.Registry):
(WebInspector.SourceTokenizer.Registry.getInstance):
(WebInspector.SourceTokenizer.Registry.prototype.getTokenizer):
* inspector/front-end/TextEditorHighlighter.js:
(WebInspector.TextEditorHighlighter):
(WebInspector.TextEditorHighlighter.prototype.set mimeType):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/inspector.html:
LayoutTests:
* inspector/syntax-highlight-css-expected.txt:
* inspector/syntax-highlight-css.html:
* inspector/syntax-highlight-javascript-expected.txt:
* inspector/syntax-highlight-javascript.html:
* inspector/syntax-highlight.js:
(frontend_dumpSyntaxHighlight):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4f10266..c630eea 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-29 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34273
+
+ * inspector/syntax-highlight-css-expected.txt:
+ * inspector/syntax-highlight-css.html:
+ * inspector/syntax-highlight-javascript-expected.txt:
+ * inspector/syntax-highlight-javascript.html:
+ * inspector/syntax-highlight.js:
+ (frontend_dumpSyntaxHighlight):
+
2010-01-28 Oliver Hunt <oliver at apple.com>
Reviewed by Gavin Barraclough.
diff --git a/LayoutTests/inspector/syntax-highlight-css-expected.txt b/LayoutTests/inspector/syntax-highlight-css-expected.txt
index 7aaf80f..4d87dc6 100644
--- a/LayoutTests/inspector/syntax-highlight-css-expected.txt
+++ b/LayoutTests/inspector/syntax-highlight-css-expected.txt
@@ -1,9 +1,9 @@
Tests that CSSSourceSyntaxHighlighter detects the tokens.
a[href='/']: webkit-css-selector
-#content > a:hover: webkit-css-selector,*,webkit-css-selector
- at import url(style.css);: webkit-css-at-rule,*,webkit-css-url,*
- at import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css-url,*,webkit-css-keyword,*,webkit-css-keyword,*
+#content > a:hover: *,webkit-css-selector,*,webkit-css-selector,*,webkit-css-selector
+ at import url(style.css);: webkit-css-at-rule,*,webkit-css-keyword,*
+ at import url("style.css") projection, tv;: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-string,*,webkit-css-keyword,*,webkit-css-keyword,*
@media screen { body { color: red; } }: webkit-css-at-rule,*,webkit-css-keyword,*,webkit-css-selector,*,webkit-css-property,*,webkit-css-keyword,*
@font-face { font-family: MyHelvetica; }: webkit-css-at-rule,*,webkit-css-property,*
p { color: color; red: red; }: webkit-css-selector,*,webkit-css-property,*,webkit-css-keyword,*
diff --git a/LayoutTests/inspector/syntax-highlight-css.html b/LayoutTests/inspector/syntax-highlight-css.html
index fb7217d..96740ea 100644
--- a/LayoutTests/inspector/syntax-highlight-css.html
+++ b/LayoutTests/inspector/syntax-highlight-css.html
@@ -8,7 +8,7 @@
function frontend_dumpSyntaxHighlightCSS(str)
{
- return frontend_dumpSyntaxHighlight(str, WebInspector.CSSSourceSyntaxHighlighter);
+ return frontend_dumpSyntaxHighlight(str, "text/css");
}
function frontend_doitAndDump() {
diff --git a/LayoutTests/inspector/syntax-highlight-javascript-expected.txt b/LayoutTests/inspector/syntax-highlight-javascript-expected.txt
index 316eb99..629eb92 100644
--- a/LayoutTests/inspector/syntax-highlight-javascript-expected.txt
+++ b/LayoutTests/inspector/syntax-highlight-javascript-expected.txt
@@ -7,8 +7,8 @@ return'foo';: webkit-javascript-keyword,webkit-javascript-string,*
"\"/".length / 2: webkit-javascript-string,*,webkit-javascript-ident,*,webkit-javascript-number
var foo = 1/*/***//2: webkit-javascript-keyword,*,webkit-javascript-ident,*,webkit-javascript-number,webkit-javascript-comment,*,webkit-javascript-number
/*comment*//.*/.test('a'): webkit-javascript-comment,webkit-javascript-regexp,*,webkit-javascript-ident,*,webkit-javascript-string,*
-'f\ oo';: webkit-javascript-string,*
+'f\ oo';: webkit-javascript-string,,webkit-javascript-string,*
'\f\b\t';: webkit-javascript-string,*
-'/\ /';: webkit-javascript-string,*
-foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment,webkit-javascript-ident
+'/\ /';: webkit-javascript-string,,webkit-javascript-string,*
+foo/** / */foo: webkit-javascript-ident,webkit-javascript-comment,,webkit-javascript-comment,,webkit-javascript-comment,webkit-javascript-ident
diff --git a/LayoutTests/inspector/syntax-highlight-javascript.html b/LayoutTests/inspector/syntax-highlight-javascript.html
index 97700e8..720a1c5 100644
--- a/LayoutTests/inspector/syntax-highlight-javascript.html
+++ b/LayoutTests/inspector/syntax-highlight-javascript.html
@@ -8,7 +8,7 @@
function frontend_dumpSyntaxHighlightJS(str)
{
- return frontend_dumpSyntaxHighlight(str, WebInspector.JavaScriptSourceSyntaxHighlighter);
+ return frontend_dumpSyntaxHighlight(str, "text/javascript");
}
function frontend_doitAndDump() {
diff --git a/LayoutTests/inspector/syntax-highlight.js b/LayoutTests/inspector/syntax-highlight.js
index 572c299..9bdf2b3 100644
--- a/LayoutTests/inspector/syntax-highlight.js
+++ b/LayoutTests/inspector/syntax-highlight.js
@@ -13,11 +13,11 @@ function doit()
// Frontend functions.
-function frontend_dumpSyntaxHighlight(str, highlighterConstructor)
+function frontend_dumpSyntaxHighlight(str, mimeType)
{
var node = document.createElement("span");
node.textContent = str;
- var javascriptSyntaxHighlighter = new highlighterConstructor(null, null);
+ var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter(mimeType);
javascriptSyntaxHighlighter.syntaxHighlightNode(node);
var node_parts = [];
for (var i = 0; i < node.childNodes.length; i++) {
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7490832..c8909d7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -2,6 +2,54 @@
Reviewed by Timothy Hatcher.
+ Web Inspector: migrate to tokenizer-based highlighting in the Elements panel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34273
+
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * inspector/front-end/CSSSourceSyntaxHighlighter.js: Removed.
+ * inspector/front-end/DOMSyntaxHighlighter.js: Added.
+ (WebInspector.DOMSyntaxHighlighter):
+ (WebInspector.DOMSyntaxHighlighter.prototype.createSpan):
+ (WebInspector.DOMSyntaxHighlighter.prototype.syntaxHighlightNode):
+ * inspector/front-end/ElementsTreeOutline.js:
+ * inspector/front-end/JavaScriptSourceSyntaxHighlighter.js: Removed.
+ * inspector/front-end/SourceCSSTokenizer.js:
+ (WebInspector.SourceCSSTokenizer):
+ (WebInspector.SourceCSSTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceCSSTokenizer.re2js:
+ * inspector/front-end/SourceHTMLTokenizer.js:
+ (WebInspector.SourceHTMLTokenizer):
+ (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceHTMLTokenizer.re2js:
+ * inspector/front-end/SourceJavaScriptTokenizer.js:
+ (WebInspector.SourceJavaScriptTokenizer):
+ (WebInspector.SourceJavaScriptTokenizer.prototype.nextToken):
+ * inspector/front-end/SourceJavaScriptTokenizer.re2js:
+ * inspector/front-end/SourceSyntaxHighlighter.js: Removed.
+ * inspector/front-end/SourceTokenizer.js: Added.
+ (WebInspector.SourceTokenizer):
+ (WebInspector.SourceTokenizer.prototype.set line):
+ (WebInspector.SourceTokenizer.prototype.set condition):
+ (WebInspector.SourceTokenizer.prototype.get condition):
+ (WebInspector.SourceTokenizer.prototype.hasCondition):
+ (WebInspector.SourceTokenizer.prototype.getLexCondition):
+ (WebInspector.SourceTokenizer.prototype.setLexCondition):
+ (WebInspector.SourceTokenizer.prototype._charAt):
+ (WebInspector.SourceTokenizer.Registry):
+ (WebInspector.SourceTokenizer.Registry.getInstance):
+ (WebInspector.SourceTokenizer.Registry.prototype.getTokenizer):
+ * inspector/front-end/TextEditorHighlighter.js:
+ (WebInspector.TextEditorHighlighter):
+ (WebInspector.TextEditorHighlighter.prototype.set mimeType):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+
+2010-01-29 Pavel Feldman <pfeldman at chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
Web Inspector: No need to render background sources
when performing search.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 98dc28d..8bfac51 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -3683,7 +3683,6 @@
'inspector/front-end/ConsoleView.js',
'inspector/front-end/ContextMenu.js',
'inspector/front-end/CookieItemsView.js',
- 'inspector/front-end/CSSSourceSyntaxHighlighter.js',
'inspector/front-end/Database.js',
'inspector/front-end/DatabaseQueryView.js',
'inspector/front-end/DatabaseTableView.js',
@@ -3691,6 +3690,7 @@
'inspector/front-end/DOMAgent.js',
'inspector/front-end/DOMStorage.js',
'inspector/front-end/DOMStorageItemsView.js',
+ 'inspector/front-end/DOMSyntaxHighlighter.js',
'inspector/front-end/Drawer.js',
'inspector/front-end/ElementsPanel.js',
'inspector/front-end/ElementsTreeOutline.js',
@@ -3702,7 +3702,6 @@
'inspector/front-end/InjectedScript.js',
'inspector/front-end/InjectedScriptAccess.js',
'inspector/front-end/inspector.js',
- 'inspector/front-end/JavaScriptSourceSyntaxHighlighter.js',
'inspector/front-end/KeyboardShortcut.js',
'inspector/front-end/MetricsSidebarPane.js',
'inspector/front-end/Object.js',
@@ -3733,7 +3732,7 @@
'inspector/front-end/SourceFrame.js',
'inspector/front-end/SourceHTMLTokenizer.js',
'inspector/front-end/SourceJavaScriptTokenizer.js',
- 'inspector/front-end/SourceSyntaxHighlighter.js',
+ 'inspector/front-end/SourceTokenizer.js',
'inspector/front-end/SourceView.js',
'inspector/front-end/StatusBarButton.js',
'inspector/front-end/StoragePanel.js',
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index e41a7fa..c83c874 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -42732,10 +42732,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\CSSSourceSyntaxHighlighter.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\Database.js"
>
</File>
@@ -42764,6 +42760,10 @@
>
</File>
<File
+ RelativePath="..\inspector\front-end\DOMSyntaxHighlighter.js"
+ >
+ </File>
+ <File
RelativePath="..\inspector\front-end\Drawer.js"
>
</File>
@@ -42812,10 +42812,6 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\JavaScriptSourceSyntaxHighlighter.js"
- >
- </File>
- <File
RelativePath="..\inspector\front-end\MetricsSidebarPane.js"
>
</File>
@@ -42932,7 +42928,7 @@
>
</File>
<File
- RelativePath="..\inspector\front-end\SourceSyntaxHighlighter.js"
+ RelativePath="..\inspector\front-end\SourceTokenizer.js"
>
</File>
<File
diff --git a/WebCore/inspector/front-end/CSSSourceSyntaxHighlighter.js b/WebCore/inspector/front-end/CSSSourceSyntaxHighlighter.js
deleted file mode 100644
index 4f91950..0000000
--- a/WebCore/inspector/front-end/CSSSourceSyntaxHighlighter.js
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.CSSSourceSyntaxHighlighter = function(table, sourceFrame) {
- WebInspector.SourceSyntaxHighlighter.call(this, table, sourceFrame);
-
- this.LexState = {
- Initial: 1,
- DeclarationProperty: 2,
- DeclarationValue: 3,
- AtMedia: 4,
- AtRule: 5,
- AtKeyframes: 6
- };
- this.ContinueState = {
- None: 0,
- Comment: 1
- };
-
- this.nonToken = "";
- this.cursor = 0;
- this.lineIndex = -1;
- this.lineCode = "";
- this.newLine = null;
- this.lexState = this.LexState.Initial;
- this.continueState = this.ContinueState.None;
-
- const urlPattern = /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i;
- const stringPattern = /^(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')/i;
- const identPattern = /^-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*/i;
- const startBlockPattern = /^{/i;
- const endBlockPattern = /^}/i;
-
- const propertyKeywords = [
- "background", "background-attachment", "background-clip", "background-color", "background-image",
- "background-origin", "background-position", "background-position-x", "background-position-y",
- "background-repeat", "background-repeat-x", "background-repeat-y", "background-size", "border",
- "border-bottom", "border-bottom-color", "border-bottom-left-radius", "border-bottom-right-radius",
- "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-left",
- "border-left-color", "border-left-style", "border-left-width", "border-radius", "border-right",
- "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style",
- "border-top", "border-top-color", "border-top-left-radius", "border-top-right-radius", "border-top-style",
- "border-top-width", "border-width", "bottom", "caption-side", "clear", "clip", "color", "content",
- "counter-increment", "counter-reset", "cursor", "direction", "display", "empty-cells", "float",
- "font", "font-family", "font-size", "font-stretch", "font-style", "font-variant", "font-weight",
- "height", "left", "letter-spacing", "line-height", "list-style", "list-style-image", "list-style-position",
- "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "max-height",
- "max-width", "min-height", "min-width", "opacity", "orphans", "outline", "outline-color", "outline-offset",
- "outline-style", "outline-width", "overflow", "overflow-x", "overflow-y", "padding", "padding-bottom",
- "padding-left", "padding-right", "padding-top", "page", "page-break-after", "page-break-before",
- "page-break-inside", "pointer-events", "position", "quotes", "resize", "right", "size", "src",
- "table-layout", "text-align", "text-decoration", "text-indent", "text-line-through", "text-line-through-color",
- "text-line-through-mode", "text-line-through-style", "text-line-through-width", "text-overflow", "text-overline",
- "text-overline-color", "text-overline-mode", "text-overline-style", "text-overline-width", "text-rendering",
- "text-shadow", "text-transform", "text-underline", "text-underline-color", "text-underline-mode",
- "text-underline-style", "text-underline-width", "top", "unicode-bidi", "unicode-range", "vertical-align",
- "visibility", "white-space", "widows", "width", "word-break", "word-spacing", "word-wrap", "z-index", "zoom",
- "-webkit-animation", "-webkit-animation-delay", "-webkit-animation-direction", "-webkit-animation-duration",
- "-webkit-animation-iteration-count", "-webkit-animation-name", "-webkit-animation-play-state",
- "-webkit-animation-timing-function", "-webkit-appearance", "-webkit-backface-visibility",
- "-webkit-background-clip", "-webkit-background-composite", "-webkit-background-origin", "-webkit-background-size",
- "-webkit-binding", "-webkit-border-fit", "-webkit-border-horizontal-spacing", "-webkit-border-image",
- "-webkit-border-radius", "-webkit-border-vertical-spacing", "-webkit-box-align", "-webkit-box-direction",
- "-webkit-box-flex", "-webkit-box-flex-group", "-webkit-box-lines", "-webkit-box-ordinal-group",
- "-webkit-box-orient", "-webkit-box-pack", "-webkit-box-reflect", "-webkit-box-shadow", "-webkit-box-sizing",
- "-webkit-column-break-after", "-webkit-column-break-before", "-webkit-column-break-inside", "-webkit-column-count",
- "-webkit-column-gap", "-webkit-column-rule", "-webkit-column-rule-color", "-webkit-column-rule-style",
- "-webkit-column-rule-width", "-webkit-column-width", "-webkit-columns", "-webkit-font-size-delta",
- "-webkit-font-smoothing", "-webkit-highlight", "-webkit-line-break", "-webkit-line-clamp",
- "-webkit-margin-bottom-collapse", "-webkit-margin-collapse", "-webkit-margin-start", "-webkit-margin-top-collapse",
- "-webkit-marquee", "-webkit-marquee-direction", "-webkit-marquee-increment", "-webkit-marquee-repetition",
- "-webkit-marquee-speed", "-webkit-marquee-style", "-webkit-mask", "-webkit-mask-attachment",
- "-webkit-mask-box-image", "-webkit-mask-clip", "-webkit-mask-composite", "-webkit-mask-image",
- "-webkit-mask-origin", "-webkit-mask-position", "-webkit-mask-position-x", "-webkit-mask-position-y",
- "-webkit-mask-repeat", "-webkit-mask-repeat-x", "-webkit-mask-repeat-y", "-webkit-mask-size",
- "-webkit-match-nearest-mail-blockquote-color", "-webkit-nbsp-mode", "-webkit-padding-start",
- "-webkit-perspective", "-webkit-perspective-origin", "-webkit-perspective-origin-x", "-webkit-perspective-origin-y",
- "-webkit-rtl-ordering", "-webkit-text-decorations-in-effect", "-webkit-text-fill-color", "-webkit-text-security",
- "-webkit-text-size-adjust", "-webkit-text-stroke", "-webkit-text-stroke-color", "-webkit-text-stroke-width",
- "-webkit-transform", "-webkit-transform-origin", "-webkit-transform-origin-x", "-webkit-transform-origin-y",
- "-webkit-transform-origin-z", "-webkit-transform-style", "-webkit-transition", "-webkit-transition-delay",
- "-webkit-transition-duration", "-webkit-transition-property", "-webkit-transition-timing-function",
- "-webkit-user-drag", "-webkit-user-modify", "-webkit-user-select", "-webkit-variable-declaration-block"
- ].keySet();
-
- const valueKeywords = [
- "above", "absolute", "activeborder", "activecaption", "afar", "after-white-space", "ahead", "alias", "all", "all-scroll",
- "alternate", "always","amharic", "amharic-abegede", "antialiased", "appworkspace", "aqua", "armenian", "auto", "avoid",
- "background", "backwards", "baseline", "below", "bidi-override", "black", "blink", "block", "block-axis", "blue", "bold",
- "bolder", "border", "border-box", "both", "bottom", "break-all", "break-word", "button", "button-bevel", "buttonface",
- "buttonhighlight", "buttonshadow", "buttontext", "capitalize", "caps-lock-indicator", "caption", "captiontext", "caret", "cell",
- "center", "checkbox", "circle", "cjk-earthly-branch", "cjk-heavenly-stem", "cjk-ideographic", "clear", "clip", "close-quote",
- "col-resize", "collapse", "compact", "condensed", "contain", "content", "content-box", "context-menu", "continuous", "copy",
- "cover", "crop", "cross", "crosshair", "currentcolor", "cursive", "dashed", "decimal", "decimal-leading-zero", "default",
- "default-button", "destination-atop", "destination-in", "destination-out", "destination-over", "disc", "discard", "document",
- "dot-dash", "dot-dot-dash", "dotted", "double", "down", "e-resize", "ease", "ease-in", "ease-in-out", "ease-out", "element",
- "ellipsis", "embed", "end", "ethiopic", "ethiopic-abegede", "ethiopic-abegede-am-et", "ethiopic-abegede-gez",
- "ethiopic-abegede-ti-er", "ethiopic-abegede-ti-et", "ethiopic-halehame-aa-er", "ethiopic-halehame-aa-et",
- "ethiopic-halehame-am-et", "ethiopic-halehame-gez", "ethiopic-halehame-om-et", "ethiopic-halehame-sid-et",
- "ethiopic-halehame-so-et", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "ethiopic-halehame-tig", "ew-resize", "expanded",
- "extra-condensed", "extra-expanded", "fantasy", "fast", "fill", "fixed", "flat", "forwards", "fuchsia", "geometricPrecision",
- "georgian", "gray", "graytext", "green", "grey", "groove", "hand", "hangul", "hangul-consonant", "hebrew", "help", "hidden", "hide",
- "higher", "highlight", "highlighttext", "hiragana", "hiragana-iroha", "horizontal", "icon", "ignore",
- "inactiveborder", "inactivecaption", "inactivecaptiontext", "infinite", "infobackground", "infotext", "inherit", "initial", "inline",
- "inline-axis", "inline-block", "inline-table", "inset", "inside", "intrinsic", "invert", "italic", "justify", "katakana",
- "katakana-iroha", "landscape", "large", "larger", "left", "level", "lighter", "lime", "line-through", "linear", "lines",
- "list-button", "list-item", "listbox", "listitem", "local", "logical", "loud", "lower", "lower-alpha", "lower-greek", "lower-latin",
- "lower-norwegian", "lower-roman", "lowercase", "ltr", "maroon", "match", "media-controls-background", "media-current-time-display",
- "media-fullscreen-button", "media-mute-button", "media-play-button", "media-return-to-realtime-button", "media-rewind-button",
- "media-seek-back-button", "media-seek-forward-button", "media-slider", "media-sliderthumb", "media-time-remaining-display",
- "media-volume-slider", "media-volume-slider-container", "media-volume-sliderthumb", "medium", "menu", "menulist", "menulist-button",
- "menulist-text", "menulist-textfield", "menutext", "message-box", "middle", "min-intrinsic", "mix", "monospace", "move", "multiple",
- "n-resize", "narrower", "navy", "ne-resize", "nesw-resize", "no-close-quote", "no-drop", "no-open-quote", "no-repeat", "none",
- "normal", "not-allowed", "nowrap", "ns-resize", "nw-resize", "nwse-resize", "oblique", "olive", "open-quote", "optimizeLegibility",
- "optimizeSpeed", "orange", "oromo", "outset", "outside", "overlay", "overline", "padding", "padding-box", "painted", "paused",
- "plus-darker", "plus-lighter", "pointer", "portrait", "pre", "pre-line", "pre-wrap", "preserve-3d", "progress", "purple",
- "push-button", "radio", "read-only", "read-write", "read-write-plaintext-only", "red", "relative", "repeat", "repeat-x",
- "repeat-y", "reset", "reverse", "ridge", "right", "round", "row-resize", "rtl", "run-in", "running", "s-resize", "sans-serif",
- "scroll", "scrollbar", "se-resize", "searchfield", "searchfield-cancel-button", "searchfield-decoration", "searchfield-results-button",
- "searchfield-results-decoration", "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama", "silver", "single",
- "skip-white-space", "slide", "slider-horizontal", "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
- "small", "small-caps", "small-caption", "smaller", "solid", "somali", "source-atop", "source-in", "source-out", "source-over",
- "space", "square", "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub", "subpixel-antialiased", "super",
- "sw-resize", "table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group",
- "table-row", "table-row-group", "teal", "text", "text-bottom", "text-top", "textarea", "textfield", "thick", "thin", "threeddarkshadow",
- "threedface", "threedhighlight", "threedlightshadow", "threedshadow", "tigre", "tigrinya-er", "tigrinya-er-abegede", "tigrinya-et",
- "tigrinya-et-abegede", "top", "transparent", "ultra-condensed", "ultra-expanded", "underline", "up", "upper-alpha", "upper-greek",
- "upper-latin", "upper-norwegian", "upper-roman", "uppercase", "vertical", "vertical-text", "visible", "visibleFill", "visiblePainted",
- "visibleStroke", "visual", "w-resize", "wait", "wave", "white", "wider", "window", "windowframe", "windowtext", "x-large", "x-small",
- "xor", "xx-large", "xx-small", "yellow", "-wap-marquee", "-webkit-activelink", "-webkit-auto", "-webkit-baseline-middle", "-webkit-body",
- "-webkit-box", "-webkit-center", "-webkit-control", "-webkit-focus-ring-color", "-webkit-grab", "-webkit-grabbing", "-webkit-inline-box",
- "-webkit-left", "-webkit-link", "-webkit-marquee", "-webkit-mini-control", "-webkit-nowrap", "-webkit-right", "-webkit-small-control",
- "-webkit-text", "-webkit-xxx-large", "-webkit-zoom-in", "-webkit-zoom-out",
- ].keySet();
-
- const mediaTypes = ["all", "aural", "braille", "embossed", "handheld", "print", "projection", "screen", "tty", "tv"].keySet();
-
- this.rules = [{
- name: "commentAction",
- pattern: /^\/\*[^\*]*\*+([^\/*][^*]*\*+)*\//i,
- style: "webkit-css-comment"
- }, {
- name: "commentStartAction",
- pattern: /^(?:\/\*(?:[^\*]|\*[^\/])*)/i,
- style: "webkit-css-comment",
- postContinueState: this.ContinueState.Comment
- }, {
- name: "commentEndAction",
- pattern: /^(?:(?:[^\*]|\*[^\/])*\*+\/)/i,
- style: "webkit-css-comment",
- preContinueState: this.ContinueState.Comment,
- postContinueState: this.ContinueState.None
- }, {
- name: "commentMiddleAction",
- pattern: /^.*/i,
- style: "webkit-css-comment",
- preContinueState: this.ContinueState.Comment
- }, {
- name: "selectorAction",
- pattern: /^(?:(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|\*)(?:#-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|\.-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|\[\s*-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\s*(?:(?:=|~=|\|=)\s*(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*'))\s*)?\]|:(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\(\s*(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\s*)?\)))*|(?:#-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|\.-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|\[\s*-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\s*(?:(?:=|~=|\|=)\s*(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*'))\s*)?\]|:(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*|-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\(\s*(?:-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*\s*)?\)))+)/i,
- style: "webkit-css-selector",
- preLexState: this.LexState.Initial
- }, {
- name: "startRulesetBlockAction",
- pattern: startBlockPattern,
- preLexState: this.LexState.Initial,
- postLexState: this.LexState.DeclarationProperty
- }, {
- name: "propertyAction",
- pattern: identPattern,
- style: "webkit-css-property",
- keywords: propertyKeywords,
- preLexState: this.LexState.DeclarationProperty,
- }, {
- name: "declarationColonAction",
- pattern: /^:/i,
- preLexState: this.LexState.DeclarationProperty,
- postLexState: this.LexState.DeclarationValue
- }, {
- name: "colorAction",
- pattern: /^(?:#(?:[\da-f]{6}|[\da-f]{3})|rgba\(\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*\)|hsla\(\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*\)|rgb\(\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*\)|hsl\(\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*,\s*(?:\d+|\d*\.\d+)%?\s*\))/i,
- style: "webkit-css-color",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "numvalueAction",
- pattern: /^(?:-?(?:\d+|\d*\.\d+)(?:em|rem|__qem|ex|px|cm|mm|in|pt|pc|deg|rad|grad|turn|ms|s|Hz|kHz|%)?)/i,
- style: "webkit-css-number",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "urlAction",
- pattern: urlPattern,
- style: "webkit-css-url",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "stringAction",
- pattern: stringPattern,
- style: "webkit-css-string",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "importantAction",
- pattern: /^!\s*important/i,
- style: "webkit-css-important",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "valueIdentAction",
- pattern: identPattern,
- keywords: valueKeywords,
- style: "webkit-css-keyword",
- preLexState: this.LexState.DeclarationValue
- }, {
- name: "declarationSemicolonAction",
- pattern: /^;/i,
- preLexState: this.LexState.DeclarationValue,
- postLexState: this.LexState.DeclarationProperty
- }, {
- name: "endRulesetBlockAction",
- pattern: endBlockPattern,
- preLexState: this.LexState.DeclarationProperty,
- postLexState: this.LexState.Initial
- }, {
- name: "atMediaAction",
- pattern: /^@media/i,
- style: "webkit-css-at-rule",
- preLexState: this.LexState.Initial,
- postLexState: this.LexState.AtMedia
- }, {
- name: "startAtMediaBlockAction",
- pattern: startBlockPattern,
- preLexState: this.LexState.AtMedia,
- postLexState: this.LexState.Initial
- }, {
- name: "atKeyframesAction",
- pattern: /^@-webkit-keyframes/i,
- style: "webkit-css-at-rule",
- preLexState: this.LexState.Initial,
- postLexState: this.LexState.AtKeyframes
- }, {
- name: "startAtKeyframesBlockAction",
- pattern: startBlockPattern,
- preLexState: this.LexState.AtKeyframes,
- postLexState: this.LexState.Initial
- }, {
- name: "atRuleAction",
- style: "webkit-css-at-rule",
- pattern: /^@-?(?:\w|(?:\\[\da-f]{1,6}\s?|\.))(?:[-\w]|(?:\\[\da-f]{1,6}\s?|\.))*/i,
- preLexState: this.LexState.Initial,
- postLexState: this.LexState.AtRule
- }, {
- name: "endAtRuleAction",
- pattern: /^;/i,
- preLexState: this.LexState.AtRule,
- postLexState: this.LexState.Initial
- }, {
- name: "urlAction",
- pattern: urlPattern,
- style: "webkit-css-url",
- preLexState: this.LexState.AtRule
- }, {
- name: "stringAction",
- pattern: stringPattern,
- style: "webkit-css-string",
- preLexState: this.LexState.AtRule
- }, {
- name: "stringAction",
- pattern: stringPattern,
- style: "webkit-css-string",
- preLexState: this.LexState.AtKeyframes
- }, {
- name: "atRuleIdentAction",
- pattern: identPattern,
- keywords: mediaTypes,
- style: "webkit-css-keyword",
- preLexState: this.LexState.AtRule
- }, {
- name: "atRuleIdentAction",
- pattern: identPattern,
- keywords: mediaTypes,
- style: "webkit-css-keyword",
- preLexState: this.LexState.AtMedia,
- }, {
- name: "startAtRuleBlockAction",
- pattern: startBlockPattern,
- preLexState: this.LexState.AtRule,
- postLexState: this.LexState.DeclarationProperty
- }];
-}
-
-WebInspector.CSSSourceSyntaxHighlighter.prototype.__proto__ = WebInspector.SourceSyntaxHighlighter.prototype;
diff --git a/WebCore/inspector/front-end/DOMSyntaxHighlighter.js b/WebCore/inspector/front-end/DOMSyntaxHighlighter.js
new file mode 100644
index 0000000..07233d3
--- /dev/null
+++ b/WebCore/inspector/front-end/DOMSyntaxHighlighter.js
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.DOMSyntaxHighlighter = function(mimeType)
+{
+ this._tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);
+}
+
+WebInspector.DOMSyntaxHighlighter.prototype = {
+ createSpan: function(content, className)
+ {
+ var span = document.createElement("span");
+ span.className = "webkit-" + className;
+ span.appendChild(document.createTextNode(content));
+ return span;
+ },
+
+ syntaxHighlightNode: function(node)
+ {
+ this._tokenizer.condition = this._tokenizer.initialCondition;
+ var lines = node.textContent.split("\n");
+ node.removeChildren();
+
+ for (var i = lines[0].length ? 0 : 1; i < lines.length; ++i) {
+ var line = lines[i];
+ var plainTextStart = 0;
+ this._tokenizer.line = line;
+ var column = 0;
+ do {
+ var newColumn = this._tokenizer.nextToken(column);
+ var tokenType = this._tokenizer.tokenType;
+ if (tokenType) {
+ if (column > plainTextStart) {
+ var plainText = line.substring(plainTextStart, column);
+ node.appendChild(document.createTextNode(plainText));
+ }
+ var token = line.substring(column, newColumn);
+ node.appendChild(this.createSpan(token, tokenType));
+ plainTextStart = newColumn;
+ }
+ column = newColumn;
+ } while (column < line.length)
+
+ if (plainTextStart < line.length) {
+ var plainText = line.substring(plainTextStart, line.length);
+ node.appendChild(document.createTextNode(plainText));
+ }
+ if (i < lines.length - 1)
+ node.appendChild(document.createElement("br"));
+ }
+ }
+}
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 87fb8ce..d38a7bb 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -979,7 +979,7 @@ WebInspector.ElementsTreeElement.prototype = {
var newNode = document.createElement("span");
newNode.textContent = node.textContent;
- var javascriptSyntaxHighlighter = new WebInspector.JavaScriptSourceSyntaxHighlighter(null, null);
+ var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/javascript");
javascriptSyntaxHighlighter.syntaxHighlightNode(newNode);
info.title = "<span class=\"webkit-html-text-node webkit-html-js-node\">" + newNode.innerHTML.replace(/^[\n\r]*/, "").replace(/\s*$/, "") + "</span>";
@@ -987,7 +987,7 @@ WebInspector.ElementsTreeElement.prototype = {
var newNode = document.createElement("span");
newNode.textContent = node.textContent;
- var cssSyntaxHighlighter = new WebInspector.CSSSourceSyntaxHighlighter(null, null);
+ var cssSyntaxHighlighter = new WebInspector.DOMSyntaxHighlighter("text/css");
cssSyntaxHighlighter.syntaxHighlightNode(newNode);
info.title = "<span class=\"webkit-html-text-node webkit-html-css-node\">" + newNode.innerHTML.replace(/^[\n\r]*/, "").replace(/\s*$/, "") + "</span>";
diff --git a/WebCore/inspector/front-end/JavaScriptSourceSyntaxHighlighter.js b/WebCore/inspector/front-end/JavaScriptSourceSyntaxHighlighter.js
deleted file mode 100644
index 060c22b..0000000
--- a/WebCore/inspector/front-end/JavaScriptSourceSyntaxHighlighter.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.JavaScriptSourceSyntaxHighlighter = function(table, sourceFrame) {
- WebInspector.SourceSyntaxHighlighter.call(this, table, sourceFrame);
-
- this.LexState = {
- Initial: 1,
- DivisionAllowed: 2,
- };
- this.ContinueState = {
- None: 0,
- Comment: 1,
- SingleQuoteString: 2,
- DoubleQuoteString: 3,
- RegExp: 4
- };
-
- this.nonToken = "";
- this.cursor = 0;
- this.lineIndex = -1;
- this.lineCode = "";
- this.newLine = null;
- this.lexState = this.LexState.Initial;
- this.continueState = this.ContinueState.None;
-
- const keywords = [
- "null", "true", "false", "break", "case", "catch", "const", "default", "finally", "for",
- "instanceof", "new", "var", "continue", "function", "return", "void", "delete", "if",
- "this", "do", "while", "else", "in", "switch", "throw", "try", "typeof", "debugger",
- "class", "enum", "export", "extends", "import", "super", "get", "set"
- ].keySet();
-
- this.rules = [{
- name: "singleLineCommentAction",
- pattern: /^(?:\/\/.*)/,
- style: "webkit-javascript-comment"
- }, {
- name: "multiLineSingleLineCommentAction",
- pattern: /^(?:\/\*(?:[^\*]|\*[^\/])*\*+\/)/,
- style: "webkit-javascript-comment"
- }, {
- name: "multiLineCommentStartAction",
- pattern: /^(?:\/\*(?:[^\*]|\*[^\/])*)/,
- style: "webkit-javascript-comment",
- postContinueState: this.ContinueState.Comment
- }, {
- name: "multiLineCommentEndAction",
- pattern: /^(?:(?:[^\*]|\*[^\/])*\*+\/)/,
- style: "webkit-javascript-comment",
- preContinueState: this.ContinueState.Comment,
- postContinueState: this.ContinueState.None
- }, {
- name: "multiLineCommentMiddleAction",
- pattern: /^.*/,
- style: "webkit-javascript-comment",
- preContinueState: this.ContinueState.Comment
- }, {
- name: "numericLiteralAction",
- pattern: /^(?:(?:0|[1-9]\d*)\.\d+?(?:[eE](?:\d+|\+\d+|-\d+))?|\.\d+(?:[eE](?:\d+|\+\d+|-\d+))?|(?:0|[1-9]\d*)(?:[eE](?:\d+|\+\d+|-\d+))?|0x[0-9a-fA-F]+|0X[0-9a-fA-F]+)/,
- style: "webkit-javascript-number",
- postLexState: this.LexState.DivisionAllowed
- }, {
- name: "stringLiteralAction",
- pattern: /^(?:"(?:[^"\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*"|'(?:[^'\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*')/,
- style: "webkit-javascript-string",
- postLexState: this.LexState.Initial
- }, {
- name: "singleQuoteStringStartAction",
- pattern: /^(?:'(?:[^'\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*)\\$/,
- style: "webkit-javascript-string",
- postContinueState: this.ContinueState.SingleQuoteString
- }, {
- name: "singleQuoteStringEndAction",
- pattern: /^(?:(?:[^'\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*')/,
- style: "webkit-javascript-string",
- preContinueState: this.ContinueState.SingleQuoteString,
- postContinueState: this.ContinueState.None
- }, {
- name: "singleQuoteStringMiddleAction",
- pattern: /^(?:(?:[^'\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*)\\$/,
- style: "webkit-javascript-string",
- preContinueState: this.ContinueState.SingleQuoteString
- }, {
- name: "doubleQuoteStringStartAction",
- pattern: /^(?:"(?:[^"\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*)\\$/,
- style: "webkit-javascript-string",
- postContinueState: this.ContinueState.DoubleQuoteString
- }, {
- name: "doubleQuoteStringEndAction",
- pattern: /^(?:(?:[^"\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*")/,
- style: "webkit-javascript-string",
- preContinueState: this.ContinueState.DoubleQuoteString,
- postContinueState: this.ContinueState.None
- }, {
- name: "doubleQuoteStringMiddleAction",
- pattern: /^(?:(?:[^"\\]|\\(?:['"\bfnrtv]|[^'"\bfnrtv0-9xu]|0|x[0-9a-fA-F][0-9a-fA-F]|(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])))*)\\$/,
- style: "webkit-javascript-string",
- preContinueState: this.ContinueState.DoubleQuoteString
- }, {
- name: "keywordAction",
- pattern: /^(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))|[0-9])*)/,
- keywords: keywords,
- style: "webkit-javascript-keyword",
- postLexState: this.LexState.Initial
- }, {
- name: "identAction",
- pattern: /^(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))|[0-9])*)/,
- style: "webkit-javascript-ident",
- callback: function(identElement) { identElement.addEventListener("mouseover", showDatatip, false); },
- postLexState: this.LexState.DivisionAllowed
- }, {
- name: "rightParenAction",
- pattern: /^\)/,
- postLexState: this.LexState.DivisionAllowed
- }, {
- name: "punctuatorAction",
- pattern: /^(?:<=|>=|===|==|!=|!==|\+\+|\-\-|<<|>>|>>>|&&|\|\||\+=|\-=|\*=|%=|<<=|>>=|>>>=|&=|\|=|^=|[{}\(\[\]\.;,<>\+\-\*%&\|\^!~\?:=])/,
- postLexState: this.LexState.Initial
- }, {
- name: "divPunctuatorAction",
- pattern: /^(?:\/=?)/,
- preLexState: this.LexState.DivisionAllowed,
- postLexState: this.LexState.Initial
- }, {
- name: "regExpLiteralAction",
- pattern: /^(?:\/(?:(?:\\.)|[^\\*\/])(?:(?:\\.)|[^\\/])*\/(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))|[0-9])*)/,
- style: "webkit-javascript-regexp",
- postLexState: this.LexState.Initial
- }, {
- name: "regExpStartAction",
- pattern: /^(?:\/(?:(?:\\.)|[^\\*\/])(?:(?:\\.)|[^\\/])*)\\$/,
- style: "webkit-javascript-regexp",
- postContinueState: this.ContinueState.RegExp
- }, {
- name: "regExpEndAction",
- pattern: /^(?:(?:(?:\\.)|[^\\/])*\/(?:(?:[a-zA-Z]|[$_]|\\(?:u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]))|[0-9])*)/,
- style: "webkit-javascript-regexp",
- preContinueState: this.ContinueState.RegExp,
- postContinueState: this.ContinueState.None
- }, {
- name: "regExpMiddleAction",
- pattern: /^(?:(?:(?:\\.)|[^\\/])*)\\$/,
- style: "webkit-javascript-regexp",
- preContinueState: this.ContinueState.RegExp
- }];
-
- function showDatatip(event) {
- if (!WebInspector.panels.scripts || !WebInspector.panels.scripts.paused)
- return;
-
- var node = event.target;
- var parts = [node.textContent];
- while (node.previousSibling && node.previousSibling.textContent === ".") {
- node = node.previousSibling.previousSibling;
- if (!node || !node.hasStyleClass("webkit-javascript-ident"))
- break;
- parts.unshift(node.textContent);
- }
-
- var expression = parts.join(".");
-
- WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression, false, "console", callback);
- function callback(result, exception)
- {
- if (exception)
- return;
- event.target.setAttribute("title", result.description);
- event.target.addEventListener("mouseout", onmouseout, false);
-
- function onmouseout(event)
- {
- event.target.removeAttribute("title");
- event.target.removeEventListener("mouseout", onmouseout, false);
- }
- }
- }
-}
-
-WebInspector.JavaScriptSourceSyntaxHighlighter.prototype.__proto__ = WebInspector.SourceSyntaxHighlighter.prototype;
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.js b/WebCore/inspector/front-end/SourceCSSTokenizer.js
index 1c0d0a2..599cfb3 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.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 Thu Jan 28 20:49:22 2010 */
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
@@ -43,7 +43,7 @@
WebInspector.SourceCSSTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._propertyKeywords = [
"background", "background-attachment", "background-clip", "background-color", "background-image",
@@ -373,40 +373,41 @@ case 26:
/* *********************************** */
case this.case_INITIAL:
yych = this._charAt(cursor);
- if (yych <= '9') {
- if (yych <= '&') {
+ if (yych <= ';') {
+ if (yych <= '\'') {
if (yych <= '"') {
if (yych <= ' ') { gotoCase = 29; continue; };
if (yych <= '!') { gotoCase = 31; continue; };
{ gotoCase = 33; continue; };
} else {
if (yych == '$') { gotoCase = 31; continue; };
+ if (yych >= '\'') { gotoCase = 34; continue; };
}
} else {
- if (yych <= '-') {
- if (yych <= '\'') { gotoCase = 34; continue; };
- if (yych >= '-') { gotoCase = 35; continue; };
+ if (yych <= '.') {
+ if (yych <= ',') { gotoCase = 29; continue; };
+ if (yych <= '-') { gotoCase = 35; continue; };
+ { gotoCase = 36; continue; };
} else {
- if (yych <= '.') { gotoCase = 36; continue; };
if (yych <= '/') { gotoCase = 37; continue; };
- { gotoCase = 38; continue; };
+ if (yych <= '9') { gotoCase = 38; continue; };
+ if (yych <= ':') { gotoCase = 40; continue; };
+ { gotoCase = 42; continue; };
}
}
} else {
- if (yych <= '_') {
+ if (yych <= '^') {
if (yych <= '?') {
- if (yych <= ':') { gotoCase = 40; continue; };
- if (yych <= ';') { gotoCase = 42; continue; };
+ if (yych == '=') { gotoCase = 31; continue; };
} else {
- if (yych <= 'Z') { gotoCase = 31; continue; };
- if (yych >= '_') { gotoCase = 31; continue; };
+ if (yych == '\\') { gotoCase = 29; continue; };
+ if (yych <= ']') { gotoCase = 31; continue; };
}
} else {
- if (yych <= '{') {
- if (yych <= '`') { gotoCase = 29; continue; };
- if (yych <= 'z') { gotoCase = 31; continue; };
- { gotoCase = 44; continue; };
+ if (yych <= 'z') {
+ if (yych != '`') { gotoCase = 31; continue; };
} else {
+ if (yych <= '{') { gotoCase = 44; continue; };
if (yych == '}') { gotoCase = 46; continue; };
}
}
@@ -426,7 +427,9 @@ case 32:
if (token === "@import" || token === "@media") {
this.tokenType = "css-at-rule";
this._parseCondition = this._parseConditions.AT_RULE;
- } else
+ } else if (token.indexOf("@") === 0)
+ this.tokenType = "css-at-rule";
+ else
this.tokenType = "css-selector";
}
else if (this._parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
@@ -444,17 +447,98 @@ case 32:
case 33:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
- if (yych == '\n') { gotoCase = 30; continue; };
- if (yych == '\r') { gotoCase = 30; continue; };
- { gotoCase = 120; continue; };
+ if (yych <= '-') {
+ if (yych <= '!') {
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 32; continue; };
+ { gotoCase = 124; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 32; continue; };
+ if (yych <= ' ') { gotoCase = 124; continue; };
+ { gotoCase = 122; continue; };
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') { gotoCase = 114; continue; };
+ if (yych <= '#') { gotoCase = 124; continue; };
+ { gotoCase = 122; continue; };
+ } else {
+ if (yych == '\'') { gotoCase = 122; continue; };
+ if (yych <= ',') { gotoCase = 124; continue; };
+ { gotoCase = 122; continue; };
+ }
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= '<') {
+ if (yych <= '.') { gotoCase = 124; continue; };
+ if (yych <= '9') { gotoCase = 122; continue; };
+ { gotoCase = 124; continue; };
+ } else {
+ if (yych <= '=') { gotoCase = 122; continue; };
+ if (yych <= '?') { gotoCase = 124; continue; };
+ { gotoCase = 122; continue; };
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '\\') { gotoCase = 126; continue; };
+ if (yych <= ']') { gotoCase = 122; continue; };
+ { gotoCase = 124; continue; };
+ } else {
+ if (yych == '`') { gotoCase = 124; continue; };
+ if (yych <= 'z') { gotoCase = 122; continue; };
+ { gotoCase = 124; continue; };
+ }
+ }
+ }
case 34:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
- if (yych == '\n') { gotoCase = 30; continue; };
- if (yych == '\r') { gotoCase = 30; continue; };
- { gotoCase = 113; continue; };
+ if (yych <= '-') {
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 32; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 32; continue; };
+ if (yych <= ' ') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ } else {
+ if (yych <= '&') {
+ if (yych == '$') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '\'') { gotoCase = 114; continue; };
+ if (yych <= ',') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= '<') {
+ if (yych <= '.') { gotoCase = 116; continue; };
+ if (yych <= '9') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '=') { gotoCase = 112; continue; };
+ if (yych <= '?') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '\\') { gotoCase = 118; continue; };
+ if (yych <= ']') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych == '`') { gotoCase = 116; continue; };
+ if (yych <= 'z') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ }
+ }
+ }
case 35:
- yyaccept = 1;
+ yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
if (yych == '.') { gotoCase = 65; continue; };
if (yych <= '/') { gotoCase = 49; continue; };
@@ -469,14 +553,18 @@ case 37:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
if (yych == '*') { gotoCase = 104; continue; };
- { gotoCase = 30; continue; };
+ { gotoCase = 49; continue; };
case 38:
- yyaccept = 2;
+ yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
switch (yych) {
case '!':
+ case '"':
case '$':
+ case '\'':
case '-':
+ case '/':
+ case '=':
case '@':
case 'A':
case 'B':
@@ -503,6 +591,8 @@ case 38:
case 'X':
case 'Y':
case 'Z':
+ case '[':
+ case ']':
case 'a':
case 'b':
case 'f':
@@ -592,35 +682,57 @@ case 48:
++cursor;
yych = this._charAt(cursor);
case 49:
- if (yych <= '/') {
- if (yych <= '#') {
- if (yych == '!') { gotoCase = 48; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= '9') {
+ if (yych <= '&') {
+ if (yych <= '"') {
+ if (yych <= ' ') { gotoCase = 32; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych == '$') { gotoCase = 48; continue; };
+ { gotoCase = 32; continue; };
+ }
} else {
- if (yych <= '$') { gotoCase = 48; continue; };
- if (yych == '-') { gotoCase = 48; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= ',') {
+ if (yych <= '\'') { gotoCase = 48; continue; };
+ { gotoCase = 32; continue; };
+ } else {
+ if (yych == '.') { gotoCase = 32; continue; };
+ { gotoCase = 48; continue; };
+ }
}
} else {
- if (yych <= '^') {
- if (yych <= '9') { gotoCase = 48; continue; };
- if (yych <= '?') { gotoCase = 32; continue; };
- if (yych <= 'Z') { gotoCase = 48; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= '\\') {
+ if (yych <= '=') {
+ if (yych <= '<') { gotoCase = 32; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '?') { gotoCase = 32; continue; };
+ if (yych <= '[') { gotoCase = 48; continue; };
+ { gotoCase = 32; continue; };
+ }
} else {
- if (yych == '`') { gotoCase = 32; continue; };
- if (yych <= 'z') { gotoCase = 48; continue; };
- { gotoCase = 32; continue; };
+ if (yych <= '_') {
+ if (yych == '^') { gotoCase = 32; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '`') { gotoCase = 32; continue; };
+ if (yych <= 'z') { gotoCase = 48; continue; };
+ { gotoCase = 32; continue; };
+ }
}
}
case 50:
- yyaccept = 2;
+ yyaccept = 1;
YYMARKER = ++cursor;
yych = this._charAt(cursor);
switch (yych) {
case '!':
+ case '"':
case '$':
+ case '\'':
case '-':
+ case '/':
+ case '=':
case '@':
case 'A':
case 'B':
@@ -647,6 +759,8 @@ case 50:
case 'X':
case 'Y':
case 'Z':
+ case '[':
+ case ']':
case 'a':
case 'b':
case 'f':
@@ -744,25 +858,43 @@ case 62:
{ gotoCase = 49; continue; };
case 63:
yych = this._charAt(++cursor);
- if (yych <= '/') {
- if (yych <= '#') {
- if (yych == '!') { gotoCase = 48; continue; };
- { gotoCase = 39; continue; };
+ if (yych <= '9') {
+ if (yych <= '&') {
+ if (yych <= '"') {
+ if (yych <= ' ') { gotoCase = 39; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych == '$') { gotoCase = 48; continue; };
+ { gotoCase = 39; continue; };
+ }
} else {
- if (yych <= '$') { gotoCase = 48; continue; };
- if (yych == '-') { gotoCase = 48; continue; };
- { gotoCase = 39; continue; };
+ if (yych <= ',') {
+ if (yych <= '\'') { gotoCase = 48; continue; };
+ { gotoCase = 39; continue; };
+ } else {
+ if (yych == '.') { gotoCase = 39; continue; };
+ { gotoCase = 48; continue; };
+ }
}
} else {
- if (yych <= '^') {
- if (yych <= '9') { gotoCase = 48; continue; };
- if (yych <= '?') { gotoCase = 39; continue; };
- if (yych <= 'Z') { gotoCase = 48; continue; };
- { gotoCase = 39; continue; };
+ if (yych <= '\\') {
+ if (yych <= '=') {
+ if (yych <= '<') { gotoCase = 39; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '?') { gotoCase = 39; continue; };
+ if (yych <= '[') { gotoCase = 48; continue; };
+ { gotoCase = 39; continue; };
+ }
} else {
- if (yych == '`') { gotoCase = 39; continue; };
- if (yych <= 'z') { gotoCase = 48; continue; };
- { gotoCase = 39; continue; };
+ if (yych <= '_') {
+ if (yych == '^') { gotoCase = 39; continue; };
+ { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '`') { gotoCase = 39; continue; };
+ if (yych <= 'z') { gotoCase = 48; continue; };
+ { gotoCase = 39; continue; };
+ }
}
}
case 64:
@@ -775,12 +907,8 @@ case 65:
if (yych <= '9') { gotoCase = 68; continue; };
case 66:
cursor = YYMARKER;
- if (yyaccept <= 1) {
- if (yyaccept <= 0) {
- { gotoCase = 30; continue; };
- } else {
- { gotoCase = 32; continue; };
- }
+ if (yyaccept <= 0) {
+ { gotoCase = 32; continue; };
} else {
{ gotoCase = 39; continue; };
}
@@ -788,7 +916,7 @@ case 67:
yych = this._charAt(++cursor);
{ gotoCase = 39; continue; };
case 68:
- yyaccept = 2;
+ yyaccept = 1;
YYMARKER = ++cursor;
yych = this._charAt(cursor);
if (yych <= 'f') {
@@ -984,85 +1112,204 @@ case 110:
++cursor;
{ this.tokenType = "css-comment"; return cursor; }
case 112:
+ yyaccept = 0;
+ YYMARKER = ++cursor;
+ yych = this._charAt(cursor);
+ if (yych <= '-') {
+ if (yych <= '"') {
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 32; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 32; continue; };
+ if (yych <= ' ') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ } else {
+ if (yych <= '&') {
+ if (yych == '$') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '\'') { gotoCase = 114; continue; };
+ if (yych <= ',') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= '<') {
+ if (yych <= '.') { gotoCase = 116; continue; };
+ if (yych <= '9') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych <= '=') { gotoCase = 112; continue; };
+ if (yych <= '?') { gotoCase = 116; continue; };
+ { gotoCase = 112; continue; };
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '\\') { gotoCase = 118; continue; };
+ if (yych <= ']') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ } else {
+ if (yych == '`') { gotoCase = 116; continue; };
+ if (yych <= 'z') { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
+ }
+ }
+ }
+case 114:
+ ++cursor;
+ if ((yych = this._charAt(cursor)) <= '9') {
+ if (yych <= '&') {
+ if (yych <= '"') {
+ if (yych >= '!') { gotoCase = 48; continue; };
+ } else {
+ if (yych == '$') { gotoCase = 48; continue; };
+ }
+ } else {
+ if (yych <= ',') {
+ if (yych <= '\'') { gotoCase = 48; continue; };
+ } else {
+ if (yych != '.') { gotoCase = 48; continue; };
+ }
+ }
+ } else {
+ if (yych <= '\\') {
+ if (yych <= '=') {
+ if (yych >= '=') { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '?') { gotoCase = 115; continue; };
+ if (yych <= '[') { gotoCase = 48; continue; };
+ }
+ } else {
+ if (yych <= '_') {
+ if (yych != '^') { gotoCase = 48; continue; };
+ } else {
+ if (yych <= '`') { gotoCase = 115; continue; };
+ if (yych <= 'z') { gotoCase = 48; continue; };
+ }
+ }
+ }
+case 115:
+ { return this._stringToken(cursor, true); }
+case 116:
++cursor;
yych = this._charAt(cursor);
-case 113:
if (yych <= '\r') {
if (yych == '\n') { gotoCase = 66; continue; };
- if (yych <= '\f') { gotoCase = 112; continue; };
+ if (yych <= '\f') { gotoCase = 116; continue; };
{ gotoCase = 66; continue; };
} else {
if (yych <= '\'') {
- if (yych <= '&') { gotoCase = 112; continue; };
- { gotoCase = 115; continue; };
+ if (yych <= '&') { gotoCase = 116; continue; };
+ { gotoCase = 121; continue; };
} else {
- if (yych != '\\') { gotoCase = 112; continue; };
+ if (yych != '\\') { gotoCase = 116; continue; };
}
}
+case 118:
++cursor;
yych = this._charAt(cursor);
if (yych <= 'a') {
if (yych <= '!') {
if (yych <= '\n') {
if (yych <= '\t') { gotoCase = 66; continue; };
- { gotoCase = 117; continue; };
} else {
- if (yych == '\r') { gotoCase = 117; continue; };
- { gotoCase = 66; continue; };
+ if (yych != '\r') { gotoCase = 66; continue; };
}
} else {
if (yych <= '\'') {
- if (yych <= '"') { gotoCase = 112; continue; };
+ if (yych <= '"') { gotoCase = 116; continue; };
if (yych <= '&') { gotoCase = 66; continue; };
- { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
} else {
- if (yych == '\\') { gotoCase = 112; continue; };
+ if (yych == '\\') { gotoCase = 116; continue; };
{ gotoCase = 66; continue; };
}
}
} else {
if (yych <= 'q') {
if (yych <= 'f') {
- if (yych <= 'b') { gotoCase = 112; continue; };
+ if (yych <= 'b') { gotoCase = 116; continue; };
if (yych <= 'e') { gotoCase = 66; continue; };
- { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
} else {
- if (yych == 'n') { gotoCase = 112; continue; };
+ if (yych == 'n') { gotoCase = 116; continue; };
{ gotoCase = 66; continue; };
}
} else {
if (yych <= 't') {
if (yych == 's') { gotoCase = 66; continue; };
- { gotoCase = 112; continue; };
+ { gotoCase = 116; continue; };
} else {
- if (yych == 'v') { gotoCase = 112; continue; };
+ if (yych == 'v') { gotoCase = 116; continue; };
{ gotoCase = 66; continue; };
}
}
}
-case 115:
- ++cursor;
- { return this._stringToken(cursor, true); }
-case 117:
++cursor;
this.setLexCondition(this._lexConditions.SSTRING);
{ return this._stringToken(cursor); }
-case 119:
+case 121:
+ yych = this._charAt(++cursor);
+ { gotoCase = 115; continue; };
+case 122:
+ yyaccept = 0;
+ YYMARKER = ++cursor;
+ yych = this._charAt(cursor);
+ if (yych <= '-') {
+ if (yych <= '!') {
+ if (yych <= '\f') {
+ if (yych == '\n') { gotoCase = 32; continue; };
+ } else {
+ if (yych <= '\r') { gotoCase = 32; continue; };
+ if (yych >= '!') { gotoCase = 122; continue; };
+ }
+ } else {
+ if (yych <= '$') {
+ if (yych <= '"') { gotoCase = 114; continue; };
+ if (yych >= '$') { gotoCase = 122; continue; };
+ } else {
+ if (yych == '\'') { gotoCase = 122; continue; };
+ if (yych >= '-') { gotoCase = 122; continue; };
+ }
+ }
+ } else {
+ if (yych <= '[') {
+ if (yych <= '<') {
+ if (yych <= '.') { gotoCase = 124; continue; };
+ if (yych <= '9') { gotoCase = 122; continue; };
+ } else {
+ if (yych <= '=') { gotoCase = 122; continue; };
+ if (yych >= '@') { gotoCase = 122; continue; };
+ }
+ } else {
+ if (yych <= '^') {
+ if (yych <= '\\') { gotoCase = 126; continue; };
+ if (yych <= ']') { gotoCase = 122; continue; };
+ } else {
+ if (yych == '`') { gotoCase = 124; continue; };
+ if (yych <= 'z') { gotoCase = 122; continue; };
+ }
+ }
+ }
+case 124:
++cursor;
yych = this._charAt(cursor);
-case 120:
if (yych <= '\r') {
if (yych == '\n') { gotoCase = 66; continue; };
- if (yych <= '\f') { gotoCase = 119; continue; };
+ if (yych <= '\f') { gotoCase = 124; continue; };
{ gotoCase = 66; continue; };
} else {
if (yych <= '"') {
- if (yych <= '!') { gotoCase = 119; continue; };
- { gotoCase = 115; continue; };
+ if (yych <= '!') { gotoCase = 124; continue; };
+ { gotoCase = 121; continue; };
} else {
- if (yych != '\\') { gotoCase = 119; continue; };
+ if (yych != '\\') { gotoCase = 124; continue; };
}
}
+case 126:
++cursor;
yych = this._charAt(cursor);
if (yych <= 'a') {
@@ -1074,30 +1321,30 @@ case 120:
}
} else {
if (yych <= '\'') {
- if (yych <= '"') { gotoCase = 119; continue; };
+ if (yych <= '"') { gotoCase = 124; continue; };
if (yych <= '&') { gotoCase = 66; continue; };
- { gotoCase = 119; continue; };
+ { gotoCase = 124; continue; };
} else {
- if (yych == '\\') { gotoCase = 119; continue; };
+ if (yych == '\\') { gotoCase = 124; continue; };
{ gotoCase = 66; continue; };
}
}
} else {
if (yych <= 'q') {
if (yych <= 'f') {
- if (yych <= 'b') { gotoCase = 119; continue; };
+ if (yych <= 'b') { gotoCase = 124; continue; };
if (yych <= 'e') { gotoCase = 66; continue; };
- { gotoCase = 119; continue; };
+ { gotoCase = 124; continue; };
} else {
- if (yych == 'n') { gotoCase = 119; continue; };
+ if (yych == 'n') { gotoCase = 124; continue; };
{ gotoCase = 66; continue; };
}
} else {
if (yych <= 't') {
if (yych == 's') { gotoCase = 66; continue; };
- { gotoCase = 119; continue; };
+ { gotoCase = 124; continue; };
} else {
- if (yych == 'v') { gotoCase = 119; continue; };
+ if (yych == 'v') { gotoCase = 124; continue; };
{ gotoCase = 66; continue; };
}
}
@@ -1109,118 +1356,118 @@ case 120:
case this.case_SSTRING:
yych = this._charAt(cursor);
if (yych <= '\r') {
- if (yych == '\n') { gotoCase = 128; continue; };
- if (yych <= '\f') { gotoCase = 127; continue; };
- { gotoCase = 128; continue; };
+ if (yych == '\n') { gotoCase = 133; continue; };
+ if (yych <= '\f') { gotoCase = 132; continue; };
+ { gotoCase = 133; continue; };
} else {
if (yych <= '\'') {
- if (yych <= '&') { gotoCase = 127; continue; };
- { gotoCase = 130; continue; };
+ if (yych <= '&') { gotoCase = 132; continue; };
+ { gotoCase = 135; continue; };
} else {
- if (yych == '\\') { gotoCase = 132; continue; };
- { gotoCase = 127; continue; };
+ if (yych == '\\') { gotoCase = 137; continue; };
+ { gotoCase = 132; continue; };
}
}
-case 126:
+case 131:
{ return this._stringToken(cursor); }
-case 127:
+case 132:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
- { gotoCase = 134; continue; };
-case 128:
+ { gotoCase = 139; continue; };
+case 133:
++cursor;
-case 129:
+case 134:
{ this.tokenType = null; return cursor; }
-case 130:
+case 135:
++cursor;
-case 131:
+case 136:
this.setLexCondition(this._lexConditions.INITIAL);
{ return this._stringToken(cursor, true); }
-case 132:
+case 137:
yych = this._charAt(++cursor);
if (yych <= 'e') {
if (yych <= '\'') {
- if (yych == '"') { gotoCase = 133; continue; };
- if (yych <= '&') { gotoCase = 129; continue; };
+ if (yych == '"') { gotoCase = 138; continue; };
+ if (yych <= '&') { gotoCase = 134; continue; };
} else {
if (yych <= '\\') {
- if (yych <= '[') { gotoCase = 129; continue; };
+ if (yych <= '[') { gotoCase = 134; continue; };
} else {
- if (yych != 'b') { gotoCase = 129; continue; };
+ if (yych != 'b') { gotoCase = 134; continue; };
}
}
} else {
if (yych <= 'r') {
if (yych <= 'm') {
- if (yych >= 'g') { gotoCase = 129; continue; };
+ if (yych >= 'g') { gotoCase = 134; continue; };
} else {
- if (yych <= 'n') { gotoCase = 133; continue; };
- if (yych <= 'q') { gotoCase = 129; continue; };
+ if (yych <= 'n') { gotoCase = 138; continue; };
+ if (yych <= 'q') { gotoCase = 134; continue; };
}
} else {
if (yych <= 't') {
- if (yych <= 's') { gotoCase = 129; continue; };
+ if (yych <= 's') { gotoCase = 134; continue; };
} else {
- if (yych != 'v') { gotoCase = 129; continue; };
+ if (yych != 'v') { gotoCase = 134; continue; };
}
}
}
-case 133:
+case 138:
yyaccept = 0;
YYMARKER = ++cursor;
yych = this._charAt(cursor);
-case 134:
+case 139:
if (yych <= '\r') {
- if (yych == '\n') { gotoCase = 126; continue; };
- if (yych <= '\f') { gotoCase = 133; continue; };
- { gotoCase = 126; continue; };
+ if (yych == '\n') { gotoCase = 131; continue; };
+ if (yych <= '\f') { gotoCase = 138; continue; };
+ { gotoCase = 131; continue; };
} else {
if (yych <= '\'') {
- if (yych <= '&') { gotoCase = 133; continue; };
- { gotoCase = 137; continue; };
+ if (yych <= '&') { gotoCase = 138; continue; };
+ { gotoCase = 142; continue; };
} else {
- if (yych != '\\') { gotoCase = 133; continue; };
+ if (yych != '\\') { gotoCase = 138; continue; };
}
}
++cursor;
yych = this._charAt(cursor);
if (yych <= 'e') {
if (yych <= '\'') {
- if (yych == '"') { gotoCase = 133; continue; };
- if (yych >= '\'') { gotoCase = 133; continue; };
+ if (yych == '"') { gotoCase = 138; continue; };
+ if (yych >= '\'') { gotoCase = 138; continue; };
} else {
if (yych <= '\\') {
- if (yych >= '\\') { gotoCase = 133; continue; };
+ if (yych >= '\\') { gotoCase = 138; continue; };
} else {
- if (yych == 'b') { gotoCase = 133; continue; };
+ if (yych == 'b') { gotoCase = 138; continue; };
}
}
} else {
if (yych <= 'r') {
if (yych <= 'm') {
- if (yych <= 'f') { gotoCase = 133; continue; };
+ if (yych <= 'f') { gotoCase = 138; continue; };
} else {
- if (yych <= 'n') { gotoCase = 133; continue; };
- if (yych >= 'r') { gotoCase = 133; continue; };
+ if (yych <= 'n') { gotoCase = 138; continue; };
+ if (yych >= 'r') { gotoCase = 138; continue; };
}
} else {
if (yych <= 't') {
- if (yych >= 't') { gotoCase = 133; continue; };
+ if (yych >= 't') { gotoCase = 138; continue; };
} else {
- if (yych == 'v') { gotoCase = 133; continue; };
+ if (yych == 'v') { gotoCase = 138; continue; };
}
}
}
cursor = YYMARKER;
- { gotoCase = 126; continue; };
-case 137:
+ { gotoCase = 131; continue; };
+case 142:
++cursor;
yych = this._charAt(cursor);
- { gotoCase = 131; continue; };
+ { gotoCase = 136; continue; };
}
}
}
}
-WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
index 1e921ca..8d6c5f1 100644
--- a/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceCSSTokenizer.re2js
@@ -42,7 +42,7 @@
WebInspector.SourceCSSTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._propertyKeywords = [
"background", "background-attachment", "background-clip", "background-color", "background-image",
@@ -212,16 +212,13 @@ WebInspector.SourceCSSTokenizer.prototype = {
OpenCurlyBracket = "{";
CloseCurlyBracket = "}";
- OpenBracket = "(";
- CloseBracket = ")";
-
Colon = ":";
Semicolon = ";";
NumericLiteral = "-"? ([0-9]+ | [0-9]* "." [0-9]+) ("em" | "rem" | "__qem" | "ex" | "px" | "cm" |
"mm" | "in" | "pt" | "pc" | "deg" | "rad" | "grad" | "turn" | "ms" | "s" | "Hz" | "kHz" | "%")?;
- Identifier = [@!_\-$0-9a-zA-Z]+;
+ Identifier = [@!_\-$0-9a-zA-Z\[\]='"/]+;
DoubleStringContent = ([^\r\n\"\\] | "\\" ['"\\bfnrtv])*;
SingleStringContent = ([^\r\n\'\\] | "\\" ['"\\bfnrtv])*;
@@ -295,7 +292,9 @@ WebInspector.SourceCSSTokenizer.prototype = {
if (token === "@import" || token === "@media") {
this.tokenType = "css-at-rule";
this._parseCondition = this._parseConditions.AT_RULE;
- } else
+ } else if (token.indexOf("@") === 0)
+ this.tokenType = "css-at-rule";
+ else
this.tokenType = "css-selector";
}
else if (this._parseCondition === this._parseConditions.AT_RULE && token in this._mediaTypes)
@@ -316,4 +315,4 @@ WebInspector.SourceCSSTokenizer.prototype = {
}
}
-WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceCSSTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.js b/WebCore/inspector/front-end/SourceHTMLTokenizer.js
index 41664af..1212ffe 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 23:10:38 2010 */
+/* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
@@ -43,7 +43,7 @@
WebInspector.SourceHTMLTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._lexConditions = {
INITIAL: 0,
@@ -234,25 +234,31 @@ case 24:
/* *********************************** */
case this.case_INITIAL:
yych = this._charAt(cursor);
- if (yych <= '>') {
+ if (yych <= '=') {
if (yych <= '\'') {
if (yych == '"') { gotoCase = 29; continue; };
if (yych >= '\'') { gotoCase = 30; continue; };
} else {
- if (yych <= ';') { gotoCase = 27; continue; };
- if (yych <= '<') { gotoCase = 31; continue; };
- if (yych <= '=') { gotoCase = 33; continue; };
- { gotoCase = 35; continue; };
+ if (yych <= '9') {
+ if (yych >= '0') { gotoCase = 31; continue; };
+ } else {
+ if (yych <= ';') { gotoCase = 27; continue; };
+ if (yych <= '<') { gotoCase = 33; continue; };
+ { gotoCase = 35; continue; };
+ }
}
} else {
- if (yych <= '_') {
+ if (yych <= '^') {
+ if (yych <= '>') { gotoCase = 37; continue; };
if (yych <= '@') { gotoCase = 27; continue; };
- if (yych <= 'Z') { gotoCase = 37; continue; };
- if (yych >= '_') { gotoCase = 37; continue; };
+ if (yych <= 'Z') { gotoCase = 31; continue; };
} else {
- if (yych <= '`') { gotoCase = 27; continue; };
- if (yych <= 'z') { gotoCase = 37; continue; };
- if (yych >= 0x80) { gotoCase = 37; continue; };
+ if (yych <= '`') {
+ if (yych <= '_') { gotoCase = 31; continue; };
+ } else {
+ if (yych <= 'z') { gotoCase = 31; continue; };
+ if (yych >= 0x80) { gotoCase = 31; continue; };
+ }
}
}
case 27:
@@ -268,19 +274,43 @@ case 30:
yych = this._charAt(YYMARKER = ++cursor);
{ gotoCase = 76; continue; };
case 31:
+ ++cursor;
+ yych = this._charAt(cursor);
+ { gotoCase = 74; continue; };
+case 32:
+ {
+ if (this._parseCondition === this._parseConditions.SCRIPT) {
+ this.tokenType = null;
+ return cursor;
+ }
+
+ if (this._parseCondition === this._parseConditions.TAG) {
+ this.tokenType = "html-tag";
+ this._parseCondition = this._parseConditions.ATTRIBUTE;
+ } else if (this._isAttribute())
+ this.tokenType = "html-attr-name";
+ else if (this._isAttributeValue())
+ this.tokenType = "html-attr-value";
+ else if (this._parseCondition === this._parseConditions.DOCTYPE)
+ this.tokenType = "html-doctype";
+ else
+ this.tokenType = null;
+ return cursor;
+ }
+case 33:
yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
if (yych <= '/') {
- if (yych == '!') { gotoCase = 44; continue; };
- if (yych >= '/') { gotoCase = 41; continue; };
+ if (yych == '!') { gotoCase = 42; continue; };
+ if (yych >= '/') { gotoCase = 39; continue; };
} else {
if (yych <= 'S') {
- if (yych >= 'S') { gotoCase = 42; continue; };
+ if (yych >= 'S') { gotoCase = 40; continue; };
} else {
- if (yych == 's') { gotoCase = 42; continue; };
+ if (yych == 's') { gotoCase = 40; continue; };
}
}
-case 32:
+case 34:
{
if (this._parseCondition === this._parseConditions.SCRIPT) {
this.tokenType = null;
@@ -291,7 +321,7 @@ case 32:
this._parseCondition = this._parseConditions.TAG;
return cursor;
}
-case 33:
+case 35:
++cursor;
{
if (this._isAttribute()) {
@@ -303,7 +333,7 @@ case 33:
this.tokenType = null;
return cursor;
}
-case 35:
+case 37:
++cursor;
{
if (this._parseCondition === this._parseConditions.SCRIPT) {
@@ -322,179 +352,163 @@ case 35:
this._parseCondition = this._parseConditions.INITIAL;
return cursor;
}
-case 37:
- ++cursor;
- yych = this._charAt(cursor);
- { 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._isAttribute())
- this.tokenType = "html-attr-name";
- else if (this._isAttributeValue())
- this.tokenType = "html-attr-value";
- else if (this._parseCondition === this._parseConditions.DOCTYPE)
- this.tokenType = "html-doctype";
- else
- this.tokenType = null;
- return cursor;
- }
case 39:
- ++cursor;
- yych = this._charAt(cursor);
-case 40:
- if (yych <= '_') {
- if (yych <= '@') { gotoCase = 38; continue; };
- if (yych <= 'Z') { gotoCase = 39; continue; };
- if (yych <= '^') { gotoCase = 38; continue; };
- { gotoCase = 39; continue; };
- } else {
- if (yych <= '`') { gotoCase = 38; continue; };
- if (yych <= 'z') { gotoCase = 39; continue; };
- if (yych <= 0x7F) { gotoCase = 38; continue; };
- { gotoCase = 39; continue; };
- }
-case 41:
yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
- if (yych == 'S') { gotoCase = 68; continue; };
- if (yych == 's') { gotoCase = 68; continue; };
- { gotoCase = 32; continue; };
-case 42:
+ if (yych == 'S') { gotoCase = 66; continue; };
+ if (yych == 's') { gotoCase = 66; continue; };
+ { gotoCase = 34; continue; };
+case 40:
yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 62; continue; };
- if (yych == 'c') { gotoCase = 62; continue; };
-case 43:
+ if (yych == 'C') { gotoCase = 60; continue; };
+ if (yych == 'c') { gotoCase = 60; continue; };
+case 41:
cursor = YYMARKER;
if (yyaccept <= 0) {
{ gotoCase = 28; continue; };
} else {
- { gotoCase = 32; continue; };
+ { gotoCase = 34; continue; };
}
-case 44:
+case 42:
yych = this._charAt(++cursor);
if (yych <= 'C') {
- if (yych != '-') { gotoCase = 43; continue; };
+ if (yych != '-') { gotoCase = 41; continue; };
} else {
- if (yych <= 'D') { gotoCase = 46; continue; };
- if (yych == 'd') { gotoCase = 46; continue; };
- { gotoCase = 43; continue; };
+ if (yych <= 'D') { gotoCase = 44; continue; };
+ if (yych == 'd') { gotoCase = 44; continue; };
+ { gotoCase = 41; continue; };
}
yych = this._charAt(++cursor);
- if (yych == '-') { gotoCase = 54; continue; };
- { gotoCase = 43; continue; };
+ if (yych == '-') { gotoCase = 52; continue; };
+ { gotoCase = 41; continue; };
+case 44:
+ yych = this._charAt(++cursor);
+ if (yych == 'O') { gotoCase = 45; continue; };
+ if (yych != 'o') { gotoCase = 41; continue; };
+case 45:
+ yych = this._charAt(++cursor);
+ if (yych == 'C') { gotoCase = 46; continue; };
+ if (yych != 'c') { gotoCase = 41; continue; };
case 46:
yych = this._charAt(++cursor);
- if (yych == 'O') { gotoCase = 47; continue; };
- if (yych != 'o') { gotoCase = 43; continue; };
+ if (yych == 'T') { gotoCase = 47; continue; };
+ if (yych != 't') { gotoCase = 41; continue; };
case 47:
yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 48; continue; };
- if (yych != 'c') { gotoCase = 43; continue; };
+ if (yych == 'Y') { gotoCase = 48; continue; };
+ if (yych != 'y') { gotoCase = 41; continue; };
case 48:
yych = this._charAt(++cursor);
- if (yych == 'T') { gotoCase = 49; continue; };
- if (yych != 't') { gotoCase = 43; continue; };
+ if (yych == 'P') { gotoCase = 49; continue; };
+ if (yych != 'p') { gotoCase = 41; continue; };
case 49:
yych = this._charAt(++cursor);
- if (yych == 'Y') { gotoCase = 50; continue; };
- if (yych != 'y') { gotoCase = 43; continue; };
+ if (yych == 'E') { gotoCase = 50; continue; };
+ if (yych != 'e') { gotoCase = 41; continue; };
case 50:
- yych = this._charAt(++cursor);
- if (yych == 'P') { gotoCase = 51; continue; };
- if (yych != 'p') { gotoCase = 43; continue; };
-case 51:
- yych = this._charAt(++cursor);
- if (yych == 'E') { gotoCase = 52; continue; };
- if (yych != 'e') { gotoCase = 43; continue; };
-case 52:
++cursor;
{
this.tokenType = "html-doctype";
this._parseCondition = this._parseConditions.DOCTYPE;
return cursor;
}
-case 54:
+case 52:
++cursor;
yych = this._charAt(cursor);
if (yych <= '\f') {
- if (yych == '\n') { gotoCase = 57; continue; };
- { gotoCase = 54; continue; };
+ if (yych == '\n') { gotoCase = 55; continue; };
+ { gotoCase = 52; continue; };
} else {
- if (yych <= '\r') { gotoCase = 57; continue; };
- if (yych != '-') { gotoCase = 54; continue; };
+ if (yych <= '\r') { gotoCase = 55; continue; };
+ if (yych != '-') { gotoCase = 52; continue; };
}
++cursor;
yych = this._charAt(cursor);
- if (yych == '-') { gotoCase = 59; continue; };
- { gotoCase = 43; continue; };
-case 57:
+ if (yych == '-') { gotoCase = 57; continue; };
+ { gotoCase = 41; continue; };
+case 55:
++cursor;
this.setLexCondition(this._lexConditions.COMMENT);
{ this.tokenType = "html-comment"; return cursor; }
-case 59:
+case 57:
++cursor;
yych = this._charAt(cursor);
- if (yych != '>') { gotoCase = 54; continue; };
+ if (yych != '>') { gotoCase = 52; continue; };
++cursor;
{ this.tokenType = "html-comment"; return cursor; }
+case 60:
+ yych = this._charAt(++cursor);
+ if (yych == 'R') { gotoCase = 61; continue; };
+ if (yych != 'r') { gotoCase = 41; continue; };
+case 61:
+ yych = this._charAt(++cursor);
+ if (yych == 'I') { gotoCase = 62; continue; };
+ if (yych != 'i') { gotoCase = 41; continue; };
case 62:
yych = this._charAt(++cursor);
- if (yych == 'R') { gotoCase = 63; continue; };
- if (yych != 'r') { gotoCase = 43; continue; };
+ if (yych == 'P') { gotoCase = 63; continue; };
+ if (yych != 'p') { gotoCase = 41; continue; };
case 63:
yych = this._charAt(++cursor);
- if (yych == 'I') { gotoCase = 64; continue; };
- if (yych != 'i') { gotoCase = 43; continue; };
+ if (yych == 'T') { gotoCase = 64; continue; };
+ if (yych != 't') { gotoCase = 41; 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 66:
+ yych = this._charAt(++cursor);
+ if (yych == 'C') { gotoCase = 67; continue; };
+ if (yych != 'c') { gotoCase = 41; continue; };
+case 67:
+ yych = this._charAt(++cursor);
+ if (yych == 'R') { gotoCase = 68; continue; };
+ if (yych != 'r') { gotoCase = 41; continue; };
case 68:
yych = this._charAt(++cursor);
- if (yych == 'C') { gotoCase = 69; continue; };
- if (yych != 'c') { gotoCase = 43; continue; };
+ if (yych == 'I') { gotoCase = 69; continue; };
+ if (yych != 'i') { gotoCase = 41; continue; };
case 69:
yych = this._charAt(++cursor);
- if (yych == 'R') { gotoCase = 70; continue; };
- if (yych != 'r') { gotoCase = 43; continue; };
+ if (yych == 'P') { gotoCase = 70; continue; };
+ if (yych != 'p') { gotoCase = 41; continue; };
case 70:
yych = this._charAt(++cursor);
- if (yych == 'I') { gotoCase = 71; continue; };
- if (yych != 'i') { gotoCase = 43; continue; };
+ if (yych == 'T') { gotoCase = 71; continue; };
+ if (yych != 't') { gotoCase = 41; 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 73:
+ ++cursor;
+ yych = this._charAt(cursor);
+case 74:
+ if (yych <= '^') {
+ if (yych <= '9') {
+ if (yych <= '/') { gotoCase = 32; continue; };
+ { gotoCase = 73; continue; };
+ } else {
+ if (yych <= '@') { gotoCase = 32; continue; };
+ if (yych <= 'Z') { gotoCase = 73; continue; };
+ { gotoCase = 32; continue; };
+ }
+ } else {
+ if (yych <= '`') {
+ if (yych <= '_') { gotoCase = 73; continue; };
+ { gotoCase = 32; continue; };
+ } else {
+ if (yych <= 'z') { gotoCase = 73; continue; };
+ if (yych <= 0x7F) { gotoCase = 32; continue; };
+ { gotoCase = 73; continue; };
+ }
+ }
case 75:
++cursor;
yych = this._charAt(cursor);
@@ -573,4 +587,4 @@ case 95:
}
}
-WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
index 55d41a2..e56f3ff 100644
--- a/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
@@ -42,7 +42,7 @@
WebInspector.SourceHTMLTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._lexConditions = {
INITIAL: 0,
@@ -150,7 +150,7 @@ WebInspector.SourceHTMLTokenizer.prototype = {
SingleStringStart = "'" SingleStringContent [\r\n];
SingleStringEnd = SingleStringContent "'";
- Identifier = [_a-zA-Z\x80-\xFF]+;
+ Identifier = [_a-zA-Z0-9\x80-\xFF]+;
<INITIAL> Comment { this.tokenType = "html-comment"; return cursor; }
<INITIAL> CommentStart => COMMENT { this.tokenType = "html-comment"; return cursor; }
@@ -255,4 +255,4 @@ WebInspector.SourceHTMLTokenizer.prototype = {
}
}
-WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceHTMLTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
index 0c86acd..816023f 100644
--- a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.js
+++ b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.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 Thu Jan 28 20:49:23 2010 */
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
*
@@ -43,7 +43,7 @@
WebInspector.SourceJavaScriptTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._keywords = [
"null", "true", "false", "break", "case", "catch", "const", "default", "finally", "for",
@@ -117,7 +117,7 @@ case this.case_COMMENT:
{ gotoCase = 3; continue; };
}
case 2:
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 3:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
@@ -133,7 +133,7 @@ case 6:
case 7:
++cursor;
this.setLexCondition(this._lexConditions.NODIV);
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 9:
++cursor;
yych = this._charAt(cursor);
@@ -247,9 +247,9 @@ case 21:
{
var token = this._line.substring(cursorOnEnter, cursor);
if (token in this._keywords)
- this.tokenType = "js-keyword";
+ this.tokenType = "javascript-keyword";
else
- this.tokenType = null;
+ this.tokenType = "javascript-ident";
return cursor;
}
case 22:
@@ -323,7 +323,7 @@ case 34:
}
}
case 35:
- { this.tokenType = "js-number"; return cursor; }
+ { this.tokenType = "javascript-number"; return cursor; }
case 36:
yyaccept = 3;
yych = this._charAt(YYMARKER = ++cursor);
@@ -636,7 +636,7 @@ case 80:
if (yych == '\n') { gotoCase = 82; continue; };
if (yych != '\r') { gotoCase = 80; continue; };
case 82:
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 83:
++cursor;
yych = this._charAt(cursor);
@@ -646,10 +646,10 @@ case 83:
case 85:
++cursor;
this.setLexCondition(this._lexConditions.COMMENT);
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 87:
++cursor;
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 89:
yyaccept = 3;
YYMARKER = ++cursor;
@@ -742,7 +742,7 @@ case 96:
}
case 98:
++cursor;
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 100:
++cursor;
yych = this._charAt(cursor);
@@ -759,7 +759,7 @@ case 100:
case 101:
++cursor;
this.setLexCondition(this._lexConditions.SSTRING);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 103:
++cursor;
yych = this._charAt(cursor);
@@ -869,7 +869,7 @@ case 109:
case 110:
++cursor;
this.setLexCondition(this._lexConditions.DSTRING);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 112:
++cursor;
yych = this._charAt(cursor);
@@ -926,7 +926,7 @@ case this.case_DSTRING:
}
}
case 118:
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 119:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
@@ -939,7 +939,7 @@ case 122:
++cursor;
case 123:
this.setLexCondition(this._lexConditions.NODIV);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 124:
yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
@@ -1179,9 +1179,9 @@ case 142:
{
var token = this._line.substring(cursorOnEnter, cursor);
if (token in this._keywords)
- this.tokenType = "js-keyword";
+ this.tokenType = "javascript-keyword";
else
- this.tokenType = null;
+ this.tokenType = "javascript-ident";
return cursor;
}
case 143:
@@ -1268,7 +1268,7 @@ case 154:
}
case 155:
this.setLexCondition(this._lexConditions.DIV);
- { this.tokenType = "js-number"; return cursor; }
+ { this.tokenType = "javascript-number"; return cursor; }
case 156:
yyaccept = 2;
yych = this._charAt(YYMARKER = ++cursor);
@@ -1627,7 +1627,7 @@ case 204:
if (yych == '\n') { gotoCase = 206; continue; };
if (yych != '\r') { gotoCase = 204; continue; };
case 206:
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 207:
++cursor;
yych = this._charAt(cursor);
@@ -1637,10 +1637,10 @@ case 207:
case 209:
++cursor;
this.setLexCondition(this._lexConditions.COMMENT);
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 211:
++cursor;
- { this.tokenType = "js-comment"; return cursor; }
+ { this.tokenType = "javascript-comment"; return cursor; }
case 213:
++cursor;
yych = this._charAt(cursor);
@@ -1677,7 +1677,7 @@ case 216:
if (yych != '\r') { gotoCase = 213; continue; };
case 217:
this.setLexCondition(this._lexConditions.REGEX);
- { this.tokenType = "js-regex"; return cursor; }
+ { this.tokenType = "javascript-regexp"; return cursor; }
case 218:
++cursor;
yych = this._charAt(cursor);
@@ -1709,7 +1709,7 @@ case 220:
if (yych <= 'i') { gotoCase = 220; continue; };
if (yych == 'm') { gotoCase = 220; continue; };
}
- { this.tokenType = "js-regex"; return cursor; }
+ { this.tokenType = "javascript-regexp"; return cursor; }
case 223:
++cursor;
yych = this._charAt(cursor);
@@ -1900,7 +1900,7 @@ case 241:
}
case 243:
++cursor;
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 245:
++cursor;
yych = this._charAt(cursor);
@@ -1917,7 +1917,7 @@ case 245:
case 246:
++cursor;
this.setLexCondition(this._lexConditions.SSTRING);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 248:
++cursor;
yych = this._charAt(cursor);
@@ -2027,7 +2027,7 @@ case 254:
case 255:
++cursor;
this.setLexCondition(this._lexConditions.DSTRING);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 257:
++cursor;
yych = this._charAt(cursor);
@@ -2090,7 +2090,7 @@ case this.case_REGEX:
}
}
case 263:
- { this.tokenType = "js-regex"; return cursor; }
+ { this.tokenType = "javascript-regexp"; return cursor; }
case 264:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
@@ -2105,7 +2105,7 @@ case 267:
{ gotoCase = 278; continue; };
case 268:
this.setLexCondition(this._lexConditions.NODIV);
- { this.tokenType = "js-regex"; return cursor; }
+ { this.tokenType = "javascript-regexp"; return cursor; }
case 269:
yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
@@ -2249,7 +2249,7 @@ case this.case_SSTRING:
}
}
case 285:
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 286:
yyaccept = 0;
yych = this._charAt(YYMARKER = ++cursor);
@@ -2262,7 +2262,7 @@ case 289:
++cursor;
case 290:
this.setLexCondition(this._lexConditions.NODIV);
- { this.tokenType = "js-string"; return cursor; }
+ { this.tokenType = "javascript-string"; return cursor; }
case 291:
yyaccept = 1;
yych = this._charAt(YYMARKER = ++cursor);
@@ -2413,4 +2413,4 @@ case 300:
}
}
-WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
index d3e1795..8630ccb 100644
--- a/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
+++ b/WebCore/inspector/front-end/SourceJavaScriptTokenizer.re2js
@@ -42,7 +42,7 @@
WebInspector.SourceJavaScriptTokenizer = function()
{
- WebInspector.TextEditorHighlighter.Tokenizer.call(this);
+ WebInspector.SourceTokenizer.call(this);
this._keywords = [
"null", "true", "false", "break", "case", "catch", "const", "default", "finally", "for",
@@ -136,33 +136,33 @@ WebInspector.SourceJavaScriptTokenizer.prototype = {
RegexStart = "/" RegexFirstChar RegexContent "\\";
RegexEnd = RegexContent "/" [igm]*;
- <DIV,NODIV> LineComment { this.tokenType = "js-comment"; return cursor; }
- <DIV,NODIV> Comment { this.tokenType = "js-comment"; return cursor; }
- <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "js-comment"; return cursor; }
- <COMMENT> CommentContent => COMMENT { this.tokenType = "js-comment"; return cursor; }
- <COMMENT> CommentEnd => NODIV { this.tokenType = "js-comment"; return cursor; }
-
- <DIV,NODIV> StringLiteral { this.tokenType = "js-string"; return cursor; }
- <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "js-string"; return cursor; }
- <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "js-string"; return cursor; }
- <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "js-string"; return cursor; }
- <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "js-string"; return cursor; }
- <SSTRING> SingleStringContent => SSTRING { this.tokenType = "js-string"; return cursor; }
- <SSTRING> SingleStringEnd => NODIV { this.tokenType = "js-string"; return cursor; }
-
- <NODIV> Regex { this.tokenType = "js-regex"; return cursor; }
- <NODIV> RegexStart => REGEX { this.tokenType = "js-regex"; return cursor; }
- <REGEX> RegexContent => REGEX { this.tokenType = "js-regex"; return cursor; }
- <REGEX> RegexEnd => NODIV { this.tokenType = "js-regex"; return cursor; }
-
- <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "js-number"; return cursor; }
+ <DIV,NODIV> LineComment { this.tokenType = "javascript-comment"; return cursor; }
+ <DIV,NODIV> Comment { this.tokenType = "javascript-comment"; return cursor; }
+ <DIV,NODIV> CommentStart => COMMENT { this.tokenType = "javascript-comment"; return cursor; }
+ <COMMENT> CommentContent => COMMENT { this.tokenType = "javascript-comment"; return cursor; }
+ <COMMENT> CommentEnd => NODIV { this.tokenType = "javascript-comment"; return cursor; }
+
+ <DIV,NODIV> StringLiteral { this.tokenType = "javascript-string"; return cursor; }
+ <DIV,NODIV> DoubleStringStart => DSTRING { this.tokenType = "javascript-string"; return cursor; }
+ <DSTRING> DoubleStringContent => DSTRING { this.tokenType = "javascript-string"; return cursor; }
+ <DSTRING> DoubleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; }
+ <DIV,NODIV> SingleStringStart => SSTRING { this.tokenType = "javascript-string"; return cursor; }
+ <SSTRING> SingleStringContent => SSTRING { this.tokenType = "javascript-string"; return cursor; }
+ <SSTRING> SingleStringEnd => NODIV { this.tokenType = "javascript-string"; return cursor; }
+
+ <NODIV> Regex { this.tokenType = "javascript-regexp"; return cursor; }
+ <NODIV> RegexStart => REGEX { this.tokenType = "javascript-regexp"; return cursor; }
+ <REGEX> RegexContent => REGEX { this.tokenType = "javascript-regexp"; return cursor; }
+ <REGEX> RegexEnd => NODIV { this.tokenType = "javascript-regexp"; return cursor; }
+
+ <DIV,NODIV> NumericLiteral => DIV { this.tokenType = "javascript-number"; return cursor; }
<DIV,NODIV> Identifier => DIV
{
var token = this._line.substring(cursorOnEnter, cursor);
if (token in this._keywords)
- this.tokenType = "js-keyword";
+ this.tokenType = "javascript-keyword";
else
- this.tokenType = null;
+ this.tokenType = "javascript-ident";
return cursor;
}
<DIV,NODIV> RightParen => DIV { this.tokenType = null; return cursor; }
@@ -174,4 +174,4 @@ WebInspector.SourceJavaScriptTokenizer.prototype = {
}
}
-WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.TextEditorHighlighter.Tokenizer.prototype;
+WebInspector.SourceJavaScriptTokenizer.prototype.__proto__ = WebInspector.SourceTokenizer.prototype;
diff --git a/WebCore/inspector/front-end/SourceSyntaxHighlighter.js b/WebCore/inspector/front-end/SourceSyntaxHighlighter.js
deleted file mode 100644
index e3c91c6..0000000
--- a/WebCore/inspector/front-end/SourceSyntaxHighlighter.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2009 Joseph Pecoraro
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-WebInspector.SourceSyntaxHighlighter = function(table, sourceFrame)
-{
- this.table = table;
- this.sourceFrame = sourceFrame;
-}
-
-WebInspector.SourceSyntaxHighlighter.prototype = {
- createSpan: function(content, className)
- {
- var span = document.createElement("span");
- span.className = className;
- span.appendChild(document.createTextNode(content));
- return span;
- },
-
- process: function()
- {
- // Split up the work into chunks so we don't block the
- // UI thread while processing.
-
- var rows = this.table.rows;
- var rowsLength = rows.length;
- const tokensPerChunk = 100;
- const lineLengthLimit = 20000;
-
- var boundProcessChunk = processChunk.bind(this);
- var processChunkInterval = setInterval(boundProcessChunk, 25);
- boundProcessChunk();
-
- function processChunk()
- {
- for (var i = 0; i < tokensPerChunk; i++) {
- if (this.cursor >= this.lineCode.length)
- moveToNextLine.call(this);
- if (this.lineIndex >= rowsLength) {
- this.sourceFrame.dispatchEventToListeners("syntax highlighting complete");
- return;
- }
- if (this.cursor > lineLengthLimit) {
- var codeFragment = this.lineCode.substring(this.cursor);
- this.nonToken += codeFragment;
- this.cursor += codeFragment.length;
- }
-
- this.lex();
- }
- }
-
- function moveToNextLine()
- {
- this.appendNonToken();
-
- var row = rows[this.lineIndex];
- var line = row ? row.cells[1] : null;
- if (line && this.newLine) {
- line.removeChildren();
-
- if (this.messageBubble)
- this.newLine.appendChild(this.messageBubble);
-
- line.parentNode.insertBefore(this.newLine, line);
- line.parentNode.removeChild(line);
-
- this.newLine = null;
- }
- this.lineIndex++;
- if (this.lineIndex >= rowsLength && processChunkInterval) {
- clearInterval(processChunkInterval);
- this.sourceFrame.dispatchEventToListeners("syntax highlighting complete");
- return;
- }
- row = rows[this.lineIndex];
- line = row ? row.cells[1] : null;
-
- this.messageBubble = null;
- if (line.lastChild && line.lastChild.nodeType === Node.ELEMENT_NODE && line.lastChild.hasStyleClass("webkit-html-message-bubble")) {
- this.messageBubble = line.lastChild;
- line.removeChild(this.messageBubble);
- }
-
- this.lineCode = line.textContent;
- this.newLine = line.cloneNode(false);
- this.cursor = 0;
- if (!line)
- moveToNextLine();
- }
- },
-
- lex: function()
- {
- var token = null;
- var codeFragment = this.lineCode.substring(this.cursor);
-
- for (var i = 0; i < this.rules.length; i++) {
- var rule = this.rules[i];
- var ruleContinueStateCondition = ("preContinueState" in rule) ? rule.preContinueState : this.ContinueState.None;
- if (this.continueState !== ruleContinueStateCondition)
- continue;
- if (("preLexState" in rule) && this.lexState !== rule.preLexState)
- continue;
-
- var match = rule.pattern.exec(codeFragment);
- if (match) {
- token = match[0];
- if (token && (!rule.keywords || (token in rule.keywords))) {
- this.cursor += token.length;
- if (rule.style) {
- this.appendNonToken();
- var elem = this.createSpan(token, rule.style);
- this.newLine.appendChild(elem);
- if (rule.callback)
- rule.callback.call(this, elem);
- } else
- this.nonToken += token;
-
- if ("postLexState" in rule)
- this.lexState = rule.postLexState;
- if ("postContinueState" in rule)
- this.continueState = rule.postContinueState;
- return;
- }
- }
- }
- this.nonToken += codeFragment[0];
- this.cursor++;
- },
-
- appendNonToken: function ()
- {
- if (this.nonToken.length > 0) {
- this.newLine.appendChild(document.createTextNode(this.nonToken));
- this.nonToken = "";
- }
- },
-
- syntaxHighlightNode: function(node)
- {
- this.lineCode = node.textContent;
- node.removeChildren();
- this.newLine = node;
- this.cursor = 0;
- while (true) {
- if (this.cursor >= this.lineCode.length) {
- var codeFragment = this.lineCode.substring(this.cursor);
- this.nonToken += codeFragment;
- this.cursor += codeFragment.length;
- this.appendNonToken();
- this.newLine = null;
- return;
- }
-
- this.lex();
- }
- }
-}
diff --git a/WebCore/inspector/front-end/SourceTokenizer.js b/WebCore/inspector/front-end/SourceTokenizer.js
new file mode 100644
index 0000000..1192383
--- /dev/null
+++ b/WebCore/inspector/front-end/SourceTokenizer.js
@@ -0,0 +1,103 @@
+/* Generated by re2c 0.13.5 on Tue Jan 26 01:16:33 2010 */
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+WebInspector.SourceTokenizer = function()
+{
+}
+
+WebInspector.SourceTokenizer.prototype = {
+ set line(line) {
+ this._line = line;
+ },
+
+ set condition(condition)
+ {
+ this._lexCondition = condition.lexCondition;
+ this._parseCondition = condition.parseCondition;
+ },
+
+ get condition()
+ {
+ return { lexCondition: this._lexCondition, parseCondition: this._parseCondition };
+ },
+
+ hasCondition: function(condition)
+ {
+ return this._lexCondition === condition.lexCondition && this._parseCondition === condition.parseCondition;
+ },
+
+ getLexCondition: function()
+ {
+ return this._lexCondition;
+ },
+
+ setLexCondition: function(lexCondition)
+ {
+ this._lexCondition = lexCondition;
+ },
+
+ _charAt: function(cursor)
+ {
+ return cursor < this._line.length ? this._line.charAt(cursor) : "\n";
+ }
+}
+
+
+WebInspector.SourceTokenizer.Registry = function() {
+ this._tokenizers = {};
+ this._tokenizerConstructors = {
+ "text/css": WebInspector.SourceCSSTokenizer,
+ "text/html": WebInspector.SourceHTMLTokenizer,
+ "text/javascript": WebInspector.SourceJavaScriptTokenizer,
+ "application/x-javascript": WebInspector.SourceJavaScriptTokenizer
+ };
+}
+
+WebInspector.SourceTokenizer.Registry.getInstance = function()
+{
+ if (!WebInspector.SourceTokenizer.Registry._instance)
+ WebInspector.SourceTokenizer.Registry._instance = new WebInspector.SourceTokenizer.Registry();
+ return WebInspector.SourceTokenizer.Registry._instance;
+}
+
+WebInspector.SourceTokenizer.Registry.prototype = {
+ getTokenizer: function(mimeType)
+ {
+ if (!this._tokenizerConstructors[mimeType])
+ return null;
+ var tokenizer = this._tokenizers[mimeType];
+ if (!tokenizer) {
+ tokenizer = new this._tokenizerConstructors[mimeType]();
+ this._tokenizers[mimeType] = tokenizer;
+ }
+ return tokenizer;
+ }
+}
diff --git a/WebCore/inspector/front-end/TextEditorHighlighter.js b/WebCore/inspector/front-end/TextEditorHighlighter.js
index 853b666..8097302 100644
--- a/WebCore/inspector/front-end/TextEditorHighlighter.js
+++ b/WebCore/inspector/front-end/TextEditorHighlighter.js
@@ -52,19 +52,11 @@ WebInspector.TextEditorHighlighter = function(textModel, damageCallback)
this._styles["html-comment"] = "rgb(35, 110, 37)";
this._styles["html-doctype"] = "rgb(192, 192, 192)";
- this._styles["js-comment"] = "rgb(0, 116, 0)";
- this._styles["js-string"] = "rgb(196, 26, 22)";
- this._styles["js-regex"] = "rgb(196, 26, 22)";
- this._styles["js-keyword"] = "rgb(170, 13, 145)";
- this._styles["js-number"] = "rgb(28, 0, 207)";
-
- this._tokenizers = {};
- this._tokenizerConstructors = {
- "text/css": WebInspector.SourceCSSTokenizer,
- "text/html": WebInspector.SourceHTMLTokenizer,
- "text/javascript": WebInspector.SourceJavaScriptTokenizer,
- "application/x-javascript": WebInspector.SourceJavaScriptTokenizer
- };
+ this._styles["javascript-comment"] = "rgb(0, 116, 0)";
+ this._styles["javascript-string"] = "rgb(196, 26, 22)";
+ this._styles["javascript-regexp"] = "rgb(196, 26, 22)";
+ this._styles["javascript-keyword"] = "rgb(170, 13, 145)";
+ this._styles["javascript-number"] = "rgb(28, 0, 207)";
this.mimeType = "text/html";
this._damageCallback = damageCallback;
@@ -73,13 +65,9 @@ WebInspector.TextEditorHighlighter = function(textModel, damageCallback)
WebInspector.TextEditorHighlighter.prototype = {
set mimeType(mimeType)
{
- if (!this._tokenizerConstructors[mimeType])
- return;
- this._tokenizer = this._tokenizers[mimeType];
- if (!this._tokenizer) {
- this._tokenizer = new this._tokenizerConstructors[mimeType]();
- this._tokenizers[mimeType] = this._tokenizer;
- }
+ var tokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer(mimeType);
+ if (tokenizer)
+ this._tokenizer = tokenizer;
},
highlight: function(endLine)
@@ -205,44 +193,3 @@ WebInspector.TextEditorHighlighter.prototype = {
} while (column < line.length)
}
}
-
-WebInspector.TextEditorHighlighter.Tokenizer = function()
-{
-}
-
-WebInspector.TextEditorHighlighter.Tokenizer.prototype = {
- set line(line) {
- this._line = line;
- },
-
- set condition(condition)
- {
- this._lexCondition = condition.lexCondition;
- this._parseCondition = condition.parseCondition;
- },
-
- get condition()
- {
- return { lexCondition: this._lexCondition, parseCondition: this._parseCondition };
- },
-
- hasCondition: function(condition)
- {
- return this._lexCondition === condition.lexCondition && this._parseCondition === condition.parseCondition;
- },
-
- getLexCondition: function()
- {
- return this._lexCondition;
- },
-
- setLexCondition: function(lexCondition)
- {
- this._lexCondition = lexCondition;
- },
-
- _charAt: function(cursor)
- {
- return cursor < this._line.length ? this._line.charAt(cursor) : "\n";
- }
-}
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index 363bb99..1d37d36 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -16,7 +16,6 @@
<file>ConsoleView.js</file>
<file>ContextMenu.js</file>
<file>CookieItemsView.js</file>
- <file>CSSSourceSyntaxHighlighter.js</file>
<file>Database.js</file>
<file>DatabaseQueryView.js</file>
<file>DatabaseTableView.js</file>
@@ -24,6 +23,7 @@
<file>DOMAgent.js</file>
<file>DOMStorage.js</file>
<file>DOMStorageItemsView.js</file>
+ <file>DOMSyntaxHighlighter.js</file>
<file>Drawer.js</file>
<file>ElementsPanel.js</file>
<file>ElementsTreeOutline.js</file>
@@ -35,7 +35,6 @@
<file>inspector.js</file>
<file>InspectorBackendStub.js</file>
<file>InspectorFrontendHostStub.js</file>
- <file>JavaScriptSourceSyntaxHighlighter.js</file>
<file>KeyboardShortcut.js</file>
<file>MetricsSidebarPane.js</file>
<file>Object.js</file>
@@ -66,7 +65,7 @@
<file>SourceFrame.js</file>
<file>SourceHTMLTokenizer.js</file>
<file>SourceJavaScriptTokenizer.js</file>
- <file>SourceSyntaxHighlighter.js</file>
+ <file>SourceTokenizer.js</file>
<file>SourceView.js</file>
<file>StatusBarButton.js</file>
<file>StoragePanel.js</file>
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index e66dc6b..1e2082c 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -93,12 +93,11 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="AuditLauncherView.js"></script>
<script type="text/javascript" src="ResourceView.js"></script>
<script type="text/javascript" src="SourceFrame.js"></script>
- <script type="text/javascript" src="SourceSyntaxHighlighter.js"></script>
- <script type="text/javascript" src="CSSSourceSyntaxHighlighter.js"></script>
- <script type="text/javascript" src="JavaScriptSourceSyntaxHighlighter.js"></script>
+ <script type="text/javascript" src="DOMSyntaxHighlighter.js"></script>
<script type="text/javascript" src="TextEditorModel.js"></script>
<script type="text/javascript" src="TextEditor.js"></script>
<script type="text/javascript" src="TextEditorHighlighter.js"></script>
+ <script type="text/javascript" src="SourceTokenizer.js"></script>
<script type="text/javascript" src="SourceCSSTokenizer.js"></script>
<script type="text/javascript" src="SourceHTMLTokenizer.js"></script>
<script type="text/javascript" src="SourceJavaScriptTokenizer.js"></script>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list