diff --git a/Tests/LibWeb/Layout/expected/getComputedStyle-on-unconnected-element.txt b/Tests/LibWeb/Layout/expected/getComputedStyle-on-unconnected-element.txt new file mode 100644 index 0000000000..08865062d8 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/getComputedStyle-on-unconnected-element.txt @@ -0,0 +1,7 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x37.835937 [BFC] children: not-inline + BlockContainer
at (8,8) content-size 784x21.835937 children: inline + line 0 width: 362.617187, height: 21.835937, bottom: 21.835937, baseline: 16.914062 + frag 0 from TextNode start: 0, length: 35, rect: [8,8 362.617187x21.835937] + "This test passes if we don't crash." + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/getComputedStyle-on-unconnected-element.html b/Tests/LibWeb/Layout/input/getComputedStyle-on-unconnected-element.html new file mode 100644 index 0000000000..34c51bfef6 --- /dev/null +++ b/Tests/LibWeb/Layout/input/getComputedStyle-on-unconnected-element.html @@ -0,0 +1,11 @@ + +This test passes if we don't crash. \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp index c1cc9fc703..99a2987d8d 100644 --- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp @@ -666,6 +666,11 @@ ErrorOr