/[suikacvs]/markup/html/whatpm/Whatpm/HTML.pm.src
Suika

Diff of /markup/html/whatpm/Whatpm/HTML.pm.src

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.58 by wakaba, Tue Sep 4 11:19:07 2007 UTC revision 1.61 by wakaba, Sun Nov 4 04:15:06 2007 UTC
# Line 147  sub new ($) { Line 147  sub new ($) {
147    $self->{parse_error} = sub {    $self->{parse_error} = sub {
148      #      #
149    };    };
150      $self->{application_cache_selection} = sub {
151        #
152      };
153    return $self;    return $self;
154  } # new  } # new
155    
# Line 263  sub _initialize_tokenizer ($) { Line 266  sub _initialize_tokenizer ($) {
266  ## has completed loading.  If one has, then it MUST be executed  ## has completed loading.  If one has, then it MUST be executed
267  ## and removed from the list.  ## and removed from the list.
268    
269    ## NOTE: HTML5 "Writing HTML documents" section, applied to
270    ## documents and not to user agents and conformance checkers,
271    ## contains some requirements that are not detected by the
272    ## parsing algorithm:
273    ## - Some requirements on character encoding declarations. ## TODO
274    ## - "Elements MUST NOT contain content that their content model disallows."
275    ##   ... Some are parse error, some are not (will be reported by c.c.).
276    ## - Polytheistic slash SHOULD NOT be used. (Applied only to atheists.) ## TODO
277    ## - Text (in elements, attributes, and comments) SHOULD NOT contain
278    ##   control characters other than space characters. ## TODO: (what is control character? C0, C1 and DEL?  Unicode control character?)
279    
280    ## TODO: HTML5 poses authors two SHOULD-level requirements that cannot
281    ## be detected by the HTML5 parsing algorithm:
282    ## - Text,
283    
284  sub _get_next_token ($) {  sub _get_next_token ($) {
285    my $self = shift;    my $self = shift;
286    if (@{$self->{token}}) {    if (@{$self->{token}}) {
# Line 2080  sub _tree_construction_root_element ($) Line 2098  sub _tree_construction_root_element ($)
2098              redo B;              redo B;
2099            }            }
2100          }          }
2101    
2102            $self->{application_cache_selection}->(undef);
2103    
2104            #
2105          } elsif ($token->{type} == START_TAG_TOKEN) {
2106            if ($token->{tag_name} eq 'html' and
2107                $token->{attributes}->{manifest}) { ## ISSUE: Spec spells as "application"
2108              $self->{application_cache_selection}
2109                   ->($token->{attributes}->{manifest}->{value});
2110              ## ISSUE: No relative reference resolution?
2111            } else {
2112              $self->{application_cache_selection}->(undef);
2113            }
2114    
2115            ## ISSUE: There is an issue in the spec
2116          #          #
2117        } elsif ({        } elsif ({
                 START_TAG_TOKEN, 1,  
2118                  END_TAG_TOKEN, 1,                  END_TAG_TOKEN, 1,
2119                  END_OF_FILE_TOKEN, 1,                  END_OF_FILE_TOKEN, 1,
2120                 }->{$token->{type}}) {                 }->{$token->{type}}) {
2121            $self->{application_cache_selection}->(undef);
2122    
2123          ## ISSUE: There is an issue in the spec          ## ISSUE: There is an issue in the spec
2124          #          #
2125        } else {        } else {
2126          die "$0: $token->{type}: Unknown token type";          die "$0: $token->{type}: Unknown token type";
2127        }        }
2128    
2129        my $root_element; !!!create-element ($root_element, 'html');        my $root_element; !!!create-element ($root_element, 'html');
2130        $self->{document}->append_child ($root_element);        $self->{document}->append_child ($root_element);
2131        push @{$self->{open_elements}}, [$root_element, 'html'];        push @{$self->{open_elements}}, [$root_element, 'html'];

Legend:
Removed from v.1.58  
changed lines
  Added in v.1.61

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24