Uploaded image for project: 'FOP'
  1. FOP
  2. FOP-2959

Using fo:retrieve-marker in an artifact (static content from header) breaks accesibility for the next page

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.5, 2.4
    • None
    • renderer/pdf
    • None
    • Patch, Important

    Description

      Using a fo:retrieve-marker in a header static content, that is marked with role artifact breaks the accessibility tags structure tree for the next pages.

       <fo:static-content
            flow-name="sc-before"
            role="artifact">
                    <fo:block>Header <fo:retrieve-marker
                        retrieve-boundary="document"
                        retrieve-class-name="title"
                        retrieve-position="first-including-carryover"/></fo:block>
       </fo:static-content>
      

      The cause:
      The class org.apache.fop.accessibility.fo.FO2StructureTreeConverter switches the current FOEventHandler (converter) to one that "swallows" all events each time an artifact is found, and restores the initial converter after the artifact ends.But this gets into conflict with the retrieve markers. The retrieve marker restore state event is processed asynchronous, just before the current page is finished, and restores the FOEventHandler to the one it was available when the start retrieve marker was emmited (in our case the "swallower", because the retrieve marker was in an artifact). The result is that the "swallower" is the current FOEventHandler for the next page.

      The fix:

      The fix is to restore the initial handler each time the page ends:
      At the end of the method: org.apache.fop.accessibility.fo.FO2StructureTreeConverter.endPageSequence(PageSequence)
      add:

        if (converter == eventSwallower) {
                converter = structureTreeEventTrigger;
                converters.clear();
         }        
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dc33 Dan Caprioara
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified