Allow to define a plugin in javascript
https://bugs.webkit.org/show_bug.cgi?id=138091
Summary Allow to define a plugin in javascript
Julien Isorce
Reported 2014-10-27 04:19:15 PDT
Created attachment 240475 [details] Patch that allow to set from javascript the internal object of an object element Hi, We know this is probably only useful for our usecase but we wanted to have your point of view if this enhancement may have more general interest. So the attach patch allow to define a plugin in pure javascript. Then the page can still use a common interface (so not using a custom element). We know we introduced a new object function which is not specified anywhere but we found this enhancement interesting and we wanted to share it with you. See minimal attached example. Cheers, Julien
Attachments
Patch that allow to set from javascript the internal object of an object element (8.28 KB, patch)
2014-10-27 04:19 PDT, Julien Isorce
no flags
Minimal test to illustrate the patch (944 bytes, text/html)
2014-10-27 04:22 PDT, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (8.28 KB, patch)
2014-10-27 09:54 PDT, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (9.85 KB, patch)
2014-11-04 05:20 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (9.84 KB, patch)
2014-11-06 01:01 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (12.88 KB, patch)
2014-11-13 10:10 PST, Julien Isorce
no flags
Minimal test to illustrate the patch (1.54 KB, text/plain)
2014-11-13 10:11 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (12.84 KB, patch)
2014-11-14 02:26 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (12.85 KB, patch)
2014-11-14 04:08 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (12.24 KB, patch)
2014-11-14 06:42 PST, Julien Isorce
buildbot: commit-queue-
Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 (576.01 KB, application/zip)
2014-11-14 07:57 PST, Build Bot
no flags
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion (602.20 KB, application/zip)
2014-11-14 08:20 PST, Build Bot
no flags
Patch that allow to set from javascript the internal object of an object element (14.96 KB, patch)
2014-11-14 10:01 PST, Julien Isorce
no flags
Patch that allow to set from javascript the internal object of an object element (17.59 KB, patch)
2014-11-17 07:37 PST, Julien Isorce
no flags
Patch (20.14 KB, patch)
2014-11-17 08:01 PST, Julien Isorce
no flags
HTMLObjectElement: can set the underlying object from javascript (21.89 KB, patch)
2014-11-17 08:11 PST, Julien Isorce
no flags
HTMLObjectElement: can set the underlying object from javascript (21.83 KB, patch)
2014-11-17 08:19 PST, Julien Isorce
no flags
HTMLObjectElement: can set the underlying object from javascript (19.04 KB, patch)
2015-02-05 03:20 PST, Julien Isorce
andersca: review-
Julien Isorce
Comment 1 2014-10-27 04:22:08 PDT
Created attachment 240476 [details] Minimal test to illustrate the patch
Julien Isorce
Comment 2 2014-10-27 09:54:58 PDT
Created attachment 240484 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 3 2014-11-04 05:20:58 PST
Created attachment 240921 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 4 2014-11-06 01:01:59 PST
Created attachment 241094 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 5 2014-11-13 10:10:08 PST
Created attachment 241489 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 6 2014-11-13 10:11:15 PST
Created attachment 241490 [details] Minimal test to illustrate the patch
Julien Isorce
Comment 7 2014-11-14 02:26:50 PST
Created attachment 241569 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 8 2014-11-14 04:08:26 PST
Created attachment 241576 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 9 2014-11-14 06:42:02 PST
Created attachment 241585 [details] Patch that allow to set from javascript the internal object of an object element
Build Bot
Comment 10 2014-11-14 07:57:24 PST
Comment on attachment 241585 [details] Patch that allow to set from javascript the internal object of an object element Attachment 241585 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.appspot.com/results/6035540264615936 New failing tests: sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/S15.3.4_A2_T3.html sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/S15.3.4_A2_T1.html sputnik/Conformance/15_Native_Objects/15.2_Object/15.2.4/S15.2.4_A3.html plugins/script-object-invoke.html sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.3/15.3.3.1_Function.prototype/S15.3.3.1_A1.html sputnik/Conformance/15_Native_Objects/15.3_Function/15.3.4/S15.3.4_A2_T2.html plugins/npruntime/throw-exception.html
Build Bot
Comment 11 2014-11-14 07:57:26 PST
Created attachment 241588 [details] Archive of layout-test-results from webkit-ews-16 for mac-mountainlion-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: webkit-ews-16 Port: mac-mountainlion-wk2 Platform: Mac OS X 10.8.5
Build Bot
Comment 12 2014-11-14 08:19:58 PST
Comment on attachment 241585 [details] Patch that allow to set from javascript the internal object of an object element Attachment 241585 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/4629795321151488 Number of test failures exceeded the failure limit.
Build Bot
Comment 13 2014-11-14 08:20:01 PST
Created attachment 241589 [details] Archive of layout-test-results from webkit-ews-03 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-03 Port: mac-mountainlion Platform: Mac OS X 10.8.5
Julien Isorce
Comment 14 2014-11-14 10:01:32 PST
Created attachment 241595 [details] Patch that allow to set from javascript the internal object of an object element
Julien Isorce
Comment 15 2014-11-17 07:37:55 PST
Created attachment 241711 [details] Patch that allow to set from javascript the internal object of an object element
Philippe Normand
Comment 16 2014-11-17 07:44:56 PST
I don't think I can review this but you'll need to provide changelog entries, see http://www.webkit.org/coding/contributing.html
Julien Isorce
Comment 17 2014-11-17 08:01:57 PST
Julien Isorce
Comment 18 2014-11-17 08:11:23 PST
Created attachment 241715 [details] HTMLObjectElement: can set the underlying object from javascript
Julien Isorce
Comment 19 2014-11-17 08:19:25 PST
Created attachment 241717 [details] HTMLObjectElement: can set the underlying object from javascript
Philippe Normand
Comment 20 2014-11-17 23:10:55 PST
Comment on attachment 241717 [details] HTMLObjectElement: can set the underlying object from javascript No Julien, only reviewers should set the r+ flag.
Julien Isorce
Comment 21 2014-11-18 01:49:34 PST
Add reviewers that Tools/Scripts/webkit-patch suggest-reviewers printed.
Chang Shu
Comment 22 2014-12-01 09:46:25 PST
Hi, Julien, Can you explain your usecase of using this interface and any other general usecases you might think of?
Julien Isorce
Comment 23 2014-12-02 05:32:01 PST
Our concrete usecase is to wrap custom js objects. These objects can be registered for example from the injectedBundle. Some of these object are registered through JSClassDefinition. (So it will look like to the second layout test attached to the patch) One of the consequences is that we do not depend on netscape and pepper plugin APIs. In HTMLPluginElement there is already a "::getInstance()" method. This patch basically implements "::setInstance" and being a call triggered from javascript.
Julien Isorce
Comment 24 2015-02-05 03:20:35 PST
Created attachment 246095 [details] HTMLObjectElement: can set the underlying object from javascript Also handle DFG and FTL cases through JITOperations.cpp
Alexey Proskuryakov
Comment 25 2015-02-06 22:53:37 PST
Julien, is this the same use case that Web Components and Shadow DOM serve?
Anders Carlsson
Comment 26 2016-06-26 07:48:40 PDT
Comment on attachment 246095 [details] HTMLObjectElement: can set the underlying object from javascript Looking at the patch, this is not a direction we'd like to take for plug-ins.
Julien Isorce
Comment 27 2016-08-30 13:12:30 PDT
(In reply to comment #25) > Julien, is this the same use case that Web Components and Shadow DOM serve? Hi, nop. Unfortunately there is no way in current upstream or in any spec to override existing properties of a tag object. Custom element would have been a good candidate but because if the "is" attribute, this is not workable.
Note You need to log in before you can comment on or make changes to this bug.