bug #27064 [VarDumper] Fix HtmlDumper classes match (ogizanagi)
This PR was merged into the 3.4 branch.
Discussion
----------
[VarDumper] Fix HtmlDumper classes match
| Q | A
| ------------- | ---
| Branch? | 3.4 <!-- see below -->
| Bug fix? | yes
| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | #27045 <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Commits
-------
229430f
[VarDumper] Fix HtmlDumper classes match
This commit is contained in:
commit
df20e804a9
@ -310,6 +310,9 @@ return function (root, x) {
|
||||
|
||||
return "concat(" + parts.join(",") + ", '')";
|
||||
}
|
||||
function xpathHasClass(className) {
|
||||
return "contains(concat(' ', normalize-space(@class), ' '), ' " + className +" ')";
|
||||
}
|
||||
addEventListener(root, 'mouseover', function (e) {
|
||||
if ('' != refStyle.innerHTML) {
|
||||
refStyle.innerHTML = '';
|
||||
@ -516,7 +519,15 @@ return function (root, x) {
|
||||
return;
|
||||
}
|
||||
|
||||
var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
|
||||
var classMatches = [
|
||||
"sf-dump-str",
|
||||
"sf-dump-key",
|
||||
"sf-dump-public",
|
||||
"sf-dump-protected",
|
||||
"sf-dump-private",
|
||||
].map(xpathHasClass).join(' or ');
|
||||
|
||||
var xpathResult = doc.evaluate('.//span[' + classMatches + '][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
|
||||
|
||||
while (node = xpathResult.iterateNext()) state.nodes.push(node);
|
||||
|
||||
|
Reference in New Issue
Block a user