Currently RenderLayer keeps track of whether we overflow in order to properly dispatch an 'overflow' event. Unfortunately this is not needed as RenderBox already knows whether it overflows (as it tracks its layout overflow) thus we could move the logic there. This would remove some unneeded logic from RenderLayer so that we can skip having them around.
Created attachment 129801 [details] Proposed refactoring: add an RAII class to handle dispatching events.
Comment on attachment 129801 [details] Proposed refactoring: add an RAII class to handle dispatching events. View in context: https://bugs.webkit.org/attachment.cgi?id=129801&action=review > Source/WebCore/rendering/RenderBlock.cpp:126 > + void computeOverflowStatus(bool& hasHorizontalLayoutOverflow, bool& hasVerticalLayoutOverflow) > + { > + hasHorizontalLayoutOverflow = m_block->hasHorizontalLayoutOverflow(); > + hasVerticalLayoutOverflow = m_block->hasVerticalLayoutOverflow(); > + } Having this method seems like overkill, since it just retrieves two bools.
Comment on attachment 129801 [details] Proposed refactoring: add an RAII class to handle dispatching events. View in context: https://bugs.webkit.org/attachment.cgi?id=129801&action=review FYI will also fix the bug mentioned by Stephen White in https://bugs.webkit.org/show_bug.cgi?id=52064#c3 as we now share the same logic as overflow-events.html >> Source/WebCore/rendering/RenderBlock.cpp:126 >> + } > > Having this method seems like overkill, since it just retrieves two bools. Makes sense. Will be removed.
Committed r109587: <http://trac.webkit.org/changeset/109587>
Looks like this broke the build (at least on Lion): http://build.webkit.org/builders/SnowLeopard%20Intel%20Release%20%28Build%29/builds/39454/steps/compile-webkit/logs/stdio /Users/estes/Safari/OpenSource/Source/WebCore/rendering/RenderBlock.cpp:123:38: error: unused parameter 'hasHorizontalLayoutOverflow' [-Werror,-Wunused-parameter,2] void computeOverflowStatus(bool& hasHorizontalLayoutOverflow, bool& hasVerticalLayoutOverflow) ^ /Users/estes/Safari/OpenSource/Source/WebCore/rendering/RenderBlock.cpp:123:73: error: unused parameter 'hasVerticalLayoutOverflow' [-Werror,-Wunused-parameter,2] void computeOverflowStatus(bool& hasHorizontalLayoutOverflow, bool& hasVerticalLayoutOverflow) ^ 2 errors generated.
> /Users/estes/Safari/OpenSource/Source/WebCore/rendering/RenderBlock.cpp:123:38: error: unused parameter 'hasHorizontalLayoutOverflow' [-Werror,-Wunused-parameter,2] > void computeOverflowStatus(bool& hasHorizontalLayoutOverflow, bool& hasVerticalLayoutOverflow) > ^ > /Users/estes/Safari/OpenSource/Source/WebCore/rendering/RenderBlock.cpp:123:73: error: unused parameter 'hasVerticalLayoutOverflow' [-Werror,-Wunused-parameter,2] > void computeOverflowStatus(bool& hasHorizontalLayoutOverflow, bool& hasVerticalLayoutOverflow) > ^ > 2 errors generated. Apologies Andy, the build fix is committed in http://trac.webkit.org/changeset/109589. Let me know if you still see a build failure.