diff --git a/Libraries/LibWeb/Layout/LayoutState.cpp b/Libraries/LibWeb/Layout/LayoutState.cpp index c73c431004e..33c825e81fc 100644 --- a/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Libraries/LibWeb/Layout/LayoutState.cpp @@ -85,6 +85,13 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box) if (child.containing_block() != &box) return TraversalDecision::Continue; + // https://drafts.csswg.org/css-position/#fixed-positioning-containing-block + // [..] As a result, parts of fixed-positioned boxes that extend outside the layout viewport/page area + // cannot be scrolled to and will not print. + // FIXME: Properly establish the fixed positioning containing block for `position: fixed` + if (child.is_fixed_position()) + return TraversalDecision::Continue; + auto child_border_box = child.paintable_box()->absolute_border_box_rect(); // Border boxes with zero area do not affect the scrollable overflow area. diff --git a/Tests/LibWeb/Text/expected/scrollable-viewport-with-position-fixed.txt b/Tests/LibWeb/Text/expected/scrollable-viewport-with-position-fixed.txt new file mode 100644 index 00000000000..227cd9056be --- /dev/null +++ b/Tests/LibWeb/Text/expected/scrollable-viewport-with-position-fixed.txt @@ -0,0 +1 @@ +{"x":8,"y":8,"width":784,"height":17,"top":8,"right":792,"bottom":25,"left":8} diff --git a/Tests/LibWeb/Text/input/scrollable-viewport-with-position-fixed.html b/Tests/LibWeb/Text/input/scrollable-viewport-with-position-fixed.html new file mode 100644 index 00000000000..dc4e75cd71e --- /dev/null +++ b/Tests/LibWeb/Text/input/scrollable-viewport-with-position-fixed.html @@ -0,0 +1,21 @@ + + + +