You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by "plutext (via GitHub)" <gi...@apache.org> on 2026/10/06 22:15:36 UTC

[PR] FOP-3355: A side float ends at the break before the first line below its foot, and the space at its edge is kept [xmlgraphics-fop]

plutext opened a new pull request, #124:
URL: https://github.com/apache/xmlgraphics-fop/pull/124

   Fixes [FOP-3355](https://issues.apache.org/jira/browse/FOP-3355).
   
   Two defects at a side float's edge:
   - The float's end was tested only at line boxes (`PageBreakingAlgorithm.handleBox`); glue is added to the
     content height but never ran the test. So when the float's foot fell in the space between two paragraphs, the
     next paragraph's first line was still laid out beside the float, although it lay wholly below it.
   - The space at the edge was discarded as at a page break: `PageBreaker.addAreasForFloats` notified the
     `SpaceResolver` of the edge as the end of a part, so the space-after of the paragraph beside the float, or the
     space-before of the one after it, was lost.
   
   **The change.**
   - `PageBreakingAlgorithm.considerLegalBreak`: while a float is in force, the float ends at a legal break if the
     content height before it plus the glue up to the next box (as `forceNode` measures a node) reaches the float's
     height; `deactivateNode` records that height, so the content after the float starts below the space.
   - `PageBreaker.addAreasForFloats`: the `SpaceResolver` notification runs to the last glue before the next box,
     so the edge's break position is told it is no break and the space is resolved and kept.
   - The block the list is read again from after the edge keeps the space-before resolved in the list before and
     emits none: a `LayoutContext.FLOAT_RESTART` flag (a bit of its own), set by `PageBreaker` and handed by
     `FlowLayoutManager` to that block only, read in `BlockStackingLayoutManager.addFirstVisibleMarks` and
     `BlockLayoutManager`.
   
   **Test.** `float_edge-after-space.xml`: a 20pt float in a heading, with the space as space-after, as
   space-before, and after a heading line that reaches the float's foot, and with no space (the line beside the
   float stays narrowed). Its first check fails without the change. With it, the fop-core suite passes, 3682 tests
   and 0 failures, and checkstyle reports 0 violations.
   
   ### Commits
   
   Two commits: the first is FOP-3354 (#123), which this change is built on (both change
   `PageBreakingAlgorithm.considerLegalBreak`) and which has a pull request of its own; the second is this fix. Once
   #123 is merged this branch will be rebased to the one commit.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Re: [PR] FOP-3355: A side float ends at the break before the first line below its foot, and the space at its edge is kept [xmlgraphics-fop]

Posted by "plutext (via GitHub)" <gi...@apache.org>.
plutext commented on PR #124:
URL: https://github.com/apache/xmlgraphics-fop/pull/124#issuecomment-6180438661

   Rebased onto main at ced58ae40 as a single commit (765487a77), now that FOP-3354 (bed50fc76) is on main; no change to the fix. Layout engine suite 748/0 and checkstyle clean on main.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org