Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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 -- nested areas.
  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-including-carryover"/>
  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:block>
  66. <fo:retrieve-marker retrieve-class-name="chapter"
  67. retrieve-boundary="page-sequence"
  68. retrieve-position="first-starting-within-page"/>
  69. </fo:block>
  70. </fo:static-content>
  71. <fo:static-content flow-name="before-even">
  72. <fo:block>
  73. <fo:retrieve-marker retrieve-class-name="section"
  74. retrieve-boundary="page-sequence"
  75. retrieve-position="first-including-carryover"/>
  76. <fo:leader leader-length.minimum="12pt"
  77. leader-length.optimum="80pt"
  78. leader-length.maximum="100%" leader-pattern="space">
  79. </fo:leader>page <fo:page-number/>
  80. </fo:block>
  81. <fo:block>
  82. <fo:retrieve-marker retrieve-class-name="chapter"
  83. retrieve-boundary="page-sequence"
  84. retrieve-position="first-starting-within-page"/>
  85. </fo:block>
  86. </fo:static-content>
  87. <fo:static-content flow-name="after-odd">
  88. <fo:block text-align="end">
  89. <fo:retrieve-marker retrieve-class-name="chapter"
  90. retrieve-boundary="page-sequence"
  91. retrieve-position="last-starting-within-page"/>
  92. </fo:block>
  93. <fo:block text-align="end">
  94. <fo:retrieve-marker retrieve-class-name="chapter"
  95. retrieve-boundary="page-sequence"
  96. retrieve-position="last-ending-within-page"/>
  97. </fo:block>
  98. </fo:static-content>
  99. <fo:static-content flow-name="after-even">
  100. <fo:block text-align="end">
  101. <fo:retrieve-marker retrieve-class-name="section"
  102. retrieve-boundary="page-sequence"
  103. retrieve-position="last-starting-within-page"/>
  104. </fo:block>
  105. <fo:block text-align="end">
  106. <fo:retrieve-marker retrieve-class-name="section"
  107. retrieve-boundary="page-sequence"
  108. retrieve-position="last-ending-within-page"/>
  109. </fo:block>
  110. </fo:static-content>
  111. <fo:flow flow-name="xsl-region-body">
  112. <fo:block id="ch5" background-color="#EE1">
  113. <fo:marker marker-class-name="chapter">5 Property Refinement / Resolution</fo:marker>
  114. <fo:marker marker-class-name="section">5 Property Refinement / Resolution</fo:marker>
  115. <fo:block space-before="6pt" space-after="6pt" font-weight="bold">
  116. 5 Property Refinement / Resolution
  117. </fo:block>
  118. <fo:block>
  119. During refinement the set of properties that apply to a
  120. formatting object is transformed into a set of traits that define
  121. constraints on the result of formatting. For many traits there is a
  122. one-to-one correspondence with a property; for other traits the
  123. transformation is more complex. Details on the transformation are
  124. described below.
  125. </fo:block>
  126. <fo:block id="sect5-1" background-color="#DD1">
  127. <fo:marker marker-class-name="section">5.1 Specified, Computed, and Actual Values, and Inheritance</fo:marker>
  128. <fo:block space-before="6pt" space-after="6pt" font-weight="bold">
  129. 5.1 Specified, Computed, and Actual Values, and Inheritance
  130. </fo:block>
  131. <fo:block>
  132. For every property that is applicable to a given
  133. formatting object, it is necessary to determine the value of the
  134. property. Three variants of the property value are distinguished: the
  135. specified value, the computed value, and the actual value.
  136. </fo:block>
  137. </fo:block>
  138. <fo:block id="sect5-2" background-color="#DD1">
  139. <fo:marker marker-class-name="section">5.2 Specified Values</fo:marker>
  140. <fo:block space-before="6pt" space-after="6pt" font-weight="bold">
  141. 5.2 Specified Values
  142. </fo:block>
  143. <fo:block>
  144. The specified value of a property is determined using the
  145. following mechanisms (in order of precedence)
  146. </fo:block>
  147. <fo:block>
  148. If the tree-construction process placed the property on
  149. the formatting object, use the value of that property as the specified
  150. value. This is called "explicit specification".
  151. </fo:block>
  152. <fo:block>
  153. Otherwise, if the property is inheritable, use the value
  154. of that property from the parent formatting object, generally the
  155. computed value (see below).
  156. </fo:block>
  157. </fo:block>
  158. </fo:block>
  159. <fo:block id="ch6" background-color="#EE6">
  160. <fo:marker marker-class-name="chapter">6 Shorthand Expansion</fo:marker>
  161. <fo:marker marker-class-name="section">6 Shorthand Expansion</fo:marker>
  162. <fo:block space-before="6pt" space-after="6pt" font-weight="bold">
  163. 6 Shorthand Expansion
  164. </fo:block>
  165. <fo:block>
  166. In XSL there are two kinds of shorthand properties; those
  167. originating from CSS, such as "border", and those that arise from
  168. breaking apart and/or combining CSS properties, such as
  169. "page-break-inside". In XSL both types of shorthands are handled in
  170. the same way.
  171. </fo:block>
  172. <fo:block id="sect6-1" background-color="#DD6">
  173. <fo:marker marker-class-name="section">6.1 Actual Values</fo:marker>
  174. <fo:block space-before="6pt" space-after="6pt" font-weight="bold">
  175. 6.1 Actual Values
  176. </fo:block>
  177. <fo:block>
  178. Specified values may be absolute (i.e., they are not
  179. specified relative to another value, as in "red" or "2mm") or relative
  180. (i.e., they are specified relative to another value, as in "auto",
  181. "2em", and "12%"), or they may be expressions. For most absolute
  182. values, no computation is needed to find the computed value. Relative
  183. values, on the other hand, must be transformed into computed values:
  184. percentages must be multiplied by a reference value (each property
  185. defines which value that is), values with a relative unit (em) must be
  186. made absolute by multiplying with the appropriate font size, "auto"
  187. values must be computed by the formulas given with each property,
  188. certain property values ("smaller", "bolder") must be replaced
  189. according to their definitions. The computed value of any property
  190. that controls a border width where the style of the border is "none"
  191. is forced to be "0pt".
  192. </fo:block>
  193. </fo:block>
  194. </fo:block>
  195. <fo:block id="ch7" background-color="#EEE">
  196. <fo:block>
  197. Some properties have more than one way in which the
  198. property value can be specified. The simplest example of such
  199. properties are those which can be specified either in terms of a
  200. direction relative to the writing-mode (e.g., padding-before) or a
  201. direction in terms of the absolute geometric orientation of the
  202. viewport (e.g., padding-top). These two properties are called the
  203. relative property and the absolute property,
  204. respectively. Collectively, they are called "corresponding
  205. properties".
  206. </fo:block>
  207. <fo:block>
  208. Specifying a value for one property determines both a
  209. computed value for the specified property and a computed value for the
  210. corresponding property. Which relative property corresponds to which
  211. absolute property depends on the writing-mode. For example, if the
  212. "writing-mode" at the top level of a document is "lr-tb", then
  213. "padding-start" corresponds to "padding-left", but if the
  214. "writing-mode" is "rl-tb", then "padding-start" corresponds to
  215. "padding-right". The exact specification of how to compute the values
  216. of corresponding properties is given in [5.3 Computing the Values of
  217. Corresponding Properties].
  218. </fo:block>
  219. <fo:block>
  220. In most cases, elements inherit computed values. However,
  221. there are some properties whose specified value may be inherited
  222. (e.g., some values for the "line-height" property). In the cases where
  223. child elements do not inherit the computed value, this is described in
  224. the property definition.
  225. </fo:block>
  226. <fo:block>
  227. A computed value is in principle ready to be used, but a
  228. user agent may not be able to make use of the value in a
  229. given environment. For example, a user agent may only be
  230. able to render borders with integer pixel widths and may,
  231. therefore, have to adjust the computed width to an
  232. integral number of media pixels. The actual value is the
  233. computed value after any such adjustments have been
  234. applied.
  235. </fo:block>
  236. <fo:block>
  237. Some of the properties applicable to formatting objects
  238. are "inheritable." Such properties are so identified in the property
  239. description. The inheritable properties can be placed on any
  240. formatting object. The inheritable properties are propagated down the
  241. formatting object tree from a parent to each child. (These properties
  242. are given their initial value at the root of the result tree.) For a
  243. given inheritable property, if that property is present on a child,
  244. then that value of the property is used for that child (and its
  245. descendants until explicitly re-set in a lower descendant); otherwise,
  246. the specified value of that property on the child is the computed
  247. value of that property on the parent formatting object. Hence there is
  248. always a specified value defined for every inheritable property for
  249. every formatting object.
  250. </fo:block>
  251. </fo:block>
  252. </fo:flow>
  253. </fo:page-sequence>
  254. </fo:root>
  255. </fo>
  256. <checks>
  257. <!-- page 1 -->
  258. <true xpath="starts-with(//pageViewport[@nr=1]//regionBefore/block[1],'5 ')"/>
  259. <true xpath="starts-with(//pageViewport[@nr=1]//regionBefore/block[2],'5 ')"/>
  260. <true xpath="starts-with(//pageViewport[@nr=1]//regionAfter/block[1],'5 ')"/>
  261. <true xpath="starts-with(//pageViewport[@nr=1]//regionAfter/block[2],'5 ')"/>
  262. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5 ')]"/>
  263. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5.1 ')]"/>
  264. <true xpath="//pageViewport[@nr=1]//regionBody//block[starts-with(.,'5.2 ')]"/>
  265. <!-- page 2 -->
  266. <true xpath="starts-with(//pageViewport[@nr=2]//regionBefore/block[1],'5 ')"/>
  267. <true xpath="starts-with(//pageViewport[@nr=2]//regionBefore/block[2],'6 ')"/>
  268. <true xpath="starts-with(//pageViewport[@nr=2]//regionAfter/block[1],'6.1 ')"/>
  269. <true xpath="starts-with(//pageViewport[@nr=2]//regionAfter/block[2],'5 ')"/>
  270. <true xpath="//pageViewport[@nr=2]//regionBody//block[starts-with(.,'6 ')]"/>
  271. <true xpath="//pageViewport[@nr=2]//regionBody//block[starts-with(.,'6.1 ')]"/>
  272. <!-- page 3 -->
  273. <true xpath="starts-with(//pageViewport[@nr=3]//regionBefore/block[1],'6 ')"/>
  274. <true xpath="starts-with(//pageViewport[@nr=3]//regionBefore/block[2],'6 ')"/>
  275. <true xpath="starts-with(//pageViewport[@nr=3]//regionAfter/block[1],'6 ')"/>
  276. <true xpath="starts-with(//pageViewport[@nr=3]//regionAfter/block[2],'6 ')"/>
  277. <true xpath="not(//pageViewport[@nr=3]//regionBody//block[starts-with(.,'6 ')])"/>
  278. <true xpath="not(//pageViewport[@nr=3]//regionBody//block[starts-with(.,'6.1 ')])"/>
  279. <!-- page 4 -->
  280. <true xpath="starts-with(//pageViewport[@nr=4]//regionBefore/block[1],'6 ')"/>
  281. <true xpath="starts-with(//pageViewport[@nr=4]//regionBefore/block[2],'6 ')"/>
  282. <true xpath="starts-with(//pageViewport[@nr=4]//regionAfter/block[1],'6 ')"/>
  283. <true xpath="starts-with(//pageViewport[@nr=4]//regionAfter/block[2],'6 ')"/>
  284. <true xpath="not(//pageViewport[@nr=4]//regionBody//block[starts-with(.,'6 ')])"/>
  285. <true xpath="not(//pageViewport[@nr=4]//regionBody//block[starts-with(.,'6.1 ')])"/>
  286. <!-- page 5 -->
  287. <true xpath="starts-with(//pageViewport[@nr=5]//regionBefore/block[1],'6 ')"/>
  288. <true xpath="starts-with(//pageViewport[@nr=5]//regionBefore/block[2],'6 ')"/>
  289. <true xpath="starts-with(//pageViewport[@nr=5]//regionAfter/block[1],'6 ')"/>
  290. <true xpath="starts-with(//pageViewport[@nr=5]//regionAfter/block[2],'6 ')"/>
  291. <true xpath="not(//pageViewport[@nr=5]//regionBody//block[starts-with(.,'6 ')])"/>
  292. <true xpath="not(//pageViewport[@nr=5]//regionBody//block[starts-with(.,'6.1 ')])"/>
  293. </checks>
  294. </testcase>