Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: sky/engine/core/dom/shadow/ElementShadow.cpp

Issue 704413007: Remove HTMLShadowElement. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/shadow/ComposedTreeWalker.cpp ('k') | sky/engine/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/shadow/ElementShadow.cpp
diff --git a/sky/engine/core/dom/shadow/ElementShadow.cpp b/sky/engine/core/dom/shadow/ElementShadow.cpp
index 1db6e38bd66a4f409eab6b6573abf1caa2d4c97b..459dab70f50aa86cf4e8f13fdf8f65a0c64681f5 100644
--- a/sky/engine/core/dom/shadow/ElementShadow.cpp
+++ b/sky/engine/core/dom/shadow/ElementShadow.cpp
@@ -33,7 +33,6 @@
#include "core/dom/NodeTraversal.h"
#include "core/dom/shadow/ContentDistribution.h"
#include "core/html/HTMLContentElement.h"
-#include "core/html/HTMLShadowElement.h"
#include "platform/EventDispatchForbiddenScope.h"
#include "platform/ScriptForbiddenScope.h"
@@ -250,42 +249,19 @@ const DestinationInsertionPoints* ElementShadow::destinationInsertionPointsFor(c
void ElementShadow::distribute()
{
host()->setNeedsStyleRecalc(SubtreeStyleChange);
- Vector<RawPtr<HTMLShadowElement>, 32> shadowInsertionPoints;
DistributionPool pool(*host());
for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot()) {
- HTMLShadowElement* shadowInsertionPoint = 0;
const Vector<RefPtr<InsertionPoint> >& insertionPoints = root->descendantInsertionPoints();
for (size_t i = 0; i < insertionPoints.size(); ++i) {
InsertionPoint* point = insertionPoints[i].get();
if (!point->isActive())
continue;
- if (isHTMLShadowElement(*point)) {
- ASSERT(!shadowInsertionPoint);
- shadowInsertionPoint = toHTMLShadowElement(point);
- shadowInsertionPoints.append(shadowInsertionPoint);
- } else {
- pool.distributeTo(point, this);
- if (ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*point))
- shadow->setNeedsDistributionRecalc();
- }
+ pool.distributeTo(point, this);
+ if (ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*point))
+ shadow->setNeedsDistributionRecalc();
}
}
-
- for (size_t i = shadowInsertionPoints.size(); i > 0; --i) {
- HTMLShadowElement* shadowInsertionPoint = shadowInsertionPoints[i - 1];
- ShadowRoot* root = shadowInsertionPoint->containingShadowRoot();
- ASSERT(root);
- if (root->isOldest()) {
- pool.distributeTo(shadowInsertionPoint, this);
- } else {
- DistributionPool olderShadowRootPool(*root->olderShadowRoot());
- olderShadowRootPool.distributeTo(shadowInsertionPoint, this);
- root->olderShadowRoot()->setShadowInsertionPointOfYoungerShadowRoot(shadowInsertionPoint);
- }
- if (ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*shadowInsertionPoint))
- shadow->setNeedsDistributionRecalc();
- }
}
void ElementShadow::didDistributeNode(const Node* node, InsertionPoint* insertionPoint)
@@ -337,9 +313,6 @@ void ElementShadow::willAffectSelector()
void ElementShadow::clearDistribution()
{
m_nodeToInsertionPoints.clear();
-
- for (ShadowRoot* root = youngestShadowRoot(); root; root = root->olderShadowRoot())
- root->setShadowInsertionPointOfYoungerShadowRoot(nullptr);
}
void ElementShadow::trace(Visitor* visitor)
« no previous file with comments | « sky/engine/core/dom/shadow/ComposedTreeWalker.cpp ('k') | sky/engine/core/dom/shadow/InsertionPoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698