Package com.volantis.styling.compiler

Examples of com.volantis.styling.compiler.SpecificityCalculator


     * Test the specificity values returned from the
     * InlineStyleSpecificityCalculator always exceed a standard Specificity
     * Calculator
     */
    public void testInlineCalculatorExceedsStandardCalculator() {
        SpecificityCalculator standardCalculator =
                new SpecificityCalculatorImpl();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addAttributeSelector();
        standardCalculator.addAttributeSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addClassSelector();
        standardCalculator.addClassSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addElementSelector();
        standardCalculator.addElementSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addIDSelector();
        standardCalculator.addIDSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addPseudoClassSelector();
        standardCalculator.addPseudoClassSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.addPseudoElementSelector();
        standardCalculator.addPseudoElementSelector();

        checkCalculatorTakePresidence(standardCalculator);

        calculator.reset();
        standardCalculator.reset();

        checkCalculatorTakePresidence(standardCalculator);

    }
View Full Code Here


            throw new IllegalArgumentException("source cannot be null");
        }

        PseudoStyleEntities supportedPseudoEntities =
                configuration.getSupportedPseudoEntities();
        SpecificityCalculator specificityCalculator =
                configuration.getSpecificityCalculator();

        // Create an object to uniquely identify a style sheet.
        MatcherBuilderContext builderContext =
                new MatcherBuilderContextImpl(stateRegistry, listeners);
View Full Code Here

        });

        // =====================================================================
        //   Test Expectations
        // =====================================================================
        SpecificityCalculator specificityCalculator =
                new ZeroSpecificityCalculator(specificityCalculatorMock);

        Specificity before = specificityCalculator.getSpecificity();
        assertSame("Specificity", specificityMock, before);

        specificityCalculator.addAttributeSelector();
        specificityCalculator.addClassSelector();
        specificityCalculator.addElementSelector();
        specificityCalculator.addIDSelector();
        specificityCalculator.addPseudoClassSelector();
        specificityCalculator.addPseudoElementSelector();

        Specificity after = specificityCalculator.getSpecificity();

        assertEquals("Specificity", after, before);
    }
View Full Code Here

     * Initialise.
     */
    private LayoutStyleSheetCompilerFactory() {
        super(StyleSheetSource.LAYOUT, StylingFunctions.getResolver());

        SpecificityCalculator specificityCalculator =
                stylingFactory.createSpecificityCalculator();
        SpecificityCalculator zeroSpecificityCalculator =
                new ZeroSpecificityCalculator(specificityCalculator);
        configuration.setSpecificityCalculator(zeroSpecificityCalculator);
    }
View Full Code Here

TOP

Related Classes of com.volantis.styling.compiler.SpecificityCalculator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.