Changeset 76943 in webkit


Ignore:
Timestamp:
Jan 28, 2011 7:48:00 AM (13 years ago)
Author:
apavlov@chromium.org
Message:

2011-01-28 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Yury Semikhatsky.

Web Inspector: syntax highlight inline JS and CSS in HTML resources
https://bugs.webkit.org/show_bug.cgi?id=30831

  • inspector/front-end/SourceHTMLTokenizer.js: (WebInspector.SourceHTMLTokenizer): (WebInspector.SourceHTMLTokenizer.prototype.set line): (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
  • inspector/front-end/SourceHTMLTokenizer.re2js:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76941 r76943  
     12011-01-28  Alexander Pavlov  <apavlov@chromium.org>
     2
     3        Reviewed by Yury Semikhatsky.
     4
     5        Web Inspector: syntax highlight inline JS and CSS in HTML resources
     6        https://bugs.webkit.org/show_bug.cgi?id=30831
     7
     8        * inspector/front-end/SourceHTMLTokenizer.js:
     9        (WebInspector.SourceHTMLTokenizer):
     10        (WebInspector.SourceHTMLTokenizer.prototype.set line):
     11        (WebInspector.SourceHTMLTokenizer.prototype.nextToken):
     12        * inspector/front-end/SourceHTMLTokenizer.re2js:
     13
    1142011-01-28  Alexander Pavlov  <apavlov@chromium.org>
    215
  • trunk/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.js

    r55248 r76943  
    1 /* Generated by re2c 0.13.5 on Thu Feb 25 21:44:55 2010 */
     1/* Generated by re2c 0.13.5 on Fri Jan 28 18:32:27 2011 */
    22/*
    33 * Copyright (C) 2009 Google Inc. All rights reserved.
     
    6868        LINKIFY: 4,
    6969        A_NODE: 8,
    70         SCRIPT: 16
     70        SCRIPT: 16,
     71        STYLE: 32
    7172    };
    7273
     
    8384            } else
    8485                this._internalJavaScriptTokenizer.line = line;
     86        } else if (this._internalCSSTokenizer) {
     87            var match = /<\/style/i.exec(line);
     88            if (match) {
     89                this._internalCSSTokenizer.line = line.substring(0, match.index);
     90            } else
     91                this._internalCSSTokenizer.line = line;
    8592        }
    8693        this._line = line;
     
    147154            } else if (cursor !== this._line.length)
    148155                delete this._internalJavaScriptTokenizer;
     156        } else if (this._internalCSSTokenizer) {
     157            // Re-set line to force </style> detection first.
     158            this.line = this._line;
     159            if (cursor !== this._internalCSSTokenizer._line.length) {
     160                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.
     161                this._internalCSSTokenizer.condition = this._condition.internalCSSTokenizerCondition;
     162                var result = this._internalCSSTokenizer.nextToken(cursor);
     163                this.tokenType = this._internalCSSTokenizer.tokenType;
     164                this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.condition;
     165                return result;
     166            } else if (cursor !== this._line.length)
     167                delete this._internalCSSTokenizer;
    149168        }
    150169
     
    332351            this.setLexCondition(this._lexConditions.TAG);
    333352            {
    334                     if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
    335                         // Do not tokenize script tag contents, keep lexer state although processing "<".
     353                    if (this._condition.parseCondition & (this._parseConditions.SCRIPT | this._parseConditions.STYLE)) {
     354                        // Do not tokenize script and style tag contents, keep lexer state, even though processing "<".
    336355                        this.setLexCondition(this._lexConditions.INITIAL);
    337356                        this.tokenType = null;
     
    346365            yyaccept = 0;
    347366            yych = this._charAt(YYMARKER = ++cursor);
    348             if (yych == 'S') { gotoCase = 68; continue; };
    349             if (yych == 's') { gotoCase = 68; continue; };
     367            if (yych == 'S') { gotoCase = 73; continue; };
     368            if (yych == 's') { gotoCase = 73; continue; };
    350369            { gotoCase = 40; continue; };
    351370case 42:
    352371            yych = this._charAt(++cursor);
    353             if (yych == 'C') { gotoCase = 62; continue; };
    354             if (yych == 'c') { gotoCase = 62; continue; };
     372            if (yych <= 'T') {
     373                if (yych == 'C') { gotoCase = 62; continue; };
     374                if (yych >= 'T') { gotoCase = 63; continue; };
     375            } else {
     376                if (yych <= 'c') {
     377                    if (yych >= 'c') { gotoCase = 62; continue; };
     378                } else {
     379                    if (yych == 't') { gotoCase = 63; continue; };
     380                }
     381            }
    355382case 43:
    356383            cursor = YYMARKER;
     
    422449case 62:
    423450            yych = this._charAt(++cursor);
    424             if (yych == 'R') { gotoCase = 63; continue; };
    425             if (yych != 'r') { gotoCase = 43; continue; };
     451            if (yych == 'R') { gotoCase = 68; continue; };
     452            if (yych == 'r') { gotoCase = 68; continue; };
     453            { gotoCase = 43; continue; };
    426454case 63:
    427455            yych = this._charAt(++cursor);
    428             if (yych == 'I') { gotoCase = 64; continue; };
     456            if (yych == 'Y') { gotoCase = 64; continue; };
     457            if (yych != 'y') { gotoCase = 43; continue; };
     458case 64:
     459            yych = this._charAt(++cursor);
     460            if (yych == 'L') { gotoCase = 65; continue; };
     461            if (yych != 'l') { gotoCase = 43; continue; };
     462case 65:
     463            yych = this._charAt(++cursor);
     464            if (yych == 'E') { gotoCase = 66; continue; };
     465            if (yych != 'e') { gotoCase = 43; continue; };
     466case 66:
     467            ++cursor;
     468            this.setLexCondition(this._lexConditions.TAG);
     469            {
     470                    if (this._condition.parseCondition & this._parseConditions.STYLE) {
     471                        // Do not tokenize style tag contents, keep lexer state, even though processing "<".
     472                        this.setLexCondition(this._lexConditions.INITIAL);
     473                        this.tokenType = null;
     474                        return cursor;
     475                    }
     476                    this.tokenType = "html-tag";
     477                    this._condition.parseCondition = this._parseConditions.STYLE;
     478                    this._setExpectingAttribute();
     479                    return cursor;
     480                }
     481case 68:
     482            yych = this._charAt(++cursor);
     483            if (yych == 'I') { gotoCase = 69; continue; };
    429484            if (yych != 'i') { gotoCase = 43; continue; };
    430 case 64:
    431             yych = this._charAt(++cursor);
    432             if (yych == 'P') { gotoCase = 65; continue; };
     485case 69:
     486            yych = this._charAt(++cursor);
     487            if (yych == 'P') { gotoCase = 70; continue; };
    433488            if (yych != 'p') { gotoCase = 43; continue; };
    434 case 65:
    435             yych = this._charAt(++cursor);
    436             if (yych == 'T') { gotoCase = 66; continue; };
     489case 70:
     490            yych = this._charAt(++cursor);
     491            if (yych == 'T') { gotoCase = 71; continue; };
    437492            if (yych != 't') { gotoCase = 43; continue; };
    438 case 66:
     493case 71:
    439494            ++cursor;
    440495            this.setLexCondition(this._lexConditions.TAG);
    441496            {
    442497                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
    443                         // Do not tokenize script tag contents, keep lexer state although processing "<".
     498                        // Do not tokenize script tag contents, keep lexer state, even though processing "<".
    444499                        this.setLexCondition(this._lexConditions.INITIAL);
    445500                        this.tokenType = null;
     
    451506                    return cursor;
    452507                }
    453 case 68:
    454             yych = this._charAt(++cursor);
    455             if (yych == 'C') { gotoCase = 69; continue; };
    456             if (yych != 'c') { gotoCase = 43; continue; };
    457 case 69:
    458             yych = this._charAt(++cursor);
    459             if (yych == 'R') { gotoCase = 70; continue; };
     508case 73:
     509            yych = this._charAt(++cursor);
     510            if (yych <= 'T') {
     511                if (yych == 'C') { gotoCase = 75; continue; };
     512                if (yych <= 'S') { gotoCase = 43; continue; };
     513            } else {
     514                if (yych <= 'c') {
     515                    if (yych <= 'b') { gotoCase = 43; continue; };
     516                    { gotoCase = 75; continue; };
     517                } else {
     518                    if (yych != 't') { gotoCase = 43; continue; };
     519                }
     520            }
     521            yych = this._charAt(++cursor);
     522            if (yych == 'Y') { gotoCase = 81; continue; };
     523            if (yych == 'y') { gotoCase = 81; continue; };
     524            { gotoCase = 43; continue; };
     525case 75:
     526            yych = this._charAt(++cursor);
     527            if (yych == 'R') { gotoCase = 76; continue; };
    460528            if (yych != 'r') { gotoCase = 43; continue; };
    461 case 70:
    462             yych = this._charAt(++cursor);
    463             if (yych == 'I') { gotoCase = 71; continue; };
     529case 76:
     530            yych = this._charAt(++cursor);
     531            if (yych == 'I') { gotoCase = 77; continue; };
    464532            if (yych != 'i') { gotoCase = 43; continue; };
    465 case 71:
    466             yych = this._charAt(++cursor);
    467             if (yych == 'P') { gotoCase = 72; continue; };
     533case 77:
     534            yych = this._charAt(++cursor);
     535            if (yych == 'P') { gotoCase = 78; continue; };
    468536            if (yych != 'p') { gotoCase = 43; continue; };
    469 case 72:
    470             yych = this._charAt(++cursor);
    471             if (yych == 'T') { gotoCase = 73; continue; };
     537case 78:
     538            yych = this._charAt(++cursor);
     539            if (yych == 'T') { gotoCase = 79; continue; };
    472540            if (yych != 't') { gotoCase = 43; continue; };
    473 case 73:
     541case 79:
    474542            ++cursor;
    475543            this.setLexCondition(this._lexConditions.TAG);
     
    479547                    return cursor;
    480548                }
     549case 81:
     550            yych = this._charAt(++cursor);
     551            if (yych == 'L') { gotoCase = 82; continue; };
     552            if (yych != 'l') { gotoCase = 43; continue; };
     553case 82:
     554            yych = this._charAt(++cursor);
     555            if (yych == 'E') { gotoCase = 83; continue; };
     556            if (yych != 'e') { gotoCase = 43; continue; };
     557case 83:
     558            ++cursor;
     559            this.setLexCondition(this._lexConditions.TAG);
     560            {
     561                    this.tokenType = "html-tag";
     562                    this._condition.parseCondition = this._parseConditions.INITIAL;
     563                    return cursor;
     564                }
    481565/* *********************************** */
    482566case this.case_SSTRING:
    483567            yych = this._charAt(cursor);
    484568            if (yych <= '\f') {
    485                 if (yych == '\n') { gotoCase = 79; continue; };
    486                 { gotoCase = 78; continue; };
    487             } else {
    488                 if (yych <= '\r') { gotoCase = 79; continue; };
    489                 if (yych == '\'') { gotoCase = 81; continue; };
    490                 { gotoCase = 78; continue; };
    491             }
    492 case 77:
     569                if (yych == '\n') { gotoCase = 89; continue; };
     570                { gotoCase = 88; continue; };
     571            } else {
     572                if (yych <= '\r') { gotoCase = 89; continue; };
     573                if (yych == '\'') { gotoCase = 91; continue; };
     574                { gotoCase = 88; continue; };
     575            }
     576case 87:
    493577            { return this._stringToken(cursor); }
    494 case 78:
    495             yych = this._charAt(++cursor);
    496             { gotoCase = 85; continue; };
    497 case 79:
     578case 88:
     579            yych = this._charAt(++cursor);
     580            { gotoCase = 95; continue; };
     581case 89:
    498582            ++cursor;
    499583            { this.tokenType = null; return cursor; }
    500 case 81:
    501             ++cursor;
    502 case 82:
     584case 91:
     585            ++cursor;
     586case 92:
    503587            this.setLexCondition(this._lexConditions.TAG);
    504588            { return this._stringToken(cursor, true); }
    505 case 83:
    506             yych = this._charAt(++cursor);
    507             { gotoCase = 82; continue; };
    508 case 84:
    509             ++cursor;
    510             yych = this._charAt(cursor);
    511 case 85:
    512             if (yych <= '\f') {
    513                 if (yych == '\n') { gotoCase = 77; continue; };
    514                 { gotoCase = 84; continue; };
    515             } else {
    516                 if (yych <= '\r') { gotoCase = 77; continue; };
    517                 if (yych == '\'') { gotoCase = 83; continue; };
    518                 { gotoCase = 84; continue; };
     589case 93:
     590            yych = this._charAt(++cursor);
     591            { gotoCase = 92; continue; };
     592case 94:
     593            ++cursor;
     594            yych = this._charAt(cursor);
     595case 95:
     596            if (yych <= '\f') {
     597                if (yych == '\n') { gotoCase = 87; continue; };
     598                { gotoCase = 94; continue; };
     599            } else {
     600                if (yych <= '\r') { gotoCase = 87; continue; };
     601                if (yych == '\'') { gotoCase = 93; continue; };
     602                { gotoCase = 94; continue; };
    519603            }
    520604/* *********************************** */
     
    523607            if (yych <= '&') {
    524608                if (yych <= '\r') {
    525                     if (yych == '\n') { gotoCase = 90; continue; };
    526                     if (yych >= '\r') { gotoCase = 90; continue; };
     609                    if (yych == '\n') { gotoCase = 100; continue; };
     610                    if (yych >= '\r') { gotoCase = 100; continue; };
    527611                } else {
    528612                    if (yych <= ' ') {
    529                         if (yych >= ' ') { gotoCase = 90; continue; };
     613                        if (yych >= ' ') { gotoCase = 100; continue; };
    530614                    } else {
    531                         if (yych == '"') { gotoCase = 92; continue; };
     615                        if (yych == '"') { gotoCase = 102; continue; };
    532616                    }
    533617                }
     
    535619                if (yych <= '>') {
    536620                    if (yych <= ';') {
    537                         if (yych <= '\'') { gotoCase = 93; continue; };
     621                        if (yych <= '\'') { gotoCase = 103; continue; };
    538622                    } else {
    539                         if (yych <= '<') { gotoCase = 90; continue; };
    540                         if (yych <= '=') { gotoCase = 94; continue; };
    541                         { gotoCase = 96; continue; };
     623                        if (yych <= '<') { gotoCase = 100; continue; };
     624                        if (yych <= '=') { gotoCase = 104; continue; };
     625                        { gotoCase = 106; continue; };
    542626                    }
    543627                } else {
    544628                    if (yych <= '[') {
    545                         if (yych >= '[') { gotoCase = 90; continue; };
     629                        if (yych >= '[') { gotoCase = 100; continue; };
    546630                    } else {
    547                         if (yych == ']') { gotoCase = 90; continue; };
    548                     }
    549                 }
    550             }
    551             ++cursor;
    552             yych = this._charAt(cursor);
    553             { gotoCase = 109; continue; };
    554 case 89:
     631                        if (yych == ']') { gotoCase = 100; continue; };
     632                    }
     633                }
     634            }
     635            ++cursor;
     636            yych = this._charAt(cursor);
     637            { gotoCase = 119; continue; };
     638case 99:
    555639            {
    556                     if (this._condition.parseCondition === this._parseConditions.SCRIPT) {
     640                    if (this._condition.parseCondition === this._parseConditions.SCRIPT || this._condition.parseCondition === this._parseConditions.STYLE) {
    557641                        // Fall through if expecting attributes.
    558642                        this.tokenType = null;
     
    581665                    return cursor;
    582666                }
    583 case 90:
     667case 100:
    584668            ++cursor;
    585669            { this.tokenType = null; return cursor; }
    586 case 92:
     670case 102:
    587671            yyaccept = 0;
    588672            yych = this._charAt(YYMARKER = ++cursor);
    589             { gotoCase = 105; continue; };
    590 case 93:
     673            { gotoCase = 115; continue; };
     674case 103:
    591675            yyaccept = 0;
    592676            yych = this._charAt(YYMARKER = ++cursor);
    593             { gotoCase = 99; continue; };
    594 case 94:
     677            { gotoCase = 109; continue; };
     678case 104:
    595679            ++cursor;
    596680            {
     
    600684                    return cursor;
    601685                }
    602 case 96:
     686case 106:
    603687            ++cursor;
    604688            this.setLexCondition(this._lexConditions.INITIAL);
     
    614698                    }
    615699
     700                    if (this._condition.parseCondition & this._parseConditions.STYLE) {
     701                        if (!this._internalCSSTokenizer) {
     702                            this._internalCSSTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/css");
     703                            this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.initialCondition;
     704                        }
     705                        // Do not tokenize style tag contents.
     706                        return cursor;
     707                    }
     708
    616709                    this._condition.parseCondition = this._parseConditions.INITIAL;
    617710                    return cursor;
    618711                }
    619 case 98:
    620             ++cursor;
    621             yych = this._charAt(cursor);
    622 case 99:
    623             if (yych <= '\f') {
    624                 if (yych != '\n') { gotoCase = 98; continue; };
    625             } else {
    626                 if (yych <= '\r') { gotoCase = 100; continue; };
    627                 if (yych == '\'') { gotoCase = 102; continue; };
    628                 { gotoCase = 98; continue; };
    629             }
    630 case 100:
     712case 108:
     713            ++cursor;
     714            yych = this._charAt(cursor);
     715case 109:
     716            if (yych <= '\f') {
     717                if (yych != '\n') { gotoCase = 108; continue; };
     718            } else {
     719                if (yych <= '\r') { gotoCase = 110; continue; };
     720                if (yych == '\'') { gotoCase = 112; continue; };
     721                { gotoCase = 108; continue; };
     722            }
     723case 110:
    631724            ++cursor;
    632725            this.setLexCondition(this._lexConditions.SSTRING);
    633726            { return this._stringToken(cursor); }
    634 case 102:
     727case 112:
    635728            ++cursor;
    636729            { return this._stringToken(cursor, true); }
    637 case 104:
    638             ++cursor;
    639             yych = this._charAt(cursor);
    640 case 105:
    641             if (yych <= '\f') {
    642                 if (yych != '\n') { gotoCase = 104; continue; };
    643             } else {
    644                 if (yych <= '\r') { gotoCase = 106; continue; };
    645                 if (yych == '"') { gotoCase = 102; continue; };
    646                 { gotoCase = 104; continue; };
    647             }
    648 case 106:
     730case 114:
     731            ++cursor;
     732            yych = this._charAt(cursor);
     733case 115:
     734            if (yych <= '\f') {
     735                if (yych != '\n') { gotoCase = 114; continue; };
     736            } else {
     737                if (yych <= '\r') { gotoCase = 116; continue; };
     738                if (yych == '"') { gotoCase = 112; continue; };
     739                { gotoCase = 114; continue; };
     740            }
     741case 116:
    649742            ++cursor;
    650743            this.setLexCondition(this._lexConditions.DSTRING);
    651744            { return this._stringToken(cursor); }
    652 case 108:
    653             ++cursor;
    654             yych = this._charAt(cursor);
    655 case 109:
     745case 118:
     746            ++cursor;
     747            yych = this._charAt(cursor);
     748case 119:
    656749            if (yych <= '"') {
    657750                if (yych <= '\r') {
    658                     if (yych == '\n') { gotoCase = 89; continue; };
    659                     if (yych <= '\f') { gotoCase = 108; continue; };
    660                     { gotoCase = 89; continue; };
    661                 } else {
    662                     if (yych == ' ') { gotoCase = 89; continue; };
    663                     if (yych <= '!') { gotoCase = 108; continue; };
    664                     { gotoCase = 89; continue; };
     751                    if (yych == '\n') { gotoCase = 99; continue; };
     752                    if (yych <= '\f') { gotoCase = 118; continue; };
     753                    { gotoCase = 99; continue; };
     754                } else {
     755                    if (yych == ' ') { gotoCase = 99; continue; };
     756                    if (yych <= '!') { gotoCase = 118; continue; };
     757                    { gotoCase = 99; continue; };
    665758                }
    666759            } else {
    667760                if (yych <= '>') {
    668                     if (yych == '\'') { gotoCase = 89; continue; };
    669                     if (yych <= ';') { gotoCase = 108; continue; };
    670                     { gotoCase = 89; continue; };
     761                    if (yych == '\'') { gotoCase = 99; continue; };
     762                    if (yych <= ';') { gotoCase = 118; continue; };
     763                    { gotoCase = 99; continue; };
    671764                } else {
    672765                    if (yych <= '[') {
    673                         if (yych <= 'Z') { gotoCase = 108; continue; };
    674                         { gotoCase = 89; continue; };
     766                        if (yych <= 'Z') { gotoCase = 118; continue; };
     767                        { gotoCase = 99; continue; };
    675768                    } else {
    676                         if (yych == ']') { gotoCase = 89; continue; };
    677                         { gotoCase = 108; continue; };
     769                        if (yych == ']') { gotoCase = 99; continue; };
     770                        { gotoCase = 118; continue; };
    678771                    }
    679772                }
  • trunk/Source/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js

    r55248 r76943  
    6767        LINKIFY: 4,
    6868        A_NODE: 8,
    69         SCRIPT: 16
     69        SCRIPT: 16,
     70        STYLE: 32
    7071    };
    7172
     
    8283            } else
    8384                this._internalJavaScriptTokenizer.line = line;
     85        } else if (this._internalCSSTokenizer) {
     86            var match = /<\/style/i.exec(line);
     87            if (match) {
     88                this._internalCSSTokenizer.line = line.substring(0, match.index);
     89            } else
     90                this._internalCSSTokenizer.line = line;
    8491        }
    8592        this._line = line;
     
    146153            } else if (cursor !== this._line.length)
    147154                delete this._internalJavaScriptTokenizer;
     155        } else if (this._internalCSSTokenizer) {
     156            // Re-set line to force </style> detection first.
     157            this.line = this._line;
     158            if (cursor !== this._internalCSSTokenizer._line.length) {
     159                // Tokenizer is stateless, so restore its condition before tokenizing and save it after.
     160                this._internalCSSTokenizer.condition = this._condition.internalCSSTokenizerCondition;
     161                var result = this._internalCSSTokenizer.nextToken(cursor);
     162                this.tokenType = this._internalCSSTokenizer.tokenType;
     163                this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.condition;
     164                return result;
     165            } else if (cursor !== this._line.length)
     166                delete this._internalCSSTokenizer;
    148167        }
    149168
     
    176195                ScriptEnd = "</" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt];
    177196
     197                StyleStart = "<" [Ss] [Tt] [Yy] [Ll] [Ee];
     198                StyleEnd = "</" [Ss] [Tt] [Yy] [Ll] [Ee];
     199
    178200                LT = "<" | "</";
    179201                GT = ">";
     
    202224                {
    203225                    if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
    204                         // Do not tokenize script tag contents, keep lexer state although processing "<".
     226                        // Do not tokenize script tag contents, keep lexer state, even though processing "<".
    205227                        this.setLexCondition(this._lexConditions.INITIAL);
    206228                        this.tokenType = null;
     
    220242                }
    221243
     244                <INITIAL> StyleStart => TAG
     245                {
     246                    if (this._condition.parseCondition & this._parseConditions.STYLE) {
     247                        // Do not tokenize style tag contents, keep lexer state, even though processing "<".
     248                        this.setLexCondition(this._lexConditions.INITIAL);
     249                        this.tokenType = null;
     250                        return cursor;
     251                    }
     252                    this.tokenType = "html-tag";
     253                    this._condition.parseCondition = this._parseConditions.STYLE;
     254                    this._setExpectingAttribute();
     255                    return cursor;
     256                }
     257
     258                <INITIAL> StyleEnd => TAG
     259                {
     260                    this.tokenType = "html-tag";
     261                    this._condition.parseCondition = this._parseConditions.INITIAL;
     262                    return cursor;
     263                }
     264
    222265                <INITIAL> LT => TAG
    223266                {
    224                     if (this._condition.parseCondition & this._parseConditions.SCRIPT) {
    225                         // Do not tokenize script tag contents, keep lexer state although processing "<".
     267                    if (this._condition.parseCondition & (this._parseConditions.SCRIPT | this._parseConditions.STYLE)) {
     268                        // Do not tokenize script and style tag contents, keep lexer state, even though processing "<".
    226269                        this.setLexCondition(this._lexConditions.INITIAL);
    227270                        this.tokenType = null;
     
    243286                        }
    244287                        // Do not tokenize script tag contents.
     288                        return cursor;
     289                    }
     290
     291                    if (this._condition.parseCondition & this._parseConditions.STYLE) {
     292                        if (!this._internalCSSTokenizer) {
     293                            this._internalCSSTokenizer = WebInspector.SourceTokenizer.Registry.getInstance().getTokenizer("text/css");
     294                            this._condition.internalCSSTokenizerCondition = this._internalCSSTokenizer.initialCondition;
     295                        }
     296                        // Do not tokenize style tag contents.
    245297                        return cursor;
    246298                    }
     
    268320                <TAG> Identifier
    269321                {
    270                     if (this._condition.parseCondition === this._parseConditions.SCRIPT) {
     322                    if (this._condition.parseCondition === this._parseConditions.SCRIPT || this._condition.parseCondition === this._parseConditions.STYLE) {
    271323                        // Fall through if expecting attributes.
    272324                        this.tokenType = null;
Note: See TracChangeset for help on using the changeset viewer.