Overset is incorrectly computed for regions with auto-height (by taking into account visual overflow). See the attached test case.
Created attachment 224602 [details]
Created attachment 225250 [details]
Comment on attachment 225250 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=225250&action=review
I like the patch and i think is moving in the right direction.However, i would like you to take another look at it.
As a comment, i would have probably created another patch before with the movement of regionOversetChange methods from RenderRegion to RenderNamedFlowFragment, without functionality change, making the review easier.
> + 1. Regions overflow no longer trigger an overset changed event. This is beacuse
beacuse -> because
5. The regionOverset property is moved from RenderRegion to RenderNamedFlowFragment.
> + if (namedFlowFragment->generatingElement()->regionOversetState() == RegionOverset)
No need for exposing the generatingElement() here. If you write something like:
return (namedFlowFragment->regionOversetState() == RegionOverset)
you achieve the same result since the method you moved to RenderNamedFlowFragment, regionOversetState() has the assertion in place. I also prefer using a ternary operator here.
> + if (namedFlowFragment->generatingElement()->regionOversetState() == RegionEmpty)
No need for assert here if you write:
if (namedFlowFragment->regionOversetState() == RegionEmpty)
> + flowRenderer->dispatchRegionEvents();
Worth a comment in the changelog explaining why you chose this layout phase for dispatching the event(s).
> +void RenderNamedFlowThread::dispatchRegionEvents()
This deserves a comment in the changelog since you are talking about events, while right now you are using this function to dispatch only the regions overset change event. I assume you want this function to be used also when we support the regionFragmentChange.
Btw, i would rename this function to dispatchRegionChainEvents or dispatchNamedFlowEvents since you are not dispatching an event for a region but rather you are dispatching the events for the named flow.
I also think it is worth explaining in the ChangeLog why regionLayoutUpdate is not triggered here, in the same place as regionOversetChange.
> + // Used to store the content bottom until the moment we need to update the overset state.
I would move this comment into the changelog.
> + // Overset should be false since the shadow of the content overflows the last region.
Maybe we can make this comment clearer. Something like:
"Overset should be false even if the content shadow overflows the last region since the visual overflow does not influence the overset property.
Created attachment 225651 [details]
Comment on attachment 225651 [details]
r=me but please make sure that you have an accurate ChangeLog before landing. For instance, Changelog mentions firstEmptyRegionIndex which was modified in the previous patch but not in this one.
Created attachment 225654 [details]
Patch for landing
Comment on attachment 225654 [details]
Patch for landing
Clearing flags on attachment: 225654
Committed r164988: <http://trac.webkit.org/changeset/164988>
All reviewed patches have been landed. Closing bug.