Changeset 54231 in webkit
- Timestamp:
- Feb 2, 2010 5:59:20 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54229 r54231 1 2010-02-02 Pavel Feldman <pfeldman@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Web Inspector: URLs are not syntax-higlighted as links in source view. 6 7 This change enables linkifier in the NativeTextViewer. It adds 8 "linkify" and "a_node" parse states into the highlighter in order 9 to detect links and distinguish between resource and external ones. 10 Contains drive-by fix for the webkit-html-* styles and moves them to the 11 common location. 12 13 https://bugs.webkit.org/show_bug.cgi?id=34364 14 15 * inspector/front-end/NativeTextViewer.js: 16 (WebInspector.NativeTextViewer): 17 (WebInspector.NativeTextViewer.prototype._createSpan): 18 (WebInspector.NativeTextViewer.prototype._createLink): 19 (WebInspector.NativeTextViewer.prototype._rewriteHref): 20 * inspector/front-end/SourceFrame.js: 21 (WebInspector.SourceFrame.prototype.setContent): 22 (WebInspector.SourceFrame.prototype._createEditorIfNeeded): 23 * inspector/front-end/SourceHTMLTokenizer.js: 24 (WebInspector.SourceHTMLTokenizer): 25 (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttribute): 26 (WebInspector.SourceHTMLTokenizer.prototype._isExpectingAttributeValue): 27 (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttribute): 28 (WebInspector.SourceHTMLTokenizer.prototype._setExpectingAttributeValue): 29 (WebInspector.SourceHTMLTokenizer.prototype._stringToken): 30 (WebInspector.SourceHTMLTokenizer.prototype._attrValueTokenType): 31 (WebInspector.SourceHTMLTokenizer.prototype.nextToken): 32 * inspector/front-end/SourceHTMLTokenizer.re2js: 33 * inspector/front-end/SourceView.js: 34 (WebInspector.SourceView.prototype._contentLoaded): 35 * inspector/front-end/TextEditorHighlighter.js: 36 (WebInspector.TextEditorHighlighter): 37 * inspector/front-end/inspector.css: 38 * inspector/front-end/inspectorSyntaxHighlight.css: 39 1 40 2010-02-02 Simon Hausmann <simon.hausmann@nokia.com> 2 41 -
trunk/WebCore/inspector/front-end/ElementsTreeOutline.js
r54053 r54231 899 899 return hrefValue; 900 900 901 var match;902 var documentURL;903 901 for (var frameOwnerCandidate = node; frameOwnerCandidate; frameOwnerCandidate = frameOwnerCandidate.parentNode) { 904 902 if (frameOwnerCandidate.documentURL) { 905 documentURL = frameOwnerCandidate.documentURL; 903 var result = WebInspector.completeURL(frameOwnerCandidate.documentURL, hrefValue); 904 if (result) 905 return result; 906 906 break; 907 907 } 908 908 } 909 if (documentURL) {910 match = documentURL.match(WebInspector.URLRegExp);911 if (match) {912 var path = hrefValue;913 if (path.charAt(0) !== "/") {914 var documentPath = match[4] || "/";915 path = documentPath.substring(0, documentPath.lastIndexOf("/")) + "/" + path;916 }917 return match[1] + "://" + match[2] + (match[3] ? (":" + match[3]) : "") + path;918 }919 }920 909 921 910 // documentURL not found or has bad value 922 911 for (var url in WebInspector.resourceURLMap) { 923 match = url.match(WebInspector.URLRegExp);912 var match = url.match(WebInspector.URLRegExp); 924 913 if (match && match[4] === hrefValue) 925 914 return url; -
trunk/WebCore/inspector/front-end/NativeTextViewer.js
r54139 r54231 29 29 */ 30 30 31 WebInspector.NativeTextViewer = function(textModel, platform )31 WebInspector.NativeTextViewer = function(textModel, platform, url) 32 32 { 33 33 WebInspector.TextEditor.call(this, textModel, platform); … … 35 35 this._canvas.style.zIndex = 0; 36 36 this._createLineDivs(); 37 this._url = url; 37 38 this._selectionColor = "rgb(241, 234, 0)"; 38 39 } … … 191 192 _createSpan: function(content, className) 192 193 { 194 if (className === "html-resource-link" || className === "html-external-link") 195 return this._createLink(content, className === "html-external-link"); 196 193 197 var span = document.createElement("span"); 194 198 span.className = "webkit-" + className; 195 199 span.appendChild(document.createTextNode(content)); 196 200 return span; 201 }, 202 203 _createLink: function(content, isExternal) 204 { 205 var quote = content.charAt(0); 206 if (content.length > 1 && (quote === "\"" || quote === "'")) 207 content = content.substring(1, content.length - 1); 208 else 209 quote = null; 210 211 var a = WebInspector.linkifyURLAsNode(this._rewriteHref(content), content, null, isExternal); 212 var span = document.createElement("span"); 213 span.className = "webkit-html-attribute-value"; 214 if (quote) 215 span.appendChild(document.createTextNode(quote)); 216 span.appendChild(a); 217 if (quote) 218 span.appendChild(document.createTextNode(quote)); 219 return span; 220 }, 221 222 _rewriteHref: function(hrefValue, isExternal) 223 { 224 if (!this._url || !hrefValue || hrefValue.indexOf("://") > 0) 225 return hrefValue; 226 return WebInspector.completeURL(this._url, hrefValue); 197 227 }, 198 228 -
trunk/WebCore/inspector/front-end/SourceFrame.js
r54139 r54231 124 124 }, 125 125 126 setContent: function(mimeType, content )126 setContent: function(mimeType, content, url) 127 127 { 128 128 this._loaded = true; 129 129 this._textModel.setText(null, content); 130 130 this._mimeType = mimeType; 131 this._url = url; 131 132 this._createEditorIfNeeded(); 132 133 }, … … 138 139 139 140 var editorConstructor = Preferences.useCanvasBasedEditor ? WebInspector.TextEditor : WebInspector.NativeTextViewer; 140 this._editor = new editorConstructor(this._textModel, WebInspector.platform );141 this._editor = new editorConstructor(this._textModel, WebInspector.platform, this._url); 141 142 this._editor.lineNumberDecorator = new WebInspector.BreakpointLineNumberDecorator(this, this._editor.textModel); 142 143 this._editor.lineDecorator = new WebInspector.ExecutionLineDecorator(this); -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.js
r54139 r54231 1 /* Generated by re2c 0.13.5 on Mon Feb 1 19:13:122010 */1 /* Generated by re2c 0.13.5 on Tue Feb 2 00:44:38 2010 */ 2 2 /* 3 3 * Copyright (C) 2009 Google Inc. All rights reserved. … … 50 50 INITIAL: 0, 51 51 COMMENT: 1, 52 TAG: 2, 52 DOCTYPE: 2, 53 TAG: 3, 53 54 DSTRING: 4, 54 55 SSTRING: 5 … … 56 57 this.case_INITIAL = 1000; 57 58 this.case_COMMENT = 1001; 58 this.case_TAG = 1002; 59 this.case_DOCTYPE = 1002; 60 this.case_TAG = 1003; 59 61 this.case_DSTRING = 1004; 60 62 this.case_SSTRING = 1005; … … 64 66 ATTRIBUTE: 1, 65 67 ATTRIBUTE_VALUE: 2, 66 SCRIPT: 3, 67 SCRIPT_ATTRIBUTE: 4, 68 SCRIPT_ATTRIBUTE_VALUE: 5, 69 DOCTYPE: 6 68 LINKIFY: 4, 69 A_NODE: 8, 70 SCRIPT: 16 70 71 }; 71 72 … … 74 75 75 76 WebInspector.SourceHTMLTokenizer.prototype = { 76 _is Attribute: function()77 _isExpectingAttribute: function() 77 78 { 78 return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE;79 return this._parseCondition & this._parseConditions.ATTRIBUTE; 79 80 }, 80 81 81 _is AttributeValue: function()82 _isExpectingAttributeValue: function() 82 83 { 83 return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE;84 return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE; 84 85 }, 85 86 86 _set AttributeValue: function()87 _setExpectingAttribute: function() 87 88 { 88 if (this._parseCondition === this._parseConditions.ATTRIBUTE) 89 this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE; 90 else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE) 91 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE; 89 if (this._isExpectingAttributeValue()) 90 this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE; 91 this._parseCondition |= this._parseConditions.ATTRIBUTE; 92 92 }, 93 93 94 _set Attribute: function()94 _setExpectingAttributeValue: function() 95 95 { 96 if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) 97 this._parseCondition = this._parseConditions.ATTRIBUTE; 98 else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE) 99 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 96 if (this._isExpectingAttribute()) 97 this._parseCondition ^= this._parseConditions.ATTRIBUTE; 98 this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE; 100 99 }, 101 100 102 101 _stringToken: function(cursor, stringEnds) 103 102 { 104 if (this._isAttributeValue()) { 105 this.tokenType = "html-attr-value"; 106 if (stringEnds) 107 this._setAttribute(); 108 } else if (this._parseCondition === this._parseConditions.DOCTYPE) 109 this.tokenType = "html-doctype"; 110 else 103 if (!this._isExpectingAttributeValue()) { 111 104 this.tokenType = null; 105 return cursor; 106 } 107 this.tokenType = this._attrValueTokenType(); 108 if (stringEnds) 109 this._setExpectingAttribute(); 112 110 return cursor; 111 }, 112 113 _attrValueTokenType: function() 114 { 115 if (this._parseCondition & this._parseConditions.LINKIFY) { 116 if (this._parseCondition & this._parseConditions.A_NODE) 117 return "html-external-link"; 118 return "html-resource-link"; 119 } 120 return "html-attribute-value"; 113 121 }, 114 122 … … 124 132 case 1: var yych; 125 133 var yyaccept = 0; 126 if (this.getLexCondition() < 2) {134 if (this.getLexCondition() < 3) { 127 135 if (this.getLexCondition() < 1) { 128 136 { gotoCase = this.case_INITIAL; continue; }; 129 137 } else { 130 { gotoCase = this.case_COMMENT; continue; }; 131 } 132 } else { 133 if (this.getLexCondition() < 3) { 138 if (this.getLexCondition() < 2) { 139 { gotoCase = this.case_COMMENT; continue; }; 140 } else { 141 { gotoCase = this.case_DOCTYPE; continue; }; 142 } 143 } 144 } else { 145 if (this.getLexCondition() < 4) { 134 146 { gotoCase = this.case_TAG; continue; }; 135 147 } else { 136 if (this.getLexCondition() < 4) {148 if (this.getLexCondition() < 5) { 137 149 { gotoCase = this.case_DSTRING; continue; }; 138 150 } else { … … 199 211 } 200 212 /* *********************************** */ 201 case this.case_D STRING:213 case this.case_DOCTYPE: 202 214 yych = this._charAt(cursor); 203 215 if (yych <= '\f') { … … 206 218 } else { 207 219 if (yych <= '\r') { gotoCase = 18; continue; }; 208 if (yych == ' "') { gotoCase = 20; continue; };220 if (yych == '>') { gotoCase = 20; continue; }; 209 221 { gotoCase = 17; continue; }; 210 222 } 211 223 case 16: 212 { return this._stringToken(cursor); }224 { this.tokenType = "html-doctype"; return cursor; } 213 225 case 17: 214 226 yych = this._charAt(++cursor); 215 { gotoCase = 2 4; continue; };227 { gotoCase = 23; continue; }; 216 228 case 18: 217 229 ++cursor; … … 219 231 case 20: 220 232 ++cursor; 221 case 21: 233 this.setLexCondition(this._lexConditions.INITIAL); 234 { this.tokenType = "html-doctype"; return cursor; } 235 case 22: 236 ++cursor; 237 yych = this._charAt(cursor); 238 case 23: 239 if (yych <= '\f') { 240 if (yych == '\n') { gotoCase = 16; continue; }; 241 { gotoCase = 22; continue; }; 242 } else { 243 if (yych <= '\r') { gotoCase = 16; continue; }; 244 if (yych == '>') { gotoCase = 16; continue; }; 245 { gotoCase = 22; continue; }; 246 } 247 /* *********************************** */ 248 case this.case_DSTRING: 249 yych = this._charAt(cursor); 250 if (yych <= '\f') { 251 if (yych == '\n') { gotoCase = 28; continue; }; 252 { gotoCase = 27; continue; }; 253 } else { 254 if (yych <= '\r') { gotoCase = 28; continue; }; 255 if (yych == '"') { gotoCase = 30; continue; }; 256 { gotoCase = 27; continue; }; 257 } 258 case 26: 259 { return this._stringToken(cursor); } 260 case 27: 261 yych = this._charAt(++cursor); 262 { gotoCase = 34; continue; }; 263 case 28: 264 ++cursor; 265 { this.tokenType = null; return cursor; } 266 case 30: 267 ++cursor; 268 case 31: 222 269 this.setLexCondition(this._lexConditions.TAG); 223 270 { return this._stringToken(cursor, true); } 224 case 22:225 yych = this._charAt(++cursor); 226 { gotoCase = 21; continue; };227 case 23:228 ++cursor; 229 yych = this._charAt(cursor); 230 case 24:231 if (yych <= '\f') { 232 if (yych == '\n') { gotoCase = 16; continue; };233 { gotoCase = 23; continue; };234 } else { 235 if (yych <= '\r') { gotoCase = 16; continue; };236 if (yych == '"') { gotoCase = 22; continue; };237 { gotoCase = 23; continue; };271 case 32: 272 yych = this._charAt(++cursor); 273 { gotoCase = 31; continue; }; 274 case 33: 275 ++cursor; 276 yych = this._charAt(cursor); 277 case 34: 278 if (yych <= '\f') { 279 if (yych == '\n') { gotoCase = 26; continue; }; 280 { gotoCase = 33; continue; }; 281 } else { 282 if (yych <= '\r') { gotoCase = 26; continue; }; 283 if (yych == '"') { gotoCase = 32; continue; }; 284 { gotoCase = 33; continue; }; 238 285 } 239 286 /* *********************************** */ 240 287 case this.case_INITIAL: 241 288 yych = this._charAt(cursor); 242 if (yych == '<') { gotoCase = 29; continue; };289 if (yych == '<') { gotoCase = 39; continue; }; 243 290 ++cursor; 244 291 { this.tokenType = null; return cursor; } 245 case 29:292 case 39: 246 293 yyaccept = 0; 247 294 yych = this._charAt(YYMARKER = ++cursor); 248 295 if (yych <= '/') { 249 if (yych == '!') { gotoCase = 34; continue; };250 if (yych >= '/') { gotoCase = 31; continue; };296 if (yych == '!') { gotoCase = 44; continue; }; 297 if (yych >= '/') { gotoCase = 41; continue; }; 251 298 } else { 252 299 if (yych <= 'S') { 253 if (yych >= 'S') { gotoCase = 32; continue; };300 if (yych >= 'S') { gotoCase = 42; continue; }; 254 301 } else { 255 if (yych == 's') { gotoCase = 32; continue; }; 256 } 257 } 258 case 30: 302 if (yych == 's') { gotoCase = 42; continue; }; 303 } 304 } 305 case 40: 306 this.setLexCondition(this._lexConditions.TAG); 259 307 { 260 if (this._parseCondition === this._parseConditions.SCRIPT) { 308 if (this._parseCondition & this._parseConditions.SCRIPT) { 309 // Do not tokenize script tag contents, keep lexer state although processing "<". 310 this.setLexCondition(this._lexConditions.INITIAL); 261 311 this.tokenType = null; 262 312 return cursor; 263 313 } 264 314 265 this.setLexCondition(this._lexConditions.TAG); 266 315 this._parseCondition = this._parseConditions.INITIAL; 267 316 this.tokenType = "html-tag"; 268 this._parseCondition = this._parseConditions.INITIAL;269 317 return cursor; 270 318 } 271 case 31:319 case 41: 272 320 yyaccept = 0; 273 321 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:322 if (yych == 'S') { gotoCase = 68; continue; }; 323 if (yych == 's') { gotoCase = 68; continue; }; 324 { gotoCase = 40; continue; }; 325 case 42: 326 yych = this._charAt(++cursor); 327 if (yych == 'C') { gotoCase = 62; continue; }; 328 if (yych == 'c') { gotoCase = 62; continue; }; 329 case 43: 282 330 cursor = YYMARKER; 283 { gotoCase = 30; continue; };284 case 34:331 { gotoCase = 40; continue; }; 332 case 44: 285 333 yych = this._charAt(++cursor); 286 334 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; }; 335 if (yych != '-') { gotoCase = 43; continue; }; 336 } else { 337 if (yych <= 'D') { gotoCase = 46; continue; }; 338 if (yych == 'd') { gotoCase = 46; continue; }; 339 { gotoCase = 43; continue; }; 340 } 341 yych = this._charAt(++cursor); 342 if (yych == '-') { gotoCase = 54; continue; }; 343 { gotoCase = 43; continue; }; 344 case 46: 345 yych = this._charAt(++cursor); 346 if (yych == 'O') { gotoCase = 47; continue; }; 347 if (yych != 'o') { gotoCase = 43; continue; }; 342 348 case 47: 349 yych = this._charAt(++cursor); 350 if (yych == 'C') { gotoCase = 48; continue; }; 351 if (yych != 'c') { gotoCase = 43; continue; }; 352 case 48: 353 yych = this._charAt(++cursor); 354 if (yych == 'T') { gotoCase = 49; continue; }; 355 if (yych != 't') { gotoCase = 43; continue; }; 356 case 49: 357 yych = this._charAt(++cursor); 358 if (yych == 'Y') { gotoCase = 50; continue; }; 359 if (yych != 'y') { gotoCase = 43; continue; }; 360 case 50: 361 yych = this._charAt(++cursor); 362 if (yych == 'P') { gotoCase = 51; continue; }; 363 if (yych != 'p') { gotoCase = 43; continue; }; 364 case 51: 365 yych = this._charAt(++cursor); 366 if (yych == 'E') { gotoCase = 52; continue; }; 367 if (yych != 'e') { gotoCase = 43; continue; }; 368 case 52: 369 ++cursor; 370 this.setLexCondition(this._lexConditions.DOCTYPE); 371 { this.tokenType = "html-doctype"; return cursor; } 372 case 54: 373 ++cursor; 374 yych = this._charAt(cursor); 375 if (yych <= '\f') { 376 if (yych == '\n') { gotoCase = 57; continue; }; 377 { gotoCase = 54; continue; }; 378 } else { 379 if (yych <= '\r') { gotoCase = 57; continue; }; 380 if (yych != '-') { gotoCase = 54; continue; }; 381 } 382 ++cursor; 383 yych = this._charAt(cursor); 384 if (yych == '-') { gotoCase = 59; continue; }; 385 { gotoCase = 43; continue; }; 386 case 57: 343 387 ++cursor; 344 388 this.setLexCondition(this._lexConditions.COMMENT); 345 389 { this.tokenType = "html-comment"; return cursor; } 346 case 49:347 ++cursor; 348 yych = this._charAt(cursor); 349 if (yych != '>') { gotoCase = 44; continue; };390 case 59: 391 ++cursor; 392 yych = this._charAt(cursor); 393 if (yych != '>') { gotoCase = 54; continue; }; 350 394 ++cursor; 351 395 { 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:396 case 62: 397 yych = this._charAt(++cursor); 398 if (yych == 'R') { gotoCase = 63; continue; }; 399 if (yych != 'r') { gotoCase = 43; continue; }; 400 case 63: 401 yych = this._charAt(++cursor); 402 if (yych == 'I') { gotoCase = 64; continue; }; 403 if (yych != 'i') { gotoCase = 43; continue; }; 404 case 64: 405 yych = this._charAt(++cursor); 406 if (yych == 'P') { gotoCase = 65; continue; }; 407 if (yych != 'p') { gotoCase = 43; continue; }; 408 case 65: 409 yych = this._charAt(++cursor); 410 if (yych == 'T') { gotoCase = 66; continue; }; 411 if (yych != 't') { gotoCase = 43; continue; }; 412 case 66: 369 413 ++cursor; 370 414 this.setLexCondition(this._lexConditions.TAG); 371 415 { 372 416 this.tokenType = "html-tag"; 373 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 417 this._parseCondition = this._parseConditions.SCRIPT; 418 this._setExpectingAttribute(); 374 419 return cursor; 375 420 } 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:421 case 68: 422 yych = this._charAt(++cursor); 423 if (yych == 'C') { gotoCase = 69; continue; }; 424 if (yych != 'c') { gotoCase = 43; continue; }; 425 case 69: 426 yych = this._charAt(++cursor); 427 if (yych == 'R') { gotoCase = 70; continue; }; 428 if (yych != 'r') { gotoCase = 43; continue; }; 429 case 70: 430 yych = this._charAt(++cursor); 431 if (yych == 'I') { gotoCase = 71; continue; }; 432 if (yych != 'i') { gotoCase = 43; continue; }; 433 case 71: 434 yych = this._charAt(++cursor); 435 if (yych == 'P') { gotoCase = 72; continue; }; 436 if (yych != 'p') { gotoCase = 43; continue; }; 437 case 72: 438 yych = this._charAt(++cursor); 439 if (yych == 'T') { gotoCase = 73; continue; }; 440 if (yych != 't') { gotoCase = 43; continue; }; 441 case 73: 397 442 ++cursor; 398 443 this.setLexCondition(this._lexConditions.TAG); … … 406 451 yych = this._charAt(cursor); 407 452 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:453 if (yych == '\n') { gotoCase = 79; continue; }; 454 { gotoCase = 78; continue; }; 455 } else { 456 if (yych <= '\r') { gotoCase = 79; continue; }; 457 if (yych == '\'') { gotoCase = 81; continue; }; 458 { gotoCase = 78; continue; }; 459 } 460 case 77: 416 461 { return this._stringToken(cursor); } 417 case 68:418 yych = this._charAt(++cursor); 419 { gotoCase = 75; continue; };420 case 69:462 case 78: 463 yych = this._charAt(++cursor); 464 { gotoCase = 85; continue; }; 465 case 79: 421 466 ++cursor; 422 467 { this.tokenType = null; return cursor; } 423 case 71:424 ++cursor; 425 case 72:468 case 81: 469 ++cursor; 470 case 82: 426 471 this.setLexCondition(this._lexConditions.TAG); 427 472 { 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; };473 case 83: 474 yych = this._charAt(++cursor); 475 { gotoCase = 82; continue; }; 476 case 84: 477 ++cursor; 478 yych = this._charAt(cursor); 479 case 85: 480 if (yych <= '\f') { 481 if (yych == '\n') { gotoCase = 77; continue; }; 482 { gotoCase = 84; continue; }; 483 } else { 484 if (yych <= '\r') { gotoCase = 77; continue; }; 485 if (yych == '\'') { gotoCase = 83; continue; }; 486 { gotoCase = 84; continue; }; 442 487 } 443 488 /* *********************************** */ 444 489 case this.case_TAG: 445 490 yych = this._charAt(cursor); 446 if (yych <= ' =') {447 if (yych <= '\ '') {448 if (yych == ' "') { gotoCase = 80; continue; };449 if (yych >= '\ '') { gotoCase = 81; continue; };491 if (yych <= '&') { 492 if (yych <= '\r') { 493 if (yych == '\n') { gotoCase = 90; continue; }; 494 if (yych >= '\r') { gotoCase = 90; continue; }; 450 495 } 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; }; 496 if (yych <= ' ') { 497 if (yych >= ' ') { gotoCase = 90; continue; }; 498 } else { 499 if (yych == '"') { gotoCase = 92; continue; }; 500 } 501 } 502 } else { 503 if (yych <= '>') { 504 if (yych <= ';') { 505 if (yych <= '\'') { gotoCase = 93; continue; }; 506 } else { 507 if (yych <= '<') { gotoCase = 90; continue; }; 508 if (yych <= '=') { gotoCase = 94; continue; }; 509 { gotoCase = 96; continue; }; 510 } 460 511 } else { 461 if (yych <= ' `') {462 if (yych <= '_') { gotoCase = 82; continue; };512 if (yych <= '[') { 513 if (yych >= '[') { gotoCase = 90; continue; }; 463 514 } 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: 515 if (yych == ']') { gotoCase = 90; continue; }; 516 } 517 } 518 } 519 ++cursor; 520 yych = this._charAt(cursor); 521 { gotoCase = 109; continue; }; 522 case 89: 485 523 { 486 524 if (this._parseCondition === this._parseConditions.SCRIPT) { 525 // Fall through if expecting attributes. 487 526 this.tokenType = null; 488 527 return cursor; … … 491 530 if (this._parseCondition === this._parseConditions.INITIAL) { 492 531 this.tokenType = "html-tag"; 493 this._parseCondition = this._parseConditions.ATTRIBUTE; 494 } else if (this._isAttribute()) 495 this.tokenType = "html-attr-name"; 496 else if (this._isAttributeValue()) 497 this.tokenType = "html-attr-value"; 498 else if (this._parseCondition === this._parseConditions.DOCTYPE) 499 this.tokenType = "html-doctype"; 532 this._setExpectingAttribute(); 533 var token = this._line.substring(cursorOnEnter, cursor); 534 if (token === "a") 535 this._parseCondition |= this._parseConditions.A_NODE; 536 else if (this._parseCondition & this._parseConditions.A_NODE) 537 this._parseCondition ^= this._parseConditions.A_NODE; 538 } else if (this._isExpectingAttribute()) { 539 var token = this._line.substring(cursorOnEnter, cursor); 540 if (token === "href" || token === "src") 541 this._parseCondition |= this._parseConditions.LINKIFY; 542 else if (this._parseCondition |= this._parseConditions.LINKIFY) 543 this._parseCondition ^= this._parseConditions.LINKIFY; 544 this.tokenType = "html-attribute-name"; 545 } else if (this._isExpectingAttributeValue()) 546 this.tokenType = this._attrValueTokenType(); 500 547 else 501 548 this.tokenType = null; 502 549 return cursor; 503 550 } 504 case 84: 551 case 90: 552 ++cursor; 553 { this.tokenType = null; return cursor; } 554 case 92: 555 yyaccept = 0; 556 yych = this._charAt(YYMARKER = ++cursor); 557 { gotoCase = 105; continue; }; 558 case 93: 559 yyaccept = 0; 560 yych = this._charAt(YYMARKER = ++cursor); 561 { gotoCase = 99; continue; }; 562 case 94: 505 563 ++cursor; 506 564 { 507 if (this._isAttribute()) { 508 this.tokenType = null; 509 this._setAttributeValue(); 510 } else if (this._parseCondition === this._parseConditions.DOCTYPE) 511 this.tokenType = "html-doctype"; 512 else 513 this.tokenType = null; 565 if (this._isExpectingAttribute()) 566 this._setExpectingAttributeValue(); 567 this.tokenType = null; 514 568 return cursor; 515 569 } 516 case 86:570 case 96: 517 571 ++cursor; 518 572 this.setLexCondition(this._lexConditions.INITIAL); 519 573 { 520 if (this._parseCondition === this._parseConditions.SCRIPT) { 574 if (this._parseCondition & this._parseConditions.SCRIPT) { 575 // Do not tokenize script tag contents. 521 576 this.tokenType = null; 522 577 return cursor; 523 578 } 524 579 525 if (this._parseCondition === this._parseConditions.DOCTYPE) 526 this.tokenType = "html-doctype"; 527 else 528 this.tokenType = "html-tag"; 529 530 if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE) 531 this._parseCondition = this._parseConditions.SCRIPT; 532 else 533 this._parseCondition = this._parseConditions.INITIAL; 580 this._parseCondition = this._parseConditions.INITIAL; 581 this.tokenType = "html-tag"; 534 582 return cursor; 535 583 } 536 case 88: 537 ++cursor; 538 yych = this._charAt(cursor); 539 case 89: 540 if (yych <= '^') { 541 if (yych <= '9') { 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; }; 548 } 549 } else { 550 if (yych <= '`') { 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: 584 case 98: 585 ++cursor; 586 yych = this._charAt(cursor); 587 case 99: 588 if (yych <= '\f') { 589 if (yych != '\n') { gotoCase = 98; continue; }; 590 } else { 591 if (yych <= '\r') { gotoCase = 100; continue; }; 592 if (yych == '\'') { gotoCase = 102; continue; }; 593 { gotoCase = 98; continue; }; 594 } 595 case 100: 571 596 ++cursor; 572 597 this.setLexCondition(this._lexConditions.SSTRING); 573 598 { return this._stringToken(cursor); } 574 case 94:599 case 102: 575 600 ++cursor; 576 601 { return this._stringToken(cursor, true); } 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:602 case 104: 603 ++cursor; 604 yych = this._charAt(cursor); 605 case 105: 606 if (yych <= '\f') { 607 if (yych != '\n') { gotoCase = 104; continue; }; 608 } else { 609 if (yych <= '\r') { gotoCase = 106; continue; }; 610 if (yych == '"') { gotoCase = 102; continue; }; 611 { gotoCase = 104; continue; }; 612 } 613 case 106: 589 614 ++cursor; 590 615 this.setLexCondition(this._lexConditions.DSTRING); 591 616 { return this._stringToken(cursor); } 617 case 108: 618 ++cursor; 619 yych = this._charAt(cursor); 620 case 109: 621 if (yych <= '"') { 622 if (yych <= '\r') { 623 if (yych == '\n') { gotoCase = 89; continue; }; 624 if (yych <= '\f') { gotoCase = 108; continue; }; 625 { gotoCase = 89; continue; }; 626 } else { 627 if (yych == ' ') { gotoCase = 89; continue; }; 628 if (yych <= '!') { gotoCase = 108; continue; }; 629 { gotoCase = 89; continue; }; 630 } 631 } else { 632 if (yych <= '>') { 633 if (yych == '\'') { gotoCase = 89; continue; }; 634 if (yych <= ';') { gotoCase = 108; continue; }; 635 { gotoCase = 89; continue; }; 636 } else { 637 if (yych <= '[') { 638 if (yych <= 'Z') { gotoCase = 108; continue; }; 639 { gotoCase = 89; continue; }; 640 } else { 641 if (yych == ']') { gotoCase = 89; continue; }; 642 { gotoCase = 108; continue; }; 643 } 644 } 645 } 592 646 } 593 647 -
trunk/WebCore/inspector/front-end/SourceHTMLTokenizer.re2js
r54139 r54231 49 49 INITIAL: 0, 50 50 COMMENT: 1, 51 TAG: 2, 51 DOCTYPE: 2, 52 TAG: 3, 52 53 DSTRING: 4, 53 54 SSTRING: 5 … … 55 56 this.case_INITIAL = 1000; 56 57 this.case_COMMENT = 1001; 57 this.case_TAG = 1002; 58 this.case_DOCTYPE = 1002; 59 this.case_TAG = 1003; 58 60 this.case_DSTRING = 1004; 59 61 this.case_SSTRING = 1005; … … 63 65 ATTRIBUTE: 1, 64 66 ATTRIBUTE_VALUE: 2, 65 SCRIPT: 3, 66 SCRIPT_ATTRIBUTE: 4, 67 SCRIPT_ATTRIBUTE_VALUE: 5, 68 DOCTYPE: 6 67 LINKIFY: 4, 68 A_NODE: 8, 69 SCRIPT: 16 69 70 }; 70 71 … … 73 74 74 75 WebInspector.SourceHTMLTokenizer.prototype = { 75 _isAttribute: function() 76 { 77 return this._parseCondition === this._parseConditions.ATTRIBUTE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE; 78 }, 79 80 _isAttributeValue: function() 81 { 82 return this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE || this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE; 83 }, 84 85 _setAttributeValue: function() 86 { 87 if (this._parseCondition === this._parseConditions.ATTRIBUTE) 88 this._parseCondition = this._parseConditions.ATTRIBUTE_VALUE; 89 else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE) 90 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE_VALUE; 91 }, 92 93 _setAttribute: function() 94 { 95 if (this._parseCondition === this._parseConditions.ATTRIBUTE_VALUE) 96 this._parseCondition = this._parseConditions.ATTRIBUTE; 97 else if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE_VALUE) 98 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 76 _isExpectingAttribute: function() 77 { 78 return this._parseCondition & this._parseConditions.ATTRIBUTE; 79 }, 80 81 _isExpectingAttributeValue: function() 82 { 83 return this._parseCondition & this._parseConditions.ATTRIBUTE_VALUE; 84 }, 85 86 _setExpectingAttribute: function() 87 { 88 if (this._isExpectingAttributeValue()) 89 this._parseCondition ^= this._parseConditions.ATTRIBUTE_VALUE; 90 this._parseCondition |= this._parseConditions.ATTRIBUTE; 91 }, 92 93 _setExpectingAttributeValue: function() 94 { 95 if (this._isExpectingAttribute()) 96 this._parseCondition ^= this._parseConditions.ATTRIBUTE; 97 this._parseCondition |= this._parseConditions.ATTRIBUTE_VALUE; 99 98 }, 100 99 101 100 _stringToken: function(cursor, stringEnds) 102 101 { 103 if (this._isAttributeValue()) { 104 this.tokenType = "html-attr-value"; 105 if (stringEnds) 106 this._setAttribute(); 107 } else if (this._parseCondition === this._parseConditions.DOCTYPE) 108 this.tokenType = "html-doctype"; 109 else 102 if (!this._isExpectingAttributeValue()) { 110 103 this.tokenType = null; 104 return cursor; 105 } 106 this.tokenType = this._attrValueTokenType(); 107 if (stringEnds) 108 this._setExpectingAttribute(); 111 109 return cursor; 110 }, 111 112 _attrValueTokenType: function() 113 { 114 if (this._parseCondition & this._parseConditions.LINKIFY) { 115 if (this._parseCondition & this._parseConditions.A_NODE) 116 return "html-external-link"; 117 return "html-resource-link"; 118 } 119 return "html-attribute-value"; 112 120 }, 113 121 … … 136 144 CommentEnd = CommentContent "-->"; 137 145 138 DocTypeLT = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee]; 146 DocTypeStart = "<!" [Dd] [Oo] [Cc] [Tt] [Yy] [Pp] [Ee]; 147 DocTypeContent = [^\r\n>]*; 148 139 149 ScriptStart = "<" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt]; 140 150 ScriptEnd = "</" [Ss] [Cc] [Rr] [Ii] [Pp] [Tt]; … … 152 162 SingleStringEnd = SingleStringContent "'"; 153 163 154 Identifier = [ _a-zA-Z0-9\x80-\xFF]+;164 Identifier = [^ \r\n"'<>\[\]=]+; 155 165 156 166 <INITIAL> Comment { this.tokenType = "html-comment"; return cursor; } … … 159 169 <COMMENT> CommentEnd => INITIAL { this.tokenType = "html-comment"; return cursor; } 160 170 161 <INITIAL> DocTypeLT => TAG 162 { 163 this.tokenType = "html-doctype"; 164 this._parseCondition = this._parseConditions.DOCTYPE; 165 return cursor; 166 } 171 <INITIAL> DocTypeStart => DOCTYPE { this.tokenType = "html-doctype"; return cursor; } 172 <DOCTYPE> DocTypeContent => DOCTYPE { this.tokenType = "html-doctype"; return cursor; } 173 <DOCTYPE> GT => INITIAL { this.tokenType = "html-doctype"; return cursor; } 167 174 168 175 <INITIAL> ScriptStart => TAG 169 176 { 170 177 this.tokenType = "html-tag"; 171 this._parseCondition = this._parseConditions.SCRIPT_ATTRIBUTE; 178 this._parseCondition = this._parseConditions.SCRIPT; 179 this._setExpectingAttribute(); 172 180 return cursor; 173 181 } … … 180 188 } 181 189 182 <INITIAL> LT 183 { 184 if (this._parseCondition === this._parseConditions.SCRIPT) { 190 <INITIAL> LT => TAG 191 { 192 if (this._parseCondition & this._parseConditions.SCRIPT) { 193 // Do not tokenize script tag contents, keep lexer state although processing "<". 194 this.setLexCondition(this._lexConditions.INITIAL); 185 195 this.tokenType = null; 186 196 return cursor; 187 197 } 188 198 189 // Only make lexer transition if not in script tag.190 this.setLexCondition(this._lexConditions.TAG);191 192 this.tokenType = "html-tag";193 199 this._parseCondition = this._parseConditions.INITIAL; 200 this.tokenType = "html-tag"; 194 201 return cursor; 195 202 } … … 197 204 <TAG> GT => INITIAL 198 205 { 199 if (this._parseCondition === this._parseConditions.SCRIPT) { 206 if (this._parseCondition & this._parseConditions.SCRIPT) { 207 // Do not tokenize script tag contents. 200 208 this.tokenType = null; 201 209 return cursor; 202 210 } 203 211 204 if (this._parseCondition === this._parseConditions.DOCTYPE) 205 this.tokenType = "html-doctype"; 206 else 207 this.tokenType = "html-tag"; 208 209 if (this._parseCondition === this._parseConditions.SCRIPT_ATTRIBUTE) 210 this._parseCondition = this._parseConditions.SCRIPT; 211 else 212 this._parseCondition = this._parseConditions.INITIAL; 212 this._parseCondition = this._parseConditions.INITIAL; 213 this.tokenType = "html-tag"; 213 214 return cursor; 214 215 } … … 224 225 <TAG> EqualSign => TAG 225 226 { 226 if (this._isAttribute()) { 227 this.tokenType = null; 228 this._setAttributeValue(); 229 } else if (this._parseCondition === this._parseConditions.DOCTYPE) 230 this.tokenType = "html-doctype"; 231 else 232 this.tokenType = null; 227 if (this._isExpectingAttribute()) 228 this._setExpectingAttributeValue(); 229 this.tokenType = null; 233 230 return cursor; 234 231 } … … 237 234 { 238 235 if (this._parseCondition === this._parseConditions.SCRIPT) { 236 // Fall through if expecting attributes. 239 237 this.tokenType = null; 240 238 return cursor; … … 243 241 if (this._parseCondition === this._parseConditions.INITIAL) { 244 242 this.tokenType = "html-tag"; 245 this._parseCondition = this._parseConditions.ATTRIBUTE; 246 } else if (this._isAttribute()) 247 this.tokenType = "html-attr-name"; 248 else if (this._isAttributeValue()) 249 this.tokenType = "html-attr-value"; 250 else if (this._parseCondition === this._parseConditions.DOCTYPE) 251 this.tokenType = "html-doctype"; 243 this._setExpectingAttribute(); 244 var token = this._line.substring(cursorOnEnter, cursor); 245 if (token === "a") 246 this._parseCondition |= this._parseConditions.A_NODE; 247 else if (this._parseCondition & this._parseConditions.A_NODE) 248 this._parseCondition ^= this._parseConditions.A_NODE; 249 } else if (this._isExpectingAttribute()) { 250 var token = this._line.substring(cursorOnEnter, cursor); 251 if (token === "href" || token === "src") 252 this._parseCondition |= this._parseConditions.LINKIFY; 253 else if (this._parseCondition |= this._parseConditions.LINKIFY) 254 this._parseCondition ^= this._parseConditions.LINKIFY; 255 this.tokenType = "html-attribute-name"; 256 } else if (this._isExpectingAttributeValue()) 257 this.tokenType = this._attrValueTokenType(); 252 258 else 253 259 this.tokenType = null; -
trunk/WebCore/inspector/front-end/SourceView.js
r54148 r54231 87 87 _contentLoaded: function(content) 88 88 { 89 this.sourceFrame.setContent(this.resource.mimeType, content );89 this.sourceFrame.setContent(this.resource.mimeType, content, this.resource.url); 90 90 this._sourceFrameSetupFinished(); 91 91 }, -
trunk/WebCore/inspector/front-end/TextEditorHighlighter.js
r54110 r54231 48 48 /* Keep this in sync with inspector.css and view-source.css */ 49 49 this._styles["html-tag"] = "rgb(136, 18, 128)"; 50 this._styles["html-attr -name"] = "rgb(153, 69, 0)";51 this._styles["html-attr -value"] = "rgb(26, 26, 166)";50 this._styles["html-attribute-name"] = "rgb(153, 69, 0)"; 51 this._styles["html-attribute-value"] = "rgb(26, 26, 166)"; 52 52 this._styles["html-comment"] = "rgb(35, 110, 37)"; 53 53 this._styles["html-doctype"] = "rgb(192, 192, 192)"; 54 this._styles["html-external-link"] = "#00e"; 55 this._styles["html-resource-link"] = "#00e"; 54 56 55 57 this._styles["javascript-comment"] = "rgb(0, 116, 0)"; -
trunk/WebCore/inspector/front-end/inspector.css
r54133 r54231 1188 1188 } 1189 1189 1190 .webkit-html-comment {1191 /* Keep this in sync with view-source.css (.webkit-html-comment) */1192 color: rgb(35, 110, 37);1193 }1194 1195 .webkit-html-tag {1196 /* Keep this in sync with view-source.css (.webkit-html-tag) */1197 color: rgb(136, 18, 128);1198 }1199 1200 .webkit-html-doctype {1201 /* Keep this in sync with view-source.css (.webkit-html-doctype) */1202 color: rgb(192, 192, 192);1203 }1204 1205 .webkit-html-attribute-name {1206 /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */1207 color: rgb(153, 69, 0);1208 }1209 1210 .webkit-html-attribute-value {1211 /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */1212 color: rgb(26, 26, 166);1213 }1214 1215 .webkit-html-external-link, .webkit-html-resource-link {1216 /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */1217 color: #00e;1218 }1219 1220 .webkit-html-external-link {1221 /* Keep this in sync with view-source.css (.webkit-html-external-link) */1222 text-decoration: none;1223 }1224 1225 .webkit-html-external-link:hover {1226 /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */1227 text-decoration: underline;1228 }1229 1230 1190 .add-attribute { 1231 1191 margin-left: 1px; -
trunk/WebCore/inspector/front-end/inspector.js
r54067 r54231 1527 1527 // FIXME: Get rid of linkifyURL entirely. 1528 1528 return WebInspector.linkifyURLAsNode(url, linkText, classes, isExternal, tooltipText).outerHTML; 1529 } 1530 1531 WebInspector.completeURL = function(baseURL, href) 1532 { 1533 var match = baseURL.match(WebInspector.URLRegExp); 1534 if (match) { 1535 var path = href; 1536 if (path.charAt(0) !== "/") { 1537 var basePath = match[4] || "/"; 1538 path = basePath.substring(0, basePath.lastIndexOf("/")) + "/" + path; 1539 } 1540 return match[1] + "://" + match[2] + (match[3] ? (":" + match[3]) : "") + path; 1541 } 1542 return null; 1529 1543 } 1530 1544 -
trunk/WebCore/inspector/front-end/inspectorSyntaxHighlight.css
r54139 r54231 67 67 } 68 68 69 /* Keep this in sync with view-source.css */ 69 .webkit-html-comment { 70 /* Keep this in sync with view-source.css (.webkit-html-comment) */ 71 color: rgb(35, 110, 37); 72 } 73 70 74 .webkit-html-tag { 75 /* Keep this in sync with view-source.css (.webkit-html-tag) */ 71 76 color: rgb(136, 18, 128); 72 77 } 73 78 74 .webkit-html-attr-name { 79 .webkit-html-doctype { 80 /* Keep this in sync with view-source.css (.webkit-html-doctype) */ 81 color: rgb(192, 192, 192); 82 } 83 84 .webkit-html-attribute-name { 85 /* Keep this in sync with view-source.css (.webkit-html-attribute-name) */ 75 86 color: rgb(153, 69, 0); 76 87 } 77 88 78 .webkit-html-attr-value { 89 .webkit-html-attribute-value { 90 /* Keep this in sync with view-source.css (.webkit-html-attribute-value) */ 79 91 color: rgb(26, 26, 166); 80 92 } 81 93 82 .webkit-html-comment { 83 color: rgb(35, 110, 37); 94 .webkit-html-external-link, .webkit-html-resource-link { 95 /* Keep this in sync with view-source.css (.webkit-html-external-link, .webkit-html-resource-link) */ 96 color: #00e; 84 97 } 85 98 86 .webkit-html-doctype { 87 color: rgb(192, 192, 192); 99 .webkit-html-external-link { 100 /* Keep this in sync with view-source.css (.webkit-html-external-link) */ 101 text-decoration: none; 88 102 } 103 104 .webkit-html-external-link:hover { 105 /* Keep this in sync with view-source.css (.webkit-html-external-link:hover) */ 106 text-decoration: underline; 107 }
Note: See TracChangeset
for help on using the changeset viewer.