Changeset 150683 in webkit
- Timestamp:
- May 25, 2013 2:08:38 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150682 r150683 1 2013-05-25 Andreas Kling <akling@apple.com> 2 3 Document::formController() should return a reference. 4 <http://webkit.org/b/116758> 5 6 Reviewed by Antti Koivisto. 7 8 The formController() is created on demand, so return a reference instead. 9 10 * dom/Document.h: 11 * dom/Document.cpp: 12 (WebCore::Document::formController): 13 (WebCore::Document::setStateForNewFormElements): 14 * html/HTMLFormControlElementWithState.cpp: 15 (WebCore::HTMLFormControlElementWithState::HTMLFormControlElementWithState): 16 (WebCore::HTMLFormControlElementWithState::~HTMLFormControlElementWithState): 17 (WebCore::HTMLFormControlElementWithState::didMoveToNewDocument): 18 (WebCore::HTMLFormControlElementWithState::finishParsingChildren): 19 * html/HTMLFormElement.cpp: 20 (WebCore::HTMLFormElement::~HTMLFormElement): 21 (WebCore::HTMLFormElement::finishParsingChildren): 22 * html/HTMLInputElement.cpp: 23 (WebCore::HTMLInputElement::~HTMLInputElement): 24 (WebCore::HTMLInputElement::didMoveToNewDocument): 25 (WebCore::HTMLInputElement::checkedRadioButtons): 26 1 27 2013-05-25 Sergio Villar Senin <svillar@igalia.com> 2 28 -
trunk/Source/WebCore/dom/Document.cpp
r150560 r150683 1645 1645 } 1646 1646 1647 FormController *Document::formController()1647 FormController& Document::formController() 1648 1648 { 1649 1649 if (!m_formController) 1650 1650 m_formController = FormController::create(); 1651 return m_formController.get();1651 return *m_formController; 1652 1652 } 1653 1653 … … 1663 1663 if (!stateVector.size() && !m_formController) 1664 1664 return; 1665 formController() ->setStateForNewFormElements(stateVector);1665 formController().setStateForNewFormElements(stateVector); 1666 1666 } 1667 1667 -
trunk/Source/WebCore/dom/Document.h
r150560 r150683 492 492 void evaluateMediaQueryList(); 493 493 494 // Never returns 0. 495 FormController* formController(); 494 FormController& formController(); 496 495 Vector<String> formElementsState() const; 497 496 void setStateForNewFormElements(const Vector<String>&); -
trunk/Source/WebCore/html/HTMLFormControlElementWithState.cpp
r150214 r150683 38 38 : HTMLFormControlElement(tagName, doc, f) 39 39 { 40 document()->formController() ->registerFormElementWithState(this);40 document()->formController().registerFormElementWithState(this); 41 41 } 42 42 43 43 HTMLFormControlElementWithState::~HTMLFormControlElementWithState() 44 44 { 45 document()->formController() ->unregisterFormElementWithState(this);45 document()->formController().unregisterFormElementWithState(this); 46 46 } 47 47 … … 49 49 { 50 50 if (oldDocument) 51 oldDocument->formController() ->unregisterFormElementWithState(this);52 document()->formController() ->registerFormElementWithState(this);51 oldDocument->formController().unregisterFormElementWithState(this); 52 document()->formController().registerFormElementWithState(this); 53 53 HTMLFormControlElement::didMoveToNewDocument(oldDocument); 54 54 } … … 85 85 { 86 86 HTMLFormControlElement::finishParsingChildren(); 87 document()->formController() ->restoreControlStateFor(*this);87 document()->formController().restoreControlStateFor(*this); 88 88 } 89 89 -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r149665 r150683 88 88 HTMLFormElement::~HTMLFormElement() 89 89 { 90 document()->formController() ->willDeleteForm(this);90 document()->formController().willDeleteForm(this); 91 91 if (!shouldAutocomplete()) 92 92 document()->unregisterForPageCacheSuspensionCallbacks(this); … … 677 677 { 678 678 HTMLElement::finishParsingChildren(); 679 document()->formController() ->restoreControlStateIn(*this);679 document()->formController().restoreControlStateIn(*this); 680 680 } 681 681 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r150140 r150683 175 175 // We should unregister it to avoid accessing a deleted object. 176 176 if (isRadioButton()) 177 document()->formController() ->checkedRadioButtons().removeButton(this);177 document()->formController().checkedRadioButtons().removeButton(this); 178 178 #if ENABLE(TOUCH_EVENTS) 179 179 if (m_hasTouchEventHandler) … … 1537 1537 oldDocument->unregisterForPageCacheSuspensionCallbacks(this); 1538 1538 if (isRadioButton()) 1539 oldDocument->formController() ->checkedRadioButtons().removeButton(this);1539 oldDocument->formController().checkedRadioButtons().removeButton(this); 1540 1540 #if ENABLE(TOUCH_EVENTS) 1541 1541 if (m_hasTouchEventHandler) … … 1851 1851 return &formElement->checkedRadioButtons(); 1852 1852 if (inDocument()) 1853 return &document()->formController() ->checkedRadioButtons();1853 return &document()->formController().checkedRadioButtons(); 1854 1854 return 0; 1855 1855 }
Note: See TracChangeset
for help on using the changeset viewer.