[CSS Regions] Regions don't paint correctly in new-multicol elements
https://bugs.webkit.org/show_bug.cgi?id=120711

Reviewed by David Hyatt.

Source/WebCore:

This patch implements basic support for regions inside multi-column elements.
Currently, the painting and hit-testing logic of CSS Regions is not aware of
enclosing multi-column elements. The change is integrated at a layer level by
making use of the pre-computed layer fragments during the painting and hit-testing
phases for regions.

There are limitations such that self painting layers found inside the named flow
thread layer will not be correctly processed because they don't go through the
layer fragment collection step. This is not trivial to implement because the enclosing
pagination layer provided by the multi-column element is not visibile from inside
the named flow thread layer and they reside in different coordinate systems.

A side effect of this patch is the fix of regions incorrect clipping in certain
cases (when both a region and its container clip their overflow, the region's
content is visible outside the container).

Tests: fast/regions/region-clipping.html
       fast/regions/regions-in-multicol-bt.html
       fast/regions/regions-in-multicol-hover-overflow.html
       fast/regions/regions-in-multicol-hover.html
       fast/regions/regions-in-multicol-lr.html
       fast/regions/regions-in-multicol-rl.html
       fast/regions/regions-in-multicol.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::paintFlowThreadIfRegionForFragments):
(WebCore::RenderLayer::hitTestFlowThreadIfRegionForFragments):
* rendering/RenderLayer.h:

LayoutTests:

Add tests for regions in multi-column elements and a test that verifies
regions are correctly clipped by their containers when both have hidden
overflow.
For the non horizontal-tb writing modes tests there's no overflow after the
last region because it's not rendered correctly yet in a new column.

* fast/regions/region-clipping-expected.html: Added.
* fast/regions/region-clipping.html: Added.
* fast/regions/regions-in-multicol-bt-expected.html: Added.
* fast/regions/regions-in-multicol-bt.html: Added.
* fast/regions/regions-in-multicol-expected.html: Added.
* fast/regions/regions-in-multicol-hover-expected.html: Added.
* fast/regions/regions-in-multicol-hover-overflow-expected.html: Added.
* fast/regions/regions-in-multicol-hover-overflow.html: Added.
* fast/regions/regions-in-multicol-hover.html: Added.
* fast/regions/regions-in-multicol-lr-expected.html: Added.
* fast/regions/regions-in-multicol-lr.html: Added.
* fast/regions/regions-in-multicol-rl-expected.html: Added.
* fast/regions/regions-in-multicol-rl.html: Added.
* fast/regions/regions-in-multicol.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164481 268f45cc-cd09-0410-ab3c-d52691b4dbfc