Class BiDiFlipper

    • Field Detail

      • BORDER_RADIUS_PROPERTIES

        public static final com.google.common.collect.ImmutableSet<java.lang.String> BORDER_RADIUS_PROPERTIES
      • FOUR_PART_PROPERTIES_THAT_SHOULD_FLIP

        public static final com.google.common.collect.ImmutableSet<java.lang.String> FOUR_PART_PROPERTIES_THAT_SHOULD_FLIP
        Set of properties whose property values may flip if they match the four-part pattern.
    • Constructor Detail

      • BiDiFlipper

        public BiDiFlipper​(MutatingVisitController visitController,
                           boolean swapLtrRtlInUrl,
                           boolean swapLeftRightInUrl,
                           boolean shouldFlipConstantReferences)
      • BiDiFlipper

        public BiDiFlipper​(MutatingVisitController visitController,
                           boolean swapLtrRtlInUrl,
                           boolean swapLeftRightInUrl)
    • Method Detail

      • flipPercentageValue

        public static java.lang.String flipPercentageValue​(java.lang.String value)
        Returns a formatted string representing 100% - value. Neither the input nor the output contains a %.
      • flipLiteralValue

        public static java.lang.String flipLiteralValue​(java.lang.String value)
        Performs appropriate replacements needed for BiDi flipping a literal value.
      • flipNode

        protected <T extends CssValueNode> T flipNode​(T tNode)
        Returns flipped node after making appropriate replacements needed for BiDi flipping, if the node is either a LiteralNode or PropertyNode. Eg: PropertyNode 'padding-right' would become 'padding-left'.

        Subclasses can override to provide custom flipping behavior.