Bug 168384 - [WebIDL] Remove custom conversion from FontFace code by using a Variant
Summary: [WebIDL] Remove custom conversion from FontFace code by using a Variant
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: Sam Weinig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 11:53 PST by Sam Weinig
Modified: 2017-02-15 15:39 PST (History)
0 users

See Also:


Attachments
Patch (5.94 KB, patch)
2017-02-15 12:01 PST, Sam Weinig
achristensen: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2017-02-15 11:53:20 PST
[WebIDL] Remove custom conversion from FontFace code by using a Variant
Comment 1 Sam Weinig 2017-02-15 12:01:41 PST
Created attachment 301642 [details]
Patch
Comment 2 Alex Christensen 2017-02-15 13:43:33 PST
Comment on attachment 301642 [details]
Patch

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

> Source/WebCore/css/FontFace.idl:47
> -    Constructor(DOMString family, any source, optional FontFaceDescriptors descriptors)
> +    Constructor(DOMString family, (DOMString or BinaryData) source, optional FontFaceDescriptors descriptors)

Did you used to be able to call this with JSValues that were not ArrayBuffers or ArrayBufferViews?  Could you add a test that verifies that that can't be done any more?
Comment 3 Sam Weinig 2017-02-15 14:02:21 PST
(In reply to comment #2)
> Comment on attachment 301642 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=301642&action=review
> 
> > Source/WebCore/css/FontFace.idl:47
> > -    Constructor(DOMString family, any source, optional FontFaceDescriptors descriptors)
> > +    Constructor(DOMString family, (DOMString or BinaryData) source, optional FontFaceDescriptors descriptors)
> 
> Did you used to be able to call this with JSValues that were not
> ArrayBuffers or ArrayBufferViews?  Could you add a test that verifies that
> that can't be done any more?

Good idea. I think the old code was wrong, in that it should be converting anything that is not a ArrayBuffer or ArrayBufferView to a String. I'll add a test.
Comment 4 Sam Weinig 2017-02-15 15:39:57 PST
Committed r212405: <http://trac.webkit.org/changeset/212405>