haikuwebkit/Source/WebCore/page/ios
Cameron McCormack 918e358163 Stop tracking form elements with FormController
https://bugs.webkit.org/show_bug.cgi?id=228724
<rdar://problem/81435095>

Reviewed by Darin Adler.

Source/WebCore:

FormController currently tracks the insertion order of
HTMLFormElementWithState objects in the document.  But we don't need
to know this list of form controls until the time we need to save
form state for the document (e.g. on pagehide).  So we instead
traverse the document to find those elements at the point we need
them, rather than maintain FormController::m_formElementsWithState.

This is a small speedup (1-2%) on a few of the Speedometer subtests
that insert and remove many input elements.

A future optimization could record on the Document whether there are
any input elements that have had their value changed, since it's
probably common for pages with form controls to never be changed.

* dom/Document.cpp:
(WebCore::Document::formElementsState const): Traverse the document to
find all the HTMLFormElementWithState objects.
* dom/Element.h:
(WebCore::Element::isFormControlElementWithState const):
* html/FormController.cpp:
(WebCore::FormController::createSavedFormStateMap):
(WebCore::FormController::formElementsState const):
* html/FormController.h:
* html/HTMLFormControlElementWithState.cpp:
(WebCore::HTMLFormControlElementWithState::insertedIntoAncestor):
Track the order that HTMLFormControlElementWithState objects are
inserted into the document.
(WebCore::HTMLFormControlElementWithState::removedFromAncestor):
* html/HTMLFormControlElementWithState.h:
(WebCore::HTMLFormControlElementWithState::insertionIndex const):
(isType):
* page/Frame.h: Remove unused formElementsCharacterCount.
* page/ios/FrameIOS.mm:

Source/WebKitLegacy/mac:

formElementsCharacterCount is unused and can be removed.

* WebView/WebFrame.mm:
* WebView/WebFramePrivate.h:


Canonical link: https://commits.webkit.org/240309@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-08-06 03:10:40 +00:00
..
ContentChangeObserver.cpp Clients of optional should use has_value instead of relying on hasValue macro 2021-05-29 22:08:56 +00:00
ContentChangeObserver.h Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
DOMTimerHoldingTank.cpp Use SortedArrayMap in a few more places 2021-05-02 03:09:34 +00:00
DOMTimerHoldingTank.h
EventHandlerIOS.mm Remove WTF::Optional synonym for std::optional, using that class template directly instead 2021-05-30 16:11:40 +00:00
FrameIOS.mm Stop tracking form elements with FormController 2021-08-06 03:10:40 +00:00
WebEventRegion.h
WebEventRegion.mm