1. load a page with an inline style tag inside of a div (http://jsfiddle.net/show) 2. open the inspector 3. expand the div, double click on the body styles inside of the style tag Upstreaming http://code.google.com/p/chromium/issues/detail?id=152973
Created attachment 168728 [details] Patch
Comment on attachment 168728 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168728&action=review > Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1327 > + container.innerText = textNode._originalContent || container.innerText; textContent is the new hotness. Why innerText (which is an IE extension) instead?
(In reply to comment #2) > (From update of attachment 168728 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=168728&action=review > > > Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1327 > > + container.innerText = textNode._originalContent || container.innerText; > > textContent is the new hotness. Why innerText (which is an IE extension) instead? Thanks for the hint; it's legacy code. Is textContent far better than innerText (from the client's PoV) and is it worth migrating to the former? AFAIK, the only tangible difference is whitespace handling, unless I'm missing something...
(In reply to comment #2) > (From update of attachment 168728 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=168728&action=review > > > Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1327 > > + container.innerText = textNode._originalContent || container.innerText; > > textContent is the new hotness. Why innerText (which is an IE extension) instead? After double-checking, I made sure innerText is there not without reason. Setting textContent collapses all whitespace and, what's most important, newlines, so that multiline text nodes all occur on a single line. We had a bug for that a while ago, and most likely it was fixed by using innerText rather than textContent in this snippet.
Created attachment 168903 [details] Patch
Comment on attachment 168903 [details] Patch We should never use innerText. Also, this change needs a test.
Created attachment 168939 [details] Patch
Comment on attachment 168939 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=168939&action=review > Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1326 > + var node = this.representedObject; I would rename textNode to textNodeElement and node to textNode. > Source/WebCore/inspector/front-end/ElementsTreeOutline.js:1331 > var config = new WebInspector.EditingConfig(this._textNodeEditingCommitted.bind(this), this._editingCancelled.bind(this)); You should bind textNode parameter for _textNodeEditingCommitted to avoid duplicating the code in _textNodeEditingCommitted.
Committed r131455: <http://trac.webkit.org/changeset/131455>