Distributed nodes should not share styles.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 17:08:21 +0000 (17:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Aug 2012 17:08:21 +0000 (17:08 +0000)
commit29058a78a9ff35434ae9c1343220ab6db32eb275
treef3d96711eaa2b13cdca121db8bf5dc74083a86f5
parent19918fed3a76ce94288e17527a637ec8d9b53d61
Distributed nodes should not share styles.
https://bugs.webkit.org/show_bug.cgi?id=90661

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

Source/WebCore:

styleForElement tries to use previous sibling's style for distributed
nodes. However distributed nodes are children of a shadow host, but
the nodes are not siblings as the result of distribution.
The spec is:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#shadow-dom-subtrees
So sharing previous sibling's style should be disabled for distrbuted
nodes.

Test: fast/dom/shadow/style-of-distributed-node.html

* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
Initialized m_distributedToInsertionPoint. Its initial value is false.
(WebCore::StyleResolver::initForStyleResolve):
After invoking NodeRenderingContext, if the context returns any
insertion point, set m_distributedToInsertionPoint to be true.
Otherwise, false. The value is used in styleForElement.
(WebCore::StyleResolver::styleForElement):
If m_distributedToInsertionPoint is true, disable local sibling style
cache.
* css/StyleResolver.h:
(StyleResolver):
Added a new member variable, m_distributedToInsertionPoint.
The variable keeps whether the m_element is distributed to an
insertion point.

LayoutTests:

* fast/dom/shadow/style-of-distributed-node-expected.txt: Added.
* fast/dom/shadow/style-of-distributed-node.html: Added.
* fast/dom/shadow/user-modify-inheritance-expected.txt:
As this patch also change the user-modify-inheritance's test result,
updated the expected result.
* fast/dom/shadow/user-modify-inheritance.html:
Added FIXME comment.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/style-of-distributed-node.html [new file with mode: 0644]
LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt
LayoutTests/fast/dom/shadow/user-modify-inheritance.html
Source/WebCore/ChangeLog
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h