[CSSRegions] Unable to collect html element in a named flow
https://bugs.webkit.org/show_bug.cgi?id=121878

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/regions/collect-html-in-named-flow.html
       fast/regions/iframe-html-collected.html

It should be possible to collect the html element in a named flow.
However, before we check whether adding a child is not restricted
by its original parent, we have to make sure that the original parent
is an element to safely perform the check.

* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::isChildAllowed):

LayoutTests:

Use an iframe with a html element collected in a named flow
to test that is does not crash or assert.

* fast/regions/collect-html-in-named-flow-expected.txt: Added.
* fast/regions/collect-html-in-named-flow.html: Added.
* fast/regions/iframe-html-collected-expected.txt: Added.
* fast/regions/iframe-html-collected.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156450 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] The layers from the flow thread should be collected under the regions' layers.
https://bugs.webkit.org/show_bug.cgi?id=120457

Patch by Mihai Maerean <mmaerean@adobe.com> on 2013-09-26
Reviewed by David Hyatt.

Source/WebCore:

This patch is based on the work of Alexandru Chiculita at https://bugs.webkit.org/attachment.cgi?id=203872&action=review

The composited layers inside the named flow threads are collected as part of the regions.
When a region displays a layer that needs accelerated compositing we activate the accelerated compositing for
that region too (inside RenderFlowThread::updateAllLayerToRegionMappings).

Tests: fast/regions/layers/accelerated-compositing/crash-transform-inside-region.html
       fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child.html
       fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another.html
       fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding.html
       fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video.html
       fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread.html
       fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region.html
       fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer.html
       fast/regions/layers/accelerated-compositing/z-index.html: Added.
       fast/regions/layers/accelerated-compositing/z-index-update.html: Added.

* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout): When the layout of the flow thread is over (including the 2 phase layout),
we update all the mappings between the layers inside the flow thread and the regions where those layers will be
painted.
(WebCore::RenderFlowThread::hasCompositingRegionDescendant): Whether any of the regions has a compositing descendant.
(WebCore::RenderFlowThread::getLayerListForRegion):
(WebCore::RenderFlowThread::regionForCompositedLayer):
(WebCore::RenderFlowThread::cachedRegionForCompositedLayer):
(WebCore::RenderFlowThread::updateLayerToRegionMappings): Triggers an update of the layers if a layer has moved
from a region to another since the last update.
(WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
* rendering/RenderFlowThread.h:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushRenderFlowThread):
* rendering/RenderGeometryMap.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateLayerBounds): The RenderNamedFlowThread is ignored when we calculate the bounds
of the RenderView.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldClipCompositedBounds): Not if it's inside an out of flow Flow Thread.
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Now adjusts the ancestorCompositingBounds for the FlowThread.
(WebCore::enclosingFlowThreadAncestor):
(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Make sure that the region propagates
its borders, paddings, outlines or box-shadows to layers inside it.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Now calls computeRegionCompositingRequirements.
(WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Do not iterate the RenderFlowThread directly. We
are going to collect composited layers as part of regions.
(WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
(WebCore::RenderLayerCompositor::canBeComposited): CSS Regions flow threads do not need to be composited as we
use composited RenderRegions to render the background of the RenderFlowThread.
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason): If it's a region.
* rendering/RenderLayerCompositor.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderElement.cpp:
(WebCore::RenderObject::propagateStyleToAnonymousChildren): Not for RenderFlowThreads, as they are updated
through the RenderView::styleDidChange function.
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRequiresLayerForCompositing):
(WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderRegion.h:
(WebCore::toRenderRegion):
* rendering/RenderRegionSet.h:
(WebCore::RenderRegionSet::requiresLayer): Never.
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):

LayoutTests:

* fast/regions/layers/accelerated-compositing/crash-transform-inside-region.html: Added.
* fast/regions/layers/accelerated-compositing/crash-transform-inside-region-expected.html: Added.
* fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child.html: Added.
* fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child-expected.html: Added.
* fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another.html: Added.
* fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another-expected.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-expected.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video-expected.html: Added.
* fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread.html: Added.
* fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread-expected.html: Added.
* fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer.html: Added.
* fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer-expected.html: Added.
* fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region.html: Added.
* fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-update-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-update.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add baselines for editing/selection/paragraph-granularity.html
https://bugs.webkit.org/show_bug.cgi?id=121842

Unreviewed EFL gardening.

Patch by Krzysztof Wolanski <k.wolanski@samsung.com> on 2013-09-26

* platform/efl/TestExpectations: Removing the corresponding entry.
* platform/efl/editing/selection/paragraph-granularity-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156452 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Remove inappropriate expectations for tests that are now passing on EFL port
https://bugs.webkit.org/show_bug.cgi?id=121897

Unreviewed EFL gardening.

Patch by Krzysztof Wolanski <k.wolanski@samsung.com> on 2013-09-26

* platform/efl-wk2/TestExpectations:
* platform/efl/TestExpectations:

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