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

Unified Diff: Source/core/html/HTMLFormElement.h

Issue 145353004: Build HTMLFormElement::m_associatedElements lazily (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix crash Created 6 years, 11 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/dom/IdTargetObserverRegistry.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLFormElement.h
diff --git a/Source/core/html/HTMLFormElement.h b/Source/core/html/HTMLFormElement.h
index 57a759fddf6e404f7e59fef5f80fba6619aa4264..552279119d1b06b9a9fc9dc3d2c2f70e2120a7b1 100644
--- a/Source/core/html/HTMLFormElement.h
+++ b/Source/core/html/HTMLFormElement.h
@@ -111,7 +111,7 @@ public:
CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
- const Vector<FormAssociatedElement*>& associatedElements() const { return m_associatedElements; }
+ const Vector<FormAssociatedElement*>& associatedElements() const;
const Vector<HTMLImageElement*>& imageElements();
void getTextFieldValues(StringPairVector& fieldNamesAndValues) const;
@@ -139,8 +139,7 @@ private:
void scheduleFormSubmission(PassRefPtr<FormSubmission>);
- unsigned formElementIndexWithFormAttribute(Element*, unsigned rangeStart, unsigned rangeEnd);
- unsigned formElementIndex(FormAssociatedElement&);
+ void collectAssociatedElements(Node* root, Vector<FormAssociatedElement*>&) const;
void collectImageElements(Node* root, Vector<HTMLImageElement*>&);
// Returns true if the submission should proceed.
@@ -162,12 +161,12 @@ private:
CheckedRadioButtons m_checkedRadioButtons;
- unsigned m_associatedElementsBeforeIndex;
- unsigned m_associatedElementsAfterIndex;
+ // Do not access m_associatedElements directly. Use associatedElements() instead.
Vector<FormAssociatedElement*> m_associatedElements;
- // Do not read m_imageElements directly. Use imageElements() instead.
+ // Do not access m_imageElements directly. Use imageElements() instead.
Vector<HTMLImageElement*> m_imageElements;
WeakPtrFactory<HTMLFormElement> m_weakPtrFactory;
+ bool m_associatedElementsAreDirty;
bool m_imageElementsAreDirty;
bool m_hasElementsAssociatedByParser;
bool m_didFinishParsingChildren;
« no previous file with comments | « Source/core/dom/IdTargetObserverRegistry.cpp ('k') | Source/core/html/HTMLFormElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698