Skip to content

Commit

Permalink
small optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 9, 2012
1 parent 46f4243 commit 436b3fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions lib/Mojo/DOM/HTML.pm
Expand Up @@ -52,21 +52,19 @@ my %OPTIONAL = map { $_ => 1 }
qw/body colgroup dd head li optgroup option p rt rp tbody td tfoot th/;

# Elements that break HTML paragraphs
my @PARAGRAPH = (
my %PARAGRAPH = map { $_ => 1 } (
qw/address article aside blockquote dir div dl fieldset footer form h1 h2/,
qw/h3 h4 h5 h6 header hgroup hr menu nav ol p pre section table or ul/
);
my %PARAGRAPH = map { $_ => 1 } @PARAGRAPH;

# HTML table elements
my %TABLE = map { $_ => 1 } qw/col colgroup tbody td th thead tr/;

# HTML5 void elements
my @VOID = (
my %VOID = map { $_ => 1 } (
qw/area base br col command embed hr img input keygen link meta param/,
qw/source track wbr/
);
my %VOID = map { $_ => 1 } @VOID;

# HTML4/5 inline elements
my @HTML4_INLINE = qw/applet basefont big del font iframe ins s strike u/;
Expand Down Expand Up @@ -150,9 +148,8 @@ sub parse {
}
}
}
$self->tree($tree);

return $self;
return $self->tree($tree);
}

sub render {
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious.pm
Expand Up @@ -69,8 +69,8 @@ sub new {
my $r = $self->routes->namespace(ref $self);

# Hide controller attributes/methods and "handler"
$r->hide(qw/AUTOLOAD DESTROY app cookie finish flash handler on on_finish/);
$r->hide(qw/param redirect_to render render_content render_data/);
$r->hide(qw/AUTOLOAD DESTROY app cookie finish flash handler on param/);
$r->hide(qw/redirect_to render render_content render_data/);
$r->hide(qw/render_exception render_json render_not_found render_partial/);
$r->hide(qw/render_static render_text rendered req res respond_to send/);
$r->hide(qw/session signed_cookie stash tx ua url_for write write_chunk/);
Expand Down

0 comments on commit 436b3fe

Please sign in to comment.