// TODO: Maybe we should be using the NoopPropertyClearer as the
// default rather than PropertyClearer? Need to think more about this.
// Initialise the style value handlers.
KeywordValueHandler textAlignKeywordHandler = new KeywordValueHandler(
TextAlignKeywordMapper.getSingleton());
horizontalAlignChecker = new TextAlignHandler(
textAlignKeywordHandler,
NoopPropertyUpdater.getDefaultInstance());
// NOTE: do not attempt to use the NoopPropertyClearer here without due
// thought. I tried it on the Orange OAT pagination.oml and the
// pagination buttons stopped rendering properly. The right side of
// the pagination is in a right aligned table cell (as shown below with
// [] meaning a table and | a cell separator)
// [ [ < | prev ] [ next | > ] ]
// stopped rendering properly, the sub table [ next | > ] was not right
// aligned in the parent table's td. This is because when you leave in
// the text-align: on the td, it apparently overrides the align= and
// has a slightly different meaning, whereby to get the "next >" right
// aligned you need to add width: 100% on the table that surrounds it.
// Not sure how we should address this in future, but we shouldn't be
// relying on such nastyness...
horizontalAlignHandler = new TextAlignHandler(
textAlignKeywordHandler,
PropertyExcluder.getDefaultInstance());
// Property handlers for vertical-align style property.
// We have two instances as handler checks device capabilities in order
// to decide if update property (if so valign attribute is later added):
// - First used for table cells and to open grid (table or div).
// In the later case we use only PropertyChecker interface so we
// don't need distinct instance.
// - Second used for table rows.
verticalAlignHandler = new DeviceAwareValueHandlerToPropertyAdapter(
supportsCSS,
protocolConfiguration.getDeviceCapabilityManager(),
"td",
StylePropertyDetails.VERTICAL_ALIGN,
"valign",
new KeywordValueHandler(
XHTMLBasicTableCellVerticalAlignKeywordMapper.getDefaultInstance()),
PropertyClearer.getDefaultInstance());
tableRowVerticalAlignHandler = new DeviceAwareValueHandlerToPropertyAdapter(
supportsCSS,
protocolConfiguration.getDeviceCapabilityManager(),
"tr",
StylePropertyDetails.VERTICAL_ALIGN,
"valign",
new KeywordValueHandler(
XHTMLBasicTableCellVerticalAlignKeywordMapper.getDefaultInstance()),
PropertyClearer.getDefaultInstance());
widthChecker = new ValueHandlerToPropertyAdapter(
StylePropertyDetails.WIDTH,