Diff
Modified: trunk/Source/WebCore/ChangeLog (269952 => 269953)
--- trunk/Source/WebCore/ChangeLog 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/ChangeLog 2020-11-18 15:01:03 UTC (rev 269953)
@@ -1,3 +1,42 @@
+2020-11-18 Sam Weinig <[email protected]>
+
+ Address additional feedback from https://bugs.webkit.org/show_bug.cgi?id=218960
+ https://bugs.webkit.org/show_bug.cgi?id=219044
+
+ Reviewed by Alex Christensen.
+
+ Address post-review feedback from Darin.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * editing/cocoa/DataDetectorType.h: Added.
+ * editing/cocoa/DataDetectorTypes.h: Removed.
+ * editing/cocoa/DataDetection.h:
+ * editing/cocoa/DataDetection.mm:
+ * loader/FrameLoader.cpp:
+ * page/SettingsBase.h:
+ * page/Settings.yaml:
+ Rename DataDetectorTypes to DataDetectorType.
+
+ * accessibility/ForcedAccessibilityValue.h:
+ Put the definition all on one line for easier reading.
+
+ * bindings/scripts/CodeGenerator.pm:
+ (WK_ucfirst):
+ * editing/EditingBehaviorType.h:
+ Special case "ios" so that it doesn't become "Ios" but rather "iOS".
+
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::setActive):
+ Fixup comment adding period and making it all one line.
+
+ * page/FrameView.cpp:
+ * page/FrameView.h:
+ Use forward declaration for FrameFlattening enum.
+
+ * page/PDFImageCachingPolicy.h:
+ * platform/graphics/cg/PDFDocumentImage.h:
+ Remove default value enumeration value and replace it with a standalone constexpr.
+
2020-11-18 Kimmo Kinnunen <[email protected]>
GraphicsContextGL should have robust multivalue getters
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (269952 => 269953)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2020-11-18 15:01:03 UTC (rev 269953)
@@ -3924,7 +3924,7 @@
BC4A532F256057CD0028C592 /* FontLoadTimingOverride.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A532E256057CD0028C592 /* FontLoadTimingOverride.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4A5331256059030028C592 /* ForcedAccessibilityValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A5330256059030028C592 /* ForcedAccessibilityValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4A5333256059830028C592 /* HTMLParserScriptingFlagPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A5332256059830028C592 /* HTMLParserScriptingFlagPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
- BC4A533525605A560028C592 /* DataDetectorTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A533425605A560028C592 /* DataDetectorTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ BC4A533525605A560028C592 /* DataDetectorType.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A533425605A560028C592 /* DataDetectorType.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4A533725605AE10028C592 /* StorageBlockingPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A533625605AE10028C592 /* StorageBlockingPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4A5339256063980028C592 /* FontRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A5338256063980028C592 /* FontRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC4A533B256064E10028C592 /* TextDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = BC4A533A256064E10028C592 /* TextDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -13848,7 +13848,7 @@
BC4A532E256057CD0028C592 /* FontLoadTimingOverride.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontLoadTimingOverride.h; sourceTree = "<group>"; };
BC4A5330256059030028C592 /* ForcedAccessibilityValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ForcedAccessibilityValue.h; sourceTree = "<group>"; };
BC4A5332256059830028C592 /* HTMLParserScriptingFlagPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HTMLParserScriptingFlagPolicy.h; sourceTree = "<group>"; };
- BC4A533425605A560028C592 /* DataDetectorTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataDetectorTypes.h; sourceTree = "<group>"; };
+ BC4A533425605A560028C592 /* DataDetectorType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DataDetectorType.h; sourceTree = "<group>"; };
BC4A533625605AE10028C592 /* StorageBlockingPolicy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StorageBlockingPolicy.h; sourceTree = "<group>"; };
BC4A5338256063980028C592 /* FontRenderingMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontRenderingMode.h; sourceTree = "<group>"; };
BC4A533A256064E10028C592 /* TextDirection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TextDirection.h; sourceTree = "<group>"; };
@@ -22582,7 +22582,7 @@
5CCC270622D53B6800964FA0 /* AutofillElements.h */,
C5227DEF1C3C6DD700F5ED54 /* DataDetection.h */,
C5227DF01C3C6DD700F5ED54 /* DataDetection.mm */,
- BC4A533425605A560028C592 /* DataDetectorTypes.h */,
+ BC4A533425605A560028C592 /* DataDetectorType.h */,
937FF3D61A10131B008EBA31 /* DictionaryLookup.mm */,
9B55EEE81B3E8898005342BC /* EditorCocoa.mm */,
F42CEB54214031EE002DCA72 /* FontAttributeChangesCocoa.mm */,
@@ -31522,7 +31522,7 @@
BE23480D18A9871400E4B6E8 /* DataCue.h in Headers */,
C5227DF11C3C6DF100F5ED54 /* DataDetection.h in Headers */,
7C7941E51C56C29300A4C58E /* DataDetectorsCoreSoftLink.h in Headers */,
- BC4A533525605A560028C592 /* DataDetectorTypes.h in Headers */,
+ BC4A533525605A560028C592 /* DataDetectorType.h in Headers */,
E58B45BA20AD07DD00991025 /* DataListButtonElement.h in Headers */,
E517670320B88C1400D41167 /* DataListSuggestionInformation.h in Headers */,
E52CF54F20A35A2800DADA27 /* DataListSuggestionPicker.h in Headers */,
Modified: trunk/Source/WebCore/accessibility/ForcedAccessibilityValue.h (269952 => 269953)
--- trunk/Source/WebCore/accessibility/ForcedAccessibilityValue.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/accessibility/ForcedAccessibilityValue.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -27,10 +27,6 @@
namespace WebCore {
-enum class ForcedAccessibilityValue : uint8_t {
- System,
- On,
- Off
-};
+enum class ForcedAccessibilityValue : uint8_t { System, On, Off };
}
Modified: trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm (269952 => 269953)
--- trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/bindings/scripts/CodeGenerator.pm 2020-11-18 15:01:03 UTC (rev 269953)
@@ -970,6 +970,7 @@
$ret =~ s/Cbcs/cbcs/ if $ret =~ /^Cbcs/;
$ret =~ s/Pq/PQ/ if $ret =~ /^Pq$/;
$ret =~ s/Hlg/HLG/ if $ret =~ /^Hlg/;
+ $ret =~ s/Ios/iOS/ if $ret =~ /^Ios/;
return $ret;
}
Modified: trunk/Source/WebCore/editing/EditingBehavior.h (269952 => 269953)
--- trunk/Source/WebCore/editing/EditingBehavior.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/editing/EditingBehavior.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -44,19 +44,19 @@
// On Windows, selections should always be considered as directional, regardless if it is
// mouse-based or keyboard-based.
- bool shouldConsiderSelectionAsDirectional() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::Ios; }
+ bool shouldConsiderSelectionAsDirectional() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::iOS; }
// On Mac, when revealing a selection (for example as a result of a Find operation on the Browser),
// content should be scrolled such that the selection gets certer aligned.
- bool shouldCenterAlignWhenSelectionIsRevealed() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::Ios; }
+ bool shouldCenterAlignWhenSelectionIsRevealed() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::iOS; }
// On Mac, style is considered present when present at the beginning of selection. On other platforms,
// style has to be present throughout the selection.
- bool shouldToggleStyleBasedOnStartOfSelection() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::Ios; }
+ bool shouldToggleStyleBasedOnStartOfSelection() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::iOS; }
// Standard Mac behavior when extending to a boundary is grow the selection rather than leaving the base
// in place and moving the extent. Matches NSTextView.
- bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::Ios; }
+ bool shouldAlwaysGrowSelectionWhenExtendingToBoundary() const { return m_type == EditingBehaviorType::Mac || m_type == EditingBehaviorType::iOS; }
// On Mac, when processing a contextual click, the object being clicked upon should be selected.
bool shouldSelectOnContextualMenuClick() const { return m_type == EditingBehaviorType::Mac; }
@@ -76,7 +76,7 @@
// On Mac, selecting backwards by word/line from the middle of a word/line, and then going
// forward leaves the caret back in the middle with no selection, instead of directly selecting
// to the other end of the line/word (Unix/Windows behavior).
- bool shouldExtendSelectionByWordOrLineAcrossCaret() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::Ios; }
+ bool shouldExtendSelectionByWordOrLineAcrossCaret() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::iOS; }
// Based on native behavior, when using ctrl(alt)+arrow to move caret by word, ctrl(alt)+left arrow moves caret to
// immediately before the word in all platforms, for example, the word break positions are: "|abc |def |hij |opq".
@@ -85,21 +85,21 @@
// On iOS the last entered character in a secure filed is shown momentarily, removing and adding back the
// space when deleting password cause space been showed insecurely.
- bool shouldRebalanceWhiteSpacesInSecureField() const { return m_type != EditingBehaviorType::Ios; }
+ bool shouldRebalanceWhiteSpacesInSecureField() const { return m_type != EditingBehaviorType::iOS; }
bool shouldSelectBasedOnDictionaryLookup() const { return m_type == EditingBehaviorType::Mac; }
// Linux and Windows always extend selections from the extent endpoint.
- bool shouldAlwaysExtendSelectionFromExtentEndpoint() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::Ios; }
+ bool shouldAlwaysExtendSelectionFromExtentEndpoint() const { return m_type != EditingBehaviorType::Mac && m_type != EditingBehaviorType::iOS; }
// On iOS, we don't want to select all the text when focusing a field. Instead, match platform behavior by going to the end of the line.
- bool shouldMoveSelectionToEndWhenFocusingTextInput() const { return m_type == EditingBehaviorType::Ios; }
+ bool shouldMoveSelectionToEndWhenFocusingTextInput() const { return m_type == EditingBehaviorType::iOS; }
// On iOS, when smart delete is on, it is always on, and should do not additional checks (i.e. TextGranularity::WordGranularity).
- bool shouldAlwaysSmartDelete() const { return m_type == EditingBehaviorType::Ios; }
+ bool shouldAlwaysSmartDelete() const { return m_type == EditingBehaviorType::iOS; }
// On iOS, we should turn on smart insert and delete and newlines around paragraphs to match UIKit behaviour.
- bool shouldSmartInsertDeleteParagraphs() const { return m_type == EditingBehaviorType::Ios; }
+ bool shouldSmartInsertDeleteParagraphs() const { return m_type == EditingBehaviorType::iOS; }
private:
EditingBehaviorType m_type;
Modified: trunk/Source/WebCore/editing/EditingBehaviorType.h (269952 => 269953)
--- trunk/Source/WebCore/editing/EditingBehaviorType.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/editing/EditingBehaviorType.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -39,7 +39,7 @@
Mac,
Windows,
Unix,
- Ios
+ iOS,
};
} // WebCore namespace
Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.h (269952 => 269953)
--- trunk/Source/WebCore/editing/cocoa/DataDetection.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -27,7 +27,7 @@
#if ENABLE(DATA_DETECTION)
-#import "DataDetectorTypes.h"
+#import "DataDetectorType.h"
#import "FloatRect.h"
#import "SimpleRange.h"
#import <wtf/OptionSet.h>
@@ -52,7 +52,7 @@
#if PLATFORM(MAC)
WEBCORE_EXPORT static Optional<DetectedItem> detectItemAroundHitTestResult(const HitTestResult&);
#endif
- WEBCORE_EXPORT static NSArray *detectContentInRange(const SimpleRange&, OptionSet<DataDetectorTypes>, NSDictionary *context);
+ WEBCORE_EXPORT static NSArray *detectContentInRange(const SimpleRange&, OptionSet<DataDetectorType>, NSDictionary *context);
WEBCORE_EXPORT static void removeDataDetectedLinksInDocument(Document&);
#if PLATFORM(IOS_FAMILY)
WEBCORE_EXPORT static bool canBePresentedByDataDetectors(const URL&);
Modified: trunk/Source/WebCore/editing/cocoa/DataDetection.mm (269952 => 269953)
--- trunk/Source/WebCore/editing/cocoa/DataDetection.mm 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/editing/cocoa/DataDetection.mm 2020-11-18 15:01:03 UTC (rev 269953)
@@ -218,24 +218,24 @@
return [urlTypes containsObject:(NSString *)softLink_DataDetectorsCore_DDResultGetType(result)];
}
-static NSString *constructURLStringForResult(DDResultRef currentResult, NSString *resultIdentifier, NSDate *referenceDate, NSTimeZone *referenceTimeZone, OptionSet<DataDetectorTypes> detectionTypes)
+static NSString *constructURLStringForResult(DDResultRef currentResult, NSString *resultIdentifier, NSDate *referenceDate, NSTimeZone *referenceTimeZone, OptionSet<DataDetectorType> detectionTypes)
{
if (!softLink_DataDetectorsCore_DDResultHasProperties(currentResult, DDResultPropertyPassiveDisplay))
return nil;
- auto phoneTypes = detectionTypes.contains(DataDetectorTypes::PhoneNumber) ? DDURLifierPhoneNumberDetectionRegular : DDURLifierPhoneNumberDetectionNone;
+ auto phoneTypes = detectionTypes.contains(DataDetectorType::PhoneNumber) ? DDURLifierPhoneNumberDetectionRegular : DDURLifierPhoneNumberDetectionNone;
auto category = softLink_DataDetectorsCore_DDResultGetCategory(currentResult);
auto type = softLink_DataDetectorsCore_DDResultGetType(currentResult);
- if ((detectionTypes.contains(DataDetectorTypes::Address) && DDResultCategoryAddress == category)
- || (detectionTypes.contains(DataDetectorTypes::TrackingNumber) && CFEqual(get_DataDetectorsCore_DDBinderTrackingNumberKey(), type))
- || (detectionTypes.contains(DataDetectorTypes::FlightNumber) && CFEqual(get_DataDetectorsCore_DDBinderFlightInformationKey(), type))
- || (detectionTypes.contains(DataDetectorTypes::LookupSuggestion) && CFEqual(get_DataDetectorsCore_DDBinderParsecSourceKey(), type))
- || (detectionTypes.contains(DataDetectorTypes::PhoneNumber) && DDResultCategoryPhoneNumber == category)
- || (detectionTypes.contains(DataDetectorTypes::Link) && resultIsURL(currentResult))) {
+ if ((detectionTypes.contains(DataDetectorType::Address) && DDResultCategoryAddress == category)
+ || (detectionTypes.contains(DataDetectorType::TrackingNumber) && CFEqual(get_DataDetectorsCore_DDBinderTrackingNumberKey(), type))
+ || (detectionTypes.contains(DataDetectorType::FlightNumber) && CFEqual(get_DataDetectorsCore_DDBinderFlightInformationKey(), type))
+ || (detectionTypes.contains(DataDetectorType::LookupSuggestion) && CFEqual(get_DataDetectorsCore_DDBinderParsecSourceKey(), type))
+ || (detectionTypes.contains(DataDetectorType::PhoneNumber) && DDResultCategoryPhoneNumber == category)
+ || (detectionTypes.contains(DataDetectorType::Link) && resultIsURL(currentResult))) {
return softLink_DataDetectorsCore_DDURLStringForResult(currentResult, resultIdentifier, phoneTypes, referenceDate, referenceTimeZone);
}
- if (detectionTypes.contains(DataDetectorTypes::CalendarEvent) && DDResultCategoryCalendarEvent == category) {
+ if (detectionTypes.contains(DataDetectorType::CalendarEvent) && DDResultCategoryCalendarEvent == category) {
if (!softLink_DataDetectorsCore_DDResultIsPastDate(currentResult, (CFDateRef)referenceDate, (CFTimeZoneRef)referenceTimeZone))
return softLink_DataDetectorsCore_DDURLStringForResult(currentResult, resultIdentifier, phoneTypes, referenceDate, referenceTimeZone);
}
@@ -433,13 +433,13 @@
removeResultLinksFromAnchor(anchor.get());
}
-NSArray *DataDetection::detectContentInRange(const SimpleRange& contextRange, OptionSet<DataDetectorTypes> types, NSDictionary *context)
+NSArray *DataDetection::detectContentInRange(const SimpleRange& contextRange, OptionSet<DataDetectorType> types, NSDictionary *context)
{
auto scanner = adoptCF(softLink_DataDetectorsCore_DDScannerCreate(DDScannerTypeStandard, 0, nullptr));
auto scanQuery = adoptCF(softLink_DataDetectorsCore_DDScanQueryCreate(NULL));
buildQuery(scanQuery.get(), contextRange);
- if (types.contains(DataDetectorTypes::LookupSuggestion))
+ if (types.contains(DataDetectorType::LookupSuggestion))
softLink_DataDetectorsCore_DDScannerEnableOptionalSource(scanner.get(), DDScannerSourceSpotlight, true);
// FIXME: we should add a timeout to this call to make sure it doesn't take too much time.
@@ -632,7 +632,7 @@
#else
-NSArray *DataDetection::detectContentInRange(const SimpleRange&, OptionSet<DataDetectorTypes>, NSDictionary *)
+NSArray *DataDetection::detectContentInRange(const SimpleRange&, OptionSet<DataDetectorType>, NSDictionary *)
{
return nil;
}
Copied: trunk/Source/WebCore/editing/cocoa/DataDetectorType.h (from rev 269952, trunk/Source/WebCore/editing/cocoa/DataDetectorTypes.h) (0 => 269953)
--- trunk/Source/WebCore/editing/cocoa/DataDetectorType.h (rev 0)
+++ trunk/Source/WebCore/editing/cocoa/DataDetectorType.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(DATA_DETECTION)
+
+#include <wtf/EnumTraits.h>
+
+namespace WebCore {
+
+enum class DataDetectorType : uint8_t {
+ None = 0,
+ PhoneNumber = 1 << 0,
+ Link = 1 << 1,
+ Address = 1 << 2,
+ CalendarEvent = 1 << 3,
+ TrackingNumber = 1 << 4,
+ FlightNumber = 1 << 5,
+ LookupSuggestion = 1 << 6,
+};
+
+}
+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::DataDetectorType> {
+ using values = EnumValues<
+ WebCore::DataDetectorType,
+ WebCore::DataDetectorType::None,
+ WebCore::DataDetectorType::PhoneNumber,
+ WebCore::DataDetectorType::Link,
+ WebCore::DataDetectorType::Address,
+ WebCore::DataDetectorType::CalendarEvent,
+ WebCore::DataDetectorType::TrackingNumber,
+ WebCore::DataDetectorType::FlightNumber,
+ WebCore::DataDetectorType::LookupSuggestion
+ >;
+};
+
+} // namespace WTF
+
+#endif
Deleted: trunk/Source/WebCore/editing/cocoa/DataDetectorTypes.h (269952 => 269953)
--- trunk/Source/WebCore/editing/cocoa/DataDetectorTypes.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/editing/cocoa/DataDetectorTypes.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2020 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#if ENABLE(DATA_DETECTION)
-
-#include <wtf/EnumTraits.h>
-
-namespace WebCore {
-
-enum class DataDetectorTypes : uint8_t {
- None = 0,
- PhoneNumber = 1 << 0,
- Link = 1 << 1,
- Address = 1 << 2,
- CalendarEvent = 1 << 3,
- TrackingNumber = 1 << 4,
- FlightNumber = 1 << 5,
- LookupSuggestion = 1 << 6,
-};
-
-}
-
-namespace WTF {
-
-template<> struct EnumTraits<WebCore::DataDetectorTypes> {
- using values = EnumValues<
- WebCore::DataDetectorTypes,
- WebCore::DataDetectorTypes::None,
- WebCore::DataDetectorTypes::PhoneNumber,
- WebCore::DataDetectorTypes::Link,
- WebCore::DataDetectorTypes::Address,
- WebCore::DataDetectorTypes::CalendarEvent,
- WebCore::DataDetectorTypes::TrackingNumber,
- WebCore::DataDetectorTypes::FlightNumber,
- WebCore::DataDetectorTypes::LookupSuggestion
- >;
-};
-
-} // namespace WTF
-
-#endif
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (269952 => 269953)
--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2020-11-18 15:01:03 UTC (rev 269953)
@@ -219,8 +219,7 @@
case EditableLinkBehavior::AlwaysLive:
break;
- // Don't set the link to be active if the current selection is in the same editable block as
- // this link
+ // Don't set the link to be active if the current selection is in the same editable block as this link.
case EditableLinkBehavior::LiveWhenNotFocused:
if (down && document().frame() && document().frame()->selection().selection().rootEditableElement() == rootEditableElement())
return;
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (269952 => 269953)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2020-11-18 15:01:03 UTC (rev 269953)
@@ -2580,7 +2580,7 @@
FRAMELOADER_RELEASE_LOG_IF_ALLOWED(ResourceLoading, "checkLoadCompleteForThisFrame: Finished frame load");
#if ENABLE(DATA_DETECTION)
auto document = m_frame.document();
- auto types = OptionSet<DataDetectorTypes> { m_frame.settings().dataDetectorTypes() };
+ auto types = OptionSet<DataDetectorType> { m_frame.settings().dataDetectorTypes() };
if (document && types) {
m_frame.setDataDetectionResults(DataDetection::detectContentInRange(makeRangeSelectingNodeContents(*document), types, m_client->dataDetectionContext()));
if (m_frame.isMainFrame())
Modified: trunk/Source/WebCore/page/FrameView.cpp (269952 => 269953)
--- trunk/Source/WebCore/page/FrameView.cpp 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/page/FrameView.cpp 2020-11-18 15:01:03 UTC (rev 269953)
@@ -47,6 +47,7 @@
#include "FloatRect.h"
#include "FocusController.h"
#include "Frame.h"
+#include "FrameFlattening.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameSelection.h"
Modified: trunk/Source/WebCore/page/FrameView.h (269952 => 269953)
--- trunk/Source/WebCore/page/FrameView.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/page/FrameView.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -27,7 +27,6 @@
#include "AdjustViewSizeOrNot.h"
#include "Color.h"
#include "ContainerNode.h"
-#include "FrameFlattening.h"
#include "FrameViewLayoutContext.h"
#include "GraphicsContext.h"
#include "LayoutMilestone.h"
@@ -81,6 +80,8 @@
}
#endif
+enum class FrameFlattening : uint8_t;
+
Pagination::Mode paginationModeForRenderStyle(const RenderStyle&);
class FrameView final : public ScrollView {
Modified: trunk/Source/WebCore/page/PDFImageCachingPolicy.h (269952 => 269953)
--- trunk/Source/WebCore/page/PDFImageCachingPolicy.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/page/PDFImageCachingPolicy.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -32,11 +32,12 @@
BelowMemoryLimit,
Disabled,
ClipBoundsOnly,
+};
+
#if PLATFORM(IOS_FAMILY)
- Default = BelowMemoryLimit
+constexpr PDFImageCachingPolicy defaultPDFImageCachingPolicy = PDFImageCachingPolicy::BelowMemoryLimit;
#else
- Default = Enabled
+constexpr PDFImageCachingPolicy defaultPDFImageCachingPolicy = PDFImageCachingPolicy::Enabled;
#endif
-};
}
Modified: trunk/Source/WebCore/page/Settings.yaml (269952 => 269953)
--- trunk/Source/WebCore/page/Settings.yaml 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/page/Settings.yaml 2020-11-18 15:01:03 UTC (rev 269953)
@@ -90,11 +90,11 @@
DataDetectorTypes:
type: uint32_t
- refinedType: DataDetectorTypes
+ refinedType: DataDetectorType
condition: ENABLE(DATA_DETECTION)
defaultValue:
WebCore:
- default: DataDetectorTypes::None
+ default: DataDetectorType::None
DefaultVideoPosterURL:
comment: >-
@@ -132,7 +132,7 @@
refinedType: EditingBehaviorType
defaultValue:
WebCore:
- PLATFORM(IOS_FAMILY): EditingBehaviorType::Ios
+ PLATFORM(IOS_FAMILY): EditingBehaviorType::iOS
OS(DARWIN): EditingBehaviorType::Mac
OS(WINDOWS): EditingBehaviorType::Windows
OS(UNIX): EditingBehaviorType::Unix
Modified: trunk/Source/WebCore/page/SettingsBase.h (269952 => 269953)
--- trunk/Source/WebCore/page/SettingsBase.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/page/SettingsBase.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -51,7 +51,7 @@
#include <wtf/text/AtomString.h>
#if ENABLE(DATA_DETECTION)
-#include "DataDetectorTypes.h"
+#include "DataDetectorType.h"
#endif
namespace WebCore {
Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h (269952 => 269953)
--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -94,7 +94,7 @@
void updateCachedImageIfNeeded(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect);
bool cacheParametersMatch(GraphicsContext&, const FloatRect& dstRect, const FloatRect& srcRect) const;
- PDFImageCachingPolicy m_pdfImageCachingPolicy { PDFImageCachingPolicy::Default };
+ PDFImageCachingPolicy m_pdfImageCachingPolicy { defaultPDFImageCachingPolicy };
#if USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
RetainPtr<PDFDocument> m_document;
Modified: trunk/Source/WebKit/ChangeLog (269952 => 269953)
--- trunk/Source/WebKit/ChangeLog 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebKit/ChangeLog 2020-11-18 15:01:03 UTC (rev 269953)
@@ -1,3 +1,20 @@
+2020-11-18 Sam Weinig <[email protected]>
+
+ Address additional feedback from https://bugs.webkit.org/show_bug.cgi?id=218960
+ https://bugs.webkit.org/show_bug.cgi?id=219044
+
+ Reviewed by Alex Christensen.
+
+ * Shared/API/Cocoa/WKDataDetectorTypesInternal.h:
+ (fromWKDataDetectorTypes):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::detectDataInAllFrames):
+ * UIProcess/WebPageProxy.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+ (WebKit::WebPage::detectDataInAllFrames):
+ Update for rename of WebCore::DataDetectionTypes to WebCore::DataDetectionType.
+
2020-11-17 Tim Horton <[email protected]>
GPU-process-hosted RemoteLayerBackingStore should flush off the main thread
Modified: trunk/Source/WebKit/Shared/API/Cocoa/WKDataDetectorTypesInternal.h (269952 => 269953)
--- trunk/Source/WebKit/Shared/API/Cocoa/WKDataDetectorTypesInternal.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebKit/Shared/API/Cocoa/WKDataDetectorTypesInternal.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -27,26 +27,26 @@
#if PLATFORM(IOS_FAMILY)
-#import <WebCore/DataDetection.h>
+#import <WebCore/DataDetectorType.h>
-static inline WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)
+static inline WebCore::DataDetectorType fromWKDataDetectorTypes(uint64_t types)
{
uint32_t value = 0;
if (types & WKDataDetectorTypePhoneNumber)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::PhoneNumber);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::PhoneNumber);
if (types & WKDataDetectorTypeLink)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::Link);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::Link);
if (types & WKDataDetectorTypeAddress)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::Address);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::Address);
if (types & WKDataDetectorTypeCalendarEvent)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::CalendarEvent);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::CalendarEvent);
if (types & WKDataDetectorTypeTrackingNumber)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::TrackingNumber);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::TrackingNumber);
if (types & WKDataDetectorTypeFlightNumber)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::FlightNumber);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::FlightNumber);
if (types & WKDataDetectorTypeLookupSuggestion)
- value |= static_cast<uint32_t>(WebCore::DataDetectorTypes::LookupSuggestion);
- return static_cast<WebCore::DataDetectorTypes>(value);
+ value |= static_cast<uint32_t>(WebCore::DataDetectorType::LookupSuggestion);
+ return static_cast<WebCore::DataDetectorType>(value);
}
#endif
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (269952 => 269953)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp 2020-11-18 15:01:03 UTC (rev 269953)
@@ -9923,7 +9923,7 @@
#if ENABLE(DATA_DETECTION)
-void WebPageProxy::detectDataInAllFrames(WebCore::DataDetectorTypes types, CompletionHandler<void(const DataDetectionResult&)>&& completionHandler)
+void WebPageProxy::detectDataInAllFrames(WebCore::DataDetectorType types, CompletionHandler<void(const DataDetectionResult&)>&& completionHandler)
{
if (!hasRunningProcess()) {
completionHandler({ });
Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (269952 => 269953)
--- trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h 2020-11-18 15:01:03 UTC (rev 269953)
@@ -477,7 +477,7 @@
#if ENABLE(DATA_DETECTION)
NSArray *dataDetectionResults() { return m_dataDetectionResults.get(); }
- void detectDataInAllFrames(WebCore::DataDetectorTypes, CompletionHandler<void(const DataDetectionResult&)>&&);
+ void detectDataInAllFrames(WebCore::DataDetectorType, CompletionHandler<void(const DataDetectionResult&)>&&);
void removeDataDetectedLinks(CompletionHandler<void(const DataDetectionResult&)>&&);
#endif
Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (269952 => 269953)
--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-11-18 12:25:37 UTC (rev 269952)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp 2020-11-18 15:01:03 UTC (rev 269953)
@@ -3739,7 +3739,7 @@
settings.setFrameFlattening(store.getBoolValueForKey(WebPreferencesKey::frameFlatteningEnabledKey()) ? WebCore::FrameFlattening::FullyEnabled : WebCore::FrameFlattening::Disabled);
settings.setEditableLinkBehavior(static_cast<WebCore::EditableLinkBehavior>(store.getUInt32ValueForKey(WebPreferencesKey::editableLinkBehaviorKey())));
#if ENABLE(DATA_DETECTION)
- settings.setDataDetectorTypes(static_cast<DataDetectorTypes>(store.getUInt32ValueForKey(WebPreferencesKey::dataDetectorTypesKey())));
+ settings.setDataDetectorTypes(static_cast<DataDetectorType>(store.getUInt32ValueForKey(WebPreferencesKey::dataDetectorTypesKey())));
#endif
DatabaseManager::singleton().setIsAvailable(store.getBoolValueForKey(WebPreferencesKey::databasesEnabledKey()));
@@ -3836,7 +3836,7 @@
void WebPage::detectDataInAllFrames(uint64_t types, CompletionHandler<void(const DataDetectionResult&)>&& completionHandler)
{
- auto dataDetectorTypes = OptionSet<DataDetectorTypes>::fromRaw(types);
+ auto dataDetectorTypes = OptionSet<DataDetectorType>::fromRaw(types);
for (auto frame = makeRefPtr(&m_page->mainFrame()); frame; frame = frame->tree().traverseNext()) {
auto document = makeRefPtr(frame->document());
if (!document)