Bug 234325 - The render descendant iterator should work with const objects
Summary: The render descendant iterator should work with const objects
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: 234326
  Show dependency treegraph
 
Reported: 2021-12-14 16:11 PST by Gabriel Nava Marino
Modified: 2021-12-21 16:12 PST (History)
1 user (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 16:11:14 PST
Currently the following code in RenderBlockFlow.cpp:
```
for (auto& block : descendantsOfType<RenderBlock>(*this))
    ...
```

Will lead to the following compile-time error:
```
./rendering/RenderIterator.h:131:12: error: no matching function for call to 'nextAncestorSibling'
    return nextAncestorSibling(current, stayWithin);
```

It was mentioned this is due to a "constness issue; const_cast makes it work. We should teach the descendant iterator to work with const objects. childrenOfType works fine so it should be relatively easy."
Comment 1 Radar WebKit Bug Importer 2021-12-21 16:12:28 PST
<rdar://problem/86787920>