Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
571 changes: 310 additions & 261 deletions docs/bootstrap-inventory.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions docs/bootstrap-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,11 @@
"ext/dom/VmDomJitDispatch.php",
"ext/dom/VmDomJitFrame.php",
"ext/dom/VmDomTokenList.php",
"ext/dom/VmDomXPath.php",
"ext/dom/XPathConstruct.php",
"ext/dom/XPathEvaluate.php",
"ext/dom/XPathQuery.php",
"ext/dom/XPathRegisterNamespace.php",
"ext/filter/BuiltinEnums.php",
"ext/filter/FilterBatchJitHelper.php",
"ext/filter/FilterBooleanJitHelper.php",
Expand Down Expand Up @@ -4537,9 +4542,9 @@
"test/bootstrap-aot/lib_opcode/main.php"
],
"totals": {
"inventory_files": 4303,
"inventory_files": 4308,
"excluded": 0,
"eligible": 4303,
"eligible": 4308,
"aot_lint_targets": 113,
"aot_link_targets": 100,
"aot_link_lib_targets": 1
Expand Down
3 changes: 3 additions & 0 deletions ext/dom/DomConstants.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ final class DomConstants
/** Internal marker for {@see VmDom::createTokenList()} handles (#16876). */
public const XML_TOKENLIST = -3;

/** Internal marker for {@see VmDom::createXPath()} handles (#6066). */
public const XML_XPATH = -4;

/** DOMNode::compareDocumentPosition() flags (php-src ext/dom/node.c; #14448). */
public const DOCUMENT_POSITION_DISCONNECTED = 0x01;

Expand Down
10 changes: 10 additions & 0 deletions ext/dom/DomNodeState.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ final class DomNodeState
/** Owning element object id for {@see DomConstants::XML_TOKENLIST} handles (#16876). */
public ?int $tokenListElementId = null;

/** Owning document object id for {@see DomConstants::XML_XPATH} handles (#6066). */
public ?int $xpathDocumentId = null;

/**
* Registered namespace prefixes for {@see DomConstants::XML_XPATH} (#6066).
*
* @var array<string, string>
*/
public array $xpathNamespaces = [];

/**
* Ordered unique tokens for {@see DomConstants::XML_TOKENLIST} (#16876).
*
Expand Down
24 changes: 24 additions & 0 deletions ext/dom/VmDom.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ final class VmDom

public const CLASS_TOKEN_LIST = 'domtokenlist';

public const CLASS_XPATH = 'domxpath';

public const PROP_FORMAT_OUTPUT = 'formatOutput';

public const PROP_IMPLEMENTATION = 'implementation';
Expand Down Expand Up @@ -383,6 +385,21 @@ public static function registerClasses(Context $ctx): void
$ctx->classes[self::CLASS_TOKEN_LIST] = $tokenList;
}

$xpath = new ClassEntry('DOMXPath');
$xpath->isInternal = true;
$xpathConstruct = new XPathConstruct();
$xpath->constructor = $xpathConstruct;
$xpath->methods['__construct'] = $xpathConstruct;
$xpath->methodVisibility['__construct'] = $pub;
$xpath->methods['query'] = new XPathQuery();
$xpath->methodVisibility['query'] = $pub;
$xpath->methods['evaluate'] = new XPathEvaluate();
$xpath->methodVisibility['evaluate'] = $pub;
$xpath->methods['registernamespace'] = new XPathRegisterNamespace();
$xpath->methodVisibility['registernamespace'] = $pub;
$xpath->methodNames['registernamespace'] = 'registerNamespace';
$ctx->classes[self::CLASS_XPATH] = $xpath;

$impl = new ClassEntry('DOMImplementation');
$impl->isInternal = true;
$impl->methods['createdocument'] = new ImplementationCreateDocument();
Expand Down Expand Up @@ -4358,6 +4375,13 @@ public static function isTokenList(ObjectEntry $entry): bool
&& DomConstants::XML_TOKENLIST === DomRegistry::state($entry)->nodeType;
}

public static function isXPath(ObjectEntry $entry): bool
{
return self::CLASS_XPATH === strtolower($entry->class->name)
&& DomRegistry::has($entry)
&& DomConstants::XML_XPATH === DomRegistry::state($entry)->nodeType;
}

public static function syncElementClassList(Context $ctx, ObjectEntry $element): void
{
if (!CompilerVersion::supportsDomTokenList() || !self::isElement($element)) {
Expand Down
Loading
Loading