Timeline
Apr 17, 2022:
- 10:55 PM Changeset in webkit [292951] by
-
- 40 edits in trunk/Source
Leverage StringView in more places
https://bugs.webkit.org/show_bug.cgi?id=239426
Reviewed by Sam Weinig.
Leverage StringView in more places, to reduce the number of String allocations.
Source/WebCore:
- Modules/applicationmanifest/ApplicationManifestParser.cpp:
(WebCore::ApplicationManifestParser::parseDisplay):
(WebCore::ApplicationManifestParser::parseIcons):
- Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::createSQLiteStatement):
- Modules/indexeddb/server/SQLiteIDBCursor.h:
- Modules/webdatabase/Database.cpp:
(WebCore::setTextValueInDatabase):
(WebCore::retrieveTextResultFromDatabase):
- accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(appendStringToResult): Deleted.
(accessibleElementsForObjects): Deleted.
(rendererForView): Deleted.
- css/parser/MediaQueryParser.h:
(WebCore::MediaQueryParser::MediaQueryData::setMediaType):
- editing/Editor.cpp:
(WebCore::Editor::transpose):
- editing/FrameSelection.cpp:
(WebCore::FrameSelection::debugRenderer const):
- html/MediaFragmentURIParser.cpp:
(WebCore::collectFraction):
(WebCore::MediaFragmentURIParser::parseNPTTime):
- html/StepRange.cpp:
(WebCore::StepRange::parseStep):
- html/StepRange.h:
- html/parser/HTMLParserIdioms.cpp:
(WebCore::parseToDecimalForNumberType):
(WebCore::parseToDoubleForNumberType):
- html/parser/HTMLParserIdioms.h:
- inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setAttributesAsText):
- layout/formattingContexts/inline/InlineItemsBuilder.cpp:
(WebCore::Layout::replaceNonPreservedNewLineCharactersAndAppend):
- layout/integration/LayoutIntegrationCoverage.cpp:
(WebCore::LayoutIntegration::printTextForSubtree):
- page/TextIndicator.cpp:
(WebCore::containsOnlyWhiteSpaceText):
- platform/Decimal.cpp:
(WebCore::Decimal::fromString):
- platform/Decimal.h:
- platform/network/CacheValidation.cpp:
(WebCore::parseCacheHeader):
(WebCore::parseCacheControlDirectives):
- platform/network/HTTPParsers.cpp:
(WebCore::filenameFromHTTPContentDisposition):
- platform/network/HTTPParsers.h:
- platform/network/MIMEHeader.cpp:
(WebCore::retrieveKeyValuePairs):
(WebCore::MIMEHeader::parseContentTransferEncoding):
- platform/network/MIMEHeader.h:
- platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setContentType):
- platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isAttachment const):
(WebCore::ResourceResponseBase::isAttachmentWithFilename const):
- platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::platformSuggestedFilename const):
- platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::executeCommandSlow):
(WebCore::SQLiteDatabase::clearAllTables):
(WebCore::SQLiteDatabase::prepareStatementSlow):
(WebCore::SQLiteDatabase::prepareHeapStatementSlow):
- platform/sql/SQLiteDatabase.h:
- platform/xr/PlatformXR.h:
(PlatformXR::parseSessionFeatureDescriptor):
- svg/SVGAnimationElement.cpp:
(WebCore::parseKeyTimes):
(WebCore::SVGAnimationElement::parseAttribute):
Source/WebKit:
- WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
Source/WebKitLegacy/mac:
- WebView/WebImmediateActionController.mm:
(+[WebImmediateActionController _dictionaryPopupInfoForRange:inFrame:withLookupOptions:indicatorOptions:transition:]):
Source/WTF:
- wtf/text/StringImpl.cpp:
- wtf/text/StringImpl.h:
(WTF::isNotSpaceOrNewline):
- wtf/text/WTFString.h:
- 2:52 PM Changeset in webkit [292950] by
-
- 4 edits in trunk/Source/JavaScriptCore
Harden JSObject::setPrototypeOf.
https://bugs.webkit.org/show_bug.cgi?id=239440
Reviewed by Yusuke Suzuki.
- runtime/JSObject.cpp:
(JSC::JSObject::setPrototypeDirect):
(JSC::JSObject::setPrototypeWithCycleCheck):
- runtime/JSObject.h:
- runtime/ObjectConstructor.cpp:
(JSC::objectConstructorSetPrototypeOf):
- 2:01 PM Changeset in webkit [292949] by
-
- 5 edits in trunk/Source/WebCore
Unreviewed, non-unified build fixes after 249632@main
https://bugs.webkit.org/show_bug.cgi?id=239436
- workers/DedicatedWorkerThread.cpp:
- workers/WorkerGlobalScope.cpp:
- workers/WorkerScriptLoader.cpp:
- workers/service/ServiceWorkerClientData.cpp:
- 6:32 AM Changeset in webkit [292948] by
-
- 2 edits in trunk/Source/WebCore
RenderDeprecatedFlexibleBox::applyLineClamp should use size_t
https://bugs.webkit.org/show_bug.cgi?id=239389
Reviewed by Darin Adler.
Use size_t consistently in applyLineClamp.
While LineClampValue is int based, it can also be a percent type which expands the clamping range to size_t.
getHeightForLineCount -> use size_t and drop the magic -1.
heightForLineCount -> return LayoutUnit instead of int.
- rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::getHeightForLineCount):
(WebCore::heightForLineCount):
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
- 1:08 AM Changeset in webkit [292947] by
-
- 13 edits3 adds in trunk
Make release assertion in Document::updateLayout more precise for FrameSelection::setSelection
https://bugs.webkit.org/show_bug.cgi?id=239431
Reviewed by Alan Bujtas.
Source/WebCore:
Avoid the assertion failure by allowing no-op layout updates within FrameSelection::setSelection.
To do this, this patch introduces a new RAII object, UpToDateLayoutScope, which denotes when when the layout
is up-to-date and therefore does not require a new layout update. When this scope exists in the stack frame,
we allow calls to Document::updateLayout even inside ScriptDisallowedScope. We also assert that nobody attempts
to schedule a new style resolution or layout when this object exists.
Test: fast/forms/textarea-selection-update-during-DOMNodeRemoved-crash.html
- WebCore.xcodeproj/project.pbxproj:
- dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateLayout):
- dom/Document.h:
(WebCore::Document::upToDateLayoutScopeCount const):
(WebCore::Document::incrementUpToDateLayoutScopeCount):
(WebCore::Document::decrementUpToDateLayoutScopeCount):
- editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelection):
- page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::scheduleLayout):
- rendering/RenderObject.h:
(WebCore::RenderObject::isSetNeedsLayoutForbidden const):
- rendering/UpToDateLayoutScope.h: Added.
(WebCore::UpToDateLayoutScope::UpToDateLayoutScope):
(WebCore::UpToDateLayoutScope::~UpToDateLayoutScope):
(WebCore::UpToDateLayoutScope::scopeIfLayoutIsUpToUpdate):
(WebCore::UpToDateLayoutScope::needsLayout):
LayoutTests:
Add a regression test, and fix existing accessibility tests which were mutating DOM inside setSelection
via should* functions. In production, this will never happen since accessibility notification will be sent
to UI process asynchronously and accesssibility code won't try to mutate DOM synchronously.
- accessibility/mac/focus-setting-selection-syncronizing-not-clearing-expected.txt: Rebaselined.
- accessibility/mac/focus-setting-selection-syncronizing-not-clearing.html: Delay DOM mutations in should*
until the notification is over.
- accessibility/mac/selection-change-userinfo.html: Ditto.
- accessibility/mac/selection-sync.html: Ditto.
- accessibility/mac/selection-value-changes-for-aria-textbox.html: Ditto.
- fast/forms/textarea-selection-update-during-DOMNodeRemoved-crash-expected.txt: Added.
- fast/forms/textarea-selection-update-during-DOMNodeRemoved-crash.html: Added.
Apr 16, 2022:
- 9:22 PM Changeset in webkit [292946] by
-
- 2 edits in trunk/Source/JavaScriptCore
Fix a deadlock in VMTraps.
https://bugs.webkit.org/show_bug.cgi?id=239421
<rdar://problem/91851592>
Reviewed by Michael Saboff.
The sampling profiler first acquires the codeBlockSet lock followed by the ThreadSuspendLocker.
VMTraps, on the other hand, first acquires the ThreadSuspendLocker followed by the
codeBlockSet lock. As a result, VMTraps can deadlock with the Sampling Profiler
thread, and leave the mutator in a suspended state, or forever blocked on the
codeBlockSet lock.
This was discovered while running the stress/has-indexed-property-with-worsening-array-mode.js.ftl-no-cjit-validate-sampling-profiler
test on a Debug build of jsc on an M1 MBP. Since it requires a race condition to
reproduce, reproducibility is not always reliable.
- runtime/VMTraps.cpp:
(JSC::VMTraps::tryInstallTrapBreakpoints):
- 8:56 PM Changeset in webkit [292945] by
-
- 22 edits in trunk
Drop String::truncate() and use String::left() instead
https://bugs.webkit.org/show_bug.cgi?id=239412
Reviewed by Darin Adler.
Source/WebCore:
- Modules/highlight/AppHighlightStorage.cpp:
(WebCore::createAppHighlightRangeData):
- dom/FragmentDirectiveParser.cpp:
(WebCore::FragmentDirectiveParser::parseFragmentDirective):
- html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
- html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
- loader/FTPDirectoryParser.h:
(WebCore::ListResult::clear):
- loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
- page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::languageIdentifier):
- platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
(WebCore::contentTypesToCodecs):
- platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::scanDirectoryForDictionaries):
- platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::extractURL):
Source/WebKit:
- Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::getUserDirectorySuffix):
Source/WebKitLegacy/win:
- WebDownloadCFNet.cpp:
(WebDownload::initToResumeWithBundle):
Source/WTF:
String::truncate() and String::left() have identical behavior. The only difference is that truncate()
modifies the String in place (which is a bit confusing), while left() returns a new String, without
modifying the original. To simplify our API, I am dropping String::truncate().
- wtf/text/WTFString.cpp:
(WTF::String::truncate): Deleted.
- wtf/text/WTFString.h:
- wtf/unix/LanguageUnix.cpp:
(WTF::platformLanguage):
- wtf/win/LanguageWin.cpp:
(WTF::localeInfo):
Tools:
- WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::willAddMessageToConsole):
- 8:13 PM Changeset in webkit [292944] by
-
- 5 edits in trunk
[macOS] Image controls are editable and prevent drops in editable web views
https://bugs.webkit.org/show_bug.cgi?id=239423
rdar://81027082
Reviewed by Darin Adler.
Source/WebCore:
Adjust the UA stylesheet for image controls (i.e., the services dropdown menu button) such that:
- The container for image controls is non-editable, and:
- The container above the button (which encompasses the bounds of the host image) ignores hit-testing.
This ensures that we're able to handle a drop over an image with image controls in an editable web view, by
inserting the dropped content before or after the image element (as opposed to either inserting it inside the
shadow root of the image, or not handling the drop via editing at all).
Test: WKAttachmentTestsMac.DropImageOverImageWithControls
- dom/mac/ImageControlsMac.cpp:
(WebCore::ImageControlsMac::createImageControls):
- html/shadow/mac/imageControlsMac.css:
(#if defined(ENABLE_SERVICE_CONTROLS) && ENABLE_SERVICE_CONTROLS):
(button#image-controls-button):
Make the contents of the image controls container non-selectable, and also avoid hit-testing over the container.
(:host(:hover) button#image-controls-button):
(div#image-controls button#image-controls-button): Deleted.
Ensure that the services menu button itself can still be activated by setting
pointer-events: auto;when the
host element (i.e. theimg) is hovered. It's important that we use the host element'shoverstate instead of
the containing#image-controls, since this container now haspointer-events: none;.
These changes make it still possible to reveal and interact with the services menu button, but allows
drag-and-drop to avoid hit-testing into shadow root content for an image with controls.
(div#image-controls:hover button#image-controls-button): Deleted.
Tools:
Add a new API test to exercise the change.
- TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):
- 3:59 PM Changeset in webkit [292943] by
-
- 4 edits in trunk/Source/WebCore
Optimize id matching in AccessibilityObject::ariaElementsReferencedByAttribute()
https://bugs.webkit.org/show_bug.cgi?id=239406
<rdar://problem/91829358>
Reviewed by Darin Adler.
For every element in the DOM tree, the function would get the value of ones of its attributes,
then construct a SpaceSplitString (which would tokenize and atomize every space-separated
component in the value), and finally see if the SpaceSplitString contains the id we're looking
for. This was unnecessarily expensive.
This patch revives SpaceSplitString::spaceSplitStringContainsValue() which was unused and makes
it work with a StringView input instead of only a const char*/LChar*. We now use this function
inside AccessibilityObject::ariaElementsReferencedByAttribute() to avoid the construction of
a SpaceSplitString. spaceSplitStringContainsValue() simply iterates the string until it finds
an HTML space, then compare the chunk of characters with the provided StringView. If it matches,
it returns early, otherwise, it keeps searching till the end of the String.
- accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::ariaElementsReferencedByAttribute const):
- dom/SpaceSplitString.cpp:
(WebCore::tokenizeSpaceSplitString):
(WebCore::TokenIsEqualToCharactersTokenProcessor::TokenIsEqualToCharactersTokenProcessor):
(WebCore::TokenIsEqualToCharactersTokenProcessor::processToken):
(WebCore::spaceSplitStringContainsValueInternal):
(WebCore::SpaceSplitString::spaceSplitStringContainsValue):
(WebCore::TokenIsEqualToCStringTokenProcessor::TokenIsEqualToCStringTokenProcessor): Deleted.
(WebCore::TokenIsEqualToCStringTokenProcessor::processToken): Deleted.
(WebCore::TokenIsEqualToCStringTokenProcessor::referenceStringWasFound const): Deleted.
- dom/SpaceSplitString.h:
(WebCore::SpaceSplitString::spaceSplitStringContainsValue): Deleted.
- 1:31 PM Changeset in webkit [292942] by
-
- 10 edits in trunk/Source
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:
- 12:28 PM Changeset in webkit [292941] by
-
- 2 edits in trunk/Source/WebGPU
[WebGPU] Fix the Big Sur build
https://bugs.webkit.org/show_bug.cgi?id=239422
Unreviewed.
HardwareLimits.mm:338:23: error: constexpr function never produces a constant expression [-Winvalid-constexpr]
- WebGPU/HardwareLimits.mm:
(WebGPU::checkLimits):