// declared multiple times with different properties. This is primarily
// done to avoid redundant ClassReferences when it can be determined at
// compile time that only the last occurrence of a selector with the
// same property will matter at runtime (because the last one wins).
// This helps keep SWF size down by avoiding linking in unused classes.
StyleDeclarationBlock block = existingDeclaration.getDeclarationBlock(selector, mediaList);
extractProperties(declaration, block.getProperties(), block.getEffectStyles());
// If the new declaration does not have a media list, we merge its
// properties into all other existing declaration blocks for this
// selector that have any of the same properties. This is necessary to
// ensure that later declaration blocks clobber all earlier declaration
// blocks.
if (mediaList == null)
{
Map<String, StyleProperty> properties = block.getProperties();
List<StyleDeclarationBlock> existingBlocks = existingDeclaration.getDeclarationBlocks();
for (StyleDeclarationBlock existingBlock : existingBlocks)
{
if (existingBlock != block)