Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123719 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id CFF6F1A009C for ; Fri, 21 Jun 2024 08:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1718957472; bh=V7mDPKKdG4rWwgOZkgMfr771rM94M1GjFD84dvRQYfU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=g091+CWDn9iAJ4BFFRG3taZvAhgWgpYMP+bDnIaF/b6bF0X8MjKfZyL2wInGJZeWk Ra2t8zQEd/MUhgpKD51twwJ3umB3DPqDRoiA8+k8Yg6iHGjq0k5TCOYc5Vx84Z72Dj MIlxCK+WQKhK2TzTVnUZY4PLTmP8NecTQjNMpuQ4RXpZhH15JcgbIM/Mfaip7Heyz9 XL/F6X4Mvz6Z+k7f77BLLihUQGnExbXBtyprVBiuDJne9K95Ga6vpnQbNW2QyxpRvv ivkxiwy3yNzUWP7AlPp4k8Du2xwemobJKCwuxDFt48/zKGcGnT2oHun9pmEZnJIhNC qfjuQrAJOsXZQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 634CB180077 for ; Fri, 21 Jun 2024 08:11:11 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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, 21 Jun 2024 08:11:10 +0000 (UTC) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4217a96de38so13252045e9.1 for ; Fri, 21 Jun 2024 01:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718957395; x=1719562195; darn=lists.php.net; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LQlgb2wEMRNLl9kOTjld95IN4pci+JI4UooUNgEMwLo=; b=JBSAXFe7omwVS/D6NjRGuPcTmRubwa6aiw1mYJmtpa4MipzhbADkXc/6WAzCFb6eE/ 4mrlZ0CKnYm1OwGKRWBjRIuNhqNOXpH1mWkjPPInaH4w42UifSbKQReqvJvd6MSWM0Ca a6i6aTwW4W8E9VfVrZgLo6FKK77eockO/K3DhZgUUGdDqs7egx44zgCBhdyb4r+cxtvg gB0OmAVoRm1o1M+6tS1PE8UaqHoDksEnZzI7ZPb+DPInHMOpxnh250XEtvLyYSOFhl5i BBzYFyoHJ6QefYv/n40Gd7AhA5BMPGnO/RhwraT9pdB+lLmGuM3ity/z8JUxAqjH29KH WfxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718957395; x=1719562195; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LQlgb2wEMRNLl9kOTjld95IN4pci+JI4UooUNgEMwLo=; b=hlO0zGTONnLlVfj0dNBgBhFXML5LvEewbTTB9lhejvaiq+ndjW1W4QqqRmyv5dRe5W 7iFTI9kYfKPc8eT0NM9gRaa4VfE7gXz5vsDk/Do/UKx8voVmSnCcSJNSS2+Vsr9f7XPh N+JTE2tLwiw1T7b1tpPeIYddjT40fLiuWknnzbdwO2QSaszpG9ny5OXCe/K6KNMakJKs g3me8JDUlpEK14a/z3HHhlEf1477yIpaiB1AT4TzcJA/HdV5nthDehN5HSPZj1L5rVjY Cmg6DGpBVYzw2Cb3h/HOHjo/B724EuhBL44KHdTXXXddVa9ZbxwpU373EMdFOjmidy+x mG1A== X-Gm-Message-State: AOJu0Yy026cfwulvbH2wkmQkPgKR5cXvPWwitAguu29pWf/87v3YLWBG cf8v2PvbOaXO4+ZbVjelT/0kbJISOKj5WgcfH6icHXJaMvJ6mhL0 X-Google-Smtp-Source: AGHT+IGTRWbICP9Xxw61DULh0qqeiO01SIQmieDoa77E6lbgrG92kA+Eqh6Etk3o6FuaWiw08p44QA== X-Received: by 2002:a05:600c:12c6:b0:422:70d4:7e96 with SMTP id 5b1f17b1804b1-42475176308mr56572505e9.15.1718957395179; Fri, 21 Jun 2024 01:09:55 -0700 (PDT) Received: from [192.168.0.103] (178-117-134-240.access.telenet.be. [178.117.134.240]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4247d212254sm53108165e9.45.2024.06.21.01.09.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jun 2024 01:09:54 -0700 (PDT) Message-ID: Date: Fri, 21 Jun 2024 10:08:31 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [Vote] New ext-dom features in PHP 8.4 To: Matthew Weier O'Phinney Cc: PHP internals References: <28a3990b-f0a4-4c4e-a14d-3eac3aa7fbce@gmail.com> <7d69ef65-4c16-4479-9239-46b6df20cac3@gmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: dossche.niels@gmail.com (Niels Dossche) On 20/06/2024 23:55, Matthew Weier O'Phinney wrote: > > > On Thu, Jun 20, 2024, 1:27 PM Niels Dossche > wrote: > > On 20/06/2024 16:28, Matthew Weier O'Phinney wrote: > > > > > > On Mon, Jun 10, 2024 at 1:15 PM Niels Dossche >> wrote: > > > >     Hi internals > > > >     I'm opening the vote of my RFC "New ext-dom features in PHP 8.4". > >     RFC link: https://wiki.php.net/rfc/dom_additions_84 > > >     Voting runs until 24th of June 21:00 GMT+2. > > > >     Kind regards > >     Niels > > > > > > Question: why is `Dom\Document::$head` marked as readonly? > > The HTML spec defines the head property to be readonly: https://html.spec.whatwg.org/#document > That's why $head is marked readonly. > > So I guess the question becomes "why does the HTML spec define it this way?" > I couldn't find a conclusive answer to this, it looks like this has been read-only since HTML's early days... > I thought about it but don't really see a technical reason why this is the case. If I had to take a guess I'd say it's for simplicity sake. > > he/him > > > I can understand that from a browser perspective, but from PHP, where we might be manipulating HTML to send back to the client, having it readonly would be a pretty big hindrance.  > Would it? Note that only the binding is readonly, you can manipulate the head element as you wish. e.g. `$doc->head->replaceWith($another_element);` is still possible and not much more difficult than `$doc->head = $another_element;`. I could add a setter for the head element, but what if WHATWG defines a setter for the head element at a later point in time that's incompatible with what I added? It may sound far-fetched, but that's not unreasonable given that setting the $body property is way more complicated than just find+replace `` (e.g. handles framesets too). Kind regards Niels