Bug 234318 - Display list iteration should automatically stop if an item is null
Summary: Display list iteration should automatically stop if an item is null
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-14 15:26 PST by Gabriel Nava Marino
Modified: 2021-12-21 15:27 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Nava Marino 2021-12-14 15:26:49 PST
We should consider modifying DisplayList::Iterator::operator== so display list iteration automatically stops iterating if an item is null.

As was previously recommended, this can be done by making DisplayList::Iterator::operator== return true when called with a null iterator and the end iterator by changing
```
bool operator==(const Iterator& other) const { return &m_displayList == &other.m_displayList && m_cursor == other.m_cursor; }
```

to
```
bool operator==(const Iterator& other) const
{
    if (atEnd() && other.atEnd())
        return true;
    return &m_displayList == &other.m_displayList && m_cursor == other.m_cursor;
}
```

This requires updating the following two API tests:
- TestWebKitAPI.DisplayListTests.InlineItemValidationFailure
- TestWebKitAPI.DisplayListTests.OutOfLineItemDecodingFailure
Comment 1 Radar WebKit Bug Importer 2021-12-21 15:27:16 PST
<rdar://problem/86786410>