Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121183 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 40607 invoked from network); 29 Sep 2023 18:23:08 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Sep 2023 18:23:08 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AB43A1804B0 for ; Fri, 29 Sep 2023 11:23:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS29838 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 29 Sep 2023 11:23:07 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id ECF7A32002B6 for ; Fri, 29 Sep 2023 14:23:05 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute4.internal (MEProxy); Fri, 29 Sep 2023 14:23:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-type:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1696011785; x= 1696098185; bh=QtGeBZBZl5v8bSNbtZNj9GthzWBfuYGpgRc0d7PbiBM=; b=p En6s7j1/y8laXzJzZ2km+ph6q6RAShAlyxMOPm0VykjKpDae/+Br/hsNQUWg1n34 fdmqMwVIZ/psw9O76SgqEybVHRbKbFxSAkAZQwVUVvNR28OMILu+/YeuaSKbKpFV wUgm6brzq/RmVv8JJHTBlLod0oz+REC3VBvhI4E0q4gzQhSvNcURwNtIwcAPjN8b oRSMQ3IdV4AKJ5BjdEQnlMTHySOYCiNpJUAzgkfzMYJAsGnq0QS7hABblfWVnn2A mLhpqHRyLn5ufWTEX6WsKs6ogTkRzN78AlSSDy0n8/UmkxzmCZyAug88Zclkky0D 5x6O4m8qjoTrULX8+IXqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1696011785; x=1696098185; bh=QtGeBZBZl5v8b SNbtZNj9GthzWBfuYGpgRc0d7PbiBM=; b=Aj53H5Hx1SLzFJzfbWSSK4rkF9Yfj GJrnvMh4YCailcAAw6lQ7ukLCY3fpc9ysvyFAwdaIaBSdYgNaqwPkz/FFIVgnhYB sWqO14j0oTtWzFM/Bve7Izx4dGZclo1vtDga+TzpXU/E3Q817g0/weHYUy6c5XDX oMEYzLz+ujn3sPfU7Qp+BoDOK+i7c3bJhrjhVwV0Ku5qL3WMX12tjruMvYxljGAi coqig7y8jcEAHTw7WQUbrcKINJwsvvshbTAfLSxy2NCYViHI2RB4FVICTIJbWW+i pIoOAqi1ZZwS02XU5qAOHgcwEtuvsFMd8hHCB3gAqzaSunBUVm1IfE/cQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrtddvgdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesthdtredtreertdenucfhrhhomhepfdfnrghr rhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmqeenucggtffrrghtthgvrhhnpeeglefgkeduiedvvdetffeujefftdfhjeeiveehgfff keduveektddvledvvdfffeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3416A1700089; Fri, 29 Sep 2023 14:23:05 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-958-g1b1b911df8-fm-20230927.002-g1b1b911d MIME-Version: 1.0 Message-ID: <0fe18a09-14a7-41d2-982f-bca60c662249@app.fastmail.com> In-Reply-To: <59bd7af5-937a-4240-9768-c620e387e8d8@gmail.com> References: <48c7bb29-a52c-416e-b855-be2746dc7a84@gmail.com> <5ace1060-dd75-4cdc-b5e2-a2ea617df586@app.fastmail.com> <59bd7af5-937a-4240-9768-c620e387e8d8@gmail.com> Date: Fri, 29 Sep 2023 18:22:44 +0000 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] DOM HTML5 parsing and serialization support From: larry@garfieldtech.com ("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 throw exceptions rather than forcing people to remember to call another "was there an error" global function like it's still 1996? :-) > > I did think about it. > Using exceptions for the parser is not viable. This is because parse > errors in HTML aren't actually hard errors. > The errors are recoverable, i.e. the parser spec tells us how to > proceed when an error occurred. So in a sense, they're closer to > warnings. Using an exception would abort parsing. > As a side note, a good amount of the web pages out there violates at > least one parsing rule, but browsers know by-spec how to proceed in > that case (which is probably also why they're often not fixed). > > I thought about other options as well. E.g. providing a > getParseErrors() method or letting the factory methods return parse > errors optionally as well. > However, I think they're not significantly better than what we have > now. Furthermore, I think overhauling how the parse errors are handled > in ext/dom (and maybe by extension ext/simplexml to keep consistency) > is a bit of a feature creep. See also the motivation in the RFC text. > Therefore, I would keep the error handling as it is described now in > the RFC. > > If accepted, this RFC would land early in the 8.4 development cycle. > Therefore, we can gather feedback very early on. If we do notice a > major problem in how these things are handled, they can be changed by a > hypothetical future RFC in the same development cycle. That would also > require thinking about the other XML extensions though. All valid, thanks. It would be helpful to include some mention of that in the Errors section to make it clear why exceptions right now are not an option, given the push elsewhere to get rid of the old error handling approaches in favor of exceptions. --Larry Garfield