Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

FOPropertyMapping.java 110KB

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