summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/Document.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-25 13:35:59 +0200
commit79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4 (patch)
tree0287b1a69d84492c901e8bc820e635e7133809a0 /Source/WebCore/dom/Document.cpp
parent682ab87480e7757346802ce7f54cfdbdfeb2339e (diff)
downloadqtwebkit-79ad030d505ccf79cf10aa9f8189ca3e2f61f6f4.tar.gz
Imported WebKit commit c4b613825abd39ac739a47d7b4410468fcef66dc (http://svn.webkit.org/repository/webkit/trunk@121147)
New snapshot that includes Win32 debug build fix (use SVGAllInOne)
Diffstat (limited to 'Source/WebCore/dom/Document.cpp')
-rw-r--r--Source/WebCore/dom/Document.cpp39
1 files changed, 12 insertions, 27 deletions
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index b93c6b0a8..132680ab0 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -3864,14 +3864,19 @@ void Document::setCSSTarget(Element* n)
void Document::registerDynamicSubtreeNodeList(DynamicSubtreeNodeList* list)
{
- ensureRareData()->ensureNodeLists(this)->m_listsInvalidatedAtDocument.add(list);
+ m_listsInvalidatedAtDocument.add(list);
}
void Document::unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList* list)
{
- ASSERT(hasRareData());
- ASSERT(rareData()->nodeLists());
- rareData()->nodeLists()->m_listsInvalidatedAtDocument.remove(list);
+ m_listsInvalidatedAtDocument.remove(list);
+}
+
+void Document::clearNodeListCaches()
+{
+ HashSet<DynamicSubtreeNodeList*>::iterator end = m_listsInvalidatedAtDocument.end();
+ for (HashSet<DynamicSubtreeNodeList*>::iterator it = m_listsInvalidatedAtDocument.begin(); it != end; ++it)
+ (*it)->invalidateCache();
}
void Document::attachNodeIterator(NodeIterator* ni)
@@ -4126,7 +4131,7 @@ HTMLFrameOwnerElement* Document::ownerElement() const
String Document::cookie(ExceptionCode& ec) const
{
- if (page() && !page()->cookieEnabled())
+ if (page() && !page()->settings()->cookieEnabled())
return String();
// FIXME: The HTML5 DOM spec states that this attribute can raise an
@@ -4147,7 +4152,7 @@ String Document::cookie(ExceptionCode& ec) const
void Document::setCookie(const String& value, ExceptionCode& ec)
{
- if (page() && !page()->cookieEnabled())
+ if (page() && !page()->settings()->cookieEnabled())
return;
// FIXME: The HTML5 DOM spec states that this attribute can raise an
@@ -5921,31 +5926,11 @@ DocumentLoader* Document::loader() const
#if ENABLE(MICRODATA)
PassRefPtr<NodeList> Document::getItems(const String& typeNames)
{
- NodeListsNodeData* nodeLists = ensureRareData()->ensureNodeLists(this);
-
// Since documet.getItem() is allowed for microdata, typeNames will be null string.
// In this case we need to create an unique string identifier to map such request in the cache.
String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
- NodeListsNodeData::MicroDataItemListCache::AddResult result = nodeLists->m_microDataItemListCache.add(localTypeNames, 0);
- if (!result.isNewEntry)
- return PassRefPtr<NodeList>(result.iterator->second);
-
- RefPtr<MicroDataItemList> list = MicroDataItemList::create(this, typeNames);
- result.iterator->second = list.get();
- return list.release();
-}
-
-void Document::removeCachedMicroDataItemList(MicroDataItemList* list, const String& typeNames)
-{
- ASSERT(rareData());
- ASSERT(rareData()->nodeLists());
-
- NodeListsNodeData* data = rareData()->nodeLists();
-
- String localTypeNames = typeNames.isNull() ? String("http://webkit.org/microdata/undefinedItemType") : typeNames;
- ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeNames));
- data->m_microDataItemListCache.remove(localTypeNames);
+ return ensureRareData()->ensureNodeLists(this)->addCacheWithName<MicroDataItemList>(this, DynamicNodeList::MicroDataItemListType, localTypeNames);
}
#endif