CSS-Flip

 view release on metacpan or  search on metacpan

lib/CSS/Janus.pm  view on Meta::CPAN


    $line =~ s{$LTR_IN_URL_RE}{~TMP~}g;
    $line =~ s{$RTL_IN_URL_RE}{ltr}g;
    $line =~ s{~TMP~}{rtl}g;

    return $line;
}

# fixCursorProperties ($line)
#
# Changes directional CSS cursor properties:
# 'cursor: ne-resize' => 'cursor: nw-resize'

sub fixCursorProperties {
    my $self = shift;
    my $line = shift;

    $line =~ s{$CURSOR_EAST_RE}{$1~TMP~}g;
    $line =~ s{$CURSOR_WEST_RE}{$1e-resize}g;
    $line =~ s{~TMP~}{w-resize}g;

    return $line;

t/16Cursor.t  view on Meta::CPAN

use strict;
#use warnings;
use Test::More tests => 6;

use CSS::Janus;

my $self = CSS::Janus->new;
my $testcase;
my $shouldbe;

$testcase = 'cursor: e-resize';
$shouldbe = 'cursor: w-resize';
is($self->transform($testcase), $shouldbe);

$testcase = 'cursor: w-resize';
$shouldbe = 'cursor: e-resize';
is($self->transform($testcase), $shouldbe);

$testcase = 'cursor: se-resize';
$shouldbe = 'cursor: sw-resize';
is($self->transform($testcase), $shouldbe);

$testcase = 'cursor: sw-resize';
$shouldbe = 'cursor: se-resize';
is($self->transform($testcase), $shouldbe);

$testcase = 'cursor: ne-resize';
$shouldbe = 'cursor: nw-resize';
is($self->transform($testcase), $shouldbe);

$testcase = 'cursor: nw-resize';
$shouldbe = 'cursor: ne-resize';
is($self->transform($testcase), $shouldbe);



( run in 0.241 second using v1.01-cache-2.11-cpan-4d50c553e7e )