[Shadow] Fallback content should also be reprojection.
authorshinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 03:08:45 +0000 (03:08 +0000)
committershinyak@chromium.org <shinyak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Oct 2012 03:08:45 +0000 (03:08 +0000)
commitc01534b2761da5af349d1a830bc00d1131c70af9
tree5c407168ee5500295115fae671b0974e01628140
parent9f923f1cab0f0339286cbda2eeba654c258fac9a
[Shadow] Fallback content should also be reprojection.
https://bugs.webkit.org/show_bug.cgi?id=99750

Reviewed by Dimitri Glazkov.

Source/WebCore:

Fallback content of InsertionPoint should be reprojected. The existing assumption that
only the direct child of host element can be distributed to InsertionPoint does not hold anymore.
So, if the parent of an element is InsertionPoint which should show fallback element, we have to
check the grand parent of the element instead of the element.

Tests: fast/dom/shadow/content-reprojection-fallback-reprojection.html
       fast/dom/shadow/content-reprojection-fallback.html

* css/StyleResolver.cpp:
(WebCore::shouldResetStyleInheritance): Checks the grandparent of the element if the parent is
an InsertionPoint which uses fallback content.
* dom/ComposedShadowTreeWalker.cpp:
(WebCore::shadowOfParentForDistribution):
(WebCore):
(WebCore::resolveReprojection):
(WebCore::ComposedShadowTreeWalker::traverseParent):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::shouldUseFallbackElements): True if the InsertionPoint should use fallback content.
(WebCore):
* html/shadow/InsertionPoint.h:
(WebCore::parentElementForDistribution): Returns the grandparent element if the parent is InsertionPoint which uses
fallback content. Returns parent element otherwise.
(WebCore):

LayoutTests:

* fast/dom/shadow/content-reprojection-fallback-expected.html: Added.
* fast/dom/shadow/content-reprojection-fallback-reprojection-expected.html: Added.
* fast/dom/shadow/content-reprojection-fallback-reprojection.html: Added.
* fast/dom/shadow/content-reprojection-fallback.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/content-reprojection-fallback-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/content-reprojection-fallback-reprojection-expected.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/content-reprojection-fallback-reprojection.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/content-reprojection-fallback.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/dom/ComposedShadowTreeWalker.cpp
Source/WebCore/html/shadow/InsertionPoint.cpp
Source/WebCore/html/shadow/InsertionPoint.h