⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Timeline



Dec 12, 2021:

11:39 PM Changeset in webkit [286936] by sihui_liu@apple.com
  • 22 edits
    5 copies
    7 adds in trunk/Source

Merge StorageManager with NetworkStorageManager to manage WebStorage by origin
https://bugs.webkit.org/show_bug.cgi?id=234087

Reviewed by Chris Dumez.

Source/WebCore:

  • platform/sql/SQLiteFileSystem.cpp:

(WebCore::SQLiteFileSystem::deleteDatabaseFile):
(WebCore::SQLiteFileSystem::moveDatabaseFile):
(WebCore::SQLiteFileSystem::databaseFileSize):

  • platform/sql/SQLiteFileSystem.h:

Source/WebKit:

In network process, WebStorage data is managed by WebKit::StorageManager class. Each StorageManager owns one or
many StorageNameSpaces, and each StorageNamespace owns one or more StorageAreas. Each StorageArea correponds
to one storage map (one localStorage or sessionStorage object), using either a SQLite database or a in-memory
map as backend. Now that we have NetworkStorageManager, which manages storage by origin. We can merge
StorageManager with NetworkStorageManager, since localStorage and sessionStorage are not shared between
different origins.

The new structure is:
NetworkStorageManager (manage storage for a session, owns one or more OriginStorageManagers)
OriginStorageManager (manage storage for an origin, owns one LocalStorageManager and one SessionStorageManager)
LocalStorageManager / SessionStorageManager (manage LocalStorage and SessionStorage, owns one or more
StorageAreaBases)
MemoryStorageArea / SQLiteStorageArea (inherits StorageAreaBases; manage one local or session storage, like
Webkit::StorageArea)

StorageNamespace layer is removed. For SessionStorage, different StorageNamespaces means different web pages,
and same origin can have different sessionStorages on different pages, so we keep a StorageNamespace <=>
StorageArea map in SessionStorageManager. For LocalStorage, differnt StorageNamespaces means different page
groups. Our original plan was the same origin can have different localStorages in different page groups, but our
old implementation actually made all page groups point to the same database file. To keep existing behavior
that all page groups with same origin share the storage, we now keep one local StorageArea and one transient
StorageArea per LocalStorageManager.

Mostly refactoring and covered by existing tests.

  • NetworkProcess/NetworkProcess.cpp:

(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::createNetworkConnectionToWebProcess):
(WebKit::NetworkProcess::addWebsiteDataStore):
(WebKit::NetworkProcess::addStorageManagerForSession):
(WebKit::NetworkProcess::destroySession):
(WebKit::NetworkProcess::hasLocalStorage):
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::deleteAndRestrictWebsiteDataForRegistrableDomains):
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::resume):
(WebKit::NetworkProcess::syncLocalStorage):
(WebKit::NetworkProcess::renameOriginInWebsiteData):
(WebKit::NetworkProcess::connectionToWebProcessClosed):
(WebKit::NetworkProcess::getLocalStorageOriginDetails): Deleted.

  • NetworkProcess/NetworkProcess.h:
  • NetworkProcess/NetworkProcess.messages.in:
  • NetworkProcess/storage/LocalStorageManager.cpp: Added.

(WebKit::fileNameToOrigin):
(WebKit::originToFileName):
(WebKit::LocalStorageManager::originsOfLocalStorageData):
(WebKit::LocalStorageManager::localStorageFilePath):
(WebKit::LocalStorageManager::LocalStorageManager):
(WebKit::LocalStorageManager::isActive const):
(WebKit::LocalStorageManager::hasDataInMemory const):
(WebKit::LocalStorageManager::clearDataInMemory):
(WebKit::LocalStorageManager::clearDataOnDisk):
(WebKit::LocalStorageManager::close):
(WebKit::LocalStorageManager::handleLowMemoryWarning):
(WebKit::LocalStorageManager::syncLocalStorage):
(WebKit::LocalStorageManager::connectionClosed):
(WebKit::LocalStorageManager::connectionClosedForLocalStorageArea):
(WebKit::LocalStorageManager::connectionClosedForTransientStorageArea):
(WebKit::LocalStorageManager::connectToLocalStorageArea):
(WebKit::LocalStorageManager::connectToTransientLocalStorageArea):
(WebKit::LocalStorageManager::disconnectFromStorageArea):

  • NetworkProcess/storage/LocalStorageManager.h: Added.
  • NetworkProcess/storage/MemoryStorageArea.cpp: Added.

(WebKit::MemoryStorageArea::MemoryStorageArea):
(WebKit::MemoryStorageArea::isEmpty):
(WebKit::MemoryStorageArea::clear):
(WebKit::MemoryStorageArea::allItems):
(WebKit::MemoryStorageArea::setItem):
(WebKit::MemoryStorageArea::removeItem):
(WebKit::MemoryStorageArea::clone const):

  • NetworkProcess/storage/MemoryStorageArea.h: Added.

(isType):

  • NetworkProcess/storage/NetworkStorageManager.cpp:

(WebKit::readOriginFromFile):
(WebKit::writeOriginToFileIfNecessary):
(WebKit::NetworkStorageManager::create):
(WebKit::NetworkStorageManager::NetworkStorageManager):
(WebKit::NetworkStorageManager::canHandleTypes):
(WebKit::NetworkStorageManager::close):
(WebKit::originDirectoryPath):
(WebKit::originFilePath):
(WebKit::NetworkStorageManager::localOriginStorageManager):
(WebKit::NetworkStorageManager::removeOriginStorageManagerIfPossible):
(WebKit::NetworkStorageManager::deleteOriginDirectoryIfPossible):
(WebKit::NetworkStorageManager::clearStorageForTesting):
(WebKit::NetworkStorageManager::forEachOriginDirectory):
(WebKit::NetworkStorageManager::getAllOrigins):
(WebKit::NetworkStorageManager::fetchDataFromDisk):
(WebKit::NetworkStorageManager::deleteDataOnDisk):
(WebKit::NetworkStorageManager::moveData):
(WebKit::NetworkStorageManager::suspend):
(WebKit::NetworkStorageManager::resume):
(WebKit::NetworkStorageManager::handleLowMemoryWarning):
(WebKit::NetworkStorageManager::syncLocalStorage):
(WebKit::NetworkStorageManager::connectToLocalStorageArea):
(WebKit::NetworkStorageManager::connectToTransientLocalStorageArea):
(WebKit::NetworkStorageManager::connectToSessionStorageArea):
(WebKit::NetworkStorageManager::disconnectFromStorageArea):
(WebKit::NetworkStorageManager::cloneSessionStorageNamespace):
(WebKit::NetworkStorageManager::getValues):
(WebKit::NetworkStorageManager::setItem):
(WebKit::NetworkStorageManager::removeItem):
(WebKit::NetworkStorageManager::clear):
(WebKit::toWebsiteDataType): Deleted.

  • NetworkProcess/storage/NetworkStorageManager.h:
  • NetworkProcess/storage/NetworkStorageManager.messages.in:
  • NetworkProcess/storage/OriginStorageManager.cpp:

(WebKit::OriginStorageManager::StorageBucket::StorageBucket):
(WebKit::OriginStorageManager::StorageBucket::toWebsiteDataType):
(WebKit::OriginStorageManager::StorageBucket::toStorageIdentifier):
(WebKit::OriginStorageManager::StorageBucket::localStorageManager):
(WebKit::OriginStorageManager::StorageBucket::existingLocalStorageManager):
(WebKit::OriginStorageManager::StorageBucket::sessionStorageManager):
(WebKit::OriginStorageManager::StorageBucket::existingSessionStorageManager):
(WebKit::OriginStorageManager::StorageBucket::isActive const):
(WebKit::OriginStorageManager::StorageBucket::isEmpty const):
(WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInList):
(WebKit::OriginStorageManager::StorageBucket::deleteData):
(WebKit::OriginStorageManager::StorageBucket::moveData):
(WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInListFromMemory):
(WebKit::OriginStorageManager::StorageBucket::fetchDataTypesInListFromDisk):
(WebKit::OriginStorageManager::StorageBucket::deleteLocalStorageData):
(WebKit::OriginStorageManager::StorageBucket::deleteSessionStorageData):
(WebKit::OriginStorageManager::OriginStorageManager):
(WebKit::OriginStorageManager::defaultBucket):
(WebKit::OriginStorageManager::localStorageManager):
(WebKit::OriginStorageManager::existingLocalStorageManager):
(WebKit::OriginStorageManager::sessionStorageManager):
(WebKit::OriginStorageManager::existingSessionStorageManager):
(WebKit::OriginStorageManager::isEmpty):
(WebKit::OriginStorageManager::fetchDataTypesInList):
(WebKit::OriginStorageManager::deleteData):
(WebKit::OriginStorageManager::moveData):
(WebKit::OriginStorageManager::StorageBucket::isActive): Deleted.

  • NetworkProcess/storage/OriginStorageManager.h:
  • NetworkProcess/storage/SQLiteStorageArea.cpp: Added.

(WebKit::SQLiteStorageArea::statementString const):
(WebKit::SQLiteStorageArea::SQLiteStorageArea):
(WebKit::SQLiteStorageArea::close):
(WebKit::SQLiteStorageArea::~SQLiteStorageArea):
(WebKit::SQLiteStorageArea::isEmpty):
(WebKit::SQLiteStorageArea::clear):
(WebKit::SQLiteStorageArea::createTableIfNecessary):
(WebKit::SQLiteStorageArea::prepareDatabase):
(WebKit::SQLiteStorageArea::startTransactionIfNecessary):
(WebKit::SQLiteStorageArea::cachedStatement):
(WebKit::SQLiteStorageArea::getItem):
(WebKit::SQLiteStorageArea::getItemFromDatabase):
(WebKit::SQLiteStorageArea::allItems):
(WebKit::SQLiteStorageArea::setItem):
(WebKit::SQLiteStorageArea::removeItem):
(WebKit::SQLiteStorageArea::commitTransactionIfNecessary):
(WebKit::SQLiteStorageArea::handleLowMemoryWarning):

  • NetworkProcess/storage/SQLiteStorageArea.h: Added.

(isType):

  • NetworkProcess/storage/SessionStorageManager.cpp: Added.

(WebKit::SessionStorageManager::SessionStorageManager):
(WebKit::SessionStorageManager::isActive const):
(WebKit::SessionStorageManager::hasDataInMemory const):
(WebKit::SessionStorageManager::clearData):
(WebKit::SessionStorageManager::connectionClosed):
(WebKit::SessionStorageManager::addStorageArea):
(WebKit::SessionStorageManager::connectToSessionStorageArea):
(WebKit::SessionStorageManager::disconnectFromStorageArea):
(WebKit::SessionStorageManager::cloneStorageArea):

  • NetworkProcess/storage/SessionStorageManager.h: Added.
  • NetworkProcess/storage/StorageAreaBase.cpp: Added. Some code is moved from NetworkProcess/WebStoreage/StorageArea.cpp.

(WebKit::StorageAreaBase::StorageAreaBase):
(WebKit::StorageAreaBase::addListener):
(WebKit::StorageAreaBase::removeListener):
(WebKit::StorageAreaBase::hasListeners const):
(WebKit::StorageAreaBase::notifyListenersAboutClear):
(WebKit::StorageAreaBase::dispatchEvents const):

  • NetworkProcess/storage/StorageAreaBase.h: Added. Some code is moved from NetworkProcess/WebStoreage/StorageArea.h.

(WebKit::StorageAreaBase::identifier const):
(WebKit::StorageAreaBase::origin const):
(WebKit::StorageAreaBase::quota const):

  • NetworkProcess/storage/StorageAreaRegistry.cpp: Added.

(WebKit::StorageAreaRegistry::registerStorageArea):
(WebKit::StorageAreaRegistry::unregisterStorageArea):
(WebKit::StorageAreaRegistry::getStorageArea):

  • NetworkProcess/storage/StorageAreaRegistry.h: Added.
  • Scripts/generate-unified-sources.sh:
  • Sources.txt:
  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::getLocalStorageDetails): Deleted.

  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::excludeDirectoryFromBackup):

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::parameters):
(WebKit::WebsiteDataStore::getLocalStorageDetails): Deleted.

  • UIProcess/WebsiteData/WebsiteDataStore.h:
  • UnifiedSources-output.xcfilelist:
  • WebKit.xcodeproj/project.pbxproj:
  • WebProcess/WebStorage/StorageAreaMap.cpp:

(WebKit::StorageAreaMap::setItem):
(WebKit::StorageAreaMap::removeItem):
(WebKit::StorageAreaMap::clear):
(WebKit::StorageAreaMap::ensureMap):
(WebKit::StorageAreaMap::connect):
(WebKit::StorageAreaMap::disconnect):

  • WebProcess/WebStorage/StorageNamespaceImpl.cpp:

(WebKit::StorageNamespaceImpl::copy):

11:18 PM Changeset in webkit [286935] by commit-queue@webkit.org
  • 2 edits in trunk/Source/JavaScriptCore

[RISCV64] Add MacroAssemblerRISCV64 implementations for trivial general-purpose-register operations
https://bugs.webkit.org/show_bug.cgi?id=233992

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-12
Reviewed by Yusuke Suzuki.

Add implementations for the trivial general-purpose-register operations
in MacroAssemblerRISCV64. This covers non-patchable loads and stores,
shifts, logical operations, zero- and sign-extensions, moves and swaps,
stack operations as well as miscellaneous operations like aborts,
breakpoints and nops.

The loadImmediate helper methods are added to handle loading of
different types of immediate values. This should replace move() calls
when a sign-extended immediate load is desired, whereas move() for
a 32-bit immediate is expected to perform no sign extension.

  • assembler/MacroAssemblerRISCV64.h:

(JSC::MacroAssemblerRISCV64::add32):
(JSC::MacroAssemblerRISCV64::add64):
(JSC::MacroAssemblerRISCV64::sub32):
(JSC::MacroAssemblerRISCV64::mul32):
(JSC::MacroAssemblerRISCV64::lshift32):
(JSC::MacroAssemblerRISCV64::lshift64):
(JSC::MacroAssemblerRISCV64::rshift32):
(JSC::MacroAssemblerRISCV64::rshift64):
(JSC::MacroAssemblerRISCV64::urshift32):
(JSC::MacroAssemblerRISCV64::urshift64):
(JSC::MacroAssemblerRISCV64::load8):
(JSC::MacroAssemblerRISCV64::load8SignedExtendTo32):
(JSC::MacroAssemblerRISCV64::load16):
(JSC::MacroAssemblerRISCV64::load16Unaligned):
(JSC::MacroAssemblerRISCV64::load16SignedExtendTo32):
(JSC::MacroAssemblerRISCV64::load32):
(JSC::MacroAssemblerRISCV64::load32WithUnalignedHalfWords):
(JSC::MacroAssemblerRISCV64::load64):
(JSC::MacroAssemblerRISCV64::loadPair32):
(JSC::MacroAssemblerRISCV64::store8):
(JSC::MacroAssemblerRISCV64::store16):
(JSC::MacroAssemblerRISCV64::store32):
(JSC::MacroAssemblerRISCV64::store64):
(JSC::MacroAssemblerRISCV64::storePair32):
(JSC::MacroAssemblerRISCV64::zeroExtend8To32):
(JSC::MacroAssemblerRISCV64::zeroExtend16To32):
(JSC::MacroAssemblerRISCV64::zeroExtend32ToWord):
(JSC::MacroAssemblerRISCV64::signExtend8To32):
(JSC::MacroAssemblerRISCV64::signExtend16To32):
(JSC::MacroAssemblerRISCV64::signExtend32ToPtr):
(JSC::MacroAssemblerRISCV64::and32):
(JSC::MacroAssemblerRISCV64::and64):
(JSC::MacroAssemblerRISCV64::or8):
(JSC::MacroAssemblerRISCV64::or16):
(JSC::MacroAssemblerRISCV64::or32):
(JSC::MacroAssemblerRISCV64::or64):
(JSC::MacroAssemblerRISCV64::xor32):
(JSC::MacroAssemblerRISCV64::xor64):
(JSC::MacroAssemblerRISCV64::not32):
(JSC::MacroAssemblerRISCV64::not64):
(JSC::MacroAssemblerRISCV64::neg32):
(JSC::MacroAssemblerRISCV64::neg64):
(JSC::MacroAssemblerRISCV64::move):
(JSC::MacroAssemblerRISCV64::swap):
(JSC::MacroAssemblerRISCV64::push):
(JSC::MacroAssemblerRISCV64::pushPair):
(JSC::MacroAssemblerRISCV64::pop):
(JSC::MacroAssemblerRISCV64::popPair):
(JSC::MacroAssemblerRISCV64::abortWithReason):
(JSC::MacroAssemblerRISCV64::breakpoint):
(JSC::MacroAssemblerRISCV64::nop):
(JSC::MacroAssemblerRISCV64::loadImmediate):

11:16 PM Changeset in webkit [286934] by commit-queue@webkit.org
  • 4 edits in trunk/Source/bmalloc

[libpas] make build.sh, test.sh, build_and_test.sh, and clean.sh work on Linux
https://bugs.webkit.org/show_bug.cgi?id=233821

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-12
Reviewed by Yusuke Suzuki.

Adjust and enhance the shell scripts for building and testing CMake
builds of libpas. In build.sh, the 'cmake' SDK option handling is added,
invoking CMake to produce a libpas build of the desired variant and
configuration. The Debug and Release configuration possibilities map
exactly to the CMAKE_BUILD_TYPE option. The ENABLE_PAS_TESTING option
used for the testing variant is converted into a macro definition that's
passed to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS.

The function declarations are adjusted to use the "fname()" form, making
things runnable on shells that don't support the "function" keyword.

  • libpas/build.sh:
  • libpas/common.sh:
  • libpas/test.sh:
7:23 PM Changeset in webkit [286933] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[IFC][Integration] Enable isolate-override for inline boxes
https://bugs.webkit.org/show_bug.cgi?id=234203

Reviewed by Antti Koivisto.

  • layout/integration/LayoutIntegrationCoverage.cpp: The only reason why plaintext is not enabled yet

is becuase it may change the inline axis direction to RTL. It is going to be enabled together with the RTL support.
(WebCore::LayoutIntegration::canUseForStyle):

6:42 PM Changeset in webkit [286932] by Simon Fraser
  • 6 edits in trunk/Source/WebCore

Ensure that the scrolling thread always commits layer position changes to reduce scrolling stutters
https://bugs.webkit.org/show_bug.cgi?id=234213

Reviewed by Tim Horton.

On a page where CA commits on the main thread take a long time (e.g. because of expensive
painting), it's possible that the main thread has updated the scrolling layer position, and
then the scrolling thread detects that the commit is taking a long time and attempts to
trigger its own commit, but because the layer position property doesn't change, no commit
occurs.

Work around this by setting the layer position to 0,0 and back when we're on the scrolling
thread. Only do this if the scroll position changed since the last display refresh to avoid
triggering redundant commits.

Ideally we'd traverse the scrolling tree and do this for every scrolling node, but scrolling
trees can get large so for now just apply this to the root node.

  • page/scrolling/ScrollingTreeScrollingNode.cpp:

(WebCore::ScrollingTreeScrollingNode::updateScrollPositionAtLastDisplayRefresh):

  • page/scrolling/ScrollingTreeScrollingNode.h:
  • page/scrolling/ThreadedScrollingTree.cpp:

(WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
(WebCore::ThreadedScrollingTree::storeScrollPositionsAtLastDisplayRefresh):

  • page/scrolling/ThreadedScrollingTree.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):

5:46 PM Changeset in webkit [286931] by Alan Bujtas
  • 5 edits in trunk

[LFC][IFC] Add partial unicode-bidi support on inline level boxes
https://bugs.webkit.org/show_bug.cgi?id=234196

Reviewed by Antti Koivisto.

Source/WebCore:

This patch enables partial unicode-bidi processing on all elements (block and inline).

  • layout/formattingContexts/inline/InlineDisplayContentBuilder.cpp:

(WebCore::Layout::InlineDisplayContentBuilder::processBidiContent): The paragraph builder now may
produce valid bidi levels for inline box end type of inline items (see popDirectionalFormatting).

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForStyle):

LayoutTests:

  • platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt: Progression.
5:09 PM Changeset in webkit [286930] by ysuzuki@apple.com
  • 15 edits in trunk/Source/JavaScriptCore

[JSC] Use FixedVector to shrink some of Wasm data structures
https://bugs.webkit.org/show_bug.cgi?id=234206

Reviewed by Saam Barati.

We can use FixedVector to shrink some of Wasm data structures including Wasm::Callee.

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::emitLoopTierUpCheck):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::PatchpointExceptionHandle::generate const):
(JSC::Wasm::B3IRGenerator::emitLoopTierUpCheck):

  • wasm/WasmCallee.cpp:

(JSC::Wasm::LLIntCallee::linkExceptionHandlers):
(JSC::Wasm::OptimizingJITCallee::linkExceptionHandlers):
(JSC::Wasm::OptimizingJITCallee::stackmap const):

  • wasm/WasmCallee.h:

(JSC::Wasm::Callee::hasExceptionHandlers const):
(JSC::Wasm::JITCallee::wasmToWasmCallsites):
(JSC::Wasm::OptimizingJITCallee::OptimizingJITCallee):

  • wasm/WasmCodeBlock.cpp:

(JSC::Wasm::CodeBlock::CodeBlock):

  • wasm/WasmCodeBlock.h:
  • wasm/WasmHandlerInfo.cpp:

(JSC::Wasm::HandlerInfo::handlerForIndex):

  • wasm/WasmHandlerInfo.h:
  • wasm/WasmOSREntryData.h:

(JSC::Wasm::OSREntryData::OSREntryData):
(JSC::Wasm::OSREntryData::values):
(JSC::Wasm::OSREntryValue::OSREntryValue): Deleted.
(JSC::Wasm::OSREntryValue::type const): Deleted.

  • wasm/WasmPlan.cpp:

(JSC::Wasm::Plan::updateCallSitesToCallUs):

  • wasm/WasmTierUpCount.cpp:

(JSC::Wasm::TierUpCount::addOSREntryData):

  • wasm/WasmTierUpCount.h:
  • wasm/js/JSWebAssemblyCodeBlock.cpp:

(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):

  • wasm/js/JSWebAssemblyCodeBlock.h:
3:49 PM Changeset in webkit [286929] by Alan Bujtas
  • 3 edits in trunk/Source/WebCore

[LFC][IFC] Add partial unicode-bidi support on the block container
https://bugs.webkit.org/show_bug.cgi?id=234195

Reviewed by Antti Koivisto.

'unicode-bidi: plaintext' on the block container may change the base directionality of
the container itself. We only support LTR inline axis direction.

  • layout/formattingContexts/inline/InlineItemsBuilder.cpp:

(WebCore::Layout::handleEnterExitBidiContext):
(WebCore::Layout::buildBidiParagraph): Add control character for the unicode-bidi property on the block container.
(WebCore::Layout::InlineItemsBuilder::breakAndComputeBidiLevels):

  • layout/integration/LayoutIntegrationCoverage.cpp:

(WebCore::LayoutIntegration::canUseForStyle):
(WebCore::LayoutIntegration::canUseForRenderInlineChild):
(WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
(WebCore::LayoutIntegration::canUseForLineLayoutAfterStyleChange):

2:10 PM Changeset in webkit [286928] by Alan Bujtas
  • 6 edits
    2 adds in trunk

[LFC][IFC] Ignore zero width glyphs while collecting fallback fonts
https://bugs.webkit.org/show_bug.cgi?id=234210

Reviewed by Antti Koivisto.

Source/WebCore:

Taking zero width glyphs (e.g. control characters) into consideration while collecting
fallback font information may result in incorrect line height and baseline positioning.

The logic in this patch matches with WidthIterator::commitCurrentFontRange (used by legacy line layout).
It is measured to have only a slight perf impact on layout microbenchmarks (~1%).
Alternatively we could check against unicode ranges to omit certain glyphs.

Test: fast/text/fallback-font-and-zero-width-glyph.html

  • layout/formattingContexts/inline/text/TextUtil.cpp:

(WebCore::Layout::fallbackFontsForRunWithIterator):

LayoutTests:

  • fast/text/fallback-font-and-zero-width-glyph-expected.html: Added.
  • fast/text/fallback-font-and-zero-width-glyph.html: Added.
12:21 PM Changeset in webkit [286927] by Fujii Hironori
  • 2 edits in trunk/LayoutTests

[WinCairo] Unreviewed test gardening

  • platform/wincairo/TestExpectations:
9:44 AM Changeset in webkit [286926] by commit-queue@webkit.org
  • 17 edits in trunk/LayoutTests

[GLIB] Update test expectations and baselines. Unreviewed test gardening.
https://bugs.webkit.org/show_bug.cgi?id=234209

Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-12-12

  • platform/glib/TestExpectations:
  • platform/glib/imported/w3c/web-platform-tests/css/cssom-view/getBoundingClientRect-shy-expected.txt:
  • platform/glib/svg/css/getComputedStyle-basic-expected.txt:
  • platform/glib/webgl/1.0.3/conformance/glsl/misc/shaders-with-name-conflicts-expected.txt:
  • platform/gtk/TestExpectations:
  • platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/datetime-local-expected.txt:
  • platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/time-2-expected.txt:
  • platform/wpe/css2.1/t0805-c5518-brdr-t-01-e-expected.txt:
  • platform/wpe/css2.1/t0805-c5519-brdr-r-01-e-expected.txt:
  • platform/wpe/css2.1/t0805-c5520-brdr-b-01-e-expected.txt:
  • platform/wpe/css2.1/t0805-c5521-brdr-l-01-e-expected.txt:
  • platform/wpe/css2.1/t0805-c5521-ibrdr-l-00-a-expected.txt:
  • platform/wpe/imported/w3c/web-platform-tests/selection/selection-select-all-move-input-crash-expected.txt:
9:31 AM Changeset in webkit [286925] by weinig@apple.com
  • 17 edits
    1 copy in trunk

Pipe ColorInterpolationMethod into Gradient
https://bugs.webkit.org/show_bug.cgi?id=234205

Reviewed by Antti Koivisto.

Source/WebCore:

There is no functional change yet, this just adds a required ColorInterpolationMethod parameter to
Gradient, which for the moment has to be SRGB and non-premultiplied alpha. Subsequent changes will
support for specifying an interpolation method via CSS gradients as well as implementing support
for that in the platform gradient backends.

Also moves the ColorInterpolationMethod struct into its own file as it was getting quite long.

  • Headers.cmake:
  • WebCore.xcodeproj/project.pbxproj:
  • css/CSSGradientValue.cpp:

(WebCore::CSSGradientValue::equals const):
(WebCore::CSSLinearGradientValue::createGradient):
(WebCore::CSSRadialGradientValue::createGradient):
(WebCore::CSSConicGradientValue::createGradient):

  • css/CSSGradientValue.h:

(WebCore::CSSGradientValue::CSSGradientValue):
(WebCore::CSSGradientValue::colorInterpolationMethod const):

  • css/parser/CSSPropertyParserHelpers.cpp:

(WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
(WebCore::CSSPropertyParserHelpers::consumeDeprecatedRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeRadialGradient):
(WebCore::CSSPropertyParserHelpers::consumeLinearGradient):
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):

  • html/HTMLInputElement.cpp:

(WebCore::autoFillStrongPasswordMaskImage):

  • html/canvas/CanvasGradient.cpp:

(WebCore::CanvasGradient::CanvasGradient):

  • platform/graphics/ColorInterpolation.h:

(WebCore::interpolateColorComponents):
(WebCore::ColorInterpolationMethod::encode const): Deleted.
(WebCore::ColorInterpolationMethod::decode): Deleted.

  • platform/graphics/ColorInterpolationMethod.h: Added.

(WebCore::ColorInterpolationMethod::encode const):
(WebCore::ColorInterpolationMethod::decode):
(WebCore::add):
(WebCore::operator==):

  • platform/graphics/Gradient.cpp:

(WebCore::Gradient::create):
(WebCore::Gradient::Gradient):
(WebCore::Gradient::hash const):

  • platform/graphics/Gradient.h:

(WebCore::Gradient::encode const):
(WebCore::Gradient::decode):

  • rendering/RenderThemeIOS.mm:

(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::checkboxRadioBackgroundGradient):
(WebCore::RenderThemeIOS::paintColorWellDecorations):

  • rendering/svg/RenderSVGResourceLinearGradient.cpp:

(WebCore::RenderSVGResourceLinearGradient::buildGradient const):

  • rendering/svg/RenderSVGResourceRadialGradient.cpp:

(WebCore::RenderSVGResourceRadialGradient::buildGradient const):

Tools:

Update calls to Gradient::create() to pass the now required ColorInterpolationMethod.

  • TestWebKitAPI/Tests/WebCore/DisplayListTests.cpp:

(TestWebKitAPI::createGradient):

  • TestWebKitAPI/Tests/WebCore/cg/BifurcatedGraphicsContextTestsCG.cpp:

(TestWebKitAPI::TEST):

9:29 AM Changeset in webkit [286924] by Alan Bujtas
  • 2 edits in trunk/LayoutTests

IFC progression after r286121.

Unreviewed gardening.

1:05 AM Changeset in webkit [286923] by graouts@webkit.org
  • 3 edits
    2 adds in trunk/LayoutTests

Add a test for document.timeline.maximumFrameRate
https://bugs.webkit.org/show_bug.cgi?id=234200

Reviewed by Dean Jackson.

Bug 234161 added a new document.timeline.maximumFrameRate property but didn't feature
a test. This new test checks that we have a minimum of 60fps reported.

  • platform/mac-wk1/TestExpectations:
  • platform/win/TestExpectations:
  • webanimations/frame-rate/document-timeline-maximum-frame-rate-expected.txt: Added.
  • webanimations/frame-rate/document-timeline-maximum-frame-rate.html: Added.

Dec 11, 2021:

7:04 PM Changeset in webkit [286922] by don.olmstead@sony.com
  • 8 edits
    2 deletes in trunk/Source/WebCore

SharedBuffer should use WTF::FileSystem when creating from a file
https://bugs.webkit.org/show_bug.cgi?id=233598
<rdar://problem/86123732>

Reviewed by Chris Dumez.

Remove platform specific implementations of SharedBuffer::createFromReadingFile and use
FileSystem::readEntireFile instead when creating a SharedBuffer from a file. The function
was only used within SharedBuffer::createWithContentsOfFile so the implementation is just
moved into that function.

  • PlatformFTW.cmake:
  • PlatformPlayStation.cmake:
  • PlatformWin.cmake:
  • platform/SharedBuffer.cpp:

(WebCore::SharedBuffer::createWithContentsOfFile):

  • platform/SharedBuffer.h:
  • platform/cocoa/SharedBufferCocoa.mm:

(WebCore::SharedBuffer::createFromReadingFile): Deleted.

  • platform/glib/SharedBufferGlib.cpp:

(WebCore::SharedBuffer::createFromReadingFile): Deleted.

  • platform/posix/SharedBufferPOSIX.cpp: Removed.
  • platform/win/SharedBufferWin.cpp: Removed.
6:08 PM Changeset in webkit [286921] by Alan Bujtas
  • 2 edits
    1 copy
    1 add in trunk/LayoutTests

fast/borders/bidi-002.html is failing on Monterey bots.
https://bugs.webkit.org/show_bug.cgi?id=234204

Unreviewed gardening.

  • platform/mac-bigsur/fast/borders/bidi-002-expected.txt: Copied from LayoutTests/platform/mac/fast/borders/bidi-002-expected.txt.
  • platform/mac/fast/borders/bidi-002-expected.txt:
4:39 PM Changeset in webkit [286920] by sbarati@apple.com
  • 14 edits in trunk/Source/JavaScriptCore

Teach the sampling profiler how to display origin data for B3 Wasm
https://bugs.webkit.org/show_bug.cgi?id=234097

Reviewed by Yusuke Suzuki.

This teaches the SamplingProfiler how to gather origin data for
Wasm. We reuse the PCToCodeOriginMap from JS, and store the wasm
function offset data inside of CodeOrigin's BytecodeIndex.

For now, this patch is only doing this for B3, because the Air backend
doesn't currently generate filled in OpcodeOrigin data. We'll fix that
in: https://bugs.webkit.org/show_bug.cgi?id=234182

Also, this capability isn't yet supported in Web Inspector. We'll want
to do that in a future change as we improve Web Inspector's ability to
debug Wasm code. When that time comes, we'll have to generate the
PCToCodeOriginMap based on debugging info, and not just 'useSamplingProfiler'
JSC option.

The data now shows up like this for hottest bytecodes:

Hottest bytecodes as <numSamples 'functionName#hash:JITType:bytecodeIndex'>

524 '<?>.wasm-function[2373]:OMG:0x21a'
414 '<?>.wasm-function[2363]:OMG:0x1ae'
395 '<?>.wasm-function[2373]:OMG:0x418'
354 '<?>.wasm-function[2373]:OMG:0x34f'
270 '<?>.wasm-function[2373]:OMG:0x352'
256 '<?>.wasm-function[2363]:OMG:0x152'

  • ftl/FTLCompile.cpp:

(JSC::FTL::compile):

  • jit/PCToCodeOriginMap.cpp:

(JSC::PCToCodeOriginMapBuilder::PCToCodeOriginMapBuilder):

  • jit/PCToCodeOriginMap.h:
  • runtime/SamplingProfiler.cpp:

(JSC::FrameWalker::recordJITFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::reportTopBytecodes):

  • runtime/SamplingProfiler.h:
  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::origin):
(JSC::Wasm::parseAndCompileAir):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::parseAndCompile):
(JSC::Wasm::computePCToCodeOriginMap):

  • wasm/WasmB3IRGenerator.h:

(): Deleted.

  • wasm/WasmBBQPlan.cpp:

(JSC::Wasm::BBQPlan::work):
(JSC::Wasm::BBQPlan::didCompleteCompilation):
(JSC::Wasm::BBQPlan::initializeCallees):

  • wasm/WasmCalleeRegistry.h:

(JSC::Wasm::CalleeRegistry::unregisterCallee):
(JSC::Wasm::CalleeRegistry::addPCToCodeOriginMap):
(JSC::Wasm::CalleeRegistry::WTF_REQUIRES_LOCK):

  • wasm/WasmOMGPlan.cpp:

(JSC::Wasm::OMGPlan::work):

  • wasm/WasmOpcodeOrigin.h:

(JSC::Wasm::OpcodeOrigin::OpcodeOrigin):

4:38 PM Changeset in webkit [286919] by timothy_horton@apple.com
  • 7 edits in trunk/Source/WebKit

Momentum Event Dispatcher: Tail frames are the wrong velocity if momentum event dispatch rate doesn't match screen refresh rate
https://bugs.webkit.org/show_bug.cgi?id=234168
<rdar://problem/86247557>

Reviewed by Simon Fraser.

In r286671, I scaled the tail frames into the momentum event disaptch
rate, but they are actually always dispatched at display refresh
frequency. In many cases these things are the same, but in some
cases can differ (most commonly a 120Hz display with 60Hz event dispatch),
so to always have the tail move at the right rate, scale into the display
refresh rate instead).

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::windowScreenDidChange):

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::pageScreenDidChange):

  • WebProcess/WebPage/EventDispatcher.h:
  • WebProcess/WebPage/EventDispatcher.messages.in:
  • WebProcess/WebPage/MomentumEventDispatcher.cpp:

(WebKit::MomentumEventDispatcher::didStartMomentumPhase):
(WebKit::MomentumEventDispatcher::displayProperties const):
(WebKit::MomentumEventDispatcher::startDisplayLink):
(WebKit::MomentumEventDispatcher::stopDisplayLink):
(WebKit::MomentumEventDispatcher::pageScreenDidChange):
(WebKit::MomentumEventDispatcher::displayWasRefreshed):
(WebKit::MomentumEventDispatcher::displayID const): Deleted.

  • WebProcess/WebPage/MomentumEventDispatcher.h:

Plumb and store the nominal display refresh rate.

(WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
Scale the tail frames from the 60Hz ideal rate into the display refresh
rate, instead of the event dispatch rate.

Incoming events still scale *in* from the event dispatch rate, since
that's... the rate they come at.

4:29 PM Changeset in webkit [286918] by Chris Dumez
  • 17 edits in trunk/Source/WebCore

ContextDestructionObserver::m_scriptExecutionContext should be private
https://bugs.webkit.org/show_bug.cgi?id=234184

Reviewed by Youenn Fablet.

ContextDestructionObserver::m_scriptExecutionContext should be private. It is poor encapsulation
to have protected data members.

  • Modules/encryptedmedia/CDM.cpp:

(WebCore::CDM::getSupportedConfiguration):

  • Modules/encryptedmedia/MediaKeySystemRequest.cpp:

(WebCore::MediaKeySystemRequest::topLevelDocumentOrigin const):
(WebCore::MediaKeySystemRequest::start):
(WebCore::MediaKeySystemRequest::deny):
(WebCore::MediaKeySystemRequest::stop):
(WebCore::MediaKeySystemRequest::document const):

  • Modules/geolocation/Geolocation.cpp:

(WebCore::Geolocation::watchPosition):

  • Modules/mediastream/RTCDataChannel.h:
  • Modules/mediastream/RTCDtlsTransport.h:
  • Modules/mediastream/RTCIceTransport.h:
  • Modules/mediastream/RTCSctpTransport.h:
  • Modules/mediastream/UserMediaRequest.cpp:

(WebCore::UserMediaRequest::userMediaDocumentOrigin const):
(WebCore::UserMediaRequest::topLevelDocumentOrigin const):
(WebCore::UserMediaRequest::start):
(WebCore::UserMediaRequest::allow):
(WebCore::UserMediaRequest::deny):
(WebCore::UserMediaRequest::stop):
(WebCore::UserMediaRequest::document const):

  • Modules/webaudio/AudioContext.cpp:

(WebCore::AudioContext::mediaSessionGroupIdentifier const):

  • Modules/webaudio/BaseAudioContext.cpp:

(WebCore::BaseAudioContext::document const):
(WebCore::BaseAudioContext::origin const):
(WebCore::BaseAudioContext::addConsoleMessage):

  • Modules/webdatabase/DatabaseContext.cpp:

(WebCore::DatabaseContext::allowDatabaseAccess const):
(WebCore::DatabaseContext::databaseExceededQuota):
(WebCore::DatabaseContext::securityOrigin const):
(WebCore::DatabaseContext::isContextThread const):

  • Modules/webxr/WebXRSystem.cpp:

(WebCore::WebXRSystem::DummyInlineDevice::requestFrame):

  • dom/ActiveDOMObject.cpp:

(WebCore::ActiveDOMObject::~ActiveDOMObject):
(WebCore::ActiveDOMObject::suspendIfNeeded):

  • dom/ContextDestructionObserver.h:
  • dom/MessagePort.cpp:

(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::messageAvailable):
(WebCore::MessagePort::start):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::dispatchEvent):
(WebCore::MessagePort::virtualHasPendingActivity const):

  • html/track/VTTRegion.cpp:

(WebCore::VTTRegion::getDisplayTree):
(WebCore::VTTRegion::prepareRegionDisplayTree):

12:48 PM Changeset in webkit [286917] by don.olmstead@sony.com
  • 15 edits in trunk/Source

Add a std::nullptr_t constructor for RefPtr
https://bugs.webkit.org/show_bug.cgi?id=234192

Reviewed by Yusuke Suzuki.

Source/WebCore:

Remove uses of 0 when creating an empty RefPtr.

  • accessibility/AccessibilityObject.cpp:

(WebCore::Accessibility::findMatchingObjects):

  • platform/graphics/cairo/CairoUtilities.cpp:

(WebCore::drawPatternToCairoContext):

  • platform/graphics/texmap/TextureMapperGL.cpp:

(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::drawTexturePlanarYUV):
(WebCore::TextureMapperGL::drawTextureSemiPlanarYUV):
(WebCore::TextureMapperGL::drawTexturePackedYUV):

  • platform/graphics/win/IconWin.cpp:

(WebCore::Icon::createIconForFiles):

  • platform/graphics/win/ImageCGWin.cpp:

(WebCore::BitmapImage::create):

  • platform/graphics/win/ImageCairoWin.cpp:

(WebCore::BitmapImage::create):

  • platform/win/DragImageWin.cpp:

(WebCore::dragLabelFont):

Source/WebKit:

Remove uses of 0 when creating an empty RefPtr.

  • WebProcess/win/WebProcessWin.cpp:

(loadResourceIntoBuffer):

Source/WebKitLegacy/win:

Remove uses of 0 when creating an empty RefPtr.

  • FullscreenVideoController.cpp:

(FullscreenVideoController::draw):

  • WebArchive.cpp:

(WebArchive::createInstance):

Source/WTF:

Add the constexpr constructor RefPtr(std::nullptr_t) with the same behavior as the default
constructor. Both std::unique_ptr and std::shared_ptr have this same overload to optimize
for the nullptr case. As an added bonus this also makes it so 0 can't fill in as a
nullptr since the ambiguity will cause a compilation error.

  • wtf/RefPtr.h:

(WTF::RefPtr::RefPtr):

10:28 AM Changeset in webkit [286916] by Antti Koivisto
  • 28 edits in trunk/Source

Remove redundant StyleRule::Type enum
https://bugs.webkit.org/show_bug.cgi?id=234156

Reviewed by Alan Bujtas.

Source/WebCore:

Remove redundant CSSRule::STYLE_RULE etc enum values and just use StyleRuleType enum class.

  • bindings/js/JSCSSRuleCustom.cpp:

(WebCore::toJSNewlyCreated):

  • bindings/scripts/CodeGenerator.pm:

(GenerateCompileTimeCheckForEnumsIfNeeded):

Add 'ConstantsEnum' attribute to generate static_asserts for constants that match an enum class.

  • bindings/scripts/IDLAttributes.json:
  • css/CSSCounterStyleRule.h:
  • css/CSSFontFaceRule.h:
  • css/CSSFontPaletteValuesRule.h:
  • css/CSSImportRule.h:
  • css/CSSKeyframeRule.h:
  • css/CSSKeyframesRule.h:
  • css/CSSLayerBlockRule.h:
  • css/CSSLayerStatementRule.h:
  • css/CSSMediaRule.h:
  • css/CSSNamespaceRule.h:
  • css/CSSPageRule.h:
  • css/CSSRule.cpp:
  • css/CSSRule.h:

(WebCore::CSSRule::typeForBindings const):

  • css/CSSRule.idl:
  • css/CSSStyleRule.h:
  • css/CSSSupportsRule.h:
  • css/CSSUnknownRule.h:
  • css/StyleRuleType.h:
  • style/InspectorCSSOMWrappers.cpp:

(WebCore::Style::InspectorCSSOMWrappers::collect):

Source/WebKitLegacy/mac:

  • DOM/DOMCSS.mm:

(kitClass):

  • DOM/DOMCSSRule.mm:

(-[DOMCSSRule type]):

10:20 AM Changeset in webkit [286915] by graouts@webkit.org
  • 14 edits
    5 adds in trunk

Expose a frameRate property to Web Animations
https://bugs.webkit.org/show_bug.cgi?id=234174
rdar://86338983

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Rebaseline the output of a Web Animations WPT which lists all enumerable Animation properties.

  • web-platform-tests/web-animations/interfaces/Animation/style-change-events-expected.txt:

Source/WebCore:

Expose a new frameRate property to the Animation interface. This property
accepts either a value from the new AnimationFrameRatePreset enum (auto,
low, high or highest) or a FramesPerSecond explicit value. This property
is governed by an off-by-default runtime setting.

When we obtain the frame rate from the IDL bindings, we record an "effective"
frame rate which is either a null value for the default frame rate, or an
explicit FramesPerSecond value for any value above or below it.

Test: webanimations/frame-rate/animation-frame-rate.html

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Headers.cmake:
  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • animation/AnimationFrameRatePreset.h: Added.
  • animation/AnimationFrameRatePreset.idl: Added.
  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::setBindingsFrameRate):
(WebCore::WebAnimation::setEffectiveFrameRate):

  • animation/WebAnimation.h:

(WebCore::WebAnimation::bindingsFrameRate const):
(WebCore::WebAnimation::frameRate const):

  • animation/WebAnimation.idl:

LayoutTests:

Add a new test checking whether valid values are accepted and invalid values
rejected without effect.

  • webanimations/frame-rate/animation-frame-rate-expected.txt: Added.
  • webanimations/frame-rate/animation-frame-rate.html: Added.
10:17 AM Changeset in webkit [286914] by Lauro Moura
  • 16 edits in trunk/Source

Non-unified build fixes, mid mid December 2021 edition
https://bugs.webkit.org/show_bug.cgi?id=234191

Unreviewed build fix.

A few more fixes already a couple of days after the last fix.

Full build still failing due to the issue discussed on bug226088.

All changes are inclusion of missing headers.

Source/WebCore:

  • html/shadow/DateTimeEditElement.cpp:
  • platform/graphics/displaylists/DisplayListRecorder.cpp:
  • workers/WorkerDebuggerProxy.h:
  • workers/shared/SharedWorkerManager.cpp:
  • workers/shared/SharedWorkerProxy.cpp:
  • workers/shared/SharedWorkerScriptLoader.cpp:
  • workers/shared/SharedWorkerScriptLoader.h:
  • workers/shared/SharedWorkerThread.cpp:

Source/WebKit:

  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
  • WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
8:59 AM Changeset in webkit [286913] by mark.lam@apple.com
  • 5 edits in trunk/Source

Automatically forbid JS execution when we throw a TerminationException.
https://bugs.webkit.org/show_bug.cgi?id=234188

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

For Worker threads, we throw a TerminationException when Worker.terminate() is
called. Once the TerminationException is thrown, we expect to completely unwind
out of any JS frames on the stack, and we also expect the client to never call
into JS again. Previously, WebCore will call VM:setExecutionForbidden() to flag
that we should not re-enter the VM anymore. On JSC side, this executionForbidden()
is used to prevent micro-tasks from firing. On WebCore side, it is used to prevent
many things from running, including firing events.

Previously, we reply on WebCore side to catch the TerminationException, determine
that it is the TerminationException, and then call VM:setExecutionForbidden().
This is tedious and error prone as there may be places in WebCore that should call
VM:setExecutionForbidden() but is missed. This has been the source of some bugs
with the handling of the Worker termination in the past.

In this patch, we change VM to setExecutionForbidden() immediately when we throw
the TerminationException, but only if VM::m_executionForbiddenOnTermination is set.
Currently, we'll only set VM:m_executionForbiddenOnTermination for Workers because
for legacy reasons, other clients of JSC has the ability to re-enter the VM after
a TerminationException unwinds out (which is ok to do when used under some
controlled conditions). Until we can determine that it is safe to adopt this
"execution forbidden on termination" behavior universally, we'll adopt it only for
workers.

In a subsequent patch, we can also look into removing all the places in WebCore
that checks for TerminationException in order to call VM:setExecutionForbidden().
We'll leave those in place for now though they should be redundant after this patch.

Also add some ASSERTs to document invariants regarding states used in the handing
of TerminationException.

  • runtime/VM.cpp:

(JSC::VM::setException):
(JSC::VM::throwTerminationException):

  • runtime/VM.h:

(JSC::VM::forbidExecutionOnTermination):

Source/WebCore:

Enable "execution forbidden on termination" behavior for workers.

  • workers/WorkerOrWorkletScriptController.cpp:

(WebCore::WorkerOrWorkletScriptController::WorkerOrWorkletScriptController):

8:55 AM Changeset in webkit [286912] by mark.lam@apple.com
  • 2 edits in trunk/Source/WebCore

WebCore::createDOMException() should abort early if termination is pending.
https://bugs.webkit.org/show_bug.cgi?id=234190

Reviewed by Darin Adler.

Attempting to create Error objects may re-enter the VM, which we should not do
when termination is pending.

This issue manifested as an ASSERT failure, and was discovered while running
http/wpt/fetch/ layout tests with a Debug build on an M1 Mac. It also manifested
on some testing bots.

  • bindings/js/JSDOMExceptionHandling.cpp:

(WebCore::createDOMException):

7:33 AM Changeset in webkit [286911] by commit-queue@webkit.org
  • 50 edits
    10 deletes in trunk

Unreviewed, reverting r286893.
https://bugs.webkit.org/show_bug.cgi?id=234197

Breaks the build

Reverted changeset:

"[macOS] Add new screen and window capture backend"
https://bugs.webkit.org/show_bug.cgi?id=234029
https://commits.webkit.org/r286893

6:37 AM Changeset in webkit [286910] by aakash_jain@apple.com
  • 2 edits in trunk

Update my github username.

Unreviewed.

  • metadata/contributors.json:
5:36 AM Changeset in webkit [286909] by jh718.park@samsung.com
  • 2 edits in trunk/Source/WebCore

Unreviewed. CSSCalcOperationNode::allowsNegativePercentageReference() should be const member function.

In r286897, the above method's const keyword was missed out, so add it.

No new tests, no new behaviours.

  • css/calc/CSSCalcOperationNode.h:
1:00 AM Changeset in webkit [286908] by jer.noble@apple.com
  • 56 edits
    17 copies
    11 adds in trunk

Source/WebCore:
Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack.
https://bugs.webkit.org/show_bug.cgi?id=230841

Reviewed by Eric Carlson.

Add an experimental property on AudioTrack VideoTrack which contains information about the
underlying media track's configuration. The AudioTrackConfiguration is based on
AudioConfiguration from MediaCapabilities. The VideoTrackConfiguration is based on a
combination of the VideoConfiguration from MediaCapabilities and the VideoColorSpace from
WebCodecs.

The AVFoundation implementation of AVTrackPrivateAVFObjCImpl will extract a NAL unit for the
video codec from the CMFormatDescription containing information about the underlying media,
and pass that NAL unit to utility methods in HEVCUtilities (which should probably be
renamed to CodecUntilities) to extract and create codec configuration strings. It will
extract colorspace information from CMFormatDescriptionExtensions found in the format
description. It will extract framerate, bitrate, width and height, sample rate and channel
count information from the underlying AVAssetTrack. There are shortcomings here, as HLS
streams and MSE streams do not generate framerate or bitrate information in the
AVAssetTrack.

Tests: media/track/audio-track-configuration.html

media/track/video-track-configuration.html

  • CMakeLists.txt:
  • DerivedSources-input.xcfilelist:
  • DerivedSources-output.xcfilelist:
  • DerivedSources.make:
  • Modules/webcodecs/VideoColorPrimaries.h:
  • Modules/webcodecs/VideoColorPrimaries.idl:
  • Modules/webcodecs/VideoColorSpace.h:

(WebCore::VideoColorSpace::create):
(WebCore::VideoColorSpace::primaries const):
(WebCore::VideoColorSpace::setPrimaries):
(WebCore::VideoColorSpace::transfer const):
(WebCore::VideoColorSpace::setTransfer):
(WebCore::VideoColorSpace::matrix const):
(WebCore::VideoColorSpace::setMatrix):
(WebCore::VideoColorSpace::fullRange const):
(WebCore::VideoColorSpace::setfFullRange):
(WebCore::VideoColorSpace::VideoColorSpace):

  • Modules/webcodecs/VideoColorSpace.idl:
  • Modules/webcodecs/VideoColorSpaceInit.h:
  • Modules/webcodecs/VideoColorSpaceInit.idl:
  • Modules/webcodecs/VideoMatrixCoefficients.h:
  • Modules/webcodecs/VideoMatrixCoefficients.idl:
  • Modules/webcodecs/VideoTransferCharacteristics.h:
  • Modules/webcodecs/VideoTransferCharacteristics.idl:
  • Sources.txt:
  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • html/track/AudioTrack.cpp:

(WebCore::AudioTrack::AudioTrack):
(WebCore::AudioTrack::setPrivate):
(WebCore::AudioTrack::updateConfigurationFromPrivate):

  • html/track/AudioTrack.h:
  • html/track/AudioTrack.idl:
  • html/track/AudioTrackConfiguration.h:

(WebCore::AudioTrackConfiguration::create):
(WebCore::AudioTrackConfiguration::codec const):
(WebCore::AudioTrackConfiguration::setCodec):
(WebCore::AudioTrackConfiguration::sampleRate const):
(WebCore::AudioTrackConfiguration::setSampleRate):
(WebCore::AudioTrackConfiguration::numberOfChannels const):
(WebCore::AudioTrackConfiguration::setNumberOfChannels):
(WebCore::AudioTrackConfiguration::bitrate const):
(WebCore::AudioTrackConfiguration::setBitrate):
(WebCore::AudioTrackConfiguration::AudioTrackConfiguration):

  • html/track/AudioTrackConfiguration.idl:
  • html/track/VideoTrack.cpp:

(WebCore::VideoTrack::VideoTrack):
(WebCore::VideoTrack::setPrivate):
(WebCore::VideoTrack::updateConfigurationFromPrivate):

  • html/track/VideoTrack.h:
  • html/track/VideoTrack.idl:
  • html/track/VideoTrackConfiguration.h: Added.

(WebCore::VideoTrackConfiguration::create):
(WebCore::VideoTrackConfiguration::codec const):
(WebCore::VideoTrackConfiguration::setCodec):
(WebCore::VideoTrackConfiguration::width const):
(WebCore::VideoTrackConfiguration::setWidth):
(WebCore::VideoTrackConfiguration::height const):
(WebCore::VideoTrackConfiguration::setHeight):
(WebCore::VideoTrackConfiguration::colorSpace const):
(WebCore::VideoTrackConfiguration::setColorSpace):
(WebCore::VideoTrackConfiguration::framerate const):
(WebCore::VideoTrackConfiguration::setFramerate):
(WebCore::VideoTrackConfiguration::bitrate const):
(WebCore::VideoTrackConfiguration::setBitrate):
(WebCore::VideoTrackConfiguration::VideoTrackConfiguration):

  • html/track/VideoTrackConfiguration.idl:
  • platform/graphics/AudioTrackPrivate.h:

(WebCore::AudioTrackPrivate::codec const):
(WebCore::AudioTrackPrivate::setCodec):
(WebCore::AudioTrackPrivate::sampleRate const):
(WebCore::AudioTrackPrivate::setSampleRate):
(WebCore::AudioTrackPrivate::numberOfChannels const):
(WebCore::AudioTrackPrivate::setNumberOfChannels):
(WebCore::AudioTrackPrivate::bitrate const):
(WebCore::AudioTrackPrivate::setBitrate):

  • platform/graphics/HEVCUtilities.cpp:

(WebCore::parseAVCCodecParameters):
(WebCore::createAVCCodecParametersString):
(WebCore::parseAVCDecoderConfigurationRecord):
(WebCore::parseHEVCCodecParameters):
(WebCore::createHEVCCodecParametersString):
(WebCore::parseHEVCDecoderConfigurationRecord):
(WebCore::parseDoViDecoderConfigurationRecord):
(WebCore::createDoViCodecParametersString):

  • platform/graphics/HEVCUtilities.h:
  • platform/graphics/PlatformVideoColorPrimaries.h:
  • platform/graphics/PlatformVideoColorSpace.h:

(WebCore::PlatformVideoColorSpace::encode const):
(WebCore::PlatformVideoColorSpace::decode):

  • platform/graphics/PlatformVideoMatrixCoefficients.h:
  • platform/graphics/PlatformVideoTransferCharacteristics.h:
  • platform/graphics/VideoTrackPrivate.h:

(WebCore::VideoTrackPrivate::codec const):
(WebCore::VideoTrackPrivate::setCodec):
(WebCore::VideoTrackPrivate::width const):
(WebCore::VideoTrackPrivate::setWidth):
(WebCore::VideoTrackPrivate::height const):
(WebCore::VideoTrackPrivate::setHeight):
(WebCore::VideoTrackPrivate::colorSpace const):
(WebCore::VideoTrackPrivate::setColorSpace):
(WebCore::VideoTrackPrivate::framerate const):
(WebCore::VideoTrackPrivate::setFramerate):
(WebCore::VideoTrackPrivate::bitrate const):
(WebCore::VideoTrackPrivate::setBitrate):

  • platform/graphics/VideoTrackPrivateClient.h:
  • platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.h:
  • platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:

(WebCore::assetTrackFor):
(WebCore::formatDescriptionFor):
(WebCore::AVTrackPrivateAVFObjCImpl::codec const):
(WebCore::AVTrackPrivateAVFObjCImpl::width const):
(WebCore::AVTrackPrivateAVFObjCImpl::height const):
(WebCore::AVTrackPrivateAVFObjCImpl::colorSpace const):
(WebCore::AVTrackPrivateAVFObjCImpl::framerate const):
(WebCore::AVTrackPrivateAVFObjCImpl::sampleRate const):
(WebCore::AVTrackPrivateAVFObjCImpl::numberOfChannels const):
(WebCore::AVTrackPrivateAVFObjCImpl::bitrate const):

  • platform/graphics/avfoundation/AudioTrackPrivateAVF.h:

(WebCore::AudioTrackPrivateAVF::kind const): Deleted.
(WebCore::AudioTrackPrivateAVF::id const): Deleted.
(WebCore::AudioTrackPrivateAVF::label const): Deleted.
(WebCore::AudioTrackPrivateAVF::language const): Deleted.
(WebCore::AudioTrackPrivateAVF::trackIndex const): Deleted.

  • platform/graphics/avfoundation/FormatDescriptionUtilities.cpp: Added.

(WebCore::presentationSizeFromFormatDescription):
(WebCore::colorSpaceFromFormatDescription):
(WebCore::codecFromFormatDescription):

  • platform/graphics/avfoundation/FormatDescriptionUtilities.h:
  • platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
  • platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:

(WebCore::MediaSelectionOptionAVFObjC::assetTrack const):

  • platform/graphics/avfoundation/VideoTrackPrivateAVF.h:
  • platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm:

(WebCore::AudioTrackPrivateAVFObjC::resetPropertiesFromTrack):

  • platform/graphics/avfoundation/objc/VideoTrackPrivateAVFObjC.cpp:

(WebCore::VideoTrackPrivateAVFObjC::resetPropertiesFromTrack):

  • platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.mm:

(WebCore::VideoTrackPrivateMediaSourceAVFObjC::resetPropertiesFromTrack):

  • platform/graphics/cocoa/VideoTrackPrivateWebM.cpp:

(WebCore::VideoTrackPrivateWebM::codec const):
(WebCore::VideoTrackPrivateWebM::width const):
(WebCore::VideoTrackPrivateWebM::height const):
(WebCore::VideoTrackPrivateWebM::framerate const):

  • platform/graphics/cocoa/VideoTrackPrivateWebM.h:

Source/WebCore/PAL:
Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack.
https://bugs.webkit.org/show_bug.cgi?id=230841

Reviewed by Eric Carlson.

  • pal/cf/CoreMediaSoftLink.cpp:
  • pal/cf/CoreMediaSoftLink.h:
  • pal/spi/cocoa/AVFoundationSPI.h:

Source/WebKit:
Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack.
https://bugs.webkit.org/show_bug.cgi?id=230841

Reviewed by Eric Carlson.

  • GPUProcess/media/RemoteAudioTrackProxy.cpp:

(WebKit::RemoteAudioTrackProxy::configuration):

  • GPUProcess/media/RemoteAudioTrackProxy.h:
  • GPUProcess/media/RemoteVideoTrackProxy.cpp:

(WebKit::RemoteVideoTrackProxy::configuration):
(WebKit::RemoteVideoTrackProxy::updateConfiguration):
(WebKit::RemoteVideoTrackProxy::selectedChanged):
(WebKit::RemoteVideoTrackProxy::idChanged):
(WebKit::RemoteVideoTrackProxy::labelChanged):
(WebKit::RemoteVideoTrackProxy::languageChanged):
(WebKit::RemoteVideoTrackProxy::configurationChanged): Deleted.

  • GPUProcess/media/RemoteVideoTrackProxy.h:
  • GPUProcess/media/TrackPrivateRemoteConfiguration.h:

(WebKit::TrackPrivateRemoteConfiguration::encode const):
(WebKit::TrackPrivateRemoteConfiguration::decode):

  • WebProcess/GPU/media/AudioTrackPrivateRemote.cpp:

(WebKit::AudioTrackPrivateRemote::updateConfiguration):

  • WebProcess/GPU/media/AudioTrackPrivateRemote.h:
  • WebProcess/GPU/media/VideoTrackPrivateRemote.cpp:

(WebKit::VideoTrackPrivateRemote::updateConfiguration):

  • WebProcess/GPU/media/VideoTrackPrivateRemote.h:

Source/WTF:
Add an experimental VideoTrackConfiguration class and accessor on VideoTrack
https://bugs.webkit.org/show_bug.cgi?id=230841

Reviewed by Eric Carlson.

Drive-by change: add a Vector::reverseFindMatching convenience method.

  • Scripts/Preferences/WebPreferencesExperimental.yaml:
  • wtf/Vector.h:

(WTF::Malloc>::reverseFindMatching const):

LayoutTests:
Add an experimental trackConfiguration accessor on AudioTrack & VideoTrack.
https://bugs.webkit.org/show_bug.cgi?id=230841

Reviewed by Eric Carlson.

  • fast/mediastream/MediaStream-video-element-expected.txt:
  • media/content/test-hevc.mp4: Added.
  • media/hevc-codec-parameters-expected.txt:
  • media/hevc-codec-parameters.html:
  • media/hevc-codec-string-expected.txt: Added.
  • media/hevc-codec-string.html: Added.
  • media/track/audio-track-configuration-expected.txt: Added.
  • media/track/audio-track-configuration.html: Added.
  • media/track/video-track-configuration-expected.txt: Added.
  • media/track/video-track-configuration.html: Added.
12:47 AM Changeset in webkit [286907] by jer.noble@apple.com
  • 3 edits in trunk/Source/WebCore

[Cocoa] -[AVPlayerItem liveUpdateInterval] can hang the main thread for ~60ms
https://bugs.webkit.org/show_bug.cgi?id=234131

Reviewed by Eric Carlson.

Direct property access of AVFoundation objects can take tens of milliseconds to return
a value, even for simple properties. This impacts scrolling responsiveness.

-liveUpdateInterval is not KVO-observable, but only changes when -seekableTimeRanges does
as well. Query and cache that property during KVO of -seekableTimeRanges.

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

12:01 AM Changeset in webkit [286906] by mmaxfield@apple.com
  • 3 edits in trunk/LayoutTests

Test gardening after r286889.
https://bugs.webkit.org/show_bug.cgi?id=234171

Unreviewed.

  • platform/mac/TestExpectations:
  • platform/win/TestExpectations:
Note: See TracTimeline for information about the timeline view.