Bug 1776211 - Assertion failure: aNode (aNode cannot be nullptr!), at /layout/base/nsGenConList.h:83 r=emilio

Specifically handle empty lists in nsGenConList::BinarySearch. This
was hidden because the pre-existing caller also handles empty lists before
calling the binary search algorithm.

Differential Revision: https://phabricator.services.mozilla.com/D150132
This commit is contained in:
Martin Robinson 2022-06-23 16:05:30 +00:00
Родитель 5095928f4d
Коммит 317f69f042
3 изменённых файлов: 29 добавлений и 0 удалений

Просмотреть файл

@ -127,6 +127,10 @@ bool nsGenConList::NodeAfter(const nsGenConNode* aNode1,
nsGenConNode* nsGenConList::BinarySearch(
const mozilla::FunctionRef<bool(nsGenConNode*)>& aIsAfter) {
if (mList.isEmpty()) {
return nullptr;
}
// The range of indices at which |aNode| could end up.
// (We already know it can't be at index mSize.)
uint32_t first = 0, last = mSize - 1;

Просмотреть файл

@ -0,0 +1,13 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS-contain test: nested style containment and the quote element following a style boundary without any quotes</title>
<link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com">
<link rel="match" href="reference/quote-scoping-empty-style-boundaries-ref.html">
<link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-style">
<div style="contain: style;">
<div style="contain: style;">
<q></q>
</div>
</div>

Просмотреть файл

@ -0,0 +1,12 @@
<!doctype html>
<html lang=en>
<meta charset=utf-8>
<title>CSS-contain test: nested style containment and the quote element following a style boundary without any quotes</title>
<link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com">
<link rel=help href="https://drafts.csswg.org/css-contain-1/#containment-style">
<div>
<div>
<q></q>
</div>
</div>