Changeset 54139 in webkit
- Timestamp:
- Feb 1, 2010 10:44:48 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54138 r54139 1 2010-02-01 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: Syntax highlighting in source view of 6 Resources pane stops half-way. 7 8 There were two problems here: (1) styles for html highlighter were not 9 added into the css file (they used to be injected manually in the 10 SourceFrame before). (2) 'Tag' needed to be lexer's state, not parser's. 11 Otherwise unbalanced quotes in the text nodes were matching too match 12 into the string tokens. 13 14 https://bugs.webkit.org/show_bug.cgi?id=34359 15 16 * inspector/front-end/NativeTextViewer.js: 17 (WebInspector.NativeTextViewer.prototype._createLineDivs): 18 (WebInspector.NativeTextViewer.prototype._lineHeight): 19 (WebInspector.NativeTextViewer.prototype.initFontMetrics): 20 * inspector/front-end/SourceFrame.js: 21 (WebInspector.SourceFrame.prototype._createEditorIfNeeded): 22 * inspector/front-end/SourceHTMLTokenizer.js: 23 (WebInspector.SourceHTMLTokenizer): 24 (WebInspector.SourceHTMLTokenizer.prototype.nextToken): 25 * inspector/front-end/SourceHTMLTokenizer.re2js: 26 * inspector/front-end/TextEditor.js: 27 (WebInspector.TextEditor.prototype.initFontMetrics): 28 (WebInspector.TextEditor.prototype._registerShortcuts): 29 * inspector/front-end/inspectorSyntaxHighlight.css: 30 1 31 2010-02-01 Ben Murdoch <benm@google.com> 2 32 -
trunk/WebCore/inspector/front-end/NativeTextViewer.js
r54133 r54139 59 59 this._sheet.appendChild(lineDiv); 60 60 this._textModel.setAttribute(i, "line-div", lineDiv); 61 this._textModel.removeAttribute(i, "div-highlighted"); 61 62 } 62 63 this._container.appendChild(this._sheet); … … 144 145 var nextElement = this._textModel.getAttribute(lineNumber + 1, "line-div"); 145 146 return nextElement.offsetTop - element.offsetTop; 146 } else147 147 } 148 return element.parentElement.offsetHeight - element.offsetTop; 148 149 }, 149 150 … … 214 215 }, 215 216 216 _initFontMetrics: function()217 { 218 WebInspector.TextEditor.prototype. _initFontMetrics.call(this);217 initFontMetrics: function() 218 { 219 WebInspector.TextEditor.prototype.initFontMetrics.call(this); 219 220 for (var i = 0; i < this._textModel.linesCount; ++i) { 220 221 var lineDiv = this._textModel.getAttribute(i, "line-div"); -
trunk/WebCore/inspector/front-end/SourceFrame.js
r54133 r54139 145 145 this._element.addEventListener("keydown", this._keyDown.bind(this), true); 146 146 this._parentElement.appendChild(this._element); 147 this._editor. _initFontMetrics();147 this._editor.initFontMetrics(); 148 148 149 149 this._editor.mimeType = this._mimeType; -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.js
r54053 r54139 1 /* Generated by re2c 0.13.5 on Thu Jan 28 20:49:22 2010 */1 /* Generated by re2c 0.13.5 on Mon Feb 1 19:13:12 2010 */ 2 2 /* 3 3 * Copyright (C) 2009 Google Inc. All rights reserved. … … 46 46 WebInspector.SourceTokenizer.call(this); 47 47 48 // The order is determined by the generated code. 48 49 this._lexConditions = { 49 50 INITIAL: 0, 50 51 COMMENT: 1, 51 DSTRING: 2, 52 SSTRING: 3 52 TAG: 2, 53 DSTRING: 4, 54 SSTRING: 5 53 55 }; 56 this.case_INITIAL = 1000; 57 this.case_COMMENT = 1001; 58 this.case_TAG = 1002; 59 this.case_DSTRING = 1004; 60 this.case_SSTRING = 1005; 54 61 55 62 this._parseConditions = { 56 63 INITIAL: 0, 57 TAG: 1, 58 ATTRIBUTE: 2, 59 ATTRIBUTE_VALUE: 3, 60 SCRIPT: 4, 61 SCRIPT_ATTRIBUTE: 5, 62 SCRIPT_ATTRIBUTE_VALUE: 6, 63 DOCTYPE: 7 64 ATTRIBUTE: 1, 65 ATTRIBUTE_VALUE: 2, 66 SCRIPT: 3, 67 SCRIPT_ATTRIBUTE: 4, 68 SCRIPT_ATTRIBUTE_VALUE: 5, 69 DOCTYPE: 6 64 70 }; 65 66 this.case_INITIAL = 1000;67 this.case_COMMENT = 1001;68 this.case_DSTRING = 1002;69 this.case_SSTRING = 1003;70 71 71 72 this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL }; … … 131 132 } else { 132 133 if (this.getLexCondition() < 3) { 133 { gotoCase = this.case_DSTRING; continue; }; 134 } else { 135 { gotoCase = this.case_SSTRING; continue; }; 134 { gotoCase = this.case_TAG; continue; }; 135 } else { 136 if (this.getLexCondition() < 4) { 137 { gotoCase = this.case_DSTRING; continue; }; 138 } else { 139 { gotoCase = this.case_SSTRING; continue; }; 140 } 136 141 } 137 142 } … … 215 220 ++cursor; 216 221 case 21: 217 this.setLexCondition(this._lexConditions. INITIAL);222 this.setLexCondition(this._lexConditions.TAG); 218 223 { return this._stringToken(cursor, true); } 219 224 case 22: … … 235 240 case this.case_INITIAL: 236 241 yych = this._charAt(cursor); 237 if (yych <= '=') { 238 if (yych <= '\'') { 239 if (yych == '"') { gotoCase = 29; continue; }; 240 if (yych >= '\'') { gotoCase = 30; continue; }; 241 } else { 242 if (yych <= '9') { 243 if (yych >= '0') { gotoCase = 31; continue; }; 244 } else { 245 if (yych <= ';') { gotoCase = 27; continue; }; 246 if (yych <= '<') { gotoCase = 33; continue; }; 247 { gotoCase = 35; continue; }; 248 } 249 } 250 } else { 251 if (yych <= '^') { 252 if (yych <= '>') { gotoCase = 37; continue; }; 253 if (yych <= '@') { gotoCase = 27; continue; }; 254 if (yych <= 'Z') { gotoCase = 31; continue; }; 255 } else { 256 if (yych <= '`') { 257 if (yych <= '_') { gotoCase = 31; continue; }; 258 } else { 259 if (yych <= 'z') { gotoCase = 31; continue; }; 260 if (yych >= 0x80) { gotoCase = 31; continue; }; 261 } 262 } 263 } 264 case 27: 265 ++cursor; 266 case 28: 242 if (yych == '<') { gotoCase = 29; continue; }; 243 ++cursor; 267 244 { this.tokenType = null; return cursor; } 268 245 case 29: 269 246 yyaccept = 0; 270 247 yych = this._charAt(YYMARKER = ++cursor); 271 { gotoCase = 82; continue; }; 248 if (yych <= '/') { 249 if (yych == '!') { gotoCase = 34; continue; }; 250 if (yych >= '/') { gotoCase = 31; continue; }; 251 } else { 252 if (yych <= 'S') { 253 if (yych >= 'S') { gotoCase = 32; continue; }; 254 } else { 255 if (yych == 's') { gotoCase = 32; continue; }; 256 } 257 } 272 258 case 30: 273 yyaccept = 0;274 yych = this._charAt(YYMARKER = ++cursor);275 { gotoCase = 76; continue; };276 case 31:277 ++cursor;278 yych = this._charAt(cursor);279 { gotoCase = 74; continue; };280 case 32:281 259 { 282 260 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 285 263 } 286 264 287 if (this._parseCondition === this._parseConditions.TAG) { 265 this.setLexCondition(this._lexConditions.TAG); 266 267 this.tokenType = "html-tag"; 268 this._parseCondition = this._parseConditions.INITIAL; 269 return cursor; 270 } 271 case 31: 272 yyaccept = 0; 273 yych = this._charAt(YYMARKER = ++cursor); 274 if (yych == 'S') { gotoCase = 58; continue; }; 275 if (yych == 's') { gotoCase = 58; continue; }; 276 { gotoCase = 30; continue; }; 277 case 32: 278 yych = this._charAt(++cursor); 279 if (yych == 'C') { gotoCase = 52; continue; }; 280 if (yych == 'c') { gotoCase = 52; continue; }; 281 case 33: 282 cursor = YYMARKER; 283 { gotoCase = 30; continue; }; 284 case 34: 285 yych = this._charAt(++cursor); 286 if (yych <= 'C') { 287 if (yych != '-') { gotoCase = 33; continue; }; 288 } else { 289 if (yych <= 'D') { gotoCase = 36; continue; }; 290 if (yych == 'd') { gotoCase = 36; continue; }; 291 { gotoCase = 33; continue; }; 292 } 293 yych = this._charAt(++cursor); 294 if (yych == '-') { gotoCase = 44; continue; }; 295 { gotoCase = 33; continue; }; 296 case 36: 297 yych = this._charAt(++cursor); 298 if (yych == 'O') { gotoCase = 37; continue; }; 299 if (yych != 'o') { gotoCase = 33; continue; }; 300 case 37: 301 yych = this._charAt(++cursor); 302 if (yych == 'C') { gotoCase = 38; continue; }; 303 if (yych != 'c') { gotoCase = 33; continue; }; 304 case 38: 305 yych = this._charAt(++cursor); 306 if (yych == 'T') { gotoCase = 39; continue; }; 307 if (yych != 't') { gotoCase = 33; continue; }; 308 case 39: 309 yych = this._charAt(++cursor); 310 if (yych == 'Y') { gotoCase = 40; continue; }; 311 if (yych != 'y') { gotoCase = 33; continue; }; 312 case 40: 313 yych = this._charAt(++cursor); 314 if (yych == 'P') { gotoCase = 41; continue; }; 315 if (yych != 'p') { gotoCase = 33; continue; }; 316 case 41: 317 yych = this._charAt(++cursor); 318 if (yych == 'E') { gotoCase = 42; continue; }; 319 if (yych != 'e') { gotoCase = 33; continue; }; 320 case 42: 321 ++cursor; 322 this.setLexCondition(this._lexConditions.TAG); 323 { 324 this.tokenType = "html-doctype"; 325 this._parseCondition = this._parseConditions.DOCTYPE; 326 return cursor; 327 } 328 case 44: 329 ++cursor; 330 yych = this._charAt(cursor); 331 if (yych <= '\f') { 332 if (yych == '\n') { gotoCase = 47; continue; }; 333 { gotoCase = 44; continue; }; 334 } else { 335 if (yych <= '\r') { gotoCase = 47; continue; }; 336 if (yych != '-') { gotoCase = 44; continue; }; 337 } 338 ++cursor; 339 yych = this._charAt(cursor); 340 if (yych == '-') { gotoCase = 49; continue; }; 341 { gotoCase = 33; continue; }; 342 case 47: 343 ++cursor; 344 this.setLexCondition(this._lexConditions.COMMENT); 345 { this.tokenType = "html-comment"; return cursor; } 346 case 49: 347 ++cursor; 348 yych = this._charAt(cursor); 349 if (yych != '>') { gotoCase = 44; continue; }; 350 ++cursor; 351 { this.tokenType = "html-comment"; return cursor; } 352 case 52: 353 yych = this._charAt(++cursor); 354 if (yych == 'R') { gotoCase = 53; continue; }; 355 if (yych != 'r') { gotoCase = 33; continue; }; 356 case 53: 357 yych = this._charAt(++cursor); 358 if (yych == 'I') { gotoCase = 54; continue; }; 359 if (yych != 'i') { gotoCase = 33; continue; }; 360 case 54: 361 yych = this._charAt(++cursor); 362 if (yych == 'P') { gotoCase = 55; continue; }; 363 if (yych != 'p') { gotoCase = 33; continue; }; 364 case 55: 365 yych = this._charAt(++cursor); 366 if (yych == 'T') { gotoCase = 56; continue; }; 367 if (yych != 't') { gotoCase = 33; continue; }; 368 case 56: 369 ++cursor; 370 this.setLexCondition(this._lexConditions.TAG); 371 { 372 this.tokenType = "html-tag"; 373 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 374 return cursor; 375 } 376 case 58: 377 yych = this._charAt(++cursor); 378 if (yych == 'C') { gotoCase = 59; continue; }; 379 if (yych != 'c') { gotoCase = 33; continue; }; 380 case 59: 381 yych = this._charAt(++cursor); 382 if (yych == 'R') { gotoCase = 60; continue; }; 383 if (yych != 'r') { gotoCase = 33; continue; }; 384 case 60: 385 yych = this._charAt(++cursor); 386 if (yych == 'I') { gotoCase = 61; continue; }; 387 if (yych != 'i') { gotoCase = 33; continue; }; 388 case 61: 389 yych = this._charAt(++cursor); 390 if (yych == 'P') { gotoCase = 62; continue; }; 391 if (yych != 'p') { gotoCase = 33; continue; }; 392 case 62: 393 yych = this._charAt(++cursor); 394 if (yych == 'T') { gotoCase = 63; continue; }; 395 if (yych != 't') { gotoCase = 33; continue; }; 396 case 63: 397 ++cursor; 398 this.setLexCondition(this._lexConditions.TAG); 399 { 400 this.tokenType = "html-tag"; 401 this._parseCondition = this._parseConditions.INITIAL; 402 return cursor; 403 } 404 /* *********************************** */ 405 case this.case_SSTRING: 406 yych = this._charAt(cursor); 407 if (yych <= '\f') { 408 if (yych == '\n') { gotoCase = 69; continue; }; 409 { gotoCase = 68; continue; }; 410 } else { 411 if (yych <= '\r') { gotoCase = 69; continue; }; 412 if (yych == '\'') { gotoCase = 71; continue; }; 413 { gotoCase = 68; continue; }; 414 } 415 case 67: 416 { return this._stringToken(cursor); } 417 case 68: 418 yych = this._charAt(++cursor); 419 { gotoCase = 75; continue; }; 420 case 69: 421 ++cursor; 422 { this.tokenType = null; return cursor; } 423 case 71: 424 ++cursor; 425 case 72: 426 this.setLexCondition(this._lexConditions.TAG); 427 { return this._stringToken(cursor, true); } 428 case 73: 429 yych = this._charAt(++cursor); 430 { gotoCase = 72; continue; }; 431 case 74: 432 ++cursor; 433 yych = this._charAt(cursor); 434 case 75: 435 if (yych <= '\f') { 436 if (yych == '\n') { gotoCase = 67; continue; }; 437 { gotoCase = 74; continue; }; 438 } else { 439 if (yych <= '\r') { gotoCase = 67; continue; }; 440 if (yych == '\'') { gotoCase = 73; continue; }; 441 { gotoCase = 74; continue; }; 442 } 443 /* *********************************** */ 444 case this.case_TAG: 445 yych = this._charAt(cursor); 446 if (yych <= '=') { 447 if (yych <= '\'') { 448 if (yych == '"') { gotoCase = 80; continue; }; 449 if (yych >= '\'') { gotoCase = 81; continue; }; 450 } else { 451 if (yych <= '/') { gotoCase = 78; continue; }; 452 if (yych <= '9') { gotoCase = 82; continue; }; 453 if (yych >= '=') { gotoCase = 84; continue; }; 454 } 455 } else { 456 if (yych <= '^') { 457 if (yych <= '>') { gotoCase = 86; continue; }; 458 if (yych <= '@') { gotoCase = 78; continue; }; 459 if (yych <= 'Z') { gotoCase = 82; continue; }; 460 } else { 461 if (yych <= '`') { 462 if (yych <= '_') { gotoCase = 82; continue; }; 463 } else { 464 if (yych <= 'z') { gotoCase = 82; continue; }; 465 if (yych >= 0x80) { gotoCase = 82; continue; }; 466 } 467 } 468 } 469 case 78: 470 ++cursor; 471 { this.tokenType = null; return cursor; } 472 case 80: 473 yyaccept = 0; 474 yych = this._charAt(YYMARKER = ++cursor); 475 { gotoCase = 97; continue; }; 476 case 81: 477 yyaccept = 0; 478 yych = this._charAt(YYMARKER = ++cursor); 479 { gotoCase = 91; continue; }; 480 case 82: 481 ++cursor; 482 yych = this._charAt(cursor); 483 { gotoCase = 89; continue; }; 484 case 83: 485 { 486 if (this._parseCondition === this._parseConditions.SCRIPT) { 487 this.tokenType = null; 488 return cursor; 489 } 490 491 if (this._parseCondition === this._parseConditions.INITIAL) { 288 492 this.tokenType = "html-tag"; 289 493 this._parseCondition = this._parseConditions.ATTRIBUTE; … … 298 502 return cursor; 299 503 } 300 case 33: 301 yyaccept = 1; 302 yych = this._charAt(YYMARKER = ++cursor); 303 if (yych <= '/') { 304 if (yych == '!') { gotoCase = 42; continue; }; 305 if (yych >= '/') { gotoCase = 39; continue; }; 306 } else { 307 if (yych <= 'S') { 308 if (yych >= 'S') { gotoCase = 40; continue; }; 309 } else { 310 if (yych == 's') { gotoCase = 40; continue; }; 311 } 312 } 313 case 34: 314 { 315 if (this._parseCondition === this._parseConditions.SCRIPT) { 316 this.tokenType = null; 317 return cursor; 318 } 319 320 this.tokenType = "html-tag"; 321 this._parseCondition = this._parseConditions.TAG; 322 return cursor; 323 } 324 case 35: 504 case 84: 325 505 ++cursor; 326 506 { … … 334 514 return cursor; 335 515 } 336 case 37: 337 ++cursor; 516 case 86: 517 ++cursor; 518 this.setLexCondition(this._lexConditions.INITIAL); 338 519 { 339 520 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 353 534 return cursor; 354 535 } 355 case 39: 356 yyaccept = 1; 357 yych = this._charAt(YYMARKER = ++cursor); 358 if (yych == 'S') { gotoCase = 66; continue; }; 359 if (yych == 's') { gotoCase = 66; continue; }; 360 { gotoCase = 34; continue; }; 361 case 40: 362 yych = this._charAt(++cursor); 363 if (yych == 'C') { gotoCase = 60; continue; }; 364 if (yych == 'c') { gotoCase = 60; continue; }; 365 case 41: 366 cursor = YYMARKER; 367 if (yyaccept <= 0) { 368 { gotoCase = 28; continue; }; 369 } else { 370 { gotoCase = 34; continue; }; 371 } 372 case 42: 373 yych = this._charAt(++cursor); 374 if (yych <= 'C') { 375 if (yych != '-') { gotoCase = 41; continue; }; 376 } else { 377 if (yych <= 'D') { gotoCase = 44; continue; }; 378 if (yych == 'd') { gotoCase = 44; continue; }; 379 { gotoCase = 41; continue; }; 380 } 381 yych = this._charAt(++cursor); 382 if (yych == '-') { gotoCase = 52; continue; }; 383 { gotoCase = 41; continue; }; 384 case 44: 385 yych = this._charAt(++cursor); 386 if (yych == 'O') { gotoCase = 45; continue; }; 387 if (yych != 'o') { gotoCase = 41; continue; }; 388 case 45: 389 yych = this._charAt(++cursor); 390 if (yych == 'C') { gotoCase = 46; continue; }; 391 if (yych != 'c') { gotoCase = 41; continue; }; 392 case 46: 393 yych = this._charAt(++cursor); 394 if (yych == 'T') { gotoCase = 47; continue; }; 395 if (yych != 't') { gotoCase = 41; continue; }; 396 case 47: 397 yych = this._charAt(++cursor); 398 if (yych == 'Y') { gotoCase = 48; continue; }; 399 if (yych != 'y') { gotoCase = 41; continue; }; 400 case 48: 401 yych = this._charAt(++cursor); 402 if (yych == 'P') { gotoCase = 49; continue; }; 403 if (yych != 'p') { gotoCase = 41; continue; }; 404 case 49: 405 yych = this._charAt(++cursor); 406 if (yych == 'E') { gotoCase = 50; continue; }; 407 if (yych != 'e') { gotoCase = 41; continue; }; 408 case 50: 409 ++cursor; 410 { 411 this.tokenType = "html-doctype"; 412 this._parseCondition = this._parseConditions.DOCTYPE; 413 return cursor; 414 } 415 case 52: 416 ++cursor; 417 yych = this._charAt(cursor); 418 if (yych <= '\f') { 419 if (yych == '\n') { gotoCase = 55; continue; }; 420 { gotoCase = 52; continue; }; 421 } else { 422 if (yych <= '\r') { gotoCase = 55; continue; }; 423 if (yych != '-') { gotoCase = 52; continue; }; 424 } 425 ++cursor; 426 yych = this._charAt(cursor); 427 if (yych == '-') { gotoCase = 57; continue; }; 428 { gotoCase = 41; continue; }; 429 case 55: 430 ++cursor; 431 this.setLexCondition(this._lexConditions.COMMENT); 432 { this.tokenType = "html-comment"; return cursor; } 433 case 57: 434 ++cursor; 435 yych = this._charAt(cursor); 436 if (yych != '>') { gotoCase = 52; continue; }; 437 ++cursor; 438 { this.tokenType = "html-comment"; return cursor; } 439 case 60: 440 yych = this._charAt(++cursor); 441 if (yych == 'R') { gotoCase = 61; continue; }; 442 if (yych != 'r') { gotoCase = 41; continue; }; 443 case 61: 444 yych = this._charAt(++cursor); 445 if (yych == 'I') { gotoCase = 62; continue; }; 446 if (yych != 'i') { gotoCase = 41; continue; }; 447 case 62: 448 yych = this._charAt(++cursor); 449 if (yych == 'P') { gotoCase = 63; continue; }; 450 if (yych != 'p') { gotoCase = 41; continue; }; 451 case 63: 452 yych = this._charAt(++cursor); 453 if (yych == 'T') { gotoCase = 64; continue; }; 454 if (yych != 't') { gotoCase = 41; continue; }; 455 case 64: 456 ++cursor; 457 { 458 this.tokenType = "html-tag"; 459 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 460 return cursor; 461 } 462 case 66: 463 yych = this._charAt(++cursor); 464 if (yych == 'C') { gotoCase = 67; continue; }; 465 if (yych != 'c') { gotoCase = 41; continue; }; 466 case 67: 467 yych = this._charAt(++cursor); 468 if (yych == 'R') { gotoCase = 68; continue; }; 469 if (yych != 'r') { gotoCase = 41; continue; }; 470 case 68: 471 yych = this._charAt(++cursor); 472 if (yych == 'I') { gotoCase = 69; continue; }; 473 if (yych != 'i') { gotoCase = 41; continue; }; 474 case 69: 475 yych = this._charAt(++cursor); 476 if (yych == 'P') { gotoCase = 70; continue; }; 477 if (yych != 'p') { gotoCase = 41; continue; }; 478 case 70: 479 yych = this._charAt(++cursor); 480 if (yych == 'T') { gotoCase = 71; continue; }; 481 if (yych != 't') { gotoCase = 41; continue; }; 482 case 71: 483 ++cursor; 484 { 485 this.tokenType = "html-tag"; 486 this._parseCondition = this._parseConditions.INITIAL; 487 return cursor; 488 } 489 case 73: 490 ++cursor; 491 yych = this._charAt(cursor); 492 case 74: 536 case 88: 537 ++cursor; 538 yych = this._charAt(cursor); 539 case 89: 493 540 if (yych <= '^') { 494 541 if (yych <= '9') { 495 if (yych <= '/') { gotoCase = 32; continue; };496 { gotoCase = 73; continue; };497 } else { 498 if (yych <= '@') { gotoCase = 32; continue; };499 if (yych <= 'Z') { gotoCase = 73; continue; };500 { gotoCase = 32; continue; };542 if (yych <= '/') { gotoCase = 83; continue; }; 543 { gotoCase = 88; continue; }; 544 } else { 545 if (yych <= '@') { gotoCase = 83; continue; }; 546 if (yych <= 'Z') { gotoCase = 88; continue; }; 547 { gotoCase = 83; continue; }; 501 548 } 502 549 } else { 503 550 if (yych <= '`') { 504 if (yych <= '_') { gotoCase = 73; continue; };505 { gotoCase = 32; continue; };506 } else { 507 if (yych <= 'z') { gotoCase = 73; continue; };508 if (yych <= 0x7F) { gotoCase = 32; continue; };509 { gotoCase = 73; continue; };510 } 511 } 512 case 75:513 ++cursor; 514 yych = this._charAt(cursor); 515 case 76:516 if (yych <= '\f') { 517 if (yych != '\n') { gotoCase = 75; continue; };518 } else { 519 if (yych <= '\r') { gotoCase = 77; continue; };520 if (yych == '\'') { gotoCase = 79; continue; };521 { gotoCase = 75; continue; };522 } 523 case 77:551 if (yych <= '_') { gotoCase = 88; continue; }; 552 { gotoCase = 83; continue; }; 553 } else { 554 if (yych <= 'z') { gotoCase = 88; continue; }; 555 if (yych <= 0x7F) { gotoCase = 83; continue; }; 556 { gotoCase = 88; continue; }; 557 } 558 } 559 case 90: 560 ++cursor; 561 yych = this._charAt(cursor); 562 case 91: 563 if (yych <= '\f') { 564 if (yych != '\n') { gotoCase = 90; continue; }; 565 } else { 566 if (yych <= '\r') { gotoCase = 92; continue; }; 567 if (yych == '\'') { gotoCase = 94; continue; }; 568 { gotoCase = 90; continue; }; 569 } 570 case 92: 524 571 ++cursor; 525 572 this.setLexCondition(this._lexConditions.SSTRING); 526 573 { return this._stringToken(cursor); } 527 case 79:574 case 94: 528 575 ++cursor; 529 576 { return this._stringToken(cursor, true); } 530 case 81:531 ++cursor; 532 yych = this._charAt(cursor); 533 case 82:534 if (yych <= '\f') { 535 if (yych != '\n') { gotoCase = 81; continue; };536 } else { 537 if (yych <= '\r') { gotoCase = 83; continue; };538 if (yych == '"') { gotoCase = 79; continue; };539 { gotoCase = 81; continue; };540 } 541 case 83:577 case 96: 578 ++cursor; 579 yych = this._charAt(cursor); 580 case 97: 581 if (yych <= '\f') { 582 if (yych != '\n') { gotoCase = 96; continue; }; 583 } else { 584 if (yych <= '\r') { gotoCase = 98; continue; }; 585 if (yych == '"') { gotoCase = 94; continue; }; 586 { gotoCase = 96; continue; }; 587 } 588 case 98: 542 589 ++cursor; 543 590 this.setLexCondition(this._lexConditions.DSTRING); 544 591 { return this._stringToken(cursor); } 545 /* *********************************** */546 case this.case_SSTRING:547 yych = this._charAt(cursor);548 if (yych <= '\f') {549 if (yych == '\n') { gotoCase = 89; continue; };550 { gotoCase = 88; continue; };551 } else {552 if (yych <= '\r') { gotoCase = 89; continue; };553 if (yych == '\'') { gotoCase = 91; continue; };554 { gotoCase = 88; continue; };555 }556 case 87:557 { return this._stringToken(cursor); }558 case 88:559 yych = this._charAt(++cursor);560 { gotoCase = 95; continue; };561 case 89:562 ++cursor;563 { this.tokenType = null; return cursor; }564 case 91:565 ++cursor;566 case 92:567 this.setLexCondition(this._lexConditions.INITIAL);568 { return this._stringToken(cursor, true); }569 case 93:570 yych = this._charAt(++cursor);571 { gotoCase = 92; continue; };572 case 94:573 ++cursor;574 yych = this._charAt(cursor);575 case 95:576 if (yych <= '\f') {577 if (yych == '\n') { gotoCase = 87; continue; };578 { gotoCase = 94; continue; };579 } else {580 if (yych <= '\r') { gotoCase = 87; continue; };581 if (yych == '\'') { gotoCase = 93; continue; };582 { gotoCase = 94; continue; };583 }584 592 } 585 593 -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
r54053 r54139 45 45 WebInspector.SourceTokenizer.call(this); 46 46 47 // The order is determined by the generated code. 47 48 this._lexConditions = { 48 49 INITIAL: 0, 49 50 COMMENT: 1, 50 DSTRING: 2, 51 SSTRING: 3 51 TAG: 2, 52 DSTRING: 4, 53 SSTRING: 5 52 54 }; 55 this.case_INITIAL = 1000; 56 this.case_COMMENT = 1001; 57 this.case_TAG = 1002; 58 this.case_DSTRING = 1004; 59 this.case_SSTRING = 1005; 53 60 54 61 this._parseConditions = { 55 62 INITIAL: 0, 56 TAG: 1, 57 ATTRIBUTE: 2, 58 ATTRIBUTE_VALUE: 3, 59 SCRIPT: 4, 60 SCRIPT_ATTRIBUTE: 5, 61 SCRIPT_ATTRIBUTE_VALUE: 6, 62 DOCTYPE: 7 63 ATTRIBUTE: 1, 64 ATTRIBUTE_VALUE: 2, 65 SCRIPT: 3, 66 SCRIPT_ATTRIBUTE: 4, 67 SCRIPT_ATTRIBUTE_VALUE: 5, 68 DOCTYPE: 6 63 69 }; 64 65 this.case_INITIAL = 1000;66 this.case_COMMENT = 1001;67 this.case_DSTRING = 1002;68 this.case_SSTRING = 1003;69 70 70 71 this.initialCondition = { lexCondition: this._lexConditions.INITIAL, parseCondition: this._parseConditions.INITIAL }; … … 158 159 <COMMENT> CommentEnd => INITIAL { this.tokenType = "html-comment"; return cursor; } 159 160 160 <INITIAL> DocTypeLT => INITIAL161 <INITIAL> DocTypeLT => TAG 161 162 { 162 163 this.tokenType = "html-doctype"; … … 165 166 } 166 167 167 <INITIAL> ScriptStart => INITIAL168 <INITIAL> ScriptStart => TAG 168 169 { 169 170 this.tokenType = "html-tag"; … … 172 173 } 173 174 174 <INITIAL> ScriptEnd => INITIAL175 <INITIAL> ScriptEnd => TAG 175 176 { 176 177 this.tokenType = "html-tag"; … … 179 180 } 180 181 181 <INITIAL> LT => INITIAL182 <INITIAL> LT 182 183 { 183 184 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 186 187 } 187 188 189 // Only make lexer transition if not in script tag. 190 this.setLexCondition(this._lexConditions.TAG); 191 188 192 this.tokenType = "html-tag"; 189 this._parseCondition = this._parseConditions. TAG;190 return cursor; 191 } 192 193 < INITIAL> GT => INITIAL193 this._parseCondition = this._parseConditions.INITIAL; 194 return cursor; 195 } 196 197 <TAG> GT => INITIAL 194 198 { 195 199 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 210 214 } 211 215 212 < INITIAL> StringLiteral { return this._stringToken(cursor, true); }213 < INITIAL> DoubleStringStart => DSTRING { return this._stringToken(cursor); }216 <TAG> StringLiteral { return this._stringToken(cursor, true); } 217 <TAG> DoubleStringStart => DSTRING { return this._stringToken(cursor); } 214 218 <DSTRING> DoubleStringContent => DSTRING { return this._stringToken(cursor); } 215 <DSTRING> DoubleStringEnd => INITIAL{ return this._stringToken(cursor, true); }216 < INITIAL> SingleStringStart => SSTRING { return this._stringToken(cursor); }219 <DSTRING> DoubleStringEnd => TAG { return this._stringToken(cursor, true); } 220 <TAG> SingleStringStart => SSTRING { return this._stringToken(cursor); } 217 221 <SSTRING> SingleStringContent => SSTRING { return this._stringToken(cursor); } 218 <SSTRING> SingleStringEnd => INITIAL{ return this._stringToken(cursor, true); }219 220 < INITIAL> EqualSign => INITIAL222 <SSTRING> SingleStringEnd => TAG { return this._stringToken(cursor, true); } 223 224 <TAG> EqualSign => TAG 221 225 { 222 226 if (this._isAttribute()) { … … 230 234 } 231 235 232 < INITIAL> Identifier236 <TAG> Identifier 233 237 { 234 238 if (this._parseCondition === this._parseConditions.SCRIPT) { … … 237 241 } 238 242 239 if (this._parseCondition === this._parseConditions. TAG) {243 if (this._parseCondition === this._parseConditions.INITIAL) { 240 244 this.tokenType = "html-tag"; 241 245 this._parseCondition = this._parseConditions.ATTRIBUTE; -
trunk/WebCore/inspector/front-end/TextEditor.js
r54133 r54139 977 977 }, 978 978 979 _initFontMetrics: function()979 initFontMetrics: function() 980 980 { 981 981 var computedStyle = window.getComputedStyle(this.element); … … 999 999 this._shortcuts[WebInspector.KeyboardShortcut.makeKey("d", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleDebugMode.bind(this); 1000 1000 this._shortcuts[WebInspector.KeyboardShortcut.makeKey("h", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleHighlightMode.bind(this); 1001 this._shortcuts[WebInspector.KeyboardShortcut.makeKey("m", modifiers.Ctrl | modifiers.Alt)] = this._handleToggleMonospaceMode.bind(this);1002 1001 }, 1003 1002 -
trunk/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
r50411 r54139 66 66 color: rgb(196, 26, 22); 67 67 } 68 69 /* Keep this in sync with view-source.css */ 70 .webkit-html-tag { 71 color: rgb(136, 18, 128); 72 } 73 74 .webkit-html-attr-name { 75 color: rgb(153, 69, 0); 76 } 77 78 .webkit-html-attr-value { 79 color: rgb(26, 26, 166); 80 } 81 82 .webkit-html-comment { 83 color: rgb(35, 110, 37); 84 } 85 86 .webkit-html-doctype { 87 color: rgb(192, 192, 192); 88 }
Note: See TracChangeset
for help on using the changeset viewer.