LibWeb: Implement Range's extension method

This patch implements `Range::getClientRects` and
`Range::getBoundingClientRect`. Since the rects returned by invoking
getClientRects can be accessed without adding them to the Selection,
`ViewportPaintable::recompute_selection_states` has been updated to
accept a Range as a parameter, rather than acquiring it through the
Document's Selection.

With this change, the following tests now pass:

- wpt[css/cssom-view/range-bounding-client-rect-with-nested-text.html]
- wpt[css/cssom-view/DOMRectList.html]

Note: The test
"css/cssom-view/range-bounding-client-rect-with-display-contents.html"
still fails due to an issue with Element::getClientRects, which will
be addressed in a future commit.
This commit is contained in:
Annya 2024-09-16 19:38:14 +08:00 committed by Alexander Kalenik
commit 75c7dbc5d2
Notes: github-actions[bot] 2024-09-20 17:59:18 +00:00
12 changed files with 225 additions and 38 deletions

View file

@ -1194,7 +1194,7 @@ void Document::update_layout()
page().client().page_did_layout();
}
paintable()->recompute_selection_states();
paintable()->update_selection();
m_needs_layout = false;