[WTF] Import std::optional reference implementation as WTF::Optional
https://bugs.webkit.org/show_bug.cgi?id=164199

Reviewed by Saam Barati and Sam Weinig.

Source/JavaScriptCore:

Previous WTF::Optional::operator= is not compatible to std::optional::operator=.
std::optional::emplace has the same semantics to the previous one.
So we change the code to use it.

* Scripts/builtins/builtins_templates.py:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result:
* Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result:
* Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
* Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::commuteCompareToZeroIntoTest):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::commuteCompareToZeroIntoTest):
* b3/B3CheckSpecial.cpp:
(JSC::B3::CheckSpecial::forEachArg):
(JSC::B3::CheckSpecial::shouldTryAliasingDef):
* b3/B3CheckSpecial.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::scaleForShl):
(JSC::B3::Air::LowerToAir::effectiveAddr):
(JSC::B3::Air::LowerToAir::tryAppendLea):
* b3/B3Opcode.cpp:
(JSC::B3::invertedCompare):
* b3/B3Opcode.h:
* b3/B3PatchpointSpecial.cpp:
(JSC::B3::PatchpointSpecial::forEachArg):
* b3/B3StackmapSpecial.cpp:
(JSC::B3::StackmapSpecial::forEachArgImpl):
* b3/B3StackmapSpecial.h:
* b3/B3Value.cpp:
(JSC::B3::Value::invertedCompare):
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::isValidScale):
(JSC::B3::Air::Arg::isValidAddrForm):
(JSC::B3::Air::Arg::isValidIndexForm):
(JSC::B3::Air::Arg::isValidForm):
* b3/air/AirCustom.h:
(JSC::B3::Air::PatchCustom::shouldTryAliasingDef):
* b3/air/AirFixObviousSpills.cpp:
* b3/air/AirInst.h:
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::shouldTryAliasingDef):
* b3/air/AirIteratedRegisterCoalescing.cpp:
* b3/air/AirSpecial.cpp:
(JSC::B3::Air::Special::shouldTryAliasingDef):
* b3/air/AirSpecial.h:
* bytecode/BytecodeGeneratorification.cpp:
(JSC::BytecodeGeneratorification::storageForGeneratorLocal):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::findPC):
(JSC::CodeBlock::bytecodeOffsetFromCallSiteIndex):
* bytecode/CodeBlock.h:
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::link):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::PropertyListNode::emitPutConstantProperty):
(JSC::ObjectPatternNode::bindValue):
* debugger/Debugger.cpp:
(JSC::Debugger::resolveBreakpoint):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::currentPosition):
* debugger/DebuggerParseData.cpp:
(JSC::DebuggerPausePositions::breakpointLocationForLineColumn):
* debugger/DebuggerParseData.h:
* debugger/ScriptProfilingScope.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeDoubleUnaryOpEffects):
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::findPC):
* dfg/DFGJITCode.h:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::SlowPathGenerator::generate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
(JSC::DFG::SpeculativeJIT::emitUntypedBitOp):
(JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
(JSC::DFG::SpeculativeJIT::compileMathIC):
(JSC::DFG::SpeculativeJIT::compileArithDiv):
(JSC::DFG::SpeculativeJIT::compileCallDOMGetter):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::findPC):
* ftl/FTLJITCode.h:
* heap/Heap.cpp:
(JSC::Heap::collectAsync):
(JSC::Heap::collectSync):
(JSC::Heap::collectInThread):
(JSC::Heap::requestCollection):
(JSC::Heap::willStartCollection):
(JSC::Heap::didFinishCollection):
(JSC::Heap::shouldDoFullCollection):
* heap/Heap.h:
(JSC::Heap::collectionScope):
* heap/HeapSnapshot.cpp:
(JSC::HeapSnapshot::nodeForCell):
(JSC::HeapSnapshot::nodeForObjectIdentifier):
* heap/HeapSnapshot.h:
* inspector/InspectorBackendDispatcher.cpp:
(Inspector::BackendDispatcher::dispatch):
(Inspector::BackendDispatcher::sendPendingErrors):
(Inspector::BackendDispatcher::reportProtocolError):
* inspector/InspectorBackendDispatcher.h:
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::nodeForHeapObjectIdentifier):
(Inspector::InspectorHeapAgent::getPreview):
(Inspector::InspectorHeapAgent::getRemoteObject):
* inspector/agents/InspectorHeapAgent.h:
* inspector/remote/RemoteConnectionToTarget.h:
* inspector/remote/RemoteConnectionToTarget.mm:
(Inspector::RemoteConnectionToTarget::targetIdentifier):
(Inspector::RemoteConnectionToTarget::setup):
* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::updateClientCapabilities):
* inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
(_generate_declarations_for_enum_conversion_methods):
(_generate_declarations_for_enum_conversion_methods.return_type_with_export_macro):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.generate_conversion_method_body):
* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
* jit/JITCode.h:
(JSC::JITCode::findPC):
* jit/JITDivGenerator.cpp:
(JSC::JITDivGenerator::generateFastPath):
* jit/JITOperations.cpp:
* jit/PCToCodeOriginMap.cpp:
(JSC::PCToCodeOriginMap::findPC):
* jit/PCToCodeOriginMap.h:
* jsc.cpp:
(WTF::RuntimeArray::getOwnPropertySlot):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::exportVariable):
* runtime/ConcurrentJSLock.h:
(JSC::ConcurrentJSLocker::ConcurrentJSLocker):
* runtime/DefinePropertyAttributes.h:
(JSC::DefinePropertyAttributes::writable):
(JSC::DefinePropertyAttributes::configurable):
(JSC::DefinePropertyAttributes::enumerable):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::getOwnPropertySlot):
(JSC::GenericArguments<Type>::put):
(JSC::GenericArguments<Type>::deleteProperty):
(JSC::GenericArguments<Type>::defineOwnProperty):
* runtime/HasOwnPropertyCache.h:
(JSC::HasOwnPropertyCache::get):
* runtime/HashMapImpl.h:
(JSC::concurrentJSMapHash):
* runtime/Identifier.h:
(JSC::parseIndex):
* runtime/JSArray.cpp:
(JSC::JSArray::defineOwnProperty):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::toNumberFromPrimitive):
(JSC::JSValue::putToPrimitive):
* runtime/JSCJSValue.h:
* runtime/JSGenericTypedArrayView.h:
(JSC::JSGenericTypedArrayView::toAdaptorNativeFromValueWithoutCoercion):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayViewWithArguments):
(JSC::constructGenericTypedArrayView):
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot):
(JSC::JSGenericTypedArrayView<Adaptor>::put):
* runtime/JSModuleRecord.cpp:
* runtime/JSModuleRecord.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectAccessor):
(JSC::JSObject::deleteProperty):
(JSC::JSObject::putDirectMayBeIndex):
(JSC::JSObject::defineOwnProperty):
* runtime/JSObject.h:
(JSC::JSObject::getOwnPropertySlot):
(JSC::JSObject::getPropertySlot):
(JSC::JSObject::putOwnDataPropertyMayBeIndex):
* runtime/JSObjectInlines.h:
(JSC::JSObject::putInline):
* runtime/JSString.cpp:
(JSC::JSString::getStringPropertyDescriptor):
* runtime/JSString.h:
(JSC::JSString::getStringPropertySlot):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::parse):
* runtime/MathCommon.h:
(JSC::safeReciprocalForDivByConst):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
* runtime/PropertyDescriptor.h:
(JSC::toPropertyDescriptor):
* runtime/PropertyName.h:
(JSC::parseIndex):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/StringObject.cpp:
(JSC::StringObject::put):
(JSC::isStringOwnProperty):
(JSC::StringObject::deleteProperty):
* runtime/ToNativeFromValue.h:
(JSC::toNativeFromValueWithoutCoercion):
* runtime/TypedArrayAdaptors.h:
(JSC::IntegralTypedArrayAdaptor::toNativeFromInt32WithoutCoercion):
(JSC::IntegralTypedArrayAdaptor::toNativeFromUint32WithoutCoercion):
(JSC::IntegralTypedArrayAdaptor::toNativeFromDoubleWithoutCoercion):
(JSC::FloatTypedArrayAdaptor::toNativeFromInt32WithoutCoercion):
(JSC::FloatTypedArrayAdaptor::toNativeFromDoubleWithoutCoercion):
(JSC::Uint8ClampedAdaptor::toNativeFromInt32WithoutCoercion):
(JSC::Uint8ClampedAdaptor::toNativeFromDoubleWithoutCoercion):

Source/WebCore:

Rename valueOr to value_or. This is specified in C++17 proposal.

Use Optional::emplace. C++17 Optional::operator=(Optional&&) requires
either copy assignment operator or move assignment operator. But
DFG::JSValueOperand etc. only defines move constructors and drop
implicit copy assignment operators.

It was OK in the previous WTF::Optional since it always uses move
constructors. But it is not valid in C++17 Optional. We use Optional::emplace
instead. This function has the same semantics to the previous WTF::Optional's
operator=.

No behavior change.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::parseAmount):
(WebCore::createContactFields):
(WebCore::toLineItemType):
(WebCore::createLineItem):
(WebCore::createLineItems):
(WebCore::createMerchantCapabilities):
(WebCore::createSupportedNetworks):
(WebCore::toShippingType):
(WebCore::createShippingMethod):
(WebCore::createShippingMethods):
(WebCore::createPaymentRequest):
(WebCore::toPaymentAuthorizationStatus):
* Modules/applepay/PaymentContact.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentMerchantSession.h:
* Modules/applepay/PaymentRequest.h:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::PaymentContact::fromJS):
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
(WebCore::PaymentMerchantSession::fromJS):
* Modules/encryptedmedia/MediaKeyStatusMap.cpp:
(WebCore::MediaKeyStatusMap::Iterator::next):
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::FetchBodyOwner):
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::finishBlobLoading):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next):
* Modules/fetch/FetchHeaders.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::setReferrerPolicy):
(WebCore::setMode):
(WebCore::setCredentials):
(WebCore::setCache):
(WebCore::setRedirect):
(WebCore::setMethod):
(WebCore::setReferrer):
(WebCore::buildOptions):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::FetchResponse):
(WebCore::FetchResponse::cloneForJS):
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::didReceiveResponse):
(WebCore::FetchResponse::BodyLoader::stop):
* Modules/fetch/FetchResponse.h:
* Modules/geolocation/Coordinates.cpp:
(WebCore::Coordinates::altitude):
(WebCore::Coordinates::altitudeAccuracy):
(WebCore::Coordinates::heading):
(WebCore::Coordinates::speed):
* Modules/geolocation/Coordinates.h:
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
* Modules/indexeddb/IDBFactory.h:
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::getAll):
(WebCore::IDBIndex::getAllKeys):
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBKeyPath.h:
(WebCore::isolatedCopy):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::getAll):
(WebCore::IDBObjectStore::getAllKeys):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::serializeIDBKeyPath):
(WebCore::deserializeIDBKeyPath):
* Modules/indexeddb/server/IDBSerialization.h:
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getAllRecords):
* Modules/indexeddb/server/MemoryIndex.h:
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::getAllRecords):
* Modules/indexeddb/server/MemoryObjectStore.h:
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
(WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
(WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
(WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
* Modules/indexeddb/server/MemoryObjectStoreCursor.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::createNewObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
(WebCore::IDBObjectStoreInfo::keyPath):
* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::displayNameForTrack):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/MediaSource.h:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::createOfferSucceeded):
(WebCore::PeerConnectionBackend::createOfferFailed):
(WebCore::PeerConnectionBackend::createAnswerSucceeded):
(WebCore::PeerConnectionBackend::createAnswerFailed):
(WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
(WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
(WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
(WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
(WebCore::PeerConnectionBackend::addIceCandidateFailed):
(WebCore::PeerConnectionBackend::stop):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::insertDTMF):
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCIceCandidate.cpp:
(WebCore::RTCIceCandidate::create):
(WebCore::RTCIceCandidate::RTCIceCandidate):
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::sdpMLineIndex):
* Modules/mediastream/SDPProcessor.cpp:
(WebCore::iceCandidateFromJSON):
* Modules/proximity/DeviceProximityEvent.h:
* Modules/streams/ReadableStreamSource.h:
(WebCore::ReadableStreamSource::startFinished):
(WebCore::ReadableStreamSource::pullFinished):
(WebCore::ReadableStreamSource::clean):
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::start):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webdatabase/SQLResultSet.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::close):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
* Modules/websockets/WebSocketChannel.h:
* bindings/generic/IDLTypes.h:
(WebCore::IDLType::nullValue):
* bindings/js/CachedModuleScript.h:
(WebCore::CachedModuleScript::error):
* bindings/js/Dictionary.h:
(WebCore::Dictionary::get):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSCryptoKeySerializationJWK.cpp:
(WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
* bindings/js/JSCryptoKeySerializationJWK.h:
* bindings/js/JSDOMConvert.h:
(WebCore::Detail::VariadicConverterBase::convert):
(WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
(WebCore::convertVariadicArguments):
* bindings/js/JSDOMIterator.h:
(WebCore::IteratorTraits>::next):
* bindings/js/JSDOMPromise.h:
(WebCore::DOMPromise::DOMPromise):
(WebCore::DOMPromise::operator=):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::getOwnPropertySlot):
* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::convertValue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLAllCollectionCustom.cpp:
(WebCore::callHTMLAllCollection):
(WebCore::JSHTMLAllCollection::item):
* bindings/js/JSHTMLCanvasElementCustom.cpp:
(WebCore::JSHTMLCanvasElement::toDataURL):
* bindings/js/JSImageConstructor.cpp:
(WebCore::JSImageConstructor::construct):
* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::createStringConstraint):
(WebCore::createBooleanConstraint):
(WebCore::createDoubleConstraint):
(WebCore::createIntConstraint):
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
(WebCore::importKey):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::executeScript):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateGetOwnPropertySlotBody):
(GenerateEnumerationImplementationContent):
(GenerateEnumerationHeaderContent):
(GenerateDefaultValue):
(GenerateImplementation):
(GenerateParametersCheck):
* bindings/scripts/test/JS/JSFloat64Array.cpp:
(WebCore::JSFloat64Array::getOwnPropertySlot):
(WebCore::JSFloat64Array::getOwnPropertyDescriptor):
(WebCore::JSFloat64Array::put):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::JSTestEventTarget::getOwnPropertySlot):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::parseEnumeration<TestObj::EnumType>):
(WebCore::parseEnumeration<TestObj::Optional>):
(WebCore::parseEnumeration<AlternateEnumName>):
(WebCore::parseEnumeration<TestObj::EnumA>):
(WebCore::parseEnumeration<TestObj::EnumB>):
(WebCore::parseEnumeration<TestObj::EnumC>):
(WebCore::parseEnumeration<TestObj::Kind>):
(WebCore::parseEnumeration<TestObj::Size>):
(WebCore::parseEnumeration<TestObj::Confidence>):
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::JSTestObj::getOwnPropertySlot):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanCaller):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordCaller):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Caller):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Caller):
(WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentCaller):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
(WebCore::parseEnumeration<TestStandaloneEnumeration>):
* bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::jsTestTypedefsPrototypeFunctionSetShadowCaller):
(WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampCaller):
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertySlot):
(JSC::RuntimeArray::put):
* crypto/CryptoAlgorithmRegistry.cpp:
(WebCore::CryptoAlgorithmRegistry::identifier):
* crypto/CryptoAlgorithmRegistry.h:
* crypto/CryptoKeySerialization.h:
* crypto/JsonWebKey.h:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
(WebCore::CryptoAlgorithmAES_CBC::importKey):
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
(WebCore::CryptoAlgorithmAES_KW::importKey):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
(WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeySerializationRaw.cpp:
(WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
* crypto/keys/CryptoKeySerializationRaw.h:
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
(WebCore::commonCryptoHMACAlgorithm):
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::cryptoDigestAlgorithm):
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::calculateStyleMask):
(WebCore::CSSFontFace::calculateWeightMask):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::computeFontTraitsMask):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::doubleValue):
(WebCore::CSSPrimitiveValue::doubleValueInternal):
* css/CSSPrimitiveValue.h:
* css/CSSPropertyNames.in:
* css/CSSSegmentedFontFace.cpp:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::create):
(WebCore::CSSStyleSheet::CSSStyleSheet):
(WebCore::CSSStyleSheet::addRule):
* css/CSSStyleSheet.h:
* css/FontFace.cpp:
(WebCore::FontFace::fontStateChanged):
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::completedLoading):
* css/FontFaceSet.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::doubleValue):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridPosition):
(WebCore::StyleBuilderConverter::convertWordSpacing):
(WebCore::StyleBuilderConverter::convertPerspective):
(WebCore::StyleBuilderConverter::convertMarqueeIncrement):
(WebCore::StyleBuilderConverter::convertFilterOperations):
(WebCore::StyleBuilderConverter::convertLineHeight):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueLineHeight):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
(WebCore::CSSParser::parseSpringTimingFunctionValue):
(WebCore::CSSParser::parseColorFunctionParameters):
(WebCore::CSSParser::parseColorFromValue):
* css/parser/CSSParser.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
* dom/CustomElementReactionQueue.cpp:
* dom/Document.cpp:
(WebCore::Document::lastModified):
* dom/Element.cpp:
(WebCore::Element::scrollBy):
(WebCore::Element::getIntegralAttribute):
(WebCore::Element::getUnsignedIntegralAttribute):
(WebCore::Element::resolveCustomStyle):
* dom/Element.h:
* dom/ElementIteratorAssertions.h:
(WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
(WebCore::ElementIteratorAssertions::clear):
* dom/ExceptionOr.h:
* dom/InlineStyleSheetOwner.cpp:
(WebCore::makeInlineStyleSheetCacheKey):
* dom/KeyboardEvent.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::error):
* dom/LoadableClassicScript.h:
* dom/LoadableModuleScript.cpp:
(WebCore::LoadableModuleScript::error):
* dom/LoadableModuleScript.h:
* dom/LoadableScript.h:
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::MessageEvent):
(WebCore::MessageEvent::create):
(WebCore::MessageEvent::initMessageEvent):
* dom/MessageEvent.h:
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe):
* dom/MutationObserver.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::resolveCustomStyle):
* dom/PseudoElement.h:
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setToBeforeChild):
(WebCore::RangeBoundaryPoint::setToAfterChild):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
(WebCore::RangeBoundaryPoint::invalidateOffset):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::determineScriptType):
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::executeScriptAndDispatchEvent):
* dom/ScriptElement.h:
* dom/TextDecoder.cpp:
(WebCore::TextDecoder::decode):
* dom/TextDecoder.h:
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::UserGestureIndicator):
* dom/UserGestureIndicator.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* fileapi/File.h:
* history/CachedFrame.h:
(WebCore::CachedFrame::hasInsecureContent):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::toggle):
* html/DOMTokenList.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL):
* html/HTMLCanvasElement.h:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseBorderWidthAttribute):
(WebCore::HTMLElement::parseAttribute):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::createForJSConstructor):
(WebCore::HTMLImageElement::width):
(WebCore::HTMLImageElement::height):
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::findClosestTickMarkValue):
(WebCore::HTMLInputElement::maxLengthAttributeChanged):
(WebCore::HTMLInputElement::minLengthAttributeChanged):
* html/HTMLInputElement.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::iconType):
* html/HTMLLinkElement.h:
* html/HTMLOListElement.h:
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
* html/HTMLOptionsCollection.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
(WebCore::HTMLSelectElement::setLength):
* html/HTMLSelectElement.h:
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
(WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::height):
(WebCore::ImageInputType::width):
* html/InputType.cpp:
(WebCore::InputType::findClosestTickMarkValue):
* html/InputType.h:
* html/LinkIconCollector.cpp:
* html/LinkRelAttribute.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::findClosestTickMarkValue):
* html/RangeInputType.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::restore):
(WebCore::CanvasRenderingContext2D::setStrokeColor):
(WebCore::CanvasRenderingContext2D::setFillColor):
(WebCore::CanvasRenderingContext2D::isPointInPathInternal):
(WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
(WebCore::CanvasRenderingContext2D::setShadow):
(WebCore::CanvasRenderingContext2D::fillText):
(WebCore::CanvasRenderingContext2D::strokeText):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::arrayBufferViewElementSize):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::validateArrayBufferType):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::texImage2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
(WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
* html/parser/HTMLConstructionSite.h:
* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLIntegerInternal):
(WebCore::parseHTMLInteger):
(WebCore::parseHTMLNonNegativeInteger):
(WebCore::parseValidHTMLNonNegativeIntegerInternal):
(WebCore::parseValidHTMLNonNegativeInteger):
(WebCore::parseValidHTMLFloatingPointNumberInternal):
(WebCore::parseValidHTMLFloatingPointNumber):
(WebCore::parseHTTPRefreshInternal):
* html/parser/HTMLParserIdioms.h:
(WebCore::limitToOnlyHTMLNonNegative):
* html/parser/HTMLSrcsetParser.cpp:
(WebCore::parseDescriptors):
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):
(WebCore::SliderThumbElement::resolveCustomStyle):
(WebCore::SliderContainerElement::resolveCustomStyle):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
(WebCore::TextControlInnerTextElement::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
* html/shadow/TextControlInnerElements.h:
* html/track/TrackEvent.h:
* inspector/InspectorIndexedDBAgent.cpp:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startIconLoading):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
(WebCore::DocumentThreadableLoader::clearResource):
(WebCore::DocumentThreadableLoader::preflightSuccess):
(WebCore::DocumentThreadableLoader::preflightFailure):
* loader/DocumentThreadableLoader.h:
* loader/EmptyClients.cpp:
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::open):
(WebCore::FrameLoader::dispatchDidCommitLoad):
(WebCore::FrameLoader::clearTestingOverrides):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::resourceTypeFromAsAttribute):
(WebCore::LinkLoader::loadLink):
* loader/LinkLoader.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::notifyDone):
* loader/SubresourceLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setLoadPriority):
* loader/cache/CachedResource.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::CachedResourceRequest):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::priority):
* mathml/MathMLElement.h:
(WebCore::MathMLElement::specifiedDisplayStyle):
(WebCore::MathMLElement::specifiedMathVariant):
* mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::cachedFractionAlignment):
(WebCore::MathMLFractionElement::parseAttribute):
* mathml/MathMLFractionElement.h:
* mathml/MathMLMathElement.cpp:
(WebCore::MathMLMathElement::specifiedDisplayStyle):
(WebCore::MathMLMathElement::parseAttribute):
* mathml/MathMLMathElement.h:
* mathml/MathMLMencloseElement.cpp:
(WebCore::MathMLMencloseElement::parseAttribute):
* mathml/MathMLMencloseElement.h:
* mathml/MathMLOperatorDictionary.cpp:
(WebCore::MathMLOperatorDictionary::search):
* mathml/MathMLOperatorDictionary.h:
* mathml/MathMLOperatorElement.cpp:
(WebCore::MathMLOperatorElement::computeOperatorFlag):
(WebCore::MathMLOperatorElement::childrenChanged):
(WebCore::attributeNameToPropertyFlag):
(WebCore::MathMLOperatorElement::parseAttribute):
* mathml/MathMLOperatorElement.h:
* mathml/MathMLPaddedElement.cpp:
(WebCore::MathMLPaddedElement::parseAttribute):
* mathml/MathMLPaddedElement.h:
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::cachedBooleanAttribute):
(WebCore::MathMLPresentationElement::cachedMathMLLength):
(WebCore::MathMLPresentationElement::specifiedDisplayStyle):
(WebCore::MathMLPresentationElement::specifiedMathVariant):
(WebCore::MathMLPresentationElement::parseAttribute):
* mathml/MathMLPresentationElement.h:
(WebCore::MathMLPresentationElement::toOptionalBool):
* mathml/MathMLScriptsElement.cpp:
(WebCore::MathMLScriptsElement::parseAttribute):
* mathml/MathMLScriptsElement.h:
* mathml/MathMLSpaceElement.cpp:
(WebCore::MathMLSpaceElement::parseAttribute):
* mathml/MathMLSpaceElement.h:
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::convertToSingleCodePoint):
* mathml/MathMLTokenElement.h:
* mathml/MathMLUnderOverElement.cpp:
(WebCore::MathMLUnderOverElement::parseAttribute):
* mathml/MathMLUnderOverElement.h:
* page/ChromeClient.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::alignedFireTime):
* page/DOMTimer.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::scrollBy):
* page/DOMWindow.h:
* page/EventSource.cpp:
(WebCore::EventSource::parseEventStream):
(WebCore::EventSource::parseEventStreamLine):
* page/EventSource.h:
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle):
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::setViewExposedRect):
* page/FrameView.h:
* page/Page.cpp:
(WebCore::Page::takeAnyMediaCanStartListener):
* page/Page.h:
(WebCore::Page::eventThrottlingBehaviorOverride):
(WebCore::Page::setEventThrottlingBehaviorOverride):
* page/ScrollToOptions.h:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::port):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::debugString):
(WebCore::SecurityOriginData::databaseIdentifier):
(WebCore::SecurityOriginData::fromDatabaseIdentifier):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::SecurityOriginData):
(WebCore::SecurityOriginData::isEmpty):
(WebCore::SecurityOriginDataHash::hash):
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/WindowFeatures.cpp:
(WebCore::parseDialogFeatures):
(WebCore::boolFeature):
(WebCore::floatFeature):
* page/WindowFeatures.h:
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
(WebCore::ContentSecurityPolicySource::portMatches):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse):
(WebCore::ContentSecurityPolicySourceList::parseSource):
(WebCore::ContentSecurityPolicySourceList::parsePort):
* page/csp/ContentSecurityPolicySourceList.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
* platform/DragImage.cpp:
* platform/LinkIcon.h:
* platform/MemoryPressureHandler.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
* platform/ScrollView.h:
* platform/Theme.h:
(WebCore::Theme::controlFont):
* platform/Timer.h:
(WebCore::TimerBase::alignedFireTime):
* platform/URL.cpp:
(WebCore::URL::port):
(WebCore::defaultPortForProtocol):
(WebCore::portAllowed):
* platform/URL.h:
* platform/URLParser.cpp:
(WebCore::URLParser::defaultPortForProtocol):
(WebCore::findLongestZeroSequence):
(WebCore::URLParser::parseIPv4Piece):
(WebCore::URLParser::parseIPv4Host):
(WebCore::URLParser::parseIPv4PieceInsideIPv6):
(WebCore::URLParser::parseIPv4AddressInsideIPv6):
(WebCore::URLParser::parseIPv6Host):
(WebCore::URLParser::domainToASCII):
(WebCore::URLParser::formURLDecode):
* platform/URLParser.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/Color.h:
(WebCore::colorWithOverrideAlpha):
* platform/graphics/DisplayRefreshMonitorClient.h:
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText):
(WebCore::FontCascade::drawEmphasisMarks):
(WebCore::FontCascade::adjustSelectionRectForText):
(WebCore::FontCascade::getEmphasisMarkGlyphData):
(WebCore::FontCascade::emphasisMarkAscent):
(WebCore::FontCascade::emphasisMarkDescent):
(WebCore::FontCascade::emphasisMarkHeight):
* platform/graphics/FontCascade.h:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawText):
(WebCore::GraphicsContext::drawEmphasisMarks):
(WebCore::GraphicsContext::drawBidiText):
* platform/graphics/GraphicsContext.h:
(WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setPosition):
(WebCore::GraphicsLayer::setApproximatePosition):
* platform/graphics/Image.h:
(WebCore::Image::hotSpot):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageFrameCache.cpp:
(WebCore::ImageFrameCache::clearMetadata):
(WebCore::ImageFrameCache::metadata):
(WebCore::ImageFrameCache::frameMetadataAtIndex):
(WebCore::ImageFrameCache::hotSpot):
* platform/graphics/ImageFrameCache.h:
* platform/graphics/ImageSource.h:
(WebCore::ImageSource::hotSpot):
* platform/graphics/PathUtilities.cpp:
(WebCore::rectFromPolygon):
(WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect):
* platform/graphics/TiledBacking.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::naturalSize):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::setLayoutViewportRect):
* platform/graphics/ca/TileController.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::encodeImage):
(WebCore::dataURL):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoder::hotSpot):
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::openTypeFeature):
(WebCore::advanceForColorBitmapFont):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::localBounds):
(WebCore::DisplayList::DrawLine::localBounds):
(WebCore::DisplayList::DrawLinesForText::localBounds):
(WebCore::DisplayList::DrawLineForDocumentMarker::localBounds):
(WebCore::DisplayList::DrawFocusRingPath::localBounds):
(WebCore::DisplayList::DrawFocusRingRects::localBounds):
(WebCore::DisplayList::StrokeRect::localBounds):
(WebCore::DisplayList::StrokePath::localBounds):
(WebCore::DisplayList::StrokeEllipse::localBounds):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawingItem::localBounds):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::updateItemExtent):
(WebCore::DisplayList::Recorder::ContextState::rotate):
(WebCore::DisplayList::Recorder::ContextState::concatCTM):
* platform/graphics/efl/ImageBufferEfl.cpp:
(WebCore::encodeImageJPEG):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::mapAbsolutePointToLocalPoint):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::selectionRect):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::capitalized):
(WebCore::shouldSynthesize):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::replicaTransform):
(WebCore::TextureMapperLayer::mapScrollOffset):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
* platform/graphics/transforms/AffineTransform.cpp:
(WebCore::AffineTransform::inverse):
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mappedPoint):
(WebCore::TransformState::mappedSecondaryQuad):
(WebCore::TransformState::mapQuad):
(WebCore::TransformState::flattenWithTransform):
* platform/graphics/transforms/TransformState.h:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::inverse):
* platform/graphics/transforms/TransformationMatrix.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoder::hotSpot):
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::supportsXDamage):
* platform/graphics/x11/PlatformDisplayX11.h:
* platform/image-decoders/ImageDecoder.h:
(WebCore::ImageDecoder::hotSpot):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::hotSpot):
(WebCore::ICOImageDecoder::hotSpotAtIndex):
* platform/image-decoders/ico/ICOImageDecoder.h:
* platform/image-encoders/JPEGImageEncoder.cpp:
(WebCore::compressRGBABigEndianToJPEG):
* platform/image-encoders/JPEGImageEncoder.h:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::setOverrideVisibleRect):
* platform/ios/LegacyTileLayer.mm:
(-[LegacyTileHostLayer renderInContext:]):
* platform/linux/MemoryPressureHandlerLinux.cpp:
* platform/mac/ThemeMac.h:
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::controlFont):
* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaTrackConstraintSetMap::set):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaTrackConstraintSetMap::width):
(WebCore::MediaTrackConstraintSetMap::height):
(WebCore::MediaTrackConstraintSetMap::sampleRate):
(WebCore::MediaTrackConstraintSetMap::sampleSize):
(WebCore::MediaTrackConstraintSetMap::aspectRatio):
(WebCore::MediaTrackConstraintSetMap::frameRate):
(WebCore::MediaTrackConstraintSetMap::volume):
(WebCore::MediaTrackConstraintSetMap::echoCancellation):
(WebCore::MediaTrackConstraintSetMap::facingMode):
(WebCore::MediaTrackConstraintSetMap::deviceId):
(WebCore::MediaTrackConstraintSetMap::groupId):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
(WebCore::RealtimeMediaSource::applySizeAndFrameRate):
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h:
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/CacheValidation.h:
* platform/network/DataURLDecoder.h:
* platform/network/HTTPHeaderMap.h:
(WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPDate):
* platform/network/HTTPParsers.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlMaxAge):
(WebCore::parseDateValueInHeader):
(WebCore::ResourceResponseBase::date):
(WebCore::ResourceResponseBase::age):
(WebCore::ResourceResponseBase::expires):
(WebCore::ResourceResponseBase::lastModified):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::certificateInfo):
* platform/network/SocketStreamHandle.h:
* platform/network/SocketStreamHandleClient.h:
* platform/network/cf/SocketStreamHandleImpl.h:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::readStreamCallback):
(WebCore::SocketStreamHandleImpl::platformSend):
* platform/network/curl/SocketStreamHandleImpl.h:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
(WebCore::SocketStreamHandleImpl::platformSend):
* platform/network/mac/CookieJarMac.mm:
(WebCore::cookiesInPartitionForURL):
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::readBytes):
(WebCore::SocketStreamHandleImpl::platformSend):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionNonLoosely):
(WebCore::nextBreakablePositionLoosely):
(WebCore::isBreakable):
* rendering/HitTestingTransformState.cpp:
(WebCore::HitTestingTransformState::flattenWithTransform):
* rendering/ImageQualityController.cpp:
(WebCore::ImageQualityController::interpolationQualityFromStyle):
(WebCore::ImageQualityController::chooseInterpolationQuality):
* rendering/ImageQualityController.h:
* rendering/InlineIterator.h:
(WebCore::InlineIterator::moveTo):
(WebCore::InlineIterator::nextBreakablePosition):
(WebCore::InlineIterator::setNextBreakablePosition):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::substringToRender):
(WebCore::InlineTextBox::hyphenatedStringForTextRun):
(WebCore::InlineTextBox::constructTextRun):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::substringToRender):
(WebCore::InlineTextBox::hyphenatedStringForTextRun):
(WebCore::InlineTextBox::constructTextRun):
* rendering/OrderIterator.cpp:
(WebCore::OrderIterator::reset):
* rendering/OrderIterator.h:
* rendering/PaintInfo.h:
(WebCore::PaintInfo::applyTransform):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlockRareData::RenderBlockRareData):
(WebCore::RenderBlock::baselinePosition):
(WebCore::RenderBlock::firstLineBaseline):
(WebCore::RenderBlock::inlineBlockBaseline):
(WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline):
(WebCore::RenderBlockFlow::inlineBlockBaseline):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalHeightByMinMax):
(WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
(WebCore::RenderBox::overrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::overrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
(WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
(WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeLogicalHeightUsing):
(WebCore::RenderBox::computeContentLogicalHeight):
(WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeight):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(WebCore::RenderBox::firstLineBaseline):
(WebCore::RenderBox::inlineBlockBaseline):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::computeTextOrigin):
* rendering/RenderCombineText.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::baselinePosition):
(WebCore::RenderFlexibleBox::firstLineBaseline):
(WebCore::RenderFlexibleBox::inlineBlockBaseline):
(WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
(WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
(WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
* rendering/RenderFlexibleBox.h:
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::addForcedRegionBreak):
* rendering/RenderGrid.cpp:
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrack::setGrowthLimitCap):
(WebCore::GridTrack::growthLimitCap):
(WebCore::RenderGrid::GridSizingData::freeSpace):
(WebCore::RenderGrid::GridSizingData::availableSpace):
(WebCore::RenderGrid::GridSizingData::setAvailableSpace):
(WebCore::RenderGrid::GridSizingData::setFreeSpace):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths):
(WebCore::RenderGrid::computeIntrinsicLogicalHeight):
(WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
(WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
(WebCore::overrideContainingBlockContentSizeForChild):
(WebCore::setOverrideContainingBlockContentSizeForChild):
(WebCore::RenderGrid::logicalHeightForChild):
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::minContentForChild):
(WebCore::RenderGrid::maxContentForChild):
(WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
(WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
(WebCore::RenderGrid::layoutGridItems):
* rendering/RenderGrid.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::hitTestLayer):
* rendering/RenderLayerBacking.cpp:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItem):
(WebCore::RenderListBox::listIndexIsVisible):
(WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
(WebCore::RenderTable::baselinePosition):
(WebCore::RenderTable::inlineBlockBaseline):
(WebCore::RenderTable::firstLineBaseline):
* rendering/RenderTable.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellBaselinePosition):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::firstLineBaseline):
* rendering/RenderTableSection.h:
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::stringView):
* rendering/RenderText.h:
* rendering/RenderTextControl.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::setSelection):
(WebCore::RenderView::splitSelectionBetweenSubtrees):
(WebCore::RenderView::getSelection):
(WebCore::RenderView::clearSelection):
* rendering/RenderView.h:
* rendering/SelectionSubtreeRoot.h:
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
(WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::lastFragment):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::createTextRuns):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/line/BreakingContext.h:
(WebCore::WordTrailingSpace::width):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
(WebCore::BreakingContext::InlineIteratorHistory::moveTo):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
* rendering/mathml/MathMLStyle.cpp:
(WebCore::MathMLStyle::resolveMathMLStyle):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::baselinePosition):
(WebCore::RenderMathMLTable::firstLineBaseline):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::ascentForChild):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::firstLineBaseline):
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::firstLineBaseline):
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.cpp:
(WebCore::RenderMathMLPadded::firstLineBaseline):
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::firstLineBaseline):
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
(WebCore::RenderMathMLScripts::firstLineBaseline):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.cpp:
(WebCore::RenderMathMLSpace::firstLineBaseline):
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
(WebCore::RenderMathMLToken::updateMathVariantGlyph):
(WebCore::RenderMathMLToken::firstLineBaseline):
* rendering/mathml/RenderMathMLToken.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::setupNonScalingStrokeContext):
(WebCore::RenderSVGShape::nodeAtFloatPoint):
(WebCore::RenderSVGShape::calculateStrokeBoundingBox):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::clipToImageBuffer):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::Parent::Parent):
* style/RenderTreeUpdater.h:
* style/StyleScope.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::parseAttribute):
(WebCore::SVGElement::resolveCustomStyle):
* svg/SVGElement.h:
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
(WebCore::SVGToOTFFontConverter::processGlyphElement):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
(WebCore::convertSVGToOTFFont):
* svg/SVGToOTFFontConversion.h:
* testing/Internals.cpp:
(WebCore::Internals::setEventThrottlingBehaviorOverride):
(WebCore::Internals::eventThrottlingBehaviorOverride):
* testing/Internals.h:
* workers/Worker.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::prepareToSend):
(WebCore::XMLHttpRequest::didFinishLoading):
* xml/XMLHttpRequest.h:

Source/WebKit/mac:

Use WTF::Optional::value_or.

* DOM/DOMHTMLOptionsCollection.mm:
(-[DOMHTMLOptionsCollection add:index:]):
* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::evaluate):
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView sendEvent:isDrawRect:]):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidCommitLoad):
* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::completeShippingMethodSelection):
(WebPaymentCoordinatorClient::completeShippingContactSelection):
(WebPaymentCoordinatorClient::completePaymentMethodSelection):
* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin port]):
* WebView/WebHTMLView.mm:
(toAction):
(toTag):

Source/WebKit/win:

Use WTF::Optional::value_or.

* Plugins/PluginView.cpp:
(WebCore::PluginView::performRequest):
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidCommitLoad):
* WebCoreSupport/WebFrameLoaderClient.h:
* WebSecurityOrigin.cpp:
(WebSecurityOrigin::port):

Source/WebKit2:

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::responseHasExpired):
* NetworkProcess/cache/NetworkCacheCoders.h:
(WebKit::NetworkCache::Coder<std::optional<T>>::encode):
(WebKit::NetworkCache::Coder<std::optional<T>>::decode):
(WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
(WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::readOrMakeSalt):
* NetworkProcess/cache/NetworkCacheData.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::Statistics::queryWasEverRequested):
* NetworkProcess/cache/NetworkCacheStatistics.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::storeBodyAsBlob):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::dispatchWriteOperation):
* NetworkProcess/cache/NetworkCacheStorage.h:
* Platform/IPC/ArgumentCoders.h:
(IPC::ArgumentCoder<std::optional<T>>::encode):
(IPC::ArgumentCoder<std::optional<T>>::decode):
(IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
(IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
* Platform/IPC/Connection.h:
(IPC::Connection::sendWithReply):
* Platform/SharedMemory.h:
* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::map):
* Scripts/webkit/messages.py:
(class_template_headers):
* Shared/API/APISecurityOrigin.h:
(API::SecurityOrigin::create):
* Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetPort):
* Shared/SessionState.h:
* Shared/WebPageCreationParameters.h:
* Shared/mac/ObjCObjectGraph.mm:
(WebKit::typeFromObject):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin port]):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _navigationGestureDidEnd]):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
(WebKit::toWebsiteDataType):
* UIProcess/API/efl/EwkView.cpp:
(EwkView::setCursor):
* UIProcess/API/mac/WKView.mm:
(toCoreScrollbarStyle):
(toAPIScrollbarStyle):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toPKPaymentSummaryItem):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::webFrameIDForHandle):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::computeElementLayout):
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::updateViewExposedRect):
(WebKit::WebViewImpl::setOverlayScrollbarStyle):
(WebKit::WebViewImpl::overlayScrollbarStyle):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::setViewExposedRect):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::viewExposedRect):
* UIProcess/InspectorServer/WebSocketServerConnection.cpp:
(WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
* UIProcess/InspectorServer/WebSocketServerConnection.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/Scrolling/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
* UIProcess/Scrolling/RemoteScrollingTree.h:
* UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
(WebKit::fileCreationTime):
(WebKit::fileModificationTime):
* UIProcess/Storage/LocalStorageDatabaseTracker.h:
* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::backForwardListState):
(WebKit::WebBackForwardList::restoreFromState):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setOverlayScrollbarStyle):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::overlayScrollbarStyle):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebsiteData/WebsiteDataRecord.h:
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::transformFromScene):
* UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _scrollOffsetForEvent:]):
(-[WKContentView _interpretKeyEvent:isCharEvent:]):
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFormDataElement):
(WebKit::decodeFormDataElement):
(WebKit::decodeV1SessionHistory):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetEventThrottlingBehaviorOverride):
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::convertFromPDFViewToRootView):
(WebKit::PDFPlugin::convertFromPDFViewToScreen):
(WebKit::PDFPlugin::boundsOnScreen):
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::performFrameLoadURLRequest):
(WebKit::PluginView::evaluate):
* WebProcess/Plugins/WebPluginInfoProvider.cpp:
(WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
* WebProcess/Plugins/WebPluginInfoProvider.h:
* WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::certificateInfo):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_userInterfaceLayoutDirection):
(WebKit::WebPage::setScrollbarOverlayStyle):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::scrollbarOverlayStyle):
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):

Source/WTF:

Import std::optional reference implementation offered by the C++17
original proposal paper. It has the same interface and functionality
to the C++17's one. Previous WTF::Optional lacks several functionalities.
The largest one is the correct constexpr constructors. This fact prevents
us from using Optional<literal type> in constexpr context in WebKit.

In WebKit, we do not allow global constructors. So only the constexpr
constructor is the way to use WTF::Optional in the static const
global variables. WTF::Optional is used in DOMJIT::Effect and
we would like to emit static const global variables that includes
this DOMJIT::Effect. That is the main motivation of this work.
This functionality allows the IDL code generator to emit DOMJIT
signatures as static const global variables.

We import the reference implementation one instead of LLVM libc++'s one.
This is because LLVM libc++'s one depends on many macro and type_traits
offered by libc++ implementation. And adopting it to WebKit requires
large modification compared to this reference implementation one.
Furthermore, it is difficult to compile libc++'s optional in old GCC and VC++.
It also requires some more modifications. To keep the thing simple,
we import the reference implementation one now. Once C++17 is released
and we update the compiler baseline, we can smoothly switch to the standard
library's std::optional.

We also add support for the environment that does not use exceptions to this
reference implementation.

And we also add valueOrCompute helper function. That keeps the extended
functionality that previous WTF::Optional has.

* wtf/CrossThreadQueue.h:
(WTF::CrossThreadQueue<DataType>::tryGetMessage):
* wtf/Expected.h:
(WTF::makeExpected):
* wtf/Forward.h:
* wtf/HashTraits.h:
(WTF::HashTraits<Ref<P>>::take):
* wtf/MainThread.cpp:
(WTF::initializeGCThreads):
(WTF::mayBeGCThread):
* wtf/MainThread.h:
* wtf/Optional.h:
(std::detail_::is_assignable::has_assign):
(std::detail_::has_overloaded_addressof::has_overload):
(std::detail_::static_addressof):
(std::detail_::convert):
(std::nullopt_t::nullopt_t):
(std::bad_optional_access::bad_optional_access):
(std::optional_base::optional_base):
(std::optional_base::~optional_base):
(std::constexpr_optional_base::constexpr_optional_base):
(std::optional::dataptr):
(std::optional::contained_val):
(std::optional::__NOEXCEPT_):
(std::optional::optional):
(std::optional::operator=):
(std::optional::emplace):
(std::optional::operator ->):
(std::optional::operator *):
(std::optional::value):
(std::optional::value_or):
(std::operator==):
(std::operator!=):
(std::operator<):
(std::operator>):
(std::operator<=):
(std::operator>=):
(std::__NOEXCEPT_):
(std::make_optional):
(std::hash<std::optional<T>>::operator()):
(WTF::NulloptTag::NulloptTag): Deleted.
(WTF::Optional::Optional): Deleted.
(WTF::Optional::~Optional): Deleted.
(WTF::Optional::operator=): Deleted.
(WTF::Optional::operator bool): Deleted.
(WTF::Optional::operator->): Deleted.
(WTF::Optional::operator*): Deleted.
(WTF::Optional::value): Deleted.
(WTF::Optional::valueOr): Deleted.
(WTF::Optional::valueOrCompute): Deleted.
(WTF::Optional::asPtr): Deleted.
(WTF::Optional::destroy): Deleted.
(WTF::operator==): Deleted.
(WTF::operator!=): Deleted.
(WTF::makeOptional): Deleted.
(WTF::printInternal): Deleted.
* wtf/text/StringView.cpp:
(WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
(WTF::StringView::GraphemeClusters::Iterator::Iterator):
* wtf/text/StringView.h:

Tools:

Use WTF::Optional::value_or.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* TestRunnerShared/Bindings/JSWrappable.h:
(WTR::JSValueMakeBooleanOrNull):
(WTR::JSValueToNullableBoolean):
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* TestWebKitAPI/Tests/WTF/Optional.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebCore/HTMLParserIdioms.cpp:
(TestWebKitAPI::testParseHTMLInteger):
(TestWebKitAPI::testParseHTMLNonNegativeInteger):
* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::checkRelativeURL):
(TestWebKitAPI::checkURLDifferences):
(TestWebKitAPI::checkRelativeURLDifferences):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::stableStateOverride):
(WTR::UIScriptController::setStableStateOverride):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@208985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 92bb5b9..ad24699 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,247 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        Previous WTF::Optional::operator= is not compatible to std::optional::operator=.
+        std::optional::emplace has the same semantics to the previous one.
+        So we change the code to use it.
+
+        * Scripts/builtins/builtins_templates.py:
+        * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result:
+        * Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result:
+        * Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result:
+        * Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result:
+        * assembler/MacroAssemblerARM64.h:
+        (JSC::MacroAssemblerARM64::commuteCompareToZeroIntoTest):
+        * assembler/MacroAssemblerX86Common.h:
+        (JSC::MacroAssemblerX86Common::commuteCompareToZeroIntoTest):
+        * b3/B3CheckSpecial.cpp:
+        (JSC::B3::CheckSpecial::forEachArg):
+        (JSC::B3::CheckSpecial::shouldTryAliasingDef):
+        * b3/B3CheckSpecial.h:
+        * b3/B3LowerToAir.cpp:
+        (JSC::B3::Air::LowerToAir::scaleForShl):
+        (JSC::B3::Air::LowerToAir::effectiveAddr):
+        (JSC::B3::Air::LowerToAir::tryAppendLea):
+        * b3/B3Opcode.cpp:
+        (JSC::B3::invertedCompare):
+        * b3/B3Opcode.h:
+        * b3/B3PatchpointSpecial.cpp:
+        (JSC::B3::PatchpointSpecial::forEachArg):
+        * b3/B3StackmapSpecial.cpp:
+        (JSC::B3::StackmapSpecial::forEachArgImpl):
+        * b3/B3StackmapSpecial.h:
+        * b3/B3Value.cpp:
+        (JSC::B3::Value::invertedCompare):
+        * b3/air/AirArg.h:
+        (JSC::B3::Air::Arg::isValidScale):
+        (JSC::B3::Air::Arg::isValidAddrForm):
+        (JSC::B3::Air::Arg::isValidIndexForm):
+        (JSC::B3::Air::Arg::isValidForm):
+        * b3/air/AirCustom.h:
+        (JSC::B3::Air::PatchCustom::shouldTryAliasingDef):
+        * b3/air/AirFixObviousSpills.cpp:
+        * b3/air/AirInst.h:
+        * b3/air/AirInstInlines.h:
+        (JSC::B3::Air::Inst::shouldTryAliasingDef):
+        * b3/air/AirIteratedRegisterCoalescing.cpp:
+        * b3/air/AirSpecial.cpp:
+        (JSC::B3::Air::Special::shouldTryAliasingDef):
+        * b3/air/AirSpecial.h:
+        * bytecode/BytecodeGeneratorification.cpp:
+        (JSC::BytecodeGeneratorification::storageForGeneratorLocal):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::findPC):
+        (JSC::CodeBlock::bytecodeOffsetFromCallSiteIndex):
+        * bytecode/CodeBlock.h:
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::UnlinkedFunctionExecutable::link):
+        * bytecode/UnlinkedFunctionExecutable.h:
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::PropertyListNode::emitPutConstantProperty):
+        (JSC::ObjectPatternNode::bindValue):
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::resolveBreakpoint):
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::currentPosition):
+        * debugger/DebuggerParseData.cpp:
+        (JSC::DebuggerPausePositions::breakpointLocationForLineColumn):
+        * debugger/DebuggerParseData.h:
+        * debugger/ScriptProfilingScope.h:
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
+        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeDoubleUnaryOpEffects):
+        * dfg/DFGJITCode.cpp:
+        (JSC::DFG::JITCode::findPC):
+        * dfg/DFGJITCode.h:
+        * dfg/DFGOperations.cpp:
+        (JSC::DFG::operationPutByValInternal):
+        * dfg/DFGSlowPathGenerator.h:
+        (JSC::DFG::SlowPathGenerator::generate):
+        * dfg/DFGSpeculativeJIT.cpp:
+        (JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
+        (JSC::DFG::SpeculativeJIT::emitUntypedBitOp):
+        (JSC::DFG::SpeculativeJIT::emitUntypedRightShiftBitOp):
+        (JSC::DFG::SpeculativeJIT::compileMathIC):
+        (JSC::DFG::SpeculativeJIT::compileArithDiv):
+        (JSC::DFG::SpeculativeJIT::compileCallDOMGetter):
+        * dfg/DFGSpeculativeJIT.h:
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compileLogicalNot):
+        (JSC::DFG::SpeculativeJIT::emitBranch):
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGStrengthReductionPhase.cpp:
+        (JSC::DFG::StrengthReductionPhase::handleNode):
+        * ftl/FTLJITCode.cpp:
+        (JSC::FTL::JITCode::findPC):
+        * ftl/FTLJITCode.h:
+        * heap/Heap.cpp:
+        (JSC::Heap::collectAsync):
+        (JSC::Heap::collectSync):
+        (JSC::Heap::collectInThread):
+        (JSC::Heap::requestCollection):
+        (JSC::Heap::willStartCollection):
+        (JSC::Heap::didFinishCollection):
+        (JSC::Heap::shouldDoFullCollection):
+        * heap/Heap.h:
+        (JSC::Heap::collectionScope):
+        * heap/HeapSnapshot.cpp:
+        (JSC::HeapSnapshot::nodeForCell):
+        (JSC::HeapSnapshot::nodeForObjectIdentifier):
+        * heap/HeapSnapshot.h:
+        * inspector/InspectorBackendDispatcher.cpp:
+        (Inspector::BackendDispatcher::dispatch):
+        (Inspector::BackendDispatcher::sendPendingErrors):
+        (Inspector::BackendDispatcher::reportProtocolError):
+        * inspector/InspectorBackendDispatcher.h:
+        * inspector/agents/InspectorHeapAgent.cpp:
+        (Inspector::InspectorHeapAgent::nodeForHeapObjectIdentifier):
+        (Inspector::InspectorHeapAgent::getPreview):
+        (Inspector::InspectorHeapAgent::getRemoteObject):
+        * inspector/agents/InspectorHeapAgent.h:
+        * inspector/remote/RemoteConnectionToTarget.h:
+        * inspector/remote/RemoteConnectionToTarget.mm:
+        (Inspector::RemoteConnectionToTarget::targetIdentifier):
+        (Inspector::RemoteConnectionToTarget::setup):
+        * inspector/remote/RemoteInspector.h:
+        * inspector/remote/RemoteInspector.mm:
+        (Inspector::RemoteInspector::updateClientCapabilities):
+        * inspector/scripts/codegen/generate_cpp_protocol_types_header.py:
+        (_generate_declarations_for_enum_conversion_methods):
+        (_generate_declarations_for_enum_conversion_methods.return_type_with_export_macro):
+        * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
+        (CppProtocolTypesImplementationGenerator._generate_enum_conversion_methods_for_domain.generate_conversion_method_body):
+        * inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
+        * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
+        * inspector/scripts/tests/expected/enum-values.json-result:
+        * inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
+        * inspector/scripts/tests/expected/type-declaration-array-type.json-result:
+        * inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
+        * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
+        * jit/JITCode.h:
+        (JSC::JITCode::findPC):
+        * jit/JITDivGenerator.cpp:
+        (JSC::JITDivGenerator::generateFastPath):
+        * jit/JITOperations.cpp:
+        * jit/PCToCodeOriginMap.cpp:
+        (JSC::PCToCodeOriginMap::findPC):
+        * jit/PCToCodeOriginMap.h:
+        * jsc.cpp:
+        (WTF::RuntimeArray::getOwnPropertySlot):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * parser/ModuleAnalyzer.cpp:
+        (JSC::ModuleAnalyzer::exportVariable):
+        * runtime/ConcurrentJSLock.h:
+        (JSC::ConcurrentJSLocker::ConcurrentJSLocker):
+        * runtime/DefinePropertyAttributes.h:
+        (JSC::DefinePropertyAttributes::writable):
+        (JSC::DefinePropertyAttributes::configurable):
+        (JSC::DefinePropertyAttributes::enumerable):
+        * runtime/GenericArgumentsInlines.h:
+        (JSC::GenericArguments<Type>::getOwnPropertySlot):
+        (JSC::GenericArguments<Type>::put):
+        (JSC::GenericArguments<Type>::deleteProperty):
+        (JSC::GenericArguments<Type>::defineOwnProperty):
+        * runtime/HasOwnPropertyCache.h:
+        (JSC::HasOwnPropertyCache::get):
+        * runtime/HashMapImpl.h:
+        (JSC::concurrentJSMapHash):
+        * runtime/Identifier.h:
+        (JSC::parseIndex):
+        * runtime/JSArray.cpp:
+        (JSC::JSArray::defineOwnProperty):
+        * runtime/JSCJSValue.cpp:
+        (JSC::JSValue::toNumberFromPrimitive):
+        (JSC::JSValue::putToPrimitive):
+        * runtime/JSCJSValue.h:
+        * runtime/JSGenericTypedArrayView.h:
+        (JSC::JSGenericTypedArrayView::toAdaptorNativeFromValueWithoutCoercion):
+        * runtime/JSGenericTypedArrayViewConstructorInlines.h:
+        (JSC::constructGenericTypedArrayViewWithArguments):
+        (JSC::constructGenericTypedArrayView):
+        * runtime/JSGenericTypedArrayViewInlines.h:
+        (JSC::JSGenericTypedArrayView<Adaptor>::getOwnPropertySlot):
+        (JSC::JSGenericTypedArrayView<Adaptor>::put):
+        * runtime/JSModuleRecord.cpp:
+        * runtime/JSModuleRecord.h:
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::putDirectAccessor):
+        (JSC::JSObject::deleteProperty):
+        (JSC::JSObject::putDirectMayBeIndex):
+        (JSC::JSObject::defineOwnProperty):
+        * runtime/JSObject.h:
+        (JSC::JSObject::getOwnPropertySlot):
+        (JSC::JSObject::getPropertySlot):
+        (JSC::JSObject::putOwnDataPropertyMayBeIndex):
+        * runtime/JSObjectInlines.h:
+        (JSC::JSObject::putInline):
+        * runtime/JSString.cpp:
+        (JSC::JSString::getStringPropertyDescriptor):
+        * runtime/JSString.h:
+        (JSC::JSString::getStringPropertySlot):
+        * runtime/LiteralParser.cpp:
+        (JSC::LiteralParser<CharType>::parse):
+        * runtime/MathCommon.h:
+        (JSC::safeReciprocalForDivByConst):
+        * runtime/ObjectPrototype.cpp:
+        (JSC::objectProtoFuncHasOwnProperty):
+        * runtime/PropertyDescriptor.h:
+        (JSC::toPropertyDescriptor):
+        * runtime/PropertyName.h:
+        (JSC::parseIndex):
+        * runtime/SamplingProfiler.cpp:
+        (JSC::SamplingProfiler::processUnverifiedStackTraces):
+        * runtime/StringObject.cpp:
+        (JSC::StringObject::put):
+        (JSC::isStringOwnProperty):
+        (JSC::StringObject::deleteProperty):
+        * runtime/ToNativeFromValue.h:
+        (JSC::toNativeFromValueWithoutCoercion):
+        * runtime/TypedArrayAdaptors.h:
+        (JSC::IntegralTypedArrayAdaptor::toNativeFromInt32WithoutCoercion):
+        (JSC::IntegralTypedArrayAdaptor::toNativeFromUint32WithoutCoercion):
+        (JSC::IntegralTypedArrayAdaptor::toNativeFromDoubleWithoutCoercion):
+        (JSC::FloatTypedArrayAdaptor::toNativeFromInt32WithoutCoercion):
+        (JSC::FloatTypedArrayAdaptor::toNativeFromDoubleWithoutCoercion):
+        (JSC::Uint8ClampedAdaptor::toNativeFromInt32WithoutCoercion):
+        (JSC::Uint8ClampedAdaptor::toNativeFromDoubleWithoutCoercion):
+
 2016-11-26  Sam Weinig  <sam@webkit.org>
 
         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
diff --git a/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py b/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py
index 8728ad7..5e3ee82 100644
--- a/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py
+++ b/Source/JavaScriptCore/Scripts/builtins/builtins_templates.py
@@ -85,7 +85,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 {\\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
@@ -96,7 +96,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \\
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 {\\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
@@ -108,7 +108,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 {\\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\
-    return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \\
+    return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \\
 }
 ${macroPrefix}_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
@@ -120,7 +120,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \\
 {\\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \\
-    return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \\
+    return clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Executable()->link(vm, clientData->builtinFunctions().${objectNameLC}Builtins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \\
 }
 ${macroPrefix}_FOREACH_${objectMacro}_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result
index faf4499..9bb21d6 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Combined.js-result
@@ -152,7 +152,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result
index 611aeef..87fdaee 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.Promise-Separate.js-result
@@ -151,7 +151,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN.PROMISE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result
index 687688a..6bf696f 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Combined.js-result
@@ -176,7 +176,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result
index 9dadc56..d0c8f26 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-Builtin.prototype-Separate.js-result
@@ -175,7 +175,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN.PROTOTYPE_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result
index 67bed64..023a829 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Combined.js-result
@@ -189,7 +189,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result
index 0962013..8000b69 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-BuiltinConstructor-Separate.js-result
@@ -188,7 +188,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTINCONSTRUCTOR_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result
index bf8a46c..8cbb539 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/JavaScriptCore-InternalClashingNames-Combined.js-result
@@ -139,7 +139,7 @@
 #define DEFINE_BUILTIN_GENERATOR(codeName, functionName, argumentCount) \
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
-    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), Nullopt, s_##codeName##Intrinsic); }
+    return vm.builtinExecutables()->codeName##Executable()->link(vm, vm.builtinExecutables()->codeName##Source(), std::nullopt, s_##codeName##Intrinsic); }
 JSC_FOREACH_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
 
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result
index 8f84511..ad530b2 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-AnotherGuardedInternalBuiltin-Separate.js-result
@@ -214,7 +214,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().anotherGuardedInternalBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_ANOTHERGUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result
index 29ce218..f91b6d9 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-ArbitraryConditionalGuard-Separate.js-result
@@ -184,7 +184,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().arbitraryConditionalGuardBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_ARBITRARYCONDITIONALGUARD_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result
index 7c20028..e971755 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedBuiltin-Separate.js-result
@@ -184,7 +184,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_GUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result
index 22e7a74..039ccc1 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-GuardedInternalBuiltin-Separate.js-result
@@ -216,7 +216,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().guardedInternalBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_GUARDEDINTERNALBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result
index ac10a11..f1dcace 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-UnguardedBuiltin-Separate.js-result
@@ -178,7 +178,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().unguardedBuiltinBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_UNGUARDEDBUILTIN_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result
index d5be62f..d21626d 100644
--- a/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result
+++ b/Source/JavaScriptCore/Scripts/tests/builtins/expected/WebCore-xmlCasingTest-Separate.js-result
@@ -267,7 +267,7 @@
 JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
 {\
     JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
-    return clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Source(), Nullopt, s_##codeName##Intrinsic); \
+    return clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Executable()->link(vm, clientData->builtinFunctions().xmlCasingTestBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
 }
 WEBCORE_FOREACH_XMLCASINGTEST_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
 #undef DEFINE_BUILTIN_GENERATOR
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
index 6546107..e38057b 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerARM64.h
@@ -3292,7 +3292,7 @@
         return static_cast<RelationalCondition>(ARM64Assembler::invert(static_cast<ARM64Assembler::Condition>(cond)));
     }
 
-    static Optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond)
+    static std::optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond)
     {
         switch (cond) {
         case Equal:
@@ -3305,7 +3305,7 @@
             return PositiveOrZero;
             break;
         default:
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
diff --git a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
index caf792a..daa23c3 100644
--- a/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
+++ b/Source/JavaScriptCore/assembler/MacroAssemblerX86Common.h
@@ -2656,7 +2656,7 @@
         }
     }
 
-    static Optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond)
+    static std::optional<ResultCondition> commuteCompareToZeroIntoTest(RelationalCondition cond)
     {
         switch (cond) {
         case Equal:
@@ -2669,7 +2669,7 @@
             return PositiveOrZero;
             break;
         default:
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
diff --git a/Source/JavaScriptCore/b3/B3CheckSpecial.cpp b/Source/JavaScriptCore/b3/B3CheckSpecial.cpp
index 8661bbd..6f7826c 100644
--- a/Source/JavaScriptCore/b3/B3CheckSpecial.cpp
+++ b/Source/JavaScriptCore/b3/B3CheckSpecial.cpp
@@ -115,7 +115,7 @@
             callback(inst.args[1 + index], role, type, width);
         });
 
-    Optional<unsigned> firstRecoverableIndex;
+    std::optional<unsigned> firstRecoverableIndex;
     if (m_checkKind.opcode == BranchAdd32 || m_checkKind.opcode == BranchAdd64)
         firstRecoverableIndex = 1;
     forEachArgImpl(numB3Args(inst), m_numCheckArgs + 1, inst, m_stackmapRole, firstRecoverableIndex, callback);
@@ -135,11 +135,11 @@
     return admitsStackImpl(numB3Args(inst), m_numCheckArgs + 1, inst, argIndex);
 }
 
-Optional<unsigned> CheckSpecial::shouldTryAliasingDef(Inst& inst)
+std::optional<unsigned> CheckSpecial::shouldTryAliasingDef(Inst& inst)
 {
-    if (Optional<unsigned> branchDef = hiddenBranch(inst).shouldTryAliasingDef())
+    if (std::optional<unsigned> branchDef = hiddenBranch(inst).shouldTryAliasingDef())
         return *branchDef + 1;
-    return Nullopt;
+    return std::nullopt;
 }
 
 CCallHelpers::Jump CheckSpecial::generate(Inst& inst, CCallHelpers& jit, GenerationContext& context)
diff --git a/Source/JavaScriptCore/b3/B3CheckSpecial.h b/Source/JavaScriptCore/b3/B3CheckSpecial.h
index aec1897..aa7f2fe 100644
--- a/Source/JavaScriptCore/b3/B3CheckSpecial.h
+++ b/Source/JavaScriptCore/b3/B3CheckSpecial.h
@@ -123,7 +123,7 @@
     void forEachArg(Air::Inst&, const ScopedLambda<Air::Inst::EachArgCallback>&) override;
     bool isValid(Air::Inst&) override;
     bool admitsStack(Air::Inst&, unsigned argIndex) override;
-    Optional<unsigned> shouldTryAliasingDef(Air::Inst&) override;
+    std::optional<unsigned> shouldTryAliasingDef(Air::Inst&) override;
 
     // NOTE: the generate method will generate the hidden branch and then register a LatePath that
     // generates the stackmap. Super crazy dude!
diff --git a/Source/JavaScriptCore/b3/B3LowerToAir.cpp b/Source/JavaScriptCore/b3/B3LowerToAir.cpp
index 9759226..490bae4 100644
--- a/Source/JavaScriptCore/b3/B3LowerToAir.cpp
+++ b/Source/JavaScriptCore/b3/B3LowerToAir.cpp
@@ -427,12 +427,12 @@
         return true;
     }
     
-    Optional<unsigned> scaleForShl(Value* shl, int32_t offset, Optional<Arg::Width> width = Nullopt)
+    std::optional<unsigned> scaleForShl(Value* shl, int32_t offset, std::optional<Arg::Width> width = std::nullopt)
     {
         if (shl->opcode() != Shl)
-            return Nullopt;
+            return std::nullopt;
         if (!shl->child(1)->hasInt32())
-            return Nullopt;
+            return std::nullopt;
         unsigned logScale = shl->child(1)->asInt32();
         if (shl->type() == Int32)
             logScale &= 31;
@@ -442,10 +442,10 @@
         // to signed since that's what all of our APIs want.
         int64_t bigScale = static_cast<uint64_t>(1) << static_cast<uint64_t>(logScale);
         if (!isRepresentableAs<int32_t>(bigScale))
-            return Nullopt;
+            return std::nullopt;
         unsigned scale = static_cast<int32_t>(bigScale);
         if (!Arg::isValidIndexForm(scale, offset, width))
-            return Nullopt;
+            return std::nullopt;
         return scale;
     }
 
@@ -470,7 +470,7 @@
             Value* right = address->child(1);
 
             auto tryIndex = [&] (Value* index, Value* base) -> Arg {
-                Optional<unsigned> scale = scaleForShl(index, offset, width);
+                std::optional<unsigned> scale = scaleForShl(index, offset, width);
                 if (!scale)
                     return Arg();
                 if (m_locked.contains(index->child(0)) || m_locked.contains(base))
@@ -1934,7 +1934,7 @@
         }
         
         auto tryShl = [&] (Value* shl, Value* other) -> bool {
-            Optional<unsigned> scale = scaleForShl(shl, offset);
+            std::optional<unsigned> scale = scaleForShl(shl, offset);
             if (!scale)
                 return false;
             if (!canBeInternal(shl))
diff --git a/Source/JavaScriptCore/b3/B3Opcode.cpp b/Source/JavaScriptCore/b3/B3Opcode.cpp
index 3c7fede..a0aa5a9 100644
--- a/Source/JavaScriptCore/b3/B3Opcode.cpp
+++ b/Source/JavaScriptCore/b3/B3Opcode.cpp
@@ -32,7 +32,7 @@
 
 namespace JSC { namespace B3 {
 
-Optional<Opcode> invertedCompare(Opcode opcode, Type type)
+std::optional<Opcode> invertedCompare(Opcode opcode, Type type)
 {
     switch (opcode) {
     case Equal:
@@ -42,19 +42,19 @@
     case LessThan:
         if (isInt(type))
             return GreaterEqual;
-        return Nullopt;
+        return std::nullopt;
     case GreaterThan:
         if (isInt(type))
             return LessEqual;
-        return Nullopt;
+        return std::nullopt;
     case LessEqual:
         if (isInt(type))
             return GreaterThan;
-        return Nullopt;
+        return std::nullopt;
     case GreaterEqual:
         if (isInt(type))
             return LessThan;
-        return Nullopt;
+        return std::nullopt;
     case Above:
         return BelowEqual;
     case Below:
@@ -64,7 +64,7 @@
     case BelowEqual:
         return Above;
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 }
 
diff --git a/Source/JavaScriptCore/b3/B3Opcode.h b/Source/JavaScriptCore/b3/B3Opcode.h
index c68aabb..956dba9 100644
--- a/Source/JavaScriptCore/b3/B3Opcode.h
+++ b/Source/JavaScriptCore/b3/B3Opcode.h
@@ -265,7 +265,7 @@
     }
 }
 
-Optional<Opcode> invertedCompare(Opcode, Type);
+std::optional<Opcode> invertedCompare(Opcode, Type);
 
 inline Opcode constPtrOpcode()
 {
diff --git a/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp b/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp
index 71adac9..c5fc588 100644
--- a/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp
+++ b/Source/JavaScriptCore/b3/B3PatchpointSpecial.cpp
@@ -59,7 +59,7 @@
         callback(inst.args[argIndex++], role, inst.origin->airType(), inst.origin->airWidth());
     }
 
-    forEachArgImpl(0, argIndex, inst, SameAsRep, Nullopt, callback);
+    forEachArgImpl(0, argIndex, inst, SameAsRep, std::nullopt, callback);
     argIndex += inst.origin->numChildren();
 
     for (unsigned i = patchpoint->numGPScratchRegisters; i--;)
diff --git a/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp b/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp
index 8cf81d0..b5aa6c3 100644
--- a/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp
+++ b/Source/JavaScriptCore/b3/B3StackmapSpecial.cpp
@@ -73,7 +73,7 @@
 
 void StackmapSpecial::forEachArgImpl(
     unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs,
-    Inst& inst, RoleMode roleMode, Optional<unsigned> firstRecoverableIndex,
+    Inst& inst, RoleMode roleMode, std::optional<unsigned> firstRecoverableIndex,
     const ScopedLambda<Inst::EachArgCallback>& callback)
 {
     StackmapValue* value = inst.origin->as<StackmapValue>();
diff --git a/Source/JavaScriptCore/b3/B3StackmapSpecial.h b/Source/JavaScriptCore/b3/B3StackmapSpecial.h
index bd6a3b5..97a0813 100644
--- a/Source/JavaScriptCore/b3/B3StackmapSpecial.h
+++ b/Source/JavaScriptCore/b3/B3StackmapSpecial.h
@@ -59,7 +59,7 @@
     // subclasses that implement that.
     void forEachArgImpl(
         unsigned numIgnoredB3Args, unsigned numIgnoredAirArgs,
-        Air::Inst&, RoleMode, Optional<unsigned> firstRecoverableIndex,
+        Air::Inst&, RoleMode, std::optional<unsigned> firstRecoverableIndex,
         const ScopedLambda<Air::Inst::EachArgCallback>&);
     
     bool isValidImpl(
diff --git a/Source/JavaScriptCore/b3/B3Value.cpp b/Source/JavaScriptCore/b3/B3Value.cpp
index 64410ac..b4fc433 100644
--- a/Source/JavaScriptCore/b3/B3Value.cpp
+++ b/Source/JavaScriptCore/b3/B3Value.cpp
@@ -457,7 +457,7 @@
 {
     if (!numChildren())
         return nullptr;
-    if (Optional<Opcode> invertedOpcode = B3::invertedCompare(opcode(), child(0)->type())) {
+    if (std::optional<Opcode> invertedOpcode = B3::invertedCompare(opcode(), child(0)->type())) {
         ASSERT(!kind().hasExtraBits());
         return proc.add<Value>(*invertedOpcode, type(), origin(), children());
     }
diff --git a/Source/JavaScriptCore/b3/air/AirArg.h b/Source/JavaScriptCore/b3/air/AirArg.h
index 2e9e57d..13db1ce 100644
--- a/Source/JavaScriptCore/b3/air/AirArg.h
+++ b/Source/JavaScriptCore/b3/air/AirArg.h
@@ -545,7 +545,7 @@
     }
 
     // If you don't pass a Width, this optimistically assumes that you're using the right width.
-    static bool isValidScale(unsigned scale, Optional<Width> width = Nullopt)
+    static bool isValidScale(unsigned scale, std::optional<Width> width = std::nullopt)
     {
         switch (scale) {
         case 1:
@@ -1085,7 +1085,7 @@
         return false;
     }
 
-    static bool isValidAddrForm(int32_t offset, Optional<Width> width = Nullopt)
+    static bool isValidAddrForm(int32_t offset, std::optional<Width> width = std::nullopt)
     {
         if (isX86())
             return true;
@@ -1110,7 +1110,7 @@
         return false;
     }
 
-    static bool isValidIndexForm(unsigned scale, int32_t offset, Optional<Width> width = Nullopt)
+    static bool isValidIndexForm(unsigned scale, int32_t offset, std::optional<Width> width = std::nullopt)
     {
         if (!isValidScale(scale, width))
             return false;
@@ -1124,7 +1124,7 @@
     // If you don't pass a width then this optimistically assumes that you're using the right width. But
     // the width is relevant to validity, so passing a null width is only useful for assertions. Don't
     // pass null widths when cascading through Args in the instruction selector!
-    bool isValidForm(Optional<Width> width = Nullopt) const
+    bool isValidForm(std::optional<Width> width = std::nullopt) const
     {
         switch (kind()) {
         case Invalid:
diff --git a/Source/JavaScriptCore/b3/air/AirCustom.h b/Source/JavaScriptCore/b3/air/AirCustom.h
index b0d55cd..644b7a1 100644
--- a/Source/JavaScriptCore/b3/air/AirCustom.h
+++ b/Source/JavaScriptCore/b3/air/AirCustom.h
@@ -82,7 +82,7 @@
         return inst.args[0].special()->admitsStack(inst, argIndex);
     }
 
-    static Optional<unsigned> shouldTryAliasingDef(Inst& inst)
+    static std::optional<unsigned> shouldTryAliasingDef(Inst& inst)
     {
         return inst.args[0].special()->shouldTryAliasingDef(inst);
     }
diff --git a/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp b/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp
index ec89ac5..d000d6c 100644
--- a/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp
+++ b/Source/JavaScriptCore/b3/air/AirFixObviousSpills.cpp
@@ -129,12 +129,12 @@
                 else if (isSpillSlot(inst.args[1]))
                     m_state.addAlias(SlotConst(inst.args[1].stackSlot(), inst.args[0].value()));
             } else if (isSpillSlot(inst.args[0]) && inst.args[1].isReg()) {
-                if (Optional<int64_t> constant = m_state.constantFor(inst.args[0]))
+                if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0]))
                     m_state.addAlias(RegConst(inst.args[1].reg(), *constant));
                 m_state.addAlias(
                     RegSlot(inst.args[1].reg(), inst.args[0].stackSlot(), RegSlot::AllBits));
             } else if (inst.args[0].isReg() && isSpillSlot(inst.args[1])) {
-                if (Optional<int64_t> constant = m_state.constantFor(inst.args[0]))
+                if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0]))
                     m_state.addAlias(SlotConst(inst.args[1].stackSlot(), *constant));
                 m_state.addAlias(
                     RegSlot(inst.args[0].reg(), inst.args[1].stackSlot(), RegSlot::AllBits));
@@ -148,12 +148,12 @@
                 else if (isSpillSlot(inst.args[1]))
                     m_state.addAlias(SlotConst(inst.args[1].stackSlot(), static_cast<uint32_t>(inst.args[0].value())));
             } else if (isSpillSlot(inst.args[0]) && inst.args[1].isReg()) {
-                if (Optional<int64_t> constant = m_state.constantFor(inst.args[0]))
+                if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0]))
                     m_state.addAlias(RegConst(inst.args[1].reg(), static_cast<uint32_t>(*constant)));
                 m_state.addAlias(
                     RegSlot(inst.args[1].reg(), inst.args[0].stackSlot(), RegSlot::ZExt32));
             } else if (inst.args[0].isReg() && isSpillSlot(inst.args[1])) {
-                if (Optional<int64_t> constant = m_state.constantFor(inst.args[0]))
+                if (std::optional<int64_t> constant = m_state.constantFor(inst.args[0]))
                     m_state.addAlias(SlotConst(inst.args[1].stackSlot(), static_cast<int32_t>(*constant)));
                 m_state.addAlias(
                     RegSlot(inst.args[0].reg(), inst.args[1].stackSlot(), RegSlot::Match32));
@@ -454,19 +454,19 @@
             return nullptr;
         }
 
-        Optional<int64_t> constantFor(const Arg& arg)
+        std::optional<int64_t> constantFor(const Arg& arg)
         {
             if (arg.isReg()) {
                 if (const RegConst* alias = getRegConst(arg.reg()))
                     return alias->constant;
-                return Nullopt;
+                return std::nullopt;
             }
             if (arg.isStack()) {
                 if (const SlotConst* alias = getSlotConst(arg.stackSlot()))
                     return alias->constant;
-                return Nullopt;
+                return std::nullopt;
             }
-            return Nullopt;
+            return std::nullopt;
         }
 
         void clobber(const Arg& arg)
diff --git a/Source/JavaScriptCore/b3/air/AirInst.h b/Source/JavaScriptCore/b3/air/AirInst.h
index 30f24d8..f38c21d 100644
--- a/Source/JavaScriptCore/b3/air/AirInst.h
+++ b/Source/JavaScriptCore/b3/air/AirInst.h
@@ -190,7 +190,7 @@
     // For example,
     //     Add Tmp1, Tmp2, Tmp3
     // returns 2 if 0 and 1 benefit from aliasing to Tmp3.
-    Optional<unsigned> shouldTryAliasingDef();
+    std::optional<unsigned> shouldTryAliasingDef();
     
     // This computes a hash for comparing this to JSAir's Inst.
     unsigned jsHash() const;
diff --git a/Source/JavaScriptCore/b3/air/AirInstInlines.h b/Source/JavaScriptCore/b3/air/AirInstInlines.h
index 1aaa06c..b753921 100644
--- a/Source/JavaScriptCore/b3/air/AirInstInlines.h
+++ b/Source/JavaScriptCore/b3/air/AirInstInlines.h
@@ -111,10 +111,10 @@
     return admitsStack(&arg - &args[0]);
 }
 
-inline Optional<unsigned> Inst::shouldTryAliasingDef()
+inline std::optional<unsigned> Inst::shouldTryAliasingDef()
 {
     if (!isX86())
-        return Nullopt;
+        return std::nullopt;
 
     switch (kind.opcode) {
     case Add32:
@@ -140,7 +140,7 @@
     case MulFloat:
 #if CPU(X86) || CPU(X86_64)
         if (MacroAssembler::supportsAVX())
-            return Nullopt;
+            return std::nullopt;
 #endif
         if (args.size() == 3)
             return 2;
@@ -171,7 +171,7 @@
     default:
         break;
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 inline bool isShiftValid(const Inst& inst)
diff --git a/Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp b/Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp
index 94d6291..bd1a5c7 100644
--- a/Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp
+++ b/Source/JavaScriptCore/b3/air/AirIteratedRegisterCoalescing.cpp
@@ -1007,7 +1007,7 @@
         m_worklistMoves.startAddingLowPriorityMoves();
         for (BasicBlock* block : m_code) {
             for (Inst& inst : *block) {
-                if (Optional<unsigned> defArgIndex = inst.shouldTryAliasingDef()) {
+                if (std::optional<unsigned> defArgIndex = inst.shouldTryAliasingDef()) {
                     Arg op1 = inst.args[*defArgIndex - 2];
                     Arg op2 = inst.args[*defArgIndex - 1];
                     Arg dest = inst.args[*defArgIndex];
diff --git a/Source/JavaScriptCore/b3/air/AirSpecial.cpp b/Source/JavaScriptCore/b3/air/AirSpecial.cpp
index 0a722e81..e825767 100644
--- a/Source/JavaScriptCore/b3/air/AirSpecial.cpp
+++ b/Source/JavaScriptCore/b3/air/AirSpecial.cpp
@@ -50,9 +50,9 @@
     return out.toCString();
 }
 
-Optional<unsigned> Special::shouldTryAliasingDef(Inst&)
+std::optional<unsigned> Special::shouldTryAliasingDef(Inst&)
 {
-    return Nullopt;
+    return std::nullopt;
 }
 
 bool Special::isTerminal(Inst&)
diff --git a/Source/JavaScriptCore/b3/air/AirSpecial.h b/Source/JavaScriptCore/b3/air/AirSpecial.h
index 6c10cb5..480cbfc 100644
--- a/Source/JavaScriptCore/b3/air/AirSpecial.h
+++ b/Source/JavaScriptCore/b3/air/AirSpecial.h
@@ -55,7 +55,7 @@
     virtual void forEachArg(Inst&, const ScopedLambda<Inst::EachArgCallback>&) = 0;
     virtual bool isValid(Inst&) = 0;
     virtual bool admitsStack(Inst&, unsigned argIndex) = 0;
-    virtual Optional<unsigned> shouldTryAliasingDef(Inst&);
+    virtual std::optional<unsigned> shouldTryAliasingDef(Inst&);
 
     // This gets called on for each Inst that uses this Special. Note that there is no way to
     // guarantee that a Special gets used from just one Inst, because Air might taildup late. So,
diff --git a/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp b/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp
index 95903e2..f7e1e9a 100644
--- a/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp
+++ b/Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp
@@ -117,7 +117,7 @@
 
         if (m_storages.size() <= index)
             m_storages.resize(index + 1);
-        if (Optional<Storage> storage = m_storages[index])
+        if (std::optional<Storage> storage = m_storages[index])
             return *storage;
 
         UnlinkedCodeBlock* codeBlock = m_graph.codeBlock();
@@ -138,7 +138,7 @@
 
     unsigned m_enterPoint { 0 };
     BytecodeGraph<UnlinkedCodeBlock> m_graph;
-    Vector<Optional<Storage>> m_storages;
+    Vector<std::optional<Storage>> m_storages;
     Yields m_yields;
     Strong<SymbolTable> m_generatorFrameSymbolTable;
     int m_generatorFrameSymbolTableIndex;
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index 249d113..a12bc0a 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -4512,29 +4512,29 @@
     m_pcToCodeOriginMap = WTFMove(map);
 }
 
-Optional<CodeOrigin> CodeBlock::findPC(void* pc)
+std::optional<CodeOrigin> CodeBlock::findPC(void* pc)
 {
     if (m_pcToCodeOriginMap) {
-        if (Optional<CodeOrigin> codeOrigin = m_pcToCodeOriginMap->findPC(pc))
+        if (std::optional<CodeOrigin> codeOrigin = m_pcToCodeOriginMap->findPC(pc))
             return codeOrigin;
     }
 
     for (Bag<StructureStubInfo>::iterator iter = m_stubInfos.begin(); !!iter; ++iter) {
         StructureStubInfo* stub = *iter;
         if (stub->containsPC(pc))
-            return Optional<CodeOrigin>(stub->codeOrigin);
+            return std::optional<CodeOrigin>(stub->codeOrigin);
     }
 
-    if (Optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc))
+    if (std::optional<CodeOrigin> codeOrigin = m_jitCode->findPC(this, pc))
         return codeOrigin;
 
-    return Nullopt;
+    return std::nullopt;
 }
 #endif // ENABLE(JIT)
 
-Optional<unsigned> CodeBlock::bytecodeOffsetFromCallSiteIndex(CallSiteIndex callSiteIndex)
+std::optional<unsigned> CodeBlock::bytecodeOffsetFromCallSiteIndex(CallSiteIndex callSiteIndex)
 {
-    Optional<unsigned> bytecodeOffset;
+    std::optional<unsigned> bytecodeOffset;
     JITCode::JITType jitType = this->jitType();
     if (jitType == JITCode::InterpreterThunk || jitType == JITCode::BaselineJIT) {
 #if USE(JSVALUE64)
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 6bb91db..aafea19 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -233,7 +233,7 @@
     void expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot,
         int& startOffset, int& endOffset, unsigned& line, unsigned& column) const;
 
-    Optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex);
+    std::optional<unsigned> bytecodeOffsetFromCallSiteIndex(CallSiteIndex);
 
     void getStubInfoMap(const ConcurrentJSLocker&, StubInfoMap& result);
     void getStubInfoMap(StubInfoMap& result);
@@ -889,7 +889,7 @@
 
 #if ENABLE(JIT)
     void setPCToCodeOriginMap(std::unique_ptr<PCToCodeOriginMap>&&);
-    Optional<CodeOrigin> findPC(void* pc);
+    std::optional<CodeOrigin> findPC(void* pc);
 #endif
 
 protected:
diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
index e3af61f..952e98b 100644
--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp
@@ -131,7 +131,7 @@
     visitor.append(&thisObject->m_unlinkedCodeBlockForConstruct);
 }
 
-FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& ownerSource, Optional<int> overrideLineNumber, Intrinsic intrinsic)
+FunctionExecutable* UnlinkedFunctionExecutable::link(VM& vm, const SourceCode& ownerSource, std::optional<int> overrideLineNumber, Intrinsic intrinsic)
 {
     SourceCode source = m_sourceOverride ? SourceCode(m_sourceOverride) : ownerSource;
     unsigned firstLine = source.firstLine() + m_firstLineOffset;
diff --git a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
index 6f558cf..bf3c528 100644
--- a/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
+++ b/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h
@@ -106,7 +106,7 @@
         const Identifier&, ExecState&, const SourceCode&, JSObject*& exception, 
         int overrideLineNumber);
 
-    JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode&, Optional<int> overrideLineNumber = Nullopt, Intrinsic = NoIntrinsic);
+    JS_EXPORT_PRIVATE FunctionExecutable* link(VM&, const SourceCode&, std::optional<int> overrideLineNumber = std::nullopt, Intrinsic = NoIntrinsic);
 
     void clearCode()
     {
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 046d2a7..bf1320f 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -910,7 +910,7 @@
         };
         typedef HashMap<RefPtr<UniquedStringImpl>, TDZNecessityLevel, IdentifierRepHash> TDZMap;
         Vector<TDZMap> m_TDZStack;
-        Optional<size_t> m_varScopeSymbolTableIndex;
+        std::optional<size_t> m_varScopeSymbolTableIndex;
         void pushTDZVariables(const VariableEnvironment&, TDZCheckOptimization, TDZRequirement);
 
         ScopeNode* const m_scopeNode;
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index edb65d7..68aeb5a 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -620,7 +620,7 @@
         return;
     }
     if (const auto* identifier = node.name()) {
-        Optional<uint32_t> optionalIndex = parseIndex(*identifier);
+        std::optional<uint32_t> optionalIndex = parseIndex(*identifier);
         if (!optionalIndex) {
             generator.emitDirectPutById(newObj, *identifier, value.get(), node.putType());
             return;
@@ -3967,7 +3967,7 @@
         RefPtr<RegisterID> temp = generator.newTemporary();
         if (!target.propertyExpression) {
             // Should not emit get_by_id for indexed ones.
-            Optional<uint32_t> optionalIndex = parseIndex(target.propertyName);
+            std::optional<uint32_t> optionalIndex = parseIndex(target.propertyName);
             if (!optionalIndex)
                 generator.emitGetById(temp.get(), rhs, target.propertyName);
             else {
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 98acd32..de23e13 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -360,7 +360,7 @@
     unsigned column = breakpoint.column ? breakpoint.column : Breakpoint::unspecifiedColumn;
 
     DebuggerParseData& parseData = debuggerParseData(breakpoint.sourceID, sourceProvider);
-    Optional<JSTextPosition> resolvedPosition = parseData.pausePositions.breakpointLocationForLineColumn((int)line, (int)column);
+    std::optional<JSTextPosition> resolvedPosition = parseData.pausePositions.breakpointLocationForLineColumn((int)line, (int)column);
     if (!resolvedPosition)
         return;
 
diff --git a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
index 16ac1ad..7f82127 100644
--- a/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp
@@ -290,7 +290,7 @@
 
     if (isTailDeleted()) {
         CodeBlock* codeBlock = m_shadowChickenFrame.codeBlock;
-        if (Optional<unsigned> bytecodeOffset = codeBlock->bytecodeOffsetFromCallSiteIndex(m_shadowChickenFrame.callSiteIndex)) {
+        if (std::optional<unsigned> bytecodeOffset = codeBlock->bytecodeOffsetFromCallSiteIndex(m_shadowChickenFrame.callSiteIndex)) {
             return TextPosition(OrdinalNumber::fromOneBasedInt(codeBlock->lineNumberForBytecodeOffset(*bytecodeOffset)),
                 OrdinalNumber::fromOneBasedInt(codeBlock->columnNumberForBytecodeOffset(*bytecodeOffset)));
         }
diff --git a/Source/JavaScriptCore/debugger/DebuggerParseData.cpp b/Source/JavaScriptCore/debugger/DebuggerParseData.cpp
index e71aac6..3b058ba 100644
--- a/Source/JavaScriptCore/debugger/DebuggerParseData.cpp
+++ b/Source/JavaScriptCore/debugger/DebuggerParseData.cpp
@@ -30,7 +30,7 @@
 
 namespace JSC {
 
-Optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineColumn(int line, int column)
+std::optional<JSTextPosition> DebuggerPausePositions::breakpointLocationForLineColumn(int line, int column)
 {
     unsigned start = 0;
     unsigned end = m_positions.size();
@@ -54,7 +54,7 @@
             // We are guarenteed to have a Leave for an Entry so we don't need to bounds check.
             while (true) {
                 if (pausePosition.type != DebuggerPausePositionType::Enter)
-                    return Optional<JSTextPosition>(pausePosition.position);
+                    return std::optional<JSTextPosition>(pausePosition.position);
                 pausePosition = m_positions[middle++];
             }
         }
@@ -67,7 +67,7 @@
 
     // Past the end, no possible pause locations.
     if (start >= m_positions.size())
-        return Nullopt;
+        return std::nullopt;
 
     // If the next location is a function Entry we will need to decide if we should go into
     // the function or go past the function. We decide to go into the function if the
@@ -87,7 +87,7 @@
     // Valid pause location. Use it.
     DebuggerPausePosition& firstSlidePosition = m_positions[start];
     if (firstSlidePosition.type != DebuggerPausePositionType::Enter)
-        return Optional<JSTextPosition>(firstSlidePosition.position);
+        return std::optional<JSTextPosition>(firstSlidePosition.position);
 
     // Determine if we should enter this function or skip past it.
     // If entryStackSize is > 0 we are skipping functions.
@@ -113,11 +113,11 @@
         }
 
         // Found pause position.
-        return Optional<JSTextPosition>(slidePosition.position);
+        return std::optional<JSTextPosition>(slidePosition.position);
     }
 
     // No pause positions found.
-    return Nullopt;
+    return std::nullopt;
 }
 
 void DebuggerPausePositions::sort()
diff --git a/Source/JavaScriptCore/debugger/DebuggerParseData.h b/Source/JavaScriptCore/debugger/DebuggerParseData.h
index 0622515..ecc78d0 100644
--- a/Source/JavaScriptCore/debugger/DebuggerParseData.h
+++ b/Source/JavaScriptCore/debugger/DebuggerParseData.h
@@ -60,7 +60,7 @@
         m_positions.append({ DebuggerPausePositionType::Leave, position });
     }
 
-    Optional<JSTextPosition> breakpointLocationForLineColumn(int line, int column);
+    std::optional<JSTextPosition> breakpointLocationForLineColumn(int line, int column);
 
     void sort();
 
diff --git a/Source/JavaScriptCore/debugger/ScriptProfilingScope.h b/Source/JavaScriptCore/debugger/ScriptProfilingScope.h
index 99624db..e40337f 100644
--- a/Source/JavaScriptCore/debugger/ScriptProfilingScope.h
+++ b/Source/JavaScriptCore/debugger/ScriptProfilingScope.h
@@ -83,7 +83,7 @@
     }
 
     JSGlobalObject* m_globalObject { nullptr };
-    Optional<double> m_startTime;
+    std::optional<double> m_startTime;
     ProfilingReason m_reason;
 };
 
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
index 5df4da3..d4be12a 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
@@ -435,7 +435,7 @@
         
     case DoubleRep: {
         JSValue child = forNode(node->child1()).value();
-        if (Optional<double> number = child.toNumberFromPrimitive()) {
+        if (std::optional<double> number = child.toNumberFromPrimitive()) {
             setConstant(node, jsDoubleNumber(*number));
             break;
         }
@@ -549,7 +549,7 @@
 
     case ArithClz32: {
         JSValue operand = forNode(node->child1()).value();
-        if (Optional<double> number = operand.toNumberFromPrimitive()) {
+        if (std::optional<double> number = operand.toNumberFromPrimitive()) {
             uint32_t value = toUInt32(*number);
             setConstant(node, jsNumber(clz32(value)));
             break;
@@ -855,7 +855,7 @@
         JSValue child = forNode(node->child1()).value();
         switch (node->child1().useKind()) {
         case Int32Use:
-            if (Optional<double> number = child.toNumberFromPrimitive()) {
+            if (std::optional<double> number = child.toNumberFromPrimitive()) {
                 JSValue result = jsNumber(fabs(*number));
                 if (result.isInt32()) {
                     setConstant(node, result);
@@ -865,7 +865,7 @@
             forNode(node).setType(SpecInt32Only);
             break;
         case DoubleRepUse:
-            if (Optional<double> number = child.toNumberFromPrimitive()) {
+            if (std::optional<double> number = child.toNumberFromPrimitive()) {
                 setConstant(node, jsDoubleNumber(fabs(*number)));
                 break;
             }
@@ -907,7 +907,7 @@
     case ArithCeil:
     case ArithTrunc: {
         JSValue operand = forNode(node->child1()).value();
-        if (Optional<double> number = operand.toNumberFromPrimitive()) {
+        if (std::optional<double> number = operand.toNumberFromPrimitive()) {
             double roundedValue = 0;
             if (node->op() == ArithRound)
                 roundedValue = jsRound(*number);
@@ -995,7 +995,7 @@
 
     case MapHash: {
         if (JSValue key = forNode(node->child1()).value()) {
-            if (Optional<uint32_t> hash = concurrentJSMapHash(key)) {
+            if (std::optional<uint32_t> hash = concurrentJSMapHash(key)) {
                 // Although C++ code uses uint32_t for the hash, the closest type in DFG IR is Int32
                 // and that's what MapHash returns. So, we have to cast to int32_t to avoid large
                 // unsigned values becoming doubles. This casting between signed and unsigned
@@ -3165,7 +3165,7 @@
 void AbstractInterpreter<AbstractStateType>::executeDoubleUnaryOpEffects(Node* node, double(*equivalentFunction)(double))
 {
     JSValue child = forNode(node->child1()).value();
-    if (Optional<double> number = child.toNumberFromPrimitive()) {
+    if (std::optional<double> number = child.toNumberFromPrimitive()) {
         setConstant(node, jsDoubleNumber(equivalentFunction(*number)));
         return;
     }
diff --git a/Source/JavaScriptCore/dfg/DFGJITCode.cpp b/Source/JavaScriptCore/dfg/DFGJITCode.cpp
index e9ac3e5..7fb9f71 100644
--- a/Source/JavaScriptCore/dfg/DFGJITCode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGJITCode.cpp
@@ -215,16 +215,16 @@
     minifiedDFG.validateReferences(trackedReferences);
 }
 
-Optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc)
+std::optional<CodeOrigin> JITCode::findPC(CodeBlock*, void* pc)
 {
     for (OSRExit& exit : osrExit) {
         if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) {
             if (handle->start() <= pc && pc < handle->end())
-                return Optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
+                return std::optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
         }
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 } } // namespace JSC::DFG
diff --git a/Source/JavaScriptCore/dfg/DFGJITCode.h b/Source/JavaScriptCore/dfg/DFGJITCode.h
index e1f1d7c..aee8742 100644
--- a/Source/JavaScriptCore/dfg/DFGJITCode.h
+++ b/Source/JavaScriptCore/dfg/DFGJITCode.h
@@ -124,7 +124,7 @@
 
     static ptrdiff_t commonDataOffset() { return OBJECT_OFFSETOF(JITCode, common); }
 
-    Optional<CodeOrigin> findPC(CodeBlock*, void* pc) override;
+    std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) override;
     
 private:
     friend class JITCompiler; // Allow JITCompiler to call setCodeRef().
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index 529869e..1026a84 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -132,7 +132,7 @@
     PutPropertySlot slot(baseValue, strict);
     if (direct) {
         RELEASE_ASSERT(baseValue.isObject());
-        if (Optional<uint32_t> index = parseIndex(propertyName)) {
+        if (std::optional<uint32_t> index = parseIndex(propertyName)) {
             scope.release();
             asObject(baseValue)->putDirectIndex(exec, index.value(), value, 0, strict ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
             return;
@@ -1174,7 +1174,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt8Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt8Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewInt16ArrayWithSize(
@@ -1188,7 +1188,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt16Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt16Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewInt32ArrayWithSize(
@@ -1202,7 +1202,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt32Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSInt32Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewUint8ArrayWithSize(
@@ -1216,7 +1216,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewUint8ClampedArrayWithSize(
@@ -1230,7 +1230,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8ClampedArray>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint8ClampedArray>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewUint16ArrayWithSize(
@@ -1244,7 +1244,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint16Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint16Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewUint32ArrayWithSize(
@@ -1258,7 +1258,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint32Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSUint32Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewFloat32ArrayWithSize(
@@ -1272,7 +1272,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat32Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat32Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 char* JIT_OPERATION operationNewFloat64ArrayWithSize(
@@ -1286,7 +1286,7 @@
 {
     VM& vm = exec->vm();
     NativeCallFrameTracer tracer(&vm, exec);
-    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat64Array>(exec, structure, encodedValue, 0, Nullopt));
+    return reinterpret_cast<char*>(constructGenericTypedArrayViewWithArguments<JSFloat64Array>(exec, structure, encodedValue, 0, std::nullopt));
 }
 
 JSCell* JIT_OPERATION operationCreateActivationDirect(ExecState* exec, Structure* structure, JSScope* scope, SymbolTable* table, EncodedJSValue initialValueEncoded)
diff --git a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
index 6081c57..67aba80 100644
--- a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
+++ b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
@@ -51,7 +51,7 @@
         jit->m_outOfLineStreamIndex = m_streamIndex;
         jit->m_origin = m_origin;
         generateInternal(jit);
-        jit->m_outOfLineStreamIndex = Nullopt;
+        jit->m_outOfLineStreamIndex = std::nullopt;
         if (!ASSERT_DISABLED)
             jit->m_jit.abortWithReason(DFGSlowPathGeneratorFellThrough);
     }
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 6ce045b..2b1efa1 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -399,7 +399,7 @@
         m_outOfLineStreamIndex = slowPathLambda.streamIndex;
         pcToCodeOriginMapBuilder.appendItem(m_jit.labelIgnoringWatchpoints(), currentNode->origin.semantic);
         slowPathLambda.generator();
-        m_outOfLineStreamIndex = Nullopt;
+        m_outOfLineStreamIndex = std::nullopt;
     }
 }
 
@@ -3188,8 +3188,8 @@
         return;
     }
 
-    Optional<JSValueOperand> left;
-    Optional<JSValueOperand> right;
+    std::optional<JSValueOperand> left;
+    std::optional<JSValueOperand> right;
 
     JSValueRegs leftRegs;
     JSValueRegs rightRegs;
@@ -3219,11 +3219,11 @@
     RELEASE_ASSERT(!leftOperand.isConst() || !rightOperand.isConst());
 
     if (!leftOperand.isConst()) {
-        left = JSValueOperand(this, leftChild);
+        left.emplace(this, leftChild);
         leftRegs = left->jsValueRegs();
     }
     if (!rightOperand.isConst()) {
-        right = JSValueOperand(this, rightChild);
+        right.emplace(this, rightChild);
         rightRegs = right->jsValueRegs();
     }
 
@@ -3335,8 +3335,8 @@
         return;
     }
 
-    Optional<JSValueOperand> left;
-    Optional<JSValueOperand> right;
+    std::optional<JSValueOperand> left;
+    std::optional<JSValueOperand> right;
 
     JSValueRegs leftRegs;
     JSValueRegs rightRegs;
@@ -3372,11 +3372,11 @@
     RELEASE_ASSERT(!leftOperand.isConst() || !rightOperand.isConst());
 
     if (!leftOperand.isConst()) {
-        left = JSValueOperand(this, leftChild);
+        left.emplace(this, leftChild);
         leftRegs = left->jsValueRegs();
     }
     if (!rightOperand.isConst()) {
-        right = JSValueOperand(this, rightChild);
+        right.emplace(this, rightChild);
         rightRegs = right->jsValueRegs();
     }
 
@@ -3497,8 +3497,8 @@
     Edge& leftChild = node->child1();
     Edge& rightChild = node->child2();
 
-    Optional<JSValueOperand> left;
-    Optional<JSValueOperand> right;
+    std::optional<JSValueOperand> left;
+    std::optional<JSValueOperand> right;
 
     JSValueRegs leftRegs;
     JSValueRegs rightRegs;
@@ -3511,16 +3511,16 @@
     GPRReg scratchGPR = InvalidGPRReg;
     FPRReg scratchFPR = InvalidFPRReg;
 
-    Optional<FPRTemporary> fprScratch;
+    std::optional<FPRTemporary> fprScratch;
     if (needsScratchFPRReg) {
-        fprScratch = FPRTemporary(this);
+        fprScratch.emplace(this);
         scratchFPR = fprScratch->fpr();
     }
 
 #if USE(JSVALUE64)
-    Optional<GPRTemporary> gprScratch;
+    std::optional<GPRTemporary> gprScratch;
     if (needsScratchGPRReg) {
-        gprScratch = GPRTemporary(this);
+        gprScratch.emplace(this);
         scratchGPR = gprScratch->gpr();
     }
     GPRTemporary result(this);
@@ -3547,11 +3547,11 @@
     ASSERT(!(Generator::isLeftOperandValidConstant(leftOperand) && Generator::isRightOperandValidConstant(rightOperand)));
 
     if (!Generator::isLeftOperandValidConstant(leftOperand)) {
-        left = JSValueOperand(this, leftChild);
+        left.emplace(this, leftChild);
         leftRegs = left->jsValueRegs();
     }
     if (!Generator::isRightOperandValidConstant(rightOperand)) {
-        right = JSValueOperand(this, rightChild);
+        right.emplace(this, rightChild);
         rightRegs = right->jsValueRegs();
     }
 
@@ -3616,10 +3616,10 @@
         });
     } else {
         if (Generator::isLeftOperandValidConstant(leftOperand)) {
-            left = JSValueOperand(this, leftChild);
+            left.emplace(this, leftChild);
             leftRegs = left->jsValueRegs();
         } else if (Generator::isRightOperandValidConstant(rightOperand)) {
-            right = JSValueOperand(this, rightChild);
+            right.emplace(this, rightChild);
             rightRegs = right->jsValueRegs();
         }
 
@@ -4258,9 +4258,9 @@
 void SpeculativeJIT::compileMathIC(Node* node, JITUnaryMathIC<Generator>* mathIC, bool needsScratchGPRReg, RepatchingFunction repatchingFunction, NonRepatchingFunction nonRepatchingFunction)
 {
     GPRReg scratchGPR = InvalidGPRReg;
-    Optional<GPRTemporary> gprScratch;
+    std::optional<GPRTemporary> gprScratch;
     if (needsScratchGPRReg) {
-        gprScratch = GPRTemporary(this);
+        gprScratch.emplace(this);
         scratchGPR = gprScratch->gpr();
     }
     JSValueOperand childOperand(this, node->child1());
@@ -4687,8 +4687,8 @@
             return;
         }
 
-        Optional<JSValueOperand> left;
-        Optional<JSValueOperand> right;
+        std::optional<JSValueOperand> left;
+        std::optional<JSValueOperand> right;
 
         JSValueRegs leftRegs;
         JSValueRegs rightRegs;
@@ -4735,11 +4735,11 @@
         RELEASE_ASSERT(!leftOperand.isConst() || !rightOperand.isConst());
 
         if (!leftOperand.isConst()) {
-            left = JSValueOperand(this, leftChild);
+            left.emplace(this, leftChild);
             leftRegs = left->jsValueRegs();
         }
         if (!rightOperand.isConst()) {
-            right = JSValueOperand(this, rightChild);
+            right.emplace(this, rightChild);
             rightRegs = right->jsValueRegs();
         }
 
@@ -7612,10 +7612,10 @@
     SpeculateCellOperand base(this, baseEdge);
     regs.append(DOMJIT::Value(base.gpr(), m_state.forNode(baseEdge).value()));
 
-    Optional<SpeculateCellOperand> globalObject;
+    std::optional<SpeculateCellOperand> globalObject;
     if (patchpoint->requireGlobalObject) {
         Edge& globalObjectEdge = node->child2();
-        globalObject = SpeculateCellOperand(this, globalObjectEdge);
+        globalObject.emplace(this, globalObjectEdge);
         regs.append(DOMJIT::Value(globalObject->gpr(), m_state.forNode(globalObjectEdge).value()));
     }
 
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index c8c9ef3..519df65 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -2928,7 +2928,7 @@
     };
     Vector<SlowPathLambda> m_slowPathLambdas;
     Vector<SilentRegisterSavePlan> m_plans;
-    Optional<unsigned> m_outOfLineStreamIndex;
+    std::optional<unsigned> m_outOfLineStreamIndex;
 };
 
 
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index 657442f..8d1bc0b 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -5050,15 +5050,15 @@
         GPRTemporary structureID(this);
         GPRTemporary result(this);
 
-        Optional<SpeculateCellOperand> keyAsCell;
-        Optional<JSValueOperand> keyAsValue;
+        std::optional<SpeculateCellOperand> keyAsCell;
+        std::optional<JSValueOperand> keyAsValue;
         JSValueRegs keyRegs;
         if (node->child2().useKind() == UntypedUse) {
-            keyAsValue = JSValueOperand(this, node->child2());
+            keyAsValue.emplace(this, node->child2());
             keyRegs = keyAsValue->jsValueRegs();
         } else {
             ASSERT(node->child2().useKind() == StringUse || node->child2().useKind() == SymbolUse);
-            keyAsCell = SpeculateCellOperand(this, node->child2());
+            keyAsCell.emplace(this, node->child2());
             keyRegs = JSValueRegs::payloadOnly(keyAsCell->gpr());
         }
 
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index 5804688..e538fbb 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -1949,10 +1949,10 @@
 
         bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();
         JSGlobalObject* globalObject = m_jit.graph().globalObjectFor(node->origin.semantic);
-        Optional<GPRTemporary> scratch;
+        std::optional<GPRTemporary> scratch;
         GPRReg scratchGPR = InvalidGPRReg;
         if (shouldCheckMasqueradesAsUndefined) {
-            scratch = GPRTemporary(this);
+            scratch.emplace(this);
             scratchGPR = scratch->gpr();
         }
         bool negateResult = true;
@@ -2103,12 +2103,12 @@
             GPRTemporary result(this);
             FPRTemporary fprValue(this);
             FPRTemporary fprTemp(this);
-            Optional<GPRTemporary> scratch;
+            std::optional<GPRTemporary> scratch;
 
             GPRReg scratchGPR = InvalidGPRReg;
             bool shouldCheckMasqueradesAsUndefined = !masqueradesAsUndefinedWatchpointIsStillValid();
             if (shouldCheckMasqueradesAsUndefined) {
-                scratch = GPRTemporary(this);
+                scratch.emplace(this);
                 scratchGPR = scratch->gpr();
             }
 
@@ -4769,11 +4769,11 @@
         case StringUse: {
             SpeculateCellOperand input(this, node->child1());
             GPRTemporary result(this);
-            Optional<GPRTemporary> temp;
+            std::optional<GPRTemporary> temp;
 
             GPRReg tempGPR = InvalidGPRReg;
             if (node->child1().useKind() == CellUse) {
-                temp = GPRTemporary(this);
+                temp.emplace(this);
                 tempGPR = temp->gpr();
             }
 
@@ -5207,15 +5207,15 @@
         GPRTemporary structureID(this);
         GPRTemporary result(this);
 
-        Optional<SpeculateCellOperand> keyAsCell;
-        Optional<JSValueOperand> keyAsValue;
+        std::optional<SpeculateCellOperand> keyAsCell;
+        std::optional<JSValueOperand> keyAsValue;
         GPRReg keyGPR;
         if (node->child2().useKind() == UntypedUse) {
-            keyAsValue = JSValueOperand(this, node->child2());
+            keyAsValue.emplace(this, node->child2());
             keyGPR = keyAsValue->gpr();
         } else {
             ASSERT(node->child2().useKind() == StringUse || node->child2().useKind() == SymbolUse);
-            keyAsCell = SpeculateCellOperand(this, node->child2());
+            keyAsCell.emplace(this, node->child2());
             keyGPR = keyAsCell->gpr();
         }
 
diff --git a/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp b/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
index 10406fa..66c5008 100644
--- a/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStrengthReductionPhase.cpp
@@ -204,7 +204,7 @@
             if (m_node->isBinaryUseKind(DoubleRepUse)
                 && m_node->child2()->isNumberConstant()) {
 
-                if (Optional<double> reciprocal = safeReciprocalForDivByConst(m_node->child2()->asNumber())) {
+                if (std::optional<double> reciprocal = safeReciprocalForDivByConst(m_node->child2()->asNumber())) {
                     Node* reciprocalNode = m_insertionSet.insertConstant(m_nodeIndex, m_node->origin, jsDoubleNumber(*reciprocal), DoubleConstant);
                     m_node->setOp(ArithMul);
                     m_node->child2() = Edge(reciprocalNode, DoubleRepUse);
diff --git a/Source/JavaScriptCore/ftl/FTLJITCode.cpp b/Source/JavaScriptCore/ftl/FTLJITCode.cpp
index 3ac41d9..1cdb509 100644
--- a/Source/JavaScriptCore/ftl/FTLJITCode.cpp
+++ b/Source/JavaScriptCore/ftl/FTLJITCode.cpp
@@ -146,23 +146,23 @@
     return RegisterSet();
 }
 
-Optional<CodeOrigin> JITCode::findPC(CodeBlock* codeBlock, void* pc)
+std::optional<CodeOrigin> JITCode::findPC(CodeBlock* codeBlock, void* pc)
 {
     for (OSRExit& exit : osrExit) {
         if (ExecutableMemoryHandle* handle = exit.m_code.executableMemory()) {
             if (handle->start() <= pc && pc < handle->end())
-                return Optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
+                return std::optional<CodeOrigin>(exit.m_codeOriginForExitProfile);
         }
     }
 
     for (std::unique_ptr<LazySlowPath>& lazySlowPath : lazySlowPaths) {
         if (ExecutableMemoryHandle* handle = lazySlowPath->stub().executableMemory()) {
             if (handle->start() <= pc && pc < handle->end())
-                return Optional<CodeOrigin>(codeBlock->codeOrigin(lazySlowPath->callSiteIndex()));
+                return std::optional<CodeOrigin>(codeBlock->codeOrigin(lazySlowPath->callSiteIndex()));
         }
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 } } // namespace JSC::FTL
diff --git a/Source/JavaScriptCore/ftl/FTLJITCode.h b/Source/JavaScriptCore/ftl/FTLJITCode.h
index 986a90a..2c2809e 100644
--- a/Source/JavaScriptCore/ftl/FTLJITCode.h
+++ b/Source/JavaScriptCore/ftl/FTLJITCode.h
@@ -60,7 +60,7 @@
 
     RegisterSet liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex) override;
 
-    Optional<CodeOrigin> findPC(CodeBlock*, void* pc) override;
+    std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) override;
 
     CodeRef b3Code() const { return m_b3Code; }
     
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 124d36f..8454dbe 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -190,7 +190,7 @@
 
 class TimingScope {
 public:
-    TimingScope(Optional<CollectionScope> scope, const char* name)
+    TimingScope(std::optional<CollectionScope> scope, const char* name)
         : m_scope(scope)
         , m_name(name)
     {
@@ -203,7 +203,7 @@
     {
     }
     
-    void setScope(Optional<CollectionScope> scope)
+    void setScope(std::optional<CollectionScope> scope)
     {
         m_scope = scope;
     }
@@ -224,7 +224,7 @@
         }
     }
 private:
-    Optional<CollectionScope> m_scope;
+    std::optional<CollectionScope> m_scope;
     double m_before;
     const char* m_name;
 };
@@ -1084,7 +1084,7 @@
     sweepAllLogicallyEmptyWeakBlocks();
 }
 
-void Heap::collectAsync(Optional<CollectionScope> scope)
+void Heap::collectAsync(std::optional<CollectionScope> scope)
 {
     if (!m_isSafeToCollect)
         return;
@@ -1092,7 +1092,7 @@
     bool alreadyRequested = false;
     {
         LockHolder locker(*m_threadLock);
-        for (Optional<CollectionScope> request : m_requests) {
+        for (std::optional<CollectionScope> request : m_requests) {
             if (scope) {
                 if (scope == CollectionScope::Eden) {
                     alreadyRequested = true;
@@ -1118,7 +1118,7 @@
     requestCollection(scope);
 }
 
-void Heap::collectSync(Optional<CollectionScope> scope)
+void Heap::collectSync(std::optional<CollectionScope> scope)
 {
     if (!m_isSafeToCollect)
         return;
@@ -1138,7 +1138,7 @@
 {
     m_currentGCStartTime = MonotonicTime::now();
     
-    Optional<CollectionScope> scope;
+    std::optional<CollectionScope> scope;
     {
         LockHolder locker(*m_threadLock);
         RELEASE_ASSERT(!m_requests.isEmpty());
@@ -1164,7 +1164,7 @@
     
     ASSERT(m_isSafeToCollect);
     if (m_collectionScope) {
-        dataLog("Collection scope already set during GC: ", m_collectionScope, "\n");
+        dataLog("Collection scope already set during GC: ", *m_collectionScope, "\n");
         RELEASE_ASSERT_NOT_REACHED();
     }
     
@@ -1542,7 +1542,7 @@
         cache->clear();
 }
 
-Heap::Ticket Heap::requestCollection(Optional<CollectionScope> scope)
+Heap::Ticket Heap::requestCollection(std::optional<CollectionScope> scope)
 {
     stopIfNecessary();
     
@@ -1582,7 +1582,7 @@
 #endif
 }
 
-void Heap::willStartCollection(Optional<CollectionScope> scope)
+void Heap::willStartCollection(std::optional<CollectionScope> scope)
 {
     if (Options::logGC())
         dataLog("=> ");
@@ -1789,7 +1789,7 @@
 
     RELEASE_ASSERT(m_collectionScope);
     m_lastCollectionScope = m_collectionScope;
-    m_collectionScope = Nullopt;
+    m_collectionScope = std::nullopt;
 
     for (auto* observer : m_observers)
         observer->didGarbageCollect(scope);
@@ -1915,7 +1915,7 @@
     m_writeBarrierBuffer.add(cell);
 }
 
-bool Heap::shouldDoFullCollection(Optional<CollectionScope> scope) const
+bool Heap::shouldDoFullCollection(std::optional<CollectionScope> scope) const
 {
     if (!Options::useGenerationalGC())
         return true;
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index 411f92a..7726ade 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -146,7 +146,7 @@
     void removeObserver(HeapObserver* observer) { m_observers.removeFirst(observer); }
 
     MutatorState mutatorState() const { return m_mutatorState; }
-    Optional<CollectionScope> collectionScope() const { return m_collectionScope; }
+    std::optional<CollectionScope> collectionScope() const { return m_collectionScope; }
     bool hasHeapAccess() const;
     bool mutatorIsStopped() const;
     bool collectorBelievesThatTheWorldIsStopped() const;
@@ -186,18 +186,18 @@
     bool shouldCollect();
     
     // Queue up a collection. Returns immediately. This will not queue a collection if a collection
-    // of equal or greater strength exists. Full collections are stronger than Nullopt collections
-    // and Nullopt collections are stronger than Eden collections. Nullopt means that the GC can
+    // of equal or greater strength exists. Full collections are stronger than std::nullopt collections
+    // and std::nullopt collections are stronger than Eden collections. std::nullopt means that the GC can
     // choose Eden or Full. This implies that if you request a GC while that GC is ongoing, nothing
     // will happen.
-    JS_EXPORT_PRIVATE void collectAsync(Optional<CollectionScope> = Nullopt);
+    JS_EXPORT_PRIVATE void collectAsync(std::optional<CollectionScope> = std::nullopt);
     
     // Queue up a collection and wait for it to complete. This won't return until you get your own
     // complete collection. For example, if there was an ongoing asynchronous collection at the time
     // you called this, then this would wait for that one to complete and then trigger your
     // collection and then return. In weird cases, there could be multiple GC requests in the backlog
     // and this will wait for that backlog before running its GC and returning.
-    JS_EXPORT_PRIVATE void collectSync(Optional<CollectionScope> = Nullopt);
+    JS_EXPORT_PRIVATE void collectSync(std::optional<CollectionScope> = std::nullopt);
     
     bool collectIfNecessaryOrDefer(GCDeferralContext* = nullptr); // Returns true if it did collect.
     void collectAccordingToDeferGCProbability();
@@ -425,11 +425,11 @@
     void notifyThreadStopping(const LockHolder&);
     
     typedef uint64_t Ticket;
-    Ticket requestCollection(Optional<CollectionScope>);
+    Ticket requestCollection(std::optional<CollectionScope>);
     void waitForCollection(Ticket);
     
     void suspendCompilerThreads();
-    void willStartCollection(Optional<CollectionScope>);
+    void willStartCollection(std::optional<CollectionScope>);
     void flushWriteBarrierBuffer();
     void prepareForMarking();
     
@@ -469,7 +469,7 @@
     void sweepAllLogicallyEmptyWeakBlocks();
     bool sweepNextLogicallyEmptyWeakBlock();
 
-    bool shouldDoFullCollection(Optional<CollectionScope> requestedCollectionScope) const;
+    bool shouldDoFullCollection(std::optional<CollectionScope> requestedCollectionScope) const;
 
     void incrementDeferralDepth();
     void decrementDeferralDepth();
@@ -497,8 +497,8 @@
     size_t m_totalBytesVisited;
     size_t m_totalBytesVisitedThisCycle;
     
-    Optional<CollectionScope> m_collectionScope;
-    Optional<CollectionScope> m_lastCollectionScope;
+    std::optional<CollectionScope> m_collectionScope;
+    std::optional<CollectionScope> m_lastCollectionScope;
     MutatorState m_mutatorState { MutatorState::Running };
     StructureIDTable m_structureIDTable;
     MarkedSpace m_objectSpace;
@@ -599,7 +599,7 @@
     bool m_collectorBelievesThatTheWorldIsStopped { false };
     MonotonicTime m_stopTime;
     
-    Deque<Optional<CollectionScope>> m_requests;
+    Deque<std::optional<CollectionScope>> m_requests;
     Ticket m_lastServedTicket { 0 };
     Ticket m_lastGrantedTicket { 0 };
     bool m_threadShouldStop { false };
diff --git a/Source/JavaScriptCore/heap/HeapSnapshot.cpp b/Source/JavaScriptCore/heap/HeapSnapshot.cpp
index fa33dc9..34db12c 100644
--- a/Source/JavaScriptCore/heap/HeapSnapshot.cpp
+++ b/Source/JavaScriptCore/heap/HeapSnapshot.cpp
@@ -130,7 +130,7 @@
 #endif
 }
 
-Optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell)
+std::optional<HeapSnapshotNode> HeapSnapshot::nodeForCell(JSCell* cell)
 {
     ASSERT(m_finalized);
 
@@ -142,7 +142,7 @@
             unsigned middle = start + ((end - start) / 2);
             HeapSnapshotNode& node = m_nodes[middle];
             if (cell == node.cell)
-                return Optional<HeapSnapshotNode>(node);
+                return std::optional<HeapSnapshotNode>(node);
             if (cell < node.cell)
                 end = middle;
             else
@@ -153,32 +153,32 @@
     if (m_previous)
         return m_previous->nodeForCell(cell);
 
-    return Nullopt;
+    return std::nullopt;
 }
 
-Optional<HeapSnapshotNode> HeapSnapshot::nodeForObjectIdentifier(unsigned objectIdentifier)
+std::optional<HeapSnapshotNode> HeapSnapshot::nodeForObjectIdentifier(unsigned objectIdentifier)
 {
     if (isEmpty()) {
         if (m_previous)
             return m_previous->nodeForObjectIdentifier(objectIdentifier);
-        return Nullopt;
+        return std::nullopt;
     }
 
     if (objectIdentifier > m_lastObjectIdentifier)
-        return Nullopt;
+        return std::nullopt;
 
     if (objectIdentifier < m_firstObjectIdentifier) {
         if (m_previous)
             return m_previous->nodeForObjectIdentifier(objectIdentifier);
-        return Nullopt;
+        return std::nullopt;
     }
 
     for (auto& node : m_nodes) {
         if (node.identifier == objectIdentifier)
-            return Optional<HeapSnapshotNode>(node);
+            return std::optional<HeapSnapshotNode>(node);
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 } // namespace JSC
diff --git a/Source/JavaScriptCore/heap/HeapSnapshot.h b/Source/JavaScriptCore/heap/HeapSnapshot.h
index 60d8284..fdd3de3 100644
--- a/Source/JavaScriptCore/heap/HeapSnapshot.h
+++ b/Source/JavaScriptCore/heap/HeapSnapshot.h
@@ -45,8 +45,8 @@
     void finalize();
 
     bool isEmpty() const { return m_nodes.isEmpty(); }
-    Optional<HeapSnapshotNode> nodeForCell(JSCell*);
-    Optional<HeapSnapshotNode> nodeForObjectIdentifier(unsigned objectIdentifier);
+    std::optional<HeapSnapshotNode> nodeForCell(JSCell*);
+    std::optional<HeapSnapshotNode> nodeForObjectIdentifier(unsigned objectIdentifier);
 
 private:
     friend class HeapSnapshotBuilder;
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
index e295f40..2388c28 100644
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
@@ -114,7 +114,7 @@
     {
         // In case this is a re-entrant call from a nested run loop, we don't want to lose
         // the outer request's id just because the inner request is bogus.
-        SetForScope<Optional<long>> scopedRequestId(m_currentRequestId, Nullopt);
+        SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, std::nullopt);
 
         RefPtr<InspectorValue> parsedMessage;
         if (!InspectorValue::parseJSON(message, parsedMessage)) {
@@ -145,7 +145,7 @@
 
     {
         // We could be called re-entrantly from a nested run loop, so restore the previous id.
-        SetForScope<Optional<long>> scopedRequestId(m_currentRequestId, requestId);
+        SetForScope<std::optional<long>> scopedRequestId(m_currentRequestId, requestId);
 
         RefPtr<InspectorValue> methodValue;
         if (!messageObject->getValue(ASCIILiteral("method"), methodValue)) {
@@ -246,7 +246,7 @@
     m_frontendRouter->sendResponse(message->toJSONString());
 
     m_protocolErrors.clear();
-    m_currentRequestId = Nullopt;
+    m_currentRequestId = std::nullopt;
 }
     
 void BackendDispatcher::reportProtocolError(CommonErrorCode errorCode, const String& errorMessage)
@@ -254,7 +254,7 @@
     reportProtocolError(m_currentRequestId, errorCode, errorMessage);
 }
 
-void BackendDispatcher::reportProtocolError(Optional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage)
+void BackendDispatcher::reportProtocolError(std::optional<long> relatedRequestId, CommonErrorCode errorCode, const String& errorMessage)
 {
     ASSERT_ARG(errorCode, errorCode >= 0);
 
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
index 3176b2d..927642c 100644
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
+++ b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.h
@@ -87,7 +87,7 @@
     void sendPendingErrors();
 
     void reportProtocolError(CommonErrorCode, const String& errorMessage);
-    void reportProtocolError(Optional<long> relatedRequestId, CommonErrorCode, const String& errorMessage);
+    void reportProtocolError(std::optional<long> relatedRequestId, CommonErrorCode, const String& errorMessage);
 
     template<typename T>
     WTF_HIDDEN_DECLARATION
@@ -114,7 +114,7 @@
 
     // For synchronously handled requests, avoid plumbing requestId through every
     // call that could potentially fail with a protocol error.
-    Optional<long> m_currentRequestId { Nullopt };
+    std::optional<long> m_currentRequestId { std::nullopt };
 };
 
 } // namespace Inspector
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
index 404169f..7e6eb50 100644
--- a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
+++ b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.cpp
@@ -213,24 +213,24 @@
     m_frontendDispatcher->trackingComplete(timestamp, snapshotData);
 }
 
-Optional<HeapSnapshotNode> InspectorHeapAgent::nodeForHeapObjectIdentifier(ErrorString& errorString, unsigned heapObjectIdentifier)
+std::optional<HeapSnapshotNode> InspectorHeapAgent::nodeForHeapObjectIdentifier(ErrorString& errorString, unsigned heapObjectIdentifier)
 {
     HeapProfiler* heapProfiler = m_environment.vm().heapProfiler();
     if (!heapProfiler) {
         errorString = ASCIILiteral("No heap snapshot");
-        return Nullopt;
+        return std::nullopt;
     }
 
     HeapSnapshot* snapshot = heapProfiler->mostRecentSnapshot();
     if (!snapshot) {
         errorString = ASCIILiteral("No heap snapshot");
-        return Nullopt;
+        return std::nullopt;
     }
 
-    const Optional<HeapSnapshotNode> optionalNode = snapshot->nodeForObjectIdentifier(heapObjectIdentifier);
+    const std::optional<HeapSnapshotNode> optionalNode = snapshot->nodeForObjectIdentifier(heapObjectIdentifier);
     if (!optionalNode) {
         errorString = ASCIILiteral("No object for identifier, it may have been collected");
-        return Nullopt;
+        return std::nullopt;
     }
 
     return optionalNode;
@@ -244,7 +244,7 @@
     DeferGC deferGC(vm.heap);
 
     unsigned heapObjectIdentifier = static_cast<unsigned>(heapObjectId);
-    const Optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier);
+    const std::optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier);
     if (!optionalNode)
         return;
 
@@ -293,7 +293,7 @@
     DeferGC deferGC(vm.heap);
 
     unsigned heapObjectIdentifier = static_cast<unsigned>(heapObjectId);
-    const Optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier);
+    const std::optional<HeapSnapshotNode> optionalNode = nodeForHeapObjectIdentifier(errorString, heapObjectIdentifier);
     if (!optionalNode)
         return;
 
diff --git a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h
index ba7382b..4757608 100644
--- a/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h
+++ b/Source/JavaScriptCore/inspector/agents/InspectorHeapAgent.h
@@ -66,7 +66,7 @@
     void clearHeapSnapshots();
 
 private:
-    Optional<JSC::HeapSnapshotNode> nodeForHeapObjectIdentifier(ErrorString&, unsigned heapObjectIdentifier);
+    std::optional<JSC::HeapSnapshotNode> nodeForHeapObjectIdentifier(ErrorString&, unsigned heapObjectIdentifier);
 
     InjectedScriptManager& m_injectedScriptManager;
     std::unique_ptr<HeapFrontendDispatcher> m_frontendDispatcher;
diff --git a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h
index 931705d..dba0601 100644
--- a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h
+++ b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.h
@@ -53,7 +53,7 @@
     void close();
     void targetClosed();
 
-    Optional<unsigned> targetIdentifier() const;
+    std::optional<unsigned> targetIdentifier() const;
     NSString *connectionIdentifier() const;
     NSString *destination() const;
 
diff --git a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.mm b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.mm
index 12f954c..d60da48 100644
--- a/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.mm
+++ b/Source/JavaScriptCore/inspector/remote/RemoteConnectionToTarget.mm
@@ -119,9 +119,9 @@
     teardownRunLoop();
 }
 
-Optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const
+std::optional<unsigned> RemoteConnectionToTarget::targetIdentifier() const
 {
-    return m_target ? Optional<unsigned>(m_target->targetIdentifier()) : Nullopt;
+    return m_target ? std::optional<unsigned>(m_target->targetIdentifier()) : std::nullopt;
 }
 
 NSString *RemoteConnectionToTarget::connectionIdentifier() const
@@ -163,7 +163,7 @@
         {
             std::lock_guard<Lock> lock(m_targetMutex);
             if (!m_target || !m_target->remoteControlAllowed()) {
-                RemoteInspector::singleton().setupFailed(targetIdentifier().valueOr(0));
+                RemoteInspector::singleton().setupFailed(targetIdentifier().value_or(0));
                 m_target = nullptr;
             } else if (is<RemoteInspectionTarget>(m_target)) {
                 auto castedTarget = downcast<RemoteInspectionTarget>(m_target);
diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h
index 4ea7f39..93fd1a7 100644
--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.h
+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.h
@@ -137,7 +137,7 @@
     RefPtr<RemoteInspectorXPCConnection> m_relayConnection;
 
     RemoteInspector::Client* m_client { nullptr };
-    Optional<RemoteInspector::Client::Capabilities> m_clientCapabilities;
+    std::optional<RemoteInspector::Client::Capabilities> m_clientCapabilities;
 
     dispatch_queue_t m_xpcQueue;
     unsigned m_nextAvailableTargetIdentifier { 1 };
diff --git a/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm b/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
index cb0bacd..21cb232 100644
--- a/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
+++ b/Source/JavaScriptCore/inspector/remote/RemoteInspector.mm
@@ -256,7 +256,7 @@
     std::lock_guard<Lock> lock(m_mutex);
 
     if (!m_client)
-        m_clientCapabilities = Nullopt;
+        m_clientCapabilities = std::nullopt;
     else {
         RemoteInspector::Client::Capabilities updatedCapabilities = {
             m_client->remoteAutomationAllowed() // remoteAutomationAllowed
diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
index d43d5a1..0704b3e 100755
--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_header.py
@@ -370,11 +370,11 @@
             'namespace %s {' % self.helpers_namespace(),
             '',
             'template<typename ProtocolEnumType>',
-            'Optional<ProtocolEnumType> parseEnumValueFromString(const String&);',
+            'std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);',
         ]))
 
         def return_type_with_export_macro(cpp_protocol_type):
-            enum_return_type = 'Optional<%s>' % cpp_protocol_type
+            enum_return_type = 'std::optional<%s>' % cpp_protocol_type
             result_terms = [enum_return_type]
             export_macro = self.model().framework.setting('export_macro', None)
             if export_macro is not None:
diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
index 57b842b..7bbb903 100755
--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
@@ -97,7 +97,7 @@
             body_lines = []
             body_lines.extend([
                 'template<>',
-                'Optional<%s> parseEnumValueFromString<%s>(const String& protocolString)' % (cpp_protocol_type, cpp_protocol_type),
+                'std::optional<%s> parseEnumValueFromString<%s>(const String& protocolString)' % (cpp_protocol_type, cpp_protocol_type),
                 '{',
                 '    static const size_t constantValues[] = {',
             ])
@@ -112,7 +112,7 @@
                 '        if (protocolString == enum_constant_values[constantValues[i]])',
                 '            return (%s)constantValues[i];' % cpp_protocol_type,
                 '',
-                '    return Nullopt;',
+                '    return std::nullopt;',
                 '}',
                 '',
             ])
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
index df3103d..442d5cb 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-async-attribute.json-result
@@ -723,11 +723,11 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Database' Domain
 template<>
-Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&);
+std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&);
 
 } // namespace TestHelpers
 
@@ -795,7 +795,7 @@
 
 // Enums in the 'Database' Domain
 template<>
-Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString)
+std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Database::PrimaryColors::Red,
@@ -806,7 +806,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Database::PrimaryColors)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
index 4ad146a..eb16820 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result
@@ -624,11 +624,11 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Database' Domain
 template<>
-Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&);
+std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String&);
 
 } // namespace TestHelpers
 
@@ -696,7 +696,7 @@
 
 // Enums in the 'Database' Domain
 template<>
-Optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString)
+std::optional<Inspector::Protocol::Database::PrimaryColors> parseEnumValueFromString<Inspector::Protocol::Database::PrimaryColors>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Database::PrimaryColors::Red,
@@ -707,7 +707,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Database::PrimaryColors)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
index 3e44fe1..e033642 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/enum-values.json-result
@@ -471,11 +471,11 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'TypeDomain' Domain
 template<>
-Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&);
+std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String&);
 
 } // namespace TestHelpers
 
@@ -545,7 +545,7 @@
 
 // Enums in the 'TypeDomain' Domain
 template<>
-Optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString)
+std::optional<Inspector::Protocol::TypeDomain::TypeDomainEnum> parseEnumValueFromString<Inspector::Protocol::TypeDomain::TypeDomainEnum>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::TypeDomain::TypeDomainEnum::Shared,
@@ -557,7 +557,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::TypeDomain::TypeDomainEnum)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
index 145a086..15ca6ac 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result
@@ -413,11 +413,11 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Runtime' Domain
 template<>
-Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&);
+std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String&);
 
 } // namespace TestHelpers
 
@@ -481,7 +481,7 @@
 
 // Enums in the 'Runtime' Domain
 template<>
-Optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString)
+std::optional<Inspector::Protocol::Runtime::KeyPath::Type> parseEnumValueFromString<Inspector::Protocol::Runtime::KeyPath::Type>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Runtime::KeyPath::Type::Null,
@@ -492,7 +492,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Runtime::KeyPath::Type)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
index 5b254e0..4dfc1f2 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-array-type.json-result
@@ -363,11 +363,11 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Debugger' Domain
 template<>
-Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&);
+std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String&);
 
 } // namespace TestHelpers
 
@@ -431,7 +431,7 @@
 
 // Enums in the 'Debugger' Domain
 template<>
-Optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString)
+std::optional<Inspector::Protocol::Debugger::Reason> parseEnumValueFromString<Inspector::Protocol::Debugger::Reason>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Debugger::Reason::Died,
@@ -442,7 +442,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Debugger::Reason)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
index 2dbda78..49a8440 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-declaration-enum-type.json-result
@@ -360,13 +360,13 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Runtime' Domain
 template<>
-Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&);
+std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String&);
 template<>
-Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&);
+std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String&);
 
 } // namespace TestHelpers
 
@@ -434,7 +434,7 @@
 
 // Enums in the 'Runtime' Domain
 template<>
-Optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString)
+std::optional<Inspector::Protocol::Runtime::FarmAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::FarmAnimals>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Runtime::FarmAnimals::Pigs,
@@ -446,11 +446,11 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Runtime::FarmAnimals)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<>
-Optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString)
+std::optional<Inspector::Protocol::Runtime::TwoLeggedAnimals> parseEnumValueFromString<Inspector::Protocol::Runtime::TwoLeggedAnimals>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Runtime::TwoLeggedAnimals::Ducks,
@@ -462,7 +462,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Runtime::TwoLeggedAnimals)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
index b904af8..5be9733 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result
@@ -582,13 +582,13 @@
 namespace TestHelpers {
 
 template<typename ProtocolEnumType>
-Optional<ProtocolEnumType> parseEnumValueFromString(const String&);
+std::optional<ProtocolEnumType> parseEnumValueFromString(const String&);
 
 // Enums in the 'Test' Domain
 template<>
-Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&);
+std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String&);
 template<>
-Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&);
+std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String&);
 
 } // namespace TestHelpers
 
@@ -656,7 +656,7 @@
 
 // Enums in the 'Test' Domain
 template<>
-Optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString)
+std::optional<Inspector::Protocol::Test::UncastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::UncastedAnimals>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Test::UncastedAnimals::Pigs,
@@ -668,11 +668,11 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Test::UncastedAnimals)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<>
-Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString)
+std::optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Inspector::Protocol::Test::CastedAnimals>(const String& protocolString)
 {
     static const size_t constantValues[] = {
         (size_t)Inspector::Protocol::Test::CastedAnimals::Ducks,
@@ -684,7 +684,7 @@
         if (protocolString == enum_constant_values[constantValues[i]])
             return (Inspector::Protocol::Test::CastedAnimals)constantValues[i];
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 
diff --git a/Source/JavaScriptCore/jit/JITCode.h b/Source/JavaScriptCore/jit/JITCode.h
index c8fb25a..75c70c7 100644
--- a/Source/JavaScriptCore/jit/JITCode.h
+++ b/Source/JavaScriptCore/jit/JITCode.h
@@ -196,7 +196,7 @@
 
 #if ENABLE(JIT)
     virtual RegisterSet liveRegistersToPreserveAtExceptionHandlingCallSite(CodeBlock*, CallSiteIndex);
-    virtual Optional<CodeOrigin> findPC(CodeBlock*, void* pc) { UNUSED_PARAM(pc); return Nullopt; }
+    virtual std::optional<CodeOrigin> findPC(CodeBlock*, void* pc) { UNUSED_PARAM(pc); return std::nullopt; }
 #endif
 
 private:
diff --git a/Source/JavaScriptCore/jit/JITDivGenerator.cpp b/Source/JavaScriptCore/jit/JITDivGenerator.cpp
index be92d3f..a5db7e1 100644
--- a/Source/JavaScriptCore/jit/JITDivGenerator.cpp
+++ b/Source/JavaScriptCore/jit/JITDivGenerator.cpp
@@ -82,7 +82,7 @@
     loadOperand(jit, m_leftOperand, m_left, m_leftFPR);
 
 #if USE(JSVALUE64)
-    Optional<double> safeReciprocal;
+    std::optional<double> safeReciprocal;
     if (m_rightOperand.isConst()) {
         double constant = m_rightOperand.asConstNumber();
         safeReciprocal = safeReciprocalForDivByConst(constant);
diff --git a/Source/JavaScriptCore/jit/JITOperations.cpp b/Source/JavaScriptCore/jit/JITOperations.cpp
index f17a6c1..12a56f3 100644
--- a/Source/JavaScriptCore/jit/JITOperations.cpp
+++ b/Source/JavaScriptCore/jit/JITOperations.cpp
@@ -571,7 +571,7 @@
     auto property = subscript.toPropertyKey(callFrame);
     RETURN_IF_EXCEPTION(scope, void());
 
-    if (Optional<uint32_t> index = parseIndex(property)) {
+    if (std::optional<uint32_t> index = parseIndex(property)) {
         byValInfo->tookSlowPath = true;
         baseObject->putDirectIndex(callFrame, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
         return;
diff --git a/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp b/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp
index b93e2c6..410009a 100644
--- a/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp
+++ b/Source/JavaScriptCore/jit/PCToCodeOriginMap.cpp
@@ -246,11 +246,11 @@
     return size;
 }
 
-Optional<CodeOrigin> PCToCodeOriginMap::findPC(void* pc) const
+std::optional<CodeOrigin> PCToCodeOriginMap::findPC(void* pc) const
 {
     uintptr_t pcAsInt = bitwise_cast<uintptr_t>(pc);
     if (!(m_pcRangeStart <= pcAsInt && pcAsInt <= m_pcRangeEnd))
-        return Nullopt;
+        return std::nullopt;
 
     uintptr_t currentPC = 0;
     CodeOrigin currentCodeOrigin(0, nullptr);
@@ -293,12 +293,12 @@
             // We subtract 1 because we generate end points inclusively in this table, even though we are interested in ranges of the form: [previousPC, currentPC)
             uintptr_t endOfRange = currentPC - 1;
             if (startOfRange <= pcAsInt && pcAsInt <= endOfRange)
-                return Optional<CodeOrigin>(previousOrigin); // We return previousOrigin here because CodeOrigin's are mapped to the startValue of the range.
+                return std::optional<CodeOrigin>(previousOrigin); // We return previousOrigin here because CodeOrigin's are mapped to the startValue of the range.
         }
     }
 
     RELEASE_ASSERT_NOT_REACHED();
-    return Nullopt;
+    return std::nullopt;
 }
 
 } // namespace JSC
diff --git a/Source/JavaScriptCore/jit/PCToCodeOriginMap.h b/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
index 1c80ed8..c01c441 100644
--- a/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
+++ b/Source/JavaScriptCore/jit/PCToCodeOriginMap.h
@@ -83,7 +83,7 @@
     PCToCodeOriginMap(PCToCodeOriginMapBuilder&&, LinkBuffer&);
     ~PCToCodeOriginMap();
 
-    Optional<CodeOrigin> findPC(void* pc) const;
+    std::optional<CodeOrigin> findPC(void* pc) const;
 
     double memorySize();
 
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index fe99eda..f7e6035 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -421,7 +421,7 @@
             return true;
         }
 
-        Optional<uint32_t> index = parseIndex(propertyName);
+        std::optional<uint32_t> index = parseIndex(propertyName);
         if (index && index.value() < thisObject->getLength()) {
             slot.setValue(thisObject, DontDelete | DontEnum, jsNumber(thisObject->m_vector[index.value()]));
             return true;
diff --git a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
index 0d56d1d..d36bb28 100644
--- a/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
+++ b/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp
@@ -892,7 +892,7 @@
     if (UNLIKELY(throwScope.exception()))
         LLINT_END();
 
-    if (Optional<uint32_t> index = parseIndex(property))
+    if (std::optional<uint32_t> index = parseIndex(property))
         baseObject->putDirectIndex(exec, index.value(), value, 0, isStrictMode ? PutDirectIndexShouldThrow : PutDirectIndexShouldNotThrow);
     else {
         PutPropertySlot slot(baseObject, isStrictMode);
diff --git a/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp b/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp
index c20aa84..a7b180b 100644
--- a/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp
+++ b/Source/JavaScriptCore/parser/ModuleAnalyzer.cpp
@@ -82,7 +82,7 @@
     // Indirectly exported binding.
     // import a from "mod"
     // export { a }
-    Optional<JSModuleRecord::ImportEntry> optionalImportEntry = moduleRecord()->tryGetImportEntry(localName.get());
+    std::optional<JSModuleRecord::ImportEntry> optionalImportEntry = moduleRecord()->tryGetImportEntry(localName.get());
     ASSERT(optionalImportEntry);
     const JSModuleRecord::ImportEntry& importEntry = *optionalImportEntry;
     for (auto& exportName : moduleProgramNode.moduleScopeData().exportedBindings().get(localName.get()))
diff --git a/Source/JavaScriptCore/runtime/ConcurrentJSLock.h b/Source/JavaScriptCore/runtime/ConcurrentJSLock.h
index 9811a38..a812d0e 100644
--- a/Source/JavaScriptCore/runtime/ConcurrentJSLock.h
+++ b/Source/JavaScriptCore/runtime/ConcurrentJSLock.h
@@ -102,7 +102,7 @@
     ConcurrentJSLocker(ConcurrentJSLock& lockable)
         : ConcurrentJSLockerBase(lockable)
 #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
-        , m_disallowGC(InPlace)
+        , m_disallowGC(std::in_place)
 #endif
     {
     }
@@ -110,7 +110,7 @@
     ConcurrentJSLocker(ConcurrentJSLock* lockable)
         : ConcurrentJSLockerBase(lockable)
 #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
-        , m_disallowGC(InPlace)
+        , m_disallowGC(std::in_place)
 #endif
     {
     }
@@ -118,7 +118,7 @@
     ConcurrentJSLocker(NoLockingNecessaryTag)
         : ConcurrentJSLockerBase(NoLockingNecessary)
 #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
-        , m_disallowGC(Nullopt)
+        , m_disallowGC(std::nullopt)
 #endif
     {
     }
@@ -127,7 +127,7 @@
 
 #if ENABLE(CONCURRENT_JS) && !defined(NDEBUG)
 private:
-    Optional<DisallowGC> m_disallowGC;
+    std::optional<DisallowGC> m_disallowGC;
 #endif
 };
 
diff --git a/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h b/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h
index c2aee71..d7e3b91 100644
--- a/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h
+++ b/Source/JavaScriptCore/runtime/DefinePropertyAttributes.h
@@ -99,10 +99,10 @@
         return extractTriState(WritableShift) != MixedTriState;
     }
 
-    Optional<bool> writable() const
+    std::optional<bool> writable() const
     {
         if (!hasWritable())
-            return Nullopt;
+            return std::nullopt;
         return extractTriState(WritableShift) == TrueTriState;
     }
 
@@ -111,10 +111,10 @@
         return extractTriState(ConfigurableShift) != MixedTriState;
     }
 
-    Optional<bool> configurable() const
+    std::optional<bool> configurable() const
     {
         if (!hasConfigurable())
-            return Nullopt;
+            return std::nullopt;
         return extractTriState(ConfigurableShift) == TrueTriState;
     }
 
@@ -123,10 +123,10 @@
         return extractTriState(EnumerableShift) != MixedTriState;
     }
 
-    Optional<bool> enumerable() const
+    std::optional<bool> enumerable() const
     {
         if (!hasEnumerable())
-            return Nullopt;
+            return std::nullopt;
         return extractTriState(EnumerableShift) == TrueTriState;
     }
 
diff --git a/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h b/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h
index a301a39..edd6477 100644
--- a/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h
+++ b/Source/JavaScriptCore/runtime/GenericArgumentsInlines.h
@@ -51,7 +51,7 @@
         }
     }
     
-    Optional<uint32_t> index = parseIndex(ident);
+    std::optional<uint32_t> index = parseIndex(ident);
     if (index && thisObject->canAccessIndexQuickly(index.value())) {
         slot.setValue(thisObject, None, thisObject->getIndexQuickly(index.value()));
         return true;
@@ -117,7 +117,7 @@
     if (UNLIKELY(isThisValueAltered(slot, thisObject)))
         return ordinarySetSlow(exec, thisObject, ident, value, slot.thisValue(), slot.isStrictMode());
     
-    Optional<uint32_t> index = parseIndex(ident);
+    std::optional<uint32_t> index = parseIndex(ident);
     if (index && thisObject->canAccessIndexQuickly(index.value())) {
         thisObject->setIndexQuickly(vm, index.value(), value);
         return true;
@@ -152,7 +152,7 @@
             || ident == vm.propertyNames->iteratorSymbol))
         thisObject->overrideThings(vm);
     
-    Optional<uint32_t> index = parseIndex(ident);
+    std::optional<uint32_t> index = parseIndex(ident);
     if (index && thisObject->canAccessIndexQuickly(index.value())) {
         thisObject->overrideArgument(vm, index.value());
         return true;
@@ -186,7 +186,7 @@
         || ident == vm.propertyNames->iteratorSymbol)
         thisObject->overrideThingsIfNecessary(vm);
     else {
-        Optional<uint32_t> optionalIndex = parseIndex(ident);
+        std::optional<uint32_t> optionalIndex = parseIndex(ident);
         if (optionalIndex && thisObject->canAccessIndexQuickly(optionalIndex.value())) {
             uint32_t index = optionalIndex.value();
             if (!descriptor.isAccessorDescriptor()) {
diff --git a/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h b/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h
index 29a57e6..1bbe6e8 100644
--- a/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h
+++ b/Source/JavaScriptCore/runtime/HasOwnPropertyCache.h
@@ -84,7 +84,7 @@
         return bitwise_cast<uint32_t>(structureID) + impl->hash();
     }
 
-    ALWAYS_INLINE Optional<bool> get(Structure* structure, PropertyName propName)
+    ALWAYS_INLINE std::optional<bool> get(Structure* structure, PropertyName propName)
     {
         UniquedStringImpl* impl = propName.uid();
         StructureID id = structure->id();
@@ -92,7 +92,7 @@
         Entry& entry = bitwise_cast<Entry*>(this)[index];
         if (entry.structureID == id && entry.impl.get() == impl)
             return entry.result;
-        return Nullopt;
+        return std::nullopt;
     }
 
     ALWAYS_INLINE void tryAdd(VM& vm, PropertySlot& slot, JSObject* object, PropertyName propName, bool result)
diff --git a/Source/JavaScriptCore/runtime/HashMapImpl.h b/Source/JavaScriptCore/runtime/HashMapImpl.h
index 3a9d2d7..5bd0117 100644
--- a/Source/JavaScriptCore/runtime/HashMapImpl.h
+++ b/Source/JavaScriptCore/runtime/HashMapImpl.h
@@ -253,16 +253,16 @@
     return wangsInt64Hash(rawValue);
 }
 
-ALWAYS_INLINE Optional<uint32_t> concurrentJSMapHash(JSValue key)
+ALWAYS_INLINE std::optional<uint32_t> concurrentJSMapHash(JSValue key)
 {
     key = normalizeMapKey(key);
     if (key.isString()) {
         JSString* string = asString(key);
         if (string->length() > 10 * 1024)
-            return Nullopt;
+            return std::nullopt;
         const StringImpl* impl = string->tryGetValueImpl();
         if (!impl)
-            return Nullopt;
+            return std::nullopt;
         return impl->concurrentHash();
     }
 
diff --git a/Source/JavaScriptCore/runtime/Identifier.h b/Source/JavaScriptCore/runtime/Identifier.h
index 581ba42..25e16ae 100644
--- a/Source/JavaScriptCore/runtime/Identifier.h
+++ b/Source/JavaScriptCore/runtime/Identifier.h
@@ -38,46 +38,46 @@
 }
 
 template <typename CharType>
-ALWAYS_INLINE Optional<uint32_t> parseIndex(const CharType* characters, unsigned length)
+ALWAYS_INLINE std::optional<uint32_t> parseIndex(const CharType* characters, unsigned length)
 {
     // An empty string is not a number.
     if (!length)
-        return Nullopt;
+        return std::nullopt;
 
     // Get the first character, turning it into a digit.
     uint32_t value = characters[0] - '0';
     if (value > 9)
-        return Nullopt;
+        return std::nullopt;
 
     // Check for leading zeros. If the first characher is 0, then the
     // length of the string must be one - e.g. "042" is not equal to "42".
     if (!value && length > 1)
-        return Nullopt;
+        return std::nullopt;
 
     while (--length) {
         // Multiply value by 10, checking for overflow out of 32 bits.
         if (value > 0xFFFFFFFFU / 10)
-            return Nullopt;
+            return std::nullopt;
         value *= 10;
 
         // Get the next character, turning it into a digit.
         uint32_t newValue = *(++characters) - '0';
         if (newValue > 9)
-            return Nullopt;
+            return std::nullopt;
 
         // Add in the old value, checking for overflow out of 32 bits.
         newValue += value;
         if (newValue < value)
-            return Nullopt;
+            return std::nullopt;
         value = newValue;
     }
 
     if (!isIndex(value))
-        return Nullopt;
+        return std::nullopt;
     return value;
 }
 
-ALWAYS_INLINE Optional<uint32_t> parseIndex(StringImpl& impl)
+ALWAYS_INLINE std::optional<uint32_t> parseIndex(StringImpl& impl)
 {
     if (impl.is8Bit())
         return parseIndex(impl.characters8(), impl.length());
@@ -271,13 +271,13 @@
     return WTF::equal(r, s, length);
 }
 
-ALWAYS_INLINE Optional<uint32_t> parseIndex(const Identifier& identifier)
+ALWAYS_INLINE std::optional<uint32_t> parseIndex(const Identifier& identifier)
 {
     auto uid = identifier.impl();
     if (!uid)
-        return Nullopt;
+        return std::nullopt;
     if (uid->isSymbol())
-        return Nullopt;
+        return std::nullopt;
     return parseIndex(*uid);
 }
 
diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp
index d748439..5187226 100644
--- a/Source/JavaScriptCore/runtime/JSArray.cpp
+++ b/Source/JavaScriptCore/runtime/JSArray.cpp
@@ -208,7 +208,7 @@
 
     // 4. Else if P is an array index (15.4), then
     // a. Let index be ToUint32(P).
-    if (Optional<uint32_t> optionalIndex = parseIndex(propertyName)) {
+    if (std::optional<uint32_t> optionalIndex = parseIndex(propertyName)) {
         // b. Reject if index >= oldLen and oldLenDesc.[[Writable]] is false.
         uint32_t index = optionalIndex.value();
         // FIXME: Nothing prevents this from being called on a RuntimeArray, and the length function will always return 0 in that case.
diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.cpp b/Source/JavaScriptCore/runtime/JSCJSValue.cpp
index d01a779..1f8c6d59 100644
--- a/Source/JavaScriptCore/runtime/JSCJSValue.cpp
+++ b/Source/JavaScriptCore/runtime/JSCJSValue.cpp
@@ -76,10 +76,10 @@
     return isUndefined() ? PNaN : 0; // null and false both convert to 0.
 }
 
-Optional<double> JSValue::toNumberFromPrimitive() const
+std::optional<double> JSValue::toNumberFromPrimitive() const
 {
     if (isEmpty())
-        return Nullopt;
+        return std::nullopt;
     if (isNumber())
         return asNumber();
     if (isBoolean())
@@ -88,7 +88,7 @@
         return PNaN;
     if (isNull())
         return 0;
-    return Nullopt;
+    return std::nullopt;
 }
 
 JSObject* JSValue::toObjectSlowCase(ExecState* exec, JSGlobalObject* globalObject) const
@@ -150,7 +150,7 @@
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
 
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putToPrimitiveByIndex(exec, index.value(), value, slot.isStrictMode());
 
     // Check if there are any setters or getters in the prototype chain
diff --git a/Source/JavaScriptCore/runtime/JSCJSValue.h b/Source/JavaScriptCore/runtime/JSCJSValue.h
index d40c3fc..8809fdc 100644
--- a/Source/JavaScriptCore/runtime/JSCJSValue.h
+++ b/Source/JavaScriptCore/runtime/JSCJSValue.h
@@ -251,7 +251,7 @@
     double toNumber(ExecState*) const;
 
     // toNumber conversion if it can be done without side effects.
-    Optional<double> toNumberFromPrimitive() const;
+    std::optional<double> toNumberFromPrimitive() const;
 
     JSString* toString(ExecState*) const; // On exception, this returns the empty string.
     JSString* toStringOrNull(ExecState*) const; // On exception, this returns null, to make exception checks faster.
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
index 355390d..9cc05fa 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
@@ -189,7 +189,7 @@
 
     static ElementType toAdaptorNativeFromValue(ExecState* exec, JSValue jsValue) { return toNativeFromValue<Adaptor>(exec, jsValue); }
 
-    static Optional<ElementType> toAdaptorNativeFromValueWithoutCoercion(JSValue jsValue) { return toNativeFromValueWithoutCoercion<Adaptor>(jsValue); }
+    static std::optional<ElementType> toAdaptorNativeFromValueWithoutCoercion(JSValue jsValue) { return toNativeFromValueWithoutCoercion<Adaptor>(jsValue); }
 
     void sort()
     {
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
index cb2b5ed..6825ffd 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h
@@ -114,7 +114,7 @@
 }
 
 template<typename ViewClass>
-inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, Structure* structure, EncodedJSValue firstArgument, unsigned offset, Optional<unsigned> lengthOpt)
+inline JSObject* constructGenericTypedArrayViewWithArguments(ExecState* exec, Structure* structure, EncodedJSValue firstArgument, unsigned offset, std::optional<unsigned> lengthOpt)
 {
     VM& vm = exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
@@ -231,7 +231,7 @@
 
     JSValue firstValue = exec->uncheckedArgument(0);
     unsigned offset = 0;
-    Optional<unsigned> length = Nullopt;
+    std::optional<unsigned> length = std::nullopt;
     if (jsDynamicCast<JSArrayBuffer*>(firstValue) && argCount > 1) {
         offset = exec->uncheckedArgument(1).toIndex(exec, "byteOffset");
         RETURN_IF_EXCEPTION(scope, encodedJSValue());
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
index 367b135..708c52c 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewInlines.h
@@ -345,7 +345,7 @@
 {
     JSGenericTypedArrayView* thisObject = jsCast<JSGenericTypedArrayView*>(object);
 
-    if (Optional<uint32_t> index = parseIndex(propertyName)) {
+    if (std::optional<uint32_t> index = parseIndex(propertyName)) {
         if (thisObject->isNeutered()) {
             slot.setCustom(thisObject, None, throwNeuteredTypedArrayTypeError);
             return true;
@@ -371,7 +371,7 @@
     // https://tc39.github.io/ecma262/#sec-integer-indexed-exotic-objects-set-p-v-receiver
     // Ignore the receiver even if the receiver is altered to non base value.
     // 9.4.5.5-2-b-i Return ? IntegerIndexedElementSet(O, numericIndex, V).
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode());
     
     return Base::put(thisObject, exec, propertyName, value, slot);
diff --git a/Source/JavaScriptCore/runtime/JSModuleRecord.cpp b/Source/JavaScriptCore/runtime/JSModuleRecord.cpp
index 221357f..7617573 100644
--- a/Source/JavaScriptCore/runtime/JSModuleRecord.cpp
+++ b/Source/JavaScriptCore/runtime/JSModuleRecord.cpp
@@ -90,20 +90,20 @@
     ASSERT_UNUSED(isNewEntry, isNewEntry); // This is guaranteed by the parser.
 }
 
-auto JSModuleRecord::tryGetImportEntry(UniquedStringImpl* localName) -> Optional<ImportEntry>
+auto JSModuleRecord::tryGetImportEntry(UniquedStringImpl* localName) -> std::optional<ImportEntry>
 {
     const auto iterator = m_importEntries.find(localName);
     if (iterator == m_importEntries.end())
-        return Nullopt;
-    return Optional<ImportEntry>(iterator->value);
+        return std::nullopt;
+    return std::optional<ImportEntry>(iterator->value);
 }
 
-auto JSModuleRecord::tryGetExportEntry(UniquedStringImpl* exportName) -> Optional<ExportEntry>
+auto JSModuleRecord::tryGetExportEntry(UniquedStringImpl* exportName) -> std::optional<ExportEntry>
 {
     const auto iterator = m_exportEntries.find(exportName);
     if (iterator == m_exportEntries.end())
-        return Nullopt;
-    return Optional<ExportEntry>(iterator->value);
+        return std::nullopt;
+    return std::optional<ExportEntry>(iterator->value);
 }
 
 auto JSModuleRecord::ExportEntry::createLocal(const Identifier& exportName, const Identifier& localName) -> ExportEntry
@@ -147,7 +147,7 @@
 
 auto JSModuleRecord::resolveImport(ExecState* exec, const Identifier& localName) -> Resolution
 {
-    Optional<ImportEntry> optionalImportEntry = tryGetImportEntry(localName.impl());
+    std::optional<ImportEntry> optionalImportEntry = tryGetImportEntry(localName.impl());
     if (!optionalImportEntry)
         return Resolution::notFound();
 
@@ -215,12 +215,12 @@
     return lhs.moduleRecord == rhs.moduleRecord && lhs.exportName == rhs.exportName;
 }
 
-auto JSModuleRecord::tryGetCachedResolution(UniquedStringImpl* exportName) -> Optional<Resolution>
+auto JSModuleRecord::tryGetCachedResolution(UniquedStringImpl* exportName) -> std::optional<Resolution>
 {
     const auto iterator = m_resolutionCache.find(exportName);
     if (iterator == m_resolutionCache.end())
-        return Nullopt;
-    return Optional<Resolution>(iterator->value);
+        return std::nullopt;
+    return std::optional<Resolution>(iterator->value);
 }
 
 void JSModuleRecord::cacheResolution(UniquedStringImpl* exportName, const Resolution& resolution)
@@ -558,14 +558,14 @@
 
             //  4. Once we follow star links, we should not retrieve the result from the cache and should not cache the result.
             if (!foundStarLinks) {
-                if (Optional<Resolution> cachedResolution = moduleRecord->tryGetCachedResolution(query.exportName.get())) {
+                if (std::optional<Resolution> cachedResolution = moduleRecord->tryGetCachedResolution(query.exportName.get())) {
                     if (!mergeToCurrentTop(*cachedResolution))
                         return Resolution::ambiguous();
                     continue;
                 }
             }
 
-            const Optional<ExportEntry> optionalExportEntry = moduleRecord->tryGetExportEntry(query.exportName.get());
+            const std::optional<ExportEntry> optionalExportEntry = moduleRecord->tryGetExportEntry(query.exportName.get());
             if (!optionalExportEntry) {
                 // If there is no matched exported binding in the current module,
                 // we need to look into the stars.
@@ -648,7 +648,7 @@
 auto JSModuleRecord::resolveExport(ExecState* exec, const Identifier& exportName) -> Resolution
 {
     // Look up the cached resolution first before entering the resolving loop, since the loop setup takes some cost.
-    if (Optional<Resolution> cachedResolution = tryGetCachedResolution(exportName.impl()))
+    if (std::optional<Resolution> cachedResolution = tryGetCachedResolution(exportName.impl()))
         return *cachedResolution;
     return resolveExportImpl(exec, ResolveQuery(this, exportName.impl()));
 }
diff --git a/Source/JavaScriptCore/runtime/JSModuleRecord.h b/Source/JavaScriptCore/runtime/JSModuleRecord.h
index 9428dda..88c9e78 100644
--- a/Source/JavaScriptCore/runtime/JSModuleRecord.h
+++ b/Source/JavaScriptCore/runtime/JSModuleRecord.h
@@ -98,8 +98,8 @@
     void addImportEntry(const ImportEntry&);
     void addExportEntry(const ExportEntry&);
 
-    Optional<ImportEntry> tryGetImportEntry(UniquedStringImpl* localName);
-    Optional<ExportEntry> tryGetExportEntry(UniquedStringImpl* exportName);
+    std::optional<ImportEntry> tryGetImportEntry(UniquedStringImpl* localName);
+    std::optional<ExportEntry> tryGetExportEntry(UniquedStringImpl* exportName);
 
     const SourceCode& sourceCode() const { return m_sourceCode; }
     const Identifier& moduleKey() const { return m_moduleKey; }
@@ -162,7 +162,7 @@
 
     struct ResolveQuery;
     static Resolution resolveExportImpl(ExecState*, const ResolveQuery&);
-    Optional<Resolution> tryGetCachedResolution(UniquedStringImpl* exportName);
+    std::optional<Resolution> tryGetCachedResolution(UniquedStringImpl* exportName);
     void cacheResolution(UniquedStringImpl* exportName, const Resolution&);
 
     // The loader resolves the given module name to the module key. The module key is the unique value to represent this module.
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index d1e0731..b5cca74 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -1462,7 +1462,7 @@
 {
     ASSERT(value.isGetterSetter() && (attributes & Accessor));
 
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putDirectIndex(exec, index.value(), value, attributes, PutDirectIndexLikePutDirect);
 
     return putDirectNonIndexAccessor(exec->vm(), propertyName, value, attributes);
@@ -1527,7 +1527,7 @@
     JSObject* thisObject = jsCast<JSObject*>(cell);
     VM& vm = exec->vm();
     
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return thisObject->methodTable(vm)->deletePropertyByIndex(thisObject, exec, index.value());
 
     unsigned attributes;
@@ -3016,7 +3016,7 @@
 
 bool JSObject::putDirectMayBeIndex(ExecState* exec, PropertyName propertyName, JSValue value)
 {
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putDirectIndex(exec, index.value(), value);
     return putDirect(exec->vm(), propertyName, value);
 }
@@ -3169,7 +3169,7 @@
 bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, PropertyName propertyName, const PropertyDescriptor& descriptor, bool throwException)
 {
     // If it's an array index, then use the indexed property storage.
-    if (Optional<uint32_t> index = parseIndex(propertyName)) {
+    if (std::optional<uint32_t> index = parseIndex(propertyName)) {
         // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
         // d. Reject if succeeded is false.
         // e. If index >= oldLen
diff --git a/Source/JavaScriptCore/runtime/JSObject.h b/Source/JavaScriptCore/runtime/JSObject.h
index 2996866..706afe4 100644
--- a/Source/JavaScriptCore/runtime/JSObject.h
+++ b/Source/JavaScriptCore/runtime/JSObject.h
@@ -1320,7 +1320,7 @@
     Structure* structure = object->structure(vm);
     if (object->getOwnNonIndexPropertySlot(vm, structure, propertyName, slot))
         return true;
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return getOwnPropertySlotByIndex(object, exec, index.value(), slot);
     return false;
 }
@@ -1338,7 +1338,7 @@
             // getOwnNonIndexPropertySlot), so we cannot safely call the overridden getOwnPropertySlot
             // (lest we return a property from a prototype that is shadowed). Check now for an index,
             // if so we need to start afresh from this object.
-            if (Optional<uint32_t> index = parseIndex(propertyName))
+            if (std::optional<uint32_t> index = parseIndex(propertyName))
                 return getPropertySlot(exec, index.value(), slot);
             // Safe to continue searching from current position; call getNonIndexPropertySlot to avoid
             // parsing the int again.
@@ -1354,7 +1354,7 @@
         object = asObject(prototype);
     }
 
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return getPropertySlot(exec, index.value(), slot);
     return false;
 }
@@ -1394,7 +1394,7 @@
     ASSERT(!structure()->hasGetterSetterProperties());
     ASSERT(!structure()->hasCustomGetterSetterProperties());
 
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putDirectIndex(exec, index.value(), value, 0, PutDirectIndexLikePutDirect);
 
     return putDirectInternal<PutModePut>(exec->vm(), propertyName, value, 0, slot);
diff --git a/Source/JavaScriptCore/runtime/JSObjectInlines.h b/Source/JavaScriptCore/runtime/JSObjectInlines.h
index 613efc5..d0d4df2 100644
--- a/Source/JavaScriptCore/runtime/JSObjectInlines.h
+++ b/Source/JavaScriptCore/runtime/JSObjectInlines.h
@@ -196,7 +196,7 @@
 
     // Try indexed put first. This is required for correctness, since loads on property names that appear like
     // valid indices will never look in the named property storage.
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putByIndex(thisObject, exec, index.value(), value, slot.isStrictMode());
 
     if (thisObject->canPerformFastPutInline(exec, vm, propertyName)) {
diff --git a/Source/JavaScriptCore/runtime/JSString.cpp b/Source/JavaScriptCore/runtime/JSString.cpp
index 96bb9eb..eb8c921 100644
--- a/Source/JavaScriptCore/runtime/JSString.cpp
+++ b/Source/JavaScriptCore/runtime/JSString.cpp
@@ -434,7 +434,7 @@
         return true;
     }
     
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && index.value() < length()) {
         descriptor.setDescriptor(getIndex(exec, index.value()), DontDelete | ReadOnly);
         return true;
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 7cd70f6..95b0b0d 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -668,7 +668,7 @@
         return true;
     }
 
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && index.value() < length()) {
         slot.setValue(this, DontDelete | ReadOnly, getIndex(exec, index.value()));
         return true;
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp
index 56e0389..5993b32 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp
@@ -690,7 +690,7 @@
                     PutPropertySlot slot(object, codeBlock ? codeBlock->isStrictMode() : false);
                     objectStack.last().put(m_exec, ident, lastValue, slot);
                 } else {
-                    if (Optional<uint32_t> index = parseIndex(ident))
+                    if (std::optional<uint32_t> index = parseIndex(ident))
                         object->putDirectIndex(m_exec, index.value(), lastValue);
                     else
                         object->putDirect(vm, ident, lastValue);
diff --git a/Source/JavaScriptCore/runtime/MathCommon.h b/Source/JavaScriptCore/runtime/MathCommon.h
index 49ce791..6325786 100644
--- a/Source/JavaScriptCore/runtime/MathCommon.h
+++ b/Source/JavaScriptCore/runtime/MathCommon.h
@@ -118,15 +118,15 @@
     return toInt32(number);
 }
 
-inline Optional<double> safeReciprocalForDivByConst(double constant)
+inline std::optional<double> safeReciprocalForDivByConst(double constant)
 {
     // No "weird" numbers (NaN, Denormal, etc).
     if (!constant || !std::isnormal(constant))
-        return Nullopt;
+        return std::nullopt;
 
     int exponent;
     if (std::frexp(constant, &exponent) != 0.5)
-        return Nullopt;
+        return std::nullopt;
 
     // Note that frexp() returns the value divided by two
     // so we to offset this exponent by one.
@@ -135,7 +135,7 @@
     // A double exponent is between -1022 and 1023.
     // Nothing we can do to invert 1023.
     if (exponent == 1023)
-        return Nullopt;
+        return std::nullopt;
 
     double reciprocal = std::ldexp(1, -exponent);
     ASSERT(std::isnormal(reciprocal));
diff --git a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
index cea2775..21ccb6e 100644
--- a/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ObjectPrototype.cpp
@@ -102,7 +102,7 @@
 
     Structure* structure = thisObject->structure(vm);
     HasOwnPropertyCache* hasOwnPropertyCache = vm.ensureHasOwnPropertyCache();
-    if (Optional<bool> result = hasOwnPropertyCache->get(structure, propertyName)) {
+    if (std::optional<bool> result = hasOwnPropertyCache->get(structure, propertyName)) {
         ASSERT(*result == thisObject->hasOwnProperty(exec, propertyName));
         ASSERT(!scope.exception());
         return JSValue::encode(jsBoolean(*result));
diff --git a/Source/JavaScriptCore/runtime/PropertyDescriptor.h b/Source/JavaScriptCore/runtime/PropertyDescriptor.h
index ce463e1..eb461d3 100644
--- a/Source/JavaScriptCore/runtime/PropertyDescriptor.h
+++ b/Source/JavaScriptCore/runtime/PropertyDescriptor.h
@@ -98,16 +98,16 @@
     // We assume that validation is already done.
     PropertyDescriptor desc;
 
-    if (Optional<bool> enumerable = attributes.enumerable())
+    if (std::optional<bool> enumerable = attributes.enumerable())
         desc.setEnumerable(enumerable.value());
 
-    if (Optional<bool> configurable = attributes.configurable())
+    if (std::optional<bool> configurable = attributes.configurable())
         desc.setConfigurable(configurable.value());
 
     if (attributes.hasValue())
         desc.setValue(value);
 
-    if (Optional<bool> writable = attributes.writable())
+    if (std::optional<bool> writable = attributes.writable())
         desc.setWritable(writable.value());
 
     if (attributes.hasGet())
diff --git a/Source/JavaScriptCore/runtime/PropertyName.h b/Source/JavaScriptCore/runtime/PropertyName.h
index c476c88..d1d4d19 100644
--- a/Source/JavaScriptCore/runtime/PropertyName.h
+++ b/Source/JavaScriptCore/runtime/PropertyName.h
@@ -114,13 +114,13 @@
     return a.uid() != b.uid();
 }
 
-ALWAYS_INLINE Optional<uint32_t> parseIndex(PropertyName propertyName)
+ALWAYS_INLINE std::optional<uint32_t> parseIndex(PropertyName propertyName)
 {
     auto uid = propertyName.uid();
     if (!uid)
-        return Nullopt;
+        return std::nullopt;
     if (uid->isSymbol())
-        return Nullopt;
+        return std::nullopt;
     return parseIndex(*uid);
 }
 
diff --git a/Source/JavaScriptCore/runtime/SamplingProfiler.cpp b/Source/JavaScriptCore/runtime/SamplingProfiler.cpp
index 3d61dac..b7ff636 100644
--- a/Source/JavaScriptCore/runtime/SamplingProfiler.cpp
+++ b/Source/JavaScriptCore/runtime/SamplingProfiler.cpp
@@ -475,7 +475,7 @@
                     storeCalleeIntoTopFrame(unprocessedStackTrace.frames[0].unverifiedCallee);
                     startIndex = 1;
                 }
-            } else if (Optional<CodeOrigin> codeOrigin = topCodeBlock->findPC(unprocessedStackTrace.topPC)) {
+            } else if (std::optional<CodeOrigin> codeOrigin = topCodeBlock->findPC(unprocessedStackTrace.topPC)) {
                 codeOrigin->walkUpInlineStack([&] (const CodeOrigin& codeOrigin) {
                     appendCodeBlock(codeOrigin.inlineCallFrame ? codeOrigin.inlineCallFrame->baselineCodeBlock.get() : topCodeBlock, codeOrigin.bytecodeIndex);
                 });
diff --git a/Source/JavaScriptCore/runtime/StringObject.cpp b/Source/JavaScriptCore/runtime/StringObject.cpp
index 5ef75b0..22923e8 100644
--- a/Source/JavaScriptCore/runtime/StringObject.cpp
+++ b/Source/JavaScriptCore/runtime/StringObject.cpp
@@ -72,7 +72,7 @@
 
     if (propertyName == vm.propertyNames->length)
         return typeError(exec, scope, slot.isStrictMode(), ASCIILiteral(ReadonlyPropertyWriteError));
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return putByIndex(cell, exec, index.value(), value, slot.isStrictMode());
     return JSObject::put(cell, exec, propertyName, value, slot);
 }
@@ -92,7 +92,7 @@
 {
     if (propertyName == exec->propertyNames().length)
         return true;
-    if (Optional<uint32_t> index = parseIndex(propertyName)) {
+    if (std::optional<uint32_t> index = parseIndex(propertyName)) {
         if (object->internalValue()->canGetIndex(index.value()))
             return true;
     }
@@ -127,7 +127,7 @@
     StringObject* thisObject = jsCast<StringObject*>(cell);
     if (propertyName == exec->propertyNames().length)
         return false;
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && thisObject->internalValue()->canGetIndex(index.value()))
         return false;
     return JSObject::deleteProperty(thisObject, exec, propertyName);
diff --git a/Source/JavaScriptCore/runtime/ToNativeFromValue.h b/Source/JavaScriptCore/runtime/ToNativeFromValue.h
index f54fd06..fd61843 100644
--- a/Source/JavaScriptCore/runtime/ToNativeFromValue.h
+++ b/Source/JavaScriptCore/runtime/ToNativeFromValue.h
@@ -48,10 +48,10 @@
 }
 
 template<typename Adaptor>
-Optional<typename Adaptor::Type> toNativeFromValueWithoutCoercion(JSValue value)
+std::optional<typename Adaptor::Type> toNativeFromValueWithoutCoercion(JSValue value)
 {
     if (!value.isNumber())
-        return Nullopt;
+        return std::nullopt;
     if (value.isInt32())
         return Adaptor::toNativeFromInt32WithoutCoercion(value.asInt32());
     return Adaptor::toNativeFromDoubleWithoutCoercion(value.asDouble());
diff --git a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
index 0fac4fe..0af71f4 100644
--- a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
+++ b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
@@ -79,26 +79,26 @@
         return OtherAdaptor::toNativeFromInt32(value);
     }
 
-    static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
+    static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
     {
         if ((value >= 0 && static_cast<uint32_t>(value) > static_cast<uint32_t>(maxValue)) || value < static_cast<int32_t>(minValue))
-            return Nullopt;
+            return std::nullopt;
         return static_cast<Type>(value);
     }
 
-    static Optional<Type> toNativeFromUint32WithoutCoercion(uint32_t value)
+    static std::optional<Type> toNativeFromUint32WithoutCoercion(uint32_t value)
     {
         if (value > static_cast<uint32_t>(maxValue))
-            return Nullopt;
+            return std::nullopt;
 
         return static_cast<Type>(value);
     }
 
-    static Optional<Type> toNativeFromDoubleWithoutCoercion(double value)
+    static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value)
     {
         Type integer = static_cast<Type>(value);
         if (static_cast<double>(integer) != value)
-            return Nullopt;
+            return std::nullopt;
 
         if (value < 0)
             return toNativeFromInt32WithoutCoercion(static_cast<int32_t>(value));
@@ -149,12 +149,12 @@
         return OtherAdaptor::toNativeFromDouble(value);
     }
 
-    static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
+    static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
     {
         return static_cast<Type>(value);
     }
 
-    static Optional<Type> toNativeFromDoubleWithoutCoercion(double value)
+    static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value)
     {
         if (std::isnan(value) || std::isinf(value))
             return static_cast<Type>(value);
@@ -162,10 +162,10 @@
         Type valueResult = static_cast<Type>(value);
 
         if (static_cast<double>(valueResult) != value)
-            return Nullopt;
+            return std::nullopt;
 
         if (value < minValue || value > maxValue)
-            return Nullopt;
+            return std::nullopt;
 
         return valueResult;
     }
@@ -255,19 +255,19 @@
         return OtherAdaptor::toNativeFromInt32(value);
     }
     
-    static Optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
+    static std::optional<Type> toNativeFromInt32WithoutCoercion(int32_t value)
     {
         if (value > maxValue || value < minValue)
-            return Nullopt;
+            return std::nullopt;
 
         return static_cast<Type>(value);
     }
 
-    static Optional<Type> toNativeFromDoubleWithoutCoercion(double value)
+    static std::optional<Type> toNativeFromDoubleWithoutCoercion(double value)
     {
         uint8_t integer = static_cast<uint8_t>(value);
         if (static_cast<double>(integer) != value)
-            return Nullopt;
+            return std::nullopt;
 
         return integer;
     }
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index c396b33..fa2e61c 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,101 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        Import std::optional reference implementation offered by the C++17
+        original proposal paper. It has the same interface and functionality
+        to the C++17's one. Previous WTF::Optional lacks several functionalities.
+        The largest one is the correct constexpr constructors. This fact prevents
+        us from using Optional<literal type> in constexpr context in WebKit.
+
+        In WebKit, we do not allow global constructors. So only the constexpr
+        constructor is the way to use WTF::Optional in the static const
+        global variables. WTF::Optional is used in DOMJIT::Effect and
+        we would like to emit static const global variables that includes
+        this DOMJIT::Effect. That is the main motivation of this work.
+        This functionality allows the IDL code generator to emit DOMJIT
+        signatures as static const global variables.
+
+        We import the reference implementation one instead of LLVM libc++'s one.
+        This is because LLVM libc++'s one depends on many macro and type_traits
+        offered by libc++ implementation. And adopting it to WebKit requires
+        large modification compared to this reference implementation one.
+        Furthermore, it is difficult to compile libc++'s optional in old GCC and VC++.
+        It also requires some more modifications. To keep the thing simple,
+        we import the reference implementation one now. Once C++17 is released
+        and we update the compiler baseline, we can smoothly switch to the standard
+        library's std::optional.
+
+        We also add support for the environment that does not use exceptions to this
+        reference implementation.
+
+        And we also add valueOrCompute helper function. That keeps the extended
+        functionality that previous WTF::Optional has.
+
+        * wtf/CrossThreadQueue.h:
+        (WTF::CrossThreadQueue<DataType>::tryGetMessage):
+        * wtf/Expected.h:
+        (WTF::makeExpected):
+        * wtf/Forward.h:
+        * wtf/HashTraits.h:
+        (WTF::HashTraits<Ref<P>>::take):
+        * wtf/MainThread.cpp:
+        (WTF::initializeGCThreads):
+        (WTF::mayBeGCThread):
+        * wtf/MainThread.h:
+        * wtf/Optional.h:
+        (std::detail_::is_assignable::has_assign):
+        (std::detail_::has_overloaded_addressof::has_overload):
+        (std::detail_::static_addressof):
+        (std::detail_::convert):
+        (std::nullopt_t::nullopt_t):
+        (std::bad_optional_access::bad_optional_access):
+        (std::optional_base::optional_base):
+        (std::optional_base::~optional_base):
+        (std::constexpr_optional_base::constexpr_optional_base):
+        (std::optional::dataptr):
+        (std::optional::contained_val):
+        (std::optional::__NOEXCEPT_):
+        (std::optional::optional):
+        (std::optional::operator=):
+        (std::optional::emplace):
+        (std::optional::operator ->):
+        (std::optional::operator *):
+        (std::optional::value):
+        (std::optional::value_or):
+        (std::operator==):
+        (std::operator!=):
+        (std::operator<):
+        (std::operator>):
+        (std::operator<=):
+        (std::operator>=):
+        (std::__NOEXCEPT_):
+        (std::make_optional):
+        (std::hash<std::optional<T>>::operator()):
+        (WTF::NulloptTag::NulloptTag): Deleted.
+        (WTF::Optional::Optional): Deleted.
+        (WTF::Optional::~Optional): Deleted.
+        (WTF::Optional::operator=): Deleted.
+        (WTF::Optional::operator bool): Deleted.
+        (WTF::Optional::operator->): Deleted.
+        (WTF::Optional::operator*): Deleted.
+        (WTF::Optional::value): Deleted.
+        (WTF::Optional::valueOr): Deleted.
+        (WTF::Optional::valueOrCompute): Deleted.
+        (WTF::Optional::asPtr): Deleted.
+        (WTF::Optional::destroy): Deleted.
+        (WTF::operator==): Deleted.
+        (WTF::operator!=): Deleted.
+        (WTF::makeOptional): Deleted.
+        (WTF::printInternal): Deleted.
+        * wtf/text/StringView.cpp:
+        (WTF::StringView::GraphemeClusters::Iterator::Impl::Impl):
+        (WTF::StringView::GraphemeClusters::Iterator::Iterator):
+        * wtf/text/StringView.h:
+
 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
 
         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
diff --git a/Source/WTF/wtf/CrossThreadQueue.h b/Source/WTF/wtf/CrossThreadQueue.h
index a150c6e..e0b4781 100644
--- a/Source/WTF/wtf/CrossThreadQueue.h
+++ b/Source/WTF/wtf/CrossThreadQueue.h
@@ -45,7 +45,7 @@
     void append(DataType&&);
 
     DataType waitForMessage();
-    Optional<DataType> tryGetMessage();
+    std::optional<DataType> tryGetMessage();
 
     bool isKilled() const { return false; }
 
@@ -81,7 +81,7 @@
 }
 
 template<typename DataType>
-Optional<DataType> CrossThreadQueue<DataType>::tryGetMessage()
+std::optional<DataType> CrossThreadQueue<DataType>::tryGetMessage()
 {
     LockHolder lock(m_lock);
 
diff --git a/Source/WTF/wtf/Expected.h b/Source/WTF/wtf/Expected.h
index d8f74e7..cd7fa56 100644
--- a/Source/WTF/wtf/Expected.h
+++ b/Source/WTF/wtf/Expected.h
@@ -406,15 +406,15 @@
 
 template <typename T, typename E> void swap(Expected<T, E>& x, Expected<T, E>& y) { x.swap(y); }
 
-template <class T, class E = WTF::NulloptTag> constexpr Expected<std::decay_t<T>, E> makeExpected(T&& v)
+template <class T, class E = std::nullopt_t> constexpr Expected<std::decay_t<T>, E> makeExpected(T&& v)
 {
     return Expected<typename std::decay<T>::type, E>(std::forward<T>(v));
 }
 template <class T, class E> constexpr Expected<T, std::decay_t<E>> makeExpectedFromError(E&& e) { return Expected<T, std::decay_t<E>>(makeUnexpected(e)); }
 template <class T, class E, class U> constexpr Expected<T, E> makeExpectedFromError(U&& u) { return Expected<T, E>(makeUnexpected(E { std::forward<U>(u) } )); }
-// template <class F, class E = WTF::NulloptTag> constexpr Expected<typename std::result_of<F>::type, E> makeExpected_from_call(F f);
+// template <class F, class E = std::nullopt_t> constexpr Expected<typename std::result_of<F>::type, E> makeExpected_from_call(F f);
 
-inline Expected<void, WTF::NulloptTag> makeExpected() { return Expected<void, WTF::NulloptTag>(); }
+inline Expected<void, std::nullopt_t> makeExpected() { return Expected<void, std::nullopt_t>(); }
 
 } // namespace WTF
 
diff --git a/Source/WTF/wtf/Forward.h b/Source/WTF/wtf/Forward.h
index 103dfac..d68a947 100644
--- a/Source/WTF/wtf/Forward.h
+++ b/Source/WTF/wtf/Forward.h
@@ -22,13 +22,16 @@
 
 #include <stddef.h>
 
+namespace std {
+template<typename T> class optional;
+}
+
 namespace WTF {
 
 template<typename T> class Function;
 template<typename T> class LazyNeverDestroyed;
 template<typename T> class NeverDestroyed;
 template<typename T> class OptionSet;
-template<typename T> class Optional;
 template<typename T> class PassRefPtr;
 template<typename T> class Ref;
 template<typename T> class RefPtr;
@@ -61,7 +64,6 @@
 using WTF::LazyNeverDestroyed;
 using WTF::NeverDestroyed;
 using WTF::OptionSet;
-using WTF::Optional;
 using WTF::OrdinalNumber;
 using WTF::PassRefPtr;
 using WTF::PrintStream;
diff --git a/Source/WTF/wtf/HashTraits.h b/Source/WTF/wtf/HashTraits.h
index eb04847..542e7ad 100644
--- a/Source/WTF/wtf/HashTraits.h
+++ b/Source/WTF/wtf/HashTraits.h
@@ -188,8 +188,8 @@
     static PeekType peek(const Ref<P>& value) { return const_cast<PeekType>(value.ptrAllowingHashTableEmptyValue()); }
     static PeekType peek(P* value) { return value; }
 
-    typedef Optional<Ref<P>> TakeType;
-    static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? Nullopt : Optional<Ref<P>>(WTFMove(value)); }
+    typedef std::optional<Ref<P>> TakeType;
+    static TakeType take(Ref<P>&& value) { return isEmptyValue(value) ? std::nullopt : std::optional<Ref<P>>(WTFMove(value)); }
 };
 
 template<> struct HashTraits<String> : SimpleClassHashTraits<String> {
diff --git a/Source/WTF/wtf/MainThread.cpp b/Source/WTF/wtf/MainThread.cpp
index d548fb7..472bee2 100644
--- a/Source/WTF/wtf/MainThread.cpp
+++ b/Source/WTF/wtf/MainThread.cpp
@@ -190,7 +190,7 @@
 }
 #endif
 
-static ThreadSpecific<Optional<GCThreadType>, CanBeGCThread::True>* isGCThread;
+static ThreadSpecific<std::optional<GCThreadType>, CanBeGCThread::True>* isGCThread;
 
 void initializeGCThreads()
 {
@@ -198,7 +198,7 @@
     std::call_once(
         flag,
         [] {
-            isGCThread = new ThreadSpecific<Optional<GCThreadType>, CanBeGCThread::True>();
+            isGCThread = new ThreadSpecific<std::optional<GCThreadType>, CanBeGCThread::True>();
         });
 }
 
@@ -221,12 +221,12 @@
     return isMainThread();
 }
 
-Optional<GCThreadType> mayBeGCThread()
+std::optional<GCThreadType> mayBeGCThread()
 {
     if (!isGCThread)
-        return Nullopt;
+        return std::nullopt;
     if (!isGCThread->isSet())
-        return Nullopt;
+        return std::nullopt;
     return **isGCThread;
 }
 
diff --git a/Source/WTF/wtf/MainThread.h b/Source/WTF/wtf/MainThread.h
index 24e5f31..ef386d4 100644
--- a/Source/WTF/wtf/MainThread.h
+++ b/Source/WTF/wtf/MainThread.h
@@ -78,7 +78,7 @@
 void printInternal(PrintStream&, GCThreadType);
 
 WTF_EXPORT_PRIVATE void registerGCThread(GCThreadType);
-WTF_EXPORT_PRIVATE Optional<GCThreadType> mayBeGCThread();
+WTF_EXPORT_PRIVATE std::optional<GCThreadType> mayBeGCThread();
 WTF_EXPORT_PRIVATE bool isMainThreadOrGCThread();
 
 // NOTE: these functions are internal to the callOnMainThread implementation.
diff --git a/Source/WTF/wtf/Optional.h b/Source/WTF/wtf/Optional.h
index 9286e6b..2b3c7c1 100644
--- a/Source/WTF/wtf/Optional.h
+++ b/Source/WTF/wtf/Optional.h
@@ -1,283 +1,1109 @@
-/*
- * Copyright (C) 2014, 2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
+// Copyright (C) 2011 - 2012 Andrzej Krzemienski.
+//
+// Use, modification, and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// The idea and interface is based on Boost.Optional library
+// authored by Fernando Luis Cacciola Carballal
+//
+// Boost Software License - Version 1.0 - August 17th, 2003
+//
+// Permission is hereby granted, free of charge, to any person or organization
+// obtaining a copy of the software and accompanying documentation covered by
+// this license (the "Software") to use, reproduce, display, distribute,
+// execute, and transmit the Software, and to prepare derivative works of the
+// Software, and to permit third-parties to whom the Software is furnished to
+// do so, all subject to the following:
+//
+// The copyright notices in the Software and this entire statement, including
+// the above license grant, this restriction and the following disclaimer,
+// must be included in all copies of the Software, in whole or in part, and
+// all derivative works of the Software, unless such copies or derivative
+// works are solely in the form of machine-executable object code generated by
+// a source language processor.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
 
-#ifndef Optional_h
-#define Optional_h
+// Copied from https://github.com/akrzemi1/Optional (727c729dd1d9f06f225868280e50154594d7e59d)
 
-#include <type_traits>
-#include <wtf/Assertions.h>
-#include <wtf/PrintStream.h>
-#include <wtf/StdLibExtras.h>
+// Modified to make it compile with exceptions disabled.
 
-// WTF::Optional is a class based on std::optional, described here:
-// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2013/n3527.html
-// If this ends up in a C++ standard, we should replace our implementation with it.
+#pragma once
+
+# include <utility>
+# include <type_traits>
+# include <initializer_list>
+# include <cassert>
+# include <functional>
+# include <string>
+# include <stdexcept>
+# include <wtf/Assertions.h>
+# include <wtf/Compiler.h>
+# include <wtf/StdLibExtras.h>
+
+# define TR2_OPTIONAL_REQUIRES(...) typename std::enable_if<__VA_ARGS__::value, bool>::type = false
+
+# if defined __GNUC__ // NOTE: GNUC is also defined for Clang
+#   if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 8)
+#     define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___
+#   elif (__GNUC__ > 4)
+#     define TR2_OPTIONAL_GCC_4_8_AND_HIGHER___
+#   endif
+#
+#   if (__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)
+#     define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___
+#   elif (__GNUC__ > 4)
+#     define TR2_OPTIONAL_GCC_4_7_AND_HIGHER___
+#   endif
+#
+#   if (__GNUC__ == 4) && (__GNUC_MINOR__ == 8) && (__GNUC_PATCHLEVEL__ >= 1)
+#     define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___
+#   elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)
+#     define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___
+#   elif (__GNUC__ > 4)
+#     define TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___
+#   endif
+# endif
+#
+# if defined __clang_major__
+#   if (__clang_major__ == 3 && __clang_minor__ >= 5)
+#     define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_
+#   elif (__clang_major__ > 3)
+#     define TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_
+#   endif
+#   if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_
+#     define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_
+#   elif (__clang_major__ == 3 && __clang_minor__ == 4 && __clang_patchlevel__ >= 2)
+#     define TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_
+#   endif
+# endif
+#
+# if defined _MSC_VER
+#   if (_MSC_VER >= 1900)
+#     define TR2_OPTIONAL_MSVC_2015_AND_HIGHER___
+#   endif
+# endif
+
+# if defined __clang__
+#   if (__clang_major__ > 2) || (__clang_major__ == 2) && (__clang_minor__ >= 9)
+#     define OPTIONAL_HAS_THIS_RVALUE_REFS 1
+#   else
+#     define OPTIONAL_HAS_THIS_RVALUE_REFS 0
+#   endif
+# elif defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___
+#   define OPTIONAL_HAS_THIS_RVALUE_REFS 1
+# elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___
+#   define OPTIONAL_HAS_THIS_RVALUE_REFS 1
+# else
+#   define OPTIONAL_HAS_THIS_RVALUE_REFS 0
+# endif
+
+
+# if defined TR2_OPTIONAL_GCC_4_8_1_AND_HIGHER___
+#   define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 1
+#   define OPTIONAL_CONSTEXPR_INIT_LIST constexpr
+# else
+#   define OPTIONAL_HAS_CONSTEXPR_INIT_LIST 0
+#   define OPTIONAL_CONSTEXPR_INIT_LIST
+# endif
+
+// FIXME: To make the result of value() type consistent among the compilers, we now intentionally disables move accessors.
+#   define OPTIONAL_HAS_MOVE_ACCESSORS 0
+// # if defined TR2_OPTIONAL_CLANG_3_5_AND_HIGHTER_ && (defined __cplusplus) && (__cplusplus != 201103L)
+// #   define OPTIONAL_HAS_MOVE_ACCESSORS 1
+// # else
+// #   define OPTIONAL_HAS_MOVE_ACCESSORS 0
+// # endif
+
+# // In C++11 constexpr implies const, so we need to make non-const members also non-constexpr
+# if (defined __cplusplus) && (__cplusplus == 201103L)
+#   define OPTIONAL_MUTABLE_CONSTEXPR
+# else
+#   define OPTIONAL_MUTABLE_CONSTEXPR constexpr
+# endif
+
+#if COMPILER_SUPPORTS(EXCEPTIONS)
+#define __THROW_EXCEPTION(__exception) throw __exception;
+#define __NOEXCEPT noexcept
+#define __NOEXCEPT_(__exception) noexcept(__exception)
+#else
+#define __THROW_EXCEPTION(__exception) do { (void)__exception; CRASH(); } while (0);
+#define __NOEXCEPT
+#define __NOEXCEPT_(...)
+#endif
+
+namespace std {
+namespace detail_ {
+
+// NOTE: All our target compilers support is_trivially_destructible.
+// // BEGIN workaround for missing is_trivially_destructible
+// # if defined TR2_OPTIONAL_GCC_4_8_AND_HIGHER___
+//     // leave it: it is already there
+// # elif defined TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_
+//     // leave it: it is already there
+// # elif defined TR2_OPTIONAL_MSVC_2015_AND_HIGHER___
+//     // leave it: it is already there
+// # elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS
+//     // leave it: the user doesn't want it
+// # else
+//     template <typename T>
+//     using is_trivially_destructible = std::has_trivial_destructor<T>;
+// # endif
+// // END workaround for missing is_trivially_destructible
+
+#if COMPILER_SUPPORTS(EXCEPTIONS)
+# if defined(TR2_OPTIONAL_GCC_4_7_AND_HIGHER___) || defined(TR2_OPTIONAL_CLANG_3_4_2_AND_HIGHER_) || defined(TR2_OPTIONAL_MSVC_2015_AND_HIGHER___)
+    // leave it; our metafunctions are already defined.
+    template <typename T>
+    using is_nothrow_move_constructible = std::is_nothrow_move_constructible<T>;
+    template <typename T>
+    using is_nothrow_move_assignable = std::is_nothrow_move_assignable<T>;
+# elif defined TR2_OPTIONAL_DISABLE_EMULATION_OF_TYPE_TRAITS
+    // leave it: the user doesn't want it
+# else
+
+
+// workaround for missing traits in GCC and CLANG
+template <class T>
+struct is_nothrow_move_constructible
+{
+  constexpr static bool value = std::is_nothrow_constructible<T, T&&>::value;
+};
+
+
+template <class T, class U>
+struct is_assignable
+{
+  template <class X, class Y>
+  constexpr static bool has_assign(...) { return false; }
+
+  template <class X, class Y, size_t S = sizeof((std::declval<X>() = std::declval<Y>(), true)) >
+  // the comma operator is necessary for the cases where operator= returns void
+  constexpr static bool has_assign(bool) { return true; }
+
+  constexpr static bool value = has_assign<T, U>(true);
+};
+
+
+template <class T>
+struct is_nothrow_move_assignable
+{
+  template <class X, bool has_any_move_assign>
+  struct has_nothrow_move_assign {
+    constexpr static bool value = false;
+  };
+
+  template <class X>
+  struct has_nothrow_move_assign<X, true> {
+    constexpr static bool value = __NOEXCEPT_( std::declval<X&>() = std::declval<X&&>() );
+  };
+
+  constexpr static bool value = has_nothrow_move_assign<T, is_assignable<T&, T&&>::value>::value;
+};
+// end workaround
+
+
+# endif
+#endif
+
+} // namespace detail_
+
+// 20.5.4, optional for object types
+template <class T> class optional;
+
+// 20.5.5, optional for lvalue reference types
+template <class T> class optional<T&>;
+
+namespace detail_ {
+
+// workaround: std utility functions aren't constexpr yet
+template <class T> inline constexpr T&& constexpr_forward(typename std::remove_reference<T>::type& t) __NOEXCEPT
+{
+  return static_cast<T&&>(t);
+}
+
+template <class T> inline constexpr T&& constexpr_forward(typename std::remove_reference<T>::type&& t) __NOEXCEPT
+{
+    static_assert(!std::is_lvalue_reference<T>::value, "!!");
+    return static_cast<T&&>(t);
+}
+
+template <class T> inline constexpr typename std::remove_reference<T>::type&& constexpr_move(T&& t) __NOEXCEPT
+{
+    return static_cast<typename std::remove_reference<T>::type&&>(t);
+}
+
+#if defined NDEBUG
+# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR)
+#else
+# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) ((CHECK) ? (EXPR) : ([]{assert(!#CHECK);}(), (EXPR)))
+#endif
+
+
+// static_addressof: a constexpr version of addressof
+template <typename T>
+struct has_overloaded_addressof
+{
+  template <class X>
+  constexpr static bool has_overload(...) { return false; }
+
+  template <class X, size_t S = sizeof(std::declval<X&>().operator&()) >
+  constexpr static bool has_overload(bool) { return true; }
+
+  constexpr static bool value = has_overload<T>(true);
+};
+
+template <typename T, TR2_OPTIONAL_REQUIRES(!has_overloaded_addressof<T>)>
+constexpr T* static_addressof(T& ref)
+{
+  return &ref;
+}
+
+template <typename T, TR2_OPTIONAL_REQUIRES(has_overloaded_addressof<T>)>
+T* static_addressof(T& ref)
+{
+  return std::addressof(ref);
+}
+
+
+// the call to convert<A>(b) has return type A and converts b to type A iff b decltype(b) is implicitly convertible to A
+template <class U>
+constexpr U convert(U v) { return v; }
+
+} // namespace detail
+
+
+constexpr struct trivial_init_t{} trivial_init{};
+
+
+// 20.5.6, In-place construction
+constexpr struct in_place_t{} in_place{};
+
+
+// 20.5.7, Disengaged state indicator
+struct nullopt_t
+{
+  struct init{};
+  constexpr explicit nullopt_t(init){}
+};
+constexpr nullopt_t nullopt{nullopt_t::init()};
+
+
+// 20.5.8, class bad_optional_access
+class bad_optional_access : public std::logic_error {
+public:
+  explicit bad_optional_access(const std::string& what_arg) : std::logic_error{what_arg} {}
+  explicit bad_optional_access(const char* what_arg) : std::logic_error{what_arg} {}
+};
+
+
+template <class T>
+union storage_t
+{
+  unsigned char dummy_;
+  T value_;
+
+  constexpr storage_t( trivial_init_t ) __NOEXCEPT : dummy_() {};
+
+  template <class... Args>
+  constexpr storage_t( Args&&... args ) : value_(detail_::constexpr_forward<Args>(args)...) {}
+
+  ~storage_t(){}
+};
+
+
+template <class T>
+union constexpr_storage_t
+{
+    unsigned char dummy_;
+    T value_;
+
+    constexpr constexpr_storage_t( trivial_init_t ) __NOEXCEPT : dummy_() {};
+
+    template <class... Args>
+    constexpr constexpr_storage_t( Args&&... args ) : value_(detail_::constexpr_forward<Args>(args)...) {}
+
+    ~constexpr_storage_t() = default;
+};
+
+
+template <class T>
+struct optional_base
+{
+    bool init_;
+    storage_t<T> storage_;
+
+    constexpr optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {};
+
+    explicit constexpr optional_base(const T& v) : init_(true), storage_(v) {}
+
+    explicit constexpr optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {}
+
+    template <class... Args> explicit optional_base(in_place_t, Args&&... args)
+        : init_(true), storage_(detail_::constexpr_forward<Args>(args)...) {}
+
+    template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)>
+    explicit optional_base(in_place_t, std::initializer_list<U> il, Args&&... args)
+        : init_(true), storage_(il, std::forward<Args>(args)...) {}
+
+    ~optional_base() { if (init_) storage_.value_.T::~T(); }
+};
+
+
+template <class T>
+struct constexpr_optional_base
+{
+    bool init_;
+    constexpr_storage_t<T> storage_;
+
+    constexpr constexpr_optional_base() __NOEXCEPT : init_(false), storage_(trivial_init) {};
+
+    explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_(v) {}
+
+    explicit constexpr constexpr_optional_base(T&& v) : init_(true), storage_(detail_::constexpr_move(v)) {}
+
+    template <class... Args> explicit constexpr constexpr_optional_base(in_place_t, Args&&... args)
+      : init_(true), storage_(detail_::constexpr_forward<Args>(args)...) {}
+
+    template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)>
+    OPTIONAL_CONSTEXPR_INIT_LIST explicit constexpr_optional_base(in_place_t, std::initializer_list<U> il, Args&&... args)
+      : init_(true), storage_(il, std::forward<Args>(args)...) {}
+
+    ~constexpr_optional_base() = default;
+};
+
+template <class T>
+using OptionalBase = typename std::conditional<
+    std::is_trivially_destructible<T>::value,                          // if possible
+    constexpr_optional_base<typename std::remove_const<T>::type>, // use base with trivial destructor
+    optional_base<typename std::remove_const<T>::type>
+>::type;
+
+
+
+template <class T>
+class optional : private OptionalBase<T>
+{
+  static_assert( !std::is_same<typename std::decay<T>::type, nullopt_t>::value, "bad T" );
+  static_assert( !std::is_same<typename std::decay<T>::type, in_place_t>::value, "bad T" );
+
+
+  constexpr bool initialized() const __NOEXCEPT { return OptionalBase<T>::init_; }
+  typename std::remove_const<T>::type* dataptr() {  return std::addressof(OptionalBase<T>::storage_.value_); }
+  constexpr const T* dataptr() const { return detail_::static_addressof(OptionalBase<T>::storage_.value_); }
+
+# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1
+  constexpr const T& contained_val() const& { return OptionalBase<T>::storage_.value_; }
+#   if OPTIONAL_HAS_MOVE_ACCESSORS == 1
+  OPTIONAL_MUTABLE_CONSTEXPR T&& contained_val() && { return std::move(OptionalBase<T>::storage_.value_); }
+  OPTIONAL_MUTABLE_CONSTEXPR T& contained_val() & { return OptionalBase<T>::storage_.value_; }
+#   else
+  T& contained_val() & { return OptionalBase<T>::storage_.value_; }
+  T&& contained_val() && { return std::move(OptionalBase<T>::storage_.value_); }
+#   endif
+# else
+  constexpr const T& contained_val() const { return OptionalBase<T>::storage_.value_; }
+  T& contained_val() { return OptionalBase<T>::storage_.value_; }
+# endif
+
+  void clear() __NOEXCEPT {
+    if (initialized()) dataptr()->T::~T();
+    OptionalBase<T>::init_ = false;
+  }
+
+  template <class... Args>
+  void initialize(Args&&... args) __NOEXCEPT_(__NOEXCEPT_(T(std::forward<Args>(args)...)))
+  {
+    ASSERT(!OptionalBase<T>::init_);
+    ::new (static_cast<void*>(dataptr())) T(std::forward<Args>(args)...);
+    OptionalBase<T>::init_ = true;
+  }
+
+  template <class U, class... Args>
+  void initialize(std::initializer_list<U> il, Args&&... args) __NOEXCEPT_(__NOEXCEPT_(T(il, std::forward<Args>(args)...)))
+  {
+    ASSERT(!OptionalBase<T>::init_);
+    ::new (static_cast<void*>(dataptr())) T(il, std::forward<Args>(args)...);
+    OptionalBase<T>::init_ = true;
+  }
+
+public:
+  typedef T value_type;
+
+  // 20.5.5.1, constructors
+  constexpr optional() __NOEXCEPT : OptionalBase<T>()  {};
+  constexpr optional(nullopt_t) __NOEXCEPT : OptionalBase<T>() {};
+
+  optional(const optional& rhs)
+  : OptionalBase<T>()
+  {
+    if (rhs.initialized()) {
+        ::new (static_cast<void*>(dataptr())) T(*rhs);
+        OptionalBase<T>::init_ = true;
+    }
+  }
+
+  optional(optional&& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value)
+  : OptionalBase<T>()
+  {
+    if (rhs.initialized()) {
+        ::new (static_cast<void*>(dataptr())) T(std::move(*rhs));
+        OptionalBase<T>::init_ = true;
+    }
+  }
+
+  constexpr optional(const T& v) : OptionalBase<T>(v) {}
+
+  constexpr optional(T&& v) : OptionalBase<T>(detail_::constexpr_move(v)) {}
+
+  template <class... Args>
+  explicit constexpr optional(in_place_t, Args&&... args)
+  : OptionalBase<T>(in_place_t{}, detail_::constexpr_forward<Args>(args)...) {}
+
+  template <class U, class... Args, TR2_OPTIONAL_REQUIRES(std::is_constructible<T, std::initializer_list<U>>)>
+  OPTIONAL_CONSTEXPR_INIT_LIST explicit optional(in_place_t, std::initializer_list<U> il, Args&&... args)
+  : OptionalBase<T>(in_place_t{}, il, detail_::constexpr_forward<Args>(args)...) {}
+
+  // 20.5.4.2, Destructor
+  ~optional() = default;
+
+  // 20.5.4.3, assignment
+  optional& operator=(nullopt_t) __NOEXCEPT
+  {
+    clear();
+    return *this;
+  }
+
+  optional& operator=(const optional& rhs)
+  {
+    if      (initialized() == true  && rhs.initialized() == false) clear();
+    else if (initialized() == false && rhs.initialized() == true)  initialize(*rhs);
+    else if (initialized() == true  && rhs.initialized() == true)  contained_val() = *rhs;
+    return *this;
+  }
+
+  optional& operator=(optional&& rhs)
+  __NOEXCEPT_(detail_::is_nothrow_move_assignable<T>::value && detail_::is_nothrow_move_constructible<T>::value)
+  {
+    if      (initialized() == true  && rhs.initialized() == false) clear();
+    else if (initialized() == false && rhs.initialized() == true)  initialize(std::move(*rhs));
+    else if (initialized() == true  && rhs.initialized() == true)  contained_val() = std::move(*rhs);
+    return *this;
+  }
+
+  template <class U>
+  auto operator=(U&& v)
+  -> typename std::enable_if
+  <
+    std::is_same<typename std::decay<U>::type, T>::value,
+    optional&
+  >::type
+  {
+    if (initialized()) { contained_val() = std::forward<U>(v); }
+    else               { initialize(std::forward<U>(v));  }
+    return *this;
+  }
+
+
+  template <class... Args>
+  void emplace(Args&&... args)
+  {
+    clear();
+    initialize(std::forward<Args>(args)...);
+  }
+
+  template <class U, class... Args>
+  void emplace(std::initializer_list<U> il, Args&&... args)
+  {
+    clear();
+    initialize<U, Args...>(il, std::forward<Args>(args)...);
+  }
+
+  // 20.5.4.4, Swap
+  void swap(optional<T>& rhs) __NOEXCEPT_(detail_::is_nothrow_move_constructible<T>::value && __NOEXCEPT_(swap(std::declval<T&>(), std::declval<T&>())))
+  {
+    if      (initialized() == true  && rhs.initialized() == false) { rhs.initialize(std::move(**this)); clear(); }
+    else if (initialized() == false && rhs.initialized() == true)  { initialize(std::move(*rhs)); rhs.clear(); }
+    else if (initialized() == true  && rhs.initialized() == true)  { using std::swap; swap(**this, *rhs); }
+  }
+
+  // 20.5.4.5, Observers
+
+  explicit constexpr operator bool() const __NOEXCEPT { return initialized(); }
+
+  constexpr T const* operator ->() const {
+    return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), dataptr());
+  }
+
+# if OPTIONAL_HAS_MOVE_ACCESSORS == 1
+
+  OPTIONAL_MUTABLE_CONSTEXPR T* operator ->() {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
+    return dataptr();
+  }
+
+  constexpr T const& operator *() const& {
+    return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), contained_val());
+  }
+
+  OPTIONAL_MUTABLE_CONSTEXPR T& operator *() & {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
+    return contained_val();
+  }
+
+  OPTIONAL_MUTABLE_CONSTEXPR T&& operator *() && {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // CONSTEXPR_ASSERT(initialized());
+    return detail_::constexpr_move(contained_val());
+  }
+
+  constexpr T const& value() const& {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
+    return contained_val();
+  }
+
+  OPTIONAL_MUTABLE_CONSTEXPR T& value() & {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
+    return contained_val();
+  }
+
+  OPTIONAL_MUTABLE_CONSTEXPR T&& value() && {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // if (!initialized()) __THROW_EXCEPTION(bad_optional_access("bad optional access"));
+    return std::move(contained_val());
+  }
+
+# else
+
+  T* operator ->() {
+    assert (initialized());
+    return dataptr();
+  }
+
+  constexpr T const& operator *() const {
+    return TR2_OPTIONAL_ASSERTED_EXPRESSION(initialized(), contained_val());
+  }
+
+  T& operator *() {
+    assert (initialized());
+    return contained_val();
+  }
+
+  constexpr T const& value() const {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
+    return contained_val();
+  }
+
+  T& value() {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
+    return contained_val();
+  }
+
+# endif
+
+# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1
+
+  template <class V>
+  constexpr T value_or(V&& v) const&
+  {
+    return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
+  }
+
+#   if OPTIONAL_HAS_MOVE_ACCESSORS == 1
+
+  template <class V>
+  OPTIONAL_MUTABLE_CONSTEXPR T value_or(V&& v) &&
+  {
+    return *this ? detail_::constexpr_move(const_cast<optional<T>&>(*this).contained_val()) : detail_::convert<T>(detail_::constexpr_forward<V>(v));
+  }
+
+#   else
+
+  template <class V>
+  T value_or(V&& v) &&
+  {
+    return *this ? detail_::constexpr_move(const_cast<optional<T>&>(*this).contained_val()) : detail_::convert<T>(detail_::constexpr_forward<V>(v));
+  }
+
+#   endif
+
+# else
+
+  template <class V>
+  constexpr T value_or(V&& v) const
+  {
+    return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
+  }
+
+# endif
+
+};
+
+
+template <class T>
+class optional<T&>
+{
+  static_assert( !std::is_same<T, nullopt_t>::value, "bad T" );
+  static_assert( !std::is_same<T, in_place_t>::value, "bad T" );
+  T* ref;
+
+public:
+
+  // 20.5.5.1, construction/destruction
+  constexpr optional() __NOEXCEPT : ref(nullptr) {}
+
+  constexpr optional(nullopt_t) __NOEXCEPT : ref(nullptr) {}
+
+  constexpr optional(T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {}
+
+  optional(T&&) = delete;
+
+  constexpr optional(const optional& rhs) __NOEXCEPT : ref(rhs.ref) {}
+
+  explicit constexpr optional(in_place_t, T& v) __NOEXCEPT : ref(detail_::static_addressof(v)) {}
+
+  explicit optional(in_place_t, T&&) = delete;
+
+  ~optional() = default;
+
+  // 20.5.5.2, mutation
+  optional& operator=(nullopt_t) __NOEXCEPT {
+    ref = nullptr;
+    return *this;
+  }
+
+  // optional& operator=(const optional& rhs) __NOEXCEPT {
+    // ref = rhs.ref;
+    // return *this;
+  // }
+
+  // optional& operator=(optional&& rhs) __NOEXCEPT {
+    // ref = rhs.ref;
+    // return *this;
+  // }
+
+  template <typename U>
+  auto operator=(U&& rhs) __NOEXCEPT
+  -> typename std::enable_if
+  <
+    std::is_same<typename std::decay<U>::type, optional<T&>>::value,
+    optional&
+  >::type
+  {
+    ref = rhs.ref;
+    return *this;
+  }
+
+  template <typename U>
+  auto operator=(U&& rhs) __NOEXCEPT
+  -> typename std::enable_if
+  <
+    !std::is_same<typename std::decay<U>::type, optional<T&>>::value,
+    optional&
+  >::type
+  = delete;
+
+  void emplace(T& v) __NOEXCEPT {
+    ref = detail_::static_addressof(v);
+  }
+
+  void emplace(T&&) = delete;
+
+
+  void swap(optional<T&>& rhs) __NOEXCEPT
+  {
+    std::swap(ref, rhs.ref);
+  }
+
+  // 20.5.5.3, observers
+  constexpr T* operator->() const {
+    return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, ref);
+  }
+
+  constexpr T& operator*() const {
+    return TR2_OPTIONAL_ASSERTED_EXPRESSION(ref, *ref);
+  }
+
+  constexpr T& value() const {
+    // FIXME: We need to offer special assert function that can be used under the contexpr context.
+    // return ref ? *ref : (throw bad_optional_access("bad optional access"), *ref);
+    return *ref;
+  }
+
+  explicit constexpr operator bool() const __NOEXCEPT {
+    return ref != nullptr;
+  }
+
+  template <class V>
+  constexpr typename std::decay<T>::type value_or(V&& v) const
+  {
+    return *this ? **this : detail_::convert<typename std::decay<T>::type>(detail_::constexpr_forward<V>(v));
+  }
+};
+
+
+template <class T>
+class optional<T&&>
+{
+  static_assert( sizeof(T) == 0, "optional rvalue references disallowed" );
+};
+
+
+// 20.5.8, Relational operators
+template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y)
+{
+  return bool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y;
+}
+
+template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y)
+{
+  return !(x == y);
+}
+
+template <class T> constexpr bool operator<(const optional<T>& x, const optional<T>& y)
+{
+  return (!y) ? false : (!x) ? true : *x < *y;
+}
+
+template <class T> constexpr bool operator>(const optional<T>& x, const optional<T>& y)
+{
+  return (y < x);
+}
+
+template <class T> constexpr bool operator<=(const optional<T>& x, const optional<T>& y)
+{
+  return !(y < x);
+}
+
+template <class T> constexpr bool operator>=(const optional<T>& x, const optional<T>& y)
+{
+  return !(x < y);
+}
+
+
+// 20.5.9, Comparison with nullopt
+template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) __NOEXCEPT
+{
+  return (!x);
+}
+
+template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) __NOEXCEPT
+{
+  return (!x);
+}
+
+template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) __NOEXCEPT
+{
+  return bool(x);
+}
+
+template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) __NOEXCEPT
+{
+  return bool(x);
+}
+
+template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) __NOEXCEPT
+{
+  return false;
+}
+
+template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) __NOEXCEPT
+{
+  return bool(x);
+}
+
+template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) __NOEXCEPT
+{
+  return (!x);
+}
+
+template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) __NOEXCEPT
+{
+  return true;
+}
+
+template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) __NOEXCEPT
+{
+  return bool(x);
+}
+
+template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) __NOEXCEPT
+{
+  return false;
+}
+
+template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) __NOEXCEPT
+{
+  return true;
+}
+
+template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) __NOEXCEPT
+{
+  return (!x);
+}
+
+
+
+// 20.5.10, Comparison with T
+template <class T> constexpr bool operator==(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x == v : false;
+}
+
+template <class T> constexpr bool operator==(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v == *x : false;
+}
+
+template <class T> constexpr bool operator!=(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x != v : true;
+}
+
+template <class T> constexpr bool operator!=(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v != *x : true;
+}
+
+template <class T> constexpr bool operator<(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x < v : true;
+}
+
+template <class T> constexpr bool operator>(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v > *x : true;
+}
+
+template <class T> constexpr bool operator>(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x > v : false;
+}
+
+template <class T> constexpr bool operator<(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v < *x : false;
+}
+
+template <class T> constexpr bool operator>=(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x >= v : false;
+}
+
+template <class T> constexpr bool operator<=(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v <= *x : false;
+}
+
+template <class T> constexpr bool operator<=(const optional<T>& x, const T& v)
+{
+  return bool(x) ? *x <= v : true;
+}
+
+template <class T> constexpr bool operator>=(const T& v, const optional<T>& x)
+{
+  return bool(x) ? v >= *x : true;
+}
+
+
+// Comparison of optional<T&> with T
+template <class T> constexpr bool operator==(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x == v : false;
+}
+
+template <class T> constexpr bool operator==(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v == *x : false;
+}
+
+template <class T> constexpr bool operator!=(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x != v : true;
+}
+
+template <class T> constexpr bool operator!=(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v != *x : true;
+}
+
+template <class T> constexpr bool operator<(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x < v : true;
+}
+
+template <class T> constexpr bool operator>(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v > *x : true;
+}
+
+template <class T> constexpr bool operator>(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x > v : false;
+}
+
+template <class T> constexpr bool operator<(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v < *x : false;
+}
+
+template <class T> constexpr bool operator>=(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x >= v : false;
+}
+
+template <class T> constexpr bool operator<=(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v <= *x : false;
+}
+
+template <class T> constexpr bool operator<=(const optional<T&>& x, const T& v)
+{
+  return bool(x) ? *x <= v : true;
+}
+
+template <class T> constexpr bool operator>=(const T& v, const optional<T&>& x)
+{
+  return bool(x) ? v >= *x : true;
+}
+
+// Comparison of optional<T const&> with T
+template <class T> constexpr bool operator==(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x == v : false;
+}
+
+template <class T> constexpr bool operator==(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v == *x : false;
+}
+
+template <class T> constexpr bool operator!=(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x != v : true;
+}
+
+template <class T> constexpr bool operator!=(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v != *x : true;
+}
+
+template <class T> constexpr bool operator<(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x < v : true;
+}
+
+template <class T> constexpr bool operator>(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v > *x : true;
+}
+
+template <class T> constexpr bool operator>(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x > v : false;
+}
+
+template <class T> constexpr bool operator<(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v < *x : false;
+}
+
+template <class T> constexpr bool operator>=(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x >= v : false;
+}
+
+template <class T> constexpr bool operator<=(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v <= *x : false;
+}
+
+template <class T> constexpr bool operator<=(const optional<const T&>& x, const T& v)
+{
+  return bool(x) ? *x <= v : true;
+}
+
+template <class T> constexpr bool operator>=(const T& v, const optional<const T&>& x)
+{
+  return bool(x) ? v >= *x : true;
+}
+
+
+// 20.5.12, Specialized algorithms
+template <class T>
+void swap(optional<T>& x, optional<T>& y) __NOEXCEPT_(__NOEXCEPT_(x.swap(y)))
+{
+  x.swap(y);
+}
+
+
+template <class T>
+constexpr optional<typename std::decay<T>::type> make_optional(T&& v)
+{
+  return optional<typename std::decay<T>::type>(detail_::constexpr_forward<T>(v));
+}
+
+template <class X>
+constexpr optional<X&> make_optional(std::reference_wrapper<X> v)
+{
+  return optional<X&>(v.get());
+}
+
+} // namespace std
 
 namespace WTF {
 
-struct InPlaceTag { };
-constexpr InPlaceTag InPlace { };
-
-struct NulloptTag { explicit constexpr NulloptTag(int) { } };
-constexpr NulloptTag Nullopt { 0 };
-
-template<typename T>
-class Optional {
-public:
-    Optional()
-        : m_isEngaged(false)
-    {
-    }
-
-    Optional(NulloptTag)
-        : m_isEngaged(false)
-    {
-    }
-
-    Optional(const T& value)
-        : m_isEngaged(true)
-    {
-        new (NotNull, &m_value) T(value);
-    }
-
-    Optional(const Optional& other)
-        : m_isEngaged(other.m_isEngaged)
-    {
-        if (m_isEngaged)
-            new (NotNull, &m_value) T(*other.asPtr());
-    }
-
-    Optional(Optional&& other)
-        : m_isEngaged(other.m_isEngaged)
-    {
-        if (m_isEngaged)
-            new (NotNull, &m_value) T(WTFMove(*other.asPtr()));
-    }
-
-    Optional(T&& value)
-        : m_isEngaged(true)
-    {
-        new (NotNull, &m_value) T(WTFMove(value));
-    }
-
-    template<typename... Args>
-    Optional(InPlaceTag, Args&&... args)
-        : m_isEngaged(true)
-    {
-        new (NotNull, &m_value) T(std::forward<Args>(args)...);
-    }
-
-    ~Optional()
-    {
-        destroy();
-    }
-
-    Optional& operator=(NulloptTag)
-    {
-        destroy();
-        return *this;
-    }
-
-    Optional& operator=(const Optional& other)
-    {
-        if (this == &other)
-            return *this;
-
-        destroy();
-        if (other.m_isEngaged) {
-            new (NotNull, &m_value) T(*other.asPtr());
-            m_isEngaged = true;
-        }
-        return *this;
-    }
-
-    Optional& operator=(Optional&& other)
-    {
-        if (this == &other)
-            return *this;
-
-        destroy();
-        if (other.m_isEngaged) {
-            new (NotNull, &m_value) T(WTFMove(*other.asPtr()));
-            m_isEngaged = true;
-        }
-        return *this;
-    }
-
-    template<typename U, class = typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, T>::value>::type>
-    Optional& operator=(U&& u)
-    {
-        destroy();
-        new (NotNull, &m_value) T(std::forward<U>(u));
-        m_isEngaged = true;
-        return *this;
-    }
-
-    explicit operator bool() const { return m_isEngaged; }
-
-    const T* operator->() const
-    {
-        ASSERT(m_isEngaged);
-        return asPtr();
-    }
-
-    T* operator->()
-    {
-        ASSERT(m_isEngaged);
-        return asPtr();
-    }
-
-    const T& operator*() const { return value(); }
-    T& operator*() { return value(); }
-
-    T& value()
-    {
-        ASSERT(m_isEngaged);
-        return *asPtr();
-    }
-
-    const T& value() const
-    {
-        ASSERT(m_isEngaged);
-        return *asPtr();
-    }
-
-    template<typename U>
-    T valueOr(U&& value) const
-    {
-        if (m_isEngaged)
-            return *asPtr();
-
-        return std::forward<U>(value);
-    }
-
-    template<typename U>
-    T valueOrCompute(U callback) const
-    {
-        if (m_isEngaged)
-            return *asPtr();
-
-        return callback();
-    }
-
-private:
-    const T* asPtr() const { return reinterpret_cast<const T*>(&m_value); }
-    T* asPtr() { return reinterpret_cast<T*>(&m_value); }
-    void destroy()
-    {
-        if (m_isEngaged) {
-            asPtr()->~T();
-            m_isEngaged = false;
-        }
-    }
-
-    bool m_isEngaged;
-    typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type m_value;
-};
-
-template<typename T>
-constexpr bool operator==(const Optional<T>& lhs, const Optional<T>& rhs)
-{
-    return static_cast<bool>(lhs) == static_cast<bool>(rhs) && (!static_cast<bool>(lhs) || lhs.value() == rhs.value());
-}
-
-template<typename T>
-constexpr bool operator!=(const Optional<T>& lhs, const Optional<T>& rhs)
-{
-    return !(lhs == rhs);
-}
-
-template<typename T>
-constexpr bool operator==(const Optional<T>& opt, NulloptTag)
-{
-    return !opt;
-}
-
-template<typename T>
-constexpr bool operator!=(const Optional<T>& opt, NulloptTag)
-{
-    return static_cast<bool>(opt);
-}
-
-template<typename T>
-constexpr bool operator==(NulloptTag, const Optional<T>& opt)
-{
-    return !opt;
-}
-
-template<typename T>
-constexpr bool operator!=(NulloptTag, const Optional<T>& opt)
-{
-    return static_cast<bool>(opt);
-}
-
-template<typename T>
-constexpr bool operator==(const Optional<T>& opt, const T& value)
-{
-    return opt && opt.value() == value;
-}
-
-template<typename T>
-constexpr bool operator!=(const Optional<T>& opt, const T& value)
-{
-    return !(opt == value);
-}
-
-template<typename T>
-constexpr bool operator==(const T& value, const Optional<T>& opt)
-{
-    return opt && opt.value() == value;
-}
-
-template<typename T>
-constexpr bool operator!=(const T& value, const Optional<T>& opt)
-{
-    return !(value == opt);
-}
-
-template<typename T>
-Optional<typename std::decay<T>::type>
-makeOptional(T&& value)
-{
-    return Optional<typename std::decay<T>::type>(std::forward<T>(value));
-}
-
-template<typename T>
-void printInternal(PrintStream& out, const Optional<T>& optional)
+// -- WebKit Additions --
+template <class OptionalType, class Callback>
+ALWAYS_INLINE
+auto valueOrCompute(OptionalType optional, Callback callback) -> typename OptionalType::value_type
 {
     if (optional)
-        out.print(*optional);
-    else
-        out.print("Nullopt");
+        return *optional;
+    return callback();
 }
 
 } // namespace WTF
 
-using WTF::InPlace;
-using WTF::Nullopt;
-using WTF::Optional;
-using WTF::makeOptional;
+namespace std
+{
+  template <typename T>
+  struct hash<std::optional<T>>
+  {
+    typedef typename hash<T>::result_type result_type;
+    typedef std::optional<T> argument_type;
 
-#endif // Optional_h
+    constexpr result_type operator()(argument_type const& arg) const {
+      return arg ? std::hash<T>{}(*arg) : result_type{};
+    }
+  };
+
+  template <typename T>
+  struct hash<std::optional<T&>>
+  {
+    typedef typename hash<T>::result_type result_type;
+    typedef std::optional<T&> argument_type;
+
+    constexpr result_type operator()(argument_type const& arg) const {
+      return arg ? std::hash<T>{}(*arg) : result_type{};
+    }
+  };
+}
+
+# undef TR2_OPTIONAL_REQUIRES
+# undef TR2_OPTIONAL_ASSERTED_EXPRESSION
+
+using WTF::valueOrCompute;
diff --git a/Source/WTF/wtf/text/StringView.cpp b/Source/WTF/wtf/text/StringView.cpp
index cfd2aa3..5965d69 100644
--- a/Source/WTF/wtf/text/StringView.cpp
+++ b/Source/WTF/wtf/text/StringView.cpp
@@ -95,7 +95,7 @@
 
 class StringView::GraphemeClusters::Iterator::Impl {
 public:
-    Impl(const StringView& stringView, Optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index)
+    Impl(const StringView& stringView, std::optional<NonSharedCharacterBreakIterator>&& iterator, unsigned index)
         : m_stringView(stringView)
         , m_iterator(WTFMove(iterator))
         , m_index(index)
@@ -136,7 +136,7 @@
 
 private:
     const StringView& m_stringView;
-    Optional<NonSharedCharacterBreakIterator> m_iterator;
+    std::optional<NonSharedCharacterBreakIterator> m_iterator;
     unsigned m_index;
     unsigned m_indexEnd;
 };
@@ -157,7 +157,7 @@
 }
 
 StringView::GraphemeClusters::Iterator::Iterator(const StringView& stringView, unsigned index)
-    : m_impl(std::make_unique<Impl>(stringView, stringView.isNull() ? Nullopt : Optional<NonSharedCharacterBreakIterator>(NonSharedCharacterBreakIterator(stringView)), index))
+    : m_impl(std::make_unique<Impl>(stringView, stringView.isNull() ? std::nullopt : std::optional<NonSharedCharacterBreakIterator>(NonSharedCharacterBreakIterator(stringView)), index))
 {
 }
 
diff --git a/Source/WTF/wtf/text/StringView.h b/Source/WTF/wtf/text/StringView.h
index b545e96..a6945a5 100644
--- a/Source/WTF/wtf/text/StringView.h
+++ b/Source/WTF/wtf/text/StringView.h
@@ -673,7 +673,7 @@
 
 private:
     std::reference_wrapper<const StringView> m_stringView;
-    Optional<unsigned> m_nextCodePointOffset;
+    std::optional<unsigned> m_nextCodePointOffset;
     UChar32 m_codePoint;
 };
 
@@ -738,7 +738,7 @@
 {
     ASSERT(m_nextCodePointOffset);
     if (m_nextCodePointOffset.value() == m_stringView.get().length()) {
-        m_nextCodePointOffset = Nullopt;
+        m_nextCodePointOffset = std::nullopt;
         return *this;
     }
     if (m_stringView.get().is8Bit())
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 3096115..64aa41e 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,1144 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        Rename valueOr to value_or. This is specified in C++17 proposal.
+
+        Use Optional::emplace. C++17 Optional::operator=(Optional&&) requires
+        either copy assignment operator or move assignment operator. But
+        DFG::JSValueOperand etc. only defines move constructors and drop
+        implicit copy assignment operators.
+
+        It was OK in the previous WTF::Optional since it always uses move
+        constructors. But it is not valid in C++17 Optional. We use Optional::emplace
+        instead. This function has the same semantics to the previous WTF::Optional's
+        operator=.
+
+        No behavior change.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::parseAmount):
+        (WebCore::createContactFields):
+        (WebCore::toLineItemType):
+        (WebCore::createLineItem):
+        (WebCore::createLineItems):
+        (WebCore::createMerchantCapabilities):
+        (WebCore::createSupportedNetworks):
+        (WebCore::toShippingType):
+        (WebCore::createShippingMethod):
+        (WebCore::createShippingMethods):
+        (WebCore::createPaymentRequest):
+        (WebCore::toPaymentAuthorizationStatus):
+        * Modules/applepay/PaymentContact.h:
+        * Modules/applepay/PaymentCoordinator.cpp:
+        (WebCore::PaymentCoordinator::completeShippingMethodSelection):
+        (WebCore::PaymentCoordinator::completeShippingContactSelection):
+        (WebCore::PaymentCoordinator::completePaymentMethodSelection):
+        * Modules/applepay/PaymentCoordinator.h:
+        * Modules/applepay/PaymentCoordinatorClient.h:
+        * Modules/applepay/PaymentMerchantSession.h:
+        * Modules/applepay/PaymentRequest.h:
+        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
+        (WebCore::PaymentContact::fromJS):
+        * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
+        (WebCore::PaymentMerchantSession::fromJS):
+        * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
+        (WebCore::MediaKeyStatusMap::Iterator::next):
+        * Modules/encryptedmedia/MediaKeyStatusMap.h:
+        * Modules/fetch/FetchBody.cpp:
+        (WebCore::FetchBody::extract):
+        * Modules/fetch/FetchBody.h:
+        * Modules/fetch/FetchBodyOwner.cpp:
+        (WebCore::FetchBodyOwner::FetchBodyOwner):
+        (WebCore::FetchBodyOwner::loadBlob):
+        (WebCore::FetchBodyOwner::finishBlobLoading):
+        * Modules/fetch/FetchBodyOwner.h:
+        * Modules/fetch/FetchHeaders.cpp:
+        (WebCore::FetchHeaders::Iterator::next):
+        * Modules/fetch/FetchHeaders.h:
+        * Modules/fetch/FetchRequest.cpp:
+        (WebCore::setReferrerPolicy):
+        (WebCore::setMode):
+        (WebCore::setCredentials):
+        (WebCore::setCache):
+        (WebCore::setRedirect):
+        (WebCore::setMethod):
+        (WebCore::setReferrer):
+        (WebCore::buildOptions):
+        (WebCore::FetchRequest::clone):
+        * Modules/fetch/FetchRequest.h:
+        (WebCore::FetchRequest::FetchRequest):
+        * Modules/fetch/FetchResponse.cpp:
+        (WebCore::FetchResponse::FetchResponse):
+        (WebCore::FetchResponse::cloneForJS):
+        (WebCore::FetchResponse::fetch):
+        (WebCore::FetchResponse::BodyLoader::didSucceed):
+        (WebCore::FetchResponse::BodyLoader::didFail):
+        (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
+        (WebCore::FetchResponse::BodyLoader::stop):
+        * Modules/fetch/FetchResponse.h:
+        * Modules/geolocation/Coordinates.cpp:
+        (WebCore::Coordinates::altitude):
+        (WebCore::Coordinates::altitudeAccuracy):
+        (WebCore::Coordinates::heading):
+        (WebCore::Coordinates::speed):
+        * Modules/geolocation/Coordinates.h:
+        * Modules/indexeddb/IDBCursor.cpp:
+        (WebCore::IDBCursor::stringToDirection):
+        * Modules/indexeddb/IDBCursor.h:
+        * Modules/indexeddb/IDBDatabase.h:
+        * Modules/indexeddb/IDBDatabaseIdentifier.h:
+        (WebCore::IDBDatabaseIdentifier::hash):
+        * Modules/indexeddb/IDBFactory.cpp:
+        (WebCore::IDBFactory::open):
+        * Modules/indexeddb/IDBFactory.h:
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::getAll):
+        (WebCore::IDBIndex::getAllKeys):
+        * Modules/indexeddb/IDBIndex.h:
+        * Modules/indexeddb/IDBKeyPath.h:
+        (WebCore::isolatedCopy):
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::keyPath):
+        (WebCore::IDBObjectStore::getAll):
+        (WebCore::IDBObjectStore::getAllKeys):
+        * Modules/indexeddb/IDBObjectStore.h:
+        * Modules/indexeddb/IDBTransaction.cpp:
+        (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
+        (WebCore::IDBTransaction::requestGetAllIndexRecords):
+        * Modules/indexeddb/IDBTransaction.h:
+        * Modules/indexeddb/IDBVersionChangeEvent.cpp:
+        (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
+        * Modules/indexeddb/IDBVersionChangeEvent.h:
+        * Modules/indexeddb/server/IDBSerialization.cpp:
+        (WebCore::serializeIDBKeyPath):
+        (WebCore::deserializeIDBKeyPath):
+        * Modules/indexeddb/server/IDBSerialization.h:
+        * Modules/indexeddb/server/MemoryIndex.cpp:
+        (WebCore::IDBServer::MemoryIndex::getAllRecords):
+        * Modules/indexeddb/server/MemoryIndex.h:
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::getAllRecords):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+        * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
+        (WebCore::IDBServer::MemoryObjectStoreCursor::objectStoreCleared):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::keyDeleted):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
+        (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
+        * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
+        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
+        (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
+        * Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
+        (WebCore::IDBDatabaseInfo::createNewObjectStore):
+        * Modules/indexeddb/shared/IDBDatabaseInfo.h:
+        * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
+        (WebCore::IDBObjectStoreInfo::IDBObjectStoreInfo):
+        * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
+        (WebCore::IDBObjectStoreInfo::keyPath):
+        * Modules/mediacontrols/MediaControlsHost.cpp:
+        (WebCore::MediaControlsHost::displayNameForTrack):
+        * Modules/mediacontrols/MediaControlsHost.h:
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::endOfStream):
+        (WebCore::MediaSource::streamEndedWithError):
+        * Modules/mediasource/MediaSource.h:
+        * Modules/mediastream/MediaStreamTrack.h:
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        (WebCore::PeerConnectionBackend::createOfferSucceeded):
+        (WebCore::PeerConnectionBackend::createOfferFailed):
+        (WebCore::PeerConnectionBackend::createAnswerSucceeded):
+        (WebCore::PeerConnectionBackend::createAnswerFailed):
+        (WebCore::PeerConnectionBackend::setLocalDescriptionSucceeded):
+        (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
+        (WebCore::PeerConnectionBackend::setRemoteDescriptionSucceeded):
+        (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
+        (WebCore::PeerConnectionBackend::addIceCandidateSucceeded):
+        (WebCore::PeerConnectionBackend::addIceCandidateFailed):
+        (WebCore::PeerConnectionBackend::stop):
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::insertDTMF):
+        * Modules/mediastream/RTCDTMFSender.h:
+        * Modules/mediastream/RTCIceCandidate.cpp:
+        (WebCore::RTCIceCandidate::create):
+        (WebCore::RTCIceCandidate::RTCIceCandidate):
+        * Modules/mediastream/RTCIceCandidate.h:
+        (WebCore::RTCIceCandidate::sdpMLineIndex):
+        * Modules/mediastream/SDPProcessor.cpp:
+        (WebCore::iceCandidateFromJSON):
+        * Modules/proximity/DeviceProximityEvent.h:
+        * Modules/streams/ReadableStreamSource.h:
+        (WebCore::ReadableStreamSource::startFinished):
+        (WebCore::ReadableStreamSource::pullFinished):
+        (WebCore::ReadableStreamSource::clean):
+        * Modules/webaudio/AudioBufferSourceNode.cpp:
+        (WebCore::AudioBufferSourceNode::start):
+        * Modules/webaudio/AudioBufferSourceNode.h:
+        * Modules/webdatabase/SQLResultSet.h:
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::close):
+        * Modules/websockets/WebSocket.h:
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didReceiveSocketStreamData):
+        * Modules/websockets/WebSocketChannel.h:
+        * bindings/generic/IDLTypes.h:
+        (WebCore::IDLType::nullValue):
+        * bindings/js/CachedModuleScript.h:
+        (WebCore::CachedModuleScript::error):
+        * bindings/js/Dictionary.h:
+        (WebCore::Dictionary::get):
+        * bindings/js/IDBBindingUtilities.cpp:
+        (WebCore::toJS):
+        * bindings/js/IDBBindingUtilities.h:
+        * bindings/js/JSCryptoKeySerializationJWK.cpp:
+        (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
+        * bindings/js/JSCryptoKeySerializationJWK.h:
+        * bindings/js/JSDOMConvert.h:
+        (WebCore::Detail::VariadicConverterBase::convert):
+        (WebCore::Detail::VariadicConverterBase<IDLInterface<T>>::convert):
+        (WebCore::convertVariadicArguments):
+        * bindings/js/JSDOMIterator.h:
+        (WebCore::IteratorTraits>::next):
+        * bindings/js/JSDOMPromise.h:
+        (WebCore::DOMPromise::DOMPromise):
+        (WebCore::DOMPromise::operator=):
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        * bindings/js/JSDictionary.h:
+        (WebCore::JSDictionary::convertValue):
+        * bindings/js/JSFileCustom.cpp:
+        (WebCore::constructJSFile):
+        * bindings/js/JSHTMLAllCollectionCustom.cpp:
+        (WebCore::callHTMLAllCollection):
+        (WebCore::JSHTMLAllCollection::item):
+        * bindings/js/JSHTMLCanvasElementCustom.cpp:
+        (WebCore::JSHTMLCanvasElement::toDataURL):
+        * bindings/js/JSImageConstructor.cpp:
+        (WebCore::JSImageConstructor::construct):
+        * bindings/js/JSMediaDevicesCustom.cpp:
+        (WebCore::createStringConstraint):
+        (WebCore::createBooleanConstraint):
+        (WebCore::createDoubleConstraint):
+        (WebCore::createIntConstraint):
+        * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
+        (WebCore::importKey):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::setupModuleScriptHandlers):
+        (WebCore::ScriptController::executeScriptInWorld):
+        (WebCore::ScriptController::executeScript):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateGetOwnPropertySlotBody):
+        (GenerateEnumerationImplementationContent):
+        (GenerateEnumerationHeaderContent):
+        (GenerateDefaultValue):
+        (GenerateImplementation):
+        (GenerateParametersCheck):
+        * bindings/scripts/test/JS/JSFloat64Array.cpp:
+        (WebCore::JSFloat64Array::getOwnPropertySlot):
+        (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
+        (WebCore::JSFloat64Array::put):
+        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
+        (WebCore::JSTestEventTarget::getOwnPropertySlot):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::parseEnumeration<TestObj::EnumType>):
+        (WebCore::parseEnumeration<TestObj::Optional>):
+        (WebCore::parseEnumeration<AlternateEnumName>):
+        (WebCore::parseEnumeration<TestObj::EnumA>):
+        (WebCore::parseEnumeration<TestObj::EnumB>):
+        (WebCore::parseEnumeration<TestObj::EnumC>):
+        (WebCore::parseEnumeration<TestObj::Kind>):
+        (WebCore::parseEnumeration<TestObj::Size>):
+        (WebCore::parseEnumeration<TestObj::Confidence>):
+        (WebCore::convertDictionary<TestObj::Dictionary>):
+        (WebCore::JSTestObj::getOwnPropertySlot):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArgCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgsCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanCaller):
+        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalRecordCaller):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2Caller):
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2Caller):
+        (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
+        (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentCaller):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
+        (WebCore::parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>):
+        * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
+        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp:
+        (WebCore::parseEnumeration<TestStandaloneEnumeration>):
+        * bindings/scripts/test/JS/JSTestStandaloneEnumeration.h:
+        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
+        (WebCore::jsTestTypedefsPrototypeFunctionSetShadowCaller):
+        (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClampCaller):
+        * bridge/runtime_array.cpp:
+        (JSC::RuntimeArray::getOwnPropertySlot):
+        (JSC::RuntimeArray::put):
+        * crypto/CryptoAlgorithmRegistry.cpp:
+        (WebCore::CryptoAlgorithmRegistry::identifier):
+        * crypto/CryptoAlgorithmRegistry.h:
+        * crypto/CryptoKeySerialization.h:
+        * crypto/JsonWebKey.h:
+        * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
+        (WebCore::CryptoAlgorithmAES_CBC::importKey):
+        * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
+        (WebCore::CryptoAlgorithmAES_KW::importKey):
+        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
+        (WebCore::CryptoAlgorithmHMAC::generateKey):
+        (WebCore::CryptoAlgorithmHMAC::importKey):
+        * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
+        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
+        * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
+        (WebCore::calculateSignature):
+        * crypto/keys/CryptoKeyAES.h:
+        * crypto/keys/CryptoKeyHMAC.h:
+        * crypto/keys/CryptoKeyRSA.cpp:
+        (WebCore::CryptoKeyRSA::importJwk):
+        * crypto/keys/CryptoKeyRSA.h:
+        * crypto/keys/CryptoKeySerializationRaw.cpp:
+        (WebCore::CryptoKeySerializationRaw::reconcileAlgorithm):
+        * crypto/keys/CryptoKeySerializationRaw.h:
+        * crypto/mac/CryptoAlgorithmHMACMac.cpp:
+        (WebCore::commonCryptoHMACAlgorithm):
+        * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
+        (WebCore::cryptoDigestAlgorithm):
+        * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
+        * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
+        * css/CSSFontFace.cpp:
+        (WebCore::CSSFontFace::calculateStyleMask):
+        (WebCore::CSSFontFace::calculateWeightMask):
+        * css/CSSFontFace.h:
+        * css/CSSFontFaceSet.cpp:
+        (WebCore::computeFontTraitsMask):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::doubleValue):
+        (WebCore::CSSPrimitiveValue::doubleValueInternal):
+        * css/CSSPrimitiveValue.h:
+        * css/CSSPropertyNames.in:
+        * css/CSSSegmentedFontFace.cpp:
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::create):
+        (WebCore::CSSStyleSheet::CSSStyleSheet):
+        (WebCore::CSSStyleSheet::addRule):
+        * css/CSSStyleSheet.h:
+        * css/FontFace.cpp:
+        (WebCore::FontFace::fontStateChanged):
+        * css/FontFace.h:
+        * css/FontFaceSet.cpp:
+        (WebCore::FontFaceSet::completedLoading):
+        * css/FontFaceSet.h:
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::doubleValue):
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertGridPosition):
+        (WebCore::StyleBuilderConverter::convertWordSpacing):
+        (WebCore::StyleBuilderConverter::convertPerspective):
+        (WebCore::StyleBuilderConverter::convertMarqueeIncrement):
+        (WebCore::StyleBuilderConverter::convertFilterOperations):
+        (WebCore::StyleBuilderConverter::convertLineHeight):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueLineHeight):
+        * css/StyleRuleImport.cpp:
+        (WebCore::StyleRuleImport::requestStyleSheet):
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseCubicBezierTimingFunctionValue):
+        (WebCore::CSSParser::parseSpringTimingFunctionValue):
+        (WebCore::CSSParser::parseColorFunctionParameters):
+        (WebCore::CSSParser::parseColorFromValue):
+        * css/parser/CSSParser.h:
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle):
+        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
+        * dom/CustomElementReactionQueue.cpp:
+        * dom/Document.cpp:
+        (WebCore::Document::lastModified):
+        * dom/Element.cpp:
+        (WebCore::Element::scrollBy):
+        (WebCore::Element::getIntegralAttribute):
+        (WebCore::Element::getUnsignedIntegralAttribute):
+        (WebCore::Element::resolveCustomStyle):
+        * dom/Element.h:
+        * dom/ElementIteratorAssertions.h:
+        (WebCore::ElementIteratorAssertions::dropEventDispatchAssertion):
+        (WebCore::ElementIteratorAssertions::clear):
+        * dom/ExceptionOr.h:
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::makeInlineStyleSheetCacheKey):
+        * dom/KeyboardEvent.h:
+        * dom/LoadableClassicScript.cpp:
+        (WebCore::LoadableClassicScript::error):
+        * dom/LoadableClassicScript.h:
+        * dom/LoadableModuleScript.cpp:
+        (WebCore::LoadableModuleScript::error):
+        * dom/LoadableModuleScript.h:
+        * dom/LoadableScript.h:
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::MessageEvent):
+        (WebCore::MessageEvent::create):
+        (WebCore::MessageEvent::initMessageEvent):
+        * dom/MessageEvent.h:
+        * dom/MutationObserver.cpp:
+        (WebCore::MutationObserver::observe):
+        * dom/MutationObserver.h:
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        * dom/PseudoElement.cpp:
+        (WebCore::PseudoElement::resolveCustomStyle):
+        * dom/PseudoElement.h:
+        * dom/RangeBoundaryPoint.h:
+        (WebCore::RangeBoundaryPoint::setToBeforeChild):
+        (WebCore::RangeBoundaryPoint::setToAfterChild):
+        (WebCore::RangeBoundaryPoint::setToEndOfNode):
+        (WebCore::RangeBoundaryPoint::invalidateOffset):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::determineScriptType):
+        (WebCore::ScriptElement::prepareScript):
+        (WebCore::ScriptElement::executeScriptAndDispatchEvent):
+        * dom/ScriptElement.h:
+        * dom/TextDecoder.cpp:
+        (WebCore::TextDecoder::decode):
+        * dom/TextDecoder.h:
+        * dom/UserGestureIndicator.cpp:
+        (WebCore::UserGestureIndicator::UserGestureIndicator):
+        * dom/UserGestureIndicator.h:
+        * editing/CompositeEditCommand.cpp:
+        (WebCore::CompositeEditCommand::moveParagraphs):
+        * editing/CompositeEditCommand.h:
+        * fileapi/File.h:
+        * history/CachedFrame.h:
+        (WebCore::CachedFrame::hasInsecureContent):
+        * html/DOMTokenList.cpp:
+        (WebCore::DOMTokenList::toggle):
+        * html/DOMTokenList.h:
+        * html/HTMLAnchorElement.cpp:
+        (WebCore::HTMLAnchorElement::handleClick):
+        * html/HTMLCanvasElement.cpp:
+        (WebCore::HTMLCanvasElement::toDataURL):
+        * html/HTMLCanvasElement.h:
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::parseBorderWidthAttribute):
+        (WebCore::HTMLElement::parseAttribute):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::createForJSConstructor):
+        (WebCore::HTMLImageElement::width):
+        (WebCore::HTMLImageElement::height):
+        * html/HTMLImageElement.h:
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::findClosestTickMarkValue):
+        (WebCore::HTMLInputElement::maxLengthAttributeChanged):
+        (WebCore::HTMLInputElement::minLengthAttributeChanged):
+        * html/HTMLInputElement.h:
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::process):
+        (WebCore::HTMLLinkElement::initializeStyleSheet):
+        (WebCore::HTMLLinkElement::iconType):
+        * html/HTMLLinkElement.h:
+        * html/HTMLOListElement.h:
+        * html/HTMLOptionsCollection.cpp:
+        (WebCore::HTMLOptionsCollection::add):
+        * html/HTMLOptionsCollection.h:
+        * html/HTMLSelectElement.cpp:
+        (WebCore::HTMLSelectElement::add):
+        (WebCore::HTMLSelectElement::setLength):
+        * html/HTMLSelectElement.h:
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::maxLengthAttributeChanged):
+        (WebCore::HTMLTextAreaElement::minLengthAttributeChanged):
+        * html/ImageInputType.cpp:
+        (WebCore::ImageInputType::height):
+        (WebCore::ImageInputType::width):
+        * html/InputType.cpp:
+        (WebCore::InputType::findClosestTickMarkValue):
+        * html/InputType.h:
+        * html/LinkIconCollector.cpp:
+        * html/LinkRelAttribute.h:
+        * html/RangeInputType.cpp:
+        (WebCore::RangeInputType::findClosestTickMarkValue):
+        * html/RangeInputType.h:
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::restore):
+        (WebCore::CanvasRenderingContext2D::setStrokeColor):
+        (WebCore::CanvasRenderingContext2D::setFillColor):
+        (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
+        (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
+        (WebCore::CanvasRenderingContext2D::setShadow):
+        (WebCore::CanvasRenderingContext2D::fillText):
+        (WebCore::CanvasRenderingContext2D::strokeText):
+        (WebCore::CanvasRenderingContext2D::drawTextInternal):
+        * html/canvas/CanvasRenderingContext2D.h:
+        * html/canvas/WebGL2RenderingContext.cpp:
+        (WebCore::arrayBufferViewElementSize):
+        * html/canvas/WebGLRenderingContextBase.cpp:
+        (WebCore::WebGLRenderingContextBase::bufferData):
+        (WebCore::WebGLRenderingContextBase::bufferSubData):
+        (WebCore::WebGLRenderingContextBase::texSubImage2D):
+        (WebCore::WebGLRenderingContextBase::validateArrayBufferType):
+        (WebCore::WebGLRenderingContextBase::validateTexFuncData):
+        (WebCore::WebGLRenderingContextBase::texImage2D):
+        * html/canvas/WebGLRenderingContextBase.h:
+        * html/parser/HTMLConstructionSite.cpp:
+        (WebCore::HTMLConstructionSite::indexOfFirstUnopenFormattingElement):
+        (WebCore::HTMLConstructionSite::reconstructTheActiveFormattingElements):
+        * html/parser/HTMLConstructionSite.h:
+        * html/parser/HTMLParserIdioms.cpp:
+        (WebCore::parseHTMLIntegerInternal):
+        (WebCore::parseHTMLInteger):
+        (WebCore::parseHTMLNonNegativeInteger):
+        (WebCore::parseValidHTMLNonNegativeIntegerInternal):
+        (WebCore::parseValidHTMLNonNegativeInteger):
+        (WebCore::parseValidHTMLFloatingPointNumberInternal):
+        (WebCore::parseValidHTMLFloatingPointNumber):
+        (WebCore::parseHTTPRefreshInternal):
+        * html/parser/HTMLParserIdioms.h:
+        (WebCore::limitToOnlyHTMLNonNegative):
+        * html/parser/HTMLSrcsetParser.cpp:
+        (WebCore::parseDescriptors):
+        * html/shadow/SliderThumbElement.cpp:
+        (WebCore::SliderThumbElement::setPositionFromPoint):
+        (WebCore::SliderThumbElement::resolveCustomStyle):
+        (WebCore::SliderContainerElement::resolveCustomStyle):
+        * html/shadow/SliderThumbElement.h:
+        * html/shadow/TextControlInnerElements.cpp:
+        (WebCore::TextControlInnerElement::resolveCustomStyle):
+        (WebCore::TextControlInnerTextElement::resolveCustomStyle):
+        (WebCore::TextControlPlaceholderElement::resolveCustomStyle):
+        * html/shadow/TextControlInnerElements.h:
+        * html/track/TrackEvent.h:
+        * inspector/InspectorIndexedDBAgent.cpp:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyleSheet::addRule):
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::setInstruments):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::startIconLoading):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
+        (WebCore::DocumentThreadableLoader::clearResource):
+        (WebCore::DocumentThreadableLoader::preflightSuccess):
+        (WebCore::DocumentThreadableLoader::preflightFailure):
+        * loader/DocumentThreadableLoader.h:
+        * loader/EmptyClients.cpp:
+        * loader/EmptyClients.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::urlSelected):
+        (WebCore::FrameLoader::receivedFirstData):
+        (WebCore::FrameLoader::commitProvisionalLoad):
+        (WebCore::FrameLoader::open):
+        (WebCore::FrameLoader::dispatchDidCommitLoad):
+        (WebCore::FrameLoader::clearTestingOverrides):
+        * loader/FrameLoader.h:
+        * loader/FrameLoaderClient.h:
+        * loader/LinkLoader.cpp:
+        (WebCore::LinkLoader::resourceTypeFromAsAttribute):
+        (WebCore::LinkLoader::loadLink):
+        * loader/LinkLoader.h:
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::SubresourceLoader):
+        (WebCore::SubresourceLoader::didReceiveResponse):
+        (WebCore::SubresourceLoader::notifyDone):
+        * loader/SubresourceLoader.h:
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::setLoadPriority):
+        * loader/cache/CachedResource.h:
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::CachedResourceRequest::CachedResourceRequest):
+        * loader/cache/CachedResourceRequest.h:
+        (WebCore::CachedResourceRequest::priority):
+        * mathml/MathMLElement.h:
+        (WebCore::MathMLElement::specifiedDisplayStyle):
+        (WebCore::MathMLElement::specifiedMathVariant):
+        * mathml/MathMLFractionElement.cpp:
+        (WebCore::MathMLFractionElement::cachedFractionAlignment):
+        (WebCore::MathMLFractionElement::parseAttribute):
+        * mathml/MathMLFractionElement.h:
+        * mathml/MathMLMathElement.cpp:
+        (WebCore::MathMLMathElement::specifiedDisplayStyle):
+        (WebCore::MathMLMathElement::parseAttribute):
+        * mathml/MathMLMathElement.h:
+        * mathml/MathMLMencloseElement.cpp:
+        (WebCore::MathMLMencloseElement::parseAttribute):
+        * mathml/MathMLMencloseElement.h:
+        * mathml/MathMLOperatorDictionary.cpp:
+        (WebCore::MathMLOperatorDictionary::search):
+        * mathml/MathMLOperatorDictionary.h:
+        * mathml/MathMLOperatorElement.cpp:
+        (WebCore::MathMLOperatorElement::computeOperatorFlag):
+        (WebCore::MathMLOperatorElement::childrenChanged):
+        (WebCore::attributeNameToPropertyFlag):
+        (WebCore::MathMLOperatorElement::parseAttribute):
+        * mathml/MathMLOperatorElement.h:
+        * mathml/MathMLPaddedElement.cpp:
+        (WebCore::MathMLPaddedElement::parseAttribute):
+        * mathml/MathMLPaddedElement.h:
+        * mathml/MathMLPresentationElement.cpp:
+        (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
+        (WebCore::MathMLPresentationElement::cachedMathMLLength):
+        (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
+        (WebCore::MathMLPresentationElement::specifiedMathVariant):
+        (WebCore::MathMLPresentationElement::parseAttribute):
+        * mathml/MathMLPresentationElement.h:
+        (WebCore::MathMLPresentationElement::toOptionalBool):
+        * mathml/MathMLScriptsElement.cpp:
+        (WebCore::MathMLScriptsElement::parseAttribute):
+        * mathml/MathMLScriptsElement.h:
+        * mathml/MathMLSpaceElement.cpp:
+        (WebCore::MathMLSpaceElement::parseAttribute):
+        * mathml/MathMLSpaceElement.h:
+        * mathml/MathMLTokenElement.cpp:
+        (WebCore::MathMLTokenElement::convertToSingleCodePoint):
+        * mathml/MathMLTokenElement.h:
+        * mathml/MathMLUnderOverElement.cpp:
+        (WebCore::MathMLUnderOverElement::parseAttribute):
+        * mathml/MathMLUnderOverElement.h:
+        * page/ChromeClient.h:
+        * page/DOMTimer.cpp:
+        (WebCore::DOMTimer::alignedFireTime):
+        * page/DOMTimer.h:
+        * page/DOMWindow.cpp:
+        (WebCore::DOMWindow::scrollBy):
+        * page/DOMWindow.h:
+        * page/EventSource.cpp:
+        (WebCore::EventSource::parseEventStream):
+        (WebCore::EventSource::parseEventStreamLine):
+        * page/EventSource.h:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::recalculateScrollbarOverlayStyle):
+        (WebCore::FrameView::setLayoutViewportOverrideRect):
+        (WebCore::FrameView::setViewExposedRect):
+        * page/FrameView.h:
+        * page/Page.cpp:
+        (WebCore::Page::takeAnyMediaCanStartListener):
+        * page/Page.h:
+        (WebCore::Page::eventThrottlingBehaviorOverride):
+        (WebCore::Page::setEventThrottlingBehaviorOverride):
+        * page/ScrollToOptions.h:
+        * page/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::SecurityOrigin):
+        (WebCore::SecurityOrigin::create):
+        * page/SecurityOrigin.h:
+        (WebCore::SecurityOrigin::port):
+        * page/SecurityOriginData.cpp:
+        (WebCore::SecurityOriginData::debugString):
+        (WebCore::SecurityOriginData::databaseIdentifier):
+        (WebCore::SecurityOriginData::fromDatabaseIdentifier):
+        * page/SecurityOriginData.h:
+        (WebCore::SecurityOriginData::SecurityOriginData):
+        (WebCore::SecurityOriginData::isEmpty):
+        (WebCore::SecurityOriginDataHash::hash):
+        * page/SecurityOriginHash.h:
+        (WebCore::SecurityOriginHash::hash):
+        * page/WindowFeatures.cpp:
+        (WebCore::parseDialogFeatures):
+        (WebCore::boolFeature):
+        (WebCore::floatFeature):
+        * page/WindowFeatures.h:
+        * page/csp/ContentSecurityPolicySource.cpp:
+        (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
+        (WebCore::ContentSecurityPolicySource::portMatches):
+        * page/csp/ContentSecurityPolicySource.h:
+        * page/csp/ContentSecurityPolicySourceList.cpp:
+        (WebCore::ContentSecurityPolicySourceList::parse):
+        (WebCore::ContentSecurityPolicySourceList::parseSource):
+        (WebCore::ContentSecurityPolicySourceList::parsePort):
+        * page/csp/ContentSecurityPolicySourceList.h:
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
+        (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
+        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        (WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
+        * page/scrolling/ScrollingCoordinator.h:
+        * page/scrolling/ScrollingTree.cpp:
+        (WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling):
+        * page/scrolling/ScrollingTree.h:
+        * page/scrolling/ScrollingTreeScrollingNode.cpp:
+        (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints):
+        * page/scrolling/ThreadedScrollingTree.cpp:
+        (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
+        * page/scrolling/ThreadedScrollingTree.h:
+        * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints):
+        * page/scrolling/ios/ScrollingTreeIOS.cpp:
+        (WebCore::ScrollingTreeIOS::scrollingTreeNodeDidScroll):
+        * page/scrolling/ios/ScrollingTreeIOS.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
+        * platform/DragImage.cpp:
+        * platform/LinkIcon.h:
+        * platform/MemoryPressureHandler.h:
+        * platform/ScrollView.cpp:
+        (WebCore::ScrollView::handleDeferredScrollUpdateAfterContentSizeChange):
+        * platform/ScrollView.h:
+        * platform/Theme.h:
+        (WebCore::Theme::controlFont):
+        * platform/Timer.h:
+        (WebCore::TimerBase::alignedFireTime):
+        * platform/URL.cpp:
+        (WebCore::URL::port):
+        (WebCore::defaultPortForProtocol):
+        (WebCore::portAllowed):
+        * platform/URL.h:
+        * platform/URLParser.cpp:
+        (WebCore::URLParser::defaultPortForProtocol):
+        (WebCore::findLongestZeroSequence):
+        (WebCore::URLParser::parseIPv4Piece):
+        (WebCore::URLParser::parseIPv4Host):
+        (WebCore::URLParser::parseIPv4PieceInsideIPv6):
+        (WebCore::URLParser::parseIPv4AddressInsideIPv6):
+        (WebCore::URLParser::parseIPv6Host):
+        (WebCore::URLParser::domainToASCII):
+        (WebCore::URLParser::formURLDecode):
+        * platform/URLParser.h:
+        * platform/graphics/BitmapImage.h:
+        * platform/graphics/Color.h:
+        (WebCore::colorWithOverrideAlpha):
+        * platform/graphics/DisplayRefreshMonitorClient.h:
+        * platform/graphics/Font.h:
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::drawText):
+        (WebCore::FontCascade::drawEmphasisMarks):
+        (WebCore::FontCascade::adjustSelectionRectForText):
+        (WebCore::FontCascade::getEmphasisMarkGlyphData):
+        (WebCore::FontCascade::emphasisMarkAscent):
+        (WebCore::FontCascade::emphasisMarkDescent):
+        (WebCore::FontCascade::emphasisMarkHeight):
+        * platform/graphics/FontCascade.h:
+        * platform/graphics/GraphicsContext.cpp:
+        (WebCore::GraphicsContext::drawText):
+        (WebCore::GraphicsContext::drawEmphasisMarks):
+        (WebCore::GraphicsContext::drawBidiText):
+        * platform/graphics/GraphicsContext.h:
+        (WebCore::InterpolationQualityMaintainer::InterpolationQualityMaintainer):
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::setPosition):
+        (WebCore::GraphicsLayer::setApproximatePosition):
+        * platform/graphics/Image.h:
+        (WebCore::Image::hotSpot):
+        * platform/graphics/ImageBuffer.h:
+        * platform/graphics/ImageFrameCache.cpp:
+        (WebCore::ImageFrameCache::clearMetadata):
+        (WebCore::ImageFrameCache::metadata):
+        (WebCore::ImageFrameCache::frameMetadataAtIndex):
+        (WebCore::ImageFrameCache::hotSpot):
+        * platform/graphics/ImageFrameCache.h:
+        * platform/graphics/ImageSource.h:
+        (WebCore::ImageSource::hotSpot):
+        * platform/graphics/PathUtilities.cpp:
+        (WebCore::rectFromPolygon):
+        (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ShadowBlur::calculateLayerBoundingRect):
+        * platform/graphics/TiledBacking.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::flush):
+        (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
+        * platform/graphics/ca/TileController.cpp:
+        (WebCore::TileController::setLayoutViewportRect):
+        * platform/graphics/ca/TileController.h:
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::encodeImage):
+        (WebCore::dataURL):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/cg/ImageDecoderCG.cpp:
+        (WebCore::ImageDecoder::hotSpot):
+        * platform/graphics/cg/ImageDecoderCG.h:
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::openTypeFeature):
+        (WebCore::advanceForColorBitmapFont):
+        * platform/graphics/displaylists/DisplayListItems.cpp:
+        (WebCore::DisplayList::DrawGlyphs::localBounds):
+        (WebCore::DisplayList::DrawLine::localBounds):
+        (WebCore::DisplayList::DrawLinesForText::localBounds):
+        (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds):
+        (WebCore::DisplayList::DrawFocusRingPath::localBounds):
+        (WebCore::DisplayList::DrawFocusRingRects::localBounds):
+        (WebCore::DisplayList::StrokeRect::localBounds):
+        (WebCore::DisplayList::StrokePath::localBounds):
+        (WebCore::DisplayList::StrokeEllipse::localBounds):
+        * platform/graphics/displaylists/DisplayListItems.h:
+        (WebCore::DisplayList::DrawingItem::localBounds):
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::updateItemExtent):
+        (WebCore::DisplayList::Recorder::ContextState::rotate):
+        (WebCore::DisplayList::Recorder::ContextState::concatCTM):
+        * platform/graphics/efl/ImageBufferEfl.cpp:
+        (WebCore::encodeImageJPEG):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/filters/Filter.h:
+        (WebCore::Filter::mapAbsolutePointToLocalPoint):
+        * platform/graphics/gtk/ImageBufferGtk.cpp:
+        (WebCore::encodeImage):
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
+        (WebCore::HarfBuzzShaper::selectionRect):
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::capitalized):
+        (WebCore::shouldSynthesize):
+        * platform/graphics/texmap/TextureMapperLayer.cpp:
+        (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
+        (WebCore::TextureMapperLayer::replicaTransform):
+        (WebCore::TextureMapperLayer::mapScrollOffset):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
+        (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
+        * platform/graphics/transforms/AffineTransform.cpp:
+        (WebCore::AffineTransform::inverse):
+        * platform/graphics/transforms/AffineTransform.h:
+        * platform/graphics/transforms/TransformState.cpp:
+        (WebCore::TransformState::mappedPoint):
+        (WebCore::TransformState::mappedSecondaryQuad):
+        (WebCore::TransformState::mapQuad):
+        (WebCore::TransformState::flattenWithTransform):
+        * platform/graphics/transforms/TransformState.h:
+        * platform/graphics/transforms/TransformationMatrix.cpp:
+        (WebCore::TransformationMatrix::inverse):
+        * platform/graphics/transforms/TransformationMatrix.h:
+        * platform/graphics/win/ImageBufferDirect2D.cpp:
+        (WebCore::ImageBuffer::toDataURL):
+        * platform/graphics/win/ImageDecoderDirect2D.cpp:
+        (WebCore::ImageDecoder::hotSpot):
+        * platform/graphics/win/ImageDecoderDirect2D.h:
+        * platform/graphics/x11/PlatformDisplayX11.cpp:
+        (WebCore::PlatformDisplayX11::supportsXDamage):
+        * platform/graphics/x11/PlatformDisplayX11.h:
+        * platform/image-decoders/ImageDecoder.h:
+        (WebCore::ImageDecoder::hotSpot):
+        * platform/image-decoders/ico/ICOImageDecoder.cpp:
+        (WebCore::ICOImageDecoder::hotSpot):
+        (WebCore::ICOImageDecoder::hotSpotAtIndex):
+        * platform/image-decoders/ico/ICOImageDecoder.h:
+        * platform/image-encoders/JPEGImageEncoder.cpp:
+        (WebCore::compressRGBABigEndianToJPEG):
+        * platform/image-encoders/JPEGImageEncoder.h:
+        * platform/ios/LegacyTileCache.h:
+        * platform/ios/LegacyTileCache.mm:
+        (WebCore::LegacyTileCache::setOverrideVisibleRect):
+        * platform/ios/LegacyTileLayer.mm:
+        (-[LegacyTileHostLayer renderInContext:]):
+        * platform/linux/MemoryPressureHandlerLinux.cpp:
+        * platform/mac/ThemeMac.h:
+        * platform/mac/ThemeMac.mm:
+        (WebCore::ThemeMac::controlFont):
+        * platform/mediastream/MediaConstraints.cpp:
+        (WebCore::MediaTrackConstraintSetMap::set):
+        * platform/mediastream/MediaConstraints.h:
+        (WebCore::MediaTrackConstraintSetMap::width):
+        (WebCore::MediaTrackConstraintSetMap::height):
+        (WebCore::MediaTrackConstraintSetMap::sampleRate):
+        (WebCore::MediaTrackConstraintSetMap::sampleSize):
+        (WebCore::MediaTrackConstraintSetMap::aspectRatio):
+        (WebCore::MediaTrackConstraintSetMap::frameRate):
+        (WebCore::MediaTrackConstraintSetMap::volume):
+        (WebCore::MediaTrackConstraintSetMap::echoCancellation):
+        (WebCore::MediaTrackConstraintSetMap::facingMode):
+        (WebCore::MediaTrackConstraintSetMap::deviceId):
+        (WebCore::MediaTrackConstraintSetMap::groupId):
+        * platform/mediastream/RealtimeMediaSource.cpp:
+        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
+        (WebCore::RealtimeMediaSource::applySizeAndFrameRate):
+        (WebCore::RealtimeMediaSource::applyConstraints):
+        * platform/mediastream/RealtimeMediaSource.h:
+        * platform/mediastream/mac/AVVideoCaptureSource.h:
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
+        (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
+        (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate):
+        * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
+        * platform/network/CacheValidation.cpp:
+        (WebCore::computeCurrentAge):
+        (WebCore::computeFreshnessLifetimeForHTTPFamily):
+        * platform/network/CacheValidation.h:
+        * platform/network/DataURLDecoder.h:
+        * platform/network/HTTPHeaderMap.h:
+        (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
+        * platform/network/HTTPParsers.cpp:
+        (WebCore::parseHTTPDate):
+        * platform/network/HTTPParsers.h:
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::didReceiveResponse):
+        * platform/network/ResourceResponseBase.cpp:
+        (WebCore::ResourceResponseBase::cacheControlMaxAge):
+        (WebCore::parseDateValueInHeader):
+        (WebCore::ResourceResponseBase::date):
+        (WebCore::ResourceResponseBase::age):
+        (WebCore::ResourceResponseBase::expires):
+        (WebCore::ResourceResponseBase::lastModified):
+        * platform/network/ResourceResponseBase.h:
+        (WebCore::ResourceResponseBase::certificateInfo):
+        * platform/network/SocketStreamHandle.h:
+        * platform/network/SocketStreamHandleClient.h:
+        * platform/network/cf/SocketStreamHandleImpl.h:
+        * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
+        (WebCore::SocketStreamHandleImpl::readStreamCallback):
+        (WebCore::SocketStreamHandleImpl::platformSend):
+        * platform/network/curl/SocketStreamHandleImpl.h:
+        * platform/network/curl/SocketStreamHandleImplCurl.cpp:
+        (WebCore::SocketStreamHandleImpl::platformSend):
+        * platform/network/mac/CookieJarMac.mm:
+        (WebCore::cookiesInPartitionForURL):
+        * platform/network/soup/SocketStreamHandleImpl.h:
+        * platform/network/soup/SocketStreamHandleImplSoup.cpp:
+        (WebCore::SocketStreamHandleImpl::readBytes):
+        (WebCore::SocketStreamHandleImpl::platformSend):
+        * rendering/BreakLines.h:
+        (WebCore::nextBreakablePositionNonLoosely):
+        (WebCore::nextBreakablePositionLoosely):
+        (WebCore::isBreakable):
+        * rendering/HitTestingTransformState.cpp:
+        (WebCore::HitTestingTransformState::flattenWithTransform):
+        * rendering/ImageQualityController.cpp:
+        (WebCore::ImageQualityController::interpolationQualityFromStyle):
+        (WebCore::ImageQualityController::chooseInterpolationQuality):
+        * rendering/ImageQualityController.h:
+        * rendering/InlineIterator.h:
+        (WebCore::InlineIterator::moveTo):
+        (WebCore::InlineIterator::nextBreakablePosition):
+        (WebCore::InlineIterator::setNextBreakablePosition):
+        * rendering/InlineTextBox.cpp:
+        (WebCore::InlineTextBox::paintSelection):
+        (WebCore::InlineTextBox::substringToRender):
+        (WebCore::InlineTextBox::hyphenatedStringForTextRun):
+        (WebCore::InlineTextBox::constructTextRun):
+        * rendering/InlineTextBox.h:
+        (WebCore::InlineTextBox::substringToRender):
+        (WebCore::InlineTextBox::hyphenatedStringForTextRun):
+        (WebCore::InlineTextBox::constructTextRun):
+        * rendering/OrderIterator.cpp:
+        (WebCore::OrderIterator::reset):
+        * rendering/OrderIterator.h:
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::applyTransform):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlockRareData::RenderBlockRareData):
+        (WebCore::RenderBlock::baselinePosition):
+        (WebCore::RenderBlock::firstLineBaseline):
+        (WebCore::RenderBlock::inlineBlockBaseline):
+        (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
+        * rendering/RenderBlock.h:
+        * rendering/RenderBlockFlow.cpp:
+        (WebCore::RenderBlockFlow::firstLineBaseline):
+        (WebCore::RenderBlockFlow::inlineBlockBaseline):
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::constrainLogicalHeightByMinMax):
+        (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
+        (WebCore::RenderBox::overrideContainingBlockContentLogicalWidth):
+        (WebCore::RenderBox::overrideContainingBlockContentLogicalHeight):
+        (WebCore::RenderBox::setOverrideContainingBlockContentLogicalWidth):
+        (WebCore::RenderBox::setOverrideContainingBlockContentLogicalHeight):
+        (WebCore::RenderBox::adjustContentBoxLogicalHeightForBoxSizing):
+        (WebCore::RenderBox::computeLogicalHeight):
+        (WebCore::RenderBox::computeLogicalHeightUsing):
+        (WebCore::RenderBox::computeContentLogicalHeight):
+        (WebCore::RenderBox::computeIntrinsicLogicalContentHeightUsing):
+        (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
+        (WebCore::RenderBox::computePercentageLogicalHeight):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        (WebCore::RenderBox::availableLogicalHeight):
+        (WebCore::RenderBox::availableLogicalHeightUsing):
+        * rendering/RenderBox.h:
+        (WebCore::RenderBox::firstLineBaseline):
+        (WebCore::RenderBox::inlineBlockBaseline):
+        * rendering/RenderCombineText.cpp:
+        (WebCore::RenderCombineText::computeTextOrigin):
+        * rendering/RenderCombineText.h:
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::baselinePosition):
+        (WebCore::RenderFlexibleBox::firstLineBaseline):
+        (WebCore::RenderFlexibleBox::inlineBlockBaseline):
+        (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
+        (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
+        (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
+        (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
+        (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
+        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+        * rendering/RenderFlexibleBox.h:
+        * rendering/RenderFlowThread.cpp:
+        (WebCore::RenderFlowThread::addForcedRegionBreak):
+        * rendering/RenderGrid.cpp:
+        (WebCore::GridTrack::setGrowthLimit):
+        (WebCore::GridTrack::setGrowthLimitCap):
+        (WebCore::GridTrack::growthLimitCap):
+        (WebCore::RenderGrid::GridSizingData::freeSpace):
+        (WebCore::RenderGrid::GridSizingData::availableSpace):
+        (WebCore::RenderGrid::GridSizingData::setAvailableSpace):
+        (WebCore::RenderGrid::GridSizingData::setFreeSpace):
+        (WebCore::RenderGrid::layoutBlock):
+        (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
+        (WebCore::RenderGrid::computeIntrinsicLogicalHeight):
+        (WebCore::RenderGrid::computeIntrinsicLogicalContentHeightUsing):
+        (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
+        (WebCore::overrideContainingBlockContentSizeForChild):
+        (WebCore::setOverrideContainingBlockContentSizeForChild):
+        (WebCore::RenderGrid::logicalHeightForChild):
+        (WebCore::RenderGrid::minSizeForChild):
+        (WebCore::RenderGrid::minContentForChild):
+        (WebCore::RenderGrid::maxContentForChild):
+        (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
+        (WebCore::sortByGridTrackGrowthPotential):
+        (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth):
+        (WebCore::RenderGrid::computeAutoRepeatTracksCount):
+        (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
+        (WebCore::RenderGrid::layoutGridItems):
+        * rendering/RenderGrid.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerByApplyingTransform):
+        (WebCore::RenderLayer::hitTestLayer):
+        * rendering/RenderLayerBacking.cpp:
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::paintItem):
+        (WebCore::RenderListBox::listIndexIsVisible):
+        (WebCore::RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas):
+        * rendering/RenderListBox.h:
+        * rendering/RenderMenuList.h:
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
+        (WebCore::RenderTable::baselinePosition):
+        (WebCore::RenderTable::inlineBlockBaseline):
+        (WebCore::RenderTable::firstLineBaseline):
+        * rendering/RenderTable.h:
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::cellBaselinePosition):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::firstLineBaseline):
+        * rendering/RenderTableSection.h:
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::computePreferredLogicalWidths):
+        (WebCore::RenderText::stringView):
+        * rendering/RenderText.h:
+        * rendering/RenderTextControl.h:
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::setSelection):
+        (WebCore::RenderView::splitSelectionBetweenSubtrees):
+        (WebCore::RenderView::getSelection):
+        (WebCore::RenderView::clearSelection):
+        * rendering/RenderView.h:
+        * rendering/SelectionSubtreeRoot.h:
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::SelectionSubtreeData):
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionStartPos):
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::selectionEndPos):
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionStartPos):
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::setSelectionEndPos):
+        (WebCore::SelectionSubtreeRoot::SelectionSubtreeData::clearSelection):
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::LineState::lastFragment):
+        (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
+        (WebCore::SimpleLineLayout::createTextRuns):
+        * rendering/SimpleLineLayoutFunctions.cpp:
+        (WebCore::SimpleLineLayout::paintFlow):
+        * rendering/line/BreakingContext.h:
+        (WebCore::WordTrailingSpace::width):
+        (WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
+        (WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
+        (WebCore::BreakingContext::InlineIteratorHistory::moveTo):
+        (WebCore::tryHyphenating):
+        (WebCore::BreakingContext::computeAdditionalBetweenWordsWidth):
+        (WebCore::BreakingContext::handleText):
+        (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
+        * rendering/mathml/MathMLStyle.cpp:
+        (WebCore::MathMLStyle::resolveMathMLStyle):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::baselinePosition):
+        (WebCore::RenderMathMLTable::firstLineBaseline):
+        * rendering/mathml/RenderMathMLBlock.h:
+        (WebCore::RenderMathMLBlock::ascentForChild):
+        * rendering/mathml/RenderMathMLFraction.cpp:
+        (WebCore::RenderMathMLFraction::firstLineBaseline):
+        * rendering/mathml/RenderMathMLFraction.h:
+        * rendering/mathml/RenderMathMLOperator.cpp:
+        (WebCore::RenderMathMLOperator::firstLineBaseline):
+        * rendering/mathml/RenderMathMLOperator.h:
+        * rendering/mathml/RenderMathMLPadded.cpp:
+        (WebCore::RenderMathMLPadded::firstLineBaseline):
+        * rendering/mathml/RenderMathMLPadded.h:
+        * rendering/mathml/RenderMathMLRow.cpp:
+        (WebCore::RenderMathMLRow::firstLineBaseline):
+        * rendering/mathml/RenderMathMLRow.h:
+        * rendering/mathml/RenderMathMLScripts.cpp:
+        (WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
+        (WebCore::RenderMathMLScripts::firstLineBaseline):
+        * rendering/mathml/RenderMathMLScripts.h:
+        * rendering/mathml/RenderMathMLSpace.cpp:
+        (WebCore::RenderMathMLSpace::firstLineBaseline):
+        * rendering/mathml/RenderMathMLSpace.h:
+        * rendering/mathml/RenderMathMLToken.cpp:
+        (WebCore::RenderMathMLToken::updateMathVariantGlyph):
+        (WebCore::RenderMathMLToken::firstLineBaseline):
+        * rendering/mathml/RenderMathMLToken.h:
+        * rendering/svg/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::nodeAtFloatPoint):
+        * rendering/svg/RenderSVGForeignObject.cpp:
+        (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
+        * rendering/svg/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::nodeAtFloatPoint):
+        * rendering/svg/RenderSVGResourceClipper.cpp:
+        (WebCore::RenderSVGResourceClipper::hitTestClipContent):
+        * rendering/svg/RenderSVGResourceFilter.cpp:
+        (WebCore::RenderSVGResourceFilter::postApplyResource):
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::nodeAtPoint):
+        * rendering/svg/RenderSVGShape.cpp:
+        (WebCore::RenderSVGShape::setupNonScalingStrokeContext):
+        (WebCore::RenderSVGShape::nodeAtFloatPoint):
+        (WebCore::RenderSVGShape::calculateStrokeBoundingBox):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::nodeAtFloatPoint):
+        * rendering/svg/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::clipToImageBuffer):
+        * rendering/svg/SVGTextQuery.cpp:
+        (WebCore::SVGTextQuery::modifyStartEndPositionsRespectingLigatures):
+        * style/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::Parent::Parent):
+        * style/RenderTreeUpdater.h:
+        * style/StyleScope.h:
+        * svg/SVGElement.cpp:
+        (WebCore::SVGElement::parseAttribute):
+        (WebCore::SVGElement::resolveCustomStyle):
+        * svg/SVGElement.h:
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::SVGToOTFFontConverter::transcodeGlyphPaths):
+        (WebCore::SVGToOTFFontConverter::processGlyphElement):
+        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
+        (WebCore::convertSVGToOTFFont):
+        * svg/SVGToOTFFontConversion.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::setEventThrottlingBehaviorOverride):
+        (WebCore::Internals::eventThrottlingBehaviorOverride):
+        * testing/Internals.h:
+        * workers/Worker.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::prepareToSend):
+        (WebCore::XMLHttpRequest::didFinishLoading):
+        * xml/XMLHttpRequest.h:
+
 2016-11-26  Csaba Osztrogonác  <ossy@webkit.org>
 
         Fix build warnings in WebCore/Modules/indexeddb/server/IDBSerialization.cp
diff --git a/Source/WebCore/Modules/applepay/ApplePaySession.cpp b/Source/WebCore/Modules/applepay/ApplePaySession.cpp
index cc1da9a..6fc45fb 100644
--- a/Source/WebCore/Modules/applepay/ApplePaySession.cpp
+++ b/Source/WebCore/Modules/applepay/ApplePaySession.cpp
@@ -76,7 +76,7 @@
 }
 
 // The amount follows the regular expression -?[0-9]+(\.[0-9][0-9])?.
-static Optional<int64_t> parseAmount(const String& amountString)
+static std::optional<int64_t> parseAmount(const String& amountString)
 {
     int64_t amount = 0;
 
@@ -105,13 +105,13 @@
             }
 
             if (!parseDigit(c, isNegative, amount))
-                return Nullopt;
+                return std::nullopt;
             state = State::Digit;
             break;
 
         case State::Sign:
             if (!parseDigit(c, isNegative, amount))
-                return Nullopt;
+                return std::nullopt;
             state = State::Digit;
             break;
 
@@ -122,30 +122,30 @@
             }
 
             if (!parseDigit(c, isNegative, amount))
-                return Nullopt;
+                return std::nullopt;
             break;
 
         case State::Dot:
             if (!parseDigit(c, isNegative, amount))
-                return Nullopt;
+                return std::nullopt;
 
             state = State::DotDigit;
             break;
 
         case State::DotDigit:
             if (!parseDigit(c, isNegative, amount))
-                return Nullopt;
+                return std::nullopt;
 
             state = State::End;
             break;
             
         case State::End:
-            return Nullopt;
+            return std::nullopt;
         }
     }
     
     if (state != State::Digit && state != State::DotDigit && state != State::End)
-        return Nullopt;
+        return std::nullopt;
 
     if (state == State::DotDigit) {
         // There was a single digit after the decimal point.
@@ -163,18 +163,18 @@
     return amount;
 }
 
-static Optional<PaymentRequest::ContactFields> createContactFields(DOMWindow& window, const ArrayValue& contactFieldsArray)
+static std::optional<PaymentRequest::ContactFields> createContactFields(DOMWindow& window, const ArrayValue& contactFieldsArray)
 {
     PaymentRequest::ContactFields result;
 
     size_t contactFieldsCount;
     if (!contactFieldsArray.length(contactFieldsCount))
-        return Nullopt;
+        return std::nullopt;
 
     for (size_t i = 0; i < contactFieldsCount; ++i) {
         String contactField;
         if (!contactFieldsArray.get(i, contactField))
-            return Nullopt;
+            return std::nullopt;
 
         if (contactField == "postalAddress")
             result.postalAddress = true;
@@ -187,21 +187,21 @@
         else {
             auto message = makeString("\"" + contactField, "\" is not a valid contact field.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
     return result;
 }
 
-static Optional<PaymentRequest::LineItem::Type> toLineItemType(const String& type)
+static std::optional<PaymentRequest::LineItem::Type> toLineItemType(const String& type)
 {
     if (type == "pending")
         return PaymentRequest::LineItem::Type::Pending;
     if (type == "final")
         return PaymentRequest::LineItem::Type::Final;
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 static bool isValidLineItemPropertyName(const String& propertyName)
@@ -220,7 +220,7 @@
     return false;
 }
 
-static Optional<PaymentRequest::LineItem> createLineItem(DOMWindow& window, const Dictionary& total)
+static std::optional<PaymentRequest::LineItem> createLineItem(DOMWindow& window, const Dictionary& total)
 {
     Vector<String> propertyNames;
     total.getOwnPropertyNames(propertyNames);
@@ -229,7 +229,7 @@
         if (!isValidLineItemPropertyName(propertyName)) {
             auto message = makeString("\"" + propertyName, "\" is not a valid line item property name.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
@@ -241,7 +241,7 @@
         if (!type) {
             auto message = makeString("\"" + *typeString, "\" is not a valid line item type.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
 
         result.type = *type;
@@ -255,25 +255,25 @@
         else {
             auto message = makeString("\"" + *amountString, "\" is not a valid amount.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
     return result;
 }
 
-static Optional<Vector<PaymentRequest::LineItem>> createLineItems(DOMWindow& window, const ArrayValue& lineItemsArray)
+static std::optional<Vector<PaymentRequest::LineItem>> createLineItems(DOMWindow& window, const ArrayValue& lineItemsArray)
 {
     Vector<PaymentRequest::LineItem> result;
 
     size_t lineItemCount;
     if (!lineItemsArray.length(lineItemCount))
-        return Nullopt;
+        return std::nullopt;
 
     for (size_t i = 0; i < lineItemCount; ++i) {
         Dictionary lineItemDictionary;
         if (!lineItemsArray.get(i, lineItemDictionary))
-            return Nullopt;
+            return std::nullopt;
 
         if (auto lineItem = createLineItem(window, lineItemDictionary))
             result.append(*lineItem);
@@ -282,18 +282,18 @@
     return result;
 }
 
-static Optional<PaymentRequest::MerchantCapabilities> createMerchantCapabilities(DOMWindow& window, const ArrayValue& merchantCapabilitiesArray)
+static std::optional<PaymentRequest::MerchantCapabilities> createMerchantCapabilities(DOMWindow& window, const ArrayValue& merchantCapabilitiesArray)
 {
     PaymentRequest::MerchantCapabilities result;
 
     size_t merchantCapabilitiesCount;
     if (!merchantCapabilitiesArray.length(merchantCapabilitiesCount))
-        return Nullopt;
+        return std::nullopt;
 
     for (size_t i = 0; i < merchantCapabilitiesCount; ++i) {
         String merchantCapability;
         if (!merchantCapabilitiesArray.get(i, merchantCapability))
-            return Nullopt;
+            return std::nullopt;
 
         if (merchantCapability == "supports3DS")
             result.supports3DS = true;
@@ -306,30 +306,30 @@
         else {
             auto message = makeString("\"" + merchantCapability, "\" is not a valid merchant capability.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
     return result;
 }
 
-static Optional<Vector<String>> createSupportedNetworks(unsigned version, DOMWindow& window, const ArrayValue& supportedNetworksArray)
+static std::optional<Vector<String>> createSupportedNetworks(unsigned version, DOMWindow& window, const ArrayValue& supportedNetworksArray)
 {
     Vector<String> result;
 
     size_t supportedNetworksCount;
     if (!supportedNetworksArray.length(supportedNetworksCount))
-        return Nullopt;
+        return std::nullopt;
 
     for (size_t i = 0; i < supportedNetworksCount; ++i) {
         String supportedNetwork;
         if (!supportedNetworksArray.get(i, supportedNetwork))
-            return Nullopt;
+            return std::nullopt;
 
         if (!PaymentRequest::isValidSupportedNetwork(version, supportedNetwork)) {
             auto message = makeString("\"" + supportedNetwork, "\" is not a valid payment network.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
 
         result.append(WTFMove(supportedNetwork));
@@ -338,7 +338,7 @@
     return result;
 }
 
-static Optional<PaymentRequest::ShippingType> toShippingType(const String& shippingTypeString)
+static std::optional<PaymentRequest::ShippingType> toShippingType(const String& shippingTypeString)
 {
     if (shippingTypeString == "shipping")
         return PaymentRequest::ShippingType::Shipping;
@@ -349,7 +349,7 @@
     if (shippingTypeString == "servicePickup")
         return PaymentRequest::ShippingType::ServicePickup;
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 static bool isValidShippingMethodPropertyName(const String& propertyName)
@@ -369,7 +369,7 @@
     return false;
 }
 
-static Optional<PaymentRequest::ShippingMethod> createShippingMethod(DOMWindow& window, const Dictionary& shippingMethodDictionary)
+static std::optional<PaymentRequest::ShippingMethod> createShippingMethod(DOMWindow& window, const Dictionary& shippingMethodDictionary)
 {
     Vector<String> propertyNames;
     shippingMethodDictionary.getOwnPropertyNames(propertyNames);
@@ -378,7 +378,7 @@
         if (!isValidShippingMethodPropertyName(propertyName)) {
             auto message = makeString("\"" + propertyName, "\" is not a valid shipping method property name.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
@@ -387,21 +387,21 @@
     auto label = shippingMethodDictionary.get<String>("label");
     if (!label) {
         window.printErrorMessage("Missing shipping method label.");
-        return Nullopt;
+        return std::nullopt;
     }
     result.label = *label;
 
     auto detail = shippingMethodDictionary.get<String>("detail");
     if (!detail) {
         window.printErrorMessage("Missing shipping method detail.");
-        return Nullopt;
+        return std::nullopt;
     }
     result.detail = *detail;
 
     auto amountString = shippingMethodDictionary.get<String>("amount");
     if (!amountString) {
         window.printErrorMessage("Missing shipping method amount.");
-        return Nullopt;
+        return std::nullopt;
     }
 
     if (auto amount = parseAmount(*amountString))
@@ -409,36 +409,36 @@
     else {
         auto message = makeString("\"" + *amountString, "\" is not a valid amount.");
         window.printErrorMessage(message);
-        return Nullopt;
+        return std::nullopt;
     }
 
     auto identifier = shippingMethodDictionary.get<String>("identifier");
     if (!identifier) {
         window.printErrorMessage("Missing shipping method identifier.");
-        return Nullopt;
+        return std::nullopt;
     }
     result.identifier = *identifier;
 
     return result;
 }
 
-static Optional<Vector<PaymentRequest::ShippingMethod>> createShippingMethods(DOMWindow& window, const ArrayValue& shippingMethodsArray)
+static std::optional<Vector<PaymentRequest::ShippingMethod>> createShippingMethods(DOMWindow& window, const ArrayValue& shippingMethodsArray)
 {
     Vector<PaymentRequest::ShippingMethod> result;
 
     size_t shippingMethodCount;
     if (!shippingMethodsArray.length(shippingMethodCount))
-        return Nullopt;
+        return std::nullopt;
 
     for (size_t i = 0; i < shippingMethodCount; ++i) {
         Dictionary shippingMethodDictionary;
         if (!shippingMethodsArray.get(i, shippingMethodDictionary))
-            return Nullopt;
+            return std::nullopt;
 
         if (auto shippingMethod = createShippingMethod(window, shippingMethodDictionary))
             result.append(*shippingMethod);
         else
-            return Nullopt;
+            return std::nullopt;
     }
 
     return result;
@@ -470,7 +470,7 @@
     return false;
 }
 
-static Optional<PaymentRequest> createPaymentRequest(unsigned version, DOMWindow& window, const Dictionary& dictionary)
+static std::optional<PaymentRequest> createPaymentRequest(unsigned version, DOMWindow& window, const Dictionary& dictionary)
 {
     PaymentRequest paymentRequest;
 
@@ -480,25 +480,25 @@
     for (auto& propertyName : propertyNames) {
         if (propertyName == "requiredShippingAddressFields") {
             window.printErrorMessage("\"requiredShippingAddressFields\" has been deprecated. Please switch to \"requiredShippingContactFields\" instead.");
-            return Nullopt;
+            return std::nullopt;
         }
 
         if (propertyName == "requiredBillingAddressFields") {
             window.printErrorMessage("\"requiredBillingAddressFields\" has been deprecated. Please switch to \"requiredBillingContactFields\" instead.");
-            return Nullopt;
+            return std::nullopt;
         }
 
         if (!isValidPaymentRequestPropertyName(propertyName)) {
             auto message = makeString("\"" + propertyName, "\" is not a valid payment request property name.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
     }
 
     if (auto merchantCapabilitiesArray = dictionary.get<ArrayValue>("merchantCapabilities")) {
         auto merchantCapabilities = createMerchantCapabilities(window, *merchantCapabilitiesArray);
         if (!merchantCapabilities)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setMerchantCapabilities(*merchantCapabilities);
     }
@@ -506,7 +506,7 @@
     if (auto supportedNetworksArray = dictionary.get<ArrayValue>("supportedNetworks")) {
         auto supportedNetworks = createSupportedNetworks(version, window, *supportedNetworksArray);
         if (!supportedNetworks)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setSupportedNetworks(*supportedNetworks);
     }
@@ -519,7 +519,7 @@
     if (auto requiredBillingContactFieldsArray = dictionary.get<ArrayValue>("requiredBillingContactFields")) {
         auto requiredBillingContactFields = createContactFields(window, *requiredBillingContactFieldsArray);
         if (!requiredBillingContactFields)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setRequiredBillingContactFields(*requiredBillingContactFields);
     }
@@ -529,7 +529,7 @@
         auto billingContact = PaymentContact::fromJS(*JSMainThreadExecState::currentState(), *billingContactValue, errorMessage);
         if (!billingContact) {
             window.printErrorMessage(errorMessage);
-            return Nullopt;
+            return std::nullopt;
         }
 
         paymentRequest.setBillingContact(*billingContact);
@@ -538,7 +538,7 @@
     if (auto requiredShippingContactFieldsArray = dictionary.get<ArrayValue>("requiredShippingContactFields")) {
         auto requiredShippingContactFields = createContactFields(window, *requiredShippingContactFieldsArray);
         if (!requiredShippingContactFields)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setRequiredShippingContactFields(*requiredShippingContactFields);
     }
@@ -548,7 +548,7 @@
         auto shippingContact = PaymentContact::fromJS(*JSMainThreadExecState::currentState(), *shippingContactValue, errorMessage);
         if (!shippingContact) {
             window.printErrorMessage(errorMessage);
-            return Nullopt;
+            return std::nullopt;
         }
 
         paymentRequest.setShippingContact(*shippingContact);
@@ -560,7 +560,7 @@
         if (!shippingType) {
             auto message = makeString("\"" + *shippingTypeString, "\" is not a valid shipping type.");
             window.printErrorMessage(message);
-            return Nullopt;
+            return std::nullopt;
         }
         paymentRequest.setShippingType(*shippingType);
     }
@@ -568,7 +568,7 @@
     if (auto shippingMethodsArray = dictionary.get<ArrayValue>("shippingMethods")) {
         auto shippingMethods = createShippingMethods(window, *shippingMethodsArray);
         if (!shippingMethods)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setShippingMethods(*shippingMethods);
     }
@@ -576,7 +576,7 @@
     if (auto totalDictionary = dictionary.get<Dictionary>("total")) {
         auto total = createLineItem(window, *totalDictionary);
         if (!total)
-            return Nullopt;
+            return std::nullopt;
 
         paymentRequest.setTotal(*total);
     }
@@ -842,7 +842,7 @@
     return { };
 }
 
-static Optional<PaymentAuthorizationStatus> toPaymentAuthorizationStatus(unsigned short status)
+static std::optional<PaymentAuthorizationStatus> toPaymentAuthorizationStatus(unsigned short status)
 {
     switch (status) {
     case ApplePaySession::STATUS_SUCCESS:
@@ -870,7 +870,7 @@
         return PaymentAuthorizationStatus::PINLockout;
 
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 }
 
diff --git a/Source/WebCore/Modules/applepay/PaymentContact.h b/Source/WebCore/Modules/applepay/PaymentContact.h
index 50aa805..7ca9f05 100644
--- a/Source/WebCore/Modules/applepay/PaymentContact.h
+++ b/Source/WebCore/Modules/applepay/PaymentContact.h
@@ -48,7 +48,7 @@
     {
     }
 
-    static Optional<PaymentContact> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage);
+    static std::optional<PaymentContact> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage);
     JSC::JSValue toJS(JSC::ExecState&) const;
 
     PKContact *pkContact() const { return m_pkContact.get(); }
diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
index 0d4bdbe..154a6d0 100644
--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
@@ -83,21 +83,21 @@
     m_client.completeMerchantValidation(paymentMerchantSession);
 }
 
-void PaymentCoordinator::completeShippingMethodSelection(PaymentAuthorizationStatus status, Optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void PaymentCoordinator::completeShippingMethodSelection(PaymentAuthorizationStatus status, std::optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     ASSERT(m_activeSession);
 
     m_client.completeShippingMethodSelection(status, WTFMove(newTotalAndItems));
 }
 
-void PaymentCoordinator::completeShippingContactSelection(PaymentAuthorizationStatus status, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, Optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void PaymentCoordinator::completeShippingContactSelection(PaymentAuthorizationStatus status, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, std::optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     ASSERT(m_activeSession);
 
     m_client.completeShippingContactSelection(status, newShippingMethods, WTFMove(newTotalAndItems));
 }
 
-void PaymentCoordinator::completePaymentMethodSelection(Optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void PaymentCoordinator::completePaymentMethodSelection(std::optional<PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     ASSERT(m_activeSession);
 
diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinator.h b/Source/WebCore/Modules/applepay/PaymentCoordinator.h
index 7c8b234..500ae16 100644
--- a/Source/WebCore/Modules/applepay/PaymentCoordinator.h
+++ b/Source/WebCore/Modules/applepay/PaymentCoordinator.h
@@ -55,9 +55,9 @@
 
     bool beginPaymentSession(ApplePaySession&, const URL& originatingURL, const Vector<URL>& linkIconURLs, const PaymentRequest&);
     void completeMerchantValidation(const PaymentMerchantSession&);
-    void completeShippingMethodSelection(PaymentAuthorizationStatus, Optional<PaymentRequest::TotalAndLineItems> newItems);
-    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, Optional<PaymentRequest::TotalAndLineItems> newItems);
-    void completePaymentMethodSelection(Optional<PaymentRequest::TotalAndLineItems> newItems);
+    void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional<PaymentRequest::TotalAndLineItems> newItems);
+    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, std::optional<PaymentRequest::TotalAndLineItems> newItems);
+    void completePaymentMethodSelection(std::optional<PaymentRequest::TotalAndLineItems> newItems);
     void completePaymentSession(PaymentAuthorizationStatus);
     void abortPaymentSession();
 
diff --git a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
index fcf7e19..3d6ecc0 100644
--- a/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
+++ b/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
@@ -46,9 +46,9 @@
 
     virtual bool showPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const PaymentRequest&) = 0;
     virtual void completeMerchantValidation(const PaymentMerchantSession&) = 0;
-    virtual void completeShippingMethodSelection(PaymentAuthorizationStatus, Optional<PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
-    virtual void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, Optional<PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
-    virtual void completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
+    virtual void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional<PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
+    virtual void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>& newShippingMethods, std::optional<PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
+    virtual void completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) = 0;
     virtual void completePaymentSession(PaymentAuthorizationStatus) = 0;
     virtual void abortPaymentSession() = 0;
     virtual void paymentCoordinatorDestroyed() = 0;
diff --git a/Source/WebCore/Modules/applepay/PaymentMerchantSession.h b/Source/WebCore/Modules/applepay/PaymentMerchantSession.h
index 8e6c8d8..a5c6ddd 100644
--- a/Source/WebCore/Modules/applepay/PaymentMerchantSession.h
+++ b/Source/WebCore/Modules/applepay/PaymentMerchantSession.h
@@ -54,7 +54,7 @@
     {
     }
 
-    static Optional<PaymentMerchantSession> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage);
+    static std::optional<PaymentMerchantSession> fromJS(JSC::ExecState&, JSC::JSValue, String& errorMessage);
 
     PKPaymentMerchantSession *pkPaymentMerchantSession() const { return m_pkPaymentMerchantSession.get(); }
 
diff --git a/Source/WebCore/Modules/applepay/PaymentRequest.h b/Source/WebCore/Modules/applepay/PaymentRequest.h
index 6af92d3..ec3ee1fa 100644
--- a/Source/WebCore/Modules/applepay/PaymentRequest.h
+++ b/Source/WebCore/Modules/applepay/PaymentRequest.h
@@ -88,7 +88,7 @@
         // Stored as a fixed point decimal number with two decimals:
         // 1.23 -> 123.
         // 0.01 -> 1.
-        Optional<int64_t> amount;
+        std::optional<int64_t> amount;
         String label;
     };
 
diff --git a/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm b/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
index a4c053bd..17c25c7 100644
--- a/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
+++ b/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
@@ -104,20 +104,20 @@
     return result;
 }
 
-Optional<PaymentContact> PaymentContact::fromJS(JSC::ExecState& state, JSC::JSValue value, String& errorMessage)
+std::optional<PaymentContact> PaymentContact::fromJS(JSC::ExecState& state, JSC::JSValue value, String& errorMessage)
 {
     // FIXME: Don't round-trip using NSString.
     auto jsonString = JSONStringify(&state, value, 0);
     if (!jsonString)
-        return Nullopt;
+        return std::nullopt;
 
     auto dictionary = dynamic_objc_cast<NSDictionary>([NSJSONSerialization JSONObjectWithData:[(NSString *)jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]);
     if (!dictionary || ![dictionary isKindOfClass:[NSDictionary class]])
-        return Nullopt;
+        return std::nullopt;
 
     auto pkContact = fromDictionary(dictionary, errorMessage);
     if (!pkContact)
-        return Nullopt;
+        return std::nullopt;
 
     return PaymentContact(pkContact.get());
 }
diff --git a/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm b/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
index 34912f0..2fbc418 100644
--- a/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
+++ b/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
@@ -42,16 +42,16 @@
 
 namespace WebCore {
 
-Optional<PaymentMerchantSession> PaymentMerchantSession::fromJS(JSC::ExecState& state, JSC::JSValue value, String&)
+std::optional<PaymentMerchantSession> PaymentMerchantSession::fromJS(JSC::ExecState& state, JSC::JSValue value, String&)
 {
     // FIXME: Don't round-trip using NSString.
     auto jsonString = JSONStringify(&state, value, 0);
     if (!jsonString)
-        return Nullopt;
+        return std::nullopt;
 
     auto dictionary = dynamic_objc_cast<NSDictionary>([NSJSONSerialization JSONObjectWithData:[(NSString *)jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil]);
     if (!dictionary || ![dictionary isKindOfClass:[NSDictionary class]])
-        return Nullopt;
+        return std::nullopt;
 
     auto pkPaymentMerchantSession = adoptNS([allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
 
diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp
index 39e2a9e..3eb6b43 100644
--- a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp
+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.cpp
@@ -61,9 +61,9 @@
 {
 }
 
-Optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> MediaKeyStatusMap::Iterator::next()
+std::optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> MediaKeyStatusMap::Iterator::next()
 {
-    return Nullopt;
+    return std::nullopt;
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h
index e92d07e..6fd43bc 100644
--- a/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h
+++ b/Source/WebCore/Modules/encryptedmedia/MediaKeyStatusMap.h
@@ -58,7 +58,7 @@
     class Iterator {
     public:
         explicit Iterator(MediaKeyStatusMap&);
-        Optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> next();
+        std::optional<WTF::KeyValuePair<BufferSource::VariantType, MediaKeyStatus>> next();
     };
     Iterator createIterator() { return Iterator(*this); }
 
diff --git a/Source/WebCore/Modules/fetch/FetchBody.cpp b/Source/WebCore/Modules/fetch/FetchBody.cpp
index 8d02b12..01340cb 100644
--- a/Source/WebCore/Modules/fetch/FetchBody.cpp
+++ b/Source/WebCore/Modules/fetch/FetchBody.cpp
@@ -48,7 +48,7 @@
 
 namespace WebCore {
 
-Optional<FetchBody> FetchBody::extract(ScriptExecutionContext& context, JSC::ExecState& state, JSC::JSValue value, String& contentType)
+std::optional<FetchBody> FetchBody::extract(ScriptExecutionContext& context, JSC::ExecState& state, JSC::JSValue value, String& contentType)
 {
     if (value.inherits(JSBlob::info())) {
         auto& blob = *JSBlob::toWrapped(value);
@@ -80,7 +80,7 @@
     if (value.inherits(JSC::JSArrayBufferView::info()))
         return FetchBody(toUnsharedArrayBufferView(value).releaseConstNonNull());
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 void FetchBody::arrayBuffer(FetchBodyOwner& owner, Ref<DeferredPromise>&& promise)
diff --git a/Source/WebCore/Modules/fetch/FetchBody.h b/Source/WebCore/Modules/fetch/FetchBody.h
index 8719b3e..52712fd 100644
--- a/Source/WebCore/Modules/fetch/FetchBody.h
+++ b/Source/WebCore/Modules/fetch/FetchBody.h
@@ -71,7 +71,7 @@
     bool isURLSearchParams() const { return WTF::holds_alternative<Ref<const URLSearchParams>>(m_data); }
     bool isText() const { return WTF::holds_alternative<String>(m_data); }
 
-    static Optional<FetchBody> extract(ScriptExecutionContext&, JSC::ExecState&, JSC::JSValue, String&);
+    static std::optional<FetchBody> extract(ScriptExecutionContext&, JSC::ExecState&, JSC::JSValue, String&);
     static FetchBody loadingBody() { return { }; }
 
     void loadingFailed();
diff --git a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp b/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
index 9f2a3c7..ee4eaa2 100644
--- a/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
+++ b/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-FetchBodyOwner::FetchBodyOwner(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers)
+FetchBodyOwner::FetchBodyOwner(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers)
     : ActiveDOMObject(&context)
     , m_body(WTFMove(body))
     , m_headers(WTFMove(headers))
@@ -190,13 +190,13 @@
         return;
     }
 
-    m_blobLoader = { *this };
+    m_blobLoader.emplace(*this);
     m_blobLoader->loader = std::make_unique<FetchLoader>(*m_blobLoader, consumer);
 
     m_blobLoader->loader->start(*scriptExecutionContext(), blob);
     if (!m_blobLoader->loader->isStarted()) {
         m_body->loadingFailed();
-        m_blobLoader = Nullopt;
+        m_blobLoader = std::nullopt;
         return;
     }
     setPendingActivity(this);
@@ -206,7 +206,7 @@
 {
     ASSERT(m_blobLoader);
 
-    m_blobLoader = Nullopt;
+    m_blobLoader = std::nullopt;
     unsetPendingActivity(this);
 }
 
diff --git a/Source/WebCore/Modules/fetch/FetchBodyOwner.h b/Source/WebCore/Modules/fetch/FetchBodyOwner.h
index 85ede78e..3a75d4b 100644
--- a/Source/WebCore/Modules/fetch/FetchBodyOwner.h
+++ b/Source/WebCore/Modules/fetch/FetchBodyOwner.h
@@ -41,7 +41,7 @@
 
 class FetchBodyOwner : public RefCounted<FetchBodyOwner>, public ActiveDOMObject {
 public:
-    FetchBodyOwner(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&);
+    FetchBodyOwner(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&);
 
     // Exposed Body API
     bool isDisturbed() const { return m_isDisturbed; };
@@ -94,7 +94,7 @@
     };
 
 protected:
-    Optional<FetchBody> m_body;
+    std::optional<FetchBody> m_body;
     String m_contentType;
     bool m_isDisturbed { false };
 #if ENABLE(READABLE_STREAM_API)
@@ -103,7 +103,7 @@
     Ref<FetchHeaders> m_headers;
 
 private:
-    Optional<BlobLoader> m_blobLoader;
+    std::optional<BlobLoader> m_blobLoader;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/fetch/FetchHeaders.cpp b/Source/WebCore/Modules/fetch/FetchHeaders.cpp
index 5fc03e6..6e07674 100644
--- a/Source/WebCore/Modules/fetch/FetchHeaders.cpp
+++ b/Source/WebCore/Modules/fetch/FetchHeaders.cpp
@@ -123,7 +123,7 @@
     }
 }
 
-Optional<WTF::KeyValuePair<String, String>> FetchHeaders::Iterator::next()
+std::optional<WTF::KeyValuePair<String, String>> FetchHeaders::Iterator::next()
 {
     while (m_currentIndex < m_keys.size()) {
         auto key = m_keys[m_currentIndex++];
@@ -131,7 +131,7 @@
         if (!value.isNull())
             return WTF::KeyValuePair<String, String> { WTFMove(key), WTFMove(value) };
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 FetchHeaders::Iterator::Iterator(FetchHeaders& headers)
diff --git a/Source/WebCore/Modules/fetch/FetchHeaders.h b/Source/WebCore/Modules/fetch/FetchHeaders.h
index c3e06b7..7f64ed1 100644
--- a/Source/WebCore/Modules/fetch/FetchHeaders.h
+++ b/Source/WebCore/Modules/fetch/FetchHeaders.h
@@ -64,7 +64,7 @@
     class Iterator {
     public:
         explicit Iterator(FetchHeaders&);
-        Optional<WTF::KeyValuePair<String, String>> next();
+        std::optional<WTF::KeyValuePair<String, String>> next();
 
     private:
         Ref<FetchHeaders> m_headers;
diff --git a/Source/WebCore/Modules/fetch/FetchRequest.cpp b/Source/WebCore/Modules/fetch/FetchRequest.cpp
index 5190017..ad19805 100644
--- a/Source/WebCore/Modules/fetch/FetchRequest.cpp
+++ b/Source/WebCore/Modules/fetch/FetchRequest.cpp
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-static Optional<Exception> setReferrerPolicy(FetchOptions& options, const String& referrerPolicy)
+static std::optional<Exception> setReferrerPolicy(FetchOptions& options, const String& referrerPolicy)
 {
     if (referrerPolicy.isEmpty())
         options.referrerPolicy = FetchOptions::ReferrerPolicy::EmptyString;
@@ -55,10 +55,10 @@
         options.referrerPolicy = FetchOptions::ReferrerPolicy::UnsafeUrl;
     else
         return Exception { TypeError, ASCIILiteral("Bad referrer policy value.") };
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setMode(FetchOptions& options, const String& mode)
+static std::optional<Exception> setMode(FetchOptions& options, const String& mode)
 {
     if (mode == "navigate")
         options.mode = FetchOptions::Mode::Navigate;
@@ -70,10 +70,10 @@
         options.mode = FetchOptions::Mode::Cors;
     else
         return Exception { TypeError, ASCIILiteral("Bad fetch mode value.") };
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setCredentials(FetchOptions& options, const String& credentials)
+static std::optional<Exception> setCredentials(FetchOptions& options, const String& credentials)
 {
     if (credentials == "omit")
         options.credentials = FetchOptions::Credentials::Omit;
@@ -83,10 +83,10 @@
         options.credentials = FetchOptions::Credentials::Include;
     else
         return Exception { TypeError, ASCIILiteral("Bad credentials mode value.") };
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setCache(FetchOptions& options, const String& cache)
+static std::optional<Exception> setCache(FetchOptions& options, const String& cache)
 {
     if (cache == "default")
         options.cache = FetchOptions::Cache::Default;
@@ -102,10 +102,10 @@
         options.cache = FetchOptions::Cache::OnlyIfCached;
     else
         return Exception { TypeError, ASCIILiteral("Bad cache mode value.") };
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setRedirect(FetchOptions& options, const String& redirect)
+static std::optional<Exception> setRedirect(FetchOptions& options, const String& redirect)
 {
     if (redirect == "follow")
         options.redirect = FetchOptions::Redirect::Follow;
@@ -115,10 +115,10 @@
         options.redirect = FetchOptions::Redirect::Manual;
     else
         return Exception { TypeError, ASCIILiteral("Bad redirect mode value.") };
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setMethod(ResourceRequest& request, const String& initMethod)
+static std::optional<Exception> setMethod(ResourceRequest& request, const String& initMethod)
 {
     if (!isValidHTTPToken(initMethod))
         return Exception { TypeError, ASCIILiteral("Method is not a valid HTTP token.") };
@@ -129,17 +129,17 @@
 
     request.setHTTPMethod((method == "DELETE" || method == "GET" || method == "HEAD" || method == "OPTIONS" || method == "POST" || method == "PUT") ? method : initMethod);
 
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> setReferrer(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
+static std::optional<Exception> setReferrer(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
 {
     String referrer;
     if (!init.get("referrer", referrer))
-        return Nullopt;
+        return std::nullopt;
     if (referrer.isEmpty()) {
         request.referrer = ASCIILiteral("no-referrer");
-        return Nullopt;
+        return std::nullopt;
     }
     // FIXME: Tighten the URL parsing algorithm according https://url.spec.whatwg.org/#concept-url-parser.
     URL referrerURL = context.completeURL(referrer);
@@ -148,17 +148,17 @@
 
     if (referrerURL.protocolIs("about") && referrerURL.path() == "client") {
         request.referrer = ASCIILiteral("client");
-        return Nullopt;
+        return std::nullopt;
     }
 
     if (!(context.securityOrigin() && context.securityOrigin()->canRequest(referrerURL)))
         return Exception { TypeError, ASCIILiteral("Referrer is not same-origin.") };
 
     request.referrer = referrerURL.string();
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<Exception> buildOptions(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
+static std::optional<Exception> buildOptions(FetchRequest::InternalRequest& request, ScriptExecutionContext& context, const Dictionary& init)
 {
     JSC::JSValue window;
     if (init.get("window", window)) {
@@ -213,7 +213,7 @@
         if (exception)
             return exception;
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 static bool methodCanHaveBody(const FetchRequest::InternalRequest& internalRequest)
@@ -320,7 +320,7 @@
     if (isDisturbedOrLocked())
         return Exception { TypeError };
 
-    auto clone = adoptRef(*new FetchRequest(context, Nullopt, FetchHeaders::create(m_headers.get()), FetchRequest::InternalRequest(m_internalRequest)));
+    auto clone = adoptRef(*new FetchRequest(context, std::nullopt, FetchHeaders::create(m_headers.get()), FetchRequest::InternalRequest(m_internalRequest)));
     clone->cloneBody(*this);
     return WTFMove(clone);
 }
diff --git a/Source/WebCore/Modules/fetch/FetchRequest.h b/Source/WebCore/Modules/fetch/FetchRequest.h
index b76265a..96fa951 100644
--- a/Source/WebCore/Modules/fetch/FetchRequest.h
+++ b/Source/WebCore/Modules/fetch/FetchRequest.h
@@ -43,7 +43,7 @@
 
 class FetchRequest final : public FetchBodyOwner {
 public:
-    static Ref<FetchRequest> create(ScriptExecutionContext& context) { return adoptRef(*new FetchRequest(context, Nullopt, FetchHeaders::create(FetchHeaders::Guard::Request), { })); }
+    static Ref<FetchRequest> create(ScriptExecutionContext& context) { return adoptRef(*new FetchRequest(context, std::nullopt, FetchHeaders::create(FetchHeaders::Guard::Request), { })); }
 
     ExceptionOr<FetchHeaders&> initializeWith(FetchRequest&, const Dictionary&);
     ExceptionOr<FetchHeaders&> initializeWith(const String&, const Dictionary&);
@@ -93,7 +93,7 @@
     const String& internalRequestReferrer() const { return m_internalRequest.referrer; }
 
 private:
-    FetchRequest(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&, InternalRequest&&);
+    FetchRequest(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&, InternalRequest&&);
 
     ExceptionOr<FetchHeaders&> initializeOptions(const Dictionary&);
 
@@ -104,7 +104,7 @@
     mutable String m_requestURL;
 };
 
-inline FetchRequest::FetchRequest(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, InternalRequest&& internalRequest)
+inline FetchRequest::FetchRequest(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, InternalRequest&& internalRequest)
     : FetchBodyOwner(context, WTFMove(body), WTFMove(headers))
     , m_internalRequest(WTFMove(internalRequest))
 {
diff --git a/Source/WebCore/Modules/fetch/FetchResponse.cpp b/Source/WebCore/Modules/fetch/FetchResponse.cpp
index 02e3135..35fb08b 100644
--- a/Source/WebCore/Modules/fetch/FetchResponse.cpp
+++ b/Source/WebCore/Modules/fetch/FetchResponse.cpp
@@ -82,7 +82,7 @@
     updateContentType();
 }
 
-FetchResponse::FetchResponse(ScriptExecutionContext& context, Optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response)
+FetchResponse::FetchResponse(ScriptExecutionContext& context, std::optional<FetchBody>&& body, Ref<FetchHeaders>&& headers, ResourceResponse&& response)
     : FetchBodyOwner(context, WTFMove(body), WTFMove(headers))
     , m_response(WTFMove(response))
 {
@@ -93,7 +93,7 @@
     ASSERT(scriptExecutionContext());
     ASSERT(!isDisturbedOrLocked());
 
-    auto clone = adoptRef(*new FetchResponse(*scriptExecutionContext(), Nullopt, FetchHeaders::create(headers()), ResourceResponse(m_response)));
+    auto clone = adoptRef(*new FetchResponse(*scriptExecutionContext(), std::nullopt, FetchHeaders::create(headers()), ResourceResponse(m_response)));
     clone->cloneBody(*this);
     return clone;
 }
@@ -105,9 +105,9 @@
     // Setting pending activity until BodyLoader didFail or didSucceed callback is called.
     response->setPendingActivity(response.ptr());
 
-    response->m_bodyLoader = BodyLoader(response.get(), WTFMove(promise));
+    response->m_bodyLoader.emplace(response.get(), WTFMove(promise));
     if (!response->m_bodyLoader->start(context, request))
-        response->m_bodyLoader = Nullopt;
+        response->m_bodyLoader = std::nullopt;
 }
 
 const String& FetchResponse::url() const
@@ -128,7 +128,7 @@
 #endif
 
     if (m_loader->isStarted())
-        m_response.m_bodyLoader = Nullopt;
+        m_response.m_bodyLoader = std::nullopt;
     m_response.unsetPendingActivity(&m_response);
 }
 
@@ -136,7 +136,7 @@
 {
     ASSERT(m_response.hasPendingActivity());
     if (m_promise)
-        std::exchange(m_promise, Nullopt)->reject(TypeError);
+        std::exchange(m_promise, std::nullopt)->reject(TypeError);
 
 #if ENABLE(READABLE_STREAM_API)
     if (m_response.m_readableStreamSource) {
@@ -148,7 +148,7 @@
 
     // Check whether didFail is called as part of FetchLoader::start.
     if (m_loader->isStarted())
-        m_response.m_bodyLoader = Nullopt;
+        m_response.m_bodyLoader = std::nullopt;
 
     m_response.unsetPendingActivity(&m_response);
 }
@@ -166,7 +166,7 @@
     m_response.m_response = resourceResponse;
     m_response.m_headers->filterAndFill(resourceResponse.httpHeaderFields(), FetchHeaders::Guard::Response);
 
-    std::exchange(m_promise, Nullopt)->resolve(m_response);
+    std::exchange(m_promise, std::nullopt)->resolve(m_response);
 }
 
 void FetchResponse::BodyLoader::didReceiveData(const char* data, size_t size)
@@ -204,7 +204,7 @@
 
 void FetchResponse::BodyLoader::stop()
 {
-    m_promise = Nullopt;
+    m_promise = std::nullopt;
     if (m_loader)
         m_loader->stop();
 }
diff --git a/Source/WebCore/Modules/fetch/FetchResponse.h b/Source/WebCore/Modules/fetch/FetchResponse.h
index ae1e744..6a6e67a 100644
--- a/Source/WebCore/Modules/fetch/FetchResponse.h
+++ b/Source/WebCore/Modules/fetch/FetchResponse.h
@@ -49,7 +49,7 @@
 public:
     using Type = ResourceResponse::Type;
 
-    static Ref<FetchResponse> create(ScriptExecutionContext& context) { return adoptRef(*new FetchResponse(context, Nullopt, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
+    static Ref<FetchResponse> create(ScriptExecutionContext& context) { return adoptRef(*new FetchResponse(context, std::nullopt, FetchHeaders::create(FetchHeaders::Guard::Response), ResourceResponse())); }
     static Ref<FetchResponse> error(ScriptExecutionContext&);
     static ExceptionOr<Ref<FetchResponse>> redirect(ScriptExecutionContext&, const String& url, int status);
 
@@ -86,7 +86,7 @@
     bool isLoading() const { return !!m_bodyLoader; }
 
 private:
-    FetchResponse(ScriptExecutionContext&, Optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceResponse&&);
+    FetchResponse(ScriptExecutionContext&, std::optional<FetchBody>&&, Ref<FetchHeaders>&&, ResourceResponse&&);
 
     static void startFetching(ScriptExecutionContext&, const FetchRequest&, FetchPromise&&);
 
@@ -117,12 +117,12 @@
         void didReceiveData(const char*, size_t) final;
 
         FetchResponse& m_response;
-        Optional<FetchPromise> m_promise;
+        std::optional<FetchPromise> m_promise;
         std::unique_ptr<FetchLoader> m_loader;
     };
 
     ResourceResponse m_response;
-    Optional<BodyLoader> m_bodyLoader;
+    std::optional<BodyLoader> m_bodyLoader;
     mutable String m_responseURL;
 
     FetchBodyConsumer m_consumer { FetchBodyConsumer::Type::ArrayBuffer  };
diff --git a/Source/WebCore/Modules/geolocation/Coordinates.cpp b/Source/WebCore/Modules/geolocation/Coordinates.cpp
index bbc76c7..8981fb5 100644
--- a/Source/WebCore/Modules/geolocation/Coordinates.cpp
+++ b/Source/WebCore/Modules/geolocation/Coordinates.cpp
@@ -28,31 +28,31 @@
 
 namespace WebCore {
 
-Optional<double> Coordinates::altitude() const
+std::optional<double> Coordinates::altitude() const
 {
     if (!m_canProvideAltitude)
-        return Nullopt;
+        return std::nullopt;
     return m_altitude;
 }
 
-Optional<double> Coordinates::altitudeAccuracy() const
+std::optional<double> Coordinates::altitudeAccuracy() const
 {
     if (!m_canProvideAltitudeAccuracy)
-        return Nullopt;
+        return std::nullopt;
     return m_altitudeAccuracy;
 }
 
-Optional<double> Coordinates::heading() const
+std::optional<double> Coordinates::heading() const
 {
     if (!m_canProvideHeading)
-        return Nullopt;
+        return std::nullopt;
     return m_heading;
 }
 
-Optional<double> Coordinates::speed() const
+std::optional<double> Coordinates::speed() const
 {
     if (!m_canProvideSpeed)
-        return Nullopt;
+        return std::nullopt;
     return m_speed;
 }
     
diff --git a/Source/WebCore/Modules/geolocation/Coordinates.h b/Source/WebCore/Modules/geolocation/Coordinates.h
index 83baac9..08c313b 100644
--- a/Source/WebCore/Modules/geolocation/Coordinates.h
+++ b/Source/WebCore/Modules/geolocation/Coordinates.h
@@ -42,11 +42,11 @@
 
     double latitude() const { return m_latitude; }
     double longitude() const { return m_longitude; }
-    Optional<double> altitude() const;
+    std::optional<double> altitude() const;
     double accuracy() const { return m_accuracy; }
-    Optional<double> altitudeAccuracy() const;
-    Optional<double> heading() const;
-    Optional<double> speed() const;
+    std::optional<double> altitudeAccuracy() const;
+    std::optional<double> heading() const;
+    std::optional<double> speed() const;
     
 private:
     Coordinates(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed)
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
index e3a5abd..ff2c219 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
@@ -72,7 +72,7 @@
     return prevunique;
 }
 
-Optional<IndexedDB::CursorDirection> IDBCursor::stringToDirection(const String& directionString)
+std::optional<IndexedDB::CursorDirection> IDBCursor::stringToDirection(const String& directionString)
 {
     if (directionString == directionNext())
         return IndexedDB::CursorDirection::Next;
@@ -83,7 +83,7 @@
     if (directionString == directionPrevUnique())
         return IndexedDB::CursorDirection::PrevNoDuplicate;
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 const AtomicString& IDBCursor::directionToString(IndexedDB::CursorDirection direction)
diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.h b/Source/WebCore/Modules/indexeddb/IDBCursor.h
index d0176de..cf20274 100644
--- a/Source/WebCore/Modules/indexeddb/IDBCursor.h
+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.h
@@ -50,7 +50,7 @@
     static const AtomicString& directionPrev();
     static const AtomicString& directionPrevUnique();
 
-    static Optional<IndexedDB::CursorDirection> stringToDirection(const String& modeString);
+    static std::optional<IndexedDB::CursorDirection> stringToDirection(const String& modeString);
     static const AtomicString& directionToString(IndexedDB::CursorDirection mode);
     
     virtual ~IDBCursor();
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.h b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
index c044d4e..424547d 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.h
@@ -58,7 +58,7 @@
     RefPtr<DOMStringList> objectStoreNames() const;
 
     struct ObjectStoreParameters {
-        Optional<IDBKeyPath> keyPath;
+        std::optional<IDBKeyPath> keyPath;
         bool autoIncrement;
     };
 
diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h b/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
index 9cff7a2..dd9f14f 100644
--- a/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
+++ b/Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
@@ -59,7 +59,7 @@
         unsigned mainFrameProtocolHash = StringHash::hash(m_mainFrameOrigin.protocol);
         unsigned mainFrameHostHash = StringHash::hash(m_mainFrameOrigin.host);
         
-        unsigned hashCodes[7] = { nameHash, openingProtocolHash, openingHostHash, m_openingOrigin.port.valueOr(0), mainFrameProtocolHash, mainFrameHostHash, m_mainFrameOrigin.port.valueOr(0) };
+        unsigned hashCodes[7] = { nameHash, openingProtocolHash, openingHostHash, m_openingOrigin.port.value_or(0), mainFrameProtocolHash, mainFrameHostHash, m_mainFrameOrigin.port.value_or(0) };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
 
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
index 1c440b8..78c188b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp
@@ -76,14 +76,14 @@
 {
 }
 
-ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::open(ScriptExecutionContext& context, const String& name, Optional<uint64_t> version)
+ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::open(ScriptExecutionContext& context, const String& name, std::optional<uint64_t> version)
 {
     LOG(IndexedDB, "IDBFactory::open");
     
     if (version && !version.value())
         return Exception { TypeError, ASCIILiteral("IDBFactory.open() called with a version of 0") };
 
-    return openInternal(context, name, version.valueOr(0));
+    return openInternal(context, name, version.value_or(0));
 }
 
 ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::openInternal(ScriptExecutionContext& context, const String& name, unsigned long long version)
diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.h b/Source/WebCore/Modules/indexeddb/IDBFactory.h
index 2726743..734f20c 100644
--- a/Source/WebCore/Modules/indexeddb/IDBFactory.h
+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.h
@@ -54,7 +54,7 @@
     static Ref<IDBFactory> create(IDBClient::IDBConnectionProxy&);
     ~IDBFactory();
 
-    ExceptionOr<Ref<IDBOpenDBRequest>> open(ScriptExecutionContext&, const String& name, Optional<uint64_t> version);
+    ExceptionOr<Ref<IDBOpenDBRequest>> open(ScriptExecutionContext&, const String& name, std::optional<uint64_t> version);
     ExceptionOr<Ref<IDBOpenDBRequest>> deleteDatabase(ScriptExecutionContext&, const String& name);
 
     ExceptionOr<short> cmp(JSC::ExecState&, JSC::JSValue first, JSC::JSValue second);
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
index 527bba9..6a08cd9 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
@@ -321,7 +321,7 @@
     return transaction.requestGetKey(execState, *this, range);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBIndex::getAll");
     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
@@ -335,7 +335,7 @@
     return m_objectStore.transaction().requestGetAllIndexRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, JSValue key, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAll(ExecState& execState, JSValue key, std::optional<uint32_t> count)
 {
     auto onlyResult = IDBKeyRange::only(execState, key);
     if (onlyResult.hasException())
@@ -344,7 +344,7 @@
     return getAll(execState, onlyResult.releaseReturnValue(), count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBIndex::getAllKeys");
     ASSERT(currentThread() == m_objectStore.transaction().database().originThreadID());
@@ -358,7 +358,7 @@
     return m_objectStore.transaction().requestGetAllIndexRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBIndex::getAllKeys(ExecState& execState, JSValue key, std::optional<uint32_t> count)
 {
     auto onlyResult = IDBKeyRange::only(execState, key);
     if (onlyResult.hasException())
diff --git a/Source/WebCore/Modules/indexeddb/IDBIndex.h b/Source/WebCore/Modules/indexeddb/IDBIndex.h
index 0eb1b9e..ed8cd65 100644
--- a/Source/WebCore/Modules/indexeddb/IDBIndex.h
+++ b/Source/WebCore/Modules/indexeddb/IDBIndex.h
@@ -70,10 +70,10 @@
     ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, IDBKeyRange*);
     ExceptionOr<Ref<IDBRequest>> getKey(JSC::ExecState&, JSC::JSValue key);
 
-    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count);
 
     const IDBIndexInfo& info() const { return m_info; }
 
diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
index e6faa19..7c3f021 100644
--- a/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
+++ b/Source/WebCore/Modules/indexeddb/IDBKeyPath.h
@@ -45,7 +45,7 @@
 
 void IDBParseKeyPath(const String&, Vector<String>&, IDBKeyPathParseError&);
 IDBKeyPath isolatedCopy(const IDBKeyPath&);
-inline Optional<IDBKeyPath> isolatedCopy(const Optional<IDBKeyPath>& variant)
+inline std::optional<IDBKeyPath> isolatedCopy(const std::optional<IDBKeyPath>& variant)
 {
     if (!variant)
         return { };
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
index 4f9c495..f5684e8 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
@@ -116,7 +116,7 @@
     return { };
 }
 
-const Optional<IDBKeyPath>& IDBObjectStore::keyPath() const
+const std::optional<IDBKeyPath>& IDBObjectStore::keyPath() const
 {
     ASSERT(currentThread() == m_transaction.database().originThreadID());
     return m_info.keyPath();
@@ -541,7 +541,7 @@
     return m_transaction.requestCount(execState, *this, range);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBObjectStore::getAll");
     ASSERT(currentThread() == m_transaction.database().originThreadID());
@@ -555,7 +555,7 @@
     return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Values, count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValue key, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAll(ExecState& execState, JSValue key, std::optional<uint32_t> count)
 {
     auto onlyResult = IDBKeyRange::only(execState, key);
     if (onlyResult.hasException())
@@ -564,7 +564,7 @@
     return getAll(execState, onlyResult.releaseReturnValue(), count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, RefPtr<IDBKeyRange> range, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBObjectStore::getAllKeys");
     ASSERT(currentThread() == m_transaction.database().originThreadID());
@@ -578,7 +578,7 @@
     return m_transaction.requestGetAllObjectStoreRecords(execState, *this, range.get(), IndexedDB::GetAllType::Keys, count);
 }
 
-ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, JSValue key, Optional<uint32_t> count)
+ExceptionOr<Ref<IDBRequest>> IDBObjectStore::getAllKeys(ExecState& execState, JSValue key, std::optional<uint32_t> count)
 {
     auto onlyResult = IDBKeyRange::only(execState, key);
     if (onlyResult.hasException())
diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
index 640693d..081700b 100644
--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
@@ -61,7 +61,7 @@
 
     const String& name() const;
     ExceptionOr<void> setName(const String&);
-    const Optional<IDBKeyPath>& keyPath() const;
+    const std::optional<IDBKeyPath>& keyPath() const;
     RefPtr<DOMStringList> indexNames() const;
     IDBTransaction& transaction();
     bool autoIncrement() const;
@@ -87,10 +87,10 @@
     ExceptionOr<void> deleteIndex(const String& name);
     ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, IDBKeyRange*);
     ExceptionOr<Ref<IDBRequest>> count(JSC::ExecState&, JSC::JSValue key);
-    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, Optional<uint32_t> count);
-    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, Optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAll(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, RefPtr<IDBKeyRange>, std::optional<uint32_t> count);
+    ExceptionOr<Ref<IDBRequest>> getAllKeys(JSC::ExecState&, JSC::JSValue key, std::optional<uint32_t> count);
 
     ExceptionOr<Ref<IDBRequest>> putForCursorUpdate(JSC::ExecState&, JSC::JSValue, JSC::JSValue key);
 
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
index 38decd5..b8326af 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
@@ -756,7 +756,7 @@
     request.didOpenOrIterateCursor(resultData);
 }
 
-Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, Optional<uint32_t> count)
+Ref<IDBRequest> IDBTransaction::requestGetAllObjectStoreRecords(JSC::ExecState& state, IDBObjectStore& objectStore, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetAllObjectStoreRecords");
     ASSERT(isActive());
@@ -774,7 +774,7 @@
     return request;
 }
 
-Ref<IDBRequest> IDBTransaction::requestGetAllIndexRecords(JSC::ExecState& state, IDBIndex& index, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, Optional<uint32_t> count)
+Ref<IDBRequest> IDBTransaction::requestGetAllIndexRecords(JSC::ExecState& state, IDBIndex& index, const IDBKeyRangeData& keyRangeData, IndexedDB::GetAllType getAllType, std::optional<uint32_t> count)
 {
     LOG(IndexedDB, "IDBTransaction::requestGetAllIndexRecords");
     ASSERT(isActive());
diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.h b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
index 56a2ae8..ff18d89 100644
--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.h
+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.h
@@ -115,8 +115,8 @@
 
     Ref<IDBRequest> requestPutOrAdd(JSC::ExecState&, IDBObjectStore&, IDBKey*, SerializedScriptValue&, IndexedDB::ObjectStoreOverwriteMode);
     Ref<IDBRequest> requestGetRecord(JSC::ExecState&, IDBObjectStore&, const IDBGetRecordData&);
-    Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count);
-    Ref<IDBRequest> requestGetAllIndexRecords(JSC::ExecState&, IDBIndex&, const IDBKeyRangeData&, IndexedDB::GetAllType, Optional<uint32_t> count);
+    Ref<IDBRequest> requestGetAllObjectStoreRecords(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&, IndexedDB::GetAllType, std::optional<uint32_t> count);
+    Ref<IDBRequest> requestGetAllIndexRecords(JSC::ExecState&, IDBIndex&, const IDBKeyRangeData&, IndexedDB::GetAllType, std::optional<uint32_t> count);
     Ref<IDBRequest> requestDeleteRecord(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&);
     Ref<IDBRequest> requestClearObjectStore(JSC::ExecState&, IDBObjectStore&);
     Ref<IDBRequest> requestCount(JSC::ExecState&, IDBObjectStore&, const IDBKeyRangeData&);
diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
index 3074200..e84a733 100644
--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp
@@ -38,7 +38,7 @@
     if (newVersion)
         m_newVersion = newVersion;
     else
-        m_newVersion = Nullopt;
+        m_newVersion = std::nullopt;
 }
 
 IDBVersionChangeEvent::IDBVersionChangeEvent(const AtomicString& name, const Init& init, IsTrusted isTrusted)
diff --git a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
index e9218eb..0801720 100644
--- a/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
+++ b/Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h
@@ -47,7 +47,7 @@
 
     struct Init : EventInit {
         uint64_t oldVersion { 0 };
-        Optional<uint64_t> newVersion;
+        std::optional<uint64_t> newVersion;
     };
 
     static Ref<IDBVersionChangeEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
@@ -60,7 +60,7 @@
     bool isVersionChangeEvent() const final { return true; }
 
     uint64_t oldVersion() const { return m_oldVersion; }
-    Optional<uint64_t> newVersion() const { return m_newVersion; }
+    std::optional<uint64_t> newVersion() const { return m_newVersion; }
 
 private:
     IDBVersionChangeEvent(const IDBResourceIdentifier& requestIdentifier, uint64_t oldVersion, uint64_t newVersion, const AtomicString& eventType);
@@ -70,7 +70,7 @@
 
     IDBResourceIdentifier m_requestIdentifier;
     uint64_t m_oldVersion;
-    Optional<uint64_t> m_newVersion;
+    std::optional<uint64_t> m_newVersion;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp
index 7d0e069..2b69b55 100644
--- a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp
+++ b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.cpp
@@ -35,7 +35,7 @@
 
 enum class KeyPathType { Null, String, Array };
 
-RefPtr<SharedBuffer> serializeIDBKeyPath(const Optional<IDBKeyPath>& keyPath)
+RefPtr<SharedBuffer> serializeIDBKeyPath(const std::optional<IDBKeyPath>& keyPath)
 {
     auto encoder = KeyedEncoder::encoder();
 
@@ -56,7 +56,7 @@
     return encoder->finishEncoding();
 }
 
-bool deserializeIDBKeyPath(const uint8_t* data, size_t size, Optional<IDBKeyPath>& result)
+bool deserializeIDBKeyPath(const uint8_t* data, size_t size, std::optional<IDBKeyPath>& result)
 {
     if (!data || !size)
         return false;
diff --git a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h
index 597203e..094fbc6 100644
--- a/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h
+++ b/Source/WebCore/Modules/indexeddb/server/IDBSerialization.h
@@ -34,8 +34,8 @@
 
 class IDBKeyData;
 
-RefPtr<SharedBuffer> serializeIDBKeyPath(const Optional<IDBKeyPath>&);
-bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, Optional<IDBKeyPath>&);
+RefPtr<SharedBuffer> serializeIDBKeyPath(const std::optional<IDBKeyPath>&);
+bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, std::optional<IDBKeyPath>&);
 
 RefPtr<SharedBuffer> serializeIDBKeyData(const IDBKeyData&);
 bool deserializeIDBKeyData(const uint8_t* buffer, size_t bufferSize, IDBKeyData&);
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp
index 307c7a1..e92d268 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.cpp
@@ -158,7 +158,7 @@
     return count;
 }
 
-void MemoryIndex::getAllRecords(const IDBKeyRangeData& keyRangeData, Optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const
+void MemoryIndex::getAllRecords(const IDBKeyRangeData& keyRangeData, std::optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const
 {
     LOG(IndexedDB, "MemoryIndex::getAllRecords");
 
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h
index 8475984..5bf9cba 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryIndex.h
@@ -68,7 +68,7 @@
 
     IDBGetResult getResultForKeyRange(IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
     uint64_t countForKeyRange(const IDBKeyRangeData&);
-    void getAllRecords(const IDBKeyRangeData&, Optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const;
+    void getAllRecords(const IDBKeyRangeData&, std::optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const;
 
     IDBError putIndexKey(const IDBKeyData&, const IndexKey&);
 
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp
index fa44b7b..34b4e12 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp
@@ -408,7 +408,7 @@
     return m_keyValueStore->get(key);
 }
 
-void MemoryObjectStore::getAllRecords(const IDBKeyRangeData& keyRangeData, Optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const
+void MemoryObjectStore::getAllRecords(const IDBKeyRangeData& keyRangeData, std::optional<uint32_t> count, IndexedDB::GetAllType type, IDBGetAllResult& result) const
 {
     result = { type };
 
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h
index 6209861..e61a0ee 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h
@@ -88,7 +88,7 @@
     IDBGetResult indexValueForKeyRange(uint64_t indexIdentifier, IndexedDB::IndexRecordType, const IDBKeyRangeData&) const;
     uint64_t countForKeyRange(uint64_t indexIdentifier, const IDBKeyRangeData&) const;
 
-    void getAllRecords(const IDBKeyRangeData&, Optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const;
+    void getAllRecords(const IDBKeyRangeData&, std::optional<uint32_t> count, IndexedDB::GetAllType, IDBGetAllResult&) const;
 
     const IDBObjectStoreInfo& info() const { return m_info; }
 
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
index 8ab7743..d95efe6 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.cpp
@@ -51,7 +51,7 @@
 
 void MemoryObjectStoreCursor::objectStoreCleared()
 {
-    m_iterator = Nullopt;
+    m_iterator = std::nullopt;
 }
 
 void MemoryObjectStoreCursor::keyDeleted(const IDBKeyData& key)
@@ -59,7 +59,7 @@
     if (m_currentPositionKey != key)
         return;
 
-    m_iterator = Nullopt;
+    m_iterator = std::nullopt;
 }
 
 void MemoryObjectStoreCursor::keyAdded(std::set<IDBKeyData>::iterator iterator)
@@ -73,7 +73,7 @@
 
 void MemoryObjectStoreCursor::setFirstInRemainingRange(std::set<IDBKeyData>& set)
 {
-    m_iterator = Nullopt;
+    m_iterator = std::nullopt;
 
     if (m_info.isDirectionForward()) {
         setForwardIteratorFromRemainingRange(set);
@@ -95,19 +95,19 @@
 void MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange(std::set<IDBKeyData>& set)
 {
     if (!set.size()) {
-        m_iterator = Nullopt;
+        m_iterator = std::nullopt;
         return;
     }
 
     if (m_remainingRange.isExactlyOneKey()) {
         m_iterator = set.find(m_remainingRange.lowerKey);
         if (*m_iterator == set.end())
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
 
         return;
     }
 
-    m_iterator = Nullopt;
+    m_iterator = std::nullopt;
 
     auto lowest = set.lower_bound(m_remainingRange.lowerKey);
     if (lowest == set.end())
@@ -133,14 +133,14 @@
 void MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange(std::set<IDBKeyData>& set)
 {
     if (!set.size()) {
-        m_iterator = Nullopt;
+        m_iterator = std::nullopt;
         return;
     }
 
     if (m_remainingRange.isExactlyOneKey()) {
         m_iterator = set.find(m_remainingRange.lowerKey);
         if (*m_iterator == set.end())
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
 
         return;
     }
@@ -148,12 +148,12 @@
     if (!m_remainingRange.upperKey.isValid()) {
         m_iterator = --set.end();
         if (!m_remainingRange.containsKey(**m_iterator))
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
 
         return;
     }
 
-    m_iterator = Nullopt;
+    m_iterator = std::nullopt;
 
     // This is one record past the actual key we're looking for.
     auto highest = set.upper_bound(m_remainingRange.upperKey);
@@ -248,7 +248,7 @@
         ++*m_iterator;
 
         if (*m_iterator == set.end() || !m_info.range().containsKey(**m_iterator)) {
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
             return;
         }
     }
@@ -300,7 +300,7 @@
 
     while (count) {
         if (*m_iterator == set.begin()) {
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
             return;
         }
 
@@ -308,7 +308,7 @@
         --*m_iterator;
 
         if (!m_info.range().containsKey(**m_iterator)) {
-            m_iterator = Nullopt;
+            m_iterator = std::nullopt;
             return;
         }
     }
diff --git a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h
index e345557..633f1e6 100644
--- a/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h
+++ b/Source/WebCore/Modules/indexeddb/server/MemoryObjectStoreCursor.h
@@ -63,7 +63,7 @@
 
     IDBKeyRangeData m_remainingRange;
 
-    WTF::Optional<std::set<IDBKeyData>::iterator> m_iterator;
+    std::optional<std::set<IDBKeyData>::iterator> m_iterator;
 
     IDBKeyData m_currentPositionKey;
 };
diff --git a/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp b/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
index a2cccad..461b9c9 100644
--- a/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
+++ b/Source/WebCore/Modules/indexeddb/server/SQLiteIDBBackingStore.cpp
@@ -602,7 +602,7 @@
             Vector<char> keyPathBuffer;
             sql.getColumnBlobAsVector(2, keyPathBuffer);
 
-            Optional<IDBKeyPath> objectStoreKeyPath;
+            std::optional<IDBKeyPath> objectStoreKeyPath;
             if (!deserializeIDBKeyPath(reinterpret_cast<const uint8_t*>(keyPathBuffer.data()), keyPathBuffer.size(), objectStoreKeyPath)) {
                 LOG_ERROR("Unable to extract key path from database");
                 return nullptr;
@@ -635,7 +635,7 @@
             Vector<char> keyPathBuffer;
             sql.getColumnBlobAsVector(3, keyPathBuffer);
 
-            Optional<IDBKeyPath> indexKeyPath;
+            std::optional<IDBKeyPath> indexKeyPath;
             if (!deserializeIDBKeyPath(reinterpret_cast<const uint8_t*>(keyPathBuffer.data()), keyPathBuffer.size(), indexKeyPath)) {
                 LOG_ERROR("Unable to extract key path from database");
                 return nullptr;
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp
index f985717..e5df15c 100644
--- a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp
+++ b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.cpp
@@ -66,7 +66,7 @@
     return false;
 }
 
-IDBObjectStoreInfo IDBDatabaseInfo::createNewObjectStore(const String& name, Optional<IDBKeyPath>&& keyPath, bool autoIncrement)
+IDBObjectStoreInfo IDBDatabaseInfo::createNewObjectStore(const String& name, std::optional<IDBKeyPath>&& keyPath, bool autoIncrement)
 {
     IDBObjectStoreInfo info(++m_maxObjectStoreID, name, WTFMove(keyPath), autoIncrement);
     m_objectStoreMap.set(info.identifier(), info);
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h
index 53df05a..db8ff2c 100644
--- a/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h
+++ b/Source/WebCore/Modules/indexeddb/shared/IDBDatabaseInfo.h
@@ -47,7 +47,7 @@
     uint64_t version() const { return m_version; }
 
     bool hasObjectStore(const String& name) const;
-    IDBObjectStoreInfo createNewObjectStore(const String& name, Optional<IDBKeyPath>&&, bool autoIncrement);
+    IDBObjectStoreInfo createNewObjectStore(const String& name, std::optional<IDBKeyPath>&&, bool autoIncrement);
     void addExistingObjectStore(const IDBObjectStoreInfo&);
     IDBObjectStoreInfo* infoForExistingObjectStore(uint64_t objectStoreIdentifier);
     IDBObjectStoreInfo* infoForExistingObjectStore(const String& objectStoreName);
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h b/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h
index f97f332..1163483 100644
--- a/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h
+++ b/Source/WebCore/Modules/indexeddb/shared/IDBGetAllRecordsData.h
@@ -40,7 +40,7 @@
 struct IDBGetAllRecordsData {
     IDBKeyRangeData keyRangeData;
     IndexedDB::GetAllType getAllType;
-    Optional<uint32_t> count;
+    std::optional<uint32_t> count;
     uint64_t objectStoreIdentifier;
     uint64_t indexIdentifier;
 
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp
index 6820a9f..acdea1e 100644
--- a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp
+++ b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.cpp
@@ -35,7 +35,7 @@
 {
 }
 
-IDBObjectStoreInfo::IDBObjectStoreInfo(uint64_t identifier, const String& name, Optional<IDBKeyPath>&& keyPath, bool autoIncrement)
+IDBObjectStoreInfo::IDBObjectStoreInfo(uint64_t identifier, const String& name, std::optional<IDBKeyPath>&& keyPath, bool autoIncrement)
     : m_identifier(identifier)
     , m_name(name)
     , m_keyPath(WTFMove(keyPath))
diff --git a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h
index 56e24c0..d7205f2 100644
--- a/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h
+++ b/Source/WebCore/Modules/indexeddb/shared/IDBObjectStoreInfo.h
@@ -37,11 +37,11 @@
 class IDBObjectStoreInfo {
 public:
     WEBCORE_EXPORT IDBObjectStoreInfo();
-    IDBObjectStoreInfo(uint64_t identifier, const String& name, Optional<IDBKeyPath>&&, bool autoIncrement);
+    IDBObjectStoreInfo(uint64_t identifier, const String& name, std::optional<IDBKeyPath>&&, bool autoIncrement);
 
     uint64_t identifier() const { return m_identifier; }
     const String& name() const { return m_name; }
-    const Optional<IDBKeyPath>& keyPath() const { return m_keyPath; }
+    const std::optional<IDBKeyPath>& keyPath() const { return m_keyPath; }
     bool autoIncrement() const { return m_autoIncrement; }
     uint64_t maxIndexID() const { return m_maxIndexID; }
 
@@ -72,7 +72,7 @@
 private:
     uint64_t m_identifier { 0 };
     String m_name;
-    Optional<IDBKeyPath> m_keyPath;
+    std::optional<IDBKeyPath> m_keyPath;
     bool m_autoIncrement { false };
     uint64_t m_maxIndexID { 0 };
 
diff --git a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
index 0420d72..e847425 100644
--- a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
+++ b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.cpp
@@ -102,7 +102,7 @@
     return page->group().captionPreferences().sortedTrackListForMenu(&trackList);
 }
 
-String MediaControlsHost::displayNameForTrack(const Optional<TextOrAudioTrack>& track)
+String MediaControlsHost::displayNameForTrack(const std::optional<TextOrAudioTrack>& track)
 {
     if (!track)
         return emptyString();
diff --git a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h
index 5053822..44dddd4 100644
--- a/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h
+++ b/Source/WebCore/Modules/mediacontrols/MediaControlsHost.h
@@ -57,7 +57,7 @@
     Vector<RefPtr<AudioTrack>> sortedTrackListForMenu(AudioTrackList&);
 
     using TextOrAudioTrack = WTF::Variant<RefPtr<TextTrack>, RefPtr<AudioTrack>>;
-    String displayNameForTrack(const Optional<TextOrAudioTrack>&);
+    String displayNameForTrack(const std::optional<TextOrAudioTrack>&);
 
     TextTrack* captionMenuOffItem();
     TextTrack* captionMenuAutomaticItem();
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.cpp b/Source/WebCore/Modules/mediasource/MediaSource.cpp
index 8f14587..5952bd9 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.cpp
+++ b/Source/WebCore/Modules/mediasource/MediaSource.cpp
@@ -542,7 +542,7 @@
     onReadyStateChange(oldState, state);
 }
 
-ExceptionOr<void> MediaSource::endOfStream(Optional<EndOfStreamError> error)
+ExceptionOr<void> MediaSource::endOfStream(std::optional<EndOfStreamError> error)
 {
     // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#widl-MediaSource-endOfStream-void-EndOfStreamError-error
     // 1. If the readyState attribute is not in the "open" state then throw an
@@ -561,7 +561,7 @@
     return { };
 }
 
-void MediaSource::streamEndedWithError(Optional<EndOfStreamError> error)
+void MediaSource::streamEndedWithError(std::optional<EndOfStreamError> error)
 {
     LOG(MediaSource, "MediaSource::streamEndedWithError(%p)", this);
     if (isClosed())
diff --git a/Source/WebCore/Modules/mediasource/MediaSource.h b/Source/WebCore/Modules/mediasource/MediaSource.h
index 5a5320b..549319f 100644
--- a/Source/WebCore/Modules/mediasource/MediaSource.h
+++ b/Source/WebCore/Modules/mediasource/MediaSource.h
@@ -65,7 +65,7 @@
     void sourceBufferDidChangeActiveState(SourceBuffer&, bool);
 
     enum class EndOfStreamError { Network, Decode };
-    void streamEndedWithError(Optional<EndOfStreamError>);
+    void streamEndedWithError(std::optional<EndOfStreamError>);
 
     MediaTime duration() const final;
     void durationChanged(const MediaTime&) final;
@@ -83,7 +83,7 @@
     ExceptionOr<void> setDurationInternal(const MediaTime&);
     MediaTime currentTime() const;
     const AtomicString& readyState() const { return m_readyState; }
-    ExceptionOr<void> endOfStream(Optional<EndOfStreamError>);
+    ExceptionOr<void> endOfStream(std::optional<EndOfStreamError>);
 
     HTMLMediaElement* mediaElement() const { return m_mediaElement; }
 
diff --git a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
index 98ce902..71e0d97 100644
--- a/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
+++ b/Source/WebCore/Modules/mediastream/MediaStreamTrack.h
@@ -127,7 +127,7 @@
     Ref<MediaStreamTrackPrivate> m_private;
 
     RefPtr<MediaConstraints> m_constraints;
-    Optional<DOMPromise<void>> m_promise;
+    std::optional<DOMPromise<void>> m_promise;
     WeakPtrFactory<MediaStreamTrack> m_weakPtrFactory;
 
     bool m_ended { false };
diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
index b66ba6e..1446879 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
@@ -60,7 +60,7 @@
 
     ASSERT(m_offerAnswerPromise);
     m_offerAnswerPromise->resolve(RTCSessionDescription::create(RTCSessionDescription::SdpType::Offer, WTFMove(sdp)));
-    m_offerAnswerPromise = Nullopt;
+    m_offerAnswerPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::createOfferFailed(Exception&& exception)
@@ -72,7 +72,7 @@
 
     ASSERT(m_offerAnswerPromise);
     m_offerAnswerPromise->reject(WTFMove(exception));
-    m_offerAnswerPromise = Nullopt;
+    m_offerAnswerPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::createAnswer(RTCAnswerOptions&& options, PeerConnection::SessionDescriptionPromise&& promise)
@@ -93,7 +93,7 @@
 
     ASSERT(m_offerAnswerPromise);
     m_offerAnswerPromise->resolve(RTCSessionDescription::create(RTCSessionDescription::SdpType::Answer, WTFMove(sdp)));
-    m_offerAnswerPromise = Nullopt;
+    m_offerAnswerPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::createAnswerFailed(Exception&& exception)
@@ -105,7 +105,7 @@
 
     ASSERT(m_offerAnswerPromise);
     m_offerAnswerPromise->reject(WTFMove(exception));
-    m_offerAnswerPromise = Nullopt;
+    m_offerAnswerPromise = std::nullopt;
 }
 
 static inline bool isLocalDescriptionTypeValidForState(RTCSessionDescription::SdpType type, PeerConnectionStates::SignalingState state)
@@ -150,7 +150,7 @@
     ASSERT(m_setDescriptionPromise);
 
     m_setDescriptionPromise->resolve();
-    m_setDescriptionPromise = Nullopt;
+    m_setDescriptionPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::setLocalDescriptionFailed(Exception&& exception)
@@ -163,7 +163,7 @@
     ASSERT(m_setDescriptionPromise);
 
     m_setDescriptionPromise->reject(WTFMove(exception));
-    m_setDescriptionPromise = Nullopt;
+    m_setDescriptionPromise = std::nullopt;
 }
 
 static inline bool isRemoteDescriptionTypeValidForState(RTCSessionDescription::SdpType type, PeerConnectionStates::SignalingState state)
@@ -208,7 +208,7 @@
     ASSERT(m_setDescriptionPromise);
 
     m_setDescriptionPromise->resolve();
-    m_setDescriptionPromise = Nullopt;
+    m_setDescriptionPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::setRemoteDescriptionFailed(Exception&& exception)
@@ -221,7 +221,7 @@
     ASSERT(m_setDescriptionPromise);
 
     m_setDescriptionPromise->reject(WTFMove(exception));
-    m_setDescriptionPromise = Nullopt;
+    m_setDescriptionPromise = std::nullopt;
 }
 
 void PeerConnectionBackend::addIceCandidate(RTCIceCandidate& iceCandidate, PeerConnection::VoidPromise&& promise)
@@ -247,7 +247,7 @@
     ASSERT(m_addIceCandidatePromise);
 
     m_addIceCandidatePromise->resolve();
-    m_addIceCandidatePromise = Nullopt;
+    m_addIceCandidatePromise = std::nullopt;
 }
 
 void PeerConnectionBackend::addIceCandidateFailed(Exception&& exception)
@@ -259,7 +259,7 @@
     ASSERT(m_addIceCandidatePromise);
 
     m_addIceCandidatePromise->reject(WTFMove(exception));
-    m_addIceCandidatePromise = Nullopt;
+    m_addIceCandidatePromise = std::nullopt;
 }
 
 void PeerConnectionBackend::fireICECandidateEvent(RefPtr<RTCIceCandidate>&& candidate)
@@ -289,9 +289,9 @@
 
 void PeerConnectionBackend::stop()
 {
-    m_offerAnswerPromise = Nullopt;
-    m_setDescriptionPromise = Nullopt;
-    m_addIceCandidatePromise = Nullopt;
+    m_offerAnswerPromise = std::nullopt;
+    m_setDescriptionPromise = std::nullopt;
+    m_addIceCandidatePromise = std::nullopt;
 
     doStop();
 }
diff --git a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
index c84b816..ca86191 100644
--- a/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
+++ b/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
@@ -139,9 +139,9 @@
     RTCPeerConnection& m_peerConnection;
 
 private:
-    Optional<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
-    Optional<PeerConnection::VoidPromise> m_setDescriptionPromise;
-    Optional<PeerConnection::VoidPromise> m_addIceCandidatePromise;
+    std::optional<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
+    std::optional<PeerConnection::VoidPromise> m_setDescriptionPromise;
+    std::optional<PeerConnection::VoidPromise> m_addIceCandidatePromise;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
index 8330c87..5dd2f1e 100644
--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
@@ -85,7 +85,7 @@
     return m_handler->currentToneBuffer();
 }
 
-ExceptionOr<void> RTCDTMFSender::insertDTMF(const String& tones, Optional<int> duration, Optional<int> interToneGap)
+ExceptionOr<void> RTCDTMFSender::insertDTMF(const String& tones, std::optional<int> duration, std::optional<int> interToneGap)
 {
     if (!canInsertDTMF())
         return Exception { NOT_SUPPORTED_ERR };
@@ -96,8 +96,8 @@
     if (interToneGap && interToneGap.value() < minInterToneGapMs)
         return Exception { SYNTAX_ERR };
 
-    m_duration = duration.valueOr(defaultToneDurationMs);
-    m_interToneGap = interToneGap.valueOr(defaultInterToneGapMs);
+    m_duration = duration.value_or(defaultToneDurationMs);
+    m_interToneGap = interToneGap.value_or(defaultInterToneGapMs);
 
     if (!m_handler->insertDTMF(tones, m_duration, m_interToneGap))
         return Exception { SYNTAX_ERR };
diff --git a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
index fca4253..c722871 100644
--- a/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
+++ b/Source/WebCore/Modules/mediastream/RTCDTMFSender.h
@@ -51,7 +51,7 @@
     long duration() const { return m_duration; }
     long interToneGap() const { return m_interToneGap; }
 
-    ExceptionOr<void> insertDTMF(const String& tones, Optional<int> duration, Optional<int> interToneGap);
+    ExceptionOr<void> insertDTMF(const String& tones, std::optional<int> duration, std::optional<int> interToneGap);
 
     using RefCounted::ref;
     using RefCounted::deref;
diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
index 118654c..85ee7c1 100644
--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.cpp
@@ -49,7 +49,7 @@
     String sdpMid;
     dictionary.getWithUndefinedOrNullCheck("sdpMid", sdpMid);
 
-    Optional<unsigned short> sdpMLineIndex;
+    std::optional<unsigned short> sdpMLineIndex;
     String sdpMLineIndexString;
 
     if (dictionary.getWithUndefinedOrNullCheck("sdpMLineIndex", sdpMLineIndexString)) {
@@ -66,12 +66,12 @@
     return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex));
 }
 
-Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex)
+Ref<RTCIceCandidate> RTCIceCandidate::create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex)
 {
     return adoptRef(*new RTCIceCandidate(candidate, sdpMid, sdpMLineIndex));
 }
 
-RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex)
+RTCIceCandidate::RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex)
     : m_candidate(candidate)
     , m_sdpMid(sdpMid)
     , m_sdpMLineIndex(sdpMLineIndex)
diff --git a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
index d789f3d..9a870ff 100644
--- a/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
+++ b/Source/WebCore/Modules/mediastream/RTCIceCandidate.h
@@ -44,18 +44,18 @@
 class RTCIceCandidate : public RefCounted<RTCIceCandidate>, public ScriptWrappable {
 public:
     static ExceptionOr<Ref<RTCIceCandidate>> create(const Dictionary&);
-    static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex);
+    static Ref<RTCIceCandidate> create(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex);
 
     const String& candidate() const { return m_candidate; }
     const String& sdpMid() const { return m_sdpMid; }
-    Optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; }
+    std::optional<unsigned short> sdpMLineIndex() const { return m_sdpMLineIndex; }
 
 private:
-    explicit RTCIceCandidate(const String& candidate, const String& sdpMid, Optional<unsigned short> sdpMLineIndex);
+    explicit RTCIceCandidate(const String& candidate, const String& sdpMid, std::optional<unsigned short> sdpMLineIndex);
 
     String m_candidate;
     String m_sdpMid;
-    Optional<unsigned short> m_sdpMLineIndex;
+    std::optional<unsigned short> m_sdpMLineIndex;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/Modules/mediastream/SDPProcessor.cpp b/Source/WebCore/Modules/mediastream/SDPProcessor.cpp
index 9a11cab..145d411 100644
--- a/Source/WebCore/Modules/mediastream/SDPProcessor.cpp
+++ b/Source/WebCore/Modules/mediastream/SDPProcessor.cpp
@@ -327,15 +327,15 @@
     return configuration;
 }
 
-static Optional<IceCandidate> iceCandidateFromJSON(const String& json)
+static std::optional<IceCandidate> iceCandidateFromJSON(const String& json)
 {
     RefPtr<InspectorValue> value;
     if (!InspectorValue::parseJSON(json, value))
-        return Nullopt;
+        return std::nullopt;
 
     RefPtr<InspectorObject> candidateObject;
     if (!value->asObject(candidateObject))
-        return Nullopt;
+        return std::nullopt;
 
     return createCandidate(*candidateObject);
 }
diff --git a/Source/WebCore/Modules/proximity/DeviceProximityEvent.h b/Source/WebCore/Modules/proximity/DeviceProximityEvent.h
index 7722fcf..373ac45 100644
--- a/Source/WebCore/Modules/proximity/DeviceProximityEvent.h
+++ b/Source/WebCore/Modules/proximity/DeviceProximityEvent.h
@@ -40,9 +40,9 @@
     }
 
     struct Init : EventInit {
-        Optional<double> value;
-        Optional<double> min;
-        Optional<double> max;
+        std::optional<double> value;
+        std::optional<double> min;
+        std::optional<double> max;
     };
 
     static Ref<DeviceProximityEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
diff --git a/Source/WebCore/Modules/streams/ReadableStreamSource.h b/Source/WebCore/Modules/streams/ReadableStreamSource.h
index 931c500..65919f2 100644
--- a/Source/WebCore/Modules/streams/ReadableStreamSource.h
+++ b/Source/WebCore/Modules/streams/ReadableStreamSource.h
@@ -63,8 +63,8 @@
     virtual void doCancel() = 0;
 
 private:
-    Optional<DOMPromise<void>> m_promise;
-    Optional<ReadableStreamDefaultController> m_controller;
+    std::optional<DOMPromise<void>> m_promise;
+    std::optional<ReadableStreamDefaultController> m_controller;
 };
 
 inline void ReadableStreamSource::start(ReadableStreamDefaultController&& controller, DOMPromise<void>&& promise)
@@ -91,14 +91,14 @@
 inline void ReadableStreamSource::startFinished()
 {
     ASSERT(m_promise);
-    std::exchange(m_promise, Nullopt).value().resolve();
+    std::exchange(m_promise, std::nullopt).value().resolve();
     setInactive();
 }
 
 inline void ReadableStreamSource::pullFinished()
 {
     ASSERT(m_promise);
-    std::exchange(m_promise, Nullopt).value().resolve();
+    std::exchange(m_promise, std::nullopt).value().resolve();
     setInactive();
 }
 
@@ -111,7 +111,7 @@
 inline void ReadableStreamSource::clean()
 {
     if (m_promise) {
-        m_promise = Nullopt;
+        m_promise = std::nullopt;
         setInactive();
     }
 }
diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
index a19f63f..11319a8 100644
--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.cpp
@@ -437,7 +437,7 @@
     return output(0)->numberOfChannels();
 }
 
-ExceptionOr<void> AudioBufferSourceNode::start(double when, double grainOffset, Optional<double> optionalGrainDuration)
+ExceptionOr<void> AudioBufferSourceNode::start(double when, double grainOffset, std::optional<double> optionalGrainDuration)
 {
     double grainDuration = 0;
     if (optionalGrainDuration)
diff --git a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h
index a09260a..f4e63a8 100644
--- a/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h
+++ b/Source/WebCore/Modules/webaudio/AudioBufferSourceNode.h
@@ -55,7 +55,7 @@
     unsigned numberOfChannels();
 
     // Play-state
-    ExceptionOr<void> start(double when, double grainOffset, Optional<double> grainDuration);
+    ExceptionOr<void> start(double when, double grainOffset, std::optional<double> grainDuration);
 
     // Note: the attribute was originally exposed as .looping, but to be more consistent in naming with <audio>
     // and with how it's described in the specification, the proper attribute name is .loop
diff --git a/Source/WebCore/Modules/webdatabase/SQLResultSet.h b/Source/WebCore/Modules/webdatabase/SQLResultSet.h
index d716fbf..e228399 100644
--- a/Source/WebCore/Modules/webdatabase/SQLResultSet.h
+++ b/Source/WebCore/Modules/webdatabase/SQLResultSet.h
@@ -50,7 +50,7 @@
     SQLResultSet();
 
     Ref<SQLResultSetRowList> m_rows;
-    Optional<int64_t> m_insertId;
+    std::optional<int64_t> m_insertId;
     int m_rowsAffected { 0 };
 };
 
diff --git a/Source/WebCore/Modules/websockets/WebSocket.cpp b/Source/WebCore/Modules/websockets/WebSocket.cpp
index 6432165..bed9362 100644
--- a/Source/WebCore/Modules/websockets/WebSocket.cpp
+++ b/Source/WebCore/Modules/websockets/WebSocket.cpp
@@ -378,7 +378,7 @@
     return { };
 }
 
-ExceptionOr<void> WebSocket::close(Optional<unsigned short> optionalCode, const String& reason)
+ExceptionOr<void> WebSocket::close(std::optional<unsigned short> optionalCode, const String& reason)
 {
     int code = optionalCode ? optionalCode.value() : static_cast<int>(WebSocketChannel::CloseEventCodeNotSpecified);
     if (code == WebSocketChannel::CloseEventCodeNotSpecified)
diff --git a/Source/WebCore/Modules/websockets/WebSocket.h b/Source/WebCore/Modules/websockets/WebSocket.h
index 4154eee..7d43f04 100644
--- a/Source/WebCore/Modules/websockets/WebSocket.h
+++ b/Source/WebCore/Modules/websockets/WebSocket.h
@@ -78,7 +78,7 @@
     ExceptionOr<void> send(JSC::ArrayBufferView&);
     ExceptionOr<void> send(Blob&);
 
-    ExceptionOr<void> close(Optional<unsigned short> code, const String& reason);
+    ExceptionOr<void> close(std::optional<unsigned short> code, const String& reason);
 
     const URL& url() const;
     State readyState() const;
diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
index 4e4aa7c..80dbb4b 100644
--- a/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.cpp
@@ -307,7 +307,7 @@
     deref();
 }
 
-void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle& handle, const char* data, Optional<size_t> len)
+void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle& handle, const char* data, std::optional<size_t> len)
 {
     if (len)
         LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData() Received %zu bytes", this, len.value());
diff --git a/Source/WebCore/Modules/websockets/WebSocketChannel.h b/Source/WebCore/Modules/websockets/WebSocketChannel.h
index 7c758d6..b3a52cc 100644
--- a/Source/WebCore/Modules/websockets/WebSocketChannel.h
+++ b/Source/WebCore/Modules/websockets/WebSocketChannel.h
@@ -82,7 +82,7 @@
     // SocketStreamHandleClient functions.
     void didOpenSocketStream(SocketStreamHandle&) final;
     void didCloseSocketStream(SocketStreamHandle&) final;
-    void didReceiveSocketStreamData(SocketStreamHandle&, const char*, Optional<size_t>) final;
+    void didReceiveSocketStreamData(SocketStreamHandle&, const char*, std::optional<size_t>) final;
     void didUpdateBufferedAmount(SocketStreamHandle&, size_t bufferedAmount) final;
     void didFailSocketStream(SocketStreamHandle&, const SocketStreamError&) final;
 
diff --git a/Source/WebCore/bindings/generic/IDLTypes.h b/Source/WebCore/bindings/generic/IDLTypes.h
index 0a327ee..97746ef 100644
--- a/Source/WebCore/bindings/generic/IDLTypes.h
+++ b/Source/WebCore/bindings/generic/IDLTypes.h
@@ -44,8 +44,8 @@
 struct IDLType {
     using ImplementationType = T;
 
-    using NullableType = Optional<ImplementationType>;
-    static NullableType nullValue() { return Nullopt; }
+    using NullableType = std::optional<ImplementationType>;
+    static NullableType nullValue() { return std::nullopt; }
     static bool isNullValue(const NullableType& value) { return !value; }
     static ImplementationType extractValueFromNullable(const NullableType& value) { return value.value(); }
 };
diff --git a/Source/WebCore/bindings/js/CachedModuleScript.h b/Source/WebCore/bindings/js/CachedModuleScript.h
index 98889d5..9eaa76b 100644
--- a/Source/WebCore/bindings/js/CachedModuleScript.h
+++ b/Source/WebCore/bindings/js/CachedModuleScript.h
@@ -45,7 +45,7 @@
     void notifyLoadFailed(LoadableScript::Error&&);
     void notifyLoadWasCanceled();
 
-    const Optional<LoadableScript::Error>& error() const { return m_error; }
+    const std::optional<LoadableScript::Error>& error() const { return m_error; }
     bool wasCanceled() const { return m_wasCanceled; }
     bool isLoaded() const { return m_isLoaded; }
 
@@ -69,7 +69,7 @@
     HashCountedSet<CachedModuleScriptClient*> m_clients;
     String m_nonce;
     String m_crossOriginMode;
-    Optional<LoadableScript::Error> m_error;
+    std::optional<LoadableScript::Error> m_error;
     bool m_wasCanceled { false };
     bool m_isLoaded { false };
 };
diff --git a/Source/WebCore/bindings/js/Dictionary.h b/Source/WebCore/bindings/js/Dictionary.h
index b883353..2e7dd1f 100644
--- a/Source/WebCore/bindings/js/Dictionary.h
+++ b/Source/WebCore/bindings/js/Dictionary.h
@@ -49,7 +49,7 @@
     template<typename Result> bool get(const char* propertyName, Result&) const;
     template<typename Result> bool get(const String& propertyName, Result&) const;
 
-    template<typename Result> Optional<Result> get(const char* propertyName) const;
+    template<typename Result> std::optional<Result> get(const char* propertyName) const;
 
     template<typename T> RefPtr<EventListener> getEventListener(const char* propertyName, T* target) const;
     template<typename T> RefPtr<EventListener> getEventListener(const String& propertyName, T* target) const;
@@ -79,11 +79,11 @@
     return get(propertyName.utf8().data(), result);
 }
 
-template<typename Result> Optional<Result> Dictionary::get(const char* propertyName) const
+template<typename Result> std::optional<Result> Dictionary::get(const char* propertyName) const
 {
     Result result;
     if (!get(propertyName, result))
-        return Nullopt;
+        return std::nullopt;
     return result;
 }
 
diff --git a/Source/WebCore/bindings/js/IDBBindingUtilities.cpp b/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
index f1175b8..a74dd18 100644
--- a/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
+++ b/Source/WebCore/bindings/js/IDBBindingUtilities.cpp
@@ -412,7 +412,7 @@
     outKey = IndexKey(WTFMove(keyDatas));
 }
 
-JSValue toJS(ExecState& state, JSDOMGlobalObject& globalObject, const Optional<IDBKeyPath>& keyPath)
+JSValue toJS(ExecState& state, JSDOMGlobalObject& globalObject, const std::optional<IDBKeyPath>& keyPath)
 {
     if (!keyPath)
         return jsNull();
diff --git a/Source/WebCore/bindings/js/IDBBindingUtilities.h b/Source/WebCore/bindings/js/IDBBindingUtilities.h
index 36c6e18..a86c10c 100644
--- a/Source/WebCore/bindings/js/IDBBindingUtilities.h
+++ b/Source/WebCore/bindings/js/IDBBindingUtilities.h
@@ -48,7 +48,7 @@
 class ThreadSafeDataBuffer;
 
 // FIXME: Remove this once we support returning union types.
-JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, const Optional<IDBKeyPath>&);
+JSC::JSValue toJS(JSC::ExecState&, JSDOMGlobalObject&, const std::optional<IDBKeyPath>&);
 
 RefPtr<IDBKey> maybeCreateIDBKeyFromScriptValueAndKeyPath(JSC::ExecState&, const JSC::JSValue&, const IDBKeyPath&);
 bool canInjectIDBKeyIntoScriptValue(JSC::ExecState&, const JSC::JSValue&, const IDBKeyPath&);
diff --git a/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp b/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
index 6e00c9f..54a8d1f 100644
--- a/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
+++ b/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.cpp
@@ -177,7 +177,7 @@
     return WTFMove(rsaKeyParameters);
 }
 
-Optional<CryptoAlgorithmPair> JSCryptoKeySerializationJWK::reconcileAlgorithm(CryptoAlgorithm* suggestedAlgorithm, CryptoAlgorithmParametersDeprecated* suggestedParameters) const
+std::optional<CryptoAlgorithmPair> JSCryptoKeySerializationJWK::reconcileAlgorithm(CryptoAlgorithm* suggestedAlgorithm, CryptoAlgorithmParametersDeprecated* suggestedParameters) const
 {
     VM& vm = m_exec->vm();
     auto scope = DECLARE_THROW_SCOPE(vm);
@@ -234,7 +234,7 @@
         parameters = adoptRef(*new CryptoAlgorithmParametersDeprecated);
     } else {
         throwTypeError(m_exec, scope, "Unsupported JWK algorithm " + m_jwkAlgorithmName);
-        return Nullopt;
+        return std::nullopt;
     }
 
     if (!suggestedAlgorithm)
@@ -244,11 +244,11 @@
         return CryptoAlgorithmPair { suggestedAlgorithm, suggestedParameters };
 
     if (algorithm->identifier() != suggestedAlgorithm->identifier())
-        return Nullopt;
+        return std::nullopt;
 
     if (algorithm->identifier() == CryptoAlgorithmIdentifier::HMAC) {
         if (downcast<CryptoAlgorithmHmacParamsDeprecated>(*parameters).hash != downcast<CryptoAlgorithmHmacParamsDeprecated>(*suggestedParameters).hash)
-            return Nullopt;
+            return std::nullopt;
         return CryptoAlgorithmPair { suggestedAlgorithm, suggestedParameters };
     }
     if (algorithm->identifier() == CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5
@@ -258,7 +258,7 @@
         ASSERT(rsaKeyParameters.hasHash);
         if (suggestedRSAKeyParameters.hasHash) {
             if (suggestedRSAKeyParameters.hash != rsaKeyParameters.hash)
-                return Nullopt;
+                return std::nullopt;
             return CryptoAlgorithmPair { suggestedAlgorithm, suggestedParameters };
         }
         suggestedRSAKeyParameters.hasHash = true;
diff --git a/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.h b/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.h
index 1a78a31..47a5a03 100644
--- a/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.h
+++ b/Source/WebCore/bindings/js/JSCryptoKeySerializationJWK.h
@@ -51,7 +51,7 @@
     static String serialize(JSC::ExecState* exec, const CryptoKey&);
 
 private:
-    Optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const override;
+    std::optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const override;
 
     void reconcileUsages(CryptoKeyUsageBitmap&) const override;
     void reconcileExtractable(bool&) const override;
diff --git a/Source/WebCore/bindings/js/JSDOMConvert.h b/Source/WebCore/bindings/js/JSDOMConvert.h
index 9d9f109..767f954 100644
--- a/Source/WebCore/bindings/js/JSDOMConvert.h
+++ b/Source/WebCore/bindings/js/JSDOMConvert.h
@@ -53,7 +53,7 @@
 template<typename T> T convertDictionary(JSC::ExecState&, JSC::JSValue);
 
 // Specialized by generated code for IDL enumeration conversion.
-template<typename T> Optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue);
+template<typename T> std::optional<T> parseEnumeration(JSC::ExecState&, JSC::JSValue);
 template<typename T> T convertEnumeration(JSC::ExecState&, JSC::JSValue);
 template<typename T> const char* expectedEnumerationValues();
 
@@ -1026,7 +1026,7 @@
 
 template<typename ReturnType, typename T>
 struct ConditionalConverter<ReturnType, T, true> {
-    static Optional<ReturnType> convert(JSC::ExecState& state, JSC::JSValue value)
+    static std::optional<ReturnType> convert(JSC::ExecState& state, JSC::JSValue value)
     {
         return ReturnType(Converter<T>::convert(state, value));
     }
@@ -1034,9 +1034,9 @@
 
 template<typename ReturnType, typename T>
 struct ConditionalConverter<ReturnType, T, false> {
-    static Optional<ReturnType> convert(JSC::ExecState&, JSC::JSValue)
+    static std::optional<ReturnType> convert(JSC::ExecState&, JSC::JSValue)
     {
-        return Nullopt;
+        return std::nullopt;
     }
 };
 
@@ -1134,7 +1134,7 @@
         //     2. If types includes object, then return the IDL value that is a reference to the object V.
         //         (FIXME: Add support for object and step 4.2)
         if (brigand::any<TypeList, IsIDLInterface<brigand::_1>>::value) {
-            Optional<ReturnType> returnValue;
+            std::optional<ReturnType> returnValue;
             brigand::for_each<InterfaceTypeList>([&](auto&& type) {
                 if (returnValue)
                     return;
@@ -1257,7 +1257,7 @@
     {
         auto index = variant.index();
 
-        Optional<JSC::JSValue> returnValue;
+        std::optional<JSC::JSValue> returnValue;
         brigand::for_each<Sequence>([&](auto&& type) {
             using I = typename WTF::RemoveCVAndReference<decltype(type)>::type::type;
             if (I::value == index) {
@@ -1302,13 +1302,13 @@
     struct VariadicConverterBase {
         using Item = typename IDLType::ImplementationType;
 
-        static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+        static std::optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
         {
             auto& vm = state.vm();
             auto scope = DECLARE_THROW_SCOPE(vm);
 
             auto result = Converter<IDLType>::convert(state, value);
-            RETURN_IF_EXCEPTION(scope, Nullopt);
+            RETURN_IF_EXCEPTION(scope, std::nullopt);
 
             return WTFMove(result);
         }
@@ -1318,12 +1318,12 @@
     struct VariadicConverterBase<IDLInterface<T>> {
         using Item = std::reference_wrapper<T>;
 
-        static Optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
+        static std::optional<Item> convert(JSC::ExecState& state, JSC::JSValue value)
         {
             auto* result = Converter<IDLInterface<T>>::convert(state, value);
             if (!result)
-                return Nullopt;
-            return Optional<Item>(*result);
+                return std::nullopt;
+            return std::optional<Item>(*result);
         }
     };
 
@@ -1334,7 +1334,7 @@
 
         struct Result {
             size_t argumentIndex;
-            Optional<Container> arguments;
+            std::optional<Container> arguments;
         };
     };
 }
@@ -1343,7 +1343,7 @@
 {
     size_t length = state.argumentCount();
     if (startIndex > length)
-        return { 0, Nullopt };
+        return { 0, std::nullopt };
 
     typename Detail::VariadicConverter<IDLType>::Container result;
     result.reserveInitialCapacity(length - startIndex);
@@ -1351,7 +1351,7 @@
     for (size_t i = startIndex; i < length; ++i) {
         auto value = Detail::VariadicConverter<IDLType>::convert(state, state.uncheckedArgument(i));
         if (!value)
-            return { i, Nullopt };
+            return { i, std::nullopt };
         result.uncheckedAppend(WTFMove(*value));
     }
 
diff --git a/Source/WebCore/bindings/js/JSDOMIterator.h b/Source/WebCore/bindings/js/JSDOMIterator.h
index b582db0..3c5fe0e 100644
--- a/Source/WebCore/bindings/js/JSDOMIterator.h
+++ b/Source/WebCore/bindings/js/JSDOMIterator.h
@@ -119,7 +119,7 @@
 
     static void destroy(JSC::JSCell*);
 
-    Optional<typename DOMWrapped::Iterator> m_iterator;
+    std::optional<typename DOMWrapped::Iterator> m_iterator;
     IterationKind m_kind;
 };
 
@@ -236,7 +236,7 @@
         auto iteratorValue = m_iterator->next();
         if (iteratorValue)
             return createIteratorResultObject(&state, asJS(state, iteratorValue), false);
-        m_iterator = Nullopt;
+        m_iterator = std::nullopt;
     }
     return createIteratorResultObject(&state, JSC::jsUndefined(), true);
 }
diff --git a/Source/WebCore/bindings/js/JSDOMPromise.h b/Source/WebCore/bindings/js/JSDOMPromise.h
index 3aff5c8..cb1c329 100644
--- a/Source/WebCore/bindings/js/JSDOMPromise.h
+++ b/Source/WebCore/bindings/js/JSDOMPromise.h
@@ -206,11 +206,20 @@
 template<typename Value> class DOMPromise {
 public:
     DOMPromise(Ref<DeferredPromise>&& genericPromise) : m_promiseDeferred(WTFMove(genericPromise)) { }
-
     DOMPromise(DOMPromise&& promise) : m_promiseDeferred(WTFMove(promise.m_promiseDeferred)) { }
+    DOMPromise(const DOMPromise& other) : m_promiseDeferred(other.m_promiseDeferred.copyRef()) { }
 
-    DOMPromise(const DOMPromise&) = default;
-    DOMPromise& operator=(DOMPromise const&) = default;
+    DOMPromise& operator=(const DOMPromise& other)
+    {
+        m_promiseDeferred = other.copyRef();
+        return *this;
+    }
+
+    DOMPromise& operator=(DOMPromise&& other)
+    {
+        m_promiseDeferred = WTFMove(other.m_promiseDeferred);
+        return *this;
+    }
 
     template<typename T = Value>
     typename std::enable_if<!std::is_void<T>::value, void>::type resolve(typename PromiseResultInspector<Value>::Type value) { m_promiseDeferred->resolve(value); }
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 4287693..45a3653 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -159,7 +159,7 @@
 {
     // (1) First, indexed properties.
     // Hand off all indexed access to getOwnPropertySlotByIndex, which supports the indexed getter.
-    if (Optional<unsigned> index = parseIndex(propertyName))
+    if (std::optional<unsigned> index = parseIndex(propertyName))
         return getOwnPropertySlotByIndex(object, state, index.value(), slot);
 
     auto* thisObject = jsCast<JSDOMWindow*>(object);
diff --git a/Source/WebCore/bindings/js/JSDictionary.h b/Source/WebCore/bindings/js/JSDictionary.h
index 08c149a..f657883 100644
--- a/Source/WebCore/bindings/js/JSDictionary.h
+++ b/Source/WebCore/bindings/js/JSDictionary.h
@@ -105,10 +105,10 @@
     GetPropertyResult tryGetProperty(const char* propertyName, JSC::JSValue&) const;
 
     template <typename T>
-    static void convertValue(JSC::ExecState* execState, JSC::JSValue value, Optional<T>& result)
+    static void convertValue(JSC::ExecState* execState, JSC::JSValue value, std::optional<T>& result)
     {
         if (value.isUndefinedOrNull()) {
-            result = Nullopt;
+            result = std::nullopt;
             return;
         }
 
diff --git a/Source/WebCore/bindings/js/JSFileCustom.cpp b/Source/WebCore/bindings/js/JSFileCustom.cpp
index 43ff82e..69d8727 100644
--- a/Source/WebCore/bindings/js/JSFileCustom.cpp
+++ b/Source/WebCore/bindings/js/JSFileCustom.cpp
@@ -71,7 +71,7 @@
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     String normalizedType;
-    Optional<int64_t> lastModified;
+    std::optional<int64_t> lastModified;
 
     arg = exec.argument(2);
     if (!arg.isUndefinedOrNull()) {
diff --git a/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp b/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
index 6d73f18..f94266b 100644
--- a/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLAllCollectionCustom.cpp
@@ -69,7 +69,7 @@
         // Support for document.all(<index>) etc.
         String string = exec->argument(0).toString(exec)->value(exec);
         RETURN_IF_EXCEPTION(scope, encodedJSValue());
-        if (Optional<uint32_t> index = parseIndex(*string.impl()))
+        if (std::optional<uint32_t> index = parseIndex(*string.impl()))
             return JSValue::encode(toJS(exec, jsCollection->globalObject(), collection.item(index.value())));
 
         // Support for document.images('<name>') etc.
@@ -79,7 +79,7 @@
     // The second arg, if set, is the index of the item we want
     String string = exec->argument(0).toString(exec)->value(exec);
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
-    if (Optional<uint32_t> index = parseIndex(*exec->argument(1).toWTFString(exec).impl())) {
+    if (std::optional<uint32_t> index = parseIndex(*exec->argument(1).toWTFString(exec).impl())) {
         if (auto* item = collection.namedItemWithIndex(string, index.value()))
             return JSValue::encode(toJS(exec, jsCollection->globalObject(), *item));
     }
@@ -112,7 +112,7 @@
         return throwException(&state, scope, createNotEnoughArgumentsError(&state));
 
     String argument = state.uncheckedArgument(0).toWTFString(&state);
-    if (Optional<uint32_t> index = parseIndex(*argument.impl()))
+    if (std::optional<uint32_t> index = parseIndex(*argument.impl()))
         return toJS(&state, globalObject(), wrapped().item(index.value()));
     return namedItems(state, this, Identifier::fromString(&state, argument));
 }
diff --git a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
index 74e3eb3..d1cfb79 100644
--- a/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
@@ -110,7 +110,7 @@
     auto type = convert<IDLNullable<IDLDOMString>>(state, state.argument(0));
     RETURN_IF_EXCEPTION(scope, JSC::JSValue());
 
-    Optional<double> quality;
+    std::optional<double> quality;
     auto qualityValue = state.argument(1);
     if (qualityValue.isNumber())
         quality = qualityValue.toNumber(&state);
diff --git a/Source/WebCore/bindings/js/JSImageConstructor.cpp b/Source/WebCore/bindings/js/JSImageConstructor.cpp
index 4082b1f..d69ed76 100644
--- a/Source/WebCore/bindings/js/JSImageConstructor.cpp
+++ b/Source/WebCore/bindings/js/JSImageConstructor.cpp
@@ -58,8 +58,8 @@
     // added to the window object. This is done to ensure that JSDocument::visit
     // will be called, which will cause the image element to be marked if necessary.
     toJS(state, jsConstructor->globalObject(), *document);
-    Optional<unsigned> width;
-    Optional<unsigned> height;
+    std::optional<unsigned> width;
+    std::optional<unsigned> height;
     if (state->argumentCount() > 0) {
         width = state->uncheckedArgument(0).toUInt32(state);
         if (state->argumentCount() > 1)
diff --git a/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp b/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp
index df7e184..352969f 100644
--- a/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp
+++ b/Source/WebCore/bindings/js/JSMediaDevicesCustom.cpp
@@ -58,7 +58,7 @@
     }
 }
 
-static Optional<StringConstraint> createStringConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
+static std::optional<StringConstraint> createStringConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
 {
     auto constraint = StringConstraint(name, type);
 
@@ -85,7 +85,7 @@
 
         if (constraint.isEmpty()) {
             LOG(Media, "createStringConstraint() - ignoring string constraint '%s' with dictionary value since it has no valid or supported key/value pairs.", name.utf8().data());
-            return Nullopt;
+            return std::nullopt;
         }
         
         return WTFMove(constraint);
@@ -98,7 +98,7 @@
 
         if (constraint.isEmpty()) {
             LOG(Media, "createStringConstraint() - ignoring string constraint '%s' with array value since it is empty.", name.utf8().data());
-            return Nullopt;
+            return std::nullopt;
         }
 
         return WTFMove(constraint);
@@ -117,10 +117,10 @@
 
     // Invalid constraint value.
     LOG(Media, "createStringConstraint() - ignoring string constraint '%s' since it has neither a dictionary nor sequence nor scalar value.", name.utf8().data());
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<BooleanConstraint> createBooleanConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
+static std::optional<BooleanConstraint> createBooleanConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
 {
     auto constraint = BooleanConstraint(name, type);
 
@@ -137,7 +137,7 @@
 
         if (constraint.isEmpty()) {
             LOG(Media, "createBooleanConstraint() - ignoring boolean constraint '%s' with dictionary value since it has no valid or supported key/value pairs.", name.utf8().data());
-            return Nullopt;
+            return std::nullopt;
         }
 
         return WTFMove(constraint);
@@ -156,10 +156,10 @@
 
     // Invalid constraint value.
     LOG(Media, "createBooleanConstraint() - ignoring boolean constraint '%s' since it has neither a dictionary nor scalar value.", name.utf8().data());
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<DoubleConstraint> createDoubleConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
+static std::optional<DoubleConstraint> createDoubleConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
 {
     auto constraint = DoubleConstraint(name, type);
 
@@ -184,7 +184,7 @@
 
         if (constraint.isEmpty()) {
             LOG(Media, "createDoubleConstraint() - ignoring double constraint '%s' with dictionary value since it has no valid or supported key/value pairs.", name.utf8().data());
-            return Nullopt;
+            return std::nullopt;
         }
 
         return WTFMove(constraint);
@@ -203,10 +203,10 @@
 
     // Invalid constraint value.
     LOG(Media, "createDoubleConstraint() - ignoring double constraint '%s' since it has neither a dictionary nor scalar value.", name.utf8().data());
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<IntConstraint> createIntConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
+static std::optional<IntConstraint> createIntConstraint(const Dictionary& mediaTrackConstraintSet, const String& name, MediaConstraintType type, ConstraintSetType constraintSetType)
 {
     auto constraint = IntConstraint(name, type);
 
@@ -231,7 +231,7 @@
 
         if (constraint.isEmpty()) {
             LOG(Media, "createIntConstraint() - ignoring long constraint '%s' with dictionary value since it has no valid or supported key/value pairs.", name.utf8().data());
-            return Nullopt;
+            return std::nullopt;
         }
 
         return WTFMove(constraint);
@@ -250,7 +250,7 @@
 
     // Invalid constraint value.
     LOG(Media, "createIntConstraint() - ignoring long constraint '%s' since it has neither a dictionary nor scalar value.", name.utf8().data());
-    return Nullopt;
+    return std::nullopt;
 }
 
 static void parseMediaTrackConstraintSetForKey(const Dictionary& mediaTrackConstraintSet, const String& name, MediaTrackConstraintSetMap& map, ConstraintSetType constraintSetType)
diff --git a/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp b/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp
index ac9b5d3..b3caa2c 100644
--- a/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp
@@ -476,7 +476,7 @@
 
     ASSERT(keySerialization);
 
-    Optional<CryptoAlgorithmPair> reconciledResult = keySerialization->reconcileAlgorithm(algorithm.get(), parameters.get());
+    std::optional<CryptoAlgorithmPair> reconciledResult = keySerialization->reconcileAlgorithm(algorithm.get(), parameters.get());
     if (!reconciledResult) {
         if (!scope.exception())
             throwTypeError(&state, scope, ASCIILiteral("Algorithm specified in key is not compatible with one passed to importKey as argument"));
diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp
index 2087a86..2f3f20c 100644
--- a/Source/WebCore/bindings/js/ScriptController.cpp
+++ b/Source/WebCore/bindings/js/ScriptController.cpp
@@ -383,7 +383,7 @@
             if (symbol->privateName() == moduleLoaderAlreadyReportedErrorSymbol) {
                 moduleScript->notifyLoadFailed(LoadableScript::Error {
                     LoadableScript::ErrorType::CachedScript,
-                    Nullopt
+                    std::nullopt
                 });
                 return JSValue::encode(jsUndefined());
             }
@@ -637,7 +637,7 @@
 
 JSValue ScriptController::executeScriptInWorld(DOMWrapperWorld& world, const String& script, bool forceUserGesture)
 {
-    UserGestureIndicator gestureIndicator(forceUserGesture ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(forceUserGesture ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
     ScriptSourceCode sourceCode(script, m_frame.document()->url());
 
     if (!canExecuteScripts(AboutToExecuteScript) || isPaused())
@@ -663,7 +663,7 @@
 
 JSValue ScriptController::executeScript(const String& script, bool forceUserGesture, ExceptionDetails* exceptionDetails)
 {
-    UserGestureIndicator gestureIndicator(forceUserGesture ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(forceUserGesture ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
     return executeScript(ScriptSourceCode(script, m_frame.document()->url()), exceptionDetails);
 }
 
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index 52cb615..24f4bef 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -407,7 +407,7 @@
     };
 
     if ($indexedGetterFunction) {
-        push(@getOwnPropertySlotImpl, "    Optional<uint32_t> optionalIndex = parseIndex(propertyName);\n");
+        push(@getOwnPropertySlotImpl, "    std::optional<uint32_t> optionalIndex = parseIndex(propertyName);\n");
 
         # If the item function returns a string then we let the TreatReturnedNullStringAs handle the cases
         # where the index is out of range.
@@ -1000,7 +1000,7 @@
     # FIXME: Change to take VM& instead of ExecState&.
     # FIXME: Consider using toStringOrNull to make exception checking faster.
     # FIXME: Consider finding a more efficient way to match against all the strings quickly.
-    $result .= "template<> Optional<$className> parseEnumeration<$className>(ExecState& state, JSValue value)\n";
+    $result .= "template<> std::optional<$className> parseEnumeration<$className>(ExecState& state, JSValue value)\n";
     $result .= "{\n";
     $result .= "    auto stringValue = value.toWTFString(&state);\n";
     foreach my $value (@{$enumeration->values}) {
@@ -1012,7 +1012,7 @@
         }
         $result .= "        return ${className}::${enumerationValueName};\n";
     }
-    $result .= "    return Nullopt;\n";
+    $result .= "    return std::nullopt;\n";
     $result .= "}\n\n";
 
     $result .= "template<> $className convertEnumeration<$className>(ExecState& state, JSValue value)\n";
@@ -1063,7 +1063,7 @@
     my $result = "";
     $result .= "#if ${conditionalString}\n\n" if $conditionalString;
     $result .= "template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, $className);\n\n";
-    $result .= "template<> Optional<$className> parseEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n";
+    $result .= "template<> std::optional<$className> parseEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n";
     $result .= "template<> $className convertEnumeration<$className>(JSC::ExecState&, JSC::JSValue);\n";
     $result .= "template<> const char* expectedEnumerationValues<$className>();\n\n";
     $result .= "#endif\n\n" if $conditionalString;
@@ -1118,7 +1118,7 @@
     }
     if ($defaultValue eq "null") {
         if ($type->isUnion) {
-            return "Nullopt" if $type->isNullable;
+            return "std::nullopt" if $type->isNullable;
 
             my $IDLType = GetIDLType($interface, $type);
             return "convert<${IDLType}>(state, jsNull());";
@@ -1126,7 +1126,7 @@
         return "jsNull()" if $type->name eq "any";
         return "nullptr" if $codeGenerator->IsWrapperType($type) || $codeGenerator->IsTypedArrayType($type);
         return "String()" if $codeGenerator->IsStringType($type);
-        return "Nullopt";
+        return "std::nullopt";
     }
     if ($defaultValue eq "[]") {
         my $nativeType = GetNativeType($interface, $type);
@@ -3423,7 +3423,7 @@
             push(@implContent, "    auto* thisObject = jsCast<${className}*>(cell);\n");
             push(@implContent, "    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
             if ($interface->extendedAttributes->{CustomIndexedSetter}) {
-                push(@implContent, "    if (Optional<uint32_t> index = parseIndex(propertyName)) {\n");
+                push(@implContent, "    if (std::optional<uint32_t> index = parseIndex(propertyName)) {\n");
                 push(@implContent, "        thisObject->indexSetter(state, index.value(), value);\n");
                 push(@implContent, "        return true;\n");
                 push(@implContent, "    }\n");
@@ -4418,7 +4418,7 @@
             my $argumentLookupMethod = $argument->isOptional ? "argument" : "uncheckedArgument";
 
             if ($argument->isOptional && !defined($argument->default)) {
-                $nativeType = "Optional<$className>";
+                $nativeType = "std::optional<$className>";
                 $optionalValue = $name;
                 $defineOptionalValue = $name;
             }
@@ -4473,8 +4473,8 @@
                 $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? $defaultValue : ";
                 $inner = "state->uncheckedArgument($argumentIndex)";
             } elsif ($argument->isOptional && !defined($argument->default)) {
-                # Use WTF::Optional<>() for optional arguments that are missing or undefined and that do not have a default value in the IDL.
-                $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? Optional<$nativeType>() : ";
+                # Use std::optional<>() for optional arguments that are missing or undefined and that do not have a default value in the IDL.
+                $outer = "state->$argumentLookupMethod($argumentIndex).isUndefined() ? std::optional<$nativeType>() : ";
                 $inner = "state->uncheckedArgument($argumentIndex)";
             } elsif (($argument->type->name eq "EventListener" || $argument->type->name eq "XPathNSResolver") && ($argument->isOptional || $type->isNullable)) {
                 $outer = "";
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp b/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp
index 2450dd9..bc36c42 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSFloat64Array.cpp
@@ -174,7 +174,7 @@
 {
     JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
         slot.setValue(thisObject, thisObject->getByIndex(exec, index.value()));
         return true;
@@ -186,7 +186,7 @@
 {
     JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && index.value() < static_cast<Float64Array*>(thisObject->impl())->length()) {
         descriptor.setDescriptor(thisObject->getByIndex(exec, index.value()), DontDelete);
         return true;
@@ -215,7 +215,7 @@
 {
     JSFloat64Array* thisObject = jsCast<JSFloat64Array*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    if (Optional<uint32_t> index = parseIndex(propertyName)) {
+    if (std::optional<uint32_t> index = parseIndex(propertyName)) {
         thisObject->indexSetter(exec, index.value(), value);
         return;
     }
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
index e613cac..7a5c001 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
@@ -128,7 +128,7 @@
 {
     auto* thisObject = jsCast<JSTestEventTarget*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Optional<uint32_t> optionalIndex = parseIndex(propertyName);
+    std::optional<uint32_t> optionalIndex = parseIndex(propertyName);
     if (optionalIndex && optionalIndex.value() < thisObject->wrapped().length()) {
         unsigned index = optionalIndex.value();
         unsigned attributes = ReadOnly;
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 15ef4ed..aee09ef 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -105,7 +105,7 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue.isEmpty())
@@ -116,7 +116,7 @@
         return TestObj::EnumType::EnumValue2;
     if (stringValue == "EnumValue3")
         return TestObj::EnumType::EnumValue3;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::EnumType convertEnumeration<TestObj::EnumType>(ExecState& state, JSValue value)
@@ -152,7 +152,7 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue.isEmpty())
@@ -163,7 +163,7 @@
         return TestObj::Optional::OptionalValue2;
     if (stringValue == "OptionalValue3")
         return TestObj::Optional::OptionalValue3;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::Optional convertEnumeration<TestObj::Optional>(ExecState& state, JSValue value)
@@ -195,14 +195,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(ExecState& state, JSValue value)
+template<> std::optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "enumValue1")
         return AlternateEnumName::EnumValue1;
     if (stringValue == "EnumValue2")
         return AlternateEnumName::EnumValue2;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> AlternateEnumName convertEnumeration<AlternateEnumName>(ExecState& state, JSValue value)
@@ -234,12 +234,12 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "A")
         return TestObj::EnumA::A;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::EnumA convertEnumeration<TestObj::EnumA>(ExecState& state, JSValue value)
@@ -273,12 +273,12 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "B")
         return TestObj::EnumB::B;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::EnumB convertEnumeration<TestObj::EnumB>(ExecState& state, JSValue value)
@@ -312,12 +312,12 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "C")
         return TestObj::EnumC::C;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::EnumC convertEnumeration<TestObj::EnumC>(ExecState& state, JSValue value)
@@ -351,14 +351,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "quick")
         return TestObj::Kind::Quick;
     if (stringValue == "dead")
         return TestObj::Kind::Dead;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::Kind convertEnumeration<TestObj::Kind>(ExecState& state, JSValue value)
@@ -390,14 +390,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::Size> parseEnumeration<TestObj::Size>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "small")
         return TestObj::Size::Small;
     if (stringValue == "much-much-larger")
         return TestObj::Size::MuchMuchLarger;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::Size convertEnumeration<TestObj::Size>(ExecState& state, JSValue value)
@@ -429,14 +429,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(ExecState& state, JSValue value)
+template<> std::optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "high")
         return TestObj::Confidence::High;
     if (stringValue == "kinda-low")
         return TestObj::Confidence::KindaLow;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(ExecState& state, JSValue value)
@@ -554,7 +554,7 @@
         result.nullableIntegerWithDefault = convert<IDLNullable<IDLLong>>(state, nullableIntegerWithDefaultValue);
         RETURN_IF_EXCEPTION(throwScope, { });
     } else
-        result.nullableIntegerWithDefault = Nullopt;
+        result.nullableIntegerWithDefault = std::nullopt;
     JSValue nullableNodeValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "nullableNode"));
     if (!nullableNodeValue.isUndefined()) {
         result.nullableNode = convert<IDLNullable<IDLInterface<Node>>>(state, nullableNodeValue);
@@ -572,7 +572,7 @@
         result.nullableUnionMember = convert<IDLNullable<IDLUnion<IDLLong, IDLInterface<Node>>>>(state, nullableUnionMemberValue);
         RETURN_IF_EXCEPTION(throwScope, { });
     } else
-        result.nullableUnionMember = Nullopt;
+        result.nullableUnionMember = std::nullopt;
     JSValue restrictedDoubleValue = isNullOrUndefined ? jsUndefined() : object->get(&state, Identifier::fromString(&state, "restrictedDouble"));
     if (!restrictedDoubleValue.isUndefined()) {
         result.restrictedDouble = convert<IDLDouble>(state, restrictedDoubleValue);
@@ -1816,7 +1816,7 @@
 {
     auto* thisObject = jsCast<JSTestObj*>(object);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-    Optional<uint32_t> optionalIndex = parseIndex(propertyName);
+    std::optional<uint32_t> optionalIndex = parseIndex(propertyName);
     if (optionalIndex) {
         unsigned index = optionalIndex.value();
         unsigned attributes = ReadOnly;
@@ -5369,7 +5369,7 @@
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
     auto enumArgValue = state->argument(0);
-    Optional<TestObj::EnumType> enumArg;
+    std::optional<TestObj::EnumType> enumArg;
     if (!enumArgValue.isUndefined()) {
         enumArg = parseEnumeration<TestObj::EnumType>(*state, enumArgValue);
         RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
@@ -5991,7 +5991,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto opt = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
+    auto opt = state->argument(0).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalArg(WTFMove(opt));
     return JSValue::encode(jsUndefined());
@@ -6031,7 +6031,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto opt = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
+    auto opt = state->argument(1).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithNonOptionalArgAndOptionalArg(WTFMove(nonOpt), WTFMove(opt));
     return JSValue::encode(jsUndefined());
@@ -6053,9 +6053,9 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto nonOpt = convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto opt1 = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
+    auto opt1 = state->argument(1).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto opt2 = state->argument(2).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(2), IntegerConversionConfiguration::Normal);
+    auto opt2 = state->argument(2).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(2), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithNonOptionalArgAndTwoOptionalArgs(WTFMove(nonOpt), WTFMove(opt1), WTFMove(opt2));
     return JSValue::encode(jsUndefined());
@@ -6307,7 +6307,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto number = state->argument(0).isUndefined() ? Optional<int64_t>() : convert<IDLLongLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
+    auto number = state->argument(0).isUndefined() ? std::optional<int64_t>() : convert<IDLLongLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalLongLong(WTFMove(number));
     return JSValue::encode(jsUndefined());
@@ -6343,7 +6343,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto number = state->argument(0).isUndefined() ? Optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
+    auto number = state->argument(0).isUndefined() ? std::optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalUnsignedLongLong(WTFMove(number));
     return JSValue::encode(jsUndefined());
@@ -6379,7 +6379,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto array = state->argument(0).isUndefined() ? Optional<Vector<String>>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
+    auto array = state->argument(0).isUndefined() ? std::optional<Vector<String>>() : convert<IDLSequence<IDLDOMString>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalSequence(WTFMove(array));
     return JSValue::encode(jsUndefined());
@@ -6415,7 +6415,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto b = state->argument(0).isUndefined() ? Optional<bool>() : convert<IDLBoolean>(*state, state->uncheckedArgument(0));
+    auto b = state->argument(0).isUndefined() ? std::optional<bool>() : convert<IDLBoolean>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalBoolean(WTFMove(b));
     return JSValue::encode(jsUndefined());
@@ -6528,7 +6528,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto record = state->argument(0).isUndefined() ? Nullopt : convert<IDLNullable<IDLRecord<IDLDOMString, IDLLong>>>(*state, state->uncheckedArgument(0));
+    auto record = state->argument(0).isUndefined() ? std::nullopt : convert<IDLNullable<IDLRecord<IDLDOMString, IDLLong>>>(*state, state->uncheckedArgument(0));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.methodWithOptionalRecord(WTFMove(record));
     return JSValue::encode(jsUndefined());
@@ -6789,7 +6789,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethod", "TestObj"); });
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
+    auto longArg = state->argument(1).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.overloadedMethod(WTFMove(objArg), WTFMove(longArg));
     return JSValue::encode(jsUndefined());
@@ -7098,7 +7098,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto objArg = convert<IDLNullable<IDLInterface<TestObj>>>(*state, state->uncheckedArgument(0), [](JSC::ExecState& state, JSC::ThrowScope& scope) { throwArgumentTypeError(state, scope, 0, "objArg", "TestObject", "overloadedMethodWithOptionalParameter", "TestObj"); });
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto longArg = state->argument(1).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
+    auto longArg = state->argument(1).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.overloadedMethodWithOptionalParameter(WTFMove(objArg), WTFMove(longArg));
     return JSValue::encode(jsUndefined());
@@ -7505,7 +7505,7 @@
     VM& vm = state->vm();
     auto throwScope = DECLARE_THROW_SCOPE(vm);
     UNUSED_PARAM(throwScope);
-    auto arg = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
+    auto arg = state->argument(0).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     return JSValue::encode(toJS<IDLLong>(TestObj::classMethodWithOptional(WTFMove(arg))));
 }
@@ -8060,7 +8060,7 @@
     UNUSED_PARAM(state);
     UNUSED_PARAM(throwScope);
     auto& impl = castedThis->wrapped();
-    auto a = state->argument(0).isUndefined() ? Optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
+    auto a = state->argument(0).isUndefined() ? std::optional<int32_t>() : convert<IDLLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.testPromiseFunctionWithOptionalIntArgument(WTFMove(a), WTFMove(promise));
     return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
index c44b1e4..2f1df75 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -103,19 +103,19 @@
 };
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumType);
 
-template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::EnumType convertEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::EnumType>();
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Optional);
 
-template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::Optional convertEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::Optional>();
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, AlternateEnumName);
 
-template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
 template<> AlternateEnumName convertEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<AlternateEnumName>();
 
@@ -123,7 +123,7 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumA);
 
-template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::EnumA convertEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::EnumA>();
 
@@ -133,7 +133,7 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumB);
 
-template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::EnumB convertEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::EnumB>();
 
@@ -143,7 +143,7 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumC);
 
-template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::EnumC convertEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::EnumC>();
 
@@ -151,19 +151,19 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Kind);
 
-template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::Kind convertEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::Kind>();
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Size);
 
-template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::Size convertEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::Size>();
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Confidence);
 
-template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
 template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestObj::Confidence>();
 
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
index 1a23e93..68afbd6 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
@@ -43,14 +43,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(ExecState& state, JSValue value)
+template<> std::optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "enumValue1")
         return TestStandaloneDictionary::EnumInStandaloneDictionaryFile::EnumValue1;
     if (stringValue == "enumValue2")
         return TestStandaloneDictionary::EnumInStandaloneDictionaryFile::EnumValue2;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestStandaloneDictionary::EnumInStandaloneDictionaryFile convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(ExecState& state, JSValue value)
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h
index faf1108..32a81b6 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.h
@@ -31,7 +31,7 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestStandaloneDictionary::EnumInStandaloneDictionaryFile);
 
-template<> Optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestStandaloneDictionary::EnumInStandaloneDictionaryFile> parseEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(JSC::ExecState&, JSC::JSValue);
 template<> TestStandaloneDictionary::EnumInStandaloneDictionaryFile convertEnumeration<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestStandaloneDictionary::EnumInStandaloneDictionaryFile>();
 
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp
index d437462..a1886a7 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.cpp
@@ -43,14 +43,14 @@
     return jsStringWithCache(&state, values[static_cast<size_t>(enumerationValue)]);
 }
 
-template<> Optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(ExecState& state, JSValue value)
+template<> std::optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(ExecState& state, JSValue value)
 {
     auto stringValue = value.toWTFString(&state);
     if (stringValue == "enumValue1")
         return TestStandaloneEnumeration::EnumValue1;
     if (stringValue == "enumValue2")
         return TestStandaloneEnumeration::EnumValue2;
-    return Nullopt;
+    return std::nullopt;
 }
 
 template<> TestStandaloneEnumeration convertEnumeration<TestStandaloneEnumeration>(ExecState& state, JSValue value)
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h
index 8aab89b..80622ad 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneEnumeration.h
@@ -29,7 +29,7 @@
 
 template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestStandaloneEnumeration);
 
-template<> Optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(JSC::ExecState&, JSC::JSValue);
+template<> std::optional<TestStandaloneEnumeration> parseEnumeration<TestStandaloneEnumeration>(JSC::ExecState&, JSC::JSValue);
 template<> TestStandaloneEnumeration convertEnumeration<TestStandaloneEnumeration>(JSC::ExecState&, JSC::JSValue);
 template<> const char* expectedEnumerationValues<TestStandaloneEnumeration>();
 
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
index 9b45ef08..d0e3dcd 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
@@ -528,7 +528,7 @@
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     auto color = state->argument(3).isUndefined() ? String() : convert<IDLDOMString>(*state, state->uncheckedArgument(3), StringConversionConfiguration::Normal);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto alpha = state->argument(4).isUndefined() ? Optional<float>() : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4));
+    auto alpha = state->argument(4).isUndefined() ? std::optional<float>() : convert<IDLUnrestrictedFloat>(*state, state->uncheckedArgument(4));
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.setShadow(WTFMove(width), WTFMove(height), WTFMove(blur), WTFMove(color), WTFMove(alpha));
     return JSValue::encode(jsUndefined());
@@ -669,7 +669,7 @@
         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
     auto arg1 = convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(0), IntegerConversionConfiguration::Clamp);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
-    auto arg2 = state->argument(1).isUndefined() ? Optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Clamp);
+    auto arg2 = state->argument(1).isUndefined() ? std::optional<uint64_t>() : convert<IDLUnsignedLongLong>(*state, state->uncheckedArgument(1), IntegerConversionConfiguration::Clamp);
     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
     impl.funcWithClamp(WTFMove(arg1), WTFMove(arg2));
     return JSValue::encode(jsUndefined());
diff --git a/Source/WebCore/bridge/runtime_array.cpp b/Source/WebCore/bridge/runtime_array.cpp
index d30a585..b878871 100644
--- a/Source/WebCore/bridge/runtime_array.cpp
+++ b/Source/WebCore/bridge/runtime_array.cpp
@@ -92,7 +92,7 @@
         return true;
     }
     
-    Optional<uint32_t> index = parseIndex(propertyName);
+    std::optional<uint32_t> index = parseIndex(propertyName);
     if (index && index.value() < thisObject->getLength()) {
         slot.setValue(thisObject, DontDelete | DontEnum,
             thisObject->getConcreteArray()->valueAt(exec, index.value()));
@@ -125,7 +125,7 @@
         return false;
     }
     
-    if (Optional<uint32_t> index = parseIndex(propertyName))
+    if (std::optional<uint32_t> index = parseIndex(propertyName))
         return thisObject->getConcreteArray()->setValueAt(exec, index.value(), value);
     
     return JSObject::put(thisObject, exec, propertyName, value, slot);
diff --git a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
index 2fcc311..22dcfcb 100644
--- a/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
+++ b/Source/WebCore/crypto/CryptoAlgorithmRegistry.cpp
@@ -47,17 +47,17 @@
     platformRegisterAlgorithms();
 }
 
-Optional<CryptoAlgorithmIdentifier> CryptoAlgorithmRegistry::identifier(const String& name)
+std::optional<CryptoAlgorithmIdentifier> CryptoAlgorithmRegistry::identifier(const String& name)
 {
     if (name.isEmpty())
-        return Nullopt;
+        return std::nullopt;
 
     std::lock_guard<StaticLock> lock(registryMutex);
 
     // FIXME: How is it helpful to call isolatedCopy on the argument to find?
     auto identifier = m_identifiers.find(name.isolatedCopy());
     if (identifier == m_identifiers.end())
-        return Nullopt;
+        return std::nullopt;
 
     return identifier->value;
 }
diff --git a/Source/WebCore/crypto/CryptoAlgorithmRegistry.h b/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
index 3d15445..75a9c2e 100644
--- a/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
+++ b/Source/WebCore/crypto/CryptoAlgorithmRegistry.h
@@ -44,7 +44,7 @@
 public:
     static CryptoAlgorithmRegistry& singleton();
 
-    Optional<CryptoAlgorithmIdentifier> identifier(const String&);
+    std::optional<CryptoAlgorithmIdentifier> identifier(const String&);
     String name(CryptoAlgorithmIdentifier);
 
     RefPtr<CryptoAlgorithm> create(CryptoAlgorithmIdentifier);
diff --git a/Source/WebCore/crypto/CryptoKeySerialization.h b/Source/WebCore/crypto/CryptoKeySerialization.h
index c36362b..926388f 100644
--- a/Source/WebCore/crypto/CryptoKeySerialization.h
+++ b/Source/WebCore/crypto/CryptoKeySerialization.h
@@ -52,7 +52,7 @@
     virtual ~CryptoKeySerialization() { }
 
     // Returns false if suggested algorithm was not compatible with one stored in the serialization.
-    virtual Optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const = 0;
+    virtual std::optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const = 0;
 
     virtual void reconcileUsages(CryptoKeyUsageBitmap&) const = 0;
     virtual void reconcileExtractable(bool&) const = 0;
diff --git a/Source/WebCore/crypto/JsonWebKey.h b/Source/WebCore/crypto/JsonWebKey.h
index 223ee48..a535891 100644
--- a/Source/WebCore/crypto/JsonWebKey.h
+++ b/Source/WebCore/crypto/JsonWebKey.h
@@ -35,27 +35,27 @@
 
 struct JsonWebKey {
     String kty;
-    Optional<String> use;
+    std::optional<String> use;
     // FIXME: Consider merging key_ops and usages.
-    Optional<Vector<CryptoKeyUsage>> key_ops;
+    std::optional<Vector<CryptoKeyUsage>> key_ops;
     CryptoKeyUsageBitmap usages;
-    Optional<String> alg;
+    std::optional<String> alg;
 
-    Optional<bool> ext;
+    std::optional<bool> ext;
 
-    Optional<String> crv;
-    Optional<String> x;
-    Optional<String> y;
-    Optional<String> d;
-    Optional<String> n;
-    Optional<String> e;
-    Optional<String> p;
-    Optional<String> q;
-    Optional<String> dp;
-    Optional<String> dq;
-    Optional<String> qi;
-    Optional<Vector<RsaOtherPrimesInfo>> oth;
-    Optional<String> k;
+    std::optional<String> crv;
+    std::optional<String> x;
+    std::optional<String> y;
+    std::optional<String> d;
+    std::optional<String> n;
+    std::optional<String> e;
+    std::optional<String> p;
+    std::optional<String> q;
+    std::optional<String> dp;
+    std::optional<String> dq;
+    std::optional<String> qi;
+    std::optional<Vector<RsaOtherPrimesInfo>> oth;
+    std::optional<String> k;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
index 6b8fefd..5d9b0e7 100644
--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_CBC.cpp
@@ -121,7 +121,7 @@
         result = CryptoKeyAES::importRaw(parameters->identifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
         break;
     case SubtleCrypto::KeyFormat::Jwk: {
-        auto checkAlgCallback = [](size_t length, const Optional<String>& alg) -> bool {
+        auto checkAlgCallback = [](size_t length, const std::optional<String>& alg) -> bool {
             switch (length) {
             case CryptoKeyAES::s_length128:
                 return !alg || alg.value() == ALG128;
diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp
index b675e05..35c7a7b 100644
--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp
+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmAES_KW.cpp
@@ -94,7 +94,7 @@
         result = CryptoKeyAES::importRaw(parameters->identifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
         break;
     case SubtleCrypto::KeyFormat::Jwk: {
-        result = CryptoKeyAES::importJwk(parameters->identifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, [](size_t length, const Optional<String>& alg) -> bool {
+        result = CryptoKeyAES::importJwk(parameters->identifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, [](size_t length, const std::optional<String>& alg) -> bool {
             switch (length) {
             case CryptoKeyAES::s_length128:
                 return !alg || alg.value() == ALG128;
diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
index bc486d9..e46bddf 100644
--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
@@ -84,7 +84,7 @@
         return;
     }
 
-    auto result = CryptoKeyHMAC::generate(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, extractable, usages);
+    auto result = CryptoKeyHMAC::generate(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, extractable, usages);
     if (!result) {
         exceptionCallback(OperationError);
         return;
@@ -106,10 +106,10 @@
     RefPtr<CryptoKeyHMAC> result;
     switch (format) {
     case SubtleCrypto::KeyFormat::Raw:
-        result = CryptoKeyHMAC::importRaw(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
+        result = CryptoKeyHMAC::importRaw(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
         break;
     case SubtleCrypto::KeyFormat::Jwk: {
-        auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const Optional<String>& alg) -> bool {
+        auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const std::optional<String>& alg) -> bool {
             switch (hash) {
             case CryptoAlgorithmIdentifier::SHA_1:
                 return !alg || alg.value() == ALG1;
@@ -126,7 +126,7 @@
             }
             return false;
         };
-        result = CryptoKeyHMAC::importJwk(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback));
+        result = CryptoKeyHMAC::importJwk(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback));
         break;
     }
     default:
diff --git a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp b/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
index 5af55e9..3d98ee5 100644
--- a/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
+++ b/Source/WebCore/crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp
@@ -118,7 +118,7 @@
             exceptionCallback(DataError);
             return;
         }
-        result = CryptoKeyRSA::importJwk(parameters->identifier, Nullopt, WTFMove(key), extractable, usages);
+        result = CryptoKeyRSA::importJwk(parameters->identifier, std::nullopt, WTFMove(key), extractable, usages);
         break;
     }
     default:
diff --git a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
index edda81e..66aaf34 100644
--- a/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
+++ b/Source/WebCore/crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp
@@ -55,7 +55,7 @@
     }
 }
 
-static Optional<Vector<uint8_t>> calculateSignature(int algorithm, const Vector<uint8_t>& key, const CryptoOperationData& data)
+static std::optional<Vector<uint8_t>> calculateSignature(int algorithm, const Vector<uint8_t>& key, const CryptoOperationData& data)
 {
     size_t digestLength = gcry_mac_get_algo_maclen(algorithm);
     const void* keyData = key.data() ? key.data() : reinterpret_cast<const uint8_t*>("");
@@ -91,7 +91,7 @@
         gcry_mac_close(hd);
 
     if (!result)
-        return Nullopt;
+        return std::nullopt;
 
     return WTFMove(signature);
 }
diff --git a/Source/WebCore/crypto/keys/CryptoKeyAES.h b/Source/WebCore/crypto/keys/CryptoKeyAES.h
index 0d7ebd9..c02765d 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyAES.h
+++ b/Source/WebCore/crypto/keys/CryptoKeyAES.h
@@ -68,7 +68,7 @@
 
     static RefPtr<CryptoKeyAES> generate(CryptoAlgorithmIdentifier, size_t lengthBits, bool extractable, CryptoKeyUsageBitmap);
     static RefPtr<CryptoKeyAES> importRaw(CryptoAlgorithmIdentifier, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
-    using CheckAlgCallback = WTF::Function<bool(size_t, const Optional<String>&)>;
+    using CheckAlgCallback = WTF::Function<bool(size_t, const std::optional<String>&)>;
     static RefPtr<CryptoKeyAES> importJwk(CryptoAlgorithmIdentifier, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap, CheckAlgCallback&&);
 
     CryptoKeyClass keyClass() const final { return CryptoKeyClass::AES; }
diff --git a/Source/WebCore/crypto/keys/CryptoKeyHMAC.h b/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
index 71ad305..cacbcd7 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
+++ b/Source/WebCore/crypto/keys/CryptoKeyHMAC.h
@@ -64,7 +64,7 @@
 
     static RefPtr<CryptoKeyHMAC> generate(size_t lengthBits, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap);
     static RefPtr<CryptoKeyHMAC> importRaw(size_t lengthBits, CryptoAlgorithmIdentifier hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap);
-    using CheckAlgCallback = WTF::Function<bool(CryptoAlgorithmIdentifier, const Optional<String>&)>;
+    using CheckAlgCallback = WTF::Function<bool(CryptoAlgorithmIdentifier, const std::optional<String>&)>;
     static RefPtr<CryptoKeyHMAC> importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap, CheckAlgCallback&&);
 
     CryptoKeyClass keyClass() const final { return CryptoKeyClass::HMAC; }
diff --git a/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp b/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
index 594c6af..2d32ee8 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
+++ b/Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
@@ -34,7 +34,7 @@
 
 namespace WebCore {
 
-RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
+RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
 {
     if (keyData.kty != "RSA")
         return nullptr;
@@ -57,8 +57,8 @@
     if (!keyData.d) {
         // import public key
         auto publicKeyComponents = CryptoKeyDataRSAComponents::createPublic(WTFMove(modulus), WTFMove(exponent));
-        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages);
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages);
     }
 
     // import private key
@@ -67,8 +67,8 @@
         return nullptr;
     if (!keyData.p && !keyData.q && !keyData.dp && !keyData.dp && !keyData.qi) {
         auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivate(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent));
-        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
     }
 
     if (!keyData.p || !keyData.q || !keyData.dp || !keyData.dq || !keyData.qi)
@@ -87,8 +87,8 @@
         return nullptr;
     if (!keyData.oth) {
         auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), { });
-        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+        // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt.
+        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
     }
 
     Vector<CryptoKeyDataRSAComponents::PrimeInfo> otherPrimeInfos;
@@ -104,8 +104,8 @@
     }
 
     auto privateKeyComponents = CryptoKeyDataRSAComponents::createPrivateWithAdditionalData(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos));
-    // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is Nullopt.
-    return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+    // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt.
+    return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
 }
 
 JsonWebKey CryptoKeyRSA::exportJwk() const
diff --git a/Source/WebCore/crypto/keys/CryptoKeyRSA.h b/Source/WebCore/crypto/keys/CryptoKeyRSA.h
index 8062101..6aee735 100644
--- a/Source/WebCore/crypto/keys/CryptoKeyRSA.h
+++ b/Source/WebCore/crypto/keys/CryptoKeyRSA.h
@@ -100,7 +100,7 @@
     using KeyPairCallback = WTF::Function<void(CryptoKeyPair&)>;
     using VoidCallback = WTF::Function<void()>;
     static void generatePair(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, unsigned modulusLength, const Vector<uint8_t>& publicExponent, bool extractable, CryptoKeyUsageBitmap, KeyPairCallback&&, VoidCallback&& failureCallback, ScriptExecutionContext*);
-    static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, Optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap);
+    static RefPtr<CryptoKeyRSA> importJwk(CryptoAlgorithmIdentifier, std::optional<CryptoAlgorithmIdentifier> hash, JsonWebKey&&, bool extractable, CryptoKeyUsageBitmap);
 
     PlatformRSAKey platformKey() const { return m_platformKey; }
     JsonWebKey exportJwk() const;
diff --git a/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.cpp b/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.cpp
index db274f3..765e1ee 100644
--- a/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.cpp
+++ b/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.cpp
@@ -44,7 +44,7 @@
 {
 }
 
-Optional<CryptoAlgorithmPair> CryptoKeySerializationRaw::reconcileAlgorithm(CryptoAlgorithm* algorithm, CryptoAlgorithmParametersDeprecated* parameters) const
+std::optional<CryptoAlgorithmPair> CryptoKeySerializationRaw::reconcileAlgorithm(CryptoAlgorithm* algorithm, CryptoAlgorithmParametersDeprecated* parameters) const
 {
     return CryptoAlgorithmPair { algorithm, parameters };
 }
diff --git a/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.h b/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.h
index 97c08d2..75dd4e5 100644
--- a/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.h
+++ b/Source/WebCore/crypto/keys/CryptoKeySerializationRaw.h
@@ -50,7 +50,7 @@
 private:
     CryptoKeySerializationRaw(const CryptoOperationData&);
 
-    Optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const override;
+    std::optional<CryptoAlgorithmPair> reconcileAlgorithm(CryptoAlgorithm*, CryptoAlgorithmParametersDeprecated*) const override;
 
     void reconcileUsages(CryptoKeyUsageBitmap&) const override;
     void reconcileExtractable(bool&) const override;
diff --git a/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp b/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp
index cd3b0cc..fb4c1b3 100644
--- a/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp
+++ b/Source/WebCore/crypto/mac/CryptoAlgorithmHMACMac.cpp
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-static Optional<CCHmacAlgorithm> commonCryptoHMACAlgorithm(CryptoAlgorithmIdentifier hashFunction)
+static std::optional<CCHmacAlgorithm> commonCryptoHMACAlgorithm(CryptoAlgorithmIdentifier hashFunction)
 {
     switch (hashFunction) {
     case CryptoAlgorithmIdentifier::SHA_1:
@@ -50,7 +50,7 @@
     case CryptoAlgorithmIdentifier::SHA_512:
         return kCCHmacAlgSHA512;
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 }
 
diff --git a/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp b/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp
index a346227..2e95c84 100644
--- a/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp
+++ b/Source/WebCore/crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp
@@ -36,7 +36,7 @@
 
 namespace WebCore {
 
-inline Optional<CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
+inline std::optional<CryptoDigest::Algorithm> cryptoDigestAlgorithm(CryptoAlgorithmIdentifier hashFunction)
 {
     switch (hashFunction) {
     case CryptoAlgorithmIdentifier::SHA_1:
@@ -50,7 +50,7 @@
     case CryptoAlgorithmIdentifier::SHA_512:
         return CryptoDigest::Algorithm::SHA_512;
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 }
 
diff --git a/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h b/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
index 0997472..e4bff65 100644
--- a/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
+++ b/Source/WebCore/crypto/parameters/CryptoAlgorithmHmacKeyParams.h
@@ -37,7 +37,7 @@
     // FIXME: Consider merging hash and hashIdentifier.
     JSC::JSValue hash;
     CryptoAlgorithmIdentifier hashIdentifier;
-    Optional<unsigned long> length;
+    std::optional<unsigned long> length;
 
     Class parametersClass() const final { return Class::HmacKeyParams; }
 };
diff --git a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h b/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
index e689936..c56e653 100644
--- a/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
+++ b/Source/WebCore/crypto/parameters/CryptoAlgorithmRsaOaepParams.h
@@ -36,7 +36,7 @@
 class CryptoAlgorithmRsaOaepParams final : public CryptoAlgorithmParameters {
 public:
     // Use labelVector() instead of label. The label will be gone once labelVector() is called.
-    Optional<BufferSource::VariantType> label;
+    std::optional<BufferSource::VariantType> label;
 
     Class parametersClass() const final { return Class::RsaOaepParams; }
 
@@ -46,7 +46,7 @@
             return m_labelVector;
 
         m_labelBuffer = WTFMove(*label);
-        label = Nullopt;
+        label = std::nullopt;
         if (!m_labelBuffer.length())
             return m_labelVector;
 
diff --git a/Source/WebCore/css/CSSFontFace.cpp b/Source/WebCore/css/CSSFontFace.cpp
index 5eab55b..25671c1 100644
--- a/Source/WebCore/css/CSSFontFace.cpp
+++ b/Source/WebCore/css/CSSFontFace.cpp
@@ -124,10 +124,10 @@
     return true;
 }
 
-Optional<FontTraitsMask> CSSFontFace::calculateStyleMask(CSSValue& style)
+std::optional<FontTraitsMask> CSSFontFace::calculateStyleMask(CSSValue& style)
 {
     if (!is<CSSPrimitiveValue>(style))
-        return Nullopt;
+        return std::nullopt;
 
     switch (downcast<CSSPrimitiveValue>(style).valueID()) {
     case CSSValueNormal:
@@ -159,10 +159,10 @@
     return false;
 }
 
-Optional<FontTraitsMask> CSSFontFace::calculateWeightMask(CSSValue& weight)
+std::optional<FontTraitsMask> CSSFontFace::calculateWeightMask(CSSValue& weight)
 {
     if (!is<CSSPrimitiveValue>(weight))
-        return Nullopt;
+        return std::nullopt;
 
     switch (downcast<CSSPrimitiveValue>(weight).valueID()) {
     case CSSValueBold:
diff --git a/Source/WebCore/css/CSSFontFace.h b/Source/WebCore/css/CSSFontFace.h
index 8b13a1b..b11dfd0 100644
--- a/Source/WebCore/css/CSSFontFace.h
+++ b/Source/WebCore/css/CSSFontFace.h
@@ -87,8 +87,8 @@
     Status status() const { return m_status; }
     StyleRuleFontFace* cssConnection() const { return m_cssConnection.get(); }
 
-    static Optional<FontTraitsMask> calculateStyleMask(CSSValue& style);
-    static Optional<FontTraitsMask> calculateWeightMask(CSSValue& weight);
+    static std::optional<FontTraitsMask> calculateStyleMask(CSSValue& style);
+    static std::optional<FontTraitsMask> calculateWeightMask(CSSValue& weight);
 
     class Client;
     void addClient(Client&);
diff --git a/Source/WebCore/css/CSSFontFaceSet.cpp b/Source/WebCore/css/CSSFontFaceSet.cpp
index 522ac86..b6068cc 100644
--- a/Source/WebCore/css/CSSFontFaceSet.cpp
+++ b/Source/WebCore/css/CSSFontFaceSet.cpp
@@ -284,7 +284,7 @@
     return m_faces[i];
 }
 
-static Optional<FontTraitsMask> computeFontTraitsMask(MutableStyleProperties& style)
+static std::optional<FontTraitsMask> computeFontTraitsMask(MutableStyleProperties& style)
 {
     RefPtr<CSSValue> styleValue = style.getPropertyCSSValue(CSSPropertyFontStyle).get();
     if (!styleValue)
@@ -294,7 +294,7 @@
     if (auto styleMaskOptional = CSSFontFace::calculateStyleMask(*styleValue))
         styleMask = styleMaskOptional.value();
     else
-        return Nullopt;
+        return std::nullopt;
 
     RefPtr<CSSValue> weightValue = style.getPropertyCSSValue(CSSPropertyFontWeight).get();
     if (!weightValue)
@@ -304,7 +304,7 @@
     if (auto weightMaskOptional = CSSFontFace::calculateWeightMask(*weightValue))
         weightMask = weightMaskOptional.value();
     else
-        return Nullopt;
+        return std::nullopt;
 
     return static_cast<FontTraitsMask>(static_cast<unsigned>(styleMask) | static_cast<unsigned>(weightMask));
 }
diff --git a/Source/WebCore/css/CSSPrimitiveValue.cpp b/Source/WebCore/css/CSSPrimitiveValue.cpp
index 621fce8..5b0d1fb 100644
--- a/Source/WebCore/css/CSSPrimitiveValue.cpp
+++ b/Source/WebCore/css/CSSPrimitiveValue.cpp
@@ -836,7 +836,7 @@
 
 double CSSPrimitiveValue::doubleValue(UnitTypes unitType) const
 {
-    return doubleValueInternal(unitType).valueOr(0);
+    return doubleValueInternal(unitType).value_or(0);
 }
 
 double CSSPrimitiveValue::doubleValue() const
@@ -871,10 +871,10 @@
     }
 }
 
-Optional<double> CSSPrimitiveValue::doubleValueInternal(UnitTypes requestedUnitType) const
+std::optional<double> CSSPrimitiveValue::doubleValueInternal(UnitTypes requestedUnitType) const
 {
     if (!isValidCSSUnitTypeForDoubleConversion(static_cast<UnitTypes>(m_primitiveUnitType)) || !isValidCSSUnitTypeForDoubleConversion(requestedUnitType))
-        return Nullopt;
+        return std::nullopt;
 
     UnitTypes sourceUnitType = static_cast<UnitTypes>(primitiveType());
     if (requestedUnitType == sourceUnitType || requestedUnitType == CSS_DIMENSION)
@@ -889,20 +889,20 @@
 
     // Cannot convert between unrelated unit categories if one of them is not UNumber.
     if (sourceCategory != targetCategory && sourceCategory != UNumber && targetCategory != UNumber)
-        return Nullopt;
+        return std::nullopt;
 
     if (targetCategory == UNumber) {
         // We interpret conversion to CSS_NUMBER as conversion to a canonical unit in this value's category.
         targetUnitType = canonicalUnitTypeForCategory(sourceCategory);
         if (targetUnitType == CSS_UNKNOWN)
-            return Nullopt;
+            return std::nullopt;
     }
 
     if (sourceUnitType == CSS_NUMBER) {
         // We interpret conversion from CSS_NUMBER in the same way as CSSParser::validUnit() while using non-strict mode.
         sourceUnitType = canonicalUnitTypeForCategory(targetCategory);
         if (sourceUnitType == CSS_UNKNOWN)
-            return Nullopt;
+            return std::nullopt;
     }
 
     double convertedValue = doubleValue();
diff --git a/Source/WebCore/css/CSSPrimitiveValue.h b/Source/WebCore/css/CSSPrimitiveValue.h
index bd76a0b..bbe817e 100644
--- a/Source/WebCore/css/CSSPrimitiveValue.h
+++ b/Source/WebCore/css/CSSPrimitiveValue.h
@@ -360,7 +360,7 @@
     void init(RefPtr<DashboardRegion>&&); // FIXME: Dashboard region should not be a primitive value.
 #endif
 
-    Optional<double> doubleValueInternal(UnitTypes targetUnitType) const;
+    std::optional<double> doubleValueInternal(UnitTypes targetUnitType) const;
 
     double computeLengthDouble(const CSSToLengthConversionData&) const;
 
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index 0623b88..1d76c66 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -35,7 +35,7 @@
 // function in css/StyleBuilderConverter.h should be used.
 //
 // * ConditionalConverter=XXX:
-// Similar to Converter=XXX but the converter function returns a WTF::Optional<>
+// Similar to Converter=XXX but the converter function returns a std::optional<>
 // to indicate if the property setter should be called or not.
 //
 // * Custom=[Initial|Value|Inherit|All]:
diff --git a/Source/WebCore/css/CSSSegmentedFontFace.cpp b/Source/WebCore/css/CSSSegmentedFontFace.cpp
index 778e649..850185b 100644
--- a/Source/WebCore/css/CSSSegmentedFontFace.cpp
+++ b/Source/WebCore/css/CSSSegmentedFontFace.cpp
@@ -87,7 +87,7 @@
         return m_result && m_result.value() && m_result.value()->isLoading();
     }
 
-    mutable Optional<RefPtr<Font>> m_result; // Caches nullptr too
+    mutable std::optional<RefPtr<Font>> m_result; // Caches nullptr too
     mutable Ref<CSSFontFace> m_fontFace;
     FontDescription m_fontDescription;
     bool m_syntheticBold;
diff --git a/Source/WebCore/css/CSSStyleSheet.cpp b/Source/WebCore/css/CSSStyleSheet.cpp
index afa3666..775a6b5 100644
--- a/Source/WebCore/css/CSSStyleSheet.cpp
+++ b/Source/WebCore/css/CSSStyleSheet.cpp
@@ -83,7 +83,7 @@
     return adoptRef(*new CSSStyleSheet(WTFMove(sheet), ownerRule));
 }
 
-Ref<CSSStyleSheet> CSSStyleSheet::create(Ref<StyleSheetContents>&& sheet, Node& ownerNode, const Optional<bool>& isCleanOrigin)
+Ref<CSSStyleSheet> CSSStyleSheet::create(Ref<StyleSheetContents>&& sheet, Node& ownerNode, const std::optional<bool>& isCleanOrigin)
 {
     return adoptRef(*new CSSStyleSheet(WTFMove(sheet), ownerNode, TextPosition::minimumPosition(), false, isCleanOrigin));
 }
@@ -105,7 +105,7 @@
     m_contents->registerClient(this);
 }
 
-CSSStyleSheet::CSSStyleSheet(Ref<StyleSheetContents>&& contents, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const Optional<bool>& isOriginClean)
+CSSStyleSheet::CSSStyleSheet(Ref<StyleSheetContents>&& contents, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const std::optional<bool>& isOriginClean)
     : m_contents(WTFMove(contents))
     , m_isInlineStylesheet(isInlineStylesheet)
     , m_isDisabled(false)
@@ -325,7 +325,7 @@
     return { };
 }
 
-ExceptionOr<int> CSSStyleSheet::addRule(const String& selector, const String& style, Optional<unsigned> index)
+ExceptionOr<int> CSSStyleSheet::addRule(const String& selector, const String& style, std::optional<unsigned> index)
 {
     StringBuilder text;
     text.append(selector);
@@ -334,7 +334,7 @@
     if (!style.isEmpty())
         text.append(' ');
     text.append('}');
-    auto insertRuleResult = insertRule(text.toString(), index.valueOr(length()));
+    auto insertRuleResult = insertRule(text.toString(), index.value_or(length()));
     if (insertRuleResult.hasException())
         return insertRuleResult.releaseException();
     
diff --git a/Source/WebCore/css/CSSStyleSheet.h b/Source/WebCore/css/CSSStyleSheet.h
index 291e9e7..c4ae395 100644
--- a/Source/WebCore/css/CSSStyleSheet.h
+++ b/Source/WebCore/css/CSSStyleSheet.h
@@ -52,7 +52,7 @@
 class CSSStyleSheet final : public StyleSheet {
 public:
     static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, CSSImportRule* ownerRule = 0);
-    static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, Node& ownerNode, const Optional<bool>& isOriginClean = Nullopt);
+    static Ref<CSSStyleSheet> create(Ref<StyleSheetContents>&&, Node& ownerNode, const std::optional<bool>& isOriginClean = std::nullopt);
     static Ref<CSSStyleSheet> createInline(Ref<StyleSheetContents>&&, Element& owner, const TextPosition& startPosition);
 
     virtual ~CSSStyleSheet();
@@ -71,7 +71,7 @@
     WEBCORE_EXPORT ExceptionOr<void> deleteRule(unsigned index);
     
     WEBCORE_EXPORT RefPtr<CSSRuleList> rules();
-    WEBCORE_EXPORT ExceptionOr<int> addRule(const String& selector, const String& style, Optional<unsigned> index);
+    WEBCORE_EXPORT ExceptionOr<int> addRule(const String& selector, const String& style, std::optional<unsigned> index);
     ExceptionOr<void> removeRule(unsigned index) { return deleteRule(index); }
     
     // For CSSRuleList.
@@ -132,7 +132,7 @@
 private:
     CSSStyleSheet(Ref<StyleSheetContents>&&, CSSImportRule* ownerRule);
     CSSStyleSheet(Ref<StyleSheetContents>&&, Node* ownerNode, const TextPosition& startPosition, bool isInlineStylesheet);
-    CSSStyleSheet(Ref<StyleSheetContents>&&, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const Optional<bool>&);
+    CSSStyleSheet(Ref<StyleSheetContents>&&, Node& ownerNode, const TextPosition& startPosition, bool isInlineStylesheet, const std::optional<bool>&);
 
     bool isCSSStyleSheet() const final { return true; }
     String type() const final { return ASCIILiteral("text/css"); }
@@ -143,7 +143,7 @@
     bool m_isInlineStylesheet;
     bool m_isDisabled;
     bool m_mutatedRules;
-    Optional<bool> m_isOriginClean;
+    std::optional<bool> m_isOriginClean;
     String m_title;
     RefPtr<MediaQuerySet> m_mediaQueries;
 
diff --git a/Source/WebCore/css/FontFace.cpp b/Source/WebCore/css/FontFace.cpp
index 601b92d..e6e0f70 100644
--- a/Source/WebCore/css/FontFace.cpp
+++ b/Source/WebCore/css/FontFace.cpp
@@ -374,12 +374,12 @@
         break;
     case CSSFontFace::Status::Success:
         if (m_promise)
-            std::exchange(m_promise, Nullopt)->resolve(*this);
+            std::exchange(m_promise, std::nullopt)->resolve(*this);
         deref();
         return;
     case CSSFontFace::Status::Failure:
         if (m_promise)
-            std::exchange(m_promise, Nullopt)->reject(NETWORK_ERR);
+            std::exchange(m_promise, std::nullopt)->reject(NETWORK_ERR);
         deref();
         return;
     case CSSFontFace::Status::Pending:
diff --git a/Source/WebCore/css/FontFace.h b/Source/WebCore/css/FontFace.h
index fa8f313..23cef7d 100644
--- a/Source/WebCore/css/FontFace.h
+++ b/Source/WebCore/css/FontFace.h
@@ -66,7 +66,7 @@
     LoadStatus status() const;
 
     typedef DOMPromise<FontFace&> Promise;
-    Optional<Promise>& promise() { return m_promise; }
+    std::optional<Promise>& promise() { return m_promise; }
     void registerLoaded(Promise&&);
 
     void adopt(CSSFontFace&);
@@ -90,7 +90,7 @@
 
     WeakPtrFactory<FontFace> m_weakPtrFactory;
     Ref<CSSFontFace> m_backing;
-    Optional<Promise> m_promise;
+    std::optional<Promise> m_promise;
 };
 
 }
diff --git a/Source/WebCore/css/FontFaceSet.cpp b/Source/WebCore/css/FontFaceSet.cpp
index 94c1c55..738b08e 100644
--- a/Source/WebCore/css/FontFaceSet.cpp
+++ b/Source/WebCore/css/FontFaceSet.cpp
@@ -204,7 +204,7 @@
 void FontFaceSet::completedLoading()
 {
     if (m_promise)
-        std::exchange(m_promise, Nullopt)->resolve(*this);
+        std::exchange(m_promise, std::nullopt)->resolve(*this);
     m_isReady = true;
 }
 
diff --git a/Source/WebCore/css/FontFaceSet.h b/Source/WebCore/css/FontFaceSet.h
index fe2a6e7..03f4f42 100644
--- a/Source/WebCore/css/FontFaceSet.h
+++ b/Source/WebCore/css/FontFaceSet.h
@@ -109,7 +109,7 @@
 
     Ref<CSSFontFaceSet> m_backing;
     HashMap<RefPtr<FontFace>, Vector<Ref<PendingPromise>>> m_pendingPromises;
-    Optional<ReadyPromise> m_promise;
+    std::optional<ReadyPromise> m_promise;
     bool m_isReady { true };
 };
 
diff --git a/Source/WebCore/css/MediaQueryEvaluator.cpp b/Source/WebCore/css/MediaQueryEvaluator.cpp
index a860117..65629ac 100644
--- a/Source/WebCore/css/MediaQueryEvaluator.cpp
+++ b/Source/WebCore/css/MediaQueryEvaluator.cpp
@@ -214,10 +214,10 @@
     return compareValue(width * aspectRatio.denominatorValue(), height * aspectRatio.numeratorValue(), op);
 }
 
-static Optional<double> doubleValue(CSSValue* value)
+static std::optional<double> doubleValue(CSSValue* value)
 {
     if (!is<CSSPrimitiveValue>(value) || !downcast<CSSPrimitiveValue>(*value).isNumber())
-        return Nullopt;
+        return std::nullopt;
     return downcast<CSSPrimitiveValue>(*value).doubleValue(CSSPrimitiveValue::CSS_NUMBER);
 }
 
diff --git a/Source/WebCore/css/StyleBuilderConverter.h b/Source/WebCore/css/StyleBuilderConverter.h
index ace5d86..4e0eaa3 100644
--- a/Source/WebCore/css/StyleBuilderConverter.h
+++ b/Source/WebCore/css/StyleBuilderConverter.h
@@ -101,13 +101,13 @@
 #if ENABLE(CSS_GRID_LAYOUT)
     static GridTrackSize convertGridTrackSize(StyleResolver&, const CSSValue&);
     static Vector<GridTrackSize> convertGridTrackSizeList(StyleResolver&, const CSSValue&);
-    static Optional<GridPosition> convertGridPosition(StyleResolver&, const CSSValue&);
+    static std::optional<GridPosition> convertGridPosition(StyleResolver&, const CSSValue&);
     static GridAutoFlow convertGridAutoFlow(StyleResolver&, const CSSValue&);
 #endif // ENABLE(CSS_GRID_LAYOUT)
-    static Optional<Length> convertWordSpacing(StyleResolver&, const CSSValue&);
-    static Optional<float> convertPerspective(StyleResolver&, const CSSValue&);
-    static Optional<Length> convertMarqueeIncrement(StyleResolver&, const CSSValue&);
-    static Optional<FilterOperations> convertFilterOperations(StyleResolver&, const CSSValue&);
+    static std::optional<Length> convertWordSpacing(StyleResolver&, const CSSValue&);
+    static std::optional<float> convertPerspective(StyleResolver&, const CSSValue&);
+    static std::optional<Length> convertMarqueeIncrement(StyleResolver&, const CSSValue&);
+    static std::optional<FilterOperations> convertFilterOperations(StyleResolver&, const CSSValue&);
 #if PLATFORM(IOS)
     static bool convertTouchCallout(StyleResolver&, const CSSValue&);
 #endif
@@ -132,7 +132,7 @@
     static StyleContentAlignmentData convertContentAlignmentData(StyleResolver&, const CSSValue&);
     static EGlyphOrientation convertGlyphOrientation(StyleResolver&, const CSSValue&);
     static EGlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&, const CSSValue&);
-    static Optional<Length> convertLineHeight(StyleResolver&, const CSSValue&, float multiplier = 1.f);
+    static std::optional<Length> convertLineHeight(StyleResolver&, const CSSValue&, float multiplier = 1.f);
     static FontSynthesis convertFontSynthesis(StyleResolver&, const CSSValue&);
     
     static BreakBetween convertPageBreakBetween(StyleResolver&, const CSSValue&);
@@ -1084,12 +1084,12 @@
     return createGridTrackSize(value, styleResolver);
 }
 
-inline Optional<GridPosition> StyleBuilderConverter::convertGridPosition(StyleResolver&, const CSSValue& value)
+inline std::optional<GridPosition> StyleBuilderConverter::convertGridPosition(StyleResolver&, const CSSValue& value)
 {
     GridPosition gridPosition;
     if (createGridPosition(value, gridPosition))
         return gridPosition;
-    return Nullopt;
+    return std::nullopt;
 }
 
 inline GridAutoFlow StyleBuilderConverter::convertGridAutoFlow(StyleResolver&, const CSSValue& value)
@@ -1137,9 +1137,9 @@
     return styleResolver.state().cssToLengthConversionData();
 }
 
-inline Optional<Length> StyleBuilderConverter::convertWordSpacing(StyleResolver& styleResolver, const CSSValue& value)
+inline std::optional<Length> StyleBuilderConverter::convertWordSpacing(StyleResolver& styleResolver, const CSSValue& value)
 {
-    Optional<Length> wordSpacing;
+    std::optional<Length> wordSpacing;
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     if (primitiveValue.valueID() == CSSValueNormal)
         wordSpacing = RenderStyle::initialWordSpacing();
@@ -1153,7 +1153,7 @@
     return wordSpacing;
 }
 
-inline Optional<float> StyleBuilderConverter::convertPerspective(StyleResolver& styleResolver, const CSSValue& value)
+inline std::optional<float> StyleBuilderConverter::convertPerspective(StyleResolver& styleResolver, const CSSValue& value)
 {
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     if (primitiveValue.valueID() == CSSValueNone)
@@ -1167,12 +1167,12 @@
     else
         ASSERT_NOT_REACHED();
 
-    return perspective < 0 ? Optional<float>(Nullopt) : Optional<float>(perspective);
+    return perspective < 0 ? std::optional<float>(std::nullopt) : std::optional<float>(perspective);
 }
 
-inline Optional<Length> StyleBuilderConverter::convertMarqueeIncrement(StyleResolver& styleResolver, const CSSValue& value)
+inline std::optional<Length> StyleBuilderConverter::convertMarqueeIncrement(StyleResolver& styleResolver, const CSSValue& value)
 {
-    Optional<Length> marqueeLength;
+    std::optional<Length> marqueeLength;
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     switch (primitiveValue.valueID()) {
     case CSSValueSmall:
@@ -1196,12 +1196,12 @@
     return marqueeLength;
 }
 
-inline Optional<FilterOperations> StyleBuilderConverter::convertFilterOperations(StyleResolver& styleResolver, const CSSValue& value)
+inline std::optional<FilterOperations> StyleBuilderConverter::convertFilterOperations(StyleResolver& styleResolver, const CSSValue& value)
 {
     FilterOperations operations;
     if (styleResolver.createFilterOperations(value, operations))
         return operations;
-    return Nullopt;
+    return std::nullopt;
 }
 
 inline FontFeatureSettings StyleBuilderConverter::convertFontFeatureSettings(StyleResolver&, const CSSValue& value)
@@ -1404,7 +1404,7 @@
     return convertGlyphOrientation(styleResolver, value);
 }
 
-inline Optional<Length> StyleBuilderConverter::convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, float multiplier)
+inline std::optional<Length> StyleBuilderConverter::convertLineHeight(StyleResolver& styleResolver, const CSSValue& value, float multiplier)
 {
     auto& primitiveValue = downcast<CSSPrimitiveValue>(value);
     if (primitiveValue.valueID() == CSSValueNormal)
@@ -1424,7 +1424,7 @@
         // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
         return Length(primitiveValue.doubleValue() * multiplier * 100.0, Percent);
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 inline FontSynthesis StyleBuilderConverter::convertFontSynthesis(StyleResolver&, const CSSValue& value)
diff --git a/Source/WebCore/css/StyleBuilderCustom.h b/Source/WebCore/css/StyleBuilderCustom.h
index 711e589..4f1a073 100644
--- a/Source/WebCore/css/StyleBuilderCustom.h
+++ b/Source/WebCore/css/StyleBuilderCustom.h
@@ -630,7 +630,7 @@
 inline void StyleBuilderCustom::applyValueLineHeight(StyleResolver& styleResolver, CSSValue& value)
 {
     float multiplier = styleResolver.style()->textSizeAdjust().isPercentage() ? styleResolver.style()->textSizeAdjust().multiplier() : 1.f;
-    Optional<Length> lineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, multiplier);
+    std::optional<Length> lineHeight = StyleBuilderConverter::convertLineHeight(styleResolver, value, multiplier);
     if (!lineHeight)
         return;
 
diff --git a/Source/WebCore/css/StyleRuleImport.cpp b/Source/WebCore/css/StyleRuleImport.cpp
index ff7bc35..0ea7cac 100644
--- a/Source/WebCore/css/StyleRuleImport.cpp
+++ b/Source/WebCore/css/StyleRuleImport.cpp
@@ -115,7 +115,7 @@
 
     // FIXME: Skip Content Security Policy check when stylesheet is in a user agent shadow tree.
     // See <https://bugs.webkit.org/show_bug.cgi?id=146663>.
-    CachedResourceRequest request(absURL, CachedResourceLoader::defaultCachedResourceOptions(), Nullopt, String(m_parentStyleSheet->charset()));
+    CachedResourceRequest request(absURL, CachedResourceLoader::defaultCachedResourceOptions(), std::nullopt, String(m_parentStyleSheet->charset()));
     request.setInitiator(cachedResourceRequestInitiators().css);
     if (m_cachedSheet)
         m_cachedSheet->removeClient(m_styleSheetClient);
diff --git a/Source/WebCore/css/parser/CSSParser.cpp b/Source/WebCore/css/parser/CSSParser.cpp
index 0d8bbbe..a5bf5c8 100644
--- a/Source/WebCore/css/parser/CSSParser.cpp
+++ b/Source/WebCore/css/parser/CSSParser.cpp
@@ -4985,29 +4985,29 @@
     return m_context.springTimingFunctionEnabled;
 }
 
-Optional<double> CSSParser::parseCubicBezierTimingFunctionValue(CSSParserValueList& args)
+std::optional<double> CSSParser::parseCubicBezierTimingFunctionValue(CSSParserValueList& args)
 {
     ValueWithCalculation argumentWithCalculation(*args.current());
     if (!validateUnit(argumentWithCalculation, FNumber))
-        return Nullopt;
-    Optional<double> result = parsedDouble(argumentWithCalculation);
+        return std::nullopt;
+    std::optional<double> result = parsedDouble(argumentWithCalculation);
     CSSParserValue* nextValue = args.next();
     if (!nextValue) {
         // The last number in the function has no comma after it, so we're done.
         return result;
     }
     if (!isComma(nextValue))
-        return Nullopt;
+        return std::nullopt;
     args.next();
     return result;
 }
 
-Optional<double> CSSParser::parseSpringTimingFunctionValue(CSSParserValueList& args)
+std::optional<double> CSSParser::parseSpringTimingFunctionValue(CSSParserValueList& args)
 {
     ValueWithCalculation argumentWithCalculation(*args.current());
     if (!validateUnit(argumentWithCalculation, FNumber))
-        return Nullopt;
-    Optional<double> result = parsedDouble(argumentWithCalculation);
+        return std::nullopt;
+    std::optional<double> result = parsedDouble(argumentWithCalculation);
     args.next();
     return result;
 }
@@ -7671,11 +7671,11 @@
     return true;
 }
 
-Optional<std::pair<std::array<double, 4>, ColorSpace>> CSSParser::parseColorFunctionParameters(CSSParserValue& value)
+std::optional<std::pair<std::array<double, 4>, ColorSpace>> CSSParser::parseColorFunctionParameters(CSSParserValue& value)
 {
     CSSParserValueList* args = value.function->args.get();
     if (!args->size())
-        return Nullopt;
+        return std::nullopt;
 
     ColorSpace colorSpace;
     switch (args->current()->id) {
@@ -7686,7 +7686,7 @@
         colorSpace = ColorSpaceDisplayP3;
         break;
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 
     std::array<double, 4> colorValues = { { 0, 0, 0, 1 } };
@@ -7696,7 +7696,7 @@
         if (valueOrNull) {
             ValueWithCalculation argumentWithCalculation(*valueOrNull);
             if (!validateUnit(argumentWithCalculation, FNumber))
-                return Nullopt;
+                return std::nullopt;
             colorValues[i] = std::max(0.0, std::min(1.0, parsedDouble(argumentWithCalculation)));
         }
     }
@@ -7706,13 +7706,13 @@
         return { { colorValues, colorSpace } };
 
     if (!isForwardSlashOperator(*slashOrNull))
-        return Nullopt;
+        return std::nullopt;
 
     // Handle alpha.
 
     ValueWithCalculation argumentWithCalculation(*args->next());
     if (!validateUnit(argumentWithCalculation, FNumber | FPercent))
-        return Nullopt;
+        return std::nullopt;
     colorValues[3] = std::max(0.0, std::min(1.0, parseColorDouble(argumentWithCalculation)));
 
     // FIXME: Support the comma-separated list of fallback color values.
@@ -7720,7 +7720,7 @@
 
     auto commaOrNull = args->next();
     if (commaOrNull && !isComma(commaOrNull))
-        return Nullopt;
+        return std::nullopt;
 
     return { { colorValues, colorSpace } };
 }
@@ -7814,7 +7814,7 @@
     } else if (value.unit == CSSParserValue::Function
         && value.function->args
         && equalLettersIgnoringASCIICase(value.function->name, "color(")) {
-        Optional<std::pair<std::array<double, 4>, ColorSpace>> colorData = parseColorFunctionParameters(value);
+        std::optional<std::pair<std::array<double, 4>, ColorSpace>> colorData = parseColorFunctionParameters(value);
         if (!colorData)
             return Color();
         return Color(colorData.value().first[0], colorData.value().first[1], colorData.value().first[2], colorData.value().first[3], colorData.value().second);
diff --git a/Source/WebCore/css/parser/CSSParser.h b/Source/WebCore/css/parser/CSSParser.h
index 0fbf659..d9d2e1f 100644
--- a/Source/WebCore/css/parser/CSSParser.h
+++ b/Source/WebCore/css/parser/CSSParser.h
@@ -175,7 +175,7 @@
         SourceSize(MediaQueryExpression&&, Ref<CSSValue>&&);
     };
     Vector<SourceSize> parseSizesAttribute(StringView);
-    Optional<SourceSize> sourceSize(MediaQueryExpression&&, CSSParserValue&);
+    std::optional<SourceSize> sourceSize(MediaQueryExpression&&, CSSParserValue&);
 
     bool parseFillImage(CSSParserValueList&, RefPtr<CSSValue>&);
 
@@ -214,8 +214,8 @@
     static std::unique_ptr<Vector<double>> parseKeyframeKeyList(const String&);
 
     bool parseTransformOriginShorthand(RefPtr<CSSPrimitiveValue>&, RefPtr<CSSPrimitiveValue>&, RefPtr<CSSValue>&);
-    Optional<double> parseCubicBezierTimingFunctionValue(CSSParserValueList&);
-    Optional<double> parseSpringTimingFunctionValue(CSSParserValueList&);
+    std::optional<double> parseCubicBezierTimingFunctionValue(CSSParserValueList&);
+    std::optional<double> parseSpringTimingFunctionValue(CSSParserValueList&);
     bool parseAnimationProperty(CSSPropertyID, RefPtr<CSSValue>&, AnimationParseContext&);
     bool parseTransitionShorthand(CSSPropertyID, bool important);
     bool parseAnimationShorthand(CSSPropertyID, bool important);
@@ -280,7 +280,7 @@
 
     bool parseRGBParameters(CSSParserValue&, int* colorValues, bool parseAlpha);
     bool parseHSLParameters(CSSParserValue&, double* colorValues, bool parseAlpha);
-    Optional<std::pair<std::array<double, 4>, ColorSpace>> parseColorFunctionParameters(CSSParserValue&);
+    std::optional<std::pair<std::array<double, 4>, ColorSpace>> parseColorFunctionParameters(CSSParserValue&);
     RefPtr<CSSPrimitiveValue> parseColor(CSSParserValue* = nullptr);
     Color parseColorFromValue(CSSParserValue&);
     void parseSelector(const String&, CSSSelectorList&);
diff --git a/Source/WebCore/cssjit/SelectorCompiler.cpp b/Source/WebCore/cssjit/SelectorCompiler.cpp
index e484849..e3dfcd0 100644
--- a/Source/WebCore/cssjit/SelectorCompiler.cpp
+++ b/Source/WebCore/cssjit/SelectorCompiler.cpp
@@ -326,8 +326,8 @@
     void generateElementHasFocusWithin(Assembler::JumpList& failureCases);
 
     // Helpers.
-    void generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type, Optional<Assembler::RegisterID> value = { });
-    void generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type, Optional<Assembler::RegisterID> value = { });
+    void generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type, std::optional<Assembler::RegisterID> value = { });
+    void generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type, std::optional<Assembler::RegisterID> value = { });
     Assembler::Jump branchOnResolvingModeWithCheckingContext(Assembler::RelationalCondition, SelectorChecker::Mode, Assembler::RegisterID checkingContext);
     Assembler::Jump branchOnResolvingMode(Assembler::RelationalCondition, SelectorChecker::Mode, Assembler::RegisterID checkingContext);
     void generateElementIsFirstLink(Assembler::JumpList& failureCases, Assembler::RegisterID element);
@@ -2170,7 +2170,7 @@
     localFailureCases.linkTo(loopStart, &m_assembler);
 }
 
-void SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type relationType, Optional<Assembler::RegisterID> value)
+void SelectorCodeGenerator::generateAddStyleRelationIfResolvingStyle(Assembler::RegisterID element, Style::Relation::Type relationType, std::optional<Assembler::RegisterID> value)
 {
     if (m_selectorContext == SelectorContext::QuerySelector)
         return;
@@ -2188,7 +2188,7 @@
     checkingContext->styleRelations.append({ *element, Style::Relation::AffectedByActive, 1 });
 }
 
-void SelectorCodeGenerator::generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type relationType, Optional<Assembler::RegisterID> value)
+void SelectorCodeGenerator::generateAddStyleRelation(Assembler::RegisterID checkingContext, Assembler::RegisterID element, Style::Relation::Type relationType, std::optional<Assembler::RegisterID> value)
 {
     ASSERT(m_selectorContext != SelectorContext::QuerySelector);
 
diff --git a/Source/WebCore/dom/CustomElementReactionQueue.cpp b/Source/WebCore/dom/CustomElementReactionQueue.cpp
index 06a2f2e..ac5fee8 100644
--- a/Source/WebCore/dom/CustomElementReactionQueue.cpp
+++ b/Source/WebCore/dom/CustomElementReactionQueue.cpp
@@ -94,7 +94,7 @@
     Type m_type;
     RefPtr<Document> m_oldDocument;
     RefPtr<Document> m_newDocument;
-    Optional<QualifiedName> m_attributeName;
+    std::optional<QualifiedName> m_attributeName;
     AtomicString m_oldValue;
     AtomicString m_newValue;
 };
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index dd944f2..b8805be 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -4343,7 +4343,7 @@
 String Document::lastModified()
 {
     using namespace std::chrono;
-    Optional<system_clock::time_point> dateTime;
+    std::optional<system_clock::time_point> dateTime;
     if (m_frame && loader())
         dateTime = loader()->response().lastModified();
 
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 95561dc..d8eaa22 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -687,7 +687,7 @@
 
 void Element::scrollBy(const ScrollToOptions& options)
 {
-    return scrollBy(options.left.valueOr(0), options.top.valueOr(0));
+    return scrollBy(options.left.value_or(0), options.top.value_or(0));
 }
 
 static inline double normalizeNonFiniteValue(double f)
@@ -3000,7 +3000,7 @@
 
 int Element::getIntegralAttribute(const QualifiedName& attributeName) const
 {
-    return parseHTMLInteger(getAttribute(attributeName)).valueOr(0);
+    return parseHTMLInteger(getAttribute(attributeName)).value_or(0);
 }
 
 void Element::setIntegralAttribute(const QualifiedName& attributeName, int value)
@@ -3010,7 +3010,7 @@
 
 unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeName) const
 {
-    return parseHTMLNonNegativeInteger(getAttribute(attributeName)).valueOr(0);
+    return parseHTMLNonNegativeInteger(getAttribute(attributeName)).value_or(0);
 }
 
 void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value)
@@ -3498,10 +3498,10 @@
     ASSERT(hasCustomStyleResolveCallbacks());
 }
 
-Optional<ElementStyle> Element::resolveCustomStyle(const RenderStyle&, const RenderStyle*)
+std::optional<ElementStyle> Element::resolveCustomStyle(const RenderStyle&, const RenderStyle*)
 {
     ASSERT(hasCustomStyleResolveCallbacks());
-    return Nullopt;
+    return std::nullopt;
 }
 
 void Element::cloneAttributesFromElement(const Element& other)
diff --git a/Source/WebCore/dom/Element.h b/Source/WebCore/dom/Element.h
index 8dc1583..76f45f1 100644
--- a/Source/WebCore/dom/Element.h
+++ b/Source/WebCore/dom/Element.h
@@ -519,7 +519,7 @@
     virtual void didAttachRenderers();
     virtual void willDetachRenderers();
     virtual void didDetachRenderers();
-    virtual Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle);
+    virtual std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle);
 
     LayoutRect absoluteEventHandlerBounds(bool& includesFixedPositionElements) override;
 
diff --git a/Source/WebCore/dom/ElementIteratorAssertions.h b/Source/WebCore/dom/ElementIteratorAssertions.h
index a764a9a..df3703a 100644
--- a/Source/WebCore/dom/ElementIteratorAssertions.h
+++ b/Source/WebCore/dom/ElementIteratorAssertions.h
@@ -40,7 +40,7 @@
 private:
     const Document* m_document;
     uint64_t m_initialDOMTreeVersion;
-    Optional<NoEventDispatchAssertion> m_eventDispatchAssertion;
+    std::optional<NoEventDispatchAssertion> m_eventDispatchAssertion;
 };
 
 // FIXME: No real point in doing these as inlines; they are for debugging and we usually turn off inlining in debug builds.
@@ -60,14 +60,14 @@
 
 inline void ElementIteratorAssertions::dropEventDispatchAssertion()
 {
-    m_eventDispatchAssertion = Nullopt;
+    m_eventDispatchAssertion = std::nullopt;
 }
 
 inline void ElementIteratorAssertions::clear()
 {
     m_document = nullptr;
     m_initialDOMTreeVersion = 0;
-    m_eventDispatchAssertion = Nullopt;
+    m_eventDispatchAssertion = std::nullopt;
 }
 
 } // namespace WebCore
diff --git a/Source/WebCore/dom/ExceptionOr.h b/Source/WebCore/dom/ExceptionOr.h
index 2bd079d..d1d28c1 100644
--- a/Source/WebCore/dom/ExceptionOr.h
+++ b/Source/WebCore/dom/ExceptionOr.h
@@ -68,7 +68,7 @@
     Exception&& releaseException();
 
 private:
-    Optional<Exception> m_exception;
+    std::optional<Exception> m_exception;
 };
 
 ExceptionOr<void> isolatedCopy(ExceptionOr<void>&&);
diff --git a/Source/WebCore/dom/InlineStyleSheetOwner.cpp b/Source/WebCore/dom/InlineStyleSheetOwner.cpp
index f550dd2..572289d 100644
--- a/Source/WebCore/dom/InlineStyleSheetOwner.cpp
+++ b/Source/WebCore/dom/InlineStyleSheetOwner.cpp
@@ -56,7 +56,7 @@
     return result;
 }
 
-static Optional<InlineStyleSheetCacheKey> makeInlineStyleSheetCacheKey(const String& text, const Element& element)
+static std::optional<InlineStyleSheetCacheKey> makeInlineStyleSheetCacheKey(const String& text, const Element& element)
 {
     // Only cache for shadow trees. Main document inline stylesheets are generally unique and can't be shared between documents.
     // FIXME: This could be relaxed when a stylesheet does not contain document-relative URLs (or #urls).
diff --git a/Source/WebCore/dom/KeyboardEvent.h b/Source/WebCore/dom/KeyboardEvent.h
index ec7de96..b6ddde3 100644
--- a/Source/WebCore/dom/KeyboardEvent.h
+++ b/Source/WebCore/dom/KeyboardEvent.h
@@ -62,7 +62,7 @@
 
         // Legacy.
         String keyIdentifier;
-        Optional<unsigned> keyLocation;
+        std::optional<unsigned> keyLocation;
     };
 
     static Ref<KeyboardEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
diff --git a/Source/WebCore/dom/LoadableClassicScript.cpp b/Source/WebCore/dom/LoadableClassicScript.cpp
index 655cd1f..90961b8 100644
--- a/Source/WebCore/dom/LoadableClassicScript.cpp
+++ b/Source/WebCore/dom/LoadableClassicScript.cpp
@@ -51,15 +51,15 @@
     return m_cachedScript->isLoaded();
 }
 
-Optional<LoadableScript::Error> LoadableClassicScript::error() const
+std::optional<LoadableScript::Error> LoadableClassicScript::error() const
 {
     if (m_error)
         return m_error;
 
     if (m_cachedScript->errorOccurred())
-        return Error { ErrorType::CachedScript, Nullopt };
+        return Error { ErrorType::CachedScript, std::nullopt };
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 bool LoadableClassicScript::wasCanceled() const
diff --git a/Source/WebCore/dom/LoadableClassicScript.h b/Source/WebCore/dom/LoadableClassicScript.h
index fe25950..ad41dc2 100644
--- a/Source/WebCore/dom/LoadableClassicScript.h
+++ b/Source/WebCore/dom/LoadableClassicScript.h
@@ -44,7 +44,7 @@
 
     static Ref<LoadableClassicScript> create(CachedResourceHandle<CachedScript>&&);
     bool isLoaded() const final;
-    Optional<Error> error() const final;
+    std::optional<Error> error() const final;
     bool wasCanceled() const final;
 
     CachedScript& cachedScript() { return *m_cachedScript; }
@@ -58,7 +58,7 @@
     void notifyFinished(CachedResource&) final;
 
     CachedResourceHandle<CachedScript> m_cachedScript;
-    Optional<Error> m_error { Nullopt };
+    std::optional<Error> m_error { std::nullopt };
 };
 
 }
diff --git a/Source/WebCore/dom/LoadableModuleScript.cpp b/Source/WebCore/dom/LoadableModuleScript.cpp
index ca18e68..84287ee 100644
--- a/Source/WebCore/dom/LoadableModuleScript.cpp
+++ b/Source/WebCore/dom/LoadableModuleScript.cpp
@@ -52,7 +52,7 @@
     return m_moduleScript->isLoaded();
 }
 
-Optional<LoadableScript::Error> LoadableModuleScript::error() const
+std::optional<LoadableScript::Error> LoadableModuleScript::error() const
 {
     return m_moduleScript->error();
 }
diff --git a/Source/WebCore/dom/LoadableModuleScript.h b/Source/WebCore/dom/LoadableModuleScript.h
index 0cfd0d6..ddea9f8 100644
--- a/Source/WebCore/dom/LoadableModuleScript.h
+++ b/Source/WebCore/dom/LoadableModuleScript.h
@@ -39,7 +39,7 @@
     static Ref<LoadableModuleScript> create(CachedModuleScript&);
 
     bool isLoaded() const final;
-    Optional<Error> error() const final;
+    std::optional<Error> error() const final;
     bool wasCanceled() const final;
 
     CachedModuleScript& moduleScript() { return m_moduleScript.get(); }
diff --git a/Source/WebCore/dom/LoadableScript.h b/Source/WebCore/dom/LoadableScript.h
index 3ad17c5..ba22fb1 100644
--- a/Source/WebCore/dom/LoadableScript.h
+++ b/Source/WebCore/dom/LoadableScript.h
@@ -51,13 +51,13 @@
 
     struct Error {
         ErrorType type;
-        Optional<ConsoleMessage> consoleMessage;
+        std::optional<ConsoleMessage> consoleMessage;
     };
 
     virtual ~LoadableScript() { }
 
     virtual bool isLoaded() const = 0;
-    virtual Optional<Error> error() const = 0;
+    virtual std::optional<Error> error() const = 0;
     virtual bool wasCanceled() const = 0;
 
     virtual void execute(ScriptElement&) = 0;
diff --git a/Source/WebCore/dom/MessageEvent.cpp b/Source/WebCore/dom/MessageEvent.cpp
index 713d73d..fe9c2c5 100644
--- a/Source/WebCore/dom/MessageEvent.cpp
+++ b/Source/WebCore/dom/MessageEvent.cpp
@@ -52,7 +52,7 @@
 {
 }
 
-inline MessageEvent::MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
+inline MessageEvent::MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
     : Event(eventNames().messageEvent, false, false)
     , m_dataType(DataTypeSerializedScriptValue)
     , m_dataAsSerializedScriptValue(WTFMove(data))
@@ -96,7 +96,7 @@
 {
 }
 
-Ref<MessageEvent> MessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source)
+Ref<MessageEvent> MessageEvent::create(Vector<RefPtr<MessagePort>>&& ports, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source)
 {
     return adoptRef(*new MessageEvent(WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports)));
 }
@@ -135,7 +135,7 @@
 {
 }
 
-void MessageEvent::initMessageEvent(ExecState& state, const AtomicString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
+void MessageEvent::initMessageEvent(ExecState& state, const AtomicString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
 {
     if (dispatched())
         return;
@@ -152,7 +152,7 @@
     m_ports = WTFMove(ports);
 }
 
-void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
+void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&& source, Vector<RefPtr<MessagePort>>&& ports)
 {
     if (dispatched())
         return;
diff --git a/Source/WebCore/dom/MessageEvent.h b/Source/WebCore/dom/MessageEvent.h
index 4e694d4..710aacf 100644
--- a/Source/WebCore/dom/MessageEvent.h
+++ b/Source/WebCore/dom/MessageEvent.h
@@ -42,7 +42,7 @@
 
 class MessageEvent final : public Event {
 public:
-    static Ref<MessageEvent> create(Vector<RefPtr<MessagePort>>&&, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, Optional<MessageEventSource>&& source = Nullopt);
+    static Ref<MessageEvent> create(Vector<RefPtr<MessagePort>>&&, RefPtr<SerializedScriptValue>&&, const String& origin = { }, const String& lastEventId = { }, std::optional<MessageEventSource>&& source = std::nullopt);
     static Ref<MessageEvent> create(const AtomicString& type, RefPtr<SerializedScriptValue>&&, const String& origin, const String& lastEventId);
     static Ref<MessageEvent> create(const String& data, const String& origin = { });
     static Ref<MessageEvent> create(Ref<Blob>&& data, const String& origin);
@@ -53,15 +53,15 @@
         JSC::JSValue data;
         String origin;
         String lastEventId;
-        Optional<MessageEventSource> source;
+        std::optional<MessageEventSource> source;
         Vector<RefPtr<MessagePort>> ports;
     };
     static Ref<MessageEvent> create(JSC::ExecState&, const AtomicString& type, Init&&, IsTrusted = IsTrusted::No);
 
     virtual ~MessageEvent();
 
-    void initMessageEvent(JSC::ExecState&, const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
-    void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
+    void initMessageEvent(JSC::ExecState&, const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
+    void initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
 
     const String& origin() const { return m_origin; }
     const String& lastEventId() const { return m_lastEventId; }
@@ -92,7 +92,7 @@
 private:
     MessageEvent();
     MessageEvent(JSC::ExecState&, const AtomicString&, Init&&, IsTrusted);
-    MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, Optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
+    MessageEvent(RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId, std::optional<MessageEventSource>&&, Vector<RefPtr<MessagePort>>&&);
     MessageEvent(const AtomicString& type, RefPtr<SerializedScriptValue>&& data, const String& origin, const String& lastEventId);
     MessageEvent(const String& data, const String& origin);
     MessageEvent(Ref<Blob>&& data, const String& origin);
@@ -107,7 +107,7 @@
     RefPtr<ArrayBuffer> m_dataAsArrayBuffer;
     String m_origin;
     String m_lastEventId;
-    Optional<MessageEventSource> m_source;
+    std::optional<MessageEventSource> m_source;
     Vector<RefPtr<MessagePort>> m_ports;
 };
 
diff --git a/Source/WebCore/dom/MutationObserver.cpp b/Source/WebCore/dom/MutationObserver.cpp
index f17001f..325579d 100644
--- a/Source/WebCore/dom/MutationObserver.cpp
+++ b/Source/WebCore/dom/MutationObserver.cpp
@@ -80,9 +80,9 @@
         options |= ChildList;
     if (init.subtree)
         options |= Subtree;
-    if (init.attributeOldValue.valueOr(false))
+    if (init.attributeOldValue.value_or(false))
         options |= AttributeOldValue;
-    if (init.characterDataOldValue.valueOr(false))
+    if (init.characterDataOldValue.value_or(false))
         options |= CharacterDataOldValue;
 
     HashSet<AtomicString> attributeFilter;
diff --git a/Source/WebCore/dom/MutationObserver.h b/Source/WebCore/dom/MutationObserver.h
index 035db64..b7c71bd 100644
--- a/Source/WebCore/dom/MutationObserver.h
+++ b/Source/WebCore/dom/MutationObserver.h
@@ -73,12 +73,12 @@
 
     struct Init {
         bool childList;
-        Optional<bool> attributes;
-        Optional<bool> characterData;
+        std::optional<bool> attributes;
+        std::optional<bool> characterData;
         bool subtree;
-        Optional<bool> attributeOldValue;
-        Optional<bool> characterDataOldValue;
-        Optional<Vector<String>> attributeFilter;
+        std::optional<bool> attributeOldValue;
+        std::optional<bool> characterDataOldValue;
+        std::optional<Vector<String>> attributeFilter;
     };
 
     ExceptionOr<void> observe(Node&, const Init&);
diff --git a/Source/WebCore/dom/ProcessingInstruction.cpp b/Source/WebCore/dom/ProcessingInstruction.cpp
index 7d1fe64..9ad9e7b 100644
--- a/Source/WebCore/dom/ProcessingInstruction.cpp
+++ b/Source/WebCore/dom/ProcessingInstruction.cpp
@@ -145,7 +145,7 @@
 #endif
             {
                 String charset = attrs.get("charset");
-                CachedResourceRequest request(document().completeURL(href), CachedResourceLoader::defaultCachedResourceOptions(), Nullopt, charset.isEmpty() ? document().charset() : WTFMove(charset));
+                CachedResourceRequest request(document().completeURL(href), CachedResourceLoader::defaultCachedResourceOptions(), std::nullopt, charset.isEmpty() ? document().charset() : WTFMove(charset));
 
                 m_cachedSheet = document().cachedResourceLoader().requestCSSStyleSheet(WTFMove(request));
             }
diff --git a/Source/WebCore/dom/PseudoElement.cpp b/Source/WebCore/dom/PseudoElement.cpp
index 3cba94b..4dadfba 100644
--- a/Source/WebCore/dom/PseudoElement.cpp
+++ b/Source/WebCore/dom/PseudoElement.cpp
@@ -77,11 +77,11 @@
     m_hostElement = nullptr;
 }
 
-Optional<ElementStyle> PseudoElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*)
+std::optional<ElementStyle> PseudoElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*)
 {
     auto* style = m_hostElement->renderer()->getCachedPseudoStyle(m_pseudoId, &parentStyle);
     if (!style)
-        return Nullopt;
+        return std::nullopt;
     return ElementStyle(RenderStyle::clonePtr(*style));
 }
 
diff --git a/Source/WebCore/dom/PseudoElement.h b/Source/WebCore/dom/PseudoElement.h
index 5269edb..367ada5 100644
--- a/Source/WebCore/dom/PseudoElement.h
+++ b/Source/WebCore/dom/PseudoElement.h
@@ -43,7 +43,7 @@
     Element* hostElement() const { return m_hostElement; }
     void clearHostElement();
 
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
     void didAttachRenderers() override;
     void didRecalcStyle(Style::Change) override;
     bool rendererIsNeeded(const RenderStyle&) override;
diff --git a/Source/WebCore/dom/RangeBoundaryPoint.h b/Source/WebCore/dom/RangeBoundaryPoint.h
index 597c92f..71c92cd 100644
--- a/Source/WebCore/dom/RangeBoundaryPoint.h
+++ b/Source/WebCore/dom/RangeBoundaryPoint.h
@@ -58,7 +58,7 @@
 
 private:
     RefPtr<Node> m_containerNode;
-    mutable Optional<unsigned> m_offsetInContainer { 0 };
+    mutable std::optional<unsigned> m_offsetInContainer { 0 };
     RefPtr<Node> m_childBeforeBoundary;
 };
 
@@ -135,7 +135,7 @@
     ASSERT(child.parentNode());
     m_childBeforeBoundary = child.previousSibling();
     m_containerNode = child.parentNode();
-    m_offsetInContainer = m_childBeforeBoundary ? Nullopt : Optional<unsigned>(0);
+    m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0);
 }
 
 inline void RangeBoundaryPoint::setToAfterChild(Node& child)
@@ -143,7 +143,7 @@
     ASSERT(child.parentNode());
     m_childBeforeBoundary = &child;
     m_containerNode = child.parentNode();
-    m_offsetInContainer = m_childBeforeBoundary ? Nullopt : Optional<unsigned>(0);
+    m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0);
 }
 
 inline void RangeBoundaryPoint::setToStartOfNode(Ref<Node>&& container)
@@ -161,7 +161,7 @@
         m_childBeforeBoundary = nullptr;
     } else {
         m_childBeforeBoundary = m_containerNode->lastChild();
-        m_offsetInContainer = m_childBeforeBoundary ? Nullopt : Optional<unsigned>(0);
+        m_offsetInContainer = m_childBeforeBoundary ? std::nullopt : std::optional<unsigned>(0);
     }
 }
 
@@ -177,7 +177,7 @@
 
 inline void RangeBoundaryPoint::invalidateOffset() const
 {
-    m_offsetInContainer = Nullopt;
+    m_offsetInContainer = std::nullopt;
 }
 
 inline bool operator==(const RangeBoundaryPoint& a, const RangeBoundaryPoint& b)
diff --git a/Source/WebCore/dom/ScriptElement.cpp b/Source/WebCore/dom/ScriptElement.cpp
index 6be0fa7..3508738 100644
--- a/Source/WebCore/dom/ScriptElement.cpp
+++ b/Source/WebCore/dom/ScriptElement.cpp
@@ -142,7 +142,7 @@
     m_element.dispatchEvent(Event::create(eventNames().errorEvent, false, false));
 }
 
-Optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(LegacyTypeSupport supportLegacyTypes) const
+std::optional<ScriptElement::ScriptType> ScriptElement::determineScriptType(LegacyTypeSupport supportLegacyTypes) const
 {
     // FIXME: isLegacySupportedJavaScriptLanguage() is not valid HTML5. It is used here to maintain backwards compatibility with existing layout tests. The specific violations are:
     // - Allowing type=javascript. type= should only support MIME types, such as text/javascript.
@@ -156,7 +156,7 @@
             return ScriptType::Classic;
         if (isLegacySupportedJavaScriptLanguage(language))
             return ScriptType::Classic;
-        return Nullopt;
+        return std::nullopt;
     }
     if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(type.stripWhiteSpace()))
         return ScriptType::Classic;
@@ -168,16 +168,16 @@
     // Once "defer" is implemented, we can reconsider enabling modules in XHTML.
     // https://bugs.webkit.org/show_bug.cgi?id=123387
     if (!m_element.document().isHTMLDocument())
-        return Nullopt;
+        return std::nullopt;
 
     auto* settings = m_element.document().settings();
     if (!settings || !settings->es6ModulesEnabled())
-        return Nullopt;
+        return std::nullopt;
     // https://html.spec.whatwg.org/multipage/scripting.html#attr-script-type
     // Setting the attribute to an ASCII case-insensitive match for the string "module" means that the script is a module script.
     if (equalLettersIgnoringASCIICase(type, "module"))
         return ScriptType::Module;
-    return Nullopt;
+    return std::nullopt;
 }
 
 // http://dev.w3.org/html5/spec/Overview.html#prepare-a-script
@@ -204,7 +204,7 @@
         return false;
 
     ScriptType scriptType = ScriptType::Classic;
-    if (Optional<ScriptType> result = determineScriptType(supportLegacyTypes))
+    if (std::optional<ScriptType> result = determineScriptType(supportLegacyTypes))
         scriptType = result.value();
     else
         return false;
@@ -438,8 +438,8 @@
 
 void ScriptElement::executeScriptAndDispatchEvent(LoadableScript& loadableScript)
 {
-    if (Optional<LoadableScript::Error> error = loadableScript.error()) {
-        if (Optional<LoadableScript::ConsoleMessage> message = error->consoleMessage)
+    if (std::optional<LoadableScript::Error> error = loadableScript.error()) {
+        if (std::optional<LoadableScript::ConsoleMessage> message = error->consoleMessage)
             m_element.document().addConsoleMessage(message->source, message->level, message->message);
         dispatchErrorEvent();
     } else if (!loadableScript.wasCanceled()) {
diff --git a/Source/WebCore/dom/ScriptElement.h b/Source/WebCore/dom/ScriptElement.h
index f414b4b..6c08688 100644
--- a/Source/WebCore/dom/ScriptElement.h
+++ b/Source/WebCore/dom/ScriptElement.h
@@ -91,7 +91,7 @@
 private:
     void executeScriptAndDispatchEvent(LoadableScript&);
 
-    Optional<ScriptType> determineScriptType(LegacyTypeSupport) const;
+    std::optional<ScriptType> determineScriptType(LegacyTypeSupport) const;
     bool ignoresLoadRequest() const;
     bool isScriptForEventSupported() const;
 
diff --git a/Source/WebCore/dom/TextDecoder.cpp b/Source/WebCore/dom/TextDecoder.cpp
index b8b416f..96cc739 100644
--- a/Source/WebCore/dom/TextDecoder.cpp
+++ b/Source/WebCore/dom/TextDecoder.cpp
@@ -95,9 +95,9 @@
     return 2;
 }
 
-ExceptionOr<String> TextDecoder::decode(Optional<BufferSource::VariantType> input, DecodeOptions options)
+ExceptionOr<String> TextDecoder::decode(std::optional<BufferSource::VariantType> input, DecodeOptions options)
 {
-    Optional<BufferSource> inputBuffer;
+    std::optional<BufferSource> inputBuffer;
     const uint8_t* data = nullptr;
     size_t length = 0;
     if (input) {
diff --git a/Source/WebCore/dom/TextDecoder.h b/Source/WebCore/dom/TextDecoder.h
index ac3dd1e..e420124 100644
--- a/Source/WebCore/dom/TextDecoder.h
+++ b/Source/WebCore/dom/TextDecoder.h
@@ -49,7 +49,7 @@
     String encoding() const;
     bool fatal() const { return m_options.fatal; }
     bool ignoreBOM() const { return m_options.ignoreBOM; }
-    ExceptionOr<String> decode(Optional<BufferSource::VariantType>, DecodeOptions);
+    ExceptionOr<String> decode(std::optional<BufferSource::VariantType>, DecodeOptions);
 
 private:
     String prependBOMIfNecessary(const String&);
diff --git a/Source/WebCore/dom/UserGestureIndicator.cpp b/Source/WebCore/dom/UserGestureIndicator.cpp
index cb28d1f..ece68f1 100644
--- a/Source/WebCore/dom/UserGestureIndicator.cpp
+++ b/Source/WebCore/dom/UserGestureIndicator.cpp
@@ -44,7 +44,7 @@
         observer(*this);
 }
 
-UserGestureIndicator::UserGestureIndicator(Optional<ProcessingUserGestureState> state, Document* document)
+UserGestureIndicator::UserGestureIndicator(std::optional<ProcessingUserGestureState> state, Document* document)
     : m_previousToken(currentToken())
 {
     // Silently ignore UserGestureIndicators on non main threads.
diff --git a/Source/WebCore/dom/UserGestureIndicator.h b/Source/WebCore/dom/UserGestureIndicator.h
index 0ab0784..f044f65 100644
--- a/Source/WebCore/dom/UserGestureIndicator.h
+++ b/Source/WebCore/dom/UserGestureIndicator.h
@@ -79,7 +79,7 @@
     WEBCORE_EXPORT static bool processingUserGestureForMedia();
 
     // If a document is provided, its last known user gesture timestamp is updated.
-    WEBCORE_EXPORT explicit UserGestureIndicator(Optional<ProcessingUserGestureState>, Document* = nullptr);
+    WEBCORE_EXPORT explicit UserGestureIndicator(std::optional<ProcessingUserGestureState>, Document* = nullptr);
     WEBCORE_EXPORT explicit UserGestureIndicator(RefPtr<UserGestureToken>);
     WEBCORE_EXPORT ~UserGestureIndicator();
 
diff --git a/Source/WebCore/editing/CompositeEditCommand.cpp b/Source/WebCore/editing/CompositeEditCommand.cpp
index cf59804..d208000 100644
--- a/Source/WebCore/editing/CompositeEditCommand.cpp
+++ b/Source/WebCore/editing/CompositeEditCommand.cpp
@@ -1535,11 +1535,11 @@
     }
 }
 
-Optional<VisibleSelection> CompositeEditCommand::shouldBreakOutOfEmptyListItem() const
+std::optional<VisibleSelection> CompositeEditCommand::shouldBreakOutOfEmptyListItem() const
 {
     auto emptyListItem = enclosingEmptyListItem(endingSelection().visibleStart());
     if (!emptyListItem)
-        return Nullopt;
+        return std::nullopt;
 
     auto listNode = emptyListItem->parentNode();
     // FIXME: Can't we do something better when the immediate parent wasn't a list node?
@@ -1547,7 +1547,7 @@
         || (!listNode->hasTagName(ulTag) && !listNode->hasTagName(olTag))
         || !listNode->hasEditableStyle()
         || listNode == emptyListItem->rootEditableElement())
-        return Nullopt;
+        return std::nullopt;
 
     return VisibleSelection(endingSelection().start().previous(BackwardDeletion), endingSelection().end());
 }
diff --git a/Source/WebCore/editing/CompositeEditCommand.h b/Source/WebCore/editing/CompositeEditCommand.h
index e1842f9..85f418f 100644
--- a/Source/WebCore/editing/CompositeEditCommand.h
+++ b/Source/WebCore/editing/CompositeEditCommand.h
@@ -200,7 +200,7 @@
     void cloneParagraphUnderNewElement(const Position& start, const Position& end, Node* outerNode, Element* blockElement);
     void cleanupAfterDeletion(VisiblePosition destination = VisiblePosition());
     
-    Optional<VisibleSelection> shouldBreakOutOfEmptyListItem() const;
+    std::optional<VisibleSelection> shouldBreakOutOfEmptyListItem() const;
     bool breakOutOfEmptyListItem();
     bool breakOutOfEmptyMailBlockquotedParagraph();
     
diff --git a/Source/WebCore/fileapi/File.h b/Source/WebCore/fileapi/File.h
index ad13435..d53447a 100644
--- a/Source/WebCore/fileapi/File.h
+++ b/Source/WebCore/fileapi/File.h
@@ -88,7 +88,7 @@
     String m_path;
     String m_name;
 
-    Optional<int64_t> m_overrideLastModifiedDate;
+    std::optional<int64_t> m_overrideLastModifiedDate;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/history/CachedFrame.h b/Source/WebCore/history/CachedFrame.h
index afc9767..b4d5836 100644
--- a/Source/WebCore/history/CachedFrame.h
+++ b/Source/WebCore/history/CachedFrame.h
@@ -61,7 +61,7 @@
     std::unique_ptr<CachedFramePlatformData> m_cachedFramePlatformData;
     bool m_isMainFrame;
     bool m_isComposited;
-    Optional<HasInsecureContent> m_hasInsecureContent;
+    std::optional<HasInsecureContent> m_hasInsecureContent;
 
     Vector<std::unique_ptr<CachedFrame>> m_childFrames;
 };
@@ -79,7 +79,7 @@
     WEBCORE_EXPORT CachedFramePlatformData* cachedFramePlatformData();
 
     WEBCORE_EXPORT void setHasInsecureContent(HasInsecureContent);
-    Optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; }
+    std::optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; }
 
     using CachedFrameBase::document;
     using CachedFrameBase::view;
diff --git a/Source/WebCore/html/DOMTokenList.cpp b/Source/WebCore/html/DOMTokenList.cpp
index b1a55cc..0395a2e 100644
--- a/Source/WebCore/html/DOMTokenList.cpp
+++ b/Source/WebCore/html/DOMTokenList.cpp
@@ -133,7 +133,7 @@
     return removeInternal(&token.string(), 1);
 }
 
-ExceptionOr<bool> DOMTokenList::toggle(const AtomicString& token, Optional<bool> force)
+ExceptionOr<bool> DOMTokenList::toggle(const AtomicString& token, std::optional<bool> force)
 {
     auto result = validateToken(token);
     if (result.hasException())
@@ -142,7 +142,7 @@
     auto& tokens = this->tokens();
 
     if (tokens.contains(token)) {
-        if (!force.valueOr(false)) {
+        if (!force.value_or(false)) {
             tokens.removeFirst(token);
             updateAssociatedAttributeFromTokens();
             return false;
diff --git a/Source/WebCore/html/DOMTokenList.h b/Source/WebCore/html/DOMTokenList.h
index 9b987d9..53ac5e2 100644
--- a/Source/WebCore/html/DOMTokenList.h
+++ b/Source/WebCore/html/DOMTokenList.h
@@ -47,7 +47,7 @@
     ExceptionOr<void> add(const AtomicString&);
     ExceptionOr<void> remove(const Vector<String>&);
     ExceptionOr<void> remove(const AtomicString&);
-    WEBCORE_EXPORT ExceptionOr<bool> toggle(const AtomicString&, Optional<bool> force);
+    WEBCORE_EXPORT ExceptionOr<bool> toggle(const AtomicString&, std::optional<bool> force);
     ExceptionOr<void> replace(const AtomicString& token, const AtomicString& newToken);
     ExceptionOr<bool> supports(StringView token);
 
diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp
index 46bd359..c485367 100644
--- a/Source/WebCore/html/HTMLAnchorElement.cpp
+++ b/Source/WebCore/html/HTMLAnchorElement.cpp
@@ -395,7 +395,7 @@
 #endif
 
     ShouldSendReferrer shouldSendReferrer = hasRel(Relation::NoReferrer) ? NeverSendReferrer : MaybeSendReferrer;
-    auto newFrameOpenerPolicy = hasRel(Relation::NoOpener) ? makeOptional(NewFrameOpenerPolicy::Suppress) : Nullopt;
+    auto newFrameOpenerPolicy = hasRel(Relation::NoOpener) ? std::make_optional(NewFrameOpenerPolicy::Suppress) : std::nullopt;
     frame->loader().urlSelected(completedURL, target(), &event, LockHistory::No, LockBackForwardList::No, shouldSendReferrer, document().shouldOpenExternalURLsPolicyToPropagate(), newFrameOpenerPolicy, downloadAttribute);
 
     sendPings(completedURL);
diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp
index d1d3f27..673a574 100644
--- a/Source/WebCore/html/HTMLCanvasElement.cpp
+++ b/Source/WebCore/html/HTMLCanvasElement.cpp
@@ -458,7 +458,7 @@
     return mimeType.convertToASCIILowercase();
 }
 
-ExceptionOr<String> HTMLCanvasElement::toDataURL(const String& mimeType, Optional<double> quality)
+ExceptionOr<String> HTMLCanvasElement::toDataURL(const String& mimeType, std::optional<double> quality)
 {
     if (!m_originClean)
         return Exception { SECURITY_ERR };
diff --git a/Source/WebCore/html/HTMLCanvasElement.h b/Source/WebCore/html/HTMLCanvasElement.h
index 2f57405..56c4faa 100644
--- a/Source/WebCore/html/HTMLCanvasElement.h
+++ b/Source/WebCore/html/HTMLCanvasElement.h
@@ -92,8 +92,8 @@
 #endif
 
     static String toEncodingMimeType(const String& mimeType);
-    WEBCORE_EXPORT ExceptionOr<String> toDataURL(const String& mimeType, Optional<double> quality);
-    ExceptionOr<String> toDataURL(const String& mimeType) { return toDataURL(mimeType, Nullopt); }
+    WEBCORE_EXPORT ExceptionOr<String> toDataURL(const String& mimeType, std::optional<double> quality);
+    ExceptionOr<String> toDataURL(const String& mimeType) { return toDataURL(mimeType, std::nullopt); }
 
     // Used for rendering
     void didDraw(const FloatRect&);
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index e009801..589ca89 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -101,7 +101,7 @@
 
 unsigned HTMLElement::parseBorderWidthAttribute(const AtomicString& value) const
 {
-    if (Optional<unsigned> borderWidth = parseHTMLNonNegativeInteger(value))
+    if (std::optional<unsigned> borderWidth = parseHTMLNonNegativeInteger(value))
         return borderWidth.value();
 
     return hasTagName(tableTag) ? 1 : 0;
@@ -424,7 +424,7 @@
     if (name == tabindexAttr) {
         if (value.isEmpty())
             clearTabIndexExplicitlyIfNeeded();
-        else if (Optional<int> tabIndex = parseHTMLInteger(value))
+        else if (std::optional<int> tabIndex = parseHTMLInteger(value))
             setTabIndexExplicitly(tabIndex.value());
         return;
     }
diff --git a/Source/WebCore/html/HTMLImageElement.cpp b/Source/WebCore/html/HTMLImageElement.cpp
index 7b6f6f9..01444ba 100644
--- a/Source/WebCore/html/HTMLImageElement.cpp
+++ b/Source/WebCore/html/HTMLImageElement.cpp
@@ -89,7 +89,7 @@
     setPictureElement(nullptr);
 }
 
-Ref<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, Optional<unsigned> width, Optional<unsigned> height)
+Ref<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document& document, std::optional<unsigned> width, std::optional<unsigned> height)
 {
     auto image = adoptRef(*new HTMLImageElement(imgTag, document));
     if (width)
@@ -380,7 +380,7 @@
 {
     if (!renderer()) {
         // check the attribute first for an explicit pixel value
-        Optional<unsigned> width = parseHTMLNonNegativeInteger(attributeWithoutSynchronization(widthAttr));
+        std::optional<unsigned> width = parseHTMLNonNegativeInteger(attributeWithoutSynchronization(widthAttr));
         if (width)
             return width.value();
 
@@ -405,7 +405,7 @@
 {
     if (!renderer()) {
         // check the attribute first for an explicit pixel value
-        Optional<unsigned> height = parseHTMLNonNegativeInteger(attributeWithoutSynchronization(heightAttr));
+        std::optional<unsigned> height = parseHTMLNonNegativeInteger(attributeWithoutSynchronization(heightAttr));
         if (height)
             return height.value();
 
diff --git a/Source/WebCore/html/HTMLImageElement.h b/Source/WebCore/html/HTMLImageElement.h
index 1492a43..52f98ba 100644
--- a/Source/WebCore/html/HTMLImageElement.h
+++ b/Source/WebCore/html/HTMLImageElement.h
@@ -39,7 +39,7 @@
 public:
     static Ref<HTMLImageElement> create(Document&);
     static Ref<HTMLImageElement> create(const QualifiedName&, Document&, HTMLFormElement*);
-    static Ref<HTMLImageElement> createForJSConstructor(Document&, Optional<unsigned> width, Optional<unsigned> height);
+    static Ref<HTMLImageElement> createForJSConstructor(Document&, std::optional<unsigned> width, std::optional<unsigned> height);
 
     virtual ~HTMLImageElement();
 
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 15ea567..cd3a612 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -381,7 +381,7 @@
 }
 
 #if ENABLE(DATALIST_ELEMENT)
-Optional<Decimal> HTMLInputElement::findClosestTickMarkValue(const Decimal& value)
+std::optional<Decimal> HTMLInputElement::findClosestTickMarkValue(const Decimal& value)
 {
     return m_inputType->findClosestTickMarkValue(value);
 }
@@ -1775,7 +1775,7 @@
 void HTMLInputElement::maxLengthAttributeChanged(const AtomicString& newValue)
 {
     unsigned oldEffectiveMaxLength = effectiveMaxLength();
-    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
+    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
     if (oldEffectiveMaxLength != effectiveMaxLength())
         updateValueIfNeeded();
 
@@ -1787,7 +1787,7 @@
 void HTMLInputElement::minLengthAttributeChanged(const AtomicString& newValue)
 {
     int oldMinLength = minLength();
-    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
+    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
     if (oldMinLength != minLength())
         updateValueIfNeeded();
 
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index d045b0a..8affd98 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -85,7 +85,7 @@
     StepRange createStepRange(AnyStepHandling) const;
 
 #if ENABLE(DATALIST_ELEMENT)
-    Optional<Decimal> findClosestTickMarkValue(const Decimal&);
+    std::optional<Decimal> findClosestTickMarkValue(const Decimal&);
 #endif
 
     WEBCORE_EXPORT ExceptionOr<void> stepUp(int = 1);
diff --git a/Source/WebCore/html/HTMLLinkElement.cpp b/Source/WebCore/html/HTMLLinkElement.cpp
index 3e46e4e..0489e89 100644
--- a/Source/WebCore/html/HTMLLinkElement.cpp
+++ b/Source/WebCore/html/HTMLLinkElement.cpp
@@ -251,7 +251,7 @@
 
         bool mediaQueryMatches = true;
         if (!m_media.isEmpty()) {
-            Optional<RenderStyle> documentStyle;
+            std::optional<RenderStyle> documentStyle;
             if (document().hasLivingRenderTree())
                 documentStyle = Style::resolveForDocument(document());
             auto media = MediaQuerySet::create(m_media);
@@ -264,7 +264,7 @@
         addPendingSheet(isActive ? ActiveSheet : InactiveSheet);
 
         // Load stylesheets that are not needed for the rendering immediately with low priority.
-        Optional<ResourceLoadPriority> priority;
+        std::optional<ResourceLoadPriority> priority;
         if (!isActive)
             priority = ResourceLoadPriority::VeryLow;
         CachedResourceRequest request(url, CachedResourceLoader::defaultCachedResourceOptions(), priority, WTFMove(charset));
@@ -343,7 +343,7 @@
 void HTMLLinkElement::initializeStyleSheet(Ref<StyleSheetContents>&& styleSheet, const CachedCSSStyleSheet& cachedStyleSheet)
 {
     // FIXME: originClean should be turned to false except if fetch mode is CORS.
-    Optional<bool> originClean;
+    std::optional<bool> originClean;
     if (cachedStyleSheet.options().mode == FetchOptions::Mode::Cors)
         originClean = cachedStyleSheet.isCORSSameOrigin();
 
@@ -513,7 +513,7 @@
     return attributeWithoutSynchronization(typeAttr);
 }
 
-Optional<LinkIconType> HTMLLinkElement::iconType() const
+std::optional<LinkIconType> HTMLLinkElement::iconType() const
 {
     return m_relAttribute.iconType;
 }
diff --git a/Source/WebCore/html/HTMLLinkElement.h b/Source/WebCore/html/HTMLLinkElement.h
index 8471ece..0db3605 100644
--- a/Source/WebCore/html/HTMLLinkElement.h
+++ b/Source/WebCore/html/HTMLLinkElement.h
@@ -53,7 +53,7 @@
 
     const AtomicString& type() const;
 
-    Optional<LinkIconType> iconType() const;
+    std::optional<LinkIconType> iconType() const;
 
     CSSStyleSheet* sheet() const { return m_sheet.get(); }
 
diff --git a/Source/WebCore/html/HTMLOListElement.h b/Source/WebCore/html/HTMLOListElement.h
index a835bd0..c3fe246 100644
--- a/Source/WebCore/html/HTMLOListElement.h
+++ b/Source/WebCore/html/HTMLOListElement.h
@@ -58,7 +58,7 @@
     bool isPresentationAttribute(const QualifiedName&) const final;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
 
-    Optional<int> m_start;
+    std::optional<int> m_start;
     unsigned m_itemCount;
 
     bool m_isReversed : 1;
diff --git a/Source/WebCore/html/HTMLOptionsCollection.cpp b/Source/WebCore/html/HTMLOptionsCollection.cpp
index 216bf0e..2f885de 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.cpp
+++ b/Source/WebCore/html/HTMLOptionsCollection.cpp
@@ -33,7 +33,7 @@
     return adoptRef(*new HTMLOptionsCollection(select));
 }
 
-ExceptionOr<void> HTMLOptionsCollection::add(const OptionOrOptGroupElement& element, const Optional<HTMLElementOrInt>& before)
+ExceptionOr<void> HTMLOptionsCollection::add(const OptionOrOptGroupElement& element, const std::optional<HTMLElementOrInt>& before)
 {
     return selectElement().add(element, before);
 }
diff --git a/Source/WebCore/html/HTMLOptionsCollection.h b/Source/WebCore/html/HTMLOptionsCollection.h
index 70d14ec..3f7dd5a 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.h
+++ b/Source/WebCore/html/HTMLOptionsCollection.h
@@ -41,7 +41,7 @@
 
     using OptionOrOptGroupElement = Variant<RefPtr<HTMLOptionElement>, RefPtr<HTMLOptGroupElement>>;
     using HTMLElementOrInt = Variant<RefPtr<HTMLElement>, int>;
-    WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const Optional<HTMLElementOrInt>& before);
+    WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const std::optional<HTMLElementOrInt>& before);
     WEBCORE_EXPORT void remove(int index);
     void remove(HTMLOptionElement&);
 
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 646431e..6c37e76 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -218,7 +218,7 @@
     return lastSelectedListIndex();
 }
 
-ExceptionOr<void> HTMLSelectElement::add(const OptionOrOptGroupElement& element, const Optional<HTMLElementOrInt>& before)
+ExceptionOr<void> HTMLSelectElement::add(const OptionOrOptGroupElement& element, const std::optional<HTMLElementOrInt>& before)
 {
     HTMLElement* beforeElement = nullptr;
     if (before) {
@@ -458,7 +458,7 @@
 
     if (diff < 0) { // Add dummy elements.
         do {
-            auto result = add(HTMLOptionElement::create(document()).ptr(), Nullopt);
+            auto result = add(HTMLOptionElement::create(document()).ptr(), std::nullopt);
             if (result.hasException())
                 return result;
         } while (++diff);
diff --git a/Source/WebCore/html/HTMLSelectElement.h b/Source/WebCore/html/HTMLSelectElement.h
index 7b9799c..63c488d 100644
--- a/Source/WebCore/html/HTMLSelectElement.h
+++ b/Source/WebCore/html/HTMLSelectElement.h
@@ -53,7 +53,7 @@
 
     using OptionOrOptGroupElement = Variant<RefPtr<HTMLOptionElement>, RefPtr<HTMLOptGroupElement>>;
     using HTMLElementOrInt = Variant<RefPtr<HTMLElement>, int>;
-    WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const Optional<HTMLElementOrInt>& before);
+    WEBCORE_EXPORT ExceptionOr<void> add(const OptionOrOptGroupElement&, const std::optional<HTMLElementOrInt>& before);
 
     using Node::remove;
     ExceptionOr<void> remove(HTMLOptionElement&);
diff --git a/Source/WebCore/html/HTMLTextAreaElement.cpp b/Source/WebCore/html/HTMLTextAreaElement.cpp
index 661778b..7929542 100644
--- a/Source/WebCore/html/HTMLTextAreaElement.cpp
+++ b/Source/WebCore/html/HTMLTextAreaElement.cpp
@@ -203,13 +203,13 @@
 
 void HTMLTextAreaElement::maxLengthAttributeChanged(const AtomicString& newValue)
 {
-    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
+    internalSetMaxLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
     updateValidity();
 }
 
 void HTMLTextAreaElement::minLengthAttributeChanged(const AtomicString& newValue)
 {
-    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).valueOr(-1));
+    internalSetMinLength(parseHTMLNonNegativeInteger(newValue).value_or(-1));
     updateValidity();
 }
 
diff --git a/Source/WebCore/html/ImageInputType.cpp b/Source/WebCore/html/ImageInputType.cpp
index c3ce285..f396a3e 100644
--- a/Source/WebCore/html/ImageInputType.cpp
+++ b/Source/WebCore/html/ImageInputType.cpp
@@ -179,7 +179,7 @@
 
     if (!element->renderer()) {
         // Check the attribute first for an explicit pixel value.
-        if (Optional<unsigned> height = parseHTMLNonNegativeInteger(element->attributeWithoutSynchronization(heightAttr)))
+        if (std::optional<unsigned> height = parseHTMLNonNegativeInteger(element->attributeWithoutSynchronization(heightAttr)))
             return height.value();
 
         // If the image is available, use its height.
@@ -200,7 +200,7 @@
 
     if (!element->renderer()) {
         // Check the attribute first for an explicit pixel value.
-        if (Optional<unsigned> width = parseHTMLNonNegativeInteger(element->attributeWithoutSynchronization(widthAttr)))
+        if (std::optional<unsigned> width = parseHTMLNonNegativeInteger(element->attributeWithoutSynchronization(widthAttr)))
             return width.value();
 
         // If the image is available, use its width.
diff --git a/Source/WebCore/html/InputType.cpp b/Source/WebCore/html/InputType.cpp
index 7578ce05..3d47e46 100644
--- a/Source/WebCore/html/InputType.cpp
+++ b/Source/WebCore/html/InputType.cpp
@@ -955,10 +955,10 @@
 {
 }
 
-Optional<Decimal> InputType::findClosestTickMarkValue(const Decimal&)
+std::optional<Decimal> InputType::findClosestTickMarkValue(const Decimal&)
 {
     ASSERT_NOT_REACHED();
-    return Nullopt;
+    return std::nullopt;
 }
 #endif
 
diff --git a/Source/WebCore/html/InputType.h b/Source/WebCore/html/InputType.h
index fc30519..c4be73d 100644
--- a/Source/WebCore/html/InputType.h
+++ b/Source/WebCore/html/InputType.h
@@ -295,7 +295,7 @@
 
 #if ENABLE(DATALIST_ELEMENT)
     virtual void listAttributeTargetChanged();
-    virtual Optional<Decimal> findClosestTickMarkValue(const Decimal&);
+    virtual std::optional<Decimal> findClosestTickMarkValue(const Decimal&);
 #endif
 
 #if ENABLE(DRAG_SUPPORT)
diff --git a/Source/WebCore/html/LinkIconCollector.cpp b/Source/WebCore/html/LinkIconCollector.cpp
index d00e06b..4d2b6e1 100644
--- a/Source/WebCore/html/LinkIconCollector.cpp
+++ b/Source/WebCore/html/LinkIconCollector.cpp
@@ -95,7 +95,7 @@
         // This icon size parsing is a little wonky - it only parses the first
         // part of the size, "60x70" becomes "60". This is for compatibility reasons
         // and is probably good enough for now.
-        Optional<unsigned> iconSize;
+        std::optional<unsigned> iconSize;
 
         if (linkElement.sizes().length()) {
             bool ok;
diff --git a/Source/WebCore/html/LinkRelAttribute.h b/Source/WebCore/html/LinkRelAttribute.h
index 6b009a2..8e26692 100644
--- a/Source/WebCore/html/LinkRelAttribute.h
+++ b/Source/WebCore/html/LinkRelAttribute.h
@@ -41,7 +41,7 @@
 
 struct LinkRelAttribute {
     bool isStyleSheet { false };
-    Optional<LinkIconType> iconType;
+    std::optional<LinkIconType> iconType;
     bool isAlternate { false };
     bool isDNSPrefetch { false };
     bool isLinkPreload { false };
diff --git a/Source/WebCore/html/RangeInputType.cpp b/Source/WebCore/html/RangeInputType.cpp
index a5a8eae..dbabfcd 100644
--- a/Source/WebCore/html/RangeInputType.cpp
+++ b/Source/WebCore/html/RangeInputType.cpp
@@ -381,11 +381,11 @@
     std::sort(m_tickMarkValues.begin(), m_tickMarkValues.end());
 }
 
-Optional<Decimal> RangeInputType::findClosestTickMarkValue(const Decimal& value)
+std::optional<Decimal> RangeInputType::findClosestTickMarkValue(const Decimal& value)
 {
     updateTickMarkValues();
     if (!m_tickMarkValues.size())
-        return Nullopt;
+        return std::nullopt;
 
     size_t left = 0;
     size_t right = m_tickMarkValues.size();
@@ -408,8 +408,8 @@
             right = middle;
     }
 
-    Optional<Decimal> closestLeft = middle ? makeOptional(m_tickMarkValues[middle - 1]) : Nullopt;
-    Optional<Decimal> closestRight = middle != m_tickMarkValues.size() ? makeOptional(m_tickMarkValues[middle]) : Nullopt;
+    std::optional<Decimal> closestLeft = middle ? std::make_optional(m_tickMarkValues[middle - 1]) : std::nullopt;
+    std::optional<Decimal> closestRight = middle != m_tickMarkValues.size() ? std::make_optional(m_tickMarkValues[middle]) : std::nullopt;
 
     if (!closestLeft)
         return closestRight;
diff --git a/Source/WebCore/html/RangeInputType.h b/Source/WebCore/html/RangeInputType.h
index a5784f5..c6f62d8 100644
--- a/Source/WebCore/html/RangeInputType.h
+++ b/Source/WebCore/html/RangeInputType.h
@@ -71,7 +71,7 @@
 #if ENABLE(DATALIST_ELEMENT)
     void listAttributeTargetChanged() final;
     void updateTickMarkValues();
-    Optional<Decimal> findClosestTickMarkValue(const Decimal&) final;
+    std::optional<Decimal> findClosestTickMarkValue(const Decimal&) final;
 
     bool m_tickMarkValuesDirty { true };
     Vector<Decimal> m_tickMarkValues;
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 0b2b3f4..7113527 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -386,7 +386,7 @@
         return;
     m_path.transform(state().transform);
     m_stateStack.removeLast();
-    if (Optional<AffineTransform> inverse = state().transform.inverse())
+    if (std::optional<AffineTransform> inverse = state().transform.inverse())
         m_path.transform(inverse.value());
     GraphicsContext* c = drawingContext();
     if (!c)
@@ -832,7 +832,7 @@
     modifiableState().hasInvertibleTransform = true;
 }
 
-void CanvasRenderingContext2D::setStrokeColor(const String& color, Optional<float> alpha)
+void CanvasRenderingContext2D::setStrokeColor(const String& color, std::optional<float> alpha)
 {
     if (alpha) {
         setStrokeStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha.value()));
@@ -868,7 +868,7 @@
     setStrokeStyle(CanvasStyle(c, m, y, k, a));
 }
 
-void CanvasRenderingContext2D::setFillColor(const String& color, Optional<float> alpha)
+void CanvasRenderingContext2D::setFillColor(const String& color, std::optional<float> alpha)
 {
     if (alpha) {
         setFillStyle(CanvasStyle::createFromStringWithOverrideAlpha(color, alpha.value()));
@@ -1114,7 +1114,7 @@
     if (!state().hasInvertibleTransform)
         return false;
 
-    FloatPoint transformedPoint = state().transform.inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(x, y));
+    FloatPoint transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
 
     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
         return false;
@@ -1130,7 +1130,7 @@
     if (!state().hasInvertibleTransform)
         return false;
 
-    FloatPoint transformedPoint = state().transform.inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(x, y));
+    FloatPoint transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
         return false;
 
@@ -1249,7 +1249,7 @@
     }
 }
 
-void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String& colorString, Optional<float> alpha)
+void CanvasRenderingContext2D::setShadow(float width, float height, float blur, const String& colorString, std::optional<float> alpha)
 {
     Color color = parseColorOrCurrentColor(colorString, &canvas());
     if (!colorString.isNull() && !color.isValid())
@@ -2257,12 +2257,12 @@
     modifiableState().direction = direction;
 }
 
-void CanvasRenderingContext2D::fillText(const String& text, float x, float y, Optional<float> maxWidth)
+void CanvasRenderingContext2D::fillText(const String& text, float x, float y, std::optional<float> maxWidth)
 {
     drawTextInternal(text, x, y, true, maxWidth);
 }
 
-void CanvasRenderingContext2D::strokeText(const String& text, float x, float y, Optional<float> maxWidth)
+void CanvasRenderingContext2D::strokeText(const String& text, float x, float y, std::optional<float> maxWidth)
 {
     drawTextInternal(text, x, y, false, maxWidth);
 }
@@ -2310,7 +2310,7 @@
     return metrics;
 }
 
-void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, Optional<float> maxWidth)
+void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, float y, bool fill, std::optional<float> maxWidth)
 {
     const auto& fontProxy = this->fontProxy();
     const FontMetrics& fontMetrics = fontProxy.fontMetrics();
diff --git a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
index 45a13b1..2a87f26 100644
--- a/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
+++ b/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
@@ -117,12 +117,12 @@
     void setTransform(float m11, float m12, float m21, float m22, float dx, float dy);
     void resetTransform();
 
-    void setStrokeColor(const String& color, Optional<float> alpha = Nullopt);
+    void setStrokeColor(const String& color, std::optional<float> alpha = std::nullopt);
     void setStrokeColor(float grayLevel, float alpha = 1.0);
     void setStrokeColor(float r, float g, float b, float a);
     void setStrokeColor(float c, float m, float y, float k, float a);
 
-    void setFillColor(const String& color, Optional<float> alpha = Nullopt);
+    void setFillColor(const String& color, std::optional<float> alpha = std::nullopt);
     void setFillColor(float grayLevel, float alpha = 1.0f);
     void setFillColor(float r, float g, float b, float a);
     void setFillColor(float c, float m, float y, float k, float a);
@@ -149,7 +149,7 @@
     void fillRect(float x, float y, float width, float height);
     void strokeRect(float x, float y, float width, float height);
 
-    void setShadow(float width, float height, float blur, const String& color = String(), Optional<float> alpha = Nullopt);
+    void setShadow(float width, float height, float blur, const String& color = String(), std::optional<float> alpha = std::nullopt);
     void setShadow(float width, float height, float blur, float grayLevel, float alpha = 1.0);
     void setShadow(float width, float height, float blur, float r, float g, float b, float a);
     void setShadow(float width, float height, float blur, float c, float m, float y, float k, float a);
@@ -214,8 +214,8 @@
     String direction() const;
     void setDirection(const String&);
 
-    void fillText(const String& text, float x, float y, Optional<float> maxWidth = Nullopt);
-    void strokeText(const String& text, float x, float y, Optional<float> maxWidth = Nullopt);
+    void fillText(const String& text, float x, float y, std::optional<float> maxWidth = std::nullopt);
+    void strokeText(const String& text, float x, float y, std::optional<float> maxWidth = std::nullopt);
     Ref<TextMetrics> measureText(const String& text);
 
     LineCap getLineCap() const { return state().lineCap; }
@@ -331,7 +331,7 @@
     void applyStrokePattern();
     void applyFillPattern();
 
-    void drawTextInternal(const String& text, float x, float y, bool fill, Optional<float> maxWidth = Nullopt);
+    void drawTextInternal(const String& text, float x, float y, bool fill, std::optional<float> maxWidth = std::nullopt);
 
     // The relationship between FontCascade and CanvasRenderingContext2D::FontProxy must hold certain invariants.
     // Therefore, all font operations must pass through the State.
diff --git a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
index 4ece377..232f0bb 100644
--- a/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
@@ -88,12 +88,12 @@
     m_context->getExtensions().ensureEnabled("GL_EXT_frag_depth");
 }
 
-inline static Optional<unsigned> arrayBufferViewElementSize(const ArrayBufferView& data)
+inline static std::optional<unsigned> arrayBufferViewElementSize(const ArrayBufferView& data)
 {
     switch (data.getType()) {
     case JSC::NotTypedArray:
     case JSC::TypeDataView:
-        return Nullopt;
+        return std::nullopt;
     case JSC::TypeInt8:
     case JSC::TypeUint8:
     case JSC::TypeUint8Clamped:
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
index 3e9dcca..2c0d807 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
@@ -1109,7 +1109,7 @@
     }
 }
 
-void WebGLRenderingContextBase::bufferData(GC3Denum target, Optional<BufferDataSource>&& data, GC3Denum usage)
+void WebGLRenderingContextBase::bufferData(GC3Denum target, std::optional<BufferDataSource>&& data, GC3Denum usage)
 {
     if (isContextLostOrPending())
         return;
@@ -1136,7 +1136,7 @@
     }, data.value());
 }
 
-void WebGLRenderingContextBase::bufferSubData(GC3Denum target, long long offset, Optional<BufferDataSource>&& data)
+void WebGLRenderingContextBase::bufferSubData(GC3Denum target, long long offset, std::optional<BufferDataSource>&& data)
 {
     if (isContextLostOrPending())
         return;
@@ -3448,7 +3448,7 @@
         m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
 }
 
-ExceptionOr<void> WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Optional<TexImageSource>&& source)
+ExceptionOr<void> WebGLRenderingContextBase::texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, std::optional<TexImageSource>&& source)
 {
     if (!source) {
         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "texSubImage2D", "source is null");
@@ -3575,7 +3575,7 @@
     return WTF::visit(visitor, source.value());
 }
 
-bool WebGLRenderingContextBase::validateArrayBufferType(const char* functionName, GC3Denum type, Optional<JSC::TypedArrayType> arrayType)
+bool WebGLRenderingContextBase::validateArrayBufferType(const char* functionName, GC3Denum type, std::optional<JSC::TypedArrayType> arrayType)
 {
 #define TYPE_VALIDATION_CASE(arrayTypeMacro) if (arrayType && arrayType.value() != JSC::arrayTypeMacro) { \
             synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, functionName, "ArrayBufferView not " #arrayTypeMacro); \
@@ -3636,7 +3636,7 @@
         return false;
     if (!validateSettableTexInternalFormat(functionName, internalFormat))
         return false;
-    if (!validateArrayBufferType(functionName, type, pixels ? Optional<JSC::TypedArrayType>(pixels->getType()) : Nullopt))
+    if (!validateArrayBufferType(functionName, type, pixels ? std::optional<JSC::TypedArrayType>(pixels->getType()) : std::nullopt))
         return false;
     
     unsigned totalBytesRequired;
@@ -3982,7 +3982,7 @@
         || internalFormat == GraphicsContext3D::RGBA8;
 }
 
-ExceptionOr<void> WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional<TexImageSource> source)
+ExceptionOr<void> WebGLRenderingContextBase::texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, std::optional<TexImageSource> source)
 {
     if (!source) {
         synthesizeGLError(GraphicsContext3D::INVALID_VALUE, "texImage2D", "source is null");
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
index 2b316bdb..5478a5d 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
+++ b/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
@@ -136,8 +136,8 @@
 
     using BufferDataSource = WTF::Variant<RefPtr<ArrayBuffer>, RefPtr<ArrayBufferView>>;
     void bufferData(GC3Denum target, long long size, GC3Denum usage);
-    void bufferData(GC3Denum target, Optional<BufferDataSource>&&, GC3Denum usage);
-    void bufferSubData(GC3Denum target, long long offset, Optional<BufferDataSource>&&);
+    void bufferData(GC3Denum target, std::optional<BufferDataSource>&&, GC3Denum usage);
+    void bufferSubData(GC3Denum target, long long offset, std::optional<BufferDataSource>&&);
 
     GC3Denum checkFramebufferStatus(GC3Denum target);
     virtual void clear(GC3Dbitfield mask) = 0;
@@ -241,13 +241,13 @@
     void texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height, GC3Dint border, GC3Denum format, GC3Denum type, RefPtr<ArrayBufferView>&&);
 
     using TexImageSource = WTF::Variant<RefPtr<ImageData>, RefPtr<HTMLImageElement>, RefPtr<HTMLCanvasElement>, RefPtr<HTMLVideoElement>>;
-    ExceptionOr<void> texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, Optional<TexImageSource>);
+    ExceptionOr<void> texImage2D(GC3Denum target, GC3Dint level, GC3Denum internalformat, GC3Denum format, GC3Denum type, std::optional<TexImageSource>);
 
     void texParameterf(GC3Denum target, GC3Denum pname, GC3Dfloat param);
     void texParameteri(GC3Denum target, GC3Denum pname, GC3Dint param);
 
     void texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Dsizei width, GC3Dsizei height, GC3Denum format, GC3Denum type, RefPtr<ArrayBufferView>&&);
-    ExceptionOr<void> texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, Optional<TexImageSource>&&);
+    ExceptionOr<void> texSubImage2D(GC3Denum target, GC3Dint level, GC3Dint xoffset, GC3Dint yoffset, GC3Denum format, GC3Denum type, std::optional<TexImageSource>&&);
 
     void uniform1f(const WebGLUniformLocation*, GC3Dfloat x);
     void uniform1fv(const WebGLUniformLocation*, Float32Array& v);
@@ -800,7 +800,7 @@
     bool supportsDrawBuffers();
 
 private:
-    bool validateArrayBufferType(const char* functionName, GC3Denum type, Optional<JSC::TypedArrayType>);
+    bool validateArrayBufferType(const char* functionName, GC3Denum type, std::optional<JSC::TypedArrayType>);
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.cpp b/Source/WebCore/html/parser/HTMLConstructionSite.cpp
index fc39040..2fdda6e 100644
--- a/Source/WebCore/html/parser/HTMLConstructionSite.cpp
+++ b/Source/WebCore/html/parser/HTMLConstructionSite.cpp
@@ -701,17 +701,17 @@
     return HTMLStackItem::create(createHTMLElement(fakeToken), WTFMove(fakeToken), item.namespaceURI());
 }
 
-Optional<unsigned> HTMLConstructionSite::indexOfFirstUnopenFormattingElement() const
+std::optional<unsigned> HTMLConstructionSite::indexOfFirstUnopenFormattingElement() const
 {
     if (m_activeFormattingElements.isEmpty())
-        return Nullopt;
+        return std::nullopt;
     unsigned index = m_activeFormattingElements.size();
     do {
         --index;
         const auto& entry = m_activeFormattingElements.at(index);
         if (entry.isMarker() || m_openElements.contains(entry.element())) {
             unsigned firstUnopenElementIndex = index + 1;
-            return firstUnopenElementIndex < m_activeFormattingElements.size() ? firstUnopenElementIndex : Optional<unsigned>(Nullopt);
+            return firstUnopenElementIndex < m_activeFormattingElements.size() ? firstUnopenElementIndex : std::optional<unsigned>(std::nullopt);
         }
     } while (index);
 
@@ -720,7 +720,7 @@
 
 void HTMLConstructionSite::reconstructTheActiveFormattingElements()
 {
-    Optional<unsigned> firstUnopenElementIndex = indexOfFirstUnopenFormattingElement();
+    std::optional<unsigned> firstUnopenElementIndex = indexOfFirstUnopenFormattingElement();
     if (!firstUnopenElementIndex)
         return;
 
diff --git a/Source/WebCore/html/parser/HTMLConstructionSite.h b/Source/WebCore/html/parser/HTMLConstructionSite.h
index 33e1bb8..7549ed5 100644
--- a/Source/WebCore/html/parser/HTMLConstructionSite.h
+++ b/Source/WebCore/html/parser/HTMLConstructionSite.h
@@ -131,7 +131,7 @@
     bool shouldFosterParent() const;
     void fosterParent(Ref<Node>&&);
 
-    Optional<unsigned> indexOfFirstUnopenFormattingElement() const;
+    std::optional<unsigned> indexOfFirstUnopenFormattingElement() const;
     void reconstructTheActiveFormattingElements();
 
     void generateImpliedEndTags();
diff --git a/Source/WebCore/html/parser/HTMLParserIdioms.cpp b/Source/WebCore/html/parser/HTMLParserIdioms.cpp
index 3b8cc4d..3990cbd 100644
--- a/Source/WebCore/html/parser/HTMLParserIdioms.cpp
+++ b/Source/WebCore/html/parser/HTMLParserIdioms.cpp
@@ -154,13 +154,13 @@
 }
 
 template <typename CharacterType>
-static Optional<int> parseHTMLIntegerInternal(const CharacterType* position, const CharacterType* end)
+static std::optional<int> parseHTMLIntegerInternal(const CharacterType* position, const CharacterType* end)
 {
     while (position < end && isHTMLSpace(*position))
         ++position;
 
     if (position == end)
-        return Nullopt;
+        return std::nullopt;
 
     bool isNegative = false;
     if (*position == '-') {
@@ -170,7 +170,7 @@
         ++position;
 
     if (position == end || !isASCIIDigit(*position))
-        return Nullopt;
+        return std::nullopt;
 
     constexpr int intMax = std::numeric_limits<int>::max();
     constexpr int base = 10;
@@ -181,7 +181,7 @@
         int digitValue = *position - '0';
 
         if (result > maxMultiplier || (result == maxMultiplier && digitValue > (intMax % base) + isNegative))
-            return Nullopt;
+            return std::nullopt;
 
         result = base * result + digitValue;
         ++position;
@@ -191,11 +191,11 @@
 }
 
 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers
-Optional<int> parseHTMLInteger(StringView input)
+std::optional<int> parseHTMLInteger(StringView input)
 {
     unsigned length = input.length();
     if (!length)
-        return Nullopt;
+        return std::nullopt;
 
     if (LIKELY(input.is8Bit())) {
         auto* start = input.characters8();
@@ -207,36 +207,36 @@
 }
 
 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-non-negative-integers
-Optional<unsigned> parseHTMLNonNegativeInteger(StringView input)
+std::optional<unsigned> parseHTMLNonNegativeInteger(StringView input)
 {
-    Optional<int> signedValue = parseHTMLInteger(input);
+    std::optional<int> signedValue = parseHTMLInteger(input);
     if (!signedValue || signedValue.value() < 0)
-        return Nullopt;
+        return std::nullopt;
 
     return static_cast<unsigned>(signedValue.value());
 }
 
 template <typename CharacterType>
-static Optional<int> parseValidHTMLNonNegativeIntegerInternal(const CharacterType* position, const CharacterType* end)
+static std::optional<int> parseValidHTMLNonNegativeIntegerInternal(const CharacterType* position, const CharacterType* end)
 {
     // A string is a valid non-negative integer if it consists of one or more ASCII digits.
     for (auto* c = position; c < end; ++c) {
         if (!isASCIIDigit(*c))
-            return Nullopt;
+            return std::nullopt;
     }
 
-    Optional<int> signedValue = parseHTMLIntegerInternal(position, end);
+    std::optional<int> signedValue = parseHTMLIntegerInternal(position, end);
     if (!signedValue || signedValue.value() < 0)
-        return Nullopt;
+        return std::nullopt;
 
     return signedValue;
 }
 
 // https://html.spec.whatwg.org/#valid-non-negative-integer
-Optional<int> parseValidHTMLNonNegativeInteger(StringView input)
+std::optional<int> parseValidHTMLNonNegativeInteger(StringView input)
 {
     if (input.isEmpty())
-        return Nullopt;
+        return std::nullopt;
 
     if (LIKELY(input.is8Bit())) {
         auto* start = input.characters8();
@@ -248,25 +248,25 @@
 }
 
 template <typename CharacterType>
-static Optional<double> parseValidHTMLFloatingPointNumberInternal(const CharacterType* position, size_t length)
+static std::optional<double> parseValidHTMLFloatingPointNumberInternal(const CharacterType* position, size_t length)
 {
     ASSERT(length > 0);
 
     // parseDouble() allows the string to start with a '+' or to end with a '.' but those
     // are not valid floating point numbers as per HTML.
     if (*position == '+' || *(position + length - 1) == '.')
-        return Nullopt;
+        return std::nullopt;
 
     size_t parsedLength = 0;
     double number = parseDouble(position, length, parsedLength);
-    return parsedLength == length && std::isfinite(number) ? number : Optional<double>();
+    return parsedLength == length && std::isfinite(number) ? number : std::optional<double>();
 }
 
 // https://html.spec.whatwg.org/#valid-floating-point-number
-Optional<double> parseValidHTMLFloatingPointNumber(StringView input)
+std::optional<double> parseValidHTMLFloatingPointNumber(StringView input)
 {
     if (input.isEmpty())
-        return Nullopt;
+        return std::nullopt;
 
     if (LIKELY(input.is8Bit())) {
         auto* start = input.characters8();
@@ -363,7 +363,7 @@
     while (position < end && isASCIIDigit(*position))
         ++position;
 
-    Optional<unsigned> number = parseHTMLNonNegativeInteger(StringView(numberStart, position - numberStart));
+    std::optional<unsigned> number = parseHTMLNonNegativeInteger(StringView(numberStart, position - numberStart));
     if (!number)
         return false;
 
diff --git a/Source/WebCore/html/parser/HTMLParserIdioms.h b/Source/WebCore/html/parser/HTMLParserIdioms.h
index 2b3473c..2f41c61 100644
--- a/Source/WebCore/html/parser/HTMLParserIdioms.h
+++ b/Source/WebCore/html/parser/HTMLParserIdioms.h
@@ -62,16 +62,16 @@
 double parseToDoubleForNumberType(const String&, double fallbackValue);
 
 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-integers
-WEBCORE_EXPORT Optional<int> parseHTMLInteger(StringView);
+WEBCORE_EXPORT std::optional<int> parseHTMLInteger(StringView);
 
 // http://www.whatwg.org/specs/web-apps/current-work/#rules-for-parsing-non-negative-integers
-WEBCORE_EXPORT Optional<unsigned> parseHTMLNonNegativeInteger(StringView);
+WEBCORE_EXPORT std::optional<unsigned> parseHTMLNonNegativeInteger(StringView);
 
 // https://html.spec.whatwg.org/#valid-non-negative-integer
-Optional<int> parseValidHTMLNonNegativeInteger(StringView);
+std::optional<int> parseValidHTMLNonNegativeInteger(StringView);
 
 // https://html.spec.whatwg.org/#valid-floating-point-number
-Optional<double> parseValidHTMLFloatingPointNumber(StringView);
+std::optional<double> parseValidHTMLFloatingPointNumber(StringView);
 
 // https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-floating-point-number-values
 Vector<double> parseHTMLListOfOfFloatingPointNumberValues(StringView);
@@ -153,7 +153,7 @@
 inline unsigned limitToOnlyHTMLNonNegative(StringView stringValue, unsigned defaultValue = 0)
 {
     ASSERT(defaultValue <= maxHTMLNonNegativeInteger);
-    unsigned value = parseHTMLNonNegativeInteger(stringValue).valueOr(defaultValue);
+    unsigned value = parseHTMLNonNegativeInteger(stringValue).value_or(defaultValue);
     ASSERT(value <= maxHTMLNonNegativeInteger);
     return value;
 }
diff --git a/Source/WebCore/html/parser/HTMLSrcsetParser.cpp b/Source/WebCore/html/parser/HTMLSrcsetParser.cpp
index 30b0f72..66a9864 100644
--- a/Source/WebCore/html/parser/HTMLSrcsetParser.cpp
+++ b/Source/WebCore/html/parser/HTMLSrcsetParser.cpp
@@ -134,14 +134,14 @@
         if (descriptorChar == 'x') {
             if (result.hasDensity() || result.hasHeight() || result.hasWidth())
                 return false;
-            Optional<double> density = parseValidHTMLFloatingPointNumber(descriptor);
+            std::optional<double> density = parseValidHTMLFloatingPointNumber(descriptor);
             if (!density || density.value() < 0)
                 return false;
             result.setDensity(density.value());
         } else if (descriptorChar == 'w') {
             if (result.hasDensity() || result.hasWidth())
                 return false;
-            Optional<int> resourceWidth = parseValidHTMLNonNegativeInteger(descriptor);
+            std::optional<int> resourceWidth = parseValidHTMLNonNegativeInteger(descriptor);
             if (!resourceWidth || resourceWidth.value() <= 0)
                 return false;
             result.setResourceWidth(resourceWidth.value());
@@ -150,7 +150,7 @@
             // The value of the 'h' descriptor is not used.
             if (result.hasDensity() || result.hasHeight())
                 return false;
-            Optional<int> resourceHeight = parseValidHTMLNonNegativeInteger(descriptor);
+            std::optional<int> resourceHeight = parseValidHTMLNonNegativeInteger(descriptor);
             if (!resourceHeight || resourceHeight.value() <= 0)
                 return false;
             result.setResourceHeight(resourceHeight.value());
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.cpp b/Source/WebCore/html/shadow/SliderThumbElement.cpp
index d111c2d..9af7352 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.cpp
+++ b/Source/WebCore/html/shadow/SliderThumbElement.cpp
@@ -298,7 +298,7 @@
 #if ENABLE(DATALIST_ELEMENT)
     const LayoutUnit snappingThreshold = renderer()->theme().sliderTickSnappingThreshold();
     if (snappingThreshold > 0) {
-        if (Optional<Decimal> closest = input->findClosestTickMarkValue(value)) {
+        if (std::optional<Decimal> closest = input->findClosestTickMarkValue(value)) {
             double closestFraction = stepRange.proportionFromValue(*closest).toDouble();
             double closestRatio = isVertical || !isLeftToRightDirection ? 1.0 - closestFraction : closestFraction;
             LayoutUnit closestPosition = trackLength * closestRatio;
@@ -582,7 +582,7 @@
     return downcast<HTMLInputElement>(shadowHost());
 }
 
-Optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle)
+std::optional<ElementStyle> SliderThumbElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle)
 {
     // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
 
@@ -590,7 +590,7 @@
     static NeverDestroyed<const AtomicString> mediaSliderThumbShadowPseudoId("-webkit-media-slider-thumb", AtomicString::ConstructFromLiteral);
 
     if (!hostStyle)
-        return Nullopt;
+        return std::nullopt;
 
     switch (hostStyle->appearance()) {
     case MediaSliderPart:
@@ -605,7 +605,7 @@
         m_shadowPseudoId = sliderThumbShadowPseudoId;
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 const AtomicString& SliderThumbElement::shadowPseudoId() const
@@ -636,7 +636,7 @@
     return createRenderer<RenderSliderContainer>(*this, WTFMove(style));
 }
 
-Optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle)
+std::optional<ElementStyle> SliderContainerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* hostStyle)
 {
     // This doesn't actually compute style. This is just a hack to pick shadow pseudo id when host style is known.
 
@@ -644,7 +644,7 @@
     static NeverDestroyed<const AtomicString> sliderContainer("-webkit-slider-container", AtomicString::ConstructFromLiteral);
 
     if (!hostStyle)
-        return Nullopt;
+        return std::nullopt;
 
     switch (hostStyle->appearance()) {
     case MediaSliderPart:
@@ -659,7 +659,7 @@
         m_shadowPseudoId = sliderContainer;
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 const AtomicString& SliderContainerElement::shadowPseudoId() const
diff --git a/Source/WebCore/html/shadow/SliderThumbElement.h b/Source/WebCore/html/shadow/SliderThumbElement.h
index 15b74af..805ecb6 100644
--- a/Source/WebCore/html/shadow/SliderThumbElement.h
+++ b/Source/WebCore/html/shadow/SliderThumbElement.h
@@ -77,7 +77,7 @@
 #endif
     void willDetachRenderers() override;
 
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override;
     const AtomicString& shadowPseudoId() const override;
 
     void startDragging();
@@ -134,7 +134,7 @@
 private:
     SliderContainerElement(Document&);
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle&, const RenderStyle*) override;
     const AtomicString& shadowPseudoId() const override;
 
     AtomicString m_shadowPseudoId;
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.cpp b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
index e0d7f2e..7901c6a 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.cpp
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.cpp
@@ -75,7 +75,7 @@
     return adoptRef(*new TextControlInnerElement(document));
 }
 
-Optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle)
+std::optional<ElementStyle> TextControlInnerElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle)
 {
     auto innerContainerStyle = RenderStyle::createPtr();
     innerContainerStyle->inheritFrom(shadowHostStyle);
@@ -134,7 +134,7 @@
     return downcast<RenderTextControlInnerBlock>(HTMLDivElement::renderer());
 }
 
-Optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle)
+std::optional<ElementStyle> TextControlInnerTextElement::resolveCustomStyle(const RenderStyle&, const RenderStyle* shadowHostStyle)
 {
     auto style = downcast<HTMLTextFormControlElement>(*shadowHost()).createInnerTextStyle(*shadowHostStyle);
     return ElementStyle(std::make_unique<RenderStyle>(WTFMove(style)));
@@ -149,7 +149,7 @@
     setHasCustomStyleResolveCallbacks();
 }
 
-Optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle)
+std::optional<ElementStyle> TextControlPlaceholderElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle)
 {
     auto style = resolveStyle(&parentStyle);
 
diff --git a/Source/WebCore/html/shadow/TextControlInnerElements.h b/Source/WebCore/html/shadow/TextControlInnerElements.h
index eeda094..b16e1e7 100644
--- a/Source/WebCore/html/shadow/TextControlInnerElements.h
+++ b/Source/WebCore/html/shadow/TextControlInnerElements.h
@@ -47,7 +47,7 @@
 
 protected:
     TextControlInnerElement(Document&);
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
 
 private:
     bool isMouseFocusable() const override { return false; }
@@ -64,7 +64,7 @@
 private:
     TextControlInnerTextElement(Document&);
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
     bool isMouseFocusable() const override { return false; }
     bool isTextControlInnerTextElement() const override { return true; }
 };
@@ -76,7 +76,7 @@
 private:
     TextControlPlaceholderElement(Document&);
     
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
 };
 
 class SearchFieldResultsButtonElement final : public HTMLDivElement {
diff --git a/Source/WebCore/html/track/TrackEvent.h b/Source/WebCore/html/track/TrackEvent.h
index e6f06e8..5e9449b 100644
--- a/Source/WebCore/html/track/TrackEvent.h
+++ b/Source/WebCore/html/track/TrackEvent.h
@@ -46,7 +46,7 @@
     using TrackEventTrack = Variant<RefPtr<VideoTrack>, RefPtr<AudioTrack>, RefPtr<TextTrack>>;
 
     struct Init : public EventInit {
-        Optional<TrackEventTrack> track;
+        std::optional<TrackEventTrack> track;
     };
 
     static Ref<TrackEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No)
diff --git a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
index 0df36df..070aaa1 100644
--- a/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
+++ b/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
@@ -150,7 +150,7 @@
         return;
     }
 
-    auto result = idbFactory->open(*context(), databaseName, Nullopt);
+    auto result = idbFactory->open(*context(), databaseName, std::nullopt);
     if (result.hasException()) {
         requestCallback().sendFailure("Could not open database.");
         return;
@@ -160,7 +160,7 @@
 }
 
 
-static RefPtr<KeyPath> keyPathFromIDBKeyPath(const Optional<IDBKeyPath>& idbKeyPath)
+static RefPtr<KeyPath> keyPathFromIDBKeyPath(const std::optional<IDBKeyPath>& idbKeyPath)
 {
     if (!idbKeyPath)
         return KeyPath::create().setType(KeyPath::Type::Null).release();
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.cpp b/Source/WebCore/inspector/InspectorInstrumentation.cpp
index bc3a566..f03e6a0 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/Source/WebCore/inspector/InspectorInstrumentation.cpp
@@ -633,7 +633,7 @@
         consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this.
 }
 
-void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, ThreadableLoaderClient* client, unsigned long identifier, Optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
+void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, ThreadableLoaderClient* client, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
 {
     if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
         consoleAgent->didFinishXHRLoading(identifier, url, sendURL, sendLineNumber, sendColumnNumber);
diff --git a/Source/WebCore/inspector/InspectorInstrumentation.h b/Source/WebCore/inspector/InspectorInstrumentation.h
index f3d3ffa..38d06fc 100644
--- a/Source/WebCore/inspector/InspectorInstrumentation.h
+++ b/Source/WebCore/inspector/InspectorInstrumentation.h
@@ -163,7 +163,7 @@
     static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
     static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
-    static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, Optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
+    static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
     static void willLoadXHRSynchronously(ScriptExecutionContext*);
     static void didLoadXHRSynchronously(ScriptExecutionContext*);
@@ -339,7 +339,7 @@
     static void didFailLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceError&);
     static void willLoadXHRImpl(InstrumentingAgents&, ThreadableLoaderClient*, const String&, const URL&, bool, RefPtr<FormData>&&, const HTTPHeaderMap&, bool);
     static void didFailXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*);
-    static void didFinishXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*, unsigned long identifier, Optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
+    static void didFinishXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
     static void didReceiveXHRResponseImpl(InstrumentingAgents&, unsigned long identifier);
     static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&);
     static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&);
@@ -914,7 +914,7 @@
         didFailLoadingImpl(*instrumentingAgents, identifier, loader, error);
 }
 
-inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, Optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
+inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, std::optional<String> decodedText, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
         didFinishXHRLoadingImpl(*instrumentingAgents, client, identifier, decodedText, url, sendURL, sendLineNumber, sendColumnNumber);
diff --git a/Source/WebCore/inspector/InspectorStyleSheet.cpp b/Source/WebCore/inspector/InspectorStyleSheet.cpp
index 88228f9..e2fecf5 100644
--- a/Source/WebCore/inspector/InspectorStyleSheet.cpp
+++ b/Source/WebCore/inspector/InspectorStyleSheet.cpp
@@ -926,7 +926,7 @@
     StringBuilder styleSheetText;
     styleSheetText.append(text.releaseReturnValue());
 
-    auto addRuleResult = m_pageStyleSheet->addRule(selector, emptyString(), Nullopt);
+    auto addRuleResult = m_pageStyleSheet->addRule(selector, emptyString(), std::nullopt);
     if (addRuleResult.hasException())
         return addRuleResult.releaseException();
     ASSERT(m_pageStyleSheet->length());
diff --git a/Source/WebCore/inspector/InspectorTimelineAgent.cpp b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
index fb40d9d..f1952c1 100644
--- a/Source/WebCore/inspector/InspectorTimelineAgent.cpp
+++ b/Source/WebCore/inspector/InspectorTimelineAgent.cpp
@@ -143,7 +143,7 @@
             return;
         }
 
-        Optional<Protocol::Timeline::Instrument> instrumentType = Protocol::InspectorHelpers::parseEnumValueFromString<Protocol::Timeline::Instrument>(enumValueString);
+        std::optional<Protocol::Timeline::Instrument> instrumentType = Protocol::InspectorHelpers::parseEnumValueFromString<Protocol::Timeline::Instrument>(enumValueString);
         if (!instrumentType) {
             errorString = makeString("Unexpected enum value: ", enumValueString);
             return;
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index db47998..2d3cd95 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -1715,7 +1715,7 @@
     Vector<LinkIcon> icons = LinkIconCollector { *document }.iconsOfTypes({ LinkIconType::Favicon, LinkIconType::TouchIcon, LinkIconType::TouchPrecomposedIcon });
 
     if (icons.isEmpty())
-        icons.append({ m_frame->document()->completeURL(ASCIILiteral("/favicon.ico")), LinkIconType::Favicon, String(), Nullopt });
+        icons.append({ m_frame->document()->completeURL(ASCIILiteral("/favicon.ico")), LinkIconType::Favicon, String(), std::nullopt });
 
     for (auto& icon : icons) {
         auto result = m_iconsPendingLoadDecision.add(nextIconCallbackID++, icon);
diff --git a/Source/WebCore/loader/DocumentThreadableLoader.cpp b/Source/WebCore/loader/DocumentThreadableLoader.cpp
index 11a48d7..e8781e3 100644
--- a/Source/WebCore/loader/DocumentThreadableLoader.cpp
+++ b/Source/WebCore/loader/DocumentThreadableLoader.cpp
@@ -157,7 +157,7 @@
 void DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight(ResourceRequest&& request)
 {
     if (m_async) {
-        m_preflightChecker = CrossOriginPreflightChecker(*this, WTFMove(request));
+        m_preflightChecker.emplace(*this, WTFMove(request));
         m_preflightChecker->startPreflight();
         return;
     }
@@ -203,7 +203,7 @@
         resource->removeClient(*this);
     }
     if (m_preflightChecker)
-        m_preflightChecker = Nullopt;
+        m_preflightChecker = std::nullopt;
 }
 
 static inline void reportContentSecurityPolicyError(ThreadableLoaderClient& client, const URL& url)
@@ -349,7 +349,7 @@
     ResourceRequest actualRequest(WTFMove(request));
     updateRequestForAccessControl(actualRequest, securityOrigin(), m_options.allowCredentials);
 
-    m_preflightChecker = Nullopt;
+    m_preflightChecker = std::nullopt;
 
     // It should be ok to skip the security check since we already asked about the preflight request.
     loadRequest(WTFMove(actualRequest), SkipSecurityCheck);
@@ -357,7 +357,7 @@
 
 void DocumentThreadableLoader::preflightFailure(unsigned long identifier, const ResourceError& error)
 {
-    m_preflightChecker = Nullopt;
+    m_preflightChecker = std::nullopt;
 
     InspectorInstrumentation::didFailLoading(m_document.frame(), m_document.frame()->loader().documentLoader(), identifier, error);
 
diff --git a/Source/WebCore/loader/DocumentThreadableLoader.h b/Source/WebCore/loader/DocumentThreadableLoader.h
index 0ff290d..3da8c5e 100644
--- a/Source/WebCore/loader/DocumentThreadableLoader.h
+++ b/Source/WebCore/loader/DocumentThreadableLoader.h
@@ -117,8 +117,8 @@
         bool m_simpleRequest;
         bool m_async;
         std::unique_ptr<ContentSecurityPolicy> m_contentSecurityPolicy;
-        Optional<CrossOriginPreflightChecker> m_preflightChecker;
-        Optional<HTTPHeaderMap> m_originalHeaders;
+        std::optional<CrossOriginPreflightChecker> m_preflightChecker;
+        std::optional<HTTPHeaderMap> m_originalHeaders;
     };
 
 } // namespace WebCore
diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp
index 356a805..4d59c00 100644
--- a/Source/WebCore/loader/EmptyClients.cpp
+++ b/Source/WebCore/loader/EmptyClients.cpp
@@ -64,9 +64,9 @@
     bool showPaymentUI(const URL&, const Vector<URL>&, const PaymentRequest&) override { return false; }
     void completeMerchantValidation(const PaymentMerchantSession&) override { }
 
-    void completeShippingMethodSelection(PaymentAuthorizationStatus, Optional<PaymentRequest::TotalAndLineItems>) override { }
-    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>&, Optional<PaymentRequest::TotalAndLineItems>) override { }
-    void completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems>) override { }
+    void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional<PaymentRequest::TotalAndLineItems>) override { }
+    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector<PaymentRequest::ShippingMethod>&, std::optional<PaymentRequest::TotalAndLineItems>) override { }
+    void completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems>) override { }
     void completePaymentSession(PaymentAuthorizationStatus) override { }
     void abortPaymentSession() override { }
     void paymentCoordinatorDestroyed() override { }
diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h
index 0397b0d..89d22e7 100644
--- a/Source/WebCore/loader/EmptyClients.h
+++ b/Source/WebCore/loader/EmptyClients.h
@@ -296,7 +296,7 @@
     void dispatchDidReceiveIcon() override { }
     void dispatchDidStartProvisionalLoad() override { }
     void dispatchDidReceiveTitle(const StringWithDirection&) override { }
-    void dispatchDidCommitLoad(Optional<HasInsecureContent>) override { }
+    void dispatchDidCommitLoad(std::optional<HasInsecureContent>) override { }
     void dispatchDidFailProvisionalLoad(const ResourceError&) override { }
     void dispatchDidFailLoad(const ResourceError&) override { }
     void dispatchDidFinishDocumentLoad() override { }
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index c7883ac..122a2bd 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -342,9 +342,9 @@
     urlSelected(request, nullptr);
 }
 
-void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute)
+void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event* triggeringEvent, LockHistory lockHistory, LockBackForwardList lockBackForwardList, ShouldSendReferrer shouldSendReferrer, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> openerPolicy, const AtomicString& downloadAttribute)
 {
-    NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.valueOr(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
+    NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.value_or(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
     urlSelected(FrameLoadRequest(m_frame.document()->securityOrigin(), ResourceRequest(url), passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, DoNotReplaceDocumentIfJavaScriptURL, shouldOpenExternalURLsPolicy, downloadAttribute), triggeringEvent);
 }
 
@@ -628,7 +628,7 @@
 
 void FrameLoader::receivedFirstData()
 {
-    dispatchDidCommitLoad(Nullopt);
+    dispatchDidCommitLoad(std::nullopt);
     dispatchDidClearWindowObjectsInAllWorlds();
     dispatchGlobalObjectAvailableInAllWorlds();
 
@@ -1814,7 +1814,7 @@
         requestFromDelegate(mainResourceRequest, mainResourceIdentifier, mainResouceError);
         notifier().dispatchDidReceiveResponse(cachedPage->documentLoader(), mainResourceIdentifier, cachedPage->documentLoader()->response());
 
-        Optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent();
+        std::optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent();
 
         // FIXME: This API should be turned around so that we ground CachedPage into the Page.
         cachedPage->restore(*m_frame.page());
@@ -2097,7 +2097,7 @@
     ASSERT(view);
     view->setWasScrolledByUser(false);
 
-    Optional<IntRect> previousViewFrameRect = m_frame.view() ?  m_frame.view()->frameRect() : Optional<IntRect>(Nullopt);
+    std::optional<IntRect> previousViewFrameRect = m_frame.view() ?  m_frame.view()->frameRect() : std::optional<IntRect>(std::nullopt);
     m_frame.setView(view);
 
     // Use the previous ScrollView's frame rect.
@@ -3529,7 +3529,7 @@
 #endif
 }
 
-void FrameLoader::dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent)
+void FrameLoader::dispatchDidCommitLoad(std::optional<HasInsecureContent> initialHasInsecureContent)
 {
     if (m_stateMachine.creatingInitialEmptyDocument())
         return;
@@ -3593,8 +3593,8 @@
 
 void FrameLoader::clearTestingOverrides()
 {
-    m_overrideCachePolicyForTesting = Nullopt;
-    m_overrideResourceLoadPriorityForTesting = Nullopt;
+    m_overrideCachePolicyForTesting = std::nullopt;
+    m_overrideResourceLoadPriorityForTesting = std::nullopt;
     m_isStrictRawResourceValidationPolicyDisabledForTesting = false;
 }
 
diff --git a/Source/WebCore/loader/FrameLoader.h b/Source/WebCore/loader/FrameLoader.h
index 17f337e..1b02eef 100644
--- a/Source/WebCore/loader/FrameLoader.h
+++ b/Source/WebCore/loader/FrameLoader.h
@@ -118,7 +118,7 @@
     unsigned long loadResourceSynchronously(const ResourceRequest&, StoredCredentials, ClientCredentialPolicy, ResourceError&, ResourceResponse&, RefPtr<SharedBuffer>& data);
 
     void changeLocation(const FrameLoadRequest&);
-    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, Optional<NewFrameOpenerPolicy> = Nullopt, const AtomicString& downloadAttribute = nullAtom);
+    WEBCORE_EXPORT void urlSelected(const URL&, const String& target, Event*, LockHistory, LockBackForwardList, ShouldSendReferrer, ShouldOpenExternalURLsPolicy, std::optional<NewFrameOpenerPolicy> = std::nullopt, const AtomicString& downloadAttribute = nullAtom);
     void submitForm(PassRefPtr<FormSubmission>);
 
     WEBCORE_EXPORT void reload(bool endToEndReload = false, bool contentBlockersEnabled = true);
@@ -350,7 +350,7 @@
 
     bool shouldReloadToHandleUnreachableURL(DocumentLoader*);
 
-    void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent);
+    void dispatchDidCommitLoad(std::optional<HasInsecureContent> initialHasInsecureContent);
 
     void urlSelected(const FrameLoadRequest&, Event*);
 
@@ -452,8 +452,8 @@
 
     RefPtr<FrameNetworkingContext> m_networkingContext;
 
-    Optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting;
-    Optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting;
+    std::optional<ResourceRequestCachePolicy> m_overrideCachePolicyForTesting;
+    std::optional<ResourceLoadPriority> m_overrideResourceLoadPriorityForTesting;
     bool m_isStrictRawResourceValidationPolicyDisabledForTesting { false };
 
     URL m_previousURL;
diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h
index b6530de..30a8b63 100644
--- a/Source/WebCore/loader/FrameLoaderClient.h
+++ b/Source/WebCore/loader/FrameLoaderClient.h
@@ -165,7 +165,7 @@
     virtual void dispatchDidReceiveIcon() = 0;
     virtual void dispatchDidStartProvisionalLoad() = 0;
     virtual void dispatchDidReceiveTitle(const StringWithDirection&) = 0;
-    virtual void dispatchDidCommitLoad(Optional<HasInsecureContent>) = 0;
+    virtual void dispatchDidCommitLoad(std::optional<HasInsecureContent>) = 0;
     virtual void dispatchDidFailProvisionalLoad(const ResourceError&) = 0;
     virtual void dispatchDidFailLoad(const ResourceError&) = 0;
     virtual void dispatchDidFinishDocumentLoad() = 0;
diff --git a/Source/WebCore/loader/LinkLoader.cpp b/Source/WebCore/loader/LinkLoader.cpp
index 55a4d5f..fa078b6 100644
--- a/Source/WebCore/loader/LinkLoader.cpp
+++ b/Source/WebCore/loader/LinkLoader.cpp
@@ -83,7 +83,7 @@
     m_cachedLinkResource = nullptr;
 }
 
-Optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(const String& as)
+std::optional<CachedResource::Type> LinkLoader::resourceTypeFromAsAttribute(const String& as)
 {
     if (as.isEmpty())
         return CachedResource::RawResource;
@@ -101,7 +101,7 @@
     if (equalLettersIgnoringASCIICase(as, "track"))
         return CachedResource::TextTrackResource;
 #endif
-    return Nullopt;
+    return std::nullopt;
 }
 
 static std::unique_ptr<LinkPreloadResourceClient> createLinkPreloadResourceClient(CachedResource& resource, LinkLoader& loader, CachedResource::Type type)
@@ -186,7 +186,7 @@
         if (!m_client.shouldLoadLink())
             return false;
 
-        Optional<ResourceLoadPriority> priority;
+        std::optional<ResourceLoadPriority> priority;
         CachedResource::Type type = CachedResource::LinkPrefetch;
         if (relAttribute.isLinkSubresource) {
             // We only make one request to the cached resource loader if multiple rel types are specified;
diff --git a/Source/WebCore/loader/LinkLoader.h b/Source/WebCore/loader/LinkLoader.h
index 2a4921c..e773b64 100644
--- a/Source/WebCore/loader/LinkLoader.h
+++ b/Source/WebCore/loader/LinkLoader.h
@@ -52,7 +52,7 @@
     virtual ~LinkLoader();
 
     bool loadLink(const LinkRelAttribute&, const URL&, const String& as, const String& crossOrigin, Document&);
-    static Optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as);
+    static std::optional<CachedResource::Type> resourceTypeFromAsAttribute(const String& as);
 
     WeakPtr<LinkLoader> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
     void triggerEvents(const CachedResource&);
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp
index 6d16067..ca0bc00 100644
--- a/Source/WebCore/loader/SubresourceLoader.cpp
+++ b/Source/WebCore/loader/SubresourceLoader.cpp
@@ -78,7 +78,7 @@
     , m_resource(&resource)
     , m_loadingMultipartContent(false)
     , m_state(Uninitialized)
-    , m_requestCountTracker(InPlace, frame.document()->cachedResourceLoader(), resource)
+    , m_requestCountTracker(std::in_place, frame.document()->cachedResourceLoader(), resource)
 {
 #ifndef NDEBUG
     subresourceLoaderCounter.increment();
@@ -302,7 +302,7 @@
         m_loadingMultipartContent = true;
 
         // We don't count multiParts in a CachedResourceLoader's request count
-        m_requestCountTracker = Nullopt;
+        m_requestCountTracker = std::nullopt;
         if (!m_resource->isImage()) {
             cancel();
             return;
@@ -572,7 +572,7 @@
     if (reachedTerminalState())
         return;
 
-    m_requestCountTracker = Nullopt;
+    m_requestCountTracker = std::nullopt;
 #if PLATFORM(IOS)
     m_documentLoader->cachedResourceLoader().loadDone(m_resource, m_state != CancelledWhileInitializing);
 #else
diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h
index a34ee06..84c0ac4 100644
--- a/Source/WebCore/loader/SubresourceLoader.h
+++ b/Source/WebCore/loader/SubresourceLoader.h
@@ -128,7 +128,7 @@
     CachedResource* m_resource;
     bool m_loadingMultipartContent;
     SubresourceLoaderState m_state;
-    Optional<RequestCountTracker> m_requestCountTracker;
+    std::optional<RequestCountTracker> m_requestCountTracker;
     RefPtr<SecurityOrigin> m_origin;
     unsigned m_redirectCount { 0 };
 };
diff --git a/Source/WebCore/loader/cache/CachedResource.cpp b/Source/WebCore/loader/cache/CachedResource.cpp
index e07938c..afb0b65 100644
--- a/Source/WebCore/loader/cache/CachedResource.cpp
+++ b/Source/WebCore/loader/cache/CachedResource.cpp
@@ -802,7 +802,7 @@
     return true;
 }
 
-void CachedResource::setLoadPriority(const Optional<ResourceLoadPriority>& loadPriority)
+void CachedResource::setLoadPriority(const std::optional<ResourceLoadPriority>& loadPriority)
 {
     if (loadPriority)
         m_loadPriority = loadPriority.value();
diff --git a/Source/WebCore/loader/cache/CachedResource.h b/Source/WebCore/loader/cache/CachedResource.h
index 8468953..c8bc0df 100644
--- a/Source/WebCore/loader/cache/CachedResource.h
+++ b/Source/WebCore/loader/cache/CachedResource.h
@@ -121,7 +121,7 @@
     Type type() const { return m_type; }
 
     ResourceLoadPriority loadPriority() const { return m_loadPriority; }
-    void setLoadPriority(const Optional<ResourceLoadPriority>&);
+    void setLoadPriority(const std::optional<ResourceLoadPriority>&);
 
     WEBCORE_EXPORT void addClient(CachedResourceClient&);
     WEBCORE_EXPORT void removeClient(CachedResourceClient&);
diff --git a/Source/WebCore/loader/cache/CachedResourceRequest.cpp b/Source/WebCore/loader/cache/CachedResourceRequest.cpp
index b220c45..473acd5 100644
--- a/Source/WebCore/loader/cache/CachedResourceRequest.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceRequest.cpp
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-CachedResourceRequest::CachedResourceRequest(ResourceRequest&& resourceRequest, const ResourceLoaderOptions& options, Optional<ResourceLoadPriority> priority, String&& charset)
+CachedResourceRequest::CachedResourceRequest(ResourceRequest&& resourceRequest, const ResourceLoaderOptions& options, std::optional<ResourceLoadPriority> priority, String&& charset)
     : m_resourceRequest(WTFMove(resourceRequest))
     , m_charset(WTFMove(charset))
     , m_options(options)
diff --git a/Source/WebCore/loader/cache/CachedResourceRequest.h b/Source/WebCore/loader/cache/CachedResourceRequest.h
index ae4b967..0e8a4c3 100644
--- a/Source/WebCore/loader/cache/CachedResourceRequest.h
+++ b/Source/WebCore/loader/cache/CachedResourceRequest.h
@@ -49,7 +49,7 @@
 
 class CachedResourceRequest {
 public:
-    CachedResourceRequest(ResourceRequest&&, const ResourceLoaderOptions&, Optional<ResourceLoadPriority> = Nullopt, String&& charset = String());
+    CachedResourceRequest(ResourceRequest&&, const ResourceLoaderOptions&, std::optional<ResourceLoadPriority> = std::nullopt, String&& charset = String());
 
     ResourceRequest&& releaseResourceRequest() { return WTFMove(m_resourceRequest); }
     const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
@@ -57,7 +57,7 @@
     void setCharset(const String& charset) { m_charset = charset; }
     const ResourceLoaderOptions& options() const { return m_options; }
     void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
-    const Optional<ResourceLoadPriority>& priority() const { return m_priority; }
+    const std::optional<ResourceLoadPriority>& priority() const { return m_priority; }
     void setInitiator(PassRefPtr<Element>);
     void setInitiator(const AtomicString& name);
     const AtomicString& initiatorName() const;
@@ -92,7 +92,7 @@
     ResourceRequest m_resourceRequest;
     String m_charset;
     ResourceLoaderOptions m_options;
-    Optional<ResourceLoadPriority> m_priority;
+    std::optional<ResourceLoadPriority> m_priority;
     RefPtr<Element> m_initiatorElement;
     AtomicString m_initiatorName;
     RefPtr<SecurityOrigin> m_origin;
diff --git a/Source/WebCore/mathml/MathMLElement.h b/Source/WebCore/mathml/MathMLElement.h
index ceb34f1..9de13d9 100644
--- a/Source/WebCore/mathml/MathMLElement.h
+++ b/Source/WebCore/mathml/MathMLElement.h
@@ -84,8 +84,8 @@
         Stretched = 18
     };
 
-    virtual Optional<bool> specifiedDisplayStyle() { return Nullopt; }
-    virtual Optional<MathVariant> specifiedMathVariant() { return Nullopt; }
+    virtual std::optional<bool> specifiedDisplayStyle() { return std::nullopt; }
+    virtual std::optional<MathVariant> specifiedMathVariant() { return std::nullopt; }
 
     virtual void updateSelectedChild() { }
 
diff --git a/Source/WebCore/mathml/MathMLFractionElement.cpp b/Source/WebCore/mathml/MathMLFractionElement.cpp
index 1a7e4ab..ee2181e 100644
--- a/Source/WebCore/mathml/MathMLFractionElement.cpp
+++ b/Source/WebCore/mathml/MathMLFractionElement.cpp
@@ -69,7 +69,7 @@
     return m_lineThickness.value();
 }
 
-MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, Optional<FractionAlignment>& alignment)
+MathMLFractionElement::FractionAlignment MathMLFractionElement::cachedFractionAlignment(const QualifiedName& name, std::optional<FractionAlignment>& alignment)
 {
     if (alignment)
         return alignment.value();
@@ -97,11 +97,11 @@
 void MathMLFractionElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == linethicknessAttr)
-        m_lineThickness = Nullopt;
+        m_lineThickness = std::nullopt;
     else if (name == numalignAttr)
-        m_numeratorAlignment = Nullopt;
+        m_numeratorAlignment = std::nullopt;
     else if (name == denomalignAttr)
-        m_denominatorAlignment = Nullopt;
+        m_denominatorAlignment = std::nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLFractionElement.h b/Source/WebCore/mathml/MathMLFractionElement.h
index 3bf63a1..cfff5b6 100644
--- a/Source/WebCore/mathml/MathMLFractionElement.h
+++ b/Source/WebCore/mathml/MathMLFractionElement.h
@@ -48,11 +48,11 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    FractionAlignment cachedFractionAlignment(const QualifiedName&, Optional<FractionAlignment>&);
+    FractionAlignment cachedFractionAlignment(const QualifiedName&, std::optional<FractionAlignment>&);
 
-    Optional<Length> m_lineThickness;
-    Optional<FractionAlignment> m_numeratorAlignment;
-    Optional<FractionAlignment> m_denominatorAlignment;
+    std::optional<Length> m_lineThickness;
+    std::optional<FractionAlignment> m_numeratorAlignment;
+    std::optional<FractionAlignment> m_denominatorAlignment;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLMathElement.cpp b/Source/WebCore/mathml/MathMLMathElement.cpp
index f626942..783e9ff 100644
--- a/Source/WebCore/mathml/MathMLMathElement.cpp
+++ b/Source/WebCore/mathml/MathMLMathElement.cpp
@@ -53,7 +53,7 @@
     return createRenderer<RenderMathMLMath>(*this, WTFMove(style));
 }
 
-Optional<bool> MathMLMathElement::specifiedDisplayStyle()
+std::optional<bool> MathMLMathElement::specifiedDisplayStyle()
 {
     if (cachedBooleanAttribute(displaystyleAttr, m_displayStyle) == BooleanValue::Default) {
         // The default displaystyle value of the <math> depends on the display attribute, so we parse it here.
@@ -71,9 +71,9 @@
     bool displayStyleAttribute = (name == displaystyleAttr || name == displayAttr);
     bool mathVariantAttribute = name == mathvariantAttr;
     if (displayStyleAttribute)
-        m_displayStyle = Nullopt;
+        m_displayStyle = std::nullopt;
     if (mathVariantAttribute)
-        m_mathVariant = Nullopt;
+        m_mathVariant = std::nullopt;
     if ((displayStyleAttribute || mathVariantAttribute) && renderer())
         MathMLStyle::resolveMathMLStyleTree(renderer());
 
diff --git a/Source/WebCore/mathml/MathMLMathElement.h b/Source/WebCore/mathml/MathMLMathElement.h
index fa6c6e9..a1e377e 100644
--- a/Source/WebCore/mathml/MathMLMathElement.h
+++ b/Source/WebCore/mathml/MathMLMathElement.h
@@ -44,7 +44,7 @@
 
     bool acceptsDisplayStyleAttribute() final { return true; }
     bool acceptsMathVariantAttribute() final { return true; }
-    Optional<bool> specifiedDisplayStyle() final;
+    std::optional<bool> specifiedDisplayStyle() final;
 
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
 };
diff --git a/Source/WebCore/mathml/MathMLMencloseElement.cpp b/Source/WebCore/mathml/MathMLMencloseElement.cpp
index 1330919..743c461 100644
--- a/Source/WebCore/mathml/MathMLMencloseElement.cpp
+++ b/Source/WebCore/mathml/MathMLMencloseElement.cpp
@@ -132,7 +132,7 @@
 void MathMLMencloseElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == notationAttr)
-        m_notationFlags = Nullopt;
+        m_notationFlags = std::nullopt;
 
     MathMLRowElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLMencloseElement.h b/Source/WebCore/mathml/MathMLMencloseElement.h
index ee745cb..da1d2a7 100644
--- a/Source/WebCore/mathml/MathMLMencloseElement.h
+++ b/Source/WebCore/mathml/MathMLMencloseElement.h
@@ -63,7 +63,7 @@
     void clearNotations() { m_notationFlags = 0; }
     void addNotation(MencloseNotationFlag notationFlag) { m_notationFlags.value() |= notationFlag; }
     void addNotationFlags(StringView notation);
-    Optional<uint16_t> m_notationFlags;
+    std::optional<uint16_t> m_notationFlags;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp
index 7a8a054..6854f0d 100644
--- a/Source/WebCore/mathml/MathMLOperatorDictionary.cpp
+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.cpp
@@ -1107,17 +1107,17 @@
     0x003D, 0x005E, 0x005F, 0x007E, 0x00AF, 0x02C6, 0x02C7, 0x02C9, 0x02CD, 0x02DC, 0x02F7, 0x0302, 0x0332, 0x203E, 0x20D0, 0x20D1, 0x20D6, 0x20D7, 0x20E1, 0x2190, 0x2192, 0x2194, 0x2198, 0x2199, 0x219C, 0x219D, 0x219E, 0x21A0, 0x21A2, 0x21A3, 0x21A4, 0x21A6, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21B4, 0x21B9, 0x21BC, 0x21BD, 0x21C0, 0x21C1, 0x21C4, 0x21C6, 0x21C7, 0x21C9, 0x21CB, 0x21CC, 0x21D0, 0x21D2, 0x21D4, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21E0, 0x21E2, 0x21E4, 0x21E5, 0x21E6, 0x21E8, 0x21F0, 0x21F6, 0x21FD, 0x21FE, 0x21FF, 0x23B4, 0x23B5, 0x23DC, 0x23DD, 0x23DE, 0x23DF, 0x23E0, 0x23E1, 0x2500, 0x27F5, 0x27F6, 0x27F7, 0x27F8, 0x27F9, 0x27FA, 0x27FB, 0x27FC, 0x27FD, 0x27FE, 0x27FF, 0x290C, 0x290D, 0x290E, 0x290F, 0x2910, 0x294E, 0x2950, 0x2952, 0x2953, 0x2956, 0x2957, 0x295A, 0x295B, 0x295E, 0x295F, 0x2B45, 0x2B46, 0xFE35, 0xFE36, 0xFE37, 0xFE38, 0x1EEF0, 0x1EEF1
 };
 
-Optional<Property> MathMLOperatorDictionary::search(UChar32 character, Form form, bool explicitForm)
+std::optional<Property> MathMLOperatorDictionary::search(UChar32 character, Form form, bool explicitForm)
 {
     if (!character)
-        return Nullopt;
+        return std::nullopt;
 
     // We try and find the default values from the operator dictionary.
     if (auto* entry = tryBinarySearch<const Entry, Key>(dictionary, dictionarySize, Key(character, form), ExtractKey))
         return ExtractProperty(*entry);
 
     if (explicitForm)
-        return Nullopt;
+        return std::nullopt;
 
     // If we did not find the desired operator form and if it was not set explicitely, we use the first one in the following order: Infix, Prefix, Postfix.
     // This is to handle bad MathML markup without explicit <mrow> delimiters like "<mo>(</mo><mi>a</mi><mo>)</mo><mo>(</mo><mi>b</mi><mo>)</mo>" where innerfences should not be considered infix.
@@ -1130,7 +1130,7 @@
         return ExtractProperty(*entry);
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 bool MathMLOperatorDictionary::isVertical(UChar32 textContent)
diff --git a/Source/WebCore/mathml/MathMLOperatorDictionary.h b/Source/WebCore/mathml/MathMLOperatorDictionary.h
index 00ef50d..e0316d7 100644
--- a/Source/WebCore/mathml/MathMLOperatorDictionary.h
+++ b/Source/WebCore/mathml/MathMLOperatorDictionary.h
@@ -52,7 +52,7 @@
     // Default operator properties are all set to "false".
     unsigned short flags { 0 };
 };
-Optional<Property> search(UChar32, Form, bool explicitForm);
+std::optional<Property> search(UChar32, Form, bool explicitForm);
 bool isVertical(UChar32);
 }
 
diff --git a/Source/WebCore/mathml/MathMLOperatorElement.cpp b/Source/WebCore/mathml/MathMLOperatorElement.cpp
index 968afe1..8d35be3 100644
--- a/Source/WebCore/mathml/MathMLOperatorElement.cpp
+++ b/Source/WebCore/mathml/MathMLOperatorElement.cpp
@@ -133,7 +133,7 @@
 {
     ASSERT(m_properties.dirtyFlags & flag);
 
-    Optional<BooleanValue> property;
+    std::optional<BooleanValue> property;
     const auto& name = propertyFlagToAttributeName(flag);
     const BooleanValue& value = cachedBooleanAttribute(name, property);
     switch (value) {
@@ -211,13 +211,13 @@
 
 void MathMLOperatorElement::childrenChanged(const ChildChange& change)
 {
-    m_operatorChar = Nullopt;
-    m_dictionaryProperty = Nullopt;
+    m_operatorChar = std::nullopt;
+    m_dictionaryProperty = std::nullopt;
     m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags;
     MathMLTokenElement::childrenChanged(change);
 }
 
-static Optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag(const QualifiedName& name)
+static std::optional<MathMLOperatorDictionary::Flag> attributeNameToPropertyFlag(const QualifiedName& name)
 {
     if (name == accentAttr)
         return Accent;
@@ -233,24 +233,24 @@
         return Stretchy;
     if (name == symmetricAttr)
         return Symmetric;
-    return Nullopt;
+    return std::nullopt;
 }
 
 void MathMLOperatorElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == formAttr) {
-        m_dictionaryProperty = Nullopt;
+        m_dictionaryProperty = std::nullopt;
         m_properties.dirtyFlags = MathMLOperatorDictionary::allFlags;
     } else if (auto flag = attributeNameToPropertyFlag(name))
         m_properties.dirtyFlags |= flag.value();
     else if (name == lspaceAttr)
-        m_leadingSpace = Nullopt;
+        m_leadingSpace = std::nullopt;
     else if (name == rspaceAttr)
-        m_trailingSpace = Nullopt;
+        m_trailingSpace = std::nullopt;
     else if (name == minsizeAttr)
-        m_minSize = Nullopt;
+        m_minSize = std::nullopt;
     else if (name == maxsizeAttr)
-        m_maxSize = Nullopt;
+        m_maxSize = std::nullopt;
 
     if ((name == stretchyAttr || name == lspaceAttr || name == rspaceAttr || name == movablelimitsAttr) && renderer()) {
         downcast<RenderMathMLOperator>(*renderer()).updateFromElement();
diff --git a/Source/WebCore/mathml/MathMLOperatorElement.h b/Source/WebCore/mathml/MathMLOperatorElement.h
index 3809657..5defd77 100644
--- a/Source/WebCore/mathml/MathMLOperatorElement.h
+++ b/Source/WebCore/mathml/MathMLOperatorElement.h
@@ -41,7 +41,7 @@
     };
     static OperatorChar parseOperatorChar(const String&);
     const OperatorChar& operatorChar();
-    void setOperatorFormDirty() { m_dictionaryProperty = Nullopt; }
+    void setOperatorFormDirty() { m_dictionaryProperty = std::nullopt; }
     MathMLOperatorDictionary::Form form() { return dictionaryProperty().form; }
     bool hasProperty(MathMLOperatorDictionary::Flag);
     Length defaultLeadingSpace();
@@ -57,9 +57,9 @@
     void childrenChanged(const ChildChange&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    Optional<OperatorChar> m_operatorChar;
+    std::optional<OperatorChar> m_operatorChar;
 
-    Optional<MathMLOperatorDictionary::Property> m_dictionaryProperty;
+    std::optional<MathMLOperatorDictionary::Property> m_dictionaryProperty;
     MathMLOperatorDictionary::Property computeDictionaryProperty();
     const MathMLOperatorDictionary::Property& dictionaryProperty();
 
@@ -70,10 +70,10 @@
     OperatorProperties m_properties;
     void computeOperatorFlag(MathMLOperatorDictionary::Flag);
 
-    Optional<Length> m_leadingSpace;
-    Optional<Length> m_trailingSpace;
-    Optional<Length> m_minSize;
-    Optional<Length> m_maxSize;
+    std::optional<Length> m_leadingSpace;
+    std::optional<Length> m_trailingSpace;
+    std::optional<Length> m_minSize;
+    std::optional<Length> m_maxSize;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLPaddedElement.cpp b/Source/WebCore/mathml/MathMLPaddedElement.cpp
index 49c06ed..b2f446d 100644
--- a/Source/WebCore/mathml/MathMLPaddedElement.cpp
+++ b/Source/WebCore/mathml/MathMLPaddedElement.cpp
@@ -73,15 +73,15 @@
 void MathMLPaddedElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == widthAttr)
-        m_width = Nullopt;
+        m_width = std::nullopt;
     else if (name == heightAttr)
-        m_height = Nullopt;
+        m_height = std::nullopt;
     else if (name == depthAttr)
-        m_depth = Nullopt;
+        m_depth = std::nullopt;
     else if (name == lspaceAttr)
-        m_lspace = Nullopt;
+        m_lspace = std::nullopt;
     else if (name == voffsetAttr)
-        m_voffset = Nullopt;
+        m_voffset = std::nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLPaddedElement.h b/Source/WebCore/mathml/MathMLPaddedElement.h
index 116bb25..7ca373e 100644
--- a/Source/WebCore/mathml/MathMLPaddedElement.h
+++ b/Source/WebCore/mathml/MathMLPaddedElement.h
@@ -45,11 +45,11 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    Optional<Length> m_width;
-    Optional<Length> m_height;
-    Optional<Length> m_depth;
-    Optional<Length> m_lspace;
-    Optional<Length> m_voffset;
+    std::optional<Length> m_width;
+    std::optional<Length> m_height;
+    std::optional<Length> m_depth;
+    std::optional<Length> m_lspace;
+    std::optional<Length> m_voffset;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLPresentationElement.cpp b/Source/WebCore/mathml/MathMLPresentationElement.cpp
index 9355d38..de9bd5d1 100644
--- a/Source/WebCore/mathml/MathMLPresentationElement.cpp
+++ b/Source/WebCore/mathml/MathMLPresentationElement.cpp
@@ -182,7 +182,7 @@
         || htmlElement.hasTagName(HTMLNames::ulTag);
 }
 
-const MathMLElement::BooleanValue& MathMLPresentationElement::cachedBooleanAttribute(const QualifiedName& name, Optional<BooleanValue>& attribute)
+const MathMLElement::BooleanValue& MathMLPresentationElement::cachedBooleanAttribute(const QualifiedName& name, std::optional<BooleanValue>& attribute)
 {
     if (attribute)
         return attribute.value();
@@ -306,7 +306,7 @@
     return parseNamedSpace(stringView);
 }
 
-const MathMLElement::Length& MathMLPresentationElement::cachedMathMLLength(const QualifiedName& name, Optional<Length>& length)
+const MathMLElement::Length& MathMLPresentationElement::cachedMathMLLength(const QualifiedName& name, std::optional<Length>& length)
 {
     if (length)
         return length.value();
@@ -319,10 +319,10 @@
     return hasTagName(mtableTag);
 }
 
-Optional<bool> MathMLPresentationElement::specifiedDisplayStyle()
+std::optional<bool> MathMLPresentationElement::specifiedDisplayStyle()
 {
     if (!acceptsDisplayStyleAttribute())
-        return Nullopt;
+        return std::nullopt;
     const MathMLElement::BooleanValue& specifiedDisplayStyle = cachedBooleanAttribute(displaystyleAttr, m_displayStyle);
     return toOptionalBool(specifiedDisplayStyle);
 }
@@ -369,13 +369,13 @@
     return MathVariant::None;
 }
 
-Optional<MathMLElement::MathVariant> MathMLPresentationElement::specifiedMathVariant()
+std::optional<MathMLElement::MathVariant> MathMLPresentationElement::specifiedMathVariant()
 {
     if (!acceptsMathVariantAttribute())
-        return Nullopt;
+        return std::nullopt;
     if (!m_mathVariant)
         m_mathVariant = parseMathVariantAttribute(attributeWithoutSynchronization(mathvariantAttr));
-    return m_mathVariant.value() == MathVariant::None ? Nullopt : m_mathVariant;
+    return m_mathVariant.value() == MathVariant::None ? std::nullopt : m_mathVariant;
 }
 
 void MathMLPresentationElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
@@ -383,9 +383,9 @@
     bool displayStyleAttribute = name == displaystyleAttr && acceptsDisplayStyleAttribute();
     bool mathVariantAttribute = name == mathvariantAttr && acceptsMathVariantAttribute();
     if (displayStyleAttribute)
-        m_displayStyle = Nullopt;
+        m_displayStyle = std::nullopt;
     if (mathVariantAttribute)
-        m_mathVariant = Nullopt;
+        m_mathVariant = std::nullopt;
     if ((displayStyleAttribute || mathVariantAttribute) && renderer())
         MathMLStyle::resolveMathMLStyleTree(renderer());
 
diff --git a/Source/WebCore/mathml/MathMLPresentationElement.h b/Source/WebCore/mathml/MathMLPresentationElement.h
index 1af8b81..2370557 100644
--- a/Source/WebCore/mathml/MathMLPresentationElement.h
+++ b/Source/WebCore/mathml/MathMLPresentationElement.h
@@ -44,20 +44,20 @@
     static bool isPhrasingContent(const Node&);
     static bool isFlowContent(const Node&);
 
-    static Optional<bool> toOptionalBool(const BooleanValue& value) { return value == BooleanValue::Default ? Nullopt : Optional<bool>(value == BooleanValue::True); }
-    const BooleanValue& cachedBooleanAttribute(const QualifiedName&, Optional<BooleanValue>&);
+    static std::optional<bool> toOptionalBool(const BooleanValue& value) { return value == BooleanValue::Default ? std::nullopt : std::optional<bool>(value == BooleanValue::True); }
+    const BooleanValue& cachedBooleanAttribute(const QualifiedName&, std::optional<BooleanValue>&);
 
     static Length parseMathMLLength(const String&);
-    const Length& cachedMathMLLength(const QualifiedName&, Optional<Length>&);
+    const Length& cachedMathMLLength(const QualifiedName&, std::optional<Length>&);
 
     virtual bool acceptsDisplayStyleAttribute();
-    Optional<bool> specifiedDisplayStyle() override;
+    std::optional<bool> specifiedDisplayStyle() override;
 
     virtual bool acceptsMathVariantAttribute() { return false; }
-    Optional<MathVariant> specifiedMathVariant() final;
+    std::optional<MathVariant> specifiedMathVariant() final;
 
-    Optional<BooleanValue> m_displayStyle;
-    Optional<MathVariant> m_mathVariant;
+    std::optional<BooleanValue> m_displayStyle;
+    std::optional<MathVariant> m_mathVariant;
 
 private:
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
diff --git a/Source/WebCore/mathml/MathMLScriptsElement.cpp b/Source/WebCore/mathml/MathMLScriptsElement.cpp
index c8b91f0..393edc1 100644
--- a/Source/WebCore/mathml/MathMLScriptsElement.cpp
+++ b/Source/WebCore/mathml/MathMLScriptsElement.cpp
@@ -58,9 +58,9 @@
 void MathMLScriptsElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == subscriptshiftAttr)
-        m_subscriptShift = Nullopt;
+        m_subscriptShift = std::nullopt;
     else if (name == superscriptshiftAttr)
-        m_superscriptShift = Nullopt;
+        m_superscriptShift = std::nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLScriptsElement.h b/Source/WebCore/mathml/MathMLScriptsElement.h
index 63c9d88..b4a6089 100644
--- a/Source/WebCore/mathml/MathMLScriptsElement.h
+++ b/Source/WebCore/mathml/MathMLScriptsElement.h
@@ -44,8 +44,8 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) override;
     void parseAttribute(const QualifiedName&, const AtomicString&) override;
 
-    Optional<Length> m_subscriptShift;
-    Optional<Length> m_superscriptShift;
+    std::optional<Length> m_subscriptShift;
+    std::optional<Length> m_superscriptShift;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLSpaceElement.cpp b/Source/WebCore/mathml/MathMLSpaceElement.cpp
index f892595..96e9b90 100644
--- a/Source/WebCore/mathml/MathMLSpaceElement.cpp
+++ b/Source/WebCore/mathml/MathMLSpaceElement.cpp
@@ -63,11 +63,11 @@
 void MathMLSpaceElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == widthAttr)
-        m_width = Nullopt;
+        m_width = std::nullopt;
     else if (name == heightAttr)
-        m_height = Nullopt;
+        m_height = std::nullopt;
     else if (name == depthAttr)
-        m_depth = Nullopt;
+        m_depth = std::nullopt;
 
     MathMLPresentationElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLSpaceElement.h b/Source/WebCore/mathml/MathMLSpaceElement.h
index 02787a7..3f16f78 100644
--- a/Source/WebCore/mathml/MathMLSpaceElement.h
+++ b/Source/WebCore/mathml/MathMLSpaceElement.h
@@ -44,9 +44,9 @@
 
     bool acceptsDisplayStyleAttribute() final { return false; }
 
-    Optional<Length> m_width;
-    Optional<Length> m_height;
-    Optional<Length> m_depth;
+    std::optional<Length> m_width;
+    std::optional<Length> m_height;
+    std::optional<Length> m_depth;
 };
 
 }
diff --git a/Source/WebCore/mathml/MathMLTokenElement.cpp b/Source/WebCore/mathml/MathMLTokenElement.cpp
index 435af13..ce1cca6 100644
--- a/Source/WebCore/mathml/MathMLTokenElement.cpp
+++ b/Source/WebCore/mathml/MathMLTokenElement.cpp
@@ -77,15 +77,15 @@
     return isPhrasingContent(child) && StyledElement::childShouldCreateRenderer(child);
 }
 
-Optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string)
+std::optional<UChar32> MathMLTokenElement::convertToSingleCodePoint(StringView string)
 {
     auto codePoints = stripLeadingAndTrailingWhitespace(string).codePoints();
     auto iterator = codePoints.begin();
     if (iterator == codePoints.end())
-        return Nullopt;
-    Optional<UChar32> character = *iterator;
+        return std::nullopt;
+    std::optional<UChar32> character = *iterator;
     ++iterator;
-    return iterator == codePoints.end() ? character : Nullopt;
+    return iterator == codePoints.end() ? character : std::nullopt;
 }
 
 }
diff --git a/Source/WebCore/mathml/MathMLTokenElement.h b/Source/WebCore/mathml/MathMLTokenElement.h
index 4d42c07..bed40f3 100644
--- a/Source/WebCore/mathml/MathMLTokenElement.h
+++ b/Source/WebCore/mathml/MathMLTokenElement.h
@@ -37,7 +37,7 @@
 public:
     static Ref<MathMLTokenElement> create(const QualifiedName& tagName, Document&);
 
-    static Optional<UChar32> convertToSingleCodePoint(StringView);
+    static std::optional<UChar32> convertToSingleCodePoint(StringView);
 
 protected:
     MathMLTokenElement(const QualifiedName& tagName, Document&);
diff --git a/Source/WebCore/mathml/MathMLUnderOverElement.cpp b/Source/WebCore/mathml/MathMLUnderOverElement.cpp
index 5ccc0c5..1413aad 100644
--- a/Source/WebCore/mathml/MathMLUnderOverElement.cpp
+++ b/Source/WebCore/mathml/MathMLUnderOverElement.cpp
@@ -58,9 +58,9 @@
 void MathMLUnderOverElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
 {
     if (name == accentAttr)
-        m_accent = Nullopt;
+        m_accent = std::nullopt;
     else if (name == accentunderAttr)
-        m_accentUnder = Nullopt;
+        m_accentUnder = std::nullopt;
 
     MathMLElement::parseAttribute(name, value);
 }
diff --git a/Source/WebCore/mathml/MathMLUnderOverElement.h b/Source/WebCore/mathml/MathMLUnderOverElement.h
index 9ec6db7..07f4d96 100644
--- a/Source/WebCore/mathml/MathMLUnderOverElement.h
+++ b/Source/WebCore/mathml/MathMLUnderOverElement.h
@@ -42,8 +42,8 @@
     RenderPtr<RenderElement> createElementRenderer(RenderStyle&&, const RenderTreePosition&) final;
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
 
-    Optional<BooleanValue> m_accent;
-    Optional<BooleanValue> m_accentUnder;
+    std::optional<BooleanValue> m_accent;
+    std::optional<BooleanValue> m_accentUnder;
 };
 
 }
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 45dbcd2..e9f3dc2 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -390,7 +390,7 @@
     virtual void notifyScrollerThumbIsVisibleInRect(const IntRect&) { }
     virtual void recommendedScrollbarStyleDidChange(ScrollbarStyle) { }
 
-    virtual WTF::Optional<ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() { return ScrollbarOverlayStyleDefault; }
+    virtual std::optional<ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() { return ScrollbarOverlayStyleDefault; }
 
     virtual void wheelEventHandlersChanged(bool hasHandlers) = 0;
         
diff --git a/Source/WebCore/page/DOMTimer.cpp b/Source/WebCore/page/DOMTimer.cpp
index d03c1b0..a969d94 100644
--- a/Source/WebCore/page/DOMTimer.cpp
+++ b/Source/WebCore/page/DOMTimer.cpp
@@ -426,11 +426,11 @@
     return interval;
 }
 
-Optional<std::chrono::milliseconds> DOMTimer::alignedFireTime(std::chrono::milliseconds fireTime) const
+std::optional<std::chrono::milliseconds> DOMTimer::alignedFireTime(std::chrono::milliseconds fireTime) const
 {
     auto alignmentInterval = scriptExecutionContext()->timerAlignmentInterval(m_nestingLevel >= maxTimerNestingLevel);
     if (alignmentInterval == 0ms)
-        return Nullopt;
+        return std::nullopt;
     
     static const double randomizedProportion = randomNumber();
 
diff --git a/Source/WebCore/page/DOMTimer.h b/Source/WebCore/page/DOMTimer.h
index 96c8b3b..39a0461 100644
--- a/Source/WebCore/page/DOMTimer.h
+++ b/Source/WebCore/page/DOMTimer.h
@@ -71,7 +71,7 @@
     // SuspendableTimer
     void fired() override;
     void didStop() override;
-    Optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const override;
+    std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const override;
 
     // ActiveDOMObject API.
     const char* activeDOMObjectName() const override;
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 2a9393a..e4570e1 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -1522,7 +1522,7 @@
 
 void DOMWindow::scrollBy(const ScrollToOptions& options) const
 {
-    return scrollBy(options.left.valueOr(0), options.top.valueOr(0));
+    return scrollBy(options.left.value_or(0), options.top.value_or(0));
 }
 
 void DOMWindow::scrollBy(double x, double y) const
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index c9f9bbc..595b3ce 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -370,7 +370,7 @@
 
     bool m_shouldPrintWhenFinishedLoading { false };
     bool m_suspendedForDocumentSuspension { false };
-    Optional<bool> m_canShowModalDialogOverride;
+    std::optional<bool> m_canShowModalDialogOverride;
 
     HashSet<DOMWindowProperty*> m_properties;
 
diff --git a/Source/WebCore/page/EventSource.cpp b/Source/WebCore/page/EventSource.cpp
index 4742288..d5555ed 100644
--- a/Source/WebCore/page/EventSource.cpp
+++ b/Source/WebCore/page/EventSource.cpp
@@ -280,8 +280,8 @@
             m_discardTrailingNewline = false;
         }
 
-        Optional<unsigned> lineLength;
-        Optional<unsigned> fieldLength;
+        std::optional<unsigned> lineLength;
+        std::optional<unsigned> fieldLength;
         for (unsigned i = position; !lineLength && i < size; ++i) {
             switch (m_receiveBuffer[i]) {
             case ':':
@@ -317,7 +317,7 @@
         m_receiveBuffer.remove(0, position);
 }
 
-void EventSource::parseEventStreamLine(unsigned position, Optional<unsigned> fieldLength, unsigned lineLength)
+void EventSource::parseEventStreamLine(unsigned position, std::optional<unsigned> fieldLength, unsigned lineLength)
 {
     if (!lineLength) {
         if (!m_data.isEmpty())
diff --git a/Source/WebCore/page/EventSource.h b/Source/WebCore/page/EventSource.h
index 03aec2b..2be3f9f 100644
--- a/Source/WebCore/page/EventSource.h
+++ b/Source/WebCore/page/EventSource.h
@@ -93,7 +93,7 @@
     void scheduleReconnect();
     void abortConnectionAttempt();
     void parseEventStream();
-    void parseEventStreamLine(unsigned position, Optional<unsigned> fieldLength, unsigned lineLength);
+    void parseEventStreamLine(unsigned position, std::optional<unsigned> fieldLength, unsigned lineLength);
     void dispatchMessageEvent();
 
     bool responseIsValid(const ResourceResponse&) const;
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index cbb5289..59096dd 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -449,7 +449,7 @@
 void FrameView::recalculateScrollbarOverlayStyle()
 {
     ScrollbarOverlayStyle oldOverlayStyle = scrollbarOverlayStyle();
-    WTF::Optional<ScrollbarOverlayStyle> clientOverlayStyle = frame().page() ? frame().page()->chrome().client().preferredScrollbarOverlayStyle() : ScrollbarOverlayStyleDefault;
+    std::optional<ScrollbarOverlayStyle> clientOverlayStyle = frame().page() ? frame().page()->chrome().client().preferredScrollbarOverlayStyle() : ScrollbarOverlayStyleDefault;
     if (clientOverlayStyle) {
         if (clientOverlayStyle.value() != oldOverlayStyle)
             setScrollbarOverlayStyle(clientOverlayStyle.value());
@@ -1831,7 +1831,7 @@
     }
 }
 
-void FrameView::setLayoutViewportOverrideRect(Optional<LayoutRect> rect)
+void FrameView::setLayoutViewportOverrideRect(std::optional<LayoutRect> rect)
 {
     if (rect == m_layoutViewportOverrideRect)
         return;
@@ -5156,7 +5156,7 @@
         widget->notifyWidget(notification);
 }
 
-void FrameView::setViewExposedRect(Optional<FloatRect> viewExposedRect)
+void FrameView::setViewExposedRect(std::optional<FloatRect> viewExposedRect)
 {
     if (m_viewExposedRect == viewExposedRect)
         return;
diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h
index 8934510..f897842 100644
--- a/Source/WebCore/page/FrameView.h
+++ b/Source/WebCore/page/FrameView.h
@@ -263,7 +263,7 @@
     
     // If set, overrides the default "m_layoutViewportOrigin, size of initial containing block" rect.
     // Used with delegated scrolling (i.e. iOS).
-    WEBCORE_EXPORT void setLayoutViewportOverrideRect(Optional<LayoutRect>);
+    WEBCORE_EXPORT void setLayoutViewportOverrideRect(std::optional<LayoutRect>);
 
     // These are in document coordinates, unaffected by zooming.
     WEBCORE_EXPORT LayoutRect layoutViewportRect() const;
@@ -569,8 +569,8 @@
     // of the view is actually exposed on screen (taking into account
     // clipping by other UI elements), whereas visibleContentRect is
     // internal to WebCore and doesn't respect those things.
-    WEBCORE_EXPORT void setViewExposedRect(Optional<FloatRect>);
-    Optional<FloatRect> viewExposedRect() const { return m_viewExposedRect; }
+    WEBCORE_EXPORT void setViewExposedRect(std::optional<FloatRect>);
+    std::optional<FloatRect> viewExposedRect() const { return m_viewExposedRect; }
 
 #if ENABLE(CSS_SCROLL_SNAP)
     void updateSnapOffsets() override;
@@ -786,10 +786,10 @@
 
     bool m_shouldUpdateWhileOffscreen;
 
-    Optional<FloatRect> m_viewExposedRect;
+    std::optional<FloatRect> m_viewExposedRect;
     
     LayoutPoint m_layoutViewportOrigin;
-    Optional<LayoutRect> m_layoutViewportOverrideRect;
+    std::optional<LayoutRect> m_layoutViewportOverrideRect;
 
     unsigned m_deferSetNeedsLayoutCount;
     bool m_setNeedsLayoutWasDeferred;
diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp
index ae96608..5fe21e7 100644
--- a/Source/WebCore/page/Page.cpp
+++ b/Source/WebCore/page/Page.cpp
@@ -553,7 +553,7 @@
     return false;
 }
 
-inline Optional<std::pair<MediaCanStartListener&, Document&>>  Page::takeAnyMediaCanStartListener()
+inline std::optional<std::pair<MediaCanStartListener&, Document&>>  Page::takeAnyMediaCanStartListener()
 {
     for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
         if (!frame->document())
@@ -561,7 +561,7 @@
         if (MediaCanStartListener* listener = frame->document()->takeAnyMediaCanStartListener())
             return { { *listener, *frame->document() } };
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 void Page::setCanStartMedia(bool canStartMedia)
diff --git a/Source/WebCore/page/Page.h b/Source/WebCore/page/Page.h
index 200ab39..22834ff 100644
--- a/Source/WebCore/page/Page.h
+++ b/Source/WebCore/page/Page.h
@@ -541,8 +541,8 @@
     bool isResourceCachingDisabled() const { return m_resourceCachingDisabled; }
     void setResourceCachingDisabled(bool disabled) { m_resourceCachingDisabled = disabled; }
 
-    Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; }
-    void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; }
+    std::optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; }
+    void setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; }
 
 private:
     WEBCORE_EXPORT void initGroup();
@@ -562,7 +562,7 @@
 
     unsigned findMatchesForText(const String&, FindOptions, unsigned maxMatchCount, ShouldHighlightMatches, ShouldMarkMatches);
 
-    Optional<std::pair<MediaCanStartListener&, Document&>> takeAnyMediaCanStartListener();
+    std::optional<std::pair<MediaCanStartListener&, Document&>> takeAnyMediaCanStartListener();
 
     Vector<Ref<PluginViewBase>> pluginViews();
 
@@ -737,7 +737,7 @@
     UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { UserInterfaceLayoutDirection::LTR };
     
     // For testing.
-    Optional<EventThrottlingBehavior> m_eventThrottlingBehaviorOverride;
+    std::optional<EventThrottlingBehavior> m_eventThrottlingBehaviorOverride;
 };
 
 inline PageGroup& Page::group()
diff --git a/Source/WebCore/page/ScrollToOptions.h b/Source/WebCore/page/ScrollToOptions.h
index c9899d7..84a9d9d 100644
--- a/Source/WebCore/page/ScrollToOptions.h
+++ b/Source/WebCore/page/ScrollToOptions.h
@@ -33,8 +33,8 @@
 namespace WebCore {
 
 struct ScrollToOptions {
-    Optional<double> left;
-    Optional<double> top;
+    std::optional<double> left;
+    std::optional<double> top;
 };
 
 }
diff --git a/Source/WebCore/page/SecurityOrigin.cpp b/Source/WebCore/page/SecurityOrigin.cpp
index 7a21d5b..b259ffa 100644
--- a/Source/WebCore/page/SecurityOrigin.cpp
+++ b/Source/WebCore/page/SecurityOrigin.cpp
@@ -108,7 +108,7 @@
     m_domain = m_host;
 
     if (m_port && isDefaultPortForProtocol(m_port.value(), m_protocol))
-        m_port = Nullopt;
+        m_port = std::nullopt;
 
     // By default, only local SecurityOrigins can load local resources.
     m_canLoadLocalResources = isLocal();
@@ -486,7 +486,7 @@
     return SecurityOrigin::create(URL(URL(), originString));
 }
 
-Ref<SecurityOrigin> SecurityOrigin::create(const String& protocol, const String& host, Optional<uint16_t> port)
+Ref<SecurityOrigin> SecurityOrigin::create(const String& protocol, const String& host, std::optional<uint16_t> port)
 {
     String decodedHost = decodeURLEscapeSequences(host);
     auto origin = create(URL(URL(), protocol + "://" + host + "/"));
diff --git a/Source/WebCore/page/SecurityOrigin.h b/Source/WebCore/page/SecurityOrigin.h
index 85cf332..18cb188 100644
--- a/Source/WebCore/page/SecurityOrigin.h
+++ b/Source/WebCore/page/SecurityOrigin.h
@@ -53,7 +53,7 @@
     static Ref<SecurityOrigin> createUnique();
 
     WEBCORE_EXPORT static Ref<SecurityOrigin> createFromString(const String&);
-    WEBCORE_EXPORT static Ref<SecurityOrigin> create(const String& protocol, const String& host, Optional<uint16_t> port);
+    WEBCORE_EXPORT static Ref<SecurityOrigin> create(const String& protocol, const String& host, std::optional<uint16_t> port);
 
     // Some URL schemes use nested URLs for their security context. For example,
     // filesystem URLs look like the following:
@@ -81,7 +81,7 @@
     const String& protocol() const { return m_protocol; }
     const String& host() const { return m_host; }
     const String& domain() const { return m_domain; }
-    Optional<uint16_t> port() const { return m_port; }
+    std::optional<uint16_t> port() const { return m_port; }
 
     // Returns true if a given URL is secure, based either directly on its
     // own protocol, or, when relevant, on the protocol of its "inner URL"
@@ -218,7 +218,7 @@
     String m_host;
     String m_domain;
     String m_filePath;
-    Optional<uint16_t> m_port;
+    std::optional<uint16_t> m_port;
     bool m_isUnique { false };
     bool m_universalAccess { false };
     bool m_domainWasSetInDOM { false };
diff --git a/Source/WebCore/page/SecurityOriginData.cpp b/Source/WebCore/page/SecurityOriginData.cpp
index 743690e..24a9d43 100644
--- a/Source/WebCore/page/SecurityOriginData.cpp
+++ b/Source/WebCore/page/SecurityOriginData.cpp
@@ -50,7 +50,7 @@
 #if !LOG_DISABLED
 String SecurityOriginData::debugString() const
 {
-    return makeString(protocol, "://", host, ":", String::number(port.valueOr(0)));
+    return makeString(protocol, "://", host, ":", String::number(port.value_or(0)));
 }
 #endif
 
@@ -92,37 +92,37 @@
     stringBuilder.append(separatorCharacter);
     stringBuilder.append(encodeForFileName(host));
     stringBuilder.append(separatorCharacter);
-    stringBuilder.appendNumber(port.valueOr(0));
+    stringBuilder.appendNumber(port.value_or(0));
     
     return stringBuilder.toString();
 }
 
-Optional<SecurityOriginData> SecurityOriginData::fromDatabaseIdentifier(const String& databaseIdentifier)
+std::optional<SecurityOriginData> SecurityOriginData::fromDatabaseIdentifier(const String& databaseIdentifier)
 {
     // Make sure there's a first separator
     size_t separator1 = databaseIdentifier.find(separatorCharacter);
     if (separator1 == notFound)
-        return Nullopt;
+        return std::nullopt;
     
     // Make sure there's a second separator
     size_t separator2 = databaseIdentifier.reverseFind(separatorCharacter);
     if (separator2 == notFound)
-        return Nullopt;
+        return std::nullopt;
     
     // Ensure there were at least 2 separator characters. Some hostnames on intranets have
     // underscores in them, so we'll assume that any additional underscores are part of the host.
     if (separator1 == separator2)
-        return Nullopt;
+        return std::nullopt;
     
     // Make sure the port section is a valid port number or doesn't exist
     bool portOkay;
     int port = databaseIdentifier.right(databaseIdentifier.length() - separator2 - 1).toInt(&portOkay);
     bool portAbsent = (separator2 == databaseIdentifier.length() - 1);
     if (!(portOkay || portAbsent))
-        return Nullopt;
+        return std::nullopt;
     
     if (port < 0 || port > std::numeric_limits<uint16_t>::max())
-        return Nullopt;
+        return std::nullopt;
     
     return SecurityOriginData {databaseIdentifier.substring(0, separator1), databaseIdentifier.substring(separator1 + 1, separator2 - separator1 - 1), static_cast<uint16_t>(port)};
 }
diff --git a/Source/WebCore/page/SecurityOriginData.h b/Source/WebCore/page/SecurityOriginData.h
index 979b42f..210a49e 100644
--- a/Source/WebCore/page/SecurityOriginData.h
+++ b/Source/WebCore/page/SecurityOriginData.h
@@ -34,7 +34,7 @@
 
 struct SecurityOriginData {
     SecurityOriginData() = default;
-    SecurityOriginData(const String& protocol, const String& host, Optional<uint16_t> port)
+    SecurityOriginData(const String& protocol, const String& host, std::optional<uint16_t> port)
         : protocol(protocol)
         , host(host)
         , port(port)
@@ -55,21 +55,21 @@
 
     String protocol;
     String host;
-    Optional<uint16_t> port;
+    std::optional<uint16_t> port;
 
     WEBCORE_EXPORT SecurityOriginData isolatedCopy() const;
 
     // Serialize the security origin to a string that could be used as part of
     // file names. This format should be used in storage APIs only.
     WEBCORE_EXPORT String databaseIdentifier() const;
-    WEBCORE_EXPORT static Optional<SecurityOriginData> fromDatabaseIdentifier(const String&);
+    WEBCORE_EXPORT static std::optional<SecurityOriginData> fromDatabaseIdentifier(const String&);
     
     template<class Encoder> void encode(Encoder&) const;
     template<class Decoder> static bool decode(Decoder&, SecurityOriginData&);
 
     bool isEmpty() const
     {
-        return protocol.isNull() && host.isNull() && port == Nullopt;
+        return protocol.isNull() && host.isNull() && port == std::nullopt;
     }
     
     bool isHashTableDeletedValue() const
@@ -117,7 +117,7 @@
         unsigned hashCodes[3] = {
             data.protocol.impl() ? data.protocol.impl()->hash() : 0,
             data.host.impl() ? data.host.impl()->hash() : 0,
-            data.port.valueOr(0)
+            data.port.value_or(0)
         };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
diff --git a/Source/WebCore/page/SecurityOriginHash.h b/Source/WebCore/page/SecurityOriginHash.h
index 50eb295..b7a5aef 100644
--- a/Source/WebCore/page/SecurityOriginHash.h
+++ b/Source/WebCore/page/SecurityOriginHash.h
@@ -40,7 +40,7 @@
         unsigned hashCodes[3] = {
             origin->protocol().impl() ? origin->protocol().impl()->hash() : 0,
             origin->host().impl() ? origin->host().impl()->hash() : 0,
-            origin->port().valueOr(0)
+            origin->port().value_or(0)
         };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
diff --git a/Source/WebCore/page/WindowFeatures.cpp b/Source/WebCore/page/WindowFeatures.cpp
index 7c76ae1..b8adcb4 100644
--- a/Source/WebCore/page/WindowFeatures.cpp
+++ b/Source/WebCore/page/WindowFeatures.cpp
@@ -36,8 +36,8 @@
 static void setWindowFeature(WindowFeatures&, StringView key, StringView value);
 
 static DialogFeaturesMap parseDialogFeaturesMap(const String&);
-static Optional<bool> boolFeature(const DialogFeaturesMap&, const char* key);
-static Optional<float> floatFeature(const DialogFeaturesMap&, const char* key, float min, float max);
+static std::optional<bool> boolFeature(const DialogFeaturesMap&, const char* key);
+static std::optional<float> floatFeature(const DialogFeaturesMap&, const char* key, float min, float max);
 
 static bool isSeparator(UChar character)
 {
@@ -158,8 +158,8 @@
     features.locationBarVisible = false;
     features.dialog = true;
 
-    float width = floatFeature(featuresMap, "dialogwidth", 100, screenAvailableRect.width()).valueOr(620); // default here came from frame size of dialog in MacIE
-    float height = floatFeature(featuresMap, "dialogheight", 100, screenAvailableRect.height()).valueOr(450); // default here came from frame size of dialog in MacIE
+    float width = floatFeature(featuresMap, "dialogwidth", 100, screenAvailableRect.width()).value_or(620); // default here came from frame size of dialog in MacIE
+    float height = floatFeature(featuresMap, "dialogheight", 100, screenAvailableRect.height()).value_or(450); // default here came from frame size of dialog in MacIE
 
     features.width = width;
     features.height = height;
@@ -167,25 +167,25 @@
     features.x = floatFeature(featuresMap, "dialogleft", screenAvailableRect.x(), screenAvailableRect.maxX() - width);
     features.y = floatFeature(featuresMap, "dialogtop", screenAvailableRect.y(), screenAvailableRect.maxY() - height);
 
-    if (boolFeature(featuresMap, "center").valueOr(true)) {
+    if (boolFeature(featuresMap, "center").value_or(true)) {
         if (!features.x)
             features.x = screenAvailableRect.x() + (screenAvailableRect.width() - width) / 2;
         if (!features.y)
             features.y = screenAvailableRect.y() + (screenAvailableRect.height() - height) / 2;
     }
 
-    features.resizable = boolFeature(featuresMap, "resizable").valueOr(false);
-    features.scrollbarsVisible = boolFeature(featuresMap, "scroll").valueOr(true);
-    features.statusBarVisible = boolFeature(featuresMap, "status").valueOr(false);
+    features.resizable = boolFeature(featuresMap, "resizable").value_or(false);
+    features.scrollbarsVisible = boolFeature(featuresMap, "scroll").value_or(true);
+    features.statusBarVisible = boolFeature(featuresMap, "status").value_or(false);
 
     return features;
 }
 
-static Optional<bool> boolFeature(const DialogFeaturesMap& features, const char* key)
+static std::optional<bool> boolFeature(const DialogFeaturesMap& features, const char* key)
 {
     auto it = features.find(key);
     if (it == features.end())
-        return Nullopt;
+        return std::nullopt;
 
     auto& value = it->value;
     return value.isNull()
@@ -194,18 +194,18 @@
         || equalLettersIgnoringASCIICase(value, "on");
 }
 
-static Optional<float> floatFeature(const DialogFeaturesMap& features, const char* key, float min, float max)
+static std::optional<float> floatFeature(const DialogFeaturesMap& features, const char* key, float min, float max)
 {
     auto it = features.find(key);
     if (it == features.end())
-        return Nullopt;
+        return std::nullopt;
 
     // FIXME: The toDouble function does not offer a way to tell "0q" from string with no digits in it: Both
     // return the number 0 and false for ok. But "0q" should yield the minimum rather than the default.
     bool ok;
     double parsedNumber = it->value.toDouble(&ok);
     if ((!parsedNumber && !ok) || std::isnan(parsedNumber))
-        return Nullopt;
+        return std::nullopt;
     if (parsedNumber < min || max <= min)
         return min;
     if (parsedNumber > max)
diff --git a/Source/WebCore/page/WindowFeatures.h b/Source/WebCore/page/WindowFeatures.h
index e00545e..d46a75a 100644
--- a/Source/WebCore/page/WindowFeatures.h
+++ b/Source/WebCore/page/WindowFeatures.h
@@ -38,10 +38,10 @@
 class FloatRect;
 
 struct WindowFeatures {
-    Optional<float> x;
-    Optional<float> y;
-    Optional<float> width;
-    Optional<float> height;
+    std::optional<float> x;
+    std::optional<float> y;
+    std::optional<float> width;
+    std::optional<float> height;
 
     bool menuBarVisible { true };
     bool statusBarVisible { true };
diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp
index ea6ff92..c8326df 100644
--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp
+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.cpp
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-ContentSecurityPolicySource::ContentSecurityPolicySource(const ContentSecurityPolicy& policy, const String& scheme, const String& host, Optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard)
+ContentSecurityPolicySource::ContentSecurityPolicySource(const ContentSecurityPolicy& policy, const String& scheme, const String& host, std::optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard)
     : m_policy(policy)
     , m_scheme(scheme)
     , m_host(host)
@@ -86,7 +86,7 @@
     if (m_portHasWildcard)
         return true;
 
-    Optional<uint16_t> port = url.port();
+    std::optional<uint16_t> port = url.port();
 
     if (port == m_port)
         return true;
diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySource.h b/Source/WebCore/page/csp/ContentSecurityPolicySource.h
index abaae96..28a1a68 100644
--- a/Source/WebCore/page/csp/ContentSecurityPolicySource.h
+++ b/Source/WebCore/page/csp/ContentSecurityPolicySource.h
@@ -36,7 +36,7 @@
 class ContentSecurityPolicySource {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    ContentSecurityPolicySource(const ContentSecurityPolicy&, const String& scheme, const String& host, Optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard);
+    ContentSecurityPolicySource(const ContentSecurityPolicy&, const String& scheme, const String& host, std::optional<uint16_t> port, const String& path, bool hostHasWildcard, bool portHasWildcard);
 
     bool matches(const URL&, bool didReceiveRedirectResponse = false) const;
 
@@ -50,7 +50,7 @@
     const ContentSecurityPolicy& m_policy;
     String m_scheme;
     String m_host;
-    Optional<uint16_t> m_port;
+    std::optional<uint16_t> m_port;
     String m_path;
 
     bool m_hostHasWildcard;
diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
index 0963f42..5d51f68 100644
--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.cpp
@@ -173,7 +173,7 @@
         skipWhile<UChar, isSourceCharacter>(position, end);
 
         String scheme, host, path;
-        Optional<uint16_t> port;
+        std::optional<uint16_t> port;
         bool hostHasWildcard = false;
         bool portHasWildcard = false;
 
@@ -203,7 +203,7 @@
 //                   / ( [ scheme "://" ] host [ port ] [ path ] )
 //                   / "'self'"
 //
-bool ContentSecurityPolicySourceList::parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, Optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard)
+bool ContentSecurityPolicySourceList::parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, std::optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard)
 {
     if (begin == end)
         return false;
@@ -292,7 +292,7 @@
         return false;
 
     if (!beginPort)
-        port = Nullopt;
+        port = std::nullopt;
     else {
         if (!parsePort(beginPort, beginPath, port, portHasWildcard))
             return false;
@@ -394,7 +394,7 @@
 
 // port              = ":" ( 1*DIGIT / "*" )
 //
-bool ContentSecurityPolicySourceList::parsePort(const UChar* begin, const UChar* end, Optional<uint16_t>& port, bool& portHasWildcard)
+bool ContentSecurityPolicySourceList::parsePort(const UChar* begin, const UChar* end, std::optional<uint16_t>& port, bool& portHasWildcard)
 {
     ASSERT(begin <= end);
     ASSERT(!port);
@@ -407,7 +407,7 @@
         return false;
     
     if (end - begin == 1 && *begin == '*') {
-        port = Nullopt;
+        port = std::nullopt;
         portHasWildcard = true;
         return true;
     }
diff --git a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h
index bfeb854..04dc29c 100644
--- a/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h
+++ b/Source/WebCore/page/csp/ContentSecurityPolicySourceList.h
@@ -58,10 +58,10 @@
 private:
     void parse(const UChar* begin, const UChar* end);
 
-    bool parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, Optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard);
+    bool parseSource(const UChar* begin, const UChar* end, String& scheme, String& host, std::optional<uint16_t>& port, String& path, bool& hostHasWildcard, bool& portHasWildcard);
     bool parseScheme(const UChar* begin, const UChar* end, String& scheme);
     bool parseHost(const UChar* begin, const UChar* end, String& host, bool& hostHasWildcard);
-    bool parsePort(const UChar* begin, const UChar* end, Optional<uint16_t>& port, bool& portHasWildcard);
+    bool parsePort(const UChar* begin, const UChar* end, std::optional<uint16_t>& port, bool& portHasWildcard);
     bool parsePath(const UChar* begin, const UChar* end, String& path);
 
     bool parseNonceSource(const UChar* begin, const UChar* end);
diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
index 85a6472..22ab0ec 100644
--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
@@ -220,7 +220,7 @@
 
     bool isProgrammaticScroll = frameView.inProgrammaticScroll();
     if (isProgrammaticScroll || frameView.frame().document()->pageCacheState() != Document::NotInPageCache)
-        updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, Nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set);
+        updateScrollPositionAfterAsyncScroll(frameView.scrollLayerID(), scrollPosition, std::nullopt, isProgrammaticScroll, ScrollingLayerPositionAction::Set);
 
     // If this frame view's document is being put into the page cache, we don't want to update our
     // main frame scroll position. Just let the FrameView think that we did.
@@ -235,7 +235,7 @@
     return true;
 }
 
-void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     ScheduledScrollUpdate scrollUpdate(nodeID, scrollPosition, layoutViewportOrigin, programmaticScroll, scrollingLayerPositionAction);
     
@@ -297,7 +297,7 @@
     return nullptr;
 }
 
-void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const FloatPoint& scrollPosition, Optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(ScrollingNodeID scrollingNodeID, const FloatPoint& scrollPosition, std::optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     ASSERT(isMainThread());
 
@@ -349,13 +349,13 @@
     bool oldProgrammaticScroll = frameView.inProgrammaticScroll();
     frameView.setInProgrammaticScroll(programmaticScroll);
 
-    Optional<FloatRect> layoutViewportRect;
+    std::optional<FloatRect> layoutViewportRect;
 
     WTF::switchOn(layoutViewportOriginOrOverrideRect,
-        [&frameView](Optional<FloatPoint> origin) {
+        [&frameView](std::optional<FloatPoint> origin) {
             if (origin)
                 frameView.setBaseLayoutViewportOrigin(LayoutPoint(origin.value()), FrameView::TriggerLayoutOrNot::No);
-        }, [&frameView, &layoutViewportRect, inStableState, visualViewportEnabled = visualViewportEnabled()](Optional<FloatRect> overrideRect) {
+        }, [&frameView, &layoutViewportRect, inStableState, visualViewportEnabled = visualViewportEnabled()](std::optional<FloatRect> overrideRect) {
             layoutViewportRect = overrideRect;
             if (overrideRect && inStableState) {
                 if (visualViewportEnabled)
diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
index 6d308a5..1d22af6 100644
--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
@@ -52,7 +52,7 @@
 
     void scrollingStateTreePropertiesChanged();
 
-    WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const Optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction);
+    WEBCORE_EXPORT void scheduleUpdateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, const std::optional<FloatPoint>& layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction);
 
 #if PLATFORM(COCOA)
     WEBCORE_EXPORT void setActiveScrollSnapIndices(ScrollingNodeID, unsigned horizontalIndex, unsigned verticalIndex);
@@ -73,7 +73,7 @@
 
     PassRefPtr<ScrollingTree> releaseScrollingTree() { return WTFMove(m_scrollingTree); }
 
-    void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, Optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction);
+    void updateScrollPositionAfterAsyncScroll(ScrollingNodeID, const FloatPoint&, std::optional<FloatPoint> layoutViewportOrigin, bool programmaticScroll, ScrollingLayerPositionAction);
 
     WEBCORE_EXPORT String scrollingStateTreeAsText() const override;
     WEBCORE_EXPORT void willCommitTree() override;
@@ -132,7 +132,7 @@
 
     struct ScheduledScrollUpdate {
         ScheduledScrollUpdate() = default;
-        ScheduledScrollUpdate(ScrollingNodeID scrollingNodeID, FloatPoint point, Optional<FloatPoint> viewportOrigin, bool isProgrammatic, ScrollingLayerPositionAction udpateAction)
+        ScheduledScrollUpdate(ScrollingNodeID scrollingNodeID, FloatPoint point, std::optional<FloatPoint> viewportOrigin, bool isProgrammatic, ScrollingLayerPositionAction udpateAction)
             : nodeID(scrollingNodeID)
             , scrollPosition(point)
             , layoutViewportOrigin(viewportOrigin)
@@ -142,7 +142,7 @@
 
         ScrollingNodeID nodeID { 0 };
         FloatPoint scrollPosition;
-        Optional<FloatPoint> layoutViewportOrigin;
+        std::optional<FloatPoint> layoutViewportOrigin;
         bool isProgrammaticScroll { false };
         ScrollingLayerPositionAction updateLayerPositionAction { ScrollingLayerPositionAction::Sync };
         
diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
index 595d55e..35ccd65 100644
--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h
+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h
@@ -119,7 +119,7 @@
     // Should be called whenever the given frame view has been laid out.
     virtual void frameViewLayoutUpdated(FrameView&) { }
 
-    using LayoutViewportOriginOrOverrideRect = WTF::Variant<Optional<FloatPoint>, Optional<FloatRect>>;
+    using LayoutViewportOriginOrOverrideRect = WTF::Variant<std::optional<FloatPoint>, std::optional<FloatRect>>;
     virtual void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool /* programmaticScroll */, bool /* inStableState*/, ScrollingLayerPositionAction) { }
 
     // Should be called whenever the slow repaint objects counter changes between zero and one.
diff --git a/Source/WebCore/page/scrolling/ScrollingTree.cpp b/Source/WebCore/page/scrolling/ScrollingTree.cpp
index b420ff6..d00ec5d 100644
--- a/Source/WebCore/page/scrolling/ScrollingTree.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTree.cpp
@@ -112,7 +112,7 @@
     downcast<ScrollingTreeOverflowScrollingNode>(*node).updateLayersAfterDelegatedScroll(scrollPosition);
 
     // Update GraphicsLayers and scroll state.
-    scrollingTreeNodeDidScroll(nodeID, scrollPosition, Nullopt, inUserInteration ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
+    scrollingTreeNodeDidScroll(nodeID, scrollPosition, std::nullopt, inUserInteration ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
 }
 
 void ScrollingTree::commitTreeState(std::unique_ptr<ScrollingStateTree> scrollingStateTree)
diff --git a/Source/WebCore/page/scrolling/ScrollingTree.h b/Source/WebCore/page/scrolling/ScrollingTree.h
index 76ca7f6..6734b53 100644
--- a/Source/WebCore/page/scrolling/ScrollingTree.h
+++ b/Source/WebCore/page/scrolling/ScrollingTree.h
@@ -78,7 +78,7 @@
 
     // Called after a scrolling tree node has handled a scroll and updated its layers.
     // Updates FrameView/RenderLayer scrolling state and GraphicsLayers.
-    virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0;
+    virtual void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) = 0;
 
     // Called for requested scroll position updates.
     virtual void scrollingTreeNodeRequestsScroll(ScrollingNodeID, const FloatPoint& /*scrollPosition*/, bool /*representsProgrammaticScroll*/) { }
diff --git a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
index cc7e8ec..84029fb 100644
--- a/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
+++ b/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
@@ -111,7 +111,7 @@
 void ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints(const FloatPoint& scrollPosition)
 {
     setScrollLayerPosition(scrollPosition, { });
-    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, Nullopt);
+    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt);
 }
 
 FloatPoint ScrollingTreeScrollingNode::minimumScrollPosition() const
diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
index ab06dab..bcb48e4 100644
--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
@@ -92,7 +92,7 @@
     ScrollingTree::commitTreeState(WTFMove(scrollingStateTree));
 }
 
-void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void ThreadedScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     if (!m_scrollingCoordinator)
         return;
diff --git a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
index 7182da6..7325405 100644
--- a/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
+++ b/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
@@ -57,7 +57,7 @@
 protected:
     explicit ThreadedScrollingTree(AsyncScrollingCoordinator*);
 
-    void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override;
+    void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override;
     void currentSnapPointIndicesDidChange(ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
 #if PLATFORM(MAC)
     void handleWheelEventPhase(PlatformWheelEventPhase) override;
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
index 54bdaf9..7811317 100644
--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
@@ -109,13 +109,13 @@
 {
     if (shouldUpdateScrollLayerPositionSynchronously()) {
         m_probableMainThreadScrollPosition = scrollPosition;
-        scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, Nullopt, ScrollingLayerPositionAction::Set);
+        scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt, ScrollingLayerPositionAction::Set);
         return;
     }
 
     FloatRect layoutViewport; // FIXME: implement for iOS WK1.
     setScrollLayerPosition(scrollPosition, layoutViewport);
-    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, Nullopt);
+    scrollingTree().scrollingTreeNodeDidScroll(scrollingNodeID(), scrollPosition, std::nullopt);
 }
 
 void ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition(const FloatPoint& scrollPosition, const FloatRect&)
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp
index 8b10fb3..10b3f87 100644
--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp
+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.cpp
@@ -70,7 +70,7 @@
     });
 }
 
-void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void ScrollingTreeIOS::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     if (!m_scrollingCoordinator)
         return;
diff --git a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
index 2ee3171..1a9aae1 100644
--- a/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
+++ b/Source/WebCore/page/scrolling/ios/ScrollingTreeIOS.h
@@ -53,7 +53,7 @@
 
     PassRefPtr<ScrollingTreeNode> createScrollingTreeNode(ScrollingNodeType, ScrollingNodeID) override;
 
-    void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override;
+    void scrollingTreeNodeDidScroll(ScrollingNodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction = ScrollingLayerPositionAction::Sync) override;
 
     void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
 
diff --git a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
index bd37653..d9411b4 100644
--- a/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
+++ b/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
@@ -388,7 +388,7 @@
 {
     updateMainFramePinState(scrollPosition);
 
-    Optional<FloatPoint> layoutViewportOrigin;
+    std::optional<FloatPoint> layoutViewportOrigin;
     if (scrollingTree().visualViewportEnabled()) {
         FloatPoint visibleContentOrigin = scrollPosition;
         float counterScale = 1 / frameScaleFactor();
diff --git a/Source/WebCore/platform/DragImage.cpp b/Source/WebCore/platform/DragImage.cpp
index d121d23..aa566af 100644
--- a/Source/WebCore/platform/DragImage.cpp
+++ b/Source/WebCore/platform/DragImage.cpp
@@ -143,8 +143,8 @@
     const Frame& frame;
     RenderObject* startRenderer;
     RenderObject* endRenderer;
-    Optional<unsigned> startOffset;
-    Optional<unsigned> endOffset;
+    std::optional<unsigned> startOffset;
+    std::optional<unsigned> endOffset;
 };
 
 DragImageRef createDragImageForRange(Frame& frame, Range& range, bool forceBlackText)
diff --git a/Source/WebCore/platform/LinkIcon.h b/Source/WebCore/platform/LinkIcon.h
index fe823c4..032ccda 100644
--- a/Source/WebCore/platform/LinkIcon.h
+++ b/Source/WebCore/platform/LinkIcon.h
@@ -36,7 +36,7 @@
     URL url;
     LinkIconType type;
     String mimeType;
-    Optional<unsigned> size;
+    std::optional<unsigned> size;
 
     template<class Encoder> void encode(Encoder&) const;
     template<class Decoder> static bool decode(Decoder&, LinkIcon&);
diff --git a/Source/WebCore/platform/MemoryPressureHandler.h b/Source/WebCore/platform/MemoryPressureHandler.h
index ab1531b..fad5445 100644
--- a/Source/WebCore/platform/MemoryPressureHandler.h
+++ b/Source/WebCore/platform/MemoryPressureHandler.h
@@ -139,7 +139,7 @@
     private:
         void readAndNotify() const;
 
-        Optional<int> m_fd;
+        std::optional<int> m_fd;
         std::function<void ()> m_notifyHandler;
 #if USE(GLIB)
         GRefPtr<GSource> m_source;
@@ -164,8 +164,8 @@
     CFRunLoopObserverRef m_observer { nullptr };
     Lock m_observerMutex;
 #elif OS(LINUX)
-    Optional<int> m_eventFD;
-    Optional<int> m_pressureLevelFD;
+    std::optional<int> m_eventFD;
+    std::optional<int> m_pressureLevelFD;
     std::unique_ptr<EventFDPoller> m_eventFDPoller;
     RunLoop::Timer<MemoryPressureHandler> m_holdOffTimer;
     void holdOffTimerFired();
diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp
index b4aaf97..cbffe6e 100644
--- a/Source/WebCore/platform/ScrollView.cpp
+++ b/Source/WebCore/platform/ScrollView.cpp
@@ -454,8 +454,8 @@
     else if (m_deferredScrollOffsets)
         scrollOffsetChangedViaPlatformWidgetImpl(m_deferredScrollOffsets.value().first, m_deferredScrollOffsets.value().second);
     
-    m_deferredScrollDelta = Nullopt;
-    m_deferredScrollOffsets = Nullopt;
+    m_deferredScrollDelta = std::nullopt;
+    m_deferredScrollOffsets = std::nullopt;
 }
 
 void ScrollView::scrollTo(const ScrollPosition& newPosition)
diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h
index e5c1821..db570dd 100644
--- a/Source/WebCore/platform/ScrollView.h
+++ b/Source/WebCore/platform/ScrollView.h
@@ -462,8 +462,8 @@
     IntSize m_fixedLayoutSize;
     IntSize m_contentsSize;
 
-    Optional<IntSize> m_deferredScrollDelta; // Needed for WebKit scrolling
-    Optional<std::pair<ScrollOffset, ScrollOffset>> m_deferredScrollOffsets; // Needed for platform widget scrolling
+    std::optional<IntSize> m_deferredScrollDelta; // Needed for WebKit scrolling
+    std::optional<std::pair<ScrollOffset, ScrollOffset>> m_deferredScrollOffsets; // Needed for platform widget scrolling
 
     bool m_scrollbarsSuppressed;
 
diff --git a/Source/WebCore/platform/Theme.h b/Source/WebCore/platform/Theme.h
index 35863bc..5911978 100644
--- a/Source/WebCore/platform/Theme.h
+++ b/Source/WebCore/platform/Theme.h
@@ -84,7 +84,7 @@
     // Methods used to adjust the RenderStyles of controls.
     
     // The font description result should have a zoomed font size.
-    virtual Optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float /*zoomFactor*/) const { return Nullopt; }
+    virtual std::optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float /*zoomFactor*/) const { return std::nullopt; }
     
     // The size here is in zoomed coordinates already. If a new size is returned, it also needs to be in zoomed coordinates.
     virtual LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize& zoomedSize, float /*zoomFactor*/) const { return zoomedSize; }
diff --git a/Source/WebCore/platform/Timer.h b/Source/WebCore/platform/Timer.h
index a35c8c6..52a166e 100644
--- a/Source/WebCore/platform/Timer.h
+++ b/Source/WebCore/platform/Timer.h
@@ -88,7 +88,7 @@
 private:
     virtual void fired() = 0;
 
-    virtual Optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const { return Nullopt; }
+    virtual std::optional<std::chrono::milliseconds> alignedFireTime(std::chrono::milliseconds) const { return std::nullopt; }
 
     void checkConsistency() const;
     void checkHeapIndex() const;
diff --git a/Source/WebCore/platform/URL.cpp b/Source/WebCore/platform/URL.cpp
index f261b84..726975a 100644
--- a/Source/WebCore/platform/URL.cpp
+++ b/Source/WebCore/platform/URL.cpp
@@ -714,10 +714,10 @@
     return m_string.substring(start, m_hostEnd - start);
 }
 
-Optional<uint16_t> URL::port() const
+std::optional<uint16_t> URL::port() const
 {
     if (!m_portEnd || m_hostEnd >= m_portEnd - 1)
-        return Nullopt;
+        return std::nullopt;
 
     bool ok = false;
     unsigned number;
@@ -726,7 +726,7 @@
     else
         number = charactersToUIntStrict(m_string.characters16() + m_hostEnd + 1, m_portEnd - m_hostEnd - 1, &ok);
     if (!ok || number > std::numeric_limits<uint16_t>::max())
-        return Nullopt;
+        return std::nullopt;
     return number;
 }
 
@@ -826,7 +826,7 @@
     defaultPortForProtocolMapForTesting().clear();
 }
 
-Optional<uint16_t> defaultPortForProtocol(StringView protocol)
+std::optional<uint16_t> defaultPortForProtocol(StringView protocol)
 {
     const auto& defaultPortForProtocolMap = defaultPortForProtocolMapForTesting();
     auto iterator = defaultPortForProtocolMap.find(protocol.toStringWithoutCopying());
@@ -2288,7 +2288,7 @@
 
 bool portAllowed(const URL& url)
 {
-    Optional<uint16_t> port = url.port();
+    std::optional<uint16_t> port = url.port();
 
     // Since most URLs don't have a port, return early for the "no port" case.
     if (!port)
diff --git a/Source/WebCore/platform/URL.h b/Source/WebCore/platform/URL.h
index 0c1b74b..0c30b6a 100644
--- a/Source/WebCore/platform/URL.h
+++ b/Source/WebCore/platform/URL.h
@@ -102,7 +102,7 @@
 
     WEBCORE_EXPORT StringView protocol() const;
     WEBCORE_EXPORT String host() const;
-    WEBCORE_EXPORT Optional<uint16_t> port() const;
+    WEBCORE_EXPORT std::optional<uint16_t> port() const;
     WEBCORE_EXPORT String hostAndPort() const;
     WEBCORE_EXPORT String user() const;
     WEBCORE_EXPORT String pass() const;
@@ -312,7 +312,7 @@
 WEBCORE_EXPORT bool protocolIsJavaScript(const String& url);
 WEBCORE_EXPORT bool protocolIsInHTTPFamily(const String& url);
 
-Optional<uint16_t> defaultPortForProtocol(StringView protocol);
+std::optional<uint16_t> defaultPortForProtocol(StringView protocol);
 WEBCORE_EXPORT bool isDefaultPortForProtocol(uint16_t port, StringView protocol);
 WEBCORE_EXPORT bool portAllowed(const URL&); // Blacklist ports that should never be used for Web resources.
 
diff --git a/Source/WebCore/platform/URLParser.cpp b/Source/WebCore/platform/URLParser.cpp
index e107caf..d7f5fab 100644
--- a/Source/WebCore/platform/URLParser.cpp
+++ b/Source/WebCore/platform/URLParser.cpp
@@ -623,7 +623,7 @@
     }
 }
 
-Optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme)
+std::optional<uint16_t> URLParser::defaultPortForProtocol(StringView scheme)
 {
     static const uint16_t ftpPort = 21;
     static const uint16_t gopherPort = 70;
@@ -634,19 +634,19 @@
     
     auto length = scheme.length();
     if (!length)
-        return Nullopt;
+        return std::nullopt;
     switch (scheme[0]) {
     case 'w':
         switch (length) {
         case 2:
             if (scheme[1] == 's')
                 return wsPort;
-            return Nullopt;
+            return std::nullopt;
         case 3:
             if (scheme[1] == 's'
                 && scheme[2] == 's')
                 return wssPort;
-            return Nullopt;
+            return std::nullopt;
         default:
             return false;
         }
@@ -657,16 +657,16 @@
                 && scheme[2] == 't'
                 && scheme[3] == 'p')
                 return httpPort;
-            return Nullopt;
+            return std::nullopt;
         case 5:
             if (scheme[1] == 't'
                 && scheme[2] == 't'
                 && scheme[3] == 'p'
                 && scheme[4] == 's')
                 return httpsPort;
-            return Nullopt;
+            return std::nullopt;
         default:
-            return Nullopt;
+            return std::nullopt;
         }
     case 'g':
         if (length == 6
@@ -676,15 +676,15 @@
             && scheme[4] == 'e'
             && scheme[5] == 'r')
             return gopherPort;
-        return Nullopt;
+        return std::nullopt;
     case 'f':
         if (length == 3
             && scheme[1] == 't'
             && scheme[2] == 'p')
             return ftpPort;
-        return Nullopt;
+        return std::nullopt;
     default:
-        return Nullopt;
+        return std::nullopt;
     }
 }
 
@@ -2055,9 +2055,9 @@
     return end - begin;
 }
 
-static Optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address)
+static std::optional<size_t> findLongestZeroSequence(const std::array<uint16_t, 8>& address)
 {
-    Optional<size_t> longest;
+    std::optional<size_t> longest;
     size_t longestLength = 0;
     for (size_t i = 0; i < 8; i++) {
         size_t length = zeroSequenceLength(address, i);
@@ -2114,7 +2114,7 @@
 }
 
 template<typename CharacterType>
-Optional<uint32_t> URLParser::parseIPv4Piece(CodePointIterator<CharacterType>& iterator, bool& didSeeSyntaxViolation)
+std::optional<uint32_t> URLParser::parseIPv4Piece(CodePointIterator<CharacterType>& iterator, bool& didSeeSyntaxViolation)
 {
     enum class State : uint8_t {
         UnknownBase,
@@ -2126,7 +2126,7 @@
     State state = State::UnknownBase;
     Checked<uint32_t, RecordOverflow> value = 0;
     if (!iterator.atEnd() && *iterator == '.')
-        return Nullopt;
+        return std::nullopt;
     while (!iterator.atEnd()) {
         if (isTabOrNewline(*iterator)) {
             didSeeSyntaxViolation = true;
@@ -2157,31 +2157,31 @@
             break;
         case State::Decimal:
             if (*iterator < '0' || *iterator > '9')
-                return Nullopt;
+                return std::nullopt;
             value *= 10;
             value += *iterator - '0';
             if (UNLIKELY(value.hasOverflowed()))
-                return Nullopt;
+                return std::nullopt;
             ++iterator;
             break;
         case State::Octal:
             ASSERT(didSeeSyntaxViolation);
             if (*iterator < '0' || *iterator > '7')
-                return Nullopt;
+                return std::nullopt;
             value *= 8;
             value += *iterator - '0';
             if (UNLIKELY(value.hasOverflowed()))
-                return Nullopt;
+                return std::nullopt;
             ++iterator;
             break;
         case State::Hex:
             ASSERT(didSeeSyntaxViolation);
             if (!isASCIIHexDigit(*iterator))
-                return Nullopt;
+                return std::nullopt;
             value *= 16;
             value += toASCIIHexValue(*iterator);
             if (UNLIKELY(value.hasOverflowed()))
-                return Nullopt;
+                return std::nullopt;
             ++iterator;
             break;
         }
@@ -2198,7 +2198,7 @@
 }
 
 template<typename CharacterType>
-Optional<URLParser::IPv4Address> URLParser::parseIPv4Host(CodePointIterator<CharacterType> iterator)
+std::optional<URLParser::IPv4Address> URLParser::parseIPv4Host(CodePointIterator<CharacterType> iterator)
 {
     auto hostBegin = iterator;
 
@@ -2212,30 +2212,30 @@
             continue;
         }
         if (items.size() >= 4)
-            return Nullopt;
+            return std::nullopt;
         if (auto item = parseIPv4Piece(iterator, didSeeSyntaxViolation))
             items.append(item.value());
         else
-            return Nullopt;
+            return std::nullopt;
         if (!iterator.atEnd()) {
             if (items.size() >= 4)
-                return Nullopt;
+                return std::nullopt;
             if (*iterator == '.')
                 ++iterator;
             else
-                return Nullopt;
+                return std::nullopt;
         }
     }
     if (!iterator.atEnd() || !items.size() || items.size() > 4)
-        return Nullopt;
+        return std::nullopt;
     if (items.size() > 1) {
         for (size_t i = 0; i < items.size() - 1; i++) {
             if (items[i] > 255)
-                return Nullopt;
+                return std::nullopt;
         }
     }
     if (items[items.size() - 1] >= pow256(5 - items.size()))
-        return Nullopt;
+        return std::nullopt;
 
     if (didSeeSyntaxViolation)
         syntaxViolation(hostBegin);
@@ -2254,27 +2254,27 @@
 }
 
 template<typename CharacterType>
-Optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator)
+std::optional<uint32_t> URLParser::parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>& iterator)
 {
     if (iterator.atEnd())
-        return Nullopt;
+        return std::nullopt;
     uint32_t piece = 0;
     bool leadingZeros = false;
     size_t digitCount = 0;
     while (!iterator.atEnd()) {
         if (!isASCIIDigit(*iterator))
-            return Nullopt;
+            return std::nullopt;
         ++digitCount;
         if (!piece && *iterator == '0') {
             if (leadingZeros)
-                return Nullopt;
+                return std::nullopt;
             leadingZeros = true;
         }
         if (!piece && *iterator == '0')
             leadingZeros = true;
         piece = piece * 10 + *iterator - '0';
         if (piece > 255)
-            return Nullopt;
+            return std::nullopt;
         advance<CharacterType, ReportSyntaxViolation::No>(iterator);
         if (iterator.atEnd())
             break;
@@ -2282,51 +2282,51 @@
             break;
     }
     if (piece && leadingZeros)
-        return Nullopt;
+        return std::nullopt;
     return piece;
 }
 
 template<typename CharacterType>
-Optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator)
+std::optional<URLParser::IPv4Address> URLParser::parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType> iterator)
 {
     IPv4Address address = 0;
     for (size_t i = 0; i < 4; ++i) {
-        if (Optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator))
+        if (std::optional<uint32_t> piece = parseIPv4PieceInsideIPv6(iterator))
             address = (address << 8) + piece.value();
         else
-            return Nullopt;
+            return std::nullopt;
         if (i < 3) {
             if (iterator.atEnd())
-                return Nullopt;
+                return std::nullopt;
             if (*iterator != '.')
-                return Nullopt;
+                return std::nullopt;
             advance<CharacterType, ReportSyntaxViolation::No>(iterator);
         } else if (!iterator.atEnd())
-            return Nullopt;
+            return std::nullopt;
     }
     ASSERT(iterator.atEnd());
     return address;
 }
 
 template<typename CharacterType>
-Optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c)
+std::optional<URLParser::IPv6Address> URLParser::parseIPv6Host(CodePointIterator<CharacterType> c)
 {
     ASSERT(*c == '[');
     auto hostBegin = c;
     advance(c, hostBegin);
     if (c.atEnd())
-        return Nullopt;
+        return std::nullopt;
 
     IPv6Address address = {{0, 0, 0, 0, 0, 0, 0, 0}};
     size_t piecePointer = 0;
-    Optional<size_t> compressPointer;
+    std::optional<size_t> compressPointer;
 
     if (*c == ':') {
         advance(c, hostBegin);
         if (c.atEnd())
-            return Nullopt;
+            return std::nullopt;
         if (*c != ':')
-            return Nullopt;
+            return std::nullopt;
         advance(c, hostBegin);
         ++piecePointer;
         compressPointer = piecePointer;
@@ -2334,19 +2334,19 @@
     
     while (!c.atEnd()) {
         if (piecePointer == 8)
-            return Nullopt;
+            return std::nullopt;
         if (*c == ':') {
             if (compressPointer)
-                return Nullopt;
+                return std::nullopt;
             advance(c, hostBegin);
             ++piecePointer;
             compressPointer = piecePointer;
             continue;
         }
         if (piecePointer == 6 || (compressPointer && piecePointer < 6)) {
-            if (Optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) {
+            if (std::optional<IPv4Address> ipv4Address = parseIPv4AddressInsideIPv6(c)) {
                 if (compressPointer && piecePointer == 5)
-                    return Nullopt;
+                    return std::nullopt;
                 syntaxViolation(hostBegin);
                 address[piecePointer++] = ipv4Address.value() >> 16;
                 address[piecePointer++] = ipv4Address.value() & 0xFFFF;
@@ -2377,12 +2377,12 @@
         if (c.atEnd())
             break;
         if (piecePointer == 8 || *c != ':')
-            return Nullopt;
+            return std::nullopt;
         advance(c, hostBegin);
     }
     
     if (!c.atEnd())
-        return Nullopt;
+        return std::nullopt;
     
     if (compressPointer) {
         size_t swaps = piecePointer - compressPointer.value();
@@ -2390,9 +2390,9 @@
         while (swaps)
             std::swap(address[piecePointer--], address[compressPointer.value() + swaps-- - 1]);
     } else if (piecePointer != 8)
-        return Nullopt;
+        return std::nullopt;
 
-    Optional<size_t> possibleCompressPointer = findLongestZeroSequence(address);
+    std::optional<size_t> possibleCompressPointer = findLongestZeroSequence(address);
     if (possibleCompressPointer)
         possibleCompressPointer.value()++;
     if (UNLIKELY(compressPointer != possibleCompressPointer))
@@ -2453,7 +2453,7 @@
 }
 
 template<typename CharacterType>
-Optional<Vector<LChar, URLParser::defaultInlineBufferSize>> URLParser::domainToASCII(const String& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
+std::optional<Vector<LChar, URLParser::defaultInlineBufferSize>> URLParser::domainToASCII(const String& domain, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition)
 {
     Vector<LChar, defaultInlineBufferSize> ascii;
     if (containsOnlyASCII(domain)) {
@@ -2496,7 +2496,7 @@
     }
 
     // FIXME: Check for U_BUFFER_OVERFLOW_ERROR and retry with an allocated buffer.
-    return Nullopt;
+    return std::nullopt;
 }
 
 bool URLParser::hasInvalidDomainCharacter(const Vector<LChar, URLParser::defaultInlineBufferSize>& asciiDomain)
@@ -2690,11 +2690,11 @@
     return true;
 }
 
-Optional<String> URLParser::formURLDecode(StringView input)
+std::optional<String> URLParser::formURLDecode(StringView input)
 {
     auto utf8 = input.utf8(StrictConversion);
     if (utf8.isNull())
-        return Nullopt;
+        return std::nullopt;
     auto percentDecoded = percentDecode(reinterpret_cast<const LChar*>(utf8.data()), utf8.length());
     return String::fromUTF8(percentDecoded.data(), percentDecoded.size());
 }
diff --git a/Source/WebCore/platform/URLParser.h b/Source/WebCore/platform/URLParser.h
index bb5e92b..864eacd 100644
--- a/Source/WebCore/platform/URLParser.h
+++ b/Source/WebCore/platform/URLParser.h
@@ -53,8 +53,8 @@
     static const UIDNA& internationalDomainNameTranscoder();
 
 private:
-    static Optional<uint16_t> defaultPortForProtocol(StringView);
-    friend Optional<uint16_t> defaultPortForProtocol(StringView);
+    static std::optional<uint16_t> defaultPortForProtocol(StringView);
+    friend std::optional<uint16_t> defaultPortForProtocol(StringView);
 
     URL m_url;
     Vector<LChar> m_asciiBuffer;
@@ -94,10 +94,10 @@
     template<typename UnsignedIntegerType> void appendNumberToASCIIBuffer(UnsignedIntegerType);
     template<bool(*isInCodeSet)(UChar32), typename CharacterType> void utf8PercentEncode(const CodePointIterator<CharacterType>&);
     template<typename CharacterType> void utf8QueryEncode(const CodePointIterator<CharacterType>&);
-    template<typename CharacterType> Optional<Vector<LChar, defaultInlineBufferSize>> domainToASCII(const String&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
+    template<typename CharacterType> std::optional<Vector<LChar, defaultInlineBufferSize>> domainToASCII(const String&, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
     template<typename CharacterType> Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t, const CodePointIterator<CharacterType>& iteratorForSyntaxViolationPosition);
     static Vector<LChar, defaultInlineBufferSize> percentDecode(const LChar*, size_t);
-    static Optional<String> formURLDecode(StringView input);
+    static std::optional<String> formURLDecode(StringView input);
     static bool hasInvalidDomainCharacter(const Vector<LChar, defaultInlineBufferSize>&);
     void percentEncodeByte(uint8_t);
     void appendToASCIIBuffer(UChar32);
@@ -110,12 +110,12 @@
 
     using IPv4Address = uint32_t;
     void serializeIPv4(IPv4Address);
-    template<typename CharacterType> Optional<IPv4Address> parseIPv4Host(CodePointIterator<CharacterType>);
-    template<typename CharacterType> Optional<uint32_t> parseIPv4Piece(CodePointIterator<CharacterType>&, bool& syntaxViolation);
+    template<typename CharacterType> std::optional<IPv4Address> parseIPv4Host(CodePointIterator<CharacterType>);
+    template<typename CharacterType> std::optional<uint32_t> parseIPv4Piece(CodePointIterator<CharacterType>&, bool& syntaxViolation);
     using IPv6Address = std::array<uint16_t, 8>;
-    template<typename CharacterType> Optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>);
-    template<typename CharacterType> Optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&);
-    template<typename CharacterType> Optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>);
+    template<typename CharacterType> std::optional<IPv6Address> parseIPv6Host(CodePointIterator<CharacterType>);
+    template<typename CharacterType> std::optional<uint32_t> parseIPv4PieceInsideIPv6(CodePointIterator<CharacterType>&);
+    template<typename CharacterType> std::optional<IPv4Address> parseIPv4AddressInsideIPv6(CodePointIterator<CharacterType>);
     void serializeIPv6Piece(uint16_t piece);
     void serializeIPv6(IPv6Address);
 
diff --git a/Source/WebCore/platform/graphics/BitmapImage.h b/Source/WebCore/platform/graphics/BitmapImage.h
index 89032dc..e023cb8 100644
--- a/Source/WebCore/platform/graphics/BitmapImage.h
+++ b/Source/WebCore/platform/graphics/BitmapImage.h
@@ -74,7 +74,7 @@
     size_t frameCount() const { return m_source.frameCount(); }
     RepetitionCount repetitionCount() const { return m_source.repetitionCount(); }
     String filenameExtension() const override { return m_source.filenameExtension(); }
-    Optional<IntPoint> hotSpot() const override { return m_source.hotSpot(); }
+    std::optional<IntPoint> hotSpot() const override { return m_source.hotSpot(); }
 
     // FloatSize due to override.
     FloatSize size() const override { return m_source.size(); }
diff --git a/Source/WebCore/platform/graphics/Color.h b/Source/WebCore/platform/graphics/Color.h
index e994ba9..2968796 100644
--- a/Source/WebCore/platform/graphics/Color.h
+++ b/Source/WebCore/platform/graphics/Color.h
@@ -69,7 +69,7 @@
 RGBA32 makeUnPremultipliedRGBA(int r, int g, int b, int a);
 
 WEBCORE_EXPORT RGBA32 colorWithOverrideAlpha(RGBA32 color, float overrideAlpha);
-RGBA32 colorWithOverrideAlpha(RGBA32 color, Optional<float> overrideAlpha);
+RGBA32 colorWithOverrideAlpha(RGBA32 color, std::optional<float> overrideAlpha);
 
 WEBCORE_EXPORT RGBA32 makeRGBA32FromFloats(float r, float g, float b, float a);
 RGBA32 makeRGBAFromHSLA(double h, double s, double l, double a);
@@ -404,7 +404,7 @@
     return approximation + (remainder >> 8);
 }
 
-inline RGBA32 colorWithOverrideAlpha(RGBA32 color, Optional<float> overrideAlpha)
+inline RGBA32 colorWithOverrideAlpha(RGBA32 color, std::optional<float> overrideAlpha)
 {
     return overrideAlpha ? colorWithOverrideAlpha(color, overrideAlpha.value()) : color;
 }
diff --git a/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h b/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h
index c669dcb..8fa114c 100644
--- a/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h
+++ b/Source/WebCore/platform/graphics/DisplayRefreshMonitorClient.h
@@ -56,7 +56,7 @@
 
 private:
     bool m_scheduled { false };
-    Optional<PlatformDisplayID> m_displayID;
+    std::optional<PlatformDisplayID> m_displayID;
 };
 
 }
diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h
index 2b914ee..5374e72 100644
--- a/Source/WebCore/platform/graphics/Font.h
+++ b/Source/WebCore/platform/graphics/Font.h
@@ -284,10 +284,10 @@
 #if PLATFORM(COCOA)
     mutable RetainPtr<CFDictionaryRef> m_nonKernedCFStringAttributes;
     mutable RetainPtr<CFDictionaryRef> m_kernedCFStringAttributes;
-    mutable Optional<BitVector> m_glyphsSupportedBySmallCaps;
-    mutable Optional<BitVector> m_glyphsSupportedByAllSmallCaps;
-    mutable Optional<BitVector> m_glyphsSupportedByPetiteCaps;
-    mutable Optional<BitVector> m_glyphsSupportedByAllPetiteCaps;
+    mutable std::optional<BitVector> m_glyphsSupportedBySmallCaps;
+    mutable std::optional<BitVector> m_glyphsSupportedByAllSmallCaps;
+    mutable std::optional<BitVector> m_glyphsSupportedByPetiteCaps;
+    mutable std::optional<BitVector> m_glyphsSupportedByAllPetiteCaps;
 #endif
 
 #if PLATFORM(COCOA) || USE(HARFBUZZ)
diff --git a/Source/WebCore/platform/graphics/FontCascade.cpp b/Source/WebCore/platform/graphics/FontCascade.cpp
index ae97518..7e68311 100644
--- a/Source/WebCore/platform/graphics/FontCascade.cpp
+++ b/Source/WebCore/platform/graphics/FontCascade.cpp
@@ -301,7 +301,7 @@
     return getGlyphsAndAdvancesForComplexText(run, from, to, glyphBuffer);
 }
 
-float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, unsigned from, Optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const
+float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, unsigned from, std::optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const
 {
     // Don't draw anything while we are using custom fonts that are in the process of loading,
     // except if the 'force' argument is set to true (in which case it will use a fallback
@@ -309,7 +309,7 @@
     if (isLoadingCustomFonts() && customFontNotReadyAction == DoNotPaintIfFontNotReady)
         return 0;
 
-    unsigned destination = to.valueOr(run.length());
+    unsigned destination = to.value_or(run.length());
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
@@ -327,12 +327,12 @@
     return startPoint.x() - startX;
 }
 
-void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, Optional<unsigned> to) const
+void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, std::optional<unsigned> to) const
 {
     if (isLoadingCustomFonts())
         return;
 
-    unsigned destination = to.valueOr(run.length());
+    unsigned destination = to.value_or(run.length());
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
@@ -490,9 +490,9 @@
     return success;
 }
 
-void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, Optional<unsigned> to) const
+void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, std::optional<unsigned> to) const
 {
-    unsigned destination = to.valueOr(run.length());
+    unsigned destination = to.value_or(run.length());
 
     CodePath codePathToUse = codePath(run);
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
@@ -1179,27 +1179,27 @@
 
 // FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
 // standard emphasis marks do so.
-Optional<GlyphData> FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark) const
+std::optional<GlyphData> FontCascade::getEmphasisMarkGlyphData(const AtomicString& mark) const
 {
     if (mark.isEmpty())
-        return Nullopt;
+        return std::nullopt;
 
     UChar32 character;
     if (!mark.is8Bit()) {
         SurrogatePairAwareTextIterator iterator(mark.characters16(), 0, mark.length(), mark.length());
         unsigned clusterLength;
         if (!iterator.consume(character, clusterLength))
-            return Nullopt;
+            return std::nullopt;
     } else
         character = mark[0];
 
-    Optional<GlyphData> glyphData(glyphDataForCharacter(character, false, EmphasisMarkVariant));
-    return glyphData.value().isValid() ? glyphData : Nullopt;
+    std::optional<GlyphData> glyphData(glyphDataForCharacter(character, false, EmphasisMarkVariant));
+    return glyphData.value().isValid() ? glyphData : std::nullopt;
 }
 
 int FontCascade::emphasisMarkAscent(const AtomicString& mark) const
 {
-    Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
+    std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
     if (!markGlyphData)
         return 0;
 
@@ -1213,7 +1213,7 @@
 
 int FontCascade::emphasisMarkDescent(const AtomicString& mark) const
 {
-    Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
+    std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
     if (!markGlyphData)
         return 0;
 
@@ -1227,7 +1227,7 @@
 
 int FontCascade::emphasisMarkHeight(const AtomicString& mark) const
 {
-    Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
+    std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
     if (!markGlyphData)
         return 0;
 
@@ -1329,7 +1329,7 @@
 
 void FontCascade::drawEmphasisMarks(GraphicsContext& context, const GlyphBuffer& glyphBuffer, const AtomicString& mark, const FloatPoint& point) const
 {
-    Optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
+    std::optional<GlyphData> markGlyphData = getEmphasisMarkGlyphData(mark);
     if (!markGlyphData)
         return;
 
diff --git a/Source/WebCore/platform/graphics/FontCascade.h b/Source/WebCore/platform/graphics/FontCascade.h
index a463e37..32dec2f 100644
--- a/Source/WebCore/platform/graphics/FontCascade.h
+++ b/Source/WebCore/platform/graphics/FontCascade.h
@@ -132,9 +132,9 @@
     void update(RefPtr<FontSelector>&&) const;
 
     enum CustomFontNotReadyAction { DoNotPaintIfFontNotReady, UseFallbackIfFontNotReady };
-    WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = Nullopt, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
+    WEBCORE_EXPORT float drawText(GraphicsContext&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt, CustomFontNotReadyAction = DoNotPaintIfFontNotReady) const;
     static void drawGlyphs(GraphicsContext&, const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&, FontSmoothingMode);
-    void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = Nullopt) const;
+    void drawEmphasisMarks(GraphicsContext&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt) const;
 
     DashArray dashesForIntersectionsWithRect(const TextRun&, const FloatPoint& textOrigin, const FloatRect& lineExtents) const;
 
@@ -144,7 +144,7 @@
     static float width(TextLayout&, unsigned from, unsigned len, HashSet<const Font*>* fallbackFonts = 0);
 
     int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const;
-    void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, unsigned from = 0, Optional<unsigned> to = Nullopt) const;
+    void adjustSelectionRectForText(const TextRun&, LayoutRect& selectionRect, unsigned from = 0, std::optional<unsigned> to = std::nullopt) const;
 
     bool isSmallCaps() const { return m_fontDescription.variantCaps() == FontVariantCaps::Small; }
 
@@ -227,7 +227,7 @@
     int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const;
     void adjustSelectionRectForSimpleText(const TextRun&, LayoutRect& selectionRect, unsigned from, unsigned to) const;
 
-    Optional<GlyphData> getEmphasisMarkGlyphData(const AtomicString&) const;
+    std::optional<GlyphData> getEmphasisMarkGlyphData(const AtomicString&) const;
 
     static bool canReturnFallbackFontsForComplexText();
     static bool canExpandAroundIdeographsInComplexText();
diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp
index c773442..1bf59c3 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp
@@ -637,7 +637,7 @@
     --m_transparencyCount;
 }
 
-float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, unsigned from, Optional<unsigned> to)
+float GraphicsContext::drawText(const FontCascade& font, const TextRun& run, const FloatPoint& point, unsigned from, std::optional<unsigned> to)
 {
     if (paintingDisabled())
         return 0;
@@ -659,7 +659,7 @@
     fontCascade.drawGlyphs(*this, font, buffer, from, numGlyphs, point, fontCascade.fontDescription().fontSmoothing());
 }
 
-void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, Optional<unsigned> to)
+void GraphicsContext::drawEmphasisMarks(const FontCascade& font, const TextRun& run, const AtomicString& mark, const FloatPoint& point, unsigned from, std::optional<unsigned> to)
 {
     if (paintingDisabled())
         return;
@@ -692,7 +692,7 @@
         subrun.setDirection(isRTL ? RTL : LTR);
         subrun.setDirectionalOverride(bidiRun->dirOverride(false));
 
-        float width = font.drawText(*this, subrun, currPoint, 0, Nullopt, customFontNotReadyAction);
+        float width = font.drawText(*this, subrun, currPoint, 0, std::nullopt, customFontNotReadyAction);
         currPoint.move(width, 0);
 
         bidiRun = bidiRun->next();
diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h
index 9a37d7c..82b9612 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext.h
+++ b/Source/WebCore/platform/graphics/GraphicsContext.h
@@ -387,9 +387,9 @@
     void setTextDrawingMode(TextDrawingModeFlags);
     TextDrawingModeFlags textDrawingMode() const { return m_state.textDrawingMode; }
 
-    float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = Nullopt);
+    float drawText(const FontCascade&, const TextRun&, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt);
     void drawGlyphs(const FontCascade&, const Font&, const GlyphBuffer&, unsigned from, unsigned numGlyphs, const FloatPoint&);
-    void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, Optional<unsigned> to = Nullopt);
+    void drawEmphasisMarks(const FontCascade&, const TextRun&, const AtomicString& mark, const FloatPoint&, unsigned from = 0, std::optional<unsigned> to = std::nullopt);
     void drawBidiText(const FontCascade&, const TextRun&, const FloatPoint&, FontCascade::CustomFontNotReadyAction = FontCascade::DoNotPaintIfFontNotReady);
 
     void applyState(const GraphicsContextState&);
@@ -698,7 +698,7 @@
             m_graphicsContext.setImageInterpolationQuality(interpolationQualityToUse);
     }
 
-    explicit InterpolationQualityMaintainer(GraphicsContext& graphicsContext, Optional<InterpolationQuality> interpolationQuality)
+    explicit InterpolationQualityMaintainer(GraphicsContext& graphicsContext, std::optional<InterpolationQuality> interpolationQuality)
         : InterpolationQualityMaintainer(graphicsContext, interpolationQuality ? interpolationQuality.value() : graphicsContext.imageInterpolationQuality())
     {
     }
diff --git a/Source/WebCore/platform/graphics/GraphicsLayer.h b/Source/WebCore/platform/graphics/GraphicsLayer.h
index 0c57d21..5831253 100644
--- a/Source/WebCore/platform/graphics/GraphicsLayer.h
+++ b/Source/WebCore/platform/graphics/GraphicsLayer.h
@@ -307,11 +307,11 @@
 
     // The position of the layer (the location of its top-left corner in its parent)
     const FloatPoint& position() const { return m_position; }
-    virtual void setPosition(const FloatPoint& p) { m_approximatePosition = Nullopt; m_position = p; }
+    virtual void setPosition(const FloatPoint& p) { m_approximatePosition = std::nullopt; m_position = p; }
 
     // approximatePosition, if set, overrides position() and is used during coverage rect computation.
     FloatPoint approximatePosition() const { return m_approximatePosition ? m_approximatePosition.value() : m_position; }
-    void setApproximatePosition(Optional<FloatPoint> p) { m_approximatePosition = p; }
+    void setApproximatePosition(std::optional<FloatPoint> p) { m_approximatePosition = p; }
 
     // For platforms that move underlying platform layers on a different thread for scrolling; just update the GraphicsLayer state.
     virtual void syncPosition(const FloatPoint& p) { m_position = p; }
@@ -602,7 +602,7 @@
     FloatPoint m_position;
 
     // If set, overrides m_position. Only used for coverage computation.
-    Optional<FloatPoint> m_approximatePosition;
+    std::optional<FloatPoint> m_approximatePosition;
 
     FloatPoint3D m_anchorPoint;
     FloatSize m_size;
diff --git a/Source/WebCore/platform/graphics/Image.h b/Source/WebCore/platform/graphics/Image.h
index 7bdab07..80b122b 100644
--- a/Source/WebCore/platform/graphics/Image.h
+++ b/Source/WebCore/platform/graphics/Image.h
@@ -108,7 +108,7 @@
     FloatRect rect() const { return FloatRect(FloatPoint(), size()); }
     float width() const { return size().width(); }
     float height() const { return size().height(); }
-    virtual Optional<IntPoint> hotSpot() const { return Nullopt; }
+    virtual std::optional<IntPoint> hotSpot() const { return std::nullopt; }
 
 #if PLATFORM(IOS)
     virtual FloatSize originalSize() const { return size(); }
diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h
index f0e65b8..397beee 100644
--- a/Source/WebCore/platform/graphics/ImageBuffer.h
+++ b/Source/WebCore/platform/graphics/ImageBuffer.h
@@ -111,7 +111,7 @@
     
     void convertToLuminanceMask();
     
-    String toDataURL(const String& mimeType, Optional<double> quality = Nullopt, CoordinateSystem = LogicalCoordinateSystem) const;
+    String toDataURL(const String& mimeType, std::optional<double> quality = std::nullopt, CoordinateSystem = LogicalCoordinateSystem) const;
 #if !USE(CG)
     AffineTransform baseTransform() const { return AffineTransform(); }
     void transformColorSpace(ColorSpace srcColorSpace, ColorSpace dstColorSpace);
@@ -180,7 +180,7 @@
 };
 
 #if USE(CG)
-String dataURL(const ImageData&, const String& mimeType, Optional<double> quality);
+String dataURL(const ImageData&, const String& mimeType, std::optional<double> quality);
 #endif
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/ImageFrameCache.cpp b/Source/WebCore/platform/graphics/ImageFrameCache.cpp
index 1c418e2..e78a537 100644
--- a/Source/WebCore/platform/graphics/ImageFrameCache.cpp
+++ b/Source/WebCore/platform/graphics/ImageFrameCache.cpp
@@ -335,12 +335,12 @@
 
 void ImageFrameCache::clearMetadata()
 {
-    m_frameCount = Nullopt;
-    m_singlePixelSolidColor = Nullopt;
+    m_frameCount = std::nullopt;
+    m_singlePixelSolidColor = std::nullopt;
 }
 
 template<typename T, T (ImageDecoder::*functor)() const>
-T ImageFrameCache::metadata(const T& defaultValue, Optional<T>* cachedValue)
+T ImageFrameCache::metadata(const T& defaultValue, std::optional<T>* cachedValue)
 {
     if (cachedValue && *cachedValue)
         return cachedValue->value();
@@ -357,7 +357,7 @@
 }
 
 template<typename T, T (ImageFrame::*functor)() const>
-T ImageFrameCache::frameMetadataAtIndex(size_t index, SubsamplingLevel subsamplingLevel, ImageFrame::Caching caching, Optional<T>* cachedValue)
+T ImageFrameCache::frameMetadataAtIndex(size_t index, SubsamplingLevel subsamplingLevel, ImageFrame::Caching caching, std::optional<T>* cachedValue)
 {
     if (cachedValue && *cachedValue)
         return cachedValue->value();
@@ -400,9 +400,9 @@
     return metadata<String, (&ImageDecoder::filenameExtension)>(String(), &m_filenameExtension);
 }
 
-Optional<IntPoint> ImageFrameCache::hotSpot()
+std::optional<IntPoint> ImageFrameCache::hotSpot()
 {
-    return metadata<Optional<IntPoint>, (&ImageDecoder::hotSpot)>(Nullopt, &m_hotSpot);
+    return metadata<std::optional<IntPoint>, (&ImageDecoder::hotSpot)>(std::nullopt, &m_hotSpot);
 }
 
 IntSize ImageFrameCache::size()
diff --git a/Source/WebCore/platform/graphics/ImageFrameCache.h b/Source/WebCore/platform/graphics/ImageFrameCache.h
index 6f905a1..32ee21e 100644
--- a/Source/WebCore/platform/graphics/ImageFrameCache.h
+++ b/Source/WebCore/platform/graphics/ImageFrameCache.h
@@ -78,7 +78,7 @@
     size_t frameCount();
     RepetitionCount repetitionCount();
     String filenameExtension();
-    Optional<IntPoint> hotSpot();
+    std::optional<IntPoint> hotSpot();
     
     // Image metadata which is calculated from the first ImageFrame.
     IntSize size();
@@ -106,10 +106,10 @@
     ImageFrameCache(NativeImagePtr&&);
 
     template<typename T, T (ImageDecoder::*functor)() const>
-    T metadata(const T& defaultValue, Optional<T>* cachedValue = nullptr);
+    T metadata(const T& defaultValue, std::optional<T>* cachedValue = nullptr);
 
     template<typename T, T (ImageFrame::*functor)() const>
-    T frameMetadataAtIndex(size_t index, SubsamplingLevel = SubsamplingLevel::Undefinded, ImageFrame::Caching = ImageFrame::Caching::Empty, Optional<T>* = nullptr);
+    T frameMetadataAtIndex(size_t index, SubsamplingLevel = SubsamplingLevel::Undefinded, ImageFrame::Caching = ImageFrame::Caching::Empty, std::optional<T>* = nullptr);
 
     bool isDecoderAvailable() const { return m_decoder; }
     void decodedSizeChanged(long long decodedSize);
@@ -153,16 +153,16 @@
     RefPtr<WorkQueue> m_decodingQueue;
 
     // Image metadata.
-    Optional<bool> m_isSizeAvailable;
-    Optional<size_t> m_frameCount;
-    Optional<RepetitionCount> m_repetitionCount;
-    Optional<String> m_filenameExtension;
-    Optional<Optional<IntPoint>> m_hotSpot;
+    std::optional<bool> m_isSizeAvailable;
+    std::optional<size_t> m_frameCount;
+    std::optional<RepetitionCount> m_repetitionCount;
+    std::optional<String> m_filenameExtension;
+    std::optional<std::optional<IntPoint>> m_hotSpot;
 
     // Image metadata which is calculated from the first ImageFrame.
-    Optional<IntSize> m_size;
-    Optional<IntSize> m_sizeRespectingOrientation;
-    Optional<Color> m_singlePixelSolidColor;
+    std::optional<IntSize> m_size;
+    std::optional<IntSize> m_sizeRespectingOrientation;
+    std::optional<Color> m_singlePixelSolidColor;
 };
     
 }
diff --git a/Source/WebCore/platform/graphics/ImageSource.h b/Source/WebCore/platform/graphics/ImageSource.h
index 3e24126..73818d9 100644
--- a/Source/WebCore/platform/graphics/ImageSource.h
+++ b/Source/WebCore/platform/graphics/ImageSource.h
@@ -74,7 +74,7 @@
     size_t frameCount() { return m_frameCache->frameCount(); }
     RepetitionCount repetitionCount() { return m_frameCache->repetitionCount(); }
     String filenameExtension() { return m_frameCache->filenameExtension(); }
-    Optional<IntPoint> hotSpot() { return m_frameCache->hotSpot(); }
+    std::optional<IntPoint> hotSpot() { return m_frameCache->hotSpot(); }
 
     // Image metadata which is calculated from the first ImageFrame.
     IntSize size() { return m_frameCache->size(); }
@@ -110,7 +110,7 @@
     Ref<ImageFrameCache> m_frameCache;
     std::unique_ptr<ImageDecoder> m_decoder;
 
-    Optional<SubsamplingLevel> m_maximumSubsamplingLevel;
+    std::optional<SubsamplingLevel> m_maximumSubsamplingLevel;
 
 #if PLATFORM(IOS)
     // FIXME: We should expose a setting to enable/disable progressive loading so that we can remove the PLATFORM(IOS)-guard.
diff --git a/Source/WebCore/platform/graphics/PathUtilities.cpp b/Source/WebCore/platform/graphics/PathUtilities.cpp
index 25fe433..a7d9071 100644
--- a/Source/WebCore/platform/graphics/PathUtilities.cpp
+++ b/Source/WebCore/platform/graphics/PathUtilities.cpp
@@ -462,13 +462,13 @@
     return radii;
 }
     
-static Optional<FloatRect> rectFromPolygon(const FloatPointGraph::Polygon& poly)
+static std::optional<FloatRect> rectFromPolygon(const FloatPointGraph::Polygon& poly)
 {
     if (poly.size() != 4)
-        return Optional<FloatRect>();
+        return std::optional<FloatRect>();
 
-    Optional<FloatPoint> topLeft;
-    Optional<FloatPoint> bottomRight;
+    std::optional<FloatPoint> topLeft;
+    std::optional<FloatPoint> bottomRight;
     for (unsigned i = 0; i < poly.size(); ++i) {
         const auto& toEdge = poly[i];
         const auto& fromEdge = (i > 0) ? poly[i - 1] : poly[poly.size() - 1];
@@ -482,7 +482,7 @@
         }
     }
     if (!topLeft || !bottomRight)
-        return Optional<FloatRect>();
+        return std::optional<FloatRect>();
     return FloatRect(topLeft.value(), bottomRight.value());
 }
 
@@ -516,7 +516,7 @@
         return Path();
     const auto& poly = polys.at(0);
     // Fast path when poly has one rect only.
-    Optional<FloatRect> rect = rectFromPolygon(poly);
+    std::optional<FloatRect> rect = rectFromPolygon(poly);
     if (rect)
         return roundedRect(rect.value());
 
diff --git a/Source/WebCore/platform/graphics/ShadowBlur.cpp b/Source/WebCore/platform/graphics/ShadowBlur.cpp
index 523b3af..329ca10 100644
--- a/Source/WebCore/platform/graphics/ShadowBlur.cpp
+++ b/Source/WebCore/platform/graphics/ShadowBlur.cpp
@@ -400,7 +400,7 @@
     if (m_shadowsIgnoreTransforms && !transform.isIdentity()) {
         FloatQuad transformedPolygon = transform.mapQuad(FloatQuad(shadowedRect));
         transformedPolygon.move(m_offset);
-        layerRect = transform.inverse().valueOr(AffineTransform()).mapQuad(transformedPolygon).boundingBox();
+        layerRect = transform.inverse().value_or(AffineTransform()).mapQuad(transformedPolygon).boundingBox();
     } else {
         layerRect = shadowedRect;
         layerRect.move(m_offset);
diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h
index 0d2b484..bb1d331 100644
--- a/Source/WebCore/platform/graphics/TiledBacking.h
+++ b/Source/WebCore/platform/graphics/TiledBacking.h
@@ -75,7 +75,7 @@
     virtual FloatRect visibleRect() const = 0;
 
     // Only used to update the tile coverage map. 
-    virtual void setLayoutViewportRect(Optional<FloatRect>) = 0;
+    virtual void setLayoutViewportRect(std::optional<FloatRect>) = 0;
 
     virtual void setCoverageRect(const FloatRect&) = 0;
     virtual FloatRect coverageRect() const = 0;
diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
index b759cd8..ac04609 100644
--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
@@ -2355,7 +2355,7 @@
     GraphicsContextStateSaver stateSaver(context);
     FloatRect imageRect(0, 0, CGImageGetWidth(m_lastImage.get()), CGImageGetHeight(m_lastImage.get()));
     AffineTransform videoTransform = [firstEnabledVideoTrack preferredTransform];
-    FloatRect transformedOutputRect = videoTransform.inverse().valueOr(AffineTransform()).mapRect(outputRect);
+    FloatRect transformedOutputRect = videoTransform.inverse().value_or(AffineTransform()).mapRect(outputRect);
 
     context.concatCTM(videoTransform);
     context.drawNativeImage(m_lastImage.get(), imageRect.size(), transformedOutputRect, imageRect);
diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
index 553de8f..064ef8f 100644
--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h
@@ -158,7 +158,7 @@
     SourceBufferPrivateClient* m_client;
     CDMSessionMediaSourceAVFObjC* m_session { nullptr };
 
-    Optional<FloatSize> m_cachedSize;
+    std::optional<FloatSize> m_cachedSize;
     FloatSize m_currentSize;
     bool m_parsingSucceeded;
     bool m_parserStateWasReset { false };
diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
index fc2eb8b..8a0243d 100644
--- a/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
+++ b/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
@@ -902,7 +902,7 @@
 void SourceBufferPrivateAVFObjC::flush(AVSampleBufferDisplayLayer *renderer)
 {
     [renderer flush];
-    m_cachedSize = Nullopt;
+    m_cachedSize = std::nullopt;
 
     if (m_mediaSource) {
         m_mediaSource->player()->setHasAvailableVideoFrame(false);
@@ -1001,7 +1001,7 @@
 
 FloatSize SourceBufferPrivateAVFObjC::naturalSize()
 {
-    return m_cachedSize.valueOr(FloatSize());
+    return m_cachedSize.value_or(FloatSize());
 }
 
 void SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples(int trackID)
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index 53d80e2..f794898 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -1274,7 +1274,7 @@
     }
 
     FloatRect coverageRect = clipRectForSelf;
-    Optional<FloatQuad> quad = state.mappedSecondaryQuad(&mapWasClamped);
+    std::optional<FloatQuad> quad = state.mappedSecondaryQuad(&mapWasClamped);
     if (quad && !mapWasClamped && !applyWasClamped)
         coverageRect = (*quad).boundingBox();
 
diff --git a/Source/WebCore/platform/graphics/ca/TileController.cpp b/Source/WebCore/platform/graphics/ca/TileController.cpp
index 4132b04..38a4d28 100644
--- a/Source/WebCore/platform/graphics/ca/TileController.cpp
+++ b/Source/WebCore/platform/graphics/ca/TileController.cpp
@@ -190,7 +190,7 @@
     updateTileCoverageMap();
 }
 
-void TileController::setLayoutViewportRect(Optional<FloatRect> rect)
+void TileController::setLayoutViewportRect(std::optional<FloatRect> rect)
 {
     if (rect == m_layoutViewportRect)
         return;
diff --git a/Source/WebCore/platform/graphics/ca/TileController.h b/Source/WebCore/platform/graphics/ca/TileController.h
index c3ee41e..8c84c7c 100644
--- a/Source/WebCore/platform/graphics/ca/TileController.h
+++ b/Source/WebCore/platform/graphics/ca/TileController.h
@@ -82,7 +82,7 @@
 
     FloatRect visibleRect() const override { return m_visibleRect; }
     FloatRect coverageRect() const override { return m_coverageRect; }
-    Optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; }
+    std::optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; }
 
     unsigned blankPixelCount() const;
     static unsigned blankPixelCountForTiles(const PlatformLayerList&, const FloatRect&, const IntPoint&);
@@ -141,7 +141,7 @@
 
     // TiledBacking member functions.
     void setVisibleRect(const FloatRect&) override;
-    void setLayoutViewportRect(Optional<FloatRect>) override;
+    void setLayoutViewportRect(std::optional<FloatRect>) override;
     void setCoverageRect(const FloatRect&) override;
     bool tilesWouldChangeForCoverageRect(const FloatRect&) const override;
     void setTiledScrollingIndicatorPosition(const FloatPoint&) override;
@@ -192,7 +192,7 @@
     std::unique_ptr<TileGrid> m_zoomedOutTileGrid;
 
     FloatRect m_visibleRect; // Only used for scroll performance logging.
-    Optional<FloatRect> m_layoutViewportRect; // Only used by the tiled scrolling indicator.
+    std::optional<FloatRect> m_layoutViewportRect; // Only used by the tiled scrolling indicator.
     FloatRect m_coverageRect;
     IntRect m_boundsAtLastRevalidate;
 
diff --git a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
index cfc66fa..0b0e695 100644
--- a/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
+++ b/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
@@ -543,7 +543,7 @@
     return cairo_surface_write_to_png_stream(image, writeFunction, output) == CAIRO_STATUS_SUCCESS;
 }
 
-String ImageBuffer::toDataURL(const String& mimeType, Optional<double>, CoordinateSystem) const
+String ImageBuffer::toDataURL(const String& mimeType, std::optional<double>, CoordinateSystem) const
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
diff --git a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
index 4587562..f6c544c 100644
--- a/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
@@ -458,7 +458,7 @@
 #endif
 }
 
-static bool encodeImage(CGImageRef image, CFStringRef uti, Optional<double> quality, CFMutableDataRef data)
+static bool encodeImage(CGImageRef image, CFStringRef uti, std::optional<double> quality, CFMutableDataRef data)
 {
     if (!image || !uti || !data)
         return false;
@@ -483,7 +483,7 @@
     return CGImageDestinationFinalize(destination.get());
 }
 
-static String dataURL(CGImageRef image, const String& mimeType, Optional<double> quality)
+static String dataURL(CGImageRef image, const String& mimeType, std::optional<double> quality)
 {
     auto uti = utiFromMIMEType(mimeType);
     ASSERT(uti);
@@ -498,7 +498,7 @@
     return "data:" + mimeType + ";base64," + base64Data;
 }
 
-String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, CoordinateSystem) const
+String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, CoordinateSystem) const
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
@@ -539,7 +539,7 @@
     return dataURL(image.get(), mimeType, quality);
 }
 
-String dataURL(const ImageData& source, const String& mimeType, Optional<double> quality)
+String dataURL(const ImageData& source, const String& mimeType, std::optional<double> quality)
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
diff --git a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
index b29031e..dd28a4a 100644
--- a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.cpp
@@ -203,23 +203,23 @@
     return RepetitionCountNone;
 }
 
-Optional<IntPoint> ImageDecoder::hotSpot() const
+std::optional<IntPoint> ImageDecoder::hotSpot() const
 {
     RetainPtr<CFDictionaryRef> properties = adoptCF(CGImageSourceCopyPropertiesAtIndex(m_nativeDecoder.get(), 0, imageSourceOptions().get()));
     if (!properties)
-        return Nullopt;
+        return std::nullopt;
     
     int x = -1, y = -1;
     CFNumberRef num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR("hotspotX"));
     if (!num || !CFNumberGetValue(num, kCFNumberIntType, &x))
-        return Nullopt;
+        return std::nullopt;
     
     num = (CFNumberRef)CFDictionaryGetValue(properties.get(), CFSTR("hotspotY"));
     if (!num || !CFNumberGetValue(num, kCFNumberIntType, &y))
-        return Nullopt;
+        return std::nullopt;
     
     if (x < 0 || y < 0)
-        return Nullopt;
+        return std::nullopt;
     
     return IntPoint(x, y);
 }
diff --git a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h
index 6bc2368..4e0f675 100644
--- a/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h
+++ b/Source/WebCore/platform/graphics/cg/ImageDecoderCG.h
@@ -51,7 +51,7 @@
     size_t frameCount() const;
     RepetitionCount repetitionCount() const;
     String filenameExtension() const;
-    Optional<IntPoint> hotSpot() const;
+    std::optional<IntPoint> hotSpot() const;
 
     IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const;
     bool frameIsCompleteAtIndex(size_t) const;
diff --git a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
index 5102c21..9c186cd 100644
--- a/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
+++ b/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm
@@ -404,7 +404,7 @@
     return CFDictionaryContainsKey(feature, kCTFontFeatureTypeIdentifierKey) && CFDictionaryContainsKey(feature, kCTFontFeatureSelectorIdentifierKey);
 }
 
-static inline Optional<CFStringRef> openTypeFeature(CFDictionaryRef feature)
+static inline std::optional<CFStringRef> openTypeFeature(CFDictionaryRef feature)
 {
     ASSERT(isOpenTypeFeature(feature));
     CFStringRef tag = static_cast<CFStringRef>(CFDictionaryGetValue(feature, kCTFontOpenTypeFeatureTag));
@@ -412,7 +412,7 @@
     CFNumberRef value = static_cast<CFNumberRef>(CFDictionaryGetValue(feature, kCTFontOpenTypeFeatureValue));
     auto success = CFNumberGetValue(value, kCFNumberIntType, &rawValue);
     ASSERT_UNUSED(success, success);
-    return rawValue ? Optional<CFStringRef>(tag) : Nullopt;
+    return rawValue ? std::optional<CFStringRef>(tag) : std::nullopt;
 }
 
 static inline std::pair<int, int> trueTypeFeature(CFDictionaryRef feature)
@@ -592,11 +592,11 @@
 }
 
 #if !((PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000))
-static inline Optional<CGSize> advanceForColorBitmapFont(const FontPlatformData& platformData, Glyph glyph)
+static inline std::optional<CGSize> advanceForColorBitmapFont(const FontPlatformData& platformData, Glyph glyph)
 {
     CTFontRef font = platformData.font();
     if (!font || !platformData.isColorBitmapFont())
-        return Nullopt;
+        return std::nullopt;
     CGSize advance;
     CTFontGetAdvancesForGlyphs(font, kCTFontOrientationDefault, &glyph, &advance, 1);
     return advance;
diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
index 4af1826..0fca123 100644
--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
@@ -395,7 +395,7 @@
     }
 }
 
-Optional<FloatRect> DrawGlyphs::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawGlyphs::localBounds(const GraphicsContext&) const
 {
     FloatRect localBounds = m_bounds;
     localBounds.move(m_blockLocation.x(), m_blockLocation.y());
@@ -575,7 +575,7 @@
     return ts;
 }
 
-Optional<FloatRect> DrawLine::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawLine::localBounds(const GraphicsContext&) const
 {
     FloatRect bounds;
     bounds.fitToPoints(m_point1, m_point2);
@@ -600,7 +600,7 @@
     context.drawLinesForText(point(), m_widths, m_printing, m_doubleLines);
 }
 
-Optional<FloatRect> DrawLinesForText::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawLinesForText::localBounds(const GraphicsContext&) const
 {
     // This function needs to return a value equal to or enclosing what GraphicsContext::computeLineBoundsAndAntialiasingModeForText() returns.
 
@@ -630,7 +630,7 @@
     context.drawLineForDocumentMarker(m_point, m_width, m_style);
 }
 
-Optional<FloatRect> DrawLineForDocumentMarker::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawLineForDocumentMarker::localBounds(const GraphicsContext&) const
 {
     // This function needs to return a value equal to or enclosing what GraphicsContext::drawLineForDocumentMarker() returns.
 
@@ -679,7 +679,7 @@
     context.drawFocusRing(m_path, m_width, m_offset, m_color);
 }
 
-Optional<FloatRect> DrawFocusRingPath::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawFocusRingPath::localBounds(const GraphicsContext&) const
 {
     FloatRect result = m_path.fastBoundingRect();
     result.inflate(platformFocusRingWidth);
@@ -701,7 +701,7 @@
     context.drawFocusRing(m_rects, m_width, m_offset, m_color);
 }
 
-Optional<FloatRect> DrawFocusRingRects::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> DrawFocusRingRects::localBounds(const GraphicsContext&) const
 {
     FloatRect result;
     for (auto& rect : m_rects)
@@ -825,7 +825,7 @@
     return ts;
 }
 
-Optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const
+std::optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const
 {
     FloatRect bounds = m_rect;
     bounds.expand(m_lineWidth, m_lineWidth);
@@ -845,7 +845,7 @@
     return ts;
 }
 
-Optional<FloatRect> StrokePath::localBounds(const GraphicsContext& context) const
+std::optional<FloatRect> StrokePath::localBounds(const GraphicsContext& context) const
 {
     // FIXME: Need to take stroke thickness into account correctly, via CGPathByStrokingPath().
     float strokeThickness = context.strokeThickness();
@@ -867,7 +867,7 @@
     return ts;
 }
 
-Optional<FloatRect> StrokeEllipse::localBounds(const GraphicsContext& context) const
+std::optional<FloatRect> StrokeEllipse::localBounds(const GraphicsContext& context) const
 {
     float strokeThickness = context.strokeThickness();
 
diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
index a71e314..a70fd6d 100644
--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
@@ -172,12 +172,12 @@
 
     // Return bounds of this drawing operation in local coordinates.
     // Does not include effets of transform, shadow etc in the state.
-    virtual Optional<FloatRect> localBounds(const GraphicsContext&) const { return Nullopt; }
+    virtual std::optional<FloatRect> localBounds(const GraphicsContext&) const { return std::nullopt; }
 
 private:
     virtual bool isDrawingItem() const { return true; }
 
-    Optional<FloatRect> m_extent; // In base coordinates, taking shadows and transforms into account.
+    std::optional<FloatRect> m_extent; // In base coordinates, taking shadows and transforms into account.
 };
 
 class Save : public Item {
@@ -543,7 +543,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     GlyphBuffer generateGlyphBuffer() const;
 
@@ -572,7 +572,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
 
     mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable.
     FloatRect m_destination;
@@ -599,7 +599,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
 
     mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable.
     FloatRect m_destination;
@@ -625,7 +625,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
 
     mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable.
     FloatRect m_destination;
@@ -652,7 +652,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
 
 #if USE(CG)
     RetainPtr<CGImageRef> m_image;
@@ -687,7 +687,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_destination; }
 
     mutable Ref<Image> m_image; // FIXME: Drawing images can cause their animations to progress. This shouldn't have to be mutable.
     AffineTransform m_patternTransform;
@@ -756,7 +756,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
     float m_borderThickness;
@@ -781,7 +781,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     FloatPoint m_point1;
     FloatPoint m_point2;
@@ -816,7 +816,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     FloatPoint m_blockLocation;
     FloatSize m_localAnchor;
@@ -847,7 +847,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     FloatPoint m_point;
     float m_width;
@@ -871,7 +871,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
 };
@@ -894,7 +894,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); }
 
     const Path m_path;
 };
@@ -923,7 +923,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     const Path m_path;
     int m_width;
@@ -955,7 +955,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     Vector<FloatRect> m_rects;
     int m_width;
@@ -980,7 +980,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
 };
@@ -1005,7 +1005,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
     Color m_color;
@@ -1029,7 +1029,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
     mutable Ref<Gradient> m_gradient; // FIXME: Make this not mutable
@@ -1058,7 +1058,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
     Color m_color;
@@ -1087,7 +1087,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect.rect(); }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect.rect(); }
 
     FloatRoundedRect m_rect;
     Color m_color;
@@ -1115,7 +1115,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
     FloatRoundedRect m_roundedHoleRect;
@@ -1139,7 +1139,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_path.fastBoundingRect(); }
 
     const Path m_path;
 };
@@ -1162,7 +1162,7 @@
 
     void apply(GraphicsContext&) const override;
 
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
 };
@@ -1186,7 +1186,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     FloatRect m_rect;
     float m_lineWidth;
@@ -1209,7 +1209,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     const Path m_path;
     FloatPoint m_blockLocation;
@@ -1232,7 +1232,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override;
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override;
 
     FloatRect m_rect;
 };
@@ -1254,7 +1254,7 @@
     }
 
     void apply(GraphicsContext&) const override;
-    Optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
+    std::optional<FloatRect> localBounds(const GraphicsContext&) const override { return m_rect; }
 
     FloatRect m_rect;
 };
diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
index c9c3c4d..6d68533 100644
--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp
@@ -374,7 +374,7 @@
 
 void Recorder::updateItemExtent(DrawingItem& item) const
 {
-    if (Optional<FloatRect> rect = item.localBounds(m_graphicsContext))
+    if (std::optional<FloatRect> rect = item.localBounds(m_graphicsContext))
         item.setExtent(extentFromLocalBounds(rect.value()));
 }
 
@@ -443,7 +443,7 @@
     AffineTransform rotation;
     rotation.rotate(angleInDegrees);
 
-    if (Optional<AffineTransform> inverse = rotation.inverse())
+    if (std::optional<AffineTransform> inverse = rotation.inverse())
         clipBounds = inverse.value().mapRect(clipBounds);
 }
 
@@ -457,7 +457,7 @@
 {
     ctm *= matrix;
 
-    if (Optional<AffineTransform> inverse = matrix.inverse())
+    if (std::optional<AffineTransform> inverse = matrix.inverse())
         clipBounds = inverse.value().mapRect(clipBounds);
 }
 
diff --git a/Source/WebCore/platform/graphics/efl/ImageBufferEfl.cpp b/Source/WebCore/platform/graphics/efl/ImageBufferEfl.cpp
index 8a1c9e2..a112db4 100644
--- a/Source/WebCore/platform/graphics/efl/ImageBufferEfl.cpp
+++ b/Source/WebCore/platform/graphics/efl/ImageBufferEfl.cpp
@@ -47,12 +47,12 @@
     return cairo_surface_write_to_png_stream(image, writeFunction, output) == CAIRO_STATUS_SUCCESS;
 }
 
-static bool encodeImageJPEG(unsigned char* data, IntSize size, Vector<char>* output, Optional<double> quality)
+static bool encodeImageJPEG(unsigned char* data, IntSize size, Vector<char>* output, std::optional<double> quality)
 {    
     return compressRGBABigEndianToJPEG(data, size, *output, quality);
 }
 
-String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, CoordinateSystem) const
+String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, CoordinateSystem) const
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
diff --git a/Source/WebCore/platform/graphics/filters/Filter.h b/Source/WebCore/platform/graphics/filters/Filter.h
index 25a5dbb..3affd42 100644
--- a/Source/WebCore/platform/graphics/filters/Filter.h
+++ b/Source/WebCore/platform/graphics/filters/Filter.h
@@ -47,7 +47,7 @@
     void setFilterScale(float scale) { m_filterScale = scale; }
 
     const AffineTransform& absoluteTransform() const { return m_absoluteTransform; }
-    FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().valueOr(AffineTransform()).mapPoint(point); }
+    FloatPoint mapAbsolutePointToLocalPoint(const FloatPoint& point) const { return m_absoluteTransform.inverse().value_or(AffineTransform()).mapPoint(point); }
 
     RenderingMode renderingMode() const { return m_renderingMode; }
     void setRenderingMode(RenderingMode renderingMode) { m_renderingMode = renderingMode; }
diff --git a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
index 3bfa260..b2fe2a9 100644
--- a/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
+++ b/Source/WebCore/platform/graphics/gtk/ImageBufferGtk.cpp
@@ -32,7 +32,7 @@
 
 namespace WebCore {
 
-static bool encodeImage(cairo_surface_t* surface, const String& mimeType, Optional<double> quality, GUniqueOutPtr<gchar>& buffer, gsize& bufferSize)
+static bool encodeImage(cairo_surface_t* surface, const String& mimeType, std::optional<double> quality, GUniqueOutPtr<gchar>& buffer, gsize& bufferSize)
 {
     // List of supported image encoding types comes from the GdkPixbuf documentation.
     // http://developer.gnome.org/gdk-pixbuf/stable/gdk-pixbuf-File-saving.html#gdk-pixbuf-save-to-bufferv
@@ -75,7 +75,7 @@
     return !error;
 }
 
-String ImageBuffer::toDataURL(const String& mimeType, Optional<double> quality, CoordinateSystem) const
+String ImageBuffer::toDataURL(const String& mimeType, std::optional<double> quality, CoordinateSystem) const
 {
     ASSERT(MIMETypeRegistry::isSupportedImageMIMETypeForEncoding(mimeType));
 
diff --git a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
index 4d6dd16..9e6f448 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
@@ -652,8 +652,8 @@
     bool foundFromX = false;
     bool foundToX = false;
 
-    Optional<unsigned> fromIndex = from;
-    Optional<unsigned> toIndex = to;
+    std::optional<unsigned> fromIndex = from;
+    std::optional<unsigned> toIndex = to;
 
     if (m_run.rtl())
         currentX = m_totalWidth;
@@ -668,7 +668,7 @@
             if (fromIndex && fromIndex.value() >= numCharacters)
                 fromIndex.value() -= numCharacters;
             else
-                fromIndex = Nullopt;
+                fromIndex = std::nullopt;
         }
 
         if (!foundToX && toIndex.value() < numCharacters) {
@@ -678,7 +678,7 @@
             if (toIndex && toIndex.value() >= numCharacters)
                 toIndex.value() -= numCharacters;
             else
-                toIndex = Nullopt;
+                toIndex = std::nullopt;
         }
 
         if (foundFromX && foundToX)
diff --git a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
index b9411b4..8dfaf7b 100644
--- a/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -276,19 +276,19 @@
 }
 
 // FIXME: Capitalization is language-dependent and context-dependent and should operate on grapheme clusters instead of codepoints.
-static inline Optional<UChar32> capitalized(UChar32 baseCharacter)
+static inline std::optional<UChar32> capitalized(UChar32 baseCharacter)
 {
     if (U_GET_GC_MASK(baseCharacter) & U_GC_M_MASK)
-        return Nullopt;
+        return std::nullopt;
 
     UChar32 uppercaseCharacter = u_toupper(baseCharacter);
     ASSERT(uppercaseCharacter == baseCharacter || (U_IS_BMP(baseCharacter) == U_IS_BMP(uppercaseCharacter)));
     if (uppercaseCharacter != baseCharacter)
         return uppercaseCharacter;
-    return Nullopt;
+    return std::nullopt;
 }
 
-static bool shouldSynthesize(const Font* nextFont, UChar32 baseCharacter, Optional<UChar32> capitalizedBase, FontVariantCaps fontVariantCaps, bool engageAllSmallCapsProcessing)
+static bool shouldSynthesize(const Font* nextFont, UChar32 baseCharacter, std::optional<UChar32> capitalizedBase, FontVariantCaps fontVariantCaps, bool engageAllSmallCapsProcessing)
 {
     if (!nextFont || nextFont == Font::systemFallback())
         return false;
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
index 895d37f..4910cf0 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
@@ -211,7 +211,7 @@
         TextureMapperPaintOptions replicaOptions(options);
         replicaOptions.transform
             .multiply(m_state.replicaLayer->m_currentTransform.combined())
-            .multiply(m_currentTransform.combined().inverse().valueOr(TransformationMatrix()));
+            .multiply(m_currentTransform.combined().inverse().value_or(TransformationMatrix()));
         paintSelfAndChildren(replicaOptions);
     }
 
@@ -230,7 +230,7 @@
 
 TransformationMatrix TextureMapperLayer::replicaTransform()
 {
-    return TransformationMatrix(m_state.replicaLayer->m_currentTransform.combined()).multiply(m_currentTransform.combined().inverse().valueOr(TransformationMatrix()));
+    return TransformationMatrix(m_state.replicaLayer->m_currentTransform.combined()).multiply(m_currentTransform.combined().inverse().value_or(TransformationMatrix()));
 }
 
 void TextureMapperLayer::setAnimatedFilters(const FilterOperations& filters)
@@ -731,7 +731,7 @@
 FloatSize TextureMapperLayer::mapScrollOffset(const FloatSize& offset)
 {
     double zeroX, zeroY, offsetX, offsetY;
-    TransformationMatrix transform = m_currentTransform.combined().inverse().valueOr(TransformationMatrix());
+    TransformationMatrix transform = m_currentTransform.combined().inverse().value_or(TransformationMatrix());
     transform.map(0, 0, zeroX, zeroY);
     transform.map(offset.width(), offset.height(), offsetX, offsetY);
     return FloatSize(offsetX - zeroX, offsetY - zeroY);
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
index 5d744d2..055ef99 100644
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
@@ -947,7 +947,7 @@
     // Return a projection of the visible rect (surface coordinates) onto the layer's plane (layer coordinates).
     // The resulting quad might be squewed and the visible rect is the bounding box of this quad,
     // so it might spread further than the real visible area (and then even more amplified by the cover rect multiplier).
-    ASSERT(m_cachedInverseTransform == m_layerTransform.combined().inverse().valueOr(TransformationMatrix()));
+    ASSERT(m_cachedInverseTransform == m_layerTransform.combined().inverse().value_or(TransformationMatrix()));
     FloatRect rect = m_cachedInverseTransform.clampedBoundsOfProjectedQuad(FloatQuad(m_coordinator->visibleContentsRect()));
     clampToContentsRectIfRectIsInfinite(rect, size());
     return enclosingIntRect(rect);
@@ -1139,7 +1139,7 @@
     m_layerTransform.setChildrenTransform(childrenTransform());
     m_layerTransform.combineTransforms(parent() ? downcast<CoordinatedGraphicsLayer>(*parent()).m_layerTransform.combinedForChildren() : TransformationMatrix());
 
-    m_cachedInverseTransform = m_layerTransform.combined().inverse().valueOr(TransformationMatrix());
+    m_cachedInverseTransform = m_layerTransform.combined().inverse().value_or(TransformationMatrix());
 
     // The combined transform will be used in tiledBackingStoreVisibleRect.
     setNeedsVisibleRectAdjustment();
diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
index c176f0d..8ebdd98 100644
--- a/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
+++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.cpp
@@ -104,11 +104,11 @@
     return std::isfinite(determinant) && determinant != 0;
 }
 
-Optional<AffineTransform> AffineTransform::inverse() const
+std::optional<AffineTransform> AffineTransform::inverse() const
 {
     double determinant = det(m_transform);
     if (!std::isfinite(determinant) || determinant == 0)
-        return Nullopt;
+        return std::nullopt;
 
     AffineTransform result;
     if (isIdentityOrTranslation()) {
diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.h b/Source/WebCore/platform/graphics/transforms/AffineTransform.h
index 82d3d6a..a0b1f7b 100644
--- a/Source/WebCore/platform/graphics/transforms/AffineTransform.h
+++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -128,7 +128,7 @@
     WEBCORE_EXPORT double yScale() const;
 
     bool isInvertible() const; // If you call this this, you're probably doing it wrong.
-    WEBCORE_EXPORT Optional<AffineTransform> inverse() const;
+    WEBCORE_EXPORT std::optional<AffineTransform> inverse() const;
 
     WEBCORE_EXPORT void blend(const AffineTransform& from, double progress);
 
diff --git a/Source/WebCore/platform/graphics/transforms/TransformState.cpp b/Source/WebCore/platform/graphics/transforms/TransformState.cpp
index e763cc1..5ef0e5b 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformState.cpp
+++ b/Source/WebCore/platform/graphics/transforms/TransformState.cpp
@@ -170,7 +170,7 @@
     if (m_direction == ApplyTransformDirection)
         return m_accumulatedTransform->mapPoint(point);
 
-    return m_accumulatedTransform->inverse().valueOr(TransformationMatrix()).projectPoint(point, wasClamped);
+    return m_accumulatedTransform->inverse().value_or(TransformationMatrix()).projectPoint(point, wasClamped);
 }
 
 FloatQuad TransformState::mappedQuad(bool* wasClamped) const
@@ -183,13 +183,13 @@
     return quad;
 }
 
-Optional<FloatQuad> TransformState::mappedSecondaryQuad(bool* wasClamped) const
+std::optional<FloatQuad> TransformState::mappedSecondaryQuad(bool* wasClamped) const
 {
     if (wasClamped)
         *wasClamped = false;
 
     if (!m_lastPlanarSecondaryQuad)
-        return Optional<FloatQuad>();
+        return std::optional<FloatQuad>();
 
     FloatQuad quad = *m_lastPlanarSecondaryQuad;
     mapQuad(quad, m_direction, wasClamped);
@@ -218,7 +218,7 @@
     if (direction == ApplyTransformDirection)
         quad = m_accumulatedTransform->mapQuad(quad);
 
-    quad = m_accumulatedTransform->inverse().valueOr(TransformationMatrix()).projectQuad(quad, wasClamped);
+    quad = m_accumulatedTransform->inverse().value_or(TransformationMatrix()).projectQuad(quad, wasClamped);
 }
 
 void TransformState::flattenWithTransform(const TransformationMatrix& t, bool* wasClamped)
@@ -233,7 +233,7 @@
         }
 
     } else {
-        TransformationMatrix inverseTransform = t.inverse().valueOr(TransformationMatrix());
+        TransformationMatrix inverseTransform = t.inverse().value_or(TransformationMatrix());
         if (m_mapPoint)
             m_lastPlanarPoint = inverseTransform.projectPoint(m_lastPlanarPoint);
         if (m_mapQuad) {
diff --git a/Source/WebCore/platform/graphics/transforms/TransformState.h b/Source/WebCore/platform/graphics/transforms/TransformState.h
index 7287862..cd955ab 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformState.h
+++ b/Source/WebCore/platform/graphics/transforms/TransformState.h
@@ -80,7 +80,7 @@
         m_lastPlanarQuad = quad;
     }
 
-    // FIXME: webkit.org/b/144226 use Optional<FloatQuad>. 
+    // FIXME: webkit.org/b/144226 use std::optional<FloatQuad>. 
     void setSecondaryQuad(const FloatQuad* quad)
     {
         // We must be in a flattened state (no accumulated offset) when setting this secondary quad.
@@ -91,7 +91,7 @@
             m_lastPlanarSecondaryQuad = nullptr;
     }
 
-    // FIXME: webkit.org/b/144226 use Optional<FloatQuad>.
+    // FIXME: webkit.org/b/144226 use std::optional<FloatQuad>.
     void setLastPlanarSecondaryQuad(const FloatQuad*);
 
     void move(LayoutUnit x, LayoutUnit y, TransformAccumulation accumulate = FlattenTransform)
@@ -113,7 +113,7 @@
     // Return the point or quad mapped through the current transform
     FloatPoint mappedPoint(bool* wasClamped = nullptr) const;
     FloatQuad mappedQuad(bool* wasClamped = nullptr) const;
-    Optional<FloatQuad> mappedSecondaryQuad(bool* wasClamped = nullptr) const;
+    std::optional<FloatQuad> mappedSecondaryQuad(bool* wasClamped = nullptr) const;
 
 private:
     void translateTransform(const LayoutSize&);
diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
index 4d1f0bf..2427b01 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
@@ -1445,7 +1445,7 @@
     return true;
 }
 
-Optional<TransformationMatrix> TransformationMatrix::inverse() const
+std::optional<TransformationMatrix> TransformationMatrix::inverse() const
 {
     if (isIdentityOrTranslation()) {
         // identity matrix
@@ -1463,7 +1463,7 @@
     // FIXME: Use LU decomposition to apply the inverse instead of calculating the inverse explicitly.
     // Calculating the inverse of a 4x4 matrix using cofactors is numerically unstable and unnecessary to apply the inverse transformation to a point.
     if (!WebCore::inverse(m_matrix, invMat.m_matrix))
-        return Nullopt;
+        return std::nullopt;
 
     return invMat;
 }
diff --git a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
index 06547d4..5db0c00 100644
--- a/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
+++ b/Source/WebCore/platform/graphics/transforms/TransformationMatrix.h
@@ -258,7 +258,7 @@
     WEBCORE_EXPORT static TransformationMatrix rectToRect(const FloatRect&, const FloatRect&);
 
     bool isInvertible() const; // If you call this this, you're probably doing it wrong.
-    WEBCORE_EXPORT Optional<TransformationMatrix> inverse() const;
+    WEBCORE_EXPORT std::optional<TransformationMatrix> inverse() const;
 
     // Decompose the matrix into its component parts.
     struct Decomposed2Type {
diff --git a/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp b/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp
index 710a0bb..9ca153b 100644
--- a/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp
+++ b/Source/WebCore/platform/graphics/win/ImageBufferDirect2D.cpp
@@ -254,7 +254,7 @@
     m_data.putData(source, scaledSourceSize, scaledSourceRect, destPoint, internalSize(), context().isAcceleratedContext(), multiplied == Unmultiplied, 1);
 }
 
-String ImageBuffer::toDataURL(const String&, Optional<double>, CoordinateSystem) const
+String ImageBuffer::toDataURL(const String&, std::optional<double>, CoordinateSystem) const
 {
     notImplemented();
     return ASCIILiteral("data:,");
diff --git a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp
index 3fde832..129a218 100644
--- a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp
+++ b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.cpp
@@ -109,7 +109,7 @@
     return RepetitionCountNone;
 }
 
-Optional<IntPoint> ImageDecoder::hotSpot() const
+std::optional<IntPoint> ImageDecoder::hotSpot() const
 {
     return IntPoint();
 }
diff --git a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h
index e538267..acb32a9 100644
--- a/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h
+++ b/Source/WebCore/platform/graphics/win/ImageDecoderDirect2D.h
@@ -56,7 +56,7 @@
     size_t frameCount() const;
 
     RepetitionCount repetitionCount() const;
-    Optional<IntPoint> hotSpot() const;
+    std::optional<IntPoint> hotSpot() const;
     
     IntSize frameSizeAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default) const;
     bool frameIsCompleteAtIndex(size_t) const;
diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
index 1ca3fa1..6da062f 100644
--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
@@ -95,7 +95,7 @@
     return m_supportsXComposite.value();
 }
 
-bool PlatformDisplayX11::supportsXDamage(Optional<int>& damageEventBase) const
+bool PlatformDisplayX11::supportsXDamage(std::optional<int>& damageEventBase) const
 {
     if (!m_supportsXDamage) {
         m_supportsXDamage = false;
diff --git a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h
index 10bc1e2..1e0add2 100644
--- a/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h
+++ b/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.h
@@ -43,7 +43,7 @@
 
     Display* native() const { return m_display; }
     bool supportsXComposite() const;
-    bool supportsXDamage(Optional<int>& damageEventBase) const;
+    bool supportsXDamage(std::optional<int>& damageEventBase) const;
 
 private:
     Type type() const override { return PlatformDisplay::Type::X11; }
@@ -54,9 +54,9 @@
 
     Display* m_display;
     bool m_ownedDisplay;
-    mutable Optional<bool> m_supportsXComposite;
-    mutable Optional<bool> m_supportsXDamage;
-    mutable Optional<int> m_damageEventBase;
+    mutable std::optional<bool> m_supportsXComposite;
+    mutable std::optional<bool> m_supportsXDamage;
+    mutable std::optional<int> m_damageEventBase;
 };
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/image-decoders/ImageDecoder.h b/Source/WebCore/platform/image-decoders/ImageDecoder.h
index a96b358..a41ec0a 100644
--- a/Source/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ImageDecoder.h
@@ -186,7 +186,7 @@
 
         // If the image has a cursor hot-spot, stores it in the argument
         // and returns true. Otherwise returns false.
-        virtual Optional<IntPoint> hotSpot() const { return Nullopt; }
+        virtual std::optional<IntPoint> hotSpot() const { return std::nullopt; }
 
     protected:
         void prepareScaleDataIfNecessary();
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
index d0a2aff..64c2c35 100644
--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -119,7 +119,7 @@
     return ImageDecoder::setFailed();
 }
 
-Optional<IntPoint> ICOImageDecoder::hotSpot() const
+std::optional<IntPoint> ICOImageDecoder::hotSpot() const
 {
     // When unspecified, the default frame is always frame 0. This is consistent with
     // BitmapImage where currentFrame() starts at 0 and only increases when animation is
@@ -127,10 +127,10 @@
     return hotSpotAtIndex(0);
 }
 
-Optional<IntPoint> ICOImageDecoder::hotSpotAtIndex(size_t index) const
+std::optional<IntPoint> ICOImageDecoder::hotSpotAtIndex(size_t index) const
 {
     if (index >= m_dirEntries.size() || m_fileType != CURSOR)
-        return Nullopt;
+        return std::nullopt;
 
     return m_dirEntries[index].m_hotSpot;
 }
diff --git a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
index 2d47a7b..b1bc5ad 100644
--- a/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
+++ b/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
@@ -55,7 +55,7 @@
         // avoid accessing deleted memory, especially when calling this from
         // inside BMPImageReader!
         bool setFailed() override;
-        Optional<IntPoint> hotSpot() const override;
+        std::optional<IntPoint> hotSpot() const override;
 
     private:
         enum ImageType {
@@ -115,8 +115,8 @@
         // could be decoded.
         bool processDirectoryEntries();
 
-        // Returns the hot-spot for |index|, returns Nullopt if there is none.
-        Optional<IntPoint> hotSpotAtIndex(size_t) const;
+        // Returns the hot-spot for |index|, returns std::nullopt if there is none.
+        std::optional<IntPoint> hotSpotAtIndex(size_t) const;
 
         // Reads and returns a directory entry from the current offset into
         // |data|.
diff --git a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
index e410a7d..057e033 100644
--- a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
+++ b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
@@ -83,7 +83,7 @@
     longjmp(err->m_setjmpBuffer, -1);
 }
 
-bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& jpegData, Optional<double> quality)
+bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize& size, Vector<char>& jpegData, std::optional<double> quality)
 {
     struct jpeg_compress_struct compressData;
     JPEGCompressErrorMgr err;
diff --git a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.h b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.h
index 328434b..9f31a91 100644
--- a/Source/WebCore/platform/image-encoders/JPEGImageEncoder.h
+++ b/Source/WebCore/platform/image-encoders/JPEGImageEncoder.h
@@ -27,6 +27,6 @@
 
 class IntSize;
 
-bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize&, Vector<char>& jpegData, Optional<double> quality = Nullopt);
+bool compressRGBABigEndianToJPEG(unsigned char* rgbaBigEndianData, const IntSize&, Vector<char>& jpegData, std::optional<double> quality = std::nullopt);
 
 }
diff --git a/Source/WebCore/platform/ios/LegacyTileCache.h b/Source/WebCore/platform/ios/LegacyTileCache.h
index 2f2c48c..92c21d2 100644
--- a/Source/WebCore/platform/ios/LegacyTileCache.h
+++ b/Source/WebCore/platform/ios/LegacyTileCache.h
@@ -140,7 +140,7 @@
     CALayer* hostLayer() const;
     unsigned tileCapacityForGrid(LegacyTileGrid*);
     Color colorForGridTileBorder(LegacyTileGrid*) const;
-    void setOverrideVisibleRect(Optional<FloatRect>);
+    void setOverrideVisibleRect(std::optional<FloatRect>);
 
     void doPendingRepaints();
 
@@ -185,7 +185,7 @@
     // Ensure there are no async calls on a dead tile cache.
     RetainPtr<LegacyTileCacheTombstone> m_tombstone;
 
-    Optional<FloatRect> m_overrideVisibleRect;
+    std::optional<FloatRect> m_overrideVisibleRect;
 
     TilingMode m_tilingMode;
     TilingDirection m_tilingDirection;
diff --git a/Source/WebCore/platform/ios/LegacyTileCache.mm b/Source/WebCore/platform/ios/LegacyTileCache.mm
index b0b7bfd..66a26e1 100644
--- a/Source/WebCore/platform/ios/LegacyTileCache.mm
+++ b/Source/WebCore/platform/ios/LegacyTileCache.mm
@@ -117,7 +117,7 @@
     return [layer convertRect:[m_window extendedVisibleRect] fromLayer:hostLayer()];
 }
 
-void LegacyTileCache::setOverrideVisibleRect(Optional<FloatRect> rect)
+void LegacyTileCache::setOverrideVisibleRect(std::optional<FloatRect> rect)
 {
     m_overrideVisibleRect = rect;
 }
diff --git a/Source/WebCore/platform/ios/LegacyTileLayer.mm b/Source/WebCore/platform/ios/LegacyTileLayer.mm
index 7782b25..5ca212a 100644
--- a/Source/WebCore/platform/ios/LegacyTileLayer.mm
+++ b/Source/WebCore/platform/ios/LegacyTileLayer.mm
@@ -64,7 +64,7 @@
 
     [super renderInContext:context];
 
-    _tileGrid->tileCache().setOverrideVisibleRect(Nullopt);
+    _tileGrid->tileCache().setOverrideVisibleRect(std::nullopt);
 }
 @end
 
diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
index 9a03832..421c6160 100644
--- a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+++ b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
@@ -119,7 +119,7 @@
 
 MemoryPressureHandler::EventFDPoller::~EventFDPoller()
 {
-    m_fd = Nullopt;
+    m_fd = std::nullopt;
 #if USE(GLIB)
     g_source_destroy(m_source.get());
 #else
@@ -164,11 +164,11 @@
 
     if (m_eventFD) {
         close(m_eventFD.value());
-        m_eventFD = Nullopt;
+        m_eventFD = std::nullopt;
     }
     if (m_pressureLevelFD) {
         close(m_pressureLevelFD.value());
-        m_pressureLevelFD = Nullopt;
+        m_pressureLevelFD = std::nullopt;
     }
 }
 
@@ -250,12 +250,12 @@
 
     if (m_pressureLevelFD) {
         close(m_pressureLevelFD.value());
-        m_pressureLevelFD = Nullopt;
+        m_pressureLevelFD = std::nullopt;
 
         // Only close the eventFD used for cgroups.
         if (m_eventFD) {
             close(m_eventFD.value());
-            m_eventFD = Nullopt;
+            m_eventFD = std::nullopt;
         }
     }
 
diff --git a/Source/WebCore/platform/mac/ThemeMac.h b/Source/WebCore/platform/mac/ThemeMac.h
index e4c7271..b346a65 100644
--- a/Source/WebCore/platform/mac/ThemeMac.h
+++ b/Source/WebCore/platform/mac/ThemeMac.h
@@ -42,7 +42,7 @@
     
     int baselinePositionAdjustment(ControlPart) const override;
 
-    Optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const override;
+    std::optional<FontCascadeDescription> controlFont(ControlPart, const FontCascade&, float zoomFactor) const override;
     
     LengthSize controlSize(ControlPart, const FontCascade&, const LengthSize&, float zoomFactor) const override;
     LengthSize minimumControlSize(ControlPart, const FontCascade&, float zoomFactor) const override;
diff --git a/Source/WebCore/platform/mac/ThemeMac.mm b/Source/WebCore/platform/mac/ThemeMac.mm
index 2bc262d..a1d785f 100644
--- a/Source/WebCore/platform/mac/ThemeMac.mm
+++ b/Source/WebCore/platform/mac/ThemeMac.mm
@@ -686,7 +686,7 @@
     return Theme::baselinePositionAdjustment(part);
 }
 
-Optional<FontCascadeDescription> ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const
+std::optional<FontCascadeDescription> ThemeMac::controlFont(ControlPart part, const FontCascade& font, float zoomFactor) const
 {
     switch (part) {
         case PushButtonPart: {
diff --git a/Source/WebCore/platform/mediastream/MediaConstraints.cpp b/Source/WebCore/platform/mediastream/MediaConstraints.cpp
index 4512b88..2805dce 100644
--- a/Source/WebCore/platform/mediastream/MediaConstraints.cpp
+++ b/Source/WebCore/platform/mediastream/MediaConstraints.cpp
@@ -219,7 +219,7 @@
         return;
 }
 
-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<IntConstraint>&& constraint)
+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<IntConstraint>&& constraint)
 {
     switch (constraintType) {
     case MediaConstraintType::Width:
@@ -248,7 +248,7 @@
     }
 }
 
-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<DoubleConstraint>&& constraint)
+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<DoubleConstraint>&& constraint)
 {
     switch (constraintType) {
     case MediaConstraintType::AspectRatio:
@@ -275,7 +275,7 @@
     }
 }
 
-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<BooleanConstraint>&& constraint)
+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<BooleanConstraint>&& constraint)
 {
     switch (constraintType) {
     case MediaConstraintType::EchoCancellation:
@@ -298,7 +298,7 @@
     }
 }
 
-void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, Optional<StringConstraint>&& constraint)
+void MediaTrackConstraintSetMap::set(MediaConstraintType constraintType, std::optional<StringConstraint>&& constraint)
 {
     switch (constraintType) {
     case MediaConstraintType::FacingMode:
diff --git a/Source/WebCore/platform/mediastream/MediaConstraints.h b/Source/WebCore/platform/mediastream/MediaConstraints.h
index 9dfc21c..0e71921 100644
--- a/Source/WebCore/platform/mediastream/MediaConstraints.h
+++ b/Source/WebCore/platform/mediastream/MediaConstraints.h
@@ -341,10 +341,10 @@
         }
     }
 
-    Optional<ValueType> m_min;
-    Optional<ValueType> m_max;
-    Optional<ValueType> m_exact;
-    Optional<ValueType> m_ideal;
+    std::optional<ValueType> m_min;
+    std::optional<ValueType> m_max;
+    std::optional<ValueType> m_exact;
+    std::optional<ValueType> m_ideal;
 };
 
 class IntConstraint final : public NumericConstraint<int> {
@@ -474,8 +474,8 @@
     }
 
 private:
-    Optional<bool> m_exact;
-    Optional<bool> m_ideal;
+    std::optional<bool> m_exact;
+    std::optional<bool> m_ideal;
 };
 
 class StringConstraint : public MediaConstraint {
@@ -583,25 +583,25 @@
     bool isEmpty() const;
     WEBCORE_EXPORT size_t size() const;
 
-    WEBCORE_EXPORT void set(MediaConstraintType, Optional<IntConstraint>&&);
-    WEBCORE_EXPORT void set(MediaConstraintType, Optional<DoubleConstraint>&&);
-    WEBCORE_EXPORT void set(MediaConstraintType, Optional<BooleanConstraint>&&);
-    WEBCORE_EXPORT void set(MediaConstraintType, Optional<StringConstraint>&&);
+    WEBCORE_EXPORT void set(MediaConstraintType, std::optional<IntConstraint>&&);
+    WEBCORE_EXPORT void set(MediaConstraintType, std::optional<DoubleConstraint>&&);
+    WEBCORE_EXPORT void set(MediaConstraintType, std::optional<BooleanConstraint>&&);
+    WEBCORE_EXPORT void set(MediaConstraintType, std::optional<StringConstraint>&&);
 
-    Optional<IntConstraint> width() const { return m_width; }
-    Optional<IntConstraint> height() const { return m_height; }
-    Optional<IntConstraint> sampleRate() const { return m_sampleRate; }
-    Optional<IntConstraint> sampleSize() const { return m_sampleSize; }
+    std::optional<IntConstraint> width() const { return m_width; }
+    std::optional<IntConstraint> height() const { return m_height; }
+    std::optional<IntConstraint> sampleRate() const { return m_sampleRate; }
+    std::optional<IntConstraint> sampleSize() const { return m_sampleSize; }
 
-    Optional<DoubleConstraint> aspectRatio() const { return m_aspectRatio; }
-    Optional<DoubleConstraint> frameRate() const { return m_frameRate; }
-    Optional<DoubleConstraint> volume() const { return m_volume; }
+    std::optional<DoubleConstraint> aspectRatio() const { return m_aspectRatio; }
+    std::optional<DoubleConstraint> frameRate() const { return m_frameRate; }
+    std::optional<DoubleConstraint> volume() const { return m_volume; }
 
-    Optional<BooleanConstraint> echoCancellation() const { return m_echoCancellation; }
+    std::optional<BooleanConstraint> echoCancellation() const { return m_echoCancellation; }
 
-    Optional<StringConstraint> facingMode() const { return m_facingMode; }
-    Optional<StringConstraint> deviceId() const { return m_deviceId; }
-    Optional<StringConstraint> groupId() const { return m_groupId; }
+    std::optional<StringConstraint> facingMode() const { return m_facingMode; }
+    std::optional<StringConstraint> deviceId() const { return m_deviceId; }
+    std::optional<StringConstraint> groupId() const { return m_groupId; }
 
     template <class Encoder> void encode(Encoder& encoder) const
     {
@@ -653,20 +653,20 @@
     }
 
 private:
-    Optional<IntConstraint> m_width;
-    Optional<IntConstraint> m_height;
-    Optional<IntConstraint> m_sampleRate;
-    Optional<IntConstraint> m_sampleSize;
+    std::optional<IntConstraint> m_width;
+    std::optional<IntConstraint> m_height;
+    std::optional<IntConstraint> m_sampleRate;
+    std::optional<IntConstraint> m_sampleSize;
 
-    Optional<DoubleConstraint> m_aspectRatio;
-    Optional<DoubleConstraint> m_frameRate;
-    Optional<DoubleConstraint> m_volume;
+    std::optional<DoubleConstraint> m_aspectRatio;
+    std::optional<DoubleConstraint> m_frameRate;
+    std::optional<DoubleConstraint> m_volume;
 
-    Optional<BooleanConstraint> m_echoCancellation;
+    std::optional<BooleanConstraint> m_echoCancellation;
 
-    Optional<StringConstraint> m_facingMode;
-    Optional<StringConstraint> m_deviceId;
-    Optional<StringConstraint> m_groupId;
+    std::optional<StringConstraint> m_facingMode;
+    std::optional<StringConstraint> m_deviceId;
+    std::optional<StringConstraint> m_groupId;
 };
 
 class FlattenedConstraint {
diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
index 77d1fa0..19086cf 100644
--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
@@ -150,13 +150,13 @@
     stop(callingObserver);
 }
 
-bool RealtimeMediaSource::supportsSizeAndFrameRate(Optional<int>, Optional<int>, Optional<double>)
+bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<int>, std::optional<int>, std::optional<double>)
 {
     // The size and frame rate are within the capability limits, so they are supported.
     return true;
 }
 
-bool RealtimeMediaSource::supportsSizeAndFrameRate(Optional<IntConstraint> widthConstraint, Optional<IntConstraint> heightConstraint, Optional<DoubleConstraint> frameRateConstraint, String& badConstraint)
+bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint> widthConstraint, std::optional<IntConstraint> heightConstraint, std::optional<DoubleConstraint> frameRateConstraint, String& badConstraint)
 {
     if (!widthConstraint && !heightConstraint && !frameRateConstraint)
         return true;
@@ -164,7 +164,7 @@
     ASSERT(this->capabilities());
     RealtimeMediaSourceCapabilities& capabilities = *this->capabilities();
 
-    Optional<int> width;
+    std::optional<int> width;
     if (widthConstraint && capabilities.supportsWidth()) {
         if (std::isinf(fitnessDistance(*widthConstraint))) {
             badConstraint = widthConstraint->name();
@@ -175,7 +175,7 @@
         width = widthConstraint->valueForCapabilityRange(size().width(), range.rangeMin().asInt, range.rangeMax().asInt);
     }
 
-    Optional<int> height;
+    std::optional<int> height;
     if (heightConstraint && capabilities.supportsHeight()) {
         if (std::isinf(fitnessDistance(*heightConstraint))) {
             badConstraint = heightConstraint->name();
@@ -186,7 +186,7 @@
         height = heightConstraint->valueForCapabilityRange(size().height(), range.rangeMin().asInt, range.rangeMax().asInt);
     }
 
-    Optional<double> frameRate;
+    std::optional<double> frameRate;
     if (frameRateConstraint && capabilities.supportsFrameRate()) {
         if (std::isinf(fitnessDistance(*frameRateConstraint))) {
             badConstraint = frameRateConstraint->name();
@@ -345,7 +345,7 @@
         (source->*applier)(value);
 }
 
-void RealtimeMediaSource::applySizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate)
+void RealtimeMediaSource::applySizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate)
 {
     if (width)
         setWidth(width.value());
@@ -589,7 +589,7 @@
 
     RealtimeMediaSourceCapabilities& capabilities = *this->capabilities();
 
-    Optional<int> width;
+    std::optional<int> width;
     if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::Width)) {
         ASSERT(constraint->isInt());
         if (capabilities.supportsWidth()) {
@@ -598,7 +598,7 @@
         }
     }
 
-    Optional<int> height;
+    std::optional<int> height;
     if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::Height)) {
         ASSERT(constraint->isInt());
         if (capabilities.supportsHeight()) {
@@ -607,7 +607,7 @@
         }
     }
 
-    Optional<double> frameRate;
+    std::optional<double> frameRate;
     if (const MediaConstraint* constraint = constraints.find(MediaConstraintType::FrameRate)) {
         ASSERT(constraint->isDouble());
         if (capabilities.supportsFrameRate()) {
@@ -628,7 +628,7 @@
     commitConfiguration();
 }
 
-Optional<std::pair<String, String>> RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints)
+std::optional<std::pair<String, String>> RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints)
 {
     ASSERT(constraints.isValid());
 
@@ -638,7 +638,7 @@
         return { { failedConstraint, ASCIILiteral("Constraint not supported") } };
 
     applyConstraints(candidates);
-    return Nullopt;
+    return std::nullopt;
 }
 
 void RealtimeMediaSource::applyConstraints(const MediaConstraints& constraints, SuccessHandler successHandler, FailureHandler failureHandler)
diff --git a/Source/WebCore/platform/mediastream/RealtimeMediaSource.h b/Source/WebCore/platform/mediastream/RealtimeMediaSource.h
index 2b3046c..e6aa9f7 100644
--- a/Source/WebCore/platform/mediastream/RealtimeMediaSource.h
+++ b/Source/WebCore/platform/mediastream/RealtimeMediaSource.h
@@ -95,7 +95,7 @@
     using SuccessHandler = std::function<void()>;
     using FailureHandler = std::function<void(const String& badConstraint, const String& errorString)>;
     void applyConstraints(const MediaConstraints&, SuccessHandler, FailureHandler);
-    Optional<std::pair<String, String>> applyConstraints(const MediaConstraints&);
+    std::optional<std::pair<String, String>> applyConstraints(const MediaConstraints&);
 
     virtual bool supportsConstraints(const MediaConstraints&, String&);
 
@@ -174,11 +174,11 @@
 
     virtual bool selectSettings(const MediaConstraints&, FlattenedConstraint&, String&);
     virtual double fitnessDistance(const MediaConstraint&);
-    virtual bool supportsSizeAndFrameRate(Optional<IntConstraint> width, Optional<IntConstraint> height, Optional<DoubleConstraint>, String&);
-    virtual bool supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>);
+    virtual bool supportsSizeAndFrameRate(std::optional<IntConstraint> width, std::optional<IntConstraint> height, std::optional<DoubleConstraint>, String&);
+    virtual bool supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>);
     virtual void applyConstraint(const MediaConstraint&);
     virtual void applyConstraints(const FlattenedConstraint&);
-    virtual void applySizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>);
+    virtual void applySizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>);
 
     bool m_muted { false };
 
diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
index 67cdbe8..b72ecb4 100644
--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.h
@@ -59,13 +59,13 @@
 
     void updateSettings(RealtimeMediaSourceSettings&) final;
 
-    void applySizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) final;
+    void applySizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) final;
     bool applySize(const IntSize&) final;
     bool applyFrameRate(double) final;
     bool setPreset(NSString*);
 
-    NSString *bestSessionPresetForVideoDimensions(Optional<int> width, Optional<int> height) const;
-    bool supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double>) final;
+    NSString *bestSessionPresetForVideoDimensions(std::optional<int> width, std::optional<int> height) const;
+    bool supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double>) final;
 
     void initializeCapabilities(RealtimeMediaSourceCapabilities&) final;
     void initializeSupportedConstraints(RealtimeMediaSourceSupportedConstraints&) final;
diff --git a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
index 7d36145..ef5e45c 100644
--- a/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
+++ b/Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
@@ -362,7 +362,7 @@
     return true;
 }
 
-void AVVideoCaptureSource::applySizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate)
+void AVVideoCaptureSource::applySizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate)
 {
     setPreset(bestSessionPresetForVideoDimensions(WTFMove(width), WTFMove(height)));
 
@@ -541,7 +541,7 @@
     return AVVideoSourcePreview::create(session(), device(), this);
 }
 
-NSString *AVVideoCaptureSource::bestSessionPresetForVideoDimensions(Optional<int> width, Optional<int> height) const
+NSString *AVVideoCaptureSource::bestSessionPresetForVideoDimensions(std::optional<int> width, std::optional<int> height) const
 {
     if (!width && !height)
         return nil;
@@ -565,7 +565,7 @@
     return nil;
 }
 
-bool AVVideoCaptureSource::supportsSizeAndFrameRate(Optional<int> width, Optional<int> height, Optional<double> frameRate)
+bool AVVideoCaptureSource::supportsSizeAndFrameRate(std::optional<int> width, std::optional<int> height, std::optional<double> frameRate)
 {
     if (!height && !width && !frameRate)
         return true;
diff --git a/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h b/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h
index c3396e7..f31048c 100644
--- a/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h
+++ b/Source/WebCore/platform/mediastream/openwebrtc/MediaEndpointOwr.h
@@ -128,7 +128,7 @@
     void ensureTransportAgentAndTransceivers(bool isInitiator, const Vector<TransceiverConfig>&);
     void internalAddRemoteCandidate(OwrSession*, const IceCandidate&, const String& ufrag, const String& password);
 
-    Optional<MediaEndpointConfiguration> m_configuration;
+    std::optional<MediaEndpointConfiguration> m_configuration;
     GRegex* m_helperServerRegEx;
 
     OwrTransportAgent* m_transportAgent;
diff --git a/Source/WebCore/platform/network/CacheValidation.cpp b/Source/WebCore/platform/network/CacheValidation.cpp
index 1f1c380..b38e707 100644
--- a/Source/WebCore/platform/network/CacheValidation.cpp
+++ b/Source/WebCore/platform/network/CacheValidation.cpp
@@ -104,7 +104,7 @@
     // No compensation for latency as that is not terribly important in practice.
     auto dateValue = response.date();
     auto apparentAge = dateValue ? std::max(0us, duration_cast<microseconds>(responseTime - *dateValue)) : 0us;
-    auto ageValue = response.age().valueOr(0us);
+    auto ageValue = response.age().value_or(0us);
     auto correctedInitialAge = std::max(apparentAge, ageValue);
     auto residentTime = duration_cast<microseconds>(system_clock::now() - responseTime);
     return correctedInitialAge + residentTime;
@@ -122,7 +122,7 @@
         return *maxAge;
 
     auto date = response.date();
-    auto effectiveDate = date.valueOr(responseTime);
+    auto effectiveDate = date.value_or(responseTime);
     if (auto expires = response.expires())
         return duration_cast<microseconds>(*expires - effectiveDate);
 
diff --git a/Source/WebCore/platform/network/CacheValidation.h b/Source/WebCore/platform/network/CacheValidation.h
index d376ebc..1bbbede 100644
--- a/Source/WebCore/platform/network/CacheValidation.h
+++ b/Source/WebCore/platform/network/CacheValidation.h
@@ -61,8 +61,8 @@
 WEBCORE_EXPORT bool redirectChainAllowsReuse(RedirectChainCacheStatus, ReuseExpiredRedirectionOrNot);
 
 struct CacheControlDirectives {
-    Optional<std::chrono::microseconds> maxAge;
-    Optional<std::chrono::microseconds> maxStale;
+    std::optional<std::chrono::microseconds> maxAge;
+    std::optional<std::chrono::microseconds> maxStale;
     bool noCache { false };
     bool noStore { false };
     bool mustRevalidate { false };
diff --git a/Source/WebCore/platform/network/DataURLDecoder.h b/Source/WebCore/platform/network/DataURLDecoder.h
index 8901c733..e5db154 100644
--- a/Source/WebCore/platform/network/DataURLDecoder.h
+++ b/Source/WebCore/platform/network/DataURLDecoder.h
@@ -49,7 +49,7 @@
     RefPtr<SharedBuffer> data;
 };
 
-using DecodeCompletionHandler = std::function<void (Optional<Result>)>;
+using DecodeCompletionHandler = std::function<void (std::optional<Result>)>;
 struct ScheduleContext {
 #if HAVE(RUNLOOP_TIMER)
     SchedulePairHashSet scheduledPairs;
diff --git a/Source/WebCore/platform/network/HTTPHeaderMap.h b/Source/WebCore/platform/network/HTTPHeaderMap.h
index 1495a6c..64559e1 100644
--- a/Source/WebCore/platform/network/HTTPHeaderMap.h
+++ b/Source/WebCore/platform/network/HTTPHeaderMap.h
@@ -54,7 +54,7 @@
 
         struct KeyValue {
             String key;
-            Optional<HTTPHeaderName> keyAsHTTPHeaderName;
+            std::optional<HTTPHeaderName> keyAsHTTPHeaderName;
             String value;
         };
 
@@ -99,7 +99,7 @@
             if (it == m_table.uncommonHeaders().end())
                 return false;
             m_keyValue.key = it->key;
-            m_keyValue.keyAsHTTPHeaderName = Nullopt;
+            m_keyValue.keyAsHTTPHeaderName = std::nullopt;
             m_keyValue.value = it->value;
             return true;
         }
diff --git a/Source/WebCore/platform/network/HTTPParsers.cpp b/Source/WebCore/platform/network/HTTPParsers.cpp
index 5fed389..4928a35 100644
--- a/Source/WebCore/platform/network/HTTPParsers.cpp
+++ b/Source/WebCore/platform/network/HTTPParsers.cpp
@@ -211,7 +211,7 @@
     }
 }
 
-Optional<std::chrono::system_clock::time_point> parseHTTPDate(const String& value)
+std::optional<std::chrono::system_clock::time_point> parseHTTPDate(const String& value)
 {
     double dateInMillisecondsSinceEpoch = parseDateFromNullTerminatedCharacters(value.utf8().data());
     if (!std::isfinite(dateInMillisecondsSinceEpoch))
diff --git a/Source/WebCore/platform/network/HTTPParsers.h b/Source/WebCore/platform/network/HTTPParsers.h
index 7f6b426..decc1b0 100644
--- a/Source/WebCore/platform/network/HTTPParsers.h
+++ b/Source/WebCore/platform/network/HTTPParsers.h
@@ -71,7 +71,7 @@
 bool isValidHTTPHeaderValue(const String&);
 bool isValidHTTPToken(const String&);
 bool parseHTTPRefresh(const String& refresh, double& delay, String& url);
-Optional<std::chrono::system_clock::time_point> parseHTTPDate(const String&);
+std::optional<std::chrono::system_clock::time_point> parseHTTPDate(const String&);
 String filenameFromHTTPContentDisposition(const String&);
 String extractMIMETypeFromMediaType(const String&);
 String extractCharsetFromMediaType(const String&);
diff --git a/Source/WebCore/platform/network/ResourceHandle.cpp b/Source/WebCore/platform/network/ResourceHandle.cpp
index 4773ded..647f604 100644
--- a/Source/WebCore/platform/network/ResourceHandle.cpp
+++ b/Source/WebCore/platform/network/ResourceHandle.cpp
@@ -154,7 +154,7 @@
 {
     if (response.isHttpVersion0_9()) {
         auto url = response.url();
-        Optional<uint16_t> port = url.port();
+        std::optional<uint16_t> port = url.port();
         if (port && !isDefaultPortForProtocol(port.value(), url.protocol())) {
             cancel();
             String message = "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9.";
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.cpp b/Source/WebCore/platform/network/ResourceResponseBase.cpp
index 2c12278..fa458a2 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.cpp
+++ b/Source/WebCore/platform/network/ResourceResponseBase.cpp
@@ -433,14 +433,14 @@
     return !m_httpHeaderFields.get(HTTPHeaderName::LastModified).isEmpty() || !m_httpHeaderFields.get(HTTPHeaderName::ETag).isEmpty();
 }
 
-Optional<std::chrono::microseconds> ResourceResponseBase::cacheControlMaxAge() const
+std::optional<std::chrono::microseconds> ResourceResponseBase::cacheControlMaxAge() const
 {
     if (!m_haveParsedCacheControlHeader)
         parseCacheControlDirectives();
     return m_cacheControlDirectives.maxAge;
 }
 
-static Optional<std::chrono::system_clock::time_point> parseDateValueInHeader(const HTTPHeaderMap& headers, HTTPHeaderName headerName)
+static std::optional<std::chrono::system_clock::time_point> parseDateValueInHeader(const HTTPHeaderMap& headers, HTTPHeaderName headerName)
 {
     String headerValue = headers.get(headerName);
     if (headerValue.isEmpty())
@@ -452,7 +452,7 @@
     return parseHTTPDate(headerValue);
 }
 
-Optional<std::chrono::system_clock::time_point> ResourceResponseBase::date() const
+std::optional<std::chrono::system_clock::time_point> ResourceResponseBase::date() const
 {
     lazyInit(CommonFieldsOnly);
 
@@ -463,7 +463,7 @@
     return m_date;
 }
 
-Optional<std::chrono::microseconds> ResourceResponseBase::age() const
+std::optional<std::chrono::microseconds> ResourceResponseBase::age() const
 {
     using namespace std::chrono;
 
@@ -480,7 +480,7 @@
     return m_age;
 }
 
-Optional<std::chrono::system_clock::time_point> ResourceResponseBase::expires() const
+std::optional<std::chrono::system_clock::time_point> ResourceResponseBase::expires() const
 {
     lazyInit(CommonFieldsOnly);
 
@@ -491,7 +491,7 @@
     return m_expires;
 }
 
-Optional<std::chrono::system_clock::time_point> ResourceResponseBase::lastModified() const
+std::optional<std::chrono::system_clock::time_point> ResourceResponseBase::lastModified() const
 {
     lazyInit(CommonFieldsOnly);
 
@@ -502,7 +502,7 @@
         // an invalid value (rdar://problem/22352838).
         const std::chrono::system_clock::time_point epoch;
         if (m_lastModified && m_lastModified.value() == epoch)
-            m_lastModified = Nullopt;
+            m_lastModified = std::nullopt;
 #endif
         m_haveParsedLastModifiedHeader = true;
     }
diff --git a/Source/WebCore/platform/network/ResourceResponseBase.h b/Source/WebCore/platform/network/ResourceResponseBase.h
index f3d2881..9d22f4f 100644
--- a/Source/WebCore/platform/network/ResourceResponseBase.h
+++ b/Source/WebCore/platform/network/ResourceResponseBase.h
@@ -115,7 +115,7 @@
     WEBCORE_EXPORT String suggestedFilename() const;
 
     WEBCORE_EXPORT void includeCertificateInfo() const;
-    const Optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; };
+    const std::optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; };
     
     // These functions return parsed values of the corresponding response headers.
     // NaN means that the header was not present or had invalid value.
@@ -123,11 +123,11 @@
     WEBCORE_EXPORT bool cacheControlContainsNoStore() const;
     WEBCORE_EXPORT bool cacheControlContainsMustRevalidate() const;
     WEBCORE_EXPORT bool hasCacheValidatorFields() const;
-    WEBCORE_EXPORT Optional<std::chrono::microseconds> cacheControlMaxAge() const;
-    WEBCORE_EXPORT Optional<std::chrono::system_clock::time_point> date() const;
-    WEBCORE_EXPORT Optional<std::chrono::microseconds> age() const;
-    WEBCORE_EXPORT Optional<std::chrono::system_clock::time_point> expires() const;
-    WEBCORE_EXPORT Optional<std::chrono::system_clock::time_point> lastModified() const;
+    WEBCORE_EXPORT std::optional<std::chrono::microseconds> cacheControlMaxAge() const;
+    WEBCORE_EXPORT std::optional<std::chrono::system_clock::time_point> date() const;
+    WEBCORE_EXPORT std::optional<std::chrono::microseconds> age() const;
+    WEBCORE_EXPORT std::optional<std::chrono::system_clock::time_point> expires() const;
+    WEBCORE_EXPORT std::optional<std::chrono::system_clock::time_point> lastModified() const;
     ParsedContentRange& contentRange() const;
 
     // This is primarily for testing support. It is not necessarily accurate in all scenarios.
@@ -189,15 +189,15 @@
     HTTPHeaderMap m_httpHeaderFields;
     mutable NetworkLoadTiming m_networkLoadTiming;
 
-    mutable Optional<CertificateInfo> m_certificateInfo;
+    mutable std::optional<CertificateInfo> m_certificateInfo;
 
     int m_httpStatusCode;
 
 private:
-    mutable Optional<std::chrono::microseconds> m_age;
-    mutable Optional<std::chrono::system_clock::time_point> m_date;
-    mutable Optional<std::chrono::system_clock::time_point> m_expires;
-    mutable Optional<std::chrono::system_clock::time_point> m_lastModified;
+    mutable std::optional<std::chrono::microseconds> m_age;
+    mutable std::optional<std::chrono::system_clock::time_point> m_date;
+    mutable std::optional<std::chrono::system_clock::time_point> m_expires;
+    mutable std::optional<std::chrono::system_clock::time_point> m_lastModified;
     mutable ParsedContentRange m_contentRange;
     mutable CacheControlDirectives m_cacheControlDirectives;
 
diff --git a/Source/WebCore/platform/network/SocketStreamHandle.h b/Source/WebCore/platform/network/SocketStreamHandle.h
index a2dbb9c..fbad641 100644
--- a/Source/WebCore/platform/network/SocketStreamHandle.h
+++ b/Source/WebCore/platform/network/SocketStreamHandle.h
@@ -54,7 +54,7 @@
     SocketStreamHandle(const URL&, SocketStreamHandleClient&);
 
     bool sendPendingData();
-    virtual Optional<size_t> platformSend(const char* data, size_t length) = 0;
+    virtual std::optional<size_t> platformSend(const char* data, size_t length) = 0;
     virtual void platformClose() = 0;
 
     URL m_url;
diff --git a/Source/WebCore/platform/network/SocketStreamHandleClient.h b/Source/WebCore/platform/network/SocketStreamHandleClient.h
index 4c42d85..e26b9a6 100644
--- a/Source/WebCore/platform/network/SocketStreamHandleClient.h
+++ b/Source/WebCore/platform/network/SocketStreamHandleClient.h
@@ -44,7 +44,7 @@
 
     virtual void didOpenSocketStream(SocketStreamHandle&) = 0;
     virtual void didCloseSocketStream(SocketStreamHandle&) = 0;
-    virtual void didReceiveSocketStreamData(SocketStreamHandle&, const char* data, Optional<size_t> length) = 0;
+    virtual void didReceiveSocketStreamData(SocketStreamHandle&, const char* data, std::optional<size_t> length) = 0;
     virtual void didUpdateBufferedAmount(SocketStreamHandle&, size_t bufferedAmount) = 0;
     virtual void didFailSocketStream(SocketStreamHandle&, const SocketStreamError&) = 0;
 };
diff --git a/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
index 876cf24..4edd390 100644
--- a/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
+++ b/Source/WebCore/platform/network/cf/SocketStreamHandleImpl.h
@@ -50,7 +50,7 @@
     virtual ~SocketStreamHandleImpl();
 
 private:
-    virtual Optional<size_t> platformSend(const char* data, size_t length);
+    virtual std::optional<size_t> platformSend(const char* data, size_t length);
     virtual void platformClose();
 
     WEBCORE_EXPORT SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&, SessionID);
diff --git a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
index ba39cdb..ccb14ea 100644
--- a/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
+++ b/Source/WebCore/platform/network/cf/SocketStreamHandleImplCFNet.cpp
@@ -536,7 +536,7 @@
         if (!length)
             return;
 
-        Optional<size_t> optionalLength;
+        std::optional<size_t> optionalLength;
         if (length != -1)
             optionalLength = length;
         
@@ -653,14 +653,14 @@
     ASSERT(!m_pacRunLoopSource);
 }
 
-Optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
+std::optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
 {
     if (!CFWriteStreamCanAcceptBytes(m_writeStream.get()))
-        return Nullopt;
+        return std::nullopt;
 
     CFIndex result = CFWriteStreamWrite(m_writeStream.get(), reinterpret_cast<const UInt8*>(data), length);
     if (result == -1)
-        return Nullopt;
+        return std::nullopt;
 
     ASSERT(result >= 0);
     return static_cast<size_t>(result);
diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h
index 754a236..626480f 100644
--- a/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h
+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleImpl.h
@@ -57,7 +57,7 @@
 private:
     SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&);
 
-    Optional<size_t> platformSend(const char* data, size_t length) final;
+    std::optional<size_t> platformSend(const char* data, size_t length) final;
     void platformClose() final;
 
     bool readData(CURL*);
diff --git a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp
index 57a6a73..e94f84a 100644
--- a/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp
+++ b/Source/WebCore/platform/network/curl/SocketStreamHandleImplCurl.cpp
@@ -66,7 +66,7 @@
     ASSERT(!m_workerThread);
 }
 
-Optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
+std::optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
 {
     LOG(Network, "SocketStreamHandle %p platformSend", this);
 
diff --git a/Source/WebCore/platform/network/mac/CookieJarMac.mm b/Source/WebCore/platform/network/mac/CookieJarMac.mm
index a4cdadf..c7cc0f0 100644
--- a/Source/WebCore/platform/network/mac/CookieJarMac.mm
+++ b/Source/WebCore/platform/network/mac/CookieJarMac.mm
@@ -115,7 +115,7 @@
         cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
 
     // The _getCookiesForURL: method calls the completionHandler synchronously.
-    Optional<RetainPtr<NSArray *>> cookiesPtr;
+    std::optional<RetainPtr<NSArray *>> cookiesPtr;
     [cookieStorage _getCookiesForURL:url mainDocumentURL:firstParty partition:partition completionHandler:[&cookiesPtr](NSArray *cookies) {
         cookiesPtr = retainPtr(cookies);
     }];
diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h
index 7f03846..5810d9b 100644
--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h
+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImpl.h
@@ -55,7 +55,7 @@
 private:
     SocketStreamHandleImpl(const URL&, SocketStreamHandleClient&);
 
-    Optional<size_t> platformSend(const char* data, size_t length) final;
+    std::optional<size_t> platformSend(const char* data, size_t length) final;
     void platformClose() final;
 
     void beginWaitingForSocketWritability();
diff --git a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
index 087dafd..2411323 100644
--- a/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
+++ b/Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
@@ -128,7 +128,7 @@
 
     // The client can close the handle, potentially removing the last reference.
     RefPtr<SocketStreamHandle> protectedThis(this);
-    Optional<size_t> optionalLength;
+    std::optional<size_t> optionalLength;
     if (bytesRead != -1)
         optionalLength = static_cast<size_t>(bytesRead);
     m_client.didReceiveSocketStreamData(*this, m_readBuffer.get(), optionalLength);
@@ -171,11 +171,11 @@
     sendPendingData();
 }
 
-Optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
+std::optional<size_t> SocketStreamHandleImpl::platformSend(const char* data, size_t length)
 {
     LOG(Network, "SocketStreamHandle %p platformSend", this);
     if (!m_outputStream || !data)
-        return Nullopt;
+        return std::nullopt;
 
     GUniqueOutPtr<GError> error;
     gssize written = g_pollable_output_stream_write_nonblocking(m_outputStream.get(), data, length, m_cancellable.get(), &error.outPtr());
@@ -184,7 +184,7 @@
             beginWaitingForSocketWritability();
         else
             didFail(SocketStreamError(error->code, String(), error->message));
-        return Nullopt;
+        return std::nullopt;
     }
 
     // If we did not send all the bytes we were given, we know that
@@ -193,7 +193,7 @@
         beginWaitingForSocketWritability();
 
     if (written == -1)
-        return Nullopt;
+        return std::nullopt;
 
     return static_cast<size_t>(written);
 }
diff --git a/Source/WebCore/rendering/BreakLines.h b/Source/WebCore/rendering/BreakLines.h
index f261795..88d7e99 100644
--- a/Source/WebCore/rendering/BreakLines.h
+++ b/Source/WebCore/rendering/BreakLines.h
@@ -85,7 +85,7 @@
 template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
 inline unsigned nextBreakablePositionNonLoosely(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition)
 {
-    Optional<unsigned> nextBreak;
+    std::optional<unsigned> nextBreak;
 
     CharacterType lastLastCharacter = startPosition > 1 ? string[startPosition - 2] : static_cast<CharacterType>(lazyBreakIterator.secondToLastCharacter());
     CharacterType lastCharacter = startPosition > 0 ? string[startPosition - 1] : static_cast<CharacterType>(lazyBreakIterator.lastCharacter());
@@ -106,7 +106,7 @@
                     if (breakIterator) {
                         int candidate = textBreakFollowing(breakIterator, i - 1 + priorContextLength);
                         if (candidate == TextBreakDone)
-                            nextBreak = Nullopt;
+                            nextBreak = std::nullopt;
                         else {
                             unsigned result = candidate;
                             ASSERT(result >= priorContextLength);
@@ -132,7 +132,7 @@
 template<typename CharacterType, NonBreakingSpaceBehavior nonBreakingSpaceBehavior>
 static inline unsigned nextBreakablePositionLoosely(LazyLineBreakIterator& lazyBreakIterator, const CharacterType* string, unsigned length, unsigned startPosition)
 {
-    Optional<unsigned> nextBreak;
+    std::optional<unsigned> nextBreak;
 
     CharacterType lastCharacter = startPosition > 0 ? string[startPosition - 1] : static_cast<CharacterType>(lazyBreakIterator.lastCharacter());
     unsigned priorContextLength = lazyBreakIterator.priorContextLength();
@@ -152,7 +152,7 @@
                     ASSERT(i + priorContextLength >= 1);
                     int candidate = textBreakFollowing(breakIterator, i + priorContextLength - 1);
                     if (candidate == TextBreakDone)
-                        nextBreak = Nullopt;
+                        nextBreak = std::nullopt;
                     else {
                         unsigned result = candidate;
                         ASSERT(result > priorContextLength);
@@ -228,7 +228,7 @@
     return nextBreakablePositionLoosely<UChar, NonBreakingSpaceBehavior::IgnoreNonBreakingSpace>(lazyBreakIterator, stringView.characters16(), stringView.length(), startPosition);
 }
 
-inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, Optional<unsigned>& nextBreakable, bool breakNBSP, bool isLooseMode, bool keepAllWords)
+inline bool isBreakable(LazyLineBreakIterator& lazyBreakIterator, unsigned startPosition, std::optional<unsigned>& nextBreakable, bool breakNBSP, bool isLooseMode, bool keepAllWords)
 {
     if (nextBreakable && nextBreakable.value() >= startPosition)
         return startPosition == nextBreakable;
diff --git a/Source/WebCore/rendering/HitTestingTransformState.cpp b/Source/WebCore/rendering/HitTestingTransformState.cpp
index ff90450..6316b3a 100644
--- a/Source/WebCore/rendering/HitTestingTransformState.cpp
+++ b/Source/WebCore/rendering/HitTestingTransformState.cpp
@@ -55,7 +55,7 @@
 
 void HitTestingTransformState::flattenWithTransform(const TransformationMatrix& t)
 {
-    if (Optional<TransformationMatrix> inverse = t.inverse()) {
+    if (std::optional<TransformationMatrix> inverse = t.inverse()) {
         m_lastPlanarPoint = inverse.value().projectPoint(m_lastPlanarPoint);
         m_lastPlanarQuad = inverse.value().projectQuad(m_lastPlanarQuad);
         m_lastPlanarArea = inverse.value().projectQuad(m_lastPlanarArea);
diff --git a/Source/WebCore/rendering/ImageQualityController.cpp b/Source/WebCore/rendering/ImageQualityController.cpp
index 4ecd85a..a1fe8fc 100644
--- a/Source/WebCore/rendering/ImageQualityController.cpp
+++ b/Source/WebCore/rendering/ImageQualityController.cpp
@@ -97,7 +97,7 @@
     m_timer.startOneShot(cLowQualityTimeThreshold);
 }
 
-Optional<InterpolationQuality> ImageQualityController::interpolationQualityFromStyle(const RenderStyle& style)
+std::optional<InterpolationQuality> ImageQualityController::interpolationQualityFromStyle(const RenderStyle& style)
 {
     switch (style.imageRendering()) {
     case ImageRenderingOptimizeSpeed:
@@ -110,7 +110,7 @@
     case ImageRenderingAuto:
         break;
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
 InterpolationQuality ImageQualityController::chooseInterpolationQuality(GraphicsContext& context, RenderBoxModelObject* object, Image& image, const void *layer, const LayoutSize& size)
@@ -119,7 +119,7 @@
     if (!(image.isBitmapImage() || image.isPDFDocumentImage()) || context.paintingDisabled())
         return InterpolationDefault;
 
-    if (Optional<InterpolationQuality> styleInterpolation = interpolationQualityFromStyle(object->style()))
+    if (std::optional<InterpolationQuality> styleInterpolation = interpolationQualityFromStyle(object->style()))
         return styleInterpolation.value();
 
     // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image
diff --git a/Source/WebCore/rendering/ImageQualityController.h b/Source/WebCore/rendering/ImageQualityController.h
index 2b1a445..eb4f153 100644
--- a/Source/WebCore/rendering/ImageQualityController.h
+++ b/Source/WebCore/rendering/ImageQualityController.h
@@ -44,7 +44,7 @@
 public:
     explicit ImageQualityController(const RenderView&);
 
-    static Optional<InterpolationQuality> interpolationQualityFromStyle(const RenderStyle&);
+    static std::optional<InterpolationQuality> interpolationQualityFromStyle(const RenderStyle&);
     InterpolationQuality chooseInterpolationQuality(GraphicsContext&, RenderBoxModelObject*, Image&, const void* layer, const LayoutSize&);
 
     void rendererWillBeDestroyed(RenderBoxModelObject& renderer) { removeObject(&renderer); }
diff --git a/Source/WebCore/rendering/InlineIterator.h b/Source/WebCore/rendering/InlineIterator.h
index a7ad816..f366b3c 100644
--- a/Source/WebCore/rendering/InlineIterator.h
+++ b/Source/WebCore/rendering/InlineIterator.h
@@ -74,7 +74,7 @@
         moveTo(object, 0);
     }
 
-    void moveTo(RenderObject& object, unsigned offset, Optional<unsigned> nextBreak = Optional<unsigned>())
+    void moveTo(RenderObject& object, unsigned offset, std::optional<unsigned> nextBreak = std::optional<unsigned>())
     {
         setRenderer(&object);
         setOffset(offset);
@@ -86,8 +86,8 @@
     unsigned offset() const { return m_pos; }
     void setOffset(unsigned position);
     RenderElement* root() const { return m_root; }
-    Optional<unsigned> nextBreakablePosition() const { return m_nextBreakablePosition; }
-    void setNextBreakablePosition(Optional<unsigned> position) { m_nextBreakablePosition = position; }
+    std::optional<unsigned> nextBreakablePosition() const { return m_nextBreakablePosition; }
+    void setNextBreakablePosition(std::optional<unsigned> position) { m_nextBreakablePosition = position; }
     bool refersToEndOfPreviousNode() const { return m_refersToEndOfPreviousNode; }
     void setRefersToEndOfPreviousNode();
 
@@ -118,7 +118,7 @@
     RenderElement* m_root { nullptr };
     RenderObject* m_renderer { nullptr };
 
-    Optional<unsigned> m_nextBreakablePosition;
+    std::optional<unsigned> m_nextBreakablePosition;
     unsigned m_pos { 0 };
 
     // There are a couple places where we want to decrement an InlineIterator.
diff --git a/Source/WebCore/rendering/InlineTextBox.cpp b/Source/WebCore/rendering/InlineTextBox.cpp
index 23adcd3..3f30555 100644
--- a/Source/WebCore/rendering/InlineTextBox.cpp
+++ b/Source/WebCore/rendering/InlineTextBox.cpp
@@ -650,7 +650,7 @@
     bool respectHyphen = selectionEnd == length && hasHyphen();
     if (respectHyphen)
         hyphenatedString = hyphenatedStringForTextRun(style, length);
-    TextRun textRun = constructTextRun(style, hyphenatedString, Optional<unsigned>(length));
+    TextRun textRun = constructTextRun(style, hyphenatedString, std::optional<unsigned>(length));
     if (respectHyphen)
         selectionEnd = textRun.length();
 
@@ -1015,18 +1015,18 @@
     return snapRectToDevicePixelsWithWritingDirection(selectionRect, renderer().document().deviceScaleFactor(), run.ltr()).maxX();
 }
 
-StringView InlineTextBox::substringToRender(Optional<unsigned> overridingLength) const
+StringView InlineTextBox::substringToRender(std::optional<unsigned> overridingLength) const
 {
-    return StringView(renderer().text()).substring(start(), overridingLength.valueOr(len()));
+    return StringView(renderer().text()).substring(start(), overridingLength.value_or(len()));
 }
 
-String InlineTextBox::hyphenatedStringForTextRun(const RenderStyle& style, Optional<unsigned> alternateLength) const
+String InlineTextBox::hyphenatedStringForTextRun(const RenderStyle& style, std::optional<unsigned> alternateLength) const
 {
     ASSERT(hasHyphen());
     return makeString(substringToRender(alternateLength), style.hyphenString());
 }
 
-TextRun InlineTextBox::constructTextRun(const RenderStyle& style, StringView alternateStringToRender, Optional<unsigned> alternateLength) const
+TextRun InlineTextBox::constructTextRun(const RenderStyle& style, StringView alternateStringToRender, std::optional<unsigned> alternateLength) const
 {
     if (alternateStringToRender.isNull())
         return constructTextRun(style, substringToRender(alternateLength), renderer().textLength() - start());
diff --git a/Source/WebCore/rendering/InlineTextBox.h b/Source/WebCore/rendering/InlineTextBox.h
index 6a97232..9c4618a 100644
--- a/Source/WebCore/rendering/InlineTextBox.h
+++ b/Source/WebCore/rendering/InlineTextBox.h
@@ -106,9 +106,9 @@
     LayoutUnit selectionBottom() const;
     LayoutUnit selectionHeight() const;
 
-    StringView substringToRender(Optional<unsigned> overridingLength = { }) const;
-    String hyphenatedStringForTextRun(const RenderStyle&, Optional<unsigned> alternateLength = { }) const;
-    TextRun constructTextRun(const RenderStyle&, StringView alternateStringToRender = { }, Optional<unsigned> alternateLength = { }) const;
+    StringView substringToRender(std::optional<unsigned> overridingLength = { }) const;
+    String hyphenatedStringForTextRun(const RenderStyle&, std::optional<unsigned> alternateLength = { }) const;
+    TextRun constructTextRun(const RenderStyle&, StringView alternateStringToRender = { }, std::optional<unsigned> alternateLength = { }) const;
     TextRun constructTextRun(const RenderStyle&, StringView, unsigned maximumLength) const;
 
 public:
diff --git a/Source/WebCore/rendering/OrderIterator.cpp b/Source/WebCore/rendering/OrderIterator.cpp
index 2f94f85..fade938 100644
--- a/Source/WebCore/rendering/OrderIterator.cpp
+++ b/Source/WebCore/rendering/OrderIterator.cpp
@@ -73,7 +73,7 @@
 void OrderIterator::reset()
 {
     m_currentChild = nullptr;
-    m_orderIndex = Nullopt;
+    m_orderIndex = std::nullopt;
 }
 
 OrderIteratorPopulator::OrderIteratorPopulator(OrderIterator& iterator)
diff --git a/Source/WebCore/rendering/OrderIterator.h b/Source/WebCore/rendering/OrderIterator.h
index 378ec52..47cd27a 100644
--- a/Source/WebCore/rendering/OrderIterator.h
+++ b/Source/WebCore/rendering/OrderIterator.h
@@ -56,7 +56,7 @@
     RenderBox* m_currentChild;
 
     Vector<int, 1> m_orderValues;
-    Optional<size_t> m_orderIndex;
+    std::optional<size_t> m_orderIndex;
 };
 
 class OrderIteratorPopulator {
diff --git a/Source/WebCore/rendering/PaintInfo.h b/Source/WebCore/rendering/PaintInfo.h
index 8e30707..84d46b6 100644
--- a/Source/WebCore/rendering/PaintInfo.h
+++ b/Source/WebCore/rendering/PaintInfo.h
@@ -108,7 +108,7 @@
         if (rect.isInfinite())
             return;
 
-        FloatRect tranformedRect(localToAncestorTransform.inverse().valueOr(AffineTransform()).mapRect(rect));
+        FloatRect tranformedRect(localToAncestorTransform.inverse().value_or(AffineTransform()).mapRect(rect));
         rect.setLocation(LayoutPoint(tranformedRect.location()));
         rect.setSize(LayoutSize(tranformedRect.size()));
     }
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp
index 851a047..2001b00 100644
--- a/Source/WebCore/rendering/RenderBlock.cpp
+++ b/Source/WebCore/rendering/RenderBlock.cpp
@@ -248,14 +248,14 @@
     RenderBlockRareData()
         : m_paginationStrut(0)
         , m_pageLogicalOffset(0)
-        , m_flowThreadContainingBlock(Nullopt)
+        , m_flowThreadContainingBlock(std::nullopt)
     {
     }
 
     LayoutUnit m_paginationStrut;
     LayoutUnit m_pageLogicalOffset;
 
-    Optional<RenderFlowThread*> m_flowThreadContainingBlock;
+    std::optional<RenderFlowThread*> m_flowThreadContainingBlock;
 };
 
 typedef HashMap<const RenderBlock*, std::unique_ptr<RenderBlockRareData>> RenderBlockRareDataMap;
@@ -2944,7 +2944,7 @@
         bool ignoreBaseline = (layer() && (layer()->marquee() || (direction == HorizontalLine ? (layer()->verticalScrollbar() || layer()->scrollOffset().y() != 0)
             : (layer()->horizontalScrollbar() || layer()->scrollOffset().x() != 0)))) || (isWritingModeRoot() && !isRubyRun());
         
-        Optional<int> baselinePos = ignoreBaseline ? Optional<int>() : inlineBlockBaseline(direction);
+        std::optional<int> baselinePos = ignoreBaseline ? std::optional<int>() : inlineBlockBaseline(direction);
         
         if (isDeprecatedFlexibleBox()) {
             // Historically, we did this check for all baselines. But we can't
@@ -2954,7 +2954,7 @@
             // For simplicity, we use this for all uses of deprecated flexbox.
             LayoutUnit bottomOfContent = direction == HorizontalLine ? borderTop() + paddingTop() + contentHeight() : borderRight() + paddingRight() + contentWidth();
             if (baselinePos && baselinePos.value() > bottomOfContent)
-                baselinePos = Optional<int>();
+                baselinePos = std::optional<int>();
         }
         if (baselinePos)
             return direction == HorizontalLine ? marginTop() + baselinePos.value() : marginRight() + baselinePos.value();
@@ -2979,43 +2979,43 @@
     return std::max<LayoutUnit>(replacedHeight, lineHeight(isFirstLine, isHorizontalWritingMode() ? HorizontalLine : VerticalLine, PositionOfInteriorLineBoxes));
 }
 
-Optional<int> RenderBlock::firstLineBaseline() const
+std::optional<int> RenderBlock::firstLineBaseline() const
 {
     if (isWritingModeRoot() && !isRubyRun())
-        return Optional<int>();
+        return std::optional<int>();
 
     for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) {
         if (!curr->isFloatingOrOutOfFlowPositioned()) {
-            if (Optional<int> result = curr->firstLineBaseline())
-                return Optional<int>(curr->logicalTop() + result.value()); // Translate to our coordinate space.
+            if (std::optional<int> result = curr->firstLineBaseline())
+                return std::optional<int>(curr->logicalTop() + result.value()); // Translate to our coordinate space.
         }
     }
 
-    return Optional<int>();
+    return std::optional<int>();
 }
 
-Optional<int> RenderBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const
+std::optional<int> RenderBlock::inlineBlockBaseline(LineDirectionMode lineDirection) const
 {
     if (isWritingModeRoot() && !isRubyRun())
-        return Optional<int>();
+        return std::optional<int>();
 
     bool haveNormalFlowChild = false;
     for (auto* box = lastChildBox(); box; box = box->previousSiblingBox()) {
         if (box->isFloatingOrOutOfFlowPositioned())
             continue;
         haveNormalFlowChild = true;
-        if (Optional<int> result = box->inlineBlockBaseline(lineDirection))
-            return Optional<int>(box->logicalTop() + result.value()); // Translate to our coordinate space.
+        if (std::optional<int> result = box->inlineBlockBaseline(lineDirection))
+            return std::optional<int>(box->logicalTop() + result.value()); // Translate to our coordinate space.
     }
 
     if (!haveNormalFlowChild && hasLineIfEmpty()) {
         auto& fontMetrics = firstLineStyle().fontMetrics();
-        return Optional<int>(fontMetrics.ascent()
+        return std::optional<int>(fontMetrics.ascent()
             + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
             + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight()));
     }
 
-    return Optional<int>();
+    return std::optional<int>();
 }
 
 static inline bool isRenderBlockFlowOrRenderButton(RenderElement& renderElement)
@@ -3354,7 +3354,7 @@
 void RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate()
 {
     RenderBlockRareData& rareData = ensureBlockRareData(this);
-    rareData.m_flowThreadContainingBlock = Nullopt;
+    rareData.m_flowThreadContainingBlock = std::nullopt;
 }
 
 RenderFlowThread* RenderBlock::updateCachedFlowThreadContainingBlock(RenderFlowThread* flowThread) const
diff --git a/Source/WebCore/rendering/RenderBlock.h b/Source/WebCore/rendering/RenderBlock.h
index 4e78667..1af6a89 100644
--- a/Source/WebCore/rendering/RenderBlock.h
+++ b/Source/WebCore/rendering/RenderBlock.h
@@ -341,8 +341,8 @@
     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
     void computePreferredLogicalWidths() override;
     
-    Optional<int> firstLineBaseline() const override;
-    Optional<int> inlineBlockBaseline(LineDirectionMode) const override;
+    std::optional<int> firstLineBaseline() const override;
+    std::optional<int> inlineBlockBaseline(LineDirectionMode) const override;
 
     // Delay updating scrollbars until endAndCommitUpdateScrollInfoAfterLayoutTransaction() is called. These functions are used
     // when a flexbox is laying out its descendants. If multiple calls are made to beginUpdateScrollInfoAfterLayoutTransaction()
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 23ef1d9..6784951 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -3034,43 +3034,43 @@
     }
 }
 
-Optional<int> RenderBlockFlow::firstLineBaseline() const
+std::optional<int> RenderBlockFlow::firstLineBaseline() const
 {
     if (isWritingModeRoot() && !isRubyRun())
-        return Optional<int>();
+        return std::optional<int>();
 
     if (!childrenInline())
         return RenderBlock::firstLineBaseline();
 
     if (!hasLines())
-        return Optional<int>();
+        return std::optional<int>();
 
     if (auto simpleLineLayout = this->simpleLineLayout())
-        return Optional<int>(SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout));
+        return std::optional<int>(SimpleLineLayout::computeFlowFirstLineBaseline(*this, *simpleLineLayout));
 
     ASSERT(firstRootBox());
     return firstRootBox()->logicalTop() + firstLineStyle().fontMetrics().ascent(firstRootBox()->baselineType());
 }
 
-Optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const
+std::optional<int> RenderBlockFlow::inlineBlockBaseline(LineDirectionMode lineDirection) const
 {
     if (isWritingModeRoot() && !isRubyRun())
-        return Optional<int>();
+        return std::optional<int>();
 
     // Note that here we only take the left and bottom into consideration. Our caller takes the right and top into consideration.
     float boxHeight = lineDirection == HorizontalLine ? height() + m_marginBox.bottom() : width() + m_marginBox.left();
     float lastBaseline;
     if (!childrenInline()) {
-        Optional<int> inlineBlockBaseline = RenderBlock::inlineBlockBaseline(lineDirection);
+        std::optional<int> inlineBlockBaseline = RenderBlock::inlineBlockBaseline(lineDirection);
         if (!inlineBlockBaseline)
             return inlineBlockBaseline;
         lastBaseline = inlineBlockBaseline.value();
     } else {
         if (!hasLines()) {
             if (!hasLineIfEmpty())
-                return Optional<int>();
+                return std::optional<int>();
             const auto& fontMetrics = firstLineStyle().fontMetrics();
-            return Optional<int>(fontMetrics.ascent()
+            return std::optional<int>(fontMetrics.ascent()
                 + (lineHeight(true, lineDirection, PositionOfInteriorLineBoxes) - fontMetrics.height()) / 2
                 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : borderRight() + paddingRight()));
         }
@@ -3086,7 +3086,7 @@
     // According to the CSS spec http://www.w3.org/TR/CSS21/visudet.html, we shouldn't be performing this min, but should
     // instead be returning boxHeight directly. However, we feel that a min here is better behavior (and is consistent
     // enough with the spec to not cause tons of breakages).
-    return Optional<int>(style().overflowY() == OVISIBLE ? lastBaseline : std::min(boxHeight, lastBaseline));
+    return std::optional<int>(style().overflowY() == OVISIBLE ? lastBaseline : std::min(boxHeight, lastBaseline));
 }
 
 void RenderBlockFlow::setSelectionState(SelectionState state)
diff --git a/Source/WebCore/rendering/RenderBlockFlow.h b/Source/WebCore/rendering/RenderBlockFlow.h
index 1a7a830..71b4311 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.h
+++ b/Source/WebCore/rendering/RenderBlockFlow.h
@@ -447,8 +447,8 @@
 
     void createFloatingObjects();
 
-    Optional<int> firstLineBaseline() const override;
-    Optional<int> inlineBlockBaseline(LineDirectionMode) const override;
+    std::optional<int> firstLineBaseline() const override;
+    std::optional<int> inlineBlockBaseline(LineDirectionMode) const override;
 
     bool isMultiColumnBlockFlow() const override { return multiColumnFlowThread(); }
     
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 017d802..d6646e47 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -97,7 +97,7 @@
 
 #if ENABLE(CSS_GRID_LAYOUT)
 // Used by grid elements to properly size their grid items.
-typedef WTF::HashMap<const RenderBox*, Optional<LayoutUnit>> OverrideOptionalSizeMap;
+typedef WTF::HashMap<const RenderBox*, std::optional<LayoutUnit>> OverrideOptionalSizeMap;
 static OverrideOptionalSizeMap* gOverrideContainingBlockLogicalHeightMap = nullptr;
 static OverrideOptionalSizeMap* gOverrideContainingBlockLogicalWidthMap = nullptr;
 static OverrideSizeMap* gExtraInlineOffsetMap = nullptr;
@@ -656,26 +656,26 @@
     return std::max(logicalWidth, computeLogicalWidthInRegionUsing(MinSize, styleToUse.logicalMinWidth(), availableWidth, cb, region));
 }
 
-LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const
+LayoutUnit RenderBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const
 {
     const RenderStyle& styleToUse = style();
     if (!styleToUse.logicalMaxHeight().isUndefined()) {
-        if (Optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
+        if (std::optional<LayoutUnit> maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
             logicalHeight = std::min(logicalHeight, maxH.value());
     }
-    if (Optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
+    if (std::optional<LayoutUnit> computedLogicalHeight = computeLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
         return std::max(logicalHeight, computedLogicalHeight.value());
     return logicalHeight;
 }
 
-LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const
+LayoutUnit RenderBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const
 {
     const RenderStyle& styleToUse = style();
     if (!styleToUse.logicalMaxHeight().isUndefined()) {
-        if (Optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
+        if (std::optional<LayoutUnit> maxH = computeContentLogicalHeight(MaxSize, styleToUse.logicalMaxHeight(), intrinsicContentHeight))
             logicalHeight = std::min(logicalHeight, maxH.value());
     }
-    if (Optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
+    if (std::optional<LayoutUnit> computedContentLogicalHeight = computeContentLogicalHeight(MinSize, styleToUse.logicalMinHeight(), intrinsicContentHeight))
         return std::max(logicalHeight, computedContentLogicalHeight.value());
     return logicalHeight;
 }
@@ -1112,13 +1112,13 @@
 }
 
 #if ENABLE(CSS_GRID_LAYOUT)
-Optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalWidth() const
+std::optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalWidth() const
 {
     ASSERT(hasOverrideContainingBlockLogicalWidth());
     return gOverrideContainingBlockLogicalWidthMap->get(this);
 }
 
-Optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalHeight() const
+std::optional<LayoutUnit> RenderBox::overrideContainingBlockContentLogicalHeight() const
 {
     ASSERT(hasOverrideContainingBlockLogicalHeight());
     return gOverrideContainingBlockLogicalHeightMap->get(this);
@@ -1134,14 +1134,14 @@
     return gOverrideContainingBlockLogicalHeightMap && gOverrideContainingBlockLogicalHeightMap->contains(this);
 }
 
-void RenderBox::setOverrideContainingBlockContentLogicalWidth(Optional<LayoutUnit> logicalWidth)
+void RenderBox::setOverrideContainingBlockContentLogicalWidth(std::optional<LayoutUnit> logicalWidth)
 {
     if (!gOverrideContainingBlockLogicalWidthMap)
         gOverrideContainingBlockLogicalWidthMap = new OverrideOptionalSizeMap;
     gOverrideContainingBlockLogicalWidthMap->set(this, logicalWidth);
 }
 
-void RenderBox::setOverrideContainingBlockContentLogicalHeight(Optional<LayoutUnit> logicalHeight)
+void RenderBox::setOverrideContainingBlockContentLogicalHeight(std::optional<LayoutUnit> logicalHeight)
 {
     if (!gOverrideContainingBlockLogicalHeightMap)
         gOverrideContainingBlockLogicalHeightMap = new OverrideOptionalSizeMap;
@@ -1217,7 +1217,7 @@
     return std::max<LayoutUnit>(0, width);
 }
 
-LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const
+LayoutUnit RenderBox::adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const
 {
     if (!height)
         return 0;
@@ -2862,7 +2862,7 @@
         LayoutUnit heightResult;
         if (checkMinMaxHeight) {
             LayoutUnit intrinsicHeight = computedValues.m_extent - borderAndPaddingLogicalHeight();
-            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
+            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).value_or(computedValues.m_extent);
             heightResult = constrainLogicalHeightByMinMax(heightResult, intrinsicHeight);
         } else {
             // The only times we don't check min/max height are when a fixed length has
@@ -2901,21 +2901,21 @@
     }
 }
 
-Optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
+std::optional<LayoutUnit> RenderBox::computeLogicalHeightUsing(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const
 {
-    if (Optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
+    if (std::optional<LayoutUnit> logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
         return adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight.value());
-    return Nullopt;
+    return std::nullopt;
 }
 
-Optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
+std::optional<LayoutUnit> RenderBox::computeContentLogicalHeight(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const
 {
-    if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
+    if (std::optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(heightType, height, intrinsicContentHeight))
         return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
-    return Nullopt;
+    return std::nullopt;
 }
 
-Optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const
+std::optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const
 {
     // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
     // If that happens, this code will have to change.
@@ -2932,10 +2932,10 @@
     return LayoutUnit(0);
 }
 
-Optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const
+std::optional<LayoutUnit> RenderBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heightType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const
 {
     if (height.isAuto())
-        return heightType == MinSize ? Optional<LayoutUnit>(0) : Nullopt;
+        return heightType == MinSize ? std::optional<LayoutUnit>(0) : std::nullopt;
     // FIXME: The CSS sizing spec is considering changing what min-content/max-content should resolve to.
     // If that happens, this code will have to change.
     if (height.isIntrinsic())
@@ -2944,7 +2944,7 @@
         return LayoutUnit(height.value());
     if (height.isPercentOrCalculated())
         return computePercentageLogicalHeight(height);
-    return Nullopt;
+    return std::nullopt;
 }
 
 bool RenderBox::skipContainingBlockForPercentHeightCalculation(const RenderBox& containingBlock, bool isPerpendicularWritingMode) const
@@ -2974,9 +2974,9 @@
     return scrollsOverflowY && (!cell.style().logicalHeight().isAuto() || !cell.table()->style().logicalHeight().isAuto());
 }
 
-Optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length& height) const
+std::optional<LayoutUnit> RenderBox::computePercentageLogicalHeight(const Length& height) const
 {
-    Optional<LayoutUnit> availableHeight;
+    std::optional<LayoutUnit> availableHeight;
 
     bool skippedAutoHeightContainingBlock = false;
     RenderBlock* cb = containingBlock();
@@ -3014,23 +3014,23 @@
             // don't care if the cell specified a height or not. We just always make ourselves
             // be a percentage of the cell's current content height.
             if (!cb->hasOverrideLogicalContentHeight())
-                return tableCellShouldHaveZeroInitialSize(*cb, scrollsOverflowY()) ? Optional<LayoutUnit>() : Nullopt;
+                return tableCellShouldHaveZeroInitialSize(*cb, scrollsOverflowY()) ? std::optional<LayoutUnit>() : std::nullopt;
 
             availableHeight = cb->overrideLogicalContentHeight();
             includeBorderPadding = true;
         }
     } else if (cbstyle.logicalHeight().isFixed()) {
         LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(LayoutUnit(cbstyle.logicalHeight().value()));
-        availableHeight = std::max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), Nullopt));
+        availableHeight = std::max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight(), std::nullopt));
     } else if (cbstyle.logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight) {
         // We need to recur and compute the percentage height for our containing block.
-        if (Optional<LayoutUnit> heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight())) {
+        if (std::optional<LayoutUnit> heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight())) {
             LayoutUnit contentBoxHeightWithScrollbar = cb->adjustContentBoxLogicalHeightForBoxSizing(heightWithScrollbar);
             // We need to adjust for min/max height because this method does not
             // handle the min/max of the current block, its caller does. So the
             // return value from the recursive call will not have been adjusted
             // yet.
-            LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight(), Nullopt);
+            LayoutUnit contentBoxHeight = cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeightWithScrollbar - cb->scrollbarLogicalHeight(), std::nullopt);
             availableHeight = std::max<LayoutUnit>(0, contentBoxHeight);
         }
     } else if (isOutOfFlowPositionedWithSpecifiedHeight) {
@@ -3133,7 +3133,7 @@
 {
     ASSERT(heightType == MinSize || heightType == MainOrPreferredSize || !logicalHeight.isAuto());
     if (heightType == MinSize && logicalHeight.isAuto())
-        return adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit>(0));
+        return adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit>(0));
 
     switch (logicalHeight.type()) {
         case Fixed:
@@ -3197,7 +3197,7 @@
 
 LayoutUnit RenderBox::availableLogicalHeight(AvailableLogicalHeightType heightType) const
 {
-    return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), Nullopt);
+    return constrainLogicalHeightByMinMax(availableLogicalHeightUsing(style().logicalHeight(), heightType), std::nullopt);
 }
 
 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const
@@ -3217,7 +3217,7 @@
         return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight));
     }
 
-    if (Optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, Nullopt))
+    if (std::optional<LayoutUnit> heightIncludingScrollbar = computeContentAndScrollbarLogicalHeightUsing(MainOrPreferredSize, h, std::nullopt))
         return std::max<LayoutUnit>(0, adjustContentBoxLogicalHeightForBoxSizing(heightIncludingScrollbar) - scrollbarLogicalHeight());
 
     // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical writing-mode.
diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h
index 0529204..ae1dea9 100644
--- a/Source/WebCore/rendering/RenderBox.h
+++ b/Source/WebCore/rendering/RenderBox.h
@@ -87,8 +87,8 @@
     LayoutUnit logicalHeight() const { return style().isHorizontalWritingMode() ? height() : width(); }
 
     LayoutUnit constrainLogicalWidthInRegionByMinMax(LayoutUnit, LayoutUnit, RenderBlock&, RenderRegion* = nullptr) const;
-    LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const;
-    LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, Optional<LayoutUnit> intrinsicContentHeight) const;
+    LayoutUnit constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const;
+    LayoutUnit constrainContentBoxLogicalHeightByMinMax(LayoutUnit logicalHeight, std::optional<LayoutUnit> intrinsicContentHeight) const;
 
     void setLogicalLeft(LayoutUnit left)
     {
@@ -312,12 +312,12 @@
     void clearOverrideLogicalContentWidth();
 
 #if ENABLE(CSS_GRID_LAYOUT)
-    Optional<LayoutUnit> overrideContainingBlockContentLogicalWidth() const;
-    Optional<LayoutUnit> overrideContainingBlockContentLogicalHeight() const;
+    std::optional<LayoutUnit> overrideContainingBlockContentLogicalWidth() const;
+    std::optional<LayoutUnit> overrideContainingBlockContentLogicalHeight() const;
     bool hasOverrideContainingBlockLogicalWidth() const;
     bool hasOverrideContainingBlockLogicalHeight() const;
-    void setOverrideContainingBlockContentLogicalWidth(Optional<LayoutUnit>);
-    void setOverrideContainingBlockContentLogicalHeight(Optional<LayoutUnit>);
+    void setOverrideContainingBlockContentLogicalWidth(std::optional<LayoutUnit>);
+    void setOverrideContainingBlockContentLogicalHeight(std::optional<LayoutUnit>);
     void clearContainingBlockOverrideSize();
     void clearOverrideContainingBlockContentLogicalHeight();
     LayoutUnit extraInlineOffset() const;
@@ -332,7 +332,7 @@
     LayoutUnit adjustBorderBoxLogicalWidthForBoxSizing(LayoutUnit width) const;
     LayoutUnit adjustBorderBoxLogicalHeightForBoxSizing(LayoutUnit height) const;
     LayoutUnit adjustContentBoxLogicalWidthForBoxSizing(LayoutUnit width) const;
-    LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(Optional<LayoutUnit> height) const;
+    LayoutUnit adjustContentBoxLogicalHeightForBoxSizing(std::optional<LayoutUnit> height) const;
 
     struct ComputedMarginValues {
         ComputedMarginValues()
@@ -422,9 +422,9 @@
     LayoutUnit shrinkLogicalWidthToAvoidFloats(LayoutUnit childMarginStart, LayoutUnit childMarginEnd, const RenderBlock& cb, RenderRegion*) const;
 
     LayoutUnit computeLogicalWidthInRegionUsing(SizeType, Length logicalWidth, LayoutUnit availableLogicalWidth, const RenderBlock& containingBlock, RenderRegion*) const;
-    Optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
-    Optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
-    Optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, Optional<LayoutUnit> intrinsicContentHeight) const;
+    std::optional<LayoutUnit> computeLogicalHeightUsing(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const;
+    std::optional<LayoutUnit> computeContentLogicalHeight(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const;
+    std::optional<LayoutUnit> computeContentAndScrollbarLogicalHeightUsing(SizeType, const Length& height, std::optional<LayoutUnit> intrinsicContentHeight) const;
     LayoutUnit computeReplacedLogicalWidthUsing(SizeType, Length width) const;
     LayoutUnit computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred  = ComputeActual) const;
     LayoutUnit computeReplacedLogicalHeightUsing(SizeType, Length height) const;
@@ -436,7 +436,7 @@
     bool hasDefiniteLogicalWidth() const;
     static bool percentageLogicalHeightIsResolvableFromBlock(const RenderBlock& containingBlock, bool outOfFlowPositioned, bool scrollsOverflowY);
     bool hasDefiniteLogicalHeight() const;
-    Optional<LayoutUnit> computePercentageLogicalHeight(const Length& height) const;
+    std::optional<LayoutUnit> computePercentageLogicalHeight(const Length& height) const;
 
     virtual LayoutUnit availableLogicalWidth() const { return contentLogicalWidth(); }
     virtual LayoutUnit availableLogicalHeight(AvailableLogicalHeightType) const;
@@ -518,8 +518,8 @@
     
     RenderLayer* enclosingFloatPaintingLayer() const;
     
-    virtual Optional<int> firstLineBaseline() const { return Optional<int>(); }
-    virtual Optional<int> inlineBlockBaseline(LineDirectionMode) const { return Optional<int>(); } // Returns empty if we should skip this box when computing the baseline of an inline-block.
+    virtual std::optional<int> firstLineBaseline() const { return std::optional<int>(); }
+    virtual std::optional<int> inlineBlockBaseline(LineDirectionMode) const { return std::optional<int>(); } // Returns empty if we should skip this box when computing the baseline of an inline-block.
 
     bool shrinkToAvoidFloats() const;
     virtual bool avoidsFloats() const;
@@ -651,7 +651,7 @@
     void computePositionedLogicalWidth(LogicalExtentComputedValues&, RenderRegion* = nullptr) const;
 
     LayoutUnit computeIntrinsicLogicalWidthUsing(Length logicalWidthLength, LayoutUnit availableLogicalWidth, LayoutUnit borderAndPadding) const;
-    virtual Optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const;
+    virtual std::optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const;
     
     virtual bool shouldComputeSizeAsReplaced() const { return isReplaced() && !isInlineBlockOrInlineTable(); }
 
diff --git a/Source/WebCore/rendering/RenderCombineText.cpp b/Source/WebCore/rendering/RenderCombineText.cpp
index b503a13..126519f 100644
--- a/Source/WebCore/rendering/RenderCombineText.cpp
+++ b/Source/WebCore/rendering/RenderCombineText.cpp
@@ -71,10 +71,10 @@
     return RenderText::width(from, length, font, xPosition, fallbackFonts, glyphOverflow);
 }
 
-Optional<FloatPoint> RenderCombineText::computeTextOrigin(const FloatRect& boxRect) const
+std::optional<FloatPoint> RenderCombineText::computeTextOrigin(const FloatRect& boxRect) const
 {
     if (!m_isCombined)
-        return Nullopt;
+        return std::nullopt;
 
     // Visually center m_combinedTextWidth/Ascent/Descent within boxRect
     FloatPoint result = boxRect.minXMaxYCorner();
diff --git a/Source/WebCore/rendering/RenderCombineText.h b/Source/WebCore/rendering/RenderCombineText.h
index 2b8bcd2..072b81c 100644
--- a/Source/WebCore/rendering/RenderCombineText.h
+++ b/Source/WebCore/rendering/RenderCombineText.h
@@ -34,7 +34,7 @@
     Text& textNode() const { return downcast<Text>(nodeForNonAnonymous()); }
 
     void combineText();
-    Optional<FloatPoint> computeTextOrigin(const FloatRect& boxRect) const;
+    std::optional<FloatPoint> computeTextOrigin(const FloatRect& boxRect) const;
     String combinedStringForRendering() const;
     bool isCombined() const { return m_isCombined; }
     float combinedTextWidth(const FontCascade& font) const { return font.size(); }
diff --git a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
index 82adbcd..563e536 100644
--- a/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -433,7 +433,7 @@
 
             // Update our height and overflow height.
             if (style().boxAlign() == BBASELINE) {
-                LayoutUnit ascent = child->firstLineBaseline().valueOr(child->height() + child->marginBottom());
+                LayoutUnit ascent = child->firstLineBaseline().value_or(child->height() + child->marginBottom());
                 ascent += child->marginTop();
                 LayoutUnit descent = (child->height() + child->verticalMarginExtent()) - ascent;
 
@@ -508,7 +508,7 @@
                     childY += child->marginTop() + std::max<LayoutUnit>(0, (contentHeight() - (child->height() + child->verticalMarginExtent())) / 2);
                     break;
                 case BBASELINE: {
-                    LayoutUnit ascent = child->firstLineBaseline().valueOr(child->height() + child->marginBottom());
+                    LayoutUnit ascent = child->firstLineBaseline().value_or(child->height() + child->marginBottom());
                     ascent += child->marginTop();
                     childY += child->marginTop() + (maxAscent - ascent);
                     break;
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index 49ca2ac..c5d0f70 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -175,16 +175,16 @@
 
 int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const
 {
-    int baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
+    int baseline = firstLineBaseline().value_or(synthesizedBaselineFromContentBox(*this, direction));
 
     int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
     return baseline + marginAscent;
 }
 
-Optional<int> RenderFlexibleBox::firstLineBaseline() const
+std::optional<int> RenderFlexibleBox::firstLineBaseline() const
 {
     if (isWritingModeRoot() || m_numberOfInFlowChildrenOnFirstLine <= 0)
-        return Optional<int>();
+        return std::optional<int>();
     RenderBox* baselineChild = nullptr;
     int childNumber = 0;
     for (RenderBox* child = m_orderIterator.first(); child; child = m_orderIterator.next()) {
@@ -203,27 +203,27 @@
     }
 
     if (!baselineChild)
-        return Optional<int>();
+        return std::optional<int>();
 
     if (!isColumnFlow() && hasOrthogonalFlow(*baselineChild))
-        return Optional<int>(crossAxisExtentForChild(*baselineChild) + baselineChild->logicalTop());
+        return std::optional<int>(crossAxisExtentForChild(*baselineChild) + baselineChild->logicalTop());
     if (isColumnFlow() && !hasOrthogonalFlow(*baselineChild))
-        return Optional<int>(mainAxisExtentForChild(*baselineChild) + baselineChild->logicalTop());
+        return std::optional<int>(mainAxisExtentForChild(*baselineChild) + baselineChild->logicalTop());
 
-    Optional<int> baseline = baselineChild->firstLineBaseline();
+    std::optional<int> baseline = baselineChild->firstLineBaseline();
     if (!baseline) {
         // FIXME: We should pass |direction| into firstLineBoxBaseline and stop bailing out if we're a writing mode root.
         // This would also fix some cases where the flexbox is orthogonal to its container.
         LineDirectionMode direction = isHorizontalWritingMode() ? HorizontalLine : VerticalLine;
-        return Optional<int>(synthesizedBaselineFromContentBox(*baselineChild, direction) + baselineChild->logicalTop());
+        return std::optional<int>(synthesizedBaselineFromContentBox(*baselineChild, direction) + baselineChild->logicalTop());
     }
 
-    return Optional<int>(baseline.value() + baselineChild->logicalTop());
+    return std::optional<int>(baseline.value() + baselineChild->logicalTop());
 }
 
-Optional<int> RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const
+std::optional<int> RenderFlexibleBox::inlineBlockBaseline(LineDirectionMode direction) const
 {
-    if (Optional<int> baseline = firstLineBaseline())
+    if (std::optional<int> baseline = firstLineBaseline())
         return baseline;
 
     int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
@@ -455,12 +455,12 @@
     return contentLogicalWidth();
 }
 
-Optional<LayoutUnit> RenderFlexibleBox::computeMainAxisExtentForChild(const RenderBox& child, SizeType sizeType, const Length& size)
+std::optional<LayoutUnit> RenderFlexibleBox::computeMainAxisExtentForChild(const RenderBox& child, SizeType sizeType, const Length& size)
 {
     // FIXME: This is wrong for orthogonal flows. It should use the flexbox's writing-mode, not the child's in order
     // to figure out the logical height/width.
     if (isColumnFlow()) {
-        // We don't have to check for "auto" here - computeContentLogicalHeight will just return Nullopt for that case anyway.
+        // We don't have to check for "auto" here - computeContentLogicalHeight will just return std::nullopt for that case anyway.
         if (size.isIntrinsic())
             const_cast<RenderBox&>(child).layoutIfNeeded(); // FIXME: Should not need to do a layout here.
         return child.computeContentLogicalHeight(sizeType, size, child.logicalHeight() - child.borderAndPaddingLogicalHeight());
@@ -685,7 +685,7 @@
         ASSERT(mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child) >= 0);
         return mainAxisExtent - mainAxisBorderAndPaddingExtentForChild(child);
     }
-    return computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis).valueOr(0);
+    return computeMainAxisExtentForChild(child, MainOrPreferredSize, flexBasis).value_or(0);
 }
 
 void RenderFlexibleBox::layoutFlexItems(bool relayoutChildren, Vector<LineContext>& lineContexts)
@@ -825,7 +825,7 @@
 
 LayoutUnit RenderFlexibleBox::marginBoxAscentForChild(RenderBox& child)
 {
-    LayoutUnit ascent = child.firstLineBaseline().valueOr(crossAxisExtentForChild(child));
+    LayoutUnit ascent = child.firstLineBaseline().value_or(crossAxisExtentForChild(child));
     return ascent + flowAwareMarginBeforeForChild(child);
 }
 
@@ -869,12 +869,12 @@
 }
 
     
-Optional<LayoutUnit> RenderFlexibleBox::computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const
+std::optional<LayoutUnit> RenderFlexibleBox::computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const
 {
     ASSERT(child.hasAspectRatio());
     ASSERT(child.intrinsicSize().height() > 0);
     
-    Optional<LayoutUnit> crossSize;
+    std::optional<LayoutUnit> crossSize;
     if (crossSizeLength.isFixed())
         crossSize = LayoutUnit(crossSizeLength.value());
     else {
@@ -900,13 +900,13 @@
     Length crossMax = isHorizontalFlow() ? child.style().maxHeight() : child.style().maxWidth();
 
     if (crossAxisLengthIsDefinite(child, crossMax)) {
-        Optional<LayoutUnit> maxValue = computeMainSizeFromAspectRatioUsing(child, crossMax);
+        std::optional<LayoutUnit> maxValue = computeMainSizeFromAspectRatioUsing(child, crossMax);
         if (maxValue)
             childSize = std::min(maxValue.value(), childSize);
     }
     
     if (crossAxisLengthIsDefinite(child, crossMin)) {
-        Optional<LayoutUnit> minValue = computeMainSizeFromAspectRatioUsing(child, crossMin);
+        std::optional<LayoutUnit> minValue = computeMainSizeFromAspectRatioUsing(child, crossMin);
         if (minValue)
             childSize = std::max(minValue.value(), childSize);
     }
@@ -927,15 +927,15 @@
 LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child, LayoutUnit childSize)
 {
     Length max = isHorizontalFlow() ? child.style().maxWidth() : child.style().maxHeight();
-    Optional<LayoutUnit> maxExtent = Nullopt;
+    std::optional<LayoutUnit> maxExtent = std::nullopt;
     if (max.isSpecifiedOrIntrinsic()) {
         maxExtent = computeMainAxisExtentForChild(child, MaxSize, max);
-        childSize = std::min(childSize, maxExtent.valueOr(childSize));
+        childSize = std::min(childSize, maxExtent.value_or(childSize));
     }
     
     Length min = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight();
     if (min.isSpecifiedOrIntrinsic())
-        return std::max(childSize, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize));
+        return std::max(childSize, computeMainAxisExtentForChild(child, MinSize, min).value_or(childSize));
     
     if (!isFlexibleBoxImpl() && min.isAuto() && mainAxisOverflowForChild(child) == OVISIBLE && !(isColumnFlow() && is<RenderFlexibleBox>(child))) {
         // This is the implementation of CSS flexbox section 4.5 which defines the minimum size of "pure" flex
@@ -947,17 +947,17 @@
         ASSERT(contentSize >= 0);
         if (child.hasAspectRatio() && child.intrinsicSize().height() > 0)
             contentSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, contentSize);
-        contentSize = std::min(contentSize, maxExtent.valueOr(contentSize));
+        contentSize = std::min(contentSize, maxExtent.value_or(contentSize));
         
         Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
         if (mainAxisLengthIsDefinite(child, mainSize)) {
             LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).value();
             ASSERT(resolvedMainSize >= 0);
-            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.valueOr(resolvedMainSize));
+            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.value_or(resolvedMainSize));
             return std::max(childSize, std::min(specifiedSize, contentSize));
         } else if (useChildAspectRatio(child)) {
             Length crossSizeLength = isHorizontalFlow() ? child.style().height() : child.style().width();
-            Optional<LayoutUnit> transferredSize = computeMainSizeFromAspectRatioUsing(child, crossSizeLength);
+            std::optional<LayoutUnit> transferredSize = computeMainSizeFromAspectRatioUsing(child, crossSizeLength);
             if (transferredSize) {
                 transferredSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, transferredSize.value());
                 return std::max(childSize, std::min(transferredSize.value(), contentSize));
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h
index 394a8de..3a19bcb 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderFlexibleBox.h
@@ -48,8 +48,8 @@
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
 
     int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
-    Optional<int> firstLineBaseline() const override;
-    Optional<int> inlineBlockBaseline(LineDirectionMode) const override;
+    std::optional<int> firstLineBaseline() const override;
+    std::optional<int> inlineBlockBaseline(LineDirectionMode) const override;
 
     void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override;
 
@@ -97,7 +97,7 @@
     LayoutUnit mainAxisExtent() const;
     LayoutUnit crossAxisContentExtent() const;
     LayoutUnit mainAxisContentExtent(LayoutUnit contentLogicalHeight);
-    Optional<LayoutUnit> computeMainAxisExtentForChild(const RenderBox& child, SizeType, const Length& size);
+    std::optional<LayoutUnit> computeMainAxisExtentForChild(const RenderBox& child, SizeType, const Length& size);
     WritingMode transformedWritingMode() const;
     LayoutUnit flowAwareBorderStart() const;
     LayoutUnit flowAwareBorderEnd() const;
@@ -161,7 +161,7 @@
     bool mainAxisLengthIsDefinite(const RenderBox&, const Length&) const;
     bool crossAxisLengthIsDefinite(const RenderBox&, const Length&) const;
     bool useChildAspectRatio(const RenderBox&) const;
-    Optional<LayoutUnit> computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const;
+    std::optional<LayoutUnit> computeMainSizeFromAspectRatioUsing(const RenderBox& child, Length crossSizeLength) const;
     
     virtual bool isFlexibleBoxImpl() const { return false; };
 
diff --git a/Source/WebCore/rendering/RenderFlowThread.cpp b/Source/WebCore/rendering/RenderFlowThread.cpp
index d423ac3..8967ab9 100644
--- a/Source/WebCore/rendering/RenderFlowThread.cpp
+++ b/Source/WebCore/rendering/RenderFlowThread.cpp
@@ -1087,7 +1087,7 @@
         hasComputedAutoHeight = true;
 
         // Compute the region height pretending that the offsetBreakInCurrentRegion is the logicalHeight for the auto-height region.
-        LayoutUnit regionComputedAutoHeight = namedFlowFragment.constrainContentBoxLogicalHeightByMinMax(offsetBreakInCurrentRegion, Nullopt);
+        LayoutUnit regionComputedAutoHeight = namedFlowFragment.constrainContentBoxLogicalHeightByMinMax(offsetBreakInCurrentRegion, std::nullopt);
 
         // The new height of this region needs to be smaller than the initial value, the max height. A forced break is the only way to change the initial
         // height of an auto-height region besides content ending.
diff --git a/Source/WebCore/rendering/RenderGrid.cpp b/Source/WebCore/rendering/RenderGrid.cpp
index 475f591..5cef69b1 100644
--- a/Source/WebCore/rendering/RenderGrid.cpp
+++ b/Source/WebCore/rendering/RenderGrid.cpp
@@ -103,7 +103,7 @@
 
     void setGrowthLimit(LayoutUnit growthLimit)
     {
-        m_growthLimit = growthLimit == infinity ? growthLimit : std::min(growthLimit, m_growthLimitCap.valueOr(growthLimit));
+        m_growthLimit = growthLimit == infinity ? growthLimit : std::min(growthLimit, m_growthLimitCap.value_or(growthLimit));
         ensureGrowthLimitIsBiggerThanBaseSize();
     }
 
@@ -140,13 +140,13 @@
     bool infinitelyGrowable() const { return m_infinitelyGrowable; }
     void setInfinitelyGrowable(bool infinitelyGrowable) { m_infinitelyGrowable = infinitelyGrowable; }
 
-    void setGrowthLimitCap(Optional<LayoutUnit> growthLimitCap)
+    void setGrowthLimitCap(std::optional<LayoutUnit> growthLimitCap)
     {
         ASSERT(!growthLimitCap || growthLimitCap.value() >= 0);
         m_growthLimitCap = growthLimitCap;
     }
 
-    Optional<LayoutUnit> growthLimitCap() const { return m_growthLimitCap; }
+    std::optional<LayoutUnit> growthLimitCap() const { return m_growthLimitCap; }
 
 private:
     bool growthLimitIsInfinite() const { return m_growthLimit == infinity; }
@@ -162,7 +162,7 @@
     LayoutUnit m_growthLimit { 0 };
     LayoutUnit m_plannedSize { 0 };
     LayoutUnit m_tempSize { 0 };
-    Optional<LayoutUnit> m_growthLimitCap;
+    std::optional<LayoutUnit> m_growthLimitCap;
     bool m_infinitelyGrowable { false };
 };
 
@@ -284,11 +284,11 @@
     Vector<GridTrack*> growBeyondGrowthLimitsTracks;
     Vector<GridItemWithSpan> itemsSortedByIncreasingSpan;
 
-    Optional<LayoutUnit> freeSpace(GridTrackSizingDirection direction) { return direction == ForColumns ? freeSpaceForColumns : freeSpaceForRows; }
-    void setFreeSpace(GridTrackSizingDirection, Optional<LayoutUnit> freeSpace);
+    std::optional<LayoutUnit> freeSpace(GridTrackSizingDirection direction) { return direction == ForColumns ? freeSpaceForColumns : freeSpaceForRows; }
+    void setFreeSpace(GridTrackSizingDirection, std::optional<LayoutUnit> freeSpace);
 
-    Optional<LayoutUnit> availableSpace() const { return m_availableSpace; }
-    void setAvailableSpace(Optional<LayoutUnit> availableSpace) { m_availableSpace = availableSpace; }
+    std::optional<LayoutUnit> availableSpace() const { return m_availableSpace; }
+    void setAvailableSpace(std::optional<LayoutUnit> availableSpace) { m_availableSpace = availableSpace; }
 
     SizingOperation sizingOperation { TrackSizing };
 
@@ -328,14 +328,14 @@
     }
 
 private:
-    Optional<LayoutUnit> freeSpaceForColumns;
-    Optional<LayoutUnit> freeSpaceForRows;
+    std::optional<LayoutUnit> freeSpaceForColumns;
+    std::optional<LayoutUnit> freeSpaceForRows;
     // No need to store one per direction as it will be only used for computations during each axis
     // track sizing. It's cached here because we need it to compute relative sizes.
-    Optional<LayoutUnit> m_availableSpace;
+    std::optional<LayoutUnit> m_availableSpace;
 };
 
-void RenderGrid::GridSizingData::setFreeSpace(GridTrackSizingDirection direction, Optional<LayoutUnit> freeSpace)
+void RenderGrid::GridSizingData::setFreeSpace(GridTrackSizingDirection direction, std::optional<LayoutUnit> freeSpace)
 {
     if (direction == ForColumns)
         freeSpaceForColumns = freeSpace;
@@ -526,7 +526,7 @@
 
     // FIXME: We should use RenderBlock::hasDefiniteLogicalHeight() but it does not work for positioned stuff.
     // FIXME: Consider caching the hasDefiniteLogicalHeight value throughout the layout.
-    bool hasDefiniteLogicalHeight = hasOverrideLogicalContentHeight() || computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt);
+    bool hasDefiniteLogicalHeight = hasOverrideLogicalContentHeight() || computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), std::nullopt);
     if (!hasDefiniteLogicalHeight)
         computeIntrinsicLogicalHeight(sizingData);
     else
@@ -666,8 +666,8 @@
         const_cast<RenderGrid*>(this)->placeItemsOnGrid(IntrinsicSizeComputation);
 
     GridSizingData sizingData(numTracks(ForColumns), numTracks(ForRows));
-    sizingData.setAvailableSpace(Nullopt);
-    sizingData.setFreeSpace(ForColumns, Nullopt);
+    sizingData.setAvailableSpace(std::nullopt);
+    sizingData.setFreeSpace(ForColumns, std::nullopt);
     sizingData.sizingOperation = IntrinsicSizeComputation;
     computeUsedBreadthOfGridTracks(ForColumns, sizingData, minLogicalWidth, maxLogicalWidth);
 
@@ -686,8 +686,8 @@
 void RenderGrid::computeIntrinsicLogicalHeight(GridSizingData& sizingData)
 {
     ASSERT(sizingData.isValidTransition(ForRows));
-    sizingData.setAvailableSpace(Nullopt);
-    sizingData.setFreeSpace(ForRows, Nullopt);
+    sizingData.setAvailableSpace(std::nullopt);
+    sizingData.setFreeSpace(ForRows, std::nullopt);
     sizingData.sizingOperation = IntrinsicSizeComputation;
     LayoutUnit minHeight, maxHeight;
     computeUsedBreadthOfGridTracks(ForRows, sizingData, minHeight, maxHeight);
@@ -710,10 +710,10 @@
     sizingData.sizingOperation = TrackSizing;
 }
 
-Optional<LayoutUnit> RenderGrid::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicLogicalHeight, LayoutUnit borderAndPadding) const
+std::optional<LayoutUnit> RenderGrid::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicLogicalHeight, LayoutUnit borderAndPadding) const
 {
     if (!intrinsicLogicalHeight)
-        return Nullopt;
+        return std::nullopt;
 
     if (logicalHeightLength.isMinContent())
         return m_minContentHeight;
@@ -723,13 +723,13 @@
 
     if (logicalHeightLength.isFitContent()) {
         LayoutUnit fillAvailableExtent = containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding);
-        return std::min(m_maxContentHeight.valueOr(0), std::max(m_minContentHeight.valueOr(0), fillAvailableExtent));
+        return std::min(m_maxContentHeight.value_or(0), std::max(m_minContentHeight.value_or(0), fillAvailableExtent));
     }
 
     if (logicalHeightLength.isFillAvailable())
         return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding) - borderAndPadding;
     ASSERT_NOT_REACHED();
-    return Nullopt;
+    return std::nullopt;
 }
 
 static inline double normalizedFlexFraction(const GridTrack& track, double flexFactor)
@@ -739,14 +739,14 @@
 
 void RenderGrid::computeUsedBreadthOfGridTracks(GridTrackSizingDirection direction, GridSizingData& sizingData, LayoutUnit& baseSizesWithoutMaximization, LayoutUnit& growthLimitsWithoutMaximization) const
 {
-    const Optional<LayoutUnit> initialFreeSpace = sizingData.freeSpace(direction);
+    const std::optional<LayoutUnit> initialFreeSpace = sizingData.freeSpace(direction);
     Vector<GridTrack>& tracks = (direction == ForColumns) ? sizingData.columnTracks : sizingData.rowTracks;
     Vector<unsigned> flexibleSizedTracksIndex;
     sizingData.contentSizedTracksIndex.shrink(0);
 
     // Grid gutters were removed from freeSpace by the caller (if freeSpace is definite),
     // but we must use them to compute relative (i.e. percentages) sizes.
-    LayoutUnit maxSize = std::max(LayoutUnit(), sizingData.availableSpace().valueOr(LayoutUnit()));
+    LayoutUnit maxSize = std::max(LayoutUnit(), sizingData.availableSpace().value_or(LayoutUnit()));
     const bool hasDefiniteFreeSpace = sizingData.sizingOperation == TrackSizing;
 
     // 1. Initialize per Grid track variables.
@@ -781,7 +781,7 @@
         growthLimitsWithoutMaximization += track.growthLimit();
         // The growth limit caps must be cleared now in order to properly sort tracks by growth
         // potential on an eventual "Maximize Tracks".
-        track.setGrowthLimitCap(Nullopt);
+        track.setGrowthLimitCap(std::nullopt);
     }
     LayoutUnit freeSpace = initialFreeSpace ? initialFreeSpace.value() - baseSizesWithoutMaximization : LayoutUnit(0);
 
@@ -973,12 +973,12 @@
     return direction == ForColumns ? child.hasOverrideContainingBlockLogicalWidth() : child.hasOverrideContainingBlockLogicalHeight();
 }
 
-static Optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox& child, GridTrackSizingDirection direction)
+static std::optional<LayoutUnit> overrideContainingBlockContentSizeForChild(const RenderBox& child, GridTrackSizingDirection direction)
 {
     return direction == ForColumns ? child.overrideContainingBlockContentLogicalWidth() : child.overrideContainingBlockContentLogicalHeight();
 }
 
-static void setOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, Optional<LayoutUnit> size)
+static void setOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, std::optional<LayoutUnit> size)
 {
     if (direction == ForColumns)
         child.setOverrideContainingBlockContentLogicalWidth(size);
@@ -1080,7 +1080,7 @@
     // If |child| has a relative logical height, we shouldn't let it override its intrinsic height, which is
     // what we are interested in here. Thus we need to set the block-axis override size to -1 (no possible resolution).
     if (shouldClearOverrideContainingBlockContentSizeForChild(child, ForRows)) {
-        setOverrideContainingBlockContentSizeForChild(child, childBlockDirection, Nullopt);
+        setOverrideContainingBlockContentSizeForChild(child, childBlockDirection, std::nullopt);
         child.setNeedsLayout(MarkOnlyThis);
     }
 
@@ -1104,13 +1104,13 @@
     bool overrideSizeHasChanged = updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, sizingData);
     if (isRowAxis) {
         LayoutUnit marginLogicalWidth = sizingData.sizingOperation == TrackSizing ? computeMarginLogicalSizeForChild(childInlineDirection, child) : marginIntrinsicLogicalWidthForChild(child);
-        return child.computeLogicalWidthInRegionUsing(MinSize, childMinSize, overrideContainingBlockContentSizeForChild(child, childInlineDirection).valueOr(0), *this, nullptr) + marginLogicalWidth;
+        return child.computeLogicalWidthInRegionUsing(MinSize, childMinSize, overrideContainingBlockContentSizeForChild(child, childInlineDirection).value_or(0), *this, nullptr) + marginLogicalWidth;
     }
 
     if (overrideSizeHasChanged && (direction != ForColumns || sizingData.sizingOperation != IntrinsicSizeComputation))
         child.setNeedsLayout(MarkOnlyThis);
     child.layoutIfNeeded();
-    return child.computeLogicalHeightUsing(MinSize, childMinSize, Nullopt).valueOr(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight();
+    return child.computeLogicalHeightUsing(MinSize, childMinSize, std::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight();
 }
 
 bool RenderGrid::updateOverrideContainingBlockContentSizeForChild(RenderBox& child, GridTrackSizingDirection direction, GridSizingData& sizingData) const
@@ -1128,9 +1128,9 @@
     GridTrackSizingDirection childInlineDirection = flowAwareDirectionForChild(child, ForColumns);
     if (direction == childInlineDirection) {
         // If |child| has a relative logical width, we shouldn't let it override its intrinsic width, which is
-        // what we are interested in here. Thus we need to set the override logical width to Nullopt (no possible resolution).
+        // what we are interested in here. Thus we need to set the override logical width to std::nullopt (no possible resolution).
         if (shouldClearOverrideContainingBlockContentSizeForChild(child, ForColumns))
-            setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, Nullopt);
+            setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, std::nullopt);
 
         // FIXME: It's unclear if we should return the intrinsic width or the preferred width.
         // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
@@ -1158,7 +1158,7 @@
         // If |child| has a relative logical width, we shouldn't let it override its intrinsic width, which is
         // what we are interested in here. Thus we need to set the inline-axis override size to -1 (no possible resolution).
         if (shouldClearOverrideContainingBlockContentSizeForChild(child, ForColumns))
-            setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, Nullopt);
+            setOverrideContainingBlockContentSizeForChild(child, childInlineDirection, std::nullopt);
 
         // FIXME: It's unclear if we should return the intrinsic width or the preferred width.
         // See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html
@@ -1274,7 +1274,7 @@
     } else if (trackSize.hasMaxContentOrAutoMaxTrackBreadth()) {
         LayoutUnit growthLimit = maxContentForChild(gridItem, direction, sizingData);
         if (trackSize.isFitContent())
-            growthLimit = std::min(growthLimit, valueForLength(trackSize.fitContentTrackBreadth().length(), sizingData.availableSpace().valueOr(0)));
+            growthLimit = std::min(growthLimit, valueForLength(trackSize.fitContentTrackBreadth().length(), sizingData.availableSpace().value_or(0)));
         track.setGrowthLimit(std::max(track.growthLimit(), growthLimit));
     }
 }
@@ -1462,8 +1462,8 @@
     if (track1HasInfiniteGrowthPotentialWithoutCap || track2HasInfiniteGrowthPotentialWithoutCap)
         return track2HasInfiniteGrowthPotentialWithoutCap;
 
-    LayoutUnit track1Limit = track1->growthLimitCap().valueOr(track1->growthLimit());
-    LayoutUnit track2Limit = track2->growthLimitCap().valueOr(track2->growthLimit());
+    LayoutUnit track1Limit = track1->growthLimitCap().value_or(track1->growthLimit());
+    LayoutUnit track2Limit = track2->growthLimitCap().value_or(track2->growthLimit());
     return (track1Limit - track1->baseSize()) < (track2Limit - track2->baseSize());
 }
 
@@ -1532,7 +1532,7 @@
 bool RenderGrid::tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection direction, GridSizingData& sizingData)
 {
     const Vector<GridTrack>& tracks = (direction == ForColumns) ? sizingData.columnTracks : sizingData.rowTracks;
-    const LayoutUnit maxSize = sizingData.availableSpace().valueOr(0);
+    const LayoutUnit maxSize = sizingData.availableSpace().value_or(0);
     for (unsigned i = 0; i < tracks.size(); ++i) {
         const GridTrackSize& trackSize = gridTrackSize(direction, i, sizingData.sizingOperation);
         if (computeUsedBreadthOfMinLength(trackSize, maxSize) > tracks[i].baseSize())
@@ -1551,19 +1551,19 @@
     if (!autoRepeatTrackListLength)
         return 0;
 
-    Optional<LayoutUnit> availableSize;
+    std::optional<LayoutUnit> availableSize;
     if (isRowAxis) {
         if (sizingOperation != IntrinsicSizeComputation)
             availableSize =  availableLogicalWidth();
     } else {
-        availableSize = computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt);
+        availableSize = computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), std::nullopt);
         if (!availableSize) {
             const Length& maxLength = style().logicalMaxHeight();
             if (!maxLength.isUndefined())
-                availableSize = computeContentLogicalHeight(MaxSize, maxLength, Nullopt);
+                availableSize = computeContentLogicalHeight(MaxSize, maxLength, std::nullopt);
         }
         if (availableSize)
-            availableSize = constrainContentBoxLogicalHeightByMinMax(availableSize.value(), Nullopt);
+            availableSize = constrainContentBoxLogicalHeightByMinMax(availableSize.value(), std::nullopt);
     }
 
     bool needsToFulfillMinimumSize = false;
@@ -1926,7 +1926,7 @@
 
 void RenderGrid::applyStretchAlignmentToTracksIfNeeded(GridTrackSizingDirection direction, GridSizingData& sizingData)
 {
-    Optional<LayoutUnit> freeSpace = sizingData.freeSpace(direction);
+    std::optional<LayoutUnit> freeSpace = sizingData.freeSpace(direction);
     if (!freeSpace
         || freeSpace.value() <= 0
         || (direction == ForColumns && style().resolvedJustifyContentDistribution(contentAlignmentNormalBehaviorGrid()) != ContentDistributionStretch)
@@ -1951,7 +1951,7 @@
         auto& track = tracks[trackIndex];
         track.setBaseSize(track.baseSize() + sizeToIncrease);
     }
-    sizingData.setFreeSpace(direction, Optional<LayoutUnit>(0));
+    sizingData.setFreeSpace(direction, std::optional<LayoutUnit>(0));
 }
 
 void RenderGrid::layoutGridItems(GridSizingData& sizingData)
@@ -1968,8 +1968,8 @@
 
         // Because the grid area cannot be styled, we don't need to adjust
         // the grid breadth to account for 'box-sizing'.
-        Optional<LayoutUnit> oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit();
-        Optional<LayoutUnit> oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit();
+        std::optional<LayoutUnit> oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit();
+        std::optional<LayoutUnit> oldOverrideContainingBlockContentLogicalHeight = child->hasOverrideContainingBlockLogicalHeight() ? child->overrideContainingBlockContentLogicalHeight() : LayoutUnit();
 
         LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChildIncludingAlignmentOffsets(*child, ForColumns, sizingData);
         LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChildIncludingAlignmentOffsets(*child, ForRows, sizingData);
diff --git a/Source/WebCore/rendering/RenderGrid.h b/Source/WebCore/rendering/RenderGrid.h
index a7665ac..7b5ef6e 100644
--- a/Source/WebCore/rendering/RenderGrid.h
+++ b/Source/WebCore/rendering/RenderGrid.h
@@ -77,7 +77,7 @@
     bool isRenderGrid() const override { return true; }
     void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const override;
 
-    Optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, Optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const override;
+    std::optional<LayoutUnit> computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const override;
 
     class GridIterator;
     class GridSizingData;
@@ -228,8 +228,8 @@
     HashMap<const RenderBox*, GridArea> m_gridItemArea;
     OrderIterator m_orderIterator;
 
-    Optional<LayoutUnit> m_minContentHeight;
-    Optional<LayoutUnit> m_maxContentHeight;
+    std::optional<LayoutUnit> m_minContentHeight;
+    std::optional<LayoutUnit> m_maxContentHeight;
 
     int m_smallestColumnStart;
     int m_smallestRowStart;
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 5bbcc00..f8bc364 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -4466,7 +4466,7 @@
 
     // Now do a paint with the root layer shifted to be us.
     LayoutSize adjustedSubpixelOffset = offsetForThisLayer - LayoutSize(devicePixelSnappedOffsetForThisLayer);
-    LayerPaintingInfo transformedPaintingInfo(this, LayoutRect(encloseRectToDevicePixels(transform.inverse().valueOr(AffineTransform()).mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor)),
+    LayerPaintingInfo transformedPaintingInfo(this, LayoutRect(encloseRectToDevicePixels(transform.inverse().value_or(AffineTransform()).mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor)),
         paintingInfo.paintBehavior, adjustedSubpixelOffset, paintingInfo.subtreePaintRoot, paintingInfo.overlapTestRequests);
     paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags);
     context.setCTM(oldTransfrom);
@@ -5100,7 +5100,7 @@
 
     // Check for hit test on backface if backface-visibility is 'hidden'
     if (localTransformState && renderer().style().backfaceVisibility() == BackfaceVisibilityHidden) {
-        Optional<TransformationMatrix> invertedMatrix = localTransformState->m_accumulatedTransform.inverse();
+        std::optional<TransformationMatrix> invertedMatrix = localTransformState->m_accumulatedTransform.inverse();
         // If the z-vector of the matrix is negative, the back is facing towards the viewer.
         if (invertedMatrix && invertedMatrix.value().m33() < 0)
             return nullptr;
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index ed11088..18f84a2 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -790,9 +790,9 @@
         return m_fromAncestorGraphicsLayer.value();
     }
 
-    Optional<LayoutSize> m_fromAncestorGraphicsLayer;
-    Optional<LayoutSize> m_fromParentGraphicsLayer;
-    Optional<LayoutSize> m_fromPrimaryGraphicsLayer;
+    std::optional<LayoutSize> m_fromAncestorGraphicsLayer;
+    std::optional<LayoutSize> m_fromParentGraphicsLayer;
+    std::optional<LayoutSize> m_fromPrimaryGraphicsLayer;
     
     const RenderLayer& m_renderLayer;
     // Location is relative to the renderer.
diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp
index b7163e6..2c6a8ee 100644
--- a/Source/WebCore/rendering/RenderListBox.cpp
+++ b/Source/WebCore/rendering/RenderListBox.cpp
@@ -281,7 +281,7 @@
 void RenderListBox::paintItem(PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintFunction paintFunction)
 {
     int listItemsSize = numItems();
-    int firstVisibleItem = m_indexOfFirstVisibleItemInsidePaddingTopArea.valueOr(m_indexOffset);
+    int firstVisibleItem = m_indexOfFirstVisibleItemInsidePaddingTopArea.value_or(m_indexOffset);
     int endIndex = firstVisibleItem + numVisibleItems(ConsiderPadding::Yes);
     for (int i = firstVisibleItem; i < listItemsSize && i < endIndex; ++i)
         paintFunction(paintInfo, paintOffset, i);
@@ -597,7 +597,7 @@
 
 bool RenderListBox::listIndexIsVisible(int index)
 {
-    int firstIndex = m_indexOfFirstVisibleItemInsidePaddingTopArea.valueOr(m_indexOffset);
+    int firstIndex = m_indexOfFirstVisibleItemInsidePaddingTopArea.value_or(m_indexOffset);
     int endIndex = m_indexOfFirstVisibleItemInsidePaddingBottomArea
         ? m_indexOfFirstVisibleItemInsidePaddingBottomArea.value() + numberOfVisibleItemsInPaddingBottom()
         : m_indexOffset + numVisibleItems();
@@ -669,8 +669,8 @@
 
 void RenderListBox::computeFirstIndexesVisibleInPaddingTopBottomAreas()
 {
-    m_indexOfFirstVisibleItemInsidePaddingTopArea = Nullopt;
-    m_indexOfFirstVisibleItemInsidePaddingBottomArea = Nullopt;
+    m_indexOfFirstVisibleItemInsidePaddingTopArea = std::nullopt;
+    m_indexOfFirstVisibleItemInsidePaddingBottomArea = std::nullopt;
 
     int maximumNumberOfItemsThatFitInPaddingTopArea = paddingTop() / itemHeight();
     if (maximumNumberOfItemsThatFitInPaddingTopArea) {
diff --git a/Source/WebCore/rendering/RenderListBox.h b/Source/WebCore/rendering/RenderListBox.h
index f280c07..73003e9 100644
--- a/Source/WebCore/rendering/RenderListBox.h
+++ b/Source/WebCore/rendering/RenderListBox.h
@@ -175,8 +175,8 @@
     int m_optionsWidth;
     int m_indexOffset;
 
-    Optional<int> m_indexOfFirstVisibleItemInsidePaddingTopArea;
-    Optional<int> m_indexOfFirstVisibleItemInsidePaddingBottomArea;
+    std::optional<int> m_indexOfFirstVisibleItemInsidePaddingTopArea;
+    std::optional<int> m_indexOfFirstVisibleItemInsidePaddingBottomArea;
 
     RefPtr<Scrollbar> m_vBar;
 };
diff --git a/Source/WebCore/rendering/RenderMenuList.h b/Source/WebCore/rendering/RenderMenuList.h
index 275b1aa..6e0ba75 100644
--- a/Source/WebCore/rendering/RenderMenuList.h
+++ b/Source/WebCore/rendering/RenderMenuList.h
@@ -122,8 +122,8 @@
     {
         return RenderBlock::baselinePosition(baseline, firstLine, direction, position);
     }
-    Optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); }
-    Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
+    std::optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); }
+    std::optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
 
     void getItemBackgroundColor(unsigned listIndex, Color&, bool& itemHasCustomBackgroundColor) const;
 
diff --git a/Source/WebCore/rendering/RenderMultiColumnSet.cpp b/Source/WebCore/rendering/RenderMultiColumnSet.cpp
index 7d2fb43..9210d74 100644
--- a/Source/WebCore/rendering/RenderMultiColumnSet.cpp
+++ b/Source/WebCore/rendering/RenderMultiColumnSet.cpp
@@ -415,7 +415,7 @@
     LayoutUnit availableHeight = multiColumnFlowThread()->columnHeightAvailable();
     LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFlowThread::maxLogicalHeight();
     if (!multicolStyle.logicalMaxHeight().isUndefined())
-        maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), Nullopt).valueOr(maxColumnHeight));
+        maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), std::nullopt).value_or(maxColumnHeight));
     return heightAdjustedForSetOffset(maxColumnHeight);
 }
 
diff --git a/Source/WebCore/rendering/RenderTable.cpp b/Source/WebCore/rendering/RenderTable.cpp
index 611f46d..386b527 100644
--- a/Source/WebCore/rendering/RenderTable.cpp
+++ b/Source/WebCore/rendering/RenderTable.cpp
@@ -373,9 +373,9 @@
         }
         return styleLogicalHeight.value() - borders;
     } else if (styleLogicalHeight.isPercentOrCalculated())
-        return computePercentageLogicalHeight(styleLogicalHeight).valueOr(0);
+        return computePercentageLogicalHeight(styleLogicalHeight).value_or(0);
     else if (styleLogicalHeight.isIntrinsic())
-        return computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding).valueOr(0);
+        return computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding).value_or(0);
     else
         ASSERT_NOT_REACHED();
     return LayoutUnit();
@@ -1468,37 +1468,37 @@
 
 int RenderTable::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
 {
-    return firstLineBaseline().valueOrCompute([&] {
+    return valueOrCompute(firstLineBaseline(), [&] {
         return RenderBox::baselinePosition(baselineType, firstLine, direction, linePositionMode);
     });
 }
 
-Optional<int> RenderTable::inlineBlockBaseline(LineDirectionMode) const
+std::optional<int> RenderTable::inlineBlockBaseline(LineDirectionMode) const
 {
     // Tables are skipped when computing an inline-block's baseline.
-    return Optional<int>();
+    return std::optional<int>();
 }
 
-Optional<int> RenderTable::firstLineBaseline() const
+std::optional<int> RenderTable::firstLineBaseline() const
 {
     // The baseline of a 'table' is the same as the 'inline-table' baseline per CSS 3 Flexbox (CSS 2.1
     // doesn't define the baseline of a 'table' only an 'inline-table').
     // This is also needed to properly determine the baseline of a cell if it has a table child.
 
     if (isWritingModeRoot())
-        return Optional<int>();
+        return std::optional<int>();
 
     recalcSectionsIfNeeded();
 
     const RenderTableSection* topNonEmptySection = this->topNonEmptySection();
     if (!topNonEmptySection)
-        return Optional<int>();
+        return std::optional<int>();
 
-    if (Optional<int> baseline = topNonEmptySection->firstLineBaseline())
-        return Optional<int>(topNonEmptySection->logicalTop() + baseline.value());
+    if (std::optional<int> baseline = topNonEmptySection->firstLineBaseline())
+        return std::optional<int>(topNonEmptySection->logicalTop() + baseline.value());
 
     // FIXME: A table row always has a baseline per CSS 2.1. Will this return the right value?
-    return Optional<int>();
+    return std::optional<int>();
 }
 
 LayoutRect RenderTable::overflowClipRect(const LayoutPoint& location, RenderRegion* region, OverlayScrollbarSizeRelevancy relevancy, PaintPhase phase)
diff --git a/Source/WebCore/rendering/RenderTable.h b/Source/WebCore/rendering/RenderTable.h
index fd97a01..82ed277 100644
--- a/Source/WebCore/rendering/RenderTable.h
+++ b/Source/WebCore/rendering/RenderTable.h
@@ -291,8 +291,8 @@
     bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override;
 
     int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const final;
-    Optional<int> firstLineBaseline() const override;
-    Optional<int> inlineBlockBaseline(LineDirectionMode) const final;
+    std::optional<int> firstLineBaseline() const override;
+    std::optional<int> inlineBlockBaseline(LineDirectionMode) const final;
 
     RenderTableCol* slowColElement(unsigned col, bool* startEdge, bool* endEdge) const;
 
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index c00cbcc..e1a7eaa 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -401,7 +401,7 @@
     // <http://www.w3.org/TR/2007/CR-CSS21-20070719/tables.html#height-layout>: The baseline of a cell is the baseline of
     // the first in-flow line box in the cell, or the first in-flow table-row in the cell, whichever comes first. If there
     // is no such line box or table-row, the baseline is the bottom of content edge of the cell box.
-    return firstLineBaseline().valueOr(borderAndPaddingBefore() + contentLogicalHeight());
+    return firstLineBaseline().value_or(borderAndPaddingBefore() + contentLogicalHeight());
 }
 
 static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
diff --git a/Source/WebCore/rendering/RenderTableSection.cpp b/Source/WebCore/rendering/RenderTableSection.cpp
index d885e8e..7b47d6c 100644
--- a/Source/WebCore/rendering/RenderTableSection.cpp
+++ b/Source/WebCore/rendering/RenderTableSection.cpp
@@ -917,16 +917,16 @@
     m_outerBorderEnd = calcOuterBorderEnd();
 }
 
-Optional<int> RenderTableSection::firstLineBaseline() const
+std::optional<int> RenderTableSection::firstLineBaseline() const
 {
     if (!m_grid.size())
-        return Optional<int>();
+        return std::optional<int>();
 
     int firstLineBaseline = m_grid[0].baseline;
     if (firstLineBaseline)
         return firstLineBaseline + roundToInt(m_rowPos[0]);
 
-    Optional<int> result;
+    std::optional<int> result;
     const Row& firstRow = m_grid[0].row;
     for (size_t i = 0; i < firstRow.size(); ++i) {
         const CellStruct& cs = firstRow.at(i);
@@ -934,7 +934,7 @@
         // Only cells with content have a baseline
         if (cell && cell->contentLogicalHeight()) {
             int candidate = roundToInt(cell->logicalTop() + cell->borderAndPaddingBefore() + cell->contentLogicalHeight());
-            result = std::max(result.valueOr(candidate), candidate);
+            result = std::max(result.value_or(candidate), candidate);
         }
     }
 
diff --git a/Source/WebCore/rendering/RenderTableSection.h b/Source/WebCore/rendering/RenderTableSection.h
index 3332c81..af9ab44 100644
--- a/Source/WebCore/rendering/RenderTableSection.h
+++ b/Source/WebCore/rendering/RenderTableSection.h
@@ -63,7 +63,7 @@
 
     void addChild(RenderObject* child, RenderObject* beforeChild = 0) override;
 
-    Optional<int> firstLineBaseline() const override;
+    std::optional<int> firstLineBaseline() const override;
 
     void addCell(RenderTableCell*, RenderTableRow* row);
 
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index ce156ec..37b0741 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -800,7 +800,7 @@
     bool isSpace = false;
     bool firstWord = true;
     bool firstLine = true;
-    Optional<unsigned> nextBreakable;
+    std::optional<unsigned> nextBreakable;
     unsigned lastWordBoundary = 0;
 
     // Non-zero only when kerning is enabled, in which case we measure words with their trailing
@@ -822,7 +822,7 @@
         minimumSuffixLength = after < 0 ? 2 : after;
     }
 
-    Optional<int> firstGlyphLeftOverflow;
+    std::optional<int> firstGlyphLeftOverflow;
 
     bool breakNBSP = style.autoWrap() && style.nbspMode() == SPACE;
     
@@ -898,7 +898,7 @@
             float currMinWidth = 0;
             bool isSpace = (j < len) && isSpaceAccordingToStyle(c, style);
             float w;
-            Optional<float> wordTrailingSpaceWidth;
+            std::optional<float> wordTrailingSpaceWidth;
             if (isSpace)
                 wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts);
             if (wordTrailingSpaceWidth)
@@ -915,7 +915,7 @@
 
                 if (suffixStart) {
                     float suffixWidth;
-                    Optional<float> wordTrailingSpaceWidth;
+                    std::optional<float> wordTrailingSpaceWidth;
                     if (isSpace)
                         wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts);
                     if (wordTrailingSpaceWidth)
@@ -1000,7 +1000,7 @@
         }
     }
 
-    glyphOverflow.left = firstGlyphLeftOverflow.valueOr(glyphOverflow.left);
+    glyphOverflow.left = firstGlyphLeftOverflow.value_or(glyphOverflow.left);
 
     if ((needsWordSpacing && len > 1) || (ignoringSpaces && !firstWord))
         currMaxWidth += wordSpacing;
@@ -1676,9 +1676,9 @@
     secureTextTimer->restart(offsetAfterLastTypedCharacter);
 }
 
-StringView RenderText::stringView(unsigned start, Optional<unsigned> stop) const
+StringView RenderText::stringView(unsigned start, std::optional<unsigned> stop) const
 {
-    unsigned destination = stop.valueOr(textLength());
+    unsigned destination = stop.value_or(textLength());
     ASSERT(start <= length());
     ASSERT(destination <= length());
     ASSERT(start <= destination);
diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h
index 6139900..9ca0f54 100644
--- a/Source/WebCore/rendering/RenderText.h
+++ b/Source/WebCore/rendering/RenderText.h
@@ -166,7 +166,7 @@
     void deleteLineBoxesBeforeSimpleLineLayout();
     const SimpleLineLayout::Layout* simpleLineLayout() const;
 
-    StringView stringView(unsigned start = 0, Optional<unsigned> stop = Nullopt) const;
+    StringView stringView(unsigned start = 0, std::optional<unsigned> stop = std::nullopt) const;
 
     LayoutUnit topOfFirstText() const;
     
diff --git a/Source/WebCore/rendering/RenderTextControl.h b/Source/WebCore/rendering/RenderTextControl.h
index 096f564..d093b79 100644
--- a/Source/WebCore/rendering/RenderTextControl.h
+++ b/Source/WebCore/rendering/RenderTextControl.h
@@ -99,8 +99,8 @@
     {
         return RenderBlock::baselinePosition(baseline, firstLine, direction, position);
     }
-    Optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); }
-    Optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
+    std::optional<int> firstLineBaseline() const override { return RenderBlock::firstLineBaseline(); }
+    std::optional<int> inlineBlockBaseline(LineDirectionMode direction) const override { return RenderBlock::inlineBlockBaseline(direction); }
 
 private:
     bool isFlexibleBoxImpl() const override { return true; }
diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp
index 8130d2e..574bb14 100644
--- a/Source/WebCore/rendering/RenderView.cpp
+++ b/Source/WebCore/rendering/RenderView.cpp
@@ -845,7 +845,7 @@
     }
 }
 
-void RenderView::setSelection(RenderObject* start, Optional<unsigned> startPos, RenderObject* end, Optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
+void RenderView::setSelection(RenderObject* start, std::optional<unsigned> startPos, RenderObject* end, std::optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
 {
     // Make sure both our start and end objects are defined.
     // Check www.msnbc.com and try clicking around to find the case where this happened.
@@ -882,7 +882,7 @@
     splitSelectionBetweenSubtrees(start, startPos, end, endPos, blockRepaintMode);
 }
 
-void RenderView::splitSelectionBetweenSubtrees(const RenderObject* start, Optional<unsigned> startPos, const RenderObject* end, Optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
+void RenderView::splitSelectionBetweenSubtrees(const RenderObject* start, std::optional<unsigned> startPos, const RenderObject* end, std::optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode)
 {
     // Compute the visible selection end points for each of the subtrees.
     RenderSubtreesMap renderSubtreesMap;
@@ -907,7 +907,7 @@
             SelectionSubtreeData selectionData = renderSubtreesMap.get(&root);
             if (selectionData.selectionClear()) {
                 selectionData.setSelectionStart(node->renderer());
-                selectionData.setSelectionStartPos(node == startNode ? startPos : Optional<unsigned>(0));
+                selectionData.setSelectionStartPos(node == startNode ? startPos : std::optional<unsigned>(0));
             }
 
             selectionData.setSelectionEnd(node->renderer());
@@ -1102,7 +1102,7 @@
         selectedBlockInfo.value->repaint();
 }
 
-void RenderView::getSelection(RenderObject*& startRenderer, Optional<unsigned>& startOffset, RenderObject*& endRenderer, Optional<unsigned>& endOffset) const
+void RenderView::getSelection(RenderObject*& startRenderer, std::optional<unsigned>& startOffset, RenderObject*& endRenderer, std::optional<unsigned>& endOffset) const
 {
     startRenderer = m_selectionUnsplitStart;
     startOffset = m_selectionUnsplitStartPos;
@@ -1113,7 +1113,7 @@
 void RenderView::clearSelection()
 {
     layer()->repaintBlockSelectionGaps();
-    setSelection(nullptr, Nullopt, nullptr, Nullopt, RepaintNewMinusOld);
+    setSelection(nullptr, std::nullopt, nullptr, std::nullopt, RepaintNewMinusOld);
 }
 
 bool RenderView::printing() const
diff --git a/Source/WebCore/rendering/RenderView.h b/Source/WebCore/rendering/RenderView.h
index 6e84f83..4a13aac 100644
--- a/Source/WebCore/rendering/RenderView.h
+++ b/Source/WebCore/rendering/RenderView.h
@@ -84,8 +84,8 @@
     void paintBoxDecorations(PaintInfo&, const LayoutPoint&) override;
 
     enum SelectionRepaintMode { RepaintNewXOROld, RepaintNewMinusOld, RepaintNothing };
-    void setSelection(RenderObject* start, Optional<unsigned> startPos, RenderObject* endObject, Optional<unsigned> endPos, SelectionRepaintMode = RepaintNewXOROld);
-    void getSelection(RenderObject*& startRenderer, Optional<unsigned>& startOffset, RenderObject*& endRenderer, Optional<unsigned>& endOffset) const;
+    void setSelection(RenderObject* start, std::optional<unsigned> startPos, RenderObject* endObject, std::optional<unsigned> endPos, SelectionRepaintMode = RepaintNewXOROld);
+    void getSelection(RenderObject*& startRenderer, std::optional<unsigned>& startOffset, RenderObject*& endRenderer, std::optional<unsigned>& endOffset) const;
     void clearSelection();
     RenderObject* selectionUnsplitStart() const { return m_selectionUnsplitStart; }
     RenderObject* selectionUnsplitEnd() const { return m_selectionUnsplitEnd; }
@@ -325,7 +325,7 @@
 
     bool isScrollableOrRubberbandableBox() const override;
 
-    void splitSelectionBetweenSubtrees(const RenderObject* startRenderer, Optional<unsigned> startPos, const RenderObject* endRenderer, Optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode);
+    void splitSelectionBetweenSubtrees(const RenderObject* startRenderer, std::optional<unsigned> startPos, const RenderObject* endRenderer, std::optional<unsigned> endPos, SelectionRepaintMode blockRepaintMode);
     void clearSubtreeSelection(const SelectionSubtreeRoot&, SelectionRepaintMode, OldSelectionData&) const;
     void updateSelectionForSubtrees(RenderSubtreesMap&, SelectionRepaintMode);
     void applySubtreeSelection(const SelectionSubtreeRoot&, SelectionRepaintMode, const OldSelectionData&);
@@ -337,8 +337,8 @@
 
     RenderObject* m_selectionUnsplitStart { nullptr };
     RenderObject* m_selectionUnsplitEnd { nullptr };
-    Optional<unsigned> m_selectionUnsplitStartPos;
-    Optional<unsigned> m_selectionUnsplitEndPos;
+    std::optional<unsigned> m_selectionUnsplitStartPos;
+    std::optional<unsigned> m_selectionUnsplitEndPos;
 
     // Include this RenderView.
     uint64_t m_rendererCount { 1 };
diff --git a/Source/WebCore/rendering/SelectionSubtreeRoot.h b/Source/WebCore/rendering/SelectionSubtreeRoot.h
index 0d19385..c7399ef 100644
--- a/Source/WebCore/rendering/SelectionSubtreeRoot.h
+++ b/Source/WebCore/rendering/SelectionSubtreeRoot.h
@@ -47,8 +47,8 @@
         {
         }
 
-        Optional<unsigned> selectionStartPos;
-        Optional<unsigned> selectionEndPos;
+        std::optional<unsigned> selectionStartPos;
+        std::optional<unsigned> selectionEndPos;
         SelectedObjectMap selectedObjects;
         SelectedBlockMap selectedBlocks;
     };
@@ -57,7 +57,7 @@
     public:
         SelectionSubtreeData() = default;
 
-        SelectionSubtreeData(RenderObject* selectionStart, Optional<unsigned> selectionStartPos, RenderObject* selectionEnd, Optional<unsigned> selectionEndPos)
+        SelectionSubtreeData(RenderObject* selectionStart, std::optional<unsigned> selectionStartPos, RenderObject* selectionEnd, std::optional<unsigned> selectionEndPos)
             : m_selectionStart(selectionStart)
             , m_selectionStartPos(selectionStartPos)
             , m_selectionEnd(selectionEnd)
@@ -66,9 +66,9 @@
         }
 
         RenderObject* selectionStart() const { return m_selectionStart; }
-        Optional<unsigned> selectionStartPos() const { return m_selectionStartPos; }
+        std::optional<unsigned> selectionStartPos() const { return m_selectionStartPos; }
         RenderObject* selectionEnd() const { return m_selectionEnd; }
-        Optional<unsigned> selectionEndPos() const { return m_selectionEndPos; }
+        std::optional<unsigned> selectionEndPos() const { return m_selectionEndPos; }
         bool selectionClear() const
         {
             return !m_selectionStart
@@ -83,22 +83,22 @@
             endPos = m_selectionEndPos.value();
         }
         void setSelectionStart(RenderObject* selectionStart) { m_selectionStart = selectionStart; }
-        void setSelectionStartPos(Optional<unsigned> selectionStartPos) { m_selectionStartPos = selectionStartPos;}
+        void setSelectionStartPos(std::optional<unsigned> selectionStartPos) { m_selectionStartPos = selectionStartPos;}
         void setSelectionEnd(RenderObject* selectionEnd) { m_selectionEnd = selectionEnd; }
-        void setSelectionEndPos(Optional<unsigned> selectionEndPos) { m_selectionEndPos = selectionEndPos;}
+        void setSelectionEndPos(std::optional<unsigned> selectionEndPos) { m_selectionEndPos = selectionEndPos;}
         void clearSelection()
         {
             m_selectionStart = nullptr;
-            m_selectionStartPos = Nullopt;
+            m_selectionStartPos = std::nullopt;
             m_selectionEnd = nullptr;
-            m_selectionEndPos = Nullopt;
+            m_selectionEndPos = std::nullopt;
         }
 
     private:
         RenderObject* m_selectionStart { nullptr };
-        Optional<unsigned> m_selectionStartPos;
+        std::optional<unsigned> m_selectionStartPos;
         RenderObject* m_selectionEnd { nullptr };
-        Optional<unsigned> m_selectionEndPos;
+        std::optional<unsigned> m_selectionEndPos;
     };
 
     typedef HashMap<SelectionSubtreeRoot*, SelectionSubtreeData> RenderSubtreesMap;
diff --git a/Source/WebCore/rendering/SimpleLineLayout.cpp b/Source/WebCore/rendering/SimpleLineLayout.cpp
index 071fb30..5f809d8 100644
--- a/Source/WebCore/rendering/SimpleLineLayout.cpp
+++ b/Source/WebCore/rendering/SimpleLineLayout.cpp
@@ -400,11 +400,11 @@
     float logicalLeftOffset() const { return m_logicalLeftOffset; }
     const TextFragmentIterator::TextFragment& overflowedFragment() const { return m_overflowedFragment; }
     bool hasTrailingWhitespace() const { return m_trailingWhitespaceLength; }
-    Optional<TextFragmentIterator::TextFragment> lastFragment() const
+    std::optional<TextFragmentIterator::TextFragment> lastFragment() const
     {
         if (m_fragments.size())
             return m_fragments.last();
-        return Nullopt;
+        return std::nullopt;
     }
     bool isWhitespaceOnly() const { return m_trailingWhitespaceWidth && m_runsWidth == m_trailingWhitespaceWidth; }
     bool fits(float extra) const { return m_availableWidth >= m_runsWidth + extra; }
@@ -807,7 +807,7 @@
     return textAlign;
 }
 
-static void closeLineEndingAndAdjustRuns(LineState& line, Layout::RunVector& runs, Optional<unsigned> lastRunIndexOfPreviousLine, unsigned& lineCount,
+static void closeLineEndingAndAdjustRuns(LineState& line, Layout::RunVector& runs, std::optional<unsigned> lastRunIndexOfPreviousLine, unsigned& lineCount,
     const TextFragmentIterator& textFragmentIterator, bool lastLineInFlow)
 {
     if (!runs.size() || (lastRunIndexOfPreviousLine && runs.size() - 1 == lastRunIndexOfPreviousLine.value()))
@@ -839,7 +839,7 @@
     LineState line;
     bool isEndOfContent = false;
     TextFragmentIterator textFragmentIterator = TextFragmentIterator(flow);
-    Optional<unsigned> lastRunIndexOfPreviousLine;
+    std::optional<unsigned> lastRunIndexOfPreviousLine;
     do {
         flow.setLogicalHeight(lineHeight * lineCount + borderAndPaddingBefore);
         LineState previousLine = line;
diff --git a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
index ec02865..95a37485 100644
--- a/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
+++ b/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
@@ -94,11 +94,11 @@
     textPainter.setFont(style.fontCascade());
     textPainter.setTextPaintStyle(computeTextPaintStyle(flow.frame(), style, paintInfo));
 
-    Optional<TextDecorationPainter> textDecorationPainter;
+    std::optional<TextDecorationPainter> textDecorationPainter;
     if (style.textDecorationsInEffect() != TextDecorationNone) {
         const RenderText* textRenderer = childrenOfType<RenderText>(flow).first();
         if (textRenderer) {
-            textDecorationPainter = TextDecorationPainter(paintInfo.context(), style.textDecorationsInEffect(), *textRenderer, false);
+            textDecorationPainter.emplace(paintInfo.context(), style.textDecorationsInEffect(), *textRenderer, false);
             textDecorationPainter->setFont(style.fontCascade());
             textDecorationPainter->setBaseline(style.fontMetrics().ascent());
         }
diff --git a/Source/WebCore/rendering/line/BreakingContext.h b/Source/WebCore/rendering/line/BreakingContext.h
index 11f2831..ed7611e 100644
--- a/Source/WebCore/rendering/line/BreakingContext.h
+++ b/Source/WebCore/rendering/line/BreakingContext.h
@@ -70,7 +70,7 @@
     {
     }
 
-    WTF::Optional<float> width(HashSet<const Font*>& fallbackFonts)
+    std::optional<float> width(HashSet<const Font*>& fallbackFonts)
     {
         if (m_state == WordTrailingSpaceState::Computed)
             return m_width;
@@ -85,7 +85,7 @@
 private:
     enum class WordTrailingSpaceState { Uninitialized, Computed };
     WordTrailingSpaceState m_state { WordTrailingSpaceState::Uninitialized };
-    WTF::Optional<float> m_width;
+    std::optional<float> m_width;
     const RenderStyle& m_style;
     TextLayout* m_textLayout { nullptr };
 };
@@ -173,7 +173,7 @@
         m_hangsAtEnd = false;
     }
 
-    void commitLineBreakAtCurrentWidth(RenderObject& object, unsigned offset = 0, Optional<unsigned> nextBreak = Optional<unsigned>())
+    void commitLineBreakAtCurrentWidth(RenderObject& object, unsigned offset = 0, std::optional<unsigned> nextBreak = std::optional<unsigned>())
     {
         m_width.commit();
         m_lineBreakHistory.moveTo(object, offset, nextBreak);
@@ -210,14 +210,14 @@
 
         RenderObject* renderer() const { return this->at(0).renderer(); }
         unsigned offset() const { return this->at(0).offset(); }
-        Optional<unsigned> nextBreakablePosition() const { return this->at(0).nextBreakablePosition(); }
+        std::optional<unsigned> nextBreakablePosition() const { return this->at(0).nextBreakablePosition(); }
         bool atTextParagraphSeparator() const { return this->at(0).atTextParagraphSeparator(); }
         UChar previousInSameNode() const { return this->at(0).previousInSameNode(); }
         const InlineIterator& get(size_t i) const { return this->at(i); };
         const InlineIterator& current() const { return get(0); }
         size_t historyLength() const { return this->size(); }
 
-        void moveTo(RenderObject& object, unsigned offset, Optional<unsigned> nextBreak = Nullopt)
+        void moveTo(RenderObject& object, unsigned offset, std::optional<unsigned> nextBreak = std::nullopt)
         {
             push([&](InlineIterator& modifyMe) {
                 modifyMe.moveTo(object, offset, nextBreak);
@@ -662,7 +662,7 @@
     lineWhitespaceCollapsingState.stopIgnoringSpaces(InlineIterator(0, textParagraphSeparator.renderer(), textParagraphSeparator.offset()));
 }
 
-inline void tryHyphenating(RenderText& text, const FontCascade& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, Optional<unsigned> nextBreakable, bool& hyphenated)
+inline void tryHyphenating(RenderText& text, const FontCascade& font, const AtomicString& localeIdentifier, unsigned consecutiveHyphenatedLines, int consecutiveHyphenatedLinesLimit, int minimumPrefixLimit, int minimumSuffixLimit, unsigned lastSpace, unsigned pos, float xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, std::optional<unsigned> nextBreakable, bool& hyphenated)
 {
     // Map 'hyphenate-limit-{before,after}: auto;' to 2.
     unsigned minimumPrefixLength;
@@ -740,7 +740,7 @@
     wordMeasurement.startOffset = lastSpace;
     
     float additionalTempWidth = 0;
-    WTF::Optional<float> wordTrailingSpaceWidth;
+    std::optional<float> wordTrailingSpaceWidth;
     if (currentCharacter == ' ')
         wordTrailingSpaceWidth = wordTrailingSpace.width(fallbackFonts);
     if (wordTrailingSpaceWidth)
@@ -870,7 +870,7 @@
             midWordBreak = m_width.committedWidth() + wrapW + charWidth > m_width.availableWidth();
         }
 
-        Optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition();
+        std::optional<unsigned> nextBreakablePosition = m_current.nextBreakablePosition();
         bool betweenWords = c == '\n' || (m_currWS != PRE && !m_atStart && isBreakable(m_renderTextInfo.lineBreakIterator, m_current.offset(), nextBreakablePosition, breakNBSP, isLooseCJKMode, keepAllWords)
             && (style.hyphens() != HyphensNone || (m_current.previousInSameNode() != softHyphen)));
         m_current.setNextBreakablePosition(nextBreakablePosition);
@@ -972,7 +972,7 @@
                     }
                     // Check if the last breaking position is a soft-hyphen.
                     if (!hyphenated && style.hyphens() != HyphensNone) {
-                        Optional<unsigned> lastBreakingPositon;
+                        std::optional<unsigned> lastBreakingPositon;
                         const RenderObject* rendererAtBreakingPosition = nullptr;
                         if (m_lineBreakHistory.offset() || m_lineBreakHistory.nextBreakablePosition()) {
                             lastBreakingPositon = m_lineBreakHistory.offset();
@@ -983,7 +983,7 @@
                             rendererAtBreakingPosition = m_current.renderer();
                         }
                         if (lastBreakingPositon) {
-                            Optional<UChar> characterBeforeBreakingPosition;
+                            std::optional<UChar> characterBeforeBreakingPosition;
                             // When last breaking position points to the start of the current context, we need to look at the last character from
                             // the previous non-empty text renderer.
                             if (!lastBreakingPositon.value())
@@ -1336,7 +1336,7 @@
         return lineBreak;
     bool isLooseCJKMode = m_renderTextInfo.text != &renderText && m_renderTextInfo.lineBreakIterator.isLooseCJKMode();
     bool breakNBSP = m_autoWrap && m_currentStyle->nbspMode() == SPACE;
-    Optional<unsigned> nextBreakablePosition = lineBreak.nextBreakablePosition();
+    std::optional<unsigned> nextBreakablePosition = lineBreak.nextBreakablePosition();
     isBreakable(m_renderTextInfo.lineBreakIterator, lineBreak.offset() + 1, nextBreakablePosition, breakNBSP, isLooseCJKMode, m_currentStyle->wordBreak() == KeepAllWordBreak);
     if (!nextBreakablePosition || nextBreakablePosition.value() != renderText.textLength())
         return lineBreak;
diff --git a/Source/WebCore/rendering/mathml/MathMLStyle.cpp b/Source/WebCore/rendering/mathml/MathMLStyle.cpp
index 5f316a4..ca46c2e 100644
--- a/Source/WebCore/rendering/mathml/MathMLStyle.cpp
+++ b/Source/WebCore/rendering/mathml/MathMLStyle.cpp
@@ -135,10 +135,10 @@
     // The displaystyle and mathvariant attributes override the default behavior.
     auto* element = downcast<RenderElement>(renderer)->element();
     if (is<MathMLElement>(element)) {
-        Optional<bool> displayStyle = downcast<MathMLElement>(element)->specifiedDisplayStyle();
+        std::optional<bool> displayStyle = downcast<MathMLElement>(element)->specifiedDisplayStyle();
         if (displayStyle)
             m_displayStyle = displayStyle.value();
-        Optional<MathMLElement::MathVariant> mathVariant = downcast<MathMLElement>(element)->specifiedMathVariant();
+        std::optional<MathMLElement::MathVariant> mathVariant = downcast<MathMLElement>(element)->specifiedMathVariant();
         if (mathVariant)
             m_mathVariant = mathVariant.value();
     }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
index 521550b..417e9c6 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
@@ -100,7 +100,7 @@
     if (linePositionMode == PositionOfInteriorLineBoxes)
         return 0;
 
-    return firstLineBaseline().valueOr(RenderBlock::baselinePosition(baselineType, firstLine, direction, linePositionMode));
+    return firstLineBaseline().value_or(RenderBlock::baselinePosition(baselineType, firstLine, direction, linePositionMode));
 }
 
 #if ENABLE(DEBUG_MATH_LAYOUT)
@@ -173,11 +173,11 @@
     }
 }
 
-Optional<int> RenderMathMLTable::firstLineBaseline() const
+std::optional<int> RenderMathMLTable::firstLineBaseline() const
 {
     // By default the vertical center of <mtable> is aligned on the math axis.
     // This is different than RenderTable::firstLineBoxBaseline, which returns the baseline of the first row of a <table>.
-    return Optional<int>(logicalHeight() / 2 + axisHeight(style()));
+    return std::optional<int>(logicalHeight() / 2 + axisHeight(style()));
 }
 
 void RenderMathMLBlock::layoutItems(bool relayoutChildren)
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
index 7a427bb..bb142a2 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLBlock.h
@@ -79,7 +79,7 @@
 
     static LayoutUnit ascentForChild(const RenderBox& child)
     {
-        return child.firstLineBaseline().valueOr(child.logicalHeight());
+        return child.firstLineBaseline().value_or(child.logicalHeight());
     }
 
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
@@ -109,7 +109,7 @@
 private:
     bool isRenderMathMLTable() const final { return true; }
     const char* renderName() const final { return "RenderMathMLTable"; }
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
 
     Ref<MathMLStyle> m_mathMLStyle;
 };
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 63f4188..35e4414 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -242,10 +242,10 @@
     info.context().drawLine(adjustedPaintOffset, roundedIntPoint(LayoutPoint(adjustedPaintOffset.x() + logicalWidth(), adjustedPaintOffset.y())));
 }
 
-Optional<int> RenderMathMLFraction::firstLineBaseline() const
+std::optional<int> RenderMathMLFraction::firstLineBaseline() const
 {
     if (isValid())
-        return Optional<int>(std::lround(static_cast<float>(m_ascent)));
+        return std::optional<int>(std::lround(static_cast<float>(m_ascent)));
     return RenderMathMLBlock::firstLineBaseline();
 }
 
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
index b999480..0ad9dff 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.h
@@ -48,7 +48,7 @@
 
     void computePreferredLogicalWidths() final;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
     void paint(PaintInfo&, const LayoutPoint&) final;
     RenderMathMLOperator* unembellishedOperator() final;
 
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
index 6d9a03c..9f97926 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.cpp
@@ -287,10 +287,10 @@
     return (m_stretchDepthBelowBaseline - m_stretchHeightAboveBaseline - m_mathOperator.descent() + m_mathOperator.ascent()) / 2;
 }
 
-Optional<int> RenderMathMLOperator::firstLineBaseline() const
+std::optional<int> RenderMathMLOperator::firstLineBaseline() const
 {
     if (useMathOperator())
-        return Optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent() - verticalStretchedOperatorShift())));
+        return std::optional<int>(std::lround(static_cast<float>(m_mathOperator.ascent() - verticalStretchedOperatorShift())));
     return RenderMathMLToken::firstLineBaseline();
 }
 
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
index 6071edf..e212e9b 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLOperator.h
@@ -77,7 +77,7 @@
     bool isRenderMathMLOperator() const final { return true; }
     bool isInvisibleOperator() const;
 
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
     RenderMathMLOperator* unembellishedOperator() final { return this; }
 
     LayoutUnit verticalStretchedOperatorShift() const;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
index c135a27..59b2b01 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLPadded.cpp
@@ -110,7 +110,7 @@
     clearNeedsLayout();
 }
 
-Optional<int> RenderMathMLPadded::firstLineBaseline() const
+std::optional<int> RenderMathMLPadded::firstLineBaseline() const
 {
     // We try and calculate the baseline from the position of the first child.
     LayoutUnit ascent;
@@ -118,7 +118,7 @@
         ascent = ascentForChild(*baselineChild) + baselineChild->logicalTop() + voffset();
     else
         ascent = mpaddedHeight(0);
-    return Optional<int>(std::lround(static_cast<float>(ascent)));
+    return std::optional<int>(std::lround(static_cast<float>(ascent)));
 }
 
 }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLPadded.h b/Source/WebCore/rendering/mathml/RenderMathMLPadded.h
index 0ac3c89..b1598d8 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLPadded.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLPadded.h
@@ -42,7 +42,7 @@
 
     void computePreferredLogicalWidths() final;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
 
     MathMLPaddedElement& element() const { return static_cast<MathMLPaddedElement&>(nodeForNonAnonymous()); }
     LayoutUnit voffset() const;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
index e5f12b3..c4bebc2 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.cpp
@@ -49,13 +49,13 @@
     return static_cast<MathMLRowElement&>(nodeForNonAnonymous());
 }
 
-Optional<int> RenderMathMLRow::firstLineBaseline() const
+std::optional<int> RenderMathMLRow::firstLineBaseline() const
 {
     auto* baselineChild = firstChildBox();
     if (!baselineChild)
-        return Optional<int>();
+        return std::optional<int>();
 
-    return Optional<int>(static_cast<int>(lroundf(ascentForChild(*baselineChild) + baselineChild->logicalTop())));
+    return std::optional<int>(static_cast<int>(lroundf(ascentForChild(*baselineChild) + baselineChild->logicalTop())));
 }
 
 void RenderMathMLRow::computeLineVerticalStretch(LayoutUnit& ascent, LayoutUnit& descent)
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLRow.h b/Source/WebCore/rendering/mathml/RenderMathMLRow.h
index 289421d..f9c1678 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLRow.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLRow.h
@@ -41,7 +41,7 @@
 
 protected:
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
-    Optional<int> firstLineBaseline() const override;
+    std::optional<int> firstLineBaseline() const override;
 
     void layoutRowItems(LayoutUnit& ascent, LayoutUnit& descent);
     void computeLineVerticalStretch(LayoutUnit& ascent, LayoutUnit& descent);
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
index fcfa4af..05d50e0 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.cpp
@@ -76,13 +76,13 @@
     return downcast<RenderMathMLBlock>(base)->unembellishedOperator();
 }
 
-Optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::validateAndGetReferenceChildren()
+std::optional<RenderMathMLScripts::ReferenceChildren> RenderMathMLScripts::validateAndGetReferenceChildren()
 {
     // All scripted elements must have at least one child.
     // The first child is the base.
     auto base = firstChildBox();
     if (!base)
-        return Nullopt;
+        return std::nullopt;
 
     ReferenceChildren reference;
     reference.base = base;
@@ -103,7 +103,7 @@
         // <mover> base overscript </mover>
         auto script = base->nextSiblingBox();
         if (!script || isPrescriptDelimiter(*script) || script->nextSiblingBox())
-            return Nullopt;
+            return std::nullopt;
         reference.firstPostScript = script;
         return reference;
     }
@@ -115,10 +115,10 @@
         // <munderover> base subscript superscript </munderover>
         auto subScript = base->nextSiblingBox();
         if (!subScript || isPrescriptDelimiter(*subScript))
-            return Nullopt;
+            return std::nullopt;
         auto superScript = subScript->nextSiblingBox();
         if (!superScript || isPrescriptDelimiter(*superScript) || superScript->nextSiblingBox())
-            return Nullopt;
+            return std::nullopt;
         reference.firstPostScript = subScript;
         return reference;
     }
@@ -148,19 +148,19 @@
             if (isPrescriptDelimiter(*script)) {
                 // This is a <mprescripts/>. Let's check 2a) and 2c).
                 if (!numberOfScriptIsEven || reference.firstPreScript)
-                    return Nullopt;
+                    return std::nullopt;
                 reference.firstPreScript = script->nextSiblingBox(); // We do 1).
                 reference.prescriptDelimiter = script;
                 continue;
             }
             numberOfScriptIsEven = !numberOfScriptIsEven;
         }
-        return numberOfScriptIsEven ? Optional<ReferenceChildren>(reference) : Nullopt; // We verify 2b).
+        return numberOfScriptIsEven ? std::optional<ReferenceChildren>(reference) : std::nullopt; // We verify 2b).
     }
     }
 
     ASSERT_NOT_REACHED();
-    return Nullopt;
+    return std::nullopt;
 }
 
 LayoutUnit RenderMathMLScripts::spaceAfterScript()
@@ -471,13 +471,13 @@
     clearNeedsLayout();
 }
 
-Optional<int> RenderMathMLScripts::firstLineBaseline() const
+std::optional<int> RenderMathMLScripts::firstLineBaseline() const
 {
     ASSERT(!needsLayout());
     auto* base = firstChildBox();
     if (!base)
-        return Optional<int>();
-    return Optional<int>(static_cast<int>(lroundf(ascentForChild(*base) + base->logicalTop())));
+        return std::optional<int>();
+    return std::optional<int>(static_cast<int>(lroundf(ascentForChild(*base) + base->logicalTop())));
 }
 
 }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
index d4870b4..ff04e86 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLScripts.h
@@ -52,14 +52,14 @@
 
 private:
     MathMLScriptsElement& element() const;
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
     struct ReferenceChildren {
         RenderBox* base;
         RenderBox* prescriptDelimiter;
         RenderBox* firstPostScript;
         RenderBox* firstPreScript;
     };
-    Optional<ReferenceChildren> validateAndGetReferenceChildren();
+    std::optional<ReferenceChildren> validateAndGetReferenceChildren();
     LayoutUnit spaceAfterScript();
     LayoutUnit italicCorrection(const ReferenceChildren&);
     struct VerticalParameters {
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
index 4c1fe9e..070aee7 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.cpp
@@ -82,11 +82,11 @@
     clearNeedsLayout();
 }
 
-Optional<int> RenderMathMLSpace::firstLineBaseline() const
+std::optional<int> RenderMathMLSpace::firstLineBaseline() const
 {
     LayoutUnit height, depth;
     getSpaceHeightAndDepth(height, depth);
-    return Optional<int>(height);
+    return std::optional<int>(height);
 }
 
 }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
index 0eb2056..fd19be2 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSpace.h
@@ -43,7 +43,7 @@
     bool isChildAllowed(const RenderObject&, const RenderStyle&) const final { return false; }
     void computePreferredLogicalWidths() final;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) final;
-    Optional<int> firstLineBaseline() const final;
+    std::optional<int> firstLineBaseline() const final;
 
     LayoutUnit spaceWidth() const;
     void getSpaceHeightAndDepth(LayoutUnit& height, LayoutUnit& depth) const;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
index bd1e96b..43bf206 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.cpp
@@ -516,7 +516,7 @@
 {
     ASSERT(m_mathVariantGlyphDirty);
 
-    m_mathVariantCodePoint = Nullopt;
+    m_mathVariantCodePoint = std::nullopt;
     m_mathVariantGlyphDirty = false;
 
     // Early return if the token element contains RenderElements.
@@ -551,12 +551,12 @@
     setMathVariantGlyphDirty();
 }
 
-Optional<int> RenderMathMLToken::firstLineBaseline() const
+std::optional<int> RenderMathMLToken::firstLineBaseline() const
 {
     if (m_mathVariantCodePoint) {
         auto mathVariantGlyph = style().fontCascade().glyphDataForCharacter(m_mathVariantCodePoint.value(), m_mathVariantIsMirrored);
         if (mathVariantGlyph.font)
-            return Optional<int>(static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y())));
+            return std::optional<int>(static_cast<int>(lroundf(-mathVariantGlyph.font->boundsForGlyph(mathVariantGlyph.glyph).y())));
     }
     return RenderMathMLBlock::firstLineBaseline();
 }
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLToken.h b/Source/WebCore/rendering/mathml/RenderMathMLToken.h
index c331ec5..5101d6a 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLToken.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLToken.h
@@ -48,7 +48,7 @@
 protected:
     void paint(PaintInfo&, const LayoutPoint&) override;
     void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) override;
-    Optional<int> firstLineBaseline() const override;
+    std::optional<int> firstLineBaseline() const override;
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) override;
     void computePreferredLogicalWidths() override;
 
@@ -63,7 +63,7 @@
         m_mathVariantGlyphDirty = true;
         setNeedsLayoutAndPrefWidthsRecalc();
     }
-    Optional<UChar32> m_mathVariantCodePoint { Nullopt };
+    std::optional<UChar32> m_mathVariantCodePoint { std::nullopt };
     bool m_mathVariantIsMirrored { false };
     bool m_mathVariantGlyphDirty { false };
 };
diff --git a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
index eea4f0d..ccdf24f 100644
--- a/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGContainer.cpp
@@ -173,7 +173,7 @@
     if (!pointIsInsideViewportClip(pointInParent))
         return false;
 
-    FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
 
     if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
         return false;
diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
index 2bf086f..1095d24 100644
--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
@@ -183,7 +183,7 @@
     if (hitTestAction != HitTestForeground)
         return false;
 
-    FloatPoint localPoint = localTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = localTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
 
     // Early exit if local point is not contained in clipped viewport area
     if (SVGRenderSupport::isOverflowHidden(*this) && !m_viewport.contains(localPoint))
diff --git a/Source/WebCore/rendering/svg/RenderSVGImage.cpp b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
index 1ded651..8de5bf4 100644
--- a/Source/WebCore/rendering/svg/RenderSVGImage.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGImage.cpp
@@ -185,7 +185,7 @@
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style().pointerEvents());
     bool isVisible = (style().visibility() == VISIBLE);
     if (isVisible || !hitRules.requireVisible) {
-        FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
+        FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
             
         if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
             return false;
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
index b5cbde6..5d835fe 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
@@ -267,10 +267,10 @@
         AffineTransform transform;
         transform.translate(objectBoundingBox.x(), objectBoundingBox.y());
         transform.scaleNonUniform(objectBoundingBox.width(), objectBoundingBox.height());
-        point = transform.inverse().valueOr(AffineTransform()).mapPoint(point);
+        point = transform.inverse().value_or(AffineTransform()).mapPoint(point);
     }
 
-    point = clipPathElement().animatedLocalTransform().inverse().valueOr(AffineTransform()).mapPoint(point);
+    point = clipPathElement().animatedLocalTransform().inverse().value_or(AffineTransform()).mapPoint(point);
 
     for (Node* childNode = clipPathElement().firstChild(); childNode; childNode = childNode->nextSibling()) {
         RenderObject* renderer = childNode->renderer();
diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
index a490464..cd5bf75 100644
--- a/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
@@ -268,7 +268,7 @@
 
         ImageBuffer* resultImage = lastEffect->asImageBuffer();
         if (resultImage) {
-            context->concatCTM(filterData->shearFreeAbsoluteTransform.inverse().valueOr(AffineTransform()));
+            context->concatCTM(filterData->shearFreeAbsoluteTransform.inverse().value_or(AffineTransform()));
 
             context->scale(FloatSize(1 / filterData->filter->filterResolution().width(), 1 / filterData->filter->filterResolution().height()));
             context->drawImageBuffer(*resultImage, lastEffect->absolutePaintRect());
diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
index c526ecf..bef903e 100644
--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
@@ -430,7 +430,7 @@
     // Only test SVG content if the point is in our content box.
     // FIXME: This should be an intersection when rect-based hit tests are supported by nodeAtFloatPoint.
     if (contentBoxRect().contains(pointInBorderBox)) {
-        FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(pointInParent));
+        FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(FloatPoint(pointInParent));
 
         for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
             // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet.
diff --git a/Source/WebCore/rendering/svg/RenderSVGShape.cpp b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
index 15eaa3d..43ab7d8 100644
--- a/Source/WebCore/rendering/svg/RenderSVGShape.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGShape.cpp
@@ -200,7 +200,7 @@
 
 bool RenderSVGShape::setupNonScalingStrokeContext(AffineTransform& strokeTransform, GraphicsContextStateSaver& stateSaver)
 {
-    Optional<AffineTransform> inverse = strokeTransform.inverse();
+    std::optional<AffineTransform> inverse = strokeTransform.inverse();
     if (!inverse)
         return false;
 
@@ -338,7 +338,7 @@
     if (hitTestAction != HitTestForeground)
         return false;
 
-    FloatPoint localPoint = m_localTransform.inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = m_localTransform.inverse().value_or(AffineTransform()).mapPoint(pointInParent);
 
     if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
         return false;
@@ -410,7 +410,7 @@
         BoundingRectStrokeStyleApplier strokeStyle(*this);
         if (hasNonScalingStroke()) {
             AffineTransform nonScalingTransform = nonScalingStrokeTransform();
-            if (Optional<AffineTransform> inverse = nonScalingTransform.inverse()) {
+            if (std::optional<AffineTransform> inverse = nonScalingTransform.inverse()) {
                 Path* usePath = nonScalingStrokePath(m_path.get(), nonScalingTransform);
                 FloatRect strokeBoundingRect = usePath->strokeBoundingRect(&strokeStyle);
                 strokeBoundingRect = inverse.value().mapRect(strokeBoundingRect);
diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp
index 5900a51..d3bb30d 100644
--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp
+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp
@@ -433,7 +433,7 @@
     if (isVisible || !hitRules.requireVisible) {
         if ((hitRules.canHitStroke && (style().svgStyle().hasStroke() || !hitRules.requireStroke))
             || (hitRules.canHitFill && (style().svgStyle().hasFill() || !hitRules.requireFill))) {
-            FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
+            FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
 
             if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
                 return false;       
diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
index 84b7e3f..b782940 100644
--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp
@@ -370,7 +370,7 @@
     if (localToRootTransform.isIdentity())
         return;
 
-    AffineTransform rootToLocalTransform = localToRootTransform.inverse().valueOr(AffineTransform());
+    AffineTransform rootToLocalTransform = localToRootTransform.inverse().value_or(AffineTransform());
     repaintRect = rootToLocalTransform.mapRect(repaintRect);
 }
 
diff --git a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
index 4f35ed9..c4b3aac 100644
--- a/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
+++ b/Source/WebCore/rendering/svg/SVGRenderingContext.cpp
@@ -318,7 +318,7 @@
 
     // The mask image has been created in the absolute coordinate space, as the image should not be scaled.
     // So the actual masking process has to be done in the absolute coordinate space as well.
-    context.concatCTM(absoluteTransform.inverse().valueOr(AffineTransform()));
+    context.concatCTM(absoluteTransform.inverse().value_or(AffineTransform()));
     context.clipToImageBuffer(*imageBuffer, absoluteTargetRect);
     context.concatCTM(absoluteTransform);
 
diff --git a/Source/WebCore/rendering/svg/SVGTextQuery.cpp b/Source/WebCore/rendering/svg/SVGTextQuery.cpp
index 3520c2a..86e4bf2 100644
--- a/Source/WebCore/rendering/svg/SVGTextQuery.cpp
+++ b/Source/WebCore/rendering/svg/SVGTextQuery.cpp
@@ -169,7 +169,7 @@
     bool alterStartPosition = true;
     bool alterEndPosition = true;
 
-    Optional<unsigned> lastPositionOffset;
+    std::optional<unsigned> lastPositionOffset;
     for (; textMetricsOffset < textMetricsSize && positionOffset < positionSize; ++textMetricsOffset) {
         SVGTextMetrics& metrics = textMetricsValues[textMetricsOffset];
 
diff --git a/Source/WebCore/style/RenderTreeUpdater.cpp b/Source/WebCore/style/RenderTreeUpdater.cpp
index 782a6ab..51c693c 100644
--- a/Source/WebCore/style/RenderTreeUpdater.cpp
+++ b/Source/WebCore/style/RenderTreeUpdater.cpp
@@ -70,7 +70,7 @@
 RenderTreeUpdater::Parent::Parent(Element& element, Style::Change styleChange)
     : element(&element)
     , styleChange(styleChange)
-    , renderTreePosition(element.renderer() ? makeOptional(RenderTreePosition(*element.renderer())) : Nullopt)
+    , renderTreePosition(element.renderer() ? std::make_optional(RenderTreePosition(*element.renderer())) : std::nullopt)
 {
 }
 
diff --git a/Source/WebCore/style/RenderTreeUpdater.h b/Source/WebCore/style/RenderTreeUpdater.h
index 4689b08..9bf475b 100644
--- a/Source/WebCore/style/RenderTreeUpdater.h
+++ b/Source/WebCore/style/RenderTreeUpdater.h
@@ -63,7 +63,7 @@
     struct Parent {
         Element* element { nullptr };
         Style::Change styleChange { Style::NoChange };
-        Optional<RenderTreePosition> renderTreePosition;
+        std::optional<RenderTreePosition> renderTreePosition;
 
         Parent(ContainerNode& root);
         Parent(Element&, Style::Change);
diff --git a/Source/WebCore/style/StyleScope.h b/Source/WebCore/style/StyleScope.h
index cf10b66..0a6e70f 100644
--- a/Source/WebCore/style/StyleScope.h
+++ b/Source/WebCore/style/StyleScope.h
@@ -145,7 +145,7 @@
     int m_pendingStyleSheetCount { 0 };
     bool m_didUpdateActiveStyleSheets { false };
 
-    Optional<UpdateType> m_pendingUpdate;
+    std::optional<UpdateType> m_pendingUpdate;
     bool m_hasDescendantWithPendingUpdate { false };
 
     ListHashSet<Node*> m_styleSheetCandidateNodes;
diff --git a/Source/WebCore/svg/SVGElement.cpp b/Source/WebCore/svg/SVGElement.cpp
index b2cb3b3..f0415fc 100644
--- a/Source/WebCore/svg/SVGElement.cpp
+++ b/Source/WebCore/svg/SVGElement.cpp
@@ -461,7 +461,7 @@
     if (name == HTMLNames::tabindexAttr) {
         if (value.isEmpty())
             clearTabIndexExplicitlyIfNeeded();
-        else if (Optional<int> tabIndex = parseHTMLInteger(value))
+        else if (std::optional<int> tabIndex = parseHTMLInteger(value))
             setTabIndexExplicitly(tabIndex.value());
         return;
     }
@@ -726,7 +726,7 @@
     contextElement->synchronizeSystemLanguage();
 }
 
-Optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*)
+std::optional<ElementStyle> SVGElement::resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle*)
 {
     // If the element is in a <use> tree we get the style from the definition tree.
     if (auto* styleElement = this->correspondingElement())
diff --git a/Source/WebCore/svg/SVGElement.h b/Source/WebCore/svg/SVGElement.h
index c9bc3ac..c666a6a 100644
--- a/Source/WebCore/svg/SVGElement.h
+++ b/Source/WebCore/svg/SVGElement.h
@@ -106,7 +106,7 @@
     void synchronizeAnimatedSVGAttribute(const QualifiedName&) const;
     static void synchronizeAllAnimatedSVGAttribute(SVGElement*);
  
-    Optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
+    std::optional<ElementStyle> resolveCustomStyle(const RenderStyle& parentStyle, const RenderStyle* shadowHostStyle) override;
 
     static void synchronizeRequiredFeatures(SVGElement* contextElement);
     static void synchronizeRequiredExtensions(SVGElement* contextElement);
diff --git a/Source/WebCore/svg/SVGToOTFFontConversion.cpp b/Source/WebCore/svg/SVGToOTFFontConversion.cpp
index 0eeaa5fc..f0643d3 100644
--- a/Source/WebCore/svg/SVGToOTFFontConversion.cpp
+++ b/Source/WebCore/svg/SVGToOTFFontConversion.cpp
@@ -195,7 +195,7 @@
 
     uint32_t calculateChecksum(size_t startingOffset, size_t endingOffset) const;
 
-    void processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement*, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, Optional<FloatRect>& boundingBox);
+    void processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement*, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, std::optional<FloatRect>& boundingBox);
 
     typedef void (SVGToOTFFontConverter::*FontAppendingFunction)();
     void appendTable(const char identifier[4], FontAppendingFunction);
@@ -221,7 +221,7 @@
 
     void appendValidCFFString(const String&);
 
-    Vector<char> transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, Optional<FloatRect>& boundingBox) const;
+    Vector<char> transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, std::optional<FloatRect>& boundingBox) const;
 
     void addCodepointRanges(const UnicodeRanges&, HashSet<Glyph>& glyphSet) const;
     void addCodepoints(const HashSet<String>& codepoints, HashSet<Glyph>& glyphSet) const;
@@ -1155,7 +1155,7 @@
         m_cffData.append(rMoveTo);
     }
 
-    Optional<FloatRect> boundingBox() const
+    std::optional<FloatRect> boundingBox() const
     {
         return m_boundingBox;
     }
@@ -1246,11 +1246,11 @@
     Vector<char>& m_cffData;
     FloatPoint m_startingPoint;
     FloatPoint m_current;
-    Optional<FloatRect> m_boundingBox;
+    std::optional<FloatRect> m_boundingBox;
     float m_unitsPerEmScalar;
 };
 
-Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, Optional<FloatRect>& boundingBox) const
+Vector<char> SVGToOTFFontConverter::transcodeGlyphPaths(float width, const SVGElement& glyphOrMissingGlyphElement, std::optional<FloatRect>& boundingBox) const
 {
     Vector<char> result;
 
@@ -1286,7 +1286,7 @@
     return result;
 }
 
-void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement* glyphElement, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, Optional<FloatRect>& boundingBox)
+void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissingGlyphElement, const SVGGlyphElement* glyphElement, float defaultHorizontalAdvance, float defaultVerticalAdvance, const String& codepoints, std::optional<FloatRect>& boundingBox)
 {
     bool ok;
     float horizontalAdvance = scaleUnitsPerEm(glyphOrMissingGlyphElement.attributeWithoutSynchronization(SVGNames::horiz_adv_xAttr).toFloat(&ok));
@@ -1298,7 +1298,7 @@
         verticalAdvance = defaultVerticalAdvance;
     m_advanceHeightMax = std::max(m_advanceHeightMax, verticalAdvance);
 
-    Optional<FloatRect> glyphBoundingBox;
+    std::optional<FloatRect> glyphBoundingBox;
     auto path = transcodeGlyphPaths(horizontalAdvance, glyphOrMissingGlyphElement, glyphBoundingBox);
     if (!path.size()) {
         // It's better to use a fallback font rather than use a font without all its glyphs.
@@ -1311,7 +1311,7 @@
     if (glyphBoundingBox)
         m_minRightSideBearing = std::min(m_minRightSideBearing, horizontalAdvance - glyphBoundingBox.value().maxX());
 
-    m_glyphs.append(GlyphData(WTFMove(path), glyphElement, horizontalAdvance, verticalAdvance, glyphBoundingBox.valueOr(FloatRect()), codepoints));
+    m_glyphs.append(GlyphData(WTFMove(path), glyphElement, horizontalAdvance, verticalAdvance, glyphBoundingBox.value_or(FloatRect()), codepoints));
 }
 
 void SVGToOTFFontConverter::appendLigatureGlyphs()
@@ -1421,7 +1421,7 @@
 
     populateEmptyGlyphCharString(m_emptyGlyphCharString, s_outputUnitsPerEm);
 
-    Optional<FloatRect> boundingBox;
+    std::optional<FloatRect> boundingBox;
     if (m_missingGlyphElement)
         processGlyphElement(*m_missingGlyphElement, nullptr, defaultHorizontalAdvance, defaultVerticalAdvance, String(), boundingBox);
     else {
@@ -1435,7 +1435,7 @@
             processGlyphElement(glyphElement, &glyphElement, defaultHorizontalAdvance, defaultVerticalAdvance, unicodeAttribute, boundingBox);
     }
 
-    m_boundingBox = boundingBox.valueOr(FloatRect());
+    m_boundingBox = boundingBox.value_or(FloatRect());
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
     // <rdar://problem/20086223> Cocoa has a bug where glyph bounding boxes are not correctly respected for frustum culling. Work around this by
@@ -1584,13 +1584,13 @@
     return true;
 }
 
-Optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement& element)
+std::optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement& element)
 {
     SVGToOTFFontConverter converter(element);
     if (converter.error())
-        return Nullopt;
+        return std::nullopt;
     if (!converter.convertSVGToOTFFont())
-        return Nullopt;
+        return std::nullopt;
     return converter.releaseResult();
 }
 
diff --git a/Source/WebCore/svg/SVGToOTFFontConversion.h b/Source/WebCore/svg/SVGToOTFFontConversion.h
index cc53de3..7756e45 100644
--- a/Source/WebCore/svg/SVGToOTFFontConversion.h
+++ b/Source/WebCore/svg/SVGToOTFFontConversion.h
@@ -32,6 +32,6 @@
 
 class SVGFontElement;
 
-Optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement&);
+std::optional<Vector<char>> convertSVGToOTFFont(const SVGFontElement&);
 
 } // namespace WebCore
diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp
index 938c7f0..10f68fe 100644
--- a/Source/WebCore/testing/Internals.cpp
+++ b/Source/WebCore/testing/Internals.cpp
@@ -854,14 +854,14 @@
     return contextDocument()->isTimerThrottlingEnabled();
 }
 
-void Internals::setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> value)
+void Internals::setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior> value)
 {
     Document* document = contextDocument();
     if (!document || !document->page())
         return;
 
     if (!value) {
-        document->page()->setEventThrottlingBehaviorOverride(Nullopt);
+        document->page()->setEventThrottlingBehaviorOverride(std::nullopt);
         return;
     }
 
@@ -875,15 +875,15 @@
     }
 }
 
-Optional<Internals::EventThrottlingBehavior> Internals::eventThrottlingBehaviorOverride() const
+std::optional<Internals::EventThrottlingBehavior> Internals::eventThrottlingBehaviorOverride() const
 {
     Document* document = contextDocument();
     if (!document || !document->page())
-        return Nullopt;
+        return std::nullopt;
 
     auto behavior = document->page()->eventThrottlingBehaviorOverride();
     if (!behavior)
-        return Nullopt;
+        return std::nullopt;
     
     switch (behavior.value()) {
     case WebCore::EventThrottlingBehavior::Responsive:
@@ -892,7 +892,7 @@
         return Internals::EventThrottlingBehavior::Unresponsive;
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 String Internals::visiblePlaceholder(Element& element)
diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h
index 250fd05..100e82c 100644
--- a/Source/WebCore/testing/Internals.h
+++ b/Source/WebCore/testing/Internals.h
@@ -122,8 +122,8 @@
     bool areTimersThrottled() const;
 
     enum EventThrottlingBehavior { Responsive, Unresponsive };
-    void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior>);
-    Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const;
+    void setEventThrottlingBehaviorOverride(std::optional<EventThrottlingBehavior>);
+    std::optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const;
 
     // Spatial Navigation testing.
     ExceptionOr<unsigned> lastSpatialNavigationCandidateCount() const;
diff --git a/Source/WebCore/workers/Worker.h b/Source/WebCore/workers/Worker.h
index 12884cf..19d8d56 100644
--- a/Source/WebCore/workers/Worker.h
+++ b/Source/WebCore/workers/Worker.h
@@ -75,7 +75,7 @@
     RefPtr<WorkerScriptLoader> m_scriptLoader;
     String m_identifier;
     WorkerGlobalScopeProxy* m_contextProxy; // The proxy outlives the worker to perform thread shutdown.
-    Optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders;
+    std::optional<ContentSecurityPolicyResponseHeaders> m_contentSecurityPolicyResponseHeaders;
     bool m_shouldBypassMainWorldContentSecurityPolicy { false };
     JSC::RuntimeFlags m_runtimeFlags;
 };
diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp
index 509a9a9..0ca7389 100644
--- a/Source/WebCore/xml/XMLHttpRequest.cpp
+++ b/Source/WebCore/xml/XMLHttpRequest.cpp
@@ -476,10 +476,10 @@
     return open(method, urlWithCredentials, async);
 }
 
-Optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend()
+std::optional<ExceptionOr<void>> XMLHttpRequest::prepareToSend()
 {
-    // A return value other than Nullopt means we should not try to send, and we should return that value to the caller.
-    // Nullopt means we are ready to send and should continue with the send algorithm.
+    // A return value other than std::nullopt means we should not try to send, and we should return that value to the caller.
+    // std::nullopt means we are ready to send and should continue with the send algorithm.
 
     if (!scriptExecutionContext())
         return ExceptionOr<void> { };
@@ -501,7 +501,7 @@
     }
 
     m_error = false;
-    return Nullopt;
+    return std::nullopt;
 }
 
 ExceptionOr<void> XMLHttpRequest::send(Document& document)
@@ -980,7 +980,7 @@
 
     m_responseBuilder.shrinkToFit();
 
-    Optional<String> decodedText;
+    std::optional<String> decodedText;
     if (!m_binaryResponseBuilder)
         decodedText = m_responseBuilder.toStringPreserveCapacity();
     InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), this, identifier, decodedText, m_url, m_lastSendURL, m_lastSendLineNumber, m_lastSendColumnNumber);
diff --git a/Source/WebCore/xml/XMLHttpRequest.h b/Source/WebCore/xml/XMLHttpRequest.h
index af650fe..04abc09 100644
--- a/Source/WebCore/xml/XMLHttpRequest.h
+++ b/Source/WebCore/xml/XMLHttpRequest.h
@@ -153,7 +153,7 @@
 
     bool responseIsXML() const;
 
-    Optional<ExceptionOr<void>> prepareToSend();
+    std::optional<ExceptionOr<void>> prepareToSend();
     ExceptionOr<void> sendBytesData(const void*, size_t);
 
     void changeState(State);
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 44c6b4c..66e4e27 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,32 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        Use WTF::Optional::value_or.
+
+        * DOM/DOMHTMLOptionsCollection.mm:
+        (-[DOMHTMLOptionsCollection add:index:]):
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::evaluate):
+        * Plugins/WebNetscapePluginView.mm:
+        (-[WebNetscapePluginView sendEvent:isDrawRect:]):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::dispatchDidCommitLoad):
+        * WebCoreSupport/WebPaymentCoordinatorClient.h:
+        * WebCoreSupport/WebPaymentCoordinatorClient.mm:
+        (WebPaymentCoordinatorClient::completeShippingMethodSelection):
+        (WebPaymentCoordinatorClient::completeShippingContactSelection):
+        (WebPaymentCoordinatorClient::completePaymentMethodSelection):
+        * WebCoreSupport/WebSecurityOrigin.mm:
+        (-[WebSecurityOrigin port]):
+        * WebView/WebHTMLView.mm:
+        (toAction):
+        (toTag):
+
 2016-11-26  Sam Weinig  <sam@webkit.org>
 
         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
diff --git a/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm b/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm
index 503ff62..fdfa6e8 100644
--- a/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm
+++ b/Source/WebKit/mac/DOM/DOMHTMLOptionsCollection.mm
@@ -90,7 +90,7 @@
     WebCore::JSMainThreadNullState state;
     if (!option)
         raiseTypeErrorException();
-    raiseOnDOMError(IMPL->add(core(option), Optional<WebCore::HTMLOptionsCollection::HTMLElementOrInt> { static_cast<int>(index) }));
+    raiseOnDOMError(IMPL->add(core(option), std::optional<WebCore::HTMLOptionsCollection::HTMLElementOrInt> { static_cast<int>(index) }));
 }
 
 - (void)remove:(unsigned)index
diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 36dbbec..b9ab8a0 100644
--- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -889,7 +889,7 @@
     Strong<JSGlobalObject> globalObject(vm, frame->script().globalObject(pluginWorld()));
     ExecState* exec = globalObject->globalExec();
 
-    UserGestureIndicator gestureIndicator(allowPopups ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(allowPopups ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
     
     JSValue result = JSC::evaluate(exec, makeSource(script));
     
diff --git a/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm b/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
index eeaaba8..d9e58e3 100644
--- a/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/Source/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -666,7 +666,7 @@
     ASSERT(_eventHandler);
     {
         JSC::JSLock::DropAllLocks dropAllLocks(JSDOMWindowBase::commonVM());
-        UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+        UserGestureIndicator gestureIndicator(_eventHandler->currentEventIsUserGesture() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
         acceptedEvent = [_pluginPackage.get() pluginFuncs]->event(plugin, event);
     }
     [self didCallPlugInFunction];
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
index 362dc6d..a11fb88 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
@@ -111,7 +111,7 @@
     void dispatchDidReceiveIcon() override;
     void dispatchDidStartProvisionalLoad() override;
     void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override;
-    void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override;
+    void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) override;
     void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override;
     void dispatchDidFailLoad(const WebCore::ResourceError&) override;
     void dispatchDidFinishDocumentLoad() override;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index f0b312f..c49d51b 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -690,7 +690,7 @@
         CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.string(), m_webFrame.get());
 }
 
-void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>)
+void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>)
 {
     // Tell the client we've committed this URL.
     ASSERT([m_webFrame->_private->webFrameView documentView] != nil);
diff --git a/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h b/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
index cffc113..0210064 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h
@@ -42,9 +42,9 @@
     void openPaymentSetup(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler) override;
     bool showPaymentUI(const WebCore::URL&, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&) override;
     void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override;
-    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
-    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
-    void completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems>) override;
+    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+    void completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems>) override;
     void completePaymentSession(WebCore::PaymentAuthorizationStatus) override;
     void abortPaymentSession() override;
     void paymentCoordinatorDestroyed() override;
diff --git a/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm
index 80b4f7f..ebfd835 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm
@@ -71,15 +71,15 @@
 {
 }
 
-void WebPaymentCoordinatorClient::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems>)
+void WebPaymentCoordinatorClient::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional<WebCore::PaymentRequest::TotalAndLineItems>)
 {
 }
 
-void WebPaymentCoordinatorClient::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, Optional<WebCore::PaymentRequest::TotalAndLineItems>)
+void WebPaymentCoordinatorClient::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, std::optional<WebCore::PaymentRequest::TotalAndLineItems>)
 {
 }
 
-void WebPaymentCoordinatorClient::completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems>)
+void WebPaymentCoordinatorClient::completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems>)
 {
 }
 
diff --git a/Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm b/Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
index 14f3f44..4f424837 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
+++ b/Source/WebKit/mac/WebCoreSupport/WebSecurityOrigin.mm
@@ -88,7 +88,7 @@
 
 - (unsigned short)port
 {
-    return reinterpret_cast<SecurityOrigin*>(_private)->port().valueOr(0);
+    return reinterpret_cast<SecurityOrigin*>(_private)->port().value_or(0);
 }
 
 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary,
diff --git a/Source/WebKit/mac/WebView/WebHTMLView.mm b/Source/WebKit/mac/WebView/WebHTMLView.mm
index 892320c..d289f1a 100644
--- a/Source/WebKit/mac/WebView/WebHTMLView.mm
+++ b/Source/WebKit/mac/WebView/WebHTMLView.mm
@@ -182,7 +182,7 @@
 - (void)forwardContextMenuAction:(id)sender;
 @end
 
-static Optional<ContextMenuAction> toAction(NSInteger tag)
+static std::optional<ContextMenuAction> toAction(NSInteger tag)
 {
     if (tag >= ContextMenuItemBaseCustomTag && tag <= ContextMenuItemLastCustomTag) {
         // Just pass these through.
@@ -357,14 +357,14 @@
     case WebMenuItemTagDictationAlternative:
         return ContextMenuItemTagDictationAlternative;
     }
-    return Nullopt;
+    return std::nullopt;
 }
 
-static Optional<NSInteger> toTag(ContextMenuAction action)
+static std::optional<NSInteger> toTag(ContextMenuAction action)
 {
     switch (action) {
     case ContextMenuItemTagNoAction:
-        return Nullopt;
+        return std::nullopt;
 
     case ContextMenuItemTagOpenLinkInNewWindow:
         return WebMenuItemTagOpenLinkInNewWindow;
@@ -547,7 +547,7 @@
         ASSERT_NOT_REACHED();
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 static WebMenuTarget* target;
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index 3bb8a64..22fb9b4 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,20 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        Use WTF::Optional::value_or.
+
+        * Plugins/PluginView.cpp:
+        (WebCore::PluginView::performRequest):
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::dispatchDidCommitLoad):
+        * WebCoreSupport/WebFrameLoaderClient.h:
+        * WebSecurityOrigin.cpp:
+        (WebSecurityOrigin::port):
+
 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
 
         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
diff --git a/Source/WebKit/win/Plugins/PluginView.cpp b/Source/WebKit/win/Plugins/PluginView.cpp
index dadd3b7..207a961 100644
--- a/Source/WebKit/win/Plugins/PluginView.cpp
+++ b/Source/WebKit/win/Plugins/PluginView.cpp
@@ -406,7 +406,7 @@
     URL requestURL = request->frameLoadRequest().resourceRequest().url();
     String jsString = scriptStringIfJavaScriptURL(requestURL);
 
-    UserGestureIndicator gestureIndicator(request->shouldAllowPopups() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(request->shouldAllowPopups() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
 
     if (jsString.isNull()) {
         // if this is not a targeted request, create a stream for it. otherwise,
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
index 7427e0c..1561852 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -423,7 +423,7 @@
         frameLoadDelegate->didReceiveTitle(webView, BString(title.string()), m_webFrame);
 }
 
-void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>)
+void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent>)
 {
     WebView* webView = m_webFrame->webView();
     COMPtr<IWebFrameLoadDelegate> frameLoadDelegate;
diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
index f272e60..8ca9b9d 100644
--- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
+++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h
@@ -86,7 +86,7 @@
     void dispatchDidReceiveIcon() override;
     void dispatchDidStartProvisionalLoad() override;
     void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override;
-    void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override;
+    void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) override;
     void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override;
     void dispatchDidFailLoad(const WebCore::ResourceError&) override;
     void dispatchDidFinishDocumentLoad() override;
diff --git a/Source/WebKit/win/WebSecurityOrigin.cpp b/Source/WebKit/win/WebSecurityOrigin.cpp
index 4ba456a..906cbba 100644
--- a/Source/WebKit/win/WebSecurityOrigin.cpp
+++ b/Source/WebKit/win/WebSecurityOrigin.cpp
@@ -120,7 +120,7 @@
     if (!result)
         return E_POINTER;
 
-    *result = m_securityOrigin->port().valueOr(0);
+    *result = m_securityOrigin->port().value_or(0);
 
     return S_OK;
 }
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 38492d9..0305ad9 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,191 @@
+2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [WTF] Import std::optional reference implementation as WTF::Optional
+        https://bugs.webkit.org/show_bug.cgi?id=164199
+
+        Reviewed by Saam Barati and Sam Weinig.
+
+        * NetworkProcess/NetworkDataTask.cpp:
+        (WebKit::NetworkDataTask::didReceiveResponse):
+        * NetworkProcess/NetworkLoad.h:
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::responseHasExpired):
+        * NetworkProcess/cache/NetworkCacheCoders.h:
+        (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
+        (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
+        (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
+        (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
+        * NetworkProcess/cache/NetworkCacheData.cpp:
+        (WebKit::NetworkCache::readOrMakeSalt):
+        * NetworkProcess/cache/NetworkCacheData.h:
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+        (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
+        (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
+        (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
+        * NetworkProcess/cache/NetworkCacheStatistics.cpp:
+        (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
+        (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
+        (WebKit::NetworkCache::Statistics::queryWasEverRequested):
+        * NetworkProcess/cache/NetworkCacheStatistics.h:
+        * NetworkProcess/cache/NetworkCacheStorage.cpp:
+        (WebKit::NetworkCache::Storage::storeBodyAsBlob):
+        (WebKit::NetworkCache::Storage::encodeRecord):
+        (WebKit::NetworkCache::Storage::dispatchWriteOperation):
+        * NetworkProcess/cache/NetworkCacheStorage.h:
+        * Platform/IPC/ArgumentCoders.h:
+        (IPC::ArgumentCoder<std::optional<T>>::encode):
+        (IPC::ArgumentCoder<std::optional<T>>::decode):
+        (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
+        (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
+        * Platform/IPC/Connection.h:
+        (IPC::Connection::sendWithReply):
+        * Platform/SharedMemory.h:
+        * Platform/unix/SharedMemoryUnix.cpp:
+        (WebKit::SharedMemory::map):
+        * Scripts/webkit/messages.py:
+        (class_template_headers):
+        * Shared/API/APISecurityOrigin.h:
+        (API::SecurityOrigin::create):
+        * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
+        * Shared/API/c/WKSecurityOriginRef.cpp:
+        (WKSecurityOriginGetPort):
+        * Shared/SessionState.h:
+        * Shared/WebPageCreationParameters.h:
+        * Shared/mac/ObjCObjectGraph.mm:
+        (WebKit::typeFromObject):
+        * Shared/mac/SecItemShim.cpp:
+        (WebKit::sendSecItemRequest):
+        * UIProcess/API/C/WKKeyValueStorageManager.cpp:
+        (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
+        * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
+        (-[WKSecurityOrigin port]):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didCommitLayerTree:]):
+        (-[WKWebView _navigationGestureDidEnd]):
+        * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
+        (WebKit::toWebsiteDataType):
+        * UIProcess/API/efl/EwkView.cpp:
+        (EwkView::setCursor):
+        * UIProcess/API/mac/WKView.mm:
+        (toCoreScrollbarStyle):
+        (toAPIScrollbarStyle):
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
+        (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
+        (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
+        (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
+        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::toPKPaymentSummaryItem):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::webFrameIDForHandle):
+        (WebKit::WebAutomationSession::switchToBrowsingContext):
+        (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
+        (WebKit::WebAutomationSession::resolveChildFrameHandle):
+        (WebKit::WebAutomationSession::resolveParentFrameHandle):
+        (WebKit::WebAutomationSession::computeElementLayout):
+        * UIProcess/Automation/WebAutomationSession.h:
+        * UIProcess/Cocoa/WebViewImpl.h:
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::updateViewExposedRect):
+        (WebKit::WebViewImpl::setOverlayScrollbarStyle):
+        (WebKit::WebViewImpl::overlayScrollbarStyle):
+        * UIProcess/DrawingAreaProxy.cpp:
+        (WebKit::DrawingAreaProxy::setViewExposedRect):
+        * UIProcess/DrawingAreaProxy.h:
+        (WebKit::DrawingAreaProxy::viewExposedRect):
+        * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
+        (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
+        * UIProcess/InspectorServer/WebSocketServerConnection.h:
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
+        (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
+        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
+        * UIProcess/Scrolling/RemoteScrollingTree.cpp:
+        (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
+        * UIProcess/Scrolling/RemoteScrollingTree.h:
+        * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
+        (WebKit::fileCreationTime):
+        (WebKit::fileModificationTime):
+        * UIProcess/Storage/LocalStorageDatabaseTracker.h:
+        * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
+        (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
+        * UIProcess/WebBackForwardList.cpp:
+        (WebKit::WebBackForwardList::backForwardListState):
+        (WebKit::WebBackForwardList::restoreFromState):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didCommitLoadForFrame):
+        (WebKit::WebPageProxy::creationParameters):
+        (WebKit::WebPageProxy::setOverlayScrollbarStyle):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::overlayScrollbarStyle):
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebsiteData/WebsiteDataRecord.h:
+        * UIProcess/efl/WebView.cpp:
+        (WebKit::WebView::transformFromScene):
+        * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
+        * UIProcess/gtk/WebPreferencesGtk.cpp:
+        (WebKit::WebPreferences::platformInitializeStore):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _scrollOffsetForEvent:]):
+        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
+        * UIProcess/mac/LegacySessionStateCoding.cpp:
+        (WebKit::encodeFormDataElement):
+        (WebKit::decodeFormDataElement):
+        (WebKit::decodeV1SessionHistory):
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
+        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+        (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
+        (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
+        (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
+        * WebProcess/ApplePay/WebPaymentCoordinator.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageSetEventThrottlingBehaviorOverride):
+        * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
+        (WebKit::PDFPlugin::convertFromPDFViewToRootView):
+        (WebKit::PDFPlugin::convertFromPDFViewToScreen):
+        (WebKit::PDFPlugin::boundsOnScreen):
+        (WebKit::PDFPlugin::geometryDidChange):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::geometryDidChange):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::performFrameLoadURLRequest):
+        (WebKit::PluginView::evaluate):
+        * WebProcess/Plugins/WebPluginInfoProvider.cpp:
+        (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
+        * WebProcess/Plugins/WebPluginInfoProvider.h:
+        * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
+        (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
+        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
+        (WebKit::toFormData):
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+        * WebProcess/WebPage/DrawingArea.h:
+        * WebProcess/WebPage/DrawingArea.messages.in:
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::certificateInfo):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_userInterfaceLayoutDirection):
+        (WebKit::WebPage::setScrollbarOverlayStyle):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::scrollbarOverlayStyle):
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
+
 2016-11-26  Sam Weinig  <sam@webkit.org>
 
         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
diff --git a/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp b/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp
index 3125888..9bfa4ec 100644
--- a/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp
+++ b/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp
@@ -99,7 +99,7 @@
     ASSERT(m_client);
     if (response.isHttpVersion0_9()) {
         auto url = response.url();
-        Optional<uint16_t> port = url.port();
+        std::optional<uint16_t> port = url.port();
         if (port && !isDefaultPortForProtocol(port.value(), url.protocol())) {
             cancel();
             m_client->didCompleteWithError({ String(), 0, url, "Cancelled load from '" + url.stringCenterEllipsizedToLength() + "' because it is using HTTP/0.9." });
diff --git a/Source/WebKit2/NetworkProcess/NetworkLoad.h b/Source/WebKit2/NetworkProcess/NetworkLoad.h
index 7d14c8c..766bd50 100644
--- a/Source/WebKit2/NetworkProcess/NetworkLoad.h
+++ b/Source/WebKit2/NetworkProcess/NetworkLoad.h
@@ -135,7 +135,7 @@
     const NetworkLoadParameters m_parameters;
 #if USE(NETWORK_SESSION)
     RefPtr<NetworkDataTask> m_task;
-    Optional<WebCore::AuthenticationChallenge> m_challenge;
+    std::optional<WebCore::AuthenticationChallenge> m_challenge;
 #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     ChallengeCompletionHandler m_challengeCompletionHandler;
 #endif
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
index 4f3981b..6b99476 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
@@ -145,7 +145,7 @@
     return false;
 }
 
-static bool responseHasExpired(const WebCore::ResourceResponse& response, std::chrono::system_clock::time_point timestamp, Optional<std::chrono::microseconds> maxStale)
+static bool responseHasExpired(const WebCore::ResourceResponse& response, std::chrono::system_clock::time_point timestamp, std::optional<std::chrono::microseconds> maxStale)
 {
     if (response.cacheControlContainsNoCache())
         return true;
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h b/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h
index 3e9e228..4171ace 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheCoders.h
@@ -80,8 +80,8 @@
     }
 };
 
-template<typename T> struct Coder<Optional<T>> {
-    static void encode(Encoder& encoder, const Optional<T>& optional)
+template<typename T> struct Coder<std::optional<T>> {
+    static void encode(Encoder& encoder, const std::optional<T>& optional)
     {
         if (!optional) {
             encoder << false;
@@ -92,14 +92,14 @@
         encoder << optional.value();
     }
     
-    static bool decode(Decoder& decoder, Optional<T>& optional)
+    static bool decode(Decoder& decoder, std::optional<T>& optional)
     {
         bool isEngaged;
         if (!decoder.decode(isEngaged))
             return false;
         
         if (!isEngaged) {
-            optional = Nullopt;
+            optional = std::nullopt;
             return true;
         }
         
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp
index 313f8da..31ae48f 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp
@@ -137,7 +137,7 @@
     return salt;
 }
 
-Optional<Salt> readOrMakeSalt(const String& path)
+std::optional<Salt> readOrMakeSalt(const String& path)
 {
     auto cpath = WebCore::fileSystemRepresentation(path);
     auto fd = open(cpath.data(), O_RDONLY, 0);
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h b/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h
index 8f54f0e..724608d 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h
@@ -159,7 +159,7 @@
 
 using Salt = std::array<uint8_t, 8>;
 
-Optional<Salt> readOrMakeSalt(const String& path);
+std::optional<Salt> readOrMakeSalt(const String& path);
 SHA1::Digest computeSHA1(const Data&, const Salt&);
 
 }
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp
index f26229d..a4359f3 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp
@@ -133,7 +133,7 @@
 class SpeculativeLoadManager::PreloadedEntry : private ExpiringEntry {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    PreloadedEntry(std::unique_ptr<Entry> entry, Optional<ResourceRequest>&& speculativeValidationRequest, std::function<void()>&& lifetimeReachedHandler)
+    PreloadedEntry(std::unique_ptr<Entry> entry, std::optional<ResourceRequest>&& speculativeValidationRequest, std::function<void()>&& lifetimeReachedHandler)
         : ExpiringEntry(WTFMove(lifetimeReachedHandler))
         , m_entry(WTFMove(entry))
         , m_speculativeValidationRequest(WTFMove(speculativeValidationRequest))
@@ -145,12 +145,12 @@
         return WTFMove(m_entry);
     }
 
-    const Optional<ResourceRequest>& revalidationRequest() const { return m_speculativeValidationRequest; }
+    const std::optional<ResourceRequest>& revalidationRequest() const { return m_speculativeValidationRequest; }
     bool wasRevalidated() const { return !!m_speculativeValidationRequest; }
 
 private:
     std::unique_ptr<Entry> m_entry;
-    Optional<ResourceRequest> m_speculativeValidationRequest;
+    std::optional<ResourceRequest> m_speculativeValidationRequest;
 };
 
 class SpeculativeLoadManager::PendingFrameLoad : public RefCounted<PendingFrameLoad> {
@@ -380,7 +380,7 @@
         pendingFrameLoad->registerSubresourceLoad(request, resourceKey);
 }
 
-void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry, const GlobalFrameID& frameID, Optional<ResourceRequest>&& revalidationRequest)
+void SpeculativeLoadManager::addPreloadedEntry(std::unique_ptr<Entry> entry, const GlobalFrameID& frameID, std::optional<ResourceRequest>&& revalidationRequest)
 {
     ASSERT(entry);
     ASSERT(!entry->needsValidation());
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h b/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h
index 4255236..dd606d5 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h
@@ -57,7 +57,7 @@
 private:
     class PreloadedEntry;
 
-    void addPreloadedEntry(std::unique_ptr<Entry>, const GlobalFrameID&, Optional<WebCore::ResourceRequest>&& revalidationRequest = Nullopt);
+    void addPreloadedEntry(std::unique_ptr<Entry>, const GlobalFrameID&, std::optional<WebCore::ResourceRequest>&& revalidationRequest = std::nullopt);
     void preloadEntry(const Key&, const SubresourceInfo&, const GlobalFrameID&);
     void retrieveEntryFromStorage(const Key&, RetrieveCompletionHandler&&);
     void revalidateEntry(std::unique_ptr<Entry>, const SubresourceInfo&, const GlobalFrameID&);
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp
index e8dc643..10a5203 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp
@@ -216,7 +216,7 @@
     ASSERT(retrieveDecision != RetrieveDecision::Yes);
 
     auto hash = key.hashAsString();
-    queryWasEverRequested(hash, NeedUncachedReason::No, [this, hash, requestURL = request.url(), webPageID, retrieveDecision](bool wasEverRequested, const Optional<StoreDecision>&) {
+    queryWasEverRequested(hash, NeedUncachedReason::No, [this, hash, requestURL = request.url(), webPageID, retrieveDecision](bool wasEverRequested, const std::optional<StoreDecision>&) {
         if (wasEverRequested) {
             String diagnosticKey = retrieveDecisionToDiagnosticKey(retrieveDecision);
             LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously requested but we are not using the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
@@ -256,7 +256,7 @@
 void Statistics::recordRetrievalFailure(uint64_t webPageID, const Key& key, const WebCore::ResourceRequest& request)
 {
     auto hash = key.hashAsString();
-    queryWasEverRequested(hash, NeedUncachedReason::Yes, [this, hash, requestURL = request.url(), webPageID](bool wasPreviouslyRequested, const Optional<StoreDecision>& storeDecision) {
+    queryWasEverRequested(hash, NeedUncachedReason::Yes, [this, hash, requestURL = request.url(), webPageID](bool wasPreviouslyRequested, const std::optional<StoreDecision>& storeDecision) {
         if (wasPreviouslyRequested) {
             String diagnosticKey = storeDecisionToDiagnosticKey(storeDecision.value());
             LOG(NetworkCache, "(NetworkProcess) webPageID %" PRIu64 ": %s was previously request but is not in the cache, reason: %s", webPageID, requestURL.string().ascii().data(), diagnosticKey.utf8().data());
@@ -351,7 +351,7 @@
     // Query pending writes first.
     bool wasAlreadyRequested = m_hashesToAdd.contains(hash);
     if (wasAlreadyRequested && needUncachedReason == NeedUncachedReason::No) {
-        completionHandler(true, Nullopt);
+        completionHandler(true, std::nullopt);
         return;
     }
     if (needUncachedReason == NeedUncachedReason::Yes && m_storeDecisionsToAdd.contains(hash)) {
@@ -365,7 +365,7 @@
     m_activeQueries.add(WTFMove(everRequestedQuery));
     serialBackgroundIOQueue().dispatch([this, wasAlreadyRequested, &query] () mutable {
         WebCore::SQLiteTransactionInProgressAutoCounter transactionCounter;
-        Optional<StoreDecision> storeDecision;
+        std::optional<StoreDecision> storeDecision;
         if (m_database.isOpen()) {
             if (!wasAlreadyRequested) {
                 WebCore::SQLiteStatement statement(m_database, ASCIILiteral("SELECT hash FROM AlreadyRequested WHERE hash=?"));
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h
index cc29fae..b67c260 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h
@@ -66,7 +66,7 @@
     void addStoreDecisionsToDatabase(const HashMap<String, NetworkCache::StoreDecision>&);
     void writeTimerFired();
 
-    typedef std::function<void (bool wasEverRequested, const Optional<StoreDecision>&)> RequestedCompletionHandler;
+    typedef std::function<void (bool wasEverRequested, const std::optional<StoreDecision>&)> RequestedCompletionHandler;
     enum class NeedUncachedReason { No, Yes };
     void queryWasEverRequested(const String&, NeedUncachedReason, RequestedCompletionHandler&&);
     void markAsRequested(const String& hash);
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
index 05a3d1c..b06b1cf 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
@@ -480,7 +480,7 @@
     return Data(encoder.buffer(), encoder.bufferSize());
 }
 
-Optional<BlobStorage::Blob> Storage::storeBodyAsBlob(WriteOperation& writeOperation)
+std::optional<BlobStorage::Blob> Storage::storeBodyAsBlob(WriteOperation& writeOperation)
 {
     auto blobPath = blobPathForKey(writeOperation.record.key);
 
@@ -505,7 +505,7 @@
     return blob;
 }
 
-Data Storage::encodeRecord(const Record& record, Optional<BlobStorage::Blob> blob)
+Data Storage::encodeRecord(const Record& record, std::optional<BlobStorage::Blob> blob)
 {
     ASSERT(!blob || bytesEqual(blob.value().data, record.body));
 
@@ -719,7 +719,7 @@
         ++writeOperation.activeCount;
 
         bool shouldStoreAsBlob = shouldStoreBodyAsBlob(writeOperation.record.body);
-        auto blob = shouldStoreAsBlob ? storeBodyAsBlob(writeOperation) : Nullopt;
+        auto blob = shouldStoreAsBlob ? storeBodyAsBlob(writeOperation) : std::nullopt;
 
         auto recordData = encodeRecord(writeOperation.record, blob);
 
diff --git a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h
index ec2fb14..2e9c251 100644
--- a/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h
+++ b/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h
@@ -124,8 +124,8 @@
     void dispatchPendingWriteOperations();
     void finishWriteOperation(WriteOperation&);
 
-    Optional<BlobStorage::Blob> storeBodyAsBlob(WriteOperation&);
-    Data encodeRecord(const Record&, Optional<BlobStorage::Blob>);
+    std::optional<BlobStorage::Blob> storeBodyAsBlob(WriteOperation&);
+    Data encodeRecord(const Record&, std::optional<BlobStorage::Blob>);
     void readRecord(ReadOperation&, const Data&);
 
     void updateFileModificationTime(const String& path);
diff --git a/Source/WebKit2/Platform/IPC/ArgumentCoders.h b/Source/WebKit2/Platform/IPC/ArgumentCoders.h
index 0568ace..f6d88b7 100644
--- a/Source/WebKit2/Platform/IPC/ArgumentCoders.h
+++ b/Source/WebKit2/Platform/IPC/ArgumentCoders.h
@@ -69,8 +69,8 @@
     }
 };
 
-template<typename T> struct ArgumentCoder<WTF::Optional<T>> {
-    static void encode(Encoder& encoder, const WTF::Optional<T>& optional)
+template<typename T> struct ArgumentCoder<std::optional<T>> {
+    static void encode(Encoder& encoder, const std::optional<T>& optional)
     {
         if (!optional) {
             encoder << false;
@@ -81,14 +81,14 @@
         encoder << optional.value();
     }
 
-    static bool decode(Decoder& decoder, WTF::Optional<T>& optional)
+    static bool decode(Decoder& decoder, std::optional<T>& optional)
     {
         bool isEngaged;
         if (!decoder.decode(isEngaged))
             return false;
 
         if (!isEngaged) {
-            optional = Nullopt;
+            optional = std::nullopt;
             return true;
         }
 
diff --git a/Source/WebKit2/Platform/IPC/Connection.h b/Source/WebKit2/Platform/IPC/Connection.h
index 503cf5f..f012a01 100644
--- a/Source/WebKit2/Platform/IPC/Connection.h
+++ b/Source/WebKit2/Platform/IPC/Connection.h
@@ -165,7 +165,7 @@
     void postConnectionDidCloseOnConnectionWorkQueue();
 
     template<typename T> bool send(T&& message, uint64_t destinationID, OptionSet<SendOption> sendOptions = { });
-    template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler);
+    template<typename T> void sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler);
     template<typename T> bool sendSync(T&& message, typename T::Reply&& reply, uint64_t destinationID, Seconds timeout = Seconds::infinity(), OptionSet<SendSyncOption> sendSyncOptions = { });
     template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, Seconds timeout, OptionSet<WaitForOption> waitForOptions = { });
 
@@ -345,7 +345,7 @@
 }
 
 template<typename T>
-void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (Optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler)
+void Connection::sendWithReply(T&& message, uint64_t destinationID, FunctionDispatcher& replyDispatcher, Function<void (std::optional<typename CodingType<typename T::Reply>::Type>)>&& replyHandler)
 {
     uint64_t requestID = 0;
     std::unique_ptr<Encoder> encoder = createSyncMessageEncoder(T::receiverName(), T::name(), destinationID, requestID);
@@ -361,7 +361,7 @@
             }
         }
 
-        replyHandler(Nullopt);
+        replyHandler(std::nullopt);
     });
 }
 
diff --git a/Source/WebKit2/Platform/SharedMemory.h b/Source/WebKit2/Platform/SharedMemory.h
index 0cc62dd..7df8e2f 100644
--- a/Source/WebKit2/Platform/SharedMemory.h
+++ b/Source/WebKit2/Platform/SharedMemory.h
@@ -113,7 +113,7 @@
     Protection m_protection;
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-    Optional<int> m_fileDescriptor;
+    std::optional<int> m_fileDescriptor;
     bool m_isWrappingMap { false };
 #elif OS(DARWIN)
     mach_port_t m_port;
diff --git a/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp b/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp
index 27b25b7e..9d91179 100644
--- a/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp
+++ b/Source/WebKit2/Platform/unix/SharedMemoryUnix.cpp
@@ -164,7 +164,7 @@
         return nullptr;
 
     RefPtr<SharedMemory> instance = wrapMap(data, handle.m_attachment.size(), -1);
-    instance->m_fileDescriptor = Nullopt;
+    instance->m_fileDescriptor = std::nullopt;
     instance->m_isWrappingMap = false;
     return instance;
 }
diff --git a/Source/WebKit2/Scripts/webkit/messages.py b/Source/WebKit2/Scripts/webkit/messages.py
index 059ec85..af9447b 100644
--- a/Source/WebKit2/Scripts/webkit/messages.py
+++ b/Source/WebKit2/Scripts/webkit/messages.py
@@ -290,7 +290,7 @@
 
     class_template_types = {
         'HashMap': {'headers': ['<wtf/HashMap.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
-        'Optional': {'headers': ['<wtf/Optional.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
+        'std::optional': {'headers': ['<wtf/Optional.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
         'OptionSet': {'headers': ['<wtf/OptionSet.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
         'Vector': {'headers': ['<wtf/Vector.h>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
         'std::pair': {'headers': ['<utility>'], 'argument_coder_headers': ['"ArgumentCoders.h"']},
diff --git a/Source/WebKit2/Shared/API/APISecurityOrigin.h b/Source/WebKit2/Shared/API/APISecurityOrigin.h
index 7bc3c6f..8917c67 100644
--- a/Source/WebKit2/Shared/API/APISecurityOrigin.h
+++ b/Source/WebKit2/Shared/API/APISecurityOrigin.h
@@ -38,7 +38,7 @@
         return create(WebCore::SecurityOrigin::createFromString(string));
     }
 
-    static RefPtr<SecurityOrigin> create(const WTF::String& protocol, const WTF::String& host, Optional<uint16_t> port)
+    static RefPtr<SecurityOrigin> create(const WTF::String& protocol, const WTF::String& host, std::optional<uint16_t> port)
     {
         return create(WebCore::SecurityOrigin::create(protocol, host, port));
     }
diff --git a/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm b/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm
index b0da4b6..2b6a31d 100644
--- a/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm
+++ b/Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.mm
@@ -53,7 +53,7 @@
         CString replySignature;
         Vector<HashSet<Class>> allowedReplyClasses;
     };
-    Optional<ReplyInfo> replyInfo;
+    std::optional<ReplyInfo> replyInfo;
 };
 
 @implementation _WKRemoteObjectInterface {
diff --git a/Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp b/Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp
index 2fde33e..d116074 100644
--- a/Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp
+++ b/Source/WebKit2/Shared/API/c/WKSecurityOriginRef.cpp
@@ -78,7 +78,7 @@
 
 unsigned short WKSecurityOriginGetPort(WKSecurityOriginRef securityOrigin)
 {
-    return toImpl(securityOrigin)->securityOrigin().port().valueOr(0);
+    return toImpl(securityOrigin)->securityOrigin().port().value_or(0);
 }
 
 // For backwards ABI compatibility.
diff --git a/Source/WebKit2/Shared/SessionState.h b/Source/WebKit2/Shared/SessionState.h
index dee768b..0ff7bba 100644
--- a/Source/WebKit2/Shared/SessionState.h
+++ b/Source/WebKit2/Shared/SessionState.h
@@ -66,8 +66,8 @@
         // File.
         String filePath;
         int64_t fileStart;
-        Optional<int64_t> fileLength;
-        Optional<double> expectedFileModificationTime;
+        std::optional<int64_t> fileLength;
+        std::optional<double> expectedFileModificationTime;
 
         // Blob.
         String blobURLString;
@@ -90,7 +90,7 @@
     String target;
 
     Vector<String> documentState;
-    Optional<Vector<uint8_t>> stateObjectData;
+    std::optional<Vector<uint8_t>> stateObjectData;
 
     int64_t documentSequenceNumber;
     int64_t itemSequenceNumber;
@@ -98,7 +98,7 @@
     WebCore::IntPoint scrollPosition;
     float pageScaleFactor;
 
-    Optional<HTTPBody> httpBody;
+    std::optional<HTTPBody> httpBody;
 
     // FIXME: These should not be per frame.
 #if PLATFORM(IOS)
@@ -139,7 +139,7 @@
     static bool decode(IPC::Decoder&, BackForwardListState&);
 
     Vector<BackForwardListItemState> items;
-    Optional<uint32_t> currentIndex;
+    std::optional<uint32_t> currentIndex;
 };
 
 struct SessionState {
diff --git a/Source/WebKit2/Shared/WebPageCreationParameters.h b/Source/WebKit2/Shared/WebPageCreationParameters.h
index 7fa027e..40b4205 100644
--- a/Source/WebKit2/Shared/WebPageCreationParameters.h
+++ b/Source/WebKit2/Shared/WebPageCreationParameters.h
@@ -109,9 +109,9 @@
     
     WebCore::ScrollPinningBehavior scrollPinningBehavior;
 
-    // FIXME: This should be WTF::Optional<WebCore::ScrollbarOverlayStyle>, but we would need to
+    // FIXME: This should be std::optional<WebCore::ScrollbarOverlayStyle>, but we would need to
     // correctly handle enums inside Optionals when encoding and decoding. 
-    WTF::Optional<uint32_t> scrollbarOverlayStyle;
+    std::optional<uint32_t> scrollbarOverlayStyle;
 
     bool backgroundExtendsBeyondPage;
 
diff --git a/Source/WebKit2/Shared/mac/ObjCObjectGraph.mm b/Source/WebKit2/Shared/mac/ObjCObjectGraph.mm
index d7bd327..70dc909 100644
--- a/Source/WebKit2/Shared/mac/ObjCObjectGraph.mm
+++ b/Source/WebKit2/Shared/mac/ObjCObjectGraph.mm
@@ -113,7 +113,7 @@
 #endif
 };
 
-static Optional<ObjCType> typeFromObject(id object)
+static std::optional<ObjCType> typeFromObject(id object)
 {
     ASSERT(object);
 
@@ -137,7 +137,7 @@
         return ObjCType::WKTypeRefWrapper;
 #endif
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 void ObjCObjectGraph::encode(IPC::Encoder& encoder, id object)
diff --git a/Source/WebKit2/Shared/mac/SecItemShim.cpp b/Source/WebKit2/Shared/mac/SecItemShim.cpp
index 43700d1..85433bd 100644
--- a/Source/WebKit2/Shared/mac/SecItemShim.cpp
+++ b/Source/WebKit2/Shared/mac/SecItemShim.cpp
@@ -71,9 +71,9 @@
     return *workQueue;
 }
 
-static Optional<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
+static std::optional<SecItemResponseData> sendSecItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
 {
-    Optional<SecItemResponseData> response;
+    std::optional<SecItemResponseData> response;
 
     auto semaphore = adoptOSObject(dispatch_semaphore_create(0));
 
diff --git a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
index 1eb76d1..b322e43 100644
--- a/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
+++ b/Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
@@ -101,9 +101,9 @@
 
             detailsMap.set(toImpl(WKKeyValueStorageManagerGetOriginKey())->string(), origin);
             if (originDetails.creationTime)
-                detailsMap.set(toImpl(WKKeyValueStorageManagerGetCreationTimeKey())->string(), API::Double::create(originDetails.creationTime.valueOr(0)));
+                detailsMap.set(toImpl(WKKeyValueStorageManagerGetCreationTimeKey())->string(), API::Double::create(originDetails.creationTime.value_or(0)));
             if (originDetails.modificationTime)
-                detailsMap.set(toImpl(WKKeyValueStorageManagerGetModificationTimeKey())->string(), API::Double::create(originDetails.modificationTime.valueOr(0)));
+                detailsMap.set(toImpl(WKKeyValueStorageManagerGetModificationTimeKey())->string(), API::Double::create(originDetails.modificationTime.value_or(0)));
 
             result.uncheckedAppend(API::Dictionary::create(WTFMove(detailsMap)));
         }
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm b/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm
index c5543a2..b7112ce 100644
--- a/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm
+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.mm
@@ -58,7 +58,7 @@
 
 - (NSInteger)port
 {
-    return _securityOrigin->securityOrigin().port().valueOr(0);
+    return _securityOrigin->securityOrigin().port().value_or(0);
 }
 
 #pragma mark WKObject protocol implementation
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
index 994584b..9e90aba 100644
--- a/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
@@ -235,11 +235,11 @@
     uint64_t _firstPaintAfterCommitLoadTransactionID;
     DynamicViewportUpdateMode _dynamicViewportUpdateMode;
     CATransform3D _resizeAnimationTransformAdjustments;
-    Optional<uint64_t> _resizeAnimationTransformTransactionID;
+    std::optional<uint64_t> _resizeAnimationTransformTransactionID;
     RetainPtr<UIView> _resizeAnimationView;
     CGFloat _lastAdjustmentForScroller;
-    Optional<CGRect> _frozenVisibleContentRect;
-    Optional<CGRect> _frozenUnobscuredContentRect;
+    std::optional<CGRect> _frozenVisibleContentRect;
+    std::optional<CGRect> _frozenUnobscuredContentRect;
 
     BOOL _needsToRestoreScrollPosition;
     BOOL _commitDidRestoreScrollPosition;
@@ -1271,7 +1271,7 @@
 
     if (_dynamicViewportUpdateMode != DynamicViewportUpdateMode::NotResizing) {
         if (_resizeAnimationTransformTransactionID && layerTreeTransaction.transactionID() >= _resizeAnimationTransformTransactionID.value()) {
-            _resizeAnimationTransformTransactionID = Nullopt;
+            _resizeAnimationTransformTransactionID = std::nullopt;
             [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments;
             if (_dynamicViewportUpdateMode == DynamicViewportUpdateMode::ResizingWithDocumentHidden) {
                 [_contentView setHidden:NO];
@@ -2301,8 +2301,8 @@
 
 - (void)_navigationGestureDidEnd
 {
-    _frozenVisibleContentRect = Nullopt;
-    _frozenUnobscuredContentRect = Nullopt;
+    _frozenVisibleContentRect = std::nullopt;
+    _frozenUnobscuredContentRect = std::nullopt;
 }
 
 #endif // PLATFORM(IOS)
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h b/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h
index f860f88..fddd6a5 100644
--- a/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h
+++ b/Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h
@@ -40,7 +40,7 @@
     return (WKWebsiteDataRecord *)websiteDataRecord.wrapper();
 }
 
-static inline Optional<WebsiteDataType> toWebsiteDataType(NSString *websiteDataType)
+static inline std::optional<WebsiteDataType> toWebsiteDataType(NSString *websiteDataType)
 {
     if ([websiteDataType isEqualToString:WKWebsiteDataTypeCookies])
         return WebsiteDataType::Cookies;
@@ -71,7 +71,7 @@
     if ([websiteDataType isEqualToString:_WKWebsiteDataTypeResourceLoadStatistics])
         return WebsiteDataType::WebsiteDataTypeResourceLoadStatistics;
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 static inline OptionSet<WebKit::WebsiteDataType> toWebsiteDataTypes(NSSet *websiteDataTypes)
diff --git a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
index caf0d72..d277005 100644
--- a/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/EwkView.cpp
@@ -451,7 +451,7 @@
             return;
 
         
-        Optional<IntPoint> hotSpot = cursorImage->hotSpot();
+        std::optional<IntPoint> hotSpot = cursorImage->hotSpot();
         Ecore_X_Cursor customCursor = createCustomCursor(window, cursorImage, IntSize(cursorImage->size()), hotSpot ? hotSpot.value() : IntPoint());
         if (!customCursor)
             return;
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index a63398a..2fef1b0 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -1329,7 +1329,7 @@
     return _data->_impl->totalHeightOfBanners();
 }
 
-static WTF::Optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle)
+static std::optional<WebCore::ScrollbarOverlayStyle> toCoreScrollbarStyle(_WKOverlayScrollbarStyle scrollbarStyle)
 {
     switch (scrollbarStyle) {
     case _WKOverlayScrollbarStyleDark:
@@ -1343,10 +1343,10 @@
         break;
     }
 
-    return Nullopt;
+    return std::nullopt;
 }
 
-static _WKOverlayScrollbarStyle toAPIScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle)
+static _WKOverlayScrollbarStyle toAPIScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> coreScrollbarStyle)
 {
     if (!coreScrollbarStyle)
         return _WKOverlayScrollbarStyleAutomatic;
diff --git a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
index 4fe945f..92a19f8 100644
--- a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
+++ b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
@@ -150,7 +150,7 @@
     m_merchantValidationState = MerchantValidationState::ValidationComplete;
 }
 
-void WebPaymentCoordinatorProxy::completeShippingMethodSelection(uint32_t opaqueStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::completeShippingMethodSelection(uint32_t opaqueStatus, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     // It's possible that the payment has been canceled already.
     if (m_state == State::Idle)
@@ -168,7 +168,7 @@
     m_state = State::Active;
 }
 
-void WebPaymentCoordinatorProxy::completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     // It's possible that the payment has been canceled already.
     if (m_state == State::Idle)
@@ -186,7 +186,7 @@
     m_state = State::Active;
 }
 
-void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     // It's possible that the payment has been canceled already.
     if (m_state == State::Idle)
diff --git a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
index a1b8ddc..c26f7ce 100644
--- a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
+++ b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h
@@ -80,9 +80,9 @@
     void openPaymentSetup(const String& merchantIdentifier, const String& domainName, uint64_t requestID);
     void showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::PaymentRequest&, bool& result);
     void completeMerchantValidation(const WebCore::PaymentMerchantSession&);
-    void completeShippingMethodSelection(uint32_t opaqueStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
-    void completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
-    void completePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void completeShippingMethodSelection(uint32_t opaqueStatus, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void completeShippingContactSelection(uint32_t opaqueStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void completePaymentMethodSelection(const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
     void completePaymentSession(uint32_t opaqueStatus);
     void abortPaymentSession();
 
@@ -98,9 +98,9 @@
     void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler);
     void platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&, std::function<void (bool)> completionHandler);
     void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&);
-    void platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
-    void platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
-    void platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
+    void platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentRequest::TotalAndLineItems>&);
     void platformCompletePaymentSession(WebCore::PaymentAuthorizationStatus);
 
     WebPageProxy& m_webPageProxy;
diff --git a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
index 85eab4c..8649816 100644
--- a/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
+++ b/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
@@ -32,9 +32,9 @@
 
     ShowPaymentUI(String originatingURLString, Vector<String> linkIconURLStrings, WebCore::PaymentRequest paymentRequest) -> (bool result)
     CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession);
-    CompleteShippingMethodSelection(uint32_t opaqueStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
-    CompleteShippingContactSelection(uint32_t opaqueStatus, Vector<WebCore::PaymentRequest::ShippingMethod> newShippingMethods, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
-    CompletePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+    CompleteShippingMethodSelection(uint32_t opaqueStatus, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+    CompleteShippingContactSelection(uint32_t opaqueStatus, Vector<WebCore::PaymentRequest::ShippingMethod> newShippingMethods, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+    CompletePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
     CompletePaymentSession(uint32_t opaqueStatus)
     AbortPaymentSession()
 }
diff --git a/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm b/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
index 579afaf..e64edc3 100644
--- a/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
+++ b/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
@@ -275,7 +275,7 @@
 
 static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::PaymentRequest::LineItem& lineItem)
 {
-    return [getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount.valueOr(0)).get() type:toPKPaymentSummaryItemType(lineItem.type)];
+    return [getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount.value_or(0)).get() type:toPKPaymentSummaryItemType(lineItem.type)];
 }
 
 static PKMerchantCapability toPKMerchantCapabilities(const WebCore::PaymentRequest::MerchantCapabilities& merchantCapabilities)
@@ -468,7 +468,7 @@
     m_paymentAuthorizationViewControllerDelegate->_sessionBlock = nullptr;
 }
 
-void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     ASSERT(m_paymentAuthorizationViewController);
     ASSERT(m_paymentAuthorizationViewControllerDelegate);
@@ -490,7 +490,7 @@
     m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion = nullptr;
 }
 
-void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     ASSERT(m_paymentAuthorizationViewController);
     ASSERT(m_paymentAuthorizationViewControllerDelegate);
@@ -518,7 +518,7 @@
     m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion = nullptr;
 }
 
-void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
+void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentRequest::TotalAndLineItems>& newTotalAndLineItems)
 {
     ASSERT(m_paymentAuthorizationViewController);
     ASSERT(m_paymentAuthorizationViewControllerDelegate);
diff --git a/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp b/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
index 8232314..648e20e 100644
--- a/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
+++ b/Source/WebKit2/UIProcess/Automation/WebAutomationSession.cpp
@@ -47,7 +47,7 @@
 static const char* const errorNameAndDetailsSeparator = ";";
 
 // Make sure the predefined error name is valid, otherwise use InternalError.
-#define VALIDATED_ERROR_MESSAGE(errorString) Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::ErrorMessage>(errorString).valueOr(Inspector::Protocol::Automation::ErrorMessage::InternalError)
+#define VALIDATED_ERROR_MESSAGE(errorString) Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::ErrorMessage>(errorString).value_or(Inspector::Protocol::Automation::ErrorMessage::InternalError)
 
 // If the error name is incorrect for these macros, it will be a compile-time error.
 #define STRING_FOR_PREDEFINED_ERROR_NAME(errorName) Inspector::Protocol::AutomationHelpers::getEnumConstantValue(Inspector::Protocol::Automation::ErrorMessage::errorName)
@@ -174,14 +174,14 @@
     return handle;
 }
 
-Optional<uint64_t> WebAutomationSession::webFrameIDForHandle(const String& handle)
+std::optional<uint64_t> WebAutomationSession::webFrameIDForHandle(const String& handle)
 {
     if (handle.isEmpty())
         return 0;
 
     auto iter = m_handleWebFrameMap.find(handle);
     if (iter == m_handleWebFrameMap.end())
-        return Nullopt;
+        return std::nullopt;
 
     return iter->value;
 }
@@ -300,7 +300,7 @@
     if (!page)
         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
 
-    Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
     if (!frameID)
         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
 
@@ -484,7 +484,7 @@
     if (!page)
         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
 
-    Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
     if (!frameID)
         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
 
@@ -527,7 +527,7 @@
     if (!page)
         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
 
-    Optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
+    std::optional<uint64_t> frameID = webFrameIDForHandle(optionalFrameHandle ? *optionalFrameHandle : emptyString());
     if (!frameID)
         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
 
@@ -570,7 +570,7 @@
     if (!page)
         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
 
-    Optional<uint64_t> frameID = webFrameIDForHandle(frameHandle);
+    std::optional<uint64_t> frameID = webFrameIDForHandle(frameHandle);
     if (!frameID)
         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
 
@@ -598,7 +598,7 @@
     if (!page)
         FAIL_WITH_PREDEFINED_ERROR(WindowNotFound);
 
-    Optional<uint64_t> frameID = webFrameIDForHandle(frameHandle);
+    std::optional<uint64_t> frameID = webFrameIDForHandle(frameHandle);
     if (!frameID)
         FAIL_WITH_PREDEFINED_ERROR(FrameNotFound);
 
diff --git a/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h b/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
index 6a8d050..6024aa4 100644
--- a/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
+++ b/Source/WebKit2/UIProcess/Automation/WebAutomationSession.h
@@ -134,7 +134,7 @@
     String handleForWebPageProxy(const WebPageProxy&);
     RefPtr<Inspector::Protocol::Automation::BrowsingContext> buildBrowsingContextForPage(WebPageProxy&);
 
-    Optional<uint64_t> webFrameIDForHandle(const String&);
+    std::optional<uint64_t> webFrameIDForHandle(const String&);
     String handleForWebFrameID(uint64_t frameID);
     String handleForWebFrameProxy(const WebFrameProxy&);
 
diff --git a/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h b/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
index f7744cf..b806978 100644
--- a/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
+++ b/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.h
@@ -230,8 +230,8 @@
     NSColor *underlayColor() const;
     NSColor *pageExtendedBackgroundColor() const;
 
-    void setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle);
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const;
+    void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle);
+    std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const;
 
     void beginDeferringViewInWindowChanges();
     // FIXME: Merge these two?
@@ -686,7 +686,7 @@
     String m_promisedFilename;
     String m_promisedURL;
 
-    WTF::Optional<NSInteger> m_spellCheckerDocumentTag;
+    std::optional<NSInteger> m_spellCheckerDocumentTag;
 
     CGFloat m_totalHeightOfBanners { 0 };
 
diff --git a/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm b/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
index 1e0e076..b007e50 100644
--- a/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
+++ b/Source/WebKit2/UIProcess/Cocoa/WebViewImpl.mm
@@ -1635,7 +1635,7 @@
         exposedRect = CGRectUnion(m_contentPreparationRect, exposedRect);
 
     if (auto drawingArea = m_page->drawingArea())
-        drawingArea->setViewExposedRect(m_clipsToVisibleRect ? Optional<WebCore::FloatRect>(exposedRect) : Nullopt);
+        drawingArea->setViewExposedRect(m_clipsToVisibleRect ? std::optional<WebCore::FloatRect>(exposedRect) : std::nullopt);
 }
 
 void WebViewImpl::setClipsToVisibleRect(bool clipsToVisibleRect)
@@ -2084,12 +2084,12 @@
     return WebCore::nsColor(color);
 }
 
-void WebViewImpl::setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle)
+void WebViewImpl::setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle)
 {
     m_page->setOverlayScrollbarStyle(scrollbarStyle);
 }
 
-WTF::Optional<WebCore::ScrollbarOverlayStyle> WebViewImpl::overlayScrollbarStyle() const
+std::optional<WebCore::ScrollbarOverlayStyle> WebViewImpl::overlayScrollbarStyle() const
 {
     return m_page->overlayScrollbarStyle();
 }
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
index 69e8c5b..b45f227 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp
@@ -75,7 +75,7 @@
 #endif
 
 #if PLATFORM(MAC)
-void DrawingAreaProxy::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+void DrawingAreaProxy::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
 {
     if (!m_webPageProxy.isValid())
         return;
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxy.h b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
index d699f63..a5d4eb2 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxy.h
@@ -82,8 +82,8 @@
     virtual void commitTransientZoom(double, WebCore::FloatPoint) { }
 
 #if PLATFORM(MAC)
-    virtual void setViewExposedRect(Optional<WebCore::FloatRect>);
-    Optional<WebCore::FloatRect> viewExposedRect() const { return m_viewExposedRect; }
+    virtual void setViewExposedRect(std::optional<WebCore::FloatRect>);
+    std::optional<WebCore::FloatRect> viewExposedRect() const { return m_viewExposedRect; }
     void viewExposedRectChangedTimerFired();
 #endif
 
@@ -136,8 +136,8 @@
 
 #if PLATFORM(MAC)
     RunLoop::Timer<DrawingAreaProxy> m_viewExposedRectChangedTimer;
-    Optional<WebCore::FloatRect> m_viewExposedRect;
-    Optional<WebCore::FloatRect> m_lastSentViewExposedRect;
+    std::optional<WebCore::FloatRect> m_viewExposedRect;
+    std::optional<WebCore::FloatRect> m_lastSentViewExposedRect;
 #endif // PLATFORM(MAC)
 #endif
 };
diff --git a/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.cpp b/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.cpp
index e8acd97..7af8542 100644
--- a/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.cpp
+++ b/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.cpp
@@ -133,7 +133,7 @@
     m_server->didCloseWebSocketServerConnection(this);
 }
 
-void WebSocketServerConnection::didReceiveSocketStreamData(SocketStreamHandle&, const char* data, Optional<size_t> length)
+void WebSocketServerConnection::didReceiveSocketStreamData(SocketStreamHandle&, const char* data, std::optional<size_t> length)
 {
     // Each didReceiveData call adds more data to our buffer.
     // We clear the buffer when we have handled data from it.
diff --git a/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h b/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h
index a2d4119..1ead501 100644
--- a/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h
+++ b/Source/WebKit2/UIProcess/InspectorServer/WebSocketServerConnection.h
@@ -69,7 +69,7 @@
     // SocketStreamHandleClient implementation.
     void didOpenSocketStream(WebCore::SocketStreamHandle&) final { }
     void didCloseSocketStream(WebCore::SocketStreamHandle&) final;
-    void didReceiveSocketStreamData(WebCore::SocketStreamHandle&, const char* data, Optional<size_t> length) final;
+    void didReceiveSocketStreamData(WebCore::SocketStreamHandle&, const char* data, std::optional<size_t> length) final;
     void didUpdateBufferedAmount(WebCore::SocketStreamHandle&, size_t bufferedAmount) final;
     void didFailSocketStream(WebCore::SocketStreamHandle&, const WebCore::SocketStreamError&) final { }
 
diff --git a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
index 356c78a..383df58 100644
--- a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
+++ b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
@@ -163,7 +163,7 @@
 }
 
 // This comes from the scrolling tree.
-void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll(ScrollingNodeID scrolledNodeID, const FloatPoint& newScrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     // Scroll updates for the main frame are sent via WebPageProxy::updateVisibleContentRects()
     // so don't send them here.
diff --git a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
index 9bfb439..e87bb2c 100644
--- a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
+++ b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
@@ -55,7 +55,7 @@
     bool visualViewportEnabled() const { return m_scrollingTree && m_scrollingTree->visualViewportEnabled(); }
 
     // Inform the web process that the scroll position changed (called from the scrolling tree)
-    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction);
+    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition, const std::optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction);
     void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll);
 
     WebCore::TrackingType eventTrackingTypeForPoint(const AtomicString& eventName, WebCore::IntPoint) const;
diff --git a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
index 9e48ec6..e11552910 100644
--- a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
+++ b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.cpp
@@ -100,7 +100,7 @@
 
 #endif
 
-void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const Optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
+void RemoteScrollingTree::scrollingTreeNodeDidScroll(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, const std::optional<FloatPoint>& layoutViewportOrigin, ScrollingLayerPositionAction scrollingLayerPositionAction)
 {
     m_scrollingCoordinatorProxy.scrollingTreeNodeDidScroll(nodeID, scrollPosition, layoutViewportOrigin, scrollingLayerPositionAction);
 }
diff --git a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
index 6c0c258..d65b2f5 100644
--- a/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
+++ b/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingTree.h
@@ -46,7 +46,7 @@
 
     const RemoteScrollingCoordinatorProxy& scrollingCoordinatorProxy() const { return m_scrollingCoordinatorProxy; }
 
-    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, const Optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override;
+    void scrollingTreeNodeDidScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, const std::optional<WebCore::FloatPoint>& layoutViewportOrigin, WebCore::ScrollingLayerPositionAction = WebCore::ScrollingLayerPositionAction::Sync) override;
     void scrollingTreeNodeRequestsScroll(WebCore::ScrollingNodeID, const WebCore::FloatPoint& scrollPosition, bool representsProgrammaticScroll) override;
 
     void currentSnapPointIndicesDidChange(WebCore::ScrollingNodeID, unsigned horizontal, unsigned vertical) override;
diff --git a/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp b/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp
index 9989710..b4f44f0 100644
--- a/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp
+++ b/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.cpp
@@ -125,17 +125,17 @@
     deleteEmptyDirectory(m_localStorageDirectory);
 }
 
-static Optional<time_t> fileCreationTime(const String& filePath)
+static std::optional<time_t> fileCreationTime(const String& filePath)
 {
     time_t time;
-    return getFileCreationTime(filePath, time) ? time : Optional<time_t>(Nullopt);
+    return getFileCreationTime(filePath, time) ? time : std::optional<time_t>(std::nullopt);
 }
 
-static Optional<time_t> fileModificationTime(const String& filePath)
+static std::optional<time_t> fileModificationTime(const String& filePath)
 {
     time_t time;
     if (!getFileModificationTime(filePath, time))
-        return Nullopt;
+        return std::nullopt;
 
     return time;
 }
diff --git a/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h b/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h
index da54193..bb7fb48 100644
--- a/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h
+++ b/Source/WebKit2/UIProcess/Storage/LocalStorageDatabaseTracker.h
@@ -61,8 +61,8 @@
 
     struct OriginDetails {
         String originIdentifier;
-        Optional<time_t> creationTime;
-        Optional<time_t> modificationTime;
+        std::optional<time_t> creationTime;
+        std::optional<time_t> modificationTime;
     };
     Vector<OriginDetails> originDetails();
 
diff --git a/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp b/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
index 5580b2c..0f81e0b 100644
--- a/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
+++ b/Source/WebKit2/UIProcess/UserMediaPermissionRequestManagerProxy.cpp
@@ -213,8 +213,8 @@
     auto request = UserMediaPermissionCheckProxy::create(*this, userMediaID);
     m_pendingDeviceRequests.add(userMediaID, request.ptr());
 
-    auto userMediaOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(userMediaDocumentOriginIdentifier).valueOr(SecurityOriginData()).securityOrigin());
-    auto topLevelOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(topLevelDocumentOriginIdentifier).valueOr(SecurityOriginData()).securityOrigin());
+    auto userMediaOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(userMediaDocumentOriginIdentifier).value_or(SecurityOriginData()).securityOrigin());
+    auto topLevelOrigin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(topLevelDocumentOriginIdentifier).value_or(SecurityOriginData()).securityOrigin());
 
     if (!m_page.uiClient().checkUserMediaPermissionForOrigin(m_page, *m_page.process().webFrame(frameID), *userMediaOrigin.get(), *topLevelOrigin.get(), request.get())) {
         m_pendingDeviceRequests.take(userMediaID);
diff --git a/Source/WebKit2/UIProcess/WebBackForwardList.cpp b/Source/WebKit2/UIProcess/WebBackForwardList.cpp
index f2a2898..368d92a 100644
--- a/Source/WebKit2/UIProcess/WebBackForwardList.cpp
+++ b/Source/WebKit2/UIProcess/WebBackForwardList.cpp
@@ -415,7 +415,7 @@
     }
 
     if (backForwardListState.items.isEmpty())
-        backForwardListState.currentIndex = Nullopt;
+        backForwardListState.currentIndex = std::nullopt;
     else if (backForwardListState.items.size() <= backForwardListState.currentIndex.value())
         backForwardListState.currentIndex = backForwardListState.items.size() - 1;
 
@@ -432,7 +432,7 @@
         items.uncheckedAppend(WebBackForwardListItem::create(WTFMove(backForwardListItemState), m_page->pageID()));
     }
     m_hasCurrentIndex = !!backForwardListState.currentIndex;
-    m_currentIndex = backForwardListState.currentIndex.valueOr(0);
+    m_currentIndex = backForwardListState.currentIndex.value_or(0);
     m_entries = WTFMove(items);
 }
 
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 5adda01..67759db 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -3295,7 +3295,7 @@
     }
 }
 
-void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, Optional<HasInsecureContent> hasInsecureContent, const UserData& userData)
+void WebPageProxy::didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t opaqueFrameLoadType, const WebCore::CertificateInfo& certificateInfo, bool containsPluginDocument, std::optional<HasInsecureContent> hasInsecureContent, const UserData& userData)
 {
     PageClientProtector protector(m_pageClient);
 
@@ -5552,7 +5552,7 @@
     if (m_scrollbarOverlayStyle)
         parameters.scrollbarOverlayStyle = m_scrollbarOverlayStyle.value();
     else
-        parameters.scrollbarOverlayStyle = Nullopt;
+        parameters.scrollbarOverlayStyle = std::nullopt;
     parameters.backgroundExtendsBeyondPage = m_backgroundExtendsBeyondPage;
     parameters.layerHostingMode = m_layerHostingMode;
     parameters.controlledByAutomation = m_controlledByAutomation;
@@ -6180,7 +6180,7 @@
         m_process->send(Messages::WebPage::SetScrollPinningBehavior(pinning), m_pageID);
 }
 
-void WebPageProxy::setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle)
+void WebPageProxy::setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle> scrollbarStyle)
 {
     if (!m_scrollbarOverlayStyle && !scrollbarStyle)
         return;
@@ -6190,7 +6190,7 @@
 
     m_scrollbarOverlayStyle = scrollbarStyle;
 
-    WTF::Optional<uint32_t> scrollbarStyleForMessage;
+    std::optional<uint32_t> scrollbarStyleForMessage;
     if (scrollbarStyle)
         scrollbarStyleForMessage = static_cast<ScrollbarOverlayStyle>(scrollbarStyle.value());
 
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index 1ec8df1..20fa1bf 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -1018,8 +1018,8 @@
     void setScrollPinningBehavior(WebCore::ScrollPinningBehavior);
     WebCore::ScrollPinningBehavior scrollPinningBehavior() const { return m_scrollPinningBehavior; }
 
-    void setOverlayScrollbarStyle(WTF::Optional<WebCore::ScrollbarOverlayStyle>);
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
+    void setOverlayScrollbarStyle(std::optional<WebCore::ScrollbarOverlayStyle>);
+    std::optional<WebCore::ScrollbarOverlayStyle> overlayScrollbarStyle() const { return m_scrollbarOverlayStyle; }
 
     bool shouldRecordNavigationSnapshots() const { return m_shouldRecordNavigationSnapshots; }
     void setShouldRecordNavigationSnapshots(bool shouldRecordSnapshots) { m_shouldRecordNavigationSnapshots = shouldRecordSnapshots; }
@@ -1217,7 +1217,7 @@
     void didReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, const String&, const UserData&);
     void didChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, const String& url);
     void didFailProvisionalLoadForFrame(uint64_t frameID, const WebCore::SecurityOriginData& frameSecurityOrigin, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, const UserData&);
-    void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
+    void didCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, uint32_t frameLoadType, const WebCore::CertificateInfo&, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, const UserData&);
     void didFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, const UserData&);
     void didFailLoadForFrame(uint64_t frameID, uint64_t navigationID, const WebCore::ResourceError&, const UserData&);
@@ -1915,7 +1915,7 @@
     HiddenPageThrottlingAutoIncreasesCounter::Token m_hiddenPageDOMTimerThrottlingAutoIncreasesCount;
         
     WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
+    std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
 
     uint64_t m_navigationID;
 
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.messages.in b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
index 9023d57..3617bbf 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebPageProxy.messages.in
@@ -131,7 +131,7 @@
     DidReceiveServerRedirectForProvisionalLoadForFrame(uint64_t frameID, uint64_t navigationID, String url, WebKit::UserData userData)
     DidChangeProvisionalURLForFrame(uint64_t frameID, uint64_t navigationID, String url)
     DidFailProvisionalLoadForFrame(uint64_t frameID, struct WebCore::SecurityOriginData frameSecurityOrigin, uint64_t navigationID, String provisionalURL, WebCore::ResourceError error, WebKit::UserData userData)
-    DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, Optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData)
+    DidCommitLoadForFrame(uint64_t frameID, uint64_t navigationID, String mimeType, bool hasCustomContentProvider, uint32_t loadType, WebCore::CertificateInfo certificateInfo, bool containsPluginDocument, std::optional<WebCore::HasInsecureContent> forcedHasInsecureContent, WebKit::UserData userData)
     DidFailLoadForFrame(uint64_t frameID, uint64_t navigationID, WebCore::ResourceError error, WebKit::UserData userData)
     DidFinishDocumentLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData)
     DidFinishLoadForFrame(uint64_t frameID, uint64_t navigationID, WebKit::UserData userData)
diff --git a/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.h b/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.h
index bc3f985..137fc1c 100644
--- a/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.h
+++ b/Source/WebKit2/UIProcess/WebsiteData/WebsiteDataRecord.h
@@ -61,7 +61,7 @@
         uint64_t totalSize;
         HashMap<unsigned, uint64_t> typeSizes;
     };
-    Optional<Size> size;
+    std::optional<Size> size;
 
     HashSet<WebCore::SecurityOriginData> origins;
     HashSet<String> cookieHostNames;
diff --git a/Source/WebKit2/UIProcess/efl/WebView.cpp b/Source/WebKit2/UIProcess/efl/WebView.cpp
index 503ca60..ecde34b 100644
--- a/Source/WebKit2/UIProcess/efl/WebView.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebView.cpp
@@ -348,7 +348,7 @@
 
 AffineTransform WebView::transformFromScene() const
 {
-    return transformToScene().inverse().valueOr(AffineTransform());
+    return transformToScene().inverse().value_or(AffineTransform());
 }
 
 AffineTransform WebView::transformToScene() const
diff --git a/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp b/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
index 149de2a..76a3891 100644
--- a/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
+++ b/Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp
@@ -46,7 +46,7 @@
 
 namespace WebKit {
 
-static Optional<int> s_damageEventBase;
+static std::optional<int> s_damageEventBase;
 
 class XDamageNotifier {
     WTF_MAKE_NONCOPYABLE(XDamageNotifier);
diff --git a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
index 3f0585d..cb49bd6 100644
--- a/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
+++ b/Source/WebKit2/UIProcess/gtk/WebPreferencesGtk.cpp
@@ -59,7 +59,7 @@
 #if USE(REDIRECTED_XCOMPOSITE_WINDOW)
     if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11) {
         auto& display = downcast<PlatformDisplayX11>(PlatformDisplay::sharedDisplay());
-        Optional<int> damageBase;
+        std::optional<int> damageBase;
         if (!display.supportsXComposite() || !display.supportsXDamage(damageBase))
             setAcceleratedCompositingEnabled(false);
     }
diff --git a/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
index 20d904a..f2da8e1 100644
--- a/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
+++ b/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
@@ -3188,16 +3188,16 @@
     _uiEventBeingResent = nil;
 }
 
-- (Optional<FloatPoint>)_scrollOffsetForEvent:(WebIOSEvent *)event
+- (std::optional<FloatPoint>)_scrollOffsetForEvent:(WebIOSEvent *)event
 {
     static const unsigned kWebSpaceKey = 0x20;
 
     if (_page->editorState().isContentEditable)
-        return Nullopt;
+        return std::nullopt;
 
     NSString *charactersIgnoringModifiers = event.charactersIgnoringModifiers;
     if (!charactersIgnoringModifiers.length)
-        return Nullopt;
+        return std::nullopt;
 
     enum ScrollingIncrement { Document, Page, Line };
     enum ScrollingDirection { Up, Down, Left, Right };
@@ -3249,7 +3249,7 @@
     if ([charactersIgnoringModifiers characterAtIndex:0] == kWebSpaceKey)
         return computeOffset(Page, (event.modifierFlags & WebEventFlagMaskShift) ? Up : Down);
 
-    return Nullopt;
+    return std::nullopt;
 }
 
 - (BOOL)_interpretKeyEvent:(WebIOSEvent *)event isCharEvent:(BOOL)isCharEvent
@@ -3266,7 +3266,7 @@
     if (!contentEditable && event.isTabKey)
         return NO;
 
-    if (Optional<FloatPoint> scrollOffset = [self _scrollOffsetForEvent:event]) {
+    if (std::optional<FloatPoint> scrollOffset = [self _scrollOffsetForEvent:event]) {
         [_webView _scrollByContentOffset:*scrollOffset];
         return YES;
     }
diff --git a/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp b/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp
index 016c6b9..17f66b7 100644
--- a/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp
+++ b/Source/WebKit2/UIProcess/mac/LegacySessionStateCoding.cpp
@@ -282,8 +282,8 @@
         encoder << false;
 
         encoder << element.fileStart;
-        encoder << element.fileLength.valueOr(-1);
-        encoder << element.expectedFileModificationTime.valueOr(std::numeric_limits<double>::quiet_NaN());
+        encoder << element.fileLength.value_or(-1);
+        encoder << element.expectedFileModificationTime.value_or(std::numeric_limits<double>::quiet_NaN());
         break;
 
     case HTTPBody::Element::Type::Blob:
@@ -704,13 +704,13 @@
 #endif
 
     template<typename T>
-    auto operator>>(Optional<T>& value) -> typename std::enable_if<std::is_enum<T>::value, HistoryEntryDataDecoder&>::type
+    auto operator>>(std::optional<T>& value) -> typename std::enable_if<std::is_enum<T>::value, HistoryEntryDataDecoder&>::type
     {
         uint32_t underlyingEnumValue;
         *this >> underlyingEnumValue;
 
         if (!isValid() || !isValidEnum(static_cast<T>(underlyingEnumValue)))
-            value = Nullopt;
+            value = std::nullopt;
         else
             value = static_cast<T>(underlyingEnumValue);
 
@@ -790,7 +790,7 @@
 
 static void decodeFormDataElement(HistoryEntryDataDecoder& decoder, HTTPBody::Element& formDataElement)
 {
-    Optional<FormDataElementType> elementType;
+    std::optional<FormDataElementType> elementType;
     decoder >> elementType;
     if (!elementType)
         return;
@@ -1068,7 +1068,7 @@
     auto currentIndexNumber = dynamic_cf_cast<CFNumberRef>(CFDictionaryGetValue(sessionHistoryDictionary, sessionHistoryCurrentIndexKey));
     if (!currentIndexNumber) {
         // No current index means the dictionary represents an empty session.
-        backForwardListState.currentIndex = Nullopt;
+        backForwardListState.currentIndex = std::nullopt;
         backForwardListState.items = { };
         return true;
     }
diff --git a/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h b/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
index d71e10c..3e5e9bf 100644
--- a/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
+++ b/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h
@@ -64,7 +64,7 @@
     void dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)>) override;
 
 #if PLATFORM(MAC)
-    void setViewExposedRect(Optional<WebCore::FloatRect>) override;
+    void setViewExposedRect(std::optional<WebCore::FloatRect>) override;
 #endif
 
     float indicatorScale(WebCore::IntSize contentsSize) const;
diff --git a/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm b/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
index ef5c338..34930dd 100644
--- a/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
+++ b/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm
@@ -257,7 +257,7 @@
 static const float indicatorInset = 10;
 
 #if PLATFORM(MAC)
-void RemoteLayerTreeDrawingAreaProxy::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+void RemoteLayerTreeDrawingAreaProxy::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
 {
     DrawingAreaProxy::setViewExposedRect(viewExposedRect);
     updateDebugIndicatorPosition();
diff --git a/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp b/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
index 1ff59be..0ddf63f 100644
--- a/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
+++ b/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp
@@ -117,17 +117,17 @@
     m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession));
 }
 
-void WebPaymentCoordinator::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void WebPaymentCoordinator::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(static_cast<uint32_t>(status), newTotalAndItems));
 }
 
-void WebPaymentCoordinator::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void WebPaymentCoordinator::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector<WebCore::PaymentRequest::ShippingMethod>& newShippingMethods, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(static_cast<uint32_t>(status), newShippingMethods, newTotalAndItems));
 }
 
-void WebPaymentCoordinator::completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
+void WebPaymentCoordinator::completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems)
 {
     m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(newTotalAndItems));
 }
diff --git a/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h b/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h
index 36b2aa4..239ce77 100644
--- a/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h
+++ b/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h
@@ -59,9 +59,9 @@
     void openPaymentSetup(const String& merchantIdentifier, const String& domainName, std::function<void (bool)> completionHandler) override;
     bool showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::PaymentRequest&) override;
     void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override;
-    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
-    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, Optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
-    void completePaymentMethodSelection(Optional<WebCore::PaymentRequest::TotalAndLineItems>) override;
+    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector<WebCore::PaymentRequest::ShippingMethod>&, std::optional<WebCore::PaymentRequest::TotalAndLineItems> newTotalAndItems) override;
+    void completePaymentMethodSelection(std::optional<WebCore::PaymentRequest::TotalAndLineItems>) override;
     void completePaymentSession(WebCore::PaymentAuthorizationStatus) override;
     void abortPaymentSession() override;
 
diff --git a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index d32dad6..828018a 100644
--- a/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -694,7 +694,7 @@
 
 void WKBundlePageSetEventThrottlingBehaviorOverride(WKBundlePageRef page, EventThrottlingBehavior* behavior)
 {
-    Optional<WebCore::EventThrottlingBehavior> behaviorValue;
+    std::optional<WebCore::EventThrottlingBehavior> behaviorValue;
     if (behavior) {
         switch (*behavior) {
         case EventThrottlingBehaviorResponsive:
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm b/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
index 0639def..bae96b6 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm
@@ -1196,7 +1196,7 @@
 IntPoint PDFPlugin::convertFromPDFViewToRootView(const IntPoint& point) const
 {
     IntPoint pointInPluginCoordinates(point.x(), size().height() - point.y());
-    return m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapPoint(pointInPluginCoordinates);
+    return m_rootViewToPluginTransform.inverse().value_or(AffineTransform()).mapPoint(pointInPluginCoordinates);
 }
 
 FloatRect PDFPlugin::convertFromPDFViewToScreen(const FloatRect& rect) const
@@ -1207,7 +1207,7 @@
         return FloatRect();
 
     FloatPoint originInPluginCoordinates(rect.x(), size().height() - rect.y() - rect.height());
-    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapRect(FloatRect(originInPluginCoordinates, rect.size()));
+    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().value_or(AffineTransform()).mapRect(FloatRect(originInPluginCoordinates, rect.size()));
 
     return frameView->contentsToScreen(enclosingIntRect(rectInRootViewCoordinates));
 }
@@ -1220,7 +1220,7 @@
         return IntRect();
 
     FloatRect bounds = FloatRect(FloatPoint(), size());
-    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapRect(bounds);
+    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().value_or(AffineTransform()).mapRect(bounds);
     return frameView->contentsToScreen(enclosingIntRect(rectInRootViewCoordinates));
 }
 
@@ -1230,7 +1230,7 @@
         return;
 
     m_size = pluginSize;
-    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().valueOr(AffineTransform());
+    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().value_or(AffineTransform());
     [m_pdfLayerController setFrameSize:pluginSize];
 
     [CATransaction begin];
diff --git a/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
index 4a72ab7..7816dac 100644
--- a/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
+++ b/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
@@ -932,7 +932,7 @@
 void PDFPlugin::geometryDidChange(const IntSize& pluginSize, const IntRect&, const AffineTransform& pluginToRootViewTransform)
 {
     m_pluginToRootViewTransform = pluginToRootViewTransform;
-    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().valueOr(AffineTransform());
+    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().value_or(AffineTransform());
     m_size = pluginSize;
 
     FrameView* frameView = webFrame()->coreFrame()->view();
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
index a0d8ab8..ac1daab 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -1205,7 +1205,7 @@
         return;
     }
 
-    UserGestureIndicator gestureIndicator(request->allowPopups() ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(request->allowPopups() ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
 
     // First, try to find a target frame.
     Frame* targetFrame = frame->loader().findFrameForNavigation(request->target());
@@ -1500,7 +1500,7 @@
     // protect the plug-in view from destruction.
     NPRuntimeObjectMap::PluginProtector pluginProtector(&m_npRuntimeObjectMap);
 
-    UserGestureIndicator gestureIndicator(allowPopups ? Optional<ProcessingUserGestureState>(ProcessingUserGesture) : Nullopt);
+    UserGestureIndicator gestureIndicator(allowPopups ? std::optional<ProcessingUserGestureState>(ProcessingUserGesture) : std::nullopt);
     return m_npRuntimeObjectMap.evaluate(npObject, scriptString, result);
 }
 
diff --git a/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp b/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp
index c99326d..9fdb865 100644
--- a/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.cpp
@@ -164,7 +164,7 @@
 #endif
 
 #if PLATFORM(MAC)
-Optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoadClientPolicyForHost(const String& host, const WebCore::PluginInfo& info) const
+std::optional<WebCore::PluginLoadClientPolicy> WebPluginInfoProvider::pluginLoadClientPolicyForHost(const String& host, const WebCore::PluginInfo& info) const
 {
     String hostToLookUp = host;
     String identifier = info.bundleIdentifier;
@@ -181,7 +181,7 @@
         }
     }
     if (policiesByIdentifierIterator == m_hostsToPluginIdentifierData.end())
-        return Nullopt;
+        return std::nullopt;
 
     auto& policiesByIdentifier = policiesByIdentifierIterator->value;
 
@@ -195,7 +195,7 @@
     }
 
     if (identifierPolicyIterator == policiesByIdentifier.end())
-        return Nullopt;
+        return std::nullopt;
 
     auto& versionsToPolicies = identifierPolicyIterator->value;
 
@@ -209,7 +209,7 @@
     }
 
     if (policyIterator == versionsToPolicies.end())
-        return Nullopt;
+        return std::nullopt;
 
     return policyIterator->value;
 }
diff --git a/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h b/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h
index 7a732ef..f76d3f5 100644
--- a/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h
+++ b/Source/WebKit2/WebProcess/Plugins/WebPluginInfoProvider.h
@@ -54,7 +54,7 @@
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 #if PLATFORM(MAC)
-    Optional<WebCore::PluginLoadClientPolicy> pluginLoadClientPolicyForHost(const String&, const WebCore::PluginInfo&) const;
+    std::optional<WebCore::PluginLoadClientPolicy> pluginLoadClientPolicyForHost(const String&, const WebCore::PluginInfo&) const;
     String longestMatchedWildcardHostForHost(const String& host) const;
     bool replaceHostWithMatchedWildcardHost(String& host, const String& identifier) const;
 
diff --git a/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm b/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
index c6cc6ab..8864152 100644
--- a/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
+++ b/Source/WebKit2/WebProcess/Scrolling/RemoteScrollingCoordinator.mm
@@ -97,7 +97,7 @@
 // Notification from the UI process that we scrolled.
 void RemoteScrollingCoordinator::scrollPositionChangedForNode(ScrollingNodeID nodeID, const FloatPoint& scrollPosition, bool syncLayerPosition)
 {
-    scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, Nullopt, false /* FIXME */, syncLayerPosition ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
+    scheduleUpdateScrollPositionAfterAsyncScroll(nodeID, scrollPosition, std::nullopt, false /* FIXME */, syncLayerPosition ? ScrollingLayerPositionAction::Sync : ScrollingLayerPositionAction::Set);
 }
 
 void RemoteScrollingCoordinator::currentSnapPointIndicesChangedForNode(ScrollingNodeID nodeID, unsigned horizontal, unsigned vertical)
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp
index 1ca7f44..28f757f 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/SessionStateConversion.cpp
@@ -132,7 +132,7 @@
             break;
 
         case HTTPBody::Element::Type::File:
-            formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.valueOr(BlobDataItem::toEndOfFile), element.expectedFileModificationTime.valueOr(invalidFileTime()));
+            formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.value_or(BlobDataItem::toEndOfFile), element.expectedFileModificationTime.value_or(invalidFileTime()));
             break;
 
         case HTTPBody::Element::Type::Blob:
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 81d5619..7f0e75d 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -970,7 +970,7 @@
     m_page->send(Messages::WebPageProxy::RecommendedScrollbarStyleDidChange(static_cast<int32_t>(newStyle)));
 }
 
-WTF::Optional<ScrollbarOverlayStyle> WebChromeClient::preferredScrollbarOverlayStyle()
+std::optional<ScrollbarOverlayStyle> WebChromeClient::preferredScrollbarOverlayStyle()
 {
     return m_page->scrollbarOverlayStyle(); 
 }
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index 6a7ecc4..05e4b35 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -280,7 +280,7 @@
     void notifyScrollerThumbIsVisibleInRect(const WebCore::IntRect&) override;
     void recommendedScrollbarStyleDidChange(WebCore::ScrollbarStyle newStyle) override;
 
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() override;
+    std::optional<WebCore::ScrollbarOverlayStyle> preferredScrollbarOverlayStyle() override;
 
     WebCore::Color underlayColor() const override;
 
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 1c88153..edefdb8 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -439,7 +439,7 @@
     webPage->send(Messages::WebPageProxy::DidReceiveTitleForFrame(m_frame->frameID(), title.string(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
 }
 
-void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> hasInsecureContent)
+void WebFrameLoaderClient::dispatchDidCommitLoad(std::optional<HasInsecureContent> hasInsecureContent)
 {
     WebPage* webPage = m_frame->page();
     if (!webPage)
@@ -454,7 +454,7 @@
     webPage->sandboxExtensionTracker().didCommitProvisionalLoad(m_frame);
 
     // Notify the UIProcess.
-    webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), documentLoader.response().certificateInfo().valueOrCompute([] { return CertificateInfo(); }), m_frame->coreFrame()->document()->isPluginDocument(), hasInsecureContent, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
+    webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), valueOrCompute(documentLoader.response().certificateInfo(), [] { return CertificateInfo(); }), m_frame->coreFrame()->document()->isPluginDocument(), hasInsecureContent, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
     webPage->didCommitLoad(m_frame);
 }
 
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
index f2bbbaf..db2f949 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
@@ -98,7 +98,7 @@
     void dispatchDidReceiveIcon() override;
     void dispatchDidStartProvisionalLoad() override;
     void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override;
-    void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>) override;
+    void dispatchDidCommitLoad(std::optional<WebCore::HasInsecureContent>) override;
     void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&) override;
     void dispatchDidFailLoad(const WebCore::ResourceError&) override;
     void dispatchDidFinishDocumentLoad() override;
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
index 783adec..8e4d09c 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.h
@@ -88,8 +88,8 @@
     virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) { }
 
 #if PLATFORM(COCOA)
-    virtual void setViewExposedRect(Optional<WebCore::FloatRect>) = 0;
-    virtual Optional<WebCore::FloatRect> viewExposedRect() const = 0;
+    virtual void setViewExposedRect(std::optional<WebCore::FloatRect>) = 0;
+    virtual std::optional<WebCore::FloatRect> viewExposedRect() const = 0;
 
     virtual void acceleratedAnimationDidStart(uint64_t /*layerID*/, const String& /*key*/, double /*startTime*/) { }
     virtual void acceleratedAnimationDidEnd(uint64_t /*layerID*/, const String& /*key*/) { }
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in b/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
index 84832b3..b076f34 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
@@ -29,7 +29,7 @@
     UpdateGeometry(WebCore::IntSize viewSize, WebCore::IntSize layerPosition, bool flushSynchronously, WebCore::MachSendRight fencePort)
     SetDeviceScaleFactor(float deviceScaleFactor)
     SetColorSpace(struct WebKit::ColorSpaceData colorSpace)
-    SetViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+    SetViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
 
     AdjustTransientZoom(double scale, WebCore::FloatPoint origin)
     CommitTransientZoom(double scale, WebCore::FloatPoint origin)
diff --git a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
index f4c0d3d..5381b75 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp
@@ -418,7 +418,7 @@
     if (!documentLoader)
         return { };
 
-    return documentLoader->response().certificateInfo().valueOrCompute([] { return CertificateInfo(); });
+    return valueOrCompute(documentLoader->response().certificateInfo(), [] { return CertificateInfo(); });
 }
 
 String WebFrame::innerText() const
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 20966e8..031bca9 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -449,7 +449,7 @@
     if (parameters.scrollbarOverlayStyle)
         m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(parameters.scrollbarOverlayStyle.value());
     else
-        m_scrollbarOverlayStyle = WTF::Optional<ScrollbarOverlayStyle>();
+        m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>();
 
     setBackgroundExtendsBeyondPage(parameters.backgroundExtendsBeyondPage);
 
@@ -5398,12 +5398,12 @@
     m_page->mainFrame().view()->setScrollPinningBehavior(m_scrollPinningBehavior);
 }
 
-void WebPage::setScrollbarOverlayStyle(WTF::Optional<uint32_t> scrollbarStyle)
+void WebPage::setScrollbarOverlayStyle(std::optional<uint32_t> scrollbarStyle)
 {
     if (scrollbarStyle)
         m_scrollbarOverlayStyle = static_cast<ScrollbarOverlayStyle>(scrollbarStyle.value());
     else
-        m_scrollbarOverlayStyle = WTF::Optional<ScrollbarOverlayStyle>();
+        m_scrollbarOverlayStyle = std::optional<ScrollbarOverlayStyle>();
     m_page->mainFrame().view()->recalculateScrollbarOverlayStyle();
 }
 
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.h b/Source/WebKit2/WebProcess/WebPage/WebPage.h
index 693053f..1831f2b 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.h
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.h
@@ -910,8 +910,8 @@
     WebCore::ScrollPinningBehavior scrollPinningBehavior() { return m_scrollPinningBehavior; }
     void setScrollPinningBehavior(uint32_t /* WebCore::ScrollPinningBehavior */ pinning);
 
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
-    void setScrollbarOverlayStyle(WTF::Optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
+    std::optional<WebCore::ScrollbarOverlayStyle> scrollbarOverlayStyle() { return m_scrollbarOverlayStyle; }
+    void setScrollbarOverlayStyle(std::optional<uint32_t /* WebCore::ScrollbarOverlayStyle */> scrollbarStyle);
 
     Ref<WebCore::DocumentLoader> createDocumentLoader(WebCore::Frame&, const WebCore::ResourceRequest&, const WebCore::SubstituteData&);
     void updateCachedDocumentLoader(WebDocumentLoader&, WebCore::Frame&);
@@ -1484,7 +1484,7 @@
     unsigned m_maximumRenderingSuppressionToken { 0 };
     
     WebCore::ScrollPinningBehavior m_scrollPinningBehavior { WebCore::DoNotPin };
-    WTF::Optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
+    std::optional<WebCore::ScrollbarOverlayStyle> m_scrollbarOverlayStyle;
 
     bool m_useAsyncScrolling { false };
 
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
index 9fcb8e3..1b11199 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
@@ -404,7 +404,7 @@
 #endif
 
     SetScrollPinningBehavior(uint32_t pinning)
-    SetScrollbarOverlayStyle(Optional<uint32_t> scrollbarStyle)
+    SetScrollbarOverlayStyle(std::optional<uint32_t> scrollbarStyle)
 
     GetBytecodeProfile(uint64_t callbackID)
 
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
index f3465d2..fd07148 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h
@@ -83,8 +83,8 @@
     void forceRepaint() override;
     bool forceRepaintAsync(uint64_t) override { return false; }
 
-    void setViewExposedRect(Optional<WebCore::FloatRect>) override;
-    Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
+    void setViewExposedRect(std::optional<WebCore::FloatRect>) override;
+    std::optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
 
     void acceleratedAnimationDidStart(uint64_t layerID, const String& key, double startTime) override;
     void acceleratedAnimationDidEnd(uint64_t layerID, const String& key) override;
@@ -141,8 +141,8 @@
 
     WebCore::IntSize m_viewSize;
 
-    Optional<WebCore::FloatRect> m_viewExposedRect;
-    Optional<WebCore::FloatRect> m_scrolledViewExposedRect;
+    std::optional<WebCore::FloatRect> m_viewExposedRect;
+    std::optional<WebCore::FloatRect> m_scrolledViewExposedRect;
 
     WebCore::Timer m_layerFlushTimer;
     bool m_isFlushingSuspended;
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
index 594d900..5a67334 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm
@@ -230,7 +230,7 @@
     m_remoteLayerTreeContext->animationDidEnd(layerID, key);
 }
 
-void RemoteLayerTreeDrawingArea::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+void RemoteLayerTreeDrawingArea::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
 {
     m_viewExposedRect = viewExposedRect;
     updateScrolledExposedRect();
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
index 7a6b0e2..958338a 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
+++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h
@@ -72,8 +72,8 @@
     void updatePreferences(const WebPreferencesStore&) override;
     void mainFrameContentSizeChanged(const WebCore::IntSize&) override;
 
-    void setViewExposedRect(Optional<WebCore::FloatRect>) override;
-    Optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
+    void setViewExposedRect(std::optional<WebCore::FloatRect>) override;
+    std::optional<WebCore::FloatRect> viewExposedRect() const override { return m_scrolledViewExposedRect; }
 
     bool supportsAsyncScrolling() override { return true; }
 
@@ -137,8 +137,8 @@
 
     bool m_isPaintingSuspended;
 
-    Optional<WebCore::FloatRect> m_viewExposedRect;
-    Optional<WebCore::FloatRect> m_scrolledViewExposedRect;
+    std::optional<WebCore::FloatRect> m_viewExposedRect;
+    std::optional<WebCore::FloatRect> m_scrolledViewExposedRect;
 
     WebCore::IntSize m_lastSentIntrinsicContentSize;
     bool m_inUpdateGeometry;
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
index 58d8a9a..f4eea01 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
@@ -511,7 +511,7 @@
     [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:m_hostingLayer.get() forKey:@"layer"]];
 }
 
-void TiledCoreAnimationDrawingArea::setViewExposedRect(Optional<WebCore::FloatRect> viewExposedRect)
+void TiledCoreAnimationDrawingArea::setViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
 {
     m_viewExposedRect = viewExposedRect;
     updateScrolledExposedRect();