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

Unified Diff: Source/core/html/HTMLSelectElement.cpp

Issue 342283005: Make collection caching code more consistent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 6 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/html/HTMLTableElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLSelectElement.cpp
diff --git a/Source/core/html/HTMLSelectElement.cpp b/Source/core/html/HTMLSelectElement.cpp
index dc4ba51354f365cd2ad157580886b45979f70e0e..f6ecf4f839dcf973bdfd7731b2e537ae8f922f4f 100644
--- a/Source/core/html/HTMLSelectElement.cpp
+++ b/Source/core/html/HTMLSelectElement.cpp
@@ -35,6 +35,7 @@
#include "core/accessibility/AXObjectCache.h"
#include "core/dom/Attribute.h"
#include "core/dom/ElementTraversal.h"
+#include "core/dom/NodeListsNodeData.h"
#include "core/dom/NodeTraversal.h"
#include "core/events/GestureEvent.h"
#include "core/events/KeyboardEvent.h"
@@ -386,12 +387,12 @@ RenderObject* HTMLSelectElement::createRenderer(RenderStyle*)
PassRefPtrWillBeRawPtr<HTMLCollection> HTMLSelectElement::selectedOptions()
{
updateListItemSelectedStates();
- return ensureCachedHTMLCollection(SelectedOptions);
+ return ensureCachedCollection<HTMLCollection>(SelectedOptions);
}
PassRefPtrWillBeRawPtr<HTMLOptionsCollection> HTMLSelectElement::options()
{
- return toHTMLOptionsCollection(ensureCachedHTMLCollection(SelectOptions).get());
+ return ensureCachedCollection<HTMLOptionsCollection>(SelectOptions);
}
void HTMLSelectElement::updateListItemSelectedStates()
@@ -754,7 +755,7 @@ const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& HTMLSelectElement::lis
void HTMLSelectElement::invalidateSelectedItems()
{
- if (HTMLCollection* collection = cachedHTMLCollection(SelectedOptions))
+ if (HTMLCollection* collection = cachedCollection<HTMLCollection>(SelectedOptions))
collection->invalidateCache();
}
@@ -769,7 +770,7 @@ void HTMLSelectElement::setRecalcListItems()
setOptionsChangedOnRenderer();
setNeedsStyleRecalc(SubtreeStyleChange);
if (!inDocument()) {
- if (HTMLCollection* collection = cachedHTMLCollection(SelectOptions))
+ if (HTMLOptionsCollection* collection = cachedCollection<HTMLOptionsCollection>(SelectOptions))
collection->invalidateCache();
}
if (!inDocument())
« no previous file with comments | « Source/core/html/HTMLMapElement.cpp ('k') | Source/core/html/HTMLTableElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698