diff --git a/Libraries/LibWeb/HTML/HTMLElement.cpp b/Libraries/LibWeb/HTML/HTMLElement.cpp index 944fc1c9ee2..476d0b16137 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -460,7 +460,7 @@ int HTMLElement::offset_top() const // NOTE: Ensure that layout is up-to-date before looking at metrics. const_cast(document()).update_layout(); - if (!layout_node()) + if (!paintable_box()) return 0; CSSPixels top_border_edge_of_element = paintable_box()->absolute_border_box_rect().y(); @@ -502,7 +502,7 @@ int HTMLElement::offset_left() const // NOTE: Ensure that layout is up-to-date before looking at metrics. const_cast(document()).update_layout(); - if (!layout_node()) + if (!paintable_box()) return 0; CSSPixels left_border_edge_of_element = paintable_box()->absolute_border_box_rect().x(); diff --git a/Tests/LibWeb/Text/expected/wpt-import/html/rendering/widgets/button-layout/display-other.txt b/Tests/LibWeb/Text/expected/wpt-import/html/rendering/widgets/button-layout/display-other.txt new file mode 100644 index 00000000000..b615d8746ff --- /dev/null +++ b/Tests/LibWeb/Text/expected/wpt-import/html/rendering/widgets/button-layout/display-other.txt @@ -0,0 +1,24 @@ +Harness status: OK + +Found 18 tests + +3 Pass +15 Fail +Fail display: block +Pass display: run-in +Pass display: flow +Fail display: flow-root +Fail display: table +Pass display: list-item +Fail display: table-row-group +Fail display: table-header-group +Fail display: table-footer-group +Fail display: table-row +Fail display: table-cell +Fail display: table-column-group +Fail display: table-column +Fail display: table-caption +Fail display: ruby-base +Fail display: ruby-text +Fail display: ruby-base-container +Fail display: ruby-text-container \ No newline at end of file diff --git a/Tests/LibWeb/Text/input/wpt-import/html/rendering/widgets/button-layout/display-other.html b/Tests/LibWeb/Text/input/wpt-import/html/rendering/widgets/button-layout/display-other.html new file mode 100644 index 00000000000..92db86d89eb --- /dev/null +++ b/Tests/LibWeb/Text/input/wpt-import/html/rendering/widgets/button-layout/display-other.html @@ -0,0 +1,52 @@ + +button with other display values + + + +
+after +