[ParsoidParser] Remove unneeded code to set render ID
commit16de2c085120d82fc1203a2b28eaa7b64eb8df0e
authorC. Scott Ananian <cscott@cscott.net>
Thu, 8 Feb 2024 21:07:04 +0000 (8 16:07 -0500)
committerC. Scott Ananian <cscott@cscott.net>
Fri, 19 Jul 2024 20:09:32 +0000 (19 16:09 -0400)
treed2f56306b09f08c119410ac8af39c81ff187d122
parent3e41554b301c5f552804dfa6d098de053d91f4a1
[ParsoidParser] Remove unneeded code to set render ID

Since I72c5e6f86b7f081ab5ce7a56f5365d2f75067a78 it is part of the
contract of ContentRenderer::getParserOutput() that the render ID (and
other cache parameters) will be set when it returns.
(ContentHandler::getParserOutput() can set them even earlier if it has
custom content-based overrides.)  We had a lot of temporary
backward-compatibility code "later" in the parse process to try to close
the barn door if some code path "forgot" to set them, but these are
unnecessary now.

This patch removes that backward-compatibility code in ParsoidParser;
there is similar remaining code in ParserCache etc. which can be
addressed in follow ups.

(For compatibility we do have to temporarily copy the render ID code
inside ParsoidOutputAccess::parseUncachable, but that class is
deprecated and will be removed.)

The HtmlOutputRendererHelper path which used to call
ParsoidParser::parseFakeRevision() is now replaced with a codepath that
goes through RevisionRenderer.  In order to maintain the same behavior
of the ParsoidHandler, we have also added 'useParsoid' handling to the
JsonContentHandler.  This support can perhaps be deprecated eventually.

Bug: T350538
Change-Id: I0853624cf785f72fd956c6c2336f979f4402a68f
includes/Rest/Handler/Helper/HtmlOutputRendererHelper.php
includes/Rest/Handler/Helper/PageRestHelperFactory.php
includes/ServiceWiring.php
includes/content/JsonContentHandler.php
includes/parser/Parsoid/ParsoidOutputAccess.php
includes/parser/Parsoid/ParsoidParser.php
includes/parser/Parsoid/ParsoidParserFactory.php
maintenance/compareLanguageConverterOutput.php
tests/phpunit/integration/includes/Rest/Handler/Helper/HtmlOutputRendererHelperTest.php
tests/phpunit/integration/includes/Rest/Handler/RevisionHTMLHandlerTest.php
tests/phpunit/unit/includes/Rest/Handler/PageHandlerTestTrait.php