Bug 163348 - Add experimental support for the "formatForeColor" inputType
Summary: Add experimental support for the "formatForeColor" inputType
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: UI Events (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks: 163112
  Show dependency treegraph
 
Reported: 2016-10-12 11:45 PDT by Wenson Hsieh
Modified: 2016-10-14 14:40 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.46 KB, patch)
2016-10-12 12:08 PDT, Wenson Hsieh
rniwa: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (8.16 KB, patch)
2016-10-12 12:46 PDT, Wenson Hsieh
wenson_hsieh: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (880.36 KB, application/zip)
2016-10-12 13:06 PDT, Build Bot
no flags Details
Patch for landing (8.55 KB, patch)
2016-10-12 14:17 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews114 for mac-yosemite (1.96 MB, application/zip)
2016-10-12 14:58 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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