Skip to content

Commit

Permalink
Add a fast path to Node::moveNodeToNewDocument
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=268065

Reviewed by Yusuke Suzuki.

Add a fast path to Node::moveNodeToNewDocument when documents don't have ranges, node iterators,
event listeners, etc... as it is the case with the document created by DOMParser by default.

In the fast path, we only call Element::didMoveToNewDocument on elements when newly introduced
TypeFlag::HasDidMoveToNewDocument flag is set. Only a select few elements set this flag upon
construction so it avoids virtual function calls in most cases. We also coalesce the updates to
each document's referencing node count so that they're updated once at the end instead of getting
incremented and decremented by 1 upon visiting each node.

* Source/WebCore/Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::HTMLModelElement):
* Source/WebCore/dom/Document.h:
(WebCore::Document::incrementReferencingNodeCount):
(WebCore::Document::decrementReferencingNodeCount):
(WebCore::Document::hasRanges):
(WebCore::Document::hasEventListeners const):
* Source/WebCore/dom/DocumentInlines.h:
(WebCore::Document::hasNodeIterators const):
* Source/WebCore/dom/Node.cpp:
(WebCore::traverseSubtreeToUpdateTreeScope):
(WebCore::isDocumentEligibleForFastAdoption):
(WebCore::Node::moveShadowTreeToNewDocumentFastCase):
(WebCore::Node::moveShadowTreeToNewDocumentSlowCase): Renamed from moveShadowTreeToNewDocument.
(WebCore::Node::moveTreeToNewScope):
(WebCore::Node::moveNodeToNewDocumentFastCase):
(WebCore::Node::moveNodeToNewDocumentSlowCase): Renamed from moveNodeToNewDocument.
* Source/WebCore/dom/Node.h:
* Source/WebCore/html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
* Source/WebCore/html/HTMLDataListElement.cpp:
(WebCore::HTMLDataListElement::HTMLDataListElement):
* Source/WebCore/html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::HTMLFormControlElement):
* Source/WebCore/html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::HTMLFormElement):
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
* Source/WebCore/html/HTMLMaybeFormAssociatedCustomElement.cpp:
(WebCore::HTMLMaybeFormAssociatedCustomElement::HTMLMaybeFormAssociatedCustomElement):
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* Source/WebCore/html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement):
* Source/WebCore/html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::HTMLPlugInElement):
* Source/WebCore/html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
* Source/WebCore/html/HTMLTemplateElement.cpp:
(WebCore::HTMLTemplateElement::HTMLTemplateElement):
* Source/WebCore/svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
* Source/WebCore/svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
* Source/WebCore/svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement):
* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):

Canonical link: https://commits.webkit.org/273544@main
  • Loading branch information
rniwa committed Jan 26, 2024
1 parent 7c475be commit 3b81a10
Show file tree
Hide file tree
Showing 21 changed files with 132 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Source/WebCore/Modules/model-element/HTMLModelElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ using namespace HTMLNames;
WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLModelElement);

HTMLModelElement::HTMLModelElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document, TypeFlag::HasCustomStyleResolveCallbacks)
: HTMLElement(tagName, document, { TypeFlag::HasCustomStyleResolveCallbacks, TypeFlag::HasDidMoveToNewDocument })
, ActiveDOMObject(document)
, m_readyPromise { makeUniqueRef<ReadyPromise>(*this, &HTMLModelElement::readyPromiseResolve) }
{
Expand Down
14 changes: 9 additions & 5 deletions Source/WebCore/dom/Document.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,16 +427,17 @@ class Document
// not enough to keep it from removing its children. This allows a
// node that outlives its document to still have a valid document
// pointer without introducing reference cycles.
void incrementReferencingNodeCount()
ALWAYS_INLINE void incrementReferencingNodeCount(unsigned count = 1)
{
ASSERT(!m_deletionHasBegun);
++m_referencingNodeCount;
m_referencingNodeCount += count;
}

void decrementReferencingNodeCount()
ALWAYS_INLINE void decrementReferencingNodeCount(unsigned count = 1)
{
ASSERT(!m_deletionHasBegun || !m_referencingNodeCount);
--m_referencingNodeCount;
ASSERT(m_referencingNodeCount >= count || (!m_referencingNodeCount && m_deletionHasBegun));
m_referencingNodeCount -= count;
if (!m_referencingNodeCount && !refCount()) {
#if ASSERT_ENABLED
m_deletionHasBegun = true;
Expand Down Expand Up @@ -960,10 +961,12 @@ class Document

void attachNodeIterator(NodeIterator&);
void detachNodeIterator(NodeIterator&);
inline bool hasNodeIterators() const;
void moveNodeIteratorsToNewDocument(Node&, Document&);

void attachRange(Range&);
void detachRange(Range&);
bool hasRanges() { return !m_ranges.isEmpty(); }

void updateRangesAfterChildrenChanged(ContainerNode&);
// nodeChildrenWillBeRemoved is used when removing all node children at once.
Expand Down Expand Up @@ -1036,7 +1039,8 @@ class Document

void didAddEventListenersOfType(const AtomString&, unsigned = 1);
void didRemoveEventListenersOfType(const AtomString&, unsigned = 1);
bool hasEventListnersOfType(const AtomString& type) const { return m_eventListenerCounts.inlineGet(type); }
bool hasNodeWithEventListeners() const { return !m_eventListenerCounts.isEmpty(); }
bool hasEventListenersOfType(const AtomString& type) const { return m_eventListenerCounts.inlineGet(type); }

bool hasConnectedPluginElements() { return m_connectedPluginElementCount; }
void didConnectPluginElement() { ++m_connectedPluginElementCount; }
Expand Down
6 changes: 6 additions & 0 deletions Source/WebCore/dom/DocumentInlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "FullscreenManager.h"
#include "LocalDOMWindow.h"
#include "MediaProducer.h"
#include "NodeIterator.h"
#include "ReportingScope.h"
#include "SecurityOrigin.h"
#include "TextResourceDecoder.h"
Expand Down Expand Up @@ -128,6 +129,11 @@ inline Ref<Document> Document::create(const Settings& settings, const URL& url)
return document;
}

bool Document::hasNodeIterators() const
{
return !m_nodeIterators.isEmptyIgnoringNullReferences();
}

inline void Document::invalidateAccessKeyCache()
{
if (UNLIKELY(m_accessKeyCache))
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/dom/EventDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ static HTMLInputElement* findInputElementInEventPath(const EventPath& path)

static bool hasRelevantEventListener(Document& document, const Event& event)
{
if (document.hasEventListnersOfType(event.type()))
if (document.hasEventListenersOfType(event.type()))
return true;

auto legacyType = EventTarget::legacyTypeForEvent(event);
if (!legacyType.isNull() && document.hasEventListnersOfType(legacyType))
if (!legacyType.isNull() && document.hasEventListenersOfType(legacyType))
return true;

return false;
Expand Down
112 changes: 92 additions & 20 deletions Source/WebCore/dom/Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,33 +2111,65 @@ EventTargetInterface Node::eventTargetInterface() const
}

template <typename MoveNodeFunction, typename MoveShadowRootFunction>
static void traverseSubtreeToUpdateTreeScope(Node& root, MoveNodeFunction moveNode, MoveShadowRootFunction moveShadowRoot)
static unsigned traverseSubtreeToUpdateTreeScope(Node& root, MoveNodeFunction moveNode, MoveShadowRootFunction moveShadowRoot)
{
unsigned count = 0;
for (Node* node = &root; node; node = NodeTraversal::next(*node, &root)) {
moveNode(*node);
++count;

auto* element = dynamicDowncast<Element>(*node);
if (!element)
continue;

if (element->hasSyntheticAttrChildNodes()) {
for (auto& attr : element->attrNodeList())
for (auto& attr : element->attrNodeList()) {
moveNode(*attr);
++count;
}
}

if (auto* shadow = element->shadowRoot())
moveShadowRoot(*shadow);
count += moveShadowRoot(*shadow);
}
return count;
}

static ALWAYS_INLINE bool isDocumentEligibleForFastAdoption(Document& oldDocument, Document& newDocument)
{
return !oldDocument.hasNodeIterators()
&& !oldDocument.hasRanges()
&& !oldDocument.hasNodeWithEventListeners()
&& !oldDocument.hasMutationObservers()
&& !oldDocument.textManipulationControllerIfExists()
&& !oldDocument.shouldInvalidateNodeListAndCollectionCaches()
&& !oldDocument.numberOfIntersectionObservers()
&& (!AXObjectCache::accessibilityEnabled() || !oldDocument.existingAXObjectCache())
&& oldDocument.inQuirksMode() == newDocument.inQuirksMode();
}

inline void Node::moveShadowTreeToNewDocument(ShadowRoot& shadowRoot, Document& oldDocument, Document& newDocument)
inline unsigned Node::moveShadowTreeToNewDocumentFastCase(ShadowRoot& shadowRoot, Document& oldDocument, Document& newDocument)
{
traverseSubtreeToUpdateTreeScope(shadowRoot, [&oldDocument, &newDocument](Node& node) {
node.moveNodeToNewDocument(oldDocument, newDocument);
ASSERT(isDocumentEligibleForFastAdoption(oldDocument, newDocument));
return traverseSubtreeToUpdateTreeScope(shadowRoot, [&](Node& node) {
node.moveNodeToNewDocumentFastCase(oldDocument, newDocument);
}, [&oldDocument, &newDocument](ShadowRoot& innerShadowRoot) {
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&innerShadowRoot.document() == &oldDocument);
innerShadowRoot.moveShadowRootToNewDocument(oldDocument, newDocument);
moveShadowTreeToNewDocument(innerShadowRoot, oldDocument, newDocument);
return moveShadowTreeToNewDocumentFastCase(innerShadowRoot, oldDocument, newDocument);
});
}

inline void Node::moveShadowTreeToNewDocumentSlowCase(ShadowRoot& shadowRoot, Document& oldDocument, Document& newDocument)
{
ASSERT(!isDocumentEligibleForFastAdoption(oldDocument, newDocument));
traverseSubtreeToUpdateTreeScope(shadowRoot, [&](Node& node) {
node.moveNodeToNewDocumentSlowCase(oldDocument, newDocument);
}, [&oldDocument, &newDocument](ShadowRoot& innerShadowRoot) {
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&innerShadowRoot.document() == &oldDocument);
innerShadowRoot.moveShadowRootToNewDocument(oldDocument, newDocument);
moveShadowTreeToNewDocumentSlowCase(innerShadowRoot, oldDocument, newDocument);
return 0; // Unused.
});
}

Expand All @@ -2150,18 +2182,36 @@ void Node::moveTreeToNewScope(Node& root, TreeScope& oldScope, TreeScope& newSco
bool newScopeIsUAShadowTree = newScope.rootNode().hasBeenInUserAgentShadowTree();
if (&oldDocument != &newDocument) {
oldDocument.incrementReferencingNodeCount();
traverseSubtreeToUpdateTreeScope(root, [&](Node& node) {
ASSERT(!node.isTreeScope());
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&node.treeScope() == &oldScope);
if (newScopeIsUAShadowTree)
node.setEventTargetFlag(EventTargetFlag::HasBeenInUserAgentShadowTree);
node.setTreeScope(newScope);
node.moveNodeToNewDocument(oldDocument, newDocument);
}, [&](ShadowRoot& shadowRoot) {
ASSERT_WITH_SECURITY_IMPLICATION(&shadowRoot.document() == &oldDocument);
shadowRoot.moveShadowRootToNewParentScope(newScope, newDocument);
moveShadowTreeToNewDocument(shadowRoot, oldDocument, newDocument);
});
bool isFastCase = isDocumentEligibleForFastAdoption(oldDocument, newDocument) && !newScopeIsUAShadowTree;
if (isFastCase) {
unsigned nodeCount = traverseSubtreeToUpdateTreeScope(root, [&](Node& node) {
ASSERT(!node.isTreeScope());
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&node.treeScope() == &oldScope);
node.setTreeScope(newScope);
node.moveNodeToNewDocumentFastCase(oldDocument, newDocument);
}, [&](ShadowRoot& shadowRoot) {
ASSERT_WITH_SECURITY_IMPLICATION(&shadowRoot.document() == &oldDocument);
shadowRoot.moveShadowRootToNewParentScope(newScope, newDocument);
return moveShadowTreeToNewDocumentFastCase(shadowRoot, oldDocument, newDocument);
});
// UNUSED_PARAM(nodeCount);
newDocument.incrementReferencingNodeCount(nodeCount);
oldDocument.decrementReferencingNodeCount(nodeCount);
} else {
traverseSubtreeToUpdateTreeScope(root, [&](Node& node) {
ASSERT(!node.isTreeScope());
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&node.treeScope() == &oldScope);
if (newScopeIsUAShadowTree)
node.setEventTargetFlag(EventTargetFlag::HasBeenInUserAgentShadowTree);
node.setTreeScope(newScope);
node.moveNodeToNewDocumentSlowCase(oldDocument, newDocument);
}, [&](ShadowRoot& shadowRoot) {
ASSERT_WITH_SECURITY_IMPLICATION(&shadowRoot.document() == &oldDocument);
shadowRoot.moveShadowRootToNewParentScope(newScope, newDocument);
moveShadowTreeToNewDocumentSlowCase(shadowRoot, oldDocument, newDocument);
return 0; // Unused
});
}
RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(&oldScope.documentScope() == &oldDocument && &newScope.documentScope() == &newDocument);
oldDocument.decrementReferencingNodeCount();
} else {
Expand All @@ -2177,11 +2227,33 @@ void Node::moveTreeToNewScope(Node& root, TreeScope& oldScope, TreeScope& newSco
nodeLists->adoptTreeScope();
}, [&newScope](ShadowRoot& shadowRoot) {
shadowRoot.setParentTreeScope(newScope);
return 0; // Unused.
});
}
}

void Node::moveNodeToNewDocument(Document& oldDocument, Document& newDocument)
void Node::moveNodeToNewDocumentFastCase(Document& oldDocument, Document& newDocument)
{
ASSERT(!oldDocument.shouldInvalidateNodeListAndCollectionCaches());
ASSERT(!oldDocument.hasNodeIterators());
ASSERT(!oldDocument.hasRanges());
ASSERT(!AXObjectCache::accessibilityEnabled() || !oldDocument.existingAXObjectCache());
ASSERT(!oldDocument.textManipulationControllerIfExists());
ASSERT(!oldDocument.hasNodeWithEventListeners());
ASSERT(!hasEventListeners());
ASSERT(!mutationObserverRegistry());
ASSERT(!transientMutationObserverRegistry());
ASSERT(!oldDocument.numberOfIntersectionObservers());

if (!hasTypeFlag(TypeFlag::HasDidMoveToNewDocument) && !hasEventTargetFlag(EventTargetFlag::HasLangAttr) && !hasEventTargetFlag(EventTargetFlag::HasXMLLangAttr)
&& !isDefinedCustomElement())
return;

if (auto* element = dynamicDowncast<Element>(*this))
element->didMoveToNewDocument(oldDocument, newDocument);
}

void Node::moveNodeToNewDocumentSlowCase(Document& oldDocument, Document& newDocument)
{
newDocument.incrementReferencingNodeCount();
oldDocument.decrementReferencingNodeCount();
Expand Down
8 changes: 5 additions & 3 deletions Source/WebCore/dom/Node.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ class Node : public EventTarget, public CanMakeCheckedPtr {
IsUnknownElement = 1 << 8,
IsSpecialInternalNode = 1 << 9, // DocumentFragment node for innerHTML/outerHTML or EditingText node.
HasCustomStyleResolveCallbacks = 1 << 10,
// 1 free bit.
HasDidMoveToNewDocument = 1 << 11,
};
static constexpr auto typeFlagBitCount = 12;

Expand Down Expand Up @@ -742,9 +742,11 @@ class Node : public EventTarget, public CanMakeCheckedPtr {

void adjustStyleValidity(Style::Validity, Style::InvalidationMode);

static void moveShadowTreeToNewDocument(ShadowRoot&, Document& oldDocument, Document& newDocument);
static unsigned moveShadowTreeToNewDocumentFastCase(ShadowRoot&, Document& oldDocument, Document& newDocument);
static void moveShadowTreeToNewDocumentSlowCase(ShadowRoot&, Document& oldDocument, Document& newDocument);
static void moveTreeToNewScope(Node&, TreeScope& oldScope, TreeScope& newScope);
void moveNodeToNewDocument(Document& oldDocument, Document& newDocument);
void moveNodeToNewDocumentFastCase(Document& oldDocument, Document& newDocument);
void moveNodeToNewDocumentSlowCase(Document& oldDocument, Document& newDocument);

WEBCORE_EXPORT void notifyInspectorOfRendererChange();

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLCanvasElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const int defaultWidth = 300;
const int defaultHeight = 150;

HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document)
: HTMLElement(tagName, document, TypeFlag::HasDidMoveToNewDocument)
, CanvasBase(IntSize(defaultWidth, defaultHeight), document.noiseInjectionHashSalt())
, ActiveDOMObject(document)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLDataListElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLDataListElement);

inline HTMLDataListElement::HTMLDataListElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document)
: HTMLElement(tagName, document, TypeFlag::HasDidMoveToNewDocument)
{
document.incrementDataListElementCount();
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLFormControlElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLFormControlElement);
using namespace HTMLNames;

HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
: HTMLElement(tagName, document, TypeFlag::HasCustomStyleResolveCallbacks)
: HTMLElement(tagName, document, { TypeFlag::HasCustomStyleResolveCallbacks, TypeFlag::HasDidMoveToNewDocument } )
, ValidatedFormListedElement(form)
, m_isRequired(false)
, m_valueMatchesRenderer(false)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLFormElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static FormRelAttributes parseFormRelAttributes(StringView string)
}

HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document)
: HTMLElement(tagName, document, TypeFlag::HasDidMoveToNewDocument)
{
ASSERT(hasTagName(formTag));
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLImageElement);
using namespace HTMLNames;

HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document& document, HTMLFormElement* form)
: HTMLElement(tagName, document, TypeFlag::HasCustomStyleResolveCallbacks)
: HTMLElement(tagName, document, { TypeFlag::HasCustomStyleResolveCallbacks, TypeFlag::HasDidMoveToNewDocument })
, FormAssociatedElement(form)
, ActiveDOMObject(document)
, m_imageLoader(makeUnique<HTMLImageLoader>(*this))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLMaybeFormAssociatedCustomElement);
using namespace HTMLNames;

HTMLMaybeFormAssociatedCustomElement::HTMLMaybeFormAssociatedCustomElement(const QualifiedName& tagName, Document& document)
: HTMLElement { tagName, document }
: HTMLElement { tagName, document, TypeFlag::HasDidMoveToNewDocument }
{
ASSERT(Document::validateCustomElementName(tagName.localName()) == CustomElementNameValidationStatus::Valid);
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static bool defaultVolumeLocked()
}

HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& document, bool createdByParser)
: HTMLElement(tagName, document, TypeFlag::HasCustomStyleResolveCallbacks)
: HTMLElement(tagName, document, { TypeFlag::HasCustomStyleResolveCallbacks, TypeFlag::HasDidMoveToNewDocument })
, ActiveDOMObject(document)
, m_progressEventTimer(*this, &HTMLMediaElement::progressEventTimerFired)
, m_playbackProgressTimer(*this, &HTMLMediaElement::playbackProgressTimerFired)
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/html/HTMLPlugInElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLPlugInElement);

using namespace HTMLNames;

HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& document)
: HTMLFrameOwnerElement(tagName, document, TypeFlag::HasCustomStyleResolveCallbacks)
HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& document, OptionSet<TypeFlag> typeFlags)
: HTMLFrameOwnerElement(tagName, document, typeFlags | TypeFlag::HasCustomStyleResolveCallbacks)
, m_swapRendererTimer(*this, &HTMLPlugInElement::swapRendererTimerFired)
{
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLPlugInElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class HTMLPlugInElement : public HTMLFrameOwnerElement {
WEBCORE_EXPORT bool isReplacementObscured();

protected:
HTMLPlugInElement(const QualifiedName& tagName, Document&);
HTMLPlugInElement(const QualifiedName& tagName, Document&, OptionSet<TypeFlag> = { });

bool canContainRangeEndPoint() const override { return false; }
void willDetachRenderers() override;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLPlugInImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLPlugInImageElement);

HTMLPlugInImageElement::HTMLPlugInImageElement(const QualifiedName& tagName, Document& document)
: HTMLPlugInElement(tagName, document)
: HTMLPlugInElement(tagName, document, TypeFlag::HasDidMoveToNewDocument)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/html/HTMLTemplateElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ WTF_MAKE_ISO_ALLOCATED_IMPL(HTMLTemplateElement);
using namespace HTMLNames;

inline HTMLTemplateElement::HTMLTemplateElement(const QualifiedName& tagName, Document& document)
: HTMLElement(tagName, document)
: HTMLElement(tagName, document, TypeFlag::HasDidMoveToNewDocument)
{
}

Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/svg/SVGGraphicsElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ namespace WebCore {

WTF_MAKE_ISO_ALLOCATED_IMPL(SVGGraphicsElement);

SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& document, UniqueRef<SVGPropertyRegistry>&& propertyRegistry)
: SVGElement(tagName, document, WTFMove(propertyRegistry))
SVGGraphicsElement::SVGGraphicsElement(const QualifiedName& tagName, Document& document, UniqueRef<SVGPropertyRegistry>&& propertyRegistry, OptionSet<TypeFlag> typeFlags)
: SVGElement(tagName, document, WTFMove(propertyRegistry), typeFlags)
, SVGTests(this)
, m_shouldIsolateBlending(false)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/svg/SVGGraphicsElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class SVGGraphicsElement : public SVGElement, public SVGTransformable, public SV
SVGAnimatedTransformList& transformAnimated() { return m_transform; }

protected:
SVGGraphicsElement(const QualifiedName&, Document&, UniqueRef<SVGPropertyRegistry>&&);
SVGGraphicsElement(const QualifiedName&, Document&, UniqueRef<SVGPropertyRegistry>&&, OptionSet<TypeFlag> = { });

void attributeChanged(const QualifiedName&, const AtomString& oldValue, const AtomString& newValue, AttributeModificationReason) override;
void svgAttributeChanged(const QualifiedName&) override;
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/svg/SVGImageElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(SVGImageElement);

inline SVGImageElement::SVGImageElement(const QualifiedName& tagName, Document& document)
: SVGGraphicsElement(tagName, document, makeUniqueRef<PropertyRegistry>(*this))
: SVGGraphicsElement(tagName, document, makeUniqueRef<PropertyRegistry>(*this), TypeFlag::HasDidMoveToNewDocument)
, SVGURIReference(this)
, m_imageLoader(*this)
{
Expand Down
Loading

0 comments on commit 3b81a10

Please sign in to comment.