Open bertfrees opened 5 years ago
Counting things that comes after the block is incorrect. However, I do think that the entire block (including margins) should end on the specified line.
<?xml version="1.0" encoding="UTF-8"?>
<pef version="2008-1" xmlns="http://www.daisy.org/ns/2008/pef">
<head>
<meta xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/x-pef+xml</dc:format>
<dc:identifier>identifier?</dc:identifier>
<dc:date>2019-05-10</dc:date>
</meta>
</head>
<body>
<volume cols="10" rows="12" rowgap="0" duplex="false">
<section>
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
</page>
</section>
<section>
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row/>
</page>
</section>
<section>
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row/>
</page>
</section>
<section>
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row/>
<row>⠉⠉⠉⠉⠉</row>
</page>
</section>
<section>
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row/>
<row>⠉⠉⠉⠉⠉</row>
<row/>
</page>
</section>
</volume>
</body>
</pef>
Thanks. What about collapsed margins? How to count these?
<sequence master="body">
<block>⠉⠉⠉⠉⠉</block>
<block margin-bottom="2">
<block vertical-align="before" vertical-position="8" margin-bottom="1">
<block>⠿⠿⠿⠿⠿<br/>⠿⠿⠿⠿⠿<br/>⠿⠿⠿⠿⠿</block>
</block>
</block>
<block>⠉⠉⠉⠉⠉</block>
</sequence>
Like this?
<page>
<row>⠉⠉⠉⠉⠉</row>
<row/>
<row/>
<row/>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row>⠿⠿⠿⠿⠿</row>
<row/>
<row/>
<row>⠉⠉⠉⠉⠉</row>
</page>
@kalaspuffar Joel said that at least part of this reported behavior is wrong, in other words a bug in Dotify, so maybe interesting for you to look at.
How exactly vertical-position
interacts with margins and collapsing of margins needs to be cleared up. I can work on this (OBFL issue https://github.com/braillespecs/obfl/issues/69). I think the solution I will propose is to position the block including the margins at the specified position. Basically what Joel said. This is apparently also how it works in CSS for absolute positioning (specification here). Collapsing margins would work normally, like in the example in my comment above.
I have made the following test OBFL:
which results in this PEF:
@joeha480 Could you change this PEF according to what is expected according to you. The spec is not entirely clear about this. I would think the position of the block with
vertical-position
should not be affected by the⠉⠉⠉⠉⠉
block after it. But also the fact that the position is affected bymargin-bottom
seems a bit strange.If you can fix the expected output I will try to fix the issue.
Note that my fix for https://github.com/brailleapps/dotify.formatter.impl/issues/92 did not fix this issue.