Bug 200064 - Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
Summary: Daring Fireball long press highlights are unnecessarily inflated due to false...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-23 17:25 PDT by Tim Horton
Modified: 2019-07-25 14:57 PDT (History)
11 users (show)

See Also:


Attachments
Patch (15.79 KB, patch)
2019-07-23 17:25 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews214 for win-future (13.60 MB, application/zip)
2019-07-23 20:40 PDT, EWS Watchlist
no flags Details
Patch (15.73 KB, patch)
2019-07-24 11:54 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Patch (15.62 KB, patch)
2019-07-24 12:25 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-highsierra-wk2 (2.93 MB, application/zip)
2019-07-24 13:18 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews100 for mac-highsierra (3.20 MB, application/zip)
2019-07-24 13:33 PDT, EWS Watchlist
no flags Details
Patch (15.63 KB, patch)
2019-07-24 14:06 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-highsierra (3.18 MB, application/zip)
2019-07-24 14:56 PDT, EWS Watchlist
no flags Details
Patch (15.72 KB, patch)
2019-07-24 15:13 PDT, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2019-07-23 17:25:03 PDT
Daring Fireball long press highlights are unnecessarily inflated due to false illegibility
Comment 1 Tim Horton 2019-07-23 17:25:11 PDT
Created attachment 374739 [details]
Patch
Comment 2 EWS Watchlist 2019-07-23 20:40:42 PDT Comment hidden (obsolete)
Comment 3 EWS Watchlist 2019-07-23 20:40:44 PDT Comment hidden (obsolete)
Comment 4 Tim Horton 2019-07-24 09:50:26 PDT
Oh I forgot to use ahem
Comment 5 Geoffrey Garen 2019-07-24 11:20:27 PDT
Comment on attachment 374739 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=374739&action=review

r=me

> Source/WebCore/platform/graphics/ColorUtilities.cpp:-107
> -float luminance(const FloatComponents& sRGBCompontents)

This is my favorite part.

> Source/WebCore/platform/graphics/ColorUtilities.cpp:123
> +    float lighterLuminance = luminance(componentsA);
> +    float darkerLuminance = luminance(componentsB);
> +
> +    if (lighterLuminance < darkerLuminance)
> +        std::swap(lighterLuminance, darkerLuminance);

Can we be fancy?

auto [ lighterLuminance, darkerLuminance ] = std::minmax(componentsA, componentsB);
Comment 6 Geoffrey Garen 2019-07-24 11:21:12 PDT
I meant:

auto [ lighterLuminance, darkerLuminance ] = std::minmax(luminance(componentsA), luminance(componentsB));
Comment 7 Tim Horton 2019-07-24 11:54:36 PDT
Created attachment 374792 [details]
Patch
Comment 8 Tim Horton 2019-07-24 12:16:48 PDT
(In reply to Geoffrey Garen from comment #6)
> I meant:
> 
> auto [ lighterLuminance, darkerLuminance ] =
> std::minmax(luminance(componentsA), luminance(componentsB));

Sure!

But, you ACTUALLY meant

auto [ darkerLuminance, lighterLuminance ] = std::minmax(luminance(componentsA), luminance(componentsB));
Comment 9 Tim Horton 2019-07-24 12:25:19 PDT
Created attachment 374793 [details]
Patch
Comment 10 EWS Watchlist 2019-07-24 12:29:06 PDT
Attachment 374793 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/ColorUtilities.cpp:119:  Extra space in capture list.  [whitespace/brackets] [4]
ERROR: Source/WebCore/platform/graphics/ColorUtilities.cpp:119:  Extra space before [.  [whitespace/brackets] [5]
Total errors found: 2 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 EWS Watchlist 2019-07-24 13:18:12 PDT
Comment on attachment 374793 [details]
Patch

Attachment 374793 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/12802905

New failing tests:
fast/text-indicator/text-indicator-with-low-contrast-text.html
Comment 12 EWS Watchlist 2019-07-24 13:18:14 PDT
Created attachment 374797 [details]
Archive of layout-test-results from ews105 for mac-highsierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-highsierra-wk2  Platform: Mac OS X 10.13.6
Comment 13 EWS Watchlist 2019-07-24 13:33:25 PDT
Comment on attachment 374793 [details]
Patch

Attachment 374793 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12802996

New failing tests:
fast/text-indicator/text-indicator-with-low-contrast-text.html
Comment 14 EWS Watchlist 2019-07-24 13:33:26 PDT
Created attachment 374798 [details]
Archive of layout-test-results from ews100 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 15 Tim Horton 2019-07-24 13:48:10 PDT
That didn't start happening till the minmax. Too fancy.
Comment 16 Tim Horton 2019-07-24 14:06:03 PDT
Created attachment 374805 [details]
Patch
Comment 17 Tim Horton 2019-07-24 14:06:18 PDT
One more shot with Geoff's version and then we go back to mine
Comment 18 EWS Watchlist 2019-07-24 14:08:14 PDT
Attachment 374805 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/ColorUtilities.cpp:119:  Extra space in capture list.  [whitespace/brackets] [4]
ERROR: Source/WebCore/platform/graphics/ColorUtilities.cpp:119:  Extra space before [.  [whitespace/brackets] [5]
Total errors found: 2 in 10 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 19 EWS Watchlist 2019-07-24 14:56:27 PDT
Comment on attachment 374805 [details]
Patch

Attachment 374805 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/12803730

New failing tests:
fast/text-indicator/text-indicator-with-low-contrast-text.html
Comment 20 EWS Watchlist 2019-07-24 14:56:28 PDT
Created attachment 374813 [details]
Archive of layout-test-results from ews101 for mac-highsierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-highsierra  Platform: Mac OS X 10.13.6
Comment 21 Tim Horton 2019-07-24 15:12:19 PDT
Alright back to my version
Comment 22 Tim Horton 2019-07-24 15:13:09 PDT
Created attachment 374818 [details]
Patch
Comment 23 WebKit Commit Bot 2019-07-24 15:36:19 PDT
Comment on attachment 374818 [details]
Patch

Clearing flags on attachment: 374818

Committed r247792: <https://trac.webkit.org/changeset/247792>
Comment 24 WebKit Commit Bot 2019-07-24 15:36:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 25 Radar WebKit Bug Importer 2019-07-24 15:38:26 PDT
<rdar://problem/53516692>
Comment 26 Darin Adler 2019-07-24 16:48:51 PDT
Comment on attachment 374818 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=374818&action=review

> Source/WebCore/testing/Internals.h:860
>              if (useBoundingRectAndPaintAllContentForComplexRanges)
>                  options = options | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges;
> +            if (computeEstimatedBackgroundColor)
> +                options = options | TextIndicatorOptionComputeEstimatedBackgroundColor;
> +            if (respectTextColor)
> +                options = options | TextIndicatorOptionRespectTextColor;

Surprised that |= is not used here. Is there a reason why?
Comment 27 Tim Horton 2019-07-24 16:50:21 PDT
(In reply to Darin Adler from comment #26)
> Comment on attachment 374818 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=374818&action=review
> 
> > Source/WebCore/testing/Internals.h:860
> >              if (useBoundingRectAndPaintAllContentForComplexRanges)
> >                  options = options | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges;
> > +            if (computeEstimatedBackgroundColor)
> > +                options = options | TextIndicatorOptionComputeEstimatedBackgroundColor;
> > +            if (respectTextColor)
> > +                options = options | TextIndicatorOptionRespectTextColor;
> 
> Surprised that |= is not used here. Is there a reason why?

Definitely no reason
Comment 28 Tim Horton 2019-07-24 16:51:07 PDT
Might need iOS-specific results, I'll see when it uploads its bits
Comment 29 Tim Horton 2019-07-24 16:51:41 PDT
(In reply to Tim Horton from comment #27)
> (In reply to Darin Adler from comment #26)
> > Comment on attachment 374818 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=374818&action=review
> > 
> > > Source/WebCore/testing/Internals.h:860
> > >              if (useBoundingRectAndPaintAllContentForComplexRanges)
> > >                  options = options | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges;
> > > +            if (computeEstimatedBackgroundColor)
> > > +                options = options | TextIndicatorOptionComputeEstimatedBackgroundColor;
> > > +            if (respectTextColor)
> > > +                options = options | TextIndicatorOptionRespectTextColor;
> > 
> > Surprised that |= is not used here. Is there a reason why?
> 
> Definitely no reason

It should also totally be an OptionSet
Comment 30 Russell Epstein 2019-07-25 09:49:31 PDT
(In reply to Tim Horton from comment #28)
> Might need iOS-specific results, I'll see when it uploads its bits

Here is the diff on iOS. Are iOS-specific results warranted?

@@ -1,40 +1,40 @@
 whiteTextWhiteBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 whiteTextGrayBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 whiteTextBlackBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 grayTextWhiteBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 grayTextGrayBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 grayTextBlackBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 lightGrayTextWhiteBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 lightGrayTextGrayBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 lightGrayTextBlackBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 darkGrayTextWhiteBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 darkGrayTextGrayBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 darkGrayTextBlackBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 blackTextWhiteBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 blackTextGrayBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
 blackTextBlackBackground: NOT legible
-    0 0 68 66
+    0 0 68 70
 dfTextDfBackground: legible
-    0 0 68 18
-    0 48 36 18
+    0 0 68 19
+    0 51 36 19
Comment 31 Tim Horton 2019-07-25 10:04:42 PDT
(In reply to Russell Epstein from comment #30)
> (In reply to Tim Horton from comment #28)
> > Might need iOS-specific results, I'll see when it uploads its bits
> 
> Here is the diff on iOS. Are iOS-specific results warranted?

Yeah, that’s fine! Can you land baselines? Otherwise I will this evening
Comment 32 Russell Epstein 2019-07-25 10:08:17 PDT
(In reply to Tim Horton from comment #31)
> (In reply to Russell Epstein from comment #30)
> > (In reply to Tim Horton from comment #28)
> > > Might need iOS-specific results, I'll see when it uploads its bits
> > 
> > Here is the diff on iOS. Are iOS-specific results warranted?
> 
> Yeah, that’s fine! Can you land baselines? Otherwise I will this evening

Not a problem.
Comment 33 Russell Epstein 2019-07-25 10:25:32 PDT
(In reply to Russell Epstein from comment #32)
> (In reply to Tim Horton from comment #31)
> > (In reply to Russell Epstein from comment #30)
> > > (In reply to Tim Horton from comment #28)
> > > > Might need iOS-specific results, I'll see when it uploads its bits
> > > 
> > > Here is the diff on iOS. Are iOS-specific results warranted?
> > 
> > Yeah, that’s fine! Can you land baselines? Otherwise I will this evening
> 
> Not a problem.

Landed baselines in https://trac.webkit.org/changeset/247824/webkit
Comment 34 Tim Horton 2019-07-25 14:57:53 PDT
Thank you!