Changeset 127418 in webkit
- Timestamp:
- Sep 3, 2012 6:22:42 AM (12 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r127416 r127418 1 2012-09-03 Alexander Pavlov <apavlov@chromium.org> 2 3 Web Inspector: Unhide hidden characters 4 https://bugs.webkit.org/show_bug.cgi?id=93888 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/elements/elements-panel-structure-expected.txt: 9 * inspector/elements/elements-panel-structure.html: 10 1 11 2012-09-03 Dominik Röttsches <dominik.rottsches@intel.com> 2 12 -
trunk/LayoutTests/inspector/elements/elements-panel-structure-expected.txt
r90617 r127418 1 1 Tests that elements panel shows DOM tree structure. 2 2 3 "Quoted Text" 3 "Quoted Text". Special characters: ><"' 4 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 5 5 - <html> … … 15 15 - <div id="level1"> 16 16 - <div id="level2"> 17 ""Quoted Text" 17 ""Quoted Text". Special characters: ><"'    ​‌‍‎‏" 18 18 <div id="level3"></div> 19 19 </div> -
trunk/LayoutTests/inspector/elements/elements-panel-structure.html
r90617 r127418 26 26 27 27 <div id="level1"> 28 <div id="level2">"Quoted Text" 29 <div id="level3"></div> 28 <div id="level2">"Quoted Text". Special characters: ><"'    ​‌‍‎‏<div id="level3"></div> 30 29 </div> 31 30 </div> -
trunk/Source/WebCore/ChangeLog
r127417 r127418 1 2012-09-03 Alexander Pavlov <apavlov@chromium.org> 2 3 Web Inspector: Unhide hidden characters 4 https://bugs.webkit.org/show_bug.cgi?id=93888 5 6 Reviewed by Pavel Feldman. 7 8 Certain invisible characters will be rendered as HTML entity references in the DOM tree to make them visible to the user. 9 10 * inspector/front-end/ElementsTreeOutline.js: 11 (WebInspector.ElementsTreeElement.prototype._startEditingTextNode): 12 1 13 2012-09-03 Pavel Feldman <pfeldman@chromium.org> 2 14 -
trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
r126572 r127418 72 72 } 73 73 74 WebInspector.ElementsTreeOutline.MappedCharToEntity = { 75 "\u00a0": "nbsp", 76 "\u2002": "ensp", 77 "\u2003": "emsp", 78 "\u2009": "thinsp", 79 "\u200b": "#8203", 80 "\u200c": "zwnj", 81 "\u200d": "zwj", 82 "\u200e": "lrm", 83 "\u200f": "rlm" 84 } 85 74 86 WebInspector.ElementsTreeOutline.prototype = { 75 87 _createNodeDecorators: function() … … 1303 1315 var container = textNode.enclosingNodeOrSelfWithClass("webkit-html-text-node"); 1304 1316 if (container) 1305 container.innerText = container.innerText; // Strip the CSS or JS highlighting if present.1317 container.innerText = textNode._originalContent; // Strip the CSS or JS highlighting if present. 1306 1318 var config = new WebInspector.EditingConfig(this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this)); 1307 1319 this._editing = WebInspector.startEditing(textNode, config); … … 1704 1716 }, 1705 1717 1718 _convertWhitespaceToEntities: function(text) 1719 { 1720 var result = ""; 1721 var lastIndexAfterEntity = 0; 1722 var charToEntity = WebInspector.ElementsTreeOutline.MappedCharToEntity; 1723 for (var i = 0, size = text.length; i < size; ++i) { 1724 var char = text.charAt(i); 1725 if (charToEntity[char]) { 1726 result += text.substring(lastIndexAfterEntity, i) + "&" + charToEntity[char] + ";"; 1727 lastIndexAfterEntity = i + 1; 1728 } 1729 } 1730 if (result) { 1731 result += text.substring(lastIndexAfterEntity); 1732 return result; 1733 } 1734 return text; 1735 }, 1736 1706 1737 _nodeTitleInfo: function(linkify) 1707 1738 { … … 1742 1773 if (showInlineText) { 1743 1774 var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node"); 1744 textNodeElement.textContent = textChild.nodeValue(); 1775 textNodeElement.textContent = this._convertWhitespaceToEntities(textChild.nodeValue()); 1776 textNodeElement._originalContent = textChild.nodeValue(); 1745 1777 info.titleDOM.appendChild(document.createTextNode("\u200B")); 1746 1778 this._buildTagDOM(info.titleDOM, tagName, true, false); … … 1765 1797 info.titleDOM.appendChild(document.createTextNode("\"")); 1766 1798 var textNodeElement = info.titleDOM.createChild("span", "webkit-html-text-node"); 1767 textNodeElement.textContent = node.nodeValue(); 1799 textNodeElement.textContent = this._convertWhitespaceToEntities(node.nodeValue()); 1800 textNodeElement._originalContent = node.nodeValue(); 1768 1801 info.titleDOM.appendChild(document.createTextNode("\"")); 1769 1802 }
Note: See TracChangeset
for help on using the changeset viewer.