Bug 163348

Summary: Add experimental support for the "formatForeColor" inputType
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: UI EventsAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, buildbot, commit-queue, enrica, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 163112    
Attachments:
Description Flags
Patch
rniwa: review+, buildbot: commit-queue-
Patch for landing
wenson_hsieh: commit-queue-
Archive of layout-test-results from ews101 for mac-yosemite
none
Patch for landing
none
Archive of layout-test-results from ews114 for mac-yosemite none

Description Wenson Hsieh 2016-10-12 11:45:46 PDT
Add experimental support for the "formatForeColor" inputType
Comment 1 Wenson Hsieh 2016-10-12 12:08:05 PDT
Created attachment 291379 [details]
Patch
Comment 2 Wenson Hsieh 2016-10-12 12:11:39 PDT
<rdar://problem/28739334>
Comment 3 Ryosuke Niwa 2016-10-12 12:22:55 PDT
Comment on attachment 291379 [details]
Patch

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

> Source/WebCore/editing/Editor.cpp:145
> +        auto colorValue = properties->getPropertyCSSValue(CSSPropertyColor);
> +        ASSERT(colorValue);
> +        return colorValue->cssText();

Why don't we just call getPropertyValue which returns String?

> LayoutTests/fast/events/input-events-forecolor-data.html:19
> +            if (event.inputType === "formatForeColor")
> +                shouldBe("event.data", "'rgb(255, 255, 255)'");

I'm not certain the functional syntax is what we want to be using here
but I guess that'd be consistent with CSSOM: https://drafts.csswg.org/cssom/#serialize-a-css-component-value
Comment 4 Ryosuke Niwa 2016-10-12 12:24:19 PDT
Comment on attachment 291379 [details]
Patch

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

Sorry, a few more comments.

> LayoutTests/fast/events/input-events-forecolor-data-expected.txt:2
> +PASS event.data is 'rgb(255, 255, 255)'
> +PASS event.data is 'rgb(255, 255, 255)'

It's not clear why these results are correct.  At minimum we should print out the event name.

> LayoutTests/fast/events/input-events-forecolor-data.html:12
> +            document.getElementById("editable").focus();
> +            testRunner.execCommand("ForeColor", "rgb(255, 255, 255)");

You don't need to wrap this inside the if. execCommand('foreColor') always works and so does focus().

You should probably test more colors though.
Comment 5 Wenson Hsieh 2016-10-12 12:32:52 PDT
Comment on attachment 291379 [details]
Patch

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

>> Source/WebCore/editing/Editor.cpp:145
>> +        return colorValue->cssText();
> 
> Why don't we just call getPropertyValue which returns String?

Good point! Changed to return getPropertyValue().

>> LayoutTests/fast/events/input-events-forecolor-data-expected.txt:2
>> +PASS event.data is 'rgb(255, 255, 255)'
> 
> It's not clear why these results are correct.  At minimum we should print out the event name.

Sounds good. I'll make it more clear by printing out the event type/inputType.

>> LayoutTests/fast/events/input-events-forecolor-data.html:12
>> +            testRunner.execCommand("ForeColor", "rgb(255, 255, 255)");
> 
> You don't need to wrap this inside the if. execCommand('foreColor') always works and so does focus().
> 
> You should probably test more colors though.

Ok, done! Also added more colors in this test.

>> LayoutTests/fast/events/input-events-forecolor-data.html:19
>> +                shouldBe("event.data", "'rgb(255, 255, 255)'");
> 
> I'm not certain the functional syntax is what we want to be using here
> but I guess that'd be consistent with CSSOM: https://drafts.csswg.org/cssom/#serialize-a-css-component-value

Good point -- let's keep this issue in mind.
Comment 6 Wenson Hsieh 2016-10-12 12:46:30 PDT
Created attachment 291384 [details]
Patch for landing
Comment 7 Build Bot 2016-10-12 13:06:14 PDT
Comment on attachment 291379 [details]
Patch

Attachment 291379 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2272193

New failing tests:
fast/events/input-events-forecolor-data.html
Comment 8 Build Bot 2016-10-12 13:06:17 PDT
Created attachment 291386 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 9 Wenson Hsieh 2016-10-12 14:17:20 PDT
Created attachment 291394 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2016-10-12 14:51:47 PDT
Comment on attachment 291394 [details]
Patch for landing

Clearing flags on attachment: 291394

Committed r207244: <http://trac.webkit.org/changeset/207244>
Comment 11 Build Bot 2016-10-12 14:57:58 PDT
Comment on attachment 291379 [details]
Patch

Attachment 291379 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2272726

New failing tests:
fast/events/input-events-forecolor-data.html
Comment 12 Build Bot 2016-10-12 14:58:01 PDT
Created attachment 291401 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5