haikuwebkit/Source/WebCore/dom/ScriptDisallowedScope.h

176 lines
4.7 KiB
C
Raw Permalink Normal View History

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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004-2016 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#pragma once
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
Adopting a child node of a script element can run script https://bugs.webkit.org/show_bug.cgi?id=167318 Patch by Ryosuke Niwa <rniwa@webkit.org> on 2017-02-09 Reviewed by Darin Adler. Source/WebCore: The bug was caused by ScriptElement::childrenChanged indiscriminately running the script. Do this only if some node has been inserted as spec'ed: https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model "The script element is connected and a node or document fragment is inserted into the script element, after any script elements inserted at that time." Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate non-contents child such as text and element being removed or inserted. New behavior matches that of Gecko and Chrome as well as the latest HTML5 specification. Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's ensureCustomFontData used to completely disable this assertion but we no longer have to do this either. To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent held by EventAllowedScope. Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed Tests: fast/html/script-must-not-run-when-child-is-adopted.html fast/html/script-must-not-run-when-child-is-removed.html * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion. * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded and insertBeforeCommon as done elsewhere. (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion. (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here. (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion. (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion. (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely. (WebCore::dispatchChildRemovalEvents): Ditto. * dom/ContainerNode.h: (WebCore::ContainerNode::ChildChange::isInsertion): Added. * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against insertionPoint since EventAllowedScope checks against the root node. * dom/Document.cpp: (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else remove() had resulted in an exception before calling TreeScope::adoptIfNeeded. * dom/Element.cpp: (WebCore::Element::childrenChanged): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node. If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider the event dispatch to be forbidden. (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted. (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of a given node as "safe" for the purpose of checking isEventDispatchForbidden. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated RAII object, and each instance remembers prior instance. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given node is a descendent of any node held by instances of EventAllowedScope. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function for isAllowedNode. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely. * dom/ScriptElement.cpp: (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes. (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running arbitrary author scripts can, indeed, result dispatch any events. * dom/ScriptElement.h: * html/HTMLElement.cpp: (WebCore::textToFragment): Made this a static local function and not return an exception since there is no way appendChild called in this function can throw an exception. (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts. Because of the precise-ness of this check, this does not disable the assertion for "this" element. HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark the shadow tree into which the fragment is inserted safe. (WebCore::HTMLElement::setOuterText): * html/HTMLElement.h: * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::childrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText). * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since the VTT tree is never exposed to author scripts. (WebCore::VTTCue::updateDisplayTree): Ditto. * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on the new SVG document we just created instead of disabling for all DOM trees. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::childrenChanged): LayoutTests: Added regression tests for adopting or removing a child node of a script element. The script must not run when nodes are adopted or removed. * fast/html/script-must-not-run-when-child-is-adopted-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-adopted.html: Added. * fast/html/script-must-not-run-when-child-is-removed-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-removed.html: Added. Canonical link: https://commits.webkit.org/185081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-09 17:59:45 +00:00
#include "ContainerNode.h"
#include "RuntimeApplicationChecks.h"
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
#include <wtf/MainThread.h>
#if PLATFORM(IOS_FAMILY)
#include "WebCoreThread.h"
#endif
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
namespace WebCore {
Rename NoEventDispatchAssertion to ScriptDisallowedScope https://bugs.webkit.org/show_bug.cgi?id=181102 Reviewed by Zalan Bujtas. Renamed the class. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): (WebCore::Document::applyPendingXSLTransformsTimerFired): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/ElementIteratorAssertions.h: (WebCore::ElementIteratorAssertions::ElementIteratorAssertions): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/NoEventDispatchAssertion.h: Removed. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h. (WebCore::ScriptDisallowedScope::ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * html/HTMLElement.cpp: (WebCore::textToFragment): (WebCore::HTMLElement::setInnerText): * html/HTMLMediaElement.cpp: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): (WebCore::VTTCue::updateDisplayTree): (WebCore::VTTCue::removeDisplayTree): * loader/FormSubmission.cpp: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::performLayoutWithFlattening): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::clearShadowTree): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Canonical link: https://commits.webkit.org/196975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-22 01:10:32 +00:00
class ScriptDisallowedScope {
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
public:
Rename NoEventDispatchAssertion to ScriptDisallowedScope https://bugs.webkit.org/show_bug.cgi?id=181102 Reviewed by Zalan Bujtas. Renamed the class. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): (WebCore::Document::applyPendingXSLTransformsTimerFired): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/ElementIteratorAssertions.h: (WebCore::ElementIteratorAssertions::ElementIteratorAssertions): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/NoEventDispatchAssertion.h: Removed. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h. (WebCore::ScriptDisallowedScope::ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * html/HTMLElement.cpp: (WebCore::textToFragment): (WebCore::HTMLElement::setInnerText): * html/HTMLMediaElement.cpp: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): (WebCore::VTTCue::updateDisplayTree): (WebCore::VTTCue::removeDisplayTree): * loader/FormSubmission.cpp: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::performLayoutWithFlattening): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::clearShadowTree): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Canonical link: https://commits.webkit.org/196975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-22 01:10:32 +00:00
// This variant is expensive. Use ScriptDisallowedScope::InMainThread whenever possible.
ScriptDisallowedScope()
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
{
if (!isMainThread())
return;
++s_count;
}
Rename NoEventDispatchAssertion to ScriptDisallowedScope https://bugs.webkit.org/show_bug.cgi?id=181102 Reviewed by Zalan Bujtas. Renamed the class. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): (WebCore::Document::applyPendingXSLTransformsTimerFired): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/ElementIteratorAssertions.h: (WebCore::ElementIteratorAssertions::ElementIteratorAssertions): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/NoEventDispatchAssertion.h: Removed. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h. (WebCore::ScriptDisallowedScope::ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * html/HTMLElement.cpp: (WebCore::textToFragment): (WebCore::HTMLElement::setInnerText): * html/HTMLMediaElement.cpp: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): (WebCore::VTTCue::updateDisplayTree): (WebCore::VTTCue::removeDisplayTree): * loader/FormSubmission.cpp: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::performLayoutWithFlattening): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::clearShadowTree): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Canonical link: https://commits.webkit.org/196975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-22 01:10:32 +00:00
ScriptDisallowedScope(const ScriptDisallowedScope&)
: ScriptDisallowedScope()
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
{
}
Rename NoEventDispatchAssertion to ScriptDisallowedScope https://bugs.webkit.org/show_bug.cgi?id=181102 Reviewed by Zalan Bujtas. Renamed the class. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): (WebCore::Document::applyPendingXSLTransformsTimerFired): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/ElementIteratorAssertions.h: (WebCore::ElementIteratorAssertions::ElementIteratorAssertions): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/NoEventDispatchAssertion.h: Removed. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h. (WebCore::ScriptDisallowedScope::ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * html/HTMLElement.cpp: (WebCore::textToFragment): (WebCore::HTMLElement::setInnerText): * html/HTMLMediaElement.cpp: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): (WebCore::VTTCue::updateDisplayTree): (WebCore::VTTCue::removeDisplayTree): * loader/FormSubmission.cpp: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::performLayoutWithFlattening): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::clearShadowTree): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Canonical link: https://commits.webkit.org/196975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-22 01:10:32 +00:00
~ScriptDisallowedScope()
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
{
if (!isMainThread())
return;
ASSERT(s_count);
s_count--;
}
Build cleanly with GCC 9 https://bugs.webkit.org/show_bug.cgi?id=195920 Reviewed by Chris Dumez. WebKit triggers three new GCC 9 warnings: """ -Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly declared copy constructor and assignment operator if one of them is user-provided. """ Solution is to either add a copy constructor or copy assignment operator, if required, or else remove one if it is redundant. """ -Wredundant-move, implied by -Wextra, warns about redundant calls to std::move. -Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision. """ These account for most of this patch. Solution is to just remove the bad WTFMove(). Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't. These are solved by casting nontrivial types to void* before using memcpy. (Of course, it would be safer to not use memcpy on nontrivial types, but that's too complex for this patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.) Source/JavaScriptCore: * b3/B3ValueRep.h: * bindings/ScriptValue.cpp: (Inspector::jsToInspectorValue): * bytecode/GetterSetterAccessCase.cpp: (JSC::GetterSetterAccessCase::create): (JSC::GetterSetterAccessCase::clone const): * bytecode/InstanceOfAccessCase.cpp: (JSC::InstanceOfAccessCase::clone const): * bytecode/IntrinsicGetterAccessCase.cpp: (JSC::IntrinsicGetterAccessCase::clone const): * bytecode/ModuleNamespaceAccessCase.cpp: (JSC::ModuleNamespaceAccessCase::clone const): * bytecode/ProxyableAccessCase.cpp: (JSC::ProxyableAccessCase::clone const): * bytecode/StructureSet.h: * debugger/Breakpoint.h: * dfg/DFGRegisteredStructureSet.h: * inspector/agents/InspectorDebuggerAgent.cpp: (Inspector::buildDebuggerLocation): * inspector/scripts/codegen/cpp_generator_templates.py: * parser/UnlinkedSourceCode.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::parseAndCompileAir): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmNameSectionParser.cpp: (JSC::Wasm::NameSectionParser::parse): * wasm/WasmStreamingParser.cpp: (JSC::Wasm::StreamingParser::consume): Source/WebCore: * Modules/encryptedmedia/CDM.cpp: (WebCore::CDM::getSupportedConfiguration): * Modules/encryptedmedia/MediaKeys.cpp: (WebCore::MediaKeys::createSession): * Modules/entriesapi/DOMFileSystem.cpp: (WebCore::listDirectoryWithMetadata): (WebCore::toFileSystemEntries): * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::fromFormData): (WebCore::FetchBody::bodyAsFormData const): (WebCore::FetchBody::take): * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::create): (WebCore::FetchRequest::clone): * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::create): (WebCore::FetchResponse::redirect): (WebCore::FetchResponse::clone): * Modules/indexeddb/IDBCursor.cpp: (WebCore::IDBCursor::update): (WebCore::IDBCursor::deleteFunction): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::transaction): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::decode): * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyData::decode): * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::createIndex): (WebCore::IDBObjectStore::index): * Modules/indexeddb/IDBValue.h: (WebCore::IDBValue::decode): * Modules/indexeddb/shared/IDBError.cpp: (WebCore::IDBError::operator=): Deleted. * Modules/indexeddb/shared/IDBError.h: * Modules/indexeddb/shared/IDBResultData.h: (WebCore::IDBResultData::decode): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::addSourceBuffer): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::iceServersFromConfiguration): (WebCore::RTCPeerConnection::certificatesFromConfiguration): (WebCore::certificateTypeFromAlgorithmIdentifier): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::getStats): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver): * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::create): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::createMediaElementSource): (WebCore::AudioContext::createMediaStreamSource): (WebCore::AudioContext::createScriptProcessor): * Modules/webaudio/OfflineAudioContext.cpp: (WebCore::OfflineAudioContext::create): * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::tryToOpenDatabaseBackend): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::canEstablishDatabase): (WebCore::DatabaseTracker::retryCanEstablishDatabase): * Modules/webdatabase/SQLResultSetRowList.cpp: (WebCore::SQLResultSetRowList::item const): * Modules/websockets/WebSocket.cpp: (WebCore::WebSocket::create): * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeForNodeContents): (WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): * bindings/js/JSCustomElementInterface.cpp: (WebCore::JSCustomElementInterface::constructElementWithFallback): * bindings/js/JSDOMConvertVariadic.h: (WebCore::VariadicConverter::convert): (WebCore::convertVariadicArguments): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readDOMPointInit): (WebCore::transferArrayBuffers): * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallbackImplementationContent): * bindings/scripts/test/JS/JSTestCallbackFunction.cpp: (WebCore::JSTestCallbackFunction::handleEvent): * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: (WebCore::JSTestCallbackFunctionRethrow::handleEvent): * bindings/scripts/test/JS/JSTestCallbackInterface.cpp: (WebCore::JSTestCallbackInterface::callbackWithAReturnValue): (WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions): (WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck): (WebCore::JSTestCallbackInterface::callbackWithThisObject): * contentextensions/ContentExtensionParser.cpp: (WebCore::ContentExtensions::getStringList): (WebCore::ContentExtensions::loadTrigger): (WebCore::ContentExtensions::loadEncodedRules): (WebCore::ContentExtensions::parseRuleList): * crypto/SubtleCrypto.cpp: (WebCore::normalizeCryptoAlgorithmParameters): * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: (WebCore::calculateSignature): * crypto/keys/CryptoKeyEC.cpp: (WebCore::CryptoKeyEC::exportJwk const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTransform): (WebCore::ComputedStyleExtractor::valueForShadow): (WebCore::ComputedStyleExtractor::valueForFilter): (WebCore::specifiedValueForGridTrackSize): (WebCore::valueForGridTrackList): (WebCore::valueForGridPosition): (WebCore::willChangePropertyValue): (WebCore::fontVariantLigaturesPropertyValue): (WebCore::fontVariantNumericPropertyValue): (WebCore::fontVariantEastAsianPropertyValue): (WebCore::touchActionFlagsToCSSValue): (WebCore::renderTextDecorationFlagsToCSSValue): (WebCore::renderEmphasisPositionFlagsToCSSValue): (WebCore::speakAsToCSSValue): (WebCore::hangingPunctuationToCSSValue): (WebCore::fillRepeatToCSSValue): (WebCore::fillSizeToCSSValue): (WebCore::counterToCSSValue): (WebCore::fontVariantFromStyle): (WebCore::fontSynthesisFromStyle): (WebCore::shapePropertyValue): (WebCore::paintOrder): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand): * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts): * css/CSSGradientValue.cpp: (WebCore::CSSGradientValue::image): * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::rules): * css/DOMMatrixReadOnly.cpp: (WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix): * css/FontFace.cpp: (WebCore::FontFace::create): * css/FontVariantBuilder.cpp: (WebCore::computeFontVariant): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::removeProperty): * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::strokeDashArrayToCSSValueList): (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const): * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertReflection): * css/WebKitCSSMatrix.cpp: (WebCore::WebKitCSSMatrix::create): (WebCore::WebKitCSSMatrix::multiply const): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontVariationSettings): (WebCore::consumeBasicShapePath): (WebCore::consumeImplicitGridAutoFlow): * cssjit/StackAllocator.h: * dom/DOMImplementation.cpp: (WebCore::DOMImplementation::createDocument): * dom/Document.cpp: (WebCore::Document::cloneNodeInternal): * dom/DocumentFragment.cpp: (WebCore::DocumentFragment::cloneNodeInternal): * dom/Element.cpp: (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::removeAttributeNode): (WebCore::Element::parseAttributeName): (WebCore::Element::animate): * dom/MessagePort.cpp: (WebCore::MessagePort::disentanglePorts): * dom/NodeIterator.cpp: (WebCore::NodeIterator::nextNode): (WebCore::NodeIterator::previousNode): * dom/Range.cpp: (WebCore::Range::processContents): (WebCore::processContentsBetweenOffsets): (WebCore::processAncestorsAndTheirSiblings): * dom/RangeBoundaryPoint.h: * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::operator=): * dom/Text.cpp: (WebCore::Text::splitText): * dom/TextDecoder.cpp: (WebCore::TextDecoder::create): (WebCore::TextDecoder::decode): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::insertBlockPlaceholder): (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): * editing/Editing.cpp: (WebCore::createTabSpanElement): * editing/EditingStyle.cpp: (WebCore::EditingStyle::styleAtSelectionStart): * editing/TextIterator.cpp: (WebCore::TextIterator::rangeFromLocationAndLength): * editing/VisibleSelection.cpp: (WebCore::makeSearchRange): * editing/markup.cpp: (WebCore::styleFromMatchedRulesAndInlineDecl): (WebCore::createFragmentForInnerOuterHTML): (WebCore::createContextualFragment): * html/FormController.cpp: (WebCore::deserializeFormControlState): * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::captureStream): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader): * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::createForJSConstructor): * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::createElementRenderer): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::createSharedCellStyle): * html/HTMLTableRowElement.cpp: (WebCore::HTMLTableRowElement::insertCell): * html/ImageData.cpp: (WebCore::ImageData::create): * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::transferToImageBitmap): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::createLinearGradient): (WebCore::CanvasRenderingContext2DBase::createRadialGradient): * html/canvas/OESVertexArrayObject.cpp: (WebCore::OESVertexArrayObject::createVertexArrayOES): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::createBuffer): (WebCore::WebGLRenderingContextBase::createFramebuffer): (WebCore::WebGLRenderingContextBase::createTexture): (WebCore::WebGLRenderingContextBase::createProgram): (WebCore::WebGLRenderingContextBase::createRenderbuffer): (WebCore::WebGLRenderingContextBase::createShader): (WebCore::WebGLRenderingContextBase::getContextAttributes): (WebCore::WebGLRenderingContextBase::getUniform): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerContainer::resolveCustomStyle): (WebCore::TextControlPlaceholderElement::resolveCustomStyle): * html/track/BufferedLineReader.cpp: (WebCore::BufferedLineReader::nextLine): * html/track/VTTCue.cpp: (WebCore::VTTCue::getCueAsHTML): (WebCore::VTTCue::createCueRenderingTree): * html/track/WebVTTElement.cpp: (WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren): * inspector/InspectorStyleSheet.cpp: (WebCore::asCSSRuleList): (WebCore::InspectorStyle::buildObjectForStyle const): (WebCore::InspectorStyleSheet::buildObjectForStyleSheet): (WebCore::InspectorStyleSheet::buildObjectForRule): * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildArrayForPseudoElements): (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * loader/FetchOptions.h: (WebCore::FetchOptions::decode): * loader/MediaResourceLoader.cpp: (WebCore::MediaResourceLoader::requestResource): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::loadCache): (WebCore::ApplicationCacheStorage::manifestURLs): * loader/archive/mhtml/MHTMLParser.cpp: (WebCore::MHTMLParser::parseArchiveWithHeader): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): * page/DOMWindow.cpp: (WebCore::DOMWindow::getMatchedCSSRules const): * page/DragController.cpp: (WebCore::documentFragmentFromDragData): * page/EventSource.cpp: (WebCore::EventSource::create): * page/PerformanceUserTiming.cpp: (WebCore::UserTiming::mark): (WebCore::UserTiming::measure): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::decode): * page/scrolling/ScrollingConstraints.h: (WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints): (WebCore::LayoutConstraints::LayoutConstraints): Deleted. * platform/Length.h: (WebCore::Length::Length): * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::createFromCSSText): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): * platform/graphics/FloatPoint3D.h: * platform/graphics/Font.cpp: (WebCore::createAndFillGlyphPage): * platform/graphics/GLContext.cpp: (WebCore::GLContext::createContextForWindow): (WebCore::GLContext::createSharingContext): * platform/graphics/GraphicsContext.cpp: * platform/graphics/HEVCUtilities.cpp: (WebCore::parseHEVCCodecParameters): * platform/graphics/gtk/ImageGtk.cpp: (WebCore::loadImageFromGResource): (WebCore::loadMissingImageIconFromTheme): * platform/graphics/wayland/PlatformDisplayWayland.cpp: (WebCore::PlatformDisplayWayland::create): * platform/mediastream/MediaConstraints.h: (WebCore::MediaTrackConstraintSetMap::decode): * platform/mediastream/MediaStreamRequest.h: (WebCore::MediaStreamRequest::decode): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerSampleFromLibWebRTCVideoFrame): * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeIncomingAudioSource::create): * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: (WebCore::RealtimeIncomingVideoSource::create): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockMediaSample::createNonDisplayingCopy const): * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::createResourceHandle): * platform/network/CookieRequestHeaderFieldProxy.h: (WebCore::CookieRequestHeaderFieldProxy::decode): * platform/network/FormData.h: (WebCore::FormData::decode): * platform/network/MIMEHeader.cpp: (WebCore::MIMEHeader::parseHeader): * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::create): * platform/network/soup/DNSResolveQueueSoup.cpp: (WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers): * rendering/RenderElement.cpp: (WebCore::RenderElement::createFor): * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): (WebCore::Shape::createBoxShape): * rendering/style/BasicShapes.cpp: (WebCore::BasicShapeCircle::blend const): (WebCore::BasicShapeEllipse::blend const): (WebCore::BasicShapePolygon::blend const): (WebCore::BasicShapePath::blend const): (WebCore::BasicShapeInset::blend const): * rendering/style/BasicShapes.h: (WebCore::BasicShapeRadius::BasicShapeRadius): * rendering/style/ContentData.cpp: (WebCore::ImageContentData::createContentRenderer const): (WebCore::TextContentData::createContentRenderer const): (WebCore::QuoteContentData::createContentRenderer const): * rendering/style/ContentData.h: * rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::createInlineFlowBox): * rendering/svg/RenderSVGInlineText.cpp: (WebCore::RenderSVGInlineText::createTextBox): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::createRootInlineBox): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::build): * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::build): * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::build): * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::build): * svg/SVGFEConvolveMatrixElement.cpp: (WebCore::SVGFEConvolveMatrixElement::build): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::build): * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::build): * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::build): * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::build): * svg/SVGFEMergeElement.cpp: (WebCore::SVGFEMergeElement::build): * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::build): * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::build): * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::build): * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::build): * svg/SVGTransformList.h: * svg/properties/SVGList.h: (WebCore::SVGList::initialize): (WebCore::SVGList::insertItemBefore): (WebCore::SVGList::replaceItem): (WebCore::SVGList::removeItem): (WebCore::SVGList::appendItem): * svg/properties/SVGListProperty.h: (WebCore::SVGListProperty::initializeValuesAndWrappers): (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers): (WebCore::SVGListProperty::replaceItemValuesAndWrappers): (WebCore::SVGListProperty::removeItemValues): (WebCore::SVGListProperty::appendItemValuesAndWrappers): * svg/properties/SVGPrimitiveList.h: * testing/Internals.cpp: (WebCore::Internals::elementRenderTreeAsText): (WebCore::parseFindOptions): * workers/AbstractWorker.cpp: (WebCore::AbstractWorker::resolveURL): * workers/Worker.cpp: (WebCore::Worker::create): * workers/service/ServiceWorkerJobData.h: (WebCore::ServiceWorkerJobData::decode): * xml/DOMParser.cpp: (WebCore::DOMParser::parseFromString): * xml/XPathExpression.cpp: (WebCore::XPathExpression::evaluate): Source/WebKit: * NetworkProcess/cache/CacheStorageEngineCache.cpp: (WebKit::CacheStorage::Cache::decode): * Platform/IPC/ArgumentCoders.h: * Shared/CallbackID.h: (WebKit::CallbackID::operator=): * Shared/OptionalCallbackID.h: (WebKit::OptionalCallbackID::operator=): * Shared/Plugins/NPIdentifierData.cpp: (WebKit::NPIdentifierData::decode): * Shared/Plugins/NPVariantData.cpp: (WebKit::NPVariantData::decode): * Shared/Plugins/Netscape/NetscapePluginModule.cpp: (WebKit::NetscapePluginModule::getOrCreate): * Shared/RTCNetwork.cpp: (WebKit::RTCNetwork::IPAddress::decode): * Shared/SessionState.cpp: (WebKit::HTTPBody::Element::decode): (WebKit::FrameState::decode): (WebKit::BackForwardListItemState::decode): * Shared/WebCompiledContentRuleListData.cpp: (WebKit::WebCompiledContentRuleListData::decode): * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<FloatPoint>::decode): (IPC::ArgumentCoder<FloatRect>::decode): (IPC::ArgumentCoder<FloatQuad>::decode): (IPC::ArgumentCoder<ViewportArguments>::decode): (IPC::ArgumentCoder<IntPoint>::decode): (IPC::ArgumentCoder<IntRect>::decode): (IPC::ArgumentCoder<IntSize>::decode): (IPC::ArgumentCoder<MimeClassInfo>::decode): (IPC::ArgumentCoder<PluginInfo>::decode): (IPC::ArgumentCoder<SelectionRect>::decode): (IPC::ArgumentCoder<CompositionUnderline>::decode): (IPC::ArgumentCoder<BlobPart>::decode): (IPC::ArgumentCoder<TextIndicatorData>::decode): (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode): * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::decode): * Shared/WebPlatformTouchPoint.cpp: (WebKit::WebPlatformTouchPoint::decode): * Shared/WebsiteData/WebsiteData.cpp: (WebKit::WebsiteData::Entry::decode): * Shared/WebsiteDataStoreParameters.cpp: (WebKit::WebsiteDataStoreParameters::decode): * UIProcess/API/APIContentRuleListStore.cpp: (API::decodeContentRuleListMetaData): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::launchProcessForReload): (WebKit::WebPageProxy::launchProcessWithItem): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadFile): (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::reload): * UIProcess/WebProcessCache.cpp: (WebKit::WebProcessCache::takeProcess): * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::findReusableSuspendedPageProcess): * WebProcess/InjectedBundle/DOM/InjectedBundleCSSStyleDeclarationHandle.cpp: (WebKit::InjectedBundleCSSStyleDeclarationHandle::getOrCreate): * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp: (WebKit::InjectedBundleRangeHandle::getOrCreate): * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::create): * WebProcess/Network/WebLoaderStrategy.cpp: (WebKit::WebLoaderStrategy::tryLoadingSynchronouslyUsingURLSchemeHandler): * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp: (WebKit::CompositingCoordinator::createGraphicsLayer): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::pdfSnapshotAtSize): (WebKit::WebPage::createDocumentLoader): * WebProcess/WebStorage/StorageNamespaceImpl.cpp: (WebKit::StorageNamespaceImpl::copy): Source/WTF: * wtf/CheckedArithmetic.h: (WTF::Checked::Checked): * wtf/MetaAllocator.cpp: (WTF::MetaAllocator::allocate): * wtf/URLParser.cpp: (WTF::CodePointIterator::operator!= const): (WTF::CodePointIterator::operator=): Deleted. * wtf/text/StringView.h: (WTF::StringView::CodePoints::Iterator::operator=): Deleted. Canonical link: https://commits.webkit.org/210232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243163 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-19 20:04:34 +00:00
ScriptDisallowedScope& operator=(const ScriptDisallowedScope&)
{
return *this;
}
Adopting a child node of a script element can run script https://bugs.webkit.org/show_bug.cgi?id=167318 Patch by Ryosuke Niwa <rniwa@webkit.org> on 2017-02-09 Reviewed by Darin Adler. Source/WebCore: The bug was caused by ScriptElement::childrenChanged indiscriminately running the script. Do this only if some node has been inserted as spec'ed: https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model "The script element is connected and a node or document fragment is inserted into the script element, after any script elements inserted at that time." Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate non-contents child such as text and element being removed or inserted. New behavior matches that of Gecko and Chrome as well as the latest HTML5 specification. Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's ensureCustomFontData used to completely disable this assertion but we no longer have to do this either. To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent held by EventAllowedScope. Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed Tests: fast/html/script-must-not-run-when-child-is-adopted.html fast/html/script-must-not-run-when-child-is-removed.html * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion. * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded and insertBeforeCommon as done elsewhere. (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion. (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here. (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion. (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion. (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely. (WebCore::dispatchChildRemovalEvents): Ditto. * dom/ContainerNode.h: (WebCore::ContainerNode::ChildChange::isInsertion): Added. * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against insertionPoint since EventAllowedScope checks against the root node. * dom/Document.cpp: (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else remove() had resulted in an exception before calling TreeScope::adoptIfNeeded. * dom/Element.cpp: (WebCore::Element::childrenChanged): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node. If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider the event dispatch to be forbidden. (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted. (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of a given node as "safe" for the purpose of checking isEventDispatchForbidden. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated RAII object, and each instance remembers prior instance. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given node is a descendent of any node held by instances of EventAllowedScope. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function for isAllowedNode. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely. * dom/ScriptElement.cpp: (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes. (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running arbitrary author scripts can, indeed, result dispatch any events. * dom/ScriptElement.h: * html/HTMLElement.cpp: (WebCore::textToFragment): Made this a static local function and not return an exception since there is no way appendChild called in this function can throw an exception. (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts. Because of the precise-ness of this check, this does not disable the assertion for "this" element. HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark the shadow tree into which the fragment is inserted safe. (WebCore::HTMLElement::setOuterText): * html/HTMLElement.h: * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::childrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText). * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since the VTT tree is never exposed to author scripts. (WebCore::VTTCue::updateDisplayTree): Ditto. * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on the new SVG document we just created instead of disabling for all DOM trees. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::childrenChanged): LayoutTests: Added regression tests for adopting or removing a child node of a script element. The script must not run when nodes are adopted or removed. * fast/html/script-must-not-run-when-child-is-adopted-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-adopted.html: Added. * fast/html/script-must-not-run-when-child-is-removed-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-removed.html: Added. Canonical link: https://commits.webkit.org/185081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-09 17:59:45 +00:00
static bool isEventAllowedInMainThread()
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
{
return !isInWebProcess() || !isMainThread() || !s_count;
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
}
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
class InMainThread {
public:
InMainThread()
{
ASSERT(isMainThread());
++s_count;
}
~InMainThread()
{
ASSERT(isMainThread());
ASSERT(s_count);
--s_count;
}
Release-assert NoEventDispatchAssertion in canExecute, updateLayout, and updateStyle https://bugs.webkit.org/show_bug.cgi?id=179281 <rdar://problem/35008993> Reviewed by Antti Koivisto. Surgically enable NoEventDispatchAssertion::InMainThread::isEventAllowed() in release builds to prevent against insecure execution of author scripts. No new tests since there should be no behavioral changes (other than preventing potential security bugs from being exploited). * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): Use the release assert here. This function is consulted whenever author scripts are executed in event handler, script element, etc... in the main thread so enabling the release assert here should basically prevent all unwanted script executions protected by NoEventDispatchAssertion. * dom/ContainerNode.cpp: (NoEventDispatchAssertion::s_count): Now always compiled. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): Use the release assert here. This assertion would prevent unwanted style updating. This part of the change can be reverted if it turns out to be too crashy since just updating the style would not directly introduce a security vulnerability. (WebCore::Document::updateLayout): Ditto for updating the layout. * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Enabled this in release builds. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Ditto. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): We still don't enable this assertion because this check requires O(n) operation. Added a comment to that end. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Enabled this in release builds. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope): Ditto. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): Use the release assert here. This is the function used by the HTML parser to run scripts via HTMLScriptRunner::executePendingScriptAndDispatchEvent. Having a release assertion here should prevent the rest of the unwanted script executions in the HTML parser not caught by canExecuteScripts. Canonical link: https://commits.webkit.org/195442@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-07 17:41:05 +00:00
// Don't enable this assertion in release since it's O(n).
// Release asserts in canExecuteScript should be sufficient for security defense purposes.
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
static bool isEventDispatchAllowedInSubtree(Node& node)
{
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
return !isInWebProcess() || isScriptAllowed() || EventAllowedScope::isAllowedNode(node);
Release-assert NoEventDispatchAssertion in canExecute, updateLayout, and updateStyle https://bugs.webkit.org/show_bug.cgi?id=179281 <rdar://problem/35008993> Reviewed by Antti Koivisto. Surgically enable NoEventDispatchAssertion::InMainThread::isEventAllowed() in release builds to prevent against insecure execution of author scripts. No new tests since there should be no behavioral changes (other than preventing potential security bugs from being exploited). * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): Use the release assert here. This function is consulted whenever author scripts are executed in event handler, script element, etc... in the main thread so enabling the release assert here should basically prevent all unwanted script executions protected by NoEventDispatchAssertion. * dom/ContainerNode.cpp: (NoEventDispatchAssertion::s_count): Now always compiled. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): Use the release assert here. This assertion would prevent unwanted style updating. This part of the change can be reverted if it turns out to be too crashy since just updating the style would not directly introduce a security vulnerability. (WebCore::Document::updateLayout): Ditto for updating the layout. * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Enabled this in release builds. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Ditto. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): We still don't enable this assertion because this check requires O(n) operation. Added a comment to that end. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Enabled this in release builds. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope): Ditto. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): Use the release assert here. This is the function used by the HTML parser to run scripts via HTMLScriptRunner::executePendingScriptAndDispatchEvent. Having a release assertion here should prevent the rest of the unwanted script executions in the HTML parser not caught by canExecuteScripts. Canonical link: https://commits.webkit.org/195442@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-07 17:41:05 +00:00
#else
UNUSED_PARAM(node);
return true;
#endif
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
}
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
static bool hasDisallowedScope()
{
ASSERT(isMainThread());
return s_count;
}
Rename NoEventDispatchAssertion to ScriptDisallowedScope https://bugs.webkit.org/show_bug.cgi?id=181102 Reviewed by Zalan Bujtas. Renamed the class. * WebCore.xcodeproj/project.pbxproj: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::isSafeToUpdateStyleOrLayout): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): (WebCore::Document::dispatchWindowLoadEvent): (WebCore::Document::applyPendingXSLTransformsTimerFired): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): (WebCore::Element::setAttributeNodeNS): (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/ElementIteratorAssertions.h: (WebCore::ElementIteratorAssertions::ElementIteratorAssertions): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/EventTarget.cpp: (WebCore::EventTarget::fireEventListeners): * dom/NoEventDispatchAssertion.h: Removed. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptDisallowedScope.h: Copied from Source/WebCore/dom/NoEventDispatchAssertion.h. (WebCore::ScriptDisallowedScope::ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::~ScriptDisallowedScope): (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::~NoEventDispatchAssertion): Deleted. (WebCore::NoEventDispatchAssertion::isEventAllowedInMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Deleted. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Deleted. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::executeClassicScript): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): (WebCore::ScriptExecutionContext::stopActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * html/HTMLElement.cpp: (WebCore::textToFragment): (WebCore::HTMLElement::setInnerText): * html/HTMLMediaElement.cpp: * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): (WebCore::VTTCue::updateDisplayTree): (WebCore::VTTCue::removeDisplayTree): * loader/FormSubmission.cpp: * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderFrameBase.cpp: (WebCore::RenderFrameBase::performLayoutWithFlattening): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::updateReferencedText): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::clearShadowTree): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Canonical link: https://commits.webkit.org/196975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-22 01:10:32 +00:00
static bool isScriptAllowed()
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
{
ASSERT(isMainThread());
#if PLATFORM(IOS_FAMILY)
return !s_count || webThreadDelegateMessageScopeCount;
#else
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
return !s_count;
#endif
Eliminate isMainThread() checks in most call sites of NoEventDispatchAssertion https://bugs.webkit.org/show_bug.cgi?id=179161 Reviewed by Zalan Bujtas. Introduced NoEventDispatchAssertion::InMainThread which bypasses the expensive isMainThread() check in order to turn NoEventDispatchAssertion into a release assertion in a separate patch. Also removed instances of NoEventDispatchAssertion in notifyChildNodeInserted and notifyChildNodeRemoved and asserted that the caller has instantiated NoEventDispatchAssertion instead. No new tests since there should be no behavioral changes. * bindings/js/ScriptController.cpp: (WebCore::ScriptController::canExecuteScripts): * dom/Attr.cpp: * dom/CharacterData.cpp: * dom/ContainerNode.cpp: (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): (WebCore::ContainerNode::removeNodeWithScriptAssertion): (WebCore::executeNodeInsertionWithScriptAssertion): (WebCore::ContainerNode::removeDetachedChildren): Instantiated NoEventDispatchAssertion::InMainThread so that notifyChildNodeRemoved would be called inside NoEventDispatchAssertion. (WebCore::ContainerNode::insertBeforeCommon): (WebCore::ContainerNode::appendChildCommon): (WebCore::ContainerNode::removeBetween): (WebCore::dispatchChildInsertionEvents): (WebCore::dispatchChildRemovalEvents): * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Assert that the caller has instantiated NoEventDispatchAssertion. (WebCore::notifyChildNodeRemoved): Ditto. * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): (WebCore::Document::dispatchWindowEvent): Replaced RELEASE_ASSERT with ASSERT_WITH_SECURITY_IMPLICATION for clarity since NoEventDispatchAssertion::isEventAllowedInMainThread() always returns true in release builds right now. (WebCore::Document::dispatchWindowLoadEvent): Ditto. (WebCore::Document::applyPendingXSLTransformsTimerFired): Use ASSERT_WITH_SECURITY_IMPLICATION instead of regular ASSERT. * dom/Element.cpp: (WebCore::Element::addShadowRoot): Instantiate NoEventDispatchAssertion::InMainThread to call notifyChildNodeInserted will it. (WebCore::Element::attachAttributeNodeIfNeeded): (WebCore::Element::setAttributeNode): Fixed the indentation. (WebCore::Element::setAttributeNodeNS): Ditto. (WebCore::Element::dispatchFocusInEvent): (WebCore::Element::dispatchFocusOutEvent): * dom/EventDispatcher.cpp: (WebCore::EventDispatcher::dispatchEvent): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchAllowedInSubtree): Moved to InMainThread. (WebCore::NoEventDispatchAssertion::InMainThread): Added. (WebCore::NoEventDispatchAssertion::InMainThread::InMainThread): Assert that we're in the main thread instead of exiting early. (WebCore::NoEventDispatchAssertion::InMainThread::~InMainThread): Ditto. (WebCore::NoEventDispatchAssertion::InMainThread::isEventDispatchAllowedInSubtree): Moved here. (WebCore::NoEventDispatchAssertion::InMainThread::isEventAllowed): * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): (WebCore::Node::dispatchDOMActivateEvent): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension): (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * page/LayoutContext.cpp: (WebCore::LayoutContext::layout): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::scrollRectToVisible): Canonical link: https://commits.webkit.org/195303@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-02 21:56:30 +00:00
}
};
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#if ASSERT_ENABLED
Adopting a child node of a script element can run script https://bugs.webkit.org/show_bug.cgi?id=167318 Patch by Ryosuke Niwa <rniwa@webkit.org> on 2017-02-09 Reviewed by Darin Adler. Source/WebCore: The bug was caused by ScriptElement::childrenChanged indiscriminately running the script. Do this only if some node has been inserted as spec'ed: https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model "The script element is connected and a node or document fragment is inserted into the script element, after any script elements inserted at that time." Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate non-contents child such as text and element being removed or inserted. New behavior matches that of Gecko and Chrome as well as the latest HTML5 specification. Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's ensureCustomFontData used to completely disable this assertion but we no longer have to do this either. To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent held by EventAllowedScope. Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed Tests: fast/html/script-must-not-run-when-child-is-adopted.html fast/html/script-must-not-run-when-child-is-removed.html * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion. * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded and insertBeforeCommon as done elsewhere. (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion. (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here. (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion. (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion. (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely. (WebCore::dispatchChildRemovalEvents): Ditto. * dom/ContainerNode.h: (WebCore::ContainerNode::ChildChange::isInsertion): Added. * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against insertionPoint since EventAllowedScope checks against the root node. * dom/Document.cpp: (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else remove() had resulted in an exception before calling TreeScope::adoptIfNeeded. * dom/Element.cpp: (WebCore::Element::childrenChanged): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node. If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider the event dispatch to be forbidden. (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted. (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of a given node as "safe" for the purpose of checking isEventDispatchForbidden. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated RAII object, and each instance remembers prior instance. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given node is a descendent of any node held by instances of EventAllowedScope. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function for isAllowedNode. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely. * dom/ScriptElement.cpp: (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes. (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running arbitrary author scripts can, indeed, result dispatch any events. * dom/ScriptElement.h: * html/HTMLElement.cpp: (WebCore::textToFragment): Made this a static local function and not return an exception since there is no way appendChild called in this function can throw an exception. (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts. Because of the precise-ness of this check, this does not disable the assertion for "this" element. HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark the shadow tree into which the fragment is inserted safe. (WebCore::HTMLElement::setOuterText): * html/HTMLElement.h: * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::childrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText). * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since the VTT tree is never exposed to author scripts. (WebCore::VTTCue::updateDisplayTree): Ditto. * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on the new SVG document we just created instead of disabling for all DOM trees. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::childrenChanged): LayoutTests: Added regression tests for adopting or removing a child node of a script element. The script must not run when nodes are adopted or removed. * fast/html/script-must-not-run-when-child-is-adopted-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-adopted.html: Added. * fast/html/script-must-not-run-when-child-is-removed-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-removed.html: Added. Canonical link: https://commits.webkit.org/185081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-09 17:59:45 +00:00
class EventAllowedScope {
public:
explicit EventAllowedScope(ContainerNode& userAgentContentRoot)
: m_eventAllowedTreeRoot(userAgentContentRoot)
, m_previousScope(s_currentScope)
{
s_currentScope = this;
}
~EventAllowedScope()
{
s_currentScope = m_previousScope;
}
static bool isAllowedNode(Node& node)
{
return s_currentScope && s_currentScope->isAllowedNodeInternal(node);
}
private:
bool isAllowedNodeInternal(Node& node)
{
return m_eventAllowedTreeRoot->contains(&node) || (m_previousScope && m_previousScope->isAllowedNodeInternal(node));
}
Ref<ContainerNode> m_eventAllowedTreeRoot;
EventAllowedScope* m_previousScope;
static EventAllowedScope* s_currentScope;
};
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#else // not ASSERT_ENABLED
Adopting a child node of a script element can run script https://bugs.webkit.org/show_bug.cgi?id=167318 Patch by Ryosuke Niwa <rniwa@webkit.org> on 2017-02-09 Reviewed by Darin Adler. Source/WebCore: The bug was caused by ScriptElement::childrenChanged indiscriminately running the script. Do this only if some node has been inserted as spec'ed: https://html.spec.whatwg.org/multipage/scripting.html#script-processing-model "The script element is connected and a node or document fragment is inserted into the script element, after any script elements inserted at that time." Split NonContentsChildChanged into NonContentsChildInserted and NonContentsChildRemoved to disambiguate non-contents child such as text and element being removed or inserted. New behavior matches that of Gecko and Chrome as well as the latest HTML5 specification. Also deploy NoEventDispatchAssertion in more places. Unfortunately, this results in some DOM trees internal to WebKit to be mutated while there is NoEventDispatchAssertion in the stack. Added a new RAII object "EventAllowedScope" to temporarily disable this assertion within such a tree. CachedSVGFont's ensureCustomFontData used to completely disable this assertion but we no longer have to do this either. To clarify the new semantics, renamed isEventDispatchForbidden to isEventAllowedInMainThread with the negated boolean value, and added a new variant isEventDispatchAllowedInSubtree, which checks isEventDispatchForbidden() is true or if the node was one of an internal DOM node or its descendent held by EventAllowedScope. Inspired by https://chromium.googlesource.com/chromium/src/+/604e798ec6ee30f44d57a5c4a44ce3dab3a871ed Tests: fast/html/script-must-not-run-when-child-is-adopted.html fast/html/script-must-not-run-when-child-is-removed.html * dom/CharacterData.cpp: (WebCore::CharacterData::notifyParentAfterChange): Added NoEventDispatchAssertion. * dom/ContainerNode.cpp: (WebCore::ContainerNode::insertBefore): Added NoEventDispatchAssertion around TreeScope's adoptIfNeeded and insertBeforeCommon as done elsewhere. (WebCore::ContainerNode::appendChildCommon): Added NoEventDispatchAssertion. (WebCore::ContainerNode::changeForChildInsertion): Use NonContentsChildInserted here. (WebCore::ContainerNode::notifyChildRemoved): Added NoEventDispatchAssertion. (WebCore::ContainerNode::replaceChild): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::ContainerNode::removeChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::parserRemoveChild): Added NoEventDispatchAssertion. (WebCore::ContainerNode::removeChildren): Call childrenChanged in NoEventDispatchAssertion. (WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck): Moved adoptIfNeeded into NoEventDispatchAssertion. (WebCore::dispatchChildInsertionEvents): Check the forbidden-ness more precisely. (WebCore::dispatchChildRemovalEvents): Ditto. * dom/ContainerNode.h: (WebCore::ContainerNode::ChildChange::isInsertion): Added. * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): Check the forbidden-ness more precisely. Here, we check against insertionPoint since EventAllowedScope checks against the root node. * dom/Document.cpp: (WebCore::Document::adoptNode): Assert the node to be adopted has not been inserted back, or else remove() had resulted in an exception before calling TreeScope::adoptIfNeeded. * dom/Element.cpp: (WebCore::Element::childrenChanged): * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::isEventDispatchForbidden): Added a new variant that takes a node. If this node is a descendent of a node "marked as safe" by EventAllowedScope, then we don't consider the event dispatch to be forbidden. (WebCore::NoEventDispatchAssertion::dropTemporarily): Deleted. (WebCore::NoEventDispatchAssertion::restoreDropped): Deleted. (WebCore::NoEventDispatchAssertion::EventAllowedScope): Added. A RAII object which marks descendants of a given node as "safe" for the purpose of checking isEventDispatchForbidden. (WebCore::NoEventDispatchAssertion::EventAllowedScope::EventAllowedScope): Added. There can be a chain of EventAllowedScope objects in the stack. s_currentScope points to the most recently instantiated RAII object, and each instance remembers prior instance. (WebCore::NoEventDispatchAssertion::EventAllowedScope::~EventAllowedScope): Added. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNode): Added. Returns true if the given node is a descendent of any node held by instances of EventAllowedScope. (WebCore::NoEventDispatchAssertion::EventAllowedScope::isAllowedNodeInternal): Added. A helper function for isAllowedNode. * dom/Node.cpp: (WebCore::Node::dispatchSubtreeModifiedEvent): Check the forbidden-ness more precisely. * dom/ScriptElement.cpp: (WebCore::ScriptElement::childrenChanged): Only prepare the script if we've inserted nodes. (WebCore::ScriptElement::executeClassicScript): Assert isEventDispatchForbidden is false since running arbitrary author scripts can, indeed, result dispatch any events. * dom/ScriptElement.h: * html/HTMLElement.cpp: (WebCore::textToFragment): Made this a static local function and not return an exception since there is no way appendChild called in this function can throw an exception. (WebCore::HTMLElement::setInnerText): Create EventAllowedScope for the fragment. It's called called by HTMLTextAreaElement's childrenChanged to update its UA shadow tree, and it's dispatching as event on a new fragment can't execute arbitrary scripts since it has never been exposed to author scripts. Because of the precise-ness of this check, this does not disable the assertion for "this" element. HTMLTextFormControlElement::setInnerTextValue explicitly creates another EventAllowedScope to mark the shadow tree into which the fragment is inserted safe. (WebCore::HTMLElement::setOuterText): * html/HTMLElement.h: * html/HTMLScriptElement.cpp: (WebCore::HTMLScriptElement::childrenChanged): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::setInnerTextValue): See above (setInnerText). * html/track/VTTCue.cpp: (WebCore::VTTCue::createCueRenderingTree): Create EventAllowedScope for the cloned fragment here since the VTT tree is never exposed to author scripts. (WebCore::VTTCue::updateDisplayTree): Ditto. * loader/cache/CachedSVGFont.cpp: (WebCore::CachedSVGFont::ensureCustomFontData): Use EventAllowedScope to disable assertions only on the new SVG document we just created instead of disabling for all DOM trees. * svg/SVGScriptElement.cpp: (WebCore::SVGScriptElement::childrenChanged): LayoutTests: Added regression tests for adopting or removing a child node of a script element. The script must not run when nodes are adopted or removed. * fast/html/script-must-not-run-when-child-is-adopted-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-adopted.html: Added. * fast/html/script-must-not-run-when-child-is-removed-expected.txt: Added. * fast/html/script-must-not-run-when-child-is-removed.html: Added. Canonical link: https://commits.webkit.org/185081@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-02-09 17:59:45 +00:00
class EventAllowedScope {
public:
explicit EventAllowedScope(ContainerNode&) { }
static bool isAllowedNode(Node&) { return true; }
};
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
#endif // not ASSERT_ENABLED
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
// FIXME: Remove this class once the sync layout inside SVGImage::draw is removed,
// CachedSVGFont::ensureCustomFontData no longer synchronously creates a document during style resolution,
// and refactored the code in RenderFrameBase::performLayoutWithFlattening.
class DisableAssertionsInScope {
public:
DisableAssertionsInScope()
{
Assert that updateStyle and updateLayout are only called when it's safe to dispatch events https://bugs.webkit.org/show_bug.cgi?id=179157 <rdar://problem/35144778> Reviewed by Zalan Bujtas. Added assertions to Document::updateStyleIfNeeded and Document::updateLayout that these functions are only called when NoEventDispatchAssertion::isEventAllowedInMainThread() is true with two exceptions: 1. Inside SVGImage::draw which triggers a layout on a separate document. 2. While doing a nested layout for a frame flattening. No new tests since there should be no behavioral changes. * dom/ContainerNode.cpp: (NoEventDispatchAssertion::DisableAssertionsInScope::s_existingCount): Deleted. This is now an instance variable of DisableAssertionsInScope. (ContainerNode::removeNodeWithScriptAssertion): Moved childrenChanged out of the scope since it could invoke respondToChangedSelection via HTMLTextAreaElement::childrenChanged. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): Added the assertion. Allow updateWidgetPositions() to call this function but exit early when checking needsStyleRecalc(). (WebCore::Document::updateLayout): Added the assertion. * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Made this class store the original value of s_count as an instance variable to support re-entrancy. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Ditto. * page/LayoutContext.cpp: (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Temporarily disable the assertion. This is safe since SVGImage has its own document. * svg/SVGSVGElement.cpp: (WebCore::checkIntersectionWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkIntersection. (WebCore::checkEnclosureWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkEnclosure. (WebCore::SVGSVGElement::getIntersectionList): Use checkIntersectionWithoutUpdatingLayout to avoid calling updateLayoutIgnorePendingStylesheets while iterating over elements. (WebCore::SVGSVGElement::getEnclosureList): Ditto. (WebCore::SVGSVGElement::checkIntersection): (WebCore::SVGSVGElement::checkEnclosure): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Temporarily disable the assertion. This is safe as SVGImage has its own page. Canonical link: https://commits.webkit.org/195322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-03 03:48:11 +00:00
ASSERT(isMainThread());
std::swap(s_count, m_originalCount);
}
~DisableAssertionsInScope()
{
Assert that updateStyle and updateLayout are only called when it's safe to dispatch events https://bugs.webkit.org/show_bug.cgi?id=179157 <rdar://problem/35144778> Reviewed by Zalan Bujtas. Added assertions to Document::updateStyleIfNeeded and Document::updateLayout that these functions are only called when NoEventDispatchAssertion::isEventAllowedInMainThread() is true with two exceptions: 1. Inside SVGImage::draw which triggers a layout on a separate document. 2. While doing a nested layout for a frame flattening. No new tests since there should be no behavioral changes. * dom/ContainerNode.cpp: (NoEventDispatchAssertion::DisableAssertionsInScope::s_existingCount): Deleted. This is now an instance variable of DisableAssertionsInScope. (ContainerNode::removeNodeWithScriptAssertion): Moved childrenChanged out of the scope since it could invoke respondToChangedSelection via HTMLTextAreaElement::childrenChanged. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): Added the assertion. Allow updateWidgetPositions() to call this function but exit early when checking needsStyleRecalc(). (WebCore::Document::updateLayout): Added the assertion. * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Made this class store the original value of s_count as an instance variable to support re-entrancy. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Ditto. * page/LayoutContext.cpp: (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Temporarily disable the assertion. This is safe since SVGImage has its own document. * svg/SVGSVGElement.cpp: (WebCore::checkIntersectionWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkIntersection. (WebCore::checkEnclosureWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkEnclosure. (WebCore::SVGSVGElement::getIntersectionList): Use checkIntersectionWithoutUpdatingLayout to avoid calling updateLayoutIgnorePendingStylesheets while iterating over elements. (WebCore::SVGSVGElement::getEnclosureList): Ditto. (WebCore::SVGSVGElement::checkIntersection): (WebCore::SVGSVGElement::checkEnclosure): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Temporarily disable the assertion. This is safe as SVGImage has its own page. Canonical link: https://commits.webkit.org/195322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-03 03:48:11 +00:00
s_count = m_originalCount;
}
private:
Assert that updateStyle and updateLayout are only called when it's safe to dispatch events https://bugs.webkit.org/show_bug.cgi?id=179157 <rdar://problem/35144778> Reviewed by Zalan Bujtas. Added assertions to Document::updateStyleIfNeeded and Document::updateLayout that these functions are only called when NoEventDispatchAssertion::isEventAllowedInMainThread() is true with two exceptions: 1. Inside SVGImage::draw which triggers a layout on a separate document. 2. While doing a nested layout for a frame flattening. No new tests since there should be no behavioral changes. * dom/ContainerNode.cpp: (NoEventDispatchAssertion::DisableAssertionsInScope::s_existingCount): Deleted. This is now an instance variable of DisableAssertionsInScope. (ContainerNode::removeNodeWithScriptAssertion): Moved childrenChanged out of the scope since it could invoke respondToChangedSelection via HTMLTextAreaElement::childrenChanged. * dom/Document.cpp: (WebCore::Document::updateStyleIfNeeded): Added the assertion. Allow updateWidgetPositions() to call this function but exit early when checking needsStyleRecalc(). (WebCore::Document::updateLayout): Added the assertion. * dom/NoEventDispatchAssertion.h: (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::DisableAssertionsInScope): Made this class store the original value of s_count as an instance variable to support re-entrancy. (WebCore::NoEventDispatchAssertion::DisableAssertionsInScope::~DisableAssertionsInScope): Ditto. * page/LayoutContext.cpp: (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Temporarily disable the assertion. This is safe since SVGImage has its own document. * svg/SVGSVGElement.cpp: (WebCore::checkIntersectionWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkIntersection. (WebCore::checkEnclosureWithoutUpdatingLayout): Extracted out of SVGSVGElement::checkEnclosure. (WebCore::SVGSVGElement::getIntersectionList): Use checkIntersectionWithoutUpdatingLayout to avoid calling updateLayoutIgnorePendingStylesheets while iterating over elements. (WebCore::SVGSVGElement::getEnclosureList): Ditto. (WebCore::SVGSVGElement::checkIntersection): (WebCore::SVGSVGElement::checkEnclosure): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Temporarily disable the assertion. This is safe as SVGImage has its own page. Canonical link: https://commits.webkit.org/195322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-11-03 03:48:11 +00:00
unsigned m_originalCount { 0 };
};
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. Canonical link: https://commits.webkit.org/174282@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-04 12:56:33 +00:00
private:
WEBCORE_EXPORT static unsigned s_count;
};
} // namespace WebCore