52 #ifndef _DOM_NodeListImpl_h_ 53 #define _DOM_NodeListImpl_h_ 55 #include "dom/dom_string.h" 56 #include "misc/shared.h" 57 #include "misc/htmlnames.h" 58 #include "ClassNames.h" 66 class NodeListImpl :
public khtml::Shared<NodeListImpl>
70 virtual unsigned long length()
const = 0;
71 virtual NodeImpl *item(
unsigned long index)
const = 0;
73 virtual ~NodeListImpl() {}
76 class DynamicNodeListImpl :
public NodeListImpl
83 LAST_NODE_LIST = CHILD_NODES
90 CacheKey(): type(UNCACHEABLE) {}
92 CacheKey(NodeImpl *_baseNode,
int _type):
93 baseNode(_baseNode), type(_type)
98 return int(reinterpret_cast<quintptr>(baseNode) >> 2) ^
99 (unsigned(type) << 26);
104 return baseNode == other.baseNode &&
109 struct Cache:
public khtml::Shared<Cache> {
110 static Cache *makeStructuralOnly();
111 static Cache *makeNameOrID();
112 static Cache *makeClassName();
114 Cache(
unsigned short relSecondaryVer);
119 unsigned int secondaryVersion;
124 unsigned int position;
127 unsigned short relevantSecondaryVer;
129 void updateNodeListInfo(DocumentImpl *doc);
131 virtual void clear(DocumentImpl *doc);
135 typedef Cache *CacheFactory();
137 DynamicNodeListImpl(NodeImpl *node,
int type, CacheFactory *factory);
138 virtual ~DynamicNodeListImpl();
141 unsigned long length()
const override;
142 NodeImpl *item(
unsigned long index)
const override;
147 virtual unsigned long calcLength(NodeImpl *start)
const;
150 NodeImpl *recursiveItem(NodeImpl *absStart, NodeImpl *start,
unsigned long &offset)
const;
151 NodeImpl *recursiveItemBack(NodeImpl *absStart, NodeImpl *start,
unsigned long &offset)
const;
155 virtual bool nodeMatches(NodeImpl *testNode,
bool &doRecurse)
const = 0;
158 mutable Cache *m_cache;
161 class ChildNodeListImpl :
public DynamicNodeListImpl
165 ChildNodeListImpl(NodeImpl *n);
168 bool nodeMatches(NodeImpl *testNode,
bool &doRecurse)
const override;
183 bool nodeMatches(NodeImpl *testNode,
bool &doRecurse)
const override;
188 bool m_namespaceAware;
202 bool nodeMatches(NodeImpl *testNode,
bool &doRecurse)
const override;
214 bool nodeMatches(NodeImpl *testNode,
bool &doRecurse)
const override;
216 ClassNames m_classNames;
219 class StaticNodeListImpl :
public NodeListImpl
222 StaticNodeListImpl();
223 ~StaticNodeListImpl();
226 unsigned long length()
const override;
227 NodeImpl *item(
unsigned long index)
const override;
230 void append(NodeImpl *n);
237 return length() == 0;
243 enum NormalizationKind {
252 void normalizeUpto(NormalizationKind kind);
255 void setKnownNormalization(NormalizationKind kind);
257 NormalizationKind knownNormalization()
const;
259 WTF::Vector<SharedPtr<NodeImpl> > m_kids;
260 NormalizationKind m_knownNormalization;
NodeList which lists all Nodes in a document with a given tag name.
bool operator==(const Qt3DRender::QGraphicsApiFilter &reference, const Qt3DRender::QGraphicsApiFilter &sample)
Type type(const QSqlDatabase &db)
This class implements the basic string we use in the DOM.
This library provides a full-featured HTML parser and widget.
For getElementsByClassName.
NodeList which lists all Nodes in a Element with a given "name=" tag.
KDB_EXPORT KDbVersionInfo version()