commit | 9a084cbac29550a9c5afd0cf432dfa97bef9559c | [log] [tgz] |
---|---|---|
author | dbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon Aug 14 17:29:34 2017 +0000 |
committer | dbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc> | Mon Aug 14 17:29:34 2017 +0000 |
tree | 65fcbe00d5d6f5a195fabcc2c8c44b59027182d1 | |
parent | b9cc2dd52c400039f451e0ee8ac3461f86e92a10 [diff] |
[css-ui] Implement caret-color support https://bugs.webkit.org/show_bug.cgi?id=166572 <rdar://problem/33852589> Reviewed by David Hyatt. Source/WebCore: Add support for the CSS property caret-color as per <https://www.w3.org/TR/css-ui-3/#caret-color> (02 March 2017). The property caret-color specifies the color of the text insertion caret in an editable element, say an HTML textarea element. Unlike other CSS color properties caret-color can have value "auto" and this is its initial value. Internally we treat value "auto" as an invalid caret color to simplify the code. Tests: editing/pasteboard/preserve-caret-color.html fast/css/caret-color-auto.html fast/css/caret-color-fallback-to-color.html fast/css/caret-color-inherit.html fast/css/caret-color-span-inside-editable-parent.html fast/css/caret-color.html fast/history/visited-link-caret-color.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/CSSProperties.json: Add property caret-color. We represent the initial "auto" Also, fix up wording in a comment while I am here. * css/StyleResolver.cpp: (WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be applied to visited hyperlinks. * css/parser/CSSParserFastPaths.cpp: (WebCore::parseCaretColor): Added. (WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color can be defined to be "auto". We explicitly check if the property is caret-color and use parseCaretColor() to parse its value. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeCaretColor): Added. (WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue() use a dedicated code path to parse caret-color. * editing/EditingStyle.cpp: Preserve caret-color during editing operations. * editing/FrameSelection.cpp: (WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of color for the color of the text insertion caret. Always honor the caret-color of the editable element if it is valid color. Note that "caret-color: auto" is treated as an invalid color internally. A caret-color can have an invalid color if its inherits from the CSS color property with an invalid color. If caret-color is a valid color then we take it to be the color of the text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the color of the text-insertion caret. (WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret(). * page/animation/CSSPropertyAnimation.cpp: (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper to support animating caret-color. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider changes to caret color. (WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate color for property caret-color with respect to an unvisited or visited link. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setCaretColor): Added. (WebCore::RenderStyle::setVisitedLinkCaretColor): Added. (WebCore::RenderStyle::caretColor const): Added. (WebCore::RenderStyle::visitedLinkCaretColor const): Added. * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color. (WebCore::StyleRareInheritedData::operator== const): Ditto. * rendering/style/StyleRareInheritedData.h: LayoutTests: Add reference tests to ensure that we do not regress CSS property caret-color. * TestExpectations: Unskip Web Platform Tests that now pass. * editing/deleting/maintain-style-after-delete-expected.txt: Updated expected result. * editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt: Ditto. * editing/pasteboard/do-not-copy-unnecessary-styles-2-expected.txt: Ditto. * editing/pasteboard/onpaste-text-html-expected.txt: Ditto. * editing/pasteboard/preserve-caret-color-expected.txt: Added. * editing/pasteboard/preserve-caret-color.html: Added. * editing/pasteboard/preserve-underline-color-expected.txt: * fast/css/caret-color-auto-expected.html: Added. * fast/css/caret-color-auto.html: Added. * fast/css/caret-color-expected.html: Added. * fast/css/caret-color-fallback-to-color-expected.html: Added. * fast/css/caret-color-fallback-to-color.html: Added. * fast/css/caret-color-inherit-expected.html: Added. * fast/css/caret-color-inherit.html: Added. * fast/css/caret-color-span-inside-editable-parent-expected.html: Added. * fast/css/caret-color-span-inside-editable-parent.html: Added. * fast/css/caret-color.html: Added. * fast/events/before-input-events-prevent-drag-and-drop-expected.txt: Updated expected result. * fast/events/input-events-paste-rich-datatransfer-expected.txt: Ditto. * fast/events/ondrop-text-html-expected.txt: Ditto. * fast/history/visited-link-caret-color-expected.html: Added. * fast/history/visited-link-caret-color.html: Added. * platform/ios/TestExpectations: Skip the tests on iOS as iOS does not enable ENABLE(TEXT_CARET). UIKit renders the text insertion caret on iOS. * platform/mac/editing/style/5065910-expected.txt: Updated expected result. * platform/mac/editing/style/5084241-expected.png: Ditto. * platform/mac/editing/style/5084241-expected.txt: Ditto. * platform/ios-wk2/editing/style/5084241-expected.txt: Ditto. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@220706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit is a cross-platform web browser engine. On iOS and macOS, it powers Safari, Mail, iBooks, and many other applications.
Visit WebKit Feature Status page to see which Web API has been implemented, in development, or under consideration.
Downloading Safari Technology Preview to test the latest version of WebKit.
Once your bug is filed, you will receive email when it is updated at each stage in the bug life cycle. After the bug is considered fixed, you may be asked to download the latest nightly and confirm that the fix works for you.
On Windows, follow the instructions on our website.
Run the following command to clone WebKit's Git SVN repository:
git clone git://git.webkit.org/WebKit.git WebKit
If you want to be able to commit changes to the repository, or just want to check out branches that aren’t contained in WebKit.git, you will need track WebKit's Subversion repository. You can run the following command to configure this and other options of the new Git clone for WebKit development.
Tools/Scripts/webkit-patch setup-git-clone
For information about this, and other aspects of using Git with WebKit, read the wiki page.
Run the following command to check out WebKit's subversion repository:
svn checkout https://svn.webkit.org/repository/webkit/trunk WebKit
Install Xcode and its command line tools if you haven't done so already:
xcode-select --install
Run the following command to build a debug build with debugging symbols and assertions:
Tools/Scripts/build-webkit --debug
For performance testing, and other purposes, use --release
instead.
You can open WebKit.xcworkspace
to build and debug WebKit within WebKit.
If you don't use a custom build location in Xcode preferences, you have to update the workspace settings to use WebKitBuild
directory. In menu bar, choose File > Workspace Settings, then click the Advanced button, select “Custom”, “Relative to Workspace”, and enter WebKitBuild
for both Products and Intermediates.
The first time after you install a new Xcode, you will need to run the following command to enable Xcode to build command line tools for iOS Simulator:
sudo Tools/Scripts/configure-xcode-for-ios-development
Without this step, you will see the error message: “target specifies product type ‘com.apple.product-type.tool’, but there’s no such product type for the ‘iphonesimulator’ platform.
” when building target JSCLLIntOffsetsExtractor
of project JavaScriptCore
.
Run the following command to build a debug build with debugging symbols and assertions for iOS:
Tools/Scripts/build-webkit --debug --ios-simulator.
Install the dependencies by running the following command:
Tools/gtk/install-dependencies
Then run the following command to build additional dependencies:
Tools/Scripts/update-webkitgtk-libs
Run the following command to build WebKit with debugging symbols for GTK+ port:
Tools/Scripts/build-webkit --debug --gtk
Note that the procedure for building a release tarball is different. For more information, see the wiki page.
For building WebKit on Windows, see the wiki page.
Run the following command to launch Safari with your local build of WebKit:
Tools/Scripts/run-safari --debug
The run-safari
script sets the DYLD_FRAMEWORK_PATH
environment variable to point to your build products, and then launches /Applications/Safari.app
. DYLD_FRAMEWORK_PATH
tells the system loader to prefer your build products over the frameworks installed in /System/Library/Frameworks
.
To run other applications with your local build of WebKit, run the following command:
Tools/Scripts/run-webkit-app <application-path>
Run the following command to launch iOS simulator with your local build of WebKit:
run-safari --debug --ios-simulator
In both cases, if you have built release builds instead, use --release
instead of --debug
.
Congratulations! You’re up and running. Now you can begin coding in WebKit and contribute your fixes and new features to the project. For details on submitting your code to the project, read Contributing Code.