Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3b7282ac21bbb0cbe93af6bf69cca280968fa183
      
https://github.com/WebKit/WebKit/commit/3b7282ac21bbb0cbe93af6bf69cca280968fa183
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-08-16 (Sun, 16 Aug 2026)

  Changed paths:
    M Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js
    M Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js

  Log Message:
  -----------
  Web Inspector: selecting a CDATA section in the DOM tree throws 
"node.truncateEnd is not a function"
https://bugs.webkit.org/show_bug.cgi?id=321865
rdar://185027124

Reviewed by Devin Rousso.

WI.DOMTreeElementPathComponent builds its title from the WI.DOMNode, but the
CDATA_SECTION_NODE case calls truncateEnd() on the node instead of on the node's
value. truncateEnd() is a String.prototype extension, so selecting a CDATA
section throws a TypeError out of the constructor, which leaves
ContentBrowser._updateContentViewSelectionPathNavigationItem() half done and
takes down the frontend. XML documents are the only ones that parse CDATA
sections, so this is reachable by selecting the CSS inside <style> when
inspecting an SVG document.

WI.DOMSearchMatchObject.titleForDOMNode() has the same mistake in its
CDATA_SECTION_NODE case, where it concatenates the WI.DOMNode itself and
produces "<![CDATA[[object Object]]]>" as the search result title.

* Source/WebInspectorUI/UserInterface/Models/DOMSearchMatchObject.js:
(WI.DOMSearchMatchObject.titleForDOMNode):
* Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js:
(WI.DOMTreeElementPathComponent):

Canonical link: https://commits.webkit.org/319252@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to