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

Side by Side Diff: sky/engine/core/dom/shadow/InsertionPoint.cpp

Issue 709573002: Remove custom style callbacks. (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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/shadow/InsertionPoint.h ('k') | sky/engine/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 25 matching lines...) Expand all
36 #include "core/dom/QualifiedName.h" 36 #include "core/dom/QualifiedName.h"
37 #include "core/dom/StaticNodeList.h" 37 #include "core/dom/StaticNodeList.h"
38 #include "core/dom/shadow/ElementShadow.h" 38 #include "core/dom/shadow/ElementShadow.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document& document) 42 InsertionPoint::InsertionPoint(const QualifiedName& tagName, Document& document)
43 : HTMLElement(tagName, document, CreateInsertionPoint) 43 : HTMLElement(tagName, document, CreateInsertionPoint)
44 , m_registeredWithShadowRoot(false) 44 , m_registeredWithShadowRoot(false)
45 { 45 {
46 setHasCustomStyleCallbacks();
47 } 46 }
48 47
49 InsertionPoint::~InsertionPoint() 48 InsertionPoint::~InsertionPoint()
50 { 49 {
51 } 50 }
52 51
53 void InsertionPoint::setDistribution(ContentDistribution& distribution) 52 void InsertionPoint::setDistribution(ContentDistribution& distribution)
54 { 53 {
55 if (shouldUseFallbackElements()) { 54 if (shouldUseFallbackElements()) {
56 for (Node* child = firstChild(); child; child = child->nextSibling()) 55 for (Node* child = firstChild(); child; child = child->nextSibling())
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 root->didRemoveInsertionPoint(this); 231 root->didRemoveInsertionPoint(this);
233 if (rootOwner) { 232 if (rootOwner) {
234 if (canAffectSelector()) 233 if (canAffectSelector())
235 rootOwner->willAffectSelector(); 234 rootOwner->willAffectSelector();
236 } 235 }
237 } 236 }
238 237
239 HTMLElement::removedFrom(insertionPoint); 238 HTMLElement::removedFrom(insertionPoint);
240 } 239 }
241 240
242 void InsertionPoint::trace(Visitor* visitor)
243 {
244 visitor->trace(m_distribution);
245 HTMLElement::trace(visitor);
246 }
247
248 const InsertionPoint* resolveReprojection(const Node* projectedNode) 241 const InsertionPoint* resolveReprojection(const Node* projectedNode)
249 { 242 {
250 ASSERT(projectedNode); 243 ASSERT(projectedNode);
251 const InsertionPoint* insertionPoint = 0; 244 const InsertionPoint* insertionPoint = 0;
252 const Node* current = projectedNode; 245 const Node* current = projectedNode;
253 ElementShadow* lastElementShadow = 0; 246 ElementShadow* lastElementShadow = 0;
254 while (true) { 247 while (true) {
255 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current); 248 ElementShadow* shadow = shadowWhereNodeCanBeDistributed(*current);
256 if (!shadow || shadow == lastElementShadow) 249 if (!shadow || shadow == lastElementShadow)
257 break; 250 break;
(...skipping 21 matching lines...) Expand all
279 if (!insertionPoints) 272 if (!insertionPoints)
280 return; 273 return;
281 for (size_t i = 0; i < insertionPoints->size(); ++i) 274 for (size_t i = 0; i < insertionPoints->size(); ++i)
282 results.append(insertionPoints->at(i).get()); 275 results.append(insertionPoints->at(i).get());
283 ASSERT(current != insertionPoints->last().get()); 276 ASSERT(current != insertionPoints->last().get());
284 current = insertionPoints->last().get(); 277 current = insertionPoints->last().get();
285 } 278 }
286 } 279 }
287 280
288 } // namespace blink 281 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/shadow/InsertionPoint.h ('k') | sky/engine/core/dom/shadow/ShadowRoot.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698