History log of /php-src/ext/dom/document.c (Results 1 – 25 of 328)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 7e45e57d 23-Aug-2024 Máté Kocsis

Suppress deprecation notices when ext/dom properties are accessed by the get_debug_info handler (#15530)


# 5853cdb7 20-Aug-2024 Gina Peter Bnayard

Use "must not" instead of "cannot" wording


# 6d9a74cd 18-Aug-2024 Gina Peter Bnayard

ext/dom: Use standard wording for ValueError


# 587110c5 13-Aug-2024 Máté Kocsis

Deprecate Soft-deprecated DOMDocument and DOMEntity properties (#15369)

RFC: https://wiki.php.net/rfc/deprecations_php_8_4#formally_deprecate_soft-deprecated_domdocument_and_domentity_proper

Deprecate Soft-deprecated DOMDocument and DOMEntity properties (#15369)

RFC: https://wiki.php.net/rfc/deprecations_php_8_4#formally_deprecate_soft-deprecated_domdocument_and_domentity_properties

show more ...


# 0122be57 10-Aug-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Simplify document standalone setter (#15320)

The logic was very weird as it just should check whether the boolean is
true or not. And in fact the code is equivalent because zval_get_long

Simplify document standalone setter (#15320)

The logic was very weird as it just should check whether the boolean is
true or not. And in fact the code is equivalent because zval_get_long()
will only return 0/1 because the type is a bool, and ZEND_NORMALIZE_BOOL
won't change that value.

show more ...


# a0c29f08 05-Aug-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Use unsigned int instead of int for refcount for libxml objects (#15247)


# 80a4783d 18-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Deduplicate NULL checks in ext/dom (#15015)

This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
ph

Deduplicate NULL checks in ext/dom (#15015)

This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
php_dom_create_object(). This deduplicates a bit of code.

show more ...


# 6980eba8 10-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Support templated content

The template element in HTML 5 is special in the sense that it does not
add its contents into the DOM tree, but instead keeps them in a separate
shadow DOM

Support templated content

The template element in HTML 5 is special in the sense that it does not
add its contents into the DOM tree, but instead keeps them in a separate
shadow DOM document fragment. Interacting with the DOM tree cannot touch
the elements in the document fragment.

Closes GH-14906.

show more ...


# 88252353 08-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Reapply "Stop using reserved names in dom"

This reverts commit dda96768ece24cb56f09924baf9d6b9dd27ad587.


# dda96768 08-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Revert "Stop using reserved names in dom"

This reverts commit 013bc53f0cf0c55a196a4336bc7d07dcded6ed95.

This somehow breaks the Windows build. Will investigate later.


# 013bc53f 06-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Stop using reserved names in dom


# 4fe82131 04-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Backport libxml2 2.13.2 fixes (#14816)

Backproted from https://github.com/php/php-src/pull/14789


# 85705eda 03-Jul-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix compilation on libxml2 2.13


# 42908f9f 28-Jun-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14702: DOMDocument::xinclude() crash

The xinclude code from libxml removes the fallback node,
but the fallback node is still reference via $fallback.
The solution is to detach

Fix GH-14702: DOMDocument::xinclude() crash

The xinclude code from libxml removes the fallback node,
but the fallback node is still reference via $fallback.
The solution is to detach the nodes that are going to be removed in
advance.

Closes GH-14704.

show more ...


# 11accb5c 25-Jun-2024 Arnaud Le Blanc

Preferably include from build dir (#13516)

* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Preferably include from build dir (#13516)

* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

-I$(top_builddir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/main
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM
-I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

-I$(top_builddir)/main
-I$(top_builddir)
-I$(top_srcdir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.

show more ...


# a068a9a5 23-Jun-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Make XMLDocument::xinclude() return values and error conditions sane

See https://wiki.php.net/rfc/dom_additions_84#api_amendments


# 8dc2391b 26-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix bug #79701: getElementById does not correctly work with duplicate definitions

This is a long standing bug: IDs aren't properly tracked causing either
outdated or plain incorrect resu

Fix bug #79701: getElementById does not correctly work with duplicate definitions

This is a long standing bug: IDs aren't properly tracked causing either
outdated or plain incorrect results from getElementById.

This PR implements a pragmatic solution in which we still try to use the
ID lookup table to a degree, but only as a performance boost not as a
"single source of truth". Full details are explained in the
getElementById code.

Closes GH-14349.

show more ...


# edc13091 29-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix build


# 88ff32a2 29-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-14343: Memory leak in xml and dom (#14347)

If there is no root, the namespace cannot be attached to it,
so we have to attach it to the old list.

This isn't a problem in "

Fix GH-14343: Memory leak in xml and dom (#14347)

If there is no root, the namespace cannot be attached to it,
so we have to attach it to the old list.

This isn't a problem in "new DOM" because namespaces are managed in a
separate structure there.

show more ...


# 0c490ade 10-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Handle dumping document to file


# 44485892 10-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Factor out all common code for XML serialization and merge common paths


# 6e7adb3c 09-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Update ext/dom names after policy change (#14171)


# 22a113b9 04-May-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Try to use an interned local name in createElementNS (#14127)


# d24a04bb 30-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Use fast ZPP in very commonly used DOM functions (#14077)

Start using fast ZPP in very commonly used DOM functions, and also try
to unify some branches by using RETURN_BOOL where appropr

Use fast ZPP in very commonly used DOM functions (#14077)

Start using fast ZPP in very commonly used DOM functions, and also try
to unify some branches by using RETURN_BOOL where appropriate.

show more ...


# ed916214 29-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Avoid additional allocation in Document\createElementNS (#14071)

For the following benchmark code:
```php
$dom = DOM\XMLDocument::createEmpty();
for ($i = 0; $i < 1000*100; $i++)

Avoid additional allocation in Document\createElementNS (#14071)

For the following benchmark code:
```php
$dom = DOM\XMLDocument::createEmpty();
for ($i = 0; $i < 1000*100; $i++) $dom->createElementNS("urn:a", "thisisaveryverylongname");
```

We obtain the following on an i7-4790:
```
Benchmark 1: ./sapi/cli/php bench.php
Time (mean ± σ): 34.5 ms ± 1.2 ms [User: 31.4 ms, System: 2.9 ms]
Range (min … max): 32.4 ms … 39.3 ms 84 runs

Benchmark 2: ./sapi/cli/php_old bench.php
Time (mean ± σ): 36.6 ms ± 1.6 ms [User: 33.6 ms, System: 2.9 ms]
Range (min … max): 34.3 ms … 45.3 ms 80 runs

Summary
./sapi/cli/php bench.php ran
1.06 ± 0.06 times faster than ./sapi/cli/php_old bench.php
```

show more ...


12345678910>>...14