diff --git a/Tests/LibWeb/Text/expected/DOM/element-scroll-height.txt b/Tests/LibWeb/Text/expected/DOM/element-scroll-height.txt new file mode 100644 index 0000000000..52ea7a30cf --- /dev/null +++ b/Tests/LibWeb/Text/expected/DOM/element-scroll-height.txt @@ -0,0 +1 @@ +Item 1Item 2Item 3Item 4Item 5Item 6Item 7Item 8Item 9Item 10Item 11Item 12 1200 diff --git a/Tests/LibWeb/Text/input/DOM/element-scroll-height.html b/Tests/LibWeb/Text/input/DOM/element-scroll-height.html new file mode 100644 index 0000000000..527ccba732 --- /dev/null +++ b/Tests/LibWeb/Text/input/DOM/element-scroll-height.html @@ -0,0 +1,25 @@ + + + +
Item 1Item 2Item 3Item 4Item 5Item 6Item 7Item 8Item 9Item 10Item 11Item 12
+ diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 1c05221d79..b9306a3c75 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -1430,7 +1430,7 @@ int Element::scroll_height() const return 0; // 7. Return the height of the element’s scrolling area. - return paintable_box()->border_box_height().to_int(); + return paintable_box()->scrollable_overflow_rect()->height().to_int(); } // https://html.spec.whatwg.org/multipage/semantics-other.html#concept-element-disabled