This patch moves remaining transformation logic to a renamed (from
HTMLTransformInput -> HTMLTransform) class. Also, the HTMLTransform
class is moved to the correct directory, hence namespace (including
tests).
Some data files have been copied over to it's own sub-directory in
the correct place since HTMLTransformTest needs it. ParsoidHandler
class is fine where it is because its operation is what happens in
the REST land.
NOTE: The 2 remaining methods moved into HTMLTransform are the last
ones we intended to move into this class to make the refactoring of
html2wt() method complete in this context.
Change-Id: I8929931e1b0acf247abe9d826eef57f3e0d4e132
When refactoring, we were assuming that if the input is a page bundle,
it will always contain original HTML. That is not the case. We need to
make use of the supplied data-parsoid array even if there is no original
HTML given.
Change-Id: Ida8cbfcaac059af8902db9560a3ad6884e8b1790
This is a regression test for an issue that broke parsoid's roundtrip
tests. The issue itself was already fixed on the master branch.
Change-Id: Ia7edb26a149231fbfc43f4edb8185304341b19ca
This moved the logic for applying page bundle data into the getters that
return DOM elements. It also makes the application of version
downgrades implicit.
NOTE: This patch changes the expected value of one of the phpunit tests
to a version that has no closing </div> tags. This appears to be the
original and expected behavior, per the corresponding test in the
parsoid extension's Parsoid.js test suite.
Change-Id: If2d7b06d8ba92fb63e6955ec7587ed4aea557251
* Several unit tests had lost information about the input format
being a pagebundle format.
* Fix the input format for a number of tests and a test expectation
in one case.
I removed a number of spurious comments which were misinterpreting
why the pagebundle format was being used. If the input payload is
in pagebundle format, the specified format should match that.
In integration tests, the API endpoint implicitly provides this
format information. But, in unit tests, this should be done explicitly
which would also be the case for internal service object callers.
Change-Id: If3d3c0ad2ee1fe19f4c1590caa43bea4340cc08c
Moving lazy initialization logic into HTMLTransformInput to clarify flow
of information.
DEPLOY: Mention that we've fixed $htmlSize and it will affect metrics
graphs when this roles out.
Change-Id: If09afc4b933ec99561ac9e4d53383bd42a856eaa
We were only testing the offset type mismatch case with a non-standard
offset type in the 'original' data structure. This cause us to miss a
bug. This adds a test that has a non-standard offset type coming from
the request attributes.
Change-Id: Icac28b3f8c85bc594e1cae42a4ee407f0d54a19b