summaryrefslogtreecommitdiff
path: root/Source/WebCore/html/shadow/InsertionPoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/html/shadow/InsertionPoint.h')
-rw-r--r--Source/WebCore/html/shadow/InsertionPoint.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/Source/WebCore/html/shadow/InsertionPoint.h b/Source/WebCore/html/shadow/InsertionPoint.h
index 292439032..b5282cddc 100644
--- a/Source/WebCore/html/shadow/InsertionPoint.h
+++ b/Source/WebCore/html/shadow/InsertionPoint.h
@@ -33,6 +33,8 @@
#include "HTMLContentSelector.h"
#include "HTMLElement.h"
+#include "HTMLNames.h"
+#include <wtf/Forward.h>
namespace WebCore {
@@ -42,17 +44,39 @@ public:
const HTMLContentSelectionList* selections() const { return &m_selections; }
bool hasSelection() const { return m_selections.first(); }
+ bool isShadowBoundary() const;
+
+ virtual const AtomicString& select() const = 0;
+ virtual bool isSelectValid() const = 0;
+ virtual bool doesSelectFromHostChildren() const = 0;
+
+ virtual void attach();
+ virtual void detach();
+
+ virtual bool isInsertionPoint() const OVERRIDE { return true; }
+ ShadowRoot* assignedFrom() const;
protected:
InsertionPoint(const QualifiedName&, Document*);
+ virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
+
+private:
+ void distributeHostChildren(ShadowTree*);
+ void clearDistribution(ShadowTree*);
+ void attachDistributedNode();
+
+ void assignShadowRoot(ShadowRoot*);
+ void clearAssignment(ShadowRoot*);
+
HTMLContentSelectionList m_selections;
};
inline bool isInsertionPoint(Node* node)
{
- // FIXME: <shadow> should also be InsertionPoint.
- // https://bugs.webkit.org/show_bug.cgi?id=78596
- if (!node || node->isContentElement())
+ if (!node)
+ return true;
+
+ if (node->isHTMLElement() && toHTMLElement(node)->isInsertionPoint())
return true;
return false;
@@ -64,6 +88,13 @@ inline InsertionPoint* toInsertionPoint(Node* node)
return static_cast<InsertionPoint*>(node);
}
+inline bool isShadowBoundary(Node* node)
+{
+ if (!isInsertionPoint(node))
+ return false;
+ return toInsertionPoint(node)->isShadowBoundary();
+}
+
} // namespace WebCore
#endif // InsertionPoint_h