You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FOPropertyMapping.java 124KB

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