[Shadow DOM] InsertionPoint should have isActive() member function.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 02:55:40 +0000 (02:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Apr 2012 02:55:40 +0000 (02:55 +0000)
commit6733a9c1fef8795df6c34ff3abbd88fb82c91d88
tree68408083fe23d5d6cd709831b96d36771704ed62
parentfa86f9f81fcf52cb541272955a3c55ef9793a7cb
[Shadow DOM] InsertionPoint should have isActive() member function.
https://bugs.webkit.org/show_bug.cgi?id=82010

Patch by Takashi Sakamoto <tasak@google.com> on 2012-04-16
Reviewed by Hajime Morita.

This patch adds isActive public member function to InsertionPoint and
makes InsertionPoint elements consider whether active or not.
If an InsertionPoint is inactive, the element is not shadow boundary
and is needed to be rendered.
c.f. https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#dfn-active-insertion-point

Test: update existing tests, i.e.
LayoutTests/fast/dom/shadow/shadow-contents-fallback-dynamic.html and
LayoutTests/fast/dom/shadow/shadow-contents-fallback.html

* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::isActive):
A new public method for checking whether an insertion point is active or inactive.
If active, returns true. Otherwise, false.
(WebCore::InsertionPoint::isShadowBoundary):
Make the method consider whether an insertin point is active or inactive.
(WebCore::InsertionPoint::rendererIsNeeded):
Changed to return true If an insertion point is inactive.
(WebCore::InsertionPoint::attach):
Changed to call only HTMLElement::attach If an insertion point is inactive.
(WebCore::InsertionPoint::detach):
Changed to call only HTMLElement::detach If an insertion point is inactive.
* html/shadow/InsertionPoint.h:
(InsertionPoint):
Added isActive public method.
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::NodeRenderingContext):
Changed to take into account an insertion point's activeness when parent is an insertion point.
(WebCore::NodeRenderingContext::firstRendererOf):
(WebCore::NodeRenderingContext::lastRendererOf):
Changed to take into account an insertion point's activeness.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114334 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/fast/dom/shadow/shadow-contents-fallback-dynamic.html
LayoutTests/fast/dom/shadow/shadow-contents-fallback.html
Source/WebCore/ChangeLog
Source/WebCore/dom/NodeRenderingContext.cpp
Source/WebCore/html/shadow/InsertionPoint.cpp
Source/WebCore/html/shadow/InsertionPoint.h