RESOLVED FIXED 193109
Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=193109
Summary Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
Wenson Hsieh
Reported 2019-01-03 09:06:45 PST
Attachments
WIP (47.58 KB, patch)
2019-01-03 15:47 PST, Wenson Hsieh
no flags
Patch (44.78 KB, patch)
2019-01-10 16:17 PST, Wenson Hsieh
rniwa: review+
Patch for EWS (47.19 KB, patch)
2019-01-10 21:43 PST, Wenson Hsieh
no flags
Wenson Hsieh
Comment 1 2019-01-03 15:47:40 PST
Wenson Hsieh
Comment 2 2019-01-10 16:17:43 PST
Ryosuke Niwa
Comment 3 2019-01-10 19:40:45 PST
Comment on attachment 358847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358847&action=review > Source/WebCore/page/UndoItem.idl:35 > + Constructor(DOMString label, UndoItemInit initDict) We might wanna consider making label simply an attribute of UndoItemInit. > Source/WebCore/page/UndoManager.h:37 > +class UndoManager : public RefCounted<UndoManager> { > +public: Maybe make it fast allocated & iso-heaped? > Source/WebCore/page/UndoManager.h:43 > + virtual ~UndoManager() = default; I don't think we need this. Just add ImplementationLacksVTable to IDL. > Source/WebCore/page/UndoManager.idl:27 > + EnabledAtRuntime=UndoManagerAPI Add GenerateIsReachable=ImplDocument. Add a test if possible too. > LayoutTests/ChangeLog:13 > + * editing/undo/UndoManager/undo-manager-interfaces-expected.txt: Added. > + * editing/undo/UndoManager/undo-manager-interfaces.html: Added. Why don't we just add it to editing/undo-manager/
Ryosuke Niwa
Comment 4 2019-01-10 19:52:08 PST
Comment on attachment 358847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358847&action=review > Source/WebCore/page/UndoItem.idl:34 > + EnabledAtRuntime=UndoManagerAPI, In the future, you'd need to add JSCustomMarkFunction here, then in JSUndoManagerCustom.cpp you need to invoke wrapped().callback().visitJSFunction in JSMutationObserver::visitAdditionalChildren. Then you have to make these objects reachable from the document/frame...
Wenson Hsieh
Comment 5 2019-01-10 21:11:14 PST
Comment on attachment 358847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358847&action=review Thanks for the review! >> Source/WebCore/page/UndoItem.idl:34 >> + EnabledAtRuntime=UndoManagerAPI, > > In the future, you'd need to add JSCustomMarkFunction here, > then in JSUndoManagerCustom.cpp you need to invoke wrapped().callback().visitJSFunction in JSMutationObserver::visitAdditionalChildren. > Then you have to make these objects reachable from the document/frame... Sounds good — I'll augment the next patch (for addItem support) with this change. >> Source/WebCore/page/UndoItem.idl:35 >> + Constructor(DOMString label, UndoItemInit initDict) > > We might wanna consider making label simply an attribute of UndoItemInit. Ok! I moved the label attribute into UndoItemInit. >> Source/WebCore/page/UndoManager.h:37 >> +public: > > Maybe make it fast allocated & iso-heaped? 👍 (Also did this to UndoItem) >> Source/WebCore/page/UndoManager.h:43 >> + virtual ~UndoManager() = default; > > I don't think we need this. > Just add ImplementationLacksVTable to IDL. 👍 (I also fixed this for UndoItem) >> LayoutTests/ChangeLog:13 >> + * editing/undo/UndoManager/undo-manager-interfaces.html: Added. > > Why don't we just add it to editing/undo-manager/ 👍
Wenson Hsieh
Comment 6 2019-01-10 21:34:33 PST
Comment on attachment 358847 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=358847&action=review >> Source/WebCore/page/UndoManager.idl:27 >> + EnabledAtRuntime=UndoManagerAPI > > Add GenerateIsReachable=ImplDocument. Add a test if possible too. 👍 Fixed, and also added a test to verify that the wrapper survives GC.
Wenson Hsieh
Comment 7 2019-01-10 21:43:44 PST
Created attachment 358873 [details] Patch for EWS
Wenson Hsieh
Comment 8 2019-01-11 10:17:56 PST
Comment on attachment 358873 [details] Patch for EWS It looks like commit queue is unresponsive :(
Wenson Hsieh
Comment 9 2019-01-11 10:30:10 PST
Note You need to log in before you can comment on or make changes to this bug.