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.

LayoutContext.java 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. /* $Id$ */
  18. package org.apache.fop.layoutmgr;
  19. import java.util.Collections;
  20. import java.util.List;
  21. import org.apache.fop.fo.Constants;
  22. import org.apache.fop.layoutmgr.inline.AlignmentContext;
  23. import org.apache.fop.layoutmgr.inline.HyphContext;
  24. import org.apache.fop.traits.MinOptMax;
  25. /**
  26. * This class is used to pass information to the getNextKnuthElements()
  27. * method. It is set up by higher level LM and used by lower level LM.
  28. */
  29. public class LayoutContext {
  30. /**
  31. * Values for flags.
  32. */
  33. public static final int LINEBREAK_AT_LF_ONLY = 0x01;
  34. /** Generated break possibility is first in a new area */
  35. public static final int NEW_AREA = 0x02;
  36. public static final int IPD_UNKNOWN = 0x04;
  37. /** Signal to a Line LM that a higher level LM may provoke a change
  38. * in the reference area, thus ref area IPD. The LineLM should return
  39. * without looking for a line break.
  40. */
  41. public static final int CHECK_REF_AREA = 0x08;
  42. /**
  43. * If this flag is set, it indicates that any break-before values other than "auto" should
  44. * not cause a mandatory break as this break was already handled by a parent layout manager.
  45. */
  46. public static final int SUPPRESS_BREAK_BEFORE = 0x10;
  47. public static final int FIRST_AREA = 0x20;
  48. public static final int TRY_HYPHENATE = 0x40;
  49. public static final int LAST_AREA = 0x80;
  50. public static final int RESOLVE_LEADING_SPACE = 0x100;
  51. /**
  52. * This flag indicates that there's a keep-with-next that hasn't
  53. * been processed, yet.
  54. */
  55. //public static final int KEEP_WITH_NEXT_PENDING = 0x200;
  56. /**
  57. * This flag indicates that there's a keep-with-previous that hasn't
  58. * been processed, yet.
  59. */
  60. //public static final int KEEP_WITH_PREVIOUS_PENDING = 0x400;
  61. private int flags; // Contains some set of flags defined above
  62. /**
  63. * Total available stacking dimension for a "galley-level" layout
  64. * manager in block-progression-direction. It is passed by the
  65. * parent LM.
  66. * These LM <b>may</b> wish to pass this information down to lower
  67. * level LM to allow them to optimize returned break possibilities.
  68. */
  69. private MinOptMax stackLimitBP;
  70. /**
  71. * Total available stacking dimension for a "galley-level" layout
  72. * manager in inline-progression-direction. It is passed by the
  73. * parent LM. For LineLM, the block LM determines this based on
  74. * indent properties.
  75. * These LM <b>may</b> wish to pass this information down to lower
  76. * level LM to allow them to optimize returned break possibilities.
  77. */
  78. private MinOptMax stackLimitIP;
  79. /** True if current element list is spanning in multi-column layout. */
  80. private int nextSpan = Constants.NOT_SET;
  81. /** inline-progression-dimension of nearest ancestor reference area */
  82. private int refIPD;
  83. //TODO After the split of stackLimit into stackLimitBP and stackLimitIP there's now some
  84. //overlap with refIPD. Need to investigate how best to refactor that.
  85. /** the writing mode established by the nearest ancestor reference area */
  86. private int writingMode = Constants.EN_LR_TB;
  87. /** Current pending space-after or space-end from preceding area */
  88. private SpaceSpecifier trailingSpace;
  89. /** Current pending space-before or space-start from ancestor areas */
  90. private SpaceSpecifier leadingSpace;
  91. /**
  92. * A list of pending marks (border and padding) on the after edge when a page break occurs.
  93. * May be null.
  94. */
  95. private List pendingAfterMarks;
  96. /**
  97. * A list of pending marks (border and padding) on the before edge when a page break occurs.
  98. * May be null.
  99. */
  100. private List pendingBeforeMarks;
  101. /** Current hyphenation context. May be null. */
  102. private HyphContext hyphContext = null;
  103. /** Alignment in BP direction */
  104. private int bpAlignment = Constants.EN_START;
  105. /** Stretch or shrink value when making areas. */
  106. private double ipdAdjust = 0.0;
  107. /** Stretch or shrink value when adding spaces. */
  108. private double dSpaceAdjust = 0.0;
  109. private AlignmentContext alignmentContext = null;
  110. /** Amount of space before / start */
  111. private int spaceBefore = 0;
  112. /** Amount of space after / end */
  113. private int spaceAfter = 0;
  114. /** Amount of space to reserve at the beginning of each line */
  115. private int lineStartBorderAndPaddingWidth = 0;
  116. /** Amount of space to reserve at the end of each line */
  117. private int lineEndBorderAndPaddingWidth = 0;
  118. private int breakBefore;
  119. private int breakAfter;
  120. private int pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
  121. private int pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
  122. /**
  123. * Copy constructor for creating child layout contexts.
  124. * @param parentLC the parent layout context to copy from
  125. */
  126. public LayoutContext(LayoutContext parentLC) {
  127. this.flags = parentLC.flags;
  128. this.refIPD = parentLC.refIPD;
  129. this.writingMode = parentLC.writingMode;
  130. setStackLimitsFrom(parentLC);
  131. this.leadingSpace = parentLC.leadingSpace; //???
  132. this.trailingSpace = parentLC.trailingSpace; //???
  133. this.hyphContext = parentLC.hyphContext;
  134. this.bpAlignment = parentLC.bpAlignment;
  135. this.dSpaceAdjust = parentLC.dSpaceAdjust;
  136. this.ipdAdjust = parentLC.ipdAdjust;
  137. this.alignmentContext = parentLC.alignmentContext;
  138. this.lineStartBorderAndPaddingWidth = parentLC.lineStartBorderAndPaddingWidth;
  139. this.lineEndBorderAndPaddingWidth = parentLC.lineEndBorderAndPaddingWidth;
  140. copyPendingMarksFrom(parentLC);
  141. this.pendingKeepWithNext = parentLC.pendingKeepWithNext;
  142. this.pendingKeepWithPrevious = parentLC.pendingKeepWithPrevious;
  143. // Copy other fields as necessary.
  144. }
  145. /**
  146. * Main constructor.
  147. * @param flags the initial flags
  148. */
  149. public LayoutContext(int flags) {
  150. this.flags = flags;
  151. this.refIPD = 0;
  152. stackLimitBP = new MinOptMax(0);
  153. stackLimitIP = new MinOptMax(0);
  154. leadingSpace = null;
  155. trailingSpace = null;
  156. }
  157. public void copyPendingMarksFrom(LayoutContext source) {
  158. if (source.pendingAfterMarks != null) {
  159. this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
  160. }
  161. if (source.pendingBeforeMarks != null) {
  162. this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
  163. }
  164. }
  165. public void setFlags(int flags) {
  166. setFlags(flags, true);
  167. }
  168. public void setFlags(int flags, boolean bSet) {
  169. if (bSet) {
  170. this.flags |= flags;
  171. } else {
  172. this.flags &= ~flags;
  173. }
  174. }
  175. public void unsetFlags(int flags) {
  176. setFlags(flags, false);
  177. }
  178. public boolean isStart() {
  179. return ((this.flags & NEW_AREA) != 0);
  180. }
  181. public boolean startsNewArea() {
  182. return ((this.flags & NEW_AREA) != 0 && leadingSpace != null);
  183. }
  184. public boolean isFirstArea() {
  185. return ((this.flags & FIRST_AREA) != 0);
  186. }
  187. public boolean isLastArea() {
  188. return ((this.flags & LAST_AREA) != 0);
  189. }
  190. public boolean suppressBreakBefore() {
  191. return ((this.flags & SUPPRESS_BREAK_BEFORE) != 0);
  192. }
  193. /**
  194. * Returns the strength of a keep-with-next currently pending.
  195. * @return the keep-with-next strength
  196. */
  197. public int getKeepWithNextPending() {
  198. return this.pendingKeepWithNext;
  199. }
  200. /**
  201. * Returns the strength of a keep-with-previous currently pending.
  202. * @return the keep-with-previous strength
  203. */
  204. public int getKeepWithPreviousPending() {
  205. return this.pendingKeepWithPrevious;
  206. }
  207. /**
  208. * Clears any pending keep-with-next strength.
  209. */
  210. public void clearKeepWithNextPending() {
  211. this.pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
  212. }
  213. /**
  214. * Clears any pending keep-with-previous strength.
  215. */
  216. public void clearKeepWithPreviousPending() {
  217. this.pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
  218. }
  219. /**
  220. * Clears both keep-with-previous and keep-with-next strengths.
  221. */
  222. public void clearKeepsPending() {
  223. clearKeepWithPreviousPending();
  224. clearKeepWithNextPending();
  225. }
  226. /**
  227. * Updates the currently pending keep-with-next strength.
  228. * @param strength the new strength to consider
  229. */
  230. public void updateKeepWithNextPending(int strength) {
  231. this.pendingKeepWithNext = Math.max(this.pendingKeepWithNext, strength);
  232. }
  233. /**
  234. * Updates the currently pending keep-with-previous strength.
  235. * @param strength the new strength to consider
  236. */
  237. public void updateKeepWithPreviousPending(int strength) {
  238. this.pendingKeepWithPrevious = Math.max(this.pendingKeepWithPrevious, strength);
  239. }
  240. /**
  241. * Indicates whether a keep-with-next constraint is pending.
  242. * @return true if a keep-with-next constraint is pending
  243. */
  244. public boolean isKeepWithNextPending() {
  245. return getKeepWithNextPending() != BlockLevelLayoutManager.KEEP_AUTO;
  246. }
  247. /**
  248. * Indicates whether a keep-with-previous constraint is pending.
  249. * @return true if a keep-with-previous constraint is pending
  250. */
  251. public boolean isKeepWithPreviousPending() {
  252. return getKeepWithPreviousPending() != BlockLevelLayoutManager.KEEP_AUTO;
  253. }
  254. public void setLeadingSpace(SpaceSpecifier space) {
  255. leadingSpace = space;
  256. }
  257. public SpaceSpecifier getLeadingSpace() {
  258. return leadingSpace;
  259. }
  260. public boolean resolveLeadingSpace() {
  261. return ((this.flags & RESOLVE_LEADING_SPACE) != 0);
  262. }
  263. public void setTrailingSpace(SpaceSpecifier space) {
  264. trailingSpace = space;
  265. }
  266. public SpaceSpecifier getTrailingSpace() {
  267. return trailingSpace;
  268. }
  269. /**
  270. * Adds a border or padding element to the pending list which will be used to generate
  271. * the right element list for break possibilities. Conditionality resolution will be done
  272. * elsewhere.
  273. * @param element the border, padding or space element
  274. */
  275. public void addPendingAfterMark(UnresolvedListElementWithLength element) {
  276. if (this.pendingAfterMarks == null) {
  277. this.pendingAfterMarks = new java.util.ArrayList();
  278. }
  279. this.pendingAfterMarks.add(element);
  280. }
  281. /**
  282. * @return the pending border and padding elements at the after edge
  283. * @see #addPendingAfterMark(UnresolvedListElementWithLength)
  284. */
  285. public List getPendingAfterMarks() {
  286. if (this.pendingAfterMarks != null) {
  287. return Collections.unmodifiableList(this.pendingAfterMarks);
  288. } else {
  289. return null;
  290. }
  291. }
  292. /**
  293. * Clears all pending marks on the LayoutContext.
  294. */
  295. public void clearPendingMarks() {
  296. this.pendingBeforeMarks = null;
  297. this.pendingAfterMarks = null;
  298. }
  299. /**
  300. * Adds a border or padding element to the pending list which will be used to generate
  301. * the right element list for break possibilities. Conditionality resolution will be done
  302. * elsewhere.
  303. * @param element the border, padding or space element
  304. */
  305. public void addPendingBeforeMark(UnresolvedListElementWithLength element) {
  306. if (this.pendingBeforeMarks == null) {
  307. this.pendingBeforeMarks = new java.util.ArrayList();
  308. }
  309. this.pendingBeforeMarks.add(element);
  310. }
  311. /**
  312. * @return the pending border and padding elements at the before edge
  313. * @see #addPendingBeforeMark(UnresolvedListElementWithLength)
  314. */
  315. public List getPendingBeforeMarks() {
  316. if (this.pendingBeforeMarks != null) {
  317. return Collections.unmodifiableList(this.pendingBeforeMarks);
  318. } else {
  319. return null;
  320. }
  321. }
  322. /**
  323. * Sets the stack limit in block-progression-dimension.
  324. * @param limit the stack limit
  325. */
  326. public void setStackLimitBP(MinOptMax limit) {
  327. stackLimitBP = limit;
  328. }
  329. /**
  330. * Returns the stack limit in block-progression-dimension.
  331. * @return the stack limit
  332. */
  333. public MinOptMax getStackLimitBP() {
  334. return stackLimitBP;
  335. }
  336. /**
  337. * Sets the stack limit in inline-progression-dimension.
  338. * @param limit the stack limit
  339. */
  340. public void setStackLimitIP(MinOptMax limit) {
  341. stackLimitIP = limit;
  342. }
  343. /**
  344. * Returns the stack limit in inline-progression-dimension.
  345. * @return the stack limit
  346. */
  347. public MinOptMax getStackLimitIP() {
  348. return stackLimitIP;
  349. }
  350. /**
  351. * Sets (Copies) the stack limits in both directions from another layout context.
  352. * @param context the layout context to taje the values from
  353. */
  354. public void setStackLimitsFrom(LayoutContext context) {
  355. setStackLimitBP(context.getStackLimitBP());
  356. setStackLimitIP(context.getStackLimitIP());
  357. }
  358. /**
  359. * Sets the inline-progression-dimension of the nearest ancestor reference area.
  360. */
  361. public void setRefIPD(int ipd) {
  362. refIPD = ipd;
  363. }
  364. /**
  365. * Returns the inline-progression-dimension of the nearest ancestor reference area.
  366. *
  367. * @return the inline-progression-dimension of the nearest ancestor reference area
  368. */
  369. public int getRefIPD() {
  370. return refIPD;
  371. }
  372. public void setHyphContext(HyphContext hyph) {
  373. hyphContext = hyph;
  374. }
  375. public HyphContext getHyphContext() {
  376. return hyphContext;
  377. }
  378. public boolean tryHyphenate() {
  379. return ((this.flags & TRY_HYPHENATE) != 0);
  380. }
  381. /**
  382. * Sets the currently applicable alignment in BP direction.
  383. * @param alignment one of EN_START, EN_JUSTIFY etc.
  384. */
  385. public void setBPAlignment(int alignment) {
  386. this.bpAlignment = alignment;
  387. }
  388. /** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...) */
  389. public int getBPAlignment() {
  390. return this.bpAlignment;
  391. }
  392. public void setSpaceAdjust(double adjust) {
  393. dSpaceAdjust = adjust;
  394. }
  395. public double getSpaceAdjust() {
  396. return dSpaceAdjust;
  397. }
  398. public void setIPDAdjust(double ipdA) {
  399. ipdAdjust = ipdA;
  400. }
  401. public double getIPDAdjust() {
  402. return ipdAdjust;
  403. }
  404. public void setAlignmentContext(AlignmentContext alignmentContext) {
  405. this.alignmentContext = alignmentContext;
  406. }
  407. public AlignmentContext getAlignmentContext() {
  408. return this.alignmentContext;
  409. }
  410. public void resetAlignmentContext() {
  411. if (this.alignmentContext != null) {
  412. this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
  413. }
  414. }
  415. /**
  416. * Get the width to be reserved for border and padding at the start of the line.
  417. * @return the width to be reserved
  418. */
  419. public int getLineStartBorderAndPaddingWidth() {
  420. return lineStartBorderAndPaddingWidth;
  421. }
  422. /**
  423. * Set the width to be reserved for border and padding at the start of the line.
  424. * @param lineStartBorderAndPaddingWidth the width to be reserved
  425. */
  426. public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
  427. this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
  428. }
  429. /**
  430. * Get the width to be reserved for border and padding at the end of the line.
  431. * @return the width to be reserved
  432. */
  433. public int getLineEndBorderAndPaddingWidth() {
  434. return lineEndBorderAndPaddingWidth;
  435. }
  436. /**
  437. * Set the width to be reserved for border and padding at the end of the line.
  438. * @param lineEndBorderAndPaddingWidth the width to be reserved
  439. */
  440. public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
  441. this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
  442. }
  443. /**
  444. * @return true if the current element list ends early because of a span change
  445. * in multi-column layout.
  446. */
  447. public int getNextSpan() {
  448. return nextSpan;
  449. }
  450. /**
  451. * Used to signal the PSLM that the element list ends early because of a span change in
  452. * multi-column layout.
  453. * @param span the new span value (legal values: NOT_SET, EN_NONE, EN_ALL)
  454. */
  455. public void signalSpanChange(int span) {
  456. if (span == Constants.NOT_SET || span == Constants.EN_NONE || span == Constants.EN_ALL) {
  457. this.nextSpan = span;
  458. } else {
  459. throw new IllegalArgumentException("Illegal value on signalSpanChange() for span: "
  460. + span);
  461. }
  462. }
  463. /**
  464. * Get the writing mode of the relevant reference area.
  465. * @return the applicable writing mode
  466. */
  467. public int getWritingMode() {
  468. return writingMode;
  469. }
  470. /**
  471. * Set the writing mode.
  472. * @param writingMode the writing mode
  473. */
  474. public void setWritingMode(int writingMode) {
  475. this.writingMode = writingMode;
  476. }
  477. /**
  478. * Get the current amount of space before / start
  479. * @return the space before / start amount
  480. */
  481. public int getSpaceBefore() {
  482. return spaceBefore;
  483. }
  484. /**
  485. * Set the amount of space before / start
  486. * @param spaceBefore the amount of space before / start
  487. */
  488. public void setSpaceBefore(int spaceBefore) {
  489. this.spaceBefore = spaceBefore;
  490. }
  491. /**
  492. * Get the current amount of space after / end
  493. * @return the space after / end amount
  494. */
  495. public int getSpaceAfter() {
  496. return spaceAfter;
  497. }
  498. /**
  499. * Set the amount of space after / end
  500. * @param spaceAfter the amount of space after / end
  501. */
  502. public void setSpaceAfter(int spaceAfter) {
  503. this.spaceAfter = spaceAfter;
  504. }
  505. /**
  506. * Returns the value of the break before the element whose
  507. * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
  508. * called.
  509. *
  510. * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
  511. * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
  512. * {@link Constants#EN_ODD_PAGE}
  513. */
  514. public int getBreakBefore() {
  515. return breakBefore;
  516. }
  517. /**
  518. * Sets the value of the break before the current element.
  519. *
  520. * @param breakBefore the value of the break-before
  521. * @see #getBreakBefore()
  522. */
  523. public void setBreakBefore(int breakBefore) {
  524. this.breakBefore = breakBefore;
  525. }
  526. /**
  527. * Returns the value of the break after the element whose
  528. * {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
  529. * called.
  530. *
  531. * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
  532. * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
  533. * {@link Constants#EN_ODD_PAGE}
  534. */
  535. public int getBreakAfter() {
  536. return breakAfter;
  537. }
  538. /**
  539. * Sets the value of the break after the current element.
  540. *
  541. * @param breakAfter the value of the break-after
  542. * @see #getBreakAfter()
  543. */
  544. public void setBreakAfter(int breakAfter) {
  545. this.breakAfter = breakAfter;
  546. }
  547. /** {@inheritDoc} */
  548. public String toString() {
  549. return "Layout Context:"
  550. + "\nStack Limit BPD: \t"
  551. + (getStackLimitBP() == null ? "null" : getStackLimitBP().toString())
  552. + "\nStack Limit IPD: \t"
  553. + (getStackLimitIP() == null ? "null" : getStackLimitIP().toString())
  554. + "\nTrailing Space: \t"
  555. + (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
  556. + "\nLeading Space: \t"
  557. + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
  558. + "\nReference IPD: \t" + getRefIPD()
  559. + "\nSpace Adjust: \t" + getSpaceAdjust()
  560. + "\nIPD Adjust: \t" + getIPDAdjust()
  561. + "\nResolve Leading Space: \t" + resolveLeadingSpace()
  562. + "\nSuppress Break Before: \t" + suppressBreakBefore()
  563. + "\nIs First Area: \t" + isFirstArea()
  564. + "\nStarts New Area: \t" + startsNewArea()
  565. + "\nIs Last Area: \t" + isLastArea()
  566. + "\nTry Hyphenate: \t" + tryHyphenate()
  567. + "\nKeeps: \t[keep-with-next=" + KeepUtil.keepStrengthToString(getKeepWithNextPending())
  568. + "][keep-with-previous="
  569. + KeepUtil.keepStrengthToString(getKeepWithPreviousPending()) + "] pending"
  570. + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
  571. + (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
  572. }
  573. }