WebKit Bugzilla
Attachment 339105 Details for
Bug 185129
: Make color-filter affect caret-color
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185129-20180429220059.patch (text/plain), 6.73 KB, created by
Simon Fraser (smfr)
on 2018-04-29 22:00:59 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-04-29 22:00:59 PDT
Size:
6.73 KB
patch
obsolete
>Subversion Revision: 231153 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c4facc47a369b1812f35d748df2da688613ec0df..a31c5e9f335adee8295f8fd37e505023a86e4f6c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-29 Simon Fraser <simon.fraser@apple.com> >+ >+ Make color-filter affect caret-color >+ https://bugs.webkit.org/show_bug.cgi?id=185129 >+ rdar://problem/39829066 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Transform the colors used to compare the caret color with the background through >+ color-filter (since we want contrasting colors after filters are applied), and >+ transform caret-color itself. >+ >+ Test: css3/color-filters/color-filter-caret-color.html >+ >+ * editing/FrameSelection.cpp: >+ (WebCore::CaretBase::paintCaret const): >+ > 2018-04-28 Simon Fraser <simon.fraser@apple.com> > > Fix color-filter to apply to SVG colors >diff --git a/Source/WebCore/editing/FrameSelection.cpp b/Source/WebCore/editing/FrameSelection.cpp >index 7f2d7793ec1879a75d8744c3767ce224fecf3766..0683af20a782a627de1b699aa6a3c6f3ae1edb5d 100644 >--- a/Source/WebCore/editing/FrameSelection.cpp >+++ b/Source/WebCore/editing/FrameSelection.cpp >@@ -1754,13 +1754,13 @@ void CaretBase::paintCaret(Node* node, GraphicsContext& context, const LayoutPoi > auto computeCaretColor = [] (const RenderStyle& elementStyle, const RenderStyle* rootEditableStyle) { > // CSS value "auto" is treated as an invalid color. > if (!elementStyle.caretColor().isValid() && rootEditableStyle) { >- auto rootEditableBackgroundColor = rootEditableStyle->visitedDependentColor(CSSPropertyBackgroundColor); >- auto elementBackgroundColor = elementStyle.visitedDependentColor(CSSPropertyBackgroundColor); >+ auto rootEditableBackgroundColor = rootEditableStyle->visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor); >+ auto elementBackgroundColor = elementStyle.visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor); > auto disappearsIntoBackground = rootEditableBackgroundColor.blend(elementBackgroundColor) == rootEditableBackgroundColor; > if (disappearsIntoBackground) >- return rootEditableStyle->visitedDependentColor(CSSPropertyCaretColor); >+ return rootEditableStyle->visitedDependentColorWithColorFilter(CSSPropertyCaretColor); > } >- return elementStyle.visitedDependentColor(CSSPropertyCaretColor); >+ return elementStyle.visitedDependentColorWithColorFilter(CSSPropertyCaretColor); > }; > auto* rootEditableElement = node->rootEditableElement(); > auto* rootEditableStyle = rootEditableElement && rootEditableElement->renderer() ? &rootEditableElement->renderer()->style() : nullptr; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 7534cf5d270ee016dc7368256835e16b67ca1c06..c6bb1e19a41e02263d69f6f4473eae32e34e4689 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2018-04-29 Simon Fraser <simon.fraser@apple.com> >+ >+ Make color-filter affect caret-color >+ https://bugs.webkit.org/show_bug.cgi?id=185129 >+ rdar://problem/39829066 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * css3/color-filters/color-filter-caret-color-expected.html: Added. >+ * css3/color-filters/color-filter-caret-color.html: Added. >+ > 2018-04-28 Simon Fraser <simon.fraser@apple.com> > > Fix color-filter to apply to SVG colors >diff --git a/LayoutTests/css3/color-filters/color-filter-caret-color-expected.html b/LayoutTests/css3/color-filters/color-filter-caret-color-expected.html >new file mode 100644 >index 0000000000000000000000000000000000000000..4dd384b33f1cbd7bb711d071f379e8b4e3defde0 >--- /dev/null >+++ b/LayoutTests/css3/color-filters/color-filter-caret-color-expected.html >@@ -0,0 +1,37 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>CSS Test: color-filter reference</title> >+ <link rel="author" title="Apple" href="http://www.apple.com/"> >+ >+ <style> >+ #test-container { >+ height: 50px; >+ width: 50px; >+ overflow: hidden; >+ border: 1px solid black; >+ } >+ >+ #test { >+ background-color: white; >+ transform-origin: left top; >+ transform: scale(50, 50); >+ font-size: 10px; /* Needed for the caret to render in Firefox. */ >+ caret-color: green; >+ } >+ >+ </style> >+ </head> >+ <body> >+ <p>The caret should show as a green flashing square below.</p> >+ <div id="test-container"> >+ <div id="test" contenteditable="true"> >+ <span> <!-- Needed for the caret to render in Firefox. --></span> >+ </div> >+ </div> >+ <script> >+ document.getElementById("test").focus(); >+ window.getSelection().modify("move", "left", "character"); // Place the caret at the start of the <span>. >+ </script> >+ </body> >+</html> >diff --git a/LayoutTests/css3/color-filters/color-filter-caret-color.html b/LayoutTests/css3/color-filters/color-filter-caret-color.html >new file mode 100644 >index 0000000000000000000000000000000000000000..f814dd67f352f471415eadb5630931f65fc778ba >--- /dev/null >+++ b/LayoutTests/css3/color-filters/color-filter-caret-color.html >@@ -0,0 +1,40 @@ >+<!DOCTYPE html> >+<html> >+ <head> >+ <title>CSS Test: color-filter affects caret-color</title> >+ <link rel="author" title="Apple" href="http://www.apple.com/"> >+ <link rel="match" href="color-filter-caret-color-expected.html"> >+ >+ <meta name="assert" content="color-filter affects caret-color"> >+ <style> >+ #test-container { >+ height: 50px; >+ width: 50px; >+ overflow: hidden; >+ border: 1px solid black; >+ } >+ >+ #test { >+ color-filter: invert(); >+ background-color: white; >+ transform-origin: left top; >+ transform: scale(50, 50); >+ font-size: 10px; /* Needed for the caret to render in Firefox. */ >+ caret-color: rgb(255, 128, 255); >+ } >+ >+ </style> >+ </head> >+ <body> >+ <p>The caret should show as a green flashing square below.</p> >+ <div id="test-container"> >+ <div id="test" contenteditable="true"> >+ <span> <!-- Needed for the caret to render in Firefox. --></span> >+ </div> >+ </div> >+ <script> >+ document.getElementById("test").focus(); >+ window.getSelection().modify("move", "left", "character"); // Place the caret at the start of the <span>. >+ </script> >+ </body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
thorton
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185129
: 339105 |
339106