| Summary: | Potentially redundant condition in LocalFrameView style functions | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Luke Warlow <lwarlow> |
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | ahmad.saleem792, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
|
Description
Luke Warlow
2023-07-08 14:18:05 PDT
Do you want to expand scope of this bug?
I think we can add more checks in 'addScrollableArea' and 'containsScrollableArea' to also assert to confirm we have 'ScrollableArea'.
bool LocalFrameView::addScrollableArea(ScrollableArea* scrollableArea)
{
ASSERT(scrollableArea);
_________
bool LocalFrameView::containsScrollableArea(ScrollableArea* scrollableArea) const
{
ASSERT(scrollableArea);
if (!m_scrollableAreas || !scrollableArea)
return false;
^ Kind of early return, if we don't have scrollableArea.
_____
I think it would make scroll code bit more robust as well.
________
If not, I am happy to separate PR, above compiles in my local build. :-)
(In reply to Ahmad Saleem from comment #1) > Do you want to expand scope of this bug? > > I think we can add more checks in 'addScrollableArea' and > 'containsScrollableArea' to also assert to confirm we have 'ScrollableArea'. > > > bool LocalFrameView::addScrollableArea(ScrollableArea* scrollableArea) > { > ASSERT(scrollableArea); > > > _________ > > bool LocalFrameView::containsScrollableArea(ScrollableArea* scrollableArea) > const > { > > ASSERT(scrollableArea); > if (!m_scrollableAreas || !scrollableArea) > return false; > > ^ Kind of early return, if we don't have scrollableArea. > > _____ > > I think it would make scroll code bit more robust as well. > > ________ > > > If not, I am happy to separate PR, above compiles in my local build. :-) Although 'containsScrollableArea' is not used much as well. (If we can also explore, if we can remove it). (In reply to Ahmad Saleem from comment #1) > Do you want to expand scope of this bug? > > I think we can add more checks in 'addScrollableArea' and > 'containsScrollableArea' to also assert to confirm we have 'ScrollableArea'. > > > bool LocalFrameView::addScrollableArea(ScrollableArea* scrollableArea) > { > ASSERT(scrollableArea); > > > _________ > > bool LocalFrameView::containsScrollableArea(ScrollableArea* scrollableArea) > const > { > > ASSERT(scrollableArea); > if (!m_scrollableAreas || !scrollableArea) > return false; > > ^ Kind of early return, if we don't have scrollableArea. > > _____ > > I think it would make scroll code bit more robust as well. > > ________ > > > If not, I am happy to separate PR, above compiles in my local build. :-) Although 'containsScrollableArea' is not used much as well. (If we can also explore, if we can remove it). Could you do this as a separate PR please. Not quite sure if this bug is actionable currently just something Darin spotted during a code review. Your changes look reasonable with my limited understanding. |