Use Optional::valueOr() instead of Optional::value_or()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 20:23:18 +0000 (20:23 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 20 Dec 2018 20:23:18 +0000 (20:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192933

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
(Inspector::RemoteConnectionToTarget::setup):
* inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
(Inspector::RemoteConnectionToTarget::setup):
* parser/SourceCodeKey.h:
(JSC::SourceCodeKey::SourceCodeKey):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

Source/WebCore:

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::convert):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::load):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::insertDTMF):
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::executeSql):
* Modules/webvr/VRFrameData.cpp:
(WebCore::VRFrameData::update):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::cancel):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/KeyframeEffect.cpp:
(WebCore::computeMissingKeyframeOffsets):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::counterToCSSValue):
* css/CSSFontFace.cpp:
(WebCore::calculateItalicRange):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::doubleValue const):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addRule):
* css/DOMMatrix.cpp:
(WebCore::DOMMatrix::rotateSelf):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::validateAndFixup):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueCounter):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::commitMediaQuery):
* dom/Document.h:
(WebCore::Document::referrerPolicy const):
* dom/Element.cpp:
(WebCore::toScrollAlignment):
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe):
* editing/cocoa/FontAttributeChangesCocoa.mm:
(WebCore::FontChanges::platformFontFamilyNameForCSS const):
* fileapi/File.cpp:
(WebCore::File::File):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::toggle):
* html/HTMLOListElement.h:
* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):
* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::setTransform):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setTransform):
(WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
(WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
* html/canvas/Path2D.cpp:
(WebCore::Path2D::addPath):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* inspector/InspectorFrontendHost.cpp:
(WebCore::populateContextMenu):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/MarginTypes.h:
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::contentBoxTop const):
(WebCore::Display::Box::contentBoxLeft const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::Iterator::set):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
* loader/NavigationAction.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::documentToAbsoluteScaleFactor const):
(WebCore::FrameView::viewportSizeForCSSViewportUnits const):
* page/Page.cpp:
(WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::databaseIdentifier const):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginDataHash::hash):
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize):
* page/WindowFeatures.cpp:
(WebCore::parseDialogFeatures):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):
(WebCore::AnimationBase::fireAnimationEventsIfNeeded):
(WebCore::AnimationBase::getTimeToNextEvent const):
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::getElapsedTime const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformThreadBody):
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformThreadBody):
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::computeHash const):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText const):
(WebCore::FontCascade::drawEmphasisMarks const):
(WebCore::FontCascade::displayListForTextRun const):
(WebCore::FontCascade::adjustSelectionRectForText const):
(WebCore::FontCascade::codePath const):
* platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::styleDistance const):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::operator<<):
(WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
(WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
(WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::naturalSize):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::replicaTransform):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mappedPoint const):
(WebCore::TransformState::mapQuad const):
(WebCore::TransformState::flattenWithTransform):
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/NetworkStateNotifier.cpp:
(WebCore::NetworkStateNotifier::onLine):
* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
(WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
* rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForChild const):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::applyTransform):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight const):
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::baselinePosition const):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridGap const):
(WebCore::RenderGrid::baselinePosition const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItem):
(WebCore::RenderListBox::listIndexIsVisible):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellBaselinePosition const):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::firstLineBaseline const):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::previousOffset const):
(WebCore::RenderText::previousOffsetForBackwardDeletion const):
(WebCore::RenderText::nextOffset const):
(WebCore::RenderText::stringView const):
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::baselinePosition const):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::ascentForChild):
* rendering/style/GridPosition.cpp:
(WebCore::GridPosition::max):
* rendering/style/TextUnderlineOffset.h:
(WebCore::TextUnderlineOffset::lengthOr const):
* 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::nodeAtFloatPoint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::clipToImageBuffer):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::processGlyphElement):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

Source/WebDriver:

* Session.cpp:
(WebDriver::Session::handleUnexpectedAlertOpen):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::selectOptionElement):
(WebDriver::builtAutomationCookie):
(WebDriver::Session::takeScreenshot):
* WebDriverService.cpp:
(WebDriver::WebDriverService::sendResponse const):
(WebDriver::WebDriverService::createSession):

Source/WebKit:

* Shared/API/c/WKSecurityOriginRef.cpp:
(WKSecurityOriginGetPort):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/WKSecurityOrigin.mm:
(-[WKSecurityOrigin port]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _cpuLimit]):
* UIProcess/API/glib/WebKitSecurityOrigin.cpp:
(webkit_security_origin_get_port):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseHandleWheelEvent):
* UIProcess/Automation/SimulatedInputDispatcher.cpp:
(WebKit::SimulatedInputKeyFrame::maximumDuration const):
(WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
(WebKit::WebAutomationSession::performInteractionSequence):
* UIProcess/Automation/WebAutomationSessionMacros.h:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::initTimeOutTimer):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::deviceScaleFactor const):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const):
* UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
(WebKit::WebPopupMenuProxyGtk::activateItem):
* UIProcess/mac/LegacySessionStateCoding.cpp:
(WebKit::encodeFormDataElement):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::convertFromPDFViewToRootView const):
(WebKit::PDFPlugin::boundsOnScreen const):
(WebKit::PDFPlugin::geometryDidChange):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFormData):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/wpe/CompositingManager.cpp:
(WebKit::CompositingManager::releaseConnectionFd):

Source/WebKitLegacy/mac:

* WebCoreSupport/WebSecurityOrigin.mm:
(-[WebSecurityOrigin port]):

Source/WebKitLegacy/win:

* WebSecurityOrigin.cpp:
(WebSecurityOrigin::port):

Source/WTF:

* wtf/Optional.h:
(WTF::Optional<T::valueOr const):

Tools:

* TestWebKitAPI/Tests/WTF/URLParser.cpp:
(TestWebKitAPI::checkURL):
(TestWebKitAPI::checkRelativeURL):
(TestWebKitAPI::checkURLDifferences):
(TestWebKitAPI::checkRelativeURLDifferences):
* TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
(TestWebKitAPI::checkURL):

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

151 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm
Source/JavaScriptCore/inspector/remote/glib/RemoteConnectionToTargetGlib.cpp
Source/JavaScriptCore/parser/SourceCodeKey.h
Source/JavaScriptCore/wasm/js/WebAssemblyModuleRecord.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Optional.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/indexeddb/IDBDatabaseIdentifier.h
Source/WebCore/Modules/indexeddb/IDBFactory.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/RTCDTMFSender.cpp
Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
Source/WebCore/Modules/webvr/VRFrameData.cpp
Source/WebCore/animation/AnimationTimeline.cpp
Source/WebCore/animation/DeclarativeAnimation.cpp
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/bindings/js/SerializedScriptValue.cpp
Source/WebCore/crypto/algorithms/CryptoAlgorithmHMAC.cpp
Source/WebCore/crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp
Source/WebCore/crypto/gcrypt/CryptoKeyRSAGCrypt.cpp
Source/WebCore/crypto/keys/CryptoKeyRSA.cpp
Source/WebCore/crypto/mac/CryptoAlgorithmAES_GCMMac.cpp
Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/css/DOMMatrix.cpp
Source/WebCore/css/DOMMatrixReadOnly.cpp
Source/WebCore/css/StyleBuilderCustom.h
Source/WebCore/css/parser/MediaQueryParser.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/MutationObserver.cpp
Source/WebCore/editing/cocoa/FontAttributeChangesCocoa.mm
Source/WebCore/fileapi/File.cpp
Source/WebCore/html/DOMTokenList.cpp
Source/WebCore/html/HTMLOListElement.h
Source/WebCore/html/ImageBitmap.cpp
Source/WebCore/html/canvas/CanvasPattern.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/html/canvas/Path2D.cpp
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/layout/FormattingContext.cpp
Source/WebCore/layout/FormattingContextGeometry.cpp
Source/WebCore/layout/FormattingContextQuirks.cpp
Source/WebCore/layout/MarginTypes.h
Source/WebCore/layout/blockformatting/BlockFormattingContextGeometry.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContextQuirks.cpp
Source/WebCore/layout/displaytree/DisplayBox.h
Source/WebCore/layout/floats/FloatingContext.cpp
Source/WebCore/layout/inlineformatting/InlineFormattingContext.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/NavigationAction.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/SecurityOriginData.cpp
Source/WebCore/page/SecurityOriginData.h
Source/WebCore/page/SecurityOriginHash.h
Source/WebCore/page/ViewportConfiguration.cpp
Source/WebCore/page/WindowFeatures.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/page/animation/CSSAnimationController.cpp
Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm
Source/WebCore/page/linux/ResourceUsageThreadLinux.cpp
Source/WebCore/platform/graphics/ComplexTextController.cpp
Source/WebCore/platform/graphics/FontCache.h
Source/WebCore/platform/graphics/FontCascade.cpp
Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp
Source/WebCore/platform/graphics/FontSelectionAlgorithm.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/filters/FETurbulence.cpp
Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/transforms/TransformState.cpp
Source/WebCore/platform/network/CacheValidation.cpp
Source/WebCore/platform/network/NetworkStateNotifier.cpp
Source/WebCore/rendering/FloatingObjects.cpp
Source/WebCore/rendering/GridBaselineAlignment.cpp
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
Source/WebCore/rendering/PaintInfo.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderCounter.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderFlexibleBox.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderListBox.cpp
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderTable.cpp
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.cpp
Source/WebCore/rendering/mathml/RenderMathMLBlock.h
Source/WebCore/rendering/style/GridPosition.cpp
Source/WebCore/rendering/style/TextUnderlineOffset.h
Source/WebCore/rendering/svg/RenderSVGContainer.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGImage.cpp
Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGShape.cpp
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/SVGRenderingContext.cpp
Source/WebCore/svg/SVGToOTFFontConversion.cpp
Source/WebDriver/ChangeLog
Source/WebDriver/Session.cpp
Source/WebDriver/WebDriverService.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/API/c/WKSecurityOriginRef.cpp
Source/WebKit/UIProcess/API/APIProcessPoolConfiguration.h
Source/WebKit/UIProcess/API/Cocoa/WKSecurityOrigin.mm
Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit/UIProcess/API/glib/WebKitSecurityOrigin.cpp
Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit/UIProcess/Automation/SimulatedInputDispatcher.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
Source/WebKit/UIProcess/Automation/WebAutomationSessionMacros.h
Source/WebKit/UIProcess/ServiceWorkerProcessProxy.cpp
Source/WebKit/UIProcess/WebAuthentication/AuthenticatorManager.cpp
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/gtk/WebPopupMenuProxyGtk.cpp
Source/WebKit/UIProcess/mac/LegacySessionStateCoding.cpp
Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp
Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
Source/WebKit/WebProcess/WebPage/wpe/CompositingManager.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/WebCoreSupport/WebSecurityOrigin.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebSecurityOrigin.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/URLParser.cpp
Tools/TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp

index d439e4b..49dadec 100644 (file)
@@ -1,3 +1,19 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * inspector/remote/cocoa/RemoteConnectionToTargetCocoa.mm:
+        (Inspector::RemoteConnectionToTarget::setup):
+        * inspector/remote/glib/RemoteConnectionToTargetGlib.cpp:
+        (Inspector::RemoteConnectionToTarget::setup):
+        * parser/SourceCodeKey.h:
+        (JSC::SourceCodeKey::SourceCodeKey):
+        * wasm/js/WebAssemblyModuleRecord.cpp:
+        (JSC::WebAssemblyModuleRecord::link):
+
 2018-12-20  Joseph Pecoraro  <pecoraro@apple.com>
 
         ITMLKit Inspector: Elements tab does not show DOM Tree
index 87215c3..2fafa12 100644 (file)
@@ -159,7 +159,7 @@ bool RemoteConnectionToTarget::setup(bool isAutomaticInspection, bool automatica
     if (!m_target)
         return false;
 
-    unsigned targetIdentifier = this->targetIdentifier().value_or(0);
+    unsigned targetIdentifier = this->targetIdentifier().valueOr(0);
     
     ref();
     dispatchAsyncOnTarget(^{
index 3b5c681..5dde888 100644 (file)
@@ -49,7 +49,7 @@ bool RemoteConnectionToTarget::setup(bool isAutomaticInspection, bool automatica
     if (!m_target)
         return false;
 
-    unsigned targetIdentifier = this->targetIdentifier().value_or(0);
+    unsigned targetIdentifier = this->targetIdentifier().valueOr(0);
 
     if (!m_target || !m_target->remoteControlAllowed()) {
         RemoteInspector::singleton().setupFailed(targetIdentifier);
index 2b03aa5..a8e603c 100644 (file)
@@ -82,7 +82,7 @@ public:
             : m_sourceCode(sourceCode)
             , m_name(name)
             , m_flags(codeType, strictMode, scriptMode, derivedContextType, evalContextType, isArrowFunctionContext, debuggerMode, typeProfilerEnabled, controlFlowProfilerEnabled)
-            , m_functionConstructorParametersEndPosition(functionConstructorParametersEndPosition.value_or(-1))
+            , m_functionConstructorParametersEndPosition(functionConstructorParametersEndPosition.valueOr(-1))
             , m_hash(sourceCode.hash() ^ m_flags.bits())
     {
     }
index c5708bc..2dc0ae7 100644 (file)
@@ -412,7 +412,7 @@ void WebAssemblyModuleRecord::link(ExecState* exec, JSValue, JSObject* importObj
 
     bool hasStart = !!moduleInformation.startFunctionIndexSpace;
     if (hasStart) {
-        auto startFunctionIndexSpace = moduleInformation.startFunctionIndexSpace.value_or(0);
+        auto startFunctionIndexSpace = moduleInformation.startFunctionIndexSpace.valueOr(0);
         Wasm::SignatureIndex signatureIndex = module->signatureIndexFromFunctionIndexSpace(startFunctionIndexSpace);
         const Wasm::Signature& signature = Wasm::SignatureInformation::get(signatureIndex);
         // The start function must not take any arguments or return anything. This is enforced by the parser.
index 0dfcf22..36a3eae 100644 (file)
@@ -1,3 +1,13 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * wtf/Optional.h:
+        (WTF::Optional<T::valueOr const):
+
 2018-12-20  Tadeu Zagallo  <tzagallo@apple.com>
 
         Consistently use MaxLength for all WTF strings
index a605be0..6d4e242 100644 (file)
@@ -557,26 +557,12 @@ public:
     return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
   }
 
-  // FIXME: Remove this.
-  template <class V>
-  constexpr T value_or(V&& v) const&
-  {
-    return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
-  }
-
   template <class V>
   OPTIONAL_MUTABLE_CONSTEXPR T valueOr(V&& v) &&
   {
     return *this ? detail_::constexpr_move(const_cast<Optional<T>&>(*this).contained_val()) : detail_::convert<T>(detail_::constexpr_forward<V>(v));
   }
 
-  // FIXME: Remove this.
-  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>
@@ -585,13 +571,6 @@ public:
     return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
   }
 
-  // FIXME: Remove this.
-  template <class V>
-  constexpr T value_or(V&& v) const
-  {
-    return *this ? **this : detail_::convert<T>(detail_::constexpr_forward<V>(v));
-  }
-
 # endif
 
   // 20.6.3.6, modifiers
@@ -699,7 +678,7 @@ public:
   }
 
   template <class V>
-  constexpr typename std::decay<T>::type value_or(V&& v) const
+  constexpr typename std::decay<T>::type valueOr(V&& v) const
   {
     return *this ? **this : detail_::convert<typename std::decay<T>::type>(detail_::constexpr_forward<V>(v));
   }
index 00426f2..6c10bac 100644 (file)
@@ -1,3 +1,296 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        (WebCore::convert):
+        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::load):
+        * Modules/indexeddb/IDBDatabaseIdentifier.h:
+        (WebCore::IDBDatabaseIdentifier::hash const):
+        * Modules/indexeddb/IDBFactory.cpp:
+        (WebCore::IDBFactory::open):
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::applyConstraints):
+        * Modules/mediastream/RTCDTMFSender.cpp:
+        (WebCore::RTCDTMFSender::insertDTMF):
+        * Modules/webdatabase/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::executeSql):
+        * Modules/webvr/VRFrameData.cpp:
+        (WebCore::VRFrameData::update):
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
+        * animation/DeclarativeAnimation.cpp:
+        (WebCore::DeclarativeAnimation::cancel):
+        (WebCore::DeclarativeAnimation::invalidateDOMEvents):
+        * animation/KeyframeEffect.cpp:
+        (WebCore::computeMissingKeyframeOffsets):
+        (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::runPendingPlayTask):
+        (WebCore::WebAnimation::runPendingPauseTask):
+        * bindings/js/SerializedScriptValue.cpp:
+        (WebCore::CloneSerializer::write):
+        * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
+        (WebCore::CryptoAlgorithmHMAC::generateKey):
+        (WebCore::CryptoAlgorithmHMAC::importKey):
+        * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
+        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
+        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
+        * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
+        (WebCore::CryptoKeyRSA::importSpki):
+        (WebCore::CryptoKeyRSA::importPkcs8):
+        * crypto/keys/CryptoKeyRSA.cpp:
+        (WebCore::CryptoKeyRSA::importJwk):
+        * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
+        (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
+        (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
+        * crypto/mac/CryptoKeyRSAMac.cpp:
+        (WebCore::CryptoKeyRSA::importSpki):
+        (WebCore::CryptoKeyRSA::importPkcs8):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::counterToCSSValue):
+        * css/CSSFontFace.cpp:
+        (WebCore::calculateItalicRange):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::doubleValue const):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::addRule):
+        * css/DOMMatrix.cpp:
+        (WebCore::DOMMatrix::rotateSelf):
+        * css/DOMMatrixReadOnly.cpp:
+        (WebCore::DOMMatrixReadOnly::validateAndFixup):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueCounter):
+        * css/parser/MediaQueryParser.cpp:
+        (WebCore::MediaQueryParser::commitMediaQuery):
+        * dom/Document.h:
+        (WebCore::Document::referrerPolicy const):
+        * dom/Element.cpp:
+        (WebCore::toScrollAlignment):
+        * dom/EventTarget.cpp:
+        (WebCore::EventTarget::addEventListener):
+        * dom/MutationObserver.cpp:
+        (WebCore::MutationObserver::observe):
+        * editing/cocoa/FontAttributeChangesCocoa.mm:
+        (WebCore::FontChanges::platformFontFamilyNameForCSS const):
+        * fileapi/File.cpp:
+        (WebCore::File::File):
+        * html/DOMTokenList.cpp:
+        (WebCore::DOMTokenList::toggle):
+        * html/HTMLOListElement.h:
+        * html/ImageBitmap.cpp:
+        (WebCore::croppedSourceRectangleWithFormatting):
+        * html/canvas/CanvasPattern.cpp:
+        (WebCore::CanvasPattern::setTransform):
+        * html/canvas/CanvasRenderingContext2DBase.cpp:
+        (WebCore::CanvasRenderingContext2DBase::setTransform):
+        (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
+        (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
+        * html/canvas/Path2D.cpp:
+        (WebCore::Path2D::addPath):
+        * inspector/InspectorCanvas.cpp:
+        (WebCore::InspectorCanvas::buildAction):
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::populateContextMenu):
+        * layout/FormattingContext.cpp:
+        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
+        * layout/FormattingContextGeometry.cpp:
+        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
+        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
+        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
+        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
+        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
+        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
+        (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
+        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
+        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
+        * layout/FormattingContextQuirks.cpp:
+        (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
+        * layout/MarginTypes.h:
+        (WebCore::Layout::VerticalMargin::usedValues const):
+        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
+        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
+        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
+        (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
+        * layout/blockformatting/BlockFormattingContextQuirks.cpp:
+        (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
+        * layout/displaytree/DisplayBox.h:
+        (WebCore::Display::Box::width const):
+        (WebCore::Display::Box::height const):
+        (WebCore::Display::Box::contentBoxTop const):
+        (WebCore::Display::Box::contentBoxLeft const):
+        * layout/floats/FloatingContext.cpp:
+        (WebCore::Layout::Iterator::set):
+        * layout/inlineformatting/InlineFormattingContext.cpp:
+        (WebCore::Layout::InlineFormattingContext::appendContentToLine const):
+        (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::urlSelected):
+        * loader/NavigationAction.cpp:
+        * page/FrameView.cpp:
+        (WebCore::FrameView::setLayoutViewportOverrideRect):
+        (WebCore::FrameView::documentToAbsoluteScaleFactor const):
+        (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
+        * page/Page.cpp:
+        (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
+        * page/SecurityOriginData.cpp:
+        (WebCore::SecurityOriginData::databaseIdentifier const):
+        * page/SecurityOriginData.h:
+        (WebCore::SecurityOriginDataHash::hash):
+        * page/SecurityOriginHash.h:
+        (WebCore::SecurityOriginHash::hash):
+        * page/ViewportConfiguration.cpp:
+        (WebCore::ViewportConfiguration::setViewLayoutSize):
+        * page/WindowFeatures.cpp:
+        (WebCore::parseDialogFeatures):
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::updateStateMachine):
+        (WebCore::AnimationBase::fireAnimationEventsIfNeeded):
+        (WebCore::AnimationBase::getTimeToNextEvent const):
+        (WebCore::AnimationBase::freezeAtTime):
+        (WebCore::AnimationBase::getElapsedTime const):
+        * page/animation/CSSAnimationController.cpp:
+        (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
+        * page/cocoa/ResourceUsageThreadCocoa.mm:
+        (WebCore::ResourceUsageThread::platformThreadBody):
+        * page/linux/ResourceUsageThreadLinux.cpp:
+        (WebCore::ResourceUsageThread::platformThreadBody):
+        * platform/graphics/ComplexTextController.cpp:
+        (WebCore::ComplexTextController::offsetForPosition):
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionKey::computeHash const):
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::drawText const):
+        (WebCore::FontCascade::drawEmphasisMarks const):
+        (WebCore::FontCascade::displayListForTextRun const):
+        (WebCore::FontCascade::adjustSelectionRectForText const):
+        (WebCore::FontCascade::codePath const):
+        * platform/graphics/FontSelectionAlgorithm.cpp:
+        (WebCore::FontSelectionAlgorithm::styleDistance const):
+        * platform/graphics/FontSelectionAlgorithm.h:
+        (WebCore::operator<<):
+        (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
+        (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
+        (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ShadowBlur::calculateLayerBoundingRect):
+        * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
+        (WebCore::WebCoreAVCFResourceLoader::startLoading):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::naturalSize):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::preparePlatformFont):
+        * platform/graphics/filters/FETurbulence.cpp:
+        (WebCore::FETurbulence::fillRegion const):
+        * platform/graphics/gstreamer/GStreamerCommon.cpp:
+        (WebCore::initializeGStreamer):
+        * platform/graphics/texmap/TextureMapperLayer.cpp:
+        (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
+        (WebCore::TextureMapperLayer::replicaTransform):
+        (WebCore::TextureMapperLayer::syncAnimations):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
+        (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
+        * platform/graphics/transforms/TransformState.cpp:
+        (WebCore::TransformState::mappedPoint const):
+        (WebCore::TransformState::mapQuad const):
+        (WebCore::TransformState::flattenWithTransform):
+        * platform/network/CacheValidation.cpp:
+        (WebCore::computeCurrentAge):
+        (WebCore::computeFreshnessLifetimeForHTTPFamily):
+        * platform/network/NetworkStateNotifier.cpp:
+        (WebCore::NetworkStateNotifier::onLine):
+        * rendering/FloatingObjects.cpp:
+        (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
+        (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
+        * rendering/GridBaselineAlignment.cpp:
+        (WebCore::GridBaselineAlignment::ascentForChild const):
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::GridTrack::setGrowthLimit):
+        (WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
+        (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
+        (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
+        (WebCore::sortByGridTrackGrowthPotential):
+        (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
+        (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
+        (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
+        * rendering/PaintInfo.h:
+        (WebCore::PaintInfo::applyTransform):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalHeight const):
+        * rendering/RenderCounter.cpp:
+        (WebCore::planCounter):
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::baselinePosition const):
+        (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
+        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::gridGap const):
+        (WebCore::RenderGrid::baselinePosition const):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintLayerByApplyingTransform):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::paintItem):
+        (WebCore::RenderListBox::listIndexIsVisible):
+        * rendering/RenderMultiColumnSet.cpp:
+        (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::cellBaselinePosition const):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::firstLineBaseline const):
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::computePreferredLogicalWidths):
+        (WebCore::RenderText::previousOffset const):
+        (WebCore::RenderText::previousOffsetForBackwardDeletion const):
+        (WebCore::RenderText::nextOffset const):
+        (WebCore::RenderText::stringView const):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::layout):
+        * rendering/mathml/RenderMathMLBlock.cpp:
+        (WebCore::RenderMathMLBlock::baselinePosition const):
+        * rendering/mathml/RenderMathMLBlock.h:
+        (WebCore::RenderMathMLBlock::ascentForChild):
+        * rendering/style/GridPosition.cpp:
+        (WebCore::GridPosition::max):
+        * rendering/style/TextUnderlineOffset.h:
+        (WebCore::TextUnderlineOffset::lengthOr const):
+        * 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::nodeAtFloatPoint):
+        * rendering/svg/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::nodeAtFloatPoint):
+        * rendering/svg/SVGRenderingContext.cpp:
+        (WebCore::SVGRenderingContext::clipToImageBuffer):
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::SVGToOTFFontConverter::processGlyphElement):
+        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
+
 2018-12-20  Jer Noble  <jer.noble@apple.com>
 
         REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
index 156d086..ea44d5f 100644 (file)
@@ -547,7 +547,7 @@ void ApplePayPaymentHandler::validateMerchant(URL&& validationURL)
 
 static Ref<PaymentAddress> convert(const ApplePayPaymentContact& contact)
 {
-    return PaymentAddress::create(contact.countryCode, contact.addressLines.value_or(Vector<String>()), contact.administrativeArea, contact.locality, contact.subLocality, contact.postalCode, String(), String(), contact.localizedName, contact.phoneNumber);
+    return PaymentAddress::create(contact.countryCode, contact.addressLines.valueOr(Vector<String>()), contact.administrativeArea, contact.locality, contact.subLocality, contact.postalCode, String(), String(), contact.localizedName, contact.phoneNumber);
 }
 
 template<typename T>
@@ -562,7 +562,7 @@ void ApplePayPaymentHandler::didAuthorizePayment(const Payment& payment)
     ASSERT(!m_isUpdating);
 
     auto applePayPayment = payment.toApplePayPayment(version());
-    auto shippingContact = applePayPayment.shippingContact.value_or(ApplePayPaymentContact());
+    auto shippingContact = applePayPayment.shippingContact.valueOr(ApplePayPaymentContact());
     auto detailsFunction = [applePayPayment = WTFMove(applePayPayment)](JSC::ExecState& execState) {
         return toJSDictionary(execState, applePayPayment);
     };
index 392a37c..4bea9a0 100644 (file)
@@ -342,7 +342,7 @@ void MediaKeySession::load(const String& sessionId, Ref<DeferredPromise>&& promi
 
                 // 8.9.5. Run the Update Expiration algorithm on the session, providing expiration time.
                 // This must be run, and NaN is the default value if the CDM instance doesn't provide one.
-                updateExpiration(expiration.value_or(std::numeric_limits<double>::quiet_NaN()));
+                updateExpiration(expiration.valueOr(std::numeric_limits<double>::quiet_NaN()));
 
                 // 8.9.6. If message is not null, run the Queue a "message" Event algorithm on the session, providing message type and message.
                 if (message)
index f42a9f9..e6eb4bf 100644 (file)
@@ -62,7 +62,7 @@ public:
         unsigned mainFrameProtocolHash = StringHash::hash(m_mainFrameOrigin.protocol);
         unsigned mainFrameHostHash = StringHash::hash(m_mainFrameOrigin.host);
         
-        unsigned hashCodes[8] = { nameHash, sessionIDHash, openingProtocolHash, openingHostHash, m_openingOrigin.port.value_or(0), mainFrameProtocolHash, mainFrameHostHash, m_mainFrameOrigin.port.value_or(0) };
+        unsigned hashCodes[8] = { nameHash, sessionIDHash, openingProtocolHash, openingHostHash, m_openingOrigin.port.valueOr(0), mainFrameProtocolHash, mainFrameHostHash, m_mainFrameOrigin.port.valueOr(0) };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
 
index 974c534..ea1f849 100644 (file)
@@ -79,7 +79,7 @@ ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::open(ScriptExecutionContext& cont
     if (version && !version.value())
         return Exception { TypeError, "IDBFactory.open() called with a version of 0"_s };
 
-    return openInternal(context, name, version.value_or(0));
+    return openInternal(context, name, version.valueOr(0));
 }
 
 ExceptionOr<Ref<IDBOpenDBRequest>> IDBFactory::openInternal(ScriptExecutionContext& context, const String& name, uint64_t version)
index b5937c7..6a7f146 100644 (file)
@@ -340,7 +340,7 @@ void MediaStreamTrack::applyConstraints(const Optional<MediaTrackConstraints>& c
         if (!weakThis || !weakThis->m_promise)
             return;
         weakThis->m_promise->resolve();
-        weakThis->m_constraints = constraints.value_or(MediaTrackConstraints { });
+        weakThis->m_constraints = constraints.valueOr(MediaTrackConstraints { });
     };
     m_private->applyConstraints(createMediaConstraints(constraints), WTFMove(successHandler), WTFMove(failureHandler));
 }
index 3f26e65..53ddc12 100644 (file)
@@ -79,8 +79,8 @@ ExceptionOr<void> RTCDTMFSender::insertDTMF(const String&, Optional<int> duratio
     if (interToneGap && interToneGap.value() < minInterToneGapMs)
         return Exception { SyntaxError };
 
-    m_duration = duration.value_or(defaultToneDurationMs);
-    m_interToneGap = interToneGap.value_or(defaultInterToneGapMs);
+    m_duration = duration.valueOr(defaultToneDurationMs);
+    m_interToneGap = interToneGap.valueOr(defaultInterToneGapMs);
 
     return Exception { SyntaxError };
 }
index 1977980..5091c83 100644 (file)
@@ -81,7 +81,7 @@ ExceptionOr<void> SQLTransaction::executeSql(const String& sqlStatement, Optiona
     else if (m_readOnly)
         permissions |= DatabaseAuthorizer::ReadOnlyMask;
 
-    auto statement = std::make_unique<SQLStatement>(m_database, sqlStatement, arguments.value_or(Vector<SQLValue> { }), WTFMove(callback), WTFMove(callbackError), permissions);
+    auto statement = std::make_unique<SQLStatement>(m_database, sqlStatement, arguments.valueOr(Vector<SQLValue> { }), WTFMove(callback), WTFMove(callbackError), permissions);
 
     if (m_database->deleted())
         statement->setDatabaseDeletedError();
index b215b55..a7c7db9 100644 (file)
@@ -128,8 +128,8 @@ void VRFrameData::update(const VRPlatformTrackingInfo& trackingInfo, const VREye
     m_timestamp = trackingInfo.timestamp;
     m_pose->update(trackingInfo);
 
-    auto rotationMatrix = rotationMatrixFromQuaternion(trackingInfo.orientation.value_or(VRPlatformTrackingInfo::Quaternion(0, 0, 0, 1)));
-    FloatPoint3D position = trackingInfo.position.value_or(FloatPoint3D(0, 0, 0));
+    auto rotationMatrix = rotationMatrixFromQuaternion(trackingInfo.orientation.valueOr(VRPlatformTrackingInfo::Quaternion(0, 0, 0, 1)));
+    FloatPoint3D position = trackingInfo.position.valueOr(FloatPoint3D(0, 0, 0));
     rotationMatrix.translate3d(-position.x(), -position.y(), -position.z());
 
     m_leftViewMatrix = rotationMatrix;
index fcba25c..625d4f0 100644 (file)
@@ -460,7 +460,7 @@ void AnimationTimeline::updateCSSTransitionsForElement(Element& element, const R
                 auto& reversingAdjustedStartStyle = previouslyRunningTransition->targetStyle();
                 double transformedProgress = 1;
                 if (auto* effect = previouslyRunningTransition->effect())
-                    transformedProgress = effect->iterationProgress().value_or(transformedProgress);
+                    transformedProgress = effect->iterationProgress().valueOr(transformedProgress);
                 auto reversingShorteningFactor = std::max(std::min(((transformedProgress * previouslyRunningTransition->reversingShorteningFactor()) + (1 - previouslyRunningTransition->reversingShorteningFactor())), 1.0), 0.0);
                 auto delay = matchingBackingAnimation->delay() < 0 ? Seconds(matchingBackingAnimation->delay()) * reversingShorteningFactor : Seconds(matchingBackingAnimation->delay());
                 auto duration = Seconds(matchingBackingAnimation->duration()) * reversingShorteningFactor;
index 0c20c52..76c83b4 100644 (file)
@@ -199,7 +199,7 @@ void DeclarativeAnimation::cancel()
 {
     auto cancelationTime = 0_s;
     if (auto animationEffect = effect())
-        cancelationTime = animationEffect->activeTime().value_or(0_s);
+        cancelationTime = animationEffect->activeTime().valueOr(0_s);
 
     WebAnimation::cancel();
 
@@ -236,7 +236,7 @@ void DeclarativeAnimation::invalidateDOMEvents(Seconds elapsedTime)
     if (isPending && m_wasPending)
         return;
 
-    auto iteration = animationEffect ? animationEffect->currentIteration().value_or(0) : 0;
+    auto iteration = animationEffect ? animationEffect->currentIteration().valueOr(0) : 0;
     auto currentPhase = animationEffect ? animationEffect->phase() : phaseWithoutEffect();
 
     bool wasActive = m_previousPhase == AnimationEffect::Phase::Active;
index 1e6462d..13dbcd0 100644 (file)
@@ -116,7 +116,7 @@ static inline void computeMissingKeyframeOffsets(Vector<KeyframeEffect::ParsedKe
     // that a keyframe hasn't had a computed offset by checking if it has a null offset and a 0 computedOffset, since the first
     // keyframe will already have a 0 computedOffset.
     for (auto& keyframe : keyframes)
-        keyframe.computedOffset = keyframe.offset.value_or(0);
+        keyframe.computedOffset = keyframe.offset.valueOr(0);
 
     // 2. If keyframes contains more than one keyframe and the computed keyframe offset of the first keyframe in keyframes is null,
     //    set the computed keyframe offset of the first keyframe to 0.
@@ -1314,7 +1314,7 @@ void KeyframeEffect::applyPendingAcceleratedActions()
     auto* compositedRenderer = downcast<RenderBoxModelObject>(renderer);
 
     // To simplify the code we use a default of 0s for an unresolved current time since for a Stop action that is acceptable.
-    auto timeOffset = animation()->currentTime().value_or(0_s).seconds() - delay().seconds();
+    auto timeOffset = animation()->currentTime().valueOr(0_s).seconds() - delay().seconds();
 
     for (const auto& action : pendingAcceleratedActions) {
         switch (action) {
index 67e9812..338cca3 100644 (file)
@@ -917,7 +917,7 @@ void WebAnimation::runPendingPlayTask()
         // Subsequently, the resulting readyTime value can be null. Unify behavior between C++17 and
         // C++14 builds (the latter using WTF's Optional) and avoid null Optional dereferencing
         // by defaulting to a Seconds(0) value. See https://bugs.webkit.org/show_bug.cgi?id=186189.
-        auto newStartTime = readyTime.value_or(0_s);
+        auto newStartTime = readyTime.valueOr(0_s);
         if (m_playbackRate)
             newStartTime -= m_holdTime.value() / m_playbackRate;
         // 3. Set the start time of animation to new start time.
@@ -928,7 +928,7 @@ void WebAnimation::runPendingPlayTask()
     } else if (m_startTime && m_pendingPlaybackRate) {
         // If animation's start time is resolved and animation has a pending playback rate,
         // 1. Let current time to match be the result of evaluating (ready time - start time) × playback rate for animation.
-        auto currentTimeToMatch = (readyTime.value_or(0_s) - m_startTime.value()) * m_playbackRate;
+        auto currentTimeToMatch = (readyTime.valueOr(0_s) - m_startTime.value()) * m_playbackRate;
         // 2. Apply any pending playback rate on animation.
         applyPendingPlaybackRate();
         // 3. If animation's playback rate is zero, let animation's hold time be current time to match.
@@ -936,7 +936,7 @@ void WebAnimation::runPendingPlayTask()
             m_holdTime = currentTimeToMatch;
         // 4. Let new start time be the result of evaluating ready time - current time to match / playback rate for animation.
         // If the playback rate is zero, let new start time be simply ready time.
-        auto newStartTime = readyTime.value_or(0_s);
+        auto newStartTime = readyTime.valueOr(0_s);
         if (m_playbackRate)
             newStartTime -= currentTimeToMatch / m_playbackRate;
         // 5. Set the start time of animation to new start time.
@@ -1059,7 +1059,7 @@ void WebAnimation::runPendingPauseTask()
         // Subsequently, the resulting readyTime value can be null. Unify behavior between C++17 and
         // C++14 builds (the latter using WTF's Optional) and avoid null Optional dereferencing
         // by defaulting to a Seconds(0) value. See https://bugs.webkit.org/show_bug.cgi?id=186189.
-        m_holdTime = (readyTime.value_or(0_s) - animationStartTime.value()) * m_playbackRate;
+        m_holdTime = (readyTime.valueOr(0_s) - animationStartTime.value()) * m_playbackRate;
     }
 
     // 3. Apply any pending playback rate on animation.
index 9998108..72ff7ca 100644 (file)
@@ -1262,7 +1262,7 @@ private:
         write(file.url());
         write(file.type());
         write(file.name());
-        write(static_cast<double>(file.lastModifiedOverride().value_or(-1)));
+        write(static_cast<double>(file.lastModifiedOverride().valueOr(-1)));
     }
 
 #if ENABLE(WEB_CRYPTO)
index 02b2171..4bfb4ef 100644 (file)
@@ -87,7 +87,7 @@ void CryptoAlgorithmHMAC::generateKey(const CryptoAlgorithmParameters& parameter
         return;
     }
 
-    auto result = CryptoKeyHMAC::generate(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, extractable, usages);
+    auto result = CryptoKeyHMAC::generate(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, extractable, usages);
     if (!result) {
         exceptionCallback(OperationError);
         return;
@@ -110,7 +110,7 @@ void CryptoAlgorithmHMAC::importKey(CryptoKeyFormat format, KeyData&& data, cons
     RefPtr<CryptoKeyHMAC> result;
     switch (format) {
     case CryptoKeyFormat::Raw:
-        result = CryptoKeyHMAC::importRaw(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
+        result = CryptoKeyHMAC::importRaw(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<Vector<uint8_t>>(data)), extractable, usages);
         break;
     case CryptoKeyFormat::Jwk: {
         auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const String& alg) -> bool {
@@ -130,7 +130,7 @@ void CryptoAlgorithmHMAC::importKey(CryptoKeyFormat format, KeyData&& data, cons
             }
             return false;
         };
-        result = CryptoKeyHMAC::importJwk(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback));
+        result = CryptoKeyHMAC::importJwk(hmacParameters.length.valueOr(0), hmacParameters.hashIdentifier, WTFMove(WTF::get<JsonWebKey>(data)), extractable, usages, WTFMove(checkAlgCallback));
         break;
     }
     default:
index 3ccc1e6..ffbc93c 100644 (file)
@@ -181,7 +181,7 @@ static Optional<Vector<uint8_t>> gcryptDecrypt(const Vector<uint8_t>& key, const
 
 ExceptionOr<Vector<uint8_t>> CryptoAlgorithmAES_GCM::platformEncrypt(const CryptoAlgorithmAesGcmParams& parameters, const CryptoKeyAES& key, const Vector<uint8_t>& plainText)
 {
-    auto output = gcryptEncrypt(key.key(), parameters.ivVector(), plainText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8);
+    auto output = gcryptEncrypt(key.key(), parameters.ivVector(), plainText, parameters.additionalDataVector(), parameters.tagLength.valueOr(0) / 8);
     if (!output)
         return Exception { OperationError };
     return WTFMove(*output);
@@ -189,7 +189,7 @@ ExceptionOr<Vector<uint8_t>> CryptoAlgorithmAES_GCM::platformEncrypt(const Crypt
 
 ExceptionOr<Vector<uint8_t>> CryptoAlgorithmAES_GCM::platformDecrypt(const CryptoAlgorithmAesGcmParams& parameters, const CryptoKeyAES& key, const Vector<uint8_t>& cipherText)
 {
-    auto output = gcryptDecrypt(key.key(), parameters.ivVector(), cipherText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8);
+    auto output = gcryptDecrypt(key.key(), parameters.ivVector(), cipherText, parameters.additionalDataVector(), parameters.tagLength.valueOr(0) / 8);
     if (!output)
         return Exception { OperationError };
     return WTFMove(*output);
index c642ca6..dfc5ba4 100644 (file)
@@ -313,7 +313,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifi
         }
     }
 
-    return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, platformKey.release(), extractable, usages));
+    return adoptRef(new CryptoKeyRSA(identifier, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, platformKey.release(), extractable, usages));
 }
 
 RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, Optional<CryptoAlgorithmIdentifier> hash, Vector<uint8_t>&& keyData, bool extractable, CryptoKeyUsageBitmap usages)
@@ -408,7 +408,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identif
         }
     }
 
-    return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, platformKey.release(), extractable, usages));
+    return adoptRef(new CryptoKeyRSA(identifier, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, platformKey.release(), extractable, usages));
 }
 
 ExceptionOr<Vector<uint8_t>> CryptoKeyRSA::exportSpki() const
index 73de51a..ec06773 100644 (file)
@@ -58,7 +58,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm
         // import public key
         auto publicKeyComponents = CryptoKeyRSAComponents::createPublic(WTFMove(modulus), WTFMove(exponent));
         // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages);
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages);
     }
 
     // import private key
@@ -68,7 +68,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm
     if (keyData.p.isNull() && keyData.q.isNull() && keyData.dp.isNull() && keyData.dp.isNull() && keyData.qi.isNull()) {
         auto privateKeyComponents = CryptoKeyRSAComponents::createPrivate(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent));
         // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
     }
 
     if (keyData.p.isNull() || keyData.q.isNull() || keyData.dp.isNull() || keyData.dq.isNull() || keyData.qi.isNull())
@@ -88,7 +88,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm
     if (!keyData.oth) {
         auto privateKeyComponents = CryptoKeyRSAComponents::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 WTF::nullopt.
-        return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+        return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
     }
 
     Vector<CryptoKeyRSAComponents::PrimeInfo> otherPrimeInfos;
@@ -105,7 +105,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm
 
     auto privateKeyComponents = CryptoKeyRSAComponents::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 WTF::nullopt.
-    return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
+    return CryptoKeyRSA::create(algorithm, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages);
 }
 
 JsonWebKey CryptoKeyRSA::exportJwk() const
index e268ff5..9234415 100644 (file)
@@ -72,12 +72,12 @@ static ExceptionOr<Vector<uint8_t>> decyptAES_GCM(const Vector<uint8_t>& iv, con
 
 ExceptionOr<Vector<uint8_t>> CryptoAlgorithmAES_GCM::platformEncrypt(const CryptoAlgorithmAesGcmParams& parameters, const CryptoKeyAES& key, const Vector<uint8_t>& plainText)
 {
-    return encryptAES_GCM(parameters.ivVector(), key.key(), plainText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8);
+    return encryptAES_GCM(parameters.ivVector(), key.key(), plainText, parameters.additionalDataVector(), parameters.tagLength.valueOr(0) / 8);
 }
 
 ExceptionOr<Vector<uint8_t>> CryptoAlgorithmAES_GCM::platformDecrypt(const CryptoAlgorithmAesGcmParams& parameters, const CryptoKeyAES& key, const Vector<uint8_t>& cipherText)
 {
-    return decyptAES_GCM(parameters.ivVector(), key.key(), cipherText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8);
+    return decyptAES_GCM(parameters.ivVector(), key.key(), cipherText, parameters.additionalDataVector(), parameters.tagLength.valueOr(0) / 8);
 }
 
 } // namespace WebCore
index 3aa701d..11a7c91 100644 (file)
@@ -363,7 +363,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifi
         return nullptr;
 
     // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt.
-    return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, ccPublicKey, extractable, usages));
+    return adoptRef(new CryptoKeyRSA(identifier, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, ccPublicKey, extractable, usages));
 }
 
 ExceptionOr<Vector<uint8_t>> CryptoKeyRSA::exportSpki() const
@@ -420,7 +420,7 @@ RefPtr<CryptoKeyRSA> CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identif
         return nullptr;
 
     // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is WTF::nullopt.
-    return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, ccPrivateKey, extractable, usages));
+    return adoptRef(new CryptoKeyRSA(identifier, hash.valueOr(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, ccPrivateKey, extractable, usages));
 }
 
 ExceptionOr<Vector<uint8_t>> CryptoKeyRSA::exportPkcs8() const
index 7b26e3a..1d09c8a 100644 (file)
@@ -1951,7 +1951,7 @@ static Ref<CSSValue> counterToCSSValue(const RenderStyle& style, CSSPropertyID p
     auto list = CSSValueList::createSpaceSeparated();
     for (auto& keyValue : *map) {
         list->append(cssValuePool.createValue(keyValue.key, CSSPrimitiveValue::CSS_STRING));
-        double number = (propertyID == CSSPropertyCounterIncrement ? keyValue.value.incrementValue : keyValue.value.resetValue).value_or(0);
+        double number = (propertyID == CSSPropertyCounterIncrement ? keyValue.value.incrementValue : keyValue.value.resetValue).valueOr(0);
         list->append(cssValuePool.createValue(number, CSSPrimitiveValue::CSS_NUMBER));
     }
     return WTFMove(list);
index 54a4048..0eca51b 100644 (file)
@@ -202,7 +202,7 @@ static FontSelectionRange calculateItalicRange(CSSValue& value)
 {
     if (value.isFontStyleValue()) {
         auto result = StyleBuilderConverter::convertFontStyleFromValue(value);
-        return { result.value_or(normalItalicValue()), result.value_or(normalItalicValue()) };
+        return { result.valueOr(normalItalicValue()), result.valueOr(normalItalicValue()) };
     }
 
     ASSERT(value.isFontStyleRangeValue());
index 6ae6267..06ffb60 100644 (file)
@@ -787,7 +787,7 @@ ExceptionOr<float> CSSPrimitiveValue::getFloatValue(unsigned short unitType) con
 
 double CSSPrimitiveValue::doubleValue(UnitType unitType) const
 {
-    return doubleValueInternal(unitType).value_or(0);
+    return doubleValueInternal(unitType).valueOr(0);
 }
 
 double CSSPrimitiveValue::doubleValue() const
index 12cda54..67c30e4 100644 (file)
@@ -316,7 +316,7 @@ ExceptionOr<int> CSSStyleSheet::addRule(const String& selector, const String& st
     if (!style.isEmpty())
         text.append(' ');
     text.append('}');
-    auto insertRuleResult = insertRule(text.toString(), index.value_or(length()));
+    auto insertRuleResult = insertRule(text.toString(), index.valueOr(length()));
     if (insertRuleResult.hasException())
         return insertRuleResult.releaseException();
     
index c354e97..a00f165 100644 (file)
@@ -189,8 +189,8 @@ Ref<DOMMatrix> DOMMatrix::rotateSelf(double rotX, Optional<double> rotY, Optiona
         rotX = 0;
         rotY = 0;
     }
-    m_matrix.rotate3d(rotX, rotY.value_or(0), rotZ.value_or(0));
-    if (rotX || rotY.value_or(0))
+    m_matrix.rotate3d(rotX, rotY.valueOr(0), rotZ.valueOr(0));
+    if (rotX || rotY.valueOr(0))
         m_is2D = false;
     return *this;
 }
index cc7f726..13996fb 100644 (file)
@@ -120,17 +120,17 @@ ExceptionOr<void> DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init)
         return Exception { TypeError, "init.f and init.m42 do not match"_s };
 
     if (!init.m11)
-        init.m11 = init.a.value_or(1);
+        init.m11 = init.a.valueOr(1);
     if (!init.m12)
-        init.m12 = init.b.value_or(0);
+        init.m12 = init.b.valueOr(0);
     if (!init.m21)
-        init.m21 = init.c.value_or(0);
+        init.m21 = init.c.valueOr(0);
     if (!init.m22)
-        init.m22 = init.d.value_or(1);
+        init.m22 = init.d.valueOr(1);
     if (!init.m41)
-        init.m41 = init.e.value_or(0);
+        init.m41 = init.e.valueOr(0);
     if (!init.m42)
-        init.m42 = init.f.value_or(0);
+        init.m42 = init.f.valueOr(0);
 
     return { };
 }
index c7852f0..48e6cab 100644 (file)
@@ -1193,7 +1193,7 @@ inline void StyleBuilderCustom::applyValueCounter(StyleResolver& styleResolver,
         if (counterBehavior == Reset)
             directives.resetValue = value;
         else
-            directives.incrementValue = saturatedAddition(directives.incrementValue.value_or(0), value);
+            directives.incrementValue = saturatedAddition(directives.incrementValue.valueOr(0), value);
     }
 }
 
index 8c3562e..6d21d20 100644 (file)
@@ -141,7 +141,7 @@ void MediaQueryParser::commitMediaQuery()
     // FIXME-NEWPARSER: Convoluted and awful, but we can't change the MediaQuerySet yet because of the
     // old parser.
     static const NeverDestroyed<String> defaultMediaType { "all"_s };
-    MediaQuery mediaQuery { m_mediaQueryData.restrictor(), m_mediaQueryData.mediaType().value_or(defaultMediaType), WTFMove(m_mediaQueryData.expressions()) };
+    MediaQuery mediaQuery { m_mediaQueryData.restrictor(), m_mediaQueryData.mediaType().valueOr(defaultMediaType), WTFMove(m_mediaQueryData.expressions()) };
     m_mediaQueryData.clear();
     m_querySet->addMediaQuery(WTFMove(mediaQuery));
 }
index 6d5cddb..8a0ffe1 100644 (file)
@@ -423,7 +423,7 @@ public:
 #endif
 
     void setReferrerPolicy(ReferrerPolicy);
-    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy.value_or(ReferrerPolicy::NoReferrerWhenDowngrade); }
+    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy.valueOr(ReferrerPolicy::NoReferrerWhenDowngrade); }
 
     WEBCORE_EXPORT DocumentType* doctype() const;
 
index b26c41f..5ff302f 100644 (file)
@@ -657,7 +657,7 @@ void Element::setHovered(bool flag)
 // FIXME(webkit.org/b/161611): Take into account orientation/direction.
 inline ScrollAlignment toScrollAlignment(Optional<ScrollLogicalPosition> position, bool isVertical)
 {
-    switch (position.value_or(isVertical ? ScrollLogicalPosition::Start : ScrollLogicalPosition::Nearest)) {
+    switch (position.valueOr(isVertical ? ScrollLogicalPosition::Start : ScrollLogicalPosition::Nearest)) {
     case ScrollLogicalPosition::Start:
         return isVertical ? ScrollAlignment::alignTopAlways : ScrollAlignment::alignLeftAlways;
     case ScrollLogicalPosition::Center:
index ba27ad0..d1c87de 100644 (file)
@@ -82,7 +82,7 @@ bool EventTarget::addEventListener(const AtomicString& eventType, Ref<EventListe
     bool listenerCreatedFromScript = listener->type() == EventListener::JSEventListenerType && !listener->wasCreatedFromMarkup();
     auto listenerRef = listener.copyRef();
 
-    if (!ensureEventTargetData().eventListenerMap.add(eventType, WTFMove(listener), { options.capture, passive.value_or(false), options.once }))
+    if (!ensureEventTargetData().eventListenerMap.add(eventType, WTFMove(listener), { options.capture, passive.valueOr(false), options.once }))
         return false;
 
     if (listenerCreatedFromScript)
index 8462495..6f79a74 100644 (file)
@@ -85,9 +85,9 @@ ExceptionOr<void> MutationObserver::observe(Node& node, const Init& init)
         options |= ChildList;
     if (init.subtree)
         options |= Subtree;
-    if (init.attributeOldValue.value_or(false))
+    if (init.attributeOldValue.valueOr(false))
         options |= AttributeOldValue;
-    if (init.characterDataOldValue.value_or(false))
+    if (init.characterDataOldValue.valueOr(false))
         options |= CharacterDataOldValue;
 
     HashSet<AtomicString> attributeFilter;
index d431f72..da02cb2 100644 (file)
@@ -46,8 +46,8 @@ const String& FontChanges::platformFontFamilyNameForCSS() const
     RetainPtr<CFStringRef> fontNameFromDescription;
 
     FontDescription description;
-    description.setIsItalic(m_italic.value_or(false));
-    description.setWeight(FontSelectionValue { m_bold.value_or(false) ? 900 : 500 });
+    description.setIsItalic(m_italic.valueOr(false));
+    description.setWeight(FontSelectionValue { m_bold.valueOr(false) ? 900 : 500 });
     if (auto font = FontCache::singleton().fontForFamily(description, m_fontFamily))
         fontNameFromDescription = adoptCF(CTFontCopyPostScriptName(font->getCTFont()));
 
index fc0fa57..b73fcde 100644 (file)
@@ -81,7 +81,7 @@ static BlobPropertyBag convertPropertyBag(const File::PropertyBag& initialBag)
 File::File(Vector<BlobPartVariant>&& blobPartVariants, const String& filename, const PropertyBag& propertyBag)
     : Blob(WTFMove(blobPartVariants), convertPropertyBag(propertyBag))
     , m_name(filename)
-    , m_lastModifiedDateOverride(propertyBag.lastModified.value_or(WallTime::now().secondsSinceEpoch().milliseconds()))
+    , m_lastModifiedDateOverride(propertyBag.lastModified.valueOr(WallTime::now().secondsSinceEpoch().milliseconds()))
 {
 }
 
index cea1cd3..af00911 100644 (file)
@@ -141,7 +141,7 @@ ExceptionOr<bool> DOMTokenList::toggle(const AtomicString& token, Optional<bool>
     auto& tokens = this->tokens();
 
     if (tokens.contains(token)) {
-        if (!force.value_or(false)) {
+        if (!force.valueOr(false)) {
             tokens.removeFirst(token);
             updateAssociatedAttributeFromTokens();
             return false;
index 5f4d9ef..813f5e0 100644 (file)
@@ -32,7 +32,7 @@ public:
     static Ref<HTMLOListElement> create(Document&);
     static Ref<HTMLOListElement> create(const QualifiedName&, Document&);
 
-    int startForBindings() const { return m_start.value_or(1); }
+    int startForBindings() const { return m_start.valueOr(1); }
     WEBCORE_EXPORT void setStartForBindings(int);
 
     // FIXME: The reason start() does not trigger layout is because it is called
index 6b2ee18..9dbbb4f 100644 (file)
@@ -160,7 +160,7 @@ static ExceptionOr<IntRect> croppedSourceRectangleWithFormatting(IntSize inputSi
     //    Otherwise let sourceRectangle be a rectangle whose corners are the four points
     //    (0,0), (width of input, 0), (width of input, height of input), (0, height of
     //    input).
-    auto sourceRectangle = rect.value_or(IntRect { 0, 0, inputSize.width(), inputSize.height() });
+    auto sourceRectangle = rect.valueOr(IntRect { 0, 0, inputSize.width(), inputSize.height() });
 
     // 4. Clip sourceRectangle to the dimensions of input.
     sourceRectangle.intersect(IntRect { 0, 0, inputSize.width(), inputSize.height() });
index 9a9de9a..72ea1a8 100644 (file)
@@ -78,7 +78,7 @@ ExceptionOr<void> CanvasPattern::setTransform(DOMMatrix2DInit&& matrixInit)
     if (checkValid.hasException())
         return checkValid.releaseException();
 
-    m_pattern->setPatternSpaceTransform({ matrixInit.a.value_or(1), matrixInit.b.value_or(0), matrixInit.c.value_or(0), matrixInit.d.value_or(1), matrixInit.e.value_or(0), matrixInit.f.value_or(0) });
+    m_pattern->setPatternSpaceTransform({ matrixInit.a.valueOr(1), matrixInit.b.valueOr(0), matrixInit.c.valueOr(0), matrixInit.d.valueOr(1), matrixInit.e.valueOr(0), matrixInit.f.valueOr(0) });
     return { };
 }
 
index 2286d32..d426fac 100644 (file)
@@ -915,7 +915,7 @@ ExceptionOr<void> CanvasRenderingContext2DBase::setTransform(DOMMatrix2DInit&& m
     if (checkValid.hasException())
         return checkValid.releaseException();
 
-    setTransform(matrixInit.a.value_or(1), matrixInit.b.value_or(0), matrixInit.c.value_or(0), matrixInit.d.value_or(1), matrixInit.e.value_or(0), matrixInit.f.value_or(0));
+    setTransform(matrixInit.a.valueOr(1), matrixInit.b.valueOr(0), matrixInit.c.valueOr(0), matrixInit.d.valueOr(1), matrixInit.e.valueOr(0), matrixInit.f.valueOr(0));
     return { };
 }
 
@@ -1204,7 +1204,7 @@ bool CanvasRenderingContext2DBase::isPointInPathInternal(const Path& path, float
     if (!state().hasInvertibleTransform)
         return false;
 
-    auto transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
+    auto transformedPoint = state().transform.inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(x, y));
 
     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
         return false;
@@ -1220,7 +1220,7 @@ bool CanvasRenderingContext2DBase::isPointInStrokeInternal(const Path& path, flo
     if (!state().hasInvertibleTransform)
         return false;
 
-    auto transformedPoint = state().transform.inverse().value_or(AffineTransform()).mapPoint(FloatPoint(x, y));
+    auto transformedPoint = state().transform.inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(x, y));
     if (!std::isfinite(transformedPoint.x()) || !std::isfinite(transformedPoint.y()))
         return false;
 
index 215b7d3..385e9da 100644 (file)
@@ -42,7 +42,7 @@ ExceptionOr<void> Path2D::addPath(Path2D& path, DOMMatrix2DInit&& matrixInit)
     if (checkValid.hasException())
         return checkValid.releaseException();
 
-    m_path.addPath(path.path(), { matrixInit.a.value_or(1), matrixInit.b.value_or(0), matrixInit.c.value_or(0), matrixInit.d.value_or(1), matrixInit.e.value_or(0), matrixInit.f.value_or(0) });
+    m_path.addPath(path.path(), { matrixInit.a.valueOr(1), matrixInit.b.valueOr(0), matrixInit.c.valueOr(0), matrixInit.d.valueOr(1), matrixInit.e.valueOr(0), matrixInit.f.valueOr(0) });
     return { };
 }
 
index 9b68c4b..52b0bcb 100644 (file)
@@ -582,12 +582,12 @@ Ref<JSON::ArrayOf<JSON::Value>> InspectorCanvas::buildAction(const String& name,
             [&] (CanvasTextBaseline value) { addParameter(indexForData(convertEnumerationToString(value)), RecordingSwizzleTypes::String); },
             [&] (const DOMMatrix2DInit& value) {
                 auto array = JSON::ArrayOf<double>::create();
-                array->addItem(value.a.value_or(1));
-                array->addItem(value.b.value_or(0));
-                array->addItem(value.c.value_or(0));
-                array->addItem(value.d.value_or(1));
-                array->addItem(value.e.value_or(0));
-                array->addItem(value.f.value_or(0));
+                array->addItem(value.a.valueOr(1));
+                array->addItem(value.b.valueOr(0));
+                array->addItem(value.c.valueOr(0));
+                array->addItem(value.d.valueOr(1));
+                array->addItem(value.e.valueOr(0));
+                array->addItem(value.f.valueOr(0));
                 addParameter(array.ptr(), RecordingSwizzleTypes::DOMMatrix);
             },
             [&] (const Element*) {
index 874f384..c080a56 100644 (file)
@@ -373,7 +373,7 @@ static void populateContextMenu(Vector<InspectorFrontendHost::ContextMenuItem>&&
         }
 
         auto type = item.type == "checkbox" ? CheckableActionType : ActionType;
-        auto action = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + item.id.value_or(0));
+        auto action = static_cast<ContextMenuAction>(ContextMenuItemBaseCustomTag + item.id.valueOr(0));
         ContextMenuItem menuItem = { type, action, item.label };
         if (item.enabled)
             menuItem.setEnabled(*item.enabled);
index b3c5762..11efc46 100644 (file)
@@ -224,16 +224,16 @@ void FormattingContext::validateGeometryConstraintsAfterLayout() const
         if ((layoutBox.isBlockLevelBox() || layoutBox.isOutOfFlowPositioned()) && !layoutBox.replaced()) {
             // margin-left + border-left-width + padding-left + width + padding-right + border-right-width + margin-right = width of containing block
             auto containingBlockWidth = containingBlockDisplayBox.contentBoxWidth();
-            ASSERT(displayBox.marginStart() + displayBox.borderLeft() + displayBox.paddingLeft().value_or(0) + displayBox.contentBoxWidth()
-                + displayBox.paddingRight().value_or(0) + displayBox.borderRight() + displayBox.marginEnd() == containingBlockWidth);
+            ASSERT(displayBox.marginStart() + displayBox.borderLeft() + displayBox.paddingLeft().valueOr(0) + displayBox.contentBoxWidth()
+                + displayBox.paddingRight().valueOr(0) + displayBox.borderRight() + displayBox.marginEnd() == containingBlockWidth);
         }
 
         // 10.6.4 Absolutely positioned, non-replaced elements
         if (layoutBox.isOutOfFlowPositioned() && !layoutBox.replaced()) {
             // top + margin-top + border-top-width + padding-top + height + padding-bottom + border-bottom-width + margin-bottom + bottom = height of containing block
             auto containingBlockHeight = containingBlockDisplayBox.contentBoxHeight();
-            ASSERT(displayBox.top() + displayBox.marginBefore() + displayBox.borderTop() + displayBox.paddingTop().value_or(0) + displayBox.contentBoxHeight()
-                + displayBox.paddingBottom().value_or(0) + displayBox.borderBottom() + displayBox.marginAfter() == containingBlockHeight);
+            ASSERT(displayBox.top() + displayBox.marginBefore() + displayBox.borderTop() + displayBox.paddingTop().valueOr(0) + displayBox.contentBoxHeight()
+                + displayBox.paddingBottom().valueOr(0) + displayBox.borderBottom() + displayBox.marginAfter() == containingBlockHeight);
         }
     }
 }
index e03d83d..c339f97 100644 (file)
@@ -282,8 +282,8 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet
     auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
     auto marginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth);
     auto marginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth);
-    auto paddingTop = displayBox.paddingTop().value_or(0);
-    auto paddingBottom = displayBox.paddingBottom().value_or(0);
+    auto paddingTop = displayBox.paddingTop().valueOr(0);
+    auto paddingBottom = displayBox.paddingBottom().valueOr(0);
     auto borderTop = displayBox.borderTop();
     auto borderBottom = displayBox.borderBottom();
 
@@ -307,45 +307,45 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeomet
     if (!top && !height && bottom) {
         // #1
         height = contentHeightForFormattingContextRoot(layoutState, layoutBox);
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         top = containingBlockHeight - (*marginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *marginAfter + *bottom); 
     }
 
     if (!top && !bottom && height) {
         // #2
         top = staticVerticalPositionForOutOfFlowPositioned(layoutState, layoutBox);
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         bottom = containingBlockHeight - (*top + *marginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *marginAfter); 
     }
 
     if (!height && !bottom && top) {
         // #3
         height = contentHeightForFormattingContextRoot(layoutState, layoutBox);
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         bottom = containingBlockHeight - (*top + *marginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *marginAfter); 
     }
 
     if (!top && height && bottom) {
         // #4
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         top = containingBlockHeight - (*marginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *marginAfter + *bottom); 
     }
 
     if (!height && top && bottom) {
         // #5
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         height = containingBlockHeight - (*top + *marginBefore + borderTop + paddingTop + paddingBottom + borderBottom + *marginAfter + *bottom); 
     }
 
     if (!bottom && top && height) {
         // #6
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
         bottom = containingBlockHeight - (*top + *marginBefore + borderTop + paddingTop + *height + paddingBottom + borderBottom + *marginAfter); 
     }
 
@@ -400,10 +400,10 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe
     auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
     auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth);
     auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth);
-    auto nonComputedMarginStart = marginStart.value_or(0);
-    auto nonComputedMarginEnd = marginEnd.value_or(0);
-    auto paddingLeft = displayBox.paddingLeft().value_or(0);
-    auto paddingRight = displayBox.paddingRight().value_or(0);
+    auto nonComputedMarginStart = marginStart.valueOr(0);
+    auto nonComputedMarginEnd = marginEnd.valueOr(0);
+    auto paddingLeft = displayBox.paddingLeft().valueOr(0);
+    auto paddingRight = displayBox.paddingRight().valueOr(0);
     auto borderLeft = displayBox.borderLeft();
     auto borderRight = displayBox.borderRight();
 
@@ -411,8 +411,8 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe
         // If all three of 'left', 'width', and 'right' are 'auto': First set any 'auto' values for 'margin-left' and 'margin-right' to 0.
         // Then, if the 'direction' property of the element establishing the static-position containing block is 'ltr' set 'left' to the static
         // position and apply rule number three below; otherwise, set 'right' to the static position and apply rule number one below.
-        marginStart = marginStart.value_or(0);
-        marginEnd = marginEnd.value_or(0);
+        marginStart = marginStart.valueOr(0);
+        marginEnd = marginEnd.valueOr(0);
 
         auto staticHorizontalPosition = staticHorizontalPositionForOutOfFlowPositioned(layoutState, layoutBox);
         if (isLeftToRightDirection)
@@ -459,8 +459,8 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGe
         }
     } else {
         // Otherwise, set 'auto' values for 'margin-left' and 'margin-right' to 0, and pick the one of the following six rules that applies.
-        marginStart = marginStart.value_or(0);
-        marginEnd = marginEnd.value_or(0);
+        marginStart = marginStart.valueOr(0);
+        marginEnd = marginEnd.valueOr(0);
     }
 
     ASSERT(marginStart);
@@ -530,8 +530,8 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(
     auto height = inlineReplacedHeightAndMargin(layoutState, layoutBox, usedHeight).height;
     auto marginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth);
     auto marginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth);
-    auto paddingTop = displayBox.paddingTop().value_or(0);
-    auto paddingBottom = displayBox.paddingBottom().value_or(0);
+    auto paddingTop = displayBox.paddingTop().valueOr(0);
+    auto paddingBottom = displayBox.paddingBottom().valueOr(0);
     auto borderTop = displayBox.borderTop();
     auto borderBottom = displayBox.borderBottom();
 
@@ -542,8 +542,8 @@ VerticalGeometry FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry(
 
     if (!bottom) {
         // #2
-        marginBefore = marginBefore.value_or(0);
-        marginAfter = marginAfter.value_or(0);
+        marginBefore = marginBefore.valueOr(0);
+        marginAfter = marginAfter.valueOr(0);
     }
 
     if (!marginBefore && !marginAfter) {
@@ -602,11 +602,11 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome
     auto right = computedValueIfNotAuto(style.logicalRight(), containingBlockWidth);
     auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth);
     auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth);
-    auto nonComputedMarginStart = marginStart.value_or(0);
-    auto nonComputedMarginEnd = marginEnd.value_or(0);
+    auto nonComputedMarginStart = marginStart.valueOr(0);
+    auto nonComputedMarginEnd = marginEnd.valueOr(0);
     auto width = inlineReplacedWidthAndMargin(layoutState, layoutBox, usedWidth).width;
-    auto paddingLeft = displayBox.paddingLeft().value_or(0);
-    auto paddingRight = displayBox.paddingRight().value_or(0);
+    auto paddingLeft = displayBox.paddingLeft().valueOr(0);
+    auto paddingRight = displayBox.paddingRight().valueOr(0);
     auto borderLeft = displayBox.borderLeft();
     auto borderRight = displayBox.borderRight();
 
@@ -621,8 +621,8 @@ HorizontalGeometry FormattingContext::Geometry::outOfFlowReplacedHorizontalGeome
 
     if (!left || !right) {
         // #2
-        marginStart = marginStart.value_or(0); 
-        marginEnd = marginEnd.value_or(0); 
+        marginStart = marginStart.valueOr(0); 
+        marginEnd = marginEnd.valueOr(0); 
     }
 
     if (!marginStart && !marginEnd) {
@@ -697,8 +697,8 @@ HeightAndMargin FormattingContext::Geometry::complicatedCases(const LayoutState&
     auto marginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth);
 
     // #1
-    marginBefore = marginBefore.value_or(0);
-    marginAfter = marginAfter.value_or(0);
+    marginBefore = marginBefore.valueOr(0);
+    marginAfter = marginAfter.valueOr(0);
     // #2
     if (!height) {
         ASSERT(isHeightAuto(layoutBox));
@@ -873,14 +873,14 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L
         if (precomputedMarginEnd)
             return precomputedMarginEnd.value();
         auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth);
-        return marginEnd.value_or(0_lu);
+        return marginEnd.valueOr(0_lu);
     };
 
     auto computeMarginStart = [&]() {
         if (precomputedMarginStart)
             return precomputedMarginStart.value();
         auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth);
-        return marginStart.value_or(0_lu);
+        return marginStart.valueOr(0_lu);
     };
 
     auto replaced = layoutBox.replaced();
@@ -888,8 +888,8 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L
 
     auto marginStart = computeMarginStart();
     auto marginEnd = computeMarginEnd();
-    auto nonComputedMarginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth).value_or(0);
-    auto nonComputedMarginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth).value_or(0);
+    auto nonComputedMarginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth).valueOr(0);
+    auto nonComputedMarginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth).valueOr(0);
     auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
 
     auto heightIsAuto = isHeightAuto(layoutBox);
@@ -901,7 +901,7 @@ WidthAndMargin FormattingContext::Geometry::inlineReplacedWidthAndMargin(const L
     } else if ((!width && heightIsAuto && !replaced->hasIntrinsicWidth() && replaced->hasIntrinsicHeight() && replaced->hasIntrinsicRatio())
         || (!width && height && replaced->hasIntrinsicRatio())) {
         // #2
-        width = height.value_or(replaced->hasIntrinsicHeight()) * replaced->intrinsicRatio();
+        width = height.valueOr(replaced->hasIntrinsicHeight()) * replaced->intrinsicRatio();
     } else if (!width && heightIsAuto && replaced->hasIntrinsicRatio() && !replaced->hasIntrinsicWidth() && !replaced->hasIntrinsicHeight()) {
         // #3
         // FIXME: undefined but surely doable.
@@ -990,7 +990,7 @@ LayoutSize FormattingContext::Geometry::inFlowPositionedPositionOffset(const Lay
     ASSERT(!left || *left == -*right);
 
     auto topPositionOffset = *top;
-    auto leftPositionOffset = left.value_or(-*right);
+    auto leftPositionOffset = left.valueOr(-*right);
 
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Position] -> positioned inflow -> top offset(" << topPositionOffset << "px) left offset(" << leftPositionOffset << "px) layoutBox(" << &layoutBox << ")");
     return { leftPositionOffset, topPositionOffset };
@@ -1025,8 +1025,8 @@ HorizontalMargin FormattingContext::Geometry::computedNonCollapsedHorizontalMarg
     auto& style = layoutBox.style();
     auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth();
 
-    auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth).value_or(0_lu);
-    auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth).value_or(0_lu);
+    auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth).valueOr(0_lu);
+    auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth).valueOr(0_lu);
 
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Margin] -> non collapsed horizontal -> margin(" << marginStart << "px, " << marginEnd << "px) -> layoutBox: " << &layoutBox);
     return { marginStart, marginEnd };
@@ -1037,8 +1037,8 @@ VerticalMargin::ComputedValues FormattingContext::Geometry::computedNonCollapsed
     auto& style = layoutBox.style();
     auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth();
 
-    auto marginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).value_or(0_lu);
-    auto marginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).value_or(0_lu);
+    auto marginBefore = computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).valueOr(0_lu);
+    auto marginAfter = computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).valueOr(0_lu);
 
     LOG_WITH_STREAM(FormattingContextLayout, stream << "[Margin] -> non collapsed vertical -> margin(" << marginBefore << "px, " << marginAfter << "px) -> layoutBox: " << &layoutBox);
     return { marginBefore, marginAfter };
index d10abe2..b4f44a8 100644 (file)
@@ -52,7 +52,7 @@ LayoutUnit FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFix
             auto& displayBox = layoutState.displayBoxForLayoutBox(*containingBlock);
 
             auto verticalMargin = FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue(layoutState, *containingBlock);
-            auto verticalPadding = displayBox.paddingTop().value_or(0) + displayBox.paddingBottom().value_or(0);
+            auto verticalPadding = displayBox.paddingTop().valueOr(0) + displayBox.paddingBottom().valueOr(0);
             auto verticalBorder = displayBox.borderTop() + displayBox.borderBottom();
             bodyAndDocumentVerticalMarginPaddingAndBorder += verticalMargin.before + verticalMargin.after + verticalPadding + verticalBorder;
         }
index fe68f29..85ffed6 100644 (file)
@@ -80,8 +80,8 @@ inline VerticalMargin::ComputedValues VerticalMargin::usedValues() const
 {
     if (!m_collapsed)
         return m_nonCollapsed;
-    return { m_collapsed->before.value_or(m_nonCollapsed.before),
-        m_collapsed->after.value_or(m_nonCollapsed.after) };
+    return { m_collapsed->before.valueOr(m_nonCollapsed.before),
+        m_collapsed->after.valueOr(m_nonCollapsed.after) };
 }
 
 }
index 56fab55..ee43872 100644 (file)
@@ -61,10 +61,10 @@ HeightAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMarg
         auto containingBlockWidth = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).contentBoxWidth();
         auto& displayBox = layoutState.displayBoxForLayoutBox(layoutBox);
 
-        auto nonCollapsedMargin = VerticalMargin::ComputedValues { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).value_or(0),
-            computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).value_or(0) }; 
+        auto nonCollapsedMargin = VerticalMargin::ComputedValues { computedValueIfNotAuto(style.marginBefore(), containingBlockWidth).valueOr(0),
+            computedValueIfNotAuto(style.marginAfter(), containingBlockWidth).valueOr(0) }; 
         auto collapsedMargin = VerticalMargin::CollapsedValues { MarginCollapse::marginBefore(layoutState, layoutBox), MarginCollapse::marginAfter(layoutState, layoutBox) };
-        auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().value_or(0);
+        auto borderAndPaddingTop = displayBox.borderTop() + displayBox.paddingTop().valueOr(0);
 
         auto height = usedHeight ? usedHeight.value() : computedHeightValue(layoutState, layoutBox, HeightType::Normal);
         if (height)
@@ -143,19 +143,19 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin
         auto width = computedValueIfNotAuto(usedWidth ? Length { usedWidth.value(), Fixed } : style.logicalWidth(), containingBlockWidth);
         auto marginStart = computedValueIfNotAuto(style.marginStart(), containingBlockWidth);
         auto marginEnd = computedValueIfNotAuto(style.marginEnd(), containingBlockWidth);
-        auto nonComputedMarginStart = marginStart.value_or(0);
-        auto nonComputedMarginEnd = marginEnd.value_or(0);
+        auto nonComputedMarginStart = marginStart.valueOr(0);
+        auto nonComputedMarginEnd = marginEnd.valueOr(0);
         auto borderLeft = displayBox.borderLeft();
         auto borderRight = displayBox.borderRight();
-        auto paddingLeft = displayBox.paddingLeft().value_or(0);
-        auto paddingRight = displayBox.paddingRight().value_or(0);
+        auto paddingLeft = displayBox.paddingLeft().valueOr(0);
+        auto paddingRight = displayBox.paddingRight().valueOr(0);
 
         // #1
         if (width) {
-            auto horizontalSpaceForMargin = containingBlockWidth - (marginStart.value_or(0) + borderLeft + paddingLeft + *width + paddingRight + borderRight + marginEnd.value_or(0));
+            auto horizontalSpaceForMargin = containingBlockWidth - (marginStart.valueOr(0) + borderLeft + paddingLeft + *width + paddingRight + borderRight + marginEnd.valueOr(0));
             if (horizontalSpaceForMargin < 0) {
-                marginStart = marginStart.value_or(0);
-                marginEnd = marginEnd.value_or(0);
+                marginStart = marginStart.valueOr(0);
+                marginEnd = marginEnd.valueOr(0);
             }
         }
 
@@ -177,8 +177,8 @@ WidthAndMargin BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin
 
         // #4
         if (!width) {
-            marginStart = marginStart.value_or(0);
-            marginEnd = marginEnd.value_or(0);
+            marginStart = marginStart.valueOr(0);
+            marginEnd = marginEnd.valueOr(0);
             width = containingBlockWidth - (*marginStart + borderLeft + paddingLeft + paddingRight + borderRight + *marginEnd);
         }
 
@@ -308,12 +308,12 @@ FormattingContext::InstrinsicWidthConstraints BlockFormattingContext::Geometry::
         ASSERT(childInstrinsicWidthConstraints);
         
         auto& style = child.style();
-        auto horizontalMarginBorderAndPadding = fixedValue(style.marginStart()).value_or(0)
+        auto horizontalMarginBorderAndPadding = fixedValue(style.marginStart()).valueOr(0)
             + LayoutUnit { style.borderLeftWidth() }
-            + fixedValue(style.paddingLeft()).value_or(0)
-            + fixedValue(style.paddingRight()).value_or(0)
+            + fixedValue(style.paddingLeft()).valueOr(0)
+            + fixedValue(style.paddingRight()).valueOr(0)
             + LayoutUnit { style.borderRightWidth() }
-            + fixedValue(style.marginEnd()).value_or(0);
+            + fixedValue(style.marginEnd()).valueOr(0);
 
         minimumIntrinsicWidth = std::max(minimumIntrinsicWidth, childInstrinsicWidthConstraints->minimum + horizontalMarginBorderAndPadding); 
         maximumIntrinsicWidth = std::max(maximumIntrinsicWidth, childInstrinsicWidthConstraints->maximum + horizontalMarginBorderAndPadding); 
index fb71b7c..4606f9d 100644 (file)
@@ -73,7 +73,7 @@ HeightAndMargin BlockFormattingContext::Quirks::stretchedHeight(const LayoutStat
     auto& documentBox = layoutBox.isDocumentBox() ? layoutBox : *layoutBox.parent();
     auto& documentBoxDisplayBox = layoutState.displayBoxForLayoutBox(documentBox);
     auto documentBoxVerticalBorders = documentBoxDisplayBox.borderTop() + documentBoxDisplayBox.borderBottom();
-    auto documentBoxVerticalPaddings = documentBoxDisplayBox.paddingTop().value_or(0) + documentBoxDisplayBox.paddingBottom().value_or(0);
+    auto documentBoxVerticalPaddings = documentBoxDisplayBox.paddingTop().valueOr(0) + documentBoxDisplayBox.paddingBottom().valueOr(0);
 
     auto strechedHeight = layoutState.displayBoxForLayoutBox(initialContainingBlock(layoutBox)).contentBoxHeight();
     strechedHeight -= documentBoxVerticalBorders + documentBoxVerticalPaddings;
index fde094b..56392f4 100644 (file)
@@ -133,8 +133,8 @@ public:
     LayoutPoint bottomRight() const { return { right(), bottom() }; }
 
     LayoutSize size() const { return { width(), height() }; }
-    LayoutUnit width() const { return borderLeft() + paddingLeft().value_or(0) + contentBoxWidth() + paddingRight().value_or(0) + borderRight(); }
-    LayoutUnit height() const { return borderTop() + paddingTop().value_or(0) + contentBoxHeight() + paddingBottom().value_or(0) + borderBottom(); }
+    LayoutUnit width() const { return borderLeft() + paddingLeft().valueOr(0) + contentBoxWidth() + paddingRight().valueOr(0) + borderRight(); }
+    LayoutUnit height() const { return borderTop() + paddingTop().valueOr(0) + contentBoxHeight() + paddingBottom().valueOr(0) + borderBottom(); }
     Rect rect() const { return { top(), left(), width(), height() }; }
     Rect rectWithMargin() const { return { top() - marginBefore(), left() - marginStart(), marginStart() + width() + marginEnd(), marginBefore() + height() + marginAfter() }; }
 
@@ -161,8 +161,8 @@ public:
     Optional<LayoutUnit> paddingBottom() const;
     Optional<LayoutUnit> paddingRight() const;
 
-    LayoutUnit contentBoxTop() const { return borderTop() + paddingTop().value_or(0); }
-    LayoutUnit contentBoxLeft() const { return borderLeft() + paddingLeft().value_or(0); }
+    LayoutUnit contentBoxTop() const { return borderTop() + paddingTop().valueOr(0); }
+    LayoutUnit contentBoxLeft() const { return borderLeft() + paddingLeft().valueOr(0); }
     LayoutUnit contentBoxBottom() const { return contentBoxTop() + contentBoxHeight(); }
     LayoutUnit contentBoxRight() const { return contentBoxLeft() + contentBoxWidth(); }
     LayoutUnit contentBoxHeight() const;
index d9dc8e6..71fc060 100644 (file)
@@ -464,7 +464,7 @@ void Iterator::set(PositionInContextRoot verticalPosition)
 
         auto index = floatingType == Float::Left ? m_current.m_leftIndex : m_current.m_rightIndex;
         // Start from the end if we don't have current yet.
-        index = index.value_or(m_floats.size());
+        index = index.valueOr(m_floats.size());
         while (true) {
             index = previousFloatingIndex(floatingType, m_floats, *index);
             if (!index)
index 6f86264..e21b874 100644 (file)
@@ -264,7 +264,7 @@ void InlineFormattingContext::appendContentToLine(Line& line, const InlineRunPro
     line.appendContent(run, runSize);
 
     if (root().style().textAlign() == TextAlignMode::Justify)
-        Geometry::computeExpansionOpportunities(line, run, lastRunType.value_or(InlineRunProvider::Run::Type::NonWhitespace));
+        Geometry::computeExpansionOpportunities(line, run, lastRunType.valueOr(InlineRunProvider::Run::Type::NonWhitespace));
 }
 
 void InlineFormattingContext::layoutInlineContent(const InlineRunProvider& inlineRunProvider) const
@@ -415,7 +415,7 @@ void InlineFormattingContext::placeInFlowPositionedChildren(unsigned fistRunInde
             for (auto* box = &layoutBox; box != &root(); box = box->parent()) {
                 if (!box->isInFlowPositioned())
                     continue;
-                offset = offset.value_or(LayoutSize()) + Geometry::inFlowPositionedPositionOffset(layoutState(), *box);
+                offset = offset.valueOr(LayoutSize()) + Geometry::inFlowPositionedPositionOffset(layoutState(), *box);
             }
             return offset;
         };
index 6a354aa..2db0ecc 100644 (file)
@@ -384,7 +384,7 @@ void FrameLoader::urlSelected(const URL& url, const String& passedTarget, Event*
     auto* frame = lexicalFrameFromCommonVM();
     auto initiatedByMainFrame = frame && frame->isMainFrame() ? InitiatedByMainFrame::Yes : InitiatedByMainFrame::Unknown;
 
-    NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.value_or(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
+    NewFrameOpenerPolicy newFrameOpenerPolicy = openerPolicy.valueOr(shouldSendReferrer == NeverSendReferrer ? NewFrameOpenerPolicy::Suppress : NewFrameOpenerPolicy::Allow);
     urlSelected(FrameLoadRequest(*m_frame.document(), m_frame.document()->securityOrigin(), { url }, passedTarget, lockHistory, lockBackForwardList, shouldSendReferrer, AllowNavigationToInvalidURL::Yes, newFrameOpenerPolicy, shouldOpenExternalURLsPolicy, initiatedByMainFrame, DoNotReplaceDocumentIfJavaScriptURL, downloadAttribute, systemPreviewInfo), triggeringEvent);
 }
 
index ba15799..54544d6 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 NavigationAction::Requester::Requester(const Document& document)
     : m_url { URL { document.url() } }
     , m_origin { makeRefPtr(document.securityOrigin()) }
-    , m_pageIDAndFrameIDPair { document.frame() ? std::make_pair(document.frame()->loader().client().pageID().value_or(0), document.frame()->loader().client().frameID().value_or(0)) : std::make_pair<uint64_t, uint64_t>(0, 0) }
+    , m_pageIDAndFrameIDPair { document.frame() ? std::make_pair(document.frame()->loader().client().pageID().valueOr(0), document.frame()->loader().client().frameID().valueOr(0)) : std::make_pair<uint64_t, uint64_t>(0, 0) }
 {
 }
 
index 4542f0b..a7e0a5e 100644 (file)
@@ -1671,7 +1671,7 @@ void FrameView::setLayoutViewportOverrideRect(Optional<LayoutRect> rect, Trigger
     if (oldRect.height() != layoutViewportRect().height())
         layoutTriggering = TriggerLayoutOrNot::Yes;
 
-    LOG_WITH_STREAM(Scrolling, stream << "\nFrameView " << this << " setLayoutViewportOverrideRect() - changing override layout viewport from " << oldRect << " to " << m_layoutViewportOverrideRect.value_or(LayoutRect()) << " layoutTriggering " << (layoutTriggering == TriggerLayoutOrNot::Yes ? "yes" : "no"));
+    LOG_WITH_STREAM(Scrolling, stream << "\nFrameView " << this << " setLayoutViewportOverrideRect() - changing override layout viewport from " << oldRect << " to " << m_layoutViewportOverrideRect.valueOr(LayoutRect()) << " layoutTriggering " << (layoutTriggering == TriggerLayoutOrNot::Yes ? "yes" : "no"));
 
     if (oldRect != layoutViewportRect() && layoutTriggering == TriggerLayoutOrNot::Yes)
         setViewportConstrainedObjectsNeedLayout();
@@ -4823,7 +4823,7 @@ IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const
 float FrameView::documentToAbsoluteScaleFactor(Optional<float> effectiveZoom) const
 {
     // If effectiveZoom is passed, it already factors in pageZoomFactor(). 
-    return effectiveZoom.value_or(frame().pageZoomFactor()) * frame().frameScaleFactor();
+    return effectiveZoom.valueOr(frame().pageZoomFactor()) * frame().frameScaleFactor();
 }
 
 float FrameView::absoluteToDocumentScaleFactor(Optional<float> effectiveZoom) const
@@ -5370,16 +5370,16 @@ IntSize FrameView::viewportSizeForCSSViewportUnits() const
 
     if (useFixedLayout()) {
         auto fixedLayoutSize = this->fixedLayoutSize();
-        viewportSize.width = viewportSize.width.value_or(fixedLayoutSize.width());
-        viewportSize.height = viewportSize.height.value_or(fixedLayoutSize.height());
+        viewportSize.width = viewportSize.width.valueOr(fixedLayoutSize.width());
+        viewportSize.height = viewportSize.height.valueOr(fixedLayoutSize.height());
         return { *viewportSize.width, *viewportSize.height };
     }
     
     // FIXME: the value returned should take into account the value of the overflow
     // property on the root element.
     auto visibleContentSizeIncludingScrollbars = visibleContentRectIncludingScrollbars().size();
-    viewportSize.width = viewportSize.width.value_or(visibleContentSizeIncludingScrollbars.width());
-    viewportSize.height = viewportSize.height.value_or(visibleContentSizeIncludingScrollbars.height());
+    viewportSize.width = viewportSize.width.valueOr(visibleContentSizeIncludingScrollbars.width());
+    viewportSize.height = viewportSize.height.valueOr(visibleContentSizeIncludingScrollbars.height());
     return { *viewportSize.width, *viewportSize.height };
 }
 
index e7251ee..63d6e94 100644 (file)
@@ -1128,7 +1128,7 @@ bool Page::isLowPowerModeEnabled() const
 void Page::setLowPowerModeEnabledOverrideForTesting(Optional<bool> isEnabled)
 {
     m_lowPowerModeEnabledOverrideForTesting = isEnabled;
-    handleLowModePowerChange(m_lowPowerModeEnabledOverrideForTesting.value_or(false));
+    handleLowModePowerChange(m_lowPowerModeEnabledOverrideForTesting.valueOr(false));
 }
 
 void Page::setTopContentInset(float contentInset)
index 1236442..05f8b19 100644 (file)
@@ -80,7 +80,7 @@ String SecurityOriginData::databaseIdentifier() const
     stringBuilder.append(separatorCharacter);
     stringBuilder.append(FileSystem::encodeForFileName(host));
     stringBuilder.append(separatorCharacter);
-    stringBuilder.appendNumber(port.value_or(0));
+    stringBuilder.appendNumber(port.valueOr(0));
     
     return stringBuilder.toString();
 }
index 5925102..244371e 100644 (file)
@@ -134,7 +134,7 @@ struct SecurityOriginDataHash {
         unsigned hashCodes[3] = {
             data.protocol.impl() ? data.protocol.impl()->hash() : 0,
             data.host.impl() ? data.host.impl()->hash() : 0,
-            data.port.value_or(0)
+            data.port.valueOr(0)
         };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
index e0148a2..f9a52fa 100644 (file)
@@ -40,7 +40,7 @@ struct SecurityOriginHash {
         unsigned hashCodes[3] = {
             origin->protocol().impl() ? origin->protocol().impl()->hash() : 0,
             origin->host().impl() ? origin->host().impl()->hash() : 0,
-            origin->port().value_or(0)
+            origin->port().valueOr(0)
         };
         return StringHasher::hashMemory<sizeof(hashCodes)>(hashCodes);
     }
index 1d36b8e..ca9cd96 100644 (file)
@@ -116,8 +116,8 @@ bool ViewportConfiguration::setContentsSize(const IntSize& contentSize)
 
 bool ViewportConfiguration::setViewLayoutSize(const FloatSize& viewLayoutSize, Optional<double>&& scaleFactor, Optional<double>&& minimumEffectiveDeviceWidth)
 {
-    double newScaleFactor = scaleFactor.value_or(m_layoutSizeScaleFactor);
-    double newEffectiveWidth = minimumEffectiveDeviceWidth.value_or(m_minimumEffectiveDeviceWidth);
+    double newScaleFactor = scaleFactor.valueOr(m_layoutSizeScaleFactor);
+    double newEffectiveWidth = minimumEffectiveDeviceWidth.valueOr(m_minimumEffectiveDeviceWidth);
     if (m_viewLayoutSize == viewLayoutSize && m_layoutSizeScaleFactor == newScaleFactor && newEffectiveWidth == m_minimumEffectiveDeviceWidth)
         return false;
 
index 1dbbd56..078f897 100644 (file)
@@ -182,8 +182,8 @@ WindowFeatures parseDialogFeatures(const String& dialogFeaturesString, const Flo
     features.locationBarVisible = false;
     features.dialog = true;
 
-    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
+    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
 
     features.width = width;
     features.height = height;
@@ -191,16 +191,16 @@ WindowFeatures parseDialogFeatures(const String& dialogFeaturesString, const Flo
     features.x = floatFeature(featuresMap, "dialogleft", screenAvailableRect.x(), screenAvailableRect.maxX() - width);
     features.y = floatFeature(featuresMap, "dialogtop", screenAvailableRect.y(), screenAvailableRect.maxY() - height);
 
-    if (boolFeature(featuresMap, "center").value_or(true)) {
+    if (boolFeature(featuresMap, "center").valueOr(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").value_or(false);
-    features.scrollbarsVisible = boolFeature(featuresMap, "scroll").value_or(true);
-    features.statusBarVisible = boolFeature(featuresMap, "status").value_or(false);
+    features.resizable = boolFeature(featuresMap, "resizable").valueOr(false);
+    features.scrollbarsVisible = boolFeature(featuresMap, "scroll").valueOr(true);
+    features.statusBarVisible = boolFeature(featuresMap, "status").valueOr(false);
 
     return features;
 }
index 90be984..3a74f96 100644 (file)
@@ -207,7 +207,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
     if (input == AnimationStateInput::ResumeOverride) {
         if (m_animationState == AnimationState::Looping || m_animationState == AnimationState::Ending) {
             // Start the animation
-            startAnimation(beginAnimationUpdateTime() - m_startTime.value_or(0));
+            startAnimation(beginAnimationUpdateTime() - m_startTime.valueOr(0));
         }
         return;
     }
@@ -313,7 +313,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
                 // We are pausing while waiting for a start response. Cancel the animation and wait. When 
                 // we unpause, we will act as though the start timer just fired
                 m_pauseTime = beginAnimationUpdateTime();
-                pauseAnimation(beginAnimationUpdateTime() - m_startTime.value_or(0));
+                pauseAnimation(beginAnimationUpdateTime() - m_startTime.valueOr(0));
                 LOG(Animations, "%p AnimationState %s -> PausedWaitResponse", this, nameForState(m_animationState));
                 m_animationState = AnimationState::PausedWaitResponse;
             }
@@ -333,7 +333,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
             } else {
                 // We are pausing while running. Cancel the animation and wait
                 m_pauseTime = beginAnimationUpdateTime();
-                pauseAnimation(beginAnimationUpdateTime() - m_startTime.value_or(0));
+                pauseAnimation(beginAnimationUpdateTime() - m_startTime.valueOr(0));
                 LOG(Animations, "%p AnimationState %s -> PausedRun", this, nameForState(m_animationState));
                 m_animationState = AnimationState::PausedRun;
             }
@@ -365,7 +365,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
             } else {
                 // We are pausing while running. Cancel the animation and wait
                 m_pauseTime = beginAnimationUpdateTime();
-                pauseAnimation(beginAnimationUpdateTime() - m_startTime.value_or(0));
+                pauseAnimation(beginAnimationUpdateTime() - m_startTime.valueOr(0));
                 LOG(Animations, "%p AnimationState %s -> PausedRun", this, nameForState(m_animationState));
                 m_animationState = AnimationState::PausedRun;
             }
@@ -375,7 +375,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
             ASSERT(input == AnimationStateInput::PlayStateRunning);
             ASSERT(paused());
             // Update the times
-            m_startTime = m_startTime.value_or(0) + beginAnimationUpdateTime() - m_pauseTime.value_or(0);
+            m_startTime = m_startTime.valueOr(0) + beginAnimationUpdateTime() - m_pauseTime.valueOr(0);
             m_pauseTime = WTF::nullopt;
 
             // we were waiting for the start timer to fire, go back and wait again
@@ -407,7 +407,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
 
                 // Update the times
                 if (m_animationState == AnimationState::PausedRun)
-                    m_startTime = m_startTime.value_or(0) + beginAnimationUpdateTime() - m_pauseTime.value_or(0);
+                    m_startTime = m_startTime.valueOr(0) + beginAnimationUpdateTime() - m_pauseTime.valueOr(0);
                 else
                     m_startTime = 0;
 
@@ -430,7 +430,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
                         updateStateMachine(AnimationStateInput::StartTimeSet, beginAnimationUpdateTime());
                         m_isAccelerated = true;
                     } else {
-                        bool started = startAnimation(beginAnimationUpdateTime() - m_startTime.value_or(0));
+                        bool started = startAnimation(beginAnimationUpdateTime() - m_startTime.valueOr(0));
                         m_compositeAnimation->animationController().addToAnimationsWaitingForStartTimeResponse(this, started);
                         m_isAccelerated = started;
                     }
@@ -447,7 +447,7 @@ void AnimationBase::updateStateMachine(AnimationStateInput input, double param)
                 m_animationState = AnimationState::PausedRun;
                 ASSERT(!m_startTime);
                 m_startTime = param;
-                m_pauseTime = m_pauseTime.value_or(0) + param;
+                m_pauseTime = m_pauseTime.valueOr(0) + param;
                 break;
             }
 
@@ -494,7 +494,7 @@ void AnimationBase::fireAnimationEventsIfNeeded()
         return;
     }
 
-    double elapsedDuration = beginAnimationUpdateTime() - m_startTime.value_or(0);
+    double elapsedDuration = beginAnimationUpdateTime() - m_startTime.valueOr(0);
 
     // FIXME: we need to ensure that elapsedDuration is never < 0. If it is, this suggests that
     // we had a recalcStyle() outside of beginAnimationUpdate()/endAnimationUpdate().
@@ -631,9 +631,9 @@ double AnimationBase::progress(double scale, double offset, const TimingFunction
 void AnimationBase::getTimeToNextEvent(Seconds& time, bool& isLooping) const
 {
     // Decide when the end or loop event needs to fire
-    const double elapsedDuration = std::max(beginAnimationUpdateTime() - m_startTime.value_or(0), 0.0);
+    const double elapsedDuration = std::max(beginAnimationUpdateTime() - m_startTime.valueOr(0), 0.0);
     double durationLeft = 0;
-    double nextIterationTime = m_totalDuration.value_or(0);
+    double nextIterationTime = m_totalDuration.valueOr(0);
 
     if (!m_totalDuration || elapsedDuration < m_totalDuration.value()) {
         durationLeft = m_animation->duration() > 0 ? (m_animation->duration() - fmod(elapsedDuration, m_animation->duration())) : 0;
@@ -675,9 +675,9 @@ void AnimationBase::freezeAtTime(double t)
 
     ASSERT(m_startTime); // If m_startTime is zero, we haven't started yet, so we'll get a bad pause time.
     if (t <= m_animation->delay())
-        m_pauseTime = m_startTime.value_or(0);
+        m_pauseTime = m_startTime.valueOr(0);
     else
-        m_pauseTime = m_startTime.value_or(0) + t - m_animation->delay();
+        m_pauseTime = m_startTime.valueOr(0) + t - m_animation->delay();
 
     if (auto* renderer = compositedRenderer())
         renderer->suspendAnimations(MonotonicTime::fromRawSeconds(m_pauseTime.value()));
@@ -695,16 +695,16 @@ double AnimationBase::getElapsedTime() const
 {
     if (paused()) {
         double delayOffset = (!m_startTime && m_animation->delay() < 0) ? m_animation->delay() : 0;
-        return m_pauseTime.value_or(0) - m_startTime.value_or(0) - delayOffset;
+        return m_pauseTime.valueOr(0) - m_startTime.valueOr(0) - delayOffset;
     }
 
     if (!m_startTime)
         return 0;
 
     if (postActive() || fillingForwards())
-        return m_totalDuration.value_or(0);
+        return m_totalDuration.valueOr(0);
 
-    return beginAnimationUpdateTime() - m_startTime.value_or(0);
+    return beginAnimationUpdateTime() - m_startTime.valueOr(0);
 }
 
 void AnimationBase::setElapsedTime(double time)
index 250e6d6..dc1ceab 100644 (file)
@@ -178,7 +178,7 @@ void CSSAnimationControllerPrivate::updateAnimationTimer(SetChanged callSetChang
 {
     Optional<Seconds> timeToNextService = updateAnimations(callSetChanged);
 
-    LOG(Animations, "updateAnimationTimer: timeToNextService is %.2f", timeToNextService.value_or(Seconds { -1 }).value());
+    LOG(Animations, "updateAnimationTimer: timeToNextService is %.2f", timeToNextService.valueOr(Seconds { -1 }).value());
 
     // If we don't need service, we want to make sure the timer is no longer running
     if (!timeToNextService) {
index efd836a..698fb8d 100644 (file)
@@ -249,8 +249,8 @@ void ResourceUsageThread::platformThreadBody(JSC::VM* vm, ResourceUsageData& dat
     data.totalExternalSize = currentGCOwnedExternal;
 
     auto now = MonotonicTime::now();
-    data.timeOfNextEdenCollection = now + vm->heap.edenActivityCallback()->timeUntilFire().value_or(Seconds(std::numeric_limits<double>::infinity()));
-    data.timeOfNextFullCollection = now + vm->heap.fullActivityCallback()->timeUntilFire().value_or(Seconds(std::numeric_limits<double>::infinity()));
+    data.timeOfNextEdenCollection = now + vm->heap.edenActivityCallback()->timeUntilFire().valueOr(Seconds(std::numeric_limits<double>::infinity()));
+    data.timeOfNextFullCollection = now + vm->heap.fullActivityCallback()->timeUntilFire().valueOr(Seconds(std::numeric_limits<double>::infinity()));
 }
 
 }
index dcafb6f..1562a08 100644 (file)
@@ -170,8 +170,8 @@ void ResourceUsageThread::platformThreadBody(JSC::VM* vm, ResourceUsageData& dat
     data.totalExternalSize = currentGCOwnedExternal;
 
     auto now = MonotonicTime::now();
-    data.timeOfNextEdenCollection = now + vm->heap.edenActivityCallback()->timeUntilFire().value_or(Seconds(std::numeric_limits<double>::infinity()));
-    data.timeOfNextFullCollection = now + vm->heap.fullActivityCallback()->timeUntilFire().value_or(Seconds(std::numeric_limits<double>::infinity()));
+    data.timeOfNextEdenCollection = now + vm->heap.edenActivityCallback()->timeUntilFire().valueOr(Seconds(std::numeric_limits<double>::infinity()));
+    data.timeOfNextFullCollection = now + vm->heap.fullActivityCallback()->timeUntilFire().valueOr(Seconds(std::numeric_limits<double>::infinity()));
 }
 
 } // namespace WebCore
index f479f9b..9a9c976 100644 (file)
@@ -222,12 +222,12 @@ unsigned ComplexTextController::offsetForPosition(float h, bool includePartialGl
                 if (cursorPositionIterator.isBoundary(hitIndex))
                     clusterStart = hitIndex;
                 else
-                    clusterStart = cursorPositionIterator.preceding(hitIndex).value_or(0);
+                    clusterStart = cursorPositionIterator.preceding(hitIndex).valueOr(0);
 
                 if (!includePartialGlyphs)
                     return complexTextRun.stringLocation() + clusterStart;
 
-                unsigned clusterEnd = cursorPositionIterator.following(hitIndex).value_or(stringLength);
+                unsigned clusterEnd = cursorPositionIterator.following(hitIndex).valueOr(stringLength);
 
                 float clusterWidth;
                 // FIXME: The search stops at the boundaries of complexTextRun. In theory, it should go on into neighboring ComplexTextRuns
index d40d3b9..b635a13 100644 (file)
@@ -113,7 +113,7 @@ struct FontDescriptionKey {
         hasher.add(m_size);
         hasher.add(m_fontSelectionRequest.weight);
         hasher.add(m_fontSelectionRequest.width);
-        hasher.add(m_fontSelectionRequest.slope.value_or(normalItalicValue()));
+        hasher.add(m_fontSelectionRequest.slope.valueOr(normalItalicValue()));
         hasher.add(m_locale.existingHash());
         for (unsigned flagItem : m_flags)
             hasher.add(flagItem);
index 3432dca..b3b6468 100644 (file)
@@ -286,7 +286,7 @@ float FontCascade::glyphBufferForTextRun(CodePath codePathToUse, const TextRun&
 
 float FontCascade::drawText(GraphicsContext& context, const TextRun& run, const FloatPoint& point, unsigned from, Optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const
 {
-    unsigned destination = to.value_or(run.length());
+    unsigned destination = to.valueOr(run.length());
     GlyphBuffer glyphBuffer;
     float startX = point.x() + glyphBufferForTextRun(codePath(run, from, to), run, from, destination, glyphBuffer);
     // We couldn't generate any glyphs for the run. Give up.
@@ -303,7 +303,7 @@ void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run
     if (isLoadingCustomFonts())
         return;
 
-    unsigned destination = to.value_or(run.length());
+    unsigned destination = to.valueOr(run.length());
     if (codePath(run, from, to) != Complex)
         drawEmphasisMarksForSimpleText(context, run, mark, point, from, destination);
     else
@@ -313,7 +313,7 @@ void FontCascade::drawEmphasisMarks(GraphicsContext& context, const TextRun& run
 std::unique_ptr<DisplayList::DisplayList> FontCascade::displayListForTextRun(GraphicsContext& context, const TextRun& run, unsigned from, Optional<unsigned> to, CustomFontNotReadyAction customFontNotReadyAction) const
 {
     ASSERT(!context.paintingDisabled());
-    unsigned destination = to.value_or(run.length());
+    unsigned destination = to.valueOr(run.length());
     
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     CodePath codePathToUse = codePath(run);
@@ -545,7 +545,7 @@ bool FontCascade::fastAverageCharWidthIfAvailable(float& width) const
 
 void FontCascade::adjustSelectionRectForText(const TextRun& run, LayoutRect& selectionRect, unsigned from, Optional<unsigned> to) const
 {
-    unsigned destination = to.value_or(run.length());
+    unsigned destination = to.valueOr(run.length());
     if (codePath(run, from, to) != Complex)
         return adjustSelectionRectForSimpleText(run, selectionRect, from, destination);
 
@@ -619,7 +619,7 @@ FontCascade::CodePath FontCascade::codePath(const TextRun& run, Optional<unsigne
 
 #if !USE(FREETYPE)
     // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
-    if ((enableKerning() || requiresShaping()) && (from.value_or(0) || to.value_or(run.length()) != run.length()))
+    if ((enableKerning() || requiresShaping()) && (from.valueOr(0) || to.valueOr(run.length()) != run.length()))
         return Complex;
 #else
     UNUSED_PARAM(from);
index 357b402..6e5f8b4 100644 (file)
@@ -66,7 +66,7 @@ auto FontSelectionAlgorithm::stretchDistance(Capabilities capabilities) const ->
 auto FontSelectionAlgorithm::styleDistance(Capabilities capabilities) const -> DistanceResult
 {
     auto slope = capabilities.slope;
-    auto requestSlope = m_request.slope.value_or(normalItalicValue());
+    auto requestSlope = m_request.slope.valueOr(normalItalicValue());
     ASSERT(slope.isValid());
     if (slope.includes(requestSlope))
         return { FontSelectionValue(), requestSlope };
index ab47057..6b11b9a 100644 (file)
@@ -353,7 +353,7 @@ inline TextStream& operator<<(TextStream& ts, const FontSelectionValue& fontSele
 
 inline TextStream& operator<<(TextStream& ts, const Optional<FontSelectionValue>& optionalFontSelectionValue)
 {
-    ts << optionalFontSelectionValue.value_or(normalItalicValue());
+    ts << optionalFontSelectionValue.valueOr(normalItalicValue());
     return ts;
 }
 
@@ -432,17 +432,17 @@ struct FontSelectionSpecifiedCapabilities {
 
     constexpr Range computeWeight() const
     {
-        return weight.value_or(Range { normalWeightValue() });
+        return weight.valueOr(Range { normalWeightValue() });
     }
 
     constexpr Range computeWidth() const
     {
-        return width.value_or(Range { normalStretchValue() });
+        return width.valueOr(Range { normalStretchValue() });
     }
 
     constexpr Range computeSlope() const
     {
-        return slope.value_or(Range { normalItalicValue() });
+        return slope.valueOr(Range { normalItalicValue() });
     }
 
     OptionalRange weight;
index fe049a4..fdc2b78 100644 (file)
@@ -390,7 +390,7 @@ IntSize ShadowBlur::calculateLayerBoundingRect(const AffineTransform& transform,
     if (m_shadowsIgnoreTransforms && !transform.isIdentity()) {
         FloatQuad transformedPolygon = transform.mapQuad(FloatQuad(shadowedRect));
         transformedPolygon.move(m_offset);
-        layerRect = transform.inverse().value_or(AffineTransform()).mapQuad(transformedPolygon).boundingBox();
+        layerRect = transform.inverse().valueOr(AffineTransform()).mapQuad(transformedPolygon).boundingBox();
     } else {
         layerRect = shadowedRect;
         layerRect.move(m_offset);
index 7b935bf..cf7dc0c 100644 (file)
@@ -2350,7 +2350,7 @@ void MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput(GraphicsContext& c
     GraphicsContextStateSaver stateSaver(context);
     FloatRect imageRect(0, 0, CGImageGetWidth(m_lastImage.get()), CGImageGetHeight(m_lastImage.get()));
     AffineTransform videoTransform = [firstEnabledVideoTrack preferredTransform];
-    FloatRect transformedOutputRect = videoTransform.inverse().value_or(AffineTransform()).mapRect(outputRect);
+    FloatRect transformedOutputRect = videoTransform.inverse().valueOr(AffineTransform()).mapRect(outputRect);
 
     context.concatCTM(videoTransform);
     context.drawNativeImage(m_lastImage.get(), imageRect.size(), transformedOutputRect, imageRect);
index 1b07b4e..238a2ea 100644 (file)
@@ -1119,7 +1119,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext(GraphicsCo
     auto image = m_imagePainter.cgImage.get();
     FloatRect imageRect(0, 0, CGImageGetWidth(image), CGImageGetHeight(image));
     AffineTransform videoTransform = videoTransformationMatrix(*m_imagePainter.mediaSample);
-    FloatRect transformedDestRect = videoTransform.inverse().value_or(AffineTransform()).mapRect(destRect);
+    FloatRect transformedDestRect = videoTransform.inverse().valueOr(AffineTransform()).mapRect(destRect);
     context.concatCTM(videoTransform);
     context.drawNativeImage(image, imageRect.size(), transformedDestRect, imageRect);
 }
index a2e07cf..65cfb24 100644 (file)
@@ -1173,7 +1173,7 @@ void SourceBufferPrivateAVFObjC::willSeek()
 
 FloatSize SourceBufferPrivateAVFObjC::naturalSize()
 {
-    return m_cachedSize.value_or(FloatSize());
+    return m_cachedSize.valueOr(FloatSize());
 }
 
 void SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples(int trackID)
index 6a51529..650eb6c 100644 (file)
@@ -1462,7 +1462,7 @@ void GraphicsLayerCA::setVisibleAndCoverageRects(const VisibleAndCoverageRects&
     auto bounds = FloatRect(m_boundsOrigin, size());
     if (auto extent = animationExtent()) {
         // Adjust the animation extent to match the current animation position.
-        bounds = rects.animatingTransform.inverse().value_or(TransformationMatrix()).mapRect(*extent);
+        bounds = rects.animatingTransform.inverse().valueOr(TransformationMatrix()).mapRect(*extent);
     }
 
     // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect.
index 50bdb5f..e258141 100644 (file)
@@ -598,7 +598,7 @@ RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescr
     if (applyWeightWidthSlopeVariations && !fontIsSystemFont(originalFont)) {
         float weight = fontSelectionRequest.weight;
         float width = fontSelectionRequest.width;
-        float slope = fontSelectionRequest.slope.value_or(normalItalicValue());
+        float slope = fontSelectionRequest.slope.valueOr(normalItalicValue());
         if (auto weightValue = fontFaceCapabilities.weight)
             weight = std::max(std::min(weight, static_cast<float>(weightValue->maximum)), static_cast<float>(weightValue->minimum));
         if (auto widthValue = fontFaceCapabilities.width)
index 4d0ded4..8227879 100644 (file)
@@ -373,7 +373,7 @@ void FETurbulence::fillRegion(Uint8ClampedArray& pixelArray, const PaintingData&
     filterRegion.scale(filter().filterScale());
     FloatPoint point(0, filterRegion.y() + startY);
     int indexOfPixelChannel = startY * (filterRegion.width() << 2);
-    AffineTransform inverseTransfrom = filter().absoluteTransform().inverse().value_or(AffineTransform());
+    AffineTransform inverseTransfrom = filter().absoluteTransform().inverse().valueOr(AffineTransform());
 
     for (int y = startY; y < endY; ++y) {
         point.setY(point.y() + 1);
index 1fe8b88..0ba4739 100644 (file)
@@ -223,7 +223,7 @@ bool initializeGStreamer(Optional<Vector<String>>&& options)
         isGStreamerInitialized = false;
 
 #if ENABLE(VIDEO) || ENABLE(WEB_AUDIO)
-        Vector<String> parameters = options.value_or(extractGStreamerOptionsFromCommandLine());
+        Vector<String> parameters = options.valueOr(extractGStreamerOptionsFromCommandLine());
         char** argv = g_new0(char*, parameters.size() + 2);
         int argc = parameters.size() + 1;
         argv[0] = g_strdup(getCurrentExecutableName().data());
index 196297b..890da9d 100644 (file)
@@ -236,7 +236,7 @@ void TextureMapperLayer::paintSelfAndChildrenWithReplica(const TextureMapperPain
         TextureMapperPaintOptions replicaOptions(options);
         replicaOptions.transform
             .multiply(m_state.replicaLayer->m_layerTransforms.combined)
-            .multiply(m_layerTransforms.combined.inverse().value_or(TransformationMatrix()));
+            .multiply(m_layerTransforms.combined.inverse().valueOr(TransformationMatrix()));
         paintSelfAndChildren(replicaOptions);
     }
 
@@ -246,7 +246,7 @@ void TextureMapperLayer::paintSelfAndChildrenWithReplica(const TextureMapperPain
 TransformationMatrix TextureMapperLayer::replicaTransform()
 {
     return TransformationMatrix(m_state.replicaLayer->m_layerTransforms.combined)
-        .multiply(m_layerTransforms.combined.inverse().value_or(TransformationMatrix()));
+        .multiply(m_layerTransforms.combined.inverse().valueOr(TransformationMatrix()));
 }
 
 static void resolveOverlaps(Region& newRegion, Region& overlapRegion, Region& nonOverlapRegion)
@@ -647,9 +647,9 @@ bool TextureMapperLayer::syncAnimations(MonotonicTime time)
     TextureMapperAnimation::ApplicationResult applicationResults;
     m_animations.apply(applicationResults, time);
 
-    m_layerTransforms.localTransform = applicationResults.transform.value_or(m_state.transform);
-    m_currentOpacity = applicationResults.opacity.value_or(m_state.opacity);
-    m_currentFilters = applicationResults.filters.value_or(m_state.filters);
+    m_layerTransforms.localTransform = applicationResults.transform.valueOr(m_state.transform);
+    m_currentOpacity = applicationResults.opacity.valueOr(m_state.opacity);
+    m_currentFilters = applicationResults.filters.valueOr(m_state.filters);
 
     return applicationResults.hasRunningAnimations;
 }
index 15ae46f..45ff951 100644 (file)
@@ -825,7 +825,7 @@ IntRect CoordinatedGraphicsLayer::transformedVisibleRect()
     // 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().value_or(TransformationMatrix()));
+    ASSERT(m_cachedInverseTransform == m_layerTransform.combined().inverse().valueOr(TransformationMatrix()));
     FloatRect rect = m_cachedInverseTransform.clampedBoundsOfProjectedQuad(FloatQuad(m_coordinator->visibleContentsRect()));
     clampToContentsRectIfRectIsInfinite(rect, size());
     return enclosingIntRect(rect);
@@ -1089,7 +1089,7 @@ void CoordinatedGraphicsLayer::computeTransformedVisibleRect()
     m_layerTransform.setChildrenTransform(childrenTransform());
     m_layerTransform.combineTransforms(parent() ? downcast<CoordinatedGraphicsLayer>(*parent()).m_layerTransform.combinedForChildren() : TransformationMatrix());
 
-    m_cachedInverseTransform = m_layerTransform.combined().inverse().value_or(TransformationMatrix());
+    m_cachedInverseTransform = m_layerTransform.combined().inverse().valueOr(TransformationMatrix());
 
     // The combined transform will be used in tiledBackingStoreVisibleRect.
     setNeedsVisibleRectAdjustment();
index f0e2da3..e763cc1 100644 (file)
@@ -170,7 +170,7 @@ FloatPoint TransformState::mappedPoint(bool* wasClamped) const
     if (m_direction == ApplyTransformDirection)
         return m_accumulatedTransform->mapPoint(point);
 
-    return m_accumulatedTransform->inverse().value_or(TransformationMatrix()).projectPoint(point, wasClamped);
+    return m_accumulatedTransform->inverse().valueOr(TransformationMatrix()).projectPoint(point, wasClamped);
 }
 
 FloatQuad TransformState::mappedQuad(bool* wasClamped) const
@@ -218,7 +218,7 @@ void TransformState::mapQuad(FloatQuad& quad, TransformDirection direction, bool
     if (direction == ApplyTransformDirection)
         quad = m_accumulatedTransform->mapQuad(quad);
 
-    quad = m_accumulatedTransform->inverse().value_or(TransformationMatrix()).projectQuad(quad, wasClamped);
+    quad = m_accumulatedTransform->inverse().valueOr(TransformationMatrix()).projectQuad(quad, wasClamped);
 }
 
 void TransformState::flattenWithTransform(const TransformationMatrix& t, bool* wasClamped)
@@ -233,7 +233,7 @@ void TransformState::flattenWithTransform(const TransformationMatrix& t, bool* w
         }
 
     } else {
-        TransformationMatrix inverseTransform = t.inverse().value_or(TransformationMatrix());
+        TransformationMatrix inverseTransform = t.inverse().valueOr(TransformationMatrix());
         if (m_mapPoint)
             m_lastPlanarPoint = inverseTransform.projectPoint(m_lastPlanarPoint);
         if (m_mapQuad) {
index 0212bc9..ef25e9f 100644 (file)
@@ -103,7 +103,7 @@ Seconds computeCurrentAge(const ResourceResponse& response, WallTime responseTim
     // No compensation for latency as that is not terribly important in practice.
     auto dateValue = response.date();
     auto apparentAge = dateValue ? std::max(0_us, responseTime - *dateValue) : 0_us;
-    auto ageValue = response.age().value_or(0_us);
+    auto ageValue = response.age().valueOr(0_us);
     auto correctedInitialAge = std::max(apparentAge, ageValue);
     auto residentTime = WallTime::now() - responseTime;
     return correctedInitialAge + residentTime;
@@ -121,7 +121,7 @@ Seconds computeFreshnessLifetimeForHTTPFamily(const ResourceResponse& response,
         return *maxAge;
 
     auto date = response.date();
-    auto effectiveDate = date.value_or(responseTime);
+    auto effectiveDate = date.valueOr(responseTime);
     if (auto expires = response.expires())
         return *expires - effectiveDate;
 
index b9673de..822e8b0 100644 (file)
@@ -50,7 +50,7 @@ bool NetworkStateNotifier::onLine()
 {
     if (!m_isOnLine)
         updateState();
-    return m_isOnLine.value_or(true);
+    return m_isOnLine.valueOr(true);
 }
 
 void NetworkStateNotifier::addListener(WTF::Function<void(bool)>&& listener)
index de28d67..35ec17c 100644 (file)
@@ -195,8 +195,8 @@ public:
     LayoutUnit highValue() const { return LayoutUnit::max(); }
     void collectIfNeeded(const IntervalType&);
 
-    LayoutUnit nextLogicalBottom() const { return m_nextLogicalBottom.value_or(0); }
-    LayoutUnit nextShapeLogicalBottom() const { return m_nextShapeLogicalBottom.value_or(nextLogicalBottom()); }
+    LayoutUnit nextLogicalBottom() const { return m_nextLogicalBottom.valueOr(0); }
+    LayoutUnit nextShapeLogicalBottom() const { return m_nextShapeLogicalBottom.valueOr(nextLogicalBottom()); }
 
 private:
     WeakPtr<const RenderBlockFlow> m_renderer;
index 1dbb3a4..290faca 100644 (file)
@@ -64,7 +64,7 @@ LayoutUnit GridBaselineAlignment::logicalAscentForChild(const RenderBox& child,
 LayoutUnit GridBaselineAlignment::ascentForChild(const RenderBox& child, GridAxis baselineAxis) const
 {
     LayoutUnit margin = isDescentBaselineForChild(child, baselineAxis) ? marginUnderForChild(child, baselineAxis) : marginOverForChild(child, baselineAxis);
-    LayoutUnit baseline(isParallelToBaselineAxisForChild(child, baselineAxis) ? child.firstLineBaseline().value_or(-1) : -1);
+    LayoutUnit baseline(isParallelToBaselineAxisForChild(child, baselineAxis) ? child.firstLineBaseline().valueOr(-1) : -1);
     // We take border-box's under edge if no valid baseline.
     if (baseline == -1) {
         if (isHorizontalBaselineAxis(baselineAxis))
index f75376b..88c4f59 100644 (file)
@@ -54,7 +54,7 @@ void GridTrack::setBaseSize(LayoutUnit baseSize)
 
 void GridTrack::setGrowthLimit(LayoutUnit growthLimit)
 {
-    m_growthLimit = growthLimit == infinity ? growthLimit : std::min(growthLimit, m_growthLimitCap.value_or(growthLimit));
+    m_growthLimit = growthLimit == infinity ? growthLimit : std::min(growthLimit, m_growthLimitCap.valueOr(growthLimit));
     ensureGrowthLimitIsBiggerThanBaseSize();
 }
 
@@ -216,7 +216,7 @@ LayoutUnit GridTrackSizingAlgorithm::initialBaseSize(const GridTrackSize& trackS
 
     const Length& trackLength = gridLength.length();
     if (trackLength.isSpecified())
-        return valueForLength(trackLength, std::max<LayoutUnit>(availableSpace().value_or(0), 0));
+        return valueForLength(trackLength, std::max<LayoutUnit>(availableSpace().valueOr(0), 0));
 
     ASSERT(trackLength.isMinContent() || trackLength.isAuto() || trackLength.isMaxContent());
     return 0;
@@ -230,7 +230,7 @@ LayoutUnit GridTrackSizingAlgorithm::initialGrowthLimit(const GridTrackSize& tra
 
     const Length& trackLength = gridLength.length();
     if (trackLength.isSpecified())
-        return valueForLength(trackLength, std::max<LayoutUnit>(availableSpace().value_or(0), 0));
+        return valueForLength(trackLength, std::max<LayoutUnit>(availableSpace().valueOr(0), 0));
 
     ASSERT(trackLength.isMinContent() || trackLength.isAuto() || trackLength.isMaxContent());
     return infinity;
@@ -254,7 +254,7 @@ void GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem(const GridSpan& spa
     } else if (trackSize.hasMaxContentOrAutoMaxTrackBreadth()) {
         LayoutUnit growthLimit = m_strategy->maxContentForChild(gridItem);
         if (trackSize.isFitContent())
-            growthLimit = std::min(growthLimit, valueForLength(trackSize.fitContentTrackBreadth().length(), availableSpace().value_or(0)));
+            growthLimit = std::min(growthLimit, valueForLength(trackSize.fitContentTrackBreadth().length(), availableSpace().valueOr(0)));
         track.setGrowthLimit(std::max(track.growthLimit(), growthLimit));
     }
 }
@@ -483,8 +483,8 @@ static bool sortByGridTrackGrowthPotential(const GridTrack* track1, const GridTr
     if (track1HasInfiniteGrowthPotentialWithoutCap || track2HasInfiniteGrowthPotentialWithoutCap)
         return track2HasInfiniteGrowthPotentialWithoutCap;
 
-    LayoutUnit track1Limit = track1->growthLimitCap().value_or(track1->growthLimit());
-    LayoutUnit track2Limit = track2->growthLimitCap().value_or(track2->growthLimit());
+    LayoutUnit track1Limit = track1->growthLimitCap().valueOr(track1->growthLimit());
+    LayoutUnit track2Limit = track2->growthLimitCap().valueOr(track2->growthLimit());
     return (track1Limit - track1->baseSize()) < (track2Limit - track2->baseSize());
 }
 
@@ -569,7 +569,7 @@ LayoutUnit GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild(const Rend
         if (maxTrackSize.isContentSized() || maxTrackSize.isFlex() || isRelativeGridLengthAsAuto(maxTrackSize, direction))
             gridAreaIsIndefinite = true;
         else
-            gridAreaSize += valueForLength(maxTrackSize.length(), availableSize.value_or(0_lu));
+            gridAreaSize += valueForLength(maxTrackSize.length(), availableSize.valueOr(0_lu));
     }
 
     gridAreaSize += m_renderGrid->guttersSize(m_grid, direction, span.startLine(), span.integerSpan(), availableSize);
@@ -810,7 +810,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::minSizeForChild(RenderBox& child) c
             GridTrackSize trackSize = m_algorithm.gridTrackSize(direction(), trackPosition);
             if (!trackSize.hasFixedMaxTrackBreadth())
                 return minSize;
-            maxBreadth += valueForLength(trackSize.maxTrackBreadth().length(), availableSpace().value_or(0_lu));
+            maxBreadth += valueForLength(trackSize.maxTrackBreadth().length(), availableSpace().valueOr(0_lu));
         }
         if (minSize > maxBreadth) {
             auto marginAndBorderAndPadding = GridLayoutFunctions::marginLogicalSizeForChild(*renderGrid(), direction(), child);
@@ -831,7 +831,7 @@ LayoutUnit GridTrackSizingAlgorithmStrategy::minSizeForChild(RenderBox& child) c
     bool overrideSizeHasChanged = updateOverrideContainingBlockContentSizeForChild(child, childInlineDirection, gridAreaSize);
     layoutGridItemForMinSizeComputation(child, overrideSizeHasChanged);
 
-    return child.computeLogicalHeightUsing(MinSize, childMinSize, WTF::nullopt).value_or(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight() + baselineShim;
+    return child.computeLogicalHeightUsing(MinSize, childMinSize, WTF::nullopt).valueOr(0) + child.marginLogicalHeight() + child.scrollbarLogicalHeight() + baselineShim;
 }
 
 bool GridTrackSizingAlgorithm::canParticipateInBaselineAlignment(const RenderBox& child, GridAxis baselineAxis) const
@@ -1101,7 +1101,7 @@ void GridTrackSizingAlgorithm::initializeTrackSizes()
     Vector<GridTrack>& allTracks = tracks(m_direction);
     const bool hasDefiniteFreeSpace = !!availableSpace();
     const bool indefiniteHeight = m_direction == ForRows && !m_renderGrid->hasDefiniteLogicalHeight();
-    LayoutUnit maxSize = std::max(0_lu, availableSpace().value_or(0_lu));
+    LayoutUnit maxSize = std::max(0_lu, availableSpace().valueOr(0_lu));
     // 1. Initialize per Grid track variables.
     for (unsigned i = 0; i < allTracks.size(); ++i) {
         GridTrack& track = allTracks[i];
index 2321d4f..4e1cfee 100644 (file)
@@ -115,7 +115,7 @@ struct PaintInfo {
         if (rect.isInfinite())
             return;
 
-        FloatRect tranformedRect(localToAncestorTransform.inverse().value_or(AffineTransform()).mapRect(rect));
+        FloatRect tranformedRect(localToAncestorTransform.inverse().valueOr(AffineTransform()).mapRect(rect));
         rect.setLocation(LayoutPoint(tranformedRect.location()));
         rect.setSize(LayoutSize(tranformedRect.size()));
     }
index aa737e4..a671111 100644 (file)
@@ -2754,7 +2754,7 @@ RenderBox::LogicalExtentComputedValues RenderBox::computeLogicalHeight(LayoutUni
         LayoutUnit heightResult;
         if (checkMinMaxHeight) {
             LayoutUnit intrinsicHeight = computedValues.m_extent - borderAndPaddingLogicalHeight();
-            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).value_or(computedValues.m_extent);
+            heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style().logicalHeight(), intrinsicHeight).valueOr(computedValues.m_extent);
             heightResult = constrainLogicalHeightByMinMax(heightResult, intrinsicHeight);
         } else {
             // The only times we don't check min/max height are when a fixed length has
index 150ac06..e5cde49 100644 (file)
@@ -167,7 +167,7 @@ static Optional<CounterPlan> planCounter(RenderElement& renderer, const AtomicSt
     }
 
     if (directives.resetValue)
-        return CounterPlan { true, saturatedAddition(*directives.resetValue, directives.incrementValue.value_or(0)) };
+        return CounterPlan { true, saturatedAddition(*directives.resetValue, directives.incrementValue.valueOr(0)) };
     if (directives.incrementValue)
         return CounterPlan { false, *directives.incrementValue };
     return WTF::nullopt;
index 3483cba..b315e09 100644 (file)
@@ -435,7 +435,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
 
             // Update our height and overflow height.
             if (style().boxAlign() == BoxAlignment::Baseline) {
-                LayoutUnit ascent = child->firstLineBaseline().value_or(child->height() + child->marginBottom());
+                LayoutUnit ascent = child->firstLineBaseline().valueOr(child->height() + child->marginBottom());
                 ascent += child->marginTop();
                 LayoutUnit descent = (child->height() + child->verticalMarginExtent()) - ascent;
 
@@ -510,7 +510,7 @@ void RenderDeprecatedFlexibleBox::layoutHorizontalBox(bool relayoutChildren)
                 childY += child->marginTop() + std::max<LayoutUnit>(0, (contentHeight() - (child->height() + child->verticalMarginExtent())) / 2);
                 break;
             case BoxAlignment::Baseline: {
-                LayoutUnit ascent = child->firstLineBaseline().value_or(child->height() + child->marginBottom());
+                LayoutUnit ascent = child->firstLineBaseline().valueOr(child->height() + child->marginBottom());
                 ascent += child->marginTop();
                 childY += child->marginTop() + (maxAscent - ascent);
                 break;
index 7949fbf..b30fc7f 100644 (file)
@@ -172,7 +172,7 @@ static int synthesizedBaselineFromContentBox(const RenderBox& box, LineDirection
 
 int RenderFlexibleBox::baselinePosition(FontBaseline, bool, LineDirectionMode direction, LinePositionMode) const
 {
-    int baseline = firstLineBaseline().value_or(synthesizedBaselineFromContentBox(*this, direction));
+    int baseline = firstLineBaseline().valueOr(synthesizedBaselineFromContentBox(*this, direction));
 
     int marginAscent = direction == HorizontalLine ? marginTop() : marginRight();
     return baseline + marginAscent;
@@ -1036,7 +1036,7 @@ bool RenderFlexibleBox::updateAutoMarginsInCrossAxis(RenderBox& child, LayoutUni
 
 LayoutUnit RenderFlexibleBox::marginBoxAscentForChild(const RenderBox& child)
 {
-    LayoutUnit ascent = child.firstLineBaseline().value_or(crossAxisExtentForChild(child));
+    LayoutUnit ascent = child.firstLineBaseline().valueOr(crossAxisExtentForChild(child));
     return ascent + flowAwareMarginBeforeForChild(child);
 }
 
@@ -1074,12 +1074,12 @@ LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child
     Optional<LayoutUnit> maxExtent = WTF::nullopt;
     if (max.isSpecifiedOrIntrinsic()) {
         maxExtent = computeMainAxisExtentForChild(child, MaxSize, max);
-        childSize = std::min(childSize, maxExtent.value_or(childSize));
+        childSize = std::min(childSize, maxExtent.valueOr(childSize));
     }
 
     Length min = isHorizontalFlow() ? child.style().minWidth() : child.style().minHeight();
     if (min.isSpecifiedOrIntrinsic())
-        return std::max(childSize, std::max(0_lu, computeMainAxisExtentForChild(child, MinSize, min).value_or(childSize)));
+        return std::max(childSize, std::max(0_lu, computeMainAxisExtentForChild(child, MinSize, min).valueOr(childSize)));
     
     if (!isFlexibleBoxImpl() && min.isAuto() && mainAxisOverflowForChild(child) == Overflow::Visible && !(isColumnFlow() && is<RenderFlexibleBox>(child))) {
         // FIXME: For now, we do not handle min-height: auto for nested
@@ -1089,17 +1089,17 @@ LayoutUnit RenderFlexibleBox::adjustChildSizeForMinAndMax(const RenderBox& child
         // css-flexbox section 4.5
         // FIXME: If the min value is expected to be valid here, we need to come up with a non optional version of computeMainAxisExtentForChild and
         // ensure it's valid through the virtual calls of computeIntrinsicLogicalContentHeightUsing.
-        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).value_or(0);
+        LayoutUnit contentSize = computeMainAxisExtentForChild(child, MinSize, Length(MinContent)).valueOr(0);
         ASSERT(contentSize >= 0);
         if (child.hasAspectRatio() && child.intrinsicSize().height() > 0)
             contentSize = adjustChildSizeForAspectRatioCrossAxisMinAndMax(child, contentSize);
-        contentSize = std::min(contentSize, maxExtent.value_or(contentSize));
+        contentSize = std::min(contentSize, maxExtent.valueOr(contentSize));
         
         Length mainSize = isHorizontalFlow() ? child.style().width() : child.style().height();
         if (mainAxisLengthIsDefinite(child, mainSize)) {
-            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).value_or(0);
+            LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize).valueOr(0);
             ASSERT(resolvedMainSize >= 0);
-            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.value_or(resolvedMainSize));
+            LayoutUnit specifiedSize = std::min(resolvedMainSize, maxExtent.valueOr(resolvedMainSize));
             return std::max(childSize, std::min(specifiedSize, contentSize));
         }
 
index 04bb2b6..35a610b 100644 (file)
@@ -310,7 +310,7 @@ LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction, Optional<Layo
     if (gapLength.isNormal())
         return 0_lu;
 
-    return valueForLength(gapLength.length(), availableSize.value_or(0));
+    return valueForLength(gapLength.length(), availableSize.valueOr(0));
 }
 
 LayoutUnit RenderGrid::gridGap(GridTrackSizingDirection direction) const
@@ -1226,7 +1226,7 @@ int RenderGrid::baselinePosition(FontBaseline, bool, LineDirectionMode direction
 #else
     UNUSED_PARAM(mode);
 #endif
-    return firstLineBaseline().value_or(synthesizedBaselineFromMarginBox(*this, direction));
+    return firstLineBaseline().valueOr(synthesizedBaselineFromMarginBox(*this, direction));
 }
 
 Optional<int> RenderGrid::firstLineBaseline() const
index c26e6b7..0e2e0f1 100644 (file)
@@ -4457,7 +4457,7 @@ void RenderLayer::paintLayerByApplyingTransform(GraphicsContext& context, const
     LayoutSize adjustedSubpixelOffset = offsetForThisLayer - LayoutSize(devicePixelSnappedOffsetForThisLayer);
     LayerPaintingInfo transformedPaintingInfo(paintingInfo);
     transformedPaintingInfo.rootLayer = this;
-    transformedPaintingInfo.paintDirtyRect = LayoutRect(encloseRectToDevicePixels(transform.inverse().value_or(AffineTransform()).mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor));
+    transformedPaintingInfo.paintDirtyRect = LayoutRect(encloseRectToDevicePixels(transform.inverse().valueOr(AffineTransform()).mapRect(paintingInfo.paintDirtyRect), deviceScaleFactor));
     transformedPaintingInfo.subpixelOffset = adjustedSubpixelOffset;
     paintLayerContentsAndReflection(context, transformedPaintingInfo, paintFlags);
     context.setCTM(oldTransfrom);
index 670e374..63ade7e 100644 (file)
@@ -302,7 +302,7 @@ LayoutRect RenderListBox::itemBoundingBoxRect(const LayoutPoint& additionalOffse
 void RenderListBox::paintItem(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const PaintFunction& paintFunction)
 {
     int listItemsSize = numItems();
-    int firstVisibleItem = m_indexOfFirstVisibleItemInsidePaddingTopArea.value_or(m_indexOffset);
+    int firstVisibleItem = m_indexOfFirstVisibleItemInsidePaddingTopArea.valueOr(m_indexOffset);
     int endIndex = firstVisibleItem + numVisibleItems(ConsiderPadding::Yes);
     for (int i = firstVisibleItem; i < listItemsSize && i < endIndex; ++i)
         paintFunction(paintInfo, paintOffset, i);
@@ -621,7 +621,7 @@ bool RenderListBox::scrollToRevealElementAtListIndex(int index)
 
 bool RenderListBox::listIndexIsVisible(int index)
 {
-    int firstIndex = m_indexOfFirstVisibleItemInsidePaddingTopArea.value_or(m_indexOffset);
+    int firstIndex = m_indexOfFirstVisibleItemInsidePaddingTopArea.valueOr(m_indexOffset);
     int endIndex = m_indexOfFirstVisibleItemInsidePaddingBottomArea
         ? m_indexOfFirstVisibleItemInsidePaddingBottomArea.value() + numberOfVisibleItemsInPaddingBottom()
         : m_indexOffset + numVisibleItems();
index dbb8ac5..28dfeb3 100644 (file)
@@ -420,7 +420,7 @@ LayoutUnit RenderMultiColumnSet::calculateMaxColumnHeight() const
     LayoutUnit availableHeight = multiColumnFlow()->columnHeightAvailable();
     LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFragmentedFlow::maxLogicalHeight();
     if (!multicolStyle.logicalMaxHeight().isUndefined())
-        maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), WTF::nullopt).value_or(maxColumnHeight));
+        maxColumnHeight = std::min(maxColumnHeight, multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), WTF::nullopt).valueOr(maxColumnHeight));
     return heightAdjustedForSetOffset(maxColumnHeight);
 }
 
index 0b03604..99ad8da 100644 (file)
@@ -322,9 +322,9 @@ LayoutUnit RenderTable::convertStyleLogicalHeightToComputedHeight(const Length&
         }
         return styleLogicalHeight.value() - borders;
     } else if (styleLogicalHeight.isPercentOrCalculated())
-        return computePercentageLogicalHeight(styleLogicalHeight).value_or(0);
+        return computePercentageLogicalHeight(styleLogicalHeight).valueOr(0);
     else if (styleLogicalHeight.isIntrinsic())
-        return computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding).value_or(0);
+        return computeIntrinsicLogicalContentHeightUsing(styleLogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding).valueOr(0);
     else
         ASSERT_NOT_REACHED();
     return 0_lu;
index 8dd66a4..f5a0fd0 100644 (file)
@@ -410,7 +410,7 @@ LayoutUnit RenderTableCell::cellBaselinePosition() const
     // <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().value_or(borderAndPaddingBefore() + contentLogicalHeight());
+    return firstLineBaseline().valueOr(borderAndPaddingBefore() + contentLogicalHeight());
 }
 
 static inline void markCellDirtyWhenCollapsedBorderChanges(RenderTableCell* cell)
index 9119312..d1db9f2 100644 (file)
@@ -888,7 +888,7 @@ Optional<int> RenderTableSection::firstLineBaseline() const
         // Only cells with content have a baseline
         if (cell && cell->contentLogicalHeight()) {
             int candidate = roundToInt(cell->logicalTop() + cell->borderAndPaddingBefore() + cell->contentLogicalHeight());
-            result = std::max(result.value_or(candidate), candidate);
+            result = std::max(result.valueOr(candidate), candidate);
         }
     }
 
index 431b8fe..8c1788a 100644 (file)
@@ -1004,7 +1004,7 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Fo
         }
     }
 
-    glyphOverflow.left = firstGlyphLeftOverflow.value_or(glyphOverflow.left);
+    glyphOverflow.left = firstGlyphLeftOverflow.valueOr(glyphOverflow.left);
 
     if ((needsWordSpacing && length > 1) || (ignoringSpaces && !firstWord))
         currMaxWidth += wordSpacing;
@@ -1510,13 +1510,13 @@ int RenderText::previousOffset(int current) const
         return current - 1;
 
     CachedTextBreakIterator iterator(text(), TextBreakIterator::Mode::Caret, nullAtom());
-    return iterator.preceding(current).value_or(current - 1);
+    return iterator.preceding(current).valueOr(current - 1);
 }
 
 int RenderText::previousOffsetForBackwardDeletion(int current) const
 {
     CachedTextBreakIterator iterator(text(), TextBreakIterator::Mode::Delete, nullAtom());
-    return iterator.preceding(current).value_or(0);
+    return iterator.preceding(current).valueOr(0);
 }
 
 int RenderText::nextOffset(int current) const
@@ -1525,7 +1525,7 @@ int RenderText::nextOffset(int current) const
         return current + 1;
 
     CachedTextBreakIterator iterator(text(), TextBreakIterator::Mode::Caret, nullAtom());
-    return iterator.following(current).value_or(current + 1);
+    return iterator.following(current).valueOr(current + 1);
 }
 
 bool RenderText::computeCanUseSimpleFontCodePath() const
@@ -1547,7 +1547,7 @@ void RenderText::momentarilyRevealLastTypedCharacter(unsigned offsetAfterLastTyp
 
 StringView RenderText::stringView(unsigned start, Optional<unsigned> stop) const
 {
-    unsigned destination = stop.value_or(text().length());
+    unsigned destination = stop.valueOr(text().length());
     ASSERT(start <= length());
     ASSERT(destination <= length());
     ASSERT(start <= destination);
index 967692e..e8dd849 100644 (file)
@@ -234,7 +234,7 @@ void RenderView::layout()
     if (!needsLayout())
         return;
 
-    LayoutStateMaintainer statePusher(*this, { }, false, m_pageLogicalSize.value_or(LayoutSize()).height(), m_pageLogicalHeightChanged);
+    LayoutStateMaintainer statePusher(*this, { }, false, m_pageLogicalSize.valueOr(LayoutSize()).height(), m_pageLogicalHeightChanged);
 
     m_pageLogicalHeightChanged = false;
 
index c9e3513..8e356b6 100644 (file)
@@ -102,7 +102,7 @@ int RenderMathMLBlock::baselinePosition(FontBaseline baselineType, bool firstLin
     if (linePositionMode == PositionOfInteriorLineBoxes)
         return 0;
 
-    return firstLineBaseline().value_or(RenderBlock::baselinePosition(baselineType, firstLine, direction, linePositionMode));
+    return firstLineBaseline().valueOr(RenderBlock::baselinePosition(baselineType, firstLine, direction, linePositionMode));
 }
 
 #if ENABLE(DEBUG_MATH_LAYOUT)
index 048c7ec..2d4393b 100644 (file)
@@ -80,7 +80,7 @@ protected:
 
     static LayoutUnit ascentForChild(const RenderBox& child)
     {
-        return child.firstLineBaseline().value_or(child.logicalHeight());
+        return child.firstLineBaseline().valueOr(child.logicalHeight());
     }
 
     void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0_lu) override;
index f12d3af..d4e731a 100644 (file)
@@ -85,7 +85,7 @@ int GridPosition::spanPosition() const
 
 int GridPosition::max()
 {
-    return gMaxPositionForTesting.value_or(kGridMaxPosition);
+    return gMaxPositionForTesting.valueOr(kGridMaxPosition);
 }
 
 int GridPosition::min()
index 807e4db..38ed93c 100644 (file)
@@ -68,7 +68,7 @@ public:
 
     float lengthOr(float defaultValue) const
     {
-        return m_length.value_or(defaultValue);
+        return m_length.valueOr(defaultValue);
     }
 
     bool operator==(const TextUnderlineOffset& other) const
index cbe270b..98b315d 100644 (file)
@@ -161,7 +161,7 @@ bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTest
     if (!pointIsInsideViewportClip(pointInParent))
         return false;
 
-    FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
 
     if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
         return false;
index dfb4b87..585c7be 100644 (file)
@@ -185,7 +185,7 @@ bool RenderSVGForeignObject::nodeAtFloatPoint(const HitTestRequest& request, Hit
     if (hitTestAction != HitTestForeground)
         return false;
 
-    FloatPoint localPoint = localTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = localTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
 
     // Early exit if local point is not contained in clipped viewport area
     if (SVGRenderSupport::isOverflowHidden(*this) && !m_viewport.contains(localPoint))
index 0a58f8f..2c6f317 100644 (file)
@@ -193,7 +193,7 @@ bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
     PointerEventsHitRules hitRules(PointerEventsHitRules::SVG_IMAGE_HITTESTING, request, style().pointerEvents());
     bool isVisible = (style().visibility() == Visibility::Visible);
     if (isVisible || !hitRules.requireVisible) {
-        FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
+        FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
             
         if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
             return false;
index 7398ef3..2cf86e2 100644 (file)
@@ -268,10 +268,10 @@ bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin
         AffineTransform transform;
         transform.translate(objectBoundingBox.location());
         transform.scale(objectBoundingBox.size());
-        point = transform.inverse().value_or(AffineTransform()).mapPoint(point);
+        point = transform.inverse().valueOr(AffineTransform()).mapPoint(point);
     }
 
-    point = clipPathElement().animatedLocalTransform().inverse().value_or(AffineTransform()).mapPoint(point);
+    point = clipPathElement().animatedLocalTransform().inverse().valueOr(AffineTransform()).mapPoint(point);
 
     for (Node* childNode = clipPathElement().firstChild(); childNode; childNode = childNode->nextSibling()) {
         RenderObject* renderer = childNode->renderer();
index 3640692..1b3ef24 100644 (file)
@@ -276,7 +276,7 @@ void RenderSVGResourceFilter::postApplyResource(RenderElement& renderer, Graphic
 
         ImageBuffer* resultImage = lastEffect->imageBufferResult();
         if (resultImage) {
-            context->concatCTM(filterData.shearFreeAbsoluteTransform.inverse().value_or(AffineTransform()));
+            context->concatCTM(filterData.shearFreeAbsoluteTransform.inverse().valueOr(AffineTransform()));
 
             context->scale(FloatSize(1 / filterData.filter->filterResolution().width(), 1 / filterData.filter->filterResolution().height()));
             context->drawImageBuffer(*resultImage, lastEffect->absolutePaintRect());
index e1502ef..df0ef6f 100644 (file)
@@ -405,7 +405,7 @@ bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
     // Test SVG content if the point is in our content box or it is inside the visualOverflowRect and the overflow is visible.
     // FIXME: This should be an intersection when rect-based hit tests are supported by nodeAtFloatPoint.
     if (contentBoxRect().contains(pointInBorderBox) || (!shouldApplyViewportClip() && visualOverflowRect().contains(pointInParent))) {
-        FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(FloatPoint(pointInParent));
+        FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(FloatPoint(pointInParent));
 
         for (RenderObject* child = lastChild(); child; child = child->previousSibling()) {
             // FIXME: nodeAtFloatPoint() doesn't handle rect-based hit tests yet.
index fa3bc91..34b0ae7 100644 (file)
@@ -368,7 +368,7 @@ bool RenderSVGShape::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
     if (hitTestAction != HitTestForeground)
         return false;
 
-    FloatPoint localPoint = m_localTransform.inverse().value_or(AffineTransform()).mapPoint(pointInParent);
+    FloatPoint localPoint = m_localTransform.inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
 
     if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
         return false;
index 637d8c4..c80e956 100644 (file)
@@ -439,7 +439,7 @@ bool RenderSVGText::nodeAtFloatPoint(const HitTestRequest& request, HitTestResul
     if (isVisible || !hitRules.requireVisible) {
         if ((hitRules.canHitStroke && (style().svgStyle().hasStroke() || !hitRules.requireStroke))
             || (hitRules.canHitFill && (style().svgStyle().hasFill() || !hitRules.requireFill))) {
-            FloatPoint localPoint = localToParentTransform().inverse().value_or(AffineTransform()).mapPoint(pointInParent);
+            FloatPoint localPoint = localToParentTransform().inverse().valueOr(AffineTransform()).mapPoint(pointInParent);
 
             if (!SVGRenderSupport::pointInClippingArea(*this, localPoint))
                 return false;       
index 495b134..aa92d63 100644 (file)
@@ -316,7 +316,7 @@ void SVGRenderingContext::clipToImageBuffer(GraphicsContext& context, const Affi
 
     // 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().value_or(AffineTransform()));
+    context.concatCTM(absoluteTransform.inverse().valueOr(AffineTransform()));
     context.clipToImageBuffer(*imageBuffer, absoluteTargetRect);
     context.concatCTM(absoluteTransform);
 
index 902e54c..dfe8755 100644 (file)
@@ -1297,7 +1297,7 @@ void SVGToOTFFontConverter::processGlyphElement(const SVGElement& glyphOrMissing
     if (glyphBoundingBox)
         m_minRightSideBearing = std::min(m_minRightSideBearing, horizontalAdvance - glyphBoundingBox.value().maxX());
 
-    m_glyphs.append(GlyphData(WTFMove(path), glyphElement, horizontalAdvance, verticalAdvance, glyphBoundingBox.value_or(FloatRect()), codepoints));
+    m_glyphs.append(GlyphData(WTFMove(path), glyphElement, horizontalAdvance, verticalAdvance, glyphBoundingBox.valueOr(FloatRect()), codepoints));
 }
 
 void SVGToOTFFontConverter::appendLigatureGlyphs()
@@ -1421,7 +1421,7 @@ SVGToOTFFontConverter::SVGToOTFFontConverter(const SVGFontElement& fontElement)
             processGlyphElement(glyphElement, &glyphElement, defaultHorizontalAdvance, defaultVerticalAdvance, unicodeAttribute, boundingBox);
     }
 
-    m_boundingBox = boundingBox.value_or(FloatRect());
+    m_boundingBox = boundingBox.valueOr(FloatRect());
 
     appendLigatureGlyphs();
 
index ca9d4f1..c7aa1e9 100644 (file)
@@ -1,3 +1,20 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * Session.cpp:
+        (WebDriver::Session::handleUnexpectedAlertOpen):
+        (WebDriver::Session::computeElementLayout):
+        (WebDriver::Session::selectOptionElement):
+        (WebDriver::builtAutomationCookie):
+        (WebDriver::Session::takeScreenshot):
+        * WebDriverService.cpp:
+        (WebDriver::WebDriverService::sendResponse const):
+        (WebDriver::WebDriverService::createSession):
+
 2018-12-20  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         WebDriver: Session::findElements should handle user prompts
index 9a60d9a..9a2cb52 100644 (file)
@@ -219,7 +219,7 @@ void Session::handleUserPrompts(Function<void (CommandResult&&)>&& completionHan
 
 void Session::handleUnexpectedAlertOpen(Function<void (CommandResult&&)>&& completionHandler)
 {
-    switch (capabilities().unhandledPromptBehavior.value_or(UnhandledPromptBehavior::DismissAndNotify)) {
+    switch (capabilities().unhandledPromptBehavior.valueOr(UnhandledPromptBehavior::DismissAndNotify)) {
     case UnhandledPromptBehavior::Dismiss:
         dismissAlert(WTFMove(completionHandler));
         break;
@@ -911,7 +911,7 @@ void Session::computeElementLayout(const String& elementID, OptionSet<ElementLay
 
     RefPtr<JSON::Object> parameters = JSON::Object::create();
     parameters->setString("browsingContextHandle"_s, m_toplevelBrowsingContext.value());
-    parameters->setString("frameHandle"_s, m_currentBrowsingContext.value_or(emptyString()));
+    parameters->setString("frameHandle"_s, m_currentBrowsingContext.valueOr(emptyString()));
     parameters->setString("nodeHandle"_s, elementID);
     parameters->setBoolean("scrollIntoViewIfNeeded"_s, options.contains(ElementLayoutOption::ScrollIntoViewIfNeeded));
     parameters->setString("coordinateSystem"_s, options.contains(ElementLayoutOption::UseViewportCoordinates) ? "LayoutViewport"_s : "Page"_s);
@@ -1502,7 +1502,7 @@ void Session::selectOptionElement(const String& elementID, Function<void (Comman
 {
     RefPtr<JSON::Object> parameters = JSON::Object::create();
     parameters->setString("browsingContextHandle"_s, m_toplevelBrowsingContext.value());
-    parameters->setString("frameHandle"_s, m_currentBrowsingContext.value_or(emptyString()));
+    parameters->setString("frameHandle"_s, m_currentBrowsingContext.valueOr(emptyString()));
     parameters->setString("nodeHandle"_s, elementID);
     m_host->sendCommandToBackend("selectOptionElement"_s, WTFMove(parameters), [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) {
         if (response.isError) {
@@ -2017,12 +2017,12 @@ static RefPtr<JSON::Object> builtAutomationCookie(const Session::Cookie& cookie)
     RefPtr<JSON::Object> cookieObject = JSON::Object::create();
     cookieObject->setString("name"_s, cookie.name);
     cookieObject->setString("value"_s, cookie.value);
-    cookieObject->setString("path"_s, cookie.path.value_or("/"));
-    cookieObject->setString("domain"_s, cookie.domain.value_or(emptyString()));
-    cookieObject->setBoolean("secure"_s, cookie.secure.value_or(false));
-    cookieObject->setBoolean("httpOnly"_s, cookie.httpOnly.value_or(false));
+    cookieObject->setString("path"_s, cookie.path.valueOr("/"));
+    cookieObject->setString("domain"_s, cookie.domain.valueOr(emptyString()));
+    cookieObject->setBoolean("secure"_s, cookie.secure.valueOr(false));
+    cookieObject->setBoolean("httpOnly"_s, cookie.httpOnly.valueOr(false));
     cookieObject->setBoolean("session"_s, !cookie.expiry);
-    cookieObject->setDouble("expires"_s, cookie.expiry.value_or(0));
+    cookieObject->setDouble("expires"_s, cookie.expiry.valueOr(0));
     return cookieObject;
 }
 
@@ -2479,7 +2479,7 @@ void Session::takeScreenshot(Optional<String> elementID, Optional<bool> scrollIn
             parameters->setString("nodeHandle"_s, elementID.value());
         else
             parameters->setBoolean("clipToViewport"_s, true);
-        if (scrollIntoView.value_or(false))
+        if (scrollIntoView.valueOr(false))
             parameters->setBoolean("scrollIntoViewIfNeeded"_s, true);
         m_host->sendCommandToBackend("takeScreenshot"_s, WTFMove(parameters), [protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)](SessionHost::CommandResponse&& response) mutable {
             if (response.isError || !response.responseObject) {
index f04f4fd..e526882 100644 (file)
@@ -268,7 +268,7 @@ void WebDriverService::sendResponse(Function<void (HTTPRequestHandler::Response&
         // Let body be a new JSON Object initialised with the following properties: "error", "message", "stacktrace".
         auto errorObject = JSON::Object::create();
         errorObject->setString("error"_s, result.errorString());
-        errorObject->setString("message"_s, result.errorMessage().value_or(emptyString()));
+        errorObject->setString("message"_s, result.errorMessage().valueOr(emptyString()));
         errorObject->setString("stacktrace"_s, emptyString());
         // If the error data dictionary contains any entries, set the "data" field on body to a new JSON Object populated with the dictionary.
         if (auto& additionalData = result.additionalErrorData())
@@ -695,12 +695,12 @@ void WebDriverService::createSession(Vector<Capabilities>&& capabilitiesList, st
             resultObject->setString("sessionId"_s, m_session->id());
             RefPtr<JSON::Object> capabilitiesObject = JSON::Object::create();
             const auto& capabilities = m_session->capabilities();
-            capabilitiesObject->setString("browserName"_s, capabilities.browserName.value_or(emptyString()));
-            capabilitiesObject->setString("browserVersion"_s, capabilities.browserVersion.value_or(emptyString()));
-            capabilitiesObject->setString("platformName"_s, capabilities.platformName.value_or(emptyString()));
-            capabilitiesObject->setBoolean("acceptInsecureCerts"_s, capabilities.acceptInsecureCerts.value_or(false));
-            capabilitiesObject->setBoolean("setWindowRect"_s, capabilities.setWindowRect.value_or(true));
-            switch (capabilities.unhandledPromptBehavior.value_or(UnhandledPromptBehavior::DismissAndNotify)) {
+            capabilitiesObject->setString("browserName"_s, capabilities.browserName.valueOr(emptyString()));
+            capabilitiesObject->setString("browserVersion"_s, capabilities.browserVersion.valueOr(emptyString()));
+            capabilitiesObject->setString("platformName"_s, capabilities.platformName.valueOr(emptyString()));
+            capabilitiesObject->setBoolean("acceptInsecureCerts"_s, capabilities.acceptInsecureCerts.valueOr(false));
+            capabilitiesObject->setBoolean("setWindowRect"_s, capabilities.setWindowRect.valueOr(true));
+            switch (capabilities.unhandledPromptBehavior.valueOr(UnhandledPromptBehavior::DismissAndNotify)) {
             case UnhandledPromptBehavior::Dismiss:
                 capabilitiesObject->setString("unhandledPromptBehavior"_s, "dismiss");
                 break;
@@ -717,7 +717,7 @@ void WebDriverService::createSession(Vector<Capabilities>&& capabilitiesList, st
                 capabilitiesObject->setString("unhandledPromptBehavior"_s, "ignore");
                 break;
             }
-            switch (capabilities.pageLoadStrategy.value_or(PageLoadStrategy::Normal)) {
+            switch (capabilities.pageLoadStrategy.valueOr(PageLoadStrategy::Normal)) {
             case PageLoadStrategy::None:
                 capabilitiesObject->setString("pageLoadStrategy"_s, "none");
                 break;
index c813612..6f5c595 100644 (file)
@@ -1,3 +1,53 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * Shared/API/c/WKSecurityOriginRef.cpp:
+        (WKSecurityOriginGetPort):
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
+        (-[WKSecurityOrigin port]):
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration _cpuLimit]):
+        * UIProcess/API/glib/WebKitSecurityOrigin.cpp:
+        (webkit_security_origin_get_port):
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseHandleWheelEvent):
+        * UIProcess/Automation/SimulatedInputDispatcher.cpp:
+        (WebKit::SimulatedInputKeyFrame::maximumDuration const):
+        (WebKit::SimulatedInputDispatcher::transitionInputSourceToState):
+        * UIProcess/Automation/WebAutomationSession.cpp:
+        (WebKit::WebAutomationSession::setWindowFrameOfBrowsingContext):
+        (WebKit::WebAutomationSession::performInteractionSequence):
+        * UIProcess/Automation/WebAutomationSessionMacros.h:
+        * UIProcess/ServiceWorkerProcessProxy.cpp:
+        (WebKit::ServiceWorkerProcessProxy::start):
+        * UIProcess/WebAuthentication/AuthenticatorManager.cpp:
+        (WebKit::AuthenticatorManager::initTimeOutTimer):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::deviceScaleFactor const):
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::viewportSizeForCSSViewportUnits const):
+        * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
+        (WebKit::WebPopupMenuProxyGtk::activateItem):
+        * UIProcess/mac/LegacySessionStateCoding.cpp:
+        (WebKit::encodeFormDataElement):
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::scheduleLoad):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::convertFromPDFViewToRootView const):
+        (WebKit::PDFPlugin::boundsOnScreen const):
+        (WebKit::PDFPlugin::geometryDidChange):
+        * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
+        (WebKit::toFormData):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::updateVisibleContentRects):
+        * WebProcess/WebPage/wpe/CompositingManager.cpp:
+        (WebKit::CompositingManager::releaseConnectionFd):
+
 2018-12-20  Keith Rollin  <krollin@apple.com>
 
         Improve release-level page-load logging
index 5e6be74..d07539b 100644 (file)
@@ -76,5 +76,5 @@ WKStringRef WKSecurityOriginCopyHost(WKSecurityOriginRef securityOrigin)
 
 unsigned short WKSecurityOriginGetPort(WKSecurityOriginRef securityOrigin)
 {
-    return WebKit::toImpl(securityOrigin)->securityOrigin().port().value_or(0);
+    return WebKit::toImpl(securityOrigin)->securityOrigin().port().valueOr(0);
 }
index 4ceba88..dad1c05 100644 (file)
@@ -61,7 +61,7 @@ public:
 
     bool isAutomaticProcessWarmingEnabled() const
     {
-        return m_isAutomaticProcessWarmingEnabledByClient.value_or(m_clientWouldBenefitFromAutomaticProcessPrewarming);
+        return m_isAutomaticProcessWarmingEnabledByClient.valueOr(m_clientWouldBenefitFromAutomaticProcessPrewarming);
     }
 
     bool wasAutomaticProcessWarmingSetByClient() const { return !!m_isAutomaticProcessWarmingEnabledByClient; }
@@ -157,7 +157,7 @@ public:
 
     bool processSwapsOnNavigation() const
     {
-        return m_processSwapsOnNavigationFromClient.value_or(m_processSwapsOnNavigationFromExperimentalFeatures);
+        return m_processSwapsOnNavigationFromClient.valueOr(m_processSwapsOnNavigationFromExperimentalFeatures);
     }
     void setProcessSwapsOnNavigation(bool swaps) { m_processSwapsOnNavigationFromClient = swaps; }
     void setProcessSwapsOnNavigationFromExperimentalFeatures(bool swaps) { m_processSwapsOnNavigationFromExperimentalFeatures = swaps; }
index b7112ce..c5543a2 100644 (file)
@@ -58,7 +58,7 @@
 
 - (NSInteger)port
 {
-    return _securityOrigin->securityOrigin().port().value_or(0);
+    return _securityOrigin->securityOrigin().port().valueOr(0);
 }
 
 #pragma mark WKObject protocol implementation
index 38c91a4..de6f33e 100644 (file)
@@ -946,7 +946,7 @@ ALLOW_DEPRECATED_DECLARATIONS_END
 
 - (double)_cpuLimit
 {
-    return _pageConfiguration->cpuLimit().value_or(0);
+    return _pageConfiguration->cpuLimit().valueOr(0);
 }
 
 #endif // PLATFORM(MAC)
index e4d065f..2e0789d 100644 (file)
@@ -217,7 +217,7 @@ guint16 webkit_security_origin_get_port(WebKitSecurityOrigin* origin)
 {
     g_return_val_if_fail(origin, 0);
 
-    return origin->securityOrigin->port().value_or(0);
+    return origin->securityOrigin->port().valueOr(0);
 }
 
 /**
index 4b26b10..50f83ba 100644 (file)
@@ -815,7 +815,7 @@ static void webkitWebViewBaseHandleWheelEvent(WebKitWebViewBase* webViewBase, Gd
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
     ASSERT(!priv->dialog);
     if (phase)
-        priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(event, phase.value(), momentum.value_or(WebWheelEvent::Phase::PhaseNone)));
+        priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(event, phase.value(), momentum.valueOr(WebWheelEvent::Phase::PhaseNone)));
     else
         priv->pageProxy->handleWheelEvent(NativeWebWheelEvent(event));
 }
index dbe8397..0590c57 100644 (file)
@@ -59,7 +59,7 @@ Seconds SimulatedInputKeyFrame::maximumDuration() const
     // The "compute the tick duration" algorithm (§17.4 Dispatching Actions).
     Seconds result;
     for (auto& entry : states)
-        result = std::max(result, entry.second.duration.value_or(Seconds(0)));
+        result = std::max(result, entry.second.duration.valueOr(Seconds(0)));
     
     return result;
 }
@@ -259,7 +259,7 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource
         eventDispatchFinished(WTF::nullopt);
         break;
     case SimulatedInputSourceType::Mouse: {
-        resolveLocation(a.location.value_or(WebCore::IntPoint()), b.location, b.origin.value_or(MouseMoveOrigin::Viewport), b.nodeHandle, [this, &a, &b, eventDispatchFinished = WTFMove(eventDispatchFinished)](Optional<WebCore::IntPoint> location, Optional<AutomationCommandError> error) mutable {
+        resolveLocation(a.location.valueOr(WebCore::IntPoint()), b.location, b.origin.valueOr(MouseMoveOrigin::Viewport), b.nodeHandle, [this, &a, &b, eventDispatchFinished = WTFMove(eventDispatchFinished)](Optional<WebCore::IntPoint> location, Optional<AutomationCommandError> error) mutable {
             if (error) {
                 eventDispatchFinished(error);
                 return;
@@ -282,7 +282,7 @@ void SimulatedInputDispatcher::transitionInputSourceToState(SimulatedInputSource
             } else if (a.location != b.location) {
                 LOG(Automation, "SimulatedInputDispatcher[%p]: simulating MouseMove for transition to %d.%d", this, m_keyframeIndex, m_inputSourceStateIndex);
                 // FIXME: This does not interpolate mousemoves per the "perform a pointer move" algorithm (§17.4 Dispatching Actions).
-                m_client.simulateMouseInteraction(m_page, MouseInteraction::Move, b.pressedMouseButton.value_or(MouseButton::NoButton), b.location.value(), WTFMove(eventDispatchFinished));
+                m_client.simulateMouseInteraction(m_page, MouseInteraction::Move, b.pressedMouseButton.valueOr(MouseButton::NoButton), b.location.value(), WTFMove(eventDispatchFinished));
             } else
                 eventDispatchFinished(WTF::nullopt);
         });
index 370b21e..57df5f3 100644 (file)
@@ -387,7 +387,7 @@ void WebAutomationSession::setWindowFrameOfBrowsingContext(const String& handle,
         this->restoreWindowForPage(webPage, [callback = WTFMove(callback), page = WTFMove(page), width, height, x, y]() mutable {
             auto& webPage = *page;
             webPage.getWindowFrameWithCallback([callback = WTFMove(callback), page = WTFMove(page), width, height, x, y](WebCore::FloatRect originalFrame) mutable {
-                WebCore::FloatRect newFrame = WebCore::FloatRect(WebCore::FloatPoint(x.value_or(originalFrame.location().x()), y.value_or(originalFrame.location().y())), WebCore::FloatSize(width.value_or(originalFrame.size().width()), height.value_or(originalFrame.size().height())));
+                WebCore::FloatRect newFrame = WebCore::FloatRect(WebCore::FloatPoint(x.valueOr(originalFrame.location().x()), y.valueOr(originalFrame.location().y())), WebCore::FloatSize(width.valueOr(originalFrame.size().width()), height.valueOr(originalFrame.size().height())));
                 if (newFrame != originalFrame)
                     page->setWindowFrame(newFrame);
                 
@@ -1834,7 +1834,7 @@ void WebAutomationSession::performInteractionSequence(const String& handle, cons
             String pressedButtonString;
             if (stateObject->getString("pressedButton"_s, pressedButtonString)) {
                 auto protocolButton = Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::MouseButton>(pressedButtonString);
-                sourceState.pressedMouseButton = protocolMouseButtonToWebMouseEventButton(protocolButton.value_or(Inspector::Protocol::Automation::MouseButton::None));
+                sourceState.pressedMouseButton = protocolMouseButtonToWebMouseEventButton(protocolButton.valueOr(Inspector::Protocol::Automation::MouseButton::None));
             }
 
             String originString;
index 3487fa9..93af5ab 100644 (file)
@@ -28,7 +28,7 @@
 #define 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).value_or(Inspector::Protocol::Automation::ErrorMessage::InternalError)
+#define VALIDATED_ERROR_MESSAGE(errorString) Inspector::Protocol::AutomationHelpers::parseEnumValueFromString<Inspector::Protocol::Automation::ErrorMessage>(errorString).valueOr(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)
index 86206ba..726883b 100644 (file)
@@ -77,7 +77,7 @@ void ServiceWorkerProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions&
 
 void ServiceWorkerProcessProxy::start(const WebPreferencesStore& store, Optional<PAL::SessionID> initialSessionID)
 {
-    send(Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerPageID, store, initialSessionID.value_or(PAL::SessionID::defaultSessionID()) }, 0);
+    send(Messages::WebProcess::EstablishWorkerContextConnectionToNetworkProcess { processPool().defaultPageGroup().pageGroupID(), m_serviceWorkerPageID, store, initialSessionID.valueOr(PAL::SessionID::defaultSessionID()) }, 0);
 }
 
 void ServiceWorkerProcessProxy::setUserAgent(const String& userAgent)
index b4e2399..73f55a4 100644 (file)
@@ -224,7 +224,7 @@ void AuthenticatorManager::initTimeOutTimer(const Optional<unsigned>& timeOutInM
 {
     using namespace AuthenticatorManagerInternal;
 
-    unsigned timeOutInMsValue = std::min(maxTimeOutValue, timeOutInMs.value_or(maxTimeOutValue));
+    unsigned timeOutInMsValue = std::min(maxTimeOutValue, timeOutInMs.valueOr(maxTimeOutValue));
     // FIXME(192061)
     LOG_ERROR("Start timer. %d", timeOutInMsValue);
     m_requestTimeOutTimer.startOneShot(Seconds::fromMilliseconds(timeOutInMsValue));
index a3918eb..aa3bcaa 100644 (file)
@@ -3119,7 +3119,7 @@ void WebPageProxy::windowScreenDidChange(PlatformDisplayID displayID)
 
 float WebPageProxy::deviceScaleFactor() const
 {
-    return m_customDeviceScaleFactor.value_or(m_intrinsicDeviceScaleFactor);
+    return m_customDeviceScaleFactor.valueOr(m_intrinsicDeviceScaleFactor);
 }
 
 void WebPageProxy::setCustomDeviceScaleFactor(float customScaleFactor)
index 156f144..01bea50 100644 (file)
@@ -1169,7 +1169,7 @@ public:
     void setAutoSizingShouldExpandToViewHeight(bool);
 
     void setViewportSizeForCSSViewportUnits(const WebCore::IntSize&);
-    WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.value_or(WebCore::IntSize()); }
+    WebCore::IntSize viewportSizeForCSSViewportUnits() const { return m_viewportSizeForCSSViewportUnits.valueOr(WebCore::IntSize()); }
 
     void didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&&);
 
index a6b1c91..e74601c 100644 (file)
@@ -69,7 +69,7 @@ void WebPopupMenuProxyGtk::selectItem(unsigned itemIndex)
 void WebPopupMenuProxyGtk::activateItem(Optional<unsigned> itemIndex)
 {
     if (m_client)
-        m_client->valueChangedForPopupMenu(this, itemIndex.value_or(m_selectedItem.value_or(-1)));
+        m_client->valueChangedForPopupMenu(this, itemIndex.valueOr(m_selectedItem.valueOr(-1)));
 }
 
 bool WebPopupMenuProxyGtk::activateItemAtPath(GtkTreePath* path)
index 01c6069..ea6c377 100644 (file)
@@ -284,8 +284,8 @@ static void encodeFormDataElement(HistoryEntryDataEncoder& encoder, const HTTPBo
         encoder << false;
 
         encoder << element.fileStart;
-        encoder << element.fileLength.value_or(-1);
-        encoder << element.expectedFileModificationTime.value_or(WallTime::nan()).secondsSinceEpoch().value();
+        encoder << element.fileLength.valueOr(-1);
+        encoder << element.expectedFileModificationTime.valueOr(WallTime::nan()).secondsSinceEpoch().value();
         break;
 
     case HTTPBody::Element::Type::Blob:
index 3ddc4f8..fe14cab 100644 (file)
@@ -156,8 +156,8 @@ void WebLoaderStrategy::scheduleLoad(ResourceLoader& resourceLoader, CachedResou
     auto& frameLoaderClient = resourceLoader.frameLoader()->client();
 
     WebResourceLoader::TrackingParameters trackingParameters;
-    trackingParameters.pageID = frameLoaderClient.pageID().value_or(0);
-    trackingParameters.frameID = frameLoaderClient.frameID().value_or(0);
+    trackingParameters.pageID = frameLoaderClient.pageID().valueOr(0);
+    trackingParameters.frameID = frameLoaderClient.frameID().valueOr(0);
     trackingParameters.resourceID = identifier;
     auto sessionID = frameLoaderClient.sessionID();
 
index e888457..c398ebe 100644 (file)
@@ -1286,7 +1286,7 @@ IntPoint PDFPlugin::convertFromRootViewToPlugin(const IntPoint& point) const
 IntPoint PDFPlugin::convertFromPDFViewToRootView(const IntPoint& point) const
 {
     IntPoint pointInPluginCoordinates(point.x(), size().height() - point.y());
-    return m_rootViewToPluginTransform.inverse().value_or(AffineTransform()).mapPoint(pointInPluginCoordinates);
+    return m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapPoint(pointInPluginCoordinates);
 }
     
 IntPoint PDFPlugin::convertFromRootViewToPDFView(const IntPoint& point) const
@@ -1315,7 +1315,7 @@ IntRect PDFPlugin::boundsOnScreen() const
         return IntRect();
 
     FloatRect bounds = FloatRect(FloatPoint(), size());
-    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().value_or(AffineTransform()).mapRect(bounds);
+    FloatRect rectInRootViewCoordinates = m_rootViewToPluginTransform.inverse().valueOr(AffineTransform()).mapRect(bounds);
     return frameView->contentsToScreen(enclosingIntRect(rectInRootViewCoordinates));
 }
 
@@ -1325,7 +1325,7 @@ void PDFPlugin::geometryDidChange(const IntSize& pluginSize, const IntRect&, con
         return;
 
     m_size = pluginSize;
-    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().value_or(AffineTransform());
+    m_rootViewToPluginTransform = pluginToRootViewTransform.inverse().valueOr(AffineTransform());
     [m_pdfLayerController setFrameSize:pluginSize];
 
     [CATransaction begin];
index f283c72..400d832 100644 (file)
@@ -128,7 +128,7 @@ static Ref<FormData> toFormData(const HTTPBody& httpBody)
             break;
 
         case HTTPBody::Element::Type::File:
-            formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.value_or(BlobDataItem::toEndOfFile), element.expectedFileModificationTime);
+            formData->appendFileRange(element.filePath, element.fileStart, element.fileLength.valueOr(BlobDataItem::toEndOfFile), element.expectedFileModificationTime);
             break;
 
         case HTTPBody::Element::Type::Blob:
index c1502ac..f881fce 100644 (file)
@@ -2988,7 +2988,7 @@ void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visi
             m_oldestNonStableUpdateVisibleContentRectsTimestamp = oldestTimestamp;
     }
 
-    float scaleToUse = scaleFromUIProcess.value_or(m_page->pageScaleFactor());
+    float scaleToUse = scaleFromUIProcess.valueOr(m_page->pageScaleFactor());
     FloatRect exposedContentRect = visibleContentRectUpdateInfo.exposedContentRect();
     FloatRect adjustedExposedContentRect = adjustExposedRectForNewScale(exposedContentRect, visibleContentRectUpdateInfo.scale(), scaleToUse);
     m_drawingArea->setExposedContentRect(adjustedExposedContentRect);
index 9fb0104..d515a0b 100644 (file)
@@ -47,7 +47,7 @@ void CompositingManager::establishConnection(WebPage& webPage)
 
 int CompositingManager::releaseConnectionFd()
 {
-    int fd = m_connectionFd.value_or(-1);
+    int fd = m_connectionFd.valueOr(-1);
     m_connectionFd = WTF::nullopt;
     return fd;
 }
index edbeb51..115f7f6 100644 (file)
@@ -1,3 +1,13 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * WebCoreSupport/WebSecurityOrigin.mm:
+        (-[WebSecurityOrigin port]):
+
 2018-12-20  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r239417.
index 067f56c..b66948a 100644 (file)
@@ -88,7 +88,7 @@ using namespace WebCore;
 
 - (unsigned short)port
 {
-    return reinterpret_cast<SecurityOrigin*>(_private)->port().value_or(0);
+    return reinterpret_cast<SecurityOrigin*>(_private)->port().valueOr(0);
 }
 
 // FIXME: Overriding isEqual: without overriding hash will cause trouble if this ever goes into an NSSet or is the key in an NSDictionary,
index f6c126b..ba43450 100644 (file)
@@ -1,3 +1,13 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * WebSecurityOrigin.cpp:
+        (WebSecurityOrigin::port):
+
 2018-12-19  Chris Dumez  <cdumez@apple.com>
 
         wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
index 945b869..57ca80e 100644 (file)
@@ -120,7 +120,7 @@ HRESULT WebSecurityOrigin::port(_Out_ unsigned short* result)
     if (!result)
         return E_POINTER;
 
-    *result = m_securityOrigin->port().value_or(0);
+    *result = m_securityOrigin->port().valueOr(0);
 
     return S_OK;
 }
index ef554be..2b84345 100644 (file)
@@ -1,3 +1,18 @@
+2018-12-20  Chris Dumez  <cdumez@apple.com>
+
+        Use Optional::valueOr() instead of Optional::value_or()
+        https://bugs.webkit.org/show_bug.cgi?id=192933
+
+        Reviewed by Geoffrey Garen.
+
+        * TestWebKitAPI/Tests/WTF/URLParser.cpp:
+        (TestWebKitAPI::checkURL):
+        (TestWebKitAPI::checkRelativeURL):
+        (TestWebKitAPI::checkURLDifferences):
+        (TestWebKitAPI::checkRelativeURLDifferences):
+        * TestWebKitAPI/Tests/WebCore/URLParserTextEncoding.cpp:
+        (TestWebKitAPI::checkURL):
+
 2018-12-20  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r239417.
index f8085d0..fb9fe64 100644 (file)
@@ -94,7 +94,7 @@ static void checkURL(const String& urlString, const ExpectedParts& parts, TestTa
     EXPECT_TRUE(eq(parts.user, url.user()));
     EXPECT_TRUE(eq(parts.password, url.pass()));
     EXPECT_TRUE(eq(parts.host, url.host()));
-    EXPECT_EQ(parts.port, url.port().value_or(0));
+    EXPECT_EQ(parts.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(parts.path, url.path()));
     EXPECT_TRUE(eq(parts.query, url.query()));
     EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier()));
@@ -121,7 +121,7 @@ static void checkRelativeURL(const String& urlString, const String& baseURLStrin
     EXPECT_TRUE(eq(parts.user, url.user()));
     EXPECT_TRUE(eq(parts.password, url.pass()));
     EXPECT_TRUE(eq(parts.host, url.host()));
-    EXPECT_EQ(parts.port, url.port().value_or(0));
+    EXPECT_EQ(parts.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(parts.path, url.path()));
     EXPECT_TRUE(eq(parts.query, url.query()));
     EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier()));
@@ -150,7 +150,7 @@ static void checkURLDifferences(const String& urlString, const ExpectedParts& pa
     EXPECT_TRUE(eq(partsNew.user, url.user()));
     EXPECT_TRUE(eq(partsNew.password, url.pass()));
     EXPECT_TRUE(eq(partsNew.host, url.host()));
-    EXPECT_EQ(partsNew.port, url.port().value_or(0));
+    EXPECT_EQ(partsNew.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(partsNew.path, url.path()));
     EXPECT_TRUE(eq(partsNew.query, url.query()));
     EXPECT_TRUE(eq(partsNew.fragment, url.fragmentIdentifier()));
@@ -179,7 +179,7 @@ static void checkRelativeURLDifferences(const String& urlString, const String& b
     EXPECT_TRUE(eq(partsNew.user, url.user()));
     EXPECT_TRUE(eq(partsNew.password, url.pass()));
     EXPECT_TRUE(eq(partsNew.host, url.host()));
-    EXPECT_EQ(partsNew.port, url.port().value_or(0));
+    EXPECT_EQ(partsNew.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(partsNew.path, url.path()));
     EXPECT_TRUE(eq(partsNew.query, url.query()));
     EXPECT_TRUE(eq(partsNew.fragment, url.fragmentIdentifier()));
index f892853..f6c3dea 100644 (file)
@@ -96,7 +96,7 @@ static void checkURL(const String& urlString, const TextEncoding* encoding, cons
     EXPECT_TRUE(eq(parts.user, url.user()));
     EXPECT_TRUE(eq(parts.password, url.pass()));
     EXPECT_TRUE(eq(parts.host, url.host()));
-    EXPECT_EQ(parts.port, url.port().value_or(0));
+    EXPECT_EQ(parts.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(parts.path, url.path()));
     EXPECT_TRUE(eq(parts.query, url.query()));
     EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier()));
@@ -120,7 +120,7 @@ static void checkURL(const String& urlString, const String& baseURLString, const
     EXPECT_TRUE(eq(parts.user, url.user()));
     EXPECT_TRUE(eq(parts.password, url.pass()));
     EXPECT_TRUE(eq(parts.host, url.host()));
-    EXPECT_EQ(parts.port, url.port().value_or(0));
+    EXPECT_EQ(parts.port, url.port().valueOr(0));
     EXPECT_TRUE(eq(parts.path, url.path()));
     EXPECT_TRUE(eq(parts.query, url.query()));
     EXPECT_TRUE(eq(parts.fragment, url.fragmentIdentifier()));