Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.4: Document all new DOM classes and methods - part 1 #4212

Merged
merged 45 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c70f9a7
Reference new Dom class from XSL
nielsdos Dec 1, 2024
3c12aa3
Reference new Dom class in SimpleXML
nielsdos Dec 1, 2024
b697303
Document Dom\import_simplexml
nielsdos Dec 1, 2024
e8d30ee
Remove unused version entries from dom/versions.xml
nielsdos Dec 1, 2024
0aabe59
Fix reference to non-existent class
nielsdos Dec 1, 2024
769faf2
Update Dom constants for Dom namespace
nielsdos Dec 1, 2024
8b183dd
Document Dom\Exception alias
nielsdos Dec 1, 2024
10f097f
Document Dom\AdjacentPosition
nielsdos Dec 1, 2024
5bc5b82
Reference new DOM classes in loadHTML(File)
nielsdos Dec 1, 2024
011501c
Document Dom\Node class
nielsdos Dec 1, 2024
00ed836
Document Dom\Implementation class
nielsdos Dec 1, 2024
a4914ca
Document Dom\Attr class
nielsdos Dec 1, 2024
627b2bf
Document Dom\DocumentType class
nielsdos Dec 1, 2024
37ef48f
Document Dom\NamespaceInfo class
nielsdos Dec 1, 2024
1cc1ab0
Document Dom\Entity class
nielsdos Dec 1, 2024
d11e8f1
Document Dom\Notation class
nielsdos Dec 1, 2024
57419f6
Document Dom\CDATASection class
nielsdos Dec 1, 2024
e9494b4
Fix encoding mistakes in DOM
nielsdos Dec 1, 2024
a2d2a14
Document Dom\CharacterData class
nielsdos Dec 1, 2024
f343484
Document DOM\ChildNode interface
nielsdos Dec 1, 2024
a8c02e0
Document Dom\Comment class
nielsdos Dec 1, 2024
6fc4ae2
Document Dom\Text class
nielsdos Dec 1, 2024
e79216f
Document Dom\DocumentFragment class
nielsdos Dec 1, 2024
2cf289d
Document Dom\EntityReference class
nielsdos Dec 1, 2024
6559b2e
Document Dom\ProcessingInstruction class
nielsdos Dec 1, 2024
c9e1699
Document Dom\Document class
nielsdos Dec 1, 2024
b3a7ba5
Document Dom\DtdNamedNodeMap class
nielsdos Dec 1, 2024
afb06c3
Document Dom\Element class
nielsdos Dec 1, 2024
67ff690
Document Dom\HTMLCollection class
nielsdos Dec 1, 2024
01097e6
Document Dom\NamedNodeMap class
nielsdos Dec 1, 2024
3eacb0d
Document Dom\HTMLDocument class
nielsdos Dec 1, 2024
db9331a
Document Dom\HTMLElement class
nielsdos Dec 1, 2024
30539db
Document Dom\NodeList class
nielsdos Dec 1, 2024
4d2421d
Document Dom\ParentNode interface
nielsdos Dec 1, 2024
850ccce
Document Dom\XMLDocument class
nielsdos Dec 1, 2024
9162a71
Document Dom\TokenList class
nielsdos Dec 1, 2024
3144a45
Document Dom\XPath class
nielsdos Dec 1, 2024
217eacf
Document Dom\Attr methods
nielsdos Dec 2, 2024
00a2237
Document Dom\ChildNode methods
nielsdos Dec 3, 2024
11f0c52
Document Dom\CharacterData methods
nielsdos Dec 3, 2024
340ac77
Document Dom\Text methods
nielsdos Dec 3, 2024
5c5903f
Document Dom\ParentNode methods
nielsdos Dec 3, 2024
50e8276
Make new DOM docs compilable with incomplete method documentation
nielsdos Dec 5, 2024
0b1338c
Update encoding note for new DOM
nielsdos Dec 5, 2024
06a4641
Add note to properties for XMLDocument
nielsdos Dec 5, 2024
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
22 changes: 16 additions & 6 deletions language-snippets.ent
Original file line number Diff line number Diff line change
Expand Up @@ -1648,30 +1648,40 @@ it is inserted with (e.g.) <function xmlns="http://docbook.org/ns/docbook">DOMNo

<!ENTITY dom.malformederror '<para xmlns="http://docbook.org/ns/docbook">While malformed HTML should load successfully, this function may generate <constant>E_WARNING</constant> errors when it encounters bad markup. <link linkend="function.libxml-use-internal-errors">libxml&apos;s error handling functions</link> may be used to handle these errors.</para>'>
<!ENTITY dom.note.utf8 '<note xmlns="http://docbook.org/ns/docbook"><para>The DOM extension uses UTF-8 encoding. Use <function>mb_convert_encoding</function>, <methodname>UConverter::transcode</methodname>, or <function>iconv</function> to handle other encodings.</para></note>'>
<!ENTITY dom.note.modern.utf8 '<note xmlns="http://docbook.org/ns/docbook">
<simpara>
The DOM extension uses UTF-8 encoding when working with methods or properties.
The parser methods auto-detect the encoding or allow the caller to specify an encoding.
</simpara>
</note>'>
<!ENTITY dom.note.json '<note xmlns="http://docbook.org/ns/docbook"><para>When using <function>json_encode</function> on a <classname>DOMDocument</classname> object the result will be that of encoding an empty object.</para></note>'>
<!ENTITY dom.domdocument.html5 '<warning xmlns="http://docbook.org/ns/docbook">
<para>
<simpara>
Use <classname>Dom\HTMLDocument</classname> to parse and process modern HTML
instead of <classname>DOMDocument</classname>.
</simpara>
<simpara>
This function parses the input using an HTML 4 parser. The parsing rules
of HTML 5, which is what modern web browsers use, are different. Depending
on the input this might result in a different DOM structure. Therefore
this function cannot be safely used for sanitizing HTML.
</para>
<para>
</simpara>
<simpara>
The behavior when parsing HTML can depend on the version of
<literal>libxml</literal> that is being used, particularly with regards to
edge conditions and error handling.
For parsing that conforms to the HTML5 specification,
use <methodname>Dom\HTMLDocument::createFromString</methodname> or
<methodname>Dom\HTMLDocument::createFromFile</methodname>, added in PHP 8.4.
</para>
<para>
</simpara>
<simpara>
As an example, some HTML elements will implicitly close a parent element
when encountered. The rules for automatically closing parent elements
differ between HTML 4 and HTML 5 and thus the resulting DOM structure that
<classname>DOMDocument</classname> sees might be different from the DOM
structure a web browser sees, possibly allowing an attacker to break the
resulting HTML.
</para>
</simpara>
</warning>'>


Expand Down
29 changes: 29 additions & 0 deletions reference/dom/book.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,35 @@
&reference.dom.domtext;
&reference.dom.domxpath;

&reference.dom.dom.dom-adjacentposition;
&reference.dom.dom.dom-attr;
&reference.dom.dom.dom-cdatasection;
&reference.dom.dom.dom-characterdata;
&reference.dom.dom.dom-childnode;
&reference.dom.dom.dom-comment;
&reference.dom.dom.dom-document;
&reference.dom.dom.dom-documentfragment;
&reference.dom.dom.dom-documenttype;
&reference.dom.dom.dom-dtdnamednodemap;
&reference.dom.dom.dom-element;
&reference.dom.dom.dom-entity;
&reference.dom.dom.dom-entityreference;
&reference.dom.dom.dom-htmlcollection;
&reference.dom.dom.dom-htmldocument;
&reference.dom.dom.dom-htmlelement;
&reference.dom.dom.dom-implementation;
&reference.dom.dom.dom-namednodemap;
&reference.dom.dom.dom-namespaceinfo;
&reference.dom.dom.dom-node;
&reference.dom.dom.dom-nodelist;
&reference.dom.dom.dom-notation;
&reference.dom.dom.dom-parentnode;
&reference.dom.dom.dom-processinginstruction;
&reference.dom.dom.dom-text;
&reference.dom.dom.dom-tokenlist;
&reference.dom.dom.dom-xmldocument;
&reference.dom.dom.dom-xpath;

<!-- FIXME:
<section xml:id="dom.class.domnamelist">
<title><classname>DOMNameList</classname></title>
Expand Down
Loading
Loading