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.

FOPropertyMapping.java 109KB

Merged revisions 604300-607033 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r604475 | vhennebert | 2007-12-15 19:16:01 +0100 (Sa, 15 Dez 2007) | 2 lines Testcase for the resolution of collapsed and conditional borders in the FO tree ........ r604678 | adelmelle | 2007-12-16 20:54:00 +0100 (So, 16 Dez 2007) | 8 lines Streamlining/Correction of the changes made in r603926 - delegate validation of the fo:wrapper's children to the parent: added static FONode.validateChildNode() - narrow the condition for processing text-childnodes: this is not only constrained to fo:flow and fo:static-content, but the same goes for a fo:wrapper that is a direct descendant of a fo:block-container or fo:inline-container, which only allow block-level content (interpretation) - minor javadoc fixups/improvements ........ r604814 | vhennebert | 2007-12-17 11:21:04 +0100 (Mo, 17 Dez 2007) | 2 lines Organized imports ........ r604965 | vhennebert | 2007-12-17 19:56:46 +0100 (Mo, 17 Dez 2007) | 2 lines Renaming GridUnitPart into the more accurate CellPart. Moreover I was always making the confusion between gup and pgu ........ r604970 | vhennebert | 2007-12-17 20:05:27 +0100 (Mo, 17 Dez 2007) | 2 lines Simplified addAreasAndFlushRow: there can no longer be null GridUnits, every hole in the grid is now filled with an EmptyGridUnit ........ r605195 | vhennebert | 2007-12-18 12:56:38 +0100 (Di, 18 Dez 2007) | 2 lines Reset previousRowsLength before a new row-group is handled ........ r605246 | vhennebert | 2007-12-18 17:48:03 +0100 (Di, 18 Dez 2007) | 2 lines Simplification in RowPainter: avoid the use of an array to store rowOffsets and firstRow index for each part of the table (header, footer, body). One at a time is enough. ........ r605253 | vhennebert | 2007-12-18 18:01:45 +0100 (Di, 18 Dez 2007) | 2 lines Renamed firstRow into firstRowIndex and moved its initialization into handeTableContentPosition ........ r605295 | vhennebert | 2007-12-18 19:58:29 +0100 (Di, 18 Dez 2007) | 2 lines Streamlined the recording of row offsets, by replacing Map with a List. Fixed bug #43633 in the same time. ........ r605297 | vhennebert | 2007-12-18 20:02:02 +0100 (Di, 18 Dez 2007) | 3 lines SVG support for AFP is an important addition IMO. IIUC it will have to be advertised in the next release as "Support for SVG images using primitive AFP graphics commands instead of bitmap images", or something like that? ........ r605517 | vhennebert | 2007-12-19 12:47:38 +0100 (Mi, 19 Dez 2007) | 2 lines I said currentGU can no longer be null ........ r605978 | jeremias | 2007-12-20 18:00:46 +0100 (Do, 20 Dez 2007) | 1 line Remove commented code. ........ r606004 | jeremias | 2007-12-20 20:19:19 +0100 (Do, 20 Dez 2007) | 1 line Added support for scale-down-to-fit and scale-up-to-fit. ........ r607032 | jeremias | 2007-12-27 11:34:15 +0100 (Do, 27 Dez 2007) | 4 lines Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package. Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started) Some javadoc cleanups. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@607034 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
PropertyCache phase 2: * improvement of the PropertyCache itself should guarantee acceptable performance of the static caches in multi-session environments, which is a possible problem with synchronizedMap * changed CommonFont to use the cache: added CachedCommonFont to contain the properties that are always cacheable CommonFont itself is only cached if the remaining properties are absolutes * changed CommonHyphenation, KeepProperty, ColorProperty and FontFamilyProperty to use the cache Facilitate the implementation for font-selection-strategy: * Changed FontInfo.fontLookup to always return an array of FontTriplet * Changed CommonFont.getFontState to return an array of FontTriplet * Initial modifications to the related LMs: initialized with the font corresponding to the first of the triplets This line, and those below, will be ignored-- M src/java/org/apache/fop/render/rtf/TextAttributesConverter.java M src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java M src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java M src/java/org/apache/fop/fonts/FontInfo.java M src/java/org/apache/fop/fo/properties/CommonHyphenation.java M src/java/org/apache/fop/fo/properties/CommonAccessibility.java M src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java M src/java/org/apache/fop/fo/properties/FontFamilyProperty.java M src/java/org/apache/fop/fo/properties/FixedLength.java M src/java/org/apache/fop/fo/properties/PropertyCache.java M src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java M src/java/org/apache/fop/fo/properties/CommonFont.java M src/java/org/apache/fop/fo/properties/ColorProperty.java M src/java/org/apache/fop/fo/properties/KeepProperty.java M src/java/org/apache/fop/fo/PropertyList.java M src/java/org/apache/fop/fo/FOPropertyMapping.java M src/java/org/apache/fop/fo/expr/PropertyParser.java M src/java/org/apache/fop/fo/expr/ICCColorFunction.java M src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java M src/java/org/apache/fop/fo/expr/RGBColorFunction.java M src/java/org/apache/fop/fo/expr/SystemColorFunction.java M status.xml git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@578311 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 603643-604293 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r603890 | vhennebert | 2007-12-13 12:35:17 +0100 (Do, 13 Dez 2007) | 2 lines Fixed @throws statements in javadoc ........ r603926 | adelmelle | 2007-12-13 15:43:08 +0100 (Do, 13 Dez 2007) | 4 lines Minor tweaks: * only add text to a fo:wrapper if it is not a direct flow-descendant * error if an fo:wrapper that is a direct flow-descendant contains inline-level children ........ r603943 | vhennebert | 2007-12-13 16:55:29 +0100 (Do, 13 Dez 2007) | 2 lines Removed calls to removeLegalBreaks since they aren't necessary (the whole content is put in a single box anyway) and the method is buggy. ........ r603945 | vhennebert | 2007-12-13 17:10:32 +0100 (Do, 13 Dez 2007) | 2 lines Implemented the resolution of collapsing borders in the FO tree, for every situation (normal, cell at the top of a page, cell broken), taking conditionality, headers and footers into account. ........ r603959 | vhennebert | 2007-12-13 18:21:24 +0100 (Do, 13 Dez 2007) | 2 lines Reverted change accidentally introduced in the previous commit. A proper fix needs to be found for this one. ........ r603961 | vhennebert | 2007-12-13 18:31:26 +0100 (Do, 13 Dez 2007) | 2 lines Ok, now /really/ revert the previous commit :-\ ........ r603962 | vhennebert | 2007-12-13 18:32:43 +0100 (Do, 13 Dez 2007) | 2 lines Style only: removed trailing white spaces ........ r603968 | vhennebert | 2007-12-13 19:28:56 +0100 (Do, 13 Dez 2007) | 2 lines Fixed the handling of columns in the border resolution, especially in case of column-spanning cells ........ r603975 | vhennebert | 2007-12-13 19:52:48 +0100 (Do, 13 Dez 2007) | 2 lines Removed parameter from the endPart method, since the part is already passed as a parameter of the previously called startPart method ........ r603979 | vhennebert | 2007-12-13 19:57:25 +0100 (Do, 13 Dez 2007) | 2 lines Removed parameter from the endTablePart method, as the part is already passed as as a parameter of the previously called startTablePart method ........ r603990 | vhennebert | 2007-12-13 20:17:12 +0100 (Do, 13 Dez 2007) | 2 lines Throw a ValidationException if table-footer is put after table-body and the table uses the collapsing border model. The footer must be known to properly resolve borders. ........ r604171 | vhennebert | 2007-12-14 12:32:51 +0100 (Fr, 14 Dez 2007) | 2 lines Clean up: removed all reset and resetPosition methods, which pre-date the Knuth era and are no longer needed ........ r604180 | vhennebert | 2007-12-14 13:23:10 +0100 (Fr, 14 Dez 2007) | 2 lines Reduced visibility of methods from public to package-private ........ r604185 | acumiskey | 2007-12-14 14:16:06 +0100 (Fr, 14 Dez 2007) | 2 lines Fixed copy constructor ........ r604293 | jeremias | 2007-12-14 21:58:53 +0100 (Fr, 14 Dez 2007) | 2 lines Bugfix: DecodeParms -> DecodeParams (introduced when I changed to generic PDF structures) (fixes CCITT encoded images) ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@604297 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 604300-607033 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r604475 | vhennebert | 2007-12-15 19:16:01 +0100 (Sa, 15 Dez 2007) | 2 lines Testcase for the resolution of collapsed and conditional borders in the FO tree ........ r604678 | adelmelle | 2007-12-16 20:54:00 +0100 (So, 16 Dez 2007) | 8 lines Streamlining/Correction of the changes made in r603926 - delegate validation of the fo:wrapper's children to the parent: added static FONode.validateChildNode() - narrow the condition for processing text-childnodes: this is not only constrained to fo:flow and fo:static-content, but the same goes for a fo:wrapper that is a direct descendant of a fo:block-container or fo:inline-container, which only allow block-level content (interpretation) - minor javadoc fixups/improvements ........ r604814 | vhennebert | 2007-12-17 11:21:04 +0100 (Mo, 17 Dez 2007) | 2 lines Organized imports ........ r604965 | vhennebert | 2007-12-17 19:56:46 +0100 (Mo, 17 Dez 2007) | 2 lines Renaming GridUnitPart into the more accurate CellPart. Moreover I was always making the confusion between gup and pgu ........ r604970 | vhennebert | 2007-12-17 20:05:27 +0100 (Mo, 17 Dez 2007) | 2 lines Simplified addAreasAndFlushRow: there can no longer be null GridUnits, every hole in the grid is now filled with an EmptyGridUnit ........ r605195 | vhennebert | 2007-12-18 12:56:38 +0100 (Di, 18 Dez 2007) | 2 lines Reset previousRowsLength before a new row-group is handled ........ r605246 | vhennebert | 2007-12-18 17:48:03 +0100 (Di, 18 Dez 2007) | 2 lines Simplification in RowPainter: avoid the use of an array to store rowOffsets and firstRow index for each part of the table (header, footer, body). One at a time is enough. ........ r605253 | vhennebert | 2007-12-18 18:01:45 +0100 (Di, 18 Dez 2007) | 2 lines Renamed firstRow into firstRowIndex and moved its initialization into handeTableContentPosition ........ r605295 | vhennebert | 2007-12-18 19:58:29 +0100 (Di, 18 Dez 2007) | 2 lines Streamlined the recording of row offsets, by replacing Map with a List. Fixed bug #43633 in the same time. ........ r605297 | vhennebert | 2007-12-18 20:02:02 +0100 (Di, 18 Dez 2007) | 3 lines SVG support for AFP is an important addition IMO. IIUC it will have to be advertised in the next release as "Support for SVG images using primitive AFP graphics commands instead of bitmap images", or something like that? ........ r605517 | vhennebert | 2007-12-19 12:47:38 +0100 (Mi, 19 Dez 2007) | 2 lines I said currentGU can no longer be null ........ r605978 | jeremias | 2007-12-20 18:00:46 +0100 (Do, 20 Dez 2007) | 1 line Remove commented code. ........ r606004 | jeremias | 2007-12-20 20:19:19 +0100 (Do, 20 Dez 2007) | 1 line Added support for scale-down-to-fit and scale-up-to-fit. ........ r607032 | jeremias | 2007-12-27 11:34:15 +0100 (Do, 27 Dez 2007) | 4 lines Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package. Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started) Some javadoc cleanups. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@607034 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 604300-607033 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r604475 | vhennebert | 2007-12-15 19:16:01 +0100 (Sa, 15 Dez 2007) | 2 lines Testcase for the resolution of collapsed and conditional borders in the FO tree ........ r604678 | adelmelle | 2007-12-16 20:54:00 +0100 (So, 16 Dez 2007) | 8 lines Streamlining/Correction of the changes made in r603926 - delegate validation of the fo:wrapper's children to the parent: added static FONode.validateChildNode() - narrow the condition for processing text-childnodes: this is not only constrained to fo:flow and fo:static-content, but the same goes for a fo:wrapper that is a direct descendant of a fo:block-container or fo:inline-container, which only allow block-level content (interpretation) - minor javadoc fixups/improvements ........ r604814 | vhennebert | 2007-12-17 11:21:04 +0100 (Mo, 17 Dez 2007) | 2 lines Organized imports ........ r604965 | vhennebert | 2007-12-17 19:56:46 +0100 (Mo, 17 Dez 2007) | 2 lines Renaming GridUnitPart into the more accurate CellPart. Moreover I was always making the confusion between gup and pgu ........ r604970 | vhennebert | 2007-12-17 20:05:27 +0100 (Mo, 17 Dez 2007) | 2 lines Simplified addAreasAndFlushRow: there can no longer be null GridUnits, every hole in the grid is now filled with an EmptyGridUnit ........ r605195 | vhennebert | 2007-12-18 12:56:38 +0100 (Di, 18 Dez 2007) | 2 lines Reset previousRowsLength before a new row-group is handled ........ r605246 | vhennebert | 2007-12-18 17:48:03 +0100 (Di, 18 Dez 2007) | 2 lines Simplification in RowPainter: avoid the use of an array to store rowOffsets and firstRow index for each part of the table (header, footer, body). One at a time is enough. ........ r605253 | vhennebert | 2007-12-18 18:01:45 +0100 (Di, 18 Dez 2007) | 2 lines Renamed firstRow into firstRowIndex and moved its initialization into handeTableContentPosition ........ r605295 | vhennebert | 2007-12-18 19:58:29 +0100 (Di, 18 Dez 2007) | 2 lines Streamlined the recording of row offsets, by replacing Map with a List. Fixed bug #43633 in the same time. ........ r605297 | vhennebert | 2007-12-18 20:02:02 +0100 (Di, 18 Dez 2007) | 3 lines SVG support for AFP is an important addition IMO. IIUC it will have to be advertised in the next release as "Support for SVG images using primitive AFP graphics commands instead of bitmap images", or something like that? ........ r605517 | vhennebert | 2007-12-19 12:47:38 +0100 (Mi, 19 Dez 2007) | 2 lines I said currentGU can no longer be null ........ r605978 | jeremias | 2007-12-20 18:00:46 +0100 (Do, 20 Dez 2007) | 1 line Remove commented code. ........ r606004 | jeremias | 2007-12-20 20:19:19 +0100 (Do, 20 Dez 2007) | 1 line Added support for scale-down-to-fit and scale-up-to-fit. ........ r607032 | jeremias | 2007-12-27 11:34:15 +0100 (Do, 27 Dez 2007) | 4 lines Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package. Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started) Some javadoc cleanups. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@607034 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 607034-611115 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r607036 | jeremias | 2007-12-27 11:51:11 +0100 (Do, 27 Dez 2007) | 1 line Don't just exit with no error message if the document contains no content. Pretty irritating if it does so. ........ r608812 | acumiskey | 2008-01-04 13:14:33 +0100 (Fr, 04 Jan 2008) | 3 lines The fonts variable would have always had an empty Configuration node (non-null value) even if a <fonts/> wasn't present in the fop configuration. ........ r609567 | jeremias | 2008-01-07 11:52:09 +0100 (Mo, 07 Jan 2008) | 4 lines Reenabled documentation for fox:destination. Enabled intermediate format functionality for fox:destination. Added a test case to check fox:destination. Deprecated FOP's XMLizable in favor of the XML Graphics Commons variant (and extend that variant). ........ r609627 | jeremias | 2008-01-07 16:06:24 +0100 (Mo, 07 Jan 2008) | 5 lines Bugzilla #44176: Support for custom fonts in Java2DRenderer and derived renderers. Submitted by: Patrick Jaromin <patrick.at.jgsullivan.dot.com> Patch modified slightly by jeremias. ........ r610020 | acumiskey | 2008-01-08 16:27:02 +0100 (Di, 08 Jan 2008) | 2 lines cleaned up ........ r610021 | acumiskey | 2008-01-08 16:28:56 +0100 (Di, 08 Jan 2008) | 2 lines Appears to be unused/referenced and superceeded by PageGroup ........ r610022 | acumiskey | 2008-01-08 16:34:07 +0100 (Di, 08 Jan 2008) | 2 lines cleaned up ........ r610023 | acumiskey | 2008-01-08 16:35:18 +0100 (Di, 08 Jan 2008) | 2 lines fixed javadoc ........ r610337 | vhennebert | 2008-01-09 12:02:08 +0100 (Mi, 09 Jan 2008) | 2 lines Fixed checkstyle issues: tabs and trailing spaces ........ r610355 | vhennebert | 2008-01-09 13:01:21 +0100 (Mi, 09 Jan 2008) | 2 lines keep-together is an inherited property ........ r610420 | acumiskey | 2008-01-09 16:40:25 +0100 (Mi, 09 Jan 2008) | 2 lines cleanup ........ r610704 | jeremias | 2008-01-10 08:38:47 +0100 (Do, 10 Jan 2008) | 1 line Added basic support for PDF page labels. ........ r610739 | jeremias | 2008-01-10 11:13:21 +0100 (Do, 10 Jan 2008) | 1 line PostScript output now generates the bounding box DSC comments for the whole document. ........ r610821 | vhennebert | 2008-01-10 16:53:20 +0100 (Do, 10 Jan 2008) | 4 lines - renamed variables for clarity - moved the computation of a cell's content length in PrimaryGridUnit - better javadoc for getHeight method in EffRow ........ r610848 | vhennebert | 2008-01-10 18:41:52 +0100 (Do, 10 Jan 2008) | 2 lines No need to check if the end of the cell is reached when creating the areas for a row ........ r610853 | vhennebert | 2008-01-10 18:54:16 +0100 (Do, 10 Jan 2008) | 2 lines Simplified addAreasAndFlushRow ........ r610886 | vhennebert | 2008-01-10 20:23:56 +0100 (Do, 10 Jan 2008) | 2 lines Removed endPart() method and moved its content into addAreasAndFlushRow() ........ r610891 | vhennebert | 2008-01-10 20:34:13 +0100 (Do, 10 Jan 2008) | 2 lines Removed accumulatedBPD which is redundant with yoffset ........ r610893 | vhennebert | 2008-01-10 20:35:24 +0100 (Do, 10 Jan 2008) | 2 lines The return value of addAreasAndFlushRow is never used, changed it to void ........ r610905 | vhennebert | 2008-01-10 20:57:29 +0100 (Do, 10 Jan 2008) | 2 lines Renamed lastRow into currentRow and yoffset into currentRowOffset ........ r611114 | jeremias | 2008-01-11 10:04:28 +0100 (Fr, 11 Jan 2008) | 2 lines Bugfix: Some string objects were not encrypted (for example in named destinations) I had to refactor the PDF library a little bit but since it only affects the inner API it shouldn't be a problem that I removed some methods which caused trouble because a didn't think about encryption when I worked on the PDF library last year. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@611120 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
Merged revisions 604300-607033 via svnmerge from https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r604475 | vhennebert | 2007-12-15 19:16:01 +0100 (Sa, 15 Dez 2007) | 2 lines Testcase for the resolution of collapsed and conditional borders in the FO tree ........ r604678 | adelmelle | 2007-12-16 20:54:00 +0100 (So, 16 Dez 2007) | 8 lines Streamlining/Correction of the changes made in r603926 - delegate validation of the fo:wrapper's children to the parent: added static FONode.validateChildNode() - narrow the condition for processing text-childnodes: this is not only constrained to fo:flow and fo:static-content, but the same goes for a fo:wrapper that is a direct descendant of a fo:block-container or fo:inline-container, which only allow block-level content (interpretation) - minor javadoc fixups/improvements ........ r604814 | vhennebert | 2007-12-17 11:21:04 +0100 (Mo, 17 Dez 2007) | 2 lines Organized imports ........ r604965 | vhennebert | 2007-12-17 19:56:46 +0100 (Mo, 17 Dez 2007) | 2 lines Renaming GridUnitPart into the more accurate CellPart. Moreover I was always making the confusion between gup and pgu ........ r604970 | vhennebert | 2007-12-17 20:05:27 +0100 (Mo, 17 Dez 2007) | 2 lines Simplified addAreasAndFlushRow: there can no longer be null GridUnits, every hole in the grid is now filled with an EmptyGridUnit ........ r605195 | vhennebert | 2007-12-18 12:56:38 +0100 (Di, 18 Dez 2007) | 2 lines Reset previousRowsLength before a new row-group is handled ........ r605246 | vhennebert | 2007-12-18 17:48:03 +0100 (Di, 18 Dez 2007) | 2 lines Simplification in RowPainter: avoid the use of an array to store rowOffsets and firstRow index for each part of the table (header, footer, body). One at a time is enough. ........ r605253 | vhennebert | 2007-12-18 18:01:45 +0100 (Di, 18 Dez 2007) | 2 lines Renamed firstRow into firstRowIndex and moved its initialization into handeTableContentPosition ........ r605295 | vhennebert | 2007-12-18 19:58:29 +0100 (Di, 18 Dez 2007) | 2 lines Streamlined the recording of row offsets, by replacing Map with a List. Fixed bug #43633 in the same time. ........ r605297 | vhennebert | 2007-12-18 20:02:02 +0100 (Di, 18 Dez 2007) | 3 lines SVG support for AFP is an important addition IMO. IIUC it will have to be advertised in the next release as "Support for SVG images using primitive AFP graphics commands instead of bitmap images", or something like that? ........ r605517 | vhennebert | 2007-12-19 12:47:38 +0100 (Mi, 19 Dez 2007) | 2 lines I said currentGU can no longer be null ........ r605978 | jeremias | 2007-12-20 18:00:46 +0100 (Do, 20 Dez 2007) | 1 line Remove commented code. ........ r606004 | jeremias | 2007-12-20 20:19:19 +0100 (Do, 20 Dez 2007) | 1 line Added support for scale-down-to-fit and scale-up-to-fit. ........ r607032 | jeremias | 2007-12-27 11:34:15 +0100 (Do, 27 Dez 2007) | 4 lines Added new extension element: fox:external-document. It allows to add whole documents such as multi-page TIFF images to be inserted as peers to a page-sequence. Each image will make up an entire page. See the documentation for details. ATM, only single pages are possible. Multi-page images will be supported with the new image package. Some preparations for page-position="only" but the implementation is incomplete and "only" has no effect, yet. (Just uploaded some stuff I once started) Some javadoc cleanups. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign@607034 13f79535-47bb-0310-9956-ffa450edef68
16 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732
  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.fo;
  19. import java.util.HashMap;
  20. import java.util.Map;
  21. import org.apache.fop.apps.FOUserAgent;
  22. import org.apache.fop.datatypes.LengthBase;
  23. import org.apache.fop.fo.expr.PropertyException;
  24. import org.apache.fop.fo.flow.table.TableFObj.ColumnNumberPropertyMaker;
  25. import org.apache.fop.fo.properties.BackgroundPositionShorthandParser;
  26. import org.apache.fop.fo.properties.BorderSpacingShorthandParser;
  27. import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
  28. import org.apache.fop.fo.properties.BoxPropShorthandParser;
  29. import org.apache.fop.fo.properties.CharacterProperty;
  30. import org.apache.fop.fo.properties.ColorProperty;
  31. import org.apache.fop.fo.properties.CondLengthProperty;
  32. import org.apache.fop.fo.properties.CorrespondingPropertyMaker;
  33. import org.apache.fop.fo.properties.DimensionPropertyMaker;
  34. import org.apache.fop.fo.properties.EnumProperty;
  35. import org.apache.fop.fo.properties.FontFamilyProperty;
  36. import org.apache.fop.fo.properties.FontShorthandParser;
  37. import org.apache.fop.fo.properties.FontShorthandProperty;
  38. import org.apache.fop.fo.properties.FontSizePropertyMaker;
  39. import org.apache.fop.fo.properties.FontStretchPropertyMaker;
  40. import org.apache.fop.fo.properties.FontWeightPropertyMaker;
  41. import org.apache.fop.fo.properties.GenericShorthandParser;
  42. import org.apache.fop.fo.properties.IndentPropertyMaker;
  43. import org.apache.fop.fo.properties.KeepProperty;
  44. import org.apache.fop.fo.properties.LengthPairProperty;
  45. import org.apache.fop.fo.properties.LengthProperty;
  46. import org.apache.fop.fo.properties.LengthRangeProperty;
  47. import org.apache.fop.fo.properties.LineHeightPropertyMaker;
  48. import org.apache.fop.fo.properties.ListProperty;
  49. import org.apache.fop.fo.properties.NumberProperty;
  50. import org.apache.fop.fo.properties.PageBreakShorthandParser;
  51. import org.apache.fop.fo.properties.PageDimensionMaker;
  52. import org.apache.fop.fo.properties.PositionShorthandParser;
  53. import org.apache.fop.fo.properties.Property;
  54. import org.apache.fop.fo.properties.PropertyMaker;
  55. import org.apache.fop.fo.properties.ReferenceOrientationMaker;
  56. import org.apache.fop.fo.properties.SpaceProperty;
  57. import org.apache.fop.fo.properties.SpacePropertyMaker;
  58. import org.apache.fop.fo.properties.SpacingPropertyMaker;
  59. import org.apache.fop.fo.properties.StringProperty;
  60. import org.apache.fop.fo.properties.TableBorderPrecedence;
  61. import org.apache.fop.fo.properties.TextDecorationProperty;
  62. import org.apache.fop.fo.properties.ToBeImplementedProperty;
  63. import org.apache.fop.fo.properties.VerticalAlignShorthandParser;
  64. import org.apache.fop.fo.properties.WhiteSpaceShorthandParser;
  65. /**
  66. * This class creates and returns an array of Property.Maker instances
  67. * indexed by the PR_* propId from Constants.java.
  68. *
  69. * @todo Check multi-threading safety of the statics below
  70. */
  71. public final class FOPropertyMapping implements Constants {
  72. private static Map s_htPropNames = new HashMap();
  73. private static Map s_htSubPropNames = new HashMap();
  74. private static Map s_htPropIds = new HashMap();
  75. private static PropertyMaker[] s_generics = null;
  76. // The rest is only used during the building of the s_generics array.
  77. private Property[] enums = null;
  78. private PropertyMaker genericColor = null;
  79. private PropertyMaker genericBoolean = null;
  80. private PropertyMaker genericKeep = null;
  81. private PropertyMaker genericCondLength = null;
  82. private PropertyMaker genericCondPadding = null;
  83. private PropertyMaker genericPadding = null;
  84. private PropertyMaker genericCondBorderWidth = null;
  85. private PropertyMaker genericBorderWidth = null;
  86. private PropertyMaker genericBorderStyle = null;
  87. private PropertyMaker genericBreak = null;
  88. private PropertyMaker genericSpace = null;
  89. /**
  90. * Create the generic property maker templates. These templates
  91. * are used be the actual makers as a parameter to .useGeneric(...).
  92. */
  93. private void createGenerics() {
  94. PropertyMaker sub;
  95. genericColor = new ColorProperty.Maker(0);
  96. // GenericBoolean
  97. genericBoolean = new EnumProperty.Maker(0);
  98. genericBoolean.addEnum("true", getEnumProperty(EN_TRUE, "TRUE"));
  99. genericBoolean.addEnum("false", getEnumProperty(EN_FALSE, "FALSE"));
  100. // GenericKeep
  101. genericKeep = new KeepProperty.Maker(0);
  102. sub = new NumberProperty.Maker(CP_WITHIN_PAGE);
  103. sub.setByShorthand(true);
  104. sub.setDefault("auto");
  105. sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  106. sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
  107. genericKeep.addSubpropMaker(sub);
  108. sub = new NumberProperty.Maker(CP_WITHIN_LINE);
  109. sub.setByShorthand(true);
  110. sub.setDefault("auto");
  111. sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  112. sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
  113. genericKeep.addSubpropMaker(sub);
  114. sub = new NumberProperty.Maker(CP_WITHIN_COLUMN);
  115. sub.setByShorthand(true);
  116. sub.setDefault("auto");
  117. sub.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  118. sub.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
  119. genericKeep.addSubpropMaker(sub);
  120. // GenericCondLength
  121. genericCondLength = new CondLengthProperty.Maker(0);
  122. sub = new LengthProperty.Maker(CP_LENGTH);
  123. sub.setByShorthand(true);
  124. genericCondLength.addSubpropMaker(sub);
  125. sub = new EnumProperty.Maker(CP_CONDITIONALITY);
  126. sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
  127. sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
  128. genericCondLength.addSubpropMaker(sub);
  129. // GenericCondPadding
  130. genericCondPadding = new CondLengthProperty.Maker(0);
  131. genericCondPadding.useGeneric(genericCondLength);
  132. genericCondPadding.setInherited(false);
  133. genericCondPadding.getSubpropMaker(CP_LENGTH).setDefault("0pt");
  134. genericCondPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  135. // GenericPadding
  136. genericPadding = new LengthProperty.Maker(0);
  137. genericPadding.setInherited(false);
  138. genericPadding.setDefault("0pt");
  139. genericPadding.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  140. genericPadding.addShorthand(s_generics[PR_PADDING]);
  141. // GenericCondBorderWidth
  142. genericCondBorderWidth = new CondLengthProperty.Maker(0);
  143. genericCondBorderWidth.setInherited(false);
  144. genericCondBorderWidth.addKeyword("thin", "0.5pt");
  145. genericCondBorderWidth.addKeyword("medium", "1pt");
  146. genericCondBorderWidth.addKeyword("thick", "2pt");
  147. sub = new LengthProperty.Maker(CP_LENGTH);
  148. sub.setByShorthand(true);
  149. sub.addKeyword("thin", "0.5pt");
  150. sub.addKeyword("medium", "1pt");
  151. sub.addKeyword("thick", "2pt");
  152. sub.setDefault("medium");
  153. genericCondBorderWidth.addSubpropMaker(sub);
  154. sub = new EnumProperty.Maker(CP_CONDITIONALITY);
  155. sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
  156. sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
  157. genericCondBorderWidth.addSubpropMaker(sub);
  158. // GenericBorderWidth
  159. genericBorderWidth = new LengthProperty.Maker(0);
  160. genericBorderWidth.setInherited(false);
  161. genericBorderWidth.addKeyword("thin", "0.5pt");
  162. genericBorderWidth.addKeyword("medium", "1pt");
  163. genericBorderWidth.addKeyword("thick", "2pt");
  164. genericBorderWidth.setDefault("medium");
  165. // GenericBorderStyle
  166. genericBorderStyle = new EnumProperty.Maker(0);
  167. genericBorderStyle.setInherited(false);
  168. genericBorderStyle.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  169. genericBorderStyle.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
  170. genericBorderStyle.addEnum("dotted", getEnumProperty(EN_DOTTED, "DOTTED"));
  171. genericBorderStyle.addEnum("dashed", getEnumProperty(EN_DASHED, "DASHED"));
  172. genericBorderStyle.addEnum("solid", getEnumProperty(EN_SOLID, "SOLID"));
  173. genericBorderStyle.addEnum("double", getEnumProperty(EN_DOUBLE, "DOUBLE"));
  174. genericBorderStyle.addEnum("groove", getEnumProperty(EN_GROOVE, "GROOVE"));
  175. genericBorderStyle.addEnum("ridge", getEnumProperty(EN_RIDGE, "RIDGE"));
  176. genericBorderStyle.addEnum("inset", getEnumProperty(EN_INSET, "INSET"));
  177. genericBorderStyle.addEnum("outset", getEnumProperty(EN_OUTSET, "OUTSET"));
  178. genericBorderStyle.setDefault("none");
  179. // GenericBreak
  180. genericBreak = new EnumProperty.Maker(0);
  181. genericBreak.setInherited(false);
  182. genericBreak.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  183. genericBreak.addEnum("column", getEnumProperty(EN_COLUMN, "COLUMN"));
  184. genericBreak.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
  185. genericBreak.addEnum("even-page", getEnumProperty(EN_EVEN_PAGE, "EVEN_PAGE"));
  186. genericBreak.addEnum("odd-page", getEnumProperty(EN_ODD_PAGE, "ODD_PAGE"));
  187. genericBreak.setDefault("auto");
  188. // GenericSpace
  189. genericSpace = new SpaceProperty.Maker(0);
  190. genericSpace.setInherited(false);
  191. sub = new LengthProperty.Maker(CP_MINIMUM);
  192. sub.setDefault("0pt");
  193. sub.setByShorthand(true);
  194. genericSpace.addSubpropMaker(sub);
  195. sub = new LengthProperty.Maker(CP_OPTIMUM);
  196. sub.setDefault("0pt");
  197. sub.setByShorthand(true);
  198. genericSpace.addSubpropMaker(sub);
  199. sub = new LengthProperty.Maker(CP_MAXIMUM);
  200. sub.setDefault("0pt");
  201. sub.setByShorthand(true);
  202. genericSpace.addSubpropMaker(sub);
  203. sub = new NumberProperty.Maker(CP_PRECEDENCE);
  204. sub.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
  205. sub.setDefault("0");
  206. genericSpace.addSubpropMaker(sub);
  207. sub = new EnumProperty.Maker(CP_CONDITIONALITY);
  208. sub.addEnum("discard", getEnumProperty(EN_DISCARD, "DISCARD"));
  209. sub.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
  210. sub.setDefault("discard");
  211. genericSpace.addSubpropMaker(sub);
  212. }
  213. /**
  214. * Add a property maker to the generics array.
  215. * Also creates the name <-> id mapping in s_htPropNames and s_htPropIds.
  216. *
  217. * @param name the name of the property maker.
  218. * @param maker the maker.
  219. */
  220. private static void addPropertyMaker(String name, PropertyMaker maker) {
  221. s_generics[maker.getPropId()] = maker;
  222. s_htPropNames.put(name, new Integer(maker.getPropId()));
  223. s_htPropIds.put(new Integer(maker.getPropId()), name);
  224. }
  225. /**
  226. * Create the name<->id mapping for the subproperty names.
  227. * @param name name of the subproperty.
  228. * @param id Id for the subproperty from CP_* in Constants.java.
  229. */
  230. private static void addSubpropMakerName(String name, int id) {
  231. s_htSubPropNames.put(name, new Integer(id));
  232. s_htPropIds.put(new Integer(id), name);
  233. }
  234. /**
  235. * Return a (possibly cached) enum property based in the enum value.
  236. * @param enum A enum value from Constants.java.
  237. * @param text the text value by which this enum property is known
  238. * @return An EnumProperty instance.
  239. */
  240. private Property getEnumProperty(int enumValue, String text) {
  241. if (enums == null) {
  242. enums = new Property[ENUM_COUNT + 1];
  243. }
  244. if (enums[enumValue] == null) {
  245. enums[enumValue] = EnumProperty.getInstance(enumValue, text);
  246. }
  247. return enums[enumValue];
  248. }
  249. /**
  250. * Return the array of Makers.
  251. * @return the maker array.
  252. */
  253. public static PropertyMaker[] getGenericMappings() {
  254. if (s_generics == null) {
  255. /* this method was never called before */
  256. s_generics = new PropertyMaker[PROPERTY_COUNT + 1];
  257. FOPropertyMapping gp = new FOPropertyMapping();
  258. /* Create the shorthand first. They are
  259. * referenced by the real properties.
  260. */
  261. gp.createShorthandProperties();
  262. gp.createGenerics();
  263. gp.createAccessibilityProperties();
  264. gp.createAbsolutePositionProperties();
  265. gp.createAuralProperties();
  266. gp.createBorderPaddingBackgroundProperties();
  267. gp.createFontProperties();
  268. gp.createHyphenationProperties();
  269. gp.createMarginBlockProperties();
  270. gp.createMarginInlineProperties();
  271. gp.createRelativePosProperties();
  272. gp.createAreaAlignmentProperties();
  273. gp.createAreaDimensionProperties();
  274. gp.createBlockAndLineProperties();
  275. gp.createCharacterProperties();
  276. gp.createColorProperties();
  277. gp.createFloatProperties();
  278. gp.createKeepsAndBreaksProperties();
  279. gp.createLayoutProperties();
  280. gp.createLeaderAndRuleProperties();
  281. gp.createDynamicProperties();
  282. gp.createMarkersProperties();
  283. gp.createNumberToStringProperties();
  284. gp.createPaginationAndLayoutProperties();
  285. gp.createTableProperties();
  286. gp.createWritingModeProperties();
  287. gp.createMiscProperties();
  288. // Hardcode the subproperties.
  289. addSubpropMakerName("length", CP_LENGTH);
  290. addSubpropMakerName("conditionality", CP_CONDITIONALITY);
  291. addSubpropMakerName("block-progression-direction", CP_BLOCK_PROGRESSION_DIRECTION);
  292. addSubpropMakerName("inline-progression-direction", CP_INLINE_PROGRESSION_DIRECTION);
  293. addSubpropMakerName("within-line", CP_WITHIN_LINE);
  294. addSubpropMakerName("within-column", CP_WITHIN_COLUMN);
  295. addSubpropMakerName("within-page", CP_WITHIN_PAGE);
  296. addSubpropMakerName("minimum", CP_MINIMUM);
  297. addSubpropMakerName("maximum", CP_MAXIMUM);
  298. addSubpropMakerName("optimum", CP_OPTIMUM);
  299. addSubpropMakerName("precedence", CP_PRECEDENCE);
  300. }
  301. return s_generics;
  302. }
  303. /**
  304. * Return the propId for a property name.
  305. * @param name the property name
  306. * @return a propId that matches the property name.
  307. */
  308. public static int getPropertyId(String name) {
  309. if (name != null) {
  310. Integer i = (Integer) s_htPropNames.get(name);
  311. if (i != null) {
  312. return i.intValue();
  313. }
  314. }
  315. return -1;
  316. }
  317. /**
  318. * Return the subpropId for a subproperty name.
  319. * @param name the subproperty name.
  320. * @return a subpropId that matches the subproperty name.
  321. */
  322. public static int getSubPropertyId(String name) {
  323. if (name != null) {
  324. Integer i = (Integer) s_htSubPropNames.get(name);
  325. if (i != null) {
  326. return i.intValue();
  327. }
  328. }
  329. return -1;
  330. }
  331. /**
  332. * Returns the property name corresponding to the PR_* id
  333. * @param id the property id in Constants
  334. * @return the property name
  335. */
  336. public static String getPropertyName(int id) {
  337. if (((id & Constants.COMPOUND_MASK) == 0)
  338. || ((id & Constants.PROPERTY_MASK) == 0)) {
  339. return (String) s_htPropIds.get(new Integer(id));
  340. } else {
  341. return (String) s_htPropIds.get(new Integer(
  342. id & Constants.PROPERTY_MASK)) + "." + s_htPropIds.get(
  343. new Integer(id & Constants.COMPOUND_MASK));
  344. }
  345. }
  346. private void createAccessibilityProperties() {
  347. PropertyMaker m;
  348. // source-document
  349. m = new StringProperty.Maker(PR_SOURCE_DOCUMENT);
  350. m.setInherited(false);
  351. m.setDefault("none");
  352. addPropertyMaker("source-document", m);
  353. // role
  354. m = new StringProperty.Maker(PR_ROLE);
  355. m.setInherited(false);
  356. m.setDefault("none");
  357. addPropertyMaker("role", m);
  358. }
  359. private void createAbsolutePositionProperties() {
  360. PropertyMaker m;
  361. LengthProperty.Maker l;
  362. // absolute-position
  363. m = new EnumProperty.Maker(PR_ABSOLUTE_POSITION);
  364. m.setInherited(false);
  365. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  366. m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
  367. m.addEnum("absolute", getEnumProperty(EN_ABSOLUTE, "ABSOLUTE"));
  368. m.setDefault("auto");
  369. m.addShorthand(s_generics[PR_POSITION]);
  370. addPropertyMaker("absolute-position", m);
  371. // top
  372. l = new LengthProperty.Maker(PR_TOP);
  373. l.setInherited(false);
  374. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  375. l.setDefault("auto");
  376. addPropertyMaker("top", l);
  377. // right
  378. l = new LengthProperty.Maker(PR_RIGHT);
  379. l.setInherited(false);
  380. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  381. l.setDefault("auto");
  382. addPropertyMaker("right", l);
  383. // bottom
  384. l = new LengthProperty.Maker(PR_BOTTOM);
  385. l.setInherited(false);
  386. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  387. l.setDefault("auto");
  388. addPropertyMaker("bottom", l);
  389. // left
  390. l = new LengthProperty.Maker(PR_LEFT);
  391. l.setInherited(false);
  392. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  393. l.setDefault("auto");
  394. addPropertyMaker("left", l);
  395. }
  396. private void createAuralProperties() {
  397. PropertyMaker m;
  398. // azimuth
  399. m = new ToBeImplementedProperty.Maker(PR_AZIMUTH);
  400. m.setInherited(true);
  401. m.setDefault("center");
  402. addPropertyMaker("azimuth", m);
  403. // cue-after
  404. m = new ToBeImplementedProperty.Maker(PR_CUE_AFTER);
  405. m.setInherited(false);
  406. m.setDefault("none");
  407. addPropertyMaker("cue-after", m);
  408. // cue-before
  409. m = new ToBeImplementedProperty.Maker(PR_CUE_BEFORE);
  410. m.setInherited(false);
  411. m.setDefault("none");
  412. addPropertyMaker("cue-before", m);
  413. // elevation
  414. m = new ToBeImplementedProperty.Maker(PR_ELEVATION);
  415. m.setInherited(true);
  416. m.setDefault("level");
  417. addPropertyMaker("elevation", m);
  418. // pause-after
  419. m = new ToBeImplementedProperty.Maker(PR_PAUSE_AFTER);
  420. m.setInherited(false);
  421. m.setDefault("");
  422. addPropertyMaker("pause-after", m);
  423. // pause-before
  424. m = new ToBeImplementedProperty.Maker(PR_PAUSE_BEFORE);
  425. m.setInherited(false);
  426. m.setDefault("");
  427. addPropertyMaker("pause-before", m);
  428. // pitch
  429. m = new ToBeImplementedProperty.Maker(PR_PITCH);
  430. m.setInherited(true);
  431. m.setDefault("medium");
  432. addPropertyMaker("pitch", m);
  433. // pitch-range
  434. m = new ToBeImplementedProperty.Maker(PR_PITCH_RANGE);
  435. m.setInherited(true);
  436. m.setDefault("50");
  437. addPropertyMaker("pitch-range", m);
  438. // play-during
  439. m = new ToBeImplementedProperty.Maker(PR_PLAY_DURING);
  440. m.setInherited(false);
  441. m.setDefault("auto");
  442. addPropertyMaker("play-during", m);
  443. // richness
  444. m = new ToBeImplementedProperty.Maker(PR_RICHNESS);
  445. m.setInherited(true);
  446. m.setDefault("50");
  447. addPropertyMaker("richness", m);
  448. // speak
  449. m = new ToBeImplementedProperty.Maker(PR_SPEAK);
  450. m.setInherited(true);
  451. m.setDefault("normal");
  452. addPropertyMaker("speak", m);
  453. // speak-header
  454. m = new ToBeImplementedProperty.Maker(PR_SPEAK_HEADER);
  455. m.setInherited(true);
  456. m.setDefault("once");
  457. addPropertyMaker("speak-header", m);
  458. // speak-numeral
  459. m = new ToBeImplementedProperty.Maker(PR_SPEAK_NUMERAL);
  460. m.setInherited(true);
  461. m.setDefault("continuous");
  462. addPropertyMaker("speak-numeral", m);
  463. // speak-punctuation
  464. m = new ToBeImplementedProperty.Maker(PR_SPEAK_PUNCTUATION);
  465. m.setInherited(true);
  466. m.setDefault("none");
  467. addPropertyMaker("speak-punctuation", m);
  468. // speech-rate
  469. m = new ToBeImplementedProperty.Maker(PR_SPEECH_RATE);
  470. m.setInherited(true);
  471. m.setDefault("medium");
  472. addPropertyMaker("speech-rate", m);
  473. // stress
  474. m = new ToBeImplementedProperty.Maker(PR_STRESS);
  475. m.setInherited(true);
  476. m.setDefault("50");
  477. addPropertyMaker("stress", m);
  478. // voice-family
  479. m = new ToBeImplementedProperty.Maker(PR_VOICE_FAMILY);
  480. m.setInherited(true);
  481. m.setDefault("");
  482. addPropertyMaker("voice-family", m);
  483. // volume
  484. m = new ToBeImplementedProperty.Maker(PR_VOLUME);
  485. m.setInherited(true);
  486. m.setDefault("medium");
  487. addPropertyMaker("volume", m);
  488. }
  489. private void createBorderPaddingBackgroundProperties() {
  490. PropertyMaker m;
  491. BorderWidthPropertyMaker bwm;
  492. CorrespondingPropertyMaker corr;
  493. // background-attachment
  494. m = new EnumProperty.Maker(PR_BACKGROUND_ATTACHMENT);
  495. m.setInherited(false);
  496. m.addEnum("scroll", getEnumProperty(EN_SCROLL, "SCROLL"));
  497. m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
  498. m.setDefault("scroll");
  499. addPropertyMaker("background-attachment", m);
  500. // background-color
  501. m = new ColorProperty.Maker(PR_BACKGROUND_COLOR) {
  502. protected Property convertPropertyDatatype(
  503. Property p, PropertyList propertyList, FObj fo) throws PropertyException {
  504. String nameval = p.getNCname();
  505. if (nameval != null) {
  506. FObj fobj = (fo == null ? propertyList.getFObj() : fo);
  507. FOUserAgent ua = (fobj == null ? null : fobj.getUserAgent());
  508. return ColorProperty.getInstance(ua, nameval);
  509. }
  510. return super.convertPropertyDatatype(p, propertyList, fo);
  511. }
  512. };
  513. m.useGeneric(genericColor);
  514. m.setInherited(false);
  515. m.setDefault("transparent");
  516. addPropertyMaker("background-color", m);
  517. // background-image
  518. m = new StringProperty.Maker(PR_BACKGROUND_IMAGE);
  519. m.setInherited(false);
  520. m.setDefault("none");
  521. addPropertyMaker("background-image", m);
  522. // background-repeat
  523. m = new EnumProperty.Maker(PR_BACKGROUND_REPEAT);
  524. m.setInherited(false);
  525. m.addEnum("repeat", getEnumProperty(EN_REPEAT, "REPEAT"));
  526. m.addEnum("repeat-x", getEnumProperty(EN_REPEATX, "REPEATX"));
  527. m.addEnum("repeat-y", getEnumProperty(EN_REPEATY, "REPEATY"));
  528. m.addEnum("no-repeat", getEnumProperty(EN_NOREPEAT, "NOREPEAT"));
  529. m.setDefault("repeat");
  530. addPropertyMaker("background-repeat", m);
  531. // background-position-horizontal
  532. m = new LengthProperty.Maker(PR_BACKGROUND_POSITION_HORIZONTAL);
  533. m.setInherited(false);
  534. m.setDefault("0%");
  535. m.addKeyword("left", "0%");
  536. m.addKeyword("center", "50%");
  537. m.addKeyword("right", "100%");
  538. m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL);
  539. m.addShorthand(s_generics[PR_BACKGROUND_POSITION]);
  540. addPropertyMaker("background-position-horizontal", m);
  541. // background-position-vertical
  542. m = new LengthProperty.Maker(PR_BACKGROUND_POSITION_VERTICAL);
  543. m.setInherited(false);
  544. m.setDefault("0%");
  545. m.addKeyword("top", "0%");
  546. m.addKeyword("center", "50%");
  547. m.addKeyword("bottom", "100%");
  548. m.setPercentBase(LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL);
  549. m.addShorthand(s_generics[PR_BACKGROUND_POSITION]);
  550. addPropertyMaker("background-position-vertical", m);
  551. // border-before-color
  552. m = new ColorProperty.Maker(PR_BORDER_BEFORE_COLOR);
  553. m.useGeneric(genericColor);
  554. m.setInherited(false);
  555. m.setDefault("black");
  556. corr = new CorrespondingPropertyMaker(m);
  557. corr.setCorresponding(PR_BORDER_TOP_COLOR, PR_BORDER_TOP_COLOR,
  558. PR_BORDER_RIGHT_COLOR);
  559. corr.setRelative(true);
  560. addPropertyMaker("border-before-color", m);
  561. // border-before-style
  562. m = new EnumProperty.Maker(PR_BORDER_BEFORE_STYLE);
  563. m.useGeneric(genericBorderStyle);
  564. corr = new CorrespondingPropertyMaker(m);
  565. corr.setCorresponding(PR_BORDER_TOP_STYLE, PR_BORDER_TOP_STYLE,
  566. PR_BORDER_RIGHT_STYLE);
  567. corr.setRelative(true);
  568. addPropertyMaker("border-before-style", m);
  569. // border-before-width
  570. m = new CondLengthProperty.Maker(PR_BORDER_BEFORE_WIDTH);
  571. m.useGeneric(genericCondBorderWidth);
  572. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  573. corr = new CorrespondingPropertyMaker(m);
  574. corr.setCorresponding(PR_BORDER_TOP_WIDTH, PR_BORDER_TOP_WIDTH,
  575. PR_BORDER_RIGHT_WIDTH);
  576. corr.setRelative(true);
  577. addPropertyMaker("border-before-width", m);
  578. // border-after-color
  579. m = new ColorProperty.Maker(PR_BORDER_AFTER_COLOR);
  580. m.useGeneric(genericColor);
  581. m.setInherited(false);
  582. m.setDefault("black");
  583. corr = new CorrespondingPropertyMaker(m);
  584. corr.setCorresponding(PR_BORDER_BOTTOM_COLOR, PR_BORDER_BOTTOM_COLOR,
  585. PR_BORDER_LEFT_COLOR);
  586. corr.setRelative(true);
  587. addPropertyMaker("border-after-color", m);
  588. // border-after-style
  589. m = new EnumProperty.Maker(PR_BORDER_AFTER_STYLE);
  590. m.useGeneric(genericBorderStyle);
  591. corr = new CorrespondingPropertyMaker(m);
  592. corr.setCorresponding(PR_BORDER_BOTTOM_STYLE, PR_BORDER_BOTTOM_STYLE,
  593. PR_BORDER_LEFT_STYLE);
  594. corr.setRelative(true);
  595. addPropertyMaker("border-after-style", m);
  596. // border-after-width
  597. m = new CondLengthProperty.Maker(PR_BORDER_AFTER_WIDTH);
  598. m.useGeneric(genericCondBorderWidth);
  599. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  600. corr = new CorrespondingPropertyMaker(m);
  601. corr.setCorresponding(PR_BORDER_BOTTOM_WIDTH, PR_BORDER_BOTTOM_WIDTH,
  602. PR_BORDER_LEFT_WIDTH);
  603. corr.setRelative(true);
  604. addPropertyMaker("border-after-width", m);
  605. // border-start-color
  606. m = new ColorProperty.Maker(PR_BORDER_START_COLOR);
  607. m.useGeneric(genericColor);
  608. m.setInherited(false);
  609. m.setDefault("black");
  610. corr = new CorrespondingPropertyMaker(m);
  611. corr.setCorresponding(PR_BORDER_LEFT_COLOR, PR_BORDER_RIGHT_COLOR,
  612. PR_BORDER_TOP_COLOR);
  613. corr.setRelative(true);
  614. addPropertyMaker("border-start-color", m);
  615. // border-start-style
  616. m = new EnumProperty.Maker(PR_BORDER_START_STYLE);
  617. m.useGeneric(genericBorderStyle);
  618. corr = new CorrespondingPropertyMaker(m);
  619. corr.setCorresponding(PR_BORDER_LEFT_STYLE, PR_BORDER_RIGHT_STYLE,
  620. PR_BORDER_TOP_STYLE);
  621. corr.setRelative(true);
  622. addPropertyMaker("border-start-style", m);
  623. // border-start-width
  624. m = new CondLengthProperty.Maker(PR_BORDER_START_WIDTH);
  625. m.useGeneric(genericCondBorderWidth);
  626. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  627. corr = new CorrespondingPropertyMaker(m);
  628. corr.setCorresponding(PR_BORDER_LEFT_WIDTH, PR_BORDER_RIGHT_WIDTH,
  629. PR_BORDER_TOP_WIDTH);
  630. corr.setRelative(true);
  631. addPropertyMaker("border-start-width", m);
  632. // border-end-color
  633. m = new ColorProperty.Maker(PR_BORDER_END_COLOR);
  634. m.useGeneric(genericColor);
  635. m.setInherited(false);
  636. m.setDefault("black");
  637. corr = new CorrespondingPropertyMaker(m);
  638. corr.setCorresponding(PR_BORDER_RIGHT_COLOR, PR_BORDER_LEFT_COLOR,
  639. PR_BORDER_BOTTOM_COLOR);
  640. corr.setRelative(true);
  641. addPropertyMaker("border-end-color", m);
  642. // border-end-style
  643. m = new EnumProperty.Maker(PR_BORDER_END_STYLE);
  644. m.useGeneric(genericBorderStyle);
  645. corr = new CorrespondingPropertyMaker(m);
  646. corr.setCorresponding(PR_BORDER_RIGHT_STYLE, PR_BORDER_LEFT_STYLE,
  647. PR_BORDER_BOTTOM_STYLE);
  648. corr.setRelative(true);
  649. addPropertyMaker("border-end-style", m);
  650. // border-end-width
  651. m = new CondLengthProperty.Maker(PR_BORDER_END_WIDTH);
  652. m.useGeneric(genericCondBorderWidth);
  653. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  654. corr = new CorrespondingPropertyMaker(m);
  655. corr.setCorresponding(PR_BORDER_RIGHT_WIDTH, PR_BORDER_LEFT_WIDTH,
  656. PR_BORDER_BOTTOM_WIDTH);
  657. corr.setRelative(true);
  658. addPropertyMaker("border-end-width", m);
  659. // border-top-color
  660. m = new ColorProperty.Maker(PR_BORDER_TOP_COLOR);
  661. m.useGeneric(genericColor);
  662. m.setInherited(false);
  663. m.setDefault("black");
  664. m.addShorthand(s_generics[PR_BORDER_TOP]);
  665. m.addShorthand(s_generics[PR_BORDER_COLOR]);
  666. m.addShorthand(s_generics[PR_BORDER]);
  667. corr = new CorrespondingPropertyMaker(m);
  668. corr.setCorresponding(PR_BORDER_BEFORE_COLOR, PR_BORDER_BEFORE_COLOR,
  669. PR_BORDER_START_COLOR);
  670. addPropertyMaker("border-top-color", m);
  671. // border-top-style
  672. m = new EnumProperty.Maker(PR_BORDER_TOP_STYLE);
  673. m.useGeneric(genericBorderStyle);
  674. m.addShorthand(s_generics[PR_BORDER_TOP]);
  675. m.addShorthand(s_generics[PR_BORDER_STYLE]);
  676. m.addShorthand(s_generics[PR_BORDER]);
  677. corr = new CorrespondingPropertyMaker(m);
  678. corr.setCorresponding(PR_BORDER_BEFORE_STYLE, PR_BORDER_BEFORE_STYLE,
  679. PR_BORDER_START_STYLE);
  680. addPropertyMaker("border-top-style", m);
  681. // border-top-width
  682. bwm = new BorderWidthPropertyMaker(PR_BORDER_TOP_WIDTH);
  683. bwm.useGeneric(genericBorderWidth);
  684. bwm.setBorderStyleId(PR_BORDER_TOP_STYLE);
  685. bwm.addShorthand(s_generics[PR_BORDER_TOP]);
  686. bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
  687. bwm.addShorthand(s_generics[PR_BORDER]);
  688. corr = new CorrespondingPropertyMaker(bwm);
  689. corr.setCorresponding(PR_BORDER_BEFORE_WIDTH, PR_BORDER_BEFORE_WIDTH,
  690. PR_BORDER_START_WIDTH);
  691. addPropertyMaker("border-top-width", bwm);
  692. // border-bottom-color
  693. m = new ColorProperty.Maker(PR_BORDER_BOTTOM_COLOR);
  694. m.useGeneric(genericColor);
  695. m.setInherited(false);
  696. m.setDefault("black");
  697. m.addShorthand(s_generics[PR_BORDER_BOTTOM]);
  698. m.addShorthand(s_generics[PR_BORDER_COLOR]);
  699. m.addShorthand(s_generics[PR_BORDER]);
  700. corr = new CorrespondingPropertyMaker(m);
  701. corr.setCorresponding(PR_BORDER_AFTER_COLOR, PR_BORDER_AFTER_COLOR,
  702. PR_BORDER_END_COLOR);
  703. addPropertyMaker("border-bottom-color", m);
  704. // border-bottom-style
  705. m = new EnumProperty.Maker(PR_BORDER_BOTTOM_STYLE);
  706. m.useGeneric(genericBorderStyle);
  707. m.addShorthand(s_generics[PR_BORDER_BOTTOM]);
  708. m.addShorthand(s_generics[PR_BORDER_STYLE]);
  709. m.addShorthand(s_generics[PR_BORDER]);
  710. corr = new CorrespondingPropertyMaker(m);
  711. corr.setCorresponding(PR_BORDER_AFTER_STYLE, PR_BORDER_AFTER_STYLE,
  712. PR_BORDER_END_STYLE);
  713. addPropertyMaker("border-bottom-style", m);
  714. // border-bottom-width
  715. bwm = new BorderWidthPropertyMaker(PR_BORDER_BOTTOM_WIDTH);
  716. bwm.useGeneric(genericBorderWidth);
  717. bwm.setBorderStyleId(PR_BORDER_BOTTOM_STYLE);
  718. bwm.addShorthand(s_generics[PR_BORDER_BOTTOM]);
  719. bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
  720. bwm.addShorthand(s_generics[PR_BORDER]);
  721. corr = new CorrespondingPropertyMaker(bwm);
  722. corr.setCorresponding(PR_BORDER_AFTER_WIDTH, PR_BORDER_AFTER_WIDTH,
  723. PR_BORDER_END_WIDTH);
  724. addPropertyMaker("border-bottom-width", bwm);
  725. // border-left-color
  726. m = new ColorProperty.Maker(PR_BORDER_LEFT_COLOR);
  727. m.useGeneric(genericColor);
  728. m.setInherited(false);
  729. m.setDefault("black");
  730. m.addShorthand(s_generics[PR_BORDER_LEFT]);
  731. m.addShorthand(s_generics[PR_BORDER_COLOR]);
  732. m.addShorthand(s_generics[PR_BORDER]);
  733. corr = new CorrespondingPropertyMaker(m);
  734. corr.setCorresponding(PR_BORDER_START_COLOR, PR_BORDER_END_COLOR,
  735. PR_BORDER_AFTER_COLOR);
  736. addPropertyMaker("border-left-color", m);
  737. // border-left-style
  738. m = new EnumProperty.Maker(PR_BORDER_LEFT_STYLE);
  739. m.useGeneric(genericBorderStyle);
  740. m.addShorthand(s_generics[PR_BORDER_LEFT]);
  741. m.addShorthand(s_generics[PR_BORDER_STYLE]);
  742. m.addShorthand(s_generics[PR_BORDER]);
  743. corr = new CorrespondingPropertyMaker(m);
  744. corr.setCorresponding(PR_BORDER_START_STYLE, PR_BORDER_END_STYLE,
  745. PR_BORDER_AFTER_STYLE);
  746. addPropertyMaker("border-left-style", m);
  747. // border-left-width
  748. bwm = new BorderWidthPropertyMaker(PR_BORDER_LEFT_WIDTH);
  749. bwm.useGeneric(genericBorderWidth);
  750. bwm.setBorderStyleId(PR_BORDER_LEFT_STYLE);
  751. bwm.addShorthand(s_generics[PR_BORDER_LEFT]);
  752. bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
  753. bwm.addShorthand(s_generics[PR_BORDER]);
  754. corr = new CorrespondingPropertyMaker(bwm);
  755. corr.setCorresponding(PR_BORDER_START_WIDTH, PR_BORDER_END_WIDTH,
  756. PR_BORDER_AFTER_WIDTH);
  757. addPropertyMaker("border-left-width", bwm);
  758. // border-right-color
  759. m = new ColorProperty.Maker(PR_BORDER_RIGHT_COLOR);
  760. m.useGeneric(genericColor);
  761. m.setInherited(false);
  762. m.setDefault("black");
  763. m.addShorthand(s_generics[PR_BORDER_RIGHT]);
  764. m.addShorthand(s_generics[PR_BORDER_COLOR]);
  765. m.addShorthand(s_generics[PR_BORDER]);
  766. corr = new CorrespondingPropertyMaker(m);
  767. corr.setCorresponding(PR_BORDER_END_COLOR, PR_BORDER_START_COLOR,
  768. PR_BORDER_BEFORE_COLOR);
  769. addPropertyMaker("border-right-color", m);
  770. // border-right-style
  771. m = new EnumProperty.Maker(PR_BORDER_RIGHT_STYLE);
  772. m.useGeneric(genericBorderStyle);
  773. m.addShorthand(s_generics[PR_BORDER_RIGHT]);
  774. m.addShorthand(s_generics[PR_BORDER_STYLE]);
  775. m.addShorthand(s_generics[PR_BORDER]);
  776. corr = new CorrespondingPropertyMaker(m);
  777. corr.setCorresponding(PR_BORDER_END_STYLE, PR_BORDER_START_STYLE,
  778. PR_BORDER_BEFORE_STYLE);
  779. addPropertyMaker("border-right-style", m);
  780. // border-right-width
  781. bwm = new BorderWidthPropertyMaker(PR_BORDER_RIGHT_WIDTH);
  782. bwm.useGeneric(genericBorderWidth);
  783. bwm.setBorderStyleId(PR_BORDER_RIGHT_STYLE);
  784. bwm.addShorthand(s_generics[PR_BORDER_RIGHT]);
  785. bwm.addShorthand(s_generics[PR_BORDER_WIDTH]);
  786. bwm.addShorthand(s_generics[PR_BORDER]);
  787. corr = new CorrespondingPropertyMaker(bwm);
  788. corr.setCorresponding(PR_BORDER_END_WIDTH, PR_BORDER_START_WIDTH,
  789. PR_BORDER_BEFORE_WIDTH);
  790. addPropertyMaker("border-right-width", bwm);
  791. // padding-before
  792. m = new CondLengthProperty.Maker(PR_PADDING_BEFORE);
  793. m.useGeneric(genericCondPadding);
  794. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  795. corr = new CorrespondingPropertyMaker(m);
  796. corr.setCorresponding(PR_PADDING_TOP, PR_PADDING_TOP,
  797. PR_PADDING_RIGHT);
  798. corr.setRelative(true);
  799. addPropertyMaker("padding-before", m);
  800. // padding-after
  801. m = new CondLengthProperty.Maker(PR_PADDING_AFTER);
  802. m.useGeneric(genericCondPadding);
  803. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  804. corr = new CorrespondingPropertyMaker(m);
  805. corr.setCorresponding(PR_PADDING_BOTTOM, PR_PADDING_BOTTOM,
  806. PR_PADDING_LEFT);
  807. corr.setRelative(true);
  808. addPropertyMaker("padding-after", m);
  809. // padding-start
  810. m = new CondLengthProperty.Maker(PR_PADDING_START);
  811. m.useGeneric(genericCondPadding);
  812. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  813. corr = new CorrespondingPropertyMaker(m);
  814. corr.setCorresponding(PR_PADDING_LEFT, PR_PADDING_RIGHT,
  815. PR_PADDING_TOP);
  816. corr.setRelative(true);
  817. addPropertyMaker("padding-start", m);
  818. // padding-end
  819. m = new CondLengthProperty.Maker(PR_PADDING_END);
  820. m.useGeneric(genericCondPadding);
  821. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  822. corr = new CorrespondingPropertyMaker(m);
  823. corr.setCorresponding(PR_PADDING_RIGHT, PR_PADDING_LEFT,
  824. PR_PADDING_BOTTOM);
  825. corr.setRelative(true);
  826. addPropertyMaker("padding-end", m);
  827. // padding-top
  828. m = new LengthProperty.Maker(PR_PADDING_TOP);
  829. m.useGeneric(genericPadding);
  830. corr = new CorrespondingPropertyMaker(m);
  831. corr.setCorresponding(PR_PADDING_BEFORE, PR_PADDING_BEFORE,
  832. PR_PADDING_START);
  833. addPropertyMaker("padding-top", m);
  834. // padding-bottom
  835. m = new LengthProperty.Maker(PR_PADDING_BOTTOM);
  836. m.useGeneric(genericPadding);
  837. corr = new CorrespondingPropertyMaker(m);
  838. corr.setCorresponding(PR_PADDING_AFTER, PR_PADDING_AFTER,
  839. PR_PADDING_END);
  840. addPropertyMaker("padding-bottom", m);
  841. // padding-left
  842. m = new LengthProperty.Maker(PR_PADDING_LEFT);
  843. m.useGeneric(genericPadding);
  844. corr = new CorrespondingPropertyMaker(m);
  845. corr.setCorresponding(PR_PADDING_START, PR_PADDING_END,
  846. PR_PADDING_AFTER);
  847. addPropertyMaker("padding-left", m);
  848. // padding-right
  849. m = new LengthProperty.Maker(PR_PADDING_RIGHT);
  850. m.useGeneric(genericPadding);
  851. corr = new CorrespondingPropertyMaker(m);
  852. corr.setCorresponding(PR_PADDING_END, PR_PADDING_START,
  853. PR_PADDING_BEFORE);
  854. addPropertyMaker("padding-right", m);
  855. }
  856. private void createFontProperties() {
  857. PropertyMaker m;
  858. // font-family
  859. m = new FontFamilyProperty.Maker(PR_FONT_FAMILY);
  860. m.setInherited(true);
  861. m.setDefault("sans-serif");
  862. m.addShorthand(s_generics[PR_FONT]);
  863. addPropertyMaker("font-family", m);
  864. // font-selection-strategy
  865. m = new EnumProperty.Maker(PR_FONT_SELECTION_STRATEGY);
  866. m.setInherited(true);
  867. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  868. m.addEnum("character-by-character", getEnumProperty(
  869. EN_CHARACTER_BY_CHARACTER, "CHARACTER_BY_CHARACTER"));
  870. m.setDefault("auto");
  871. addPropertyMaker("font-selection-strategy", m);
  872. // font-size
  873. m = new FontSizePropertyMaker(PR_FONT_SIZE);
  874. m.setInherited(true);
  875. m.setDefault("12pt");
  876. m.addKeyword("xx-small", "6.944pt");
  877. m.addKeyword("x-small", "8.333pt");
  878. m.addKeyword("small", "10pt");
  879. m.addKeyword("medium", "12pt");
  880. m.addKeyword("large", "14.4pt");
  881. m.addKeyword("x-large", "17.28pt");
  882. m.addKeyword("xx-large", "20.736pt");
  883. m.addEnum("larger", getEnumProperty(EN_LARGER, "LARGER"));
  884. m.addEnum("smaller", getEnumProperty(EN_SMALLER, "SMALLER"));
  885. m.setPercentBase(LengthBase.INH_FONTSIZE);
  886. m.addShorthand(s_generics[PR_FONT]);
  887. addPropertyMaker("font-size", m);
  888. // font-stretch
  889. m = new FontStretchPropertyMaker(PR_FONT_STRETCH);
  890. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  891. m.addEnum("wider", getEnumProperty(EN_WIDER, "WIDER"));
  892. m.addEnum("narrower", getEnumProperty(EN_NARROWER, "NARROWER"));
  893. m.addEnum("ultra-condensed", getEnumProperty(EN_ULTRA_CONDENSED, "ULTRA_CONDENSED"));
  894. m.addEnum("extra-condensed", getEnumProperty(EN_EXTRA_CONDENSED, "EXTRA_CONDENSED"));
  895. m.addEnum("condensed", getEnumProperty(EN_CONDENSED, "CONDENSED"));
  896. m.addEnum("semi-condensed", getEnumProperty(EN_SEMI_CONDENSED, "SEMI_CONDENSED"));
  897. m.addEnum("semi-expanded", getEnumProperty(EN_SEMI_EXPANDED, "SEMI_EXPANDED"));
  898. m.addEnum("expanded", getEnumProperty(EN_EXPANDED, "EXPANDED"));
  899. m.addEnum("extra-expanded", getEnumProperty(EN_EXTRA_EXPANDED, "EXTRA_EXPANDED"));
  900. m.addEnum("ultra-expanded", getEnumProperty(EN_ULTRA_EXPANDED, "ULTRA_EXPANDED"));
  901. m.setDefault("normal");
  902. addPropertyMaker("font-stretch", m);
  903. // font-size-adjust
  904. m = new NumberProperty.Maker(PR_FONT_SIZE_ADJUST);
  905. m.setInherited(true);
  906. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  907. m.setDefault("none");
  908. addPropertyMaker("font-size-adjust", m);
  909. // font-style
  910. m = new EnumProperty.Maker(PR_FONT_STYLE);
  911. m.setInherited(true);
  912. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  913. m.addEnum("italic", getEnumProperty(EN_ITALIC, "ITALIC"));
  914. m.addEnum("oblique", getEnumProperty(EN_OBLIQUE, "OBLIQUE"));
  915. m.addEnum("backslant", getEnumProperty(EN_BACKSLANT, "BACKSLANT"));
  916. m.setDefault("normal");
  917. m.addShorthand(s_generics[PR_FONT]);
  918. addPropertyMaker("font-style", m);
  919. // font-variant
  920. m = new EnumProperty.Maker(PR_FONT_VARIANT);
  921. m.setInherited(true);
  922. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  923. m.addEnum("small-caps", getEnumProperty(EN_SMALL_CAPS, "SMALL_CAPS"));
  924. m.setDefault("normal");
  925. m.addShorthand(s_generics[PR_FONT]);
  926. addPropertyMaker("font-variant", m);
  927. // font-weight
  928. m = new FontWeightPropertyMaker(PR_FONT_WEIGHT);
  929. m.setInherited(true);
  930. m.addKeyword("normal", "400");
  931. m.addKeyword("bold", "700");
  932. m.addEnum("bolder", getEnumProperty(EN_BOLDER, "BOLDER"));
  933. m.addEnum("lighter", getEnumProperty(EN_LIGHTER, "LIGHTER"));
  934. m.addEnum("100", getEnumProperty(EN_100, "100"));
  935. m.addEnum("200", getEnumProperty(EN_200, "200"));
  936. m.addEnum("300", getEnumProperty(EN_300, "300"));
  937. m.addEnum("400", getEnumProperty(EN_400, "400"));
  938. m.addEnum("500", getEnumProperty(EN_500, "500"));
  939. m.addEnum("600", getEnumProperty(EN_600, "600"));
  940. m.addEnum("700", getEnumProperty(EN_700, "700"));
  941. m.addEnum("800", getEnumProperty(EN_800, "800"));
  942. m.addEnum("900", getEnumProperty(EN_900, "900"));
  943. m.setDefault("400");
  944. m.addShorthand(s_generics[PR_FONT]);
  945. addPropertyMaker("font-weight", m);
  946. }
  947. private void createHyphenationProperties() {
  948. PropertyMaker m;
  949. // country
  950. m = new StringProperty.Maker(PR_COUNTRY);
  951. m.setInherited(true);
  952. m.setDefault("none");
  953. addPropertyMaker("country", m);
  954. // language
  955. m = new StringProperty.Maker(PR_LANGUAGE);
  956. m.setInherited(true);
  957. m.setDefault("none");
  958. addPropertyMaker("language", m);
  959. // script
  960. m = new StringProperty.Maker(PR_SCRIPT);
  961. m.setInherited(true);
  962. m.setDefault("auto");
  963. addPropertyMaker("script", m);
  964. // hyphenate
  965. m = new EnumProperty.Maker(PR_HYPHENATE);
  966. m.useGeneric(genericBoolean);
  967. m.setInherited(true);
  968. m.setDefault("false");
  969. addPropertyMaker("hyphenate", m);
  970. // hyphenation-character
  971. m = new CharacterProperty.Maker(PR_HYPHENATION_CHARACTER);
  972. m.setInherited(true);
  973. m.setDefault("-");
  974. addPropertyMaker("hyphenation-character", m);
  975. // hyphenation-push-character-count
  976. m = new NumberProperty.Maker(PR_HYPHENATION_PUSH_CHARACTER_COUNT);
  977. m.setInherited(true);
  978. m.setDefault("2");
  979. addPropertyMaker("hyphenation-push-character-count", m);
  980. // hyphenation-remain-character-count
  981. m = new NumberProperty.Maker(PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
  982. m.setInherited(true);
  983. m.setDefault("2");
  984. addPropertyMaker("hyphenation-remain-character-count", m);
  985. }
  986. private void createMarginBlockProperties() {
  987. PropertyMaker m;
  988. CorrespondingPropertyMaker corr;
  989. // margin-top
  990. m = new LengthProperty.Maker(PR_MARGIN_TOP);
  991. m.setInherited(false);
  992. m.setDefault("0pt");
  993. m.addShorthand(s_generics[PR_MARGIN]);
  994. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  995. addPropertyMaker("margin-top", m);
  996. // margin-bottom
  997. m = new LengthProperty.Maker(PR_MARGIN_BOTTOM);
  998. m.setInherited(false);
  999. m.setDefault("0pt");
  1000. m.addShorthand(s_generics[PR_MARGIN]);
  1001. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1002. addPropertyMaker("margin-bottom", m);
  1003. // margin-left
  1004. m = new LengthProperty.Maker(PR_MARGIN_LEFT);
  1005. m.setInherited(false);
  1006. m.setDefault("0pt");
  1007. m.addShorthand(s_generics[PR_MARGIN]);
  1008. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1009. addPropertyMaker("margin-left", m);
  1010. // margin-right
  1011. m = new LengthProperty.Maker(PR_MARGIN_RIGHT);
  1012. m.setInherited(false);
  1013. m.setDefault("0pt");
  1014. m.addShorthand(s_generics[PR_MARGIN]);
  1015. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1016. addPropertyMaker("margin-right", m);
  1017. // space-before
  1018. m = new SpaceProperty.Maker(PR_SPACE_BEFORE);
  1019. m.useGeneric(genericSpace);
  1020. corr = new SpacePropertyMaker(m);
  1021. corr.setCorresponding(PR_MARGIN_TOP, PR_MARGIN_TOP, PR_MARGIN_RIGHT);
  1022. corr.setUseParent(false);
  1023. corr.setRelative(true);
  1024. addPropertyMaker("space-before", m);
  1025. // space-after
  1026. m = new SpaceProperty.Maker(PR_SPACE_AFTER);
  1027. m.useGeneric(genericSpace);
  1028. corr = new SpacePropertyMaker(m);
  1029. corr.setCorresponding(PR_MARGIN_BOTTOM, PR_MARGIN_BOTTOM, PR_MARGIN_LEFT);
  1030. corr.setUseParent(true);
  1031. corr.setRelative(true);
  1032. addPropertyMaker("space-after", m);
  1033. // start-indent
  1034. m = new LengthProperty.Maker(PR_START_INDENT);
  1035. m.setInherited(true);
  1036. m.setDefault("0pt");
  1037. IndentPropertyMaker sCorr = new IndentPropertyMaker(m);
  1038. sCorr.setCorresponding(PR_MARGIN_LEFT, PR_MARGIN_RIGHT, PR_MARGIN_TOP);
  1039. sCorr.setUseParent(true);
  1040. sCorr.setRelative(true);
  1041. sCorr.setPaddingCorresponding(new int[] {
  1042. PR_PADDING_LEFT, PR_PADDING_RIGHT, PR_PADDING_TOP
  1043. });
  1044. sCorr.setBorderWidthCorresponding(new int[] {
  1045. PR_BORDER_LEFT_WIDTH, PR_BORDER_RIGHT_WIDTH, PR_BORDER_TOP_WIDTH
  1046. });
  1047. addPropertyMaker("start-indent", m);
  1048. // end-indent
  1049. m = new LengthProperty.Maker(PR_END_INDENT);
  1050. m.setInherited(true);
  1051. m.setDefault("0pt");
  1052. IndentPropertyMaker eCorr = new IndentPropertyMaker(m);
  1053. eCorr.setCorresponding(PR_MARGIN_RIGHT, PR_MARGIN_LEFT, PR_MARGIN_BOTTOM);
  1054. eCorr.setUseParent(true);
  1055. eCorr.setRelative(true);
  1056. eCorr.setPaddingCorresponding(new int[] {
  1057. PR_PADDING_RIGHT, PR_PADDING_LEFT, PR_PADDING_BOTTOM
  1058. });
  1059. eCorr.setBorderWidthCorresponding(new int[] {
  1060. PR_BORDER_RIGHT_WIDTH, PR_BORDER_LEFT_WIDTH, PR_BORDER_BOTTOM_WIDTH
  1061. });
  1062. addPropertyMaker("end-indent", m);
  1063. }
  1064. private void createMarginInlineProperties() {
  1065. PropertyMaker m;
  1066. // space-end
  1067. m = new SpaceProperty.Maker(PR_SPACE_END);
  1068. m.useGeneric(genericSpace);
  1069. addPropertyMaker("space-end", m);
  1070. // space-start
  1071. m = new SpaceProperty.Maker(PR_SPACE_START);
  1072. m.useGeneric(genericSpace);
  1073. addPropertyMaker("space-start", m);
  1074. }
  1075. private void createRelativePosProperties() {
  1076. PropertyMaker m;
  1077. // relative-position
  1078. m = new EnumProperty.Maker(PR_RELATIVE_POSITION);
  1079. m.setInherited(false);
  1080. m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC"));
  1081. m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
  1082. m.setDefault("static");
  1083. m.addShorthand(s_generics[PR_POSITION]);
  1084. addPropertyMaker("relative-position", m);
  1085. }
  1086. private void createAreaAlignmentProperties() {
  1087. PropertyMaker m;
  1088. // alignment-adjust
  1089. m = new LengthProperty.Maker(PR_ALIGNMENT_ADJUST);
  1090. m.setInherited(false);
  1091. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1092. m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
  1093. m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
  1094. m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
  1095. m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
  1096. m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
  1097. m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
  1098. m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
  1099. m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
  1100. m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
  1101. m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
  1102. m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
  1103. m.setDefault("auto");
  1104. m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
  1105. m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
  1106. addPropertyMaker("alignment-adjust", m);
  1107. // alignment-baseline
  1108. m = new EnumProperty.Maker(PR_ALIGNMENT_BASELINE);
  1109. m.setInherited(false);
  1110. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1111. m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
  1112. m.addEnum("before-edge", getEnumProperty(EN_BEFORE_EDGE, "BEFORE_EDGE"));
  1113. m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
  1114. m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
  1115. m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
  1116. m.addEnum("after-edge", getEnumProperty(EN_AFTER_EDGE, "AFTER_EDGE"));
  1117. m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
  1118. m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
  1119. m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
  1120. m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
  1121. m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
  1122. m.setDefault("auto");
  1123. m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
  1124. addPropertyMaker("alignment-baseline", m);
  1125. // baseline-shift
  1126. m = new LengthProperty.Maker(PR_BASELINE_SHIFT);
  1127. m.setInherited(false);
  1128. m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
  1129. m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
  1130. m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
  1131. m.setDefault("baseline");
  1132. m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
  1133. m.setPercentBase(LengthBase.CUSTOM_BASE);
  1134. addPropertyMaker("baseline-shift", m);
  1135. // display-align
  1136. m = new EnumProperty.Maker(PR_DISPLAY_ALIGN);
  1137. m.setInherited(true);
  1138. m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
  1139. m.addEnum("after", getEnumProperty(EN_AFTER, "AFTER"));
  1140. m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
  1141. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1142. /*LF*/ m.addEnum("distribute", getEnumProperty(EN_X_DISTRIBUTE, "DISTRIBUTE"));
  1143. /*LF*/ m.addEnum("fill", getEnumProperty(EN_X_FILL, "FILL"));
  1144. m.setDefault("auto");
  1145. addPropertyMaker("display-align", m);
  1146. // dominant-baseline
  1147. m = new EnumProperty.Maker(PR_DOMINANT_BASELINE);
  1148. m.setInherited(false);
  1149. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1150. m.addEnum("use-script", getEnumProperty(EN_USE_SCRIPT, "USE_SCRIPT"));
  1151. m.addEnum("no-change", getEnumProperty(EN_NO_CHANGE, "NO_CHANGE"));
  1152. m.addEnum("reset-size", getEnumProperty(EN_RESET_SIZE, "RESET_SIZE"));
  1153. m.addEnum("ideographic", getEnumProperty(EN_IDEOGRAPHIC, "IDEOGRAPHIC"));
  1154. m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
  1155. m.addEnum("hanging", getEnumProperty(EN_HANGING, "HANGING"));
  1156. m.addEnum("mathematical", getEnumProperty(EN_MATHEMATICAL, "MATHEMATICAL"));
  1157. m.addEnum("central", getEnumProperty(EN_CENTRAL, "CENTRAL"));
  1158. m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
  1159. m.addEnum("text-after-edge", getEnumProperty(EN_TEXT_AFTER_EDGE, "TEXT_AFTER_EDGE"));
  1160. m.addEnum("text-before-edge", getEnumProperty(EN_TEXT_BEFORE_EDGE, "TEXT_BEFORE_EDGE"));
  1161. m.setDefault("auto");
  1162. m.addShorthand(s_generics[PR_VERTICAL_ALIGN]);
  1163. addPropertyMaker("dominant-baseline", m);
  1164. // relative-align
  1165. m = new EnumProperty.Maker(PR_RELATIVE_ALIGN);
  1166. m.setInherited(true);
  1167. m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
  1168. m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
  1169. m.setDefault("before");
  1170. addPropertyMaker("relative-align", m);
  1171. }
  1172. private void createAreaDimensionProperties() {
  1173. PropertyMaker m;
  1174. LengthProperty.Maker l;
  1175. DimensionPropertyMaker pdim;
  1176. // block-progression-dimension
  1177. m = new LengthRangeProperty.Maker(PR_BLOCK_PROGRESSION_DIMENSION);
  1178. m.setInherited(false);
  1179. m.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
  1180. l = new LengthProperty.Maker(CP_MINIMUM);
  1181. l.setDefault("auto");
  1182. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1183. l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
  1184. l.setByShorthand(true);
  1185. m.addSubpropMaker(l);
  1186. l = new LengthProperty.Maker(CP_OPTIMUM);
  1187. l.setDefault("auto");
  1188. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1189. l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
  1190. l.setByShorthand(true);
  1191. m.addSubpropMaker(l);
  1192. l = new LengthProperty.Maker(CP_MAXIMUM);
  1193. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1194. l.setDefault("auto");
  1195. l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
  1196. l.setByShorthand(true);
  1197. m.addSubpropMaker(l);
  1198. pdim = new DimensionPropertyMaker(m);
  1199. pdim.setCorresponding(PR_HEIGHT, PR_HEIGHT, PR_WIDTH);
  1200. pdim.setExtraCorresponding(new int[][] {
  1201. {PR_MIN_HEIGHT, PR_MIN_HEIGHT, PR_MIN_WIDTH, },
  1202. {PR_MAX_HEIGHT, PR_MAX_HEIGHT, PR_MAX_WIDTH, }
  1203. });
  1204. pdim.setRelative(true);
  1205. m.setCorresponding(pdim);
  1206. addPropertyMaker("block-progression-dimension", m);
  1207. // content-height
  1208. l = new LengthProperty.Maker(PR_CONTENT_HEIGHT);
  1209. l.setInherited(false);
  1210. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1211. l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
  1212. l.addEnum("scale-down-to-fit", getEnumProperty(EN_SCALE_DOWN_TO_FIT, "SCALE_DOWN_TO_FIT"));
  1213. l.addEnum("scale-up-to-fit", getEnumProperty(EN_SCALE_UP_TO_FIT, "SCALE_UP_TO_FIT"));
  1214. l.setDefault("auto");
  1215. l.setPercentBase(LengthBase.IMAGE_INTRINSIC_HEIGHT);
  1216. addPropertyMaker("content-height", l);
  1217. // content-width
  1218. l = new LengthProperty.Maker(PR_CONTENT_WIDTH);
  1219. l.setInherited(false);
  1220. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1221. l.addEnum("scale-to-fit", getEnumProperty(EN_SCALE_TO_FIT, "SCALE_TO_FIT"));
  1222. l.addEnum("scale-down-to-fit", getEnumProperty(EN_SCALE_DOWN_TO_FIT, "SCALE_DOWN_TO_FIT"));
  1223. l.addEnum("scale-up-to-fit", getEnumProperty(EN_SCALE_UP_TO_FIT, "SCALE_UP_TO_FIT"));
  1224. l.setDefault("auto");
  1225. l.setPercentBase(LengthBase.IMAGE_INTRINSIC_WIDTH);
  1226. addPropertyMaker("content-width", l);
  1227. // height
  1228. l = new LengthProperty.Maker(PR_HEIGHT);
  1229. l.setInherited(false);
  1230. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1231. l.setPercentBase(LengthBase.CONTAINING_BLOCK_HEIGHT);
  1232. l.setDefault("auto");
  1233. addPropertyMaker("height", l);
  1234. // inline-progression-dimension
  1235. m = new LengthRangeProperty.Maker(PR_INLINE_PROGRESSION_DIMENSION);
  1236. m.setInherited(false);
  1237. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1238. l = new LengthProperty.Maker(CP_MINIMUM);
  1239. l.setDefault("auto");
  1240. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1241. l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1242. l.setByShorthand(true);
  1243. m.addSubpropMaker(l);
  1244. l = new LengthProperty.Maker(CP_OPTIMUM);
  1245. l.setDefault("auto");
  1246. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1247. l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1248. l.setByShorthand(true);
  1249. m.addSubpropMaker(l);
  1250. l = new LengthProperty.Maker(CP_MAXIMUM);
  1251. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1252. l.setDefault("auto");
  1253. l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1254. l.setByShorthand(true);
  1255. m.addSubpropMaker(l);
  1256. pdim = new DimensionPropertyMaker(m);
  1257. pdim.setRelative(true);
  1258. pdim.setCorresponding(PR_WIDTH, PR_WIDTH, PR_HEIGHT);
  1259. pdim.setExtraCorresponding(new int[][] {
  1260. {PR_MIN_WIDTH, PR_MIN_WIDTH, PR_MIN_HEIGHT, },
  1261. {PR_MAX_WIDTH, PR_MAX_WIDTH, PR_MAX_HEIGHT, }
  1262. });
  1263. m.setCorresponding(pdim);
  1264. addPropertyMaker("inline-progression-dimension", m);
  1265. // max-height
  1266. m = new ToBeImplementedProperty.Maker(PR_MAX_HEIGHT);
  1267. m.setInherited(false);
  1268. m.setDefault("0pt");
  1269. addPropertyMaker("max-height", m);
  1270. // max-width
  1271. m = new ToBeImplementedProperty.Maker(PR_MAX_WIDTH);
  1272. m.setInherited(false);
  1273. m.setDefault("none");
  1274. addPropertyMaker("max-width", m);
  1275. // min-height
  1276. m = new ToBeImplementedProperty.Maker(PR_MIN_HEIGHT);
  1277. m.setInherited(false);
  1278. m.setDefault("0pt");
  1279. addPropertyMaker("min-height", m);
  1280. // min-width
  1281. m = new ToBeImplementedProperty.Maker(PR_MIN_WIDTH);
  1282. m.setInherited(false);
  1283. m.setDefault("");
  1284. addPropertyMaker("min-width", m);
  1285. // scaling
  1286. m = new EnumProperty.Maker(PR_SCALING);
  1287. m.setInherited(true);
  1288. m.addEnum("uniform", getEnumProperty(EN_UNIFORM, "UNIFORM"));
  1289. m.addEnum("non-uniform", getEnumProperty(EN_NON_UNIFORM, "NON_UNIFORM"));
  1290. m.setDefault("uniform");
  1291. addPropertyMaker("scaling", m);
  1292. // scaling-method
  1293. m = new EnumProperty.Maker(PR_SCALING_METHOD);
  1294. m.setInherited(false);
  1295. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1296. m.addEnum("integer-pixels", getEnumProperty(EN_INTEGER_PIXELS, "INTEGER_PIXELS"));
  1297. m.addEnum("resample-any-method", getEnumProperty(EN_RESAMPLE_ANY_METHOD, "RESAMPLE_ANY_METHOD"));
  1298. m.setDefault("auto");
  1299. addPropertyMaker("scaling-method", m);
  1300. // width
  1301. l = new LengthProperty.Maker(PR_WIDTH);
  1302. l.setInherited(false);
  1303. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1304. l.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1305. l.setDefault("auto");
  1306. addPropertyMaker("width", l);
  1307. // fox:block-progression-unit (**CUSTOM EXTENSION**)
  1308. l = new LengthProperty.Maker(PR_X_BLOCK_PROGRESSION_UNIT);
  1309. l.setInherited(false);
  1310. l.setDefault("0pt");
  1311. addPropertyMaker("fox:block-progression-unit", l);
  1312. }
  1313. private void createBlockAndLineProperties() {
  1314. PropertyMaker m;
  1315. // hyphenation-keep
  1316. m = new EnumProperty.Maker(PR_HYPHENATION_KEEP);
  1317. m.setInherited(true);
  1318. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1319. m.addEnum("column", getEnumProperty(EN_COLUMN, "COLUMN"));
  1320. m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
  1321. m.setDefault("auto");
  1322. addPropertyMaker("hyphenation-keep", m);
  1323. // hyphenation-ladder-count
  1324. m = new NumberProperty.Maker(PR_HYPHENATION_LADDER_COUNT);
  1325. m.setInherited(true);
  1326. m.addEnum("no-limit", getEnumProperty(EN_NO_LIMIT, "NO_LIMIT"));
  1327. m.setDefault("no-limit");
  1328. addPropertyMaker("hyphenation-ladder-count", m);
  1329. // last-line-end-indent
  1330. m = new LengthProperty.Maker(PR_LAST_LINE_END_INDENT);
  1331. m.setInherited(true);
  1332. m.setDefault("0pt");
  1333. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1334. addPropertyMaker("last-line-end-indent", m);
  1335. // line-height
  1336. m = new LineHeightPropertyMaker(PR_LINE_HEIGHT);
  1337. m.useGeneric(genericSpace);
  1338. m.setInherited(true);
  1339. m.addKeyword("normal", "1.2");
  1340. m.setPercentBase(LengthBase.FONTSIZE);
  1341. m.setDefault("normal", true);
  1342. m.addShorthand(s_generics[PR_FONT]);
  1343. addPropertyMaker("line-height", m);
  1344. // line-height-shift-adjustment
  1345. m = new EnumProperty.Maker(PR_LINE_HEIGHT_SHIFT_ADJUSTMENT);
  1346. m.setInherited(true);
  1347. m.addEnum("consider-shifts", getEnumProperty(EN_CONSIDER_SHIFTS, "CONSIDER_SHIFTS"));
  1348. m.addEnum("disregard-shifts", getEnumProperty(EN_DISREGARD_SHIFTS, "DISREGARD_SHIFTS"));
  1349. m.setDefault("consider-shifts");
  1350. addPropertyMaker("line-height-shift-adjustment", m);
  1351. // line-stacking-strategy
  1352. m = new EnumProperty.Maker(PR_LINE_STACKING_STRATEGY);
  1353. m.setInherited(true);
  1354. m.addEnum("line-height", getEnumProperty(EN_LINE_HEIGHT, "LINE_HEIGHT"));
  1355. m.addEnum("font-height", getEnumProperty(EN_FONT_HEIGHT, "FONT_HEIGHT"));
  1356. m.addEnum("max-height", getEnumProperty(EN_MAX_HEIGHT, "MAX_HEIGHT"));
  1357. m.setDefault("max-height");
  1358. addPropertyMaker("line-stacking-strategy", m);
  1359. // linefeed-treatment
  1360. m = new EnumProperty.Maker(PR_LINEFEED_TREATMENT);
  1361. m.setInherited(true);
  1362. m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE"));
  1363. m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE"));
  1364. m.addEnum("treat-as-space", getEnumProperty(EN_TREAT_AS_SPACE, "TREAT_AS_SPACE"));
  1365. m.addEnum("treat-as-zero-width-space", getEnumProperty(EN_TREAT_AS_ZERO_WIDTH_SPACE, "TREAT_AS_ZERO_WIDTH_SPACE"));
  1366. m.setDefault("treat-as-space");
  1367. m.addShorthand(s_generics[PR_WHITE_SPACE]);
  1368. addPropertyMaker("linefeed-treatment", m);
  1369. // white-space-treatment
  1370. m = new EnumProperty.Maker(PR_WHITE_SPACE_TREATMENT);
  1371. m.setInherited(true);
  1372. m.addEnum("ignore", getEnumProperty(EN_IGNORE, "IGNORE"));
  1373. m.addEnum("preserve", getEnumProperty(EN_PRESERVE, "PRESERVE"));
  1374. m.addEnum("ignore-if-before-linefeed", getEnumProperty(EN_IGNORE_IF_BEFORE_LINEFEED, "IGNORE_IF_BEFORE_LINEFEED"));
  1375. m.addEnum("ignore-if-after-linefeed", getEnumProperty(EN_IGNORE_IF_AFTER_LINEFEED, "IGNORE_IF_AFTER_LINEFEED"));
  1376. m.addEnum("ignore-if-surrounding-linefeed", getEnumProperty(EN_IGNORE_IF_SURROUNDING_LINEFEED, "IGNORE_IF_SURROUNDING_LINEFEED"));
  1377. m.setDefault("ignore-if-surrounding-linefeed");
  1378. m.addShorthand(s_generics[PR_WHITE_SPACE]);
  1379. addPropertyMaker("white-space-treatment", m);
  1380. // text-align TODO: make it a StringProperty with enums.
  1381. m = new EnumProperty.Maker(PR_TEXT_ALIGN);
  1382. m.setInherited(true);
  1383. // Note: both 'end', 'right' and 'outside' are mapped to END
  1384. // both 'start', 'left' and 'inside' are mapped to START
  1385. m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
  1386. m.addEnum("end", getEnumProperty(EN_END, "END"));
  1387. m.addEnum("right", getEnumProperty(EN_END, "END"));
  1388. m.addEnum("start", getEnumProperty(EN_START, "START"));
  1389. m.addEnum("left", getEnumProperty(EN_START, "START"));
  1390. m.addEnum("justify", getEnumProperty(EN_JUSTIFY, "JUSTIFY"));
  1391. m.addEnum("inside", getEnumProperty(EN_START, "START"));
  1392. m.addEnum("outside", getEnumProperty(EN_END, "END"));
  1393. m.setDefault("start");
  1394. addPropertyMaker("text-align", m);
  1395. // text-align-last
  1396. m = new EnumProperty.Maker(PR_TEXT_ALIGN_LAST) {
  1397. public Property get(int subpropId, PropertyList propertyList,
  1398. boolean bTryInherit, boolean bTryDefault) throws PropertyException {
  1399. Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault);
  1400. if (p != null && p.getEnum() == EN_RELATIVE) {
  1401. //The default may have been returned, so check inherited value
  1402. p = propertyList.getNearestSpecified(PR_TEXT_ALIGN_LAST);
  1403. if (p.getEnum() == EN_RELATIVE) {
  1404. return calcRelative(propertyList);
  1405. }
  1406. }
  1407. return p;
  1408. }
  1409. private Property calcRelative(PropertyList propertyList) throws PropertyException {
  1410. Property corresponding = propertyList.get(PR_TEXT_ALIGN);
  1411. if (corresponding == null) {
  1412. return null;
  1413. }
  1414. int correspondingValue = corresponding.getEnum();
  1415. if (correspondingValue == EN_JUSTIFY) {
  1416. return getEnumProperty(EN_START, "START");
  1417. } else if (correspondingValue == EN_END) {
  1418. return getEnumProperty(EN_END, "END");
  1419. } else if (correspondingValue == EN_START) {
  1420. return getEnumProperty(EN_START, "START");
  1421. } else if (correspondingValue == EN_CENTER) {
  1422. return getEnumProperty(EN_CENTER, "CENTER");
  1423. } else {
  1424. return null;
  1425. }
  1426. }
  1427. };
  1428. m.setInherited(false); //Actually it's "true" but the special PropertyMaker compensates
  1429. // Note: both 'end', 'right' and 'outside' are mapped to END
  1430. // both 'start', 'left' and 'inside' are mapped to START
  1431. m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
  1432. m.addEnum("center", getEnumProperty(EN_CENTER, "CENTER"));
  1433. m.addEnum("end", getEnumProperty(EN_END, "END"));
  1434. m.addEnum("right", getEnumProperty(EN_END, "END"));
  1435. m.addEnum("start", getEnumProperty(EN_START, "START"));
  1436. m.addEnum("left", getEnumProperty(EN_START, "START"));
  1437. m.addEnum("justify", getEnumProperty(EN_JUSTIFY, "JUSTIFY"));
  1438. m.addEnum("inside", getEnumProperty(EN_START, "START"));
  1439. m.addEnum("outside", getEnumProperty(EN_END, "END"));
  1440. m.setDefault("relative", true);
  1441. addPropertyMaker("text-align-last", m);
  1442. // text-indent
  1443. m = new LengthProperty.Maker(PR_TEXT_INDENT);
  1444. m.setInherited(true);
  1445. m.setDefault("0pt");
  1446. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1447. addPropertyMaker("text-indent", m);
  1448. // white-space-collapse
  1449. m = new EnumProperty.Maker(PR_WHITE_SPACE_COLLAPSE);
  1450. m.useGeneric(genericBoolean);
  1451. m.setInherited(true);
  1452. m.setDefault("true");
  1453. m.addShorthand(s_generics[PR_WHITE_SPACE]);
  1454. addPropertyMaker("white-space-collapse", m);
  1455. // wrap-option
  1456. m = new EnumProperty.Maker(PR_WRAP_OPTION);
  1457. m.setInherited(true);
  1458. m.addEnum("wrap", getEnumProperty(EN_WRAP, "WRAP"));
  1459. m.addEnum("no-wrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
  1460. m.setDefault("wrap");
  1461. m.addShorthand(s_generics[PR_WHITE_SPACE]);
  1462. addPropertyMaker("wrap-option", m);
  1463. }
  1464. private void createCharacterProperties() {
  1465. PropertyMaker m;
  1466. // character
  1467. m = new CharacterProperty.Maker(PR_CHARACTER);
  1468. m.setInherited(false);
  1469. m.setDefault("none");
  1470. addPropertyMaker("character", m);
  1471. // letter-spacing
  1472. m = new SpacingPropertyMaker(PR_LETTER_SPACING);
  1473. m.useGeneric(genericSpace);
  1474. m.setInherited(true);
  1475. m.getSubpropMaker(CP_PRECEDENCE).setDefault("force");
  1476. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  1477. m.setDefault("normal");
  1478. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  1479. addPropertyMaker("letter-spacing", m);
  1480. // suppress-at-line-break
  1481. m = new EnumProperty.Maker(PR_SUPPRESS_AT_LINE_BREAK);
  1482. m.setInherited(false);
  1483. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1484. m.addEnum("suppress", getEnumProperty(EN_SUPPRESS, "SUPPRESS"));
  1485. m.addEnum("retain", getEnumProperty(EN_RETAIN, "RETAIN"));
  1486. m.setDefault("auto");
  1487. addPropertyMaker("suppress-at-line-break", m);
  1488. // text-decoration
  1489. //m = new EnumProperty.Maker(PR_TEXT_DECORATION);
  1490. m = new TextDecorationProperty.Maker(PR_TEXT_DECORATION);
  1491. m.setInherited(false);
  1492. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1493. m.addEnum("underline", getEnumProperty(EN_UNDERLINE, "UNDERLINE"));
  1494. m.addEnum("overline", getEnumProperty(EN_OVERLINE, "OVERLINE"));
  1495. m.addEnum("line-through", getEnumProperty(EN_LINE_THROUGH, "LINE_THROUGH"));
  1496. m.addEnum("blink", getEnumProperty(EN_BLINK, "BLINK"));
  1497. m.addEnum("no-underline", getEnumProperty(EN_NO_UNDERLINE, "NO_UNDERLINE"));
  1498. m.addEnum("no-overline", getEnumProperty(EN_NO_OVERLINE, "NO_OVERLINE"));
  1499. m.addEnum("no-line-through", getEnumProperty(EN_NO_LINE_THROUGH, "NO_LINE_THROUGH"));
  1500. m.addEnum("no-blink", getEnumProperty(EN_NO_BLINK, "NO_BLINK"));
  1501. m.setDefault("none");
  1502. addPropertyMaker("text-decoration", m);
  1503. // text-shadow
  1504. m = new ToBeImplementedProperty.Maker(PR_TEXT_SHADOW);
  1505. m.setInherited(false);
  1506. m.setDefault("none");
  1507. addPropertyMaker("text-shadow", m);
  1508. // text-transform
  1509. m = new EnumProperty.Maker(PR_TEXT_TRANSFORM);
  1510. m.setInherited(true);
  1511. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1512. m.addEnum("capitalize", getEnumProperty(EN_CAPITALIZE, "CAPITALIZE"));
  1513. m.addEnum("uppercase", getEnumProperty(EN_UPPERCASE, "UPPERCASE"));
  1514. m.addEnum("lowercase", getEnumProperty(EN_LOWERCASE, "LOWERCASE"));
  1515. m.setDefault("none");
  1516. addPropertyMaker("text-transform", m);
  1517. // treat-as-word-space
  1518. m = new EnumProperty.Maker(PR_TREAT_AS_WORD_SPACE);
  1519. m.useGeneric(genericBoolean);
  1520. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1521. m.setInherited(false);
  1522. m.setDefault("auto");
  1523. addPropertyMaker("treat-as-word-space", m);
  1524. // word-spacing
  1525. m = new SpacingPropertyMaker(PR_WORD_SPACING);
  1526. m.useGeneric(genericSpace);
  1527. m.setInherited(true);
  1528. m.getSubpropMaker(CP_PRECEDENCE).setDefault("force");
  1529. m.getSubpropMaker(CP_CONDITIONALITY).setDefault("discard");
  1530. m.setDefault("normal");
  1531. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  1532. addPropertyMaker("word-spacing", m);
  1533. }
  1534. private void createColorProperties() {
  1535. PropertyMaker m;
  1536. // color
  1537. m = new ColorProperty.Maker(PR_COLOR);
  1538. m.useGeneric(genericColor);
  1539. m.setInherited(true);
  1540. m.setDefault("black");
  1541. addPropertyMaker("color", m);
  1542. // color-profile-name
  1543. m = new StringProperty.Maker(PR_COLOR_PROFILE_NAME);
  1544. m.setInherited(false);
  1545. m.setDefault("");
  1546. addPropertyMaker("color-profile-name", m);
  1547. // rendering-intent
  1548. m = new EnumProperty.Maker(PR_RENDERING_INTENT);
  1549. m.setInherited(false);
  1550. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1551. m.addEnum("perceptual", getEnumProperty(EN_PERCEPTUAL, "PERCEPTUAL"));
  1552. m.addEnum("relative-colorimetric", getEnumProperty(EN_RELATIVE_COLOMETRIC, "RELATIVE_COLOMETRIC"));
  1553. m.addEnum("saturation", getEnumProperty(EN_SATURATION, "SATURATION"));
  1554. m.addEnum("absolute-colorimetric", getEnumProperty(EN_ABSOLUTE_COLORMETRIC, "ABSOLUTE_COLORMETRIC"));
  1555. m.setDefault("auto");
  1556. addPropertyMaker("rendering-intent", m);
  1557. }
  1558. private void createFloatProperties() {
  1559. PropertyMaker m;
  1560. // clear
  1561. m = new EnumProperty.Maker(PR_CLEAR);
  1562. m.setInherited(false);
  1563. // Note that left -> start and right -> end.
  1564. m.addEnum("start", getEnumProperty(EN_START, "START"));
  1565. m.addEnum("end", getEnumProperty(EN_END, "END"));
  1566. m.addEnum("left", getEnumProperty(EN_START, "START"));
  1567. m.addEnum("right", getEnumProperty(EN_END, "END"));
  1568. m.addEnum("both", getEnumProperty(EN_BOTH, "BOTH"));
  1569. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1570. m.setDefault("none");
  1571. addPropertyMaker("clear", m);
  1572. // float
  1573. m = new EnumProperty.Maker(PR_FLOAT);
  1574. m.setInherited(false);
  1575. // Note that left -> start and right -> end.
  1576. m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
  1577. m.addEnum("start", getEnumProperty(EN_START, "START"));
  1578. m.addEnum("end", getEnumProperty(EN_END, "END"));
  1579. m.addEnum("left", getEnumProperty(EN_START, "START"));
  1580. m.addEnum("right", getEnumProperty(EN_END, "END"));
  1581. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1582. m.setDefault("none");
  1583. addPropertyMaker("float", m);
  1584. // intrusion-displace
  1585. m = new EnumProperty.Maker(PR_INTRUSION_DISPLACE);
  1586. m.setInherited(false);
  1587. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1588. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1589. m.addEnum("line", getEnumProperty(EN_LINE, "LINE"));
  1590. m.addEnum("indent", getEnumProperty(EN_INDENT, "INDENT"));
  1591. m.addEnum("block", getEnumProperty(EN_BLOCK, "BLOCK"));
  1592. m.setDefault("none");
  1593. addPropertyMaker("intrusion-displace", m);
  1594. }
  1595. private void createKeepsAndBreaksProperties() {
  1596. PropertyMaker m;
  1597. // break-after
  1598. m = new EnumProperty.Maker(PR_BREAK_AFTER);
  1599. m.useGeneric(genericBreak);
  1600. m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]);
  1601. addPropertyMaker("break-after", m);
  1602. // break-before
  1603. m = new EnumProperty.Maker(PR_BREAK_BEFORE);
  1604. m.useGeneric(genericBreak);
  1605. m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]);
  1606. addPropertyMaker("break-before", m);
  1607. // keep-together
  1608. m = new KeepProperty.Maker(PR_KEEP_TOGETHER);
  1609. m.useGeneric(genericKeep);
  1610. m.setInherited(true);
  1611. m.setDefault("auto");
  1612. m.addShorthand(s_generics[PR_PAGE_BREAK_INSIDE]);
  1613. addPropertyMaker("keep-together", m);
  1614. // keep-with-next
  1615. m = new KeepProperty.Maker(PR_KEEP_WITH_NEXT);
  1616. m.useGeneric(genericKeep);
  1617. m.setInherited(false);
  1618. m.setDefault("auto");
  1619. m.addShorthand(s_generics[PR_PAGE_BREAK_AFTER]);
  1620. addPropertyMaker("keep-with-next", m);
  1621. // keep-with-previous
  1622. m = new KeepProperty.Maker(PR_KEEP_WITH_PREVIOUS);
  1623. m.useGeneric(genericKeep);
  1624. m.setInherited(false);
  1625. m.setDefault("auto");
  1626. m.addShorthand(s_generics[PR_PAGE_BREAK_BEFORE]);
  1627. addPropertyMaker("keep-with-previous", m);
  1628. // orphans
  1629. m = new NumberProperty.Maker(PR_ORPHANS);
  1630. m.setInherited(true);
  1631. m.setDefault("2");
  1632. addPropertyMaker("orphans", m);
  1633. // widows
  1634. m = new NumberProperty.Maker(PR_WIDOWS);
  1635. m.setInherited(true);
  1636. m.setDefault("2");
  1637. addPropertyMaker("widows", m);
  1638. // fox:widow-content-limit
  1639. m = new LengthProperty.Maker(PR_X_WIDOW_CONTENT_LIMIT);
  1640. m.setInherited(true);
  1641. m.setDefault("0pt");
  1642. addPropertyMaker("fox:widow-content-limit", m);
  1643. // fox:orphan-content-limit
  1644. m = new LengthProperty.Maker(PR_X_ORPHAN_CONTENT_LIMIT);
  1645. m.setInherited(true);
  1646. m.setDefault("0pt");
  1647. addPropertyMaker("fox:orphan-content-limit", m);
  1648. }
  1649. private void createLayoutProperties() {
  1650. PropertyMaker m;
  1651. // clip
  1652. m = new ToBeImplementedProperty.Maker(PR_CLIP);
  1653. m.setInherited(false);
  1654. m.setDefault("auto");
  1655. addPropertyMaker("clip", m);
  1656. // overflow
  1657. m = new EnumProperty.Maker(PR_OVERFLOW);
  1658. m.setInherited(false);
  1659. m.addEnum("visible", getEnumProperty(EN_VISIBLE, "VISIBLE"));
  1660. m.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
  1661. m.addEnum("scroll", getEnumProperty(EN_SCROLL, "SCROLL"));
  1662. m.addEnum("error-if-overflow", getEnumProperty(EN_ERROR_IF_OVERFLOW, "ERROR_IF_OVERFLOW"));
  1663. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1664. m.setDefault("auto");
  1665. addPropertyMaker("overflow", m);
  1666. // reference-orientation
  1667. m = new ReferenceOrientationMaker(PR_REFERENCE_ORIENTATION);
  1668. m.setInherited(true);
  1669. m.setDefault("0");
  1670. addPropertyMaker("reference-orientation", m);
  1671. // span
  1672. m = new EnumProperty.Maker(PR_SPAN);
  1673. m.setInherited(false);
  1674. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1675. m.addEnum("all", getEnumProperty(EN_ALL, "ALL"));
  1676. m.setDefault("none");
  1677. addPropertyMaker("span", m);
  1678. }
  1679. private void createLeaderAndRuleProperties() {
  1680. PropertyMaker m;
  1681. PropertyMaker sub;
  1682. // leader-alignment
  1683. m = new EnumProperty.Maker(PR_LEADER_ALIGNMENT);
  1684. m.setInherited(true);
  1685. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1686. m.addEnum("reference-area", getEnumProperty(EN_REFERENCE_AREA, "REFERENCE_AREA"));
  1687. m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
  1688. m.setDefault("none");
  1689. addPropertyMaker("leader-alignment", m);
  1690. // leader-pattern
  1691. m = new EnumProperty.Maker(PR_LEADER_PATTERN);
  1692. m.setInherited(true);
  1693. m.addEnum("space", getEnumProperty(EN_SPACE, "SPACE"));
  1694. m.addEnum("rule", getEnumProperty(EN_RULE, "RULE"));
  1695. m.addEnum("dots", getEnumProperty(EN_DOTS, "DOTS"));
  1696. m.addEnum("use-content", getEnumProperty(EN_USECONTENT, "USECONTENT"));
  1697. m.setDefault("space");
  1698. addPropertyMaker("leader-pattern", m);
  1699. // leader-pattern-width
  1700. m = new LengthProperty.Maker(PR_LEADER_PATTERN_WIDTH);
  1701. m.setInherited(true);
  1702. m.setDefault("use-font-metrics", true);
  1703. m.addKeyword("use-font-metrics", "0pt");
  1704. m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
  1705. addPropertyMaker("leader-pattern-width", m);
  1706. // leader-length
  1707. m = new LengthRangeProperty.Maker(PR_LEADER_LENGTH);
  1708. m.setInherited(true);
  1709. m.setPercentBase(LengthBase.PARENT_AREA_WIDTH);
  1710. sub = new LengthProperty.Maker(CP_MINIMUM);
  1711. sub.setDefault("0pt");
  1712. sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1713. sub.setByShorthand(true);
  1714. m.addSubpropMaker(sub);
  1715. sub = new LengthProperty.Maker(CP_OPTIMUM);
  1716. sub.setDefault("12.0pt");
  1717. sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1718. sub.setByShorthand(true);
  1719. m.addSubpropMaker(sub);
  1720. sub = new LengthProperty.Maker(CP_MAXIMUM);
  1721. sub.setDefault("100%", true);
  1722. sub.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  1723. sub.setByShorthand(true);
  1724. m.addSubpropMaker(sub);
  1725. addPropertyMaker("leader-length", m);
  1726. // rule-style
  1727. m = new EnumProperty.Maker(PR_RULE_STYLE);
  1728. m.setInherited(true);
  1729. m.addEnum("none", getEnumProperty(EN_NONE, "NONE"));
  1730. m.addEnum("dotted", getEnumProperty(EN_DOTTED, "DOTTED"));
  1731. m.addEnum("dashed", getEnumProperty(EN_DASHED, "DASHED"));
  1732. m.addEnum("solid", getEnumProperty(EN_SOLID, "SOLID"));
  1733. m.addEnum("double", getEnumProperty(EN_DOUBLE, "DOUBLE"));
  1734. m.addEnum("groove", getEnumProperty(EN_GROOVE, "GROOVE"));
  1735. m.addEnum("ridge", getEnumProperty(EN_RIDGE, "RIDGE"));
  1736. m.setDefault("solid");
  1737. addPropertyMaker("rule-style", m);
  1738. // rule-thickness
  1739. m = new LengthProperty.Maker(PR_RULE_THICKNESS);
  1740. m.setInherited(true);
  1741. m.setDefault("1.0pt");
  1742. addPropertyMaker("rule-thickness", m);
  1743. }
  1744. private void createDynamicProperties() {
  1745. PropertyMaker m;
  1746. // active-state
  1747. m = new ToBeImplementedProperty.Maker(PR_ACTIVE_STATE);
  1748. m.setInherited(false);
  1749. m.setDefault("");
  1750. addPropertyMaker("active-state", m);
  1751. // auto-restore
  1752. m = new ToBeImplementedProperty.Maker(PR_AUTO_RESTORE);
  1753. m.setInherited(true);
  1754. m.setDefault("false");
  1755. addPropertyMaker("auto-restore", m);
  1756. // case-name
  1757. m = new ToBeImplementedProperty.Maker(PR_CASE_NAME);
  1758. m.setInherited(false);
  1759. m.setDefault("");
  1760. addPropertyMaker("case-name", m);
  1761. // case-title
  1762. m = new ToBeImplementedProperty.Maker(PR_CASE_TITLE);
  1763. m.setInherited(false);
  1764. m.setDefault("");
  1765. addPropertyMaker("case-title", m);
  1766. // destination-placement-offset
  1767. m = new ToBeImplementedProperty.Maker(PR_DESTINATION_PLACEMENT_OFFSET);
  1768. m.setInherited(false);
  1769. m.setDefault("0pt");
  1770. addPropertyMaker("destination-placement-offset", m);
  1771. // external-destination
  1772. m = new StringProperty.Maker(PR_EXTERNAL_DESTINATION);
  1773. m.setInherited(false);
  1774. m.setDefault("");
  1775. addPropertyMaker("external-destination", m);
  1776. // indicate-destination
  1777. m = new ToBeImplementedProperty.Maker(PR_INDICATE_DESTINATION);
  1778. m.setInherited(false);
  1779. m.setDefault("false");
  1780. addPropertyMaker("indicate-destination", m);
  1781. // internal-destination
  1782. m = new StringProperty.Maker(PR_INTERNAL_DESTINATION);
  1783. m.setInherited(false);
  1784. m.setDefault("");
  1785. addPropertyMaker("internal-destination", m);
  1786. // show-destination
  1787. m = new ToBeImplementedProperty.Maker(PR_SHOW_DESTINATION);
  1788. m.setInherited(false);
  1789. m.setDefault("replace");
  1790. addPropertyMaker("show-destination", m);
  1791. // starting-state
  1792. m = new EnumProperty.Maker(PR_STARTING_STATE);
  1793. m.setInherited(false);
  1794. m.addEnum("show", getEnumProperty(EN_SHOW, "SHOW"));
  1795. m.addEnum("hide", getEnumProperty(EN_HIDE, "HIDE"));
  1796. m.setDefault("show");
  1797. addPropertyMaker("starting-state", m);
  1798. // switch-to
  1799. m = new ToBeImplementedProperty.Maker(PR_SWITCH_TO);
  1800. m.setInherited(false);
  1801. m.setDefault("xsl-any");
  1802. addPropertyMaker("switch-to", m);
  1803. // target-presentation-context
  1804. m = new ToBeImplementedProperty.Maker(PR_TARGET_PRESENTATION_CONTEXT);
  1805. m.setInherited(false);
  1806. m.setDefault("use-target-processing-context");
  1807. addPropertyMaker("target-presentation-context", m);
  1808. // target-processing-context
  1809. m = new ToBeImplementedProperty.Maker(PR_TARGET_PROCESSING_CONTEXT);
  1810. m.setInherited(false);
  1811. m.setDefault("document-root");
  1812. addPropertyMaker("target-processing-context", m);
  1813. // target-stylesheet
  1814. m = new ToBeImplementedProperty.Maker(PR_TARGET_STYLESHEET);
  1815. m.setInherited(false);
  1816. m.setDefault("use-normal-stylesheet");
  1817. addPropertyMaker("target-stylesheet", m);
  1818. }
  1819. private void createMarkersProperties() {
  1820. PropertyMaker m;
  1821. // marker-class-name
  1822. m = new StringProperty.Maker(PR_MARKER_CLASS_NAME);
  1823. m.setInherited(false);
  1824. m.setDefault("");
  1825. addPropertyMaker("marker-class-name", m);
  1826. // retrieve-class-name
  1827. m = new StringProperty.Maker(PR_RETRIEVE_CLASS_NAME);
  1828. m.setInherited(false);
  1829. m.setDefault("");
  1830. addPropertyMaker("retrieve-class-name", m);
  1831. // retrieve-position
  1832. m = new EnumProperty.Maker(PR_RETRIEVE_POSITION);
  1833. m.setInherited(false);
  1834. m.addEnum("first-starting-within-page", getEnumProperty(EN_FSWP, "FSWP"));
  1835. m.addEnum("first-including-carryover", getEnumProperty(EN_FIC, "FIC"));
  1836. m.addEnum("last-starting-within-page", getEnumProperty(EN_LSWP, "LSWP"));
  1837. m.addEnum("last-ending-within-page", getEnumProperty(EN_LEWP, "LEWP"));
  1838. m.setDefault("first-starting-within-page");
  1839. addPropertyMaker("retrieve-position", m);
  1840. // retrieve-boundary
  1841. m = new EnumProperty.Maker(PR_RETRIEVE_BOUNDARY);
  1842. m.setInherited(false);
  1843. m.addEnum("page", getEnumProperty(EN_PAGE, "PAGE"));
  1844. m.addEnum("page-sequence", getEnumProperty(EN_PAGE_SEQUENCE, "PAGE_SEQUENCE"));
  1845. m.addEnum("document", getEnumProperty(EN_DOCUMENT, "DOCUMENT"));
  1846. m.setDefault("page-sequence");
  1847. addPropertyMaker("retrieve-boundary", m);
  1848. }
  1849. private void createNumberToStringProperties() {
  1850. PropertyMaker m;
  1851. // format
  1852. m = new StringProperty.Maker(PR_FORMAT);
  1853. m.setInherited(false);
  1854. m.setDefault("1");
  1855. addPropertyMaker("format", m);
  1856. // grouping-separator
  1857. m = new CharacterProperty.Maker(PR_GROUPING_SEPARATOR);
  1858. m.setInherited(false);
  1859. m.setDefault("none");
  1860. addPropertyMaker("grouping-separator", m);
  1861. // grouping-size
  1862. m = new NumberProperty.Maker(PR_GROUPING_SIZE);
  1863. m.setInherited(false);
  1864. m.setDefault("0");
  1865. addPropertyMaker("grouping-size", m);
  1866. // letter-value
  1867. m = new EnumProperty.Maker(PR_LETTER_VALUE);
  1868. m.setInherited(false);
  1869. m.addEnum("alphabetic", getEnumProperty(EN_ALPHABETIC, "ALPHABETIC"));
  1870. m.addEnum("traditional", getEnumProperty(EN_TRADITIONAL, "TRADITIONAL"));
  1871. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1872. m.setDefault("auto");
  1873. addPropertyMaker("letter-value", m);
  1874. }
  1875. private void createPaginationAndLayoutProperties() {
  1876. PropertyMaker m;
  1877. LengthProperty.Maker l;
  1878. // blank-or-not-blank
  1879. m = new EnumProperty.Maker(PR_BLANK_OR_NOT_BLANK);
  1880. m.setInherited(false);
  1881. m.addEnum("blank", getEnumProperty(EN_BLANK, "BLANK"));
  1882. m.addEnum("not-blank", getEnumProperty(EN_NOT_BLANK, "NOT_BLANK"));
  1883. m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
  1884. m.setDefault("any");
  1885. addPropertyMaker("blank-or-not-blank", m);
  1886. // column-count
  1887. m = new NumberProperty.Maker(PR_COLUMN_COUNT);
  1888. m.setInherited(false);
  1889. m.setDefault("1");
  1890. addPropertyMaker("column-count", m);
  1891. // column-gap
  1892. l = new LengthProperty.Maker(PR_COLUMN_GAP);
  1893. l.setInherited(false);
  1894. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1895. l.setDefault("0.25in");
  1896. addPropertyMaker("column-gap", l);
  1897. // extent
  1898. m = new LengthProperty.Maker(PR_EXTENT);
  1899. m.setInherited(true);
  1900. m.setDefault("0pt");
  1901. m.setPercentBase(LengthBase.CUSTOM_BASE);
  1902. addPropertyMaker("extent", m);
  1903. // flow-name
  1904. m = new StringProperty.Maker(PR_FLOW_NAME);
  1905. m.setInherited(false);
  1906. m.setDefault("");
  1907. addPropertyMaker("flow-name", m);
  1908. // force-page-count
  1909. m = new EnumProperty.Maker(PR_FORCE_PAGE_COUNT);
  1910. m.setInherited(false);
  1911. m.addEnum("even", getEnumProperty(EN_EVEN, "EVEN"));
  1912. m.addEnum("odd", getEnumProperty(EN_ODD, "ODD"));
  1913. m.addEnum("end-on-even", getEnumProperty(EN_END_ON_EVEN, "END_ON_EVEN"));
  1914. m.addEnum("end-on-odd", getEnumProperty(EN_END_ON_ODD, "END_ON_ODD"));
  1915. m.addEnum("no-force", getEnumProperty(EN_NO_FORCE, "NO_FORCE"));
  1916. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1917. m.setDefault("auto");
  1918. addPropertyMaker("force-page-count", m);
  1919. // initial-page-number
  1920. m = new NumberProperty.Maker(PR_INITIAL_PAGE_NUMBER);
  1921. m.setInherited(false);
  1922. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1923. m.addEnum("auto-odd", getEnumProperty(EN_AUTO_ODD, "AUTO_ODD"));
  1924. m.addEnum("auto-even", getEnumProperty(EN_AUTO_EVEN, "AUTO_EVEN"));
  1925. m.setDefault("auto");
  1926. addPropertyMaker("initial-page-number", m);
  1927. // master-name
  1928. m = new StringProperty.Maker(PR_MASTER_NAME);
  1929. m.setInherited(false);
  1930. m.setDefault("");
  1931. addPropertyMaker("master-name", m);
  1932. // master-reference
  1933. m = new StringProperty.Maker(PR_MASTER_REFERENCE);
  1934. m.setInherited(false);
  1935. m.setDefault("");
  1936. addPropertyMaker("master-reference", m);
  1937. // maximum-repeats
  1938. m = new NumberProperty.Maker(PR_MAXIMUM_REPEATS);
  1939. m.setInherited(false);
  1940. m.addEnum("no-limit", getEnumProperty(EN_NO_LIMIT, "NO_LIMIT"));
  1941. m.setDefault("no-limit");
  1942. addPropertyMaker("maximum-repeats", m);
  1943. // media-usage
  1944. m = new EnumProperty.Maker(PR_MEDIA_USAGE);
  1945. m.setInherited(false);
  1946. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1947. m.addEnum("paginate", getEnumProperty(EN_PAGINATE, "PAGINATE"));
  1948. m.addEnum("bounded-in-one-dimension", getEnumProperty(EN_BOUNDED_IN_ONE_DIMENSION, "BOUNDED_IN_ONE_DIMENSION"));
  1949. m.addEnum("unbounded", getEnumProperty(EN_UNBOUNDED, "UNBOUNDED"));
  1950. m.setDefault("auto");
  1951. addPropertyMaker("media-usage", m);
  1952. // odd-or-even
  1953. m = new EnumProperty.Maker(PR_ODD_OR_EVEN);
  1954. m.setInherited(false);
  1955. m.addEnum("odd", getEnumProperty(EN_ODD, "ODD"));
  1956. m.addEnum("even", getEnumProperty(EN_EVEN, "EVEN"));
  1957. m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
  1958. m.setDefault("any");
  1959. addPropertyMaker("odd-or-even", m);
  1960. // page-height
  1961. l = new PageDimensionMaker(PR_PAGE_HEIGHT);
  1962. l.setInherited(false);
  1963. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1964. l.addEnum("indefinite", getEnumProperty(EN_INDEFINITE, "INDEFINITE"));
  1965. l.setDefault("auto");
  1966. addPropertyMaker("page-height", l);
  1967. // page-position
  1968. m = new EnumProperty.Maker(PR_PAGE_POSITION);
  1969. m.setInherited(false);
  1970. m.addEnum("first", getEnumProperty(EN_FIRST, "FIRST"));
  1971. m.addEnum("last", getEnumProperty(EN_LAST, "LAST"));
  1972. m.addEnum("rest", getEnumProperty(EN_REST, "REST"));
  1973. m.addEnum("any", getEnumProperty(EN_ANY, "ANY"));
  1974. m.addEnum("only", getEnumProperty(EN_ONLY, "ONLY")); //XSL 1.1
  1975. m.setDefault("any");
  1976. addPropertyMaker("page-position", m);
  1977. // page-width
  1978. l = new PageDimensionMaker(PR_PAGE_WIDTH);
  1979. l.setInherited(false);
  1980. l.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  1981. l.addEnum("indefinite", getEnumProperty(EN_INDEFINITE, "INDEFINITE"));
  1982. l.setDefault("auto");
  1983. addPropertyMaker("page-width", l);
  1984. // precedence
  1985. m = new EnumProperty.Maker(PR_PRECEDENCE);
  1986. m.useGeneric(genericBoolean);
  1987. m.setInherited(false);
  1988. m.setDefault("false");
  1989. addPropertyMaker("precedence", m);
  1990. // region-name
  1991. m = new StringProperty.Maker(PR_REGION_NAME);
  1992. m.setInherited(false);
  1993. m.setDefault("");
  1994. addPropertyMaker("region-name", m);
  1995. }
  1996. private void createTableProperties() {
  1997. PropertyMaker m;
  1998. PropertyMaker sub;
  1999. // border-after-precedence
  2000. m = new TableBorderPrecedence(PR_BORDER_AFTER_PRECEDENCE);
  2001. m.setInherited(false);
  2002. m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
  2003. addPropertyMaker("border-after-precedence", m);
  2004. // border-before-precedence
  2005. m = new TableBorderPrecedence(PR_BORDER_BEFORE_PRECEDENCE);
  2006. m.setInherited(false);
  2007. m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
  2008. addPropertyMaker("border-before-precedence", m);
  2009. // border-collapse
  2010. m = new EnumProperty.Maker(PR_BORDER_COLLAPSE);
  2011. m.setInherited(true);
  2012. m.setDefault("collapse");
  2013. m.addEnum("separate", getEnumProperty(EN_SEPARATE, "SEPARATE"));
  2014. m.addEnum("collapse-with-precedence", getEnumProperty(
  2015. EN_COLLAPSE_WITH_PRECEDENCE, "COLLAPSE_WITH_PRECEDENCE"));
  2016. m.addEnum("collapse", getEnumProperty(EN_COLLAPSE, "COLLAPSE"));
  2017. addPropertyMaker("border-collapse", m);
  2018. // border-end-precedence
  2019. m = new TableBorderPrecedence(PR_BORDER_END_PRECEDENCE);
  2020. m.setInherited(false);
  2021. m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
  2022. addPropertyMaker("border-end-precedence", m);
  2023. // border-separation
  2024. m = new LengthPairProperty.Maker(PR_BORDER_SEPARATION);
  2025. m.setInherited(true);
  2026. m.addShorthand(s_generics[PR_BORDER_SPACING]);
  2027. sub = new LengthProperty.Maker(CP_BLOCK_PROGRESSION_DIRECTION);
  2028. sub.setDefault("0pt");
  2029. sub.setByShorthand(true);
  2030. m.addSubpropMaker(sub);
  2031. sub = new LengthProperty.Maker(CP_INLINE_PROGRESSION_DIRECTION);
  2032. sub.setDefault("0pt");
  2033. sub.setByShorthand(true);
  2034. m.addSubpropMaker(sub);
  2035. addPropertyMaker("border-separation", m);
  2036. // border-start-precedence
  2037. m = new TableBorderPrecedence(PR_BORDER_START_PRECEDENCE);
  2038. m.setInherited(false);
  2039. m.addEnum("force", getEnumProperty(EN_FORCE, "FORCE"));
  2040. addPropertyMaker("border-start-precedence", m);
  2041. // caption-side
  2042. m = new EnumProperty.Maker(PR_CAPTION_SIDE);
  2043. m.setInherited(true);
  2044. m.addEnum("before", getEnumProperty(EN_BEFORE, "BEFORE"));
  2045. m.addEnum("after", getEnumProperty(EN_AFTER, "AFTER"));
  2046. m.addEnum("start", getEnumProperty(EN_START, "START"));
  2047. m.addEnum("end", getEnumProperty(EN_END, "END"));
  2048. m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
  2049. m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
  2050. m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
  2051. m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
  2052. m.setDefault("before");
  2053. addPropertyMaker("caption-side", m);
  2054. // column-number
  2055. m = new ColumnNumberPropertyMaker(PR_COLUMN_NUMBER);
  2056. m.setInherited(false);
  2057. addPropertyMaker("column-number", m);
  2058. // column-width
  2059. m = new LengthProperty.Maker(PR_COLUMN_WIDTH);
  2060. m.setInherited(false);
  2061. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2062. m.setDefault("auto");
  2063. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  2064. addPropertyMaker("column-width", m);
  2065. // empty-cells
  2066. m = new EnumProperty.Maker(PR_EMPTY_CELLS);
  2067. m.setInherited(true);
  2068. m.addEnum("show", getEnumProperty(EN_SHOW, "SHOW"));
  2069. m.addEnum("hide", getEnumProperty(EN_HIDE, "HIDE"));
  2070. m.setDefault("show");
  2071. addPropertyMaker("empty-cells", m);
  2072. // ends-row
  2073. m = new EnumProperty.Maker(PR_ENDS_ROW);
  2074. m.setInherited(false);
  2075. m.useGeneric(genericBoolean);
  2076. m.setDefault("false");
  2077. addPropertyMaker("ends-row", m);
  2078. // number-columns-repeated
  2079. m = new NumberProperty.Maker(PR_NUMBER_COLUMNS_REPEATED);
  2080. m.setInherited(false);
  2081. m.setDefault("1");
  2082. addPropertyMaker("number-columns-repeated", m);
  2083. // number-columns-spanned
  2084. m = new NumberProperty.Maker(PR_NUMBER_COLUMNS_SPANNED);
  2085. m.setInherited(false);
  2086. m.setDefault("1");
  2087. addPropertyMaker("number-columns-spanned", m);
  2088. // number-rows-spanned
  2089. m = new NumberProperty.Maker(PR_NUMBER_ROWS_SPANNED);
  2090. m.setInherited(false);
  2091. m.setDefault("1");
  2092. addPropertyMaker("number-rows-spanned", m);
  2093. // starts-row
  2094. m = new EnumProperty.Maker(PR_STARTS_ROW);
  2095. m.useGeneric(genericBoolean);
  2096. m.setInherited(false);
  2097. m.setDefault("false");
  2098. addPropertyMaker("starts-row", m);
  2099. // table-layout
  2100. m = new EnumProperty.Maker(PR_TABLE_LAYOUT);
  2101. m.setInherited(false);
  2102. m.setDefault("auto");
  2103. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2104. m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
  2105. addPropertyMaker("table-layout", m);
  2106. // table-omit-footer-at-break
  2107. m = new EnumProperty.Maker(PR_TABLE_OMIT_FOOTER_AT_BREAK);
  2108. m.useGeneric(genericBoolean);
  2109. m.setInherited(false);
  2110. m.setDefault("false");
  2111. addPropertyMaker("table-omit-footer-at-break", m);
  2112. // table-omit-header-at-break
  2113. m = new EnumProperty.Maker(PR_TABLE_OMIT_HEADER_AT_BREAK);
  2114. m.useGeneric(genericBoolean);
  2115. m.setInherited(false);
  2116. m.setDefault("false");
  2117. addPropertyMaker("table-omit-header-at-break", m);
  2118. }
  2119. private void createWritingModeProperties() {
  2120. PropertyMaker m;
  2121. // direction
  2122. m = new EnumProperty.Maker(PR_DIRECTION);
  2123. m.setInherited(true);
  2124. m.addEnum("ltr", getEnumProperty(EN_LTR, "LTR"));
  2125. m.addEnum("rtl", getEnumProperty(EN_RTL, "RTL"));
  2126. m.setDefault("ltr");
  2127. addPropertyMaker("direction", m);
  2128. // glyph-orientation-horizontal
  2129. m = new ToBeImplementedProperty.Maker(PR_GLYPH_ORIENTATION_HORIZONTAL);
  2130. m.setInherited(true);
  2131. m.setDefault("0deg");
  2132. addPropertyMaker("glyph-orientation-horizontal", m);
  2133. // glyph-orientation-vertical
  2134. m = new ToBeImplementedProperty.Maker(PR_GLYPH_ORIENTATION_VERTICAL);
  2135. m.setInherited(true);
  2136. m.setDefault("auto");
  2137. addPropertyMaker("glyph-orientation-vertical", m);
  2138. // text-altitude
  2139. m = new LengthProperty.Maker(PR_TEXT_ALTITUDE);
  2140. m.setInherited(false);
  2141. m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
  2142. m.setDefault("use-font-metrics");
  2143. m.setPercentBase(LengthBase.FONTSIZE);
  2144. addPropertyMaker("text-altitude", m);
  2145. // text-depth
  2146. m = new LengthProperty.Maker(PR_TEXT_DEPTH);
  2147. m.setInherited(false);
  2148. m.addEnum("use-font-metrics", getEnumProperty(EN_USE_FONT_METRICS, "USE_FONT_METRICS"));
  2149. m.setDefault("use-font-metrics");
  2150. m.setPercentBase(LengthBase.FONTSIZE);
  2151. addPropertyMaker("text-depth", m);
  2152. // unicode-bidi
  2153. m = new EnumProperty.Maker(PR_UNICODE_BIDI);
  2154. m.setInherited(false);
  2155. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  2156. m.addEnum("embed", getEnumProperty(EN_EMBED, "EMBED"));
  2157. m.addEnum("bidi-override", getEnumProperty(EN_BIDI_OVERRIDE, "BIDI_OVERRIDE"));
  2158. m.setDefault("normal");
  2159. addPropertyMaker("unicode-bidi", m);
  2160. // writing-mode
  2161. m = new EnumProperty.Maker(PR_WRITING_MODE);
  2162. m.setInherited(true);
  2163. m.setDefault("lr-tb");
  2164. m.addEnum("lr-tb", getEnumProperty(EN_LR_TB, "LR_TB"));
  2165. m.addEnum("rl-tb", getEnumProperty(EN_RL_TB, "RL_TB"));
  2166. m.addEnum("tb-rl", getEnumProperty(EN_TB_RL, "TB_RL"));
  2167. m.addKeyword("lr", "lr-tb");
  2168. m.addKeyword("rl", "rl-tb");
  2169. m.addKeyword("tb", "tb-rl");
  2170. addPropertyMaker("writing-mode", m);
  2171. }
  2172. private void createMiscProperties() {
  2173. PropertyMaker m;
  2174. // content-type
  2175. m = new StringProperty.Maker(PR_CONTENT_TYPE);
  2176. m.setInherited(false);
  2177. m.setDefault("auto");
  2178. addPropertyMaker("content-type", m);
  2179. // id
  2180. m = new StringProperty.Maker(PR_ID);
  2181. m.setInherited(false);
  2182. m.setDefault("");
  2183. addPropertyMaker("id", m);
  2184. // provisional-label-separation
  2185. m = new LengthProperty.Maker(PR_PROVISIONAL_LABEL_SEPARATION);
  2186. m.setInherited(true);
  2187. m.setDefault("6pt");
  2188. addPropertyMaker("provisional-label-separation", m);
  2189. // provisional-distance-between-starts
  2190. m = new LengthProperty.Maker(PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS);
  2191. m.setInherited(true);
  2192. m.setDefault("24pt");
  2193. addPropertyMaker("provisional-distance-between-starts", m);
  2194. // ref-id
  2195. m = new StringProperty.Maker(PR_REF_ID);
  2196. m.setInherited(false);
  2197. m.setDefault("");
  2198. addPropertyMaker("ref-id", m);
  2199. // score-spaces
  2200. m = new EnumProperty.Maker(PR_SCORE_SPACES);
  2201. m.useGeneric(genericBoolean);
  2202. m.setInherited(true);
  2203. m.setDefault("true");
  2204. addPropertyMaker("score-spaces", m);
  2205. // src
  2206. m = new StringProperty.Maker(PR_SRC);
  2207. m.setInherited(false);
  2208. m.setDefault("");
  2209. addPropertyMaker("src", m);
  2210. // visibility
  2211. m = new EnumProperty.Maker(PR_VISIBILITY);
  2212. m.setInherited(false);
  2213. m.addEnum("visible", getEnumProperty(EN_VISIBLE, "VISIBLE"));
  2214. m.addEnum("hidden", getEnumProperty(EN_HIDDEN, "HIDDEN"));
  2215. m.addEnum("collapse", getEnumProperty(EN_COLLAPSE, "COLLAPSE"));
  2216. m.setDefault("visible");
  2217. addPropertyMaker("visibility", m);
  2218. // z-index
  2219. m = new NumberProperty.Maker(PR_Z_INDEX);
  2220. m.setInherited(false);
  2221. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2222. m.setDefault("auto");
  2223. addPropertyMaker("z-index", m);
  2224. }
  2225. private void createShorthandProperties() {
  2226. PropertyMaker m;
  2227. // background
  2228. m = new ToBeImplementedProperty.Maker(PR_BACKGROUND);
  2229. m.setInherited(false);
  2230. m.setDefault("none");
  2231. addPropertyMaker("background", m);
  2232. // background-position
  2233. m = new ListProperty.Maker(PR_BACKGROUND_POSITION);
  2234. m.setInherited(false);
  2235. m.addKeyword("left", "0% 50%");
  2236. m.addKeyword("right", "100% 50%");
  2237. m.addKeyword("center", "50% 50%");
  2238. m.addKeyword("top", "50% 0%");
  2239. m.addKeyword("bottom", "50% 100%");
  2240. m.setDefault("0% 0%");
  2241. m.setDatatypeParser(new BackgroundPositionShorthandParser());
  2242. addPropertyMaker("background-position", m);
  2243. // border
  2244. m = new ListProperty.Maker(PR_BORDER);
  2245. m.setInherited(false);
  2246. m.setDefault("");
  2247. m.setDatatypeParser(new GenericShorthandParser());
  2248. addPropertyMaker("border", m);
  2249. // border-bottom
  2250. m = new ListProperty.Maker(PR_BORDER_BOTTOM);
  2251. m.setInherited(false);
  2252. m.setDefault("");
  2253. m.setDatatypeParser(new GenericShorthandParser());
  2254. addPropertyMaker("border-bottom", m);
  2255. // border-color
  2256. m = new ListProperty.Maker(PR_BORDER_COLOR);
  2257. m.setInherited(false);
  2258. m.setDefault("");
  2259. m.setDatatypeParser(new BoxPropShorthandParser());
  2260. addPropertyMaker("border-color", m);
  2261. // border-left
  2262. m = new ListProperty.Maker(PR_BORDER_LEFT);
  2263. m.setInherited(false);
  2264. m.setDefault("");
  2265. m.setDatatypeParser(new GenericShorthandParser());
  2266. addPropertyMaker("border-left", m);
  2267. // border-right
  2268. m = new ListProperty.Maker(PR_BORDER_RIGHT);
  2269. m.setInherited(false);
  2270. m.setDefault("");
  2271. m.setDatatypeParser(new GenericShorthandParser());
  2272. addPropertyMaker("border-right", m);
  2273. // border-style
  2274. m = new ListProperty.Maker(PR_BORDER_STYLE);
  2275. m.setInherited(false);
  2276. m.setDefault("");
  2277. m.setDatatypeParser(new BoxPropShorthandParser());
  2278. addPropertyMaker("border-style", m);
  2279. // border-spacing
  2280. m = new ListProperty.Maker(PR_BORDER_SPACING);
  2281. m.setInherited(true);
  2282. m.setDefault("0pt");
  2283. m.setDatatypeParser(new BorderSpacingShorthandParser());
  2284. addPropertyMaker("border-spacing", m);
  2285. // border-top
  2286. m = new ListProperty.Maker(PR_BORDER_TOP);
  2287. m.setInherited(false);
  2288. m.setDefault("");
  2289. m.setDatatypeParser(new GenericShorthandParser());
  2290. addPropertyMaker("border-top", m);
  2291. // border-width
  2292. m = new ListProperty.Maker(PR_BORDER_WIDTH);
  2293. m.setInherited(false);
  2294. m.setDefault("");
  2295. m.setDatatypeParser(new BoxPropShorthandParser());
  2296. addPropertyMaker("border-width", m);
  2297. // cue
  2298. m = new ToBeImplementedProperty.Maker(PR_CUE);
  2299. m.setInherited(false);
  2300. m.setDefault("");
  2301. addPropertyMaker("cue", m);
  2302. // font
  2303. m = new FontShorthandProperty.Maker(PR_FONT);
  2304. m.setInherited(true);
  2305. m.addEnum("caption", getEnumProperty(EN_CAPTION, "CAPTION"));
  2306. m.addEnum("icon", getEnumProperty(EN_ICON, "ICON"));
  2307. m.addEnum("message-box", getEnumProperty(EN_MESSAGE_BOX, "MESSAGE_BOX"));
  2308. m.addEnum("menu", getEnumProperty(EN_MENU, "MENU"));
  2309. m.addEnum("small-caption", getEnumProperty(EN_SMALL_CAPTION, "SMALL_CAPTION"));
  2310. m.addEnum("status-bar", getEnumProperty(EN_STATUS_BAR, "STATUS_BAR"));
  2311. m.setDefault("");
  2312. m.setDatatypeParser(new FontShorthandParser());
  2313. addPropertyMaker("font", m);
  2314. // margin
  2315. m = new ListProperty.Maker(PR_MARGIN);
  2316. m.setInherited(false);
  2317. m.setDefault("");
  2318. m.setDatatypeParser(new BoxPropShorthandParser());
  2319. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  2320. addPropertyMaker("margin", m);
  2321. // padding
  2322. m = new ListProperty.Maker(PR_PADDING);
  2323. m.setInherited(false);
  2324. m.setDatatypeParser(new BoxPropShorthandParser());
  2325. m.setPercentBase(LengthBase.CONTAINING_BLOCK_WIDTH);
  2326. addPropertyMaker("padding", m);
  2327. // page-break-after
  2328. m = new EnumProperty.Maker(PR_PAGE_BREAK_AFTER);
  2329. m.setInherited(false);
  2330. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2331. m.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
  2332. m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
  2333. m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
  2334. m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
  2335. m.setDefault("auto");
  2336. m.setDatatypeParser(new PageBreakShorthandParser());
  2337. addPropertyMaker("page-break-after", m);
  2338. // page-break-before
  2339. m = new EnumProperty.Maker(PR_PAGE_BREAK_BEFORE);
  2340. m.setInherited(false);
  2341. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2342. m.addEnum("always", getEnumProperty(EN_ALWAYS, "ALWAYS"));
  2343. m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
  2344. m.addEnum("left", getEnumProperty(EN_LEFT, "LEFT"));
  2345. m.addEnum("right", getEnumProperty(EN_RIGHT, "RIGHT"));
  2346. m.setDefault("auto");
  2347. m.setDatatypeParser(new PageBreakShorthandParser());
  2348. addPropertyMaker("page-break-before", m);
  2349. // page-break-inside
  2350. m = new EnumProperty.Maker(PR_PAGE_BREAK_INSIDE);
  2351. m.setInherited(true);
  2352. m.addEnum("auto", getEnumProperty(EN_AUTO, "AUTO"));
  2353. m.addEnum("avoid", getEnumProperty(EN_AVOID, "AVOID"));
  2354. m.setDefault("auto");
  2355. m.setDatatypeParser(new PageBreakShorthandParser());
  2356. addPropertyMaker("page-break-inside", m);
  2357. // pause
  2358. m = new ToBeImplementedProperty.Maker(PR_PAUSE);
  2359. m.setInherited(false);
  2360. m.setDefault("");
  2361. addPropertyMaker("pause", m);
  2362. // position
  2363. m = new EnumProperty.Maker(PR_POSITION);
  2364. m.setInherited(false);
  2365. m.addEnum("static", getEnumProperty(EN_STATIC, "STATIC"));
  2366. m.addEnum("relative", getEnumProperty(EN_RELATIVE, "RELATIVE"));
  2367. m.addEnum("absolute", getEnumProperty(EN_ABSOLUTE, "ABSOLUTE"));
  2368. m.addEnum("fixed", getEnumProperty(EN_FIXED, "FIXED"));
  2369. m.setDefault("static");
  2370. m.setDatatypeParser(new PositionShorthandParser());
  2371. addPropertyMaker("position", m);
  2372. // size
  2373. m = new ToBeImplementedProperty.Maker(PR_SIZE);
  2374. m.setInherited(false);
  2375. m.setDefault("auto");
  2376. addPropertyMaker("size", m);
  2377. // vertical-align
  2378. m = new LengthProperty.Maker(PR_VERTICAL_ALIGN);
  2379. m.setInherited(false);
  2380. m.addEnum("baseline", getEnumProperty(EN_BASELINE, "BASELINE"));
  2381. m.addEnum("middle", getEnumProperty(EN_MIDDLE, "MIDDLE"));
  2382. m.addEnum("sub", getEnumProperty(EN_SUB, "SUB"));
  2383. m.addEnum("super", getEnumProperty(EN_SUPER, "SUPER"));
  2384. m.addEnum("text-top", getEnumProperty(EN_TEXT_TOP, "TEXT_TOP"));
  2385. m.addEnum("text-bottom", getEnumProperty(EN_TEXT_BOTTOM, "TEXT_BOTTOM"));
  2386. m.addEnum("top", getEnumProperty(EN_TOP, "TOP"));
  2387. m.addEnum("bottom", getEnumProperty(EN_BOTTOM, "BOTTOM"));
  2388. m.setDatatypeParser(new VerticalAlignShorthandParser());
  2389. m.setDefault("baseline");
  2390. m.setPercentBase(LengthBase.ALIGNMENT_ADJUST);
  2391. addPropertyMaker("vertical-align", m);
  2392. // white-space
  2393. m = new EnumProperty.Maker(PR_WHITE_SPACE);
  2394. m.setInherited(true);
  2395. m.addEnum("normal", getEnumProperty(EN_NORMAL, "NORMAL"));
  2396. m.addEnum("pre", getEnumProperty(EN_PRE, "PRE"));
  2397. m.addEnum("nowrap", getEnumProperty(EN_NO_WRAP, "NO_WRAP"));
  2398. m.setDefault("normal");
  2399. m.setDatatypeParser(new WhiteSpaceShorthandParser());
  2400. addPropertyMaker("white-space", m);
  2401. // xml:lang
  2402. m = new ToBeImplementedProperty.Maker(PR_XML_LANG);
  2403. m.setInherited(true);
  2404. m.setDefault("");
  2405. addPropertyMaker("xml:lang", m);
  2406. }
  2407. }