You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

markers_6a.xml 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <testcase>
  18. <info>
  19. <p>
  20. This test checks markers, especially the retrieval of markers
  21. belonging to a preceding page.
  22. </p>
  23. </info>
  24. <fo>
  25. <fo:root
  26. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  27. xmlns:fox="http://xml.apache.org/fop/extensions"
  28. xmlns:svg="http://www.w3.org/2000/svg">
  29. <fo:layout-master-set>
  30. <fo:simple-page-master master-name="odd"
  31. page-width="5in" page-height="5in">
  32. <fo:region-body margin="0.5in 0in"/>
  33. <fo:region-before extent="0.5in" region-name="before-odd"/>
  34. <fo:region-after extent="0.5in" region-name="after-odd"/>
  35. </fo:simple-page-master>
  36. <fo:simple-page-master master-name="even"
  37. page-width="5in" page-height="5in">
  38. <fo:region-body margin="0.5in 0in"/>
  39. <fo:region-before extent="0.5in" region-name="before-even"/>
  40. <fo:region-after extent="0.5in" region-name="after-even"/>
  41. </fo:simple-page-master>
  42. <fo:page-sequence-master master-name="odd-even">
  43. <fo:repeatable-page-master-alternatives>
  44. <fo:conditional-page-master-reference
  45. master-reference="odd"
  46. page-position="any"
  47. odd-or-even="odd" />
  48. <fo:conditional-page-master-reference
  49. master-reference="even"
  50. page-position="any"
  51. odd-or-even="even" />
  52. </fo:repeatable-page-master-alternatives>
  53. </fo:page-sequence-master>
  54. </fo:layout-master-set>
  55. <fo:page-sequence master-reference="odd-even">
  56. <fo:static-content flow-name="before-odd">
  57. <fo:block>
  58. <fo:retrieve-marker retrieve-class-name="chapter"
  59. retrieve-boundary="page-sequence"
  60. retrieve-position="first-starting-within-page"/>
  61. <fo:leader leader-length.minimum="12pt"
  62. leader-length.optimum="80pt"
  63. leader-length.maximum="100%" leader-pattern="space">
  64. </fo:leader>page <fo:page-number/></fo:block>
  65. </fo:static-content>
  66. <fo:static-content flow-name="before-even">
  67. <fo:block>
  68. <fo:retrieve-marker retrieve-class-name="section"
  69. retrieve-boundary="page-sequence"
  70. retrieve-position="first-starting-within-page"/>
  71. <fo:leader leader-length.minimum="12pt"
  72. leader-length.optimum="80pt"
  73. leader-length.maximum="100%" leader-pattern="space">
  74. </fo:leader>page <fo:page-number/>
  75. </fo:block>
  76. </fo:static-content>
  77. <fo:static-content flow-name="after-odd">
  78. <fo:block text-align="end">
  79. <fo:retrieve-marker retrieve-class-name="chapter"
  80. retrieve-boundary="page-sequence"
  81. retrieve-position="last-ending-within-page"/>
  82. </fo:block>
  83. </fo:static-content>
  84. <fo:static-content flow-name="after-even">
  85. <fo:block text-align="end">
  86. <fo:retrieve-marker retrieve-class-name="section"
  87. retrieve-boundary="page-sequence"
  88. retrieve-position="last-ending-within-page"/>
  89. </fo:block>
  90. </fo:static-content>
  91. <fo:flow flow-name="xsl-region-body">
  92. <fo:block space-before="6pt" space-after="6pt"
  93. font-weight="bold" id="ch5" background-color="#EE1">
  94. <fo:marker marker-class-name="chapter">5 Property Refinement / Resolution</fo:marker>
  95. <fo:marker marker-class-name="section">5 Property Refinement / Resolution</fo:marker>5 Property Refinement / Resolution
  96. </fo:block>
  97. <fo:block>
  98. During refinement the set of properties that apply to a
  99. formatting object is transformed into a set of traits that define
  100. constraints on the result of formatting. For many traits there is a
  101. one-to-one correspondence with a property; for other traits the
  102. transformation is more complex. Details on the transformation are
  103. described below.
  104. </fo:block>
  105. <fo:block space-before="6pt" space-after="6pt"
  106. font-weight="bold" id="sect5-1" background-color="#DD1">
  107. <fo:marker marker-class-name="section">5.1 Specified, Computed, and Actual Values, and Inheritance</fo:marker>5.1 Specified,
  108. Computed, and Actual Values, and Inheritance
  109. </fo:block>
  110. <fo:block>
  111. For every property that is applicable to a given
  112. formatting object, it is necessary to determine the value of the
  113. property. Three variants of the property value are distinguished: the
  114. specified value, the computed value, and the actual value.
  115. </fo:block>
  116. <fo:block space-before="6pt" space-after="6pt"
  117. font-weight="bold" id="sect5-2" background-color="#DD1">
  118. <fo:marker marker-class-name="section">5.2 Specified Values</fo:marker>5.2 Specified Values
  119. </fo:block>
  120. <fo:block>
  121. The specified value of a property is determined using the
  122. following mechanisms (in order of precedence)
  123. </fo:block>
  124. <fo:block>
  125. If the tree-construction process placed the property on
  126. the formatting object, use the value of that property as the specified
  127. value. This is called "explicit specification".
  128. </fo:block>
  129. <fo:block>
  130. Otherwise, if the property is inheritable, use the value
  131. of that property from the parent formatting object, generally the
  132. computed value (see below).
  133. </fo:block>
  134. <fo:block space-before="6pt" space-after="6pt"
  135. font-weight="bold" id="ch6" background-color="#EE6">
  136. <fo:marker marker-class-name="chapter">6 Shorthand Expansion</fo:marker>
  137. <fo:marker marker-class-name="section">6 Shorthand Expansion</fo:marker>6 Shorthand Expansion
  138. </fo:block>
  139. <fo:block>
  140. In XSL there are two kinds of shorthand properties; those
  141. originating from CSS, such as "border", and those that arise from
  142. breaking apart and/or combining CSS properties, such as
  143. "page-break-inside". In XSL both types of shorthands are handled in
  144. the same way.
  145. </fo:block>
  146. <fo:block space-before="6pt" space-after="6pt"
  147. font-weight="bold" id="sect6-1" background-color="#DD6">
  148. <fo:marker marker-class-name="section">6.1 Actual Values</fo:marker>6.1 Actual Values
  149. </fo:block>
  150. <fo:block>
  151. Specified values may be absolute (i.e., they are not
  152. specified relative to another value, as in "red" or "2mm") or relative
  153. (i.e., they are specified relative to another value, as in "auto",
  154. "2em", and "12%"), or they may be expressions. For most absolute
  155. values, no computation is needed to find the computed value. Relative
  156. values, on the other hand, must be transformed into computed values:
  157. percentages must be multiplied by a reference value (each property
  158. defines which value that is), values with a relative unit (em) must be
  159. made absolute by multiplying with the appropriate font size, "auto"
  160. values must be computed by the formulas given with each property,
  161. certain property values ("smaller", "bolder") must be replaced
  162. according to their definitions. The computed value of any property
  163. that controls a border width where the style of the border is "none"
  164. is forced to be "0pt".
  165. </fo:block>
  166. <fo:block>
  167. Some properties have more than one way in which the
  168. property value can be specified. The simplest example of such
  169. properties are those which can be specified either in terms of a
  170. direction relative to the writing-mode (e.g., padding-before) or a
  171. direction in terms of the absolute geometric orientation of the
  172. viewport (e.g., padding-top). These two properties are called the
  173. relative property and the absolute property,
  174. respectively. Collectively, they are called "corresponding
  175. properties".
  176. </fo:block>
  177. <fo:block>
  178. Specifying a value for one property determines both a computed
  179. value for the specified property and a computed value for the
  180. corresponding property. Which relative property corresponds to which
  181. absolute property depends on the writing-mode. For example, if the
  182. "writing-mode" at the top level of a document is "lr-tb", then
  183. "padding-start" corresponds to "padding-left", but if the
  184. "writing-mode" is "rl-tb", then "padding-start" corresponds to
  185. "padding-right". The exact specification of how to compute the values
  186. of corresponding properties is given in [5.3 Computing the Values of
  187. Corresponding Properties].
  188. </fo:block>
  189. <fo:block>
  190. In most cases, elements inherit computed values. However,
  191. there are some properties whose specified value may be inherited
  192. (e.g., some values for the "line-height" property). In the cases where
  193. child elements do not inherit the computed value, this is described in
  194. the property definition.
  195. </fo:block>
  196. <fo:block>
  197. A computed value is in principle ready to be used, but a
  198. user agent may not be able to make use of the value in a given
  199. environment. For example, a user agent may only be able to render
  200. borders with integer pixel widths and may, therefore, have to adjust
  201. the computed width to an integral number of media pixels. The actual
  202. value is the computed value after any such adjustments have been
  203. applied.
  204. </fo:block>
  205. <fo:block>
  206. Some of the properties applicable to formatting objects
  207. are "inheritable." Such properties are so identified in the property
  208. description. The inheritable properties can be placed on any
  209. formatting object. The inheritable properties are propagated down the
  210. formatting object tree from a parent to each child. (These properties
  211. are given their initial value at the root of the result tree.) For a
  212. given inheritable property, if that property is present on a child,
  213. then that value of the property is used for that child (and its
  214. descendants until explicitly re-set in a lower descendant); otherwise,
  215. the specified value of that property on the child is the computed
  216. value of that property on the parent formatting object. Hence there is
  217. always a specified value defined for every inheritable property for
  218. every formatting object.
  219. </fo:block>
  220. </fo:flow>
  221. </fo:page-sequence>
  222. </fo:root>
  223. </fo>
  224. <checks>
  225. <!-- page 1 -->
  226. <true xpath="starts-with(//pageViewport[@nr=1]//regionBefore,'5 ')"/>
  227. <true xpath="starts-with(//pageViewport[@nr=1]//regionAfter,'5 ')"/>
  228. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5 ')]"/>
  229. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5.1 ')]"/>
  230. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5.2 ')]"/>
  231. <!-- page 2 -->
  232. <true xpath="starts-with(//pageViewport[@nr=2]//regionBefore,'6 ')"/>
  233. <true xpath="starts-with(//pageViewport[@nr=2]//regionAfter,'6.1 ')"/>
  234. <true xpath="//pageViewport[@nr=2]//regionBody//block[starts-with(.,'6 ')]"/>
  235. <true xpath="//pageViewport[@nr=2]//regionBody//block[starts-with(.,'6.1 ')]"/>
  236. <!-- page 3 -->
  237. <true xpath="starts-with(//pageViewport[@nr=3]//regionBefore,'6 ')"/>
  238. <true xpath="starts-with(//pageViewport[@nr=3]//regionAfter,'6 ')"/>
  239. <true xpath="not(//pageViewport[@nr=3]//regionBody//block[starts-with(.,'6 ')])"/>
  240. <true xpath="not(//pageViewport[@nr=3]//regionBody//block[starts-with(.,'6.1 ')])"/>
  241. <!-- page 4 -->
  242. <true xpath="starts-with(//pageViewport[@nr=4]//regionBefore,'6.1 ')"/>
  243. <true xpath="starts-with(//pageViewport[@nr=4]//regionAfter,'6.1 ')"/>
  244. <true xpath="not(//pageViewport[@nr=4]//regionBody//block[starts-with(.,'6 ')])"/>
  245. <true xpath="not(//pageViewport[@nr=4]//regionBody//block[starts-with(.,'6.1 ')])"/>
  246. <!-- page 5 -->
  247. <true xpath="starts-with(//pageViewport[@nr=5]//regionBefore,'6 ')"/>
  248. <true xpath="starts-with(//pageViewport[@nr=5]//regionAfter,'6 ')"/>
  249. <true xpath="not(//pageViewport[@nr=5]//regionBody//block[starts-with(.,'6 ')])"/>
  250. <true xpath="not(//pageViewport[@nr=5]//regionBody//block[starts-with(.,'6.1 ')])"/>
  251. </checks>
  252. </testcase>