haikuwebkit/Source/WebCore/editing/EditableLinkBehavior.h

39 lines
1.5 KiB
C
Raw Permalink Normal View History

Source/WebCore: Standardize enums that are used by Settings in preperation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Move each enum type used by Settings to its own header and make them all scoped enums in preparation for using them in the generated settings code. Also converted enums used in Settings that are used as flags to use OptionSet, adding the necessary EnumTraits to make it to work. In the change, Settings still generates with getters/setters that work on the raw enum, but in subsequent changes the generation will work directly with OptionSets. * Headers.cmake: * WebCore.xcodeproj/project.pbxproj: Add new headers, adjust for renames. * Scripts/GenerateSettings.rb: Add special case for HTML prefix to keep renamed HTMLParserScriptingFlagPolicy setting using WebCore consistent capitalization. * accessibility/ForcedAccessibilityValue.h: Added. * css/FontLoadTimingOverride.h: Added. * editing/EditableLinkBehavior.h: Added. * editing/cocoa/DataDetectorTypes.h: Added. * html/parser/HTMLParserScriptingFlagPolicy.h: Added. * page/FrameFlattening.h: Added. * page/PDFImageCachingPolicy.h: Added. * page/DebugOverlayRegions.h: Added. * page/StorageBlockingPolicy.h: Added. * page/TextDirectionSubmenuInclusionBehavior.h: Added. * page/UserInterfaceDirectionPolicy.h: Added. * platform/text/FontRenderingMode.h: Added. * platform/text/TextDirection.h: Added. Add new headers. * editing/EditingBehaviorType.h: Added. * editing/EditingBehaviorTypes.h: Removed. Renamed header to match enum name. * css/CSSFontFace.cpp: (WebCore::fontLoadTimingOverride): (WebCore::CSSFontFace::fontLoadTiming const): Update uses of FontLoadTimingOverride to remove Settings scoping. * css/MediaQueryEvaluator.cpp: (WebCore::monochromeEvaluate): (WebCore::invertedColorsEvaluate): (WebCore::dynamicRangeEvaluate): (WebCore::prefersReducedMotionEvaluate): Update uses of ForcedAccessibilityValue to remove Settings scoping. * dom/Document.cpp: (WebCore::Document::applyQuickLookSandbox): Update uses of StorageBlockingPolicy to remove SecurityOrigin scoping. * editing/EditingBehavior.h: Update use of EditingBehaviorType to use scoped syntax. * editing/Editor.cpp: (WebCore::Editor::behavior const): Remove unnecessary duplication of EditingBehavior construction. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: Switch to using OptionSet<DataDetectorTypes> rather than raw DataDetectorTypes. * editing/markup.cpp: (WebCore::createPageForSanitizingWebContent): Update for renamed setter now called setHTMLParserScriptingFlagPolicy to make it clear it is about the HTML parser. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::setActive): (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType const): Update use of EditableLinkBehavior to use scoped syntax. * html/parser/HTMLParserOptions.cpp: (WebCore::HTMLParserOptions::HTMLParserOptions): Update for renamed setting now called HTMLParserScriptingFlagPolicy to make it clear it is about the HTML parser and no longer scoped to Settings. * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): Switch to using OptionSet<DataDetectorTypes> rather than raw DataDetectorTypes. * page/ContextMenuController.cpp: (WebCore::ContextMenuController::populate): Update use of TextDirectionSubmenuInclusionBehavior to use scoped syntax. * page/DebugPageOverlays.cpp: (WebCore::DebugPageOverlays::updateOverlayRegionVisibility): (WebCore::DebugPageOverlays::settingsChanged): * page/DebugPageOverlays.h: Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * page/EventHandler.cpp: (WebCore::EventHandler::useHandCursor): Update use of EditableLinkBehavior to use scoped syntax. * page/FrameView.h: Switch to #including FrameFlattening.h since it is such a trivial include now. * page/Page.cpp: (WebCore::Page::shouldBuildEditableRegion const): Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * page/SecurityOrigin.cpp: * page/SecurityOrigin.h: Update to now include StorageBlockingPolicy.h and switch to use scoped syntax. * page/Settings.yaml: Update setting defaults to use new scoped names where appropriate and rename ParserScriptingFlagPolicy to HTMLParserScriptingFlagPolicy to make it clear which parser it is for. * page/SettingsBase.h: Replace enum definitions with #includes for the new headers. In future changes, these will be automatically included in the generated code and this won't be necessary anymore. * platform/DragImage.h: * platform/graphics/FontDescription.h: Update #includes to keep things building. * platform/graphics/cg/PDFDocumentImage.cpp: (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): * platform/graphics/cg/PDFDocumentImage.h: Update use of PDFImageCachingPolicy to use scoped syntax. * platform/text/TextFlags.h: Extract FontRenderingMode into its own header. * platform/text/WritingMode.h: Extract TextDirection into its own header. Also replace some macros with constexprs while I was here. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintDebugOverlays): (WebCore::RenderLayerBacking::paintContents): Switch to using OptionSet<DebugOverlayRegions> rather than raw DebugOverlayRegions. * testing/InternalSettings.cpp: * testing/InternalSettings.h: * testing/InternalSettings.idl: Use new enums rather than redeclaring them. Updates EditingBehaviorType to use the value "windows" rather than "win" which requires test changes as does changes to capitalization of PDFImageCachingPolicy enum values. * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::createPageForServiceWorker): (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy): * workers/service/context/ServiceWorkerThreadProxy.h: Update for extracted StorageBlockingPolicy enum. Source/WebKit: Standardize enums that are used by Settings in preperation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Update enum uses for renames and scoped syntax use. * UIProcess/API/C/WKAPICast.h: (WebKit::toAPI): (WebKit::toEditableLinkBehavior): (WebKit::toStorageBlockingPolicy): * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetEditableLinkBehavior): (WKPreferencesSetStorageBlockingPolicy): (WKPreferencesGetStorageBlockingPolicy): * UIProcess/API/Cocoa/WKPreferences.mm: (toStorageBlockingPolicy): (toAPI): (-[WKPreferences _storageBlockingPolicy]): (-[WKPreferences _setStorageBlockingPolicy:]): (toEditableLinkBehavior): (-[WKPreferences _setEditableLinkBehavior:]): * UIProcess/WebPreferences.cpp: (WebKit::WebPreferences::createWithLegacyDefaults): * WebProcess/Storage/WebSWContextManagerConnection.cpp: (WebKit::WebSWContextManagerConnection::updatePreferencesStore): * WebProcess/Storage/WebSWContextManagerConnection.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): (WebKit::WebPage::detectDataInAllFrames): Source/WebKitLegacy/mac: Standardize enums that are used by Settings in preperation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Update enum uses for renames and scoped syntax use. * WebView/WebFrame.mm: * WebView/WebView.mm: Source/WTF: Standardize enums that are used by Settings in preperation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Update enum uses in default WebPreferences values for renames and scoped syntax use. * Scripts/Preferences/WebPreferences.yaml: LayoutTests: Standardize enums that are used by Settings in preparation for autogeneration https://bugs.webkit.org/show_bug.cgi?id=218960 Reviewed by Tim Horton. Update tests and results for change in EditingBahavior enum value "win" -> "windows". * editing/deleting/delete-ligature-003-expected.txt: * editing/deleting/delete-ligature-003.html: * editing/deleting/paragraph-in-preserveNewline-expected.txt: * editing/deleting/paragraph-in-preserveNewline.html: * editing/deleting/smart-editing-disabled-win.html: * editing/deleting/whitespace-pre-1-expected.txt: * editing/deleting/whitespace-pre-1.html: * editing/execCommand/query-command-state-expected.txt: * editing/execCommand/query-command-state.html: * editing/execCommand/query-text-alignment-expected.txt: * editing/execCommand/query-text-alignment.html: * editing/execCommand/remove-format-multiple-elements-win.html: * editing/execCommand/toggle-compound-styles-expected.txt: * editing/execCommand/toggle-compound-styles.html: * editing/execCommand/toggle-link-win.html: * editing/execCommand/toggle-unlink-win.html: * editing/selection/5195166-1.html: * editing/selection/5354455-1.html: * editing/selection/click-in-margins-inside-editable-div.html: * editing/selection/click-in-padding-with-multiple-line-boxes.html: * editing/selection/context-menu-text-selection-lookup.html: * editing/selection/context-menu-text-selection.html: * editing/selection/extend-after-mouse-selection.html: * editing/selection/extend-selection-after-double-click.html: * editing/selection/extend-selection-enclosing-block-win.html: * editing/selection/move-by-word-visually-crash-test-1.html: * editing/selection/move-by-word-visually-crash-test-2.html: * editing/selection/move-by-word-visually-crash-test-3.html: * editing/selection/move-by-word-visually-crash-test-4.html: * editing/selection/move-by-word-visually-crash-test-5.html: * editing/selection/move-by-word-visually-crash-test-css-generated-content.html: * editing/selection/move-by-word-visually-crash-test-textarea.html: * editing/selection/move-by-word-visually-inline-block-positioned-element.html: * editing/selection/move-by-word-visually-multi-line.html: * editing/selection/move-by-word-visually-multi-space.html: * editing/selection/move-by-word-visually-null-box.html: * editing/selection/move-by-word-visually-single-space-inline-element.html: * editing/selection/move-by-word-visually-single-space-one-element.html: * editing/selection/move-by-word-visually-textarea.html: * editing/selection/move-by-word-visually-wrong-left-right.html: * editing/selection/programmatic-selection-on-mac-is-directionless-expected.txt: * editing/selection/programmatic-selection-on-mac-is-directionless.html: * editing/selection/rtl-move-selection-right-left.html: * editing/selection/selection-extend-should-not-move-across-caret-on-mac-expected.txt: * editing/selection/selection-extend-should-not-move-across-caret-on-mac.html: * editing/selection/shift-click.html: * editing/selection/user-select-all-with-shift-expected.txt: * editing/selection/user-select-all-with-shift.html: * editing/spelling/copy-paste-crash.html: * editing/style/iframe-onload-crash-win.html: * editing/style/make-text-writing-direction-inline-win.html: * editing/style/push-down-font-styles-win.html: * editing/style/push-down-implicit-styles-around-list-win.html: * editing/style/toggle-style-bold-italic-expected.txt: * editing/style/toggle-style-bold-italic-mixed-editability-expected.txt: * editing/style/toggle-style-bold-italic-mixed-editability.html: * editing/style/toggle-style-bold-italic.html: * fast/events/backspace-navigates-back.html: * fast/forms/selection-direction-expected.txt: * fast/forms/selection-direction.html: Canonical link: https://commits.webkit.org/231641@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-17 01:34:46 +00:00
/*
* 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
namespace WebCore {
enum class EditableLinkBehavior : uint8_t {
Default,
AlwaysLive,
OnlyLiveWithShiftKey,
LiveWhenNotFocused,
NeverLive
};
}