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

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 >

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

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

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". >>>

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

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

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. >>

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

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

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

2023-09-29 Thread Niels Dossche
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 Hi internals Discussion seems to have died down. Today, it's been

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

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

2023-09-23 Thread Niels Dossche
Hi internals 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 Some minor changes after a discussion with Tim: * The

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

2023-09-21 Thread Niels Dossche
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 Hi internals After the discussion here, I have made the following

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

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

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.

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". >>>

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 > > >

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

2023-09-15 Thread Niels Dossche
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 Hi internals I'd like to announce a change to the RFC. The new RFC

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

2023-09-06 Thread Niels Dossche
Hi Dennis On 06/09/2023 22:02, Dennis Snell wrote: > > >> On Sep 4, 2023, at 1:15 PM, Niels Dossche wrote: >> >> On 04/09/2023 21:54, Dennis Snell wrote: >>> Thanks for the proposal Niels, >>> >>> I’ve dealt with my own grief working through issues in DOMDocument and >>> wanting it to work

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

2023-09-06 Thread Dennis Snell via internals
> On Sep 4, 2023, at 1:15 PM, Niels Dossche wrote: > > On 04/09/2023 21:54, Dennis Snell wrote: >> Thanks for the proposal Niels, >> >> I’ve dealt with my own grief working through issues in DOMDocument and >> wanting it to work but finding it inadequate. >> >>> HTML5 >> >> This would be

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

2023-09-05 Thread Niels Dossche
Hi Ben On 05/09/2023 03:31, Ben Ramsey wrote: > On 9/2/23 14: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 > > > Thanks, Niels. This is much needed. > > >> This proposal

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

2023-09-04 Thread Ben Ramsey
On 9/2/23 14: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 Thanks, Niels. This is much needed. This proposal introduces the DOM\HTML5Document class that extends the

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

2023-09-04 Thread Niels Dossche
Hi Dennis On 04/09/2023 21:54, Dennis Snell wrote: > Thanks for the proposal Niels, > > I’ve dealt with my own grief working through issues in DOMDocument and > wanting it to work but finding it inadequate. > >> HTML5 > > This would be a great starting point; I would love it if we took the >

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

2023-09-04 Thread Dennis Snell via internals
Thanks for the proposal Niels, I’ve dealt with my own grief working through issues in DOMDocument and wanting it to work but finding it inadequate. > HTML5 This would be a great starting point; I would love it if we took the opportunity to fix named character reference decoding, as PHP has