Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
Hi Dennis On 9/29/23 23:38, Dennis Snell wrote: >> Just chiming in here to say that while we don't offer a createFragment() in >> this proposal, it's possible to parse fragments by passing the >> LIBXML_HTML_NOIMPLIED option. Alternatively, in the future I plan to offer >> innerHTML which you c

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Dennis Snell via internals
> Just chiming in here to say that while we don't offer a createFragment() in > this proposal, it's possible to parse fragments by passing the > LIBXML_HTML_NOIMPLIED option. Alternatively, in the future I plan to offer > innerHTML which you could use then in conjunction with > createDocumentFr

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
Hi Dennis On 9/29/23 20:20, Dennis Snell wrote: >> >>> >>> For both, `XMLDocument::fromEmpty` and `HTMLDocument::createEmpty` there is >>> an argument available to define the encoding but none of the other >>> `createFrom*` methods have this argument. >>> >>> As far as I understand, in the these

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
On 9/29/23 20:22, Larry Garfield wrote: > On Fri, Sep 29, 2023, at 6:12 PM, Niels Dossche wrote: > >>> Unclear to me: Would the XML constants also be aliased into the namespace >>> verbatim, or left globally? >>> >> >> I'll clarify this. >> The intention is to alias them verbatim. > > :thumbs

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Larry Garfield
On Fri, Sep 29, 2023, at 6:12 PM, Niels Dossche wrote: >> Unclear to me: Would the XML constants also be aliased into the namespace >> verbatim, or left globally? >> > > I'll clarify this. > The intention is to alias them verbatim. :thumbs up emoji: >> Did you consider making the new classes

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Dennis Snell via internals
> >> >> For both, `XMLDocument::fromEmpty` and `HTMLDocument::createEmpty` there is >> an argument available to define the encoding but none of the other >> `createFrom*` methods have this argument. >> >> As far as I understand, in the these other cases the encoding gets detected >> from the

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
Hi Larry On 29/09/2023 18:58, Larry Garfield wrote: > On Fri, Sep 29, 2023, at 7:07 AM, Niels Dossche wrote: >> On 02/09/2023 21:41, Niels Dossche wrote: >>> Hello internals >>> >>> I'm opening the discussion for my RFC "DOM HTML5 parsing and serialization >>> support". >>> https://wiki.php.net/r

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Larry Garfield
On Fri, Sep 29, 2023, at 5:13 PM, Tim Düsterhus wrote: > Hi > > On 9/29/23 18:58, Larry Garfield wrote: >>> \DOMDocument will also use DOM\Document as a base class to make it >>> interchangeable with the new classes. We're only adding XMLDocument for >>> completeness and API parity. It's a drop-i

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Tim Düsterhus
Hi On 9/29/23 18:58, Larry Garfield wrote: \DOMDocument will also use DOM\Document as a base class to make it interchangeable with the new classes. We're only adding XMLDocument for completeness and API parity. It's a drop-in replacement for \DOMDocument, and behaves the exact same. The diffe

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Larry Garfield
On Fri, Sep 29, 2023, at 7:07 AM, Niels Dossche wrote: > On 02/09/2023 21:41, Niels Dossche wrote: >> Hello internals >> >> I'm opening the discussion for my RFC "DOM HTML5 parsing and serialization >> support". >> https://wiki.php.net/rfc/domdocument_html5_parser >> >> Kind regards >> Niels > >

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
Hi Tim On 29/09/2023 18:06, Tim Düsterhus wrote: > Hi > > On 9/29/23 17:45, Niels Dossche wrote: >> Right, we follow the HTML spec in this regard. Roughly speaking we determine >> the charset in the following order of priorities. >> If one option fails, it will fall through to the next one. >> 1

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Tim Düsterhus
Hi On 9/29/23 17:45, Niels Dossche wrote: Right, we follow the HTML spec in this regard. Roughly speaking we determine the charset in the following order of priorities. If one option fails, it will fall through to the next one. 1. The Content-Type HTTP header from which you loaded the document.

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Niels Dossche
Hi Marc On 29/09/2023 09:39, Marc Bennewitz wrote: > Hi Niels, > > On 29.09.23 09:07, Niels Dossche wrote: >> Hi internals >> >> Discussion seems to have died down. >> Today, it's been 14 days since the last major change was done to the RFC >> (i.e. the class hierarchy update). >> And it's also

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-29 Thread Marc Bennewitz
Hi Niels, On 29.09.23 09:07, Niels Dossche wrote: Hi internals Discussion seems to have died down. Today, it's been 14 days since the last major change was done to the RFC (i.e. the class hierarchy update). And it's also been close to 4 weeks since I first announced the RFC it on the mailing

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-25 Thread Derick Rethans
On Sat, 23 Sep 2023, Niels Dossche wrote: > On 9/2/23 21:41, Niels Dossche wrote: > > > > I'm opening the discussion for my RFC "DOM HTML5 parsing and > > serialization support". > > https://wiki.php.net/rfc/domdocument_html5_parser > > Some minor changes after a discussion with Tim: > > * The

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-17 Thread Tim Düsterhus
Hi On 9/16/23 01:17, Niels Dossche wrote: […] Thank you for the fruitful discussion. This updated API is much better. When reading the updated RFC yesterday, I initially wanted to complain about the "The options argument" section still existing, but the $options argument nowhere to be seen.

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-17 Thread Niels Dossche
Hi Alexandru On 9/17/23 11:59, Alexandru Pătrănescu wrote: > On Sat, Sep 16, 2023, 02:17 Niels Dossche wrote: > >> >> We'll add a common abstract base class DOM\Document (name taken from the >> DOM spec & Javascript world). >> DOM\Document contains the properties and abstract methods common to b

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-17 Thread Alexandru Pătrănescu
On Sat, Sep 16, 2023, 02:17 Niels Dossche wrote: > > We'll add a common abstract base class DOM\Document (name taken from the > DOM spec & Javascript world). > DOM\Document contains the properties and abstract methods common to both > HTML and XML documents. > > Hi, Yes looks a lot better. Great

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-16 Thread Niels Dossche
Hi Larry On 9/17/23 01:04, Larry Garfield wrote: > On Fri, Sep 15, 2023, at 6:17 PM, Niels Dossche wrote: >> On 9/2/23 21:41, Niels Dossche wrote: >>> Hello internals >>> >>> I'm opening the discussion for my RFC "DOM HTML5 parsing and serialization >>> support". >>> https://wiki.php.net/rfc/domd

Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support

2023-09-16 Thread Larry Garfield
On Fri, Sep 15, 2023, at 6:17 PM, Niels Dossche wrote: > On 9/2/23 21:41, Niels Dossche wrote: >> Hello internals >> >> I'm opening the discussion for my RFC "DOM HTML5 parsing and serialization >> support". >> https://wiki.php.net/rfc/domdocument_html5_parser >> >> Kind regards >> Niels > > > H