8000 bug #50493 [VarDumper] Use documentElement instead of body for JS fla… · symfony/symfony@c31276b · GitHub
[go: up one dir, main page]

Skip to content

Commit c31276b

Browse files
bug #50493 [VarDumper] Use documentElement instead of body for JS flag (ohader)
This PR was merged into the 6.3 branch. Discussion ---------- [VarDumper] Use documentElement instead of body for JS flag | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #50487 | License | MIT | Doc PR | --- Fixes: #50487 Using `document.documentElement` allows to use the dumper outside of a `<html><body>...</body></html>` scenario. Commits ------- 91e6e57 [VarDumper] Use documentElement instead of body for JS flag
2 parents 1a9ac8d + 91e6e57 commit c31276b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ protected function getDumpHeader()
163163
<script>
164164
Sfdump = window.Sfdump || (function (doc) {
165165
166-
if (doc.body instanceof HTMLElement) {
167-
doc.body.classList.add('sf-js-enabled');
168-
}
166+
doc.documentElement.classList.add('sf-js-enabled');
169167
170168
var rxEsc = /([.*+?^${}()|\[\]\/\\])/g,
171169
idRx = /\bsf-dump-\d+-ref[012]\w+\b/,

0 commit comments

Comments
 (0)
0