Dan Caprioara created FOP-2959:
----------------------------------

             Summary: Using fo:retrieve-marker in an artifact (static content 
from header) breaks accesibility for the next page 
                 Key: FOP-2959
                 URL: https://issues.apache.org/jira/browse/FOP-2959
             Project: FOP
          Issue Type: Bug
          Components: renderer/pdf
    Affects Versions: 2.4, 2.5
            Reporter: Dan Caprioara


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.
{code:xml}
 <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>
{code}
*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:
{code:java}
  if (converter == eventSwallower) {
          converter = structureTreeEventTrigger;
          converters.clear();
   }        
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to