RESOLVED FIXED 191352
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
Summary Make it possible to edit images inline
Tim Horton
Reported 2018-11-07 00:58:47 PST
Make it possible to edit images inline
Attachments
WIP (86.57 KB, patch)
2018-11-07 01:02 PST, Tim Horton
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.45 MB, application/zip)
2018-11-07 02:14 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (1.83 MB, application/zip)
2018-11-07 02:57 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews117 for mac-sierra (3.35 MB, application/zip)
2018-11-07 06:13 PST, EWS Watchlist
no flags
WIP (95.21 KB, patch)
2018-11-07 11:12 PST, Tim Horton
no flags
Patch (99.33 KB, patch)
2018-11-07 15:34 PST, Tim Horton
no flags
Patch (99.67 KB, patch)
2018-11-08 01:17 PST, Tim Horton
no flags
Archive of layout-test-results from ews101 for mac-sierra (2.47 MB, application/zip)
2018-11-08 02:30 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (2.95 MB, application/zip)
2018-11-08 02:40 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (3.35 MB, application/zip)
2018-11-08 03:20 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (3.59 MB, application/zip)
2018-11-08 05:12 PST, EWS Watchlist
no flags
Patch (99.66 KB, patch)
2018-11-08 10:11 PST, Tim Horton
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.60 MB, application/zip)
2018-11-08 11:10 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (3.35 MB, application/zip)
2018-11-08 12:17 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.36 MB, application/zip)
2018-11-08 13:59 PST, EWS Watchlist
no flags
Archive of layout-test-results from ews113 for mac-sierra (3.46 MB, application/zip)
2018-11-08 14:14 PST, EWS Watchlist
no flags
Patch (101.35 KB, patch)
2018-11-09 14:49 PST, Tim Horton
no flags
Patch (101.30 KB, patch)
2018-11-09 15:53 PST, Tim Horton
no flags
Patch (101.39 KB, patch)
2018-11-09 21:43 PST, Tim Horton
no flags
Patch (100.86 KB, patch)
2018-11-10 00:32 PST, Tim Horton
no flags
Patch (101.18 KB, patch)
2018-11-12 12:55 PST, Tim Horton
no flags
Tim Horton
Comment 1 2018-11-07 01:02:38 PST
Tim Horton
Comment 2 2018-11-07 01:03:34 PST
EWS Watchlist
Comment 3 2018-11-07 01:04:37 PST Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-11-07 02:14:07 PST Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-11-07 02:14:08 PST Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-11-07 02:57:05 PST Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-11-07 02:57:06 PST Comment hidden (obsolete)
EWS Watchlist
Comment 8 2018-11-07 06:13:36 PST Comment hidden (obsolete)
EWS Watchlist
Comment 9 2018-11-07 06:13:37 PST Comment hidden (obsolete)
Sam Weinig
Comment 10 2018-11-07 08:59:15 PST
I think you forgot to upload the whole patch. From what I can see in the WebCore part, will this provide a generic mechanism for hosting arbitrary views (NS or UI) as an element (I'm getting this from the generic sounding EmbeddedView enum value in GraphicsLayer).
Tim Horton
Comment 11 2018-11-07 09:10:57 PST
(In reply to Sam Weinig from comment #10) > I think you forgot to upload the whole patch. > > From what I can see in the WebCore part, will this provide a generic > mechanism for hosting arbitrary views (NS or UI) as an element (I'm getting > this from the generic sounding EmbeddedView enum value in GraphicsLayer). It’s also adopted for contenteditable image, if a pref is turned on. But right now it just plops in a native view, doesn’t do any serialization of the image in either direction, etc. There’s more to do! But this is the first step. Just need a changelog.
Tim Horton
Comment 12 2018-11-07 11:12:26 PST
Tim Horton
Comment 13 2018-11-07 15:34:01 PST
EWS Watchlist
Comment 14 2018-11-07 15:37:00 PST Comment hidden (obsolete)
Tim Horton
Comment 15 2018-11-08 01:17:37 PST
EWS Watchlist
Comment 16 2018-11-08 01:20:22 PST Comment hidden (obsolete)
EWS Watchlist
Comment 17 2018-11-08 02:30:10 PST Comment hidden (obsolete)
EWS Watchlist
Comment 18 2018-11-08 02:30:12 PST Comment hidden (obsolete)
EWS Watchlist
Comment 19 2018-11-08 02:40:16 PST Comment hidden (obsolete)
EWS Watchlist
Comment 20 2018-11-08 02:40:18 PST Comment hidden (obsolete)
EWS Watchlist
Comment 21 2018-11-08 03:20:05 PST Comment hidden (obsolete)
EWS Watchlist
Comment 22 2018-11-08 03:20:07 PST Comment hidden (obsolete)
EWS Watchlist
Comment 23 2018-11-08 05:12:55 PST Comment hidden (obsolete)
EWS Watchlist
Comment 24 2018-11-08 05:12:57 PST Comment hidden (obsolete)
Tim Horton
Comment 25 2018-11-08 10:10:34 PST
I'm guessing the test failure has something to do with shouldBeNormalFlowOnly/shouldBeSelfPaintingLayer
Tim Horton
Comment 26 2018-11-08 10:11:33 PST
EWS Watchlist
Comment 27 2018-11-08 10:14:59 PST Comment hidden (obsolete)
EWS Watchlist
Comment 28 2018-11-08 11:10:29 PST Comment hidden (obsolete)
EWS Watchlist
Comment 29 2018-11-08 11:10:31 PST Comment hidden (obsolete)
EWS Watchlist
Comment 30 2018-11-08 12:17:16 PST Comment hidden (obsolete)
EWS Watchlist
Comment 31 2018-11-08 12:17:18 PST Comment hidden (obsolete)
Dean Jackson
Comment 32 2018-11-08 12:51:39 PST
Comment on attachment 354246 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354246&action=review I feel like the EmbeddedView part should be a separate patch, and I'm not really qualified to review, but whatever 🤗 > Source/WebCore/platform/graphics/GraphicsLayer.cpp:745 > + return ++nextEmbeddedViewID; Shouldn't "next" mean nextEmbeddedViewID++? Or is 0 special? (/me reads backwards and discovers that 0 is actually special in that it is treated as no assigned ID) > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1170 > + contentsLayerChanged = true; Why not just put noteSublayersChanged() here and avoid contentsLayerChanged entirely? > Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:1031 > + return { }; Why { } vs 0? > Source/WebCore/rendering/RenderImage.cpp:227 > + auto editableValue = element()->attributeWithoutSynchronization(x_apple_editable_imageAttr); > + if (editableValue.isNull()) > + return false; > + > + return editableValue.isEmpty() || equalLettersIgnoringASCIICase(editableValue, "true"); I think this should follow the controls attribute behaviour on HTMLMediaElement. e.g. return element()->hasAttributeWithoutSynchronization(x_apple_editable_imageAttr); and don't even look at the value. > Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:44 > + , embeddedViewID(0) You use 0 here :) Also, why isn't this in the .h file? > Source/WebKit/Shared/WebPreferences.yaml:1187 > +EditableImagesEnabled: > + type: bool > + defaultValue: false No webcoreBinding needed? > LayoutTests/editing/images/basic-editable-image.html:13 > + const numberOfStrokesInEditableImageAfterDrawing = (await UIHelper.numberOfStrokesInEditableImage()); Please use WebML to detect if it was a square. Nit: No need for the () around awaits. > LayoutTests/editing/images/basic-editable-image.html:15 > + testRunner.notifyDone(); No need to do this - I believe we wait until all promises are resolved by default.
EWS Watchlist
Comment 33 2018-11-08 13:59:18 PST Comment hidden (obsolete)
EWS Watchlist
Comment 34 2018-11-08 13:59:20 PST Comment hidden (obsolete)
EWS Watchlist
Comment 35 2018-11-08 14:14:43 PST Comment hidden (obsolete)
EWS Watchlist
Comment 36 2018-11-08 14:14:46 PST Comment hidden (obsolete)
Tim Horton
Comment 37 2018-11-09 11:10:23 PST
(In reply to Dean Jackson from comment #32) > Comment on attachment 354246 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=354246&action=review > > I feel like the EmbeddedView part should be a separate patch, and I'm not > really qualified to review, but whatever 🤗 I didn't want to do that because it's not testable by itself. > > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1170 > > + contentsLayerChanged = true; > > Why not just put noteSublayersChanged() here and avoid contentsLayerChanged > entirely? Sure > > Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:1031 > > + return { }; > > Why { } vs 0? 🤗 > > Source/WebCore/rendering/RenderImage.cpp:227 > > + auto editableValue = element()->attributeWithoutSynchronization(x_apple_editable_imageAttr); > > + if (editableValue.isNull()) > > + return false; > > + > > + return editableValue.isEmpty() || equalLettersIgnoringASCIICase(editableValue, "true"); > > I think this should follow the controls attribute behaviour on > HTMLMediaElement. e.g. > > return > element()->hasAttributeWithoutSynchronization(x_apple_editable_imageAttr); > > and don't even look at the value. GOOD IDEA > > Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:44 > > + , embeddedViewID(0) > > You use 0 here :) > > Also, why isn't this in the .h file? Because I didn't want to move all of them. > > Source/WebKit/Shared/WebPreferences.yaml:1187 > > +EditableImagesEnabled: > > + type: bool > > + defaultValue: false > > No webcoreBinding needed? Defaults to a WebCore::Setting with the same name, right? > > LayoutTests/editing/images/basic-editable-image.html:13 > > + const numberOfStrokesInEditableImageAfterDrawing = (await UIHelper.numberOfStrokesInEditableImage()); > > Please use WebML to detect if it was a square. Patches welcome. > Nit: No need for the () around awaits. > > LayoutTests/editing/images/basic-editable-image.html:15 > > + testRunner.notifyDone(); > > No need to do this - I believe we wait until all promises are resolved by > default. Both good to know!
Tim Horton
Comment 38 2018-11-09 11:11:27 PST
(In reply to Tim Horton from comment #37) > (In reply to Dean Jackson from comment #32) > > Comment on attachment 354246 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=354246&action=review > > > > > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1170 > > > + contentsLayerChanged = true; > > > > Why not just put noteSublayersChanged() here and avoid contentsLayerChanged > > entirely? > > Sure Wait, no, it's because if you're setting to 0 and it's already 0 we won't rebuild :P
Tim Horton
Comment 39 2018-11-09 14:49:40 PST
EWS Watchlist
Comment 40 2018-11-09 14:51:31 PST
Attachment 354389 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:960: developmentRegion is not en. [xcodeproj/settings] [5] ERROR: Tools/TestRunnerShared/spi/PencilKitTestSPI.h:35: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 61 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 41 2018-11-09 15:53:52 PST
EWS Watchlist
Comment 42 2018-11-09 15:56:38 PST
Attachment 354401 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:960: developmentRegion is not en. [xcodeproj/settings] [5] ERROR: Tools/TestRunnerShared/spi/PencilKitTestSPI.h:35: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 61 files If any of these errors are false positives, please file a bug against check-webkit-style.
Simon Fraser (smfr)
Comment 43 2018-11-09 16:13:07 PST
Comment on attachment 354401 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=354401&action=review > Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp:1168 > + m_contentsLayer = createPlatformCALayerForEmbeddedView(platformType, embeddedViewID, this); Probably don't want to create this very time. > Source/WebCore/platform/graphics/ca/PlatformCALayer.h:80 > + LayerTypeCustom, > + LayerTypeEditableImageLayer, I would keep Custom at the end. > Source/WebCore/rendering/RenderLayerCompositor.cpp:2464 > + m_reevaluateCompositingAfterLayout = true; I don't think you want this. > Source/WebKit/UIProcess/ios/WKDrawingView.mm:47 > + _pencilView = adoptNS([allocPKCanvasViewInstance() initWithFrame:CGRectMake(0, 0, 768, 400)]); Hardcoded frame! > Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm:787 > +PKCanvasView *findEditableImageCanvas(void) (void)?
Tim Horton
Comment 44 2018-11-09 21:43:31 PST
EWS Watchlist
Comment 45 2018-11-09 21:46:40 PST
Attachment 354440 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:960: developmentRegion is not en. [xcodeproj/settings] [5] ERROR: Tools/TestRunnerShared/spi/PencilKitTestSPI.h:35: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 61 files If any of these errors are false positives, please file a bug against check-webkit-style.
Tim Horton
Comment 46 2018-11-10 00:32:46 PST
EWS Watchlist
Comment 47 2018-11-10 00:35:46 PST
Attachment 354453 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:960: developmentRegion is not en. [xcodeproj/settings] [5] ERROR: Tools/TestRunnerShared/spi/PencilKitTestSPI.h:35: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 60 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 48 2018-11-10 01:58:11 PST
Comment on attachment 354453 [details] Patch Clearing flags on attachment: 354453 Committed r238065: <https://trac.webkit.org/changeset/238065>
WebKit Commit Bot
Comment 49 2018-11-10 01:58:14 PST
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 50 2018-11-10 13:01:43 PST
Reverted r238065 for reason: Breaks internal builds. Committed r238070: <https://trac.webkit.org/changeset/238070>
Tim Horton
Comment 51 2018-11-12 12:55:34 PST
EWS Watchlist
Comment 52 2018-11-12 12:58:15 PST
Attachment 354575 [details] did not pass style-queue: ERROR: Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:960: developmentRegion is not en. [xcodeproj/settings] [5] ERROR: Tools/TestRunnerShared/spi/PencilKitTestSPI.h:35: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 60 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 53 2018-11-12 14:04:55 PST
Comment on attachment 354575 [details] Patch Clearing flags on attachment: 354575 Committed r238108: <https://trac.webkit.org/changeset/238108>
WebKit Commit Bot
Comment 54 2018-11-12 14:04:57 PST
All reviewed patches have been landed. Closing bug.
Ryan Haddad
Comment 55 2018-11-13 11:29:44 PST
This change broke the Windows build: C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(50): error C2259: 'WebCore::PlatformCALayerWin': cannot instantiate abstract class [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj] C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(50): note: due to following members: C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(50): note: 'WebCore::GraphicsLayer::EmbeddedViewID WebCore::PlatformCALayer::embeddedViewID(void) const': is abstract C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\PlatformCALayer.h(240): note: see declaration of 'WebCore::PlatformCALayer::embeddedViewID' C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(55): error C2259: 'WebCore::PlatformCALayerWin': cannot instantiate abstract class [C:\cygwin\home\buildbot\WebKit\WebKitBuild\Release\Source\WebCore\WebCore.vcxproj] C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(55): note: due to following members: C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\win\PlatformCALayerWin.cpp(55): note: 'WebCore::GraphicsLayer::EmbeddedViewID WebCore::PlatformCALayer::embeddedViewID(void) const': is abstract C:\cygwin\home\buildbot\WebKit\Source\WebCore\platform\graphics\ca\PlatformCALayer.h(240): note: see declaration of 'WebCore::PlatformCALayer::embeddedViewID https://build.webkit.org/builders/Apple%20Win%2010%20Release%20%28Build%29/builds/252/steps/compile-webkit/logs/stdio
Tim Horton
Comment 56 2018-11-13 11:30:38 PST
Will sort that out
Ross Kirsling
Comment 57 2018-11-13 15:28:52 PST
Note You need to log in before you can comment on or make changes to this bug.