Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122188 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 47273 invoked from network); 19 Jan 2024 12:45:21 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 19 Jan 2024 12:45:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1705668361; bh=OosmMkd5ehBKMK5+hKmy393JSnaGVPX+2OWzla/7PrQ=; h=Date:To:From:Cc:Subject:In-Reply-To:References:From; b=mTy4ycn+NvW8+Al0xn6A1X/JinL0qIaTOt9fYvENLBKuvYplBoPYDdzx/jBlBZ7zf f0Sm/iu8FQsfx/QQ/FGOd4XPQkAOPmd8k77mGhXLSXb2cYom7MXocMt+qMVHEOJWng 8Sk1onrm8xLd4dafqKErGxaI0X2BM8D/dn9DmHirgeD6jcP3/9YuR0pduhQQx6dYk1 0f1+6+KNhHJBaqParRXYLeFkpbiHR43KASEelX9YzTP0XVQIDAy2JipQASdgHWFg8C olc1WXBRSjCyF6hzuPUj+eJCQn9hb+dm+BwClTVXCXb+nkN5UZR24FoH3ndlniMmLC BexG7y1huI8Iw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D70E018004F for ; Fri, 19 Jan 2024 04:45:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-4323.proton.ch (mail-4323.proton.ch [185.70.43.23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 19 Jan 2024 04:45:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpb.moe; s=protonmail; t=1705668315; x=1705927515; bh=OosmMkd5ehBKMK5+hKmy393JSnaGVPX+2OWzla/7PrQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=fBu61lQcuMgISH13bNgyCns3rPKX3mbmMVhLGrIqS7RRRwwIz3UCK0LPPA8vzQp1M 3gwPy+PN32T6wzTpgtrhr7Wlek6moaE+AfkoNEy1+ZHkLJvtv4Pbnc0CiDWr5IwKyG Y/PCPiTDIpOnnwJvpo0+SToJD8VqrvU2MTwlLY12kImxrAn0M/RZeyLDof/YA5QMAl gOowhrbI+/Zt1CojXZl8t5NT3WxeHJuRd7rvOgPrBd8xtgi5AcnXtV19vNirR9CWmK +a9kfN95HYW/uCllXvxKqKVNIIIJMJEKkKXywFt9Yz3B7Fn8/0h5eVbXunL8W6moFb 3GpQqnWJCi3cg== Date: Fri, 19 Jan 2024 12:44:51 +0000 To: Niels Dossche Cc: PHP internals Message-ID: In-Reply-To: <921837a7-81bf-4c10-bb79-36eda76e8d5d@gmail.com> References: <2006cef3-0e8c-49cc-9703-0fa70690a4ae@gmail.com> <921837a7-81bf-4c10-bb79-36eda76e8d5d@gmail.com> Feedback-ID: 96993444:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] [Discussion] Opt-in DOM spec-compliance From: internals@gpb.moe ("Gina P. Banyard") On Thursday, 18 January 2024 at 20:08, Niels Dossche wrote: > Hi Gina >=20 > On 18/01/2024 14:05, Gina P. Banyard wrote: >=20 > > Hello Niels, > >=20 > > Thank you for the RFC and the thorough overview of the current state. > >=20 > > I think converting the new aliases to proper classes which have the cor= rect spec behaviour is indeed the way to proceed. > >=20 > > I do have some questions however, do you really think we need the DOMDo= cument methods to import modern nodes into legacy documents? > > As I can imagine, this would provide fewer incentives for users to move= to the new spec compliant classes. >=20 >=20 > It's a double-edged sword: if we don't provide it, it becomes harder to m= igrate and it may take a longer time to do so. > If we do provide it there may be fewer incentives. >=20 > I think it's necessary as a first step to aid migration, otherwise, if we= don't provide this, it's going to become more difficult for library mainta= iners as they'd have to effectively create two versions of their library in= some cases. > By creating these methods it may become possible to use libraries that ar= e not yet adapted to the new classes. So depending on your point of view it= may even accelerate adoption. > One caveat is, as always, that any migration can be hindered if a library= you try to use relies on bugs that are fixed in the new classes. Understandable, I suppose we can always deprecate the import modern node me= thods before the import legacy nodes. > > The other thing to clarify is why and when would those return false, co= mpared to the methods that import legacy nodes which never throw? > =20 > {import,adopt}ModernNode may return false or throw, depending on the $str= ictErrorChecking property of DOMDocument, when an error occurs. > The only possible error case really is when an unsupported node is import= ed/adopted (e.g. a document itself). > The reason we don't have the false return value for {import,adopt}LegacyN= ode is because the DOM\{XML,HTML}Document class doesn't have a $strictError= Checking property, i.e. it always uses exceptions. ACK Best regards, Gina P. Banyard