Changeset 185716 in webkit
- Timestamp:
- Jun 18, 2015, 12:21:22 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r185709 r185716 1 2015-06-18 Joseph Pecoraro <pecoraro@apple.com> 2 3 Web Inspector: Improve a few more node preview types 4 https://bugs.webkit.org/show_bug.cgi?id=146048 5 6 Reviewed by Timothy Hatcher. 7 8 * UserInterface/Views/FormattedValue.js: 9 (WebInspector.FormattedValue.createElementForNodePreview): 10 1 11 2015-06-18 Devin Rousso <drousso@apple.com> 2 12 -
trunk/Source/WebInspectorUI/UserInterface/Views/FormattedValue.js
r185703 r185716 70 70 WebInspector.FormattedValue.createElementForNodePreview = function(preview) 71 71 { 72 var value = preview.value; 72 73 var span = document.createElement("span"); 73 74 span.className = "formatted-node-preview syntax-highlighted"; 74 75 75 // A node preview has a very strict format, with at most a single attribute. 76 // Comment node preview. 77 if (value.startsWith("<!--")) { 78 var comment = span.appendChild(document.createElement("span")); 79 comment.className = "html-comment"; 80 comment.textContent = value; 81 return span; 82 } 83 84 // Doctype node preview. 85 if (value.startsWith("<!DOCTYPE")) { 86 var doctype = span.appendChild(document.createElement("span")); 87 doctype.className = "html-doctype"; 88 doctype.textContent = value; 89 return span; 90 } 91 92 // Element node previews have a very strict format, with at most a single attribute. 76 93 // We can style it up like a DOMNode without interactivity. 77 var matches = preview.value.match(/^<(\S+?)(?: (\S+?)="(.*?)")?>$/); 94 var matches = value.match(/^<(\S+?)(?: (\S+?)="(.*?)")?>$/); 95 96 // Remaining node types are often #text, #document, etc, with attribute nodes potentially being any string. 78 97 if (!matches) { 79 console. error("Node preview did not match format.", preview.value)80 span.textContent = preview.value;98 console.assert(!value.startsWith("<"), "Unexpected node preview format: " + value); 99 span.textContent = value; 81 100 return span; 82 101 }
Note:
See TracChangeset
for help on using the changeset viewer.