<credit-image> is written with the right valign since #451, but reading one still throws the
alignment away, so valign="middle" on a credit image does not survive a round trip.
getImageData reads position data and then discards the vertical alignment
(src/private/mx/impl/PageTextFunctions.cpp:43-47):
out.positionData = getPositionData(image);
out.positionData.verticalAlignment = api::VerticalAlignment::unspecified;
It has to discard it, because the generic getPositionData cannot read a picture's alignment. A
picture uses valign-image (top, middle, bottom) rather than the valign that text uses, and the
generic reader's value getter is compiled out on the type mismatch, so it hands back the default
baseline whenever the attribute is present. Recording that would be worse than recording nothing.
The direction <image> reader already solves this by reading the attribute off the element itself
(src/private/mx/impl/DirectionReader.cpp:978-999). getImageData should do the same.
This is also the reason the writer bug in #444 went unnoticed: no round trip ever carried a
credit-image alignment in for the writer to get wrong.
References
<credit-image>is written with the rightvalignsince #451, but reading one still throws thealignment away, so
valign="middle"on a credit image does not survive a round trip.getImageDatareads position data and then discards the vertical alignment(
src/private/mx/impl/PageTextFunctions.cpp:43-47):It has to discard it, because the generic
getPositionDatacannot read a picture's alignment. Apicture uses
valign-image(top, middle, bottom) rather than thevalignthat text uses, and thegeneric reader's value getter is compiled out on the type mismatch, so it hands back the default
baselinewhenever the attribute is present. Recording that would be worse than recording nothing.The direction
<image>reader already solves this by reading the attribute off the element itself(
src/private/mx/impl/DirectionReader.cpp:978-999).getImageDatashould do the same.This is also the reason the writer bug in #444 went unnoticed: no round trip ever carried a
credit-image alignment in for the writer to get wrong.
References
<image>and<credit-image>writevalign="top"for other alignments #444, which fixed the writer side; this is the reader side