line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Tested::JavaScript::Test::RichEdit; |
2
|
1
|
|
|
1
|
|
3998
|
use base 'HTML::Tested::Test::Value', 'Exporter'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
1346
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our @EXPORT_OK = qw(HTRE_Get_Value HTRE_Set_Value HTRE_Get_Body HTRE_Clean); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub handle_sealed { |
7
|
|
|
|
|
|
|
my ($class, $e_root, $name, $e_val, $r_val, $err) = @_; |
8
|
|
|
|
|
|
|
return ($e_val, $r_val); |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub check_text { |
12
|
|
|
|
|
|
|
my ($class, $e_root, $name, $e_stash, $text) = @_; |
13
|
|
|
|
|
|
|
return ($class->SUPER::check_text($e_root, $name, $e_stash, $text) |
14
|
|
|
|
|
|
|
, $class->SUPER::check_text($e_root, $name . "_script" |
15
|
|
|
|
|
|
|
, $e_stash, $text)); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub HTRE_Get_Body { |
19
|
|
|
|
|
|
|
my ($mech, $name) = @_; |
20
|
|
|
|
|
|
|
return $mech->get_html_element_by_id($name, "IFrame") |
21
|
|
|
|
|
|
|
->GetContentDocument() |
22
|
|
|
|
|
|
|
->GetElementsByTagName("body")->Item(0) |
23
|
|
|
|
|
|
|
->QueryInterface(Mozilla::DOM::NSHTMLElement->GetIID); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub HTRE_Clean { |
27
|
|
|
|
|
|
|
my $v = shift; |
28
|
|
|
|
|
|
|
$v =~ s# xmlns="[^"]+"##g; |
29
|
|
|
|
|
|
|
$v =~ s# _moz[^ />]+##g; |
30
|
|
|
|
|
|
|
$v =~ s# type="_moz"##g; |
31
|
|
|
|
|
|
|
return $v; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub HTRE_Get_Value { HTRE_Clean(HTRE_Get_Body(@_)->GetInnerHTML); } |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub HTRE_Set_Value { |
37
|
|
|
|
|
|
|
my ($mech, $name, $val) = @_; |
38
|
|
|
|
|
|
|
HTRE_Get_Body($mech, $name)->SetInnerHTML($val); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |