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

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

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 unified diff | Download patch
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 30 matching lines...) Expand all
41 class InsertionPoint : public HTMLElement { 41 class InsertionPoint : public HTMLElement {
42 public: 42 public:
43 virtual ~InsertionPoint(); 43 virtual ~InsertionPoint();
44 44
45 bool hasDistribution() const { return !m_distribution.isEmpty(); } 45 bool hasDistribution() const { return !m_distribution.isEmpty(); }
46 void setDistribution(ContentDistribution&); 46 void setDistribution(ContentDistribution&);
47 void clearDistribution() { m_distribution.clear(); } 47 void clearDistribution() { m_distribution.clear(); }
48 bool isActive() const; 48 bool isActive() const;
49 bool canBeActive() const; 49 bool canBeActive() const;
50 50
51 bool isShadowInsertionPoint() const;
52 bool isContentInsertionPoint() const; 51 bool isContentInsertionPoint() const;
53 52
54 PassRefPtr<StaticNodeList> getDistributedNodes(); 53 PassRefPtr<StaticNodeList> getDistributedNodes();
55 54
56 virtual bool canAffectSelector() const { return false; } 55 virtual bool canAffectSelector() const { return false; }
57 56
58 virtual void attach(const AttachContext& = AttachContext()) override; 57 virtual void attach(const AttachContext& = AttachContext()) override;
59 virtual void detach(const AttachContext& = AttachContext()) override; 58 virtual void detach(const AttachContext& = AttachContext()) override;
60 59
61 bool shouldUseFallbackElements() const; 60 bool shouldUseFallbackElements() const;
(...skipping 22 matching lines...) Expand all
84 83
85 typedef Vector<RefPtr<InsertionPoint> > DestinationInsertionPoints; 84 typedef Vector<RefPtr<InsertionPoint> > DestinationInsertionPoints;
86 85
87 DEFINE_ELEMENT_TYPE_CASTS(InsertionPoint, isInsertionPoint()); 86 DEFINE_ELEMENT_TYPE_CASTS(InsertionPoint, isInsertionPoint());
88 87
89 inline bool isActiveInsertionPoint(const Node& node) 88 inline bool isActiveInsertionPoint(const Node& node)
90 { 89 {
91 return node.isInsertionPoint() && toInsertionPoint(node).isActive(); 90 return node.isInsertionPoint() && toInsertionPoint(node).isActive();
92 } 91 }
93 92
94 inline bool isActiveShadowInsertionPoint(const Node& node)
95 {
96 return node.isInsertionPoint() && toInsertionPoint(node).isShadowInsertionPo int();
97 }
98
99 inline ElementShadow* shadowWhereNodeCanBeDistributed(const Node& node) 93 inline ElementShadow* shadowWhereNodeCanBeDistributed(const Node& node)
100 { 94 {
101 Node* parent = node.parentNode(); 95 Node* parent = node.parentNode();
102 if (!parent) 96 if (!parent)
103 return 0; 97 return 0;
104 if (parent->isShadowRoot() && !toShadowRoot(parent)->isYoungest()) 98 if (parent->isShadowRoot() && !toShadowRoot(parent)->isYoungest())
105 return node.shadowHost()->shadow(); 99 return node.shadowHost()->shadow();
106 if (isActiveInsertionPoint(*parent)) 100 if (isActiveInsertionPoint(*parent))
107 return node.shadowHost()->shadow(); 101 return node.shadowHost()->shadow();
108 if (parent->isElementNode()) 102 if (parent->isElementNode())
109 return toElement(parent)->shadow(); 103 return toElement(parent)->shadow();
110 return 0; 104 return 0;
111 } 105 }
112 106
113 const InsertionPoint* resolveReprojection(const Node*); 107 const InsertionPoint* resolveReprojection(const Node*);
114 108
115 void collectDestinationInsertionPoints(const Node&, Vector<RawPtr<InsertionPoint >, 8>& results); 109 void collectDestinationInsertionPoints(const Node&, Vector<RawPtr<InsertionPoint >, 8>& results);
116 110
117 } // namespace blink 111 } // namespace blink
118 112
119 #endif // InsertionPoint_h 113 #endif // InsertionPoint_h
OLDNEW
« no previous file with comments | « sky/engine/core/dom/shadow/ElementShadow.cpp ('k') | sky/engine/core/dom/shadow/InsertionPoint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698