Bug #77651 [Opn->Nab]: DOMDocument preserves insignificant whitespace text nodes
| From: | cmb@php.net | Date: | Tue, 27 Oct 2020 12:57:26 +0000 |
| Subject: | Bug #77651 [Opn->Nab]: DOMDocument preserves insignificant whitespace text nodes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-229945@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77651&edit=1
ID: 77651
Updated by: cmb@php.net
Reported by: morozov at tut dot by
Summary: DOMDocument preserves insignificant whitespace text
nodes
-Status: Open
+Status: Not a bug
Type: Bug
Package: DOM XML related
Operating System: Windows
PHP Version: 7.3.2
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Windows vs. Linux is irrelevant here; the behavior is different
for different versions of libxml2; libxml2 2.9.10 on Linux also
reports
int(3)
int(3)
So this is an upstream issue, but not a PHP bug.
Previous Comments:
------------------------------------------------------------------------
[2019-02-22 00:26:11] morozov at tut dot by
Description:
------------
DOMDocument::loadHTML() produces different results on Windows and Linux. Whitespace text nodes are
ignored between non-inline elements on Linux but not on Windows.
The different behaviors are observed on the same PHP version (7.3.2) and very close libxml versions
(2.9.3 on Linux and 2.9.8 on Windows).
Test script:
---------------
$doc = new DOMDocument();
$doc->loadHTML(
<<<HTML
<html>
<body>
<map>
<area />
</map>
<div>
<span />
</div>
</body>
</html>
HTML
);
var_dump(
$doc->getElementsByTagName('map')
->item(0)
->childNodes
->length
);
var_dump(
$doc->getElementsByTagName('div')
->item(0)
->childNodes
->length
);
Expected result:
----------------
int(1)
int(3)
Actual result:
--------------
int(3)
int(3)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77651&edit=1