[webkit-changes] [292942] trunk/Source

2022-04-16 Thread cdumez
Title: [292942] trunk/Source








Revision 292942
Author cdu...@apple.com
Date 2022-04-16 13:31:36 -0700 (Sat, 16 Apr 2022)


Log Message
Replace complex String::insert() with a simplified makeStringByInserting() free function
https://bugs.webkit.org/show_bug.cgi?id=239370

Reviewed by Darin Adler.

Source/WebCore:

* Modules/mediasource/MediaSource.cpp:
(WebCore::addVP9FullRangeVideoFlagToContentType):
* dom/CharacterData.cpp:
(WebCore::CharacterData::insertData):
(WebCore::CharacterData::replaceData):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::setRangeText):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/win/PasteboardWin.cpp:
(WebCore::createGlobalImageFileDescriptor):

Source/WTF:

* wtf/text/WTFString.cpp:
(WTF::makeStringByInserting):
(WTF::String::insert): Deleted.
(WTF::String::append): Deleted.
* wtf/text/WTFString.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringConcatenate.h
trunk/Source/WTF/wtf/text/WTFString.cpp
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp
trunk/Source/WebCore/dom/CharacterData.cpp
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
trunk/Source/WebCore/platform/network/DataURLDecoder.cpp
trunk/Source/WebCore/platform/win/PasteboardWin.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (292941 => 292942)

--- trunk/Source/WTF/ChangeLog	2022-04-16 19:28:05 UTC (rev 292941)
+++ trunk/Source/WTF/ChangeLog	2022-04-16 20:31:36 UTC (rev 292942)
@@ -1,3 +1,16 @@
+2022-04-16  Chris Dumez  
+
+Replace complex String::insert() with a simplified makeStringByInserting() free function
+https://bugs.webkit.org/show_bug.cgi?id=239370
+
+Reviewed by Darin Adler.
+
+* wtf/text/WTFString.cpp:
+(WTF::makeStringByInserting):
+(WTF::String::insert): Deleted.
+(WTF::String::append): Deleted.
+* wtf/text/WTFString.h:
+
 2022-04-15  Myles C. Maxfield  
 
 [WebGPU] Implement hardware limits


Modified: trunk/Source/WTF/wtf/text/StringConcatenate.h (292941 => 292942)

--- trunk/Source/WTF/wtf/text/StringConcatenate.h	2022-04-16 19:28:05 UTC (rev 292941)
+++ trunk/Source/WTF/wtf/text/StringConcatenate.h	2022-04-16 20:31:36 UTC (rev 292942)
@@ -478,11 +478,17 @@
 return result;
 }
 
+inline String makeStringByInserting(StringView originalString, StringView stringToInsert, unsigned position)
+{
+return makeString(originalString.left(position), stringToInsert, originalString.substring(position));
+}
+
 } // namespace WTF
 
 using WTF::Indentation;
 using WTF::IndentationScope;
 using WTF::makeString;
+using WTF::makeStringByInserting;
 using WTF::pad;
 using WTF::lowercase;
 using WTF::tryMakeString;


Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (292941 => 292942)

--- trunk/Source/WTF/wtf/text/WTFString.cpp	2022-04-16 19:28:05 UTC (rev 292941)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2022-04-16 20:31:36 UTC (rev 292942)
@@ -78,116 +78,6 @@
 return codePointCompare(a.impl(), b.impl());
 }
 
-void String::insert(const String& string, unsigned position)
-{
-// FIXME: This is extremely inefficient. So much so that we might want to take this out of String's API.
-
-unsigned lengthToInsert = string.length();
-
-if (!lengthToInsert) {
-if (string.isNull())
-return;
-if (isNull())
-m_impl = string.impl();
-return;
-}
-
-if (position >= length()) {
-if (string.is8Bit())
-append(string.characters8(), string.length());
-else
-append(string.characters16(), string.length());
-return;
-}
-
-if (lengthToInsert > MaxLength - length())
-CRASH();
-
-if (is8Bit() && string.is8Bit()) {
-LChar* data;
-auto newString = StringImpl::createUninitialized(length() + lengthToInsert, data);
-StringView(*m_impl).left(position).getCharactersWithUpconvert(data);
-StringView(string).getCharactersWithUpconvert(data + position);
-StringView(*m_impl).substring(position).getCharactersWithUpconvert(data + position + lengthToInsert);
-m_impl = WTFMove(newString);
-} else {
-UChar* data;
-auto newString = StringImpl::createUninitialized(length() + lengthToInsert, data);
-StringView(*m_impl).left(position).getCharactersWithUpconvert(data);
-StringView(string).getCharactersWithUpconvert(data + position);
-StringView(*m_impl).substring(position).getCharactersWithUpconvert(data + position + lengthToInsert);
-m_impl = WTFMove(newString);
-}
-}
-
-void String::append(const LChar* charactersToAppend, unsigned lengthToAppend)
-{
-// FIXME: This is extremely inefficient. So much so that we might want to take this out of String's API.
-
-if (!m_impl) {
-if (!charactersToAppend)
-return;
-

[webkit-changes] [292939] trunk/Source

2022-04-15 Thread cdumez
Title: [292939] trunk/Source








Revision 292939
Author cdu...@apple.com
Date 2022-04-15 21:44:41 -0700 (Fri, 15 Apr 2022)


Log Message
Leverage StringView in more places to avoid some String allocations
https://bugs.webkit.org/show_bug.cgi?id=239356

Reviewed by Darin Adler.

Source/_javascript_Core:

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::getRegularExpressionMatchesByLines):
(Inspector::ContentSearchUtilities::findMagicComment):
* runtime/ExceptionHelpers.cpp:
(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts const):
(JSC::IntlDateTimeFormat::formatRangeToParts):
* runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::formatToParts const):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatRangeToPartsInternal):
* tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):

Source/WebCore:

* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::toRtpCodecCapability):
* Modules/model-element/scenekit/SceneKitModelLoader.mm:
(WebCore::mimeTypeUtilizingFileExtensionOverridingForLocalFiles):
* Modules/plugins/PluginReplacement.h:
(WebCore::ReplacementPlugin::supportsFileExtension const):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::supportsFileExtension):
* Modules/plugins/YouTubePluginReplacement.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::setPseudoElement):
* css/ContainerQueryParser.cpp:
(WebCore::ContainerQueryParser::consumePlainSizeFeature):
* css/parser/CSSSelectorParser.cpp:
(WebCore::consumeANPlusB):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::isBlobURLContainsNullOrigin):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::updateTokensFromAttributeValue):
* html/DOMTokenList.h:
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::parseAttribute):
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* inspector/InspectorStyleSheet.cpp:
(WebCore::StyleSheetHandler::observeProperty):
(WebCore::StyleSheetHandler::observeComment):
* layout/formattingContexts/inline/InlineLineBuilder.cpp:
(WebCore::Layout::toString):
* layout/formattingContexts/inline/display/InlineDisplayContentBuilder.cpp:
(WebCore::Layout::InlineDisplayContentBuilder::appendTextDisplayBox):
* layout/layouttree/LayoutInlineTextBox.h:
(WebCore::Layout::InlineTextBox::content const):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::writeDataToUniqueFileInDirectory):
* loader/appcache/ApplicationCacheStorage.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::getSVGFontById const):
(WebCore::CachedSVGFont::maybeInitializeExternalSVGFontElement):
* loader/cache/CachedSVGFont.h:
* page/Location.cpp:
(WebCore::Location::setHash):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* page/UserContentURLPattern.h:
(WebCore::UserContentURLPattern::UserContentURLPattern):
* platform/MIMETypeRegistry.cpp:
(WebCore::typesForCommonExtension):
(WebCore::MIMETypeRegistry::mediaMIMETypeForExtension):
* platform/MIMETypeRegistry.h:
* platform/cocoa/DragImageCocoa.mm:
(WebCore::createDragImageIconForCachedImageFilename):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::getUnmangledInfoLog):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog):
* platform/network/HTTPParsers.cpp:
(WebCore::parseStructuredFieldValue):
(WebCore::parseRange):
* platform/network/HTTPParsers.h:
* platform/network/MIMEHeader.cpp:
(WebCore::retrieveKeyValuePairs):
* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setContentType):
* platform/network/ParsedContentType.h:
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::textRun const):

Source/WebKit:

* Platform/cocoa/ImageAnalysisUtilities.mm:
(WebKit::makeTextRecognitionResult):
* UIProcess/Cocoa/MediaPermissionUtilities.mm:
(WebKit::visibleDomain):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performJavaScriptURLRequest):

Source/WebKitLegacy/mac:

* Misc/WebUserContentURLPattern.mm:
(-[WebUserContentURLPattern initWithPatternString:]):

Modified 

[webkit-changes] [292938] trunk/Source/WebCore

2022-04-15 Thread cdumez
Title: [292938] trunk/Source/WebCore








Revision 292938
Author cdu...@apple.com
Date 2022-04-15 20:41:53 -0700 (Fri, 15 Apr 2022)


Log Message
Rename WebCore::webCoreBuiltinNames() to WebCore::builtinNames()
https://bugs.webkit.org/show_bug.cgi?id=239408

Reviewed by Darin Adler.

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::getBackingMap):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::getBackingSet):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::initStaticGlobals):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::put):
(WebCore::addCrossOriginPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setOpener):
(WebCore::JSDOMWindow::openDatabase const):
(WebCore::JSDOMWindow::setOpenDatabase):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::put):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::put):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::lock):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
(WebCore::rejectWithFetchError):
* bindings/js/WebCoreJSClientData.h:
(WebCore::builtinNames):
(WebCore::webCoreBuiltinNames): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindow::finishCreation):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWritePrototype::finishCreation):
(WebCore::JSTestConditionallyReadWrite::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
trunk/Source/WebCore/bindings/js/JSDOMMapLike.cpp
trunk/Source/WebCore/bindings/js/JSDOMSetLike.cpp
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp
trunk/Source/WebCore/bindings/js/ReadableStream.cpp
trunk/Source/WebCore/bindings/js/ScriptController.cpp
trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
trunk/Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledForContext.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292937 => 292938)

--- trunk/Source/WebCore/ChangeLog	2022-04-16 01:59:43 UTC (rev 292937)
+++ trunk/Source/WebCore/ChangeLog	2022-04-16 03:41:53 UTC (rev 292938)
@@ -1,3 +1,71 @@
+2022-04-15  Chris Dumez  
+
+Rename WebCore::webCoreBuiltinNames() to WebCore::builtinNames()
+https://bugs.webkit.org/show_bug.cgi?id=239408
+
+Reviewed by Darin Adler.
+
+* bindings/js/JSDOMGlobalObject.cpp:
+(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
+* bindings/js/JSDOMMapLike.cpp:
+(WebCore::getBackingMap):
+* bindings/js/JSDOMSetLike.cpp:
+(WebCore::getBackingSet):
+* bindings/js/JSDOMWindowBase.cpp:
+(WebCore::JSDOMWindowBase::initStaticGlobals):
+(WebCore::JSDOMWindowBase::finishCreation):
+

[webkit-changes] [292899] trunk/Source/WebCore

2022-04-14 Thread cdumez
Title: [292899] trunk/Source/WebCore








Revision 292899
Author cdu...@apple.com
Date 2022-04-14 22:44:28 -0700 (Thu, 14 Apr 2022)


Log Message
Use WebCoreBuiltinNames when possible
https://bugs.webkit.org/show_bug.cgi?id=239361

Reviewed by Yusuke Suzuki.

Use WebCoreBuiltinNames when possible to avoid unnecessary calls to Identifier::fromString().
This is more efficient.

* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::getBackingMap):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::getBackingSet):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::initStaticGlobals):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::updateDocument):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::put):
(WebCore::addCrossOriginPropertyNames):
(WebCore::JSDOMWindow::defineOwnProperty):
(WebCore::JSDOMWindow::setOpener):
(WebCore::JSDOMWindow::openDatabase const):
(WebCore::JSDOMWindow::setOpenDatabase):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::JSLocation::put):
* bindings/js/JSRemoteDOMWindowCustom.cpp:
(WebCore::JSRemoteDOMWindow::put):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::lock):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::rejectToPropagateNetworkError):
(WebCore::rejectWithFetchError):
* bindings/js/WebCoreBuiltinNames.h:
* bindings/js/WebCoreJSClientData.h:
(WebCore::webCoreBuiltinNames):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSDOMWindow.cpp:
(WebCore::JSDOMWindow::finishCreation):
* bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp:
(WebCore::JSTestConditionallyReadWritePrototype::finishCreation):
(WebCore::JSTestConditionallyReadWrite::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySetting::finishCreation):
* bindings/scripts/test/JS/JSTestEnabledForContext.cpp:
(WebCore::JSTestEnabledForContext::finishCreation):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObject::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
* html/HTMLMediaElement.cpp:
(WebCore::controllerJSValue):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::loadModuleSynchronously):
(WebCore::WorkerOrWorkletScriptController::loadAndEvaluateModule):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
trunk/Source/WebCore/bindings/js/JSDOMMapLike.cpp
trunk/Source/WebCore/bindings/js/JSDOMSetLike.cpp
trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
trunk/Source/WebCore/bindings/js/JSEventListener.cpp
trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp
trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowCustom.cpp
trunk/Source/WebCore/bindings/js/ReadableStream.cpp
trunk/Source/WebCore/bindings/js/ScriptController.cpp
trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
trunk/Source/WebCore/bindings/js/WebCoreJSClientData.h
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
trunk/Source/WebCore/bindings/scripts/test/JS/JSDOMWindow.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestConditionallyReadWrite.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledBySetting.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEnabledForContext.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestGlobalObject.cpp
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
trunk/Source/WebCore/html/HTMLMediaElement.cpp
trunk/Source/WebCore/testing/Internals.cpp
trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292898 => 292899)

--- trunk/Source/WebCore/ChangeLog	2022-04-15 01:45:58 UTC (rev 292898)
+++ trunk/Source/WebCore/ChangeLog	2022-04-15 05:44:28 UTC (rev 292899)
@@ -1,3 +1,76 @@
+2022-04-14  Chris Dumez  
+
+Use WebCoreBuiltinNames when possible
+https://bugs.webkit.org/show_bug.cgi?id=239361
+
+Reviewed by Yusuke Suzuki.
+
+Use WebCoreBuiltinNames when possible to avoid unnecessary calls to Identifier::fromString().
+This is more efficient.
+
+ 

[webkit-changes] [292887] trunk/Source/WebCore

2022-04-14 Thread cdumez
Title: [292887] trunk/Source/WebCore








Revision 292887
Author cdu...@apple.com
Date 2022-04-14 13:35:15 -0700 (Thu, 14 Apr 2022)


Log Message
Require an existing AtomString for HTMLFormElement's named getter parameter
https://bugs.webkit.org/show_bug.cgi?id=239335

Reviewed by Darin Adler.

Require an existing AtomString for HTMLFormElement's named getter parameter. There is no point
in allocating a new AtomString as the AtomString should already exist if there is any element
with this name / id.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::namedElements):
* html/HTMLFormElement.idl:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLFormElement.cpp
trunk/Source/WebCore/html/HTMLFormElement.idl




Diff

Modified: trunk/Source/WebCore/ChangeLog (292886 => 292887)

--- trunk/Source/WebCore/ChangeLog	2022-04-14 20:19:14 UTC (rev 292886)
+++ trunk/Source/WebCore/ChangeLog	2022-04-14 20:35:15 UTC (rev 292887)
@@ -1,5 +1,20 @@
 2022-04-14  Chris Dumez  
 
+Require an existing AtomString for HTMLFormElement's named getter parameter
+https://bugs.webkit.org/show_bug.cgi?id=239335
+
+Reviewed by Darin Adler.
+
+Require an existing AtomString for HTMLFormElement's named getter parameter. There is no point
+in allocating a new AtomString as the AtomString should already exist if there is any element
+with this name / id.
+
+* html/HTMLFormElement.cpp:
+(WebCore::HTMLFormElement::namedElements):
+* html/HTMLFormElement.idl:
+
+2022-04-14  Chris Dumez  
+
 Require an existing AtomString for HTMLDocument's named getter parameter
 https://bugs.webkit.org/show_bug.cgi?id=239334
 


Modified: trunk/Source/WebCore/html/HTMLFormElement.cpp (292886 => 292887)

--- trunk/Source/WebCore/html/HTMLFormElement.cpp	2022-04-14 20:19:14 UTC (rev 292886)
+++ trunk/Source/WebCore/html/HTMLFormElement.cpp	2022-04-14 20:35:15 UTC (rev 292887)
@@ -932,6 +932,9 @@
 // FIXME: Use Ref for the function result since there are no non-HTML elements returned here.
 Vector> HTMLFormElement::namedElements(const AtomString& name)
 {
+if (name.isEmpty())
+return { };
+
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#dom-form-nameditem
 Vector> namedItems = elements()->namedItems(name);
 


Modified: trunk/Source/WebCore/html/HTMLFormElement.idl (292886 => 292887)

--- trunk/Source/WebCore/html/HTMLFormElement.idl	2022-04-14 20:19:14 UTC (rev 292886)
+++ trunk/Source/WebCore/html/HTMLFormElement.idl	2022-04-14 20:35:15 UTC (rev 292887)
@@ -39,7 +39,7 @@
 readonly attribute HTMLFormControlsCollection elements;
 readonly attribute unsigned long length;
 getter Element? (unsigned long index);
-getter (RadioNodeList or Element)? ([AtomString] DOMString name);
+getter (RadioNodeList or Element)? ([RequiresExistingAtomString] DOMString name);
 
 [ImplementedAs=submitFromJavaScript] undefined submit();
 [EnabledBySetting=RequestSubmitEnabled] undefined requestSubmit(optional HTMLElement? submitter);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292885] trunk/Source/WebCore

2022-04-14 Thread cdumez
Title: [292885] trunk/Source/WebCore








Revision 292885
Author cdu...@apple.com
Date 2022-04-14 12:52:17 -0700 (Thu, 14 Apr 2022)


Log Message
Require an existing AtomString for HTMLDocument's named getter parameter
https://bugs.webkit.org/show_bug.cgi?id=239334

Reviewed by Alexey Shvayka.

Require an existing AtomString for HTMLDocument's named getter parameter. There is no point
in allocating a new AtomString as the AtomString should already exist if there is any element
with this name.

* html/HTMLDocument.idl:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLDocument.idl




Diff

Modified: trunk/Source/WebCore/ChangeLog (292884 => 292885)

--- trunk/Source/WebCore/ChangeLog	2022-04-14 19:45:24 UTC (rev 292884)
+++ trunk/Source/WebCore/ChangeLog	2022-04-14 19:52:17 UTC (rev 292885)
@@ -1,3 +1,16 @@
+2022-04-14  Chris Dumez  
+
+Require an existing AtomString for HTMLDocument's named getter parameter
+https://bugs.webkit.org/show_bug.cgi?id=239334
+
+Reviewed by Alexey Shvayka.
+
+Require an existing AtomString for HTMLDocument's named getter parameter. There is no point
+in allocating a new AtomString as the AtomString should already exist if there is any element
+with this name.
+
+* html/HTMLDocument.idl:
+
 2022-04-14  J Pascoe  
 
 [WebAuthn] Clean up WebAuthenticationModern and WebAuthnProcess


Modified: trunk/Source/WebCore/html/HTMLDocument.idl (292884 => 292885)

--- trunk/Source/WebCore/html/HTMLDocument.idl	2022-04-14 19:45:24 UTC (rev 292884)
+++ trunk/Source/WebCore/html/HTMLDocument.idl	2022-04-14 19:52:17 UTC (rev 292885)
@@ -24,5 +24,5 @@
 LegacyOverrideBuiltIns,
 Exposed=Window
 ] interface HTMLDocument : Document {
-getter (WindowProxy or Element or HTMLCollection) ([AtomString] DOMString name);
+getter (WindowProxy or Element or HTMLCollection) ([RequiresExistingAtomString] DOMString name);
 };






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292879] trunk

2022-04-14 Thread cdumez
Title: [292879] trunk








Revision 292879
Author cdu...@apple.com
Date 2022-04-14 10:55:19 -0700 (Thu, 14 Apr 2022)


Log Message
Drop inefficient String::append() overloads
https://bugs.webkit.org/show_bug.cgi?id=239289

Reviewed by Sam Weinig.

Source/_javascript_Core:

* heap/HeapSnapshotBuilder.cpp:
(JSC::HeapSnapshotBuilder::json):
* runtime/IntlObject.cpp:
(JSC::resolveLocale):
* runtime/TemporalObject.cpp:
(JSC::ellipsizeAt):
* tools/FunctionOverrides.cpp:
(JSC::initializeOverrideInfo):
(JSC::parseClause):

Source/WebCore:

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const):
* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::loggingString const):
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::trimInputSample):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* dom/Text.cpp:
(WebCore::appendTextRepresentation):
* dom/ViewportArguments.cpp:
(WebCore::viewportErrorMessage):
* editing/markup.cpp:
(WebCore::fillContainerFromString):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocumentParser::parseAndAppendOneLine):
(WebCore::FTPDirectoryDocumentParser::append):
(WebCore::FTPDirectoryDocumentParser::finish):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getActiveUniform):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* inspector/InspectorOverlay.cpp:
(WebCore::truncateWithEllipsis):
* inspector/InspectorOverlayLabel.cpp:
(WebCore::InspectorOverlayLabel::draw):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::scrollingStateTreeAsText const):
* platform/graphics/HEVCUtilities.cpp:
(WebCore::createHEVCCodecParametersString):
* platform/network/HTTPParsers.cpp:
(WebCore::trimInputSample):
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::saveResponseHeaders):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::setCacheDirectory):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):

Source/WebKit:

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::populateSandboxInitializationParameters):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::setSuggestedFilename):

Source/WebKitLegacy/win:

* WebDownload.cpp:
(WebDownload::bundlePathForTargetPath):

Source/WTF:

* wtf/Assertions.cpp:
* wtf/text/StringBuilder.h:
(WTF::StringBuilder::append):
* wtf/text/WTFString.cpp:
(WTF::String::insert):
(WTF::String::append):
* wtf/text/WTFString.h:

Tools:

* TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
(TestWebKitAPI::TEST_F):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveAuthenticationChallenge):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/heap/HeapSnapshotBuilder.cpp
trunk/Source/_javascript_Core/runtime/IntlObject.cpp
trunk/Source/_javascript_Core/runtime/TemporalObject.cpp
trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/Assertions.cpp
trunk/Source/WTF/wtf/text/StringBuilder.h
trunk/Source/WTF/wtf/text/WTFString.cpp
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp
trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp
trunk/Source/WebCore/Modules/indexeddb/shared/IDBIndexInfo.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
trunk/Source/WebCore/dom/CharacterData.cpp
trunk/Source/WebCore/dom/Text.cpp
trunk/Source/WebCore/dom/ViewportArguments.cpp
trunk/Source/WebCore/editing/markup.cpp
trunk/Source/WebCore/html/FTPDirectoryDocument.cpp
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
trunk/Source/WebCore/html/track/WebVTTParser.cpp
trunk/Source/WebCore/html/track/WebVTTParser.h
trunk/Source/WebCore/inspector/InspectorOverlay.cpp
trunk/Source/WebCore/inspector/InspectorOverlayLabel.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/page/scrolling/ScrollingStateTree.cpp
trunk/Source/WebCore/platform/graphics/HEVCUtilities.cpp
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp
trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp

[webkit-changes] [292874] trunk/Source/WebCore

2022-04-14 Thread cdumez
Title: [292874] trunk/Source/WebCore








Revision 292874
Author cdu...@apple.com
Date 2022-04-14 10:07:18 -0700 (Thu, 14 Apr 2022)


Log Message
Update ContainerNode::getElementsByName() to take in an AtomString
https://bugs.webkit.org/show_bug.cgi?id=239333

Reviewed by Alexey Shvayka.

Update ContainerNode::getElementsByName() to take in an AtomString instead of a String.
Its implementation ends up atomizing the name anyway.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByName):
* dom/ContainerNode.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/ContainerNode.cpp
trunk/Source/WebCore/dom/ContainerNode.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292873 => 292874)

--- trunk/Source/WebCore/ChangeLog	2022-04-14 16:39:48 UTC (rev 292873)
+++ trunk/Source/WebCore/ChangeLog	2022-04-14 17:07:18 UTC (rev 292874)
@@ -1,3 +1,17 @@
+2022-04-14  Chris Dumez  
+
+Update ContainerNode::getElementsByName() to take in an AtomString
+https://bugs.webkit.org/show_bug.cgi?id=239333
+
+Reviewed by Alexey Shvayka.
+
+Update ContainerNode::getElementsByName() to take in an AtomString instead of a String.
+Its implementation ends up atomizing the name anyway.
+
+* dom/ContainerNode.cpp:
+(WebCore::ContainerNode::getElementsByName):
+* dom/ContainerNode.h:
+
 2022-04-14  Youenn Fablet  
 
 Add logging for persistent notification event handler failure


Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (292873 => 292874)

--- trunk/Source/WebCore/dom/ContainerNode.cpp	2022-04-14 16:39:48 UTC (rev 292873)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2022-04-14 17:07:18 UTC (rev 292874)
@@ -947,7 +947,7 @@
 return ensureRareData().ensureNodeLists().addCachedTagCollectionNS(*this, namespaceURI.isEmpty() ? nullAtom() : namespaceURI, localName);
 }
 
-Ref ContainerNode::getElementsByName(const String& elementName)
+Ref ContainerNode::getElementsByName(const AtomString& elementName)
 {
 return ensureRareData().ensureNodeLists().addCacheWithAtomName(*this, elementName);
 }


Modified: trunk/Source/WebCore/dom/ContainerNode.h (292873 => 292874)

--- trunk/Source/WebCore/dom/ContainerNode.h	2022-04-14 16:39:48 UTC (rev 292873)
+++ trunk/Source/WebCore/dom/ContainerNode.h	2022-04-14 17:07:18 UTC (rev 292874)
@@ -140,7 +140,7 @@
 
 WEBCORE_EXPORT Ref getElementsByTagName(const AtomString&);
 WEBCORE_EXPORT Ref getElementsByTagNameNS(const AtomString& namespaceURI, const AtomString& localName);
-WEBCORE_EXPORT Ref getElementsByName(const String& elementName);
+WEBCORE_EXPORT Ref getElementsByName(const AtomString& elementName);
 WEBCORE_EXPORT Ref getElementsByClassName(const AtomString& classNames);
 Ref radioNodeList(const AtomString&);
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292854] trunk/Source/WebCore

2022-04-13 Thread cdumez
Title: [292854] trunk/Source/WebCore








Revision 292854
Author cdu...@apple.com
Date 2022-04-13 20:55:10 -0700 (Wed, 13 Apr 2022)


Log Message
Use [AtomString] where appropriate in IDL files for performance
https://bugs.webkit.org/show_bug.cgi?id=239314

Reviewed by Alexey Shvayka.

Use [AtomString] where appropriate in IDL files for performance. I added [AtomString] on the
IDL side whenever our C++ implementation uses AtomString.

Without this, the generated bindings code will generate a String, which will then get atomized
once passed to our implementation. This means we're doing unnecessary String allocations in
cases where the AtomString is already in the AtomStringTable.

* dom/Attr.idl:
* dom/Document+HTML.idl:
* dom/Document.cpp:
(WebCore::Document::createAttribute):
* dom/Document.h:
* dom/Document.idl:
* dom/Element.cpp:
(WebCore::Element::getAttribute const):
* dom/Element.idl:
* dom/ElementContentEditable.idl:
* dom/Event.idl:
* dom/FocusEvent.idl:
* dom/FormDataEvent.idl:
* dom/HashChangeEvent.idl:
* dom/InputEvent.idl:
* dom/KeyboardEvent.idl:
* dom/MessageEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationEvent.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/OverflowEvent.idl:
* dom/PageTransitionEvent.idl:
* dom/PointerEvent.idl:
* dom/ProgressEvent.idl:
* dom/PromiseRejectionEvent.idl:
* dom/SecurityPolicyViolationEvent.idl:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/TransitionEvent.idl:
* dom/UIEvent.idl:
* dom/WheelEvent.idl:
* html/HTMLButtonElement.idl:
* html/HTMLDocument.idl:
* html/HTMLElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLImageElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLLinkElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLScriptElement.idl:
* html/HTMLTableCellElement.idl:
* html/HTMLTrackElement.idl:
* html/MediaEncryptedEvent.idl:
* html/SubmitEvent.idl:
* html/track/AudioTrack.idl:
* html/track/AudioTrackList.idl:
* html/track/TextTrack.idl:
* html/track/TextTrackList.idl:
* html/track/VTTRegion.idl:
* html/track/VideoTrack.idl:
* html/track/VideoTrackList.idl:
* page/DOMWindow.idl:
* page/UserMessageHandlersNamespace.idl:
* storage/StorageEvent.idl:
* svg/SVGAltGlyphElement.idl:
* svg/SVGStyleElement.idl:
* workers/service/ExtendableEvent.idl:
* workers/service/ExtendableMessageEvent.idl:
* workers/service/FetchEvent.idl:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Attr.idl
trunk/Source/WebCore/dom/Document+HTML.idl
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/dom/Document.h
trunk/Source/WebCore/dom/Document.idl
trunk/Source/WebCore/dom/Element.cpp
trunk/Source/WebCore/dom/Element.idl
trunk/Source/WebCore/dom/ElementContentEditable.idl
trunk/Source/WebCore/dom/Event.idl
trunk/Source/WebCore/dom/FocusEvent.idl
trunk/Source/WebCore/dom/FormDataEvent.idl
trunk/Source/WebCore/dom/HashChangeEvent.idl
trunk/Source/WebCore/dom/InputEvent.idl
trunk/Source/WebCore/dom/KeyboardEvent.idl
trunk/Source/WebCore/dom/MessageEvent.idl
trunk/Source/WebCore/dom/MouseEvent.idl
trunk/Source/WebCore/dom/MutationEvent.idl
trunk/Source/WebCore/dom/NamedNodeMap.idl
trunk/Source/WebCore/dom/Node.idl
trunk/Source/WebCore/dom/OverflowEvent.idl
trunk/Source/WebCore/dom/PageTransitionEvent.idl
trunk/Source/WebCore/dom/PointerEvent.idl
trunk/Source/WebCore/dom/ProgressEvent.idl
trunk/Source/WebCore/dom/PromiseRejectionEvent.idl
trunk/Source/WebCore/dom/SecurityPolicyViolationEvent.idl
trunk/Source/WebCore/dom/TextEvent.idl
trunk/Source/WebCore/dom/TouchEvent.idl
trunk/Source/WebCore/dom/TransitionEvent.idl
trunk/Source/WebCore/dom/UIEvent.idl
trunk/Source/WebCore/dom/WheelEvent.idl
trunk/Source/WebCore/html/HTMLButtonElement.idl
trunk/Source/WebCore/html/HTMLDocument.idl
trunk/Source/WebCore/html/HTMLElement.idl
trunk/Source/WebCore/html/HTMLFormElement.idl
trunk/Source/WebCore/html/HTMLImageElement.idl
trunk/Source/WebCore/html/HTMLInputElement.idl
trunk/Source/WebCore/html/HTMLLinkElement.idl
trunk/Source/WebCore/html/HTMLMediaElement.idl
trunk/Source/WebCore/html/HTMLScriptElement.idl
trunk/Source/WebCore/html/HTMLTableCellElement.idl
trunk/Source/WebCore/html/HTMLTrackElement.idl
trunk/Source/WebCore/html/MediaEncryptedEvent.idl
trunk/Source/WebCore/html/SubmitEvent.idl
trunk/Source/WebCore/html/track/AudioTrack.idl
trunk/Source/WebCore/html/track/AudioTrackList.idl
trunk/Source/WebCore/html/track/TextTrack.idl
trunk/Source/WebCore/html/track/TextTrackList.idl
trunk/Source/WebCore/html/track/VTTRegion.idl
trunk/Source/WebCore/html/track/VideoTrack.idl
trunk/Source/WebCore/html/track/VideoTrackList.idl
trunk/Source/WebCore/page/DOMWindow.idl
trunk/Source/WebCore/page/UserMessageHandlersNamespace.idl
trunk/Source/WebCore/storage/StorageEvent.idl
trunk/Source/WebCore/svg/SVGAltGlyphElement.idl
trunk/Source/WebCore/svg/SVGStyleElement.idl
trunk/Source/WebCore/workers/service/ExtendableEvent.idl
trunk/Source/WebCore/workers/service/ExtendableMessageEvent.idl
trunk/Source/WebCore/workers/service/FetchEvent.idl




Diff

Modified: 

[webkit-changes] [292842] trunk/Source/WebKit

2022-04-13 Thread cdumez
Title: [292842] trunk/Source/WebKit








Revision 292842
Author cdu...@apple.com
Date 2022-04-13 16:17:19 -0700 (Wed, 13 Apr 2022)


Log Message
WebContent crashes with SIGTERM_TIMEOUT on macOS
https://bugs.webkit.org/show_bug.cgi?id=239298


Reviewed by Darin Adler.

To make sure that WebProcesses cannot use any CPU time while in the WebProcess cache on macOS, I recently tried to
suspend these cached processes. However, since we haven't adopted RunningBoard on macOS yet, I was doing suspension
and resuming manually via the SIGSTOP & SIGCONT signals. While this properly suspended our cached processes, this
introduced SIGTERM_TIMEOUT crashes and potential delays when exiting Safari or logging out of macOS while Safari is
running. This is because our cached & suspended processes are unable to process the SIGTERM signal they receive and
thus don't cleanly exit. After a timeout, the system forcefully kills them and generates a crash log with
SIGTERM_TIMEOUT to let us know.

To address the issue, I am disabling the WebProcess suspension logic that I recently added. We can reconsider doing
something like this once we adopt RunningBoard on macOS, assuming the same issue doesn't affect suspension via
RunningBoard.

* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::platformSuspendProcess):
(WebKit::WebProcessProxy::platformResumeProcess):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (292841 => 292842)

--- trunk/Source/WebKit/ChangeLog	2022-04-13 23:14:10 UTC (rev 292841)
+++ trunk/Source/WebKit/ChangeLog	2022-04-13 23:17:19 UTC (rev 292842)
@@ -1,3 +1,27 @@
+2022-04-13  Chris Dumez  
+
+WebContent crashes with SIGTERM_TIMEOUT on macOS
+https://bugs.webkit.org/show_bug.cgi?id=239298
+
+
+Reviewed by Darin Adler.
+
+To make sure that WebProcesses cannot use any CPU time while in the WebProcess cache on macOS, I recently tried to
+suspend these cached processes. However, since we haven't adopted RunningBoard on macOS yet, I was doing suspension
+and resuming manually via the SIGSTOP & SIGCONT signals. While this properly suspended our cached processes, this
+introduced SIGTERM_TIMEOUT crashes and potential delays when exiting Safari or logging out of macOS while Safari is
+running. This is because our cached & suspended processes are unable to process the SIGTERM signal they receive and
+thus don't cleanly exit. After a timeout, the system forcefully kills them and generates a crash log with
+SIGTERM_TIMEOUT to let us know.
+
+To address the issue, I am disabling the WebProcess suspension logic that I recently added. We can reconsider doing
+something like this once we adopt RunningBoard on macOS, assuming the same issue doesn't affect suspension via
+RunningBoard.
+
+* UIProcess/mac/WebProcessProxyMac.mm:
+(WebKit::WebProcessProxy::platformSuspendProcess):
+(WebKit::WebProcessProxy::platformResumeProcess):
+
 2022-04-13  Michael Catanzaro  
 
 Misc compiler warnings, April 2022 edition


Modified: trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm (292841 => 292842)

--- trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm	2022-04-13 23:14:10 UTC (rev 292841)
+++ trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm	2022-04-13 23:17:19 UTC (rev 292842)
@@ -80,20 +80,12 @@
 
 void WebProcessProxy::platformSuspendProcess()
 {
-RELEASE_LOG(Process, "%p - [PID=%i] WebProcessProxy::platformSuspendProcess", this, processIdentifier());
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-if (auto* connection = this->connection())
-xpc_connection_kill(connection->xpcConnection(), SIGSTOP);
-ALLOW_DEPRECATED_DECLARATIONS_END
+// FIXME: Adopt RunningBoard on macOS to support process suspension.
 }
 
 void WebProcessProxy::platformResumeProcess()
 {
-RELEASE_LOG(Process, "%p - [PID=%i] WebProcessProxy::platformResumeProcess", this, processIdentifier());
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-if (auto* connection = this->connection())
-xpc_connection_kill(connection->xpcConnection(), SIGCONT);
-ALLOW_DEPRECATED_DECLARATIONS_END
+// FIXME: Adopt RunningBoard on macOS to support process suspension.
 }
 
 } // namespace WebKit






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292832] trunk/LayoutTests/imported/w3c

2022-04-13 Thread cdumez
Title: [292832] trunk/LayoutTests/imported/w3c








Revision 292832
Author cdu...@apple.com
Date 2022-04-13 14:41:42 -0700 (Wed, 13 Apr 2022)


Log Message
imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html
https://bugs.webkit.org/show_bug.cgi?id=238790


Reviewed by Eric Carlson.

The audio values may differ slightly from hardware to hardware due to floating point precision and vectorization.
On one of our ARM platforms, we were getting values slightly outside the allowed range but still close enough
that we consider the behavior to be correct. As a result, I am increasing the tolerance a bit in the test.

If this resolves the issue on our bot (I cannot reproduce locally), I'll submit a PR upstream.

* web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt:
* web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html:

Modified Paths

trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html




Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (292831 => 292832)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-04-13 21:27:49 UTC (rev 292831)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-04-13 21:41:42 UTC (rev 292832)
@@ -1,3 +1,20 @@
+2022-04-13  Chris Dumez  
+
+imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html
+https://bugs.webkit.org/show_bug.cgi?id=238790
+
+
+Reviewed by Eric Carlson.
+
+The audio values may differ slightly from hardware to hardware due to floating point precision and vectorization.
+On one of our ARM platforms, we were getting values slightly outside the allowed range but still close enough
+that we consider the behavior to be correct. As a result, I am increasing the tolerance a bit in the test.
+
+If this resolves the issue on our bot (I cannot reproduce locally), I'll submit a PR upstream.
+
+* web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt:
+* web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html:
+
 2022-04-13  Antti Koivisto  
 
 [CSS Container Queries] Limit query range syntax


Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt (292831 => 292832)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt	2022-04-13 21:27:49 UTC (rev 292831)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering-expected.txt	2022-04-13 21:41:42 UTC (rev 292832)
@@ -36,7 +36,7 @@
 PASS   Output from gain setter matches setValueAtTime output is true.
 PASS < [Test 3] All assertions passed. (total 5 assertions)
 PASS > [Test 4] No dezippering of frequency vs JS filter
-PASS   Output from lowpass filter equals [expected array] with an element-wise tolerance of {"absoluteThreshold":5.9607e-7,"relativeThreshold":0}.
+PASS   Output from lowpass filter equals [expected array] with an element-wise tolerance of {"absoluteThreshold":6.8546e-7,"relativeThreshold":0}.
 PASS   Output matches JS filter results is true.
 PASS < [Test 4] All assertions passed. (total 2 assertions)
 PASS > [Test 5] Test with modulation


Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html (292831 => 292832)

--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html	2022-04-13 21:27:49 UTC (rev 292831)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-biquadfilternode-interface/no-dezippering.html	2022-04-13 21:41:42 UTC (rev 292832)
@@ -155,7 +155,7 @@
   let match =
   should(actual, 'Output from ' + f.type + ' filter')
   .beCloseToArray(
-  expected, {absoluteThreshold: 5.9607e-7});
+  expected, {absoluteThreshold: 6.8546e-7});
   should(match, 'Output matches JS filter results').beTrue();
 })
 .then(() => task.done());






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292814] trunk/Source/WTF

2022-04-13 Thread cdumez
Title: [292814] trunk/Source/WTF








Revision 292814
Author cdu...@apple.com
Date 2022-04-13 10:52:20 -0700 (Wed, 13 Apr 2022)


Log Message
Drop unused AtomString(const LChar*) constructor
https://bugs.webkit.org/show_bug.cgi?id=239274

Reviewed by Darin Adler.

* wtf/text/AtomString.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/AtomString.h




Diff

Modified: trunk/Source/WTF/ChangeLog (292813 => 292814)

--- trunk/Source/WTF/ChangeLog	2022-04-13 16:52:59 UTC (rev 292813)
+++ trunk/Source/WTF/ChangeLog	2022-04-13 17:52:20 UTC (rev 292814)
@@ -1,3 +1,12 @@
+2022-04-13  Chris Dumez  
+
+Drop unused AtomString(const LChar*) constructor
+https://bugs.webkit.org/show_bug.cgi?id=239274
+
+Reviewed by Darin Adler.
+
+* wtf/text/AtomString.h:
+
 2022-04-13  Wenson Hsieh  
 
 MSE video is not drawn onto canvas


Modified: trunk/Source/WTF/wtf/text/AtomString.h (292813 => 292814)

--- trunk/Source/WTF/wtf/text/AtomString.h	2022-04-13 16:52:59 UTC (rev 292813)
+++ trunk/Source/WTF/wtf/text/AtomString.h	2022-04-13 17:52:20 UTC (rev 292814)
@@ -38,7 +38,6 @@
 WTF_EXPORT_PRIVATE static void init();
 
 AtomString();
-AtomString(const LChar*);
 AtomString(const LChar*, unsigned length);
 AtomString(const UChar*, unsigned length);
 AtomString(const UChar*);
@@ -211,11 +210,6 @@
 {
 }
 
-inline AtomString::AtomString(const LChar* string)
-: m_string(AtomStringImpl::add(string))
-{
-}
-
 inline AtomString::AtomString(const char* string)
 : m_string(AtomStringImpl::add(string))
 {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292801] trunk/Source/WebCore

2022-04-12 Thread cdumez
Title: [292801] trunk/Source/WebCore








Revision 292801
Author cdu...@apple.com
Date 2022-04-12 22:38:50 -0700 (Tue, 12 Apr 2022)


Log Message
Crash under CachedResourceClientWalker::next()
https://bugs.webkit.org/show_bug.cgi?id=239253


Reviewed by Simon Fraser and Brent Fulgham.

I haven't been able to reproduce the issue or figure out why this is happening so I am doing
some hardening and adding assertions to help catch the underlying bug.

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::didUpdateCachedImage):
There is some speculation that r291141 could have caused this because of the timing of when
this patch landed and the fact that this patch modifies ImageLoader, which is a CachedImageClient.
I couldn't see anything wrong with the change. However, I did notice that we were calling
didUpdateCachedImage() twice with the same CachedImage now for lazy loading (once initially and then
another time when the image actually starts lazily). This was intentional. However, the registering
again as a client of the CachedImage (and then unregistering right away) was not. Technically, this
should be fine since CachedResource is using a HashCountedSet for m_clients locally. However, for
the sake of safety, I am now not doing this redundant registering/unregistering as a client of
the CachedImage when this image has not changed.

* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::checkNotify):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::notifyObservers):
(WebCore::CachedImage::canDestroyDecodedData):
(WebCore::CachedImage::imageFrameAvailable):
(WebCore::CachedImage::scheduleRenderingUpdate):
(WebCore::CachedImage::isVisibleInViewport):
(WebCore::CachedImage::isVisibleInViewport const): Deleted.
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::notifyClientsDataWasReceived):
(WebCore::iterateRedirects):

(WebCore::CachedRawResource::redirectReceived):
The new assertions found a bug here where we were capturing the CachedRawResourceClient by value in the lambda and thus
making a copy of it (even though this is a polymorphic class). I fixed the bug and marked CachedResourceClient as non
copyable to avoid issues like these.

(WebCore::CachedRawResource::responseReceived):
(WebCore::CachedRawResource::shouldCacheResponse):
(WebCore::CachedRawResource::didSendData):
(WebCore::CachedRawResource::finishedTimingForWorkerLoad):
(WebCore::CachedRawResource::previewResponseReceived):

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::checkNotify):
(WebCore::CachedResource::didAddClient):
(WebCore::CachedResource::addClientToSet):
(WebCore::CachedResource::removeClient):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceClient.h:
(WebCore::CachedResourceClient::~CachedResourceClient):
(WebCore::CachedResourceClient::addAssociatedResource):
(WebCore::CachedResourceClient::removeAssociatedResource):
Add new assertions to make sure that a CachedResourceClient is no longer associated (i.e. marked as a client of) with
any CachedResource at the time it is destroyed. Hopefully, this will catch the issue right away and give us a useful
stack trace, instead of crashing later on when iterating over the clients of a CachedResource.

* loader/cache/CachedResourceClientWalker.h:
(WebCore::CachedResourceClientWalker::CachedResourceClientWalker):
(WebCore::CachedResourceClientWalker::next):
CachedResourceClientWalker is meant to be a safe way of iterating over the clients of a CachedResource, allowing clients
to unregister themselves as we iterate. However, when clients unregister themselves, it could in theory cause the
CachedResource itself to get destroyed. In such cases, the CachedResourceClientWalker would not be safe since its
m_clientSet data member would come from a dead CachedResource. To address the issue, the walker now keeps a handle to
the cached resource, instead of the reference to the CachedResource's clients set. The handle will ensure the cached
resource stays alive.

* loader/cache/CachedScript.cpp:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::doUpdateBuffer):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::checkNotify):
* rendering/RenderObject.cpp:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/ImageLoader.cpp
trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
trunk/Source/WebCore/loader/cache/CachedFont.cpp
trunk/Source/WebCore/loader/cache/CachedImage.cpp
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
trunk/Source/WebCore/loader/cache/CachedResource.cpp
trunk/Source/WebCore/loader/cache/CachedResource.h
trunk/Source/WebCore/loader/cache/CachedResourceClient.h
trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h
trunk/Source/WebCore/loader/cache/CachedScript.cpp

[webkit-changes] [292796] trunk/Source/WebCore

2022-04-12 Thread cdumez
Title: [292796] trunk/Source/WebCore








Revision 292796
Author cdu...@apple.com
Date 2022-04-12 20:58:56 -0700 (Tue, 12 Apr 2022)


Log Message
Use safer downcast<>() for CachedResourceClient subclasses
https://bugs.webkit.org/show_bug.cgi?id=239220

Reviewed by Simon Fraser.

* loader/LinkPreloadResourceClients.h:
(WebCore::LinkPreloadImageResourceClient::LinkPreloadImageResourceClient):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::didAddClient):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didAddClient):
(WebCore::CachedImage::didRemoveClient):
* loader/cache/CachedImageClient.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::didAddClient):
* loader/cache/CachedRawResourceClient.h:
* loader/cache/CachedResourceClient.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
* loader/cache/CachedSVGDocumentClient.h:
* loader/cache/CachedStyleSheetClient.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/LinkPreloadResourceClients.h
trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp
trunk/Source/WebCore/loader/cache/CachedFont.cpp
trunk/Source/WebCore/loader/cache/CachedFontClient.h
trunk/Source/WebCore/loader/cache/CachedImage.cpp
trunk/Source/WebCore/loader/cache/CachedImageClient.h
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
trunk/Source/WebCore/loader/cache/CachedRawResourceClient.h
trunk/Source/WebCore/loader/cache/CachedResourceClient.h
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
trunk/Source/WebCore/loader/cache/CachedSVGDocumentClient.h
trunk/Source/WebCore/loader/cache/CachedStyleSheetClient.h
trunk/Source/WebCore/loader/cache/CachedXSLStyleSheet.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292795 => 292796)

--- trunk/Source/WebCore/ChangeLog	2022-04-13 03:54:32 UTC (rev 292795)
+++ trunk/Source/WebCore/ChangeLog	2022-04-13 03:58:56 UTC (rev 292796)
@@ -1,3 +1,31 @@
+2022-04-12  Chris Dumez  
+
+Use safer downcast<>() for CachedResourceClient subclasses
+https://bugs.webkit.org/show_bug.cgi?id=239220
+
+Reviewed by Simon Fraser.
+
+* loader/LinkPreloadResourceClients.h:
+(WebCore::LinkPreloadImageResourceClient::LinkPreloadImageResourceClient):
+* loader/cache/CachedCSSStyleSheet.cpp:
+(WebCore::CachedCSSStyleSheet::didAddClient):
+* loader/cache/CachedFont.cpp:
+(WebCore::CachedFont::didAddClient):
+* loader/cache/CachedImage.cpp:
+(WebCore::CachedImage::didAddClient):
+(WebCore::CachedImage::didRemoveClient):
+* loader/cache/CachedImageClient.h:
+* loader/cache/CachedRawResource.cpp:
+(WebCore::CachedRawResource::didAddClient):
+* loader/cache/CachedRawResourceClient.h:
+* loader/cache/CachedResourceClient.h:
+* loader/cache/CachedResourceLoader.cpp:
+(WebCore::createResource):
+* loader/cache/CachedSVGDocumentClient.h:
+* loader/cache/CachedStyleSheetClient.h:
+* loader/cache/CachedXSLStyleSheet.cpp:
+(WebCore::CachedXSLStyleSheet::didAddClient):
+
 2022-04-12  Devin Rousso  
 
 [Modern Media Controls] allow skipping by durations other than 15s


Modified: trunk/Source/WebCore/loader/LinkPreloadResourceClients.h (292795 => 292796)

--- trunk/Source/WebCore/loader/LinkPreloadResourceClients.h	2022-04-13 03:54:32 UTC (rev 292795)
+++ trunk/Source/WebCore/loader/LinkPreloadResourceClients.h	2022-04-13 03:58:56 UTC (rev 292796)
@@ -116,7 +116,7 @@
 WTF_MAKE_FAST_ALLOCATED;
 public:
 LinkPreloadImageResourceClient(LinkLoader& loader, CachedImage& resource)
-: LinkPreloadResourceClient(loader, static_cast(resource))
+: LinkPreloadResourceClient(loader, resource)
 {
 addResource(*this);
 }


Modified: trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp (292795 => 292796)

--- trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2022-04-13 03:54:32 UTC (rev 292795)
+++ trunk/Source/WebCore/loader/cache/CachedCSSStyleSheet.cpp	2022-04-13 03:58:56 UTC (rev 292796)
@@ -59,7 +59,7 @@
 CachedResource::didAddClient(client);
 
 if (!isLoading())
-static_cast(client).setCSSStyleSheet(m_resourceRequest.url().string(), m_response.url(), String::fromLatin1(m_decoder->encoding().name()), this);
+downcast(client).setCSSStyleSheet(m_resourceRequest.url().string(), m_response.url(), String::fromLatin1(m_decoder->encoding().name()), this);
 }
 
 void CachedCSSStyleSheet::setEncoding(const String& chs)


Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (292795 => 292796)

--- trunk/Source/WebCore/loader/cache/CachedFont.cpp	2022-04-13 03:54:32 UTC (rev 292795)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp	2022-04-13 03:58:56 UTC (rev 292796)

[webkit-changes] [292750] trunk/Tools

2022-04-11 Thread cdumez
Title: [292750] trunk/Tools








Revision 292750
Author cdu...@apple.com
Date 2022-04-11 18:15:48 -0700 (Mon, 11 Apr 2022)


Log Message
REGRESSION:(r292696) lldb_webkit_unittest.TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=239087

Reviewed by Jonathan Bedard.

Revert change to aNullString made in r292696 as the the following test relies on this String being empty:
lldb_webkit_unittest.TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string

* lldb/lldbWebKitTester/main.cpp:
(testSummaryProviders):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/lldb/lldbWebKitTester/main.cpp




Diff

Modified: trunk/Tools/ChangeLog (292749 => 292750)

--- trunk/Tools/ChangeLog	2022-04-12 00:43:49 UTC (rev 292749)
+++ trunk/Tools/ChangeLog	2022-04-12 01:15:48 UTC (rev 292750)
@@ -1,3 +1,16 @@
+2022-04-11  Chris Dumez  
+
+REGRESSION:(r292696) lldb_webkit_unittest.TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string is a constant failure
+https://bugs.webkit.org/show_bug.cgi?id=239087
+
+Reviewed by Jonathan Bedard.
+
+Revert change to aNullString made in r292696 as the the following test relies on this String being empty:
+lldb_webkit_unittest.TestSummaryProviders.serial_test_WTFStringImpl_SummaryProvider_null_string
+
+* lldb/lldbWebKitTester/main.cpp:
+(testSummaryProviders):
+
 2022-04-11  Alan Bujtas  
 
 [ iOS iPhone 12 ] fast/hidpi & fast/layers/hidpi tests are flaky text/image failing


Modified: trunk/Tools/lldb/lldbWebKitTester/main.cpp (292749 => 292750)

--- trunk/Tools/lldb/lldbWebKitTester/main.cpp	2022-04-12 00:43:49 UTC (rev 292749)
+++ trunk/Tools/lldb/lldbWebKitTester/main.cpp	2022-04-12 01:15:48 UTC (rev 292750)
@@ -57,7 +57,7 @@
 
 static void testSummaryProviders()
 {
-String aNullString { };
+String aNullString { ""_s };
 StringImpl* aNullStringImpl = aNullString.impl();
 
 String anEmptyString { ""_s };






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292703] trunk/Tools

2022-04-11 Thread cdumez
Title: [292703] trunk/Tools








Revision 292703
Author cdu...@apple.com
Date 2022-04-10 23:17:54 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.

* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp




Diff

Modified: trunk/Tools/ChangeLog (292702 => 292703)

--- trunk/Tools/ChangeLog	2022-04-11 06:13:04 UTC (rev 292702)
+++ trunk/Tools/ChangeLog	2022-04-11 06:17:54 UTC (rev 292703)
@@ -2,6 +2,13 @@
 
 Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.
 
+* TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp:
+(TestWebKitAPI::TEST):
+
+2022-04-10  Chris Dumez  
+
+Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.
+
 * TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp:
 (TestWebKitAPI::TEST_F):
 


Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp (292702 => 292703)

--- trunk/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp	2022-04-11 06:13:04 UTC (rev 292702)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/ParsedContentType.cpp	2022-04-11 06:17:54 UTC (rev 292703)
@@ -237,8 +237,8 @@
 EXPECT_STREQ(serializeIfValid("text"_s), "NOTVALID");
 EXPECT_STREQ(serializeIfValid("text/"_s), "NOTVALID");
 EXPECT_STREQ(serializeIfValid("/plain"_s), "NOTVALID");
-EXPECT_STREQ(serializeIfValid("†/†"_s), "NOTVALID");
-EXPECT_STREQ(serializeIfValid("text/\xD8\x88\x12\x34"_s), "NOTVALID");
+EXPECT_STREQ(serializeIfValid(String::fromUTF8("†/†")), "NOTVALID");
+EXPECT_STREQ(serializeIfValid(String::fromUTF8("text/\xD8\x88\x12\x34")), "NOTVALID");
 
 EXPECT_STREQ(serializeIfValid("text/plain;"_s), "text/plain");
 EXPECT_STREQ(serializeIfValid("text/plain;;"_s), "text/plain");






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292702] trunk/Tools

2022-04-11 Thread cdumez
Title: [292702] trunk/Tools








Revision 292702
Author cdu...@apple.com
Date 2022-04-10 23:13:04 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.

* TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp




Diff

Modified: trunk/Tools/ChangeLog (292701 => 292702)

--- trunk/Tools/ChangeLog	2022-04-11 05:29:23 UTC (rev 292701)
+++ trunk/Tools/ChangeLog	2022-04-11 06:13:04 UTC (rev 292702)
@@ -1,5 +1,12 @@
 2022-04-10  Chris Dumez  
 
+Unreviewed, fix use of ASCIILiteral for a literal containing non-ASCII characters after r292251.
+
+* TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp:
+(TestWebKitAPI::TEST_F):
+
+2022-04-10  Chris Dumez  
+
 Finish porting code base to String::fromLatin1() and make String(const char*) private
 https://bugs.webkit.org/show_bug.cgi?id=238977
 


Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp (292701 => 292702)

--- trunk/Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp	2022-04-11 05:29:23 UTC (rev 292701)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/PublicSuffix.cpp	2022-04-11 06:13:04 UTC (rev 292702)
@@ -60,7 +60,7 @@
 EXPECT_FALSE(isPublicSuffix(utf16String(bidirectionalDomain)));
 EXPECT_TRUE(isPublicSuffix(utf16String(u"\u6803\u6728.jp")));
 EXPECT_FALSE(isPublicSuffix(""_s));
-EXPECT_FALSE(isPublicSuffix("åäö"_s));
+EXPECT_FALSE(isPublicSuffix(String::fromUTF8("åäö")));
 
 // UK
 EXPECT_TRUE(isPublicSuffix("uk"_s));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292701] trunk/Source

2022-04-10 Thread cdumez
Title: [292701] trunk/Source








Revision 292701
Author cdu...@apple.com
Date 2022-04-10 22:29:23 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed Windows build fix after r292696.

Source/WebCore:

* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):

Source/WebCore/PAL:

* pal/win/LoggingWin.cpp:
(PAL::logLevelString):

Source/WebKit:

* Platform/win/LoggingWin.cpp:
(WebKit::logLevelString):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/win/LoggingWin.cpp
trunk/Source/WebCore/platform/win/LoggingWin.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Platform/win/LoggingWin.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292700 => 292701)

--- trunk/Source/WebCore/ChangeLog	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebCore/ChangeLog	2022-04-11 05:29:23 UTC (rev 292701)
@@ -1,3 +1,10 @@
+2022-04-10  Chris Dumez  
+
+Unreviewed Windows build fix after r292696.
+
+* platform/win/LoggingWin.cpp:
+(WebCore::logLevelString):
+
 2022-04-10  Yusuke Suzuki  
 
 [JSC] DFG / FTL should be aware of JSString's String replacement


Modified: trunk/Source/WebCore/PAL/ChangeLog (292700 => 292701)

--- trunk/Source/WebCore/PAL/ChangeLog	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-04-11 05:29:23 UTC (rev 292701)
@@ -1,3 +1,10 @@
+2022-04-10  Chris Dumez  
+
+Unreviewed Windows build fix after r292696.
+
+* pal/win/LoggingWin.cpp:
+(PAL::logLevelString):
+
 2022-04-08  Elliott Williams  
 
 [Xcode] Avoid targeting 32-bit iOS and Mac architectures


Modified: trunk/Source/WebCore/PAL/pal/win/LoggingWin.cpp (292700 => 292701)

--- trunk/Source/WebCore/PAL/pal/win/LoggingWin.cpp	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebCore/PAL/pal/win/LoggingWin.cpp	2022-04-11 05:29:23 UTC (rev 292701)
@@ -47,7 +47,7 @@
 if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.data(), length))
 return emptyString();
 
-return String(buffer.data());
+return String::fromLatin1(buffer.data());
 #else
 return String();
 #endif


Modified: trunk/Source/WebCore/platform/win/LoggingWin.cpp (292700 => 292701)

--- trunk/Source/WebCore/platform/win/LoggingWin.cpp	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebCore/platform/win/LoggingWin.cpp	2022-04-11 05:29:23 UTC (rev 292701)
@@ -47,7 +47,7 @@
 if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.data(), length))
 return emptyString();
 
-return String(buffer.data());
+return String::fromLatin1(buffer.data());
 #else
 return String();
 #endif


Modified: trunk/Source/WebKit/ChangeLog (292700 => 292701)

--- trunk/Source/WebKit/ChangeLog	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebKit/ChangeLog	2022-04-11 05:29:23 UTC (rev 292701)
@@ -1,3 +1,10 @@
+2022-04-10  Chris Dumez  
+
+Unreviewed Windows build fix after r292696.
+
+* Platform/win/LoggingWin.cpp:
+(WebKit::logLevelString):
+
 2022-04-10  Fujii Hironori  
 
 [WinCairo] Child process happens to remain alive even after IPC::Connection is disconnected


Modified: trunk/Source/WebKit/Platform/win/LoggingWin.cpp (292700 => 292701)

--- trunk/Source/WebKit/Platform/win/LoggingWin.cpp	2022-04-11 05:27:02 UTC (rev 292700)
+++ trunk/Source/WebKit/Platform/win/LoggingWin.cpp	2022-04-11 05:29:23 UTC (rev 292701)
@@ -48,7 +48,7 @@
 if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.data(), length))
 return emptyString();
 
-return String(buffer.data());
+return String::fromLatin1(buffer.data());
 #else
 return String();
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292700] trunk/Source/JavaScriptCore

2022-04-10 Thread cdumez
Title: [292700] trunk/Source/_javascript_Core








Revision 292700
Author cdu...@apple.com
Date 2022-04-10 22:27:02 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed WatchOS build fix.

* runtime/MathCommon.cpp:
(JSC::fdlibmPow):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/MathCommon.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292699 => 292700)

--- trunk/Source/_javascript_Core/ChangeLog	2022-04-11 05:23:47 UTC (rev 292699)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-04-11 05:27:02 UTC (rev 292700)
@@ -5,6 +5,13 @@
 * runtime/MathCommon.cpp:
 (JSC::fdlibmPow):
 
+2022-04-10  Chris Dumez  
+
+Unreviewed WatchOS build fix.
+
+* runtime/MathCommon.cpp:
+(JSC::fdlibmPow):
+
 2022-04-10  Yusuke Suzuki  
 
 [JSC] DFG / FTL should be aware of JSString's String replacement


Modified: trunk/Source/_javascript_Core/runtime/MathCommon.cpp (292699 => 292700)

--- trunk/Source/_javascript_Core/runtime/MathCommon.cpp	2022-04-11 05:23:47 UTC (rev 292699)
+++ trunk/Source/_javascript_Core/runtime/MathCommon.cpp	2022-04-11 05:27:02 UTC (rev 292700)
@@ -175,11 +175,10 @@
 {
 double z,ax,z_h,z_l,p_h,p_l;
 double y1,t1,t2,r,s,t,u,v,w;
-int i0,i,j,k,yisint,n;
+int i,j,k,yisint,n;
 int hx,hy,ix,iy;
 unsigned lx,ly;
 
-i0 = ((*(const int*))>>29)^1;
 hx = __HI(x); lx = __LO(x);
 hy = __HI(y); ly = __LO(y);
 ix = hx&0x7fff;  iy = hy&0x7fff;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292699] trunk/Source/WTF

2022-04-10 Thread cdumez
Title: [292699] trunk/Source/WTF








Revision 292699
Author cdu...@apple.com
Date 2022-04-10 22:23:47 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed Windows build fix after r292696.

* wtf/win/LoggingWin.cpp:
(WTF::logLevelString):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/win/LoggingWin.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (292698 => 292699)

--- trunk/Source/WTF/ChangeLog	2022-04-11 05:21:44 UTC (rev 292698)
+++ trunk/Source/WTF/ChangeLog	2022-04-11 05:23:47 UTC (rev 292699)
@@ -1,5 +1,12 @@
 2022-04-10  Chris Dumez  
 
+Unreviewed Windows build fix after r292696.
+
+* wtf/win/LoggingWin.cpp:
+(WTF::logLevelString):
+
+2022-04-10  Chris Dumez  
+
 Finish porting code base to String::fromLatin1() and make String(const char*) private
 https://bugs.webkit.org/show_bug.cgi?id=238977
 


Modified: trunk/Source/WTF/wtf/win/LoggingWin.cpp (292698 => 292699)

--- trunk/Source/WTF/wtf/win/LoggingWin.cpp	2022-04-11 05:21:44 UTC (rev 292698)
+++ trunk/Source/WTF/wtf/win/LoggingWin.cpp	2022-04-11 05:23:47 UTC (rev 292699)
@@ -48,7 +48,7 @@
 if (!GetEnvironmentVariableA(loggingEnvironmentVariable, buffer.data(), length))
 return emptyString();
 
-return String(buffer.data());
+return String::fromLatin1(buffer.data());
 #else
 return String();
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292698] trunk/Source/JavaScriptCore

2022-04-10 Thread cdumez
Title: [292698] trunk/Source/_javascript_Core








Revision 292698
Author cdu...@apple.com
Date 2022-04-10 22:21:44 -0700 (Sun, 10 Apr 2022)


Log Message
Unreviewed WatchOS build fix.

* runtime/MathCommon.cpp:
(JSC::fdlibmPow):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/MathCommon.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292697 => 292698)

--- trunk/Source/_javascript_Core/ChangeLog	2022-04-11 04:57:33 UTC (rev 292697)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-04-11 05:21:44 UTC (rev 292698)
@@ -1,3 +1,10 @@
+2022-04-10  Chris Dumez  
+
+Unreviewed WatchOS build fix.
+
+* runtime/MathCommon.cpp:
+(JSC::fdlibmPow):
+
 2022-04-10  Yusuke Suzuki  
 
 [JSC] DFG / FTL should be aware of JSString's String replacement


Modified: trunk/Source/_javascript_Core/runtime/MathCommon.cpp (292697 => 292698)

--- trunk/Source/_javascript_Core/runtime/MathCommon.cpp	2022-04-11 04:57:33 UTC (rev 292697)
+++ trunk/Source/_javascript_Core/runtime/MathCommon.cpp	2022-04-11 05:21:44 UTC (rev 292698)
@@ -175,11 +175,11 @@
 {
 double z,ax,z_h,z_l,p_h,p_l;
 double y1,t1,t2,r,s,t,u,v,w;
-int i0,i1,i,j,k,yisint,n;
+int i0,i,j,k,yisint,n;
 int hx,hy,ix,iy;
 unsigned lx,ly;
 
-i0 = ((*(const int*))>>29)^1; i1=1-i0;
+i0 = ((*(const int*))>>29)^1;
 hx = __HI(x); lx = __LO(x);
 hy = __HI(y); ly = __LO(y);
 ix = hx&0x7fff;  iy = hy&0x7fff;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292693] trunk/Source/WebCore

2022-04-10 Thread cdumez
Title: [292693] trunk/Source/WebCore








Revision 292693
Author cdu...@apple.com
Date 2022-04-10 18:32:25 -0700 (Sun, 10 Apr 2022)


Log Message
Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=239022


Reviewed by Darin Adler.

Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String. listMarkerTextForNodeAndPosition()
has a StringView internally and none it its call sites actually need a String. The call sites either use StringBuilder
or want a NSString*. This avoids unnecessary String allocations.

* accessibility/AccessibilityObject.cpp:
(WebCore::listMarkerTextForNode):
(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(AXAttributedStringAppendText):
(-[WebAccessibilityObjectWrapperBase contentForSimpleRange:attributed:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
trunk/Source/WebCore/accessibility/AccessibilityObject.h
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperBase.mm
trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (292692 => 292693)

--- trunk/Source/WebCore/ChangeLog	2022-04-10 23:54:28 UTC (rev 292692)
+++ trunk/Source/WebCore/ChangeLog	2022-04-11 01:32:25 UTC (rev 292693)
@@ -1,5 +1,27 @@
 2022-04-10  Chris Dumez  
 
+Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String
+https://bugs.webkit.org/show_bug.cgi?id=239022
+
+
+Reviewed by Darin Adler.
+
+Update listMarkerTextForNodeAndPosition() to return a StringView instead of a String. listMarkerTextForNodeAndPosition()
+has a StringView internally and none it its call sites actually need a String. The call sites either use StringBuilder
+or want a NSString*. This avoids unnecessary String allocations.
+
+* accessibility/AccessibilityObject.cpp:
+(WebCore::listMarkerTextForNode):
+(WebCore::AccessibilityObject::listMarkerTextForNodeAndPosition):
+* accessibility/AccessibilityObject.h:
+* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
+(AXAttributedStringAppendText):
+(-[WebAccessibilityObjectWrapperBase contentForSimpleRange:attributed:]):
+* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+(-[WebAccessibilityObjectWrapper doAXAttributedStringForTextMarkerRange:spellCheck:]):
+
+2022-04-10  Chris Dumez  
+
 Avoid redundant calls to findHTTPHeaderName()
 https://bugs.webkit.org/show_bug.cgi?id=239021
 


Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (292692 => 292693)

--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2022-04-10 23:54:28 UTC (rev 292692)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2022-04-11 01:32:25 UTC (rev 292693)
@@ -1440,20 +1440,20 @@
 return nullptr;
 }
 
-static String listMarkerTextForNode(Node* node)
+static StringView listMarkerTextForNode(Node* node)
 {
 RenderListItem* listItem = renderListItemContainerForNode(node);
 if (!listItem)
-return String();
+return { };
 
 // If this is in a list item, we need to manually add the text for the list marker
 // because a RenderListMarker does not have a Node equivalent and thus does not appear
 // when iterating text.
-return listItem->markerTextWithSuffix().toString();
+return listItem->markerTextWithSuffix();
 }
 
 // Returns the text associated with a list marker if this node is contained within a list item.
-String AccessibilityObject::listMarkerTextForNodeAndPosition(Node* node, const VisiblePosition& visiblePositionStart)
+StringView AccessibilityObject::listMarkerTextForNodeAndPosition(Node* node, const VisiblePosition& visiblePositionStart)
 {
 auto* listItem = renderListItemContainerForNode(node);
 if (!listItem)


Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (292692 => 292693)

--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2022-04-10 23:54:28 UTC (rev 292692)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2022-04-11 01:32:25 UTC (rev 292693)
@@ -607,7 +607,7 @@
 String doAXStringForRange(const PlainTextRange&) const override { return String(); }
 IntRect doAXBoundsForRange(const PlainTextRange&) const override { return IntRect(); }
 IntRect doAXBoundsForRangeUsingCharacterOffset(const PlainTextRange&) const override { return IntRect(); }
-static String listMarkerTextForNodeAndPosition(Node*, const VisiblePosition&);
+static StringView listMarkerTextForNodeAndPosition(Node*, 

[webkit-changes] [292692] trunk/Source/WebCore

2022-04-10 Thread cdumez
Title: [292692] trunk/Source/WebCore








Revision 292692
Author cdu...@apple.com
Date 2022-04-10 16:54:28 -0700 (Sun, 10 Apr 2022)


Log Message
Avoid redundant calls to findHTTPHeaderName()
https://bugs.webkit.org/show_bug.cgi?id=239021

Reviewed by Darin Adler.

Some call sites of HTTPHeaderMap::add() / set() or ResourceResponse::addHTTPHeaderField() / setHTTPHeaderField()
have already called findHTTPHeaderName() and determined that this wasn't a common header. As a result, we were
doing redundant findHTTPHeaderName() checks inside those functions. To avoid this, add overloads that take in
a header that we already know is uncommon.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::appendToHeaderMap):
(WebCore::FetchHeaders::filterAndFill):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::resourceResponse const):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readHTTPHeaders):
* platform/network/CacheValidation.cpp:
(WebCore::updateResponseHeadersAfterRevalidation):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::setUncommonHeader):
(WebCore::HTTPHeaderMap::add):
(WebCore::HTTPHeaderMap::addUncommonHeader):
* platform/network/HTTPHeaderMap.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setHTTPHeaderField):
(WebCore::ResourceResponseBase::setUncommonHTTPHeaderField):
(WebCore::ResourceResponseBase::addHTTPHeaderField):
(WebCore::ResourceResponseBase::addUncommonHTTPHeaderField):
* platform/network/ResourceResponseBase.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp
trunk/Source/WebCore/platform/network/CacheValidation.cpp
trunk/Source/WebCore/platform/network/HTTPHeaderMap.cpp
trunk/Source/WebCore/platform/network/HTTPHeaderMap.h
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
trunk/Source/WebCore/platform/network/ResourceResponseBase.h
trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292691 => 292692)

--- trunk/Source/WebCore/ChangeLog	2022-04-10 23:52:37 UTC (rev 292691)
+++ trunk/Source/WebCore/ChangeLog	2022-04-10 23:54:28 UTC (rev 292692)
@@ -1,3 +1,38 @@
+2022-04-10  Chris Dumez  
+
+Avoid redundant calls to findHTTPHeaderName()
+https://bugs.webkit.org/show_bug.cgi?id=239021
+
+Reviewed by Darin Adler.
+
+Some call sites of HTTPHeaderMap::add() / set() or ResourceResponse::addHTTPHeaderField() / setHTTPHeaderField()
+have already called findHTTPHeaderName() and determined that this wasn't a common header. As a result, we were
+doing redundant findHTTPHeaderName() checks inside those functions. To avoid this, add overloads that take in
+a header that we already know is uncommon.
+
+* Modules/fetch/FetchHeaders.cpp:
+(WebCore::appendToHeaderMap):
+(WebCore::FetchHeaders::filterAndFill):
+* Modules/fetch/FetchResponse.cpp:
+(WebCore::FetchResponse::resourceResponse const):
+* Modules/websockets/WebSocketHandshake.cpp:
+(WebCore::WebSocketHandshake::readHTTPHeaders):
+* platform/network/CacheValidation.cpp:
+(WebCore::updateResponseHeadersAfterRevalidation):
+* platform/network/HTTPHeaderMap.cpp:
+(WebCore::HTTPHeaderMap::setUncommonHeader):
+(WebCore::HTTPHeaderMap::add):
+(WebCore::HTTPHeaderMap::addUncommonHeader):
+* platform/network/HTTPHeaderMap.h:
+* platform/network/ResourceResponseBase.cpp:
+(WebCore::ResourceResponseBase::setHTTPHeaderField):
+(WebCore::ResourceResponseBase::setUncommonHTTPHeaderField):
+(WebCore::ResourceResponseBase::addHTTPHeaderField):
+(WebCore::ResourceResponseBase::addUncommonHTTPHeaderField):
+* platform/network/ResourceResponseBase.h:
+* workers/service/ServiceWorkerJob.cpp:
+(WebCore::ServiceWorkerJob::fetchScriptWithContext):
+
 2022-04-10  Alan Bujtas  
 
 [Line clamp] Move line clamp only code from RenderBlockFlow to RenderDeprecatedFlexibleBox


Modified: trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp (292691 => 292692)

--- trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp	2022-04-10 23:52:37 UTC (rev 292691)
+++ trunk/Source/WebCore/Modules/fetch/FetchHeaders.cpp	2022-04-10 23:54:28 UTC (rev 292692)
@@ -87,7 +87,7 @@
 if (header.keyAsHTTPHeaderName)
 headers.add(header.keyAsHTTPHeaderName.value(), header.value);
 else
-headers.add(header.key, header.value);
+headers.addUncommonHeader(header.key, header.value);
 
 if (guard == FetchHeaders::Guard::RequestNoCors)
 removePrivilegedNoCORSRequestHeaders(headers);
@@ -218,7 +218,7 @@
 if 

[webkit-changes] [292680] trunk

2022-04-09 Thread cdumez
Title: [292680] trunk








Revision 292680
Author cdu...@apple.com
Date 2022-04-09 12:05:27 -0700 (Sat, 09 Apr 2022)


Log Message
The Youtube plugin replacement should only work for actual Youtube URLs
https://bugs.webkit.org/show_bug.cgi?id=239003


Reviewed by Brent Fulgham.

Source/WebCore:

The Youtube plugin replacement was too permissive and was falling back to using
the original URL in cases there the original URL wasn't an expected Youtube
URL. This patch hardens the plugin replacement and drops the URL if it is not
a valid youtube URL instead.

Covered by new API test.

* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::isYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):

Tools:

Add API test coverage.

* TestWebKitAPI/SourcesCocoa.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp:
(TestWebKitAPI::test):
(TestWebKitAPI::TEST_F):
* TestWebKitAPI/Tests/WebKitCocoa/YoutubeReplacementPlugin.mm: Added.
(TEST):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/SourcesCocoa.txt
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
trunk/Tools/TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp


Added Paths

trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/YoutubeReplacementPlugin.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (292679 => 292680)

--- trunk/Source/WebCore/ChangeLog	2022-04-09 17:55:18 UTC (rev 292679)
+++ trunk/Source/WebCore/ChangeLog	2022-04-09 19:05:27 UTC (rev 292680)
@@ -1,3 +1,23 @@
+2022-04-09  Chris Dumez  
+
+The Youtube plugin replacement should only work for actual Youtube URLs
+https://bugs.webkit.org/show_bug.cgi?id=239003
+
+
+Reviewed by Brent Fulgham.
+
+The Youtube plugin replacement was too permissive and was falling back to using
+the original URL in cases there the original URL wasn't an expected Youtube
+URL. This patch hardens the plugin replacement and drops the URL if it is not
+a valid youtube URL instead.
+
+Covered by new API test.
+
+* Modules/plugins/YouTubePluginReplacement.cpp:
+(WebCore::isYouTubeURL):
+(WebCore::processAndCreateYouTubeURL):
+(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
+
 2022-04-09  Alan Bujtas  
 
 REGRESSION (Safari 15.4): Focused element doesn't render outline when it has an underline


Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (292679 => 292680)

--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-04-09 17:55:18 UTC (rev 292679)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-04-09 19:05:27 UTC (rev 292680)
@@ -169,6 +169,9 @@
 
 static bool isYouTubeURL(const URL& url)
 {
+if (!url.protocolIsInHTTPFamily())
+return false;
+
 auto hostName = url.host();
 return equalLettersIgnoringASCIICase(hostName, "m.youtube.com")
 || equalLettersIgnoringASCIICase(hostName, "youtu.be")
@@ -189,8 +192,7 @@
 
 static URL processAndCreateYouTubeURL(const URL& url, bool& isYouTubeShortenedURL, String& outPathAfterFirstAmpersand)
 {
-if (!url.protocolIsInHTTPFamily())
-return URL();
+ASSERT(isYouTubeURL(url));
 
 // Bail out early if we aren't even on www.youtube.com or youtube.com.
 if (!isYouTubeURL(url))
@@ -282,10 +284,14 @@
 
 String YouTubePluginReplacement::youTubeURLFromAbsoluteURL(const URL& srcURL, const String& srcString)
 {
+// Validate URL to make sure it is a Youtube URL.
+if (!isYouTubeURL(srcURL))
+return emptyString();
+
 bool isYouTubeShortenedURL = false;
 String possiblyMalformedQuery;
 URL youTubeURL = processAndCreateYouTubeURL(srcURL, isYouTubeShortenedURL, possiblyMalformedQuery);
-if (srcURL.isEmpty() || youTubeURL.isEmpty())
+if (youTubeURL.isEmpty())
 return srcString;
 
 // Transform the youtubeURL (youtube:VideoID) to iframe embed url which has the format: http://www.youtube.com/embed/VideoID


Modified: trunk/Tools/ChangeLog (292679 => 292680)

--- trunk/Tools/ChangeLog	2022-04-09 17:55:18 UTC (rev 292679)
+++ trunk/Tools/ChangeLog	2022-04-09 19:05:27 UTC (rev 292680)
@@ -1,3 +1,21 @@
+2022-04-09  Chris Dumez  
+
+The Youtube plugin replacement should only work for actual Youtube URLs
+https://bugs.webkit.org/show_bug.cgi?id=239003
+
+
+Reviewed by Brent Fulgham.
+
+Add API test coverage.
+
+* TestWebKitAPI/SourcesCocoa.txt:
+* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+* TestWebKitAPI/Tests/WebCore/YouTubePluginReplacement.cpp:
+(TestWebKitAPI::test):
+(TestWebKitAPI::TEST_F):
+* 

[webkit-changes] [292641] trunk/Source

2022-04-08 Thread cdumez
Title: [292641] trunk/Source








Revision 292641
Author cdu...@apple.com
Date 2022-04-08 16:00:43 -0700 (Fri, 08 Apr 2022)


Log Message
Drop unused pluginReplacementScriptObject
https://bugs.webkit.org/show_bug.cgi?id=239008

Reviewed by Geoff Garen.

Drop unused pluginReplacementScriptObject as it is always null.

Source/WebCore:

* Modules/plugins/PluginReplacement.h:
(): Deleted.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
* Modules/plugins/YouTubePluginReplacement.h:
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObject):
(WebCore::pluginElementCustomGetCallData):
(WebCore::pluginScriptObjectFromPluginViewBase): Deleted.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::visitChildrenImpl):
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Deleted.
* html/HTMLPlugInElement.h:
(WebCore::HTMLPlugInElement::pluginReplacementScriptObject): Deleted.
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::scriptObject): Deleted.

Source/WebKit:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::scriptObject): Deleted.
* WebProcess/Plugins/PluginView.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/plugins/PluginReplacement.h
trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.h
trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPluginInterface.cpp
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
trunk/Source/WebCore/html/HTMLPlugInElement.h
trunk/Source/WebCore/plugins/PluginViewBase.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp
trunk/Source/WebKit/WebProcess/Plugins/PluginView.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292640 => 292641)

--- trunk/Source/WebCore/ChangeLog	2022-04-08 22:56:27 UTC (rev 292640)
+++ trunk/Source/WebCore/ChangeLog	2022-04-08 23:00:43 UTC (rev 292641)
@@ -1,3 +1,33 @@
+2022-04-08  Chris Dumez  
+
+Drop unused pluginReplacementScriptObject
+https://bugs.webkit.org/show_bug.cgi?id=239008
+
+Reviewed by Geoff Garen.
+
+Drop unused pluginReplacementScriptObject as it is always null.
+
+* Modules/plugins/PluginReplacement.h:
+(): Deleted.
+* Modules/plugins/YouTubePluginReplacement.cpp:
+(WebCore::YouTubePluginReplacement::installReplacement):
+* Modules/plugins/YouTubePluginReplacement.h:
+* bindings/js/JSPluginElementFunctions.cpp:
+(WebCore::pluginScriptObject):
+(WebCore::pluginElementCustomGetCallData):
+(WebCore::pluginScriptObjectFromPluginViewBase): Deleted.
+* bindings/scripts/CodeGeneratorJS.pm:
+(GenerateImplementation):
+* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
+(WebCore::JSTestPluginInterface::visitChildrenImpl):
+* html/HTMLPlugInElement.cpp:
+(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot):
+(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Deleted.
+* html/HTMLPlugInElement.h:
+(WebCore::HTMLPlugInElement::pluginReplacementScriptObject): Deleted.
+* plugins/PluginViewBase.h:
+(WebCore::PluginViewBase::scriptObject): Deleted.
+
 2022-04-08  Elliott Williams  
 
 [Xcode] Avoid targeting 32-bit iOS and Mac architectures


Modified: trunk/Source/WebCore/Modules/plugins/PluginReplacement.h (292640 => 292641)

--- trunk/Source/WebCore/Modules/plugins/PluginReplacement.h	2022-04-08 22:56:27 UTC (rev 292640)
+++ trunk/Source/WebCore/Modules/plugins/PluginReplacement.h	2022-04-08 23:00:43 UTC (rev 292641)
@@ -47,15 +47,8 @@
 public:
 virtual ~PluginReplacement() = default;
 
-struct InstallResult {
-bool success;
-#if PLATFORM(COCOA)
-JSC::JSValue scriptObject { };
-#endif
-};
+virtual void installReplacement(ShadowRoot&) = 0;
 
-virtual InstallResult installReplacement(ShadowRoot&) = 0;
-
 virtual bool willCreateRenderer() { return false; }
 virtual RenderPtr createElementRenderer(HTMLPlugInElement&, RenderStyle&&, const RenderTreePosition&) = 0;
 };


Modified: trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp (292640 => 292641)

--- trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-04-08 22:56:27 UTC (rev 292640)
+++ trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp	2022-04-08 23:00:43 UTC (rev 292641)
@@ -77,7 +77,7 @@
 return m_embedShadowElement->createElementRenderer(WTFMove(style), insertionPosition);
 }
 
-auto YouTubePluginReplacement::installReplacement(ShadowRoot& root) -> 

[webkit-changes] [292638] trunk/Source/WebCore

2022-04-08 Thread cdumez
Title: [292638] trunk/Source/WebCore








Revision 292638
Author cdu...@apple.com
Date 2022-04-08 15:07:25 -0700 (Fri, 08 Apr 2022)


Log Message
Simplify / Optimize the whitespace cache implementation
https://bugs.webkit.org/show_bug.cgi?id=238736


Reviewed by Darin Adler.

Follow-up to r292310 to add missing blank lines.

* html/parser/HTMLConstructionSite.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/parser/HTMLConstructionSite.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292637 => 292638)

--- trunk/Source/WebCore/ChangeLog	2022-04-08 22:00:22 UTC (rev 292637)
+++ trunk/Source/WebCore/ChangeLog	2022-04-08 22:07:25 UTC (rev 292638)
@@ -1,3 +1,15 @@
+2022-04-08  Chris Dumez  
+
+Simplify / Optimize the whitespace cache implementation
+https://bugs.webkit.org/show_bug.cgi?id=238736
+
+
+Reviewed by Darin Adler.
+
+Follow-up to r292310 to add missing blank lines.
+
+* html/parser/HTMLConstructionSite.h:
+
 2022-04-08  Oriol Brufau  
 
 [css-cascade] Merge getRelatedPropertyId() and shouldApplyPropertyInParseOrder()


Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.h (292637 => 292638)

--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2022-04-08 22:00:22 UTC (rev 292637)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2022-04-08 22:07:25 UTC (rev 292638)
@@ -42,6 +42,7 @@
 AtomString string;
 uint64_t code { 0 };
 };
+
 }
 
 namespace WTF {
@@ -49,6 +50,7 @@
 }
 
 namespace WebCore {
+
 struct HTMLConstructionSiteTask {
 enum Operation {
 Insert,






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292627] trunk/Source

2022-04-08 Thread cdumez
Title: [292627] trunk/Source








Revision 292627
Author cdu...@apple.com
Date 2022-04-08 11:41:53 -0700 (Fri, 08 Apr 2022)


Log Message
static_pointer_cast<>() may cause some unnecessary ref-counting churn
https://bugs.webkit.org/show_bug.cgi?id=238961

Reviewed by Darin Adler.

Source/WebCore:

* dom/TreeScope.cpp:
(WebCore::TreeScope::elementFromPoint):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::textNodeForRebalance const):
* editing/DeleteSelectionCommand.cpp:
(WebCore::firstInSpecialElement):
(WebCore::lastInSpecialElement):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
* page/ImageOverlayController.cpp:
(WebCore::ImageOverlayController::selectionQuadsDidChange):
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::pageDestroyed):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):

Source/WTF:

* wtf/RefPtr.h:
(WTF::adoptRef):
(WTF::static_pointer_cast):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/RefPtr.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/TreeScope.cpp
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
trunk/Source/WebCore/page/ImageOverlayController.cpp
trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
trunk/Source/WebCore/page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (292626 => 292627)

--- trunk/Source/WTF/ChangeLog	2022-04-08 18:29:35 UTC (rev 292626)
+++ trunk/Source/WTF/ChangeLog	2022-04-08 18:41:53 UTC (rev 292627)
@@ -1,3 +1,14 @@
+2022-04-08  Chris Dumez  
+
+static_pointer_cast<>() may cause some unnecessary ref-counting churn
+https://bugs.webkit.org/show_bug.cgi?id=238961
+
+Reviewed by Darin Adler.
+
+* wtf/RefPtr.h:
+(WTF::adoptRef):
+(WTF::static_pointer_cast):
+
 2022-04-08  Elliott Williams  
 
 Unreviewed, reverting r292591.


Modified: trunk/Source/WTF/wtf/RefPtr.h (292626 => 292627)

--- trunk/Source/WTF/wtf/RefPtr.h	2022-04-08 18:29:35 UTC (rev 292626)
+++ trunk/Source/WTF/wtf/RefPtr.h	2022-04-08 18:41:53 UTC (rev 292627)
@@ -236,6 +236,13 @@
 return a != b.get(); 
 }
 
+template
+inline RefPtr adoptRef(T* p)
+{
+adopted(p);
+return RefPtr(p, RefPtr::Adopt);
+}
+
 template, typename V = DefaultRefDerefTraits, typename X, typename Y, typename Z>
 inline RefPtr static_pointer_cast(const RefPtr& p)
 { 
@@ -242,18 +249,17 @@
 return RefPtr(static_cast(p.get()));
 }
 
+template, typename V = DefaultRefDerefTraits, typename X, typename Y, typename Z>
+inline RefPtr static_pointer_cast(RefPtr&& p)
+{
+return adoptRef(static_cast(p.leakRef()));
+}
+
 template 
 struct IsSmartPtr> {
 static constexpr bool value = true;
 };
 
-template
-inline RefPtr adoptRef(T* p)
-{
-adopted(p);
-return RefPtr(p, RefPtr::Adopt);
-}
-
 template
 inline bool is(RefPtr& source)
 {


Modified: trunk/Source/WebCore/ChangeLog (292626 => 292627)

--- trunk/Source/WebCore/ChangeLog	2022-04-08 18:29:35 UTC (rev 292626)
+++ trunk/Source/WebCore/ChangeLog	2022-04-08 18:41:53 UTC (rev 292627)
@@ -1,3 +1,30 @@
+2022-04-08  Chris Dumez  
+
+static_pointer_cast<>() may cause some unnecessary ref-counting churn
+https://bugs.webkit.org/show_bug.cgi?id=238961
+
+Reviewed by Darin Adler.
+
+* dom/TreeScope.cpp:
+(WebCore::TreeScope::elementFromPoint):
+* editing/ApplyStyleCommand.cpp:
+(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
+* editing/CompositeEditCommand.cpp:
+(WebCore::CompositeEditCommand::textNodeForRebalance const):
+* editing/DeleteSelectionCommand.cpp:
+(WebCore::firstInSpecialElement):
+(WebCore::lastInSpecialElement):
+* html/canvas/WebGL2RenderingContext.cpp:
+(WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
+* html/canvas/WebGLRenderingContext.cpp:
+(WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter):
+* page/ImageOverlayController.cpp:
+(WebCore::ImageOverlayController::selectionQuadsDidChange):
+* page/scrolling/mac/ScrollingCoordinatorMac.mm:
+(WebCore::ScrollingCoordinatorMac::pageDestroyed):
+* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
+(WebCore::ScrollingCoordinatorNicosia::pageDestroyed):
+
 2022-04-08  Elliott Williams  
 
 Unreviewed, 

[webkit-changes] [292619] trunk/Source

2022-04-08 Thread cdumez
Title: [292619] trunk/Source








Revision 292619
Author cdu...@apple.com
Date 2022-04-08 10:54:47 -0700 (Fri, 08 Apr 2022)


Log Message
Reduce number of StringView to String conversions in JSC
https://bugs.webkit.org/show_bug.cgi?id=238911

Reviewed by Darin Adler.

Source/_javascript_Core:

* dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::getValue const):
Resolve ambiguity by explicitly converting the StringImpl to a String before
calling jsString(). [1]

* jsc.cpp:
Avoid constructing a String from the StringView, just to compute a hash.
Instead, rely on the StringViewHashTranslator for this.

* profiler/ProfilerOSRExit.cpp:
(JSC::Profiler::OSRExit::toJS const):
exitKindToString() returns an ASCIILiteral whose length is always greater
than 1 so we can call the more efficient jsNontrivialString() instead of
jsString(). Calling jsString() here had become ambiguous because an
ASCIILiteral can be implicitely converted to both a String and a
StringView [2].

* runtime/ArrayPrototype.cpp:
(JSC::fastJoin):
Call the new jsString() overload that takes a StringView, to avoid
unnecessarily constructing a String in the case where the length is <= 1 [3].

* runtime/ErrorInstance.cpp:
(JSC::appendSourceToErrorMessage):
* runtime/ErrorInstance.h:
* runtime/ExceptionHelpers.cpp:
(JSC::defaultApproximateSourceError):
(JSC::defaultSourceAppender):
(JSC::functionCallBase):
(JSC::notAFunctionSourceAppender):
(JSC::invalidParameterInSourceAppender):
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::invalidParameterInstanceofNotFunctionSourceAppender):
(JSC::invalidParameterInstanceofhasInstanceValueNotFunctionSourceAppender):
(JSC::invalidPrototypeSourceAppender):
* runtime/ExceptionHelpers.h:
Call SourceAppender with a StringView since this is what we have. In most
cases, these appenders end up calling makeString() and it is thus beneficial
to avoid temporary/intermediate String constructions.

* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::toStringSlow):
Same as [3].

* runtime/IdentifierInlines.h:
(JSC::identifierToJSValue):
(JSC::identifierToSafePublicJSValue):
Same as [1].

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::formatToParts const):
(JSC::IntlDateTimeFormat::formatRangeToParts):
* runtime/IntlLocale.cpp:
(JSC::IntlLocale::textInfo):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::formatRangeToPartsInternal):
(JSC::IntlNumberFormat::formatToPartsInternal):
Same as [2].

* runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::formatToParts const):
Same as [3].

* runtime/JSArrayBufferPrototype.cpp:
(JSC::JSArrayBufferPrototype::finishCreation):
Same as [2].

* runtime/JSModuleLoader.cpp:
(JSC::JSModuleLoader::requestImportModule):
(JSC::JSC_DEFINE_HOST_FUNCTION):
Same as [1].

* runtime/JSString.h:
(JSC::jsString):
Add a jsString() overload that takes in a StringView instead of a String.
This avoids construction of a String for call sites having a StringView
in the event where the view's length is <= 1.

* runtime/SymbolConstructor.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
Same as [1].

Source/WTF:

Provide a reverseFind(StringView, unsigned) overload on StringView, for consistency
with String and to facilitate the converting of code from String to StringView.

* wtf/text/StringCommon.h:
(WTF::reverseFindInner):
* wtf/text/StringImpl.cpp:
(WTF::reverseFindInner): Deleted.
* wtf/text/StringView.cpp:
(WTF::StringView::reverseFind const):
* wtf/text/StringView.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/dfg/DFGLazyJSValue.cpp
trunk/Source/_javascript_Core/jsc.cpp
trunk/Source/_javascript_Core/profiler/ProfilerOSRExit.cpp
trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp
trunk/Source/_javascript_Core/runtime/ErrorInstance.cpp
trunk/Source/_javascript_Core/runtime/ErrorInstance.h
trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp
trunk/Source/_javascript_Core/runtime/ExceptionHelpers.h
trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp
trunk/Source/_javascript_Core/runtime/IdentifierInlines.h
trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp
trunk/Source/_javascript_Core/runtime/IntlLocale.cpp
trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp
trunk/Source/_javascript_Core/runtime/IntlRelativeTimeFormat.cpp
trunk/Source/_javascript_Core/runtime/JSArrayBufferPrototype.cpp
trunk/Source/_javascript_Core/runtime/JSModuleLoader.cpp
trunk/Source/_javascript_Core/runtime/JSString.h
trunk/Source/_javascript_Core/runtime/SymbolConstructor.cpp
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringCommon.h
trunk/Source/WTF/wtf/text/StringHash.h
trunk/Source/WTF/wtf/text/StringImpl.cpp
trunk/Source/WTF/wtf/text/StringView.cpp
trunk/Source/WTF/wtf/text/StringView.h
trunk/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292618 => 292619)

--- trunk/Source/_javascript_Core/ChangeLog	2022-04-08 17:53:28 UTC (rev 292618)
+++ 

[webkit-changes] [292588] trunk/Source

2022-04-07 Thread cdumez
Title: [292588] trunk/Source








Revision 292588
Author cdu...@apple.com
Date 2022-04-07 19:30:33 -0700 (Thu, 07 Apr 2022)


Log Message
Add PAL::TextEncoding() constructor that takes in a StringView
https://bugs.webkit.org/show_bug.cgi?id=238905

Reviewed by Darin Adler.

This allows some call sites to be a bit more efficient.

Source/WebCore:

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::setEncoding):
* fileapi/FileReaderLoader.h:
* html/parser/HTMLMetaCharsetParser.cpp:
(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
* loader/FormSubmission.cpp:
(WebCore::encodingFromAcceptCharset):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* platform/network/HTTPParsers.cpp:
(WebCore::extractCharsetFromMediaType):
* platform/network/HTTPParsers.h:
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::handleDataURL):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::ResourceResponse):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::didReceiveData):

Source/WebCore/PAL:

* pal/text/TextEncoding.cpp:
(PAL::TextEncoding::TextEncoding):
* pal/text/TextEncoding.h:
(PAL::TextEncoding::TextEncoding):
* pal/text/TextEncodingRegistry.cpp:
(PAL::atomCanonicalTextEncodingName):
* pal/text/TextEncodingRegistry.h:

Source/WebKit:

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didRequestNextPart):
(WebKit::NetworkDataTaskSoup::didGetFileInfo):
* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
trunk/Source/WebCore/PAL/ChangeLog
trunk/Source/WebCore/PAL/pal/text/TextEncoding.cpp
trunk/Source/WebCore/PAL/pal/text/TextEncoding.h
trunk/Source/WebCore/PAL/pal/text/TextEncodingRegistry.cpp
trunk/Source/WebCore/PAL/pal/text/TextEncodingRegistry.h
trunk/Source/WebCore/fileapi/FileReaderLoader.cpp
trunk/Source/WebCore/fileapi/FileReaderLoader.h
trunk/Source/WebCore/html/parser/HTMLMetaCharsetParser.cpp
trunk/Source/WebCore/loader/FormSubmission.cpp
trunk/Source/WebCore/loader/soup/ResourceLoaderSoup.cpp
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
trunk/Source/WebCore/platform/network/HTTPParsers.h
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
trunk/Source/WebCore/platform/network/ResourceResponseBase.h
trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp
trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp
trunk/Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp
trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp
trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292587 => 292588)

--- trunk/Source/WebCore/ChangeLog	2022-04-08 02:21:13 UTC (rev 292587)
+++ trunk/Source/WebCore/ChangeLog	2022-04-08 02:30:33 UTC (rev 292588)
@@ -1,3 +1,38 @@
+2022-04-07  Chris Dumez  
+
+Add PAL::TextEncoding() constructor that takes in a StringView
+https://bugs.webkit.org/show_bug.cgi?id=238905
+
+Reviewed by Darin Adler.
+
+This allows some call sites to be a bit more efficient.
+
+* Modules/fetch/FetchResponse.cpp:
+(WebCore::FetchResponse::create):
+* fileapi/FileReaderLoader.cpp:
+(WebCore::FileReaderLoader::setEncoding):
+* fileapi/FileReaderLoader.h:
+* html/parser/HTMLMetaCharsetParser.cpp:
+(WebCore::HTMLMetaCharsetParser::encodingFromMetaAttributes):
+* loader/FormSubmission.cpp:
+(WebCore::encodingFromAcceptCharset):
+* loader/soup/ResourceLoaderSoup.cpp:
+(WebCore::ResourceLoader::loadGResource):
+* platform/network/HTTPParsers.cpp:
+(WebCore::extractCharsetFromMediaType):
+* platform/network/HTTPParsers.h:
+* platform/network/curl/CurlCacheEntry.cpp:
+(WebCore::CurlCacheEntry::setResponseFromCachedHeaders):
+* platform/network/curl/ResourceHandleCurl.cpp:
+(WebCore::ResourceHandle::handleDataURL):
+* platform/network/curl/ResourceResponseCurl.cpp:
+(WebCore::ResourceResponse::ResourceResponse):
+* platform/network/soup/ResourceResponseSoup.cpp:
+(WebCore::ResourceResponse::ResourceResponse):
+* xml/XMLHttpRequest.cpp:
+(WebCore::XMLHttpRequest::finalResponseCharset const):
+(WebCore::XMLHttpRequest::didReceiveData):
+
 2022-04-07  Gabriel 

[webkit-changes] [292587] trunk

2022-04-07 Thread cdumez
Title: [292587] trunk








Revision 292587
Author cdu...@apple.com
Date 2022-04-07 19:21:13 -0700 (Thu, 07 Apr 2022)


Log Message
Replace deprecated String(const char*) with String::fromLatin1() in more places
https://bugs.webkit.org/show_bug.cgi?id=238925

Reviewed by Darin Adler.

Source/WebKit:

* NetworkProcess/DatabaseUtilities.cpp:
(WebKit::DatabaseUtilities::stripIndexQueryToMatchStoredValue):
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpContentsToFile):
* Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb:
* Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb:
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
(encodeObject):
* Shared/API/Cocoa/_WKRemoteObjectRegistry.mm:
(-[_WKRemoteObjectRegistry _sendInvocation:interface:]):
* Shared/Cocoa/SandboxExtensionCocoa.mm:
(WebKit::SandboxExtension::createHandleForTemporaryFile):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getClientBundleIdentifier):
(WebKit::XPCServiceInitializerDelegate::getClientProcessName):
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(+[_WKWebAuthenticationPanel getAllLocalAuthenticatorCredentials]):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::showSafeBrowsingWarning):
* UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticator::clearAllCredentials):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::createCredentialPrivateKey const):
* UIProcess/WebPageProxy.cpp:
(WebKit::pasteAccessCategoryForCommand):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::didReceiveInvalidMessage):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::pluginInfo):
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::replaceSelectionPasteboardName):
* WebProcess/WebPage/IPCTestingAPI.cpp:
(WebKit::IPCTestingAPI::createJSArrayForArgumentDescriptions):
(WebKit::IPCTestingAPI::JSMessageListener::jsDescriptionFromDecoder):
* webpushd/WebPushDaemonMain.mm:
(WebKit::WebPushDaemonMain):

Source/WebKitLegacy/mac:

* History/HistoryPropertyList.mm:
(HistoryPropertyListWriter::HistoryPropertyListWriter):
* WebView/WebHTMLView.mm:
(-[WebHTMLView coreCommandByName:]):

Tools:

* DumpRenderTree/TestRunner.cpp:
(TestRunner::setAccummulateLogsForChannel):
* DumpRenderTree/mac/DumpRenderTree.mm:
(handleControlCommand):
(changeWindowScaleIfNeeded):
(resetWebViewToConsistentState):
* TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::waitForPostDumpWatchdogTimerFired):
* WebKitTestRunner/cocoa/CrashReporterInfo.mm:
(WTR::testPathFromURL):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::cocoaPlatformInitialize):
(WTR::TestController::cocoaResetStateToConsistentValues):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/DatabaseUtilities.cpp
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb
trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb
trunk/Source/WebKit/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb
trunk/Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm
trunk/Source/WebKit/Shared/API/Cocoa/_WKRemoteObjectRegistry.mm
trunk/Source/WebKit/Shared/Cocoa/SandboxExtensionCocoa.mm
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm
trunk/Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
trunk/Source/WebKit/UIProcess/WebProcessPool.cpp
trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
trunk/Source/WebKit/WebProcess/WebPage/IPCTestingAPI.cpp
trunk/Source/WebKit/webpushd/WebPushDaemonMain.mm
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/History/HistoryPropertyList.mm
trunk/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
trunk/Tools/ChangeLog
trunk/Tools/DumpRenderTree/TestRunner.cpp
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
trunk/Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp

[webkit-changes] [292534] trunk/Source

2022-04-07 Thread cdumez
Title: [292534] trunk/Source








Revision 292534
Author cdu...@apple.com
Date 2022-04-07 07:40:11 -0700 (Thu, 07 Apr 2022)


Log Message
Drop unused EditorClient::getAutoCorrectSuggestionForMisspelledWord()
https://bugs.webkit.org/show_bug.cgi?id=238897

Reviewed by Wenson Hsieh.

Source/WebCore:

* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
* editing/TextCheckingHelper.cpp:
(WebCore::findMisspellings):
* loader/EmptyClients.cpp:
* platform/text/TextCheckerClient.h:

Source/WebKit:

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): Deleted.
* WebProcess/WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.h:
(WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): Deleted.
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): Deleted.

Source/WebKitLegacy/win:

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::getAutoCorrectSuggestionForMisspelledWord): Deleted.
* WebCoreSupport/WebEditorClient.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/editing/Editor.cpp
trunk/Source/WebCore/editing/TextCheckingHelper.cpp
trunk/Source/WebCore/loader/EmptyClients.cpp
trunk/Source/WebCore/platform/text/TextCheckerClient.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
trunk/Source/WebKitLegacy/win/ChangeLog
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.cpp
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebEditorClient.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292533 => 292534)

--- trunk/Source/WebCore/ChangeLog	2022-04-07 13:34:59 UTC (rev 292533)
+++ trunk/Source/WebCore/ChangeLog	2022-04-07 14:40:11 UTC (rev 292534)
@@ -1,3 +1,17 @@
+2022-04-07  Chris Dumez  
+
+Drop unused EditorClient::getAutoCorrectSuggestionForMisspelledWord()
+https://bugs.webkit.org/show_bug.cgi?id=238897
+
+Reviewed by Wenson Hsieh.
+
+* editing/Editor.cpp:
+(WebCore::Editor::markMisspellingsAfterTypingToWord):
+* editing/TextCheckingHelper.cpp:
+(WebCore::findMisspellings):
+* loader/EmptyClients.cpp:
+* platform/text/TextCheckerClient.h:
+
 2022-04-07  Alan Bujtas  
 
 A float avoider should never take a vertical position where a float is present even when its used width is zero


Modified: trunk/Source/WebCore/editing/Editor.cpp (292533 => 292534)

--- trunk/Source/WebCore/editing/Editor.cpp	2022-04-07 13:34:59 UTC (rev 292533)
+++ trunk/Source/WebCore/editing/Editor.cpp	2022-04-07 14:40:11 UTC (rev 292534)
@@ -2642,28 +2642,7 @@
 // Autocorrect the misspelled word.
 if (!misspellingRange)
 return;
-
-// Get the misspelled word.
-String autocorrectedString = textChecker()->getAutoCorrectSuggestionForMisspelledWord(plainText(*misspellingRange));
 
-// If autocorrected word is non empty, replace the misspelled word by this word.
-if (!autocorrectedString.isEmpty()) {
-VisibleSelection newSelection(*misspellingRange);
-if (newSelection != m_document.selection().selection()) {
-if (!m_document.selection().shouldChangeSelection(newSelection))
-return;
-m_document.selection().setSelection(newSelection);
-}
-
-if (!m_document.editor().shouldInsertText(autocorrectedString, misspellingRange, EditorInsertAction::Typed))
-return;
-m_document.editor().replaceSelectionWithText(autocorrectedString, SelectReplacement::No, SmartReplace::No, EditAction::Insert);
-
-// Reset the charet one character further.
-m_document.selection().moveTo(m_document.selection().selection().end());
-m_document.selection().modify(FrameSelection::AlterationMove, SelectionDirection::Forward, TextGranularity::CharacterGranularity);
-}
-
 if (!isGrammarCheckingEnabled())
 return;
 


Modified: trunk/Source/WebCore/editing/TextCheckingHelper.cpp (292533 => 292534)

--- trunk/Source/WebCore/editing/TextCheckingHelper.cpp	2022-04-07 13:34:59 UTC (rev 292533)
+++ trunk/Source/WebCore/editing/TextCheckingHelper.cpp	2022-04-07 14:40:11 UTC (rev 292534)
@@ -94,7 +94,6 @@
 TextCheckingResult misspelling;
 misspelling.type = TextCheckingType::Spelling;
 misspelling.range = CharacterRange(wordStart + misspellingLocation, misspellingLength);
-misspelling.replacement = client.getAutoCorrectSuggestionForMisspelledWord(text.substring(misspelling.range.location, misspelling.range.length).toStringWithoutCopying());
 results.append(misspelling);
 }
 


Modified: 

[webkit-changes] [292506] trunk/Source

2022-04-06 Thread cdumez
Title: [292506] trunk/Source








Revision 292506
Author cdu...@apple.com
Date 2022-04-06 14:29:00 -0700 (Wed, 06 Apr 2022)


Log Message
Drop unnecessary ExceptionOr<> return types
https://bugs.webkit.org/show_bug.cgi?id=238876

Reviewed by Alex Christensen.

Drop unnecessary ExceptionOr<> return types as they may cause unnecessary branching at runtime.

Source/WebCore:

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
* animation/KeyframeEffect.h:
* css/MediaList.cpp:
(WebCore::MediaList::setMediaText):
* css/MediaList.h:
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::getContext):
* html/CustomPaintCanvas.h:
* html/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):

Source/WebKitLegacy/mac:

* DOM/DOMMediaList.mm:
(-[DOMMediaList setMediaText:]):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/animation/KeyframeEffect.cpp
trunk/Source/WebCore/animation/KeyframeEffect.h
trunk/Source/WebCore/css/MediaList.cpp
trunk/Source/WebCore/css/MediaList.h
trunk/Source/WebCore/dom/Attr.cpp
trunk/Source/WebCore/dom/Attr.h
trunk/Source/WebCore/dom/CharacterData.cpp
trunk/Source/WebCore/dom/CharacterData.h
trunk/Source/WebCore/dom/Node.cpp
trunk/Source/WebCore/dom/Node.h
trunk/Source/WebCore/html/CustomPaintCanvas.cpp
trunk/Source/WebCore/html/CustomPaintCanvas.h
trunk/Source/WebCore/html/CustomPaintImage.cpp
trunk/Source/WebCore/inspector/DOMEditor.cpp
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/DOM/DOMMediaList.mm
trunk/Source/WebKitLegacy/mac/DOM/DOMNode.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (292505 => 292506)

--- trunk/Source/WebCore/ChangeLog	2022-04-06 21:26:40 UTC (rev 292505)
+++ trunk/Source/WebCore/ChangeLog	2022-04-06 21:29:00 UTC (rev 292506)
@@ -1,3 +1,24 @@
+2022-04-06  Chris Dumez  
+
+Drop unnecessary ExceptionOr<> return types
+https://bugs.webkit.org/show_bug.cgi?id=238876
+
+Reviewed by Alex Christensen.
+
+Drop unnecessary ExceptionOr<> return types as they may cause unnecessary branching at runtime.
+
+* animation/KeyframeEffect.cpp:
+(WebCore::KeyframeEffect::create):
+* animation/KeyframeEffect.h:
+* css/MediaList.cpp:
+(WebCore::MediaList::setMediaText):
+* css/MediaList.h:
+* html/CustomPaintCanvas.cpp:
+(WebCore::CustomPaintCanvas::getContext):
+* html/CustomPaintCanvas.h:
+* html/CustomPaintImage.cpp:
+(WebCore::CustomPaintImage::doCustomPaint):
+
 2022-04-06  Simon Fraser  
 
 Stop using the shared IOSurfacePool for WebGL


Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (292505 => 292506)

--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-04-06 21:26:40 UTC (rev 292505)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-04-06 21:29:00 UTC (rev 292506)
@@ -536,7 +536,7 @@
 return keyframeEffect;
 }
 
-ExceptionOr> KeyframeEffect::create(Ref&& source)
+Ref KeyframeEffect::create(Ref&& source)
 {
 auto keyframeEffect = adoptRef(*new KeyframeEffect(nullptr, PseudoId::None));
 keyframeEffect->copyPropertiesFromSource(WTFMove(source));


Modified: trunk/Source/WebCore/animation/KeyframeEffect.h (292505 => 292506)

--- trunk/Source/WebCore/animation/KeyframeEffect.h	2022-04-06 21:26:40 UTC (rev 292505)
+++ trunk/Source/WebCore/animation/KeyframeEffect.h	2022-04-06 21:29:00 UTC (rev 292506)
@@ -54,7 +54,7 @@
 , public CSSPropertyBlendingClient {
 public:
 static ExceptionOr> create(JSC::JSGlobalObject&, Document&, Element*, JSC::Strong&&, std::optional>&&);
-static ExceptionOr> create(Ref&&);
+static Ref create(Ref&&);
 static Ref create(const Element&, PseudoId);
 ~KeyframeEffect() { }
 


Modified: trunk/Source/WebCore/css/MediaList.cpp (292505 => 292506)

--- trunk/Source/WebCore/css/MediaList.cpp	2022-04-06 21:26:40 UTC (rev 292505)
+++ trunk/Source/WebCore/css/MediaList.cpp	2022-04-06 21:29:00 UTC (rev 292506)
@@ -179,13 +179,12 @@
 
 MediaList::~MediaList() = default;
 
-ExceptionOr MediaList::setMediaText(const String& value)
+void MediaList::setMediaText(const String& value)
 {
 CSSStyleSheet::RuleMutationScope mutationScope(m_parentRule);
 m_mediaQueries->set(value);
 if (m_parentStyleSheet)
 m_parentStyleSheet->didMutate();
-return { };
 }
 
 String MediaList::item(unsigned index) const


Modified: trunk/Source/WebCore/css/MediaList.h (292505 => 292506)

--- trunk/Source/WebCore/css/MediaList.h	2022-04-06 21:26:40 UTC (rev 292505)
+++ trunk/Source/WebCore/css/MediaList.h	2022-04-06 21:29:00 UTC (rev 292506)
@@ -89,7 +89,7 @@
 WEBCORE_EXPORT void appendMedium(const String& newMedium);
 
 String mediaText() const { return m_mediaQueries->mediaText(); }
-WEBCORE_EXPORT ExceptionOr setMediaText(const String&);
+WEBCORE_EXPORT void setMediaText(const String&);
 
 CSSRule* parentRule() const { return m_parentRule; }
 CSSStyleSheet* 

[webkit-changes] [292483] trunk/Source/WebKit

2022-04-06 Thread cdumez
Title: [292483] trunk/Source/WebKit








Revision 292483
Author cdu...@apple.com
Date 2022-04-06 11:29:39 -0700 (Wed, 06 Apr 2022)


Log Message
Improve API::SerializedScriptValue::deserialize to not allocate a new JSContext every second
https://bugs.webkit.org/show_bug.cgi?id=210920

Reviewed by Geoffrey Garen.

Instead of forcing the lifetime of the shared JSContext to 1 second, we now use a hysteresis
logic so that it can stay alive as long as it is used at least every 10 seconds.

* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
(API::SharedJSContext::SharedJSContext):
(API::SharedJSContext::ensureContext):
(API::SharedJSContext::releaseContextIfNecessary):
(API::SharedJSContext::releaseContext): Deleted.

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (292482 => 292483)

--- trunk/Source/WebKit/ChangeLog	2022-04-06 18:22:11 UTC (rev 292482)
+++ trunk/Source/WebKit/ChangeLog	2022-04-06 18:29:39 UTC (rev 292483)
@@ -1,5 +1,21 @@
 2022-04-06  Chris Dumez  
 
+Improve API::SerializedScriptValue::deserialize to not allocate a new JSContext every second
+https://bugs.webkit.org/show_bug.cgi?id=210920
+
+Reviewed by Geoffrey Garen.
+
+Instead of forcing the lifetime of the shared JSContext to 1 second, we now use a hysteresis
+logic so that it can stay alive as long as it is used at least every 10 seconds.
+
+* UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
+(API::SharedJSContext::SharedJSContext):
+(API::SharedJSContext::ensureContext):
+(API::SharedJSContext::releaseContextIfNecessary):
+(API::SharedJSContext::releaseContext): Deleted.
+
+2022-04-06  Chris Dumez  
+
 Reduce number of conversions from StringView to String
 https://bugs.webkit.org/show_bug.cgi?id=238841
 


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm (292482 => 292483)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm	2022-04-06 18:22:11 UTC (rev 292482)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm	2022-04-06 18:29:39 UTC (rev 292483)
@@ -36,15 +36,18 @@
 
 namespace API {
 
+static constexpr auto sharedJSContextMaxIdleTime = 10_s;
+
 class SharedJSContext {
 public:
 SharedJSContext()
-: m_timer(RunLoop::main(), this, ::releaseContext)
+: m_timer(RunLoop::main(), this, ::releaseContextIfNecessary)
 {
 }
 
 JSContext* ensureContext()
 {
+m_lastUseTime = MonotonicTime::now();
 if (!m_context) {
 bool previous = JSRemoteInspectorGetInspectionEnabledByDefault();
 JSRemoteInspectorSetInspectionEnabledByDefault(false);
@@ -51,13 +54,20 @@
 m_context = adoptNS([[JSContext alloc] init]);
 JSRemoteInspectorSetInspectionEnabledByDefault(previous);
 
-m_timer.startOneShot(1_s);
+m_timer.startOneShot(sharedJSContextMaxIdleTime);
 }
 return m_context.get();
 }
 
-void releaseContext()
+void releaseContextIfNecessary()
 {
+auto idleTime = MonotonicTime::now() - m_lastUseTime;
+if (idleTime < sharedJSContextMaxIdleTime) {
+// We lazily restart the timer if needed every 10 seconds instead of doing so every time ensureContext()
+// is called, for performance reasons.
+m_timer.startOneShot(sharedJSContextMaxIdleTime - idleTime);
+return;
+}
 m_context.clear();
 }
 
@@ -64,6 +74,7 @@
 private:
 RetainPtr m_context;
 RunLoop::Timer m_timer;
+MonotonicTime m_lastUseTime;
 };
 
 static SharedJSContext& sharedContext()






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292477] trunk/Source

2022-04-06 Thread cdumez
Title: [292477] trunk/Source








Revision 292477
Author cdu...@apple.com
Date 2022-04-06 10:48:44 -0700 (Wed, 06 Apr 2022)


Log Message
Reduce number of conversions from StringView to String
https://bugs.webkit.org/show_bug.cgi?id=238841

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

* runtime/RegExp.h:
* runtime/StringPrototype.cpp:
(JSC::substituteBackreferencesSlow):

Source/WebCore:

* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::queryCacheMatch):
* dom/ViewportArguments.cpp:
(WebCore::viewportErrorMessage):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
* loader/CrossOriginAccessControl.cpp:
(WebCore::validateCrossOriginRedirectionURL):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::disallowWebArchive const):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::representationExistsForURLScheme const):
(WebCore::EmptyFrameLoaderClient::generatedMIMETypeForURLScheme const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/archive/mhtml/MHTMLArchive.cpp:
(WebCore::MHTMLArchive::create):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::freshnessLifetime const):
* loader/soup/ResourceLoaderSoup.cpp:
(WebCore::ResourceLoader::loadGResource):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::Page::allowsLoadFromURL const):
* page/SecurityOrigin.cpp:
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::shouldTreatAsPotentiallyTrustworthy):
(WebCore::SecurityOrigin::isSecure):
(WebCore::SecurityOrigin::canDisplay const):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource const):
(WebCore::ContentSecurityPolicy::allowChildFrameFromSource const):
(WebCore::ContentSecurityPolicy::allowResourceFromSource const):
(WebCore::ContentSecurityPolicy::allowWorkerFromSource const):
(WebCore::ContentSecurityPolicy::allowScriptFromSource const):
(WebCore::ContentSecurityPolicy::allowStyleFromSource const):
(WebCore::ContentSecurityPolicy::allowConnectToSource const):
(WebCore::ContentSecurityPolicy::allowBaseURI const):
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::schemeIsInHttpFamily):
(WebCore::ContentSecurityPolicySourceList::isValidSourceForExtensionMode):
* platform/LegacySchemeRegistry.cpp:
(WebCore::LegacySchemeRegistry::schemeIsHandledBySchemeHandler):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsLocal):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsNoAccess):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsSecure):
(WebCore::LegacySchemeRegistry::shouldLoadURLSchemeAsEmptyDocument):
(WebCore::LegacySchemeRegistry::canDisplayOnlyIfCanRequest):
(WebCore::LegacySchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
(WebCore::LegacySchemeRegistry::schemeShouldBypassContentSecurityPolicy):
(WebCore::LegacySchemeRegistry::shouldAlwaysRevalidateURLScheme):
(WebCore::LegacySchemeRegistry::isUserExtensionScheme):
* platform/LegacySchemeRegistry.h:
* platform/PublicSuffix.h:
* platform/mac/PublicSuffixMac.mm:
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
* platform/network/CacheValidation.cpp:
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeadersInternal):
(WebCore::collectVaryingRequestHeaders):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::get const):
(WebCore::HTTPHeaderMap::getUncommonHeader const):
* platform/network/HTTPHeaderMap.h:
* platform/network/HTTPParsers.cpp:
(WebCore::isCrossOriginSafeHeader):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::httpHeaderField const):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
(WebCore::ResourceResponseBase::httpHeaderField const):
* platform/network/ResourceResponseBase.h:
* platform/network/curl/PublicSuffixCurl.cpp:
(WebCore::isPublicSuffix):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::checkTLSErrors):
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::isPublicSuffix):

Source/WebKit:

* NetworkProcess/NetworkSchemeRegistry.cpp:
(WebKit::NetworkSchemeRegistry::shouldTreatURLSchemeAsCORSEnabled):
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::updateVaryInformation):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::proxyDictionary):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::shouldAllowHSTSPolicySetting const):
* UIProcess/WebPageProxy.cpp:

[webkit-changes] [292428] trunk/Source/JavaScriptCore

2022-04-05 Thread cdumez
Title: [292428] trunk/Source/_javascript_Core








Revision 292428
Author cdu...@apple.com
Date 2022-04-05 14:48:50 -0700 (Tue, 05 Apr 2022)


Log Message
Avoid unnecessary String constructions in IdentifiersFactory.cpp
https://bugs.webkit.org/show_bug.cgi?id=238819

Reviewed by Geoffrey Garen.

* inspector/IdentifiersFactory.cpp:
(Inspector::addPrefixToIdentifier):
(Inspector::IdentifiersFactory::createIdentifier):
(Inspector::IdentifiersFactory::requestId):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (292427 => 292428)

--- trunk/Source/_javascript_Core/ChangeLog	2022-04-05 21:38:40 UTC (rev 292427)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-04-05 21:48:50 UTC (rev 292428)
@@ -1,5 +1,17 @@
 2022-04-05  Chris Dumez  
 
+Avoid unnecessary String constructions in IdentifiersFactory.cpp
+https://bugs.webkit.org/show_bug.cgi?id=238819
+
+Reviewed by Geoffrey Garen.
+
+* inspector/IdentifiersFactory.cpp:
+(Inspector::addPrefixToIdentifier):
+(Inspector::IdentifiersFactory::createIdentifier):
+(Inspector::IdentifiersFactory::requestId):
+
+2022-04-05  Chris Dumez  
+
 Mark String(const char*) constructor as explicit
 https://bugs.webkit.org/show_bug.cgi?id=238693
 


Modified: trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp (292427 => 292428)

--- trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp	2022-04-05 21:38:40 UTC (rev 292427)
+++ trunk/Source/_javascript_Core/inspector/IdentifiersFactory.cpp	2022-04-05 21:48:50 UTC (rev 292428)
@@ -27,13 +27,15 @@
 #include "config.h"
 #include "IdentifiersFactory.h"
 
+#include 
+
 namespace Inspector {
 
 namespace {
-static long s_lastUsedIdentifier = 0;
+static unsigned long s_lastUsedIdentifier = 0;
 }
 
-static String addPrefixToIdentifier(const String& identifier)
+static String addPrefixToIdentifier(unsigned long identifier)
 {
 return makeString("0.", identifier);
 }
@@ -40,14 +42,12 @@
 
 String IdentifiersFactory::createIdentifier()
 {
-return addPrefixToIdentifier(String::number(++s_lastUsedIdentifier));
+return addPrefixToIdentifier(++s_lastUsedIdentifier);
 }
 
 String IdentifiersFactory::requestId(unsigned long identifier)
 {
-if (identifier)
-return addPrefixToIdentifier(String::number(identifier));
-return String();
+return identifier ? addPrefixToIdentifier(identifier) : String();
 }
 
 } // namespace Inspector






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292423] trunk/Source/WebKit

2022-04-05 Thread cdumez
Title: [292423] trunk/Source/WebKit








Revision 292423
Author cdu...@apple.com
Date 2022-04-05 14:30:35 -0700 (Tue, 05 Apr 2022)


Log Message
Unreviewed GTK build fix after r292408.

* Platform/unix/LoggingUnix.cpp:
(WebKit::logLevelString):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Platform/unix/LoggingUnix.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (292422 => 292423)

--- trunk/Source/WebKit/ChangeLog	2022-04-05 21:27:29 UTC (rev 292422)
+++ trunk/Source/WebKit/ChangeLog	2022-04-05 21:30:35 UTC (rev 292423)
@@ -1,5 +1,12 @@
 2022-04-05  Chris Dumez  
 
+Unreviewed GTK build fix after r292408.
+
+* Platform/unix/LoggingUnix.cpp:
+(WebKit::logLevelString):
+
+2022-04-05  Chris Dumez  
+
 Unreviewed build fix after r292408.
 
 * NetworkProcess/cocoa/NetworkSessionCocoa.mm:


Modified: trunk/Source/WebKit/Platform/unix/LoggingUnix.cpp (292422 => 292423)

--- trunk/Source/WebKit/Platform/unix/LoggingUnix.cpp	2022-04-05 21:27:29 UTC (rev 292422)
+++ trunk/Source/WebKit/Platform/unix/LoggingUnix.cpp	2022-04-05 21:30:35 UTC (rev 292423)
@@ -34,7 +34,7 @@
 String logLevelString()
 {
 #if !LOG_DISABLED
-return getenv("WEBKIT_DEBUG");
+return String { getenv("WEBKIT_DEBUG") };
 #else
 return String();
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292417] trunk/Source/WebCore

2022-04-05 Thread cdumez
Title: [292417] trunk/Source/WebCore








Revision 292417
Author cdu...@apple.com
Date 2022-04-05 13:16:18 -0700 (Tue, 05 Apr 2022)


Log Message
Implement faster lookup of HTML tags in the HTML parser
https://bugs.webkit.org/show_bug.cgi?id=238804

Reviewed by Geoffrey Garen.

Implement faster lookup of HTML tags in the HTML parser by having make_names.pl generate
a findHTMLTag function that returns very efficient well-known HTML tag names.

It is a little more efficient that our current HTMLNameCache (0.4% progression on
Speedometer on MacBookAir 10,1, neutral on iMac20,1). Unlike the HTMLNameCache, It doesn't
require any hashing or additional storage since the set of well-known HTML tags is known
at compile time.

* dom/make_names.pl:
(printNamesHeaderFile):
(findMaxTagLength):
(tagsWithLength):
(generateFindTagForLength):
(printNamesCppFile):
* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::AtomHTMLToken):
* html/parser/HTMLNameCache.cpp:
(WebCore::HTMLNameCache::atomStringCache):
* html/parser/HTMLNameCache.h:
(WebCore::HTMLNameCache::makeAttributeValue):
(WebCore::HTMLNameCache::clear):
(WebCore::HTMLNameCache::makeAtomString):
(WebCore::HTMLNameCache::atomStringCacheSlot):
(WebCore::HTMLNameCache::makeTagName): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/make_names.pl
trunk/Source/WebCore/html/parser/AtomHTMLToken.h
trunk/Source/WebCore/html/parser/HTMLNameCache.cpp
trunk/Source/WebCore/html/parser/HTMLNameCache.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292416 => 292417)

--- trunk/Source/WebCore/ChangeLog	2022-04-05 20:11:37 UTC (rev 292416)
+++ trunk/Source/WebCore/ChangeLog	2022-04-05 20:16:18 UTC (rev 292417)
@@ -1,3 +1,35 @@
+2022-04-05  Chris Dumez  
+
+Implement faster lookup of HTML tags in the HTML parser
+https://bugs.webkit.org/show_bug.cgi?id=238804
+
+Reviewed by Geoffrey Garen.
+
+Implement faster lookup of HTML tags in the HTML parser by having make_names.pl generate
+a findHTMLTag function that returns very efficient well-known HTML tag names.
+
+It is a little more efficient that our current HTMLNameCache (0.4% progression on
+Speedometer on MacBookAir 10,1, neutral on iMac20,1). Unlike the HTMLNameCache, It doesn't
+require any hashing or additional storage since the set of well-known HTML tags is known
+at compile time.
+
+* dom/make_names.pl:
+(printNamesHeaderFile):
+(findMaxTagLength):
+(tagsWithLength):
+(generateFindTagForLength):
+(printNamesCppFile):
+* html/parser/AtomHTMLToken.h:
+(WebCore::AtomHTMLToken::AtomHTMLToken):
+* html/parser/HTMLNameCache.cpp:
+(WebCore::HTMLNameCache::atomStringCache):
+* html/parser/HTMLNameCache.h:
+(WebCore::HTMLNameCache::makeAttributeValue):
+(WebCore::HTMLNameCache::clear):
+(WebCore::HTMLNameCache::makeAtomString):
+(WebCore::HTMLNameCache::atomStringCacheSlot):
+(WebCore::HTMLNameCache::makeTagName): Deleted.
+
 2022-04-05  Alan Bujtas  
 
 [CSS-Contain] Flex layout should take "contain: inline-size" into account when computing the flex item's logical width


Modified: trunk/Source/WebCore/dom/make_names.pl (292416 => 292417)

--- trunk/Source/WebCore/dom/make_names.pl	2022-04-05 20:11:37 UTC (rev 292416)
+++ trunk/Source/WebCore/dom/make_names.pl	2022-04-05 20:16:18 UTC (rev 292417)
@@ -747,6 +747,9 @@
 if (keys %allTags) {
 print F "const unsigned $parameters{namespace}TagsCount = ", scalar(keys %allTags), ";\n";
 print F "const WebCore::$parameters{namespace}QualifiedName* const* get$parameters{namespace}Tags();\n";
+if ($parameters{namespace} eq "HTML") {
+print F "AtomString find$parameters{namespace}Tag(Span);\n"
+}
 }
 
 if (keys %allAttrs) {
@@ -758,6 +761,86 @@
 close F;
 }
 
+sub findMaxTagLength
+{
+my $allTags = shift;
+
+my $maxLength = 0;
+foreach my $tagName (keys %{$allTags}) {
+my $tagLength = length($tagName);
+$maxLength = $tagLength if $tagLength > $maxLength;
+}
+return $maxLength;
+}
+
+sub tagsWithLength
+{
+my $allAttrs = shift;
+my $expectedLength = shift;
+
+my @tags = (); 
+foreach my $tagName (sort keys %{$allAttrs}) {
+push(@tags, $tagName) if length($tagName) == $expectedLength;
+}
+return @tags;
+}
+
+sub generateFindTagForLength
+{
+my $indent = shift;
+my $tagsRef = shift;
+my $length = shift;
+my $currentIndex = shift;
+
+my @tags = @{$tagsRef};
+my $tagCount = @tags;
+if ($tagCount == 1) {
+my $tag = $tags[0];
+my $needsIfCheck = $currentIndex < $length;
+if ($needsIfCheck) {
+my $lengthToCompare = $length - $currentIndex;
+if ($lengthToCompare == 1) {
+my $letter = substr($tag, $currentIndex, 1);
+

[webkit-changes] [292415] trunk/Source/WebKitLegacy/win

2022-04-05 Thread cdumez
Title: [292415] trunk/Source/WebKitLegacy/win








Revision 292415
Author cdu...@apple.com
Date 2022-04-05 13:02:36 -0700 (Tue, 05 Apr 2022)


Log Message
Unreviewed WinCairo build fix after r292408.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::initialize):

Modified Paths

trunk/Source/WebKitLegacy/win/ChangeLog
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp




Diff

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (292414 => 292415)

--- trunk/Source/WebKitLegacy/win/ChangeLog	2022-04-05 20:01:09 UTC (rev 292414)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2022-04-05 20:02:36 UTC (rev 292415)
@@ -2,6 +2,13 @@
 
 Unreviewed WinCairo build fix after r292408.
 
+* WebCoreSupport/AcceleratedCompositingContext.cpp:
+(AcceleratedCompositingContext::initialize):
+
+2022-04-05  Chris Dumez  
+
+Unreviewed WinCairo build fix after r292408.
+
 * WebView.cpp:
 (imeNotificationName):
 (imeRequestName):


Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp (292414 => 292415)

--- trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2022-04-05 20:01:09 UTC (rev 292414)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp	2022-04-05 20:02:36 UTC (rev 292415)
@@ -90,8 +90,8 @@
 m_nonCompositedContentLayer->setAcceleratesDrawing(true);
 
 #ifndef NDEBUG
-m_rootLayer->setName("Root layer");
-m_nonCompositedContentLayer->setName("Non-composited content");
+m_rootLayer->setName("Root layer"_s);
+m_nonCompositedContentLayer->setName("Non-composited content"_s);
 #endif
 
 m_rootLayer->addChild(*m_nonCompositedContentLayer);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292413] trunk/Source

2022-04-05 Thread cdumez
Title: [292413] trunk/Source








Revision 292413
Author cdu...@apple.com
Date 2022-04-05 12:54:03 -0700 (Tue, 05 Apr 2022)


Log Message
Unreviewed WinCairo build fix after r292408.

Source/WebCore:

* platform/win/GDIObjectCounter.cpp:
(WebCore::GDIObjectCounter::GDIObjectCounter):
* platform/win/GDIObjectCounter.h:

Source/WebKitLegacy/win:

* WebView.cpp:
(imeNotificationName):
(imeRequestName):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/win/GDIObjectCounter.cpp
trunk/Source/WebCore/platform/win/GDIObjectCounter.h
trunk/Source/WebKitLegacy/win/ChangeLog
trunk/Source/WebKitLegacy/win/WebView.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292412 => 292413)

--- trunk/Source/WebCore/ChangeLog	2022-04-05 19:47:28 UTC (rev 292412)
+++ trunk/Source/WebCore/ChangeLog	2022-04-05 19:54:03 UTC (rev 292413)
@@ -1,5 +1,13 @@
 2022-04-05  Chris Dumez  
 
+Unreviewed WinCairo build fix after r292408.
+
+* platform/win/GDIObjectCounter.cpp:
+(WebCore::GDIObjectCounter::GDIObjectCounter):
+* platform/win/GDIObjectCounter.h:
+
+2022-04-05  Chris Dumez  
+
 Unreviewed Windows debug build fix after r292279.
 
 * animation/CSSPropertyAnimation.cpp:


Modified: trunk/Source/WebCore/platform/win/GDIObjectCounter.cpp (292412 => 292413)

--- trunk/Source/WebCore/platform/win/GDIObjectCounter.cpp	2022-04-05 19:47:28 UTC (rev 292412)
+++ trunk/Source/WebCore/platform/win/GDIObjectCounter.cpp	2022-04-05 19:54:03 UTC (rev 292413)
@@ -40,9 +40,9 @@
 
 namespace WebCore {
 
-GDIObjectCounter::GDIObjectCounter(const String& identifier)
+GDIObjectCounter::GDIObjectCounter(const char* identifier)
 {
-init(identifier);
+init(String { identifier });
 }
 
 GDIObjectCounter::GDIObjectCounter(const String& className, void* instance)


Modified: trunk/Source/WebCore/platform/win/GDIObjectCounter.h (292412 => 292413)

--- trunk/Source/WebCore/platform/win/GDIObjectCounter.h	2022-04-05 19:47:28 UTC (rev 292412)
+++ trunk/Source/WebCore/platform/win/GDIObjectCounter.h	2022-04-05 19:54:03 UTC (rev 292413)
@@ -43,7 +43,7 @@
 
 class GDIObjectCounter {
 public:
-GDIObjectCounter(const String& identifier);
+GDIObjectCounter(const char* identifier);
 GDIObjectCounter(const String& className, void* instance);
 ~GDIObjectCounter();
 


Modified: trunk/Source/WebKitLegacy/win/ChangeLog (292412 => 292413)

--- trunk/Source/WebKitLegacy/win/ChangeLog	2022-04-05 19:47:28 UTC (rev 292412)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2022-04-05 19:54:03 UTC (rev 292413)
@@ -1,5 +1,13 @@
 2022-04-05  Chris Dumez  
 
+Unreviewed WinCairo build fix after r292408.
+
+* WebView.cpp:
+(imeNotificationName):
+(imeRequestName):
+
+2022-04-05  Chris Dumez  
+
 Mark String(const char*) constructor as explicit
 https://bugs.webkit.org/show_bug.cgi?id=238693
 


Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (292412 => 292413)

--- trunk/Source/WebKitLegacy/win/WebView.cpp	2022-04-05 19:47:28 UTC (rev 292412)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2022-04-05 19:54:03 UTC (rev 292413)
@@ -6079,31 +6079,31 @@
 {
 switch (wparam) {
 case IMN_CHANGECANDIDATE:
-return "IMN_CHANGECANDIDATE";
+return "IMN_CHANGECANDIDATE"_s;
 case IMN_CLOSECANDIDATE:
-return "IMN_CLOSECANDIDATE";
+return "IMN_CLOSECANDIDATE"_s;
 case IMN_CLOSESTATUSWINDOW:
-return "IMN_CLOSESTATUSWINDOW";
+return "IMN_CLOSESTATUSWINDOW"_s;
 case IMN_GUIDELINE:
-return "IMN_GUIDELINE";
+return "IMN_GUIDELINE"_s;
 case IMN_OPENCANDIDATE:
-return "IMN_OPENCANDIDATE";
+return "IMN_OPENCANDIDATE"_s;
 case IMN_OPENSTATUSWINDOW:
-return "IMN_OPENSTATUSWINDOW";
+return "IMN_OPENSTATUSWINDOW"_s;
 case IMN_SETCANDIDATEPOS:
-return "IMN_SETCANDIDATEPOS";
+return "IMN_SETCANDIDATEPOS"_s;
 case IMN_SETCOMPOSITIONFONT:
-return "IMN_SETCOMPOSITIONFONT";
+return "IMN_SETCOMPOSITIONFONT"_s;
 case IMN_SETCOMPOSITIONWINDOW:
-return "IMN_SETCOMPOSITIONWINDOW";
+return "IMN_SETCOMPOSITIONWINDOW"_s;
 case IMN_SETCONVERSIONMODE:
-return "IMN_SETCONVERSIONMODE";
+return "IMN_SETCONVERSIONMODE"_s;
 case IMN_SETOPENSTATUS:
-return "IMN_SETOPENSTATUS";
+return "IMN_SETOPENSTATUS"_s;
 case IMN_SETSENTENCEMODE:
-return "IMN_SETSENTENCEMODE";
+return "IMN_SETSENTENCEMODE"_s;
 case IMN_SETSTATUSWINDOWPOS:
-return "IMN_SETSTATUSWINDOWPOS";
+return "IMN_SETSTATUSWINDOWPOS"_s;
 default:
 return "Unknown (" + String::number(wparam) + ")";
 }
@@ -6113,19 +6113,19 @@
 {
 switch (wparam) {
 case IMR_CANDIDATEWINDOW:
-return "IMR_CANDIDATEWINDOW";
+return "IMR_CANDIDATEWINDOW"_s;
 case IMR_COMPOSITIONFONT:
-return "IMR_COMPOSITIONFONT";

[webkit-changes] [292412] trunk/Source/WebCore

2022-04-05 Thread cdumez
Title: [292412] trunk/Source/WebCore








Revision 292412
Author cdu...@apple.com
Date 2022-04-05 12:47:28 -0700 (Tue, 05 Apr 2022)


Log Message
Unreviewed Windows debug build fix after r292279.

* animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292411 => 292412)

--- trunk/Source/WebCore/ChangeLog	2022-04-05 19:46:00 UTC (rev 292411)
+++ trunk/Source/WebCore/ChangeLog	2022-04-05 19:47:28 UTC (rev 292412)
@@ -1,5 +1,12 @@
 2022-04-05  Chris Dumez  
 
+Unreviewed Windows debug build fix after r292279.
+
+* animation/CSSPropertyAnimation.cpp:
+(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
+
+2022-04-05  Chris Dumez  
+
 Mark String(const char*) constructor as explicit
 https://bugs.webkit.org/show_bug.cgi?id=238693
 


Modified: trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp (292411 => 292412)

--- trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-04-05 19:46:00 UTC (rev 292411)
+++ trunk/Source/WebCore/animation/CSSPropertyAnimation.cpp	2022-04-05 19:47:28 UTC (rev 292412)
@@ -3310,10 +3310,14 @@
 // When adding a new property, you should make sure it belongs in this list
 // or provide a wrapper for it above. If you are adding to this list but the
 // property should be animatable, make sure to file a bug.
+#if ENABLE(DARK_MODE_CSS)
 case CSSPropertyColorScheme:
+#endif
 case CSSPropertyDirection:
 case CSSPropertyDisplay:
+#if ENABLE(VARIATION_FONTS)
 case CSSPropertyFontOpticalSizing:
+#endif
 case CSSPropertyTextOrientation:
 case CSSPropertyWritingMode:
 case CSSPropertyWebkitFontSmoothing:






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292410] trunk/Source/WebKit

2022-04-05 Thread cdumez
Title: [292410] trunk/Source/WebKit








Revision 292410
Author cdu...@apple.com
Date 2022-04-05 12:42:38 -0700 (Tue, 05 Apr 2022)


Log Message
Unreviewed build fix after r292408.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::removeNetworkWebsiteData):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (292409 => 292410)

--- trunk/Source/WebKit/ChangeLog	2022-04-05 18:54:46 UTC (rev 292409)
+++ trunk/Source/WebKit/ChangeLog	2022-04-05 19:42:38 UTC (rev 292410)
@@ -1,5 +1,12 @@
 2022-04-05  Chris Dumez  
 
+Unreviewed build fix after r292408.
+
+* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+(WebKit::NetworkSessionCocoa::removeNetworkWebsiteData):
+
+2022-04-05  Chris Dumez  
+
 Mark String(const char*) constructor as explicit
 https://bugs.webkit.org/show_bug.cgi?id=238693
 


Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (292409 => 292410)

--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2022-04-05 18:54:46 UTC (rev 292409)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2022-04-05 19:42:38 UTC (rev 292410)
@@ -1935,7 +1935,7 @@
 }
 
 if (isActingOnBehalfOfAFullWebBrowser(bundleID))
-bundleID = "com.apple.mobilesafari";
+bundleID = "com.apple.mobilesafari"_s;
 
 NSDictionary *options = @{
 (id)getkSymptomAnalyticsServiceDomainTrackingClearHistoryKey(): @{






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292370] trunk/Source/WebCore

2022-04-04 Thread cdumez
Title: [292370] trunk/Source/WebCore








Revision 292370
Author cdu...@apple.com
Date 2022-04-04 20:46:42 -0700 (Mon, 04 Apr 2022)


Log Message
Avoid repeated calls to WebCore::eventNames()
https://bugs.webkit.org/show_bug.cgi?id=238773

Reviewed by Geoffrey Garen.

Avoid repeated calls to WebCore::eventNames() by caching it where appropriate.
WebCore::eventNames() calls pthread_get_specific.

* dom/Element.cpp:
(WebCore::isCompatibilityMouseEvent):
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents const):
* dom/EventTarget.cpp:
(WebCore::legacyType):
(WebCore::EventTarget::removeAllEventListeners):
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::toElement const):
(WebCore::MouseEvent::fromElement const):
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
(WebCore::Node::willRespondToMouseMoveEvents):
(WebCore::Node::willRespondToTouchEvents):
(WebCore::Node::willRespondToMouseClickEvents):
* dom/PointerEvent.h:
(WebCore::PointerEvent::typeIsEnterOrLeave):
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::defaultEventHandler):
* html/HTMLButtonElement.cpp:
(WebCore::HTMLButtonElement::defaultEventHandler):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::willDispatchEvent):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::defaultEventHandler):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::forwardEvent):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::forwardEvent):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::handleTouchEvent):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::deviceOrientationController const): Deleted.
(WebCore::DOMWindow::deviceMotionController const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceMotionOrOrientation const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceMotion const): Deleted.
(WebCore::DOMWindow::isAllowedToUseDeviceOrientation const): Deleted.
(WebCore::DOMWindow::hasPermissionToReceiveDeviceMotionOrOrientationEvents const): Deleted.
(WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary): Deleted.
(WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary): Deleted.
(WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary): Deleted.
(WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary): Deleted.
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener): Deleted.
(WebCore::DOMWindow::incrementScrollEventListenersCount): Deleted.
(WebCore::DOMWindow::decrementScrollEventListenersCount): Deleted.
(WebCore::DOMWindow::resetAllGeolocationPermission): Deleted.
(WebCore::DOMWindow::removeEventListener): Deleted.
(WebCore::DOMWindow::languagesChanged): Deleted.
(WebCore::DOMWindow::dispatchLoadEvent): Deleted.
(WebCore::DOMWindow::dispatchEvent): Deleted.
(WebCore::DOMWindow::removeAllEventListeners): Deleted.
(WebCore::DOMWindow::captureEvents): Deleted.
(WebCore::DOMWindow::releaseEvents): Deleted.
(WebCore::DOMWindow::finishedLoading): Deleted.
(WebCore::DOMWindow::setLocation): Deleted.
(WebCore::DOMWindow::printErrorMessage const): Deleted.
(WebCore::DOMWindow::crossDomainAccessErrorMessage): Deleted.
(WebCore::DOMWindow::isInsecureScriptAccess): Deleted.
(WebCore::DOMWindow::createWindow): Deleted.
(WebCore::DOMWindow::open): Deleted.
(WebCore::DOMWindow::showModalDialog): Deleted.
(WebCore::DOMWindow::enableSuddenTermination): Deleted.
(WebCore::DOMWindow::disableSuddenTermination): Deleted.
(WebCore::DOMWindow::frame const): Deleted.
(WebCore::DOMWindow::eventListenersDidChange): Deleted.
* page/EventHandler.cpp:
(WebCore::EventHandler::updateMouseEventTargetNode):
(WebCore::EventHandler::isKeyboardOptionTab):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Element.cpp
trunk/Source/WebCore/dom/EventContext.cpp
trunk/Source/WebCore/dom/EventTarget.cpp
trunk/Source/WebCore/dom/MouseEvent.cpp
trunk/Source/WebCore/dom/Node.cpp
trunk/Source/WebCore/dom/PointerEvent.h
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
trunk/Source/WebCore/html/HTMLButtonElement.cpp
trunk/Source/WebCore/html/HTMLInputElement.cpp
trunk/Source/WebCore/html/HTMLSelectElement.cpp
trunk/Source/WebCore/html/HTMLSummaryElement.cpp
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
trunk/Source/WebCore/html/TextFieldInputType.cpp
trunk/Source/WebCore/html/shadow/SliderThumbElement.cpp
trunk/Source/WebCore/page/DOMWindow.cpp
trunk/Source/WebCore/page/EventHandler.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292369 => 292370)

--- trunk/Source/WebCore/ChangeLog	2022-04-05 03:32:00 UTC (rev 292369)
+++ trunk/Source/WebCore/ChangeLog	2022-04-05 03:46:42 UTC (rev 292370)

[webkit-changes] [292310] trunk/Source/WebCore

2022-04-04 Thread cdumez
Title: [292310] trunk/Source/WebCore








Revision 292310
Author cdu...@apple.com
Date 2022-04-04 12:25:09 -0700 (Mon, 04 Apr 2022)


Log Message
Simplify / Optimize the whitespace cache implementation
https://bugs.webkit.org/show_bug.cgi?id=238736

Reviewed by Sam Weinig.

Instead of using 2 C arrays of size maximumCachedStringLength + 1 Vector with an inline
buffer of size maximumCachedStringLength, we now used a single FixedVector of size
maximumCachedStringLength.

Because the Vector has an inline buffer whose size is the max size of the cache, using
a FixedVector is just more efficient. It also means we don't need to store indexes in
that Vector in a separate C array. Finally, I used a struct named AtomStringWithCode to
store { AtomString, uint64 code } so we don't need separate containers for the AtomString
and the code.

Note that I added VectorTraits for the new AtomStringWithCode struct to make sure it can
get initialized via a simple memset.

This is a 0.25-0.3% progression on Speedometer according to A/B bots.

* html/parser/HTMLConstructionSite.cpp:
(WebCore::WhitespaceCache::lookup):
* html/parser/HTMLConstructionSite.h:
(WebCore::WhitespaceCache::WhitespaceCache):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp
trunk/Source/WebCore/html/parser/HTMLConstructionSite.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (292309 => 292310)

--- trunk/Source/WebCore/ChangeLog	2022-04-04 19:06:56 UTC (rev 292309)
+++ trunk/Source/WebCore/ChangeLog	2022-04-04 19:25:09 UTC (rev 292310)
@@ -1,3 +1,30 @@
+2022-04-04  Chris Dumez  
+
+Simplify / Optimize the whitespace cache implementation
+https://bugs.webkit.org/show_bug.cgi?id=238736
+
+Reviewed by Sam Weinig.
+
+Instead of using 2 C arrays of size maximumCachedStringLength + 1 Vector with an inline
+buffer of size maximumCachedStringLength, we now used a single FixedVector of size
+maximumCachedStringLength.
+
+Because the Vector has an inline buffer whose size is the max size of the cache, using
+a FixedVector is just more efficient. It also means we don't need to store indexes in
+that Vector in a separate C array. Finally, I used a struct named AtomStringWithCode to
+store { AtomString, uint64 code } so we don't need separate containers for the AtomString
+and the code.
+
+Note that I added VectorTraits for the new AtomStringWithCode struct to make sure it can
+get initialized via a simple memset.
+
+This is a 0.25-0.3% progression on Speedometer according to A/B bots.
+
+* html/parser/HTMLConstructionSite.cpp:
+(WebCore::WhitespaceCache::lookup):
+* html/parser/HTMLConstructionSite.h:
+(WebCore::WhitespaceCache::WhitespaceCache):
+
 2022-04-04  Tim Nguyen  
 
 Conditionally inject  styles based on runtime flag


Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp (292309 => 292310)

--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2022-04-04 19:06:56 UTC (rev 292309)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.cpp	2022-04-04 19:25:09 UTC (rev 292310)
@@ -887,35 +887,26 @@
 return whitespaceMode == AllWhitespace || isAllWhitespace(string) ? AtomString(string) : AtomString();
 
 uint64_t code;
-if (whitespaceMode == AllWhitespace)
+if (whitespaceMode == AllWhitespace) {
 code = codeForString(string);
-else
+ASSERT(code);
+} else {
 code = codeForString(string);
+if (!code)
+return AtomString();
+}
 
-if (!code)
-return AtomString();
-
-size_t lengthIndex = length - 1;
-if (m_codes[lengthIndex] == code) {
-ASSERT(m_atoms[m_indexes[lengthIndex]] == string);
-return m_atoms[m_indexes[lengthIndex]];
+auto& existingAtom = m_atoms[length - 1];
+if (existingAtom.code == code) {
+ASSERT(existingAtom.string == string);
+return existingAtom.string;
 }
 
 if (code == overflowWhitespaceCode)
 return AtomString(string);
 
-if (m_codes[lengthIndex]) {
-AtomString whitespaceAtom(string);
-m_codes[lengthIndex] = code;
-m_atoms[m_indexes[lengthIndex]] = whitespaceAtom;
-return whitespaceAtom;
-}
-
-AtomString whitespaceAtom(string);
-m_codes[lengthIndex] = code;
-m_indexes[lengthIndex] = m_atoms.size();
-m_atoms.append(whitespaceAtom);
-return whitespaceAtom;
+existingAtom = { AtomString { string }, code };
+return existingAtom.string;
 }
 
 }


Modified: trunk/Source/WebCore/html/parser/HTMLConstructionSite.h (292309 => 292310)

--- trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2022-04-04 19:06:56 UTC (rev 292309)
+++ trunk/Source/WebCore/html/parser/HTMLConstructionSite.h	2022-04-04 19:25:09 UTC (rev 292310)
@@ -30,6 +30,7 @@
 #include "FragmentScriptingPermission.h"
 #include 

[webkit-changes] [292299] trunk

2022-04-04 Thread cdumez
Title: [292299] trunk








Revision 292299
Author cdu...@apple.com
Date 2022-04-04 10:37:06 -0700 (Mon, 04 Apr 2022)


Log Message
Drop mostly unused String(const LChar*) constructor
https://bugs.webkit.org/show_bug.cgi?id=238716

Reviewed by Geoffrey Garen.

Source/WTF:

* wtf/text/WTFString.cpp:
* wtf/text/WTFString.h:

Tools:

* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/WTFString.cpp
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm




Diff

Modified: trunk/Source/WTF/ChangeLog (292298 => 292299)

--- trunk/Source/WTF/ChangeLog	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Source/WTF/ChangeLog	2022-04-04 17:37:06 UTC (rev 292299)
@@ -1,3 +1,13 @@
+2022-04-04  Chris Dumez  
+
+Drop mostly unused String(const LChar*) constructor
+https://bugs.webkit.org/show_bug.cgi?id=238716
+
+Reviewed by Geoffrey Garen.
+
+* wtf/text/WTFString.cpp:
+* wtf/text/WTFString.h:
+
 2022-04-04  Cathie Chen  
 
 REGRESSION(r291797): [wk1] 5 contain-intrinsic-size* tests are constant text failures


Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (292298 => 292299)

--- trunk/Source/WTF/wtf/text/WTFString.cpp	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2022-04-04 17:37:06 UTC (rev 292299)
@@ -67,12 +67,6 @@
 }
 
 // Construct a string with Latin-1 data, from a null-terminated source.
-String::String(const LChar* nullTerminatedString)
-{
-if (nullTerminatedString)
-m_impl = StringImpl::create(nullTerminatedString);
-}
-
 String::String(const char* nullTerminatedString)
 {
 if (nullTerminatedString)


Modified: trunk/Source/WTF/wtf/text/WTFString.h (292298 => 292299)

--- trunk/Source/WTF/wtf/text/WTFString.h	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2022-04-04 17:37:06 UTC (rev 292299)
@@ -81,7 +81,6 @@
 WTF_EXPORT_PRIVATE String(const char* characters, unsigned length);
 
 // Construct a string with latin1 data, from a null-terminated source.
-WTF_EXPORT_PRIVATE String(const LChar* characters);
 WTF_EXPORT_PRIVATE String(const char* characters);
 
 // Construct a string referencing an existing StringImpl.


Modified: trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp (292298 => 292299)

--- trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Source/WebCore/platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp	2022-04-04 17:37:06 UTC (rev 292299)
@@ -215,7 +215,7 @@
 GLint numExtensions = 0;
 ::glGetIntegerv(GL_NUM_EXTENSIONS, );
 for (GLint i = 0; i < numExtensions; ++i)
-m_availableExtensions.add(glGetStringi(GL_EXTENSIONS, i));
+m_availableExtensions.add(reinterpret_cast(glGetStringi(GL_EXTENSIONS, i)));
 
 if (!m_availableExtensions.contains("GL_ARB_texture_storage"_s)) {
 GLint majorVersion;


Modified: trunk/Tools/ChangeLog (292298 => 292299)

--- trunk/Tools/ChangeLog	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Tools/ChangeLog	2022-04-04 17:37:06 UTC (rev 292299)
@@ -1,3 +1,15 @@
+2022-04-04  Chris Dumez  
+
+Drop mostly unused String(const LChar*) constructor
+https://bugs.webkit.org/show_bug.cgi?id=238716
+
+Reviewed by Geoffrey Garen.
+
+* TestWebKitAPI/Tests/WTF/StringOperators.cpp:
+(TestWebKitAPI::TEST):
+* TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm:
+(TestWebKitAPI::TEST):
+
 2022-04-04  Elliott Williams  
 
 [XCBuild] WebKitLegacy's "Migrated headers" script does not emit task information


Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp (292298 => 292299)

--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp	2022-04-04 17:33:28 UTC (rev 292298)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringOperators.cpp	2022-04-04 17:37:06 UTC (rev 292299)
@@ -260,10 +260,10 @@
 ASSERT_EQ(static_cast(4), concatenation16.length());
 ASSERT_TRUE(concatenation16 == String(ucharArray));
 
-LChar lcharArray[] = { 't', 'e', 's', 't', '\0' };
-String concatenation8 = lcharArray + emptyString;
+LChar lcharArray[] = { 't', 'e', 's', 't' };
+String concatenation8 = String(lcharArray, 4) + emptyString;
 ASSERT_EQ(static_cast(4), concatenation8.length());
-ASSERT_TRUE(concatenation8 == String(lcharArray));
+ASSERT_TRUE(concatenation8 == String(lcharArray, 4));
 }
 
 } // namespace TestWebKitAPI


Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm (292298 => 292299)

--- trunk/Tools/TestWebKitAPI/Tests/WTF/cocoa/URLExtras.mm	

[webkit-changes] [292272] trunk/Source

2022-04-02 Thread cdumez
Title: [292272] trunk/Source








Revision 292272
Author cdu...@apple.com
Date 2022-04-02 20:56:21 -0700 (Sat, 02 Apr 2022)


Log Message
Add default constructor to ASCIILiteral
https://bugs.webkit.org/show_bug.cgi?id=238700

Reviewed by Geoffrey Garen.

Add default constructor to ASCIILiteral, to replace the more verbose ASCIILiteral::null().

Source/_javascript_Core:

* Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Separate.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-Builtin.prototype-Separate.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Combined.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-BuiltinConstructor-Separate.js-result:
* Scripts/tests/builtins/expected/_javascript_Core-InternalClashingNames-Combined.js-result:
* Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
* Scripts/wkbuiltins/builtins_model.py:
(BuiltinFunction.fromString):
* runtime/ArrayBufferSharingMode.h:
(JSC::arrayBufferSharingModeName):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::usageString):
(JSC::IntlCollator::sensitivityString):
(JSC::IntlCollator::caseFirstString):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::initializeDateTimeFormat):
(JSC::IntlDateTimeFormat::hourCycleString):
(JSC::IntlDateTimeFormat::weekdayString):
(JSC::IntlDateTimeFormat::eraString):
(JSC::IntlDateTimeFormat::yearString):
(JSC::IntlDateTimeFormat::monthString):
(JSC::IntlDateTimeFormat::dayString):
(JSC::IntlDateTimeFormat::dayPeriodString):
(JSC::IntlDateTimeFormat::hourString):
(JSC::IntlDateTimeFormat::minuteString):
(JSC::IntlDateTimeFormat::secondString):
(JSC::IntlDateTimeFormat::timeZoneNameString):
(JSC::IntlDateTimeFormat::formatStyleString):
* runtime/IntlDisplayNames.cpp:
(JSC::IntlDisplayNames::styleString):
(JSC::IntlDisplayNames::typeString):
(JSC::IntlDisplayNames::fallbackString):
(JSC::IntlDisplayNames::languageDisplayString):
* runtime/IntlListFormat.cpp:
(JSC::IntlListFormat::styleString):
(JSC::IntlListFormat::typeString):
* runtime/IntlLocale.cpp:
(JSC::IntlLocale::initializeLocale):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::initializeNumberFormat):
(JSC::IntlNumberFormat::styleString):
(JSC::IntlNumberFormat::currencyDisplayString):
(JSC::IntlNumberFormat::notationString):
(JSC::IntlNumberFormat::currencySignString):
(JSC::IntlNumberFormat::unitDisplayString):
(JSC::IntlNumberFormat::compactDisplayString):
(JSC::IntlNumberFormat::signDisplayString):
(JSC::IntlNumberFormat::roundingModeString):
(JSC::IntlNumberFormat::trailingZeroDisplayString):
(JSC::IntlNumberFormat::roundingPriorityString):
* runtime/IntlObject.cpp:
(JSC::relevantExtensionKeyString):
* runtime/IntlRelativeTimeFormat.cpp:
(JSC::IntlRelativeTimeFormat::initializeRelativeTimeFormat):
(JSC::IntlRelativeTimeFormat::styleString):
* runtime/IntlSegmenter.cpp:
(JSC::IntlSegmenter::granularityString):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putDirectInternal):
* runtime/TemporalDuration.cpp:
(JSC::TemporalDuration::total const):
* runtime/TemporalObject.cpp:
(JSC::temporalLargestUnit):
(JSC::temporalSmallestUnit):
* yarr/YarrErrorCode.cpp:
(JSC::Yarr::errorMessage):

Source/WebCore:

* css/makevalues.pl:
* dom/DOMException.cpp:
(WebCore::DOMException::description const):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::imageTypeToFakeFilename):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):

Source/WebKit:

* NetworkProcess/WebStorage/LocalStorageDatabase.cpp:
(WebKit::LocalStorageDatabase::migrateItemTableIfNeeded):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::sendMessage):
* WebProcess/Inspector/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::setDockSide):

Source/WebKitLegacy:

* Storage/StorageAreaSync.cpp:
(WebKit::StorageAreaSync::migrateItemTableIfNeeded):

Source/WTF:

* wtf/cocoa/ResourceUsageCocoa.cpp:
(WTF::displayNameForVMTag):
* wtf/text/ASCIILiteral.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Combined.js-result
trunk/Source/_javascript_Core/Scripts/tests/builtins/expected/_javascript_Core-Builtin.Promise-Separate.js-result

[webkit-changes] [292238] trunk/Source/WTF

2022-04-01 Thread cdumez
Title: [292238] trunk/Source/WTF








Revision 292238
Author cdu...@apple.com
Date 2022-04-01 15:42:46 -0700 (Fri, 01 Apr 2022)


Log Message
Unreviewed, drop unnecessary WTF_EXPORT_PRIVATE on String(ASCIILiteral)

This constructor was recently inlined.

* wtf/text/WTFString.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/WTFString.h




Diff

Modified: trunk/Source/WTF/ChangeLog (292237 => 292238)

--- trunk/Source/WTF/ChangeLog	2022-04-01 22:38:25 UTC (rev 292237)
+++ trunk/Source/WTF/ChangeLog	2022-04-01 22:42:46 UTC (rev 292238)
@@ -1,3 +1,11 @@
+2022-04-01  Chris Dumez  
+
+Unreviewed, drop unnecessary WTF_EXPORT_PRIVATE on String(ASCIILiteral)
+
+This constructor was recently inlined.
+
+* wtf/text/WTFString.h:
+
 2022-03-31  Chris Dumez  
 
 Prepare WebKit/ & WebKitLegacy/ for making the String(const char*) constructor explicit


Modified: trunk/Source/WTF/wtf/text/WTFString.h (292237 => 292238)

--- trunk/Source/WTF/wtf/text/WTFString.h	2022-04-01 22:38:25 UTC (rev 292237)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2022-04-01 22:42:46 UTC (rev 292238)
@@ -97,7 +97,7 @@
 String(StaticStringImpl*);
 
 // Construct a string from a constant string literal.
-WTF_EXPORT_PRIVATE String(ASCIILiteral);
+String(ASCIILiteral);
 
 String(const String&) = default;
 String(String&&) = default;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292230] trunk/Source/WebKit

2022-04-01 Thread cdumez
Title: [292230] trunk/Source/WebKit








Revision 292230
Author cdu...@apple.com
Date 2022-04-01 12:30:08 -0700 (Fri, 01 Apr 2022)


Log Message
REGRESSION(r292197): 3 TestWebKitAPI.ContentRuleList API tests are constant failures/timeout
https://bugs.webkit.org/show_bug.cgi?id=238678


Unreviewed, in r292197, I made a last minute mistake when applying some of Darin's review comments.
I converted a few calls to `NSURL.absoluteURL.fileSystemRepresentation` to
`NSURL.absoluteString` instead of `NSURL.absoluteURL.path`. As a result, the file://
prefix was still present and some characters may still be URL-encoded.

No new tests, covered by existing API tests failing on the bots.


* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
(+[WKContentRuleListStore storeWithURL:]):
(+[WKContentRuleListStore storeWithURLAndLegacyFilename:]):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (292229 => 292230)

--- trunk/Source/WebKit/ChangeLog	2022-04-01 19:26:41 UTC (rev 292229)
+++ trunk/Source/WebKit/ChangeLog	2022-04-01 19:30:08 UTC (rev 292230)
@@ -1,3 +1,20 @@
+2022-04-01  Chris Dumez  
+
+REGRESSION(r292197): 3 TestWebKitAPI.ContentRuleList API tests are constant failures/timeout
+https://bugs.webkit.org/show_bug.cgi?id=238678
+
+
+Unreviewed, in r292197, I made a last minute mistake when applying some of Darin's review comments.
+I converted a few calls to `NSURL.absoluteURL.fileSystemRepresentation` to
+`NSURL.absoluteString` instead of `NSURL.absoluteURL.path`. As a result, the file://
+prefix was still present and some characters may still be URL-encoded.
+
+No new tests, covered by existing API tests failing on the bots.
+
+* UIProcess/API/Cocoa/WKContentRuleListStore.mm:
+(+[WKContentRuleListStore storeWithURL:]):
+(+[WKContentRuleListStore storeWithURLAndLegacyFilename:]):
+
 2022-04-01  Zan Dobersek  
 
 [Linux] Implement IPC::Semaphore


Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm (292229 => 292230)

--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm	2022-04-01 19:26:41 UTC (rev 292229)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.mm	2022-04-01 19:30:08 UTC (rev 292230)
@@ -79,7 +79,7 @@
 + (instancetype)storeWithURL:(NSURL *)url
 {
 #if ENABLE(CONTENT_EXTENSIONS)
-return wrapper(API::ContentRuleListStore::storeWithPath(url.absoluteString));
+return wrapper(API::ContentRuleListStore::storeWithPath(url.absoluteURL.path));
 #else
 return nil;
 #endif
@@ -194,7 +194,7 @@
 + (instancetype)storeWithURLAndLegacyFilename:(NSURL *)url
 {
 #if ENABLE(CONTENT_EXTENSIONS)
-return wrapper(API::ContentRuleListStore::storeWithPath(url.absoluteString));
+return wrapper(API::ContentRuleListStore::storeWithPath(url.absoluteURL.path));
 #else
 return nil;
 #endif






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292220] trunk/Source/WebCore

2022-04-01 Thread cdumez
Title: [292220] trunk/Source/WebCore








Revision 292220
Author cdu...@apple.com
Date 2022-04-01 07:39:36 -0700 (Fri, 01 Apr 2022)


Log Message
Unreviewed, update DerivedSources-output.xcfilelist to fix build.

* DerivedSources-output.xcfilelist:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/DerivedSources-output.xcfilelist




Diff

Modified: trunk/Source/WebCore/ChangeLog (292219 => 292220)

--- trunk/Source/WebCore/ChangeLog	2022-04-01 14:11:39 UTC (rev 292219)
+++ trunk/Source/WebCore/ChangeLog	2022-04-01 14:39:36 UTC (rev 292220)
@@ -1,3 +1,9 @@
+2022-04-01  Chris Dumez  
+
+Unreviewed, update DerivedSources-output.xcfilelist to fix build.
+
+* DerivedSources-output.xcfilelist:
+
 2022-04-01  Rob Buis  
 
 Abort formatBlock command on null start or end selections


Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (292219 => 292220)

--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2022-04-01 14:11:39 UTC (rev 292219)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2022-04-01 14:39:36 UTC (rev 292220)
@@ -789,6 +789,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSEffectTiming.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+CSSOMView.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+CSSOMView.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+ComputedStyleMap.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+ComputedStyleMap.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+DOMParsing.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+DOMParsing.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSElement+Fullscreen.cpp






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292173] trunk/LayoutTests

2022-03-31 Thread cdumez
Title: [292173] trunk/LayoutTests








Revision 292173
Author cdu...@apple.com
Date 2022-03-31 14:03:01 -0700 (Thu, 31 Mar 2022)


Log Message
REGRESSION(r292107): [ Mac iOS ] http/tests/paymentrequest/updateWith-shippingOptions.https.html is a constant text failure
https://bugs.webkit.org/show_bug.cgi?id=238581


Unreviewed, adjust test results. This test is expected to fail pre macOS 12.3 and iOS 15.4.

Patch by Devin Rousso  on 2022-03-31

* http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (292172 => 292173)

--- trunk/LayoutTests/ChangeLog	2022-03-31 21:02:45 UTC (rev 292172)
+++ trunk/LayoutTests/ChangeLog	2022-03-31 21:03:01 UTC (rev 292173)
@@ -1,3 +1,13 @@
+2022-03-31  Devin Rousso  
+
+REGRESSION(r292107): [ Mac iOS ] http/tests/paymentrequest/updateWith-shippingOptions.https.html is a constant text failure
+https://bugs.webkit.org/show_bug.cgi?id=238581
+
+
+Unreviewed, adjust test results. This test is expected to fail pre macOS 12.3 and iOS 15.4.
+
+* http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt:
+
 2022-03-31  Ben Nham  
 
 Remove push subscriptions when permissions are reset


Modified: trunk/LayoutTests/http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt (292172 => 292173)

--- trunk/LayoutTests/http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt	2022-03-31 21:02:45 UTC (rev 292172)
+++ trunk/LayoutTests/http/tests/paymentrequest/updateWith-shippingOptions.https-expected.txt	2022-03-31 21:03:01 UTC (rev 292173)
@@ -1,5 +1,5 @@
 CONSOLE MESSAGE: WebKit currently uses the first shipping option even if other shipping options are marked as selected.
 
 PASS Calling `updateWith` with a new `shippingOptions` without `requestShipping` should not update any values.
-FAIL Calling `updateWith` with a new `shippingOptions` should not update any other values. assert_equals: selected shipping option should change expected "shippingId4" but got "shippingId3"
+FAIL Calling `updateWith` with a new `shippingOptions` should not update any other values. assert_equals: shipping option 0 selected should change expected (boolean) false but got (undefined) undefined
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292144] trunk/Tools

2022-03-31 Thread cdumez
Title: [292144] trunk/Tools








Revision 292144
Author cdu...@apple.com
Date 2022-03-31 01:07:31 -0700 (Thu, 31 Mar 2022)


Log Message
Drop bad adoptNS() in NetworkProcess.LaunchOnlyWhenNecessary
https://bugs.webkit.org/show_bug.cgi?id=238583

Reviewed by Anders Carlsson.

Drop bad adoptNS() in NetworkProcess.LaunchOnlyWhenNecessary. It is incorrect as the
WKWebViewConfiguration.websiteDataStore getter is not ref'ing the store for us.

* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
(TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm




Diff

Modified: trunk/Tools/ChangeLog (292143 => 292144)

--- trunk/Tools/ChangeLog	2022-03-31 06:04:21 UTC (rev 292143)
+++ trunk/Tools/ChangeLog	2022-03-31 08:07:31 UTC (rev 292144)
@@ -1,3 +1,16 @@
+2022-03-31  Chris Dumez  
+
+Drop bad adoptNS() in NetworkProcess.LaunchOnlyWhenNecessary
+https://bugs.webkit.org/show_bug.cgi?id=238583
+
+Reviewed by Anders Carlsson.
+
+Drop bad adoptNS() in NetworkProcess.LaunchOnlyWhenNecessary. It is incorrect as the
+WKWebViewConfiguration.websiteDataStore getter is not ref'ing the store for us.
+
+* TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm:
+(TEST):
+
 2022-03-30  Sihui Liu  
 
 Regression: WebsiteDataStore fails to read experimental feature values from NSUserDefaults


Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm (292143 => 292144)

--- trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm	2022-03-31 06:04:21 UTC (rev 292143)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/NetworkProcess.mm	2022-03-31 08:07:31 UTC (rev 292144)
@@ -93,7 +93,7 @@
 
 @autoreleasepool {
 auto webView = adoptNS([WKWebView new]);
-websiteDataStore = adoptNS([webView configuration].websiteDataStore);
+websiteDataStore = [webView configuration].websiteDataStore;
 [websiteDataStore _setResourceLoadStatisticsEnabled:YES];
 [[webView configuration].processPool _registerURLSchemeAsSecure:@"test"];
 [[webView configuration].processPool _registerURLSchemeAsBypassingContentSecurityPolicy:@"test"];






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292128] trunk/Source/WebKit

2022-03-30 Thread cdumez
Title: [292128] trunk/Source/WebKit








Revision 292128
Author cdu...@apple.com
Date 2022-03-30 16:33:13 -0700 (Wed, 30 Mar 2022)


Log Message
Use dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM) in setOSTransaction()
https://bugs.webkit.org/show_bug.cgi?id=238559

Reviewed by Darin Adler.

Use dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM) in setOSTransaction() instead of a
low-level signal(SIGTERM) handler, as recommended by the XPC team.

This is better becomes it has less limitations about what you can do in the handler. It is also
possible to set several handlers this way, in different parts of the code (i.e. also not worry about
some other code overriding our handler).

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::setOSTransaction):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (292127 => 292128)

--- trunk/Source/WebKit/ChangeLog	2022-03-30 23:23:34 UTC (rev 292127)
+++ trunk/Source/WebKit/ChangeLog	2022-03-30 23:33:13 UTC (rev 292128)
@@ -1,3 +1,20 @@
+2022-03-30  Chris Dumez  
+
+Use dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM) in setOSTransaction()
+https://bugs.webkit.org/show_bug.cgi?id=238559
+
+Reviewed by Darin Adler.
+
+Use dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM) in setOSTransaction() instead of a
+low-level signal(SIGTERM) handler, as recommended by the XPC team.
+
+This is better becomes it has less limitations about what you can do in the handler. It is also
+possible to set several handlers this way, in different parts of the code (i.e. also not worry about
+some other code overriding our handler).
+
+* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
+(WebKit::setOSTransaction):
+
 2022-03-30  Sihui Liu  
 
 Remove -[WKWebsiteDataStore _indexedDBDatabaseDirectory]


Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (292127 => 292128)

--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-30 23:23:34 UTC (rev 292127)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-30 23:33:13 UTC (rev 292128)
@@ -168,13 +168,15 @@
 // services ourselves. However, one of the side effects of leaking this transaction is that the default SIGTERM
 // handler doesn't cleanly exit our XPC services when logging out or rebooting. This led to crashes with
 // XPC_EXIT_REASON_SIGTERM_TIMEOUT as termination reason (rdar://88940229). To address the issue, we now set our
-// own SIGTERM handler that calls _exit(0). In the future, we should likely adopt RunningBoard on macOS and
+// own SIGTERM handler that calls exit(0). In the future, we should likely adopt RunningBoard on macOS and
 // control our lifetime via process assertions instead of leaking this OS transaction.
-static std::once_flag onceKey;
-std::call_once(onceKey, [] {
-signal(SIGTERM, [](int) {
-_exit(0);
+static dispatch_once_t flag;
+dispatch_once(, ^{
+auto sigTermSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGTERM, 0, dispatch_get_main_queue());
+dispatch_source_set_event_handler(sigTermSource, ^{
+exit(0);
 });
+dispatch_resume(sigTermSource);
 });
 
 globalTransaction.get() = WTFMove(transaction);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [292106] trunk/Source

2022-03-30 Thread cdumez
Title: [292106] trunk/Source








Revision 292106
Author cdu...@apple.com
Date 2022-03-30 07:56:39 -0700 (Wed, 30 Mar 2022)


Log Message
Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets
https://bugs.webkit.org/show_bug.cgi?id=238521

Reviewed by Geoffrey Garen.

Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets using an ASCIILiteral,
without the need for allocating a String.

Source/WebCore:

* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::packageFormData):
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::YouTubePluginReplacement::installReplacement):
* Modules/websockets/WebSocketDeflateFramer.cpp:
(WebCore::WebSocketExtensionDeflateFrame::processResponse):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::allowsCrossOriginMethod const):
(WebCore::CrossOriginPreflightResultCacheItem::validateCrossOriginHeaders const):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):

Source/WebKit:

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::getUserDirectorySuffix):
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::getLaunchOptions):
* UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/glib/ProcessLauncherGLib.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):
* UIProcess/glib/WebProcessProxyGLib.cpp:
(WebKit::WebProcessProxy::platformGetLaunchOptions):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

Source/WTF:

* wtf/text/StringImpl.h:
* wtf/text/WTFString.h:
(WTF::HashTranslatorASCIILiteral::hash):
(WTF::HashTranslatorASCIILiteral::equal):
(WTF::HashTranslatorASCIILiteral::translate):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringImpl.h
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
trunk/Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp
trunk/Source/WebCore/Modules/websockets/WebSocketDeflateFramer.cpp
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp
trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp
trunk/Source/WebCore/loader/CrossOriginPreflightResultCache.cpp
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm
trunk/Source/WebKit/UIProcess/Launcher/glib/ProcessLauncherGLib.cpp
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
trunk/Source/WebKit/UIProcess/glib/WebProcessProxyGLib.cpp
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm




Diff

Modified: trunk/Source/WTF/ChangeLog (292105 => 292106)

--- trunk/Source/WTF/ChangeLog	2022-03-30 13:28:05 UTC (rev 292105)
+++ trunk/Source/WTF/ChangeLog	2022-03-30 14:56:39 UTC (rev 292106)
@@ -1,3 +1,19 @@
+2022-03-30  Chris Dumez  
+
+Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets
+https://bugs.webkit.org/show_bug.cgi?id=238521
+
+Reviewed by Geoffrey Garen.
+
+Add HashTranslator for ASCIILiteral for faster lookup in HashMaps / HashSets using an ASCIILiteral,
+without the need for allocating a String.
+
+* wtf/text/StringImpl.h:
+* wtf/text/WTFString.h:
+(WTF::HashTranslatorASCIILiteral::hash):
+(WTF::HashTranslatorASCIILiteral::equal):
+(WTF::HashTranslatorASCIILiteral::translate):
+
 2022-03-30  Youenn Fablet  
 
 Implement ServiceWorker WindowClient.ancestorOrigins


Modified: trunk/Source/WTF/wtf/text/StringImpl.h (292105 => 292106)

--- trunk/Source/WTF/wtf/text/StringImpl.h	2022-03-30 13:28:05 UTC (rev 292105)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2022-03-30 14:56:39 UTC (rev 292106)
@@ -60,6 +60,7 @@
 
 struct CStringTranslator;
 struct HashAndUTF8CharactersTranslator;
+struct HashTranslatorASCIILiteral;
 struct LCharBufferTranslator;
 struct SubstringTranslator;
 struct UCharBufferTranslator;
@@ -178,6 +179,7 @@
 
 friend struct WTF::CStringTranslator;
 friend struct WTF::HashAndUTF8CharactersTranslator;
+friend struct WTF::HashTranslatorASCIILiteral;
 friend struct WTF::LCharBufferTranslator;
 friend struct WTF::SubstringTranslator;
 friend struct WTF::UCharBufferTranslator;


Modified: trunk/Source/WTF/wtf/text/WTFString.h (292105 => 292106)

--- trunk/Source/WTF/wtf/text/WTFString.h	2022-03-30 13:28:05 UTC (rev 292105)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2022-03-30 14:56:39 UTC (rev 292106)
@@ -609,6 +609,24 @@
 return 

[webkit-changes] [292057] trunk/Source/WebCore

2022-03-29 Thread cdumez
Title: [292057] trunk/Source/WebCore








Revision 292057
Author cdu...@apple.com
Date 2022-03-29 12:23:30 -0700 (Tue, 29 Mar 2022)


Log Message
Use "UTF-8"_s instead of PAL::UTF8Encoding().domName()
https://bugs.webkit.org/show_bug.cgi?id=238508

Reviewed by Geoffrey Garen.

Use "UTF-8"_s instead of PAL::UTF8Encoding().domName() as it is equivalent and more efficient.

* dom/Document.cpp:
(WebCore::Document::characterSetWithUTF8Fallback const):
(WebCore::Document::defaultCharsetForLegacyBindings const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (292056 => 292057)

--- trunk/Source/WebCore/ChangeLog	2022-03-29 19:17:10 UTC (rev 292056)
+++ trunk/Source/WebCore/ChangeLog	2022-03-29 19:23:30 UTC (rev 292057)
@@ -1,3 +1,16 @@
+2022-03-29  Chris Dumez  
+
+Use "UTF-8"_s instead of PAL::UTF8Encoding().domName()
+https://bugs.webkit.org/show_bug.cgi?id=238508
+
+Reviewed by Geoffrey Garen.
+
+Use "UTF-8"_s instead of PAL::UTF8Encoding().domName() as it is equivalent and more efficient.
+
+* dom/Document.cpp:
+(WebCore::Document::characterSetWithUTF8Fallback const):
+(WebCore::Document::defaultCharsetForLegacyBindings const):
+
 2022-03-29  Alan Bujtas  
 
 WebCore::LegacyRootInlineBox::lineSnapAdjustment should bail out on grid line height < 1


Modified: trunk/Source/WebCore/dom/Document.cpp (292056 => 292057)

--- trunk/Source/WebCore/dom/Document.cpp	2022-03-29 19:17:10 UTC (rev 292056)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-03-29 19:23:30 UTC (rev 292057)
@@ -1493,13 +1493,13 @@
 AtomString name = encoding();
 if (!name.isNull())
 return name;
-return String { PAL::UTF8Encoding().domName() };
+return "UTF-8"_s;
 }
 
 String Document::defaultCharsetForLegacyBindings() const
 {
 if (!frame())
-PAL::UTF8Encoding().domName();
+return "UTF-8"_s;
 return settings().defaultTextEncodingName();
 }
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291997] trunk/Source/JavaScriptCore

2022-03-28 Thread cdumez
Title: [291997] trunk/Source/_javascript_Core








Revision 291997
Author cdu...@apple.com
Date 2022-03-28 15:23:39 -0700 (Mon, 28 Mar 2022)


Log Message
Unreviewed, address post-landing review comment from Darin after r291972.

* yarr/YarrJIT.cpp:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/yarr/YarrJIT.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291996 => 291997)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-28 22:20:21 UTC (rev 291996)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-28 22:23:39 UTC (rev 291997)
@@ -1,5 +1,11 @@
 2022-03-28  Chris Dumez  
 
+Unreviewed, address post-landing review comment from Darin after r291972.
+
+* yarr/YarrJIT.cpp:
+
+2022-03-28  Chris Dumez  
+
 Use StringView for Yarr / RegularExpression parsing
 https://bugs.webkit.org/show_bug.cgi?id=238420
 


Modified: trunk/Source/_javascript_Core/yarr/YarrJIT.cpp (291996 => 291997)

--- trunk/Source/_javascript_Core/yarr/YarrJIT.cpp	2022-03-28 22:20:21 UTC (rev 291996)
+++ trunk/Source/_javascript_Core/yarr/YarrJIT.cpp	2022-03-28 22:23:39 UTC (rev 291997)
@@ -4652,7 +4652,7 @@
 
 StackCheck* m_compilationThreadStackChecker { nullptr };
 YarrPattern& m_pattern;
-StringView m_patternString;
+const StringView m_patternString;
 
 CharSize m_charSize;
 JITCompileMode m_compileMode;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291981] trunk/Source/WebCore

2022-03-28 Thread cdumez
Title: [291981] trunk/Source/WebCore








Revision 291981
Author cdu...@apple.com
Date 2022-03-28 11:45:53 -0700 (Mon, 28 Mar 2022)


Log Message
Speed up Element::removedFromAncestor()
https://bugs.webkit.org/show_bug.cgi?id=238404

Reviewed by Geoffrey Garen.

Speed up Element::removedFromAncestor() by inlining some of the functions it is calling.
This is a confirmed 1.5-2% progression on Speedometer on iMac 20,1.

* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
(WebCore::Element::clearBeforePseudoElementSlow):
(WebCore::Element::clearAfterPseudoElementSlow):
(WebCore::Element::setSavedLayerScrollPositionSlow):
(WebCore::Element::clearBeforePseudoElement): Deleted.
(WebCore::Element::clearAfterPseudoElement): Deleted.
(WebCore::Element::setSavedLayerScrollPosition): Deleted.
* dom/Element.h:
(WebCore::Element::setSavedLayerScrollPosition):
(WebCore::Element::clearBeforePseudoElement):
(WebCore::Element::clearAfterPseudoElement):
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::elementWasRemovedSlow):
(WebCore::PointerCaptureController::elementWasRemoved): Deleted.
* page/PointerCaptureController.h:
(WebCore::PointerCaptureController::elementWasRemoved):
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementWasRemovedInternal):
(WebCore::PointerLockController::elementWasRemoved): Deleted.
* page/PointerLockController.h:
(WebCore::PointerLockController::elementWasRemoved):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Element.cpp
trunk/Source/WebCore/dom/Element.h
trunk/Source/WebCore/page/PointerCaptureController.cpp
trunk/Source/WebCore/page/PointerCaptureController.h
trunk/Source/WebCore/page/PointerLockController.cpp
trunk/Source/WebCore/page/PointerLockController.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291980 => 291981)

--- trunk/Source/WebCore/ChangeLog	2022-03-28 18:18:47 UTC (rev 291980)
+++ trunk/Source/WebCore/ChangeLog	2022-03-28 18:45:53 UTC (rev 291981)
@@ -1,3 +1,36 @@
+2022-03-28  Chris Dumez  
+
+Speed up Element::removedFromAncestor()
+https://bugs.webkit.org/show_bug.cgi?id=238404
+
+Reviewed by Geoffrey Garen.
+
+Speed up Element::removedFromAncestor() by inlining some of the functions it is calling.
+This is a confirmed 1.5-2% progression on Speedometer on iMac 20,1.
+
+* dom/Element.cpp:
+(WebCore::Element::removedFromAncestor):
+(WebCore::Element::clearBeforePseudoElementSlow):
+(WebCore::Element::clearAfterPseudoElementSlow):
+(WebCore::Element::setSavedLayerScrollPositionSlow):
+(WebCore::Element::clearBeforePseudoElement): Deleted.
+(WebCore::Element::clearAfterPseudoElement): Deleted.
+(WebCore::Element::setSavedLayerScrollPosition): Deleted.
+* dom/Element.h:
+(WebCore::Element::setSavedLayerScrollPosition):
+(WebCore::Element::clearBeforePseudoElement):
+(WebCore::Element::clearAfterPseudoElement):
+* page/PointerCaptureController.cpp:
+(WebCore::PointerCaptureController::elementWasRemovedSlow):
+(WebCore::PointerCaptureController::elementWasRemoved): Deleted.
+* page/PointerCaptureController.h:
+(WebCore::PointerCaptureController::elementWasRemoved):
+* page/PointerLockController.cpp:
+(WebCore::PointerLockController::elementWasRemovedInternal):
+(WebCore::PointerLockController::elementWasRemoved): Deleted.
+* page/PointerLockController.h:
+(WebCore::PointerLockController::elementWasRemoved):
+
 2022-03-28  Devin Rousso  
 
 [iOS] Add `WKWebView` API to control CSS "small viewport" `sv*` and "large viewport" `lv*` units


Modified: trunk/Source/WebCore/dom/Element.cpp (291980 => 291981)

--- trunk/Source/WebCore/dom/Element.cpp	2022-03-28 18:18:47 UTC (rev 291980)
+++ trunk/Source/WebCore/dom/Element.cpp	2022-03-28 18:45:53 UTC (rev 291981)
@@ -2417,11 +2417,10 @@
 if (hasPendingResources())
 document().accessSVGExtensions().removeElementFromPendingResources(*this);
 
-RefPtr frame = document().frame();
 Styleable::fromElement(*this).elementWasRemoved();
 
 #if ENABLE(WHEEL_EVENT_LATCHING)
-if (frame && frame->page()) {
+if (RefPtr frame = document().frame(); frame && frame->page()) {
 if (auto* scrollLatchingController = frame->page()->scrollLatchingControllerIfExists())
 scrollLatchingController->removeLatchingStateForTarget(*this);
 }
@@ -3741,18 +3740,16 @@
 pseudoElement->clearHostElement();
 }
 
-void Element::clearBeforePseudoElement()
+void Element::clearBeforePseudoElementSlow()
 {
-if (!hasRareData())
-return;
+ASSERT(hasRareData());
 disconnectPseudoElement(elementRareData()->beforePseudoElement());
 elementRareData()->setBeforePseudoElement(nullptr);
 }
 
-void Element::clearAfterPseudoElement()
+void Element::clearAfterPseudoElementSlow()
 {
-if (!hasRareData())

[webkit-changes] [291972] trunk/Source

2022-03-28 Thread cdumez
Title: [291972] trunk/Source








Revision 291972
Author cdu...@apple.com
Date 2022-03-28 10:25:14 -0700 (Mon, 28 Mar 2022)


Log Message
Use StringView for Yarr / RegularExpression parsing
https://bugs.webkit.org/show_bug.cgi?id=238420

Reviewed by Sam Weinig.

Source/_javascript_Core:

Use StringView for Yarr / RegularExpression parsing, to avoid unnecessary String construction
in some cases. It is not uncommon for the pattern to be a string literal.

* yarr/RegularExpression.cpp:
(JSC::Yarr::RegularExpression::Private::create):
(JSC::Yarr::RegularExpression::Private::Private):
(JSC::Yarr::RegularExpression::Private::compile):
(JSC::Yarr::RegularExpression::RegularExpression):
(JSC::Yarr::RegularExpression::match const):
(JSC::Yarr::RegularExpression::searchRev const):
(JSC::Yarr::replace):
* yarr/RegularExpression.h:
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::interpret):
* yarr/YarrInterpreter.h:
* yarr/YarrJIT.cpp:
(JSC::Yarr::jitCompile):
(JSC::Yarr::jitCompileInlinedTest):
* yarr/YarrJIT.h:
* yarr/YarrParser.h:
(JSC::Yarr::Parser::Parser):
(JSC::Yarr::parse):
* yarr/YarrPattern.cpp:
(JSC::Yarr::YarrPattern::compile):
(JSC::Yarr::YarrPattern::YarrPattern):
(JSC::Yarr::YarrPattern::dumpPatternString):
(JSC::Yarr::YarrPattern::dumpPattern):
* yarr/YarrPattern.h:
* yarr/YarrSyntaxChecker.cpp:
(JSC::Yarr::checkSyntax):
* yarr/YarrSyntaxChecker.h:

Source/WebCore:

* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):

Source/WTF:

Add convenience characters() templated function to StringView, to match String and StringImpl.

* wtf/text/StringView.h:
(WTF::StringView::characters const):
(WTF::StringView::characters const):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/yarr/RegularExpression.cpp
trunk/Source/_javascript_Core/yarr/RegularExpression.h
trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp
trunk/Source/_javascript_Core/yarr/YarrInterpreter.h
trunk/Source/_javascript_Core/yarr/YarrJIT.cpp
trunk/Source/_javascript_Core/yarr/YarrJIT.h
trunk/Source/_javascript_Core/yarr/YarrParser.h
trunk/Source/_javascript_Core/yarr/YarrPattern.cpp
trunk/Source/_javascript_Core/yarr/YarrPattern.h
trunk/Source/_javascript_Core/yarr/YarrSyntaxChecker.cpp
trunk/Source/_javascript_Core/yarr/YarrSyntaxChecker.h
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringView.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291971 => 291972)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-28 17:25:08 UTC (rev 291971)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-28 17:25:14 UTC (rev 291972)
@@ -1,3 +1,42 @@
+2022-03-28  Chris Dumez  
+
+Use StringView for Yarr / RegularExpression parsing
+https://bugs.webkit.org/show_bug.cgi?id=238420
+
+Reviewed by Sam Weinig.
+
+Use StringView for Yarr / RegularExpression parsing, to avoid unnecessary String construction
+in some cases. It is not uncommon for the pattern to be a string literal.
+
+* yarr/RegularExpression.cpp:
+(JSC::Yarr::RegularExpression::Private::create):
+(JSC::Yarr::RegularExpression::Private::Private):
+(JSC::Yarr::RegularExpression::Private::compile):
+(JSC::Yarr::RegularExpression::RegularExpression):
+(JSC::Yarr::RegularExpression::match const):
+(JSC::Yarr::RegularExpression::searchRev const):
+(JSC::Yarr::replace):
+* yarr/RegularExpression.h:
+* yarr/YarrInterpreter.cpp:
+(JSC::Yarr::interpret):
+* yarr/YarrInterpreter.h:
+* yarr/YarrJIT.cpp:
+(JSC::Yarr::jitCompile):
+(JSC::Yarr::jitCompileInlinedTest):
+* yarr/YarrJIT.h:
+* yarr/YarrParser.h:
+(JSC::Yarr::Parser::Parser):
+(JSC::Yarr::parse):
+* yarr/YarrPattern.cpp:
+(JSC::Yarr::YarrPattern::compile):
+(JSC::Yarr::YarrPattern::YarrPattern):
+(JSC::Yarr::YarrPattern::dumpPatternString):
+(JSC::Yarr::YarrPattern::dumpPattern):
+* yarr/YarrPattern.h:
+* yarr/YarrSyntaxChecker.cpp:
+(JSC::Yarr::checkSyntax):
+* yarr/YarrSyntaxChecker.h:
+
 2022-03-27  Lauro Moura  
 
 Unreviewed, non-unified buildfix


Modified: trunk/Source/_javascript_Core/yarr/RegularExpression.cpp (291971 => 291972)

--- trunk/Source/_javascript_Core/yarr/RegularExpression.cpp	2022-03-28 17:25:08 UTC (rev 291971)
+++ trunk/Source/_javascript_Core/yarr/RegularExpression.cpp	2022-03-28 17:25:14 UTC (rev 291972)
@@ -38,18 +38,18 @@
 
 class RegularExpression::Private : public RefCounted {
 public:
-static Ref create(const String& pattern, TextCaseSensitivity caseSensitivity, MultilineMode multilineMode, UnicodeMode unicodeMode)
+static Ref create(StringView pattern, TextCaseSensitivity caseSensitivity, MultilineMode 

[webkit-changes] [291964] trunk/Source/WebCore

2022-03-28 Thread cdumez
Title: [291964] trunk/Source/WebCore








Revision 291964
Author cdu...@apple.com
Date 2022-03-28 07:22:20 -0700 (Mon, 28 Mar 2022)


Log Message
Optimize toJS() for HTMLElements
https://bugs.webkit.org/show_bug.cgi?id=238426

Reviewed by Yusuke Suzuki.

Optimize toJS() for HTMLElements. Previously, the more generic Element's toJS() would be called,
which would have to do more checks.

This is a 0.6% progression on Speedometer 2.0 on MacBook Air 10,1 (AS).

* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::toJS):
(WebCore::toJSNewlyCreated):
* html/HTMLElement.idl:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp
trunk/Source/WebCore/html/HTMLElement.idl




Diff

Modified: trunk/Source/WebCore/ChangeLog (291963 => 291964)

--- trunk/Source/WebCore/ChangeLog	2022-03-28 14:14:09 UTC (rev 291963)
+++ trunk/Source/WebCore/ChangeLog	2022-03-28 14:22:20 UTC (rev 291964)
@@ -1,5 +1,22 @@
 2022-03-28  Chris Dumez  
 
+Optimize toJS() for HTMLElements
+https://bugs.webkit.org/show_bug.cgi?id=238426
+
+Reviewed by Yusuke Suzuki.
+
+Optimize toJS() for HTMLElements. Previously, the more generic Element's toJS() would be called,
+which would have to do more checks.
+
+This is a 0.6% progression on Speedometer 2.0 on MacBook Air 10,1 (AS).
+
+* bindings/js/JSHTMLElementCustom.cpp:
+(WebCore::toJS):
+(WebCore::toJSNewlyCreated):
+* html/HTMLElement.idl:
+
+2022-03-28  Chris Dumez  
+
 Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
 https://bugs.webkit.org/show_bug.cgi?id=238422
 


Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (291963 => 291964)

--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp	2022-03-28 14:14:09 UTC (rev 291963)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp	2022-03-28 14:22:20 UTC (rev 291964)
@@ -32,6 +32,7 @@
 #include "HTMLFormElement.h"
 #include "JSCustomElementInterface.h"
 #include "JSDOMConstructorBase.h"
+#include "JSHTMLElementWrapperFactory.h"
 #include "JSNodeCustom.h"
 #include "ScriptExecutionContext.h"
 #include <_javascript_Core/InternalFunction.h>
@@ -130,4 +131,23 @@
 return JSWithScope::create(vm, lexicalGlobalObject, scope, asObject(toJS(lexicalGlobalObject, globalObject(), element)));
 }
 
+JSValue toJS(JSGlobalObject*, JSDOMGlobalObject* globalObject, HTMLElement& element)
+{
+if (auto* wrapper = getCachedWrapper(globalObject->world(), element))
+return wrapper;
+return createJSHTMLWrapper(globalObject, element);
+}
+
+JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& element)
+{
+if (element->isDefinedCustomElement()) {
+JSValue result = getCachedWrapper(globalObject->world(), element);
+if (result)
+return result;
+ASSERT(!globalObject->vm().exceptionForInspection());
+}
+ASSERT(!getCachedWrapper(globalObject->world(), element));
+return createJSHTMLWrapper(globalObject, WTFMove(element));
+}
+
 } // namespace WebCore


Modified: trunk/Source/WebCore/html/HTMLElement.idl (291963 => 291964)

--- trunk/Source/WebCore/html/HTMLElement.idl	2022-03-28 14:14:09 UTC (rev 291963)
+++ trunk/Source/WebCore/html/HTMLElement.idl	2022-03-28 14:22:20 UTC (rev 291964)
@@ -20,6 +20,7 @@
 
 [
 CustomPushEventHandlerScope,
+CustomToJSObject,
 ExportMacro=WEBCORE_EXPORT,
 Exposed=Window,
 GenerateForEachEventHandlerContentAttribute,






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291963] trunk/Source/WebCore

2022-03-28 Thread cdumez
Title: [291963] trunk/Source/WebCore








Revision 291963
Author cdu...@apple.com
Date 2022-03-28 07:14:09 -0700 (Mon, 28 Mar 2022)


Log Message
Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
https://bugs.webkit.org/show_bug.cgi?id=238422

Reviewed by Peng Liu.

Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp and inline its implementation in the only caller instead.

* bindings/js/JSNodeCustom.cpp:
(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
(WebCore::isReachableFromDOM): Deleted.

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291962 => 291963)

--- trunk/Source/WebCore/ChangeLog	2022-03-28 12:08:56 UTC (rev 291962)
+++ trunk/Source/WebCore/ChangeLog	2022-03-28 14:14:09 UTC (rev 291963)
@@ -1,3 +1,16 @@
+2022-03-28  Chris Dumez  
+
+Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp
+https://bugs.webkit.org/show_bug.cgi?id=238422
+
+Reviewed by Peng Liu.
+
+Drop unnecessary isReachableFromDOM() function in JSNodeCustom.cpp and inline its implementation in the only caller instead.
+
+* bindings/js/JSNodeCustom.cpp:
+(WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
+(WebCore::isReachableFromDOM): Deleted.
+
 2022-03-28  Ziran Sun  
 
 [Forms] Alias appearance  keywords to 'auto' for button


Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (291962 => 291963)

--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-28 12:08:56 UTC (rev 291962)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-28 14:14:09 UTC (rev 291963)
@@ -64,17 +64,18 @@
 using namespace JSC;
 using namespace HTMLNames;
 
-static inline bool isReachableFromDOM(Node* node, AbstractSlotVisitor& visitor, const char** reason)
+bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle handle, void*, AbstractSlotVisitor& visitor, const char** reason)
 {
-if (!node->isConnected()) {
+auto& node = jsCast(handle.slot()->asCell())->wrapped();
+if (!node.isConnected()) {
 // If a node is firing event listeners, its wrapper is observable because
 // its wrapper is responsible for marking those event listeners.
-if (node->isFiringEventListeners()) {
+if (node.isFiringEventListeners()) {
 if (UNLIKELY(reason))
 *reason = "Node which is firing event listeners";
 return true;
 }
-if (GCReachableRefMap::contains(*node)) {
+if (GCReachableRefMap::contains(node)) {
 if (UNLIKELY(reason))
 *reason = "Node is scheduled to be used in an async script invocation)";
 return true;
@@ -87,12 +88,6 @@
 return visitor.containsOpaqueRoot(root(node));
 }
 
-bool JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle handle, void*, AbstractSlotVisitor& visitor, const char** reason)
-{
-JSNode* jsNode = jsCast(handle.slot()->asCell());
-return isReachableFromDOM(>wrapped(), visitor, reason);
-}
-
 JSScope* JSNode::pushEventHandlerScope(JSGlobalObject* lexicalGlobalObject, JSScope* node) const
 {
 if (inherits(lexicalGlobalObject->vm()))






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291947] trunk/LayoutTests

2022-03-26 Thread cdumez
Title: [291947] trunk/LayoutTests








Revision 291947
Author cdu...@apple.com
Date 2022-03-26 18:13:11 -0700 (Sat, 26 Mar 2022)


Log Message
Unreviewed, mark streams/readable-stream-lock-after-worker-terminates-crash.html as flaky on Windows.

This test has been a flaky Timeout on Windows EWS for months and keeps leading to false positives.
Mark it as flaky to silence the noise.

* platform/win/TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/platform/win/TestExpectations




Diff

Modified: trunk/LayoutTests/ChangeLog (291946 => 291947)

--- trunk/LayoutTests/ChangeLog	2022-03-26 22:19:31 UTC (rev 291946)
+++ trunk/LayoutTests/ChangeLog	2022-03-27 01:13:11 UTC (rev 291947)
@@ -1,3 +1,12 @@
+2022-03-26  Chris Dumez  
+
+Unreviewed, mark streams/readable-stream-lock-after-worker-terminates-crash.html as flaky on Windows.
+
+This test has been a flaky Timeout on Windows EWS for months and keeps leading to false positives.
+Mark it as flaky to silence the noise.
+
+* platform/win/TestExpectations:
+
 2022-03-26  Youenn Fablet  
 
 Implement ServiceWorkerWindowClient.focus


Modified: trunk/LayoutTests/platform/win/TestExpectations (291946 => 291947)

--- trunk/LayoutTests/platform/win/TestExpectations	2022-03-26 22:19:31 UTC (rev 291946)
+++ trunk/LayoutTests/platform/win/TestExpectations	2022-03-27 01:13:11 UTC (rev 291947)
@@ -5008,6 +5008,9 @@
 http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked2.html [ Failure ]
 http/tests/security/contentSecurityPolicy/userAgentShadowDOM/default-src-object-data-url-blocked3.html [ Failure ]
 
+# Test is flaky on Window EWS and leads to false positives.
+streams/readable-stream-lock-after-worker-terminates-crash.html [ Timeout Pass ]
+
 # Push subscription tests fail without platform-specific PushCrypto implementations.
 http/tests/push-api/subscribe-default-permissions-iframe-cross-origin.html [ Failure ]
 http/tests/push-api/subscribe-default-permissions-iframe-same-origin.html [ Failure ]






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291933] trunk/Source/WebCore

2022-03-25 Thread cdumez
Title: [291933] trunk/Source/WebCore








Revision 291933
Author cdu...@apple.com
Date 2022-03-25 22:26:02 -0700 (Fri, 25 Mar 2022)


Log Message
Simplify / Optimize JSNodeOwner::isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=238380

Reviewed by Geoffrey Garen.

Drop checks specific to HTMLAudioElement and HTMLImageElement from
JSNodeOwner::isReachableFromOpaqueRoots() so that other Node wrappers
that are not audio or image elements do not have to pay the cost.

In the HTMLAudioElement case, HTMLAudioElement already subclasses HTMLMediaElement which
is an ActiveDOMObject and HTMLMediaElement::virtualHasPendingActivity() already takes
care of keeping the JS wrapper alive is there is audio playing.

For HTMLImageElement, I made it subclass ActiveDOMObject so that the JSHTMLImageElement
wrapper is now calling HTMLImageElement::hasPendingActivity() instead of every JS Node
wrapper via JSNodeOwner::isReachableFromOpaqueRoots().

* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::create):
(WebCore::HTMLImageElement::createForLegacyFactoryFunction):
(WebCore::HTMLImageElement::activeDOMObjectName const):
(WebCore::HTMLImageElement::virtualHasPendingActivity const):
(WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
* html/HTMLImageElement.h:
* html/HTMLImageElement.idl:
* html/ImageDocument.cpp:
(WebCore::ImageDocumentElement::create):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp
trunk/Source/WebCore/html/HTMLImageElement.cpp
trunk/Source/WebCore/html/HTMLImageElement.h
trunk/Source/WebCore/html/HTMLImageElement.idl
trunk/Source/WebCore/html/ImageDocument.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291932 => 291933)

--- trunk/Source/WebCore/ChangeLog	2022-03-26 04:30:10 UTC (rev 291932)
+++ trunk/Source/WebCore/ChangeLog	2022-03-26 05:26:02 UTC (rev 291933)
@@ -1,3 +1,36 @@
+2022-03-25  Chris Dumez  
+
+Simplify / Optimize JSNodeOwner::isReachableFromOpaqueRoots()
+https://bugs.webkit.org/show_bug.cgi?id=238380
+
+Reviewed by Geoffrey Garen.
+
+Drop checks specific to HTMLAudioElement and HTMLImageElement from
+JSNodeOwner::isReachableFromOpaqueRoots() so that other Node wrappers
+that are not audio or image elements do not have to pay the cost.
+
+In the HTMLAudioElement case, HTMLAudioElement already subclasses HTMLMediaElement which
+is an ActiveDOMObject and HTMLMediaElement::virtualHasPendingActivity() already takes
+care of keeping the JS wrapper alive is there is audio playing.
+
+For HTMLImageElement, I made it subclass ActiveDOMObject so that the JSHTMLImageElement
+wrapper is now calling HTMLImageElement::hasPendingActivity() instead of every JS Node
+wrapper via JSNodeOwner::isReachableFromOpaqueRoots().
+
+* bindings/js/JSNodeCustom.cpp:
+(WebCore::isReachableFromDOM):
+* html/HTMLImageElement.cpp:
+(WebCore::HTMLImageElement::HTMLImageElement):
+(WebCore::HTMLImageElement::create):
+(WebCore::HTMLImageElement::createForLegacyFactoryFunction):
+(WebCore::HTMLImageElement::activeDOMObjectName const):
+(WebCore::HTMLImageElement::virtualHasPendingActivity const):
+(WebCore::HTMLImageElement::hasPendingActivity const): Deleted.
+* html/HTMLImageElement.h:
+* html/HTMLImageElement.idl:
+* html/ImageDocument.cpp:
+(WebCore::ImageDocumentElement::create):
+
 2022-03-25  Nikolaos Mouchtaris  
 
 Incorrect handling of NaN inside calc() for top-level calculation


Modified: trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp (291932 => 291933)

--- trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-26 04:30:10 UTC (rev 291932)
+++ trunk/Source/WebCore/bindings/js/JSNodeCustom.cpp	2022-03-26 05:26:02 UTC (rev 291933)
@@ -32,15 +32,8 @@
 #include "Document.h"
 #include "DocumentFragment.h"
 #include "DocumentType.h"
-#include "HTMLAudioElement.h"
-#include "HTMLCanvasElement.h"
 #include "HTMLElement.h"
-#include "HTMLFrameElementBase.h"
-#include "HTMLImageElement.h"
-#include "HTMLLinkElement.h"
 #include "HTMLNames.h"
-#include "HTMLScriptElement.h"
-#include "HTMLStyleElement.h"
 #include "JSAttr.h"
 #include "JSCDATASection.h"
 #include "JSComment.h"
@@ -64,8 +57,6 @@
 #include "SVGElement.h"
 #include "ShadowRoot.h"
 #include "GCReachableRef.h"
-#include "StyleSheet.h"
-#include "StyledElement.h"
 #include "Text.h"
 
 namespace WebCore {
@@ -76,32 +67,6 @@
 static inline bool isReachableFromDOM(Node* node, AbstractSlotVisitor& visitor, const char** reason)
 {
 if (!node->isConnected()) {
-if (is(*node)) {
-auto& element = downcast(*node);
-
-// If a wrapper is the last reference to an image element
-// that is loading but not in the 

[webkit-changes] [291902] trunk/Source

2022-03-25 Thread cdumez
Title: [291902] trunk/Source








Revision 291902
Author cdu...@apple.com
Date 2022-03-25 16:42:25 -0700 (Fri, 25 Mar 2022)


Log Message
Use StringView::split() instead of String::split() in more places
https://bugs.webkit.org/show_bug.cgi?id=238362

Reviewed by Geoffrey Garen.

Use StringView::split() instead of String::split() where suitable and more efficient.

Source/WebCore:

* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* html/HTMLInputElement.cpp:
(WebCore::isValidMIMEType):
(WebCore::isValidFileExtension):
(WebCore::parseAcceptAttribute):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::setMessageDOMAndStartTimer):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::compileShader):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::nodeForPath):
* page/WindowFeatures.cpp:
(WebCore::parseDisabledAdaptations):
(WebCore::parseDialogFeatures):
(WebCore::parseDialogFeaturesMap):
* page/WindowFeatures.h:
* platform/network/CacheValidation.cpp:
(WebCore::collectVaryingRequestHeadersInternal):
* platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
(WebCore::parseXFrameOptionsHeader):
* platform/network/HTTPParsers.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isAttachmentWithFilename const):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendOS2Table):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::parseOffsetValue):
(WebCore::SVGSMILElement::parseClockValue):
(WebCore::SVGSMILElement::parseCondition):
(WebCore::SVGSMILElement::parseBeginOrEnd):
(WebCore::SVGSMILElement::parseAttribute):
* svg/animation/SVGSMILElement.h:

Source/WebKit:

* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::parseOSVersion):
(WebKit::populateSandboxInitializationParameters):
* UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::launchProcess):
* WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp:
(WebKit::RemoteGraphicsContextGLProxy::initialize):

Source/WTF:

* wtf/Assertions.cpp:
* wtf/text/StringView.cpp:
(WTF::StringView::stripWhiteSpace const):
* wtf/text/StringView.h:
(WTF::StringView::toDouble const):
(WTF::StringView::stripLeadingAndTrailingMatchedCharacters const):
(WTF::StringView::stripLeadingAndTrailingMatchedCharacters): Deleted.

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/Assertions.cpp
trunk/Source/WTF/wtf/text/StringView.cpp
trunk/Source/WTF/wtf/text/StringView.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
trunk/Source/WebCore/html/HTMLInputElement.cpp
trunk/Source/WebCore/html/ValidationMessage.cpp
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
trunk/Source/WebCore/inspector/agents/InspectorDOMAgent.cpp
trunk/Source/WebCore/page/WindowFeatures.cpp
trunk/Source/WebCore/page/WindowFeatures.h
trunk/Source/WebCore/platform/network/CacheValidation.cpp
trunk/Source/WebCore/platform/network/HTTPParsers.cpp
trunk/Source/WebCore/platform/network/HTTPParsers.h
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp
trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp
trunk/Source/WebCore/svg/animation/SVGSMILElement.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
trunk/Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm
trunk/Source/WebKit/WebProcess/GPU/graphics/RemoteGraphicsContextGLProxy.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291901 => 291902)

--- trunk/Source/WTF/ChangeLog	2022-03-25 23:14:26 UTC (rev 291901)
+++ trunk/Source/WTF/ChangeLog	2022-03-25 23:42:25 UTC (rev 291902)
@@ -1,3 +1,20 @@
+2022-03-25  Chris Dumez  
+
+Use StringView::split() instead of String::split() in more places
+https://bugs.webkit.org/show_bug.cgi?id=238362
+
+Reviewed by Geoffrey Garen.
+
+Use StringView::split() instead of String::split() where suitable and more efficient.
+
+* wtf/Assertions.cpp:
+* wtf/text/StringView.cpp:
+(WTF::StringView::stripWhiteSpace const):
+* wtf/text/StringView.h:
+(WTF::StringView::toDouble const):
+(WTF::StringView::stripLeadingAndTrailingMatchedCharacters const):
+(WTF::StringView::stripLeadingAndTrailingMatchedCharacters): Deleted.
+
 2022-03-25  Antoine Quint  
 
 [web-animations] enable support for mutable timelines by default


Modified: trunk/Source/WTF/wtf/Assertions.cpp (291901 => 291902)

--- trunk/Source/WTF/wtf/Assertions.cpp	2022-03-25 23:14:26 UTC (rev 291901)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2022-03-25 23:42:25 UTC (rev 291902)
@@ -548,10 +548,14 @@
 }
 #endif
 
-for (auto& logLevelComponent : String(logLevel).split(',')) {
-Vector componentInfo = logLevelComponent.split('=');
-String component = componentInfo[0].stripWhiteSpace();
+for (auto 

[webkit-changes] [291893] trunk/Source/WebCore

2022-03-25 Thread cdumez
Title: [291893] trunk/Source/WebCore








Revision 291893
Author cdu...@apple.com
Date 2022-03-25 15:07:41 -0700 (Fri, 25 Mar 2022)


Log Message
Unreviewed, update DerivedSources-output.xcfilelist to fix build.

* DerivedSources-output.xcfilelist:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/DerivedSources-output.xcfilelist




Diff

Modified: trunk/Source/WebCore/ChangeLog (291892 => 291893)

--- trunk/Source/WebCore/ChangeLog	2022-03-25 22:05:27 UTC (rev 291892)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 22:07:41 UTC (rev 291893)
@@ -1,3 +1,9 @@
+2022-03-25  Chris Dumez  
+
+Unreviewed, update DerivedSources-output.xcfilelist to fix build.
+
+* DerivedSources-output.xcfilelist:
+
 2022-03-25  Wenson Hsieh  
 
 Enable PGO when building for release and production


Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (291892 => 291893)

--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2022-03-25 22:05:27 UTC (rev 291892)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2022-03-25 22:07:41 UTC (rev 291893)
@@ -293,6 +293,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCDATASection.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSAnimation.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSAnimation.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSColor.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSColor.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSColorValue.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSColorValue.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSConditionRule.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSCounterStyleRule.cpp
@@ -303,6 +307,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSFontPaletteValuesRule.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSGroupingRule.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSGroupingRule.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSHSL.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSHSL.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSHWB.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSHWB.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule+Layer.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule+Layer.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSImportRule.cpp
@@ -313,6 +321,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSKeyframesRule.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSKeywordValue.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSKeywordValue.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLCH.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLCH.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLab.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLab.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerBlockRule.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerBlockRule.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSLayerStatementRule.cpp
@@ -349,6 +361,10 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSNumericType.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSNumericValue.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSNumericValue.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOKLCH.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOKLCH.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOKLab.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOKLab.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOMVariableReferenceValue.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSOMVariableReferenceValue.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSPageRule.cpp
@@ -359,6 +375,8 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSPaintSize.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSPerspective.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSPerspective.h
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSRGB.cpp
+$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSRGB.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSRotate.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSRotate.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSCSSRule.cpp






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291883] trunk/Source/WebCore

2022-03-25 Thread cdumez
Title: [291883] trunk/Source/WebCore








Revision 291883
Author cdu...@apple.com
Date 2022-03-25 13:32:31 -0700 (Fri, 25 Mar 2022)


Log Message
Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()
https://bugs.webkit.org/show_bug.cgi?id=238376

Reviewed by Geoffrey Garen.

Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots().
Those wrappers already call JSNodeOwner::isReachableFromOpaqueRoots() which already takes care
of checking the isFiringEventListeners flag.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm




Diff

Modified: trunk/Source/WebCore/ChangeLog (291882 => 291883)

--- trunk/Source/WebCore/ChangeLog	2022-03-25 20:16:29 UTC (rev 291882)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 20:32:31 UTC (rev 291883)
@@ -1,3 +1,17 @@
+2022-03-25  Chris Dumez  
+
+Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots()
+https://bugs.webkit.org/show_bug.cgi?id=238376
+
+Reviewed by Geoffrey Garen.
+
+Drop duplicate isFiringEventListeners check in Node wrappers' isReachableFromOpaqueRoots().
+Those wrappers already call JSNodeOwner::isReachableFromOpaqueRoots() which already takes care
+of checking the isFiringEventListeners flag.
+
+* bindings/scripts/CodeGeneratorJS.pm:
+(GenerateImplementation):
+
 2022-03-25  J Pascoe  
 
 [WebAuthn] Maintain last modification time separate from last used time for platform credentials


Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (291882 => 291883)

--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2022-03-25 20:16:29 UTC (rev 291882)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2022-03-25 20:32:31 UTC (rev 291883)
@@ -5021,24 +5021,23 @@
 push(@implContent, "return true;\n");
 push(@implContent, " }\n");
 }
-if ($codeGenerator->InheritsInterface($interface, "EventTarget")) {
+if ($codeGenerator->InheritsInterface($interface, "Node")) {
 if (!$emittedJSCast) {
 push(@implContent, "auto* js${interfaceName} = jsCast(handle.slot()->asCell());\n");
 $emittedJSCast = 1;
 }
-push(@implContent, "if (js${interfaceName}->wrapped().isFiringEventListeners()) {\n");
-push(@implContent, "if (UNLIKELY(reason))\n");
-push(@implContent, "*reason = \"EventTarget firing event listeners\";\n");
+push(@implContent, "if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))\n");
 push(@implContent, "return true;\n");
-push(@implContent, "}\n");
-}
-if ($codeGenerator->InheritsInterface($interface, "Node")) {
+} elsif ($codeGenerator->InheritsInterface($interface, "EventTarget")) {
 if (!$emittedJSCast) {
 push(@implContent, "auto* js${interfaceName} = jsCast(handle.slot()->asCell());\n");
 $emittedJSCast = 1;
 }
-push(@implContent, "if (JSNodeOwner::isReachableFromOpaqueRoots(handle, 0, visitor, reason))\n");
+push(@implContent, "if (js${interfaceName}->wrapped().isFiringEventListeners()) {\n");
+push(@implContent, "if (UNLIKELY(reason))\n");
+push(@implContent, "*reason = \"EventTarget firing event listeners\";\n");
 push(@implContent, "return true;\n");
+push(@implContent, "}\n");
 }
 if (GetGenerateIsReachable($interface)) {
 if (!$emittedJSCast) {






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291866] trunk/Source/WebCore

2022-03-25 Thread cdumez
Title: [291866] trunk/Source/WebCore








Revision 291866
Author cdu...@apple.com
Date 2022-03-25 10:39:07 -0700 (Fri, 25 Mar 2022)


Log Message
Reduce EventListenerVector's minimum capacity from 16 to 2
https://bugs.webkit.org/show_bug.cgi?id=238374

Reviewed by Geoffrey Garen.

Reduce EventListenerVector's minimum capacity from 16 to 2 to save memory and get a small speedup on Speedometer.
Very few event listeners are registered for a given type in the common case so eagerly allocating enough memory for 16 is wasteful.
This is a confirmed 0.4% progression on Speedometer according to A/B bots.

* dom/EventListenerMap.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/EventListenerMap.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291865 => 291866)

--- trunk/Source/WebCore/ChangeLog	2022-03-25 17:32:48 UTC (rev 291865)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 17:39:07 UTC (rev 291866)
@@ -1,5 +1,18 @@
 2022-03-25  Chris Dumez  
 
+Reduce EventListenerVector's minimum capacity from 16 to 2
+https://bugs.webkit.org/show_bug.cgi?id=238374
+
+Reviewed by Geoffrey Garen.
+
+Reduce EventListenerVector's minimum capacity from 16 to 2 to save memory and get a small speedup on Speedometer.
+Very few event listeners are registered for a given type in the common case so eagerly allocating enough memory for 16 is wasteful.
+This is a confirmed 0.4% progression on Speedometer according to A/B bots.
+
+* dom/EventListenerMap.h:
+
+2022-03-25  Chris Dumez  
+
 Start preparing WebCore for making the String(const char*) constructor explicit
 https://bugs.webkit.org/show_bug.cgi?id=238336
 


Modified: trunk/Source/WebCore/dom/EventListenerMap.h (291865 => 291866)

--- trunk/Source/WebCore/dom/EventListenerMap.h	2022-03-25 17:32:48 UTC (rev 291865)
+++ trunk/Source/WebCore/dom/EventListenerMap.h	2022-03-25 17:39:07 UTC (rev 291866)
@@ -43,7 +43,7 @@
 
 class EventTarget;
 
-using EventListenerVector = Vector, 1>;
+using EventListenerVector = Vector, 1, CrashOnOverflow, 2>;
 
 class EventListenerMap {
 public:






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291848] trunk/Source

2022-03-24 Thread cdumez
Title: [291848] trunk/Source








Revision 291848
Author cdu...@apple.com
Date 2022-03-24 21:21:48 -0700 (Thu, 24 Mar 2022)


Log Message
String::split() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238355

Reviewed by Geoffrey Garen.

Source/WebCore:

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::classList const):
Call the more efficient split(UChar) overload instead.

Source/WebKit:

* UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp:
Optimize by calling StringView::split() instead of String::split().

Source/WTF:

String::split() should take in a StringView instead of a String, to avoid unnecessary construction
of Strings in some instances.

* wtf/text/WTFString.cpp:
(WTF::String::splitInternal const):
(WTF::String::split const):
(WTF::String::splitAllowingEmptyEntries const):
* wtf/text/WTFString.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/WTFString.cpp
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Inspector/socket/RemoteInspectorProtocolHandler.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291847 => 291848)

--- trunk/Source/WTF/ChangeLog	2022-03-25 04:14:29 UTC (rev 291847)
+++ trunk/Source/WTF/ChangeLog	2022-03-25 04:21:48 UTC (rev 291848)
@@ -1,5 +1,21 @@
 2022-03-24  Chris Dumez  
 
+String::split() should take in a StringView instead of a String
+https://bugs.webkit.org/show_bug.cgi?id=238355
+
+Reviewed by Geoffrey Garen.
+
+String::split() should take in a StringView instead of a String, to avoid unnecessary construction
+of Strings in some instances.
+
+* wtf/text/WTFString.cpp:
+(WTF::String::splitInternal const):
+(WTF::String::split const):
+(WTF::String::splitAllowingEmptyEntries const):
+* wtf/text/WTFString.h:
+
+2022-03-24  Chris Dumez  
+
 FileSystem::pathByAppendingComponent() should take in StringViews instead of Strings
 https://bugs.webkit.org/show_bug.cgi?id=238344
 


Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (291847 => 291848)

--- trunk/Source/WTF/wtf/text/WTFString.cpp	2022-03-25 04:14:29 UTC (rev 291847)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2022-03-25 04:21:48 UTC (rev 291848)
@@ -532,7 +532,7 @@
 }
 
 template
-inline Vector String::splitInternal(const String& separator) const
+inline Vector String::splitInternal(StringView separator) const
 {
 Vector result;
 
@@ -586,7 +586,7 @@
 return splitInternal(separator);
 }
 
-Vector String::split(const String& separator) const
+Vector String::split(StringView separator) const
 {
 return splitInternal(separator);
 }
@@ -601,7 +601,7 @@
 return splitInternal(separator);
 }
 
-Vector String::splitAllowingEmptyEntries(const String& separator) const
+Vector String::splitAllowingEmptyEntries(StringView separator) const
 {
 return splitInternal(separator);
 }


Modified: trunk/Source/WTF/wtf/text/WTFString.h (291847 => 291848)

--- trunk/Source/WTF/wtf/text/WTFString.h	2022-03-25 04:14:29 UTC (rev 291847)
+++ trunk/Source/WTF/wtf/text/WTFString.h	2022-03-25 04:21:48 UTC (rev 291848)
@@ -243,11 +243,11 @@
 
 WTF_EXPORT_PRIVATE void split(UChar separator, const SplitFunctor&) const;
 WTF_EXPORT_PRIVATE Vector split(UChar separator) const;
-WTF_EXPORT_PRIVATE Vector split(const String& separator) const;
+WTF_EXPORT_PRIVATE Vector split(StringView separator) const;
 
 WTF_EXPORT_PRIVATE void splitAllowingEmptyEntries(UChar separator, const SplitFunctor&) const;
 WTF_EXPORT_PRIVATE Vector splitAllowingEmptyEntries(UChar separator) const;
-WTF_EXPORT_PRIVATE Vector splitAllowingEmptyEntries(const String& separator) const;
+WTF_EXPORT_PRIVATE Vector splitAllowingEmptyEntries(StringView separator) const;
 
 WTF_EXPORT_PRIVATE double toDouble(bool* ok = nullptr) const;
 WTF_EXPORT_PRIVATE float toFloat(bool* ok = nullptr) const;
@@ -343,7 +343,7 @@
 
 template void splitInternal(UChar separator, const SplitFunctor&) const;
 template Vector splitInternal(UChar separator) const;
-template Vector splitInternal(const String& separator) const;
+template Vector splitInternal(StringView separator) const;
 
 RefPtr m_impl;
 };


Modified: trunk/Source/WebCore/ChangeLog (291847 => 291848)

--- trunk/Source/WebCore/ChangeLog	2022-03-25 04:14:29 UTC (rev 291847)
+++ trunk/Source/WebCore/ChangeLog	2022-03-25 04:21:48 UTC (rev 291848)
@@ -1,3 +1,14 @@
+2022-03-24  Chris Dumez  
+
+String::split() should take in a StringView instead of a String
+https://bugs.webkit.org/show_bug.cgi?id=238355
+
+Reviewed by Geoffrey Garen.
+
+* accessibility/isolatedtree/AXIsolatedObject.cpp:
+(WebCore::AXIsolatedObject::classList const):
+Call the more efficient 

[webkit-changes] [291842] trunk

2022-03-24 Thread cdumez
Title: [291842] trunk








Revision 291842
Author cdu...@apple.com
Date 2022-03-24 19:05:10 -0700 (Thu, 24 Mar 2022)


Log Message
FileSystem::pathByAppendingComponent() should take in StringViews instead of Strings
https://bugs.webkit.org/show_bug.cgi?id=238344

Reviewed by Geoff Garen.

Source/_javascript_Core:

* jsc.cpp:

Source/WebCore:

* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::getAllDatabaseNamesAndVersions):
(WebCore::IDBServer::IDBServer::diskUsage):
(WebCore::IDBServer::IDBServer::upgradedDatabaseDirectory):
* Modules/webdatabase/OriginLock.cpp:
(WebCore::lockFileNameForPath):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
* platform/network/curl/CurlCacheManager.cpp:
(WebCore::CurlCacheManager::loadIndex):

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp:
(WebKit::ResourceLoadStatisticsDatabaseStore::ResourceLoadStatisticsDatabaseStore):
* NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp:
(WebKit::PCM::Database::Database):
* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::storagePath):
(WebKit::CacheStorage::Engine::initialize):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::cachesListFilename):
(WebKit::CacheStorage::cachesOriginFilename):
(WebKit::CacheStorage::Caches::cachesSizeFilename):
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
(WebKit::NetworkCache::BlobStorage::blobPathForHash const):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeCachePath):
* NetworkProcess/storage/IDBStorageManager.cpp:
(WebKit::IDBStorageManager::idbStorageOriginDirectory):
* UIProcess/Inspector/win/InspectorResourceURLSchemeHandler.cpp:
(WebKit::InspectorResourceURLSchemeHandler::platformStartTask):

Source/WebKitLegacy/mac:

* Storage/WebDatabaseProvider.mm:
(WebDatabaseProvider::indexedDatabaseDirectoryPath):
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

Source/WTF:

FileSystem::pathByAppendingComponent() should take in StringViews instead of Strings, to avoid
unnecessary String constructor in many instances.

* wtf/FileSystem.cpp:
(WTF::FileSystemImpl::pathByAppendingComponent):
* wtf/FileSystem.h:
* wtf/posix/FileSystemPOSIX.cpp:
(WTF::FileSystemImpl::pathByAppendingComponent):

Tools:

* TestWebKitAPI/Tests/WTF/FileSystem.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/jsc.cpp
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/FileSystem.cpp
trunk/Source/WTF/wtf/FileSystem.h
trunk/Source/WTF/wtf/posix/FileSystemPOSIX.cpp
trunk/Source/WTF/wtf/win/FileSystemWin.cpp
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.cpp
trunk/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp
trunk/Source/WebCore/Modules/webdatabase/OriginLock.cpp
trunk/Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm
trunk/Source/WebCore/platform/network/curl/CurlCacheManager.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.cpp
trunk/Source/WebKit/NetworkProcess/PrivateClickMeasurement/PrivateClickMeasurementDatabase.cpp
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheBlobStorage.cpp
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
trunk/Source/WebKit/NetworkProcess/storage/IDBStorageManager.cpp
trunk/Source/WebKit/NetworkProcess/storage/LocalStorageManager.cpp
trunk/Source/WebKit/UIProcess/Inspector/win/InspectorResourceURLSchemeHandler.cpp
trunk/Source/WebKit/WebProcess/Model/mac/ARKitInlinePreviewModelPlayerMac.mm
trunk/Source/WebKitLegacy/Storage/StorageSyncManager.cpp
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/Storage/WebDatabaseProvider.mm
trunk/Source/WebKitLegacy/mac/WebView/WebView.mm
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291841 => 291842)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-25 01:03:07 UTC (rev 291841)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-25 02:05:10 UTC (rev 291842)
@@ -1,5 +1,14 @@
 2022-03-24  Chris Dumez  
 
+FileSystem::pathByAppendingComponent() should take in StringViews instead of Strings
+https://bugs.webkit.org/show_bug.cgi?id=238344
+
+Reviewed by Geoff Garen.
+
+* 

[webkit-changes] [291837] trunk

2022-03-24 Thread cdumez
Title: [291837] trunk








Revision 291837
Author cdu...@apple.com
Date 2022-03-24 17:13:55 -0700 (Thu, 24 Mar 2022)


Log Message
String's startsWith() / endsWith() / replace() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238333

Reviewed by Geoff Garen.

Source/_javascript_Core:

* runtime/FileBasedFuzzerAgent.cpp:
(JSC::FileBasedFuzzerAgent::getPredictionInternal):
* runtime/IntlRelativeTimeFormat.cpp:
(JSC::singularUnit):
* runtime/TemporalObject.cpp:
(JSC::singularUnit):

Source/WebCore:

* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::shouldIgnoreIceCandidate):
* css/CSSImageValue.cpp:
(WebCore::ResolvedURL::isLocalURL const):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::screenshot):
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::pathMatches const):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::getUnmangledInfoLog):
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem):
* platform/graphics/gstreamer/ImageDecoderGStreamer.cpp:
(WebCore::ImageDecoderGStreamer::supportsContainerType):
(WebCore::ImageDecoderGStreamer::canDecodeType):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::checkVaryingsPacking const):
* platform/network/ParsedRequestRange.cpp:
(WebCore::ParsedRequestRange::parse):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::checkSecureCookie):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::handleAcceptedCandidateWithSoftSpaces):

Source/WTF:

String's startsWith() / endsWith() / replace() should take in a StringView instead of a String,
to avoid unnecessary String creation in many instances.

* wtf/text/AtomString.h:
* wtf/text/StringCommon.h:
(WTF::startsWith): Deleted.
(WTF::startsWithIgnoringASCIICase): Deleted.
(WTF::endsWith): Deleted.
(WTF::endsWithIgnoringASCIICase): Deleted.
* wtf/text/StringImpl.cpp:
(WTF::equalInner):
(WTF::StringImpl::startsWith const):
(WTF::StringImpl::startsWithIgnoringASCIICase const):
(WTF::StringImpl::hasInfixStartingAt const):
(WTF::StringImpl::endsWith):
(WTF::StringImpl::endsWithIgnoringASCIICase const):
(WTF::StringImpl::hasInfixEndingAt const):
(WTF::StringImpl::replace):
* wtf/text/StringImpl.h:
(WTF::StringImpl::startsWith const): Deleted.
(WTF::StringImpl::endsWith const): Deleted.
* wtf/text/StringView.h:
(WTF::startsWith):
(WTF::startsWithIgnoringASCIICase):
(WTF::endsWith):
(WTF::endsWithIgnoringASCIICase):
(WTF::String::replace):
(WTF::String::startsWith const):
(WTF::String::startsWithIgnoringASCIICase const):
(WTF::String::endsWith const):
(WTF::String::endsWithIgnoringASCIICase const):
(WTF::String::hasInfixStartingAt const):
(WTF::String::hasInfixEndingAt const):
(WTF::AtomString::startsWith const):
(WTF::AtomString::startsWithIgnoringASCIICase const):
(WTF::AtomString::endsWith const):
(WTF::AtomString::endsWithIgnoringASCIICase const):
* wtf/text/WTFString.h:

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/FileBasedFuzzerAgent.cpp
trunk/Source/_javascript_Core/runtime/IntlRelativeTimeFormat.cpp
trunk/Source/_javascript_Core/runtime/TemporalObject.cpp
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/AtomString.h
trunk/Source/WTF/wtf/text/StringCommon.h
trunk/Source/WTF/wtf/text/StringImpl.cpp
trunk/Source/WTF/wtf/text/StringImpl.h
trunk/Source/WTF/wtf/text/StringView.h
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
trunk/Source/WebCore/css/CSSImageValue.cpp
trunk/Source/WebCore/page/PageConsoleClient.cpp
trunk/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp
trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp
trunk/Source/WebCore/platform/graphics/avfoundation/CDMFairPlayStreaming.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/ImageDecoderGStreamer.cpp
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.cpp
trunk/Source/WebCore/platform/mediarecorder/MediaRecorderPrivateGStreamer.cpp
trunk/Source/WebCore/platform/network/ParsedRequestRange.cpp
trunk/Source/WebCore/platform/network/curl/CookieJarDB.cpp
trunk/Source/WebKit/NetworkProcess/storage/LocalStorageManager.cpp
trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
trunk/Source/WebKitLegacy/mac/ChangeLog
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291836 => 291837)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-25 00:13:47 UTC (rev 291836)
+++ trunk/Source/_javascript_Core/ChangeLog	

[webkit-changes] [291800] trunk

2022-03-24 Thread cdumez
Title: [291800] trunk








Revision 291800
Author cdu...@apple.com
Date 2022-03-24 09:55:40 -0700 (Thu, 24 Mar 2022)


Log Message
String's find() / reverseFind() / replace() should take in a StringView instead of a String
https://bugs.webkit.org/show_bug.cgi?id=238287

Reviewed by Darin Adler.

Source/WebCore:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::decodeDatabaseName):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::label const):

Source/WebKit:

* WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
(WebKit::WebContextMenuClient::searchWithGoogle):

Source/WebKitLegacy/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):

Source/WTF:

String's find() / reverseFind() / replace() should take in a StringView instead of a String
to avoid unnecessary String construction in many cases. We should probably do the same for
more String functions where we don't really need a String parameter, but those will be
addressed separately.

* wtf/text/AtomString.h:
* wtf/text/StringCommon.h:
(WTF::findCommon): Deleted.
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::find):
(WTF::StringImpl::findIgnoringASCIICase const):
(WTF::StringImpl::reverseFind):
(WTF::StringImpl::replace):
* wtf/text/StringImpl.h:
* wtf/text/StringView.h:
(WTF::findCommon):
(WTF::findIgnoringASCIICase):
(WTF::String::find const):
(WTF::String::findIgnoringASCIICase const):
(WTF::String::reverseFind const):
(WTF::String::contains const):
(WTF::String::containsIgnoringASCIICase const):
(WTF::String::replace):
(WTF::AtomString::find const):
(WTF::AtomString::findIgnoringASCIICase const):
(WTF::AtomString::contains const):
(WTF::AtomString::containsIgnoringASCIICase const):
* wtf/text/WTFString.h:

Modified Paths

trunk/Source/_javascript_Core/API/JSValue.mm
trunk/Source/_javascript_Core/API/JSWrapperMap.mm
trunk/Source/_javascript_Core/inspector/agents/InspectorAuditAgent.cpp
trunk/Source/_javascript_Core/jit/ExecutableAllocator.cpp
trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp
trunk/Source/_javascript_Core/runtime/TypeProfiler.cpp
trunk/Source/_javascript_Core/runtime/TypeSet.cpp
trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp
trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/AtomString.h
trunk/Source/WTF/wtf/text/StringCommon.h
trunk/Source/WTF/wtf/text/StringImpl.cpp
trunk/Source/WTF/wtf/text/StringImpl.h
trunk/Source/WTF/wtf/text/StringView.h
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Modules/fetch/FetchBodyConsumer.cpp
trunk/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
trunk/Source/WebCore/PAL/pal/text/DecodeEscapeSequences.h
trunk/Source/WebCore/PAL/pal/text/win/TextCodecWin.cpp
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
trunk/Source/WebCore/page/UserContentURLPattern.cpp
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp
trunk/Source/WebCore/platform/mediastream/CaptureDevice.h
trunk/Source/WebCore/platform/network/curl/AuthenticationChallengeCurl.cpp
trunk/Source/WebCore/platform/network/curl/CurlCacheEntry.cpp
trunk/Source/WebCore/platform/network/curl/CurlMultipartHandle.cpp
trunk/Source/WebCore/platform/network/curl/CurlRequest.cpp
trunk/Source/WebDriver/WebDriverService.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebContextMenuClient.cpp
trunk/Source/WebKitLegacy/win/ChangeLog
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebContextMenuClient.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp




Diff

Modified: trunk/Source/_javascript_Core/API/JSValue.mm (291799 => 291800)

--- trunk/Source/_javascript_Core/API/JSValue.mm	2022-03-24 15:55:34 UTC (rev 291799)
+++ trunk/Source/_javascript_Core/API/JSValue.mm	2022-03-24 16:55:40 UTC (rev 291800)
@@ -1179,7 +1179,7 @@
 return;
 // Try to find a matching valueWith:context: method.
 auto type = adoptSystem(method_copyReturnType(method));
-StructHandlers::iterator iter = structHandlers->find(String { type.get() });
+StructHandlers::iterator iter = structHandlers->find(type.get());
 if (iter == structHandlers->end())
 return;
 StructTagHandler& handler = iter->value;
@@ -1217,7 +1217,7 @@
 
 static StructHandlers* structHandlers = createStructHandlerMap();
 
-StructHandlers::iterator iter = structHandlers->find(String { encodedType });
+StructHandlers::iterator iter = structHandlers->find(encodedType);
 if (iter == structHandlers->end())
 return 0;
 return >value;


Modified: trunk/Source/_javascript_Core/API/JSWrapperMap.mm (291799 => 291800)

--- 

[webkit-changes] [291795] trunk/Tools

2022-03-24 Thread cdumez
Title: [291795] trunk/Tools








Revision 291795
Author cdu...@apple.com
Date 2022-03-24 08:03:09 -0700 (Thu, 24 Mar 2022)


Log Message
Unreviewed, update outdated comment after r291787.

* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp




Diff

Modified: trunk/Tools/ChangeLog (291794 => 291795)

--- trunk/Tools/ChangeLog	2022-03-24 14:15:24 UTC (rev 291794)
+++ trunk/Tools/ChangeLog	2022-03-24 15:03:09 UTC (rev 291795)
@@ -1,3 +1,10 @@
+2022-03-24  Chris Dumez  
+
+Unreviewed, update outdated comment after r291787.
+
+* TestWebKitAPI/Tests/WTF/StringImpl.cpp:
+(TestWebKitAPI::TEST):
+
 2022-03-23  Simon Fraser  
 
 Have MiniBrowser shows the GPU Process pid in its title bar


Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp (291794 => 291795)

--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp	2022-03-24 14:15:24 UTC (rev 291794)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp	2022-03-24 15:03:09 UTC (rev 291795)
@@ -35,7 +35,7 @@
 
 TEST(WTF, StringImplCreationFromLiteral)
 {
-// Constructor using the template to determine the size.
+// Constructor taking an ASCIILiteral.
 auto stringWithTemplate = StringImpl::createFromLiteral("Template Literal"_s);
 ASSERT_EQ(strlen("Template Literal"), stringWithTemplate->length());
 ASSERT_TRUE(equal(stringWithTemplate.get(), "Template Literal"));






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291787] trunk

2022-03-24 Thread cdumez
Title: [291787] trunk








Revision 291787
Author cdu...@apple.com
Date 2022-03-23 23:27:16 -0700 (Wed, 23 Mar 2022)


Log Message
Inline String(ASCIILiteral) constructor so the compiler can optimize out strlen()
https://bugs.webkit.org/show_bug.cgi?id=238162

Reviewed by Geoffrey Garen.

I have verified using a profiler that strlen() is no longer called under String::String(WTF::ASCIILiteral)
or StringImpl::createFromLiteral(WTF::ASCIILiteral) when running Speedometer.

* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:
(WTF::StringImpl::createFromLiteral):
* wtf/text/WTFString.cpp:
* wtf/text/WTFString.h:
(WTF::String::String):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/text/StringImpl.cpp
trunk/Source/WTF/wtf/text/StringImpl.h
trunk/Source/WTF/wtf/text/WTFString.cpp
trunk/Source/WTF/wtf/text/WTFString.h
trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/FileSystem.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/StringView.cpp
trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291786 => 291787)

--- trunk/Source/WTF/ChangeLog	2022-03-24 06:25:20 UTC (rev 291786)
+++ trunk/Source/WTF/ChangeLog	2022-03-24 06:27:16 UTC (rev 291787)
@@ -1,3 +1,20 @@
+2022-03-23  Chris Dumez  
+
+Inline String(ASCIILiteral) constructor so the compiler can optimize out strlen()
+https://bugs.webkit.org/show_bug.cgi?id=238162
+
+Reviewed by Geoffrey Garen.
+
+I have verified using a profiler that strlen() is no longer called under String::String(WTF::ASCIILiteral)
+or StringImpl::createFromLiteral(WTF::ASCIILiteral) when running Speedometer.
+
+* wtf/text/StringImpl.cpp:
+* wtf/text/StringImpl.h:
+(WTF::StringImpl::createFromLiteral):
+* wtf/text/WTFString.cpp:
+* wtf/text/WTFString.h:
+(WTF::String::String):
+
 2022-03-23  Alex Christensen  
 
 Add off-by-default experimental feature for app store attribution


Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (291786 => 291787)

--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2022-03-24 06:25:20 UTC (rev 291786)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2022-03-24 06:27:16 UTC (rev 291787)
@@ -163,11 +163,6 @@
 return createFromLiteral(characters, strlen(characters));
 }
 
-Ref StringImpl::createFromLiteral(ASCIILiteral literal)
-{
-return createFromLiteral(literal.characters(), literal.length());
-}
-
 Ref StringImpl::createWithoutCopying(const UChar* characters, unsigned length)
 {
 if (!length)


Modified: trunk/Source/WTF/wtf/text/StringImpl.h (291786 => 291787)

--- trunk/Source/WTF/wtf/text/StringImpl.h	2022-03-24 06:25:20 UTC (rev 291786)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2022-03-24 06:27:16 UTC (rev 291787)
@@ -245,12 +245,10 @@
 
 static Ref createSubstringSharingImpl(StringImpl&, unsigned offset, unsigned length);
 
-template static Ref createFromLiteral(const char (&)[characterCount]);
-
 // FIXME: Replace calls to these overloads of createFromLiteral to createWithoutCopying instead.
 WTF_EXPORT_PRIVATE static Ref createFromLiteral(const char*, unsigned length);
 WTF_EXPORT_PRIVATE static Ref createFromLiteral(const char*);
-WTF_EXPORT_PRIVATE static Ref createFromLiteral(ASCIILiteral);
+static Ref createFromLiteral(ASCIILiteral);
 
 WTF_EXPORT_PRIVATE static Ref createWithoutCopying(const UChar*, unsigned length);
 WTF_EXPORT_PRIVATE static Ref createWithoutCopying(const LChar*, unsigned length);
@@ -982,12 +980,9 @@
 return adoptRef(*new (NotNull, stringImpl) StringImpl(rep.m_data16 + offset, length, *ownerRep));
 }
 
-template ALWAYS_INLINE Ref StringImpl::createFromLiteral(const char ()[characterCount])
+inline Ref StringImpl::createFromLiteral(ASCIILiteral literal)
 {
-COMPILE_ASSERT(characterCount > 1, StringImplFromLiteralNotEmpty);
-COMPILE_ASSERT((characterCount - 1 <= ((unsigned(~0) - sizeof(StringImpl)) / sizeof(LChar))), StringImplFromLiteralCannotOverflow);
-
-return createWithoutCopying(reinterpret_cast(characters), characterCount - 1);
+return createFromLiteral(literal.characters(), literal.length());
 }
 
 template ALWAYS_INLINE RefPtr StringImpl::tryCreateUninitialized(unsigned length, CharacterType*& output)


Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (291786 => 291787)

--- trunk/Source/WTF/wtf/text/WTFString.cpp	2022-03-24 06:25:20 UTC (rev 291786)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2022-03-24 06:27:16 UTC (rev 291787)
@@ -79,11 +79,6 @@
 m_impl = StringImpl::create(reinterpret_cast(nullTerminatedString));
 }
 
-String::String(ASCIILiteral characters)
-: m_impl(characters.isNull() ? nullptr : RefPtr { StringImpl::createFromLiteral(characters) })
-{
-}
-
 void String::append(const String& otherString)
 {
 // FIXME: This is extremely inefficient. So much so that we might want to take 

[webkit-changes] [291755] trunk/Source/JavaScriptCore

2022-03-23 Thread cdumez
Title: [291755] trunk/Source/_javascript_Core








Revision 291755
Author cdu...@apple.com
Date 2022-03-23 11:37:21 -0700 (Wed, 23 Mar 2022)


Log Message
Avoid unnecessary String constructor under FunctionExecutable::toStringSlow()
https://bugs.webkit.org/show_bug.cgi?id=238263

Reviewed by Darin Adler.

* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::toStringSlow):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291754 => 291755)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-23 18:31:58 UTC (rev 291754)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-23 18:37:21 UTC (rev 291755)
@@ -1,3 +1,13 @@
+2022-03-23  Chris Dumez  
+
+Avoid unnecessary String constructor under FunctionExecutable::toStringSlow()
+https://bugs.webkit.org/show_bug.cgi?id=238263
+
+Reviewed by Darin Adler.
+
+* runtime/FunctionExecutable.cpp:
+(JSC::FunctionExecutable::toStringSlow):
+
 2022-03-23  Yusuke Suzuki  
 
 Unreviewed, fix DataIC's slowPathJump handling


Modified: trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp (291754 => 291755)

--- trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp	2022-03-23 18:31:58 UTC (rev 291754)
+++ trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp	2022-03-23 18:37:21 UTC (rev 291755)
@@ -141,7 +141,7 @@
 if (isClass())
 return cache(jsString(vm, classSource().view().toString()));
 
-String functionHeader;
+ASCIILiteral functionHeader = ""_s;
 switch (parseMode()) {
 case SourceParseMode::GeneratorWrapperFunctionMode:
 case SourceParseMode::GeneratorWrapperMethodMode:
@@ -164,7 +164,6 @@
 
 case SourceParseMode::ArrowFunctionMode:
 case SourceParseMode::ClassFieldInitializerMode:
-functionHeader = "";
 break;
 
 case SourceParseMode::AsyncFunctionMode:






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291731] trunk/Source

2022-03-22 Thread cdumez
Title: [291731] trunk/Source








Revision 291731
Author cdu...@apple.com
Date 2022-03-22 18:27:54 -0700 (Tue, 22 Mar 2022)


Log Message
Use ASCIILiteral in a few more places where it is useful
https://bugs.webkit.org/show_bug.cgi?id=238235

Reviewed by Geoffrey Garen.

Source/_javascript_Core:

* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::toStringSlow):

Source/WebCore:

* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::setValueCommon):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const):

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLTextAreaElement.cpp
trunk/Source/WebCore/platform/animation/TimingFunction.cpp




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (291730 => 291731)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-23 00:58:41 UTC (rev 291730)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-23 01:27:54 UTC (rev 291731)
@@ -1,3 +1,13 @@
+2022-03-22  Chris Dumez  
+
+Use ASCIILiteral in a few more places where it is useful
+https://bugs.webkit.org/show_bug.cgi?id=238235
+
+Reviewed by Geoffrey Garen.
+
+* runtime/FunctionExecutable.cpp:
+(JSC::FunctionExecutable::toStringSlow):
+
 2022-03-21  Yusuke Suzuki  
 
 [JSC] Change Date.parse to stop returning numbers with fractional part


Modified: trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp (291730 => 291731)

--- trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp	2022-03-23 00:58:41 UTC (rev 291730)
+++ trunk/Source/_javascript_Core/runtime/FunctionExecutable.cpp	2022-03-23 01:27:54 UTC (rev 291731)
@@ -145,7 +145,7 @@
 switch (parseMode()) {
 case SourceParseMode::GeneratorWrapperFunctionMode:
 case SourceParseMode::GeneratorWrapperMethodMode:
-functionHeader = "function* ";
+functionHeader = "function* "_s;
 break;
 
 case SourceParseMode::NormalFunctionMode:
@@ -159,7 +159,7 @@
 case SourceParseMode::AsyncGeneratorBodyMode:
 case SourceParseMode::AsyncFunctionBodyMode:
 case SourceParseMode::AsyncArrowFunctionBodyMode:
-functionHeader = "function ";
+functionHeader = "function "_s;
 break;
 
 case SourceParseMode::ArrowFunctionMode:
@@ -169,16 +169,16 @@
 
 case SourceParseMode::AsyncFunctionMode:
 case SourceParseMode::AsyncMethodMode:
-functionHeader = "async function ";
+functionHeader = "async function "_s;
 break;
 
 case SourceParseMode::AsyncArrowFunctionMode:
-functionHeader = "async ";
+functionHeader = "async "_s;
 break;
 
 case SourceParseMode::AsyncGeneratorWrapperFunctionMode:
 case SourceParseMode::AsyncGeneratorWrapperMethodMode:
-functionHeader = "async function* ";
+functionHeader = "async function* "_s;
 break;
 }
 


Modified: trunk/Source/WebCore/ChangeLog (291730 => 291731)

--- trunk/Source/WebCore/ChangeLog	2022-03-23 00:58:41 UTC (rev 291730)
+++ trunk/Source/WebCore/ChangeLog	2022-03-23 01:27:54 UTC (rev 291731)
@@ -1,5 +1,17 @@
 2022-03-22  Chris Dumez  
 
+Use ASCIILiteral in a few more places where it is useful
+https://bugs.webkit.org/show_bug.cgi?id=238235
+
+Reviewed by Geoffrey Garen.
+
+* html/HTMLTextAreaElement.cpp:
+(WebCore::HTMLTextAreaElement::setValueCommon):
+* platform/animation/TimingFunction.cpp:
+(WebCore::TimingFunction::cssText const):
+
+2022-03-22  Chris Dumez  
+
 Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView
 https://bugs.webkit.org/show_bug.cgi?id=238221
 


Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (291730 => 291731)

--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2022-03-23 00:58:41 UTC (rev 291730)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2022-03-23 01:27:54 UTC (rev 291731)
@@ -395,7 +395,7 @@
 // Code elsewhere normalizes line endings added by the user via the keyboard or pasting.
 // We normalize line endings coming from _javascript_ here.
 String normalizedValue = newValue.isNull() ? emptyString() : newValue;
-normalizedValue.replace("\r\n", "\n");
+normalizedValue.replace("\r\n"_s, "\n"_s);
 normalizedValue.replace('\r', '\n');
 
 // Return early because we don't want to move the caret or trigger other side effects


Modified: trunk/Source/WebCore/platform/animation/TimingFunction.cpp (291730 => 291731)

--- trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2022-03-23 00:58:41 UTC (rev 291730)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2022-03-23 01:27:54 UTC (rev 291731)
@@ -198,13 +198,13 @@
 if (m_type == TimingFunction::CubicBezierFunction) {
 auto& function = downcast(*this);
 if 

[webkit-changes] [291730] trunk/Source

2022-03-22 Thread cdumez
Title: [291730] trunk/Source








Revision 291730
Author cdu...@apple.com
Date 2022-03-22 17:58:41 -0700 (Tue, 22 Mar 2022)


Log Message
Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView
https://bugs.webkit.org/show_bug.cgi?id=238221

Reviewed by Geoffrey Garen.

Source/WebCore:

* page/History.cpp:
(WebCore::History::stateObjectAdded):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
(WebCore::BlobRegistryImpl::registerBlobURLHandle):
(WebCore::BlobRegistryImpl::unregisterBlobURLHandle):
(WebCore::blobURLWithoutFragment): Deleted.

Source/WTF:

* wtf/URL.cpp:
(WTF::URL::viewWithoutQueryOrFragmentIdentifier const):
(WTF::URL::viewWithoutFragmentIdentifier const):
(WTF::URL::stringWithoutFragmentIdentifier const):
(WTF::equalIgnoringFragmentIdentifier):
(WTF::URL::stringWithoutQueryOrFragmentIdentifier const): Deleted.
* wtf/URL.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/URL.cpp
trunk/Source/WTF/wtf/URL.h
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/History.cpp
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291729 => 291730)

--- trunk/Source/WTF/ChangeLog	2022-03-23 00:19:32 UTC (rev 291729)
+++ trunk/Source/WTF/ChangeLog	2022-03-23 00:58:41 UTC (rev 291730)
@@ -1,3 +1,18 @@
+2022-03-22  Chris Dumez  
+
+Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView
+https://bugs.webkit.org/show_bug.cgi?id=238221
+
+Reviewed by Geoffrey Garen.
+
+* wtf/URL.cpp:
+(WTF::URL::viewWithoutQueryOrFragmentIdentifier const):
+(WTF::URL::viewWithoutFragmentIdentifier const):
+(WTF::URL::stringWithoutFragmentIdentifier const):
+(WTF::equalIgnoringFragmentIdentifier):
+(WTF::URL::stringWithoutQueryOrFragmentIdentifier const): Deleted.
+* wtf/URL.h:
+
 2022-03-22  Per Arne Vollan  
 
 Enable content filtering in the Network process


Modified: trunk/Source/WTF/wtf/URL.cpp (291729 => 291730)

--- trunk/Source/WTF/wtf/URL.cpp	2022-03-23 00:19:32 UTC (rev 291729)
+++ trunk/Source/WTF/wtf/URL.cpp	2022-03-23 00:58:41 UTC (rev 291730)
@@ -708,7 +708,7 @@
 ));
 }
 
-StringView URL::stringWithoutQueryOrFragmentIdentifier() const
+StringView URL::viewWithoutQueryOrFragmentIdentifier() const
 {
 if (!m_isValid)
 return m_string;
@@ -716,7 +716,7 @@
 return StringView(m_string).left(pathEnd());
 }
 
-StringView URL::stringWithoutFragmentIdentifier() const
+StringView URL::viewWithoutFragmentIdentifier() const
 {
 if (!m_isValid)
 return m_string;
@@ -724,9 +724,17 @@
 return StringView(m_string).left(m_queryEnd);
 }
 
+String URL::stringWithoutFragmentIdentifier() const
+{
+if (!m_isValid)
+return m_string;
+
+return m_string.left(m_queryEnd);
+}
+
 bool equalIgnoringFragmentIdentifier(const URL& a, const URL& b)
 {
-return a.stringWithoutFragmentIdentifier() == b.stringWithoutFragmentIdentifier();
+return a.viewWithoutFragmentIdentifier() == b.viewWithoutFragmentIdentifier();
 }
 
 bool protocolHostAndPortAreEqual(const URL& a, const URL& b)


Modified: trunk/Source/WTF/wtf/URL.h (291729 => 291730)

--- trunk/Source/WTF/wtf/URL.h	2022-03-23 00:19:32 UTC (rev 291729)
+++ trunk/Source/WTF/wtf/URL.h	2022-03-23 00:58:41 UTC (rev 291730)
@@ -117,8 +117,9 @@
 
 WTF_EXPORT_PRIVATE StringView queryWithLeadingQuestionMark() const;
 WTF_EXPORT_PRIVATE StringView fragmentIdentifierWithLeadingNumberSign() const;
-WTF_EXPORT_PRIVATE StringView stringWithoutQueryOrFragmentIdentifier() const;
-WTF_EXPORT_PRIVATE StringView stringWithoutFragmentIdentifier() const;
+WTF_EXPORT_PRIVATE StringView viewWithoutQueryOrFragmentIdentifier() const;
+WTF_EXPORT_PRIVATE StringView viewWithoutFragmentIdentifier() const;
+WTF_EXPORT_PRIVATE String stringWithoutFragmentIdentifier() const;
 
 WTF_EXPORT_PRIVATE String protocolHostAndPort() const;
 WTF_EXPORT_PRIVATE String hostAndPort() const;


Modified: trunk/Source/WebCore/ChangeLog (291729 => 291730)

--- trunk/Source/WebCore/ChangeLog	2022-03-23 00:19:32 UTC (rev 291729)
+++ trunk/Source/WebCore/ChangeLog	2022-03-23 00:58:41 UTC (rev 291730)
@@ -1,3 +1,18 @@
+2022-03-22  Chris Dumez  
+
+Add URL::stringWithoutFragmentIdentifier() overload which returns a String instead of a StringView
+https://bugs.webkit.org/show_bug.cgi?id=238221
+
+Reviewed by Geoffrey Garen.
+
+* page/History.cpp:
+(WebCore::History::stateObjectAdded):
+* platform/network/BlobRegistryImpl.cpp:
+(WebCore::BlobRegistryImpl::getBlobDataFromURL const):
+(WebCore::BlobRegistryImpl::registerBlobURLHandle):
+(WebCore::BlobRegistryImpl::unregisterBlobURLHandle):
+(WebCore::blobURLWithoutFragment): Deleted.
+
 2022-03-22  Sihui Liu  
 
 Check if 

[webkit-changes] [291689] trunk

2022-03-22 Thread cdumez
Title: [291689] trunk








Revision 291689
Author cdu...@apple.com
Date 2022-03-22 12:51:52 -0700 (Tue, 22 Mar 2022)


Log Message
REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters
https://bugs.webkit.org/show_bug.cgi?id=236069


Reviewed by Darin Adler.

Source/WebCore:

To extend the lifetime of Blob objects while loading/downloading is pending, we rely to
BlobURLHandle objects, which tell the NetworkProcess that we still need this blob data,
even if the corresponding Blob object gets GC'd by JS. The issue here is that the load
was not using the vanilla blob URL but was intead appending a fragment to the URL. As
a result, BlobRegistryImpl::registerBlobURLHandle() would fail to look up the
corresponding blob data and would fail to extend its lifetime.

To address the issue, BlobRegistryImpl::registerBlobURLHandle() / unregisterBlobURLHandle()
now strip fragments from the blob URL, similarly to what was already done inside
BlobRegistryImpl::getBlobDataFromURL().

Test: fast/files/blob-with-fragment-as-frame-url.html

* platform/network/BlobRegistryImpl.cpp:
(WebCore::blobURLWithoutFragment):
(WebCore::BlobRegistryImpl::registerBlobURLHandle):
(WebCore::BlobRegistryImpl::unregisterBlobURLHandle):

Source/WebKit:

Fix theoretical blob data leak. A WebContent process could create several BlobURLHandles for
the same blob URL. This would result in several calls to NetworkConnectionToWebProcess::registerBlobURLHandle()
for the same URL and several calls to to BlobRegistryImpl::registerBlobURLHandle() for the
same URL as well. BlobRegistryImpl is using a HashCountedSet for m_blobReferences in order
to deal with this fact. However, NetworkConnectionToWebProcess was using a simple HashSet
for m_blobURLHandles. As a result, if the WebContent process would exit and didClose()
would get called, the NetworkConnectionToWebProcess may call BlobRegistryImpl::unregisterBlobURLHandle()
only once even though the WebContent process had several handles for this URL, which would
not fully remove the URL from BlobRegistryImpl's HashCountedSet. To address the issue,
NetworkConnectionToWebProcess::m_blobURLHandles is now a HashCountedSet too and we call
BlobRegistryImpl::unregisterBlobURLHandle() as many times as needed in didClose().

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
* NetworkProcess/NetworkConnectionToWebProcess.h:

LayoutTests:

Add layout test coverage.

* fast/files/blob-with-fragment-as-frame-url-expected.txt: Added.
* fast/files/blob-with-fragment-as-frame-url.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h


Added Paths

trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url-expected.txt
trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url.html




Diff

Modified: trunk/LayoutTests/ChangeLog (291688 => 291689)

--- trunk/LayoutTests/ChangeLog	2022-03-22 19:45:56 UTC (rev 291688)
+++ trunk/LayoutTests/ChangeLog	2022-03-22 19:51:52 UTC (rev 291689)
@@ -1,3 +1,16 @@
+2022-03-22  Chris Dumez  
+
+REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters
+https://bugs.webkit.org/show_bug.cgi?id=236069
+
+
+Reviewed by Darin Adler.
+
+Add layout test coverage.
+
+* fast/files/blob-with-fragment-as-frame-url-expected.txt: Added.
+* fast/files/blob-with-fragment-as-frame-url.html: Added.
+
 2022-03-22  Matteo Flores  
 
 [ iOS EWS ] fast/text/text-shadow-ink-overflow-missing.html is a flaky image failure


Added: trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url-expected.txt (0 => 291689)

--- trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url-expected.txt	2022-03-22 19:51:52 UTC (rev 291689)
@@ -0,0 +1,12 @@
+Tests the lifetime of a Blob URL with a fragment.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS iframe.contentDocument.body.innerText is "FOO"
+PASS iframe.contentWindow.location.href == blobURLWithFragment is true
+PASS iframe.contentDocument.URL == blobURLWithFragment is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url.html (0 => 291689)

--- trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url.html	(rev 0)
+++ trunk/LayoutTests/fast/files/blob-with-fragment-as-frame-url.html	2022-03-22 19:51:52 UTC (rev 291689)
@@ -0,0 +1,30 @@
+
+
+
+
+description("Tests the lifetime of a Blob URL with a fragment.");
+jsTestIsAsync = true;
+
+_onload_ = () => {
+

[webkit-changes] [291589] trunk

2022-03-21 Thread cdumez
Title: [291589] trunk








Revision 291589
Author cdu...@apple.com
Date 2022-03-21 16:46:48 -0700 (Mon, 21 Mar 2022)


Log Message
LayoutTests/imported/w3c:
BroadcastChannel instances in distinct opaque origins can communicate
https://bugs.webkit.org/show_bug.cgi?id=238090


Reviewed by Alex Christensen.

Import web-platform-tests test coverage.

* web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
* web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
* web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:

Source/WebCore:
BroadcastChannel instances in distinct opaque origins can communicate
https://bugs.webkit.org/show_bug.cgi?id=238090


Reviewed by Alex Christensen.

The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
unique SecurityOrigins, they would compare as equal.

To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
would not be equal but the same unique SecurityOrigin would be. I then used this new
PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
ClientOrigin. This allows communication between several BroadcastChannels from the same
unique origin, while preventing communication between distinct opaque origins.

When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
the Network Process at all since the destination can only be in the same WebProcess.

Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* dom/BroadcastChannel.cpp:
(WebCore::shouldPartitionOrigin):
(WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
(WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
(WebCore::BroadcastChannel::MainThreadBridge::postMessage):
* dom/BroadcastChannelRegistry.h:
* loader/EmptyClients.cpp:
* page/PartitionedSecurityOrigin.h: Added.
(WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
(WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
(WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
(WebCore::operator==):
(WTF::add):
(WTF::PartitionedSecurityOriginHash::hash):
(WTF::PartitionedSecurityOriginHash::equal):
(WTF::HashTraits::emptyValue):
(WTF::HashTraits::constructEmptyValue):
(WTF::HashTraits::isEmptyValue):
(WTF::HashTraits::peek):
(WTF::HashTraits::take):

Source/WebKit:
BroadcastChannel instances in distinct opaque origins can communicate
https://bugs.webkit.org/show_bug.cgi?id=238090


Reviewed by Alex Christensen.

The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
unique SecurityOrigins, they would compare as equal.

To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
would not be equal but the same unique SecurityOrigin would be. I then used this new
PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
ClientOrigin. This allows communication between several BroadcastChannels from the same
unique origin, while preventing communication between distinct opaque origins.

When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
the Network Process at all since the destination can only be in the same WebProcess.

* WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
(WebKit::toClientOrigin):
(WebKit::WebBroadcastChannelRegistry::registerChannel):
(WebKit::WebBroadcastChannelRegistry::unregisterChannel):
(WebKit::WebBroadcastChannelRegistry::postMessage):
(WebKit::WebBroadcastChannelRegistry::postMessageLocally):
(WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
(WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
* WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:

Source/WebKitLegacy:
Dust off Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=238121

Reviewed by Yusuke Suzuki.

* PlatformMac.cmake:

Modified Paths

trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/w3c-import.log
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/Headers.cmake

[webkit-changes] [291540] trunk

2022-03-19 Thread cdumez
Title: [291540] trunk








Revision 291540
Author cdu...@apple.com
Date 2022-03-19 21:11:32 -0700 (Sat, 19 Mar 2022)


Log Message
Vector move constructor and move assignment operator are suboptimal when the vector has an inline buffer
https://bugs.webkit.org/show_bug.cgi?id=238096

Reviewed by Darin Adler.

Source/WTF:

The move constructor (and move assignment operators) for Vector were implemented using Vector::swap(), which
is fine for vectors with out of line buffers because we're just swapping pointers. However, when the vector
has inline capacity, this is suboptimal because it is not cheap to move data from one inline buffer to another
and moving any data to the source buffer is unnecessary.

* wtf/Vector.h:
(WTF::VectorBuffer::VectorBuffer):
(WTF::VectorBuffer::adopt):
(WTF::Malloc>::Vector):
(WTF::=):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST):

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/Vector.h
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WTF/Vector.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291539 => 291540)

--- trunk/Source/WTF/ChangeLog	2022-03-20 03:46:37 UTC (rev 291539)
+++ trunk/Source/WTF/ChangeLog	2022-03-20 04:11:32 UTC (rev 291540)
@@ -1,3 +1,21 @@
+2022-03-19  Chris Dumez  
+
+Vector move constructor and move assignment operator are suboptimal when the vector has an inline buffer
+https://bugs.webkit.org/show_bug.cgi?id=238096
+
+Reviewed by Darin Adler.
+
+The move constructor (and move assignment operators) for Vector were implemented using Vector::swap(), which
+is fine for vectors with out of line buffers because we're just swapping pointers. However, when the vector
+has inline capacity, this is suboptimal because it is not cheap to move data from one inline buffer to another
+and moving any data to the source buffer is unnecessary.
+
+* wtf/Vector.h:
+(WTF::VectorBuffer::VectorBuffer):
+(WTF::VectorBuffer::adopt):
+(WTF::Malloc>::Vector):
+(WTF::=):
+
 2022-03-18  Philippe Normand  
 
 [GStreamer] Initial import of the GstWebRTC backend


Modified: trunk/Source/WTF/wtf/Vector.h (291539 => 291540)

--- trunk/Source/WTF/wtf/Vector.h	2022-03-20 03:46:37 UTC (rev 291539)
+++ trunk/Source/WTF/wtf/Vector.h	2022-03-20 04:11:32 UTC (rev 291540)
@@ -435,6 +435,21 @@
 protected:
 using Base::m_size;
 
+VectorBuffer(VectorBuffer&& other)
+{
+m_buffer = std::exchange(other.m_buffer, nullptr);
+m_capacity = std::exchange(other.m_capacity, 0);
+m_size = std::exchange(other.m_size, 0);
+}
+
+void adopt(VectorBuffer&& other)
+{
+deallocateBuffer(buffer());
+m_buffer = std::exchange(other.m_buffer, nullptr);
+m_capacity = std::exchange(other.m_capacity, 0);
+m_size = std::exchange(other.m_size, 0);
+}
+
 private:
 friend class JSC::LLIntOffsetsExtractor;
 using Base::m_buffer;
@@ -556,6 +571,34 @@
 protected:
 using Base::m_size;
 
+VectorBuffer(VectorBuffer&& other)
+: Base(inlineBuffer(), inlineCapacity, 0)
+{
+if (other.buffer() == other.inlineBuffer())
+VectorTypeOperations::move(other.inlineBuffer(), other.inlineBuffer() + other.m_size, inlineBuffer());
+else {
+m_buffer = std::exchange(other.m_buffer, other.inlineBuffer());
+m_capacity = std::exchange(other.m_capacity, inlineCapacity);
+}
+m_size = std::exchange(other.m_size, 0);
+}
+
+void adopt(VectorBuffer&& other)
+{
+if (buffer() != inlineBuffer()) {
+deallocateBuffer(buffer());
+m_buffer = inlineBuffer();
+}
+if (other.buffer() == other.inlineBuffer()) {
+VectorTypeOperations::move(other.inlineBuffer(), other.inlineBuffer() + other.m_size, inlineBuffer());
+m_capacity = other.m_capacity;
+} else {
+m_buffer = std::exchange(other.m_buffer, other.inlineBuffer());
+m_capacity = std::exchange(other.m_capacity, inlineCapacity);
+}
+m_size = std::exchange(other.m_size, 0);
+}
+
 private:
 using Base::m_buffer;
 using Base::m_capacity;
@@ -974,14 +1017,24 @@
 
 template
 inline Vector::Vector(Vector&& other)
+: Base(WTFMove(other))
 {
-swap(other);
 }
 
 template
 inline Vector& Vector::operator=(Vector&& other)
 {
-swap(other);
+if (m_size)
+VectorTypeOperations::destruct(begin(), end());
+
+// Make it possible to copy inline buffer.
+asanSetBufferSizeToFullCapacity();
+other.asanSetBufferSizeToFullCapacity();
+
+Base::adopt(WTFMove(other));
+
+asanSetInitialBufferSizeTo(m_size);
+
 return *this;
 }
 


Modified: trunk/Tools/ChangeLog (291539 => 291540)

--- trunk/Tools/ChangeLog	2022-03-20 03:46:37 UTC (rev 291539)
+++ trunk/Tools/ChangeLog	2022-03-20 04:11:32 UTC (rev 291540)

[webkit-changes] [291538] trunk/Source/WebCore

2022-03-19 Thread cdumez
Title: [291538] trunk/Source/WebCore








Revision 291538
Author cdu...@apple.com
Date 2022-03-19 20:29:17 -0700 (Sat, 19 Mar 2022)


Log Message
Optimize EventTarget::visitJSEventListeners()
https://bugs.webkit.org/show_bug.cgi?id=238116

Reviewed by Darin Adler.

This was confirmed by A/B bots to be a 1-1.5% progression on Speedometer on
iMac 20,1 (Intel).

* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::replace):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
(WebCore::EventListenerMap::EventListenerMap): Deleted.
(WebCore::EventListenerIterator::EventListenerIterator): Deleted.
(WebCore::EventListenerIterator::~EventListenerIterator): Deleted.
(WebCore::EventListenerIterator::nextListener): Deleted.
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::visitJSEventListeners):
(): Deleted.
(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
* dom/EventTarget.cpp:
(WebCore::EventTarget::visitJSEventListeners): Deleted.
* dom/EventTarget.h:
(WebCore::EventTarget::visitJSEventListeners):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/EventListenerMap.cpp
trunk/Source/WebCore/dom/EventListenerMap.h
trunk/Source/WebCore/dom/EventTarget.cpp
trunk/Source/WebCore/dom/EventTarget.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291537 => 291538)

--- trunk/Source/WebCore/ChangeLog	2022-03-20 03:18:09 UTC (rev 291537)
+++ trunk/Source/WebCore/ChangeLog	2022-03-20 03:29:17 UTC (rev 291538)
@@ -1,3 +1,33 @@
+2022-03-19  Chris Dumez  
+
+Optimize EventTarget::visitJSEventListeners()
+https://bugs.webkit.org/show_bug.cgi?id=238116
+
+Reviewed by Darin Adler.
+
+This was confirmed by A/B bots to be a 1-1.5% progression on Speedometer on
+iMac 20,1 (Intel).
+
+* dom/EventListenerMap.cpp:
+(WebCore::EventListenerMap::clear):
+(WebCore::EventListenerMap::replace):
+(WebCore::EventListenerMap::add):
+(WebCore::EventListenerMap::remove):
+(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
+(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
+(WebCore::EventListenerMap::EventListenerMap): Deleted.
+(WebCore::EventListenerIterator::EventListenerIterator): Deleted.
+(WebCore::EventListenerIterator::~EventListenerIterator): Deleted.
+(WebCore::EventListenerIterator::nextListener): Deleted.
+* dom/EventListenerMap.h:
+(WebCore::EventListenerMap::visitJSEventListeners):
+(): Deleted.
+(WebCore::EventListenerMap::assertNoActiveIterators const): Deleted.
+* dom/EventTarget.cpp:
+(WebCore::EventTarget::visitJSEventListeners): Deleted.
+* dom/EventTarget.h:
+(WebCore::EventTarget::visitJSEventListeners):
+
 2022-03-19  Oriol Brufau  
 
 [cssom] Implement border-image serialization


Modified: trunk/Source/WebCore/dom/EventListenerMap.cpp (291537 => 291538)

--- trunk/Source/WebCore/dom/EventListenerMap.cpp	2022-03-20 03:18:09 UTC (rev 291537)
+++ trunk/Source/WebCore/dom/EventListenerMap.cpp	2022-03-20 03:29:17 UTC (rev 291538)
@@ -44,17 +44,8 @@
 
 namespace WebCore {
 
-#ifndef NDEBUG
-void EventListenerMap::assertNoActiveIterators() const
-{
-ASSERT(!m_activeIteratorCount);
-}
-#endif
+EventListenerMap::EventListenerMap() = default;
 
-EventListenerMap::EventListenerMap()
-{
-}
-
 bool EventListenerMap::containsCapturing(const AtomString& eventType) const
 {
 auto* listeners = find(eventType);
@@ -84,8 +75,6 @@
 void EventListenerMap::clear()
 {
 Locker locker { m_lock };
-
-assertNoActiveIterators();
 
 for (auto& entry : m_entries) {
 for (auto& listener : entry.second)
@@ -115,8 +104,6 @@
 void EventListenerMap::replace(const AtomString& eventType, EventListener& oldListener, Ref&& newListener, const RegisteredEventListener::Options& options)
 {
 Locker locker { m_lock };
-
-assertNoActiveIterators();
 
 auto* listeners = find(eventType);
 ASSERT(listeners);
@@ -130,8 +117,6 @@
 bool EventListenerMap::add(const AtomString& eventType, Ref&& listener, const RegisteredEventListener::Options& options)
 {
 Locker locker { m_lock };
-
-assertNoActiveIterators();
 
 if (auto* listeners = find(eventType)) {
 if (findListener(*listeners, listener, options.capture) != notFound)
@@ -158,8 +143,6 @@
 bool EventListenerMap::remove(const AtomString& eventType, EventListener& listener, bool useCapture)
 {
 Locker locker { m_lock };
-
-assertNoActiveIterators();
 
 for (unsigned i = 0; i < m_entries.size(); ++i) {
 if (m_entries[i].first == eventType) {
@@ -198,8 +181,6 @@
 void EventListenerMap::removeFirstEventListenerCreatedFromMarkup(const AtomString& 

[webkit-changes] [291508] trunk/Source/WebCore

2022-03-18 Thread cdumez
Title: [291508] trunk/Source/WebCore








Revision 291508
Author cdu...@apple.com
Date 2022-03-18 17:19:29 -0700 (Fri, 18 Mar 2022)


Log Message
Optimize AtomHTMLToken::initializeAttributes()
https://bugs.webkit.org/show_bug.cgi?id=238074

Reviewed by Geoffrey Garen.

Use a HashSet to find duplicate attributes instead of doing a linear search.
This is a confirmed 1.2% progression on Speedometer on iMac20,1 via A/B bots.

* html/parser/AtomHTMLToken.h:
(WebCore::AtomHTMLToken::initializeAttributes):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/parser/AtomHTMLToken.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291507 => 291508)

--- trunk/Source/WebCore/ChangeLog	2022-03-19 00:00:12 UTC (rev 291507)
+++ trunk/Source/WebCore/ChangeLog	2022-03-19 00:19:29 UTC (rev 291508)
@@ -1,3 +1,16 @@
+2022-03-18  Chris Dumez  
+
+Optimize AtomHTMLToken::initializeAttributes()
+https://bugs.webkit.org/show_bug.cgi?id=238074
+
+Reviewed by Geoffrey Garen.
+
+Use a HashSet to find duplicate attributes instead of doing a linear search.
+This is a confirmed 1.2% progression on Speedometer on iMac20,1 via A/B bots.
+
+* html/parser/AtomHTMLToken.h:
+(WebCore::AtomHTMLToken::initializeAttributes):
+
 2022-03-18  Jonathan Bedard  
 
 [iOS 15.4] Fix unused variables


Modified: trunk/Source/WebCore/html/parser/AtomHTMLToken.h (291507 => 291508)

--- trunk/Source/WebCore/html/parser/AtomHTMLToken.h	2022-03-19 00:00:12 UTC (rev 291507)
+++ trunk/Source/WebCore/html/parser/AtomHTMLToken.h	2022-03-19 00:19:29 UTC (rev 291508)
@@ -204,6 +204,8 @@
 if (!size)
 return;
 
+HashSet addedAttributes;
+addedAttributes.reserveInitialCapacity(size);
 m_attributes.reserveInitialCapacity(size);
 for (auto& attribute : attributes) {
 if (attribute.name.isEmpty())
@@ -211,8 +213,7 @@
 
 auto qualifiedName = HTMLNameCache::makeAttributeQualifiedName(attribute.name);
 
-// FIXME: This is N^2 for the number of attributes.
-if (!hasAttribute(m_attributes, qualifiedName.localName()))
+if (addedAttributes.add(qualifiedName.localName()).isNewEntry)
 m_attributes.uncheckedAppend(Attribute(WTFMove(qualifiedName), HTMLNameCache::makeAttributeValue(attribute.value)));
 else
 m_hasDuplicateAttribute = HasDuplicateAttribute::Yes;






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291496] trunk/Source

2022-03-18 Thread cdumez
Title: [291496] trunk/Source








Revision 291496
Author cdu...@apple.com
Date 2022-03-18 14:53:45 -0700 (Fri, 18 Mar 2022)


Log Message
Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
https://bugs.webkit.org/show_bug.cgi?id=237933


Reviewed by Geoffrey Garen.

Source/WebCore:

Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
for performance reasons since those are synchronous, potentially slow and called on the UIProcess
main thread.

Instead, rely on the fact that the locationManagerDidChangeAuthorization always gets called
asynchronously right after constructing the CLLocationManager with the actual authorization.
This simplifies our logic a bit too.

We now only call [CLLocationManager requestWhenInUseAuthorization] when locationManagerDidChangeAuthorization
gets called with kCLAuthorizationStatusNotDetermined asynchronously after construction.
If locationManagerDidChangeAuthorization gets called with an authorized enum value, we
call [CLLocationManager startUpdatingLocation] then (if the client is interested in locations, and not
merely in the authorization).

* platform/cocoa/CoreLocationGeolocationProvider.h:
* platform/cocoa/CoreLocationGeolocationProvider.mm:
(-[WebCLLocationManager initWithWebsiteIdentifier:client:mode:]):
(-[WebCLLocationManager locationManagerDidChangeAuthorization:]):
(WebCore::CoreLocationGeolocationProvider::CoreLocationGeolocationProvider):
(isAuthorizationGranted): Deleted.
(-[WebCLLocationManager initWithWebsiteIdentifier:client:]): Deleted.
(-[WebCLLocationManager start]): Deleted.
(-[WebCLLocationManager requestGeolocationAuthorization]): Deleted.
(WebCore::CoreLocationGeolocationProvider::start): Deleted.
(WebCore::CoreLocationGeolocationProvider::stop): Deleted.

Source/WebKit:

Minor changes to reflect API changes for our CoreLocation location manager.

* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::providerStartUpdating):
(WebKit::WebGeolocationManagerProxy::providerStopUpdating):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/platform/cocoa/CoreLocationGeolocationProvider.h
trunk/Source/WebCore/platform/cocoa/CoreLocationGeolocationProvider.mm
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebGeolocationManagerProxy.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291495 => 291496)

--- trunk/Source/WebCore/ChangeLog	2022-03-18 20:09:08 UTC (rev 291495)
+++ trunk/Source/WebCore/ChangeLog	2022-03-18 21:53:45 UTC (rev 291496)
@@ -1,5 +1,39 @@
 2022-03-18  Chris Dumez  
 
+Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
+https://bugs.webkit.org/show_bug.cgi?id=237933
+
+
+Reviewed by Geoffrey Garen.
+
+Avoid calls to [CLLocationManager authorizationStatus] & [CLLocationManager locationServicesEnabled]
+for performance reasons since those are synchronous, potentially slow and called on the UIProcess
+main thread.
+
+Instead, rely on the fact that the locationManagerDidChangeAuthorization always gets called
+asynchronously right after constructing the CLLocationManager with the actual authorization.
+This simplifies our logic a bit too.
+
+We now only call [CLLocationManager requestWhenInUseAuthorization] when locationManagerDidChangeAuthorization
+gets called with kCLAuthorizationStatusNotDetermined asynchronously after construction.
+If locationManagerDidChangeAuthorization gets called with an authorized enum value, we
+call [CLLocationManager startUpdatingLocation] then (if the client is interested in locations, and not
+merely in the authorization).
+
+* platform/cocoa/CoreLocationGeolocationProvider.h:
+* platform/cocoa/CoreLocationGeolocationProvider.mm:
+(-[WebCLLocationManager initWithWebsiteIdentifier:client:mode:]):
+(-[WebCLLocationManager locationManagerDidChangeAuthorization:]):
+(WebCore::CoreLocationGeolocationProvider::CoreLocationGeolocationProvider):
+(isAuthorizationGranted): Deleted.
+(-[WebCLLocationManager initWithWebsiteIdentifier:client:]): Deleted.
+(-[WebCLLocationManager start]): Deleted.
+(-[WebCLLocationManager requestGeolocationAuthorization]): Deleted.
+(WebCore::CoreLocationGeolocationProvider::start): Deleted.
+(WebCore::CoreLocationGeolocationProvider::stop): Deleted.
+
+2022-03-18  Chris Dumez  
+
 Avoid extra pointer dereference in EventListenerMap::m_entries
 https://bugs.webkit.org/show_bug.cgi?id=238075
 


Modified: trunk/Source/WebCore/platform/cocoa/CoreLocationGeolocationProvider.h (291495 => 291496)

--- trunk/Source/WebCore/platform/cocoa/CoreLocationGeolocationProvider.h	2022-03-18 20:09:08 UTC (rev 291495)
+++ 

[webkit-changes] [291495] trunk/Source/WebCore

2022-03-18 Thread cdumez
Title: [291495] trunk/Source/WebCore








Revision 291495
Author cdu...@apple.com
Date 2022-03-18 13:09:08 -0700 (Fri, 18 Mar 2022)


Log Message
Avoid extra pointer dereference in EventListenerMap::m_entries
https://bugs.webkit.org/show_bug.cgi?id=238075

Reviewed by Geoffrey Garen.

This is a confirmed 0.5-0.8% progression on Speedometer according to A/B
bots.

* dom/EventListenerMap.cpp:
(WebCore::EventListenerMap::clear):
(WebCore::EventListenerMap::add):
(WebCore::EventListenerMap::remove):
(WebCore::EventListenerMap::find):
(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
(WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
(WebCore::EventListenerIterator::nextListener):
(WebCore::EventListenerMap::find const): Deleted.
* dom/EventListenerMap.h:
(WebCore::EventListenerMap::find const):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/EventListenerMap.cpp
trunk/Source/WebCore/dom/EventListenerMap.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291494 => 291495)

--- trunk/Source/WebCore/ChangeLog	2022-03-18 19:42:42 UTC (rev 291494)
+++ trunk/Source/WebCore/ChangeLog	2022-03-18 20:09:08 UTC (rev 291495)
@@ -1,3 +1,25 @@
+2022-03-18  Chris Dumez  
+
+Avoid extra pointer dereference in EventListenerMap::m_entries
+https://bugs.webkit.org/show_bug.cgi?id=238075
+
+Reviewed by Geoffrey Garen.
+
+This is a confirmed 0.5-0.8% progression on Speedometer according to A/B
+bots.
+
+* dom/EventListenerMap.cpp:
+(WebCore::EventListenerMap::clear):
+(WebCore::EventListenerMap::add):
+(WebCore::EventListenerMap::remove):
+(WebCore::EventListenerMap::find):
+(WebCore::EventListenerMap::removeFirstEventListenerCreatedFromMarkup):
+(WebCore::EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget):
+(WebCore::EventListenerIterator::nextListener):
+(WebCore::EventListenerMap::find const): Deleted.
+* dom/EventListenerMap.h:
+(WebCore::EventListenerMap::find const):
+
 2022-03-18  Alex Christensen  
 
 Keep a strong reference to session in [WebCoreNSURLSessionDataTask _restart]


Modified: trunk/Source/WebCore/dom/EventListenerMap.cpp (291494 => 291495)

--- trunk/Source/WebCore/dom/EventListenerMap.cpp	2022-03-18 19:42:42 UTC (rev 291494)
+++ trunk/Source/WebCore/dom/EventListenerMap.cpp	2022-03-18 20:09:08 UTC (rev 291495)
@@ -88,7 +88,7 @@
 assertNoActiveIterators();
 
 for (auto& entry : m_entries) {
-for (auto& listener : *entry.second)
+for (auto& listener : entry.second)
 listener->markAsRemoved();
 }
 
@@ -140,9 +140,7 @@
 return true;
 }
 
-auto listeners = makeUnique();
-listeners->uncheckedAppend(RegisteredEventListener::create(WTFMove(listener), options));
-m_entries.append({ eventType, WTFMove(listeners) });
+m_entries.append({ eventType, EventListenerVector { RegisteredEventListener::create(WTFMove(listener), options) } });
 return true;
 }
 
@@ -165,8 +163,8 @@
 
 for (unsigned i = 0; i < m_entries.size(); ++i) {
 if (m_entries[i].first == eventType) {
-bool wasRemoved = removeListenerFromVector(*m_entries[i].second, listener, useCapture);
-if (m_entries[i].second->isEmpty())
+bool wasRemoved = removeListenerFromVector(m_entries[i].second, listener, useCapture);
+if (m_entries[i].second.isEmpty())
 m_entries.remove(i);
 return wasRemoved;
 }
@@ -175,11 +173,11 @@
 return false;
 }
 
-EventListenerVector* EventListenerMap::find(const AtomString& eventType) const
+EventListenerVector* EventListenerMap::find(const AtomString& eventType)
 {
 for (auto& entry : m_entries) {
 if (entry.first == eventType)
-return entry.second.get();
+return 
 }
 
 return nullptr;
@@ -205,8 +203,8 @@
 
 for (unsigned i = 0; i < m_entries.size(); ++i) {
 if (m_entries[i].first == eventType) {
-removeFirstListenerCreatedFromMarkup(*m_entries[i].second);
-if (m_entries[i].second->isEmpty())
+removeFirstListenerCreatedFromMarkup(m_entries[i].second);
+if (m_entries[i].second.isEmpty())
 m_entries.remove(i);
 return;
 }
@@ -226,7 +224,7 @@
 void EventListenerMap::copyEventListenersNotCreatedFromMarkupToTarget(EventTarget* target)
 {
 for (auto& entry : m_entries)
-copyListenersNotCreatedFromMarkupToTarget(entry.first, *entry.second, target);
+copyListenersNotCreatedFromMarkupToTarget(entry.first, entry.second, target);
 }
 
 EventListenerIterator::EventListenerIterator(EventTarget* target)
@@ -267,7 +265,7 @@
 return nullptr;
 
 for (; m_entryIndex < m_map->m_entries.size(); ++m_entryIndex) {
-EventListenerVector& listeners = *m_map->m_entries[m_entryIndex].second;

[webkit-changes] [291446] trunk/Source/WebCore

2022-03-17 Thread cdumez
Title: [291446] trunk/Source/WebCore








Revision 291446
Author cdu...@apple.com
Date 2022-03-17 15:07:39 -0700 (Thu, 17 Mar 2022)


Log Message
Microsoft Teams fails to launch from Safari
https://bugs.webkit.org/show_bug.cgi?id=238045


Reviewed by Geoffrey Garen.

Extend MS Teams quirk to teams.microsoft.com, not just teams.live.com.

* page/Quirks.cpp:
(WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/Quirks.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291445 => 291446)

--- trunk/Source/WebCore/ChangeLog	2022-03-17 21:57:54 UTC (rev 291445)
+++ trunk/Source/WebCore/ChangeLog	2022-03-17 22:07:39 UTC (rev 291446)
@@ -1,3 +1,16 @@
+2022-03-17  Chris Dumez  
+
+Microsoft Teams fails to launch from Safari
+https://bugs.webkit.org/show_bug.cgi?id=238045
+
+
+Reviewed by Geoffrey Garen.
+
+Extend MS Teams quirk to teams.microsoft.com, not just teams.live.com.
+
+* page/Quirks.cpp:
+(WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
+
 2022-03-17  Alejandro G. Castro  
 
 [GTK][WPE] m_compositorThread ASSERT in TextureMapper classes can just be used in debug mode


Modified: trunk/Source/WebCore/page/Quirks.cpp (291445 => 291446)

--- trunk/Source/WebCore/page/Quirks.cpp	2022-03-17 21:57:54 UTC (rev 291445)
+++ trunk/Source/WebCore/page/Quirks.cpp	2022-03-17 22:07:39 UTC (rev 291446)
@@ -1422,7 +1422,7 @@
 
 bool Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture(StringView protocol, const SecurityOriginData& requesterOrigin)
 {
-return protocol == "msteams" && requesterOrigin.host == "teams.live.com";
+return protocol == "msteams" && (requesterOrigin.host == "teams.live.com" || requesterOrigin.host == "teams.microsoft.com");
 }
 
 #if ENABLE(IMAGE_ANALYSIS)






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291416] trunk/Source/WebCore

2022-03-17 Thread cdumez
Title: [291416] trunk/Source/WebCore








Revision 291416
Author cdu...@apple.com
Date 2022-03-17 09:54:03 -0700 (Thu, 17 Mar 2022)


Log Message
Stop returning NodeVector from functions
https://bugs.webkit.org/show_bug.cgi?id=237988

Reviewed by Darin Adler.

Stop returning NodeVector from functions and use a out-parameter instead. While this doesn't look
as modern, this is actually more efficient. This is because NodeVector has a fairly large inline
buffer and is thus not that cheap to "move".

This was causing functions like `ContainerNode::parserAppendChild(Node&)` to spend unnecessary
time under:
`VectorBuffer>, 11, FastMalloc>::swap(VectorBuffer>, 11, FastMalloc>&, unsigned long, unsigned long)`

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
(WebCore::executeNodeInsertionWithScriptAssertion):
(WebCore::ContainerNode::removeSelfOrChildNodesForInsertion):
(WebCore::ContainerNode::takeAllChildrenFrom):
(WebCore::ContainerNode::replaceAll):
(WebCore::ContainerNode::removeChildren):
(WebCore::ContainerNode::replaceChildren):
* dom/ContainerNode.h:
(WebCore::collectChildNodes):
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
* dom/ContainerNodeAlgorithms.h:
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::insertAdjacentHTML):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/ContainerNode.cpp
trunk/Source/WebCore/dom/ContainerNode.h
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.cpp
trunk/Source/WebCore/dom/ContainerNodeAlgorithms.h
trunk/Source/WebCore/dom/Element.cpp
trunk/Source/WebCore/editing/ApplyStyleCommand.cpp
trunk/Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291415 => 291416)

--- trunk/Source/WebCore/ChangeLog	2022-03-17 16:52:37 UTC (rev 291415)
+++ trunk/Source/WebCore/ChangeLog	2022-03-17 16:54:03 UTC (rev 291416)
@@ -1,3 +1,39 @@
+2022-03-17  Chris Dumez  
+
+Stop returning NodeVector from functions
+https://bugs.webkit.org/show_bug.cgi?id=237988
+
+Reviewed by Darin Adler.
+
+Stop returning NodeVector from functions and use a out-parameter instead. While this doesn't look
+as modern, this is actually more efficient. This is because NodeVector has a fairly large inline
+buffer and is thus not that cheap to "move".
+
+This was causing functions like `ContainerNode::parserAppendChild(Node&)` to spend unnecessary
+time under:
+`VectorBuffer>, 11, FastMalloc>::swap(VectorBuffer>, 11, FastMalloc>&, unsigned long, unsigned long)`
+
+* dom/ContainerNode.cpp:
+(WebCore::ContainerNode::removeAllChildrenWithScriptAssertion):
+(WebCore::executeNodeInsertionWithScriptAssertion):
+(WebCore::ContainerNode::removeSelfOrChildNodesForInsertion):
+(WebCore::ContainerNode::takeAllChildrenFrom):
+(WebCore::ContainerNode::replaceAll):
+(WebCore::ContainerNode::removeChildren):
+(WebCore::ContainerNode::replaceChildren):
+* dom/ContainerNode.h:
+(WebCore::collectChildNodes):
+* dom/ContainerNodeAlgorithms.cpp:
+(WebCore::notifyChildNodeInserted):
+* dom/ContainerNodeAlgorithms.h:
+* dom/Element.cpp:
+(WebCore::Element::addShadowRoot):
+(WebCore::Element::insertAdjacentHTML):
+* editing/ApplyStyleCommand.cpp:
+(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
+* editing/ReplaceNodeWithSpanCommand.cpp:
+(WebCore::swapInNodePreservingAttributesAndChildren):
+
 2022-03-17  Ben Nham  
 
 Only show notification permission prompt on user gesture


Modified: trunk/Source/WebCore/dom/ContainerNode.cpp (291415 => 291416)

--- trunk/Source/WebCore/dom/ContainerNode.cpp	2022-03-17 16:52:37 UTC (rev 291415)
+++ trunk/Source/WebCore/dom/ContainerNode.cpp	2022-03-17 16:54:03 UTC (rev 291416)
@@ -79,9 +79,10 @@
 ScriptDisallowedScope::EventAllowedScope* ScriptDisallowedScope::EventAllowedScope::s_currentScope = nullptr;
 #endif
 
-ALWAYS_INLINE NodeVector ContainerNode::removeAllChildrenWithScriptAssertion(ChildChange::Source source, DeferChildrenChanged deferChildrenChanged)
+ALWAYS_INLINE void ContainerNode::removeAllChildrenWithScriptAssertion(ChildChange::Source source, NodeVector& children, DeferChildrenChanged deferChildrenChanged)
 {
-auto children = collectChildNodes(*this);
+ASSERT(children.isEmpty());
+collectChildNodes(*this, children);
 
 if (UNLIKELY(isDocumentFragmentForInnerOuterHTML())) {
 ScriptDisallowedScope::InMainThread scriptDisallowedScope;
@@ -90,7 +91,7 @@
 while (RefPtr child = m_firstChild)
 removeBetween(nullptr, child->nextSibling(), *child);
 

[webkit-changes] [291381] trunk/Source/WebKit

2022-03-16 Thread cdumez
Title: [291381] trunk/Source/WebKit








Revision 291381
Author cdu...@apple.com
Date 2022-03-16 17:55:31 -0700 (Wed, 16 Mar 2022)


Log Message
Don't build WebPageProxy::writePromisedAttachmentToPasteboard() and its IPC on macOS
https://bugs.webkit.org/show_bug.cgi?id=237986

Reviewed by Brent Fulgham.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::writePromisedAttachmentToPasteboard):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/PageClient.h
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
trunk/Source/WebKit/UIProcess/WebPageProxy.h
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in




Diff

Modified: trunk/Source/WebKit/ChangeLog (291380 => 291381)

--- trunk/Source/WebKit/ChangeLog	2022-03-17 00:39:04 UTC (rev 291380)
+++ trunk/Source/WebKit/ChangeLog	2022-03-17 00:55:31 UTC (rev 291381)
@@ -1,3 +1,15 @@
+2022-03-16  Chris Dumez  
+
+Don't build WebPageProxy::writePromisedAttachmentToPasteboard() and its IPC on macOS
+https://bugs.webkit.org/show_bug.cgi?id=237986
+
+Reviewed by Brent Fulgham.
+
+* UIProcess/WebPageProxy.cpp:
+(WebKit::WebPageProxy::writePromisedAttachmentToPasteboard):
+* UIProcess/WebPageProxy.h:
+* UIProcess/WebPageProxy.messages.in:
+
 2022-03-16  Brent Fulgham  
 
 CoreIPC Hardening: Add user gesture check when saving images


Modified: trunk/Source/WebKit/UIProcess/PageClient.h (291380 => 291381)

--- trunk/Source/WebKit/UIProcess/PageClient.h	2022-03-17 00:39:04 UTC (rev 291380)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2022-03-17 00:55:31 UTC (rev 291381)
@@ -619,7 +619,9 @@
 virtual void didInsertAttachment(API::Attachment&, const String& source) { }
 virtual void didRemoveAttachment(API::Attachment&) { }
 virtual void didInvalidateDataForAttachment(API::Attachment&) { }
+#if PLATFORM(IOS_FAMILY)
 virtual void writePromisedAttachmentToPasteboard(WebCore::PromisedAttachmentInfo&&) { }
+#endif
 #if PLATFORM(COCOA)
 virtual NSFileWrapper *allocFileWrapperInstance() const { return nullptr; }
 virtual NSSet *serializableFileWrapperClasses() const { return nullptr; }


Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (291380 => 291381)

--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-03-17 00:39:04 UTC (rev 291380)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-03-17 00:55:31 UTC (rev 291381)
@@ -10193,17 +10193,14 @@
 
 #if ENABLE(ATTACHMENT_ELEMENT)
 
+#if PLATFORM(IOS_FAMILY)
 void WebPageProxy::writePromisedAttachmentToPasteboard(WebCore::PromisedAttachmentInfo&& info, const String& authorizationToken)
 {
-#if PLATFORM(IOS_FAMILY)
 MESSAGE_CHECK(m_process, isValidPerformActionOnElementAuthorizationToken(authorizationToken));
 
 pageClient().writePromisedAttachmentToPasteboard(WTFMove(info));
-#else
-UNUSED_PARAM(info);
-UNUSED_PARAM(authorizationToken);
+}
 #endif
-}
 
 void WebPageProxy::requestAttachmentIcon(const String& identifier, const String& contentType, const String& fileName, const String& title, const FloatSize& requestedSize)
 {


Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (291380 => 291381)

--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2022-03-17 00:39:04 UTC (rev 291380)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2022-03-17 00:55:31 UTC (rev 291381)
@@ -2542,8 +2542,9 @@
 Ref ensureAttachment(const String& identifier);
 void invalidateAllAttachments();
 
-
+#if PLATFORM(IOS_FAMILY)
 void writePromisedAttachmentToPasteboard(WebCore::PromisedAttachmentInfo&&, const String& authorizationToken);
+#endif
 
 void requestAttachmentIcon(const String& identifier, const String& type, const String& path, const String& title, const WebCore::FloatSize&);
 


Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (291380 => 291381)

--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2022-03-17 00:39:04 UTC (rev 291380)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in	2022-03-17 00:55:31 UTC (rev 291381)
@@ -525,7 +525,9 @@
 DidInsertAttachmentWithIdentifier(String identifier, String source, bool hasEnclosingImage)
 DidRemoveAttachmentWithIdentifier(String identifier)
 SerializedAttachmentDataForIdentifiers(Vector identifiers) -> (Vector seralizedData) Synchronous
+#if PLATFORM(IOS_FAMILY)
 WritePromisedAttachmentToPasteboard(struct WebCore::PromisedAttachmentInfo info, String authorizationToken)
+#endif
 RequestAttachmentIcon(String identifier, String contentType, String path, String title, WebCore::FloatSize size)
 #endif
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291320] trunk/Source

2022-03-15 Thread cdumez
Title: [291320] trunk/Source








Revision 291320
Author cdu...@apple.com
Date 2022-03-15 16:16:02 -0700 (Tue, 15 Mar 2022)


Log Message
Make it clearer in the loading logging when it is for the main frame or not
https://bugs.webkit.org/show_bug.cgi?id=237913

Reviewed by Alex Christensen.

Source/WebCore:

* dom/Document.cpp:
* loader/DocumentLoader.cpp:
* loader/FrameLoader.cpp:
* page/FrameView.cpp:

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::didPerformClientRedirectShared):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/loader/DocumentLoader.cpp
trunk/Source/WebCore/loader/FrameLoader.cpp
trunk/Source/WebCore/page/FrameView.cpp
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291319 => 291320)

--- trunk/Source/WebCore/ChangeLog	2022-03-15 22:22:25 UTC (rev 291319)
+++ trunk/Source/WebCore/ChangeLog	2022-03-15 23:16:02 UTC (rev 291320)
@@ -1,3 +1,15 @@
+2022-03-15  Chris Dumez  
+
+Make it clearer in the loading logging when it is for the main frame or not
+https://bugs.webkit.org/show_bug.cgi?id=237913
+
+Reviewed by Alex Christensen.
+
+* dom/Document.cpp:
+* loader/DocumentLoader.cpp:
+* loader/FrameLoader.cpp:
+* page/FrameView.cpp:
+
 2022-03-15  Commit Queue  
 
 Unreviewed, reverting r291282.


Modified: trunk/Source/WebCore/dom/Document.cpp (291319 => 291320)

--- trunk/Source/WebCore/dom/Document.cpp	2022-03-15 22:22:25 UTC (rev 291319)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-03-15 23:16:02 UTC (rev 291320)
@@ -355,8 +355,8 @@
 #include "HTMLVideoElement.h"
 #endif
 
-#define DOCUMENT_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", main=%d] Document::" fmt, this, valueOrDefault(pageID()).toUInt64(), valueOrDefault(frameID()).toUInt64(), this == (), ##__VA_ARGS__)
-#define DOCUMENT_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", main=%d] Document::" fmt, this, valueOrDefault(pageID()).toUInt64(), valueOrDefault(frameID()).toUInt64(), this == (), ##__VA_ARGS__)
+#define DOCUMENT_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", isMainFrame=%d] Document::" fmt, this, valueOrDefault(pageID()).toUInt64(), valueOrDefault(frameID()).toUInt64(), this == (), ##__VA_ARGS__)
+#define DOCUMENT_RELEASE_LOG_ERROR(channel, fmt, ...) RELEASE_LOG_ERROR(channel, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", isMainFrame=%d] Document::" fmt, this, valueOrDefault(pageID()).toUInt64(), valueOrDefault(frameID()).toUInt64(), this == (), ##__VA_ARGS__)
 
 namespace WebCore {
 


Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (291319 => 291320)

--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2022-03-15 22:22:25 UTC (rev 291319)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2022-03-15 23:16:02 UTC (rev 291320)
@@ -130,7 +130,7 @@
 #define PAGE_ID ((m_frame ? valueOrDefault(m_frame->pageID()) : PageIdentifier()).toUInt64())
 #define FRAME_ID ((m_frame ? valueOrDefault(m_frame->frameID()) : FrameIdentifier()).toUInt64())
 #define IS_MAIN_FRAME (m_frame ? m_frame->isMainFrame() : false)
-#define DOCUMENTLOADER_RELEASE_LOG(fmt, ...) RELEASE_LOG(Network, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", main=%d] DocumentLoader::" fmt, this, PAGE_ID, FRAME_ID, IS_MAIN_FRAME, ##__VA_ARGS__)
+#define DOCUMENTLOADER_RELEASE_LOG(fmt, ...) RELEASE_LOG(Network, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", isMainFrame=%d] DocumentLoader::" fmt, this, PAGE_ID, FRAME_ID, IS_MAIN_FRAME, ##__VA_ARGS__)
 
 #if USE(APPLE_INTERNAL_SDK)
 #include 


Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (291319 => 291320)

--- trunk/Source/WebCore/loader/FrameLoader.cpp	2022-03-15 22:22:25 UTC (rev 291319)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp	2022-03-15 23:16:02 UTC (rev 291320)
@@ -155,8 +155,8 @@
 
 #define PAGE_ID (valueOrDefault(pageID()).toUInt64())
 #define FRAME_ID (valueOrDefault(frameID()).toUInt64())
-#define FRAMELOADER_RELEASE_LOG(channel, fmt, ...) RELEASE_LOG(channel, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 ", 

[webkit-changes] [291311] trunk/Source/WebKit

2022-03-15 Thread cdumez
Title: [291311] trunk/Source/WebKit








Revision 291311
Author cdu...@apple.com
Date 2022-03-15 13:45:47 -0700 (Tue, 15 Mar 2022)


Log Message
Fix logging in GPUProcessProxy::didCreateContextForVisibilityPropagation()
https://bugs.webkit.org/show_bug.cgi?id=237907

Reviewed by Simon Fraser.

LayerHostingContextID is a uint32_t. The current printing ends up logging negative values:
`GPUProcessProxy::didCreateContextForVisibilityPropagation: webPageProxyID: 7, pagePID: 79, contextID: -2041854761`

* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::didCreateContextForVisibilityPropagation):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (291310 => 291311)

--- trunk/Source/WebKit/ChangeLog	2022-03-15 20:30:16 UTC (rev 291310)
+++ trunk/Source/WebKit/ChangeLog	2022-03-15 20:45:47 UTC (rev 291311)
@@ -1,3 +1,16 @@
+2022-03-15  Chris Dumez  
+
+Fix logging in GPUProcessProxy::didCreateContextForVisibilityPropagation()
+https://bugs.webkit.org/show_bug.cgi?id=237907
+
+Reviewed by Simon Fraser.
+
+LayerHostingContextID is a uint32_t. The current printing ends up logging negative values:
+`GPUProcessProxy::didCreateContextForVisibilityPropagation: webPageProxyID: 7, pagePID: 79, contextID: -2041854761`
+
+* UIProcess/GPU/GPUProcessProxy.cpp:
+(WebKit::GPUProcessProxy::didCreateContextForVisibilityPropagation):
+
 2022-03-15  Aditya Keerthi  
 
 [iOS] Indefinite hang when printing using a UIPrintPageRenderer


Modified: trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp (291310 => 291311)

--- trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp	2022-03-15 20:30:16 UTC (rev 291310)
+++ trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp	2022-03-15 20:45:47 UTC (rev 291311)
@@ -590,7 +590,7 @@
 #if HAVE(VISIBILITY_PROPAGATION_VIEW)
 void GPUProcessProxy::didCreateContextForVisibilityPropagation(WebPageProxyIdentifier webPageProxyID, WebCore::PageIdentifier pageID, LayerHostingContextID contextID)
 {
-RELEASE_LOG(Process, "GPUProcessProxy::didCreateContextForVisibilityPropagation: webPageProxyID: %" PRIu64 ", pagePID: %" PRIu64 ", contextID: %d", webPageProxyID.toUInt64(), pageID.toUInt64(), contextID);
+RELEASE_LOG(Process, "GPUProcessProxy::didCreateContextForVisibilityPropagation: webPageProxyID: %" PRIu64 ", pagePID: %" PRIu64 ", contextID: %u", webPageProxyID.toUInt64(), pageID.toUInt64(), contextID);
 auto* page = WebProcessProxy::webPage(webPageProxyID);
 if (!page) {
 RELEASE_LOG(Process, "GPUProcessProxy::didCreateContextForVisibilityPropagation() No WebPageProxy with this identifier");






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291306] trunk/Source/WebCore

2022-03-15 Thread cdumez
Title: [291306] trunk/Source/WebCore








Revision 291306
Author cdu...@apple.com
Date 2022-03-15 11:53:28 -0700 (Tue, 15 Mar 2022)


Log Message
Fix SQL statement in ApplicationCacheStorage::verifySchemaVersion()
https://bugs.webkit.org/show_bug.cgi?id=237905

Reviewed by Geoffrey Garen.

This was leading to the following logging:
`SQLiteDatabase::prepareStatement: Failed to prepare statement PRAGMA user_version=%7`

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::verifySchemaVersion):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (291305 => 291306)

--- trunk/Source/WebCore/ChangeLog	2022-03-15 18:47:49 UTC (rev 291305)
+++ trunk/Source/WebCore/ChangeLog	2022-03-15 18:53:28 UTC (rev 291306)
@@ -1,3 +1,16 @@
+2022-03-15  Chris Dumez  
+
+Fix SQL statement in ApplicationCacheStorage::verifySchemaVersion()
+https://bugs.webkit.org/show_bug.cgi?id=237905
+
+Reviewed by Geoffrey Garen.
+
+This was leading to the following logging:
+`SQLiteDatabase::prepareStatement: Failed to prepare statement PRAGMA user_version=%7`
+
+* loader/appcache/ApplicationCacheStorage.cpp:
+(WebCore::ApplicationCacheStorage::verifySchemaVersion):
+
 2022-03-15  Antti Koivisto  
 
 background-clip:text doesn't work with display:flex


Modified: trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp (291305 => 291306)

--- trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp	2022-03-15 18:47:49 UTC (rev 291305)
+++ trunk/Source/WebCore/loader/appcache/ApplicationCacheStorage.cpp	2022-03-15 18:53:28 UTC (rev 291306)
@@ -567,7 +567,7 @@
 SQLiteTransaction setDatabaseVersion(m_database);
 setDatabaseVersion.begin();
 
-auto statement = m_database.prepareStatementSlow(makeString("PRAGMA user_version=%", schemaVersion));
+auto statement = m_database.prepareStatementSlow(makeString("PRAGMA user_version=", schemaVersion));
 if (!statement)
 return;
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291203] trunk/Source

2022-03-11 Thread cdumez
Title: [291203] trunk/Source








Revision 291203
Author cdu...@apple.com
Date 2022-03-11 18:33:04 -0800 (Fri, 11 Mar 2022)


Log Message
IPC thread's QOS should match the sending thread's QOS when calling sendSync()
https://bugs.webkit.org/show_bug.cgi?id=237800


Reviewed by Geoffrey Garen.

Source/WebKit:

IPC thread's QOS should match the sending thread's QOS when calling sendSync(), since it blocks the calling thread.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendSyncMessage):

Source/WTF:

Add function to get the QoS of the current thread.

* wtf/Threading.cpp:
(WTF::toQOS):
(WTF::Thread::currentThreadQOS):
* wtf/Threading.h:

Modified Paths

trunk/Source/WTF/ChangeLog
trunk/Source/WTF/wtf/Threading.cpp
trunk/Source/WTF/wtf/Threading.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Platform/IPC/Connection.cpp




Diff

Modified: trunk/Source/WTF/ChangeLog (291202 => 291203)

--- trunk/Source/WTF/ChangeLog	2022-03-12 02:23:42 UTC (rev 291202)
+++ trunk/Source/WTF/ChangeLog	2022-03-12 02:33:04 UTC (rev 291203)
@@ -1,3 +1,18 @@
+2022-03-11  Chris Dumez  
+
+IPC thread's QOS should match the sending thread's QOS when calling sendSync()
+https://bugs.webkit.org/show_bug.cgi?id=237800
+
+
+Reviewed by Geoffrey Garen.
+
+Add function to get the QoS of the current thread.
+
+* wtf/Threading.cpp:
+(WTF::toQOS):
+(WTF::Thread::currentThreadQOS):
+* wtf/Threading.h:
+
 2022-03-11  Elliott Williams  
 
 [Xcode] "Nest Headers" script phases copy headers incorrectly on Catalyst


Modified: trunk/Source/WTF/wtf/Threading.cpp (291202 => 291203)

--- trunk/Source/WTF/wtf/Threading.cpp	2022-03-12 02:23:42 UTC (rev 291202)
+++ trunk/Source/WTF/wtf/Threading.cpp	2022-03-12 02:33:04 UTC (rev 291203)
@@ -401,6 +401,38 @@
 }
 
 #if HAVE(QOS_CLASSES)
+static Thread::QOS toQOS(qos_class_t qosClass)
+{
+switch (qosClass) {
+case QOS_CLASS_USER_INTERACTIVE:
+return Thread::QOS::UserInteractive;
+case QOS_CLASS_USER_INITIATED:
+return Thread::QOS::UserInitiated;
+case QOS_CLASS_UTILITY:
+return Thread::QOS::Utility;
+case QOS_CLASS_BACKGROUND:
+return Thread::QOS::Background;
+case QOS_CLASS_UNSPECIFIED:
+case QOS_CLASS_DEFAULT:
+default:
+return Thread::QOS::Default;
+}
+}
+#endif
+
+auto Thread::currentThreadQOS() -> QOS
+{
+#if HAVE(QOS_CLASSES)
+qos_class_t qos = QOS_CLASS_DEFAULT;
+int relativePriority;
+pthread_get_qos_class_np(pthread_self(), , );
+return toQOS(qos);
+#else
+return QOS::Default;
+#endif
+}
+
+#if HAVE(QOS_CLASSES)
 static qos_class_t globalMaxQOSclass { QOS_CLASS_UNSPECIFIED };
 
 void Thread::setGlobalMaxQOSClass(qos_class_t maxClass)


Modified: trunk/Source/WTF/wtf/Threading.h (291202 => 291203)

--- trunk/Source/WTF/wtf/Threading.h	2022-03-12 02:23:42 UTC (rev 291202)
+++ trunk/Source/WTF/wtf/Threading.h	2022-03-12 02:33:04 UTC (rev 291203)
@@ -195,6 +195,7 @@
 // relativePriority is a value in the range [-15, 0] where a lower value indicates a lower priority.
 WTF_EXPORT_PRIVATE static void setCurrentThreadIsUserInteractive(int relativePriority = 0);
 WTF_EXPORT_PRIVATE static void setCurrentThreadIsUserInitiated(int relativePriority = 0);
+WTF_EXPORT_PRIVATE static QOS currentThreadQOS();
 
 #if HAVE(QOS_CLASSES)
 WTF_EXPORT_PRIVATE static void setGlobalMaxQOSClass(qos_class_t);


Modified: trunk/Source/WebKit/ChangeLog (291202 => 291203)

--- trunk/Source/WebKit/ChangeLog	2022-03-12 02:23:42 UTC (rev 291202)
+++ trunk/Source/WebKit/ChangeLog	2022-03-12 02:33:04 UTC (rev 291203)
@@ -1,3 +1,16 @@
+2022-03-11  Chris Dumez  
+
+IPC thread's QOS should match the sending thread's QOS when calling sendSync()
+https://bugs.webkit.org/show_bug.cgi?id=237800
+
+
+Reviewed by Geoffrey Garen.
+
+IPC thread's QOS should match the sending thread's QOS when calling sendSync(), since it blocks the calling thread.
+
+* Platform/IPC/Connection.cpp:
+(IPC::Connection::sendSyncMessage):
+
 2022-03-11  Simon Fraser  
 
 Move RemoteLayerBackingStore flusher creation into RemoteLayerBackingStoreCollection


Modified: trunk/Source/WebKit/Platform/IPC/Connection.cpp (291202 => 291203)

--- trunk/Source/WebKit/Platform/IPC/Connection.cpp	2022-03-12 02:23:42 UTC (rev 291202)
+++ trunk/Source/WebKit/Platform/IPC/Connection.cpp	2022-03-12 02:33:04 UTC (rev 291203)
@@ -652,8 +652,11 @@
 encoder->setShouldMaintainOrderingWithAsyncMessages();
 
 auto messageName = encoder->messageName();
-sendMessage(WTFMove(encoder), sendOptions);
 
+// Since sync IPC is blocking the current thread, make sure we use the same priority for the IPC sending thread
+// as the current thread.
+sendMessage(WTFMove(encoder), sendOptions, Thread::currentThreadQOS());
+
 // Then wait for a reply. Waiting for a reply could involve dispatching incoming 

[webkit-changes] [291182] trunk/Source/WebKit

2022-03-11 Thread cdumez
Title: [291182] trunk/Source/WebKit








Revision 291182
Author cdu...@apple.com
Date 2022-03-11 12:22:03 -0800 (Fri, 11 Mar 2022)


Log Message
Delay responsiveness checks for the Network Process until it has finished initialization
https://bugs.webkit.org/show_bug.cgi?id=237782


Reviewed by Geoffrey Garen.

Delay responsiveness checks for the Network Process until it has finished initialization.
Network process initialization can be slow but we have evidence that it is not truly
hung since we see network process terminations right as the network process is initiating
the WebProcess connection later on.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/AuxiliaryProcessProxy.cpp:
(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
(WebKit::AuxiliaryProcessProxy::beginResponsivenessChecks):
(WebKit::AuxiliaryProcessProxy::startResponsivenessTimer):
* UIProcess/AuxiliaryProcessProxy.h:
* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::didFinishLaunching):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess):
* UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp:
(WebKit::WebAuthnProcessProxy::didFinishLaunching):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didFinishLaunching):

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp
trunk/Source/WebKit/NetworkProcess/NetworkProcess.h
trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.cpp
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
trunk/Source/WebKit/UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp




Diff

Modified: trunk/Source/WebKit/ChangeLog (291181 => 291182)

--- trunk/Source/WebKit/ChangeLog	2022-03-11 19:14:03 UTC (rev 291181)
+++ trunk/Source/WebKit/ChangeLog	2022-03-11 20:22:03 UTC (rev 291182)
@@ -1,3 +1,34 @@
+2022-03-11  Chris Dumez  
+
+Delay responsiveness checks for the Network Process until it has finished initialization
+https://bugs.webkit.org/show_bug.cgi?id=237782
+
+
+Reviewed by Geoffrey Garen.
+
+Delay responsiveness checks for the Network Process until it has finished initialization.
+Network process initialization can be slow but we have evidence that it is not truly
+hung since we see network process terminations right as the network process is initiating
+the WebProcess connection later on.
+
+* NetworkProcess/NetworkProcess.cpp:
+(WebKit::NetworkProcess::initializeNetworkProcess):
+* NetworkProcess/NetworkProcess.h:
+* NetworkProcess/NetworkProcess.messages.in:
+* UIProcess/AuxiliaryProcessProxy.cpp:
+(WebKit::AuxiliaryProcessProxy::didFinishLaunching):
+(WebKit::AuxiliaryProcessProxy::beginResponsivenessChecks):
+(WebKit::AuxiliaryProcessProxy::startResponsivenessTimer):
+* UIProcess/AuxiliaryProcessProxy.h:
+* UIProcess/GPU/GPUProcessProxy.cpp:
+(WebKit::GPUProcessProxy::didFinishLaunching):
+* UIProcess/Network/NetworkProcessProxy.cpp:
+(WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess):
+* UIProcess/WebAuthentication/WebAuthnProcessProxy.cpp:
+(WebKit::WebAuthnProcessProxy::didFinishLaunching):
+* UIProcess/WebProcessProxy.cpp:
+(WebKit::WebProcessProxy::didFinishLaunching):
+
 2022-03-11  Wenson Hsieh  
 
 [iOS] Add support for -[UITextInput removeEmojiAlternatives] on WKContentView


Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (291181 => 291182)

--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2022-03-11 19:14:03 UTC (rev 291181)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2022-03-11 20:22:03 UTC (rev 291182)
@@ -303,8 +303,10 @@
 });
 }
 
-void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& parameters)
+void NetworkProcess::initializeNetworkProcess(NetworkProcessCreationParameters&& parameters, CompletionHandler&& completionHandler)
 {
+CompletionHandlerCallingScope callCompletionHandler(WTFMove(completionHandler));
+
 applyProcessCreationParameters(parameters.auxiliaryProcessParameters);
 #if HAVE(SEC_KEY_PROXY)
 WTF::setProcessPrivileges({ ProcessPrivilege::CanAccessRawCookies });


Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (291181 => 291182)

--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2022-03-11 19:14:03 UTC (rev 291181)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2022-03-11 20:22:03 UTC (rev 291182)
@@ -409,7 +409,7 @@
 
 // Message Handlers
 bool 

[webkit-changes] [291141] trunk

2022-03-10 Thread cdumez
Title: [291141] trunk








Revision 291141
Author cdu...@apple.com
Date 2022-03-10 18:04:19 -0800 (Thu, 10 Mar 2022)


Log Message
Main document is leaking on haaretz.co.il due to lazy image loading
https://bugs.webkit.org/show_bug.cgi?id=237660


Reviewed by Geoffrey Garen.

Source/WebCore:

When an HTML image uses `loading=lazy`, ImageLoader::updateFromElement() may get
called twice. If the image is outside the viewport, the first time ImageLoader::updateFromElement()
is called, we'll request a CachedImage but we'll set m_lazyImageLoadState to LazyImageLoadState::Deferred
and not ask the CachedImage to load. Then, later on, if the HTML image approaches the viewport,
ImageLoader::loadDeferredImage() will get called. It will set m_lazyImageLoadState to LazyImageLoadState::LoadImmediately
and call updateFromElement() again. This time however, updateFromElement() will actually ask the CachedImage
to load.

The issue was that the first time ImageLoader::updateFromElement(), we would set m_lazyImageLoadState to Deferred
and not ask the CachedImage to load but still set m_hasPendingLoadEvent to true. This is problematic if the CachedImage
is not already loaded since no was was started and thus no load event is coming (and no load event may ever come if the
image never approaches the viewport). When updatedHasPendingEvent() is called, it will protect the HTMLImageElement if
m_hasPendingLoadEvent is true, to make sure the image element stays alive long enough for us to dispatch the load event.
With lazy loading, this meant that we would protect the HTMLImageElement right away and undefinitely since no load event
may ever come. This meant that when navigating away from a page with images that are lazily loaded (and not loaded yet),
we would leak the HTMLImageElements (and ImageLoaders), which in turn would keep the Document alive too.

To address the issue, we now make sure that m_hasPendingLoadEvent is no longer set to true when updateFromElement()
is called but the CachedImage is not already loaded and not loading (lazy loading case). When updateFromElement() gets
called the second time (when the lazily loaded image approaches the viewport), we make sure that the m_hasPendingLoadEvent
flag gets set to true then.

Test: fast/dom/lazy-image-loading-document-leak.html

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::ImageLoader):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::didUpdateCachedImage):
(WebCore::ImageLoader::didStartLoading):
* loader/ImageLoader.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load):
* loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::didStartLoading):

LayoutTests:

Add layout test coverage.

* fast/dom/lazy-image-loading-document-leak-expected.txt: Added.
* fast/dom/lazy-image-loading-document-leak.html: Added.
* fast/dom/resources/lazy-image-loading-document-leak-popup.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/loader/ImageLoader.cpp
trunk/Source/WebCore/loader/ImageLoader.h
trunk/Source/WebCore/loader/cache/CachedImage.cpp
trunk/Source/WebCore/loader/cache/CachedImageClient.h


Added Paths

trunk/LayoutTests/fast/dom/lazy-image-loading-document-leak-expected.txt
trunk/LayoutTests/fast/dom/lazy-image-loading-document-leak.html
trunk/LayoutTests/fast/dom/resources/lazy-image-loading-document-leak-popup.html




Diff

Modified: trunk/LayoutTests/ChangeLog (291140 => 291141)

--- trunk/LayoutTests/ChangeLog	2022-03-11 01:47:40 UTC (rev 291140)
+++ trunk/LayoutTests/ChangeLog	2022-03-11 02:04:19 UTC (rev 291141)
@@ -1,3 +1,17 @@
+2022-03-10  Chris Dumez  
+
+Main document is leaking on haaretz.co.il due to lazy image loading
+https://bugs.webkit.org/show_bug.cgi?id=237660
+
+
+Reviewed by Geoffrey Garen.
+
+Add layout test coverage.
+
+* fast/dom/lazy-image-loading-document-leak-expected.txt: Added.
+* fast/dom/lazy-image-loading-document-leak.html: Added.
+* fast/dom/resources/lazy-image-loading-document-leak-popup.html: Added.
+
 2022-03-10  Matteo Flores  
 
 [ iOS Mac ] imported/w3c/web-platform-tests/service-workers/service-worker/partitioned-service-worker-matchAll.tentative.https.html is a flaky text failure on all queues


Added: trunk/LayoutTests/fast/dom/lazy-image-loading-document-leak-expected.txt (0 => 291141)

--- trunk/LayoutTests/fast/dom/lazy-image-loading-document-leak-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/dom/lazy-image-loading-document-leak-expected.txt	2022-03-11 02:04:19 UTC (rev 291141)
@@ -0,0 +1,11 @@
+Tests that lazy image loading doesn't cause Document leaks.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.isDocumentAlive(frameDocumentID) is true
+PASS The popup document didn't leak.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: 

[webkit-changes] [291140] trunk/Source/WebKit

2022-03-10 Thread cdumez
Title: [291140] trunk/Source/WebKit








Revision 291140
Author cdu...@apple.com
Date 2022-03-10 17:47:40 -0800 (Thu, 10 Mar 2022)


Log Message
Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess()
https://bugs.webkit.org/show_bug.cgi?id=237737

Reviewed by Geoffrey Garen.

Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess() to store referring to
shared workers and add logging.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::registerRemoteWorkerClientProcess):
(WebKit::NetworkProcessProxy::unregisterRemoteWorkerClientProcess):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h
trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in




Diff

Modified: trunk/Source/WebKit/ChangeLog (291139 => 291140)

--- trunk/Source/WebKit/ChangeLog	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/ChangeLog	2022-03-11 01:47:40 UTC (rev 291140)
@@ -1,3 +1,19 @@
+2022-03-10  Chris Dumez  
+
+Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess()
+https://bugs.webkit.org/show_bug.cgi?id=237737
+
+Reviewed by Geoffrey Garen.
+
+Fix naming in NetworkProcessProxy::registerRemoteWorkerClientProcess() to store referring to
+shared workers and add logging.
+
+* UIProcess/Network/NetworkProcessProxy.cpp:
+(WebKit::NetworkProcessProxy::registerRemoteWorkerClientProcess):
+(WebKit::NetworkProcessProxy::unregisterRemoteWorkerClientProcess):
+* UIProcess/Network/NetworkProcessProxy.h:
+* UIProcess/Network/NetworkProcessProxy.messages.in:
+
 2022-03-10  Michael Saboff  
 
 Catalyst _javascript_Core, WebCore, WebKitLegacy, and WebKit shouldn't be copied to the Secondary Path


Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (291139 => 291140)

--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2022-03-11 01:20:55 UTC (rev 291139)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2022-03-11 01:47:40 UTC (rev 291140)
@@ -1481,24 +1481,30 @@
 }
 #endif
 
-void NetworkProcessProxy::registerRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier)
+void NetworkProcessProxy::registerRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier)
 {
-auto* webProcess = WebProcessProxy::processForIdentifier(webProcessIdentifier);
-auto* sharedWorkerProcess = WebProcessProxy::processForIdentifier(sharedWorkerProcessIdentifier);
-if (!webProcess || !sharedWorkerProcess)
+RELEASE_LOG(Worker, "NetworkProcessProxy::registerRemoteWorkerClientProcess: workerType=%{public}s, clientProcessIdentifier=%" PRIu64 ", remoteWorkerProcessIdentifier=%" PRIu64, workerType == RemoteWorkerType::ServiceWorker ? "service" : "shared", clientProcessIdentifier.toUInt64(), remoteWorkerProcessIdentifier.toUInt64());
+auto* clientWebProcess = WebProcessProxy::processForIdentifier(clientProcessIdentifier);
+auto* remoteWorkerProcess = WebProcessProxy::processForIdentifier(remoteWorkerProcessIdentifier);
+if (!clientWebProcess || !remoteWorkerProcess) {
+RELEASE_LOG_ERROR(Worker, "NetworkProcessProxy::registerRemoteWorkerClientProcess: Could not look up one of the processes (clientWebProcess=%p, remoteWorkerProcess=%p)", clientWebProcess, remoteWorkerProcess);
 return;
+}
 
-sharedWorkerProcess->registerRemoteWorkerClientProcess(workerType, *webProcess);
+remoteWorkerProcess->registerRemoteWorkerClientProcess(workerType, *clientWebProcess);
 }
 
-void NetworkProcessProxy::unregisterRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier webProcessIdentifier, WebCore::ProcessIdentifier sharedWorkerProcessIdentifier)
+void NetworkProcessProxy::unregisterRemoteWorkerClientProcess(RemoteWorkerType workerType, WebCore::ProcessIdentifier clientProcessIdentifier, WebCore::ProcessIdentifier remoteWorkerProcessIdentifier)
 {
-auto* webProcess = WebProcessProxy::processForIdentifier(webProcessIdentifier);
-auto* sharedWorkerProcess = WebProcessProxy::processForIdentifier(sharedWorkerProcessIdentifier);
-if (!webProcess || !sharedWorkerProcess)
+RELEASE_LOG(Worker, "NetworkProcessProxy::unregisterRemoteWorkerClientProcess: workerType=%{public}s, clientProcessIdentifier=%" PRIu64 ", remoteWorkerProcessIdentifier=%" PRIu64, workerType == RemoteWorkerType::ServiceWorker ? "service" : "shared", clientProcessIdentifier.toUInt64(), remoteWorkerProcessIdentifier.toUInt64());
+auto* clientWebProcess = 

[webkit-changes] [291137] trunk/Source/WebKit

2022-03-10 Thread cdumez
Title: [291137] trunk/Source/WebKit








Revision 291137
Author cdu...@apple.com
Date 2022-03-10 16:28:03 -0800 (Thu, 10 Mar 2022)


Log Message
[macOS] WebContent processes crash with XPC_EXIT_REASON_SIGTERM_TIMEOUT when logging out
https://bugs.webkit.org/show_bug.cgi?id=237398


Reviewed by Alexey Proskuryakov.

Because we don't use RunningBoard on macOS, we leak an OS transaction to control the lifetime of our XPC
services ourselves. However, one of the side effects of leaking this transaction is that the default SIGTERM
handler doesn't cleanly exit our XPC services when logging out or rebooting. This led to crashes with
XPC_EXIT_REASON_SIGTERM_TIMEOUT as termination reason (rdar://88940229).

To address the issue, we now set our own SIGTERM handler that calls _exit(0) to exit cleanly. In the future,
we should likely adopt RunningBoard on macOS and control our lifetime via process assertions instead of
leaking this OS transaction.

* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
(WebKit::XPCServiceInitializer):
* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
(WebKit::setOSTransaction):
(WebKit::XPCServiceExit):
(WebKit::osTransaction): Deleted.

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (291136 => 291137)

--- trunk/Source/WebKit/ChangeLog	2022-03-11 00:15:39 UTC (rev 291136)
+++ trunk/Source/WebKit/ChangeLog	2022-03-11 00:28:03 UTC (rev 291137)
@@ -1,3 +1,27 @@
+2022-03-10  Chris Dumez  
+
+[macOS] WebContent processes crash with XPC_EXIT_REASON_SIGTERM_TIMEOUT when logging out
+https://bugs.webkit.org/show_bug.cgi?id=237398
+
+
+Reviewed by Alexey Proskuryakov.
+
+Because we don't use RunningBoard on macOS, we leak an OS transaction to control the lifetime of our XPC
+services ourselves. However, one of the side effects of leaking this transaction is that the default SIGTERM
+handler doesn't cleanly exit our XPC services when logging out or rebooting. This led to crashes with
+XPC_EXIT_REASON_SIGTERM_TIMEOUT as termination reason (rdar://88940229).
+
+To address the issue, we now set our own SIGTERM handler that calls _exit(0) to exit cleanly. In the future,
+we should likely adopt RunningBoard on macOS and control our lifetime via process assertions instead of
+leaking this OS transaction.
+
+* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h:
+(WebKit::XPCServiceInitializer):
+* Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm:
+(WebKit::setOSTransaction):
+(WebKit::XPCServiceExit):
+(WebKit::osTransaction): Deleted.
+
 2022-03-10  Wenson Hsieh  
 
 [iOS] Add support for -[UITextInput addTextAlternatives:] on WKContentView


Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h (291136 => 291137)

--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2022-03-11 00:15:39 UTC (rev 291136)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2022-03-11 00:28:03 UTC (rev 291137)
@@ -82,7 +82,7 @@
 }
 
 #if PLATFORM(MAC)
-OSObjectPtr& osTransaction();
+void setOSTransaction(OSObjectPtr&&);
 #endif
 
 template
@@ -113,7 +113,7 @@
 // so ensure that we have an outstanding transaction here. This is not needed on iOS because
 // the UIProcess takes process assertions on behalf of its child processes.
 #if PLATFORM(MAC)
-osTransaction() = adoptOSObject(os_transaction_create("WebKit XPC Service"));
+setOSTransaction(adoptOSObject(os_transaction_create("WebKit XPC Service")));
 #endif
 
 InitializeWebKit2();


Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (291136 => 291137)

--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-11 00:15:39 UTC (rev 291136)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-11 00:28:03 UTC (rev 291137)
@@ -29,6 +29,7 @@
 #import "SandboxUtilities.h"
 #import "XPCServiceEntryPoint.h"
 #import 
+#import 
 #import 
 #import 
 #import 
@@ -159,10 +160,24 @@
 }
 
 #if PLATFORM(MAC)
-OSObjectPtr& osTransaction()
+void setOSTransaction(OSObjectPtr&& transaction)
 {
-static NeverDestroyed> transaction;
-return transaction.get();
+static NeverDestroyed> globalTransaction;
+
+// Because we don't use RunningBoard on macOS, we leak an OS transaction to control the lifetime of our XPC
+// services ourselves. However, one of the side effects of leaking this transaction is that the default SIGTERM
+// handler doesn't cleanly exit our XPC 

[webkit-changes] [291127] trunk/Source/WebCore

2022-03-10 Thread cdumez
Title: [291127] trunk/Source/WebCore








Revision 291127
Author cdu...@apple.com
Date 2022-03-10 13:27:29 -0800 (Thu, 10 Mar 2022)


Log Message
Document is leaking on haaretz.co.il due to an async script
https://bugs.webkit.org/show_bug.cgi?id=237672


Reviewed by Geoffrey Garen.

I haven't been able to reproduce this in the context of a layout test, however,
I see the https://acdn.adnxs.com/dmp/async_usersync.html document flakily leaking
on haaretz.co.il due to an async script (sometimes the top document too).

>From a memgraph, I can see that the cycle is:
HTMLDocument -> ScriptRunner -> PendingScript (via m_scriptsToExecuteSoon) -> HTMLScriptElement -> HTMLDocument (again)

To address the issue, I updated Document::commonTeardown() to clear all its ScriptRunner's pending scripts, right after
we stop all ActiveDOMObjects. At this point, we no longer want to run script and clearing any pending scripts is critical
since they hold a strong reference to the Document.

I have validated the fix on haaretz.co.il since I wasn't able to write an automated
test for this.

* dom/Document.cpp:
(WebCore::Document::commonTeardown):
* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::clearPendingScripts):
* dom/ScriptRunner.h:

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/dom/ScriptRunner.cpp
trunk/Source/WebCore/dom/ScriptRunner.h




Diff

Modified: trunk/Source/WebCore/ChangeLog (291126 => 291127)

--- trunk/Source/WebCore/ChangeLog	2022-03-10 21:25:37 UTC (rev 291126)
+++ trunk/Source/WebCore/ChangeLog	2022-03-10 21:27:29 UTC (rev 291127)
@@ -1,3 +1,31 @@
+2022-03-10  Chris Dumez  
+
+Document is leaking on haaretz.co.il due to an async script
+https://bugs.webkit.org/show_bug.cgi?id=237672
+
+
+Reviewed by Geoffrey Garen.
+
+I haven't been able to reproduce this in the context of a layout test, however,
+I see the https://acdn.adnxs.com/dmp/async_usersync.html document flakily leaking
+on haaretz.co.il due to an async script (sometimes the top document too).
+
+From a memgraph, I can see that the cycle is:
+HTMLDocument -> ScriptRunner -> PendingScript (via m_scriptsToExecuteSoon) -> HTMLScriptElement -> HTMLDocument (again)
+
+To address the issue, I updated Document::commonTeardown() to clear all its ScriptRunner's pending scripts, right after
+we stop all ActiveDOMObjects. At this point, we no longer want to run script and clearing any pending scripts is critical
+since they hold a strong reference to the Document.
+
+I have validated the fix on haaretz.co.il since I wasn't able to write an automated
+test for this.
+
+* dom/Document.cpp:
+(WebCore::Document::commonTeardown):
+* dom/ScriptRunner.cpp:
+(WebCore::ScriptRunner::clearPendingScripts):
+* dom/ScriptRunner.h:
+
 2022-03-10  Chris Fleizach  
 
 AX: Support updated WebSpeech API


Modified: trunk/Source/WebCore/dom/Document.cpp (291126 => 291127)

--- trunk/Source/WebCore/dom/Document.cpp	2022-03-10 21:25:37 UTC (rev 291126)
+++ trunk/Source/WebCore/dom/Document.cpp	2022-03-10 21:27:29 UTC (rev 291127)
@@ -830,6 +830,8 @@
 resizeObserver->disconnect();
 }
 
+scriptRunner().clearPendingScripts();
+
 if (m_highlightRegister)
 m_highlightRegister->clear();
 if (m_fragmentHighlightRegister)


Modified: trunk/Source/WebCore/dom/ScriptRunner.cpp (291126 => 291127)

--- trunk/Source/WebCore/dom/ScriptRunner.cpp	2022-03-10 21:25:37 UTC (rev 291126)
+++ trunk/Source/WebCore/dom/ScriptRunner.cpp	2022-03-10 21:27:29 UTC (rev 291127)
@@ -141,4 +141,11 @@
 }
 }
 
+void ScriptRunner::clearPendingScripts()
+{
+m_scriptsToExecuteInOrder.clear();
+m_scriptsToExecuteSoon.clear();
+m_pendingAsyncScripts.clear();
 }
+
+} // namespace WebCore


Modified: trunk/Source/WebCore/dom/ScriptRunner.h (291126 => 291127)

--- trunk/Source/WebCore/dom/ScriptRunner.h	2022-03-10 21:25:37 UTC (rev 291126)
+++ trunk/Source/WebCore/dom/ScriptRunner.h	2022-03-10 21:27:29 UTC (rev 291127)
@@ -55,6 +55,8 @@
 
 void documentFinishedParsing();
 
+void clearPendingScripts();
+
 private:
 void timerFired();
 






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291110] trunk/Source/WebKit

2022-03-10 Thread cdumez
Title: [291110] trunk/Source/WebKit








Revision 291110
Author cdu...@apple.com
Date 2022-03-10 08:01:08 -0800 (Thu, 10 Mar 2022)


Log Message
Unreviewed, reverting r290795.

Caused crashes 

Reverted changeset:

"[macOS] WebContent processes crash with
XPC_EXIT_REASON_SIGTERM_TIMEOUT when logging out"
https://bugs.webkit.org/show_bug.cgi?id=237398
https://commits.webkit.org/r290795

Modified Paths

trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm




Diff

Modified: trunk/Source/WebKit/ChangeLog (291109 => 291110)

--- trunk/Source/WebKit/ChangeLog	2022-03-10 15:57:15 UTC (rev 291109)
+++ trunk/Source/WebKit/ChangeLog	2022-03-10 16:01:08 UTC (rev 291110)
@@ -1,3 +1,16 @@
+2022-03-10  Chris Dumez  
+
+Unreviewed, reverting r290795.
+
+Caused crashes 
+
+Reverted changeset:
+
+"[macOS] WebContent processes crash with
+XPC_EXIT_REASON_SIGTERM_TIMEOUT when logging out"
+https://bugs.webkit.org/show_bug.cgi?id=237398
+https://commits.webkit.org/r290795
+
 2022-03-10  Youenn Fablet  
 
 Remove RemoteVideoSample


Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h (291109 => 291110)

--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2022-03-10 15:57:15 UTC (rev 291109)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h	2022-03-10 16:01:08 UTC (rev 291110)
@@ -82,7 +82,7 @@
 }
 
 #if PLATFORM(MAC)
-void setOSTransaction(OSObjectPtr&&);
+OSObjectPtr& osTransaction();
 #endif
 
 template
@@ -113,7 +113,7 @@
 // so ensure that we have an outstanding transaction here. This is not needed on iOS because
 // the UIProcess takes process assertions on behalf of its child processes.
 #if PLATFORM(MAC)
-setOSTransaction(adoptOSObject(os_transaction_create("WebKit XPC Service")));
+osTransaction() = adoptOSObject(os_transaction_create("WebKit XPC Service"));
 #endif
 
 InitializeWebKit2();


Modified: trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm (291109 => 291110)

--- trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-10 15:57:15 UTC (rev 291109)
+++ trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm	2022-03-10 16:01:08 UTC (rev 291110)
@@ -29,7 +29,6 @@
 #import "SandboxUtilities.h"
 #import "XPCServiceEntryPoint.h"
 #import 
-#import 
 #import 
 #import 
 #import 
@@ -160,27 +159,10 @@
 }
 
 #if PLATFORM(MAC)
-void setOSTransaction(OSObjectPtr&& transaction)
+OSObjectPtr& osTransaction()
 {
-static NeverDestroyed> globalTransaction;
-
-// Because we don't use RunningBoard on macOS, we leak an OS transaction to control the lifetime of our XPC
-// services ourselves. However, one of the side effects of leaking this transaction is that the default SIGTERM
-// handler doesn't cleanly exit our XPC services when logging out or rebooting. This led to crashes with
-// XPC_EXIT_REASON_SIGTERM_TIMEOUT as termination reason (rdar://88940229). To address the issue, we now set our
-// own SIGTERM handler that releases the OS transaction and calls the default SIGTERM handler. In the future, we
-// should likely adopt RunningBoard on macOS and control our lifetime via process assertions instead of leaking
-// this OS transaction.
-static std::once_flag onceKey;
-std::call_once(onceKey, [] {
-signal(SIGTERM, [](int) {
-globalTransaction.get() = nullptr;
-signal(SIGTERM, SIG_DFL);
-raise(SIGTERM);
-});
-});
-
-globalTransaction.get() = WTFMove(transaction);
+static NeverDestroyed> transaction;
+return transaction.get();
 }
 #endif
 
@@ -190,7 +172,7 @@
 priorityBoostMessage = nullptr;
 
 #if PLATFORM(MAC)
-setOSTransaction(nullptr);
+osTransaction() = nullptr;
 #endif
 
 xpc_transaction_exit_clean();






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [291030] trunk

2022-03-08 Thread cdumez
Title: [291030] trunk








Revision 291030
Author cdu...@apple.com
Date 2022-03-08 22:13:25 -0800 (Tue, 08 Mar 2022)


Log Message
IntersectionObserver is causing massive document leaks on haaretz.co.il
https://bugs.webkit.org/show_bug.cgi?id=237619


Reviewed by Simon Fraser.

Source/WebCore:

On haaretz.co.il, many of the iframe documents (for Google ad frames) were leaking due to
IntersectionObserver. In particular, IntersectionObserver::isReachableFromOpaqueRoots()
was returning true because m_targetsWaitingForFirstObservation was non-empty. This indicates
that the IntersectionObserver is waiting for its first observation since that target was
added. However, the observation is not coming because we navigated away from the document.

To address the issue, I updated Document::commonTeardown() to disconnect all
IntersectionObservers (and the very similar ResizeObservers), right after stopping all
ActiveDOMObject.

Test: fast/dom/intersection-observer-document-leak.html

* dom/Document.cpp:
(WebCore::Document::commonTeardown):
* dom/Document.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::disconnect):
No longer return early if hasObservationTargets() returns false. This is because

LayoutTests:

Add layout test coverage.

* fast/dom/intersection-observer-document-leak-expected.txt: Added.
* fast/dom/intersection-observer-document-leak.html: Added.
* fast/dom/resources/intersection-observer-document-leak-popup.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Document.cpp
trunk/Source/WebCore/dom/Document.h
trunk/Source/WebCore/page/IntersectionObserver.cpp


Added Paths

trunk/LayoutTests/fast/dom/intersection-observer-document-leak-expected.txt
trunk/LayoutTests/fast/dom/intersection-observer-document-leak.html
trunk/LayoutTests/fast/dom/resources/intersection-observer-document-leak-popup.html




Diff

Modified: trunk/LayoutTests/ChangeLog (291029 => 291030)

--- trunk/LayoutTests/ChangeLog	2022-03-09 03:34:18 UTC (rev 291029)
+++ trunk/LayoutTests/ChangeLog	2022-03-09 06:13:25 UTC (rev 291030)
@@ -1,3 +1,17 @@
+2022-03-08  Chris Dumez  
+
+IntersectionObserver is causing massive document leaks on haaretz.co.il
+https://bugs.webkit.org/show_bug.cgi?id=237619
+
+
+Reviewed by Simon Fraser.
+
+Add layout test coverage.
+
+* fast/dom/intersection-observer-document-leak-expected.txt: Added.
+* fast/dom/intersection-observer-document-leak.html: Added.
+* fast/dom/resources/intersection-observer-document-leak-popup.html: Added.
+
 2022-03-08  Eric Carlson  
 
 [Cocoa] metadata cue endTime may not be updated


Added: trunk/LayoutTests/fast/dom/intersection-observer-document-leak-expected.txt (0 => 291030)

--- trunk/LayoutTests/fast/dom/intersection-observer-document-leak-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/dom/intersection-observer-document-leak-expected.txt	2022-03-09 06:13:25 UTC (rev 291030)
@@ -0,0 +1,12 @@
+main frame - has 1 onunload handler(s)
+Tests that IntersectionObserver doesn't cause Document leaks.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.isDocumentAlive(frameDocumentID) is true
+PASS The iframe document didn't leak.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/dom/intersection-observer-document-leak.html (0 => 291030)

--- trunk/LayoutTests/fast/dom/intersection-observer-document-leak.html	(rev 0)
+++ trunk/LayoutTests/fast/dom/intersection-observer-document-leak.html	2022-03-09 06:13:25 UTC (rev 291030)
@@ -0,0 +1,40 @@
+
+
+
+
+description("Tests that IntersectionObserver doesn't cause Document leaks.");
+jsTestIsAsync = true;
+
+frameDocumentID = 0;
+checkCount = 0;
+
+_onload_ = () => {
+window.open("resources/intersection-observer-document-leak-popup.html");
+};
+
+function popupDocumentWasCreated(frameDocument)
+{
+if (!window.internals)
+return;
+
+frameDocumentID = internals.documentIdentifier(frameDocument);
+shouldBeTrue("internals.isDocumentAlive(frameDocumentID)");
+handle = setInterval(() => {
+gc();
+if (!internals.isDocumentAlive(frameDocumentID)) {
+clearInterval(handle);
+testPassed("The iframe document didn't leak.");
+finishJSTest();
+}
+checkCount++;
+if (checkCount > 500) {
+clearInterval(handle);
+testFailed("The iframe document leaked.");
+finishJSTest();
+}
+}, 10);
+}
+
+
+


Added: trunk/LayoutTests/fast/dom/resources/intersection-observer-document-leak-popup.html (0 => 291030)

--- trunk/LayoutTests/fast/dom/resources/intersection-observer-document-leak-popup.html	(rev 0)
+++ trunk/LayoutTests/fast/dom/resources/intersection-observer-document-leak-popup.html	2022-03-09 06:13:25 

[webkit-changes] [291017] trunk

2022-03-08 Thread cdumez
Title: [291017] trunk








Revision 291017
Author cdu...@apple.com
Date 2022-03-08 15:27:30 -0800 (Tue, 08 Mar 2022)


Log Message
Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
https://bugs.webkit.org/show_bug.cgi?id=237605

Reviewed by Darin Adler.

Source/WebCore:

Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407

There is no backward compatibility risk since support for this flag was added very recently
in r290958.

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:

Source/WebKit:

Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407

There is no backward compatibility risk since support for this flag was added very recently
in r290958.

* UIProcess/WebPageProxy.cpp:
(WebKit::frameSandboxAllowsOpeningExternalCustomProtocols):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(TEST):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/SecurityContext.cpp
trunk/Source/WebCore/dom/SecurityContext.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (291016 => 291017)

--- trunk/Source/WebCore/ChangeLog	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 23:27:30 UTC (rev 291017)
@@ -1,3 +1,21 @@
+2022-03-08  Chris Dumez  
+
+Rename allow-custom-protocols-navigation to allow-top-navigation-to-custom-protocols
+https://bugs.webkit.org/show_bug.cgi?id=237605
+
+Reviewed by Darin Adler.
+
+Rename allow-custom-protocols-navigation sandbox flag to allow-top-navigation-to-custom-protocols as per:
+- https://github.com/whatwg/html/pull/7654#issuecomment-1054219407
+
+There is no backward compatibility risk since support for this flag was added very recently
+in r290958.
+
+* dom/SecurityContext.cpp:
+(WebCore::SecurityContext::isSupportedSandboxPolicy):
+(WebCore::SecurityContext::parseSandboxPolicy):
+* dom/SecurityContext.h:
+
 2022-03-08  Alex Christensen  
 
 Fix Windows debug build


Modified: trunk/Source/WebCore/dom/SecurityContext.cpp (291016 => 291017)

--- trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-08 23:27:30 UTC (rev 291017)
@@ -84,7 +84,7 @@
 bool SecurityContext::isSupportedSandboxPolicy(StringView policy)
 {
 static const char* const supportedPolicies[] = {
-"allow-custom-protocols-navigation", "allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
+"allow-top-navigation-to-custom-protocols", "allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
 };
 
 for (auto* supportedPolicy : supportedPolicies) {
@@ -133,8 +133,8 @@
 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-top-navigation-by-user-activation"))
 flags &= ~SandboxTopNavigationByUserActivation;
-else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-custom-protocols-navigation"))
-flags &= ~SandboxCustomProtocolsNavigation;
+else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-top-navigation-to-custom-protocols"))
+flags &= ~SandboxTopNavigationToCustomProtocols;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-modals"))
 flags &= ~SandboxModals;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-storage-access-by-user-activation"))


Modified: trunk/Source/WebCore/dom/SecurityContext.h (291016 => 291017)

--- trunk/Source/WebCore/dom/SecurityContext.h	2022-03-08 23:18:34 UTC (rev 291016)
+++ trunk/Source/WebCore/dom/SecurityContext.h	2022-03-08 23:27:30 UTC (rev 291017)
@@ -58,7 +58,7 @@
 SandboxDocumentDomain   = 1 << 11,
 SandboxModals   = 1 << 12,
 SandboxStorageAccessByUserActivation = 1 << 13,
-SandboxCustomProtocolsNavigation = 1 << 14,
+SandboxTopNavigationToCustomProtocols = 1 << 14,
 SandboxAll  = -1 // Mask with all bits set to 1.
 };
 


Modified: trunk/Source/WebKit/ChangeLog 

[webkit-changes] [290992] trunk/LayoutTests

2022-03-08 Thread cdumez
Title: [290992] trunk/LayoutTests








Revision 290992
Author cdu...@apple.com
Date 2022-03-08 08:24:11 -0800 (Tue, 08 Mar 2022)


Log Message
Unreviewed, silence console logging for http/tests/security/cookie-module-import-propagate.html


This is to address flakiness on the bots.

* TestExpectations:
* http/tests/security/cookie-module-import-propagate-expected.txt:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/http/tests/security/cookie-module-import-propagate-expected.txt




Diff

Modified: trunk/LayoutTests/ChangeLog (290991 => 290992)

--- trunk/LayoutTests/ChangeLog	2022-03-08 16:17:13 UTC (rev 290991)
+++ trunk/LayoutTests/ChangeLog	2022-03-08 16:24:11 UTC (rev 290992)
@@ -1,3 +1,13 @@
+2022-03-08  Chris Dumez  
+
+Unreviewed, silence console logging for http/tests/security/cookie-module-import-propagate.html
+
+
+This is to address flakiness on the bots.
+
+* TestExpectations:
+* http/tests/security/cookie-module-import-propagate-expected.txt:
+
 2022-03-08  J Pascoe  
 
 [ iOS ] 2X http/wpt/webauthn/public-key-credential-create-failure-local (layout-tests) are constant text failures


Modified: trunk/LayoutTests/TestExpectations (290991 => 290992)

--- trunk/LayoutTests/TestExpectations	2022-03-08 16:17:13 UTC (rev 290991)
+++ trunk/LayoutTests/TestExpectations	2022-03-08 16:24:11 UTC (rev 290992)
@@ -426,6 +426,7 @@
 imported/w3c/web-platform-tests/server-timing/navigation_timing_idl.https.html [ Skip ]
 
 # Console log lines may appear in a different order so we silence them.
+http/tests/security/cookie-module-import-propagate.html [ DumpJSConsoleLogInStdErr ]
 http/tests/security/window-opened-from-sandboxed-iframe-should-inherit-sandbox.html [ DumpJSConsoleLogInStdErr ]
 http/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ DumpJSConsoleLogInStdErr ]
 imported/w3c/web-platform-tests/eventsource/format-mime-bogus.any.html [ DumpJSConsoleLogInStdErr ]


Modified: trunk/LayoutTests/http/tests/security/cookie-module-import-propagate-expected.txt (290991 => 290992)

--- trunk/LayoutTests/http/tests/security/cookie-module-import-propagate-expected.txt	2022-03-08 16:17:13 UTC (rev 290991)
+++ trunk/LayoutTests/http/tests/security/cookie-module-import-propagate-expected.txt	2022-03-08 16:24:11 UTC (rev 290992)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin. Status code: 400
 PASS did load script with ./cookie-protected-script.py?testId=0.
 
 PASS did load script with http://127.0.0.1:8000/security/resources/cookie-protected-script.py?testId=1.






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes


[webkit-changes] [290990] trunk/Source/JavaScriptCore

2022-03-08 Thread cdumez
Title: [290990] trunk/Source/_javascript_Core








Revision 290990
Author cdu...@apple.com
Date 2022-03-08 07:37:17 -0800 (Tue, 08 Mar 2022)


Log Message
Unreviewed, reverting r290975.

Broke the build for some configurations

Reverted changeset:

"[XCBuild] Emit a discovered dependency file from offlineasm"
https://bugs.webkit.org/show_bug.cgi?id=237329
https://commits.webkit.org/r290975

Modified Paths

trunk/Source/_javascript_Core/ChangeLog
trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig
trunk/Source/_javascript_Core/Configurations/ToolExecutable.xcconfig
trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj
trunk/Source/_javascript_Core/offlineasm/asm.rb
trunk/Source/_javascript_Core/offlineasm/generate_offset_extractor.rb
trunk/Source/_javascript_Core/offlineasm/generate_settings_extractor.rb
trunk/Source/_javascript_Core/offlineasm/parser.rb




Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (290989 => 290990)

--- trunk/Source/_javascript_Core/ChangeLog	2022-03-08 15:33:00 UTC (rev 290989)
+++ trunk/Source/_javascript_Core/ChangeLog	2022-03-08 15:37:17 UTC (rev 290990)
@@ -1,3 +1,15 @@
+2022-03-08  Chris Dumez  
+
+Unreviewed, reverting r290975.
+
+Broke the build for some configurations
+
+Reverted changeset:
+
+"[XCBuild] Emit a discovered dependency file from offlineasm"
+https://bugs.webkit.org/show_bug.cgi?id=237329
+https://commits.webkit.org/r290975
+
 2022-03-08  Mark Lam  
 
 Remove invalid ASSERT in LocaleIDBuilder::overrideLanguageScriptRegion().


Modified: trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig (290989 => 290990)

--- trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig	2022-03-08 15:33:00 UTC (rev 290989)
+++ trunk/Source/_javascript_Core/Configurations/_javascript_Core.xcconfig	2022-03-08 15:37:17 UTC (rev 290990)
@@ -61,7 +61,4 @@
 INSTALLHDRS_SCRIPT_PHASE = YES;
 APPLY_RULES_IN_COPY_HEADERS = $(WK_USE_NEW_BUILD_SYSTEM);
 
-EXCLUDED_SOURCE_FILE_NAMES = $(inherited) $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_WHICH_BUILD_SYSTEM));
 EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = $(inherited) framework.sb;
-// Offset and settings headers are built by separate targets and script phases in the legacy build system, not using build rules.
-EXCLUDED_SOURCE_FILE_NAMES_legacy = *.asm;


Modified: trunk/Source/_javascript_Core/Configurations/ToolExecutable.xcconfig (290989 => 290990)

--- trunk/Source/_javascript_Core/Configurations/ToolExecutable.xcconfig	2022-03-08 15:33:00 UTC (rev 290989)
+++ trunk/Source/_javascript_Core/Configurations/ToolExecutable.xcconfig	2022-03-08 15:37:17 UTC (rev 290990)
@@ -54,12 +54,6 @@
 OTHER_CFLAGS = $(inherited) -isystem icu;
 
 // Explicitly add the PrivateHeaders directory to the search path so that generated header files can be found in production builds.
-HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core" $(HEADER_SEARCH_PATHS_$(WK_WHICH_BUILD_SYSTEM)) "$(_javascript_CORE_FRAMEWORKS_DIR)/_javascript_Core.framework/PrivateHeaders" $(inherited);
-// XCBuild generates LLIntOffsets in TARGET_TEMP_DIR, which does not need to be manually specifed.
-HEADER_SEARCH_PATHS_legacy = "${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}";
+HEADER_SEARCH_PATHS = "${BUILT_PRODUCTS_DIR}/DerivedSources/_javascript_Core" "${BUILT_PRODUCTS_DIR}/LLIntOffsets/${ARCHS}" "$(_javascript_CORE_FRAMEWORKS_DIR)/_javascript_Core.framework/PrivateHeaders" $(inherited);
 
-EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(WK_WHICH_BUILD_SYSTEM));
-// Offset and settings headers are built by separate targets and script phases in the legacy build system, not using build rules.
-EXCLUDED_SOURCE_FILE_NAMES_legacy = *.asm;
-
 OTHER_LDFLAGS = $(inherited) $(SOURCE_VERSION_LDFLAGS);


Modified: trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj (290989 => 290990)

--- trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2022-03-08 15:33:00 UTC (rev 290989)
+++ trunk/Source/_javascript_Core/_javascript_Core.xcodeproj/project.pbxproj	2022-03-08 15:37:17 UTC (rev 290990)
@@ -3,32 +3,32 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 52;
+	objectVersion = 51;
 	objects = {
 
 /* Begin PBXAggregateTarget section */
-		0F4680A914BA7FD900BFE272 /* (Legacy) LLInt Offsets */ = {
+		0F4680A914BA7FD900BFE272 /* LLInt Offsets */ = {
 			isa = PBXAggregateTarget;
-			buildConfigurationList = 0F4680AC14BA7FD900BFE272 /* Build configuration list for PBXAggregateTarget "(Legacy) LLInt Offsets" */;
+			buildConfigurationList = 0F4680AC14BA7FD900BFE272 /* Build configuration list for PBXAggregateTarget "LLInt Offsets" */;
 			buildPhases = (
-0F4680AA14BA7FD900BFE272 /* (Legacy) Generate Derived Sources */,
+0F4680AA14BA7FD900BFE272 /* Generate Derived Sources */,
 			);
 			dependencies = (
 14BD68992151916D0050DAFF /* PBXTargetDependency */,
 			);
-			name = "(Legacy) 

[webkit-changes] [290977] trunk/LayoutTests

2022-03-08 Thread cdumez
Title: [290977] trunk/LayoutTests








Revision 290977
Author cdu...@apple.com
Date 2022-03-08 00:01:30 -0800 (Tue, 08 Mar 2022)


Log Message
Resync web-platform-tests/beacon from upstream
https://bugs.webkit.org/show_bug.cgi?id=237536

LayoutTests/imported/w3c:

Unreviewed, drop web-platform-tests/beacon tests that are no longer upstream (as of 30d5f8f4c7687a4f2c0).


* web-platform-tests/beacon/beacon-basic-blob-expected.txt: Removed.
* web-platform-tests/beacon/beacon-navigate-expected.txt: Removed.
* web-platform-tests/beacon/beacon-redirect.sub.window-expected.txt: Removed.
* web-platform-tests/beacon/beacon-redirect.sub.window.html: Removed.
* web-platform-tests/beacon/resources/beacon-preflight.py: Removed.
(respondToCORSPreflight): Deleted.
(main): Deleted.
* web-platform-tests/beacon/resources/redirect.py: Removed.
(main): Deleted.
* web-platform-tests/beacon/resources/upgrade-iframe.html: Removed.
* web-platform-tests/beacon/upgrade-beacon.https-expected.txt: Removed.
* web-platform-tests/beacon/upgrade-beacon.https.html: Removed.

LayoutTests:

Unreviewed, drop web-platform-tests/beacon tests that are no longer upstream.


* TestExpectations:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/TestExpectations
trunk/LayoutTests/imported/w3c/ChangeLog


Removed Paths

trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-basic-blob-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-navigate-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-redirect.sub.window-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/beacon-redirect.sub.window.html
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/resources/beacon-preflight.py
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/resources/redirect.py
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/resources/upgrade-iframe.html
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/upgrade-beacon.https-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/beacon/upgrade-beacon.https.html




Diff

Modified: trunk/LayoutTests/ChangeLog (290976 => 290977)

--- trunk/LayoutTests/ChangeLog	2022-03-08 07:28:30 UTC (rev 290976)
+++ trunk/LayoutTests/ChangeLog	2022-03-08 08:01:30 UTC (rev 290977)
@@ -1,3 +1,12 @@
+2022-03-08  Chris Dumez  
+
+Resync web-platform-tests/beacon from upstream
+https://bugs.webkit.org/show_bug.cgi?id=237536
+
+Unreviewed, drop web-platform-tests/beacon tests that are no longer upstream.
+
+* TestExpectations:
+
 2022-03-07  Andres Gonzalez  
 
 Fix for  elements in isolated tree mode.


Modified: trunk/LayoutTests/TestExpectations (290976 => 290977)

--- trunk/LayoutTests/TestExpectations	2022-03-08 07:28:30 UTC (rev 290976)
+++ trunk/LayoutTests/TestExpectations	2022-03-08 08:01:30 UTC (rev 290977)
@@ -849,7 +849,6 @@
 imported/w3c/web-platform-tests/user-timing/mark.html [ Failure Pass ]
 imported/w3c/web-platform-tests/user-timing/measure_associated_with_navigation_timing.html [ Failure Pass ]
 imported/w3c/web-platform-tests/html/webappapis/system-state-and-capabilities/the-navigator-object/plugins-and-mimetypes.html [ Failure Pass ]
-imported/w3c/web-platform-tests/beacon/beacon-redirect.sub.window.html [ Failure Pass ]
 imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/anonymous-iframe/sharedworker-partitioning.tentative.https.window.html [ Failure Pass ]
 imported/w3c/web-platform-tests/service-workers/service-worker/navigation-timing-extended.https.html [ Failure Pass ]
 imported/w3c/web-platform-tests/service-workers/service-worker/resource-timing-fetch-variants.https.html [ Failure Pass ]


Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290976 => 290977)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 07:28:30 UTC (rev 290976)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-08 08:01:30 UTC (rev 290977)
@@ -1,3 +1,23 @@
+2022-03-08  Chris Dumez  
+
+Resync web-platform-tests/beacon from upstream
+https://bugs.webkit.org/show_bug.cgi?id=237536
+
+Unreviewed, drop web-platform-tests/beacon tests that are no longer upstream (as of 30d5f8f4c7687a4f2c0).
+
+* web-platform-tests/beacon/beacon-basic-blob-expected.txt: Removed.
+* web-platform-tests/beacon/beacon-navigate-expected.txt: Removed.
+* web-platform-tests/beacon/beacon-redirect.sub.window-expected.txt: Removed.
+* web-platform-tests/beacon/beacon-redirect.sub.window.html: Removed.
+* web-platform-tests/beacon/resources/beacon-preflight.py: Removed.
+(respondToCORSPreflight): Deleted.
+(main): Deleted.
+* web-platform-tests/beacon/resources/redirect.py: Removed.
+(main): Deleted.
+* web-platform-tests/beacon/resources/upgrade-iframe.html: Removed.
+* web-platform-tests/beacon/upgrade-beacon.https-expected.txt: Removed.
+* 

[webkit-changes] [290958] trunk

2022-03-07 Thread cdumez
Title: [290958] trunk








Revision 290958
Author cdu...@apple.com
Date 2022-03-07 14:32:47 -0800 (Mon, 07 Mar 2022)


Log Message
allow-custom-protocols-navigation sandbox flag.
https://bugs.webkit.org/show_bug.cgi?id=237269


Reviewed by Geoffrey Garen.

Source/WebCore:

Add support for allow-custom-protocols-navigation iframe sandbox flag to allow sandboxed iframes
to navigate to custom protocols, as per:
- https://github.com/whatwg/html/pull/7654

We recently started preventing sandboxed iframes from navigating to custom protocols, which broke
Microsoft Teams. We added a quirk for Microsoft Teams which we should be able to drop once they
adopt this new sandbox flag.

* dom/SecurityContext.cpp:
(WebCore::SecurityContext::isSupportedSandboxPolicy):
(WebCore::SecurityContext::parseSandboxPolicy):
* dom/SecurityContext.h:

Source/WebKit:

Add support for allow-custom-protocols-navigation iframe sandbox flag to allow sandboxed iframes
to navigate to custom protocols, as per:
- https://github.com/whatwg/html/pull/7654

We recently started preventing sandboxed iframes from navigating to custom protocols, which broke
Microsoft Teams. We added a quirk for Microsoft Teams which we should be able to drop once they
adopt this new sandbox flag.

* UIProcess/WebPageProxy.cpp:
(WebKit::frameSandboxAllowsOpeningExternalCustomProtocols):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(TEST):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/SecurityContext.cpp
trunk/Source/WebCore/dom/SecurityContext.h
trunk/Source/WebKit/ChangeLog
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
trunk/Tools/ChangeLog
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm




Diff

Modified: trunk/Source/WebCore/ChangeLog (290957 => 290958)

--- trunk/Source/WebCore/ChangeLog	2022-03-07 22:13:22 UTC (rev 290957)
+++ trunk/Source/WebCore/ChangeLog	2022-03-07 22:32:47 UTC (rev 290958)
@@ -1,5 +1,26 @@
 2022-03-07  Chris Dumez  
 
+allow-custom-protocols-navigation sandbox flag.
+https://bugs.webkit.org/show_bug.cgi?id=237269
+
+
+Reviewed by Geoffrey Garen.
+
+Add support for allow-custom-protocols-navigation iframe sandbox flag to allow sandboxed iframes
+to navigate to custom protocols, as per:
+- https://github.com/whatwg/html/pull/7654
+
+We recently started preventing sandboxed iframes from navigating to custom protocols, which broke
+Microsoft Teams. We added a quirk for Microsoft Teams which we should be able to drop once they
+adopt this new sandbox flag.
+
+* dom/SecurityContext.cpp:
+(WebCore::SecurityContext::isSupportedSandboxPolicy):
+(WebCore::SecurityContext::parseSandboxPolicy):
+* dom/SecurityContext.h:
+
+2022-03-07  Chris Dumez  
+
 Optimize the passing of data across threads
 https://bugs.webkit.org/show_bug.cgi?id=237502
 


Modified: trunk/Source/WebCore/dom/SecurityContext.cpp (290957 => 290958)

--- trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-07 22:13:22 UTC (rev 290957)
+++ trunk/Source/WebCore/dom/SecurityContext.cpp	2022-03-07 22:32:47 UTC (rev 290958)
@@ -84,7 +84,7 @@
 bool SecurityContext::isSupportedSandboxPolicy(StringView policy)
 {
 static const char* const supportedPolicies[] = {
-"allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
+"allow-custom-protocols-navigation", "allow-forms", "allow-same-origin", "allow-scripts", "allow-top-navigation", "allow-pointer-lock", "allow-popups", "allow-popups-to-escape-sandbox", "allow-top-navigation-by-user-activation", "allow-modals", "allow-storage-access-by-user-activation"
 };
 
 for (auto* supportedPolicy : supportedPolicies) {
@@ -133,6 +133,8 @@
 flags &= ~SandboxPropagatesToAuxiliaryBrowsingContexts;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-top-navigation-by-user-activation"))
 flags &= ~SandboxTopNavigationByUserActivation;
+else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-custom-protocols-navigation"))
+flags &= ~SandboxCustomProtocolsNavigation;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-modals"))
 flags &= ~SandboxModals;
 else if (equalLettersIgnoringASCIICase(sandboxToken, "allow-storage-access-by-user-activation"))


Modified: trunk/Source/WebCore/dom/SecurityContext.h (290957 => 290958)

--- trunk/Source/WebCore/dom/SecurityContext.h	2022-03-07 22:13:22 UTC (rev 290957)
+++ trunk/Source/WebCore/dom/SecurityContext.h	2022-03-07 22:32:47 UTC (rev 290958)
@@ -58,6 +58,7 @@
 SandboxDocumentDomain   = 1 << 11,
 SandboxModals   = 1 << 12,
 SandboxStorageAccessByUserActivation = 1 << 

[webkit-changes] [290899] trunk

2022-03-07 Thread cdumez
Title: [290899] trunk








Revision 290899
Author cdu...@apple.com
Date 2022-03-07 11:21:15 -0800 (Mon, 07 Mar 2022)


Log Message
Make "true" count as truthy in window.open()'s boolean features
https://bugs.webkit.org/show_bug.cgi?id=237530

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Import WPT test coverage.

* resources/resource-files.json:
* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html:
* web-platform-tests/html/browsers/the-window-object/support/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/support/windowFeature-values-target.html: Added.
* web-platform-tests/html/browsers/the-window-object/w3c-import.log:
* web-platform-tests/html/browsers/the-window-object/window-open-noopener.html:
* web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values-expected.txt: Added.
* web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values.html: Added.

Source/WebCore:

Make "true" count as truthy in window.open()'s boolean features, as per:
- https://github.com/whatwg/html/pull/7425

Test: imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values.html

* page/WindowFeatures.cpp:
(WebCore::setWindowFeature):

LayoutTests:

* tests-options.json:

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/imported/w3c/ChangeLog
trunk/LayoutTests/imported/w3c/resources/resource-files.json
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/w3c-import.log
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/w3c-import.log
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-noopener.html
trunk/LayoutTests/tests-options.json
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/page/WindowFeatures.cpp


Added Paths

trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/support/windowFeature-values-target.html
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values-expected.txt
trunk/LayoutTests/imported/w3c/web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values.html




Diff

Modified: trunk/LayoutTests/ChangeLog (290898 => 290899)

--- trunk/LayoutTests/ChangeLog	2022-03-07 19:13:52 UTC (rev 290898)
+++ trunk/LayoutTests/ChangeLog	2022-03-07 19:21:15 UTC (rev 290899)
@@ -1,5 +1,14 @@
 2022-03-07  Chris Dumez  
 
+Make "true" count as truthy in window.open()'s boolean features
+https://bugs.webkit.org/show_bug.cgi?id=237530
+
+Reviewed by Alex Christensen.
+
+* tests-options.json:
+
+2022-03-07  Chris Dumez  
+
 [Catalina Release wk1] imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html is a flaky failure
 https://bugs.webkit.org/show_bug.cgi?id=230729
 


Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290898 => 290899)

--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 19:13:52 UTC (rev 290898)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-03-07 19:21:15 UTC (rev 290899)
@@ -1,3 +1,21 @@
+2022-03-07  Chris Dumez  
+
+Make "true" count as truthy in window.open()'s boolean features
+https://bugs.webkit.org/show_bug.cgi?id=237530
+
+Reviewed by Alex Christensen.
+
+Import WPT test coverage.
+
+* resources/resource-files.json:
+* web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html:
+* web-platform-tests/html/browsers/the-window-object/support/w3c-import.log:
+* web-platform-tests/html/browsers/the-window-object/support/windowFeature-values-target.html: Added.
+* web-platform-tests/html/browsers/the-window-object/w3c-import.log:
+* web-platform-tests/html/browsers/the-window-object/window-open-noopener.html:
+* web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values-expected.txt: Added.
+* web-platform-tests/html/browsers/the-window-object/window-open-windowfeatures-values.html: Added.
+
 2022-03-07  Antoine Quint  
 
 [web-animations] animating "fill" and "stroke" to or from "currentColor" should work


Modified: trunk/LayoutTests/imported/w3c/resources/resource-files.json (290898 => 290899)

--- trunk/LayoutTests/imported/w3c/resources/resource-files.json	2022-03-07 19:13:52 UTC (rev 290898)
+++ trunk/LayoutTests/imported/w3c/resources/resource-files.json	2022-03-07 19:21:15 UTC (rev 290899)
@@ -2238,6 +2238,7 @@
 

<    1   2   3   4   5   6   7   8   9   10   >