Skip to content

Commit a9b9306

Browse files
BlackEgoistiText-CI
authored andcommitted
Add properties and default values for orphans and widows css support
DEVSIX-3664
1 parent 4510043 commit a9b9306

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

styled-xml-parser/src/main/java/com/itextpdf/styledxmlparser/css/CommonCssConstants.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,11 @@ public class CommonCssConstants {
463463
*/
464464
public static final String OPACITY = "opacity";
465465

466+
/**
467+
* The Constant OPRPHANS.
468+
*/
469+
public static final String ORPHANS = "orphans";
470+
466471
/**
467472
* The Constant OUTLINE.
468473
*/
@@ -618,6 +623,11 @@ public class CommonCssConstants {
618623
*/
619624
public static final String WHITE_SPACE = "white-space";
620625

626+
/**
627+
* The Constant WIDOWS.
628+
*/
629+
public static final String WIDOWS = "widows";
630+
621631
/**
622632
* The Constant WIDTH.
623633
*/

styled-xml-parser/src/main/java/com/itextpdf/styledxmlparser/css/resolve/CssDefaults.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ public class CssDefaults {
142142
defaultValues.put(CommonCssConstants.WHITE_SPACE, CommonCssConstants.NORMAL);
143143
defaultValues.put(CommonCssConstants.WIDTH, CommonCssConstants.AUTO);
144144

145+
defaultValues.put(CommonCssConstants.ORPHANS, "2");
146+
defaultValues.put(CommonCssConstants.WIDOWS, "2");
147+
145148
// TODO not complete
146149
}
147150

styled-xml-parser/src/main/java/com/itextpdf/styledxmlparser/css/resolve/CssInheritance.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,10 @@ public class CssInheritance implements IStyleInheritance {
126126
CommonCssConstants.LIST_STYLE_TYPE,
127127

128128
// Generated Content for Paged Media
129-
CommonCssConstants.QUOTES
129+
CommonCssConstants.QUOTES,
130+
131+
CommonCssConstants.ORPHANS,
132+
CommonCssConstants.WIDOWS
130133
));
131134

132135
/**

0 commit comments

Comments
 (0)