Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (247101 => 247102)
--- trunk/Source/_javascript_Core/ChangeLog 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1,3 +1,24 @@
+2019-07-03 Sam Weinig <wei...@apple.com>
+
+ Adopt simple structured bindings in more places
+ https://bugs.webkit.org/show_bug.cgi?id=199247
+
+ Reviewed by Alex Christensen.
+
+ Replaces simple uses of std::tie() with structured bindings. Does not touch
+ uses of std::tie() that are not initial declarations, use std::ignore or in
+ case where the binding is captured by a lambda, as structured bindings don't
+ work for those cases yet.
+
+ * runtime/PromiseDeferredTimer.cpp:
+ (JSC::PromiseDeferredTimer::doWork):
+ * wasm/WasmFaultSignalHandler.cpp:
+ (JSC::Wasm::trapHandler):
+ * wasm/js/JSWebAssemblyHelpers.h:
+ (JSC::createSourceBufferFromValue):
+ * wasm/js/WebAssemblyPrototype.cpp:
+ (JSC::webAssemblyValidateFunc):
+
2019-07-03 Keith Miller <keith_mil...@apple.com>
PACCage should first cage leaving PAC bits intact then authenticate
Modified: trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp (247101 => 247102)
--- trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/_javascript_Core/runtime/PromiseDeferredTimer.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -54,9 +54,7 @@
}
while (!m_tasks.isEmpty()) {
- JSPromiseDeferred* ticket;
- Task task;
- std::tie(ticket, task) = m_tasks.takeLast();
+ auto [ticket, task] = m_tasks.takeLast();
dataLogLnIf(PromiseDeferredTimerInternal::verbose, "Doing work on promise: ", RawPointer(ticket));
// We may have already canceled these promises.
Modified: trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp (247101 => 247102)
--- trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/_javascript_Core/wasm/WasmFaultSignalHandler.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -77,10 +77,7 @@
if (faultedInActiveFastMemory) {
dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "found active fast memory for faulting address");
LockHolder locker(codeLocationsLock);
- for (auto range : codeLocations.get()) {
- void* start;
- void* end;
- std::tie(start, end) = range;
+ for (auto [start, end] : codeLocations.get()) {
dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "function start: ", RawPointer(start), " end: ", RawPointer(end));
if (start <= faultingInstruction && faultingInstruction < end) {
dataLogLnIf(WasmFaultSignalHandlerInternal::verbose, "found match");
Modified: trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h (247101 => 247102)
--- trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/_javascript_Core/wasm/js/JSWebAssemblyHelpers.h 2019-07-03 20:46:41 UTC (rev 247102)
@@ -83,9 +83,7 @@
ALWAYS_INLINE Vector<uint8_t> createSourceBufferFromValue(VM& vm, ExecState* exec, JSValue value)
{
auto throwScope = DECLARE_THROW_SCOPE(vm);
- const uint8_t* data;
- size_t byteSize;
- std::tie(data, byteSize) = getWasmBufferFromValue(exec, value);
+ auto [data, byteSize] = getWasmBufferFromValue(exec, value);
RETURN_IF_EXCEPTION(throwScope, Vector<uint8_t>());
Vector<uint8_t> result;
Modified: trunk/Source/_javascript_Core/wasm/js/WebAssemblyPrototype.cpp (247101 => 247102)
--- trunk/Source/_javascript_Core/wasm/js/WebAssemblyPrototype.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/_javascript_Core/wasm/js/WebAssemblyPrototype.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -290,9 +290,7 @@
VM& vm = exec->vm();
auto scope = DECLARE_THROW_SCOPE(vm);
- const uint8_t* base;
- size_t byteSize;
- std::tie(base, byteSize) = getWasmBufferFromValue(exec, exec->argument(0));
+ auto [base, byteSize] = getWasmBufferFromValue(exec, exec->argument(0));
RETURN_IF_EXCEPTION(scope, encodedJSValue());
BBQPlan plan(&vm.wasmContext, BBQPlan::Validation, Plan::dontFinalize());
// FIXME: We might want to throw an OOM exception here if we detect that something will OOM.
Modified: trunk/Source/WebCore/ChangeLog (247101 => 247102)
--- trunk/Source/WebCore/ChangeLog 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/ChangeLog 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1,3 +1,44 @@
+2019-07-03 Sam Weinig <wei...@apple.com>
+
+ Adopt simple structured bindings in more places
+ https://bugs.webkit.org/show_bug.cgi?id=199247
+
+ Reviewed by Alex Christensen.
+
+ Replaces simple uses of std::tie() with structured bindings. Does not touch
+ uses of std::tie() that are not initial declarations, use std::ignore or in
+ case where the binding is captured by a lambda, as structured bindings don't
+ work for those cases yet.
+
+ * css/StyleResolver.cpp:
+ (WebCore::checkForOrientationChange):
+ * page/csp/ContentSecurityPolicy.cpp:
+ (WebCore::ContentSecurityPolicy::allowInlineScript const):
+ (WebCore::ContentSecurityPolicy::allowInlineStyle const):
+ * platform/graphics/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+ * platform/graphics/PathUtilities.cpp:
+ (WebCore::PathUtilities::pathWithShrinkWrappedRectsForOutline):
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advanceInternal):
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::FontCache::createFontPlatformData):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::lastResortFallbackFont):
+ * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
+ (WebCore::FontFamilySpecificationCoreText::fontRanges const):
+ * platform/network/SocketStreamHandleImpl.cpp:
+ (WebCore::cookieDataForHandshake):
+ * rendering/InlineTextBox.cpp:
+ (WebCore::InlineTextBox::selectionState):
+ (WebCore::createMarkedTextFromSelectionInBox):
+ * rendering/svg/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::paintSelectionBackground):
+ * style/StyleResolveForDocument.cpp:
+ (WebCore::Style::resolveForDocument):
+ * svg/animation/SVGSMILElement.cpp:
+ (WebCore::SVGSMILElement::constructAttributeName const):
+
2019-07-03 Wenson Hsieh <wenson_hs...@apple.com>
REGRESSION (iOS 13): Tapping an element with a click event handler no longer clears the selection
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (247101 => 247102)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1199,9 +1199,7 @@
static void checkForOrientationChange(RenderStyle& style)
{
- FontOrientation fontOrientation;
- NonCJKGlyphOrientation glyphOrientation;
- std::tie(fontOrientation, glyphOrientation) = style.fontAndGlyphOrientation();
+ auto [fontOrientation, glyphOrientation] = style.fontAndGlyphOrientation();
const auto& fontDescription = style.fontDescription();
if (fontDescription.orientation() == fontOrientation && fontDescription.nonCJKGlyphOrientation() == glyphOrientation)
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp (247101 => 247102)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -427,9 +427,7 @@
if (overrideContentSecurityPolicy)
return true;
bool didNotifyInspector = false;
- bool foundHashInEnforcedPolicies;
- bool foundHashInReportOnlyPolicies;
- std::tie(foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies) = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, scriptContent, m_hashAlgorithmsForInlineScripts);
+ auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForScriptHash, scriptContent, m_hashAlgorithmsForInlineScripts);
if (foundHashInEnforcedPolicies && foundHashInReportOnlyPolicies)
return true;
auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) {
@@ -453,9 +451,7 @@
return true;
if (m_overrideInlineStyleAllowed)
return true;
- bool foundHashInEnforcedPolicies;
- bool foundHashInReportOnlyPolicies;
- std::tie(foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies) = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, styleContent, m_hashAlgorithmsForInlineStylesheets);
+ auto [foundHashInEnforcedPolicies, foundHashInReportOnlyPolicies] = findHashOfContentInPolicies(&ContentSecurityPolicyDirectiveList::violatedDirectiveForStyleHash, styleContent, m_hashAlgorithmsForInlineStylesheets);
if (foundHashInEnforcedPolicies && foundHashInReportOnlyPolicies)
return true;
auto handleViolatedDirective = [&] (const ContentSecurityPolicyDirective& violatedDirective) {
Modified: trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/graphics/ComplexTextController.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -788,8 +788,7 @@
if (treatAsSpace || ideograph || forceLeadingExpansion || forceTrailingExpansion) {
// Distribute the run's total expansion evenly over all expansion opportunities in the run.
if (m_expansion) {
- bool expandLeft, expandRight;
- std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), afterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
+ auto [expandLeft, expandRight] = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), afterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
if (expandLeft) {
m_expansion -= m_expansionPerOpportunity;
// Increase previous width
Modified: trunk/Source/WebCore/platform/graphics/PathUtilities.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/graphics/PathUtilities.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/graphics/PathUtilities.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -580,14 +580,10 @@
continue;
}
}
- FloatPoint startPoint;
- FloatPoint endPoint;
- std::tie(startPoint, endPoint) = startAndEndPointsForCorner(fromEdge, toEdge, radius);
+ auto [startPoint, endPoint] = startAndEndPointsForCorner(fromEdge, toEdge, radius);
moveOrAddLineTo(startPoint);
- FloatPoint cp1;
- FloatPoint cp2;
- std::tie(cp1, cp2) = controlPointsForBezierCurve(corner, fromEdge, toEdge, radius);
+ auto [cp1, cp2] = controlPointsForBezierCurve(corner, fromEdge, toEdge, radius);
path.addBezierCurveTo(cp1, cp2, endPoint);
}
path.closeSubpath();
Modified: trunk/Source/WebCore/platform/graphics/WidthIterator.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/graphics/WidthIterator.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/graphics/WidthIterator.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -276,8 +276,7 @@
if (treatAsSpace || ideograph || forceLeadingExpansion || forceTrailingExpansion) {
// Distribute the run's total expansion evenly over all expansion opportunities in the run.
if (m_expansion) {
- bool expandLeft, expandRight;
- std::tie(expandLeft, expandRight) = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), m_isAfterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
+ auto [expandLeft, expandRight] = expansionLocation(ideograph, treatAsSpace, m_run.ltr(), m_isAfterExpansion, forbidLeadingExpansion, forbidTrailingExpansion, forceLeadingExpansion, forceTrailingExpansion);
if (expandLeft) {
if (m_run.ltr()) {
// Increase previous width
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1308,8 +1308,7 @@
if (fontDescription.shouldAllowUserInstalledFonts() == AllowUserInstalledFonts::No)
m_seenFamiliesForPrewarming.add(FontCascadeDescription::foldedFamilyName(family));
- bool syntheticBold, syntheticOblique;
- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair();
+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair();
return std::make_unique<FontPlatformData>(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
}
@@ -1409,8 +1408,7 @@
// font pointer.
CTFontRef substituteFont = fallbackDedupSet().add(result).iterator->get();
- bool syntheticBold, syntheticOblique;
- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(substituteFont, description, isForPlatformFont == IsForPlatformFont::Yes).boldObliquePair();
+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(substituteFont, description, isForPlatformFont == IsForPlatformFont::Yes).boldObliquePair();
FontPlatformData alternateFont(substituteFont, platformData.size(), syntheticBold, syntheticOblique, platformData.orientation(), platformData.widthVariant(), platformData.textRenderingMode());
@@ -1546,8 +1544,7 @@
// a thin wrapper around a GraphicsFont which represents LastResort.
auto font = adoptCF(CTFontCreateWithName(CFSTR("Helvetica"), fontDescription.computedPixelSize(), nullptr));
#endif
- bool syntheticBold, syntheticOblique;
- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair();
+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(font.get(), fontDescription).boldObliquePair();
FontPlatformData platformData(font.get(), fontDescription.computedPixelSize(), syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
return fontForPlatformData(platformData);
}
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -110,8 +110,7 @@
font = preparePlatformFont(font.get(), fontDescription, nullptr, nullptr, { });
- bool syntheticBold, syntheticOblique;
- std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair();
+ auto [syntheticBold, syntheticOblique] = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair();
return std::make_unique<FontPlatformData>(font.get(), size, false, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
}).iterator->value;
Modified: trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp (247101 => 247102)
--- trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/platform/network/SocketStreamHandleImpl.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -82,9 +82,7 @@
if (!networkStorageSession)
return WTF::nullopt;
- String cookieDataString;
- bool secureCookiesAccessed = false;
- std::tie(cookieDataString, secureCookiesAccessed) = networkStorageSession->cookieRequestHeaderFieldValue(headerFieldProxy);
+ auto [cookieDataString, secureCookiesAccessed] = networkStorageSession->cookieRequestHeaderFieldValue(headerFieldProxy);
if (cookieDataString.isEmpty())
return std::pair<Vector<uint8_t>, bool> { { }, secureCookiesAccessed };
Modified: trunk/Source/WebCore/rendering/InlineTextBox.cpp (247101 => 247102)
--- trunk/Source/WebCore/rendering/InlineTextBox.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/rendering/InlineTextBox.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -180,9 +180,7 @@
if (m_truncation != cNoTruncation && root().ellipsisBox()) {
EllipsisBox* ellipsis = root().ellipsisBox();
if (state != RenderObject::SelectionNone) {
- unsigned selectionStart;
- unsigned selectionEnd;
- std::tie(selectionStart, selectionEnd) = selectionStartEnd();
+ auto [selectionStart, selectionEnd] = selectionStartEnd();
// The ellipsis should be considered to be selected if the end of
// the selection is past the beginning of the truncation and the
// beginning of the selection is before or at the beginning of the
@@ -438,9 +436,7 @@
static MarkedText createMarkedTextFromSelectionInBox(const InlineTextBox& box)
{
- unsigned selectionStart;
- unsigned selectionEnd;
- std::tie(selectionStart, selectionEnd) = box.selectionStartEnd();
+ auto [selectionStart, selectionEnd] = box.selectionStartEnd();
if (selectionStart < selectionEnd)
return { selectionStart, selectionEnd, MarkedText::Selection };
return { };
Modified: trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp (247101 => 247102)
--- trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -202,9 +202,7 @@
auto& style = parentRenderer.style();
- unsigned startPosition;
- unsigned endPosition;
- std::tie(startPosition, endPosition) = selectionStartEnd();
+ auto [startPosition, endPosition] = selectionStartEnd();
unsigned fragmentStartPosition = 0;
unsigned fragmentEndPosition = 0;
Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (247101 => 247102)
--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -117,9 +117,7 @@
bool useSVGZoomRules = document.isSVGDocument();
fontDescription.setComputedSize(computedFontSizeFromSpecifiedSize(size, fontDescription.isAbsoluteSize(), useSVGZoomRules, &documentStyle, document));
- FontOrientation fontOrientation;
- NonCJKGlyphOrientation glyphOrientation;
- std::tie(fontOrientation, glyphOrientation) = documentStyle.fontAndGlyphOrientation();
+ auto [fontOrientation, glyphOrientation] = documentStyle.fontAndGlyphOrientation();
fontDescription.setOrientation(fontOrientation);
fontDescription.setNonCJKGlyphOrientation(glyphOrientation);
Modified: trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp (247101 => 247102)
--- trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebCore/svg/animation/SVGSMILElement.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -219,8 +219,7 @@
if (parseResult.hasException())
return anyQName();
- AtomString prefix, localName;
- std::tie(prefix, localName) = parseResult.releaseReturnValue();
+ auto [prefix, localName] = parseResult.releaseReturnValue();
if (prefix.isNull())
return { nullAtom(), localName, nullAtom() };
Modified: trunk/Source/WebKit/ChangeLog (247101 => 247102)
--- trunk/Source/WebKit/ChangeLog 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/ChangeLog 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1,3 +1,55 @@
+2019-07-03 Sam Weinig <wei...@apple.com>
+
+ Adopt simple structured bindings in more places
+ https://bugs.webkit.org/show_bug.cgi?id=199247
+
+ Reviewed by Alex Christensen.
+
+ Replaces simple uses of std::tie() with structured bindings. Does not touch
+ uses of std::tie() that are not initial declarations, use std::ignore or in
+ case where the binding is captured by a lambda, as structured bindings don't
+ work for those cases yet.
+
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::printSpeculativeLoadingDiagnosticMessageCounts):
+ * NetworkProcess/cache/PrefetchCache.cpp:
+ (WebKit::PrefetchCache::clearExpiredEntries):
+ * Platform/IPC/MessageReceiverMap.cpp:
+ (IPC::MessageReceiverMap::removeMessageReceiver):
+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
+ (WebKit::PlaybackSessionManagerProxy::invalidate):
+ * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
+ (WebKit::VideoFullscreenManagerProxy::invalidate):
+ (WebKit::VideoFullscreenManagerProxy::requestHideAndExitFullscreen):
+ (WebKit::VideoFullscreenManagerProxy::hasMode const):
+ (WebKit::VideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture const):
+ (WebKit::VideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen const):
+ (WebKit::VideoFullscreenManagerProxy::applicationDidBecomeActive):
+ (WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
+ (WebKit::VideoFullscreenManagerProxy::didCleanupFullscreen):
+ * UIProcess/ios/SmartMagnificationController.mm:
+ (WebKit::SmartMagnificationController::zoomFactorForTargetRect):
+ (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
+ (WebKit::SmartMagnificationController::magnify):
+ * WebProcess/Plugins/PDF/PDFPlugin.mm:
+ (WebKit:: const):
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::performDictionaryLookupAtLocation):
+ (WebKit::WebPage::performDictionaryLookupForSelection):
+ * WebProcess/cocoa/PlaybackSessionManager.mm:
+ (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
+ (WebKit::PlaybackSessionManager::removeContext):
+ * WebProcess/cocoa/VideoFullscreenManager.mm:
+ (WebKit::VideoFullscreenManager::~VideoFullscreenManager):
+ (WebKit::VideoFullscreenManager::removeContext):
+ (WebKit::VideoFullscreenManager::enterVideoFullscreenForVideoElement):
+ (WebKit::VideoFullscreenManager::requestVideoContentLayer):
+ (WebKit::VideoFullscreenManager::didSetupFullscreen):
+ (WebKit::VideoFullscreenManager::willExitFullscreen):
+ (WebKit::VideoFullscreenManager::didEnterFullscreen):
+ (WebKit::VideoFullscreenManager::didCleanupFullscreen):
+ (WebKit::VideoFullscreenManager::setVideoLayerFrameFenced):
+
2019-07-03 Zalan Bujtas <za...@apple.com>
[ContentChangeObserver] REGRESSION (r244356): Drop down menus collapse without user input - Ebay.com
Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (247101 => 247102)
--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -59,8 +59,8 @@
static void printSpeculativeLoadingDiagnosticMessageCounts()
{
LOG(NetworkCacheSpeculativePreloading, "-- Speculative loading statistics --");
- for (auto& pair : allSpeculativeLoadingDiagnosticMessages())
- LOG(NetworkCacheSpeculativePreloading, "%s: %u", pair.key.utf8().data(), pair.value);
+ for (auto& [message, count] : allSpeculativeLoadingDiagnosticMessages())
+ LOG(NetworkCacheSpeculativePreloading, "%s: %u", message.utf8().data(), count);
}
#endif
Modified: trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp (247101 => 247102)
--- trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/NetworkProcess/cache/PrefetchCache.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -96,11 +96,9 @@
void PrefetchCache::clearExpiredEntries()
{
- URL requestUrl;
- WallTime timestamp;
auto timeout = WallTime::now();
while (!m_sessionExpirationList.isEmpty()) {
- std::tie(requestUrl, timestamp) = m_sessionExpirationList.first();
+ auto [requestUrl, timestamp] = m_sessionExpirationList.first();
auto* resources = m_sessionPrefetches.get();
ASSERT(resources);
ASSERT(resources->contains(requestUrl));
Modified: trunk/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp (247101 => 247102)
--- trunk/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/Platform/IPC/MessageReceiverMap.cpp 2019-07-03 20:46:41 UTC (rev 247102)
@@ -80,9 +80,9 @@
void MessageReceiverMap::removeMessageReceiver(MessageReceiver& messageReceiver)
{
Vector<StringReference> globalReceiversToRemove;
- for (auto& nameAndReceiver : m_globalMessageReceivers) {
- if (nameAndReceiver.value == &messageReceiver)
- globalReceiversToRemove.append(nameAndReceiver.key);
+ for (auto& [name, receiver] : m_globalMessageReceivers) {
+ if (receiver == &messageReceiver)
+ globalReceiversToRemove.append(name);
}
for (auto& globalReceiverToRemove : globalReceiversToRemove)
@@ -89,13 +89,13 @@
removeMessageReceiver(globalReceiverToRemove);
Vector<std::pair<StringReference, uint64_t>> receiversToRemove;
- for (auto& nameAndIdAndReceiver : m_messageReceivers) {
- if (nameAndIdAndReceiver.value == &messageReceiver)
- receiversToRemove.append(std::make_pair(nameAndIdAndReceiver.key.first, nameAndIdAndReceiver.key.second));
+ for (auto& [nameAndDestinationID, receiver] : m_messageReceivers) {
+ if (receiver == &messageReceiver)
+ receiversToRemove.append(std::make_pair(nameAndDestinationID.first, nameAndDestinationID.second));
}
- for (auto& receiverToRemove : receiversToRemove)
- removeMessageReceiver(receiverToRemove.first, receiverToRemove.second);
+ for (auto& [name, destinationID] : receiversToRemove)
+ removeMessageReceiver(name, destinationID);
}
void MessageReceiverMap::invalidate()
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm (247101 => 247102)
--- trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -320,13 +320,8 @@
auto contextMap = WTFMove(m_contextMap);
m_clientCounts.clear();
- for (auto& tuple : contextMap.values()) {
- RefPtr<PlaybackSessionModelContext> model;
- RefPtr<PlatformPlaybackSessionInterface> interface;
- std::tie(model, interface) = tuple;
-
+ for (auto& [model, interface] : contextMap.values())
interface->invalidate();
- }
}
PlaybackSessionManagerProxy::ModelInterfaceTuple PlaybackSessionManagerProxy::createModelAndInterface(uint64_t contextId)
Modified: trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm (247101 => 247102)
--- trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -343,11 +343,7 @@
auto contextMap = WTFMove(m_contextMap);
m_clientCounts.clear();
- for (auto& tuple : contextMap.values()) {
- RefPtr<VideoFullscreenModelContext> model;
- RefPtr<PlatformVideoFullscreenInterface> interface;
- std::tie(model, interface) = tuple;
-
+ for (auto& [model, interface] : contextMap.values()) {
interface->invalidate();
[model->layerHostView() removeFromSuperview];
model->setLayerHostView(nullptr);
@@ -356,14 +352,14 @@
void VideoFullscreenManagerProxy::requestHideAndExitFullscreen()
{
- for (auto& tuple : m_contextMap.values())
- std::get<1>(tuple)->requestHideAndExitFullscreen();
+ for (auto& [model, interface] : m_contextMap.values())
+ interface->requestHideAndExitFullscreen();
}
bool VideoFullscreenManagerProxy::hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const
{
- for (auto& tuple : m_contextMap.values()) {
- if (std::get<1>(tuple)->hasMode(mode))
+ for (auto& [model, interface] : m_contextMap.values()) {
+ if (interface->hasMode(mode))
return true;
}
return false;
@@ -371,8 +367,8 @@
bool VideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture() const
{
- for (auto& tuple : m_contextMap.values()) {
- if (std::get<1>(tuple)->mayAutomaticallyShowVideoPictureInPicture())
+ for (auto& [model, interface] : m_contextMap.values()) {
+ if (interface->mayAutomaticallyShowVideoPictureInPicture())
return true;
}
return false;
@@ -381,8 +377,8 @@
#if ENABLE(VIDEO_PRESENTATION_MODE)
bool VideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen() const
{
- for (auto& tuple : m_contextMap.values()) {
- if (std::get<1>(tuple)->isPlayingVideoInEnhancedFullscreen())
+ for (auto& [model, interface] : m_contextMap.values()) {
+ if (interface->isPlayingVideoInEnhancedFullscreen())
return true;
}
@@ -399,8 +395,8 @@
void VideoFullscreenManagerProxy::applicationDidBecomeActive()
{
- for (auto& tuple : m_contextMap.values())
- std::get<1>(tuple)->applicationDidBecomeActive();
+ for (auto& [model, interface] : m_contextMap.values())
+ interface->applicationDidBecomeActive();
}
void VideoFullscreenManagerProxy::requestRouteSharingPolicyAndContextUID(uint64_t contextId, CompletionHandler<void(WebCore::RouteSharingPolicy, String)>&& callback)
@@ -497,10 +493,8 @@
MESSAGE_CHECK_CONTEXTID(contextId);
ASSERT(videoLayerID);
- RefPtr<VideoFullscreenModelContext> model;
- RefPtr<PlatformVideoFullscreenInterface> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto& [model, interface] = ensureModelAndInterface(contextId);
addClientForContext(contextId);
RetainPtr<WKLayerHostView> view = static_cast<WKLayerHostView*>(model->layerHostView());
@@ -686,11 +680,8 @@
void VideoFullscreenManagerProxy::didCleanupFullscreen(uint64_t contextId)
{
- RefPtr<VideoFullscreenModelContext> model;
- RefPtr<PlatformVideoFullscreenInterface> interface;
+ auto& [model, interface] = ensureModelAndInterface(contextId);
- std::tie(model, interface) = ensureModelAndInterface(contextId);
-
[CATransaction flush];
[model->layerHostView() removeFromSuperview];
model->setLayerHostView(nullptr);
Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (247101 => 247102)
--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -97,10 +97,7 @@
{
// FIXME: Share some of this code with didCollectGeometryForSmartMagnificationGesture?
- FloatRect adjustedTargetRect;
- double minimumScale = viewportMinimumScale;
- double maximumScale = viewportMaximumScale;
- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect);
+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect);
double currentScale = [m_contentView _contentZoomScale];
double targetScale = [m_contentView _targetContentZoomScaleForRect:adjustedTargetRect currentScale:currentScale fitEntireRect:fitEntireRect minimumScale:minimumScale maximumScale:maximumScale];
@@ -118,10 +115,7 @@
[m_contentView _zoomToInitialScaleWithOrigin:origin];
return;
}
- FloatRect adjustedTargetRect;
- double minimumScale = viewportMinimumScale;
- double maximumScale = viewportMaximumScale;
- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect);
+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, !fitEntireRect);
// FIXME: Check if text selection wants to consume the double tap before we attempt magnification.
@@ -147,10 +141,7 @@
void SmartMagnificationController::magnify(FloatPoint origin, FloatRect targetRect, FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale)
{
- FloatRect adjustedTargetRect;
- double maximumScale = viewportMaximumScale;
- double minimumScale = viewportMinimumScale;
- std::tie(adjustedTargetRect, minimumScale, maximumScale) = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, true);
+ auto [adjustedTargetRect, minimumScale, maximumScale] = smartMagnificationTargetRectAndZoomScales(targetRect, viewportMinimumScale, viewportMaximumScale, true);
[m_contentView _zoomToRect:adjustedTargetRect withOrigin:origin fitEntireRect:NO minimumScale:minimumScale maximumScale:maximumScale minimumScrollDistance:0];
}
Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (247101 => 247102)
--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -2094,9 +2094,7 @@
return { selection.string, selection, nil };
}
- NSString *lookupText;
- NSDictionary *options;
- std::tie(lookupText, options) = DictionaryLookup::stringForPDFSelection(selection);
+ auto [lookupText, options] = DictionaryLookup::stringForPDFSelection(selection);
if (!lookupText.length)
return { emptyString(), selection, nil };
Modified: trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (247101 => 247102)
--- trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -85,9 +85,7 @@
// Find the frame the point is over.
HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(roundedIntPoint(floatPoint)));
- RefPtr<Range> range;
- NSDictionary *options;
- std::tie(range, options) = DictionaryLookup::rangeAtHitTestResult(result);
+ auto [range, options] = DictionaryLookup::rangeAtHitTestResult(result);
if (!range)
return;
@@ -100,9 +98,7 @@
void WebPage::performDictionaryLookupForSelection(Frame& frame, const VisibleSelection& selection, TextIndicatorPresentationTransition presentationTransition)
{
- RefPtr<Range> selectedRange;
- NSDictionary *options;
- std::tie(selectedRange, options) = DictionaryLookup::rangeForSelection(selection);
+ auto [selectedRange, options] = DictionaryLookup::rangeForSelection(selection);
if (selectedRange)
performDictionaryLookupForRange(frame, *selectedRange, options, presentationTransition);
}
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm (247101 => 247102)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -175,10 +175,7 @@
PlaybackSessionManager::~PlaybackSessionManager()
{
- for (auto& tuple : m_contextMap.values()) {
- RefPtr<PlaybackSessionModelMediaElement> model;
- RefPtr<PlaybackSessionInterfaceContext> interface;
- std::tie(model, interface) = tuple;
+ for (auto& [model, interface] : m_contextMap.values()) {
model->removeClient(*interface);
model->setMediaElement(nullptr);
@@ -229,9 +226,7 @@
void PlaybackSessionManager::removeContext(uint64_t contextId)
{
- RefPtr<PlaybackSessionModelMediaElement> model;
- RefPtr<PlaybackSessionInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto& [model, interface] = ensureModelAndInterface(contextId);
RefPtr<HTMLMediaElement> mediaElement = model->mediaElement();
model->setMediaElement(nullptr);
Modified: trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm (247101 => 247102)
--- trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKit/WebProcess/cocoa/VideoFullscreenManager.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -122,11 +122,7 @@
VideoFullscreenManager::~VideoFullscreenManager()
{
- for (auto& tuple : m_contextMap.values()) {
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = tuple;
-
+ for (auto& [model, interface] : m_contextMap.values()) {
model->setVideoElement(nullptr);
model->removeClient(*interface);
@@ -180,9 +176,7 @@
void VideoFullscreenManager::removeContext(uint64_t contextId)
{
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
m_playbackSessionManager->removeClientForContext(contextId);
@@ -250,9 +244,7 @@
UNUSED_PARAM(addResult);
ASSERT(addResult.iterator->value == contextId);
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
addClientForContext(contextId);
if (!interface->layerHostingContext())
interface->setLayerHostingContext(LayerHostingContext::createForExternalHostingProcess());
@@ -369,9 +361,7 @@
void VideoFullscreenManager::requestVideoContentLayer(uint64_t contextId)
{
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
CALayer* videoLayer = interface->layerHostingContext()->rootLayer();
@@ -406,9 +396,7 @@
LOG(Fullscreen, "VideoFullscreenManager::didSetupFullscreen(%p, %x)", this, contextId);
ASSERT(m_page);
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
#if PLATFORM(IOS_FAMILY)
dispatch_async(dispatch_get_main_queue(), [protectedThis = makeRefPtr(this), this, contextId] {
@@ -431,9 +419,7 @@
{
LOG(Fullscreen, "VideoFullscreenManager::willExitFullscreen(%p, %x)", this, contextId);
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
RefPtr<HTMLVideoElement> videoElement = model->videoElement();
if (!videoElement)
@@ -450,9 +436,7 @@
{
LOG(Fullscreen, "VideoFullscreenManager::didEnterFullscreen(%p, %x)", this, contextId);
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
interface->setIsAnimating(false);
interface->setIsFullscreen(false);
@@ -510,9 +494,7 @@
{
LOG(Fullscreen, "VideoFullscreenManager::didCleanupFullscreen(%p, %x)", this, contextId);
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
if (interface->layerHostingContext()) {
interface->layerHostingContext()->setRootLayer(nullptr);
@@ -572,9 +554,7 @@
return;
}
- RefPtr<VideoFullscreenModelVideoElement> model;
- RefPtr<VideoFullscreenInterfaceContext> interface;
- std::tie(model, interface) = ensureModelAndInterface(contextId);
+ auto [model, interface] = ensureModelAndInterface(contextId);
if (std::isnan(bounds.x()) || std::isnan(bounds.y()) || std::isnan(bounds.width()) || std::isnan(bounds.height())) {
auto videoRect = inlineVideoFrame(*model->videoElement());
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (247101 => 247102)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1,3 +1,18 @@
+2019-07-03 Sam Weinig <wei...@apple.com>
+
+ Adopt simple structured bindings in more places
+ https://bugs.webkit.org/show_bug.cgi?id=199247
+
+ Reviewed by Alex Christensen.
+
+ Replaces simple uses of std::tie() with structured bindings. Does not touch
+ uses of std::tie() that are not initial declarations, use std::ignore or in
+ case where the binding is captured by a lambda, as structured bindings don't
+ work for those cases yet.
+
+ * WebView/WebImmediateActionController.mm:
+ (-[WebImmediateActionController _animationControllerForText]):
+
2019-07-02 Devin Rousso <drou...@apple.com>
Web Inspector: Debug: "Reset Web Inspector" should also clear the saved window size and attachment side
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (247101 => 247102)
--- trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -558,9 +558,7 @@
if (!frame)
return nil;
- RefPtr<Range> dictionaryRange;
- NSDictionary *options;
- std::tie(dictionaryRange, options) = DictionaryLookup::rangeAtHitTestResult(_hitTestResult);
+ auto [dictionaryRange, options] = DictionaryLookup::rangeAtHitTestResult(_hitTestResult);
if (!dictionaryRange)
return nil;
Modified: trunk/Tools/ChangeLog (247101 => 247102)
--- trunk/Tools/ChangeLog 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Tools/ChangeLog 2019-07-03 20:46:41 UTC (rev 247102)
@@ -1,3 +1,18 @@
+2019-07-03 Sam Weinig <wei...@apple.com>
+
+ Adopt simple structured bindings in more places
+ https://bugs.webkit.org/show_bug.cgi?id=199247
+
+ Reviewed by Alex Christensen.
+
+ Replaces simple uses of std::tie() with structured bindings. Does not touch
+ uses of std::tie() that are not initial declarations, use std::ignore or in
+ case where the binding is captured by a lambda, as structured bindings don't
+ work for those cases yet.
+
+ * TestWebKitAPI/ios/PreferredContentMode.mm:
+ (TestWebKitAPI::TEST):
+
2019-07-03 Aakash Jain <aakash_j...@apple.com>
Unreviewed follow-up fix to r247049, default the platform to '*' when platform property is not set.
Modified: trunk/Tools/TestWebKitAPI/ios/PreferredContentMode.mm (247101 => 247102)
--- trunk/Tools/TestWebKitAPI/ios/PreferredContentMode.mm 2019-07-03 20:25:14 UTC (rev 247101)
+++ trunk/Tools/TestWebKitAPI/ios/PreferredContentMode.mm 2019-07-03 20:46:41 UTC (rev 247102)
@@ -217,30 +217,32 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<WKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
- [webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
- EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode);
- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
- }];
- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil];
- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
+ {
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ [webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
+ EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode);
+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
+ }];
+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil];
+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
+ }
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop);
- [webView loadHTMLString:@"<pre>Bar</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
- EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode);
- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
- }];
- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil];
- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
+ {
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop);
+ [webView loadHTMLString:@"<pre>Bar</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
+ EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode);
+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
+ }];
+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Mac", @"TestWebKitAPI", nil];
+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
- [webView loadHTMLString:@"<pre>Baz</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
- EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode);
- decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeMobile]);
- }];
- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (iP", @"TestWebKitAPI", nil];
- EXPECT_TRUE([[webView navigatorPlatform] containsString:@"iP"]);
+ [webView loadHTMLString:@"<pre>Baz</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
+ EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode);
+ decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeMobile]);
+ }];
+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (iP", @"TestWebKitAPI", nil];
+ EXPECT_TRUE([[webView navigatorPlatform] containsString:@"iP"]);
+ }
}
TEST(PreferredContentMode, DesktopModeWithoutNavigationDelegate)
@@ -264,9 +266,7 @@
{
IPhoneUserInterfaceSwizzler iPhoneUserInterface;
- RetainPtr<WKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
[webView loadHTMLString:@"<pre>Foo</pre>" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
EXPECT_EQ(WKContentModeRecommended, defaultPreferences.preferredContentMode);
decisionHandler(WKNavigationActionPolicyAllow, [WKWebpagePreferences preferencesWithContentMode:WKContentModeDesktop]);
@@ -286,9 +286,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<WKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
__block BOOL decidedPolicyForMainFrame = NO;
__block BOOL decidedPolicyForSubFrame = NO;
@@ -314,9 +312,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<WKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)];
EXPECT_EQ(1024, [[webView objectByEvaluatingJavaScript:@"innerWidth"] intValue]);
@@ -334,9 +330,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop);
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop);
NSString *customUserAgent = @"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36";
[webView setCustomUserAgent:customUserAgent];
@@ -352,9 +346,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop);
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<TestWKWebView>(WKContentModeDesktop);
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
EXPECT_EQ(WKContentModeDesktop, defaultPreferences.preferredContentMode);
@@ -374,9 +366,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
[webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:nil];
[webView loadTestPageNamed:@"simple2" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)];
@@ -387,9 +377,7 @@
{
IPhoneUserInterfaceSwizzler iPhoneUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
[webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeMobile withPolicyDecisionHandler:nil];
[webView loadTestPageNamed:@"simple2" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:makeContentModeDecisionHandler(WKContentModeDesktop)];
@@ -400,9 +388,7 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>({ }, { "TestWebKitAPI" }, CGSizeZero);
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>({ }, { "TestWebKitAPI" }, CGSizeZero);
[webView loadTestPageNamed:@"simple" andExpectEffectiveContentMode:WKContentModeDesktop withPolicyDecisionHandler:nil];
[[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"TestWebKitAPI", nil];
@@ -419,20 +405,20 @@
{
IPadUserInterfaceSwizzler iPadUserInterface;
- RetainPtr<TestWKWebView> webView;
- RetainPtr<ContentModeNavigationDelegate> delegate;
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>();
- [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
- defaultPreferences._applicationNameForUserAgentWithModernCompatibility = @"DesktopBrowser";
- decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
- }];
- [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"DesktopBrowser", nil];
- EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
+ {
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>();
+ [webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:^(WKNavigationAction *, WKWebpagePreferences *defaultPreferences, void (^decisionHandler)(WKNavigationActionPolicy, WKWebpagePreferences *)) {
+ defaultPreferences._applicationNameForUserAgentWithModernCompatibility = @"DesktopBrowser";
+ decisionHandler(WKNavigationActionPolicyAllow, defaultPreferences);
+ }];
+ [[webView navigatorUserAgent] shouldContainStrings:@"Mozilla/5.0 (Macintosh", @"DesktopBrowser", nil];
+ EXPECT_WK_STREQ("MacIntel", [webView navigatorPlatform]);
+ }
{
// Don't attempt to change the application name, but still opt into desktop-class browsing;
// the application name should not default to "Mobile/15E148".
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { });
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { });
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil];
NSString *userAgent = [webView navigatorUserAgent];
EXPECT_FALSE([userAgent containsString:@"Mobile"]);
@@ -441,7 +427,7 @@
{
// Don't attempt to change the application name, but this time, opt into mobile content. The application
// name should default to "Mobile/15E148".
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeMobile, { });
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeMobile, { });
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil];
NSString *userAgent = [webView navigatorUserAgent];
EXPECT_TRUE([userAgent containsString:@"Mobile"]);
@@ -449,7 +435,7 @@
}
{
// Manually set the application name for user agent to the default value, Mobile/15E148.
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { "Mobile/15E148" });
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, { "Mobile/15E148" });
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil];
NSString *userAgent = [webView navigatorUserAgent];
EXPECT_TRUE([userAgent containsString:@"Mobile"]);
@@ -457,7 +443,7 @@
}
{
// Manually set the application name for user agent to nil.
- std::tie(webView, delegate) = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, {{ }});
+ auto [webView, delegate] = setUpWebViewForPreferredContentModeTesting<WKWebView>(WKContentModeDesktop, {{ }});
[webView loadTestPageNamed:@"simple" withPolicyDecisionHandler:nil];
NSString *userAgent = [webView navigatorUserAgent];
EXPECT_FALSE([userAgent containsString:@"Mobile"]);