Skip to content

Commit

Permalink
Make documentURI and URL not readonly (#13982)
Browse files Browse the repository at this point in the history
These aren't actually readonly right now because `@readonly` means
nothing, and the setters are configured in php_dom.c. So no functional
changes here.

DOM spec marks these as readonly, but the problem is that this reduces
usefulness in XML contexts (like WSDL scheme handling). In context of a
browser, for which DOM was designed, this actually makes sense to have
as readonly because it is tied to the origin of the page etc. But PHP is
not a browser. This also wasn't readonly in "old DOM".
  • Loading branch information
nielsdos committed Apr 17, 2024
1 parent 58c0202 commit 47ec320
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions ext/dom/php_dom.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -1515,9 +1515,7 @@ abstract class Document extends Node implements ParentNode
{
/** @readonly */
public Implementation $implementation;
/** @readonly */
public string $URL;
/** @readonly */
public string $documentURI;
public string $characterSet;
public string $charset;
Expand Down
2 changes: 1 addition & 1 deletion ext/dom/php_dom_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 47ec320

Please sign in to comment.