#include "core/dom/DocumentType.h"
#include "core/dom/Element.h"
#include "core/dom/ElementRareData.h"
+#include "core/dom/ElementTraversal.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/LiveNodeList.h"
#include "core/dom/NodeRareData.h"
+#include "core/dom/NodeRenderingTraversal.h"
#include "core/dom/NodeTraversal.h"
#include "core/dom/ProcessingInstruction.h"
#include "core/dom/Range.h"
#include "core/dom/StaticNodeList.h"
-#include "core/dom/TagNodeList.h"
#include "core/dom/TemplateContentDocumentFragment.h"
#include "core/dom/Text.h"
#include "core/dom/TreeScopeAdopter.h"
Element* element = toElement(node);
HashMap<String, size_t>::AddResult result = perTagCount.add(element->tagName(), 1);
if (!result.isNewEntry)
- result.iterator->value++;
+ result.storedValue->value++;
if (ElementData* elementData = element->elementData()) {
attributes += elementData->length();
Document& document = this->document();
if (hasEventTargetData()) {
- document.didRemoveEventTargetNode(this);
clearEventTargetData();
+ document.didClearTouchEventHandlers(this);
}
if (AXObjectCache* cache = document.existingAXObjectCache())
setFlag(isLink && !SVGImage::isInSVGImage(toElement(this)), IsLinkFlag);
}
+void Node::setNeedsStyleInvalidation()
+{
+ setFlag(NeedsStyleInvalidation);
+ markAncestorsWithChildNeedsStyleInvalidation();
+}
+
+void Node::markAncestorsWithChildNeedsStyleInvalidation()
+{
+ for (Node* node = this; node && !node->childNeedsStyleInvalidation(); node = node->parentOrShadowHostNode())
+ node->setChildNeedsStyleInvalidation();
+ if (document().childNeedsStyleInvalidation())
+ document().scheduleStyleRecalc();
+}
+
void Node::markAncestorsWithChildNeedsDistributionRecalc()
{
for (Node* node = this; node && !node->childNeedsDistributionRecalc(); node = node->parentOrShadowHostNode())
bool Node::isInert() const
{
const HTMLDialogElement* dialog = document().activeModalDialog();
- if (dialog && this != document() && !dialog->containsIncludingShadowDOM(this))
+ if (dialog && this != document() && !NodeRenderingTraversal::contains(dialog, this))
return true;
return document().ownerElement() && document().ownerElement()->isInert();
}
document().invalidateNodeListCaches(attrName);
for (Node* node = this; node; node = node->parentNode()) {
- if (!node->hasRareData())
- continue;
- NodeRareData* data = node->rareData();
- if (data->nodeLists())
- data->nodeLists()->invalidateCaches(attrName);
+ if (NodeListsNodeData* lists = node->nodeLists())
+ lists->invalidateCaches(attrName);
}
}
return parentOrShadowHostNode() ? parentOrShadowHostNode()->canStartSelection() : true;
}
-bool Node::isRegisteredWithNamedFlow() const
-{
- return document().renderView()->flowThreadController()->isContentNodeRegisteredWithAnyNamedFlow(this);
-}
-
Element* Node::shadowHost() const
{
if (ShadowRoot* root = containingShadowRoot())
if (documentTypeThis->internalSubset() != documentTypeOther->internalSubset())
return false;
-
- // FIXME: We don't compare entities or notations because currently both are always empty.
}
return true;
// --------
-void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
-{
- NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicNameCaches.end();
- for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begin(); it != atomicNameCacheEnd; ++it)
- it->value->invalidateCache(attrName);
-
- NodeListNameCacheMap::const_iterator nameCacheEnd = m_nameCaches.end();
- for (NodeListNameCacheMap::const_iterator it = m_nameCaches.begin(); it != nameCacheEnd; ++it)
- it->value->invalidateCache(attrName);
-
- if (attrName)
- return;
-
- TagNodeListCacheNS::iterator tagCacheEnd = m_tagNodeListCacheNS.end();
- for (TagNodeListCacheNS::iterator it = m_tagNodeListCacheNS.begin(); it != tagCacheEnd; ++it)
- it->value->invalidateCache();
-}
-
Node* Node::enclosingLinkEventParentOrSelf()
{
for (Node* node = this; node; node = node->parentOrShadowHostNode()) {
return tryRemoveEventListener(this, eventType, listener, useCapture);
}
+void Node::removeAllEventListeners()
+{
+ EventTarget::removeAllEventListeners();
+ document().didClearTouchEventHandlers(this);
+}
+
typedef HashMap<Node*, OwnPtr<EventTargetData> > EventTargetDataMap;
static EventTargetDataMap& eventTargetDataMap()
MutationRecordDeliveryOptions deliveryOptions = registration.deliveryOptions();
HashMap<MutationObserver*, MutationRecordDeliveryOptions>::AddResult result = observers.add(registration.observer(), deliveryOptions);
if (!result.isNewEntry)
- result.iterator->value |= deliveryOptions;
+ result.storedValue->value |= deliveryOptions;
}
}
}
setFlag(newState == Upgraded, CustomElementUpgraded);
if (oldState == NotCustomElement || newState == Upgraded)
- setNeedsStyleRecalc(); // :unresolved has changed
+ setNeedsStyleRecalc(SubtreeStyleChange); // :unresolved has changed
}
} // namespace WebCore