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

Timeline



Jun 24, 2021:

8:30 PM Changeset in webkit [279266] by sihui_liu@apple.com
  • 8 edits in trunk/Source

Remove references to order files
https://bugs.webkit.org/show_bug.cgi?id=227377
rdar://76070556

Reviewed by Mark Lam.

Source/JavaScriptCore:

  • Configurations/JavaScriptCore.xcconfig:

Source/WebCore:

We don't need to refer to order files on iOS now.

  • Configurations/WebCore.xcconfig:

Source/WebKit:

  • Configurations/WebKit.xcconfig:

Source/WebKitLegacy/mac:

  • Configurations/WebKitLegacy.xcconfig:
7:23 PM Changeset in webkit [279265] by commit-queue@webkit.org
  • 18 edits
    1 add in trunk

[WASM-Function-References] Add support for (ref null? $t) type constructor
https://bugs.webkit.org/show_bug.cgi?id=226296

JSTests:

Adds additional tests for uses of (ref $t) and (ref null $t)
types, including with non-null extern/funcrefs.

Patch by Asumu Takikawa <asumu@igalia.com> on 2021-06-24
Reviewed by Yusuke Suzuki.

  • wasm/function-references/ref_types.js: Added.

(module):
(async testRefTypeLocal):
(async testNonNullRefTypeLocal):
(async testRefTypeInSignature):
(async testRefTypeParamCheck):
(async testRefGlobalCheck):
(async testExternFuncrefNonNullCheck):
(async testExternrefCompatibility):
(async testNonNullExternrefIncompatible):
(async testFuncrefCompatibility):
(async testNonNullFuncrefIncompatible):

  • wasm/wasm.json:

Source/JavaScriptCore:

Patch by Asumu Takikawa <asumu@igalia.com> on 2021-06-24
Reviewed by Yusuke Suzuki.

Adds the ref type constructor from the typed function references proposal:

https://github.com/WebAssembly/function-references/blob/master/proposals/function-references/Overview.md

It's also required for the type imports and GC proposals as well. Ref types represent
references to any heap type (including existing funcref and externref) with a specified
nullability.

This requires a new isNullable flag in the type representation. This flag also enables
non-null externref and funcrefs, and hence this commit also adds the necessary checks
at Wasm/JS boundaries.

Non-null reference types also generally cannot be used as function locals.

  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::gTypeIdx):
(JSC::Wasm::AirIRGenerator::tmpForType):
(JSC::Wasm::AirIRGenerator::emitCCall):
(JSC::Wasm::AirIRGenerator::moveOpForValueType):
(JSC::Wasm::AirIRGenerator::AirIRGenerator):
(JSC::Wasm::AirIRGenerator::addLocal):
(JSC::Wasm::AirIRGenerator::addConstant):
(JSC::Wasm::AirIRGenerator::addRefFunc):

  • wasm/WasmCallingConvention.h:

(JSC::Wasm::WasmCallingConvention::marshallLocation const):
(JSC::Wasm::JSCallingConvention::marshallLocation const):

  • wasm/WasmFormat.h:

(JSC::Wasm::isSubtype):
(JSC::Wasm::isValidHeapTypeKind):
(JSC::Wasm::isDefaultableType):

  • wasm/WasmFunctionParser.h:

(JSC::Wasm::FunctionParser<Context>::parse):
(JSC::Wasm::FunctionParser<Context>::parseAnnotatedSelectImmediates):
(JSC::Wasm::FunctionParser<Context>::checkBranchTarget):
(JSC::Wasm::FunctionParser<Context>::parseExpression):

  • wasm/WasmGlobal.cpp:

(JSC::Wasm::Global::get const):
(JSC::Wasm::Global::set):

  • wasm/WasmLLIntGenerator.cpp:

(JSC::Wasm::LLIntGenerator::callInformationForCaller):
(JSC::Wasm::LLIntGenerator::callInformationForCallee):
(JSC::Wasm::LLIntGenerator::addArguments):

  • wasm/WasmParser.h:

(JSC::Wasm::Parser<SuccessType>::parseBlockSignature):
(JSC::Wasm::Parser<SuccessType>::parseValueType):
(JSC::Wasm::Parser<SuccessType>::parseRefType):

  • wasm/WasmSectionParser.cpp:

(JSC::Wasm::SectionParser::parseType):
(JSC::Wasm::SectionParser::parseElement):
(JSC::Wasm::SectionParser::parseInitExpr):
(JSC::Wasm::SectionParser::parseElementSegmentVectorOfExpressions):
(JSC::Wasm::SectionParser::parseGlobalType):

  • wasm/WasmSignature.cpp:

(JSC::Wasm::computeHash):

  • wasm/generateWasmOpsHeader.py:
  • wasm/js/WasmToJS.cpp:

(JSC::Wasm::wasmToJS):

  • wasm/js/WebAssemblyFunction.cpp:

(JSC::JSC_DEFINE_HOST_FUNCTION):
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

  • wasm/js/WebAssemblyFunctionBase.h:

(JSC::WebAssemblyFunctionBase::offsetOfSignatureIndex):

  • wasm/js/WebAssemblyModuleRecord.cpp:

(JSC::WebAssemblyModuleRecord::linkImpl):

  • wasm/wasm.json:
6:27 PM Changeset in webkit [279264] by Ruben Turcios
  • 8 edits in trunk/Source

Versioning.

WebKit-7612.1.21

6:26 PM Changeset in webkit [279263] by Ruben Turcios
  • 8 edits in trunk/Source

Versioning.

WebKit-7612.1.22

6:22 PM Changeset in webkit [279262] by Ruben Turcios
  • 1 copy in tags/Safari-612.1.20.1

Tag Safari-612.1.20.1.

6:18 PM Changeset in webkit [279261] by Ruben Turcios
  • 8 edits in branches/safari-612.1.20-branch/Source

Versioning.

WebKit-7612.1.20.1

5:52 PM Changeset in webkit [279260] by Kocsen Chung
  • 1 copy in tags/Safari-612.1.15.4.5

Tag Safari-612.1.15.4.5.

5:50 PM Changeset in webkit [279259] by Kocsen Chung
  • 2 edits in branches/safari-612.1.15.4-branch/Source/WebCore

Cherry-pick r278838. rdar://problem/79228536

[AppleWin] Fix build failure
https://bugs.webkit.org/show_bug.cgi?id=226966
<rdar://79228536>

Reviewed by Eric Carlson.

Disable warning causing the build failure.

  • platform/cf/MediaAccessibilitySoftLink.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278838 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5:46 PM Changeset in webkit [279258] by Kocsen Chung
  • 8 edits in branches/safari-612.1.15.4-branch/Source

Versioning.

WebKit-7612.1.15.4.5

5:33 PM Changeset in webkit [279257] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

REGRESSION: (r279244) [ Mac ] http/tests/workers/service/postmessage-after-terminate.https.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=227380
<rdar://problem/79748648>

Unreviewed, drop protector added in r279244 inside establishServiceWorkerContext() as it is what caused this test
to time out. I am not sure why this is happening yet but I am doing this partial revert to get us back in a good
state.

  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::establishServiceWorkerContext):

5:06 PM Changeset in webkit [279256] by mark.lam@apple.com
  • 17 edits
    1 add in trunk/Source/JavaScriptCore

Use ldp and stp more for saving / restoring registers on ARM64.
https://bugs.webkit.org/show_bug.cgi?id=227039
rdar://79354736

Reviewed by Saam Barati.

This patch introduces a spooler abstraction in AssemblyHelpers. The spooler
basically batches up load / store operations and emit them as pair instructions
if appropriate.

There are 4 spooler classes:

  1. Spooler
    • template base class for LoadRegSpooler and StoreRegSpooler.
    • encapsulates the batching strategy for load / store pairs.
  1. LoadRegSpooler - specializes Spooler to handle load pairs.
  2. StoreRegSpooler - specializes Spooler to handle store pairs.
  1. CopySpooler
    • handles matching loads with stores.
    • tries to emit loads as load pairs if possible.
    • tries to emot stores as store pairs if possible.
    • ensures that pre-requisite loads are emitted before stores are emitted.
    • other than loads, also support constants and registers as sources of values to be stored. This is useful in OSR exit ramps where we may materialize a stack value to store from constants or registers in addition to values we load from the old stack frame or from a scratch buffer.

In this patch, we also do the following:

  1. Use spoolers in many places so that we can emit load / store pairs instead of single load / stores. This helps shrink JIT code side, and also potentially improves performance.
  1. In DFG::OSRExit::compileExit(), we used to recover constants into a scratch buffer, and then later, load from that scratch buffer to store into the new stack frame(s).

This patch changes it so that we defer constant recovery until the final
loop where we store the recovered value directly into the new stack frame(s).
This saves us the work (and JIT code space) for storing into a scratch buffer
and then reloading from the scratch buffer.

There is one exception: tmp values used by active checkpoints. We need to call
operationMaterializeOSRExitSideState() to materialize the active checkpoint
side state before the final loop where we now recover constants. Hence, we
need these tmp values recovered before hand.

So, we check upfront if we have active checkpoint side state to materialize.
If so, we'll eagerly recover the constants for initializing those tmps.

We also use the CopySpooler in the final loop to emit load / store pairs for
filling in the new stack frame(s).

One more thing: it turns out that the vast majority of constants to be recovered
is simply the undefined value. So, as an optimization, the final loop keeps
the undefined value in a register, and has the spooler store directly from
that register when appropriate. This saves on JIT code to repeatedly materialize
the undefined JSValue constant.

  1. In reifyInlinedCallFrames(), replace the use of GPRInfo::nonArgGPR0 with GPRInfo::regT4. nonArgGPRs are sometimes map to certain regTXs on certain ports. Replacing with regT4 makes it easier to ensure that we're not trashing the register when we use more temp registers.

reifyInlinedCallFrames() will be using emitSaveOrCopyLLIntBaselineCalleeSavesFor()
later where we need more temp registers.

  1. Move the following functions to AssemblyHelpers.cpp. They don't need to be inline functions. Speedometer2 and JetStream2 shows that making these non inline does not hurt performance:

AssemblyHelpers::emitSave(const RegisterAtOffsetList&);
AssemblyHelpers::emitRestore(const RegisterAtOffsetList&);
AssemblyHelpers::emitSaveCalleeSavesFor(const RegisterAtOffsetList*);
AssemblyHelpers::emitSaveOrCopyCalleeSavesFor(...);
AssemblyHelpers::emitRestoreCalleeSavesFor(const RegisterAtOffsetList*);
AssemblyHelpers::copyLLIntBaselineCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer(...);

Also renamed emitSaveOrCopyCalleeSavesFor() to emitSaveOrCopyLLIntBaselineCalleeSavesFor()
because it is only used with baseline codeBlocks.

Results:
Cummulative LinkBuffer profile sizes shrunk by ~2M in aggregate:

base new

===

BaselineJIT: 83827048 (79.943703 MB) => 83718736 (79.840408 MB)

DFG: 56594836 (53.973042 MB) => 56603508 (53.981312 MB)

InlineCache: 33923900 (32.352352 MB) => 33183156 (31.645924 MB)

FTL: 6770956 (6.457287 MB) => 6568964 (6.264652 MB)

DFGOSRExit: 5212096 (4.970642 MB) => 3728088 (3.555382 MB)

CSSJIT: 748428 (730.886719 KB) => 748428 (730.886719 KB)

FTLOSRExit: 692276 (676.050781 KB) => 656884 (641.488281 KB)

YarrJIT: 445280 (434.843750 KB) => 512988 (500.964844 KB)

FTLThunk: 22908 (22.371094 KB) => 22556 (22.027344 KB)

BoundFunctionThunk: 8400 (8.203125 KB) => 10088 (9.851562 KB)

ExtraCTIThunk: 6952 (6.789062 KB) => 6824 (6.664062 KB)

SpecializedThunk: 4508 (4.402344 KB) => 4508 (4.402344 KB)

Thunk: 3912 (3.820312 KB) => 3784 (3.695312 KB)

LLIntThunk: 2908 (2.839844 KB) => 2908 (2.839844 KB)

VirtualThunk: 1248 (1.218750 KB) => 1248 (1.218750 KB)

DFGThunk: 1084 (1.058594 KB) => 444

DFGOSREntry: 216 => 184

JumpIsland: 0

WasmThunk: 0

Wasm: 0

Uncategorized: 0

Total: 188266956 (179.545361 MB) => 185773296 (177.167221 MB)

Speedometer2 and JetStream2 results shows that performance is neutral for this
patch (as measured on an M1 Mac):

Speedometer2:


| subtest | ms | ms | b / a | pValue (significance using False Discovery Rate) |


| Elm-TodoMVC |129.037500 |127.212500 |0.985857 | 0.012706 |
| VueJS-TodoMVC |28.312500 |27.525000 |0.972185 | 0.240315 |
| EmberJS-TodoMVC |132.550000 |132.025000 |0.996039 | 0.538034 |
| Flight-TodoMVC |80.762500 |80.875000 |1.001393 | 0.914749 |
| BackboneJS-TodoMVC |51.637500 |51.175000 |0.991043 | 0.285427 |
| Preact-TodoMVC |21.025000 |22.075000 |1.049941 | 0.206140 |
| AngularJS-TodoMVC |142.900000 |142.887500 |0.999913 | 0.990681 |
| Inferno-TodoMVC |69.300000 |69.775000 |1.006854 | 0.505201 |
| Vanilla-ES2015-TodoMVC |71.500000 |71.225000 |0.996154 | 0.608650 |
| Angular2-TypeScript-TodoMVC |43.287500 |43.275000 |0.999711 | 0.987926 |
| VanillaJS-TodoMVC |57.212500 |57.812500 |1.010487 | 0.333357 |
| jQuery-TodoMVC |276.150000 |276.775000 |1.002263 | 0.614404 |
| EmberJS-Debug-TodoMVC |353.612500 |352.762500 |0.997596 | 0.518836 |
| React-TodoMVC |93.637500 |92.637500 |0.989321 | 0.036277 |
| React-Redux-TodoMVC |158.237500 |156.587500 |0.989573 | 0.042154 |
| Vanilla-ES2015-Babel-Webpack-TodoMVC |68.050000 |68.087500 |1.000551 | 0.897149 |


a mean = 236.26950
b mean = 236.57964
pValue = 0.7830785938
(Bigger means are better.)
1.001 times better
Results ARE NOT significant

JetStream2:


| subtest | pts | pts | b / a | pValue (significance using False Discovery Rate) |


| gaussian-blur |542.570057 |542.671885 |1.000188 | 0.982573 |
| HashSet-wasm |57.710498 |64.406371 |1.116025 | 0.401424 |
| gcc-loops-wasm |44.516009 |44.453535 |0.998597 | 0.973651 |
| json-parse-inspector |241.275085 |240.720491 |0.997701 | 0.704732 |
| prepack-wtb |62.640114 |63.754878 |1.017796 | 0.205840 |
| date-format-xparb-SP |416.976817 |448.921409 |1.076610 | 0.052977 |
| WSL |1.555257 |1.570233 |1.009629 | 0.427924 |
| OfflineAssembler |177.052352 |179.746511 |1.015217 | 0.112114 |
| cdjs |192.517586 |194.598906 |1.010811 | 0.025807 |
| UniPoker |514.023694 |526.111500 |1.023516 | 0.269892 |
| json-stringify-inspector |227.584725 |223.619390 |0.982576 | 0.102714 |
| crypto-sha1-SP |980.728788 |984.192104 |1.003531 | 0.838618 |
| Basic |685.148483 |711.590247 |1.038593 | 0.142952 |
| chai-wtb |106.256376 |106.590318 |1.003143 | 0.865894 |
| crypto-aes-SP |722.308829 |728.702310 |1.008851 | 0.486766 |
| Babylon |655.857561 |654.204901 |0.997480 | 0.931520 |
| string-unpack-code-SP |407.837271 |405.710752 |0.994786 | 0.729122 |
| stanford-crypto-aes |456.906021 |449.993856 |0.984872 | 0.272994 |
| raytrace |883.911335 |902.887238 |1.021468 | 0.189785 |
| multi-inspector-code-load |409.997347 |405.643639 |0.989381 | 0.644447 |
| hash-map |593.590160 |601.576332 |1.013454 | 0.249414 |
| stanford-crypto-pbkdf2 |722.178638 |728.283532 |1.008453 | 0.661195 |
| coffeescript-wtb |42.393544 |41.869545 |0.987640 | 0.197441 |
| Box2D |452.034685 |454.104868 |1.004580 | 0.535342 |
| richards-wasm |140.873688 |148.394050 |1.053384 | 0.303651 |
| lebab-wtb |61.671318 |62.119403 |1.007266 | 0.620998 |
| tsf-wasm |108.592794 |119.498398 |1.100427 | 0.504710 |
| base64-SP |629.744643 |603.425565 |0.958207 | 0.049997 |
| navier-stokes |740.588523 |739.951662 |0.999140 | 0.871445 |
| jshint-wtb |51.938359 |52.651104 |1.013723 | 0.217137 |
| regex-dna-SP |459.251148 |463.492489 |1.009235 | 0.371891 |
| async-fs |235.853820 |236.031189 |1.000752 | 0.938459 |
| first-inspector-code-load |275.298325 |274.172125 |0.995909 | 0.623403 |
| segmentation |44.002842 |43.445960 |0.987344 | 0.207134 |
| typescript |26.360161 |26.458820 |1.003743 | 0.609942 |
| octane-code-load |1126.749036 |1087.132024 |0.964840 | 0.524171 |
| float-mm.c |16.691935 |16.721354 |1.001762 | 0.194425 |
| quicksort-wasm |461.630091 |450.161127 |0.975156 | 0.371394 |
| Air |392.442375 |412.201810 |1.050350 | 0.046887 |
| splay |510.111886 |475.131657 |0.931426 | 0.024732 |
| ai-astar |607.966974 |626.573181 |1.030604 | 0.468711 |
| acorn-wtb |67.510766 |68.143956 |1.009379 | 0.481663 |
| gbemu |144.133842 |145.620304 |1.010313 | 0.802154 |
| richards |963.475078 |946.658879 |0.982546 | 0.231189 |
| 3d-cube-SP |549.426784 |550.479154 |1.001915 | 0.831307 |
| espree-wtb |68.707483 |73.762202 |1.073569 | 0.033603 |
| bomb-workers |96.882596 |96.116121 |0.992089 | 0.687952 |
| tagcloud-SP |309.888767 |303.538511 |0.979508 | 0.187768 |
| mandreel |133.667031 |135.009929 |1.010047 | 0.075232 |
| 3d-raytrace-SP |491.967649 |492.528992 |1.001141 | 0.957842 |
| delta-blue |1066.718312 |1080.230772 |1.012667 | 0.549382 |
| ML |139.617293 |140.088630 |1.003376 | 0.661651 |
| regexp |351.773956 |351.075935 |0.998016 | 0.769250 |
| crypto |1510.474663 |1519.218842 |1.005789 | 0.638420 |
| crypto-md5-SP |795.447899 |774.082493 |0.973140 | 0.079728 |
| earley-boyer |812.574545 |870.678372 |1.071506 | 0.044081 |
| octane-zlib |25.162470 |25.660261 |1.019783 | 0.554591 |
| date-format-tofte-SP |395.296135 |398.008992 |1.006863 | 0.650475 |
| n-body-SP |1165.386611 |1150.525110 |0.987248 | 0.227908 |
| pdfjs |189.060252 |191.015628 |1.010343 | 0.633777 |
| FlightPlanner |908.426192 |903.636642 |0.994728 | 0.838821 |
| uglify-js-wtb |34.029399 |34.164342 |1.003965 | 0.655652 |
| babylon-wtb |81.329869 |80.855680 |0.994170 | 0.854393 |
| stanford-crypto-sha256 |826.850533 |838.494164 |1.014082 | 0.579636 |


a mean = 237.91084
b mean = 239.92670
pValue = 0.0657710897
(Bigger means are better.)
1.008 times better
Results ARE NOT significant

  • CMakeLists.txt:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/MacroAssembler.h:

(JSC::MacroAssembler::pushToSaveByteOffset):

  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::pushToSaveByteOffset):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::compileExit):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGThunks.cpp:

(JSC::DFG::osrExitGenerationThunkGenerator):

  • ftl/FTLSaveRestore.cpp:

(JSC::FTL::saveAllRegisters):
(JSC::FTL::restoreAllRegisters):

  • ftl/FTLSaveRestore.h:
  • ftl/FTLThunks.cpp:

(JSC::FTL::genericGenerationThunkGenerator):
(JSC::FTL::slowPathCallThunkGenerator):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
(JSC::AssemblyHelpers::emitSave):
(JSC::AssemblyHelpers::emitRestore):
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor):
(JSC::AssemblyHelpers::emitRestoreCalleeSavesFor):
(JSC::AssemblyHelpers::copyLLIntBaselineCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::emitSaveOrCopyLLIntBaselineCalleeSavesFor):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::copyLLIntBaselineCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::emitSave): Deleted.
(JSC::AssemblyHelpers::emitRestore): Deleted.
(JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor): Deleted.

  • jit/AssemblyHelpersSpoolers.h: Added.

(JSC::AssemblyHelpers::Spooler::Spooler):
(JSC::AssemblyHelpers::Spooler::handleGPR):
(JSC::AssemblyHelpers::Spooler::finalizeGPR):
(JSC::AssemblyHelpers::Spooler::handleFPR):
(JSC::AssemblyHelpers::Spooler::finalizeFPR):
(JSC::AssemblyHelpers::Spooler::op):
(JSC::AssemblyHelpers::LoadRegSpooler::LoadRegSpooler):
(JSC::AssemblyHelpers::LoadRegSpooler::loadGPR):
(JSC::AssemblyHelpers::LoadRegSpooler::finalizeGPR):
(JSC::AssemblyHelpers::LoadRegSpooler::loadFPR):
(JSC::AssemblyHelpers::LoadRegSpooler::finalizeFPR):
(JSC::AssemblyHelpers::LoadRegSpooler::handlePair):
(JSC::AssemblyHelpers::LoadRegSpooler::handleSingle):
(JSC::AssemblyHelpers::StoreRegSpooler::StoreRegSpooler):
(JSC::AssemblyHelpers::StoreRegSpooler::storeGPR):
(JSC::AssemblyHelpers::StoreRegSpooler::finalizeGPR):
(JSC::AssemblyHelpers::StoreRegSpooler::storeFPR):
(JSC::AssemblyHelpers::StoreRegSpooler::finalizeFPR):
(JSC::AssemblyHelpers::StoreRegSpooler::handlePair):
(JSC::AssemblyHelpers::StoreRegSpooler::handleSingle):
(JSC::RegDispatch<GPRReg>::get):
(JSC::RegDispatch<GPRReg>::temp1):
(JSC::RegDispatch<GPRReg>::temp2):
(JSC::RegDispatch<GPRReg>::regToStore):
(JSC::RegDispatch<GPRReg>::invalid):
(JSC::RegDispatch<GPRReg>::regSize):
(JSC::RegDispatch<GPRReg>::isValidLoadPairImm):
(JSC::RegDispatch<GPRReg>::isValidStorePairImm):
(JSC::RegDispatch<FPRReg>::get):
(JSC::RegDispatch<FPRReg>::temp1):
(JSC::RegDispatch<FPRReg>::temp2):
(JSC::RegDispatch<FPRReg>::regToStore):
(JSC::RegDispatch<FPRReg>::invalid):
(JSC::RegDispatch<FPRReg>::regSize):
(JSC::RegDispatch<FPRReg>::isValidLoadPairImm):
(JSC::RegDispatch<FPRReg>::isValidStorePairImm):
(JSC::AssemblyHelpers::CopySpooler::Source::getReg):
(JSC::AssemblyHelpers::CopySpooler::CopySpooler):
(JSC::AssemblyHelpers::CopySpooler::temp1 const):
(JSC::AssemblyHelpers::CopySpooler::temp2 const):
(JSC::AssemblyHelpers::CopySpooler::regToStore):
(JSC::AssemblyHelpers::CopySpooler::invalid):
(JSC::AssemblyHelpers::CopySpooler::regSize):
(JSC::AssemblyHelpers::CopySpooler::isValidLoadPairImm):
(JSC::AssemblyHelpers::CopySpooler::isValidStorePairImm):
(JSC::AssemblyHelpers::CopySpooler::load):
(JSC::AssemblyHelpers::CopySpooler::move):
(JSC::AssemblyHelpers::CopySpooler::copy):
(JSC::AssemblyHelpers::CopySpooler::store):
(JSC::AssemblyHelpers::CopySpooler::flush):
(JSC::AssemblyHelpers::CopySpooler::loadGPR):
(JSC::AssemblyHelpers::CopySpooler::copyGPR):
(JSC::AssemblyHelpers::CopySpooler::moveConstant):
(JSC::AssemblyHelpers::CopySpooler::storeGPR):
(JSC::AssemblyHelpers::CopySpooler::finalizeGPR):
(JSC::AssemblyHelpers::CopySpooler::loadFPR):
(JSC::AssemblyHelpers::CopySpooler::copyFPR):
(JSC::AssemblyHelpers::CopySpooler::storeFPR):
(JSC::AssemblyHelpers::CopySpooler::finalizeFPR):
(JSC::AssemblyHelpers::CopySpooler::loadPair):
(JSC::AssemblyHelpers::CopySpooler::storePair):

  • jit/ScratchRegisterAllocator.cpp:

(JSC::ScratchRegisterAllocator::preserveReusedRegistersByPushing):
(JSC::ScratchRegisterAllocator::restoreReusedRegistersByPopping):
(JSC::ScratchRegisterAllocator::preserveRegistersToStackForCall):
(JSC::ScratchRegisterAllocator::restoreRegistersFromStackForCall):

  • jit/ScratchRegisterAllocator.h:
  • wasm/WasmAirIRGenerator.cpp:

(JSC::Wasm::AirIRGenerator::addReturn):

  • wasm/WasmB3IRGenerator.cpp:

(JSC::Wasm::B3IRGenerator::addReturn):

5:06 PM Changeset in webkit [279255] by commit-queue@webkit.org
  • 4 edits
    2 adds in trunk

Source/WebCore:
Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
https://bugs.webkit.org/show_bug.cgi?id=226885

Patch by Venky Dass <yaranamavenkataramana@apple.com> on 2021-06-24
Reviewed by Sihui Liu.

Added a test to create null openDBRequest so that it can crash.

Test: storage/indexeddb/request-with-null-open-db-request.html

  • Modules/indexeddb/IDBTransaction.cpp:

(WebCore::IDBTransaction::dispatchEvent):

LayoutTests:
Crash in IDBTransaction::dispatchEvent when m_openDBRequest is null.
https://bugs.webkit.org/show_bug.cgi?id=226885

Patch by Venky Dass <yaranamavenkataramana@apple.com> on 2021-06-24
Reviewed by Sihui Liu.

  • storage/indexeddb/request-with-null-open-db-request-expected.txt: Added.
  • storage/indexeddb/request-with-null-open-db-request.html: Added.
4:55 PM Changeset in webkit [279254] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

Crash in WebFrameLoaderClient::dispatchDidStartProvisionalLoad after provisionalLoader is gone.
https://bugs.webkit.org/show_bug.cgi?id=226979

Patch by Venky Dass <yaranamavenkataramana@apple.com> on 2021-06-24
Reviewed by Ryosuke Niwa.

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):

4:47 PM Changeset in webkit [279253] by ysuzuki@apple.com
  • 3 edits in trunk/Source/JavaScriptCore

Unreviewed, build fix for ARM64
https://bugs.webkit.org/show_bug.cgi?id=227201

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::cageWithoutUntagging):
(JSC::AssemblyHelpers::cageConditionallyAndUntag):

4:12 PM Changeset in webkit [279252] by Said Abou-Hallawa
  • 2 edits in trunk/Source/WebKit

[GPU Process] RELEASE_ASSERT in RemoteResourceCacheProxy::didFinalizeRenderingUpdate() may fire if GPUP is relaunched
https://bugs.webkit.org/show_bug.cgi?id=227229
<rdar://79147947>

Reviewed by Myles C. Maxfield.

When the GPUP is relaunched remoteResourceCacheWasDestroyed() clears
m_fontIdentifierToLastRenderingUpdateVersionMap but it does not reset
m_numberOfFontsUsedInCurrentRenderingUpdate. This will make it always
greater than m_fontIdentifierToLastRenderingUpdateVersionMap.size().
And this is why the assertion fires.

  • WebProcess/GPU/graphics/RemoteResourceCacheProxy.cpp:

(WebKit::RemoteResourceCacheProxy::remoteResourceCacheWasDestroyed):

4:11 PM Changeset in webkit [279251] by commit-queue@webkit.org
  • 2 edits in trunk/Source/ThirdParty/ANGLE

[ANGLE Metal] - Set barriers on transform feedback buffers only up to the in use buffer count
https://bugs.webkit.org/show_bug.cgi?id=227272
<rdar://79587861>

Patch by John Cunningham <johncunningham@apple.com> on 2021-06-24
Reviewed by Dean Jackson.

  • src/libANGLE/renderer/metal/ContextMtl.mm:

(rx::ContextMtl::onEndTransformFeedback):

4:07 PM Changeset in webkit [279250] by jer.noble@apple.com
  • 4 edits
    5 adds in trunk

[Cocoa] Last few seconds of 'audio/webm; codecs=vorbis' appended to a SampleBuffer are not played
https://bugs.webkit.org/show_bug.cgi?id=226069
<rdar://78004793>

Reviewed by Eric Carlson.

Source/WebCore:

Test: platform/mac-bigsur/media/media-source/media-vorbis-partial.html

When parsing samples from a WebM file, the samples emitted by the parser can be very short in
duration, which is ineffecient both in storage costs in our SampleMap, as well as in decoding
CPU costs, as each sample must be fed into the decoder separately. So the parser will group
together these small samples into a larger "meta sample" with a duration no shorter than 2s.

However, at the end of a file, no more sample data will be appended, up to 2s of audio data
will not be emitted from the parser.

At the end of an append, always flush audio track data to ensure that all parsed samples are
emitted, regardless of their collective duration.

Drive-by Fixes:

  • createSampleBuffer() would completely empty m_packetData, which would corrupt the parser state in the case where there was partial frame data read (because that partial data would be cleared) Instead, remove only the data from the m_packetData that actually went into the CMSampleBuffer
  • createSampleBuffer() would use the entire m_packetData to create a CMSampleBuffer, even if partial data was read but not yet complete. Only use the fully parsed data to create the CMSampleBuffer.
  • consumeFrameData() would only increase the size of m_packetData when m_currentPacketSize was unset, which would leave the buffer zeroed when partial sample data was present. Always grow m_packetData to be large enough to receive the read data.
  • The Read() method would not return the correct number of bytes read (0) when a null destination buffer was passed in.
  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:

(WebCore::SourceBufferParserWebM::appendData):
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer):

LayoutTests:

  • platform/mac/TestExpectations:
  • platform/mac/media/media-source/content/test-vorbis-manifest.json: Added.
  • platform/mac/media/media-source/content/test-vorbis.webm: Added.
  • platform/mac/media/media-source/media-vorbis-partial-expected.txt: Added.
  • platform/mac/media/media-source/media-vorbis-partial.html: Added.
3:50 PM Changeset in webkit [279249] by commit-queue@webkit.org
  • 7 edits in trunk/Source/JavaScriptCore

Add a new pattern to instruction selector to utilize BFI supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=227201

Patch by Yijia Huang <Yijia Huang> on 2021-06-24
Reviewed by Filip Pizlo.

Bitfield insert(BFI), leaving other bits unchanged. The instruction selector
can utilize this to lowering certain patterns in B3 IR before further Air
optimization. Given the operation:

bfi d, n, lsb, width

The equivalent pattern would be:

Pattern 1:

mask1 = ((1 << width) - 1) << lsb
mask2 = ~mask1
d = ((n << lsb) & mask1) | (d & mask2);

Pattern 2:

mask1 = (1 << width) - 1
mask2 = ~(mask1 << lsb)
d = ((n & mask1) << lsb) | (d & mask2)

Current optimizer already has the strength reduction rule:

Turn This: (n << lsb) & mask1)
Into This: (n & mask1) << lsb)

Then, d = ((n & mask1) << lsb) | (d & mask2) is the canonical form.

With constraints:

  1. 0 <= lsb < datasize
  2. 0 < width < datasize
  3. lsb + width <= dataszie

Given B3 IR:
Int @0 = ArgumentReg(%x0)
Int @1 = ArgumentReg(%x1)
Int @2 = lsb
Int @3 = mask
Int @4 = BitAnd(@1, @3)
Int @5 = Shl(@4, @2)
Int @6 = BitOr(@0, @5)
Int @7 = Return(@6, Terminal)

Before Adding BFI:
Old optimized AIR
And mask, %x1, %x1, @4
Lshift %x1, lsb, %x1, @5
Or %x1, %x0, %x0, @6
Ret %x0, @7

After Adding BFI:
New optimized AIR
BitFieldInsert %x1, lsb, width, %x0, @6
Ret %x0, @7

  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::bitFieldInsert32):
(JSC::MacroAssemblerARM64::bitFieldInsert64):

  • assembler/testmasm.cpp:

(JSC::testUbfx32):
(JSC::testUbfx64):
(JSC::testUbfiz32):
(JSC::testUbfiz64):
(JSC::testBitFieldInsert32):
(JSC::testBitFieldInsert64):

  • b3/B3LowerToAir.cpp:
  • b3/air/AirOpcode.opcodes:
  • b3/testb3.h:
  • b3/testb3_2.cpp:

(testBitFieldInsert32):
(testBitFieldInsert64):
(addBitTests):

3:45 PM Changeset in webkit [279248] by achristensen@apple.com
  • 2 edits in trunk/Source/WebKit

Fix WKDownloadDelegate header doc
https://bugs.webkit.org/show_bug.cgi?id=227378

Reviewed by Brady Eidson.

This removes the following sentence:
"If this is a download of a blob URL, response will be null."
This was correct in an earlier iteration of the implementation of this API, but is now incorrect
and verified by the WKDownload.BlobResponse API test.

  • UIProcess/API/Cocoa/WKDownloadDelegate.h:
3:12 PM Changeset in webkit [279247] by Kate Cheney
  • 5 edits in trunk

WKWebView loadSimulatedRequest does not set attribution value for url requests within html content
https://bugs.webkit.org/show_bug.cgi?id=227266
<rdar://problem/79316911>

Reviewed by Brent Fulgham.

Source/WebKit:

We currently pass the attribution value from the main NSURLRequest
passed into WebPageProxy::loadRequest by setting a value on the WebPage
document loader that gets passed to all requests initiated by that main
navigation. This patch adds the same functionality for
WebPageProxy::loadSimulatedRequest, which could initiate URL requests
from HTML content.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::loadSimulatedRequest):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::loadSimulatedRequestAndResponse):

Tools:

API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
3:10 PM Changeset in webkit [279246] by Ruben Turcios
  • 1 copy in tags/Safari-612.1.20

Tag Safari-612.1.20.

2:41 PM Changeset in webkit [279245] by Wenson Hsieh
  • 4 edits in trunk/Source/WebKit

[watchOS] Automatically apply system minimum layout margins as scroll view content insets
https://bugs.webkit.org/show_bug.cgi?id=227178
rdar://76784095

Reviewed by Tim Horton.

Respect -[UIViewController systemMinimumLayoutMargins] on watchOS by treating them in a similar way as safe
area insets, such that we avoid laying out parts of the web page within these margins unless the page's meta
viewport specifies viewport-fit=cover. On watch, avoiding these layout margins is crucial.

  • UIProcess/API/ios/WKWebViewIOS.mm:

(-[WKWebView _computedObscuredInsetForSafeBrowsingWarning]):
(-[WKWebView _contentInsetsFromSystemMinimumLayoutMargins]):

Add a helper method to compute the amount of additional content inset we need to apply to the scroll view in
order for content to fit within WKWebView's view controller's -systemMinimumLayoutMargins. Note that this
accounts for cases where the web view's frame is already inset relative to the view controller's content view.

(-[WKWebView _computedObscuredInset]):
(-[WKWebView _computedContentInset]):

Unconditionalize a few codepaths that apply obscured and content insets by consulting
-_scrollViewSystemContentInset.

(-[WKWebView _computedUnobscuredSafeAreaInset]):

On watchOS, we augment safe area insets, such that they include _contentInsetsFromSystemMinimumLayoutMargins
as well.

(-[WKWebView activeViewLayoutSize:]):
(-[WKWebView _updateScrollViewContentInsetsIfNecessary]):

Add a helper method that (on watchOS only) updates WKScrollView's content scroll insets such that the web page
fits inside -systemMinimumLayoutMargins. See WKScrollView changes below for more details.

(-[WKWebView _updateVisibleContentRects]):
(-[WKWebView _setAvoidsUnsafeArea:]):

Update scroll view content insets on watchOS if the viewport-fit state changes. Additionally make sure that we
also update the active layout size if the insets actually change (without this tweak, when dynamically adding
viewport-fit=cover, we'll end up in a state where the content size is still narrow to account for the old
content scroll insets, but the new content scroll insets are set, so the web page apears misaligned relative to
the scroll view).

  • UIProcess/ios/WKScrollView.h:
  • UIProcess/ios/WKScrollView.mm:

(-[WKScrollView _setContentScrollInset:]):
(-[WKScrollView _setContentScrollInsetInternal:]):

Add an internal method for setting -[UIScrollView _contentScrollInset] that defers to the embedding client.
This means WKWebView clients that use webView.scrollView.contentScrollInset = myInset; will override the above
behavior in -_updateScrollViewContentInsetsIfNecessary, but otherwise, the content scroll insets will be
automatically computed and set in order to avoid minimum layout margins if needed.

Note that this also returns a BOOL indicating whether the inset was updated.

(-[WKScrollView _updateContentScrollInset]):

2:38 PM Changeset in webkit [279244] by Chris Dumez
  • 4 edits in trunk/Source/WebKit

Improve release logging in WebProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=227374

Reviewed by Geoffrey Garen.

Improve release logging in WebProcessProxy:

  • Add more logging
  • Use more consistent logging format to faciliate grep'ing
  • Always include pointer and PID in the logging
  • UIProcess/WebProcessPool.cpp:

(WebKit::WebProcessPool::enableProcessTermination):
(WebKit::WebProcessPool::disableProcessTermination):

  • UIProcess/WebProcessPool.h:
  • UIProcess/WebProcessProxy.cpp:

(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::setIsInProcessCache):
(WebKit::WebProcessProxy::setWebsiteDataStore):
(WebKit::WebProcessProxy::addProvisionalPageProxy):
(WebKit::WebProcessProxy::removeProvisionalPageProxy):
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::addExistingWebPage):
(WebKit::WebProcessProxy::markIsNoLongerInPrewarmedPool):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::checkURLReceivedFromWebProcess):
(WebKit::WebProcessProxy::gpuProcessExited):
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch):
(WebKit::WebProcessProxy::didBecomeUnresponsive):
(WebKit::WebProcessProxy::didBecomeResponsive):
(WebKit::WebProcessProxy::didFinishLaunching):
(WebKit::WebProcessProxy::canBeAddedToWebProcessCache const):
(WebKit::WebProcessProxy::canTerminateAuxiliaryProcess):
(WebKit::WebProcessProxy::fetchWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteData):
(WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::sendPrepareToSuspend):
(WebKit::WebProcessProxy::sendProcessDidResume):
(WebKit::WebProcessProxy::didSetAssertionType):
(WebKit::WebProcessProxy::updateAudibleMediaAssertions):
(WebKit::WebProcessProxy::setIsHoldingLockedFiles):
(WebKit::WebProcessProxy::processTerminated):
(WebKit::WebProcessProxy::didExceedActiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedInactiveMemoryLimit):
(WebKit::WebProcessProxy::didExceedCPULimit):
(WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame):
(WebKit::WebProcessProxy::incrementSuspendedPageCount):
(WebKit::WebProcessProxy::decrementSuspendedPageCount):
(WebKit::WebProcessProxy::processPoolIfExists const):
(WebKit::WebProcessProxy::startBackgroundActivityForFullscreenInput):
(WebKit::WebProcessProxy::endBackgroundActivityForFullscreenInput):
(WebKit::WebProcessProxy::establishServiceWorkerContext):
(WebKit::WebProcessProxy::updateServiceWorkerProcessAssertion):
(WebKit::WebProcessProxy::registerServiceWorkerClientProcess):
(WebKit::WebProcessProxy::unregisterServiceWorkerClientProcess):
(WebKit::WebProcessProxy::disableServiceWorkers):
(WebKit::WebProcessProxy::enableServiceWorkers):

12:33 PM Changeset in webkit [279243] by guijemont@igalia.com
  • 2 edits
    1 delete in trunk/JSTests

Improve our checking of NaN values in DataView tests
https://bugs.webkit.org/show_bug.cgi?id=227347

Reviewed by Yusuke Suzuki.

This allows the merging of dataview-jit-set-nan.js and
dataview-jit-set.js.

  • stress/dataview-jit-set-nan.js: Removed.
  • stress/dataview-jit-set.js:

(test5):
(test6):

12:14 PM Changeset in webkit [279242] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebCore

Unreviewed, reverting r275633.
https://bugs.webkit.org/show_bug.cgi?id=227373

Revert to see if this was the cause for some crashes seen
lately

Reverted changeset:

"Reduce Vector<> wasted capacity in some RuleSet code"
https://bugs.webkit.org/show_bug.cgi?id=224160
https://trac.webkit.org/changeset/275633

12:07 PM Changeset in webkit [279241] by Chris Dumez
  • 2 edits in trunk/Source/WebKit

Add release logging in the WebPage constructor / destructor
https://bugs.webkit.org/show_bug.cgi?id=227361

Reviewed by Geoffrey Garen.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::~WebPage):

11:49 AM Changeset in webkit [279240] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebCore

Use <cmath> instead of <math.h>
https://bugs.webkit.org/show_bug.cgi?id=225856

This is needed to avoid ambiguity between abs and std::abs observed on
vanilla clang 7.1.0.

Patch by Dmitry Kalinkin <dmitry.kalinkin+webkit@gmail.com> on 2021-06-24
Reviewed by Fujii Hironori.

  • platform/graphics/ColorComponents.h:
11:27 AM Changeset in webkit [279239] by commit-queue@webkit.org
  • 2 edits in trunk/LayoutTests

[GStreamer] Unreviewed Test gardening, webrtc/peer-connection-remote-audio-mute* are no longer failing
https://bugs.webkit.org/show_bug.cgi?id=221504

These tests pass as of r277175.
Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-06-24

  • platform/glib/TestExpectations:
11:24 AM Changeset in webkit [279238] by Darin Adler
  • 6 edits in trunk

CSS parser does not handle unpaired surrogates correctly
https://bugs.webkit.org/show_bug.cgi?id=227357

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

  • web-platform-tests/css/css-syntax/input-preprocessing-expected.txt:

Expect tests to pass instead of fail.

Source/WebCore:

Tests: imported/w3c/web-platform-tests/css/css-syntax/input-preprocessing.html

  • bindings/js/JSDOMConvertStrings.cpp:

(WebCore::stringToUSVString): Made non-inline to be used outside this file.

  • bindings/js/JSDOMConvertStrings.h: Added stringToUSVString.
  • css/parser/CSSTokenizer.cpp:

(WebCore::preprocessString): Call stringToUSVString to convert unpaired
surrogates to replacement characters.

10:49 AM Changeset in webkit [279237] by sihui_liu@apple.com
  • 5 edits in trunk

IndexedDB prints error log about blob files when there is no error
https://bugs.webkit.org/show_bug.cgi?id=227092

Reviewed by Chris Dumez.

Source/WebCore:

We should try opening database if file exists, and try getting blob files only if database is opened.

API test: IndexedDB.StoreBlobThenDeleteDatabase

  • Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:

(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/StoreBlobThenDelete.mm:

(TEST):

  • TestWebKitAPI/Tests/WebKitCocoa/StoreBlobToBeDeleted.html:
10:38 AM Changeset in webkit [279236] by pvollan@apple.com
  • 2 edits in trunk/Source/WebKit

[macOS] Fix incorrect version check in the WebContent process' sandbox
https://bugs.webkit.org/show_bug.cgi?id=227346
<rdar://79589961>

Reviewed by Alexey Proskuryakov.

  • WebProcess/com.apple.WebProcess.sb.in:
10:29 AM Changeset in webkit [279235] by achristensen@apple.com
  • 5 edits in trunk/LayoutTests/imported/w3c

Fix URL test expectations after r279234
https://bugs.webkit.org/show_bug.cgi?id=227321

That revision was a mistake. I took the expected from the bots instead of the actual.
This should actually update the expectations.

  • web-platform-tests/url/url-constructor.any-expected.txt:
  • web-platform-tests/url/url-constructor.any.worker-expected.txt:
  • web-platform-tests/url/url-origin.any-expected.txt:
  • web-platform-tests/url/url-origin.any.worker-expected.txt:
10:19 AM Changeset in webkit [279234] by achristensen@apple.com
  • 5 edits in trunk/LayoutTests/imported/w3c

Fix URL test expectations after r279211
https://bugs.webkit.org/show_bug.cgi?id=227321

The process of moving and committing did something strange to the invalid UTF-16 sequences.
This should fix the bots.

  • web-platform-tests/url/url-constructor.any-expected.txt:
  • web-platform-tests/url/url-constructor.any.worker-expected.txt:
  • web-platform-tests/url/url-origin.any-expected.txt:
  • web-platform-tests/url/url-origin.any.worker-expected.txt:
10:10 AM Changeset in webkit [279233] by Chris Dumez
  • 5 edits
    7 adds
    2 deletes in trunk/LayoutTests/imported/w3c

Resync eventsource WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227324

Reviewed by Alex Christensen.

Resync eventsource WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/eventsource/*: Updated.
9:44 AM Changeset in webkit [279232] by commit-queue@webkit.org
  • 3 edits in trunk/Tools

[WPE] Uninstalled Cog now requires a COG_MODULEDIR environment variable
https://bugs.webkit.org/show_bug.cgi?id=227351

Patch by Philippe Normand <pnormand@igalia.com> on 2021-06-24
Reviewed by Adrian Perez de Castro.

Renamed the cog_path() method to cog_path_to() which requires a file_or_directory argument.
This is useful when setting the COG_MODULEDIR environment variable.

  • Scripts/webkitpy/port/wpe.py:

(WPEPort.cog_path_to):
(WPEPort.browser_name):
(WPEPort.browser_env):
(WPEPort.run_minibrowser):
(WPEPort.cog_path): Deleted.

9:29 AM Changeset in webkit [279231] by Chris Dumez
  • 5 edits in trunk/LayoutTests/imported/w3c

(r279211) introduced 4 failing web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=227355
<rdar://problem/79728204>

Unreviewed, rebaseline a few WPT url tests after resync in r279211.

  • web-platform-tests/url/url-constructor.any-expected.txt:
  • web-platform-tests/url/url-constructor.any.worker-expected.txt:
  • web-platform-tests/url/url-origin.any-expected.txt:
  • web-platform-tests/url/url-origin.any.worker-expected.txt:
9:28 AM Changeset in webkit [279230] by Brent Fulgham
  • 3 edits in trunk/Source/WebKit

[iOS] Allow network-outbound logging for internal builds
https://bugs.webkit.org/show_bug.cgi?id=227332
<rdar://problem/79669627>

Reviewed by Per Arne Vollan.

We allow network-outbound for /private/var/run/syslog in the WebContent process for debugging
purposes on internal OS images. We should do the same for our other processes to avoid noisy logging.

  • Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
  • Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
8:49 AM Changeset in webkit [279229] by Ruben Turcios
  • 2 edits in branches/safari-612.1.20-branch/Source/WebKit

Cherry-pick r279210. rdar://problem/79726355

REGRESSION(r278970): A CATransaction commitHandler should not execute a client callback
https://bugs.webkit.org/show_bug.cgi?id=227318
<rdar://79625962>

Reviewed by Tim Horton.

In takeSnapshotWithConfiguration() we call callSnapshotRect() inside the
callback of [CATransaction addCommitHandler].

callSnapshotRect() calls the client callback which may call directly or
indirectly addCommitHandler. But it is prohibited by CA to add a commit
handler while processing a registered commit handler.

The fix is to postpone calling callSnapshotRect() till CATransaction
processes all its commit handler callbacks.

  • UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

8:37 AM Changeset in webkit [279228] by Chris Dumez
  • 222 edits
    65 copies
    9 moves
    74 adds
    55 deletes in trunk/LayoutTests

Resync websockets WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227317

Reviewed by Alex Christensen.

Resync websockets WPT tests from upstream a38612f39e7752c3532080c.

  • web-platform-tests/websockets/*: Updated.
8:33 AM Changeset in webkit [279227] by Chris Dumez
  • 13 edits
    16 adds in trunk/LayoutTests/imported/w3c

Resync custom-elements WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227330

Reviewed by Alex Christensen.

Resync custom-elements WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/custom-elements/*: Updated.
8:31 AM Changeset in webkit [279226] by Chris Dumez
  • 5 edits
    3 adds in trunk/LayoutTests/imported/w3c

Resync WebIDL WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227322

Reviewed by Alex Christensen.

Resync WebIDL WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/WebIDL/*: Updated.
8:23 AM Changeset in webkit [279225] by Chris Dumez
  • 75 edits
    3 adds
    6 deletes in trunk/LayoutTests

Resync shadow-dom WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227331

Reviewed by Alex Christensen.

Resync shadow-dom WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/shadow-dom/*: Updated.
8:19 AM Changeset in webkit [279224] by Chris Dumez
  • 5 edits
    4 moves
    8 adds
    25 deletes in trunk/LayoutTests

Resync beacon WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227323

Reviewed by Alex Christensen.

Resync beacon WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/beacon/*: Updated.
8:04 AM Changeset in webkit [279223] by emilio
  • 6 edits
    4 adds in trunk/LayoutTests/imported/w3c

Update some html pseudo-class tests.
https://bugs.webkit.org/show_bug.cgi?id=225851

Reviewed by Manuel Rego Casasnovas.

Generated by ./Tools/Scripts/import-w3c-tests web-platform-tests/html/semantics/selectors -t, plus the relevant expectation update.

  • resources/import-expectations.json:
  • web-platform-tests/html/semantics/selectors/META.yml:
  • web-platform-tests/html/semantics/selectors/pseudo-classes/autofill-expected.txt: Added.
  • web-platform-tests/html/semantics/selectors/pseudo-classes/autofill.html: Added.
  • web-platform-tests/html/semantics/selectors/pseudo-classes/invalid-after-clone-expected.txt: Added.
  • web-platform-tests/html/semantics/selectors/pseudo-classes/invalid-after-clone.html: Added.
  • web-platform-tests/html/semantics/selectors/pseudo-classes/link-expected.txt:
  • web-platform-tests/html/semantics/selectors/pseudo-classes/link.html:
  • web-platform-tests/html/semantics/selectors/pseudo-classes/w3c-import.log:
7:59 AM Changeset in webkit [279222] by commit-queue@webkit.org
  • 2 edits in trunk

REGRESSION(r236846): WPE shouldn't depend on OpenGL ES 3
https://bugs.webkit.org/show_bug.cgi?id=227289

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-06-24
Reviewed by Adrian Perez de Castro.

  • Source/cmake/OptionsWPE.cmake: Drop the OpenGLES2 package search.

None of the possible versions are meaningful because libepoxy is used
as the underlying GL relay.

7:38 AM Changeset in webkit [279221] by commit-queue@webkit.org
  • 41 edits
    3 copies
    1 add in trunk/Source

Using a video as a source for a WebGL texture is slow and hangs on iOS 15
https://bugs.webkit.org/show_bug.cgi?id=227081

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-06-24
Reviewed by Eric Carlson.

Source/WebCore:

Video frame transfer from GPU process to Web process would fail when
WebGL tried to copy the video frame to a texture. The failure was
artificial, due to use of WebCore::IOSurface as a unneeeded helper
to convert CVPixelBufferRef to cross-process object.

This would cause performance regression when WebGL would
fall back to software conversion fallback. This callback did work
as it obtains the image through "get last frame as native image"
API.

  • platform/cocoa/CoreVideoSoftLink.cpp:
  • platform/graphics/cocoa/IOSurface.h:
  • platform/graphics/cocoa/IOSurface.mm:

Remove CVPixelBufferRef -> WebCore::IOSurface conversion function.
Remove WebCore::IOSurface -> CVPixelBufferRef conversion function.
These were used in WebKit IPC serialization for CVPixelBufferRef.
However, this is incorrect behavior as CVPixelBufferRef
is not always compatible with WebCore::IOSurface. IOSurfaceRef
has always a destination color space. This would be missing from
CVPixelBufferRef. The code is moved to the IPC serialization
functions.

Source/WebKit:

In current form, media is decoded in GPU process and WebGL is processed
in Web process.

Video frame transfer from GPU process to Web process would fail when
WebGL tried to copy the video frame to a texture. The failure was
artificial, due to use of WebCore::IOSurface as a unneeeded helper
to convert CVPixelBufferRef to a cross-process object.

The failure would occur when AVPlayerItemVideoOutput
would generate a CVPixelBufferRef without color space information. Creating
WebCore::IOSurface out of this would fail. WebCore::IOSurface
has always a color space. The failure is not significant, as WebCore::IOSurface
was only used as a convenience.

This would cause performance regression when WebGL would
fall back to software conversion fallback. This callback did work
as it obtains the image through "get last frame as native image"
API.

  • GPUProcess/media/RemoteMediaPlayerProxy.h:
  • GPUProcess/media/RemoteMediaPlayerProxy.messages.in:

Use the correct type of object in the IPC messages:
Function PixelBufferForCurrentTime returns CVPixelBufferRef
so use that type instead of MachPort. It is an implementation
detail of CVPixelBufferRef encode/decode how the object
transfer is implemented.

The type of transfer must be RetainPtr<CVPixelBufferRef> as that
is how the IPC system operates wrt input, output and "storage"
types. This is the same as with IPC support for RefPtr<> types.

No tests as Sources/WebKit is not unit-testable ATM.

  • GPUProcess/media/cocoa/RemoteMediaPlayerProxyCocoa.mm:

(WebKit::RemoteMediaPlayerProxy::pixelBufferForCurrentTime):
Change the receive side according to the message type change.

  • Scripts/webkit/messages.py:

(types_that_cannot_be_forward_declared):
(class_template_headers):
Add support for RetainPtr in the IPC message language.

  • Scripts/webkit/messages_unittest.py:
  • Scripts/webkit/tests/Makefile:
  • Scripts/webkit/tests/MessageArgumentDescriptions.cpp:

(IPC::jsValueForArguments):
(IPC::messageArgumentDescriptions):

  • Scripts/webkit/tests/MessageNames.cpp:

(IPC::description):
(IPC::receiverName):
(IPC::isValidMessageName):

  • Scripts/webkit/tests/MessageNames.h:
  • Scripts/webkit/tests/TestWithCVPixelBuffer.messages.in: Added.
  • Scripts/webkit/tests/TestWithCVPixelBufferMessageReceiver.cpp: Added.

(WebKit::TestWithCVPixelBuffer::didReceiveMessage):
(WebKit::TestWithCVPixelBuffer::didReceiveSyncMessage):

  • Scripts/webkit/tests/TestWithCVPixelBufferMessages.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.

(Messages::TestWithCVPixelBuffer::messageReceiverName):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::name):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::SendCVPixelBuffer):
(Messages::TestWithCVPixelBuffer::SendCVPixelBuffer::arguments const):
(Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::name):
(Messages::TestWithCVPixelBuffer::ReceiveCVPixelBuffer::arguments const):

  • Scripts/webkit/tests/TestWithCVPixelBufferMessagesReplies.h: Copied from Source/WebKit/Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h.
  • Scripts/webkit/tests/TestWithSuperclassMessagesReplies.h:

Add code generation examples for IPC implemetation regarding transferring
RetainPtr<CVPixelBufferRef>.

  • Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:

(IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::encode):
(IPC::ArgumentCoder<RetainPtr<CVPixelBufferRef>>::decode):

  • Shared/WebCoreArgumentCoders.h:

Move the CVPixelBufferRef transfer code from IOSurface
to the IPC layer.
The encode function must be of type RetainPtr<CVPixelBufferRef> instead of
CVPixelBufferRef, in contrast to existing RetainPtr<CF*> types.
The existing RetainPtr<CF*> types are not used as IPC message inputs,
only as subobjects. The IPC message language does not have concept of
encode type differing from decode type.

  • WebProcess/GPU/media/cocoa/MediaPlayerPrivateRemoteCocoa.mm:

(WebKit::MediaPlayerPrivateRemote::pixelBufferForCurrentTime):
Change the send side according to the message type change.

6:49 AM Changeset in webkit [279220] by Alan Bujtas
  • 3 edits
    2 adds in trunk

[IFC][Integration] Text selection flashing to end of paragraph
https://bugs.webkit.org/show_bug.cgi?id=227158
<rdar://79138828>

Reviewed by Antti Koivisto.

Source/WebCore:

The "find the line for this position" code in RenderText::positionForPoint() expects adjoining lines boxes (i.e. no gaps between the lines). This function is called by hittesting as part of the text selection process.
This patch implements the legacy behavior by

  1. expanding the "selection top" all the way to the (selection)bottom of the previous line.
  2. ensures that the first line's computed offset is ignored when the containing block has no border/padding.

Test: fast/events/touch/ios/hidpi-selection-when-content-is-on-subpixel.html

  • layout/integration/LayoutIntegrationLineIteratorModernPath.h:

(WebCore::LayoutIntegration::LineIteratorModernPath::selectionTop const):
(WebCore::LayoutIntegration::LineIteratorModernPath::selectionTopForHitTesting const):

LayoutTests:

  • fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html:
  • fast/events/touch/ios/hidpi-selection-when-content-is-on-subpixel-expected.txt: Added.
  • fast/events/touch/ios/hidpi-selection-when-content-is-on-subpixel.html: Added.
4:43 AM Changeset in webkit [279219] by commit-queue@webkit.org
  • 2 edits in trunk/JSTests

Unskip arguments-properties-order.js on MIPS
https://bugs.webkit.org/show_bug.cgi?id=227254

No failures after 50 iterations. Also tested on Loongson 3A4000 (in 32-bits mode).

Unreviewed Gardening.

Patch by Mikhail R. Gadelha <Mikhail R. Gadelha> on 2021-06-24

  • stress/arguments-properties-order.js:
3:49 AM Changeset in webkit [279218] by Martin Robinson
  • 67 edits in trunk

[css-scroll-snap] Remove ENABLE_SCROLL_SNAP compile-time option
https://bugs.webkit.org/show_bug.cgi?id=227067

Reviewed by Simon Fraser.

Remove compile-time ENABLE_SCROLL_SNAP configuration option.

.:

  • Source/cmake/WebKitFeatures.cmake: Remove the flag from the CMake configuration.

Source/WebCore:

No new tests. This should not change behavior in any way.

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSPrimitiveValueMappings.h:
  • css/CSSProperties.json:
  • css/CSSValueKeywords.in:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue):

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):

  • page/FrameView.cpp:

(WebCore::FrameView::updateScrollingCoordinatorScrollSnapProperties const):
(WebCore::FrameView::performPostLayoutTasks):

  • page/FrameView.h:
  • page/mac/EventHandlerMac.mm:

(WebCore::EventHandler::processWheelEventForScrollSnap):

  • page/scrolling/AsyncScrollingCoordinator.cpp:

(WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):

  • page/scrolling/AsyncScrollingCoordinator.h:
  • page/scrolling/ScrollSnapOffsetsInfo.cpp:
  • page/scrolling/ScrollSnapOffsetsInfo.h:
  • page/scrolling/ScrollingMomentumCalculator.cpp:
  • page/scrolling/ScrollingMomentumCalculator.h:
  • page/scrolling/ScrollingStateScrollingNode.cpp:

(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::applicableProperties const):
(WebCore::ScrollingStateScrollingNode::setCurrentVerticalSnapPointIndex):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):

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

(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
(WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex):

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

(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):

  • page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
  • page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:

(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):

  • page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp:

(WebCore::ScrollingTreeScrollingNodeDelegateNicosia::handleWheelEvent):

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::ScrollAnimator):
(WebCore::ScrollAnimator::~ScrollAnimator):
(WebCore::ScrollAnimator::scroll):
(WebCore::ScrollAnimator::resnapAfterLayout):
(WebCore::ScrollAnimator::handleWheelEvent):
(WebCore::ScrollAnimator::updateActiveScrollSnapIndexForOffset):
(WebCore::ScrollAnimator::notifyPositionChanged):
(WebCore::ScrollAnimator::pageScaleFactor const):
(WebCore::ScrollAnimator::scrollControllerAnimationTimerFired):
(WebCore::ScrollAnimator::adjustScrollOffsetForSnappingIfNeeded):

  • platform/ScrollAnimator.h:
  • platform/ScrollController.cpp:

(WebCore::ScrollController::usesScrollSnap const):
(WebCore::ScrollController::resnapAfterLayout):

  • platform/ScrollController.h:
  • platform/ScrollSnapAnimatorState.cpp:
  • platform/ScrollSnapAnimatorState.h:
  • platform/ScrollableArea.cpp:

(WebCore::ScrollableArea::doPostThumbMoveSnapping):

  • platform/ScrollableArea.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::isScrollSnapInProgress const):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture const):
(WebCore::ScrollAnimatorMac::didEndScrollGesture const):
(WebCore::gestureShouldBeginSnap):
(WebCore::ScrollAnimatorMac::allowsVerticalStretching const):
(WebCore::ScrollAnimatorMac::allowsHorizontalStretching const):

  • platform/mac/ScrollController.mm:

(WebCore::ScrollController::stopAllTimers):
(WebCore::ScrollController::handleWheelEvent):
(WebCore::ScrollController::isScrollSnapInProgress const):
(WebCore::ScrollController::updateScrollSnapAnimatingState):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::willBeDestroyed):
(WebCore::RenderBox::styleWillChange):

  • rendering/RenderLayerCompositor.cpp:

(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):

  • rendering/RenderLayerCompositor.h:
  • rendering/RenderLayerModelObject.cpp:

(WebCore::RenderLayerModelObject::styleDidChange):

  • rendering/RenderLayerScrollableArea.cpp:

(WebCore::RenderLayerScrollableArea::updateScrollInfoAfterLayout):
(WebCore::RenderLayerScrollableArea::isScrollSnapInProgress const):

  • rendering/RenderLayerScrollableArea.h:
  • rendering/RenderView.cpp:

(WebCore::RenderView::unregisterBoxWithScrollSnapPositions):

  • rendering/RenderView.h:
  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::RenderStyle::setScrollPaddingRight):
(WebCore::RenderStyle::hasSnapPosition const):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.cpp:

(WebCore::operator<<):

  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareNonInheritedData.cpp:

(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):

  • rendering/style/StyleRareNonInheritedData.h:
  • rendering/style/StyleScrollSnapPoints.h:
  • style/StyleBuilderConverter.h:
  • testing/Internals.cpp:

(WebCore::Internals::isScrollSnapInProgress):

  • testing/Internals.h:
  • testing/Internals.idl:

Source/WebKit:

  • Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:

(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(WebKit::dump):

  • UIProcess/API/ios/WKWebViewIOS.mm:

(-[WKWebView scrollViewWillBeginDragging:]):
(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(-[WKWebView _updateVisibleContentRects]):

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:

(WebKit::RemoteScrollingCoordinatorProxy::resetStateAfterProcessExited):

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
  • UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
(WebKit::ScrollingTreeScrollingNodeDelegateIOS::commitStateAfterChildren):

  • WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h:

Source/WTF:

  • wtf/PlatformEnable.h: Remove the global feature definition.

Tools:

  • Scripts/webkitperl/FeatureList.pm: Remove the option from the list of features.
2:31 AM Changeset in webkit [279217] by eocanha@igalia.com
  • 9 edits
    1 add in trunk

[GTK] media/muted-video-is-playing-audio.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=208321

Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Added setPageMediaVolume() API to set the Page mediaVolume. This was 0
by default and a way to set it to a non-zero value was needed in order
to prevent a zero effectiveVolume in HTMLMediaElement.

  • testing/Internals.cpp:

(WebCore::Internals::setPageMediaVolume): Set the Page mediaVolume.

  • testing/Internals.h: Added setPageMediaVolume().
  • testing/Internals.idl: Ditto.

Tools:

Set the WebKitTestRunnerWPE application name on user-agent to ease the
detection of the WPE port from the layout tests using the isWPE()
function in platform-helper.js.

  • WebKitTestRunner/wpe/TestControllerWPE.cpp:

(WTR::TestController::platformConfigureViewForTest): Set WebKitTestRunnerWPE application name on user-agent.

LayoutTests:

Changed the test to set a non-zero mediaVolume, because a zero one
(default value set by TestController::resetStateToConsistentValues())
would multiply any other volume in HTMLMediaElement::effectiveVolume(),
cause a zero effectiveVolume (being considered in practice as "no audio" by
HTMLMediaElement::mediaState()) and prevent the IsPlayingAudio MediaState
being set.

Also, adapted the test to still expect IsPlayingAudio after mute on the
glib ports (GTK & WPE), since on those ports a muted video is expected to
report IsPlayingAudio, as per the HTMLMediaElement::mediaState() source
code comments.

  • media/muted-video-is-playing-audio.html: Test changed as described above.
  • platform/glib/media/muted-video-is-playing-audio-expected.txt: Added expectation for glib port.
  • resources/platform-helper.js:

(isGtk): Clarified where the GTK user-agent string comes from.
(isWPE): New function to check if a WPE port is being used.

1:31 AM Changeset in webkit [279216] by commit-queue@webkit.org
  • 16 edits in trunk

[JSC] Implement returnEarlyFromInfiniteLoopsForFuzzing for 32bits
https://bugs.webkit.org/show_bug.cgi?id=227290

JSTests:

Patch by Xan Lopez <Xan Lopez> on 2021-06-24
Reviewed by Mark Lam.

Now that we can return early from infinite (actual or just
extremely long running) loops on 32bits, we can pass these tests.

  • stress/construct-return-early-from-infinite-loop-for-fuzzer.js: unskip for 32bits.
  • stress/early-return-from-builtin2.js: ditto.
  • stress/validate-does-gc-with-return-early-from-infinite-loop-2.js: ditto.
  • stress/validate-does-gc-with-return-early-from-infinite-loop.js: ditto.

Source/JavaScriptCore:

Patch by Xan López <Xan Lopez> on 2021-06-24
Reviewed by Mark Lam.

Mostly a matter of changing the counter type to uintptr_t and
making the baseline/dfg/ftl code generation work on both 32 and
64bits, most of it can be shared with minor tweaks.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileLoopHint):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_loop_hint):

  • llint/LLIntSlowPaths.cpp:

(JSC::LLInt::LLINT_SLOW_PATH_DECL):

  • llint/LowLevelInterpreter32_64.asm:
  • runtime/VM.cpp:

(JSC::VM::addLoopHintExecutionCounter):
(JSC::VM::getLoopHintExecutionCounter):

  • runtime/VM.h:
1:13 AM Changeset in webkit [279215] by commit-queue@webkit.org
  • 2 edits in trunk/Source/WebKit

REGRESSION(r272882): [WPE][GTK] xdg-dbus-proxy may not be mounted in sandbox
https://bugs.webkit.org/show_bug.cgi?id=227294

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-06-24
Reviewed by Adrian Perez de Castro.

  • UIProcess/Launcher/glib/BubblewrapLauncher.cpp:

(WebKit::bubblewrapSpawn):

Jun 23, 2021:

11:56 PM Changeset in webkit [279214] by commit-queue@webkit.org
  • 3 edits in trunk/Tools

[WPE] WebKitGLibAPITestsCore should more explicitly link against library dependencies
https://bugs.webkit.org/show_bug.cgi?id=227288

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-06-23
Reviewed by Carlos Garcia Campos.

  • TestWebKitAPI/glib/CMakeLists.txt: Set up the WebKitGLibAPITestsCore_LIBRARIES

variable, use that for the target_link_libraries() call for the
WebKitGLibAPITestsCore target.

  • TestWebKitAPI/glib/PlatformWPE.cmake: Extent the new variable to also

explicitly include Cairo and WPEToolingBackends libraries.

11:52 PM Changeset in webkit [279213] by Kyle Piddington
  • 2 edits in trunk/Source/ThirdParty/ANGLE

Fix incorrect indexing / out of bounds access in getRestartIndices
https://bugs.webkit.org/show_bug.cgi?id=227274
<rdar://79244789>

In the case where a restart index is present in the last element of an index array, we can accidently
access out of bounds. Fix this by checking boundaries, and fixing other indexing errors

Tests: Ran deqp/functional/gles3/primitiverestart suite. Passed 8 tests.

Reviewed by Dean Jackson.

  • src/libANGLE/renderer/metal/BufferMtl.mm:

(rx::calculateRestartRanges):

11:51 PM Changeset in webkit [279212] by Kyle Piddington
  • 3 edits in trunk/Source/ThirdParty/ANGLE

Guard against compile failures of the default libraries
https://bugs.webkit.org/show_bug.cgi?id=227239
<rdar://79037623>

Under certain events (High memory usage), the MTLCompilerService can fail when creating the default library.
Guard against nil pipelines by failing GL calls instead, if this happens. While this can create rendering artifacts
due to missing blits / conversions, this can at least avoid crashing the process.

Reviewed by Dean Jackson.

  • src/libANGLE/renderer/metal/mtl_render_utils.h:
  • src/libANGLE/renderer/metal/mtl_render_utils.mm:

(rx::mtl::ClearUtils::setupClearWithDraw):
(rx::mtl::ClearUtils::clearWithDraw):
(rx::mtl::ColorBlitUtils::setupColorBlitWithDraw):
(rx::mtl::ColorBlitUtils::blitColorWithDraw):
(rx::mtl::DepthStencilBlitUtils::setupDepthStencilBlitWithDraw):
(rx::mtl::DepthStencilBlitUtils::blitDepthStencilWithDraw):
(rx::mtl::VertexFormatConversionUtils::setupCommonConvertVertexFormatToFloat):
(rx::mtl::VertexFormatConversionUtils::expandVertexFormatComponentsVS):
(rx::mtl::VertexFormatConversionUtils::setupCommonExpandVertexFormatComponents):

11:01 PM Changeset in webkit [279211] by achristensen@apple.com
  • 16 edits
    23 adds
    3 deletes in trunk/LayoutTests/imported/w3c

Resync url WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227321

Patch by Chris Dumez <Chris Dumez> on 2021-06-23
Reviewed by Alex Christensen.

Resync url WPT tests from upstream a38612f39e7752c353.

  • web-platform-tests/url/*: Updated.
10:27 PM Changeset in webkit [279210] by Said Abou-Hallawa
  • 2 edits in trunk/Source/WebKit

REGRESSION(r278970): A CATransaction commitHandler should not execute a client callback
https://bugs.webkit.org/show_bug.cgi?id=227318
<rdar://79625962>

Reviewed by Tim Horton.

In takeSnapshotWithConfiguration() we call callSnapshotRect() inside the
callback of [CATransaction addCommitHandler].

callSnapshotRect() calls the client callback which may call directly or
indirectly addCommitHandler. But it is prohibited by CA to add a commit
handler while processing a registered commit handler.

The fix is to postpone calling callSnapshotRect() till CATransaction
processes all its commit handler callbacks.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):

9:27 PM Changeset in webkit [279209] by mark.lam@apple.com
  • 7 edits in trunk/Source

Base Options::useWebAssemblyFastMemory's default value on Gigacage::hasCapacityToUseLargeGigacage.
https://bugs.webkit.org/show_bug.cgi?id=227328

Reviewed by Saam Barati.

Source/bmalloc:

Rename Gigacage::useLargeGigacage to Gigacage::hasCapacityToUseLargeGigacage.

  • bmalloc/Gigacage.h:

Source/JavaScriptCore:

Gigacage::hasCapacityToUseLargeGigacage is determined based on EFFECTIVE_ADDRESS_WIDTH.
If we have enough address range to potentially use a large gigacage, then we have
enough address range to useWebAssemblyFastMemory.

  • runtime/Options.cpp:

(JSC::canUseWebAssemblyFastMemory):

  • runtime/OptionsList.h:

Source/WTF:

Provide a Gigacage::hasCapacityToUseLargeGigacage value for when !GIGACAGE_ENABLED.

  • wtf/Gigacage.h:
9:13 PM Changeset in webkit [279208] by Jean-Yves Avenard
  • 67 edits in trunk/Source

Not all uses of AudioToolbox framework use soft linking
https://bugs.webkit.org/show_bug.cgi?id=227250
<rdar://problem/79606090>

Reviewed by Eric Carlson.

Source/WebCore:

Unify AudioToolbox, CoreMedia, VideoToolbox and MediaToolbox's method
definitions and their use, ensuring that they are always soft-linked.
Unified builds and the inconsistent use of explicitly using the PAL namespace
caused some calls to be ambiguous leading to compilation errors; some
code would also use the softlinked methods while others called into the frameworks
directly.
To get around those we ensure that any calls to AudioToolbox or CoreMedia is always using
the fully resolved PAL name.
Remove unnecessary using namespace PAL; statements wherever applicable.
No change in observable behavior.

  • Modules/mediastream/PeerConnectionBackend.cpp:
  • Modules/plugins/QuickTimePluginReplacement.mm:
  • Modules/webaudio/MediaStreamAudioSourceCocoa.cpp:

(WebCore::MediaStreamAudioSource::consumeAudio):

  • dom/Document.cpp:
  • html/HTMLCanvasElement.cpp:
  • html/HTMLMediaElement.cpp:
  • platform/audio/AudioFileReader.h:
  • platform/audio/cocoa/AudioFileReaderCocoa.cpp:

(WebCore::AudioFileReader::AudioFileReader):
(WebCore::AudioFileReader::~AudioFileReader):
(WebCore::AudioFileReader::createBus):
(WebCore::createBusFromAudioFile): Deleted.

  • platform/audio/cocoa/AudioFileReaderCocoa.h:
  • platform/audio/cocoa/AudioOutputUnitAdaptor.cpp:

(WebCore::AudioOutputUnitAdaptor::~AudioOutputUnitAdaptor):
(WebCore::AudioOutputUnitAdaptor::start):
(WebCore::AudioOutputUnitAdaptor::stop):

  • platform/audio/cocoa/AudioSampleBufferList.cpp:

(WebCore::AudioSampleBufferList::copyFrom):

  • platform/audio/cocoa/AudioSampleDataSource.mm:
  • platform/audio/cocoa/WebAudioBufferList.cpp:

(WebCore::WebAudioBufferList::WebAudioBufferList):

  • platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:

(WebCore::AudioFileReader::decodeAudioForBusCreation):
(WebCore::createBusFromAudioFile): Deleted.

  • platform/audio/ios/AudioOutputUnitAdaptorIOS.cpp:

(WebCore::AudioOutputUnitAdaptor::configure):

  • platform/audio/mac/AudioOutputUnitAdaptorMac.cpp:

(WebCore::AudioOutputUnitAdaptor::configure):

  • platform/cocoa/MediaUtilities.cpp:

(WebCore::createAudioFormatDescription):
(WebCore::createAudioSampleBuffer):

  • platform/graphics/RemoteVideoSample.cpp:

(WebCore::RemoteVideoSample::create):

  • platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:

(WebCore::AudioSourceProviderAVFObjC::create):
(WebCore::AudioSourceProviderAVFObjC::provideInput):
(WebCore::AudioSourceProviderAVFObjC::createMixIfNeeded):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
(WebCore::AudioSourceProviderAVFObjC::prepareCallback):
(WebCore::AudioSourceProviderAVFObjC::unprepareCallback):
(WebCore::AudioSourceProviderAVFObjC::processCallback):
(WebCore::AudioSourceProviderAVFObjC::prepare):
(WebCore::AudioSourceProviderAVFObjC::process):

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

(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageGenerator):
(WebCore::MediaPlayerPrivateAVFoundationObjC::getStartDate const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::currentMediaTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformBufferedTimeRanges const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMinTimeSeekable const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeSeekable const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformMaxTimeLoaded const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataGroupDidArrive):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
(WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):

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

(WebCore::EffectiveRateChangedListener::stop):
(WebCore::EffectiveRateChangedListener::EffectiveRateChangedListener):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentMediaTime const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCurrentTimeDidChangeCallback):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastPixelBuffer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::destroyLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::streamSession):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):

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

(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
(WebCore::videoTransformationMatrix):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage):

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

(WTF::CFTypeTrait<CMSampleBufferRef>::typeID):
(WebCore::MediaSampleAVFObjC::createImageSample):
(WebCore::MediaSampleAVFObjC::presentationTime const):
(WebCore::MediaSampleAVFObjC::decodeTime const):
(WebCore::MediaSampleAVFObjC::duration const):
(WebCore::MediaSampleAVFObjC::sizeInBytes const):
(WebCore::MediaSampleAVFObjC::videoPixelFormat const):
(WebCore::isCMSampleBufferAttachmentRandomAccess):
(WebCore::doesCMSampleBufferHaveSyncInfo):
(WebCore::isCMSampleBufferRandomAccess):
(WebCore::isCMSampleBufferAttachmentNonDisplaying):
(WebCore::isCMSampleBufferNonDisplaying):
(WebCore::MediaSampleAVFObjC::presentationSize const):
(WebCore::MediaSampleAVFObjC::offsetTimestampsBy):
(WebCore::MediaSampleAVFObjC::setTimestamps):
(WebCore::MediaSampleAVFObjC::isDivisable const):
(WebCore::MediaSampleAVFObjC::divide):
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy const):
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
(WebCore::setSampleBufferAsDisplayImmediately):
(WebCore::MediaSampleAVFObjC::isHomogeneous const):
(WebCore::MediaSampleAVFObjC::divideIntoHomogeneousSamples):
(WebCore::MediaSampleAVFObjC::cloneSampleBufferAndSetAsDisplayImmediately):

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

(WebCore::bufferWasConsumedCallback):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::rendererWasAutomaticallyFlushed):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::canSetMinimumUpcomingPresentationTime const):
(WebCore::SourceBufferPrivateAVFObjC::setMinimumUpcomingPresentationTime):

  • platform/graphics/cocoa/SourceBufferParserWebM.cpp:

(WebCore::SourceBufferParserWebM::OnFrame):
(WebCore::SourceBufferParserWebM::VideoTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::VideoTrackData::createSampleBuffer):
(WebCore::SourceBufferParserWebM::AudioTrackData::consumeFrameData):
(WebCore::SourceBufferParserWebM::AudioTrackData::createSampleBuffer):

  • platform/graphics/cocoa/VP9UtilitiesCocoa.mm:

(WebCore::convertToCMColorPrimaries):
(WebCore::convertToCMTransferFunction):
(WebCore::convertToCMYCbCRMatrix):
(WebCore::createFormatDescriptionFromVPCodecConfigurationRecord):

  • platform/graphics/cocoa/WebCoreDecompressionSession.mm:

(WTF::CFTypeTrait<CMSampleBufferRef>::typeID):
(WebCore::WebCoreDecompressionSession::setTimebase):
(WebCore::WebCoreDecompressionSession::enqueueSample):
(WebCore::WebCoreDecompressionSession::shouldDecodeSample):
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
(WebCore::WebCoreDecompressionSession::isReadyForMoreMediaData const):
(WebCore::WebCoreDecompressionSession::notifyWhenHasAvailableVideoFrame):
(WebCore::WebCoreDecompressionSession::imageForTime):
(WebCore::WebCoreDecompressionSession::flush):
(WebCore::WebCoreDecompressionSession::getDecodeTime):
(WebCore::WebCoreDecompressionSession::getPresentationTime):
(WebCore::WebCoreDecompressionSession::getDuration):
(WebCore::WebCoreDecompressionSession::compareBuffers):
(WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):

  • platform/graphics/cv/ImageTransferSessionVT.mm:

(WebCore::ImageTransferSessionVT::createPixelBuffer):
(WebCore::ImageTransferSessionVT::convertCMSampleBuffer):
(WebCore::ImageTransferSessionVT::createCMSampleBuffer):

  • platform/ios/PlaybackSessionInterfaceAVKit.mm:

(WebCore::PlaybackSessionInterfaceAVKit::seekableRangesChanged):

  • platform/mac/VideoFullscreenInterfaceMac.mm:
  • platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:

(WebCore::MediaRecorderPrivateAVFImpl::videoSampleAvailable):

  • platform/mediarecorder/cocoa/AudioSampleBufferCompressor.mm:

(WebCore::AudioSampleBufferCompressor::~AudioSampleBufferCompressor):
(WebCore::AudioSampleBufferCompressor::initialize):
(WebCore::AudioSampleBufferCompressor::finish):
(WebCore::AudioSampleBufferCompressor::initAudioConverterForSourceFormatDescription):
(WebCore::AudioSampleBufferCompressor::attachPrimingTrimsIfNeeded):
(WebCore::AudioSampleBufferCompressor::gradualDecoderRefreshCount):
(WebCore::AudioSampleBufferCompressor::sampleBufferWithNumPackets):
(WebCore::AudioSampleBufferCompressor::provideSourceDataNumOutputPackets):
(WebCore::AudioSampleBufferCompressor::processSampleBuffersUntilLowWaterTime):
(WebCore::AudioSampleBufferCompressor::processSampleBuffer):
(WebCore::AudioSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::AudioSampleBufferCompressor::takeOutputSampleBuffer):

  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
  • platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:

(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedVideoSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::processNewCompressedAudioSampleBuffers):
(WebCore::MediaRecorderPrivateWriter::startAssetWriter):
(WebCore::MediaRecorderPrivateWriter::appendCompressedVideoSampleBuffer):
(WebCore::appendEndsPreviousSampleDurationMarker):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::completeFetchData):
(WebCore::MediaRecorderPrivateWriter::pause):
(WebCore::MediaRecorderPrivateWriter::resume):

  • platform/mediarecorder/cocoa/VideoSampleBufferCompressor.mm:

(WebCore::VideoSampleBufferCompressor::~VideoSampleBufferCompressor):
(WebCore::VideoSampleBufferCompressor::initialize):
(WebCore::VideoSampleBufferCompressor::finish):
(WebCore::VideoSampleBufferCompressor::videoCompressionCallback):
(WebCore::VideoSampleBufferCompressor::vtProfileLevel const):
(WebCore::VideoSampleBufferCompressor::initCompressionSession):
(WebCore::VideoSampleBufferCompressor::processSampleBuffer):
(WebCore::VideoSampleBufferCompressor::getOutputSampleBuffer):
(WebCore::VideoSampleBufferCompressor::takeOutputSampleBuffer):

  • platform/mediastream/cocoa/AudioMediaStreamTrackRendererInternalUnit.cpp:

(WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::start):
(WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::stop):
(WebCore::LocalAudioMediaStreamTrackRendererInternalUnit::createAudioUnitIfNeeded):

  • platform/mediastream/mac/AVVideoCaptureSource.mm:

(WebCore::AVVideoCaptureSource::setSessionSizeAndFrameRate):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::generatePresets):

  • platform/mediastream/mac/CoreAudioCaptureDevice.cpp:

(WebCore::CoreAudioCaptureDevice::deviceClock):

  • platform/mediastream/mac/CoreAudioCaptureSource.cpp:

(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
(WebCore::CoreAudioSharedUnit::configureSpeakerProc):
(WebCore::CoreAudioSharedUnit::cleanupAudioUnit):
(WebCore::CoreAudioSharedUnit::reconfigureAudioUnit):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::stopInternal):
(WebCore::CoreAudioSharedUnit::defaultInputDevice):

  • platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
  • platform/mediastream/mac/MockAudioSharedUnit.mm:

(WebCore::MockAudioSharedUnit::reconfigure):
(WebCore::MockAudioSharedUnit::emitSampleBuffers):

  • platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
  • platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:

(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):

  • platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:

(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):

  • platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:

(WebCore::RealtimeOutgoingVideoSourceCocoa::videoSampleAvailable):

  • platform/mediastream/mac/WindowDisplayCapturerMac.mm:

Source/WebCore/PAL:

  • pal/cf/AudioToolboxSoftLink.cpp:
  • pal/cf/AudioToolboxSoftLink.h: Add methods whose definitions were scattered across

the code.

  • pal/cocoa/MediaToolboxSoftLink.cpp:
  • pal/cocoa/MediaToolboxSoftLink.h: Same as above.
  • pal/cf/AudioToolboxSoftLink.cpp:
  • pal/cf/AudioToolboxSoftLink.h: Add missing methods
  • pal/cf/CoreMediaSoftLink.cpp:
  • pal/cf/CoreMediaSoftLink.h: Add missing methods
  • pal/cf/VideoToolboxSoftLink.cpp:
  • pal/cf/VideoToolboxSoftLink.h: Add missing methods and fix some spelling in define names
  • pal/cocoa/MediaToolboxSoftLink.cpp:
  • pal/cocoa/MediaToolboxSoftLink.h: Add missing methods

Source/WebKit:

  • UIProcess/Cocoa/WebProcessProxyCocoa.mm:

(WebKit::WebProcessProxy::sendAudioComponentRegistrations):

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::consumeAudioComponentRegistrations):

  • Shared/mac/MediaFormatReader/CoreMediaWrapped.cpp:

(WebKit::createWrapper):
(WebKit::wrapperStorage):
(WebKit::wrapperVTable):

  • Shared/mac/MediaFormatReader/MediaFormatReader.cpp:

(WebKit::MediaFormatReader::copyProperty):

  • Shared/mac/MediaFormatReader/MediaSampleByteRange.cpp:

(WebKit::MediaSampleByteRange::MediaSampleByteRange):

  • Shared/mac/MediaFormatReader/MediaSampleCursor.cpp:
  • Shared/mac/MediaFormatReader/MediaTrackReader.cpp:
  • UIProcess/Cocoa/WebProcessProxyCocoa.mm:

(WebKit::WebProcessProxy::sendAudioComponentRegistrations):

  • UIProcess/Media/cocoa/MediaUsageManagerCocoa.mm:
  • WebProcess/cocoa/RemoteRealtimeAudioSource.cpp:
  • WebProcess/cocoa/RemoteRealtimeMediaSourceProxy.cpp:
  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::consumeAudioComponentRegistrations):

8:43 PM Changeset in webkit [279207] by Jean-Yves Avenard
  • 2 edits in trunk/Source/WebCore

Remove #include <wtf/Optional.h>
https://bugs.webkit.org/show_bug.cgi?id=227335

Reviewed by Darin Adler.

  • Modules/mediasession/MediaSessionCoordinatorPrivate.h:
8:34 PM Changeset in webkit [279206] by Peng Liu
  • 3 edits in trunk/Source/WebCore

[iPadOS] A video cannot enter picture-in-picture when Safari is suspended
https://bugs.webkit.org/show_bug.cgi?id=227325

Reviewed by Eric Carlson.

When an element goes into the element fullscreen mode, a descendant video element
gains the ability to automatically enter picture-in-picture on application suspend.
However, the video element may lose the ability after some stress tests.

The root cause is related to m_restoringFullscreenForPictureInPictureStop.
Under stress tests, -[AVPlayerViewController enterFullScreenAnimated:completionHandler]
may call the completion handler with success == NO. The current implementation
will keep m_restoringFullscreenForPictureInPictureStop with a wrong value,
so that the video cannot enter picture-in-picture automatically when the browser
is suspended.

This patch removes m_restoringFullscreenForPictureInPictureStop since it is not needed
after r269557.

Manually tested.

  • platform/ios/VideoFullscreenInterfaceAVKit.h:
  • platform/ios/VideoFullscreenInterfaceAVKit.mm:

(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler):
(VideoFullscreenInterfaceAVKit::doEnterFullscreen):
(VideoFullscreenInterfaceAVKit::enterFullscreenHandler):

8:32 PM Changeset in webkit [279205] by Chris Dumez
  • 2 edits in trunk/LayoutTests

Unreviewed, mark imported/w3c/web-platform-tests/mediacapture-streams/MediaStreamTrack-MediaElement-disabled-audio-is-silence.https.html as flaky on iOS.

  • platform/ios-wk2/TestExpectations:
8:27 PM Changeset in webkit [279204] by Chris Dumez
  • 4 edits in trunk/LayoutTests

Unreviewed, silence console logging for imported/w3c/web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects.html

The console logging was making the test flaky.

LayoutTests/imported/w3c:

  • web-platform-tests/html/browsers/origin/cross-origin-objects/cross-origin-objects-expected.txt:

LayoutTests:

7:06 PM Changeset in webkit [279203] by commit-queue@webkit.org
  • 8 edits
    2 adds in trunk

Fix some PerformanceNavigationTiming bugs
https://bugs.webkit.org/show_bug.cgi?id=227329

Patch by Alex Christensen <achristensen@webkit.org> on 2021-06-23
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

  • web-platform-tests/navigation-timing/buffered-flag.window-expected.txt: Added.
  • web-platform-tests/navigation-timing/buffered-flag.window.html: Added.
  • web-platform-tests/navigation-timing/nav2_test_unique_nav_instances-expected.txt:

Source/WebCore:

Test: imported/w3c/web-platform-tests/navigation-timing/buffered-flag.window.html

This fixes two bugs:

  1. We need to delay the PerformanceObserver event until didFinishNavigation time, which is after iframes have also finished loading.
  2. We need to remember whether we've added the PerformanceNavigationTiming to a PerformanceObserver's list to avoid duplicate entries.

This fixes two WPT tests that were passed by Chrome and Firefox.
PerformanceNavigationTiming is still an off-by-default experimental feature, so this won't affect anything yet.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::checkLoadCompleteForThisFrame):

  • page/Performance.cpp:

(WebCore::Performance::appendBufferedEntriesByType const):
(WebCore::Performance::registerPerformanceObserver):
(WebCore::Performance::scheduleNavigationObservationTaskIfNeeded):

  • page/Performance.h:
  • page/PerformanceObserver.cpp:

(WebCore::PerformanceObserver::observe):

  • page/PerformanceObserver.h:

(WebCore::PerformanceObserver::hasNavigationTiming const):
(WebCore::PerformanceObserver::addedNavigationTiming):

6:58 PM Changeset in webkit [279202] by Chris Dumez
  • 91 edits
    2 moves
    3 adds
    1 delete in trunk/LayoutTests

Update WPT resources from upstream
https://bugs.webkit.org/show_bug.cgi?id=227296

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

  • web-platform-tests/IndexedDB/idlharness.any-expected.txt:
  • web-platform-tests/IndexedDB/idlharness.any.worker-expected.txt:
  • web-platform-tests/WebCryptoAPI/idlharness.https.any-expected.txt:
  • web-platform-tests/WebCryptoAPI/idlharness.https.any.worker-expected.txt:
  • web-platform-tests/content-security-policy/securitypolicyviolation/idlharness.window-expected.txt:
  • web-platform-tests/css/css-animations/idlharness-expected.txt:
  • web-platform-tests/css/css-font-loading/idlharness.https-expected.txt:
  • web-platform-tests/css/css-syntax/input-preprocessing-expected.txt:
  • web-platform-tests/css/css-transitions/idlharness-expected.txt:
  • web-platform-tests/css/cssom-view/idlharness-expected.txt:
  • web-platform-tests/css/cssom/idlharness-expected.txt:
  • web-platform-tests/dom/idlharness.any.worker-expected.txt:
  • web-platform-tests/dom/idlharness.window-expected.txt:
  • web-platform-tests/domparsing/idlharness.window-expected.txt:
  • web-platform-tests/eventsource/idlharness-expected.txt:
  • web-platform-tests/fetch/api/idlharness.any-expected.txt:
  • web-platform-tests/fetch/api/idlharness.any.worker-expected.txt:
  • web-platform-tests/fetch/cors-rfc1918/idlharness.tentative.any-expected.txt:
  • web-platform-tests/fetch/cors-rfc1918/idlharness.tentative.any.worker-expected.txt:
  • web-platform-tests/hr-time/idlharness.any-expected.txt:
  • web-platform-tests/hr-time/idlharness.any.worker-expected.txt:
  • web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt:
  • web-platform-tests/html/dom/idlharness.worker-expected.txt:
  • web-platform-tests/html/infrastructure/safe-passing-of-structured-data/structured-cloning-error-stack-optional.sub.window-expected.txt:
  • web-platform-tests/interfaces/DOM-Parsing.idl:
  • web-platform-tests/interfaces/SVG.idl:
  • web-platform-tests/interfaces/mediasession.idl:
  • web-platform-tests/mediasession/idlharness.window-expected.txt:
  • web-platform-tests/notifications/idlharness.https.any-expected.txt:
  • web-platform-tests/notifications/idlharness.https.any.worker-expected.txt:
  • web-platform-tests/pointerevents/idlharness.window-expected.txt:

Rebaseline existing tests.

  • web-platform-tests/resources/*: Updated.

LayoutTests:

  • platform/mac-wk2/imported/w3c/web-platform-tests/html/dom/idlharness.https-expected.txt:
6:25 PM Changeset in webkit [279201] by Russell Epstein
  • 1 copy in tags/Safari-611.3.10.1.2

Tag Safari-611.3.10.1.2.

5:45 PM Changeset in webkit [279200] by Truitt Savell
  • 2 edits in trunk/Source/WebCore

Fix iOS Debug testing be removing the assert added in r279119
https://bugs.webkit.org/show_bug.cgi?id=227227

Reviewed by Eric Carlson.

  • platform/audio/ios/AudioSessionIOS.mm:

(WebCore::setEligibleForSmartRouting):

5:15 PM Changeset in webkit [279199] by Russell Epstein
  • 1 copy in tags/Safari-612.1.18.11.2

Tag Safari-612.1.18.11.2.

5:10 PM Changeset in webkit [279198] by Russell Epstein
  • 8 edits in branches/safari-612.1.18.11-branch/Source

Versioning.

WebKit-7612.1.18.11.2

4:44 PM Changeset in webkit [279197] by Wenson Hsieh
  • 3 edits in trunk/Source/WebKit

Add a delegate SPI to allow arbitrary gestures to ignore preventDefault() with active touch events
https://bugs.webkit.org/show_bug.cgi?id=227311
rdar://79624236

Reviewed by Tim Horton.

Add a UI delegate hook to allow internal clients to (easily) introduce gesture recognizers on WKWebView that are
capable of recognizing even if active touch events are prevented by the page. This allows Safari to stop
overriding an internal method on WKWebView, -_isNavigationSwipeGestureRecognizer:.

Testing this requires the ability to simulate touch events (through HID event dispatch) in API tests.

  • UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _touchEventsMustRequireGestureRecognizerToFail:]):

Note that we only consult the delegate here for gestures that are added directly to WKWebView. This is because
we already avoid deferring gestures that are added *above* WKWebView, and it's unnecessary to allow clients to
avoid deferring gestures that are internal to WebKit (i.e. added on WKContentView).

(-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
(-[WKContentView deferringGestureRecognizer:shouldDeferOtherGestureRecognizer:]):

4:36 PM Changeset in webkit [279196] by Russell Epstein
  • 3 edits in branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit

Unreviewed build fix. rdar://problem/79474211

Sources/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:82:5: error: static_assert failed due to requirement 'sizeof (WebKitVP9Decoder_BaseClass.alignedClass.version) == sizeof(unsigned long)' CMBaseClass fixup is not required

4:00 PM Changeset in webkit [279195] by commit-queue@webkit.org
  • 6 edits
    4 adds in trunk

[iOS 15 Regression]: scroll position resets when using scroll snap
https://bugs.webkit.org/show_bug.cgi?id=226816
<rdar://problem/79081301>

Patch by Martin Robinson <mrobinson@igalia.com> on 2021-06-23
Reviewed by Simon Fraser.

Source/WebKit:

To improve scrolling fluidity on iOS, have any sort of momentum scroll trigger directional
scroll snapping. This means that any momentum scroll will move to the next or previous scroll
position and not snap back. This improves behavior on tesla.com and also on the scroll
snapping demo on the WebKit page.

Tests: fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-main-frame.html

fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-overflow-scroll-area.html

  • UIProcess/API/ios/WKWebViewIOS.mm:

(-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Pass the current scroll offset to
the RemoteScrollingCoordinatorProxy. Passing a value for this offset is the trigger for directional scroll
snapping.

  • UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: Update method definitions.
  • UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:

(WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Pass the current offset.
(WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling const): Ditto.

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:

(-[WKScrollingNodeScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Enable
directional scroll snapping for RenderLayers.

LayoutTests:

  • fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-main-frame-expected.txt: Added.
  • fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-main-frame.html: Added.
  • fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-overflow-scroll-area-expected.txt: Added.
  • fast/scrolling/ios/scroll-snap-with-momentum-scroll-in-overflow-scroll-area.html: Added.
3:37 PM Changeset in webkit [279194] by Russell Epstein
  • 1 copy in tags/Safari-612.1.18.11.1

Tag Safari-612.1.18.11.1.

3:09 PM Changeset in webkit [279193] by commit-queue@webkit.org
  • 10 edits in trunk/Source

Add a new pattern to instruction selector to utilize UBFIZ supported by ARM64
https://bugs.webkit.org/show_bug.cgi?id=227204

Patch by Yijia Huang <Yijia Huang> on 2021-06-23
Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch includes three parts:

A) Add UBFIZ to instruction selector.
B) Fix UBFX, introduced in https://bugs.webkit.org/show_bug.cgi?id=226984,

to match all patterns.

C) Fix error condition in one strength reduction introduced

in https://bugs.webkit.org/show_bug.cgi?id=227138.

Part A
Unsigned Bitfield Insert in Zero(UBFIZ), supported by ARM64, zeros the
destination register and copies any number of contiguous bits from a
source register into any position in the destination register. The
instruction selector can utilize this to lowering certain patterns in
B3 IR before further Air optimization.

Given the operation: ubfiz d, n, lsb, width

This is equivalent to "d = (n << lsb) & (((1 << width) - 1) << lsb)".
Since wasm introduces constant folding, then the matched patterns would be:
1.1 d = (n << lsb) & maskShift
1.2 d = maskShift & (n << lsb)

2.1 d = (n & mask) << lsb
2.2 d = (mask & n) << lsb

Where:

maskShift = mask << lsb
mask = (1 << width) - 1

To make the pattern matching in instruction selection beneficial to JIT, these
constraints should be introduced:

  1. 0 <= lsb < datasize
  2. 0 < width < datasize
  3. lsb + width <= datasize

Choose (n & mask) << lsb as the canonical form and introduce a strength reduction.
Turn this: (n << lsb) & maskShift
Into this: (n & mask) << lsb

Given B3 IR:
Int @0 = ArgumentReg(%x0)
Int @1 = lsb
Int @2 = 0b0110
Int @3 = Shl(@0, @1)
Int @4 = BitAnd(@3, @2)
Void@5 = Return(@4, Terminal)

Before Adding UBFIZ Pattern:
Old optimized AIR
Lshift %x0, $62, %x0, @3
And 0b0110, %x0, %x0, @4
Ret %x0, @5

After Adding UBFIZ Pattern:
New optimized AIR
Ubfiz %x0, lsb, 2, %x0, @4
Ret %x0, @5

Part B
Fix UBFX to match both patterns:
dest = (src >> lsb) & mask
dest = mask & (src >> lsb)

Where:

  1. mask = (1 << width) - 1
  2. 0 <= lsb < datasize
  3. 0 < width < datasize
  4. lsb + width <= datasize

Part C
Fix one B3 strength reduction.
Turn this: (src >> shiftAmount) & mask
Into this: src >> shiftAmount

With updated constraints:

  1. mask = (1 << width) - 1
  2. 0 <= shiftAmount < datasize
  3. 0 < width < datasize
  4. shiftAmount + width >= datasize
  • assembler/MacroAssemblerARM64.h:

(JSC::MacroAssemblerARM64::ubfiz32):
(JSC::MacroAssemblerARM64::ubfiz64):

  • assembler/testmasm.cpp:

(JSC::testUbfiz32):
(JSC::testUbfiz64):

  • b3/B3LowerToAir.cpp:
  • b3/air/AirOpcode.opcodes:
  • b3/testb3.h:
  • b3/testb3_2.cpp:

(testUbfx32ArgLeft):
(testUbfx32ArgRight):
(testUbfx64ArgLeft):
(testUbfx64ArgRight):
(testUbfiz32ArgLeft):
(testUbfiz32ArgRight):
(testUbfiz64ArgLeft):
(testUbfiz64ArgRight):
(addBitTests):
(testUbfx32): Deleted.
(testUbfx32PatternMatch): Deleted.
(testUbfx64): Deleted.
(testUbfx64PatternMatch): Deleted.

Source/WTF:

Add functions to count the consecutive zero bits (trailing) on the
right with modulus division and lookup. Reference: Bit Twiddling Hacks.

  • wtf/MathExtras.h:

(WTF::countTrailingZeros):

3:04 PM Changeset in webkit [279192] by Chris Dumez
  • 6 edits
    13 adds in trunk/LayoutTests/imported/w3c

Resync IndexedDB WPT tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=227315

Reviewed by Darin Adler.

Resync IndexedDB WPT tests from upstream a38612f39e7752c3532080c.

  • web-platform-tests/IndexedDB/*: Updated.
3:03 PM Changeset in webkit [279191] by Russell Epstein
  • 8 edits in branches/safari-612.1.18.11-branch/Source

Versioning.

WebKit-7612.1.18.11.1

2:42 PM Changeset in webkit [279190] by Russell Epstein
  • 8 edits in branches/safari-611.3.10.1-branch/Source

Versioning.

WebKit-7611.3.10.1.2

2:41 PM Changeset in webkit [279189] by Russell Epstein
  • 2 edits in branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc

Cherry-pick r279187. rdar://problem/79474211

WebKitDecoder.h should include TargetConditionals.h
https://bugs.webkit.org/show_bug.cgi?id=227314
<rdar://problem/79689776>

Reviewed by Geoff Garen.

  • Source/webrtc/sdk/WebKit/WebKitDecoder.h: Include TargetConditionals.h so the TARGET_ defines are initialized correctly.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2:41 PM Changeset in webkit [279188] by Russell Epstein
  • 4 edits in branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc

Cherry-pick r279101. rdar://problem/79474211

[Mac] libwebrtc CMBaseClass objects need alignment fixup
https://bugs.webkit.org/show_bug.cgi?id=227137
<rdar://problem/79464124>

Reviewed by Youenn Fablet.

  • Source/webrtc/sdk/WebKit/WebKitDecoder.h: Define CMBASE_OBJECT_NEEDS_ALIGNMENT.
  • Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp: (webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on Mac and Mac Catalyst when building for x86_64 so function pointers are naturally aligned. Add static_asserts to ensure alignment and sizes are correct.
  • Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp: (webrtc::createWebKitVP9Decoder): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

2:30 PM Changeset in webkit [279187] by eric.carlson@apple.com
  • 2 edits in trunk/Source/ThirdParty/libwebrtc

WebKitDecoder.h should include TargetConditionals.h
https://bugs.webkit.org/show_bug.cgi?id=227314
<rdar://problem/79689776>

Reviewed by Geoff Garen.

  • Source/webrtc/sdk/WebKit/WebKitDecoder.h: Include TargetConditionals.h so the

TARGET_ defines are initialized correctly.

2:21 PM Changeset in webkit [279186] by jer.noble@apple.com
  • 14 edits in trunk/Source

[Cocoa] Make the hostTime parameter to playSession a Monotonic time
https://bugs.webkit.org/show_bug.cgi?id=226515

Reviewed by Youenn Fablet.

Source/WebCore:

Fire the playSession action handler at approximately the hostTime indicated by the MediaSessionCoordinatorPrivate.

  • Modules/mediasession/MediaSessionCoordinator.cpp:

(WebCore::MediaSessionCoordinator::playSession):

  • Modules/mediasession/MediaSessionCoordinator.h:
  • Modules/mediasession/MediaSessionCoordinatorPrivate.h:

(WebCore::MediaSessionCoordinatorClient::playSession):

Source/WebCore/PAL:

SoftLink CMClockConvertHostTimeToSystemUnits.

  • pal/cf/CoreMediaSoftLink.cpp:
  • pal/cf/CoreMediaSoftLink.h:

Source/WebKit:

  • UIProcess/API/Cocoa/WKWebViewTesting.mm:

(-[WKWebView _createMediaSessionCoordinatorForTesting:completionHandler:]):
(-[WKMediaSessionCoordinatorHelper playSessionWithCompletion:]):

  • UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp:

(WebKit::RemoteMediaSessionCoordinatorProxy::playSession):

  • UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h:
  • WebProcess/MediaSession/RemoteMediaSessionCoordinator.cpp:

(WebKit::RemoteMediaSessionCoordinator::playSession):

  • WebProcess/MediaSession/RemoteMediaSessionCoordinator.h:
  • WebProcess/MediaSession/RemoteMediaSessionCoordinator.messages.in:
1:44 PM Changeset in webkit [279185] by Fujii Hironori
  • 3 edits in trunk/LayoutTests

[WinCairo] Unreviewed test gardening

  • platform/wincairo-wk1/TestExpectations:
  • platform/wincairo/TestExpectations:
1:27 PM Changeset in webkit [279184] by Kate Cheney
  • 9 edits in trunk

Migrate App Privacy Report code from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=227045
<rdar://problem/74333287>

Reviewed by Alex Christensen.

Source/WebKit:

  • NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:

(processPCMRequest):
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
(contextString): Deleted.
This patch deletes the contextString function because it is no longer
needed now that CFNetwork sets the attribution context based on the
main document URL, and it seemed silly to migrate code from
WebKitAdditions just to delete it immediately. This also moves the
processPCMRequest function declaration from WebKitAdditions so we can
remove NETWORK_DATA_TASK_COCOA_ADDITIONS.

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(WebKit::isActingOnBehalfOfAFullWebBrowser):
(WebKit::NetworkSessionCocoa::removeNetworkWebsiteData):

  • UIProcess/Cocoa/WebPageProxyCocoa.mm:

(WebKit::WebPageProxy::setLastNavigationWasAppBound):

Source/WTF:

Update compile flag naming to align with the App Privacy Report
feature. Added a new check for Symptoms for a simpler, more clear
check.

  • wtf/PlatformEnableCocoa.h:
  • wtf/PlatformHave.h:

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/InAppBrowserPrivacy.mm:
1:20 PM Changeset in webkit [279183] by Chris Dumez
  • 2 edits in trunk/LayoutTests/imported/w3c

REGRESSION (r279169?): [MacOS] imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_timeupdate_on_seek.html is consistently failing.
https://bugs.webkit.org/show_bug.cgi?id=227312
<rdar://problem/79684170>

Unreviewed, update python script used by the test to be compatible with the new WPT tools (updated in r279169).

  • web-platform-tests/html/semantics/embedded-content/the-video-element/timeout_on_seek.py:

(main):

1:08 PM Changeset in webkit [279182] by Russell Epstein
  • 1 copy in branches/safari-612.1.18.11-branch

New branch.

1:02 PM Changeset in webkit [279181] by Aditya Keerthi
  • 7 edits in trunk

[iOS] Adopt new date picker presentation SPI
https://bugs.webkit.org/show_bug.cgi?id=227221
<rdar://problem/77930086>

Reviewed by Wenson Hsieh.

Source/WebKit:

In native applications, tapping on a compact UIDatePicker presents an
inline picker using _UIDatePickerOverlayPresentation. To avoid
maintaining our own presentation logic, and to better match the native
presentation, use _UIDatePickerOverlayPresentation when tapping on a
date/time input in WebKit.

Covered by existing tests.

  • Platform/spi/ios/UIKitSPI.h:

Declare the SPI rather than importing the header directly, as the
_UIDatePickerOverlayAnchor enum is not available in all SDKs with
the header.

  • UIProcess/ios/forms/WKDateTimeInputControl.mm:

(-[WKDateTimePickerViewController initWithDatePicker:]):
(-[WKDateTimePickerViewController setDelegate:]):
(-[WKDateTimePicker initWithView:datePickerMode:]):

Create the UIDatePicker here so it can be shared by the old context menu
presentation and the new overlay presentation.

(-[WKDateTimePicker handleDatePickerPresentationDismissal]):
(-[WKDateTimePicker removeDatePickerPresentation]):

accessoryDone eventually removes the presentation. If the date picker
is already being dismissed, do not dismiss it without an animation.

For programmatic dismissal (using blur()) this method is called prior to
accessoryDone, in which case we force dismissal without animation.

(-[WKDateTimePicker dateTimePickerViewControllerDidPressResetButton:]):
(-[WKDateTimePicker dateTimePickerViewControllerDidPressDoneButton:]):
(-[WKDateTimePicker showDateTimePicker]):
(-[WKDateTimePicker datePickerChanged:]):
(-[WKDateTimePicker reset:]):
(-[WKDateTimePicker done:]):
(-[WKDateTimePicker dealloc]):
(-[WKDateTimePicker _timeZoneOffsetFromGMT:]):
(-[WKDateTimePicker dateFormatterForPicker]):
(-[WKDateTimePicker _dateChangedSetAsNumber]):
(-[WKDateTimePicker _dateChangedSetAsString]):
(-[WKDateTimePicker setDateTimePickerToInitialValue]):
(-[WKDateTimePicker controlBeginEditing]):
(-[WKDateTimePicker controlEndEditing]):
(-[WKDateTimePicker calendarType]):
(-[WKDateTimePicker hour]):
(-[WKDateTimePicker minute]):
(-[WKDateTimePicker setHour:minute:]):

Source/WTF:

  • wtf/PlatformHave.h:

Add HAVE(UIDATEPICKER_OVERLAY_PRESENTATION) and HAVE(UITOOLBAR_STANDARD_APPEARANCE).

LayoutTests:

  • fast/forms/ios/constant-scroll-area-when-moving-focus-between-fields.html:

Re-order the call to wait for the keyboard to dismiss since the
presentation SPI doesn't tell us exactly when the presentation animation
is complete. The other alternative was to add a manual delay, however,
re-ordering the calls is safe and preserves the original test behavior.

12:40 PM Changeset in webkit [279180] by commit-queue@webkit.org
  • 2 edits in trunk/LayoutTests

[GLIB] Unreviewed test gardening, skip a WebGL2 test
https://bugs.webkit.org/show_bug.cgi?id=227303

Patch by Arcady Goldmints-Orlov <Arcady Goldmints-Orlov> on 2021-06-23

  • platform/glib/TestExpectations:
12:20 PM Changeset in webkit [279179] by keith_miller@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

add/removeManagedReference:withOwner: should have autoreleasepools
https://bugs.webkit.org/show_bug.cgi?id=227308

Reviewed by Darin Adler.

Since these APIs create autoreleased objects as an implementation detail
but don't return any to the caller there's no indication such autoreleased
objects could be accumulating. Additionally, it's entirely reasonable to
call these methods in a loop an a large set of objects, which further
exacerbates the problem.

  • API/JSVirtualMachine.mm:

(-[JSVirtualMachine addManagedReference:withOwner:]):
(-[JSVirtualMachine removeManagedReference:withOwner:]):

12:11 PM Changeset in webkit [279178] by mark.lam@apple.com
  • 2 edits in trunk/Source/WebCore

Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
https://bugs.webkit.org/show_bug.cgi?id=227302

Reviewed by Yusuke Suzuki.

A RELEASE_AND_RETURN will do because we're just propagating the exception to the
client in both cases.

  • bindings/js/ScriptModuleLoader.cpp:

(WebCore::ScriptModuleLoader::evaluate):

11:49 AM Changeset in webkit [279177] by sbarati@apple.com
  • 2 edits in trunk/JSTests

Bound stress/put-by-id-flags with a fixed number of iterations
https://bugs.webkit.org/show_bug.cgi?id=227305

Reviewed by Mark Lam.

  • stress/put-by-id-flags.js:

(numberOfDFGCompiles): Deleted.

11:38 AM Changeset in webkit [279176] by Chris Dumez
  • 1 edit
    2 adds in trunk/LayoutTests

CSSStyleDeclaration.getPropertyPriority() should return the empty string for invalid CSS properties
https://bugs.webkit.org/show_bug.cgi?id=227257
<rdar://problem/79622278>

Reviewed by Darin Adler.

Follow-up to r279125 to improve test coverage for usage of USVString in CSSStyleDeclaration.

  • fast/css/CSSStyleDeclaration-setProperty-unicode-expected.txt: Added.
  • fast/css/CSSStyleDeclaration-setProperty-unicode.html: Added.
11:34 AM Changeset in webkit [279175] by sbarati@apple.com
  • 2 edits in trunk/JSTests

Run typedarray-intrinsic-getters-change-prototype for a fixed set of iterations
https://bugs.webkit.org/show_bug.cgi?id=227304

Reviewed by Mark Lam.

  • stress/typedarray-intrinsic-getters-change-prototype.js:

(body):

10:42 AM Changeset in webkit [279174] by Amir Mark Jr.
  • 2 edits in trunk/LayoutTests

[macOS WK1] imported/w3c/web-platform-tests/css/css-scroll-snap/scroll-target-snap-003.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=227085

Unreviewed test gardening.

Updating previous test expectation.

  • platform/mac-wk1/TestExpectations:
10:14 AM Changeset in webkit [279173] by Russell Epstein
  • 8 edits in branches/safari-611.3.10.0-branch/Source

Versioning.

WebKit-7611.3.10.0.1

10:08 AM Changeset in webkit [279172] by commit-queue@webkit.org
  • 9 edits in trunk/Source

rAF driven WebGL submits excessive amount of GPU work when frames are slow
https://bugs.webkit.org/show_bug.cgi?id=227059
<rdar://problem/79385858>

Patch by Kimmo Kinnunen <kkinnunen@apple.com> on 2021-06-23
Reviewed by Kenneth Russell.

Source/ThirdParty/ANGLE:

Advertise GL_ARB_sync for the Metal backend.
Since GL_ARB_sync is core in OpenGL ES 3.0 and the Metal backend advertises OpenGL ES 3.0,
the API must be working already.

  • src/libANGLE/renderer/metal/DisplayMtl.mm:

(rx::DisplayMtl::initializeExtensions const):

Source/WebCore:

Limit in-flight WebGL frames to three frames. Do not continue preparation for display
until the commands for the oldest frame have been executed by the GPU.

This limits the impact slow frames have, especially in the
case where the compositor skip frames and WebKit would issue a new slow frame
on top of the skipped frame.

No new tests, tested manually with the pages referenced from the bugs.

  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLOpenGL::waitAndUpdateOldestFrame):

  • platform/graphics/angle/GraphicsContextGLANGLEUtilities.h:

(WebCore::ScopedGLFence::ScopedGLFence):
(WebCore::ScopedGLFence::operator=):
(WebCore::ScopedGLFence::~ScopedGLFence):
(WebCore::ScopedGLFence::reset):
(WebCore::ScopedGLFence::abandon):
(WebCore::ScopedGLFence::fenceSync):
(WebCore::ScopedGLFence::operator GLsync const):

  • platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:

(WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
(WebCore::GraphicsContextGLOpenGL::prepareForDisplay):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.h:
9:59 AM Changeset in webkit [279171] by Andres Gonzalez
  • 24 edits
    5 adds in trunk

Accessibility support for image text recognition.
https://bugs.webkit.org/show_bug.cgi?id=224280
rdar://76348740

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/ios-simulator/image-overlay-elements.html

Exposes to accessibility clients the elements created by
WebPage::requestTextRecognition for static images. This allows clients
to present the recognized text in images to assistive technology users.

  • Added a new AXObject subclass, AXImage, to encapsulate this functionality.

This class can be expanded to offload some of the image specific code
contained in AccessibilityRenderObject, AccessibilityNodeObject,
AccessibilityObject and others.

  • Since requestTextRecognition is an async call, added an AXNotification

to notify clients when the image overlay elements are available for
consumption.

  • Sources.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • accessibility/AXImage.cpp: Added.

(WebCore::AXImage::AXImage):
(WebCore::AXImage::create):
(WebCore::AXImage::roleValue const):
(WebCore::AXImage::imageOverlayElements):

  • accessibility/AXImage.h: Added.
  • accessibility/AXLogger.cpp:

(WebCore::operator<<):

  • accessibility/AXObjectCache.cpp:

(WebCore::isSimpleImage): Determines whether a given element is a static
image.
(WebCore::createFromRenderer): Instantiate an AXImage object when
appropriate.

  • accessibility/AXObjectCache.h:
  • accessibility/AccessibilityNodeObject.cpp:

(WebCore::AccessibilityNodeObject::canHaveChildren const): Images can
have children.

  • accessibility/AccessibilityObject.h:
  • accessibility/AccessibilityObjectInterface.h:
  • accessibility/ios/AXObjectCacheIOS.mm:

(WebCore::AXObjectCache::notificationPlatformName):

  • accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:

(-[WebAccessibilityObjectWrapper accessibilityElements]):
(-[WebAccessibilityObjectWrapper accessibilityImageOverlayElements]):

  • accessibility/isolatedtree/AXIsolatedObject.cpp:

(WebCore::AXIsolatedObject::isAXImageInstance const):

  • accessibility/isolatedtree/AXIsolatedObject.h:
  • accessibility/mac/AXObjectCacheMac.mm:

(WebCore::AXObjectCache::postPlatformNotification):

  • accessibility/mac/WebAccessibilityObjectWrapperMac.mm:

(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

  • WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:

(WTR::AccessibilityUIElement::children const):

  • WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
  • WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
  • WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:

(WTR::AccessibilityUIElement::children const):
(WTR::AccessibilityUIElement::imageOverlayElements const):

  • WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:

(WTR::AccessibilityUIElement::children const):
(WTR::AccessibilityUIElement::imageOverlayElements const):

LayoutTests:

  • accessibility/image-link-expected.txt:
  • accessibility/ios-simulator/image-overlay-elements-expected.txt: Added.
  • accessibility/ios-simulator/image-overlay-elements.html: Added.
  • accessibility/resources/green-400x400.png: Added.
9:25 AM Changeset in webkit [279170] by mark.lam@apple.com
  • 7 edits
    2 adds in trunk

Add missing exception checks in ScriptModuleLoader and JSDOMPromiseDeferred.
https://bugs.webkit.org/show_bug.cgi?id=221374
rdar://problem/68911404

Reviewed by Yusuke Suzuki.

Based on patch by Frédéric Wang <fwang@igalia.com>.

Source/WebCore:

When an import call fails, ScriptModuleLoader::notifyFinished() rejects the
deferred promise with either a call to
DeferredPromise::reject(ExceptionCode, const String&, RejectAsHandled) or a call to
rejectToPropagateNetworkError() / DeferredPromise::rejectWithCallback(). When it
succeeds, it calls DeferredPromise::resolveWithPromise(). These correspond to three
places where we enter the VM. Catch scopes are thus added to handle uncaught
exceptions for DeferredPromise.

Currently, this logic for uncaught exceptions is already duplicated at several
places in the code, and is likely needed for other places too in follow-up work.
This patch however covers all the rejection and resolution calls from
ScriptModuleLoader. Additionally, it handles missing exception checks in
ScriptModuleLoader::evaluate.

Test: js/dom/modules/missing-exception-check-for-import.html

  • bindings/js/JSDOMPromiseDeferred.cpp:

(WebCore::DeferredPromise::reject):
(WebCore::DeferredPromise::handleTerminationExceptionIfNeeded):
(WebCore::DeferredPromise::handleUncaughtException):

  • bindings/js/JSDOMPromiseDeferred.h:

(WebCore::DeferredPromise::resolveWithCallback):
(WebCore::DeferredPromise::rejectWithCallback):

  • bindings/js/ScriptModuleLoader.cpp:

(WebCore::ScriptModuleLoader::evaluate):

LayoutTests:

Add a regression test for import('./'). Depending on the system configuration this can
execute two different rejection methods from ScriptModuleLoader::notifyFinished().
In other words, we may get 2 different error messages. Hence, the test needs to
allow for this variance.

Additional test cases are added for rejectToPropagateNetworkError /
DeferredPromise::rejectWithCallback (e.g. module file not found), for
DeferredPromise::reject(ExceptionCode, const String&, RejectAsHandled) (e.g. module file does
not have JavaScript MIME type) and DeferredPromise::resolveWithCallback (e.g. module import
is successful).

Also update promise-rejection-might-stack-overflow.html now that the stack overflow error is
reported.

  • js/dom/modules/missing-exception-check-for-import-expected.txt: Added.
  • js/dom/modules/missing-exception-check-for-import.html: Added.
  • js/dom/promise-rejection-might-stack-overflow-expected.txt:
  • js/dom/promise-rejection-might-stack-overflow.html:
8:37 AM Changeset in webkit [279169] by Chris Dumez
  • 725 edits
    15 copies
    1 move
    682 adds
    32 deletes in trunk

Update WPT tools from upstream
https://bugs.webkit.org/show_bug.cgi?id=227255

Reviewed by Jonathan Bedard.

LayoutTests/imported/w3c:

Update WPT tools from upstream 94d018bb5d7c0d46df7ba1.

  • web-platform-tests/tools/*: Updated.

Tools:

  • Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:

(WebPlatformTestServer.init):
The WPT server requires Python v3 to run so fallback to python3 executable if
the python executable is v2.

8:20 AM Changeset in webkit [279168] by commit-queue@webkit.org
  • 3 edits in trunk/Source/WebKit

Unreviewed, reverting r279104.
https://bugs.webkit.org/show_bug.cgi?id=227292

Made various layout tests very flaky

Reverted changeset:

"[GPU Process] RELEASE_ASSERT in
RemoteResourceCacheProxy::didFinalizeRenderingUpdate() may
fire if GPUP is relaunched"
https://bugs.webkit.org/show_bug.cgi?id=227229
https://trac.webkit.org/changeset/279104

8:20 AM Changeset in webkit [279167] by sbarati@apple.com
  • 2 edits in trunk/Source/JavaScriptCore

Run lazy properties initializers under a DeferTerminationForAWhile scope
https://bugs.webkit.org/show_bug.cgi?id=227271

Reviewed by Mark Lam.

We don't expect that exceptions can be thrown when initializing
a lazy property. Termination exceptions were preventing this from
being true. The latest example found is inside JSModuleLoader when
it asserts that no exception is thrown when creating its JSMap field.
This patch makes it so termination exceptions can't be thrown when
running lazy property initializers.

  • runtime/LazyPropertyInlines.h:

(JSC::ElementType>::initLater):
(JSC::ElementType>::callFunc):

Note: See TracTimeline for information about the timeline view.