diff --git a/Tests/LibWeb/Layout/expected/incomplete-input-no-newline-at-eof-should-not-crash.txt b/Tests/LibWeb/Layout/expected/incomplete-input-no-newline-at-eof-should-not-crash.txt new file mode 100644 index 0000000000..fb08f18b0a --- /dev/null +++ b/Tests/LibWeb/Layout/expected/incomplete-input-no-newline-at-eof-should-not-crash.txt @@ -0,0 +1,12 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline + BlockContainer
at (8,8) content-size 784x17.46875 children: inline + line 0 width: 14.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 2, rect: [8,8 14.65625x17.46875] + "" + TextNode <#text> + +ViewportPaintable (Viewport<#document>) [0,0 800x600] + PaintableWithLines (BlockContainer) [0,0 800x600] + PaintableWithLines (BlockContainer) [8,8 784x17.46875] + TextPaintable (TextNode<#text>) diff --git a/Tests/LibWeb/Layout/input/incomplete-input-no-newline-at-eof-should-not-crash.html b/Tests/LibWeb/Layout/input/incomplete-input-no-newline-at-eof-should-not-crash.html new file mode 100644 index 0000000000..35324addd9 --- /dev/null +++ b/Tests/LibWeb/Layout/input/incomplete-input-no-newline-at-eof-should-not-crash.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp index 7d2876a3a7..9e8c8d9d68 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLEncodingDetection.cpp @@ -321,12 +321,12 @@ Optional