OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 if (media.sourceURL) { | 1188 if (media.sourceURL) { |
1189 var refElement = mediaDataElement.createChild("div", "subtitle")
; | 1189 var refElement = mediaDataElement.createChild("div", "subtitle")
; |
1190 var rawLocation; | 1190 var rawLocation; |
1191 var mediaHeader; | 1191 var mediaHeader; |
1192 if (media.range) { | 1192 if (media.range) { |
1193 mediaHeader = media.header(); | 1193 mediaHeader = media.header(); |
1194 if (mediaHeader) { | 1194 if (mediaHeader) { |
1195 var lineNumber = media.lineNumberInSource(); | 1195 var lineNumber = media.lineNumberInSource(); |
1196 var columnNumber = media.columnNumberInSource(); | 1196 var columnNumber = media.columnNumberInSource(); |
1197 console.assert(typeof lineNumber !== "undefined" && type
of columnNumber !== "undefined"); | 1197 console.assert(typeof lineNumber !== "undefined" && type
of columnNumber !== "undefined"); |
1198 rawLocation = new WebInspector.CSSLocation(this._parentP
ane._target, media.sourceURL, lineNumber, columnNumber); | 1198 rawLocation = new WebInspector.CSSLocation(this._parentP
ane._target, mediaHeader.id, media.sourceURL, lineNumber, columnNumber); |
1199 } | 1199 } |
1200 } | 1200 } |
1201 | 1201 |
1202 var anchor; | 1202 var anchor; |
1203 if (rawLocation) | 1203 if (rawLocation) { |
1204 anchor = this._parentPane._linkifier.linkifyCSSLocation(medi
aHeader.id, rawLocation); | 1204 anchor = this._parentPane._linkifier.linkifyCSSLocation(rawL
ocation); |
1205 else { | 1205 } else { |
1206 // The "linkedStylesheet" case. | 1206 // The "linkedStylesheet" case. |
1207 anchor = WebInspector.linkifyResourceAsNode(media.sourceURL,
undefined, "subtitle", media.sourceURL); | 1207 anchor = WebInspector.linkifyResourceAsNode(media.sourceURL,
undefined, "subtitle", media.sourceURL); |
1208 } | 1208 } |
1209 anchor.style.float = "right"; | 1209 anchor.style.float = "right"; |
1210 refElement.appendChild(anchor); | 1210 refElement.appendChild(anchor); |
1211 } | 1211 } |
1212 | 1212 |
1213 var mediaTextElement = mediaDataElement.createChild("span"); | 1213 var mediaTextElement = mediaDataElement.createChild("span"); |
1214 mediaTextElement.textContent = mediaText; | 1214 mediaTextElement.textContent = mediaText; |
1215 mediaTextElement.title = media.text; | 1215 mediaTextElement.title = media.text; |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 | 1441 |
1442 var selectors = rule.selectors; | 1442 var selectors = rule.selectors; |
1443 var fragment = document.createDocumentFragment(); | 1443 var fragment = document.createDocumentFragment(); |
1444 var currentMatch = 0; | 1444 var currentMatch = 0; |
1445 for (var i = 0; i < selectors.length ; ++i) { | 1445 for (var i = 0; i < selectors.length ; ++i) { |
1446 if (i) | 1446 if (i) |
1447 fragment.appendChild(document.createTextNode(", ")); | 1447 fragment.appendChild(document.createTextNode(", ")); |
1448 var isSelectorMatching = matchingSelectors[currentMatch] === i; | 1448 var isSelectorMatching = matchingSelectors[currentMatch] === i; |
1449 if (isSelectorMatching) | 1449 if (isSelectorMatching) |
1450 ++currentMatch; | 1450 ++currentMatch; |
1451 var rawLocation = new WebInspector.CSSLocation(this._parentPane._tar
get, rule.sourceURL, rule.lineNumberInSource(i), rule.columnNumberInSource(i)); | |
1452 var matchingSelectorClass = isSelectorMatching ? " selector-matches"
: ""; | 1451 var matchingSelectorClass = isSelectorMatching ? " selector-matches"
: ""; |
1453 var selectorElement = document.createElement("span"); | 1452 var selectorElement = document.createElement("span"); |
1454 selectorElement.className = "simple-selector" + matchingSelectorClas
s; | 1453 selectorElement.className = "simple-selector" + matchingSelectorClas
s; |
1455 if (rule.styleSheetId) | 1454 if (rule.styleSheetId) |
1456 selectorElement._selectorIndex = i; | 1455 selectorElement._selectorIndex = i; |
1457 selectorElement.textContent = selectors[i].value; | 1456 selectorElement.textContent = selectors[i].value; |
1458 | 1457 |
1459 fragment.appendChild(selectorElement); | 1458 fragment.appendChild(selectorElement); |
1460 } | 1459 } |
1461 | 1460 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1516 { | 1515 { |
1517 var link = WebInspector.linkifyResourceAsNode(url, line, "", url + "
:" + (line + 1)); | 1516 var link = WebInspector.linkifyResourceAsNode(url, line, "", url + "
:" + (line + 1)); |
1518 link.classList.add("webkit-html-resource-link"); | 1517 link.classList.add("webkit-html-resource-link"); |
1519 link.setAttribute("data-uncopyable", link.textContent); | 1518 link.setAttribute("data-uncopyable", link.textContent); |
1520 link.textContent = ""; | 1519 link.textContent = ""; |
1521 return link; | 1520 return link; |
1522 } | 1521 } |
1523 | 1522 |
1524 if (this.styleRule.sourceURL) { | 1523 if (this.styleRule.sourceURL) { |
1525 var firstMatchingIndex = this.styleRule.rule.matchingSelectors && th
is.rule.matchingSelectors.length ? this.rule.matchingSelectors[0] : 0; | 1524 var firstMatchingIndex = this.styleRule.rule.matchingSelectors && th
is.rule.matchingSelectors.length ? this.rule.matchingSelectors[0] : 0; |
1526 var matchingSelectorLocation = new WebInspector.CSSLocation(this._pa
rentPane._target, this.styleRule.sourceURL, this.rule.lineNumberInSource(firstMa
tchingIndex), this.rule.columnNumberInSource(firstMatchingIndex)); | 1525 var matchingSelectorLocation = new WebInspector.CSSLocation(this._pa
rentPane._target, this.rule.styleSheetId, this.styleRule.sourceURL, this.rule.li
neNumberInSource(firstMatchingIndex), this.rule.columnNumberInSource(firstMatchi
ngIndex)); |
1527 return this._parentPane._linkifier.linkifyCSSLocation(this.rule.styl
eSheetId, matchingSelectorLocation) || linkifyUncopyable(this.styleRule.sourceUR
L, this.rule.lineNumberInSource()); | 1526 return this._parentPane._linkifier.linkifyCSSLocation(matchingSelect
orLocation) || linkifyUncopyable(this.styleRule.sourceURL, this.rule.lineNumberI
nSource()); |
1528 } | 1527 } |
1529 | 1528 |
1530 if (!this.rule) | 1529 if (!this.rule) |
1531 return document.createTextNode(""); | 1530 return document.createTextNode(""); |
1532 | 1531 |
1533 if (this.rule.isUserAgent) | 1532 if (this.rule.isUserAgent) |
1534 return document.createTextNode(WebInspector.UIString("user agent sty
lesheet")); | 1533 return document.createTextNode(WebInspector.UIString("user agent sty
lesheet")); |
1535 if (this.rule.isUser) | 1534 if (this.rule.isUser) |
1536 return document.createTextNode(WebInspector.UIString("user styleshee
t")); | 1535 return document.createTextNode(WebInspector.UIString("user styleshee
t")); |
1537 if (this.rule.isViaInspector) | 1536 if (this.rule.isViaInspector) |
(...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3329 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase(
))) { | 3328 if (userEnteredText && (userEnteredText === userEnteredText.toUpperCase(
))) { |
3330 for (var i = 0; i < results.length; ++i) | 3329 for (var i = 0; i < results.length; ++i) |
3331 results[i] = results[i].toUpperCase(); | 3330 results[i] = results[i].toUpperCase(); |
3332 } | 3331 } |
3333 var selectedIndex = this._cssCompletions.mostUsedOf(results); | 3332 var selectedIndex = this._cssCompletions.mostUsedOf(results); |
3334 completionsReadyCallback(results, selectedIndex); | 3333 completionsReadyCallback(results, selectedIndex); |
3335 }, | 3334 }, |
3336 | 3335 |
3337 __proto__: WebInspector.TextPrompt.prototype | 3336 __proto__: WebInspector.TextPrompt.prototype |
3338 } | 3337 } |
OLD | NEW |