[webkit-changes] [WebKit/WebKit] 980a1d: Restrict didFinishInsertingNode to connected nodes

Ryosuke Niwa noreply at github.com
Thu Jan 25 11:40:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 980a1d5fec289b479d5fd6f76bea60cdc8d8d25e
      https://github.com/WebKit/WebKit/commit/980a1d5fec289b479d5fd6f76bea60cdc8d8d25e
  Author: Ryosuke Niwa <rniwa at webkit.org>
  Date:   2024-01-25 (Thu, 25 Jan 2024)

  Changed paths:
    M Source/WebCore/dom/ContainerNodeAlgorithms.cpp
    M Source/WebCore/html/HTMLFormControlElement.cpp
    M Source/WebCore/html/HTMLInputElement.cpp
    M Source/WebCore/html/HTMLMaybeFormAssociatedCustomElement.cpp
    M Source/WebCore/html/HTMLMediaElement.cpp
    M Source/WebCore/html/HTMLObjectElement.cpp
    M Source/WebCore/html/ValidatedFormListedElement.cpp
    M Source/WebCore/svg/SVGFEImageElement.cpp
    M Source/WebCore/svg/SVGTextPathElement.cpp

  Log Message:
  -----------
  Restrict didFinishInsertingNode to connected nodes
https://bugs.webkit.org/show_bug.cgi?id=268051

Reviewed by Wenson Hsieh.

Don't call didFinishInsertingNode when a node is not connected to a document.

* Source/WebCore/dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyNodeInsertedIntoTree):
(WebCore::notifyChildNodeInserted):
* Source/WebCore/html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedIntoAncestor):
* Source/WebCore/html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::insertedIntoAncestor):
* Source/WebCore/html/HTMLMaybeFormAssociatedCustomElement.cpp:
(WebCore::HTMLMaybeFormAssociatedCustomElement::insertedIntoAncestor):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::insertedIntoAncestor):
* Source/WebCore/html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::insertedIntoAncestor):
* Source/WebCore/html/ValidatedFormListedElement.cpp:
(WebCore::ValidatedFormListedElement::insertedIntoAncestor): Call resetFormOwner when this insertion
didn't result in getting connected to a new document since didFinishInsertingNode won't be called in
such cases. It's okay to call this function synchronously in this case since we don't rely on
TreeScope::getElementById when the node is not connected to a a document in findAssociatedForm.
* Source/WebCore/svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::insertedIntoAncestor):
* Source/WebCore/svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedIntoAncestor):

Canonical link: https://commits.webkit.org/273523@main




More information about the webkit-changes mailing list