Chromium Code Reviews| Index: Source/core/dom/shadow/InsertionPoint.cpp |
| diff --git a/Source/core/dom/shadow/InsertionPoint.cpp b/Source/core/dom/shadow/InsertionPoint.cpp |
| index 4ee112b5cb8ef4627f4ba55aa29379f953da505d..63532d8b81b231439b2307bb2b46a3d0ffd7016c 100644 |
| --- a/Source/core/dom/shadow/InsertionPoint.cpp |
| +++ b/Source/core/dom/shadow/InsertionPoint.cpp |
| @@ -45,6 +45,7 @@ InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document* document) |
| : HTMLElement(tagName, document, CreateInsertionPoint) |
| , m_registeredWithShadowRoot(false) |
| { |
| + setHasCustomStyleCallbacks(); |
| } |
| InsertionPoint::~InsertionPoint() |
| @@ -74,6 +75,16 @@ void InsertionPoint::detach(const AttachContext& context) |
| HTMLElement::detach(context); |
| } |
| +void InsertionPoint::willRecalcStyle(StyleChange change) |
| +{ |
| + if (change < Inherit) |
| + return; |
| + if (ShadowRoot* shadowRoot = containingShadowRoot()) { |
| + ContentDistributor::ensureDistribution(shadowRoot); |
|
esprehn
2013/06/14 08:32:29
Why not call shadowRoot->host() here and avoid the
|
| + shadowRoot->owner()->distributor().setNeedsStyleRecalcIfDistributedTo(shadowRoot->host(), this); |
| + } |
| +} |
| + |
| bool InsertionPoint::shouldUseFallbackElements() const |
| { |
| return isActive() && !hasDistribution(); |
| @@ -206,6 +217,7 @@ InsertionPoint* resolveReprojection(const Node* projectedNode) |
| while (current) { |
| if (ElementShadow* shadow = shadowOfParentForDistribution(current)) { |
| + ContentDistributor::ensureDistribution(shadow); |
| if (ShadowRoot* root = current->containingShadowRoot()) |
| ContentDistributor::ensureDistribution(root); |
| if (InsertionPoint* insertedTo = shadow->distributor().findInsertionPointFor(projectedNode)) { |