| 13 |
|
|
| 14 |
my $out = $self->output; |
my $out = $self->output; |
| 15 |
|
|
| 16 |
|
$self->result->layer_uncertain ('charset'); |
| 17 |
|
|
| 18 |
$out->start_section (role => 'parse-errors'); |
$out->start_section (role => 'parse-errors'); |
| 19 |
$out->start_error_list (role => 'parse-errors'); |
$out->start_error_list (role => 'parse-errors'); |
| 20 |
|
$self->result->layer_applicable ('syntax'); |
| 21 |
|
|
| 22 |
my $input = $self->input; |
my $input = $self->input; |
| 23 |
my $result = $self->result; |
my $result = $self->result; |
| 31 |
} |
} |
| 32 |
$result->add_error (%opt, layer => 'syntax'); |
$result->add_error (%opt, layer => 'syntax'); |
| 33 |
}; |
}; |
| 34 |
$p->{href} = $input->{uri}; |
$p->{href} = $input->url; |
| 35 |
$p->{base_uri} = $input->{base_uri}; |
$p->{base_uri} = $input->{base_uri}; |
| 36 |
|
|
| 37 |
# if ($parse_mode eq 'q') { |
# if ($parse_mode eq 'q') { |
| 44 |
my $s = \$input->{s}; |
my $s = \$input->{s}; |
| 45 |
my $charset; |
my $charset; |
| 46 |
unless ($input->{is_char_string}) { |
unless ($input->{is_char_string}) { |
| 47 |
|
$self->result->layer_uncertain ('encode'); |
| 48 |
require Encode; |
require Encode; |
| 49 |
if (defined $input->{charset}) {## TODO: IANA->Perl |
if (defined $input->{charset}) {## TODO: IANA->Perl |
| 50 |
$charset = $input->{charset}; |
$charset = $input->{charset}; |
| 71 |
|
|
| 72 |
my $out = $self->output; |
my $out = $self->output; |
| 73 |
|
|
| 74 |
$out->start_section (role => 'reserialized'); |
$out->start_section (role => 'reformatted'); |
| 75 |
|
|
| 76 |
$out->start_code_block; |
$out->start_code_block; |
| 77 |
$out->text ($self->{structure}->css_text); |
$out->text ($self->{structure}->css_text); |
| 81 |
} # generate_structure_dump_section |
} # generate_structure_dump_section |
| 82 |
|
|
| 83 |
sub generate_structure_error_section ($) { |
sub generate_structure_error_section ($) { |
| 84 |
my $self = shift; |
## NOTE: The content of this method is commented out, since a CSSOM |
| 85 |
|
## tree would contain no error that affect conformance, AFAICT. |
| 86 |
my $out = $self->output; |
## The plan is that we could someday implement "semantic" checking for CSSOM |
| 87 |
|
## trees, like "this color and this background color is too resemble such that |
| 88 |
$out->start_section (role => 'structure-errors'); |
## a user might not be able to read the text". Such errors do not affect |
| 89 |
$out->start_error_list (role => 'structure-errors'); |
## conformance, in any way. |
| 90 |
|
# my $self = shift; |
| 91 |
$self->result->add_error (level => 'u', |
# |
| 92 |
layer => 'structure', |
# my $out = $self->output; |
| 93 |
input => $self->input, |
# |
| 94 |
type => 'CSSOM validation not supported'); |
# $out->start_section (role => 'structure-errors'); |
| 95 |
|
# $out->start_error_list (role => 'structure-errors'); |
| 96 |
$out->end_error_list (role => 'structure-errors'); |
# $self->result->layer_applicable ('structure'); |
| 97 |
$out->end_section; |
# |
| 98 |
|
# $self->result->add_error (level => 'u', |
| 99 |
|
# layer => 'structure', |
| 100 |
|
# input => $self->input, |
| 101 |
|
# type => 'CSSOM validation not supported'); |
| 102 |
|
# |
| 103 |
|
# $out->end_error_list (role => 'structure-errors'); |
| 104 |
|
# $out->end_section; |
| 105 |
} # generate_structure_error_section |
} # generate_structure_error_section |
| 106 |
|
|
| 107 |
sub get_css_parser () { |
sub get_css_parser () { |