Commit Graph

22 Commits

Author SHA1 Message Date
Niels Dossche
14b6c981c3
[RFC] Add a way to opt-in ext/dom spec compliance (#13031)
RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance
2024-03-09 16:56:00 +01:00
Niels Dossche
1492be5286
[RFC] DOM HTML5 parsing and serialization support (#12111) 2023-11-13 20:18:19 +01:00
Niels Dossche
8874384921 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix json_encode result on DOMDocument
2023-08-01 17:35:10 +02:00
Niels Dossche
82eda28616 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix json_encode result on DOMDocument
2023-08-01 17:31:55 +02:00
Niels Dossche
6e468bbd3b Fix json_encode result on DOMDocument
According to https://www.php.net/manual/en/class.domdocument:
  When using json_encode() on a DOMDocument object the result will be
  that of encoding an empty object.

But this was broken in 8.1. The output was `{"config": null}`.
That's because the config property is defined with a default value of
NULL, hence it was included. The other properties are not included
because they don't have a default property, and nothing is ever written
to their backing field. Hence, the JSON encoder excludes them.
Similarly, `(array) $doc` would yield the same `config` key in the
array.

Closes GH-11840.
2023-08-01 17:28:51 +02:00
Niels Dossche
3b68e84341 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix DOM test
2023-07-26 18:05:56 +02:00
Niels Dossche
9a358b2842 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix DOM test
2023-07-26 18:05:51 +02:00
Niels Dossche
bed0e54104 Fix DOM test 2023-07-26 18:05:24 +02:00
Niels Dossche
8ac0dcc632 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11791: Wrong default value of DOMDocument::xmlStandalone
2023-07-26 17:26:14 +02:00
Niels Dossche
86580c6624 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11791: Wrong default value of DOMDocument::xmlStandalone
2023-07-26 17:23:45 +02:00
Niels Dossche
bf4e7bd3ed Fix GH-11791: Wrong default value of DOMDocument::xmlStandalone
At one point this was changed from a bool to an int in libxml2, with
negative values meaning it is unspecified. Because it is cast to a bool
this therefore returned true instead of the expected false.

Closes GH-11793.
2023-07-26 17:20:10 +02:00
Niels Dossche
d04f48b6ac Implement DOMNode::parentElement and DOMNameSpaceNode::parentElement
ref: https://dom.spec.whatwg.org/#parent-element

Closes GH-11679.
2023-07-17 13:15:31 +02:00
Niels Dossche
d38cc9b9b6 Implement DOMNode::isConnected and DOMNameSpaceNode::isConnected
ref: https://dom.spec.whatwg.org/#dom-node-isconnected

Closes GH-11677.
2023-07-17 13:14:13 +02:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Máté Kocsis
7da2151f7a
Declare typed properties in ext/dom
Closes GH-7013
2021-05-26 12:23:43 +02:00
Máté Kocsis
a5e938dc86
Declare dynamic properties in ext/dom
Closes GH-6644
2021-05-18 15:12:35 +02:00
Max Semenik
bd9f4fa676 Migrate skip checks to --EXTENSIONS--, p2
For rationale, see https://github.com/php/php-src/pull/6787

Make extension checks lowercase, add a special case for opcache
that has internal name not matching .so filename.

Extensions migrated in part 2:
* dom
* exif
* fileinfo
* ffi
2021-04-01 12:08:24 +01:00
Máté Kocsis
7aacc705d0
Add many missing closing PHP tags to tests
Closes GH-5958
2020-08-09 22:03:36 +02:00
Benjamin Eberlei
5acd86df8e [RFC] Implement new DOM Living Standard APIs in ext/dom 2020-02-28 16:13:39 +01:00
Máté Kocsis
2015c7a48e
Fix another batch of indentation in tests 2020-02-02 23:33:40 +01:00
Arnout Boks
13edec75a3 Fixed #73907 (nextSibling property not included in var_dump of DOMNode) 2017-01-10 23:29:02 +01:00
Gustavo André dos Santos Lopes
b61017c9b6 Improved on DOM object debug info handler. Added test. 2012-03-23 21:23:24 +00:00