Enable assertions against DOM mutations in RenderTreeUpdater
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2016 12:56:33 +0000 (12:56 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Apr 2016 12:56:33 +0000 (12:56 +0000)
commit5a161bbc2db352323f953f6eb2a041de5a59cee5
tree50ba6f6f4f22d26a552e30ad15cd6558006c19bf
parent1d5c0730e5df754499c79c2e5a865a3ddb945918
Enable assertions against DOM mutations in RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=156156

Reviewed by Andreas Kling.

Ensure we don't mutate DOM or dispatch events during render tree updates.

* WebCore.xcodeproj/project.pbxproj:
* dom/ContainerNode.cpp:
* dom/ContainerNode.h:
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted.
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted.
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Deleted.

    Move NoEventDispatchAssertion to a header of its own.

* dom/NoEventDispatchAssertion.h: Added.
(WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
(WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion):
(WebCore::NoEventDispatchAssertion::isEventDispatchForbidden):
(WebCore::NoEventDispatchAssertion::dropTemporarily):
(WebCore::NoEventDispatchAssertion::restoreDropped):

    Add a way to disable event assertions temporarily.

* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::ensureCustomFontData):

    Temporary SVG font document may get constructed during render tree update. These can't run scripts or generally
    affect anything outside the font document as it does not have a frame. Disable event assertions temporarily.

    Tested by svg/W3C-SVG-1.1/fonts-elem-07-b.svg

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):

    Enable assertions.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNode.h
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/ElementIteratorAssertions.h
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/NoEventDispatchAssertion.h [new file with mode: 0644]
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/WebKitNamedFlow.cpp
Source/WebCore/history/PageCache.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/loader/cache/CachedSVGFont.cpp
Source/WebCore/style/RenderTreeUpdater.cpp