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

Position:fixed uses a bad reference area

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.2
    • None
    • layout/block
    • None

    Description

      When trying to place some elements to the corners of the page, it seems that FOP uses some wrong dimensions. Take a look at the attached screenshot, showing the difference between FOP and AntennaHouse.

      <?xml version="1.0" encoding="UTF-8"?>
      <fo:root
          xml:lang="dflt"
          xmlns:css="http://www.w3.org/1998/CSS"
          xmlns:fo="http://www.w3.org/1999/XSL/Format">
          <fo:layout-master-set>
              <!-- Page: css2fo-default-->
              <fo:page-sequence-master
                  master-name="css2fo-default">
                  <fo:repeatable-page-master-alternatives>
                      <fo:conditional-page-master-reference
                          blank-or-not-blank="any"
                          master-reference="spm-css2fo-default"
                          odd-or-even="any"
                          page-position="any"/>
                  </fo:repeatable-page-master-alternatives>
              </fo:page-sequence-master>
              <fo:simple-page-master
                  master-name="spm-css2fo-default"
                  page-height="8.27in"
                  page-width="5.83in">
                  <fo:region-body
                      border-bottom-color="orange"
                      border-bottom-style="solid"
                      border-bottom-width="2pt"
                      border-left-color="orange"
                      border-left-style="solid"
                      border-left-width="2pt"
                      border-right-color="orange"
                      border-right-style="solid"
                      border-right-width="2pt"
                      border-top-color="orange"
                      border-top-style="solid"
                      border-top-width="2pt"
                      margin-bottom="1in"
                      margin-left="1in"
                      margin-right="1in"
                      margin-top="1in"/>
                  <fo:region-before
                      extent="1in"
                      region-name="sc-before"/>
                  <fo:region-after
                      extent="1in"
                      region-name="sc-after"/>
                  <fo:region-start
                      extent="1in"
                      region-name="sc-start"/>
                  <fo:region-end
                      extent="1in"
                      region-name="sc-end"/>
              </fo:simple-page-master>
          </fo:layout-master-set>
          <fo:declarations>
              <x:xmpmeta
                  xmlns:x="adobe:ns:meta/">
                  <rdf:RDF
                      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                      <rdf:Description>
                          <xmp:CreatorTool
                              xmlns:xmp="http://ns.adobe.com/xap/1.0/">oXygen PDF Chemistry</xmp:CreatorTool>
                      </rdf:Description>
                  </rdf:RDF>
              </x:xmpmeta>
          </fo:declarations>
          <fo:page-sequence
              force-page-count="no-force"
              id="last-page-sequence"
              line-height-shift-adjustment="disregard-shifts"
              master-reference="css2fo-default">
              <fo:flow
                  flow-name="xsl-region-body">
                  <fo:block
                      font-family="serif"
                      font-size="12pt">
                      <fo:block
                          font-size="larger"
                          font-style="oblique">An element with position: fixed is positioned relative to its
                          page.</fo:block>
                      <fo:block>1. Normal div.</fo:block>
                      <fo:block-container
                          border-bottom-color="red"
                          border-bottom-style="solid"
                          border-bottom-width="3pt"
                          border-left-color="red"
                          border-left-style="solid"
                          border-left-width="3pt"
                          border-right-color="red"
                          border-right-style="solid"
                          border-right-width="3pt"
                          border-top-color="red"
                          border-top-style="solid"
                          border-top-width="3pt"
                          height="100pt"
                          left="10pt"
                          position="fixed"
                          top="10pt"
                          width="100pt">
                          <fo:block
                              end-indent="0"
                              start-indent="0">Fixed top left.</fo:block>
                      </fo:block-container>
                      <fo:block-container
                          border-bottom-color="red"
                          border-bottom-style="solid"
                          border-bottom-width="3pt"
                          border-left-color="red"
                          border-left-style="solid"
                          border-left-width="3pt"
                          border-right-color="red"
                          border-right-style="solid"
                          border-right-width="3pt"
                          border-top-color="red"
                          border-top-style="solid"
                          border-top-width="3pt"
                          height="100pt"
                          position="fixed"
                          right="10pt"
                          top="10pt"
                          width="100pt">
                          <fo:block
                              end-indent="0"
                              start-indent="0">Fixed top right.</fo:block>
                      </fo:block-container>
                      <fo:block-container
                          border-bottom-color="red"
                          border-bottom-style="solid"
                          border-bottom-width="3pt"
                          border-left-color="red"
                          border-left-style="solid"
                          border-left-width="3pt"
                          border-right-color="red"
                          border-right-style="solid"
                          border-right-width="3pt"
                          border-top-color="red"
                          border-top-style="solid"
                          border-top-width="3pt"
                          bottom="10pt"
                          height="100pt"
                          left="10pt"
                          position="fixed"
                          width="100pt">
                          <fo:block
                              end-indent="0"
                              start-indent="0">Fixed bottom left.</fo:block>
                      </fo:block-container>
                      <fo:block-container
                          border-bottom-color="red"
                          border-bottom-style="solid"
                          border-bottom-width="3pt"
                          border-left-color="red"
                          border-left-style="solid"
                          border-left-width="3pt"
                          border-right-color="red"
                          border-right-style="solid"
                          border-right-width="3pt"
                          border-top-color="red"
                          border-top-style="solid"
                          border-top-width="3pt"
                          bottom="10pt"
                          height="100pt"
                          position="fixed"
                          right="10pt"
                          width="100pt">
                          <fo:block
                              end-indent="0"
                              start-indent="0">Fixed bottom right.</fo:block>
                      </fo:block-container>
                      <fo:block>2. Normal div.</fo:block>
                      <fo:block>3. Normal div.</fo:block>
                  </fo:block>
              </fo:flow>
          </fo:page-sequence>
      </fo:root>
      

      Attachments

        1. position-fixed-bad-reference-area.png
          72 kB
          Dan Caprioara
        2. position.fo
          5 kB
          Dan Caprioara
        3. fop.patch
          3 kB
          Dan Caprioara

        Activity

          People

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

            Dates

              Created:
              Updated: