* Release window event handlers on Dispose
Make sure event handlers related to `Window`, e.g. `WindowStateChanged`, is released during Dispose.
* Clear reference to `Window`
IRenderWebBrowser - Method naming now matches CEF, xmldoc updated to be more accurate
CefSharp.Wpf.ChromiumWebBrowser and CefSharp.OffScreen.ChromiumWebBrowser both updated as a result of IRenderWebBrowser changes
Should be minimal public API changes, should only require changes for those that are implementing their own rendering, who will have a major rewrite on their hands regardless of this.
Improved for when drag/drop both originate and end within the browser. Reuse the CEF IDragData for DragTargetDragEnter call
No improvement has been made to dragging external items
WritableBitmapFactory now works as expected
Add option to invalidate whole bitmap in response to #2035 (default is to invalidate only the dirty rect still)
* JSB Rewrite - Add CefSharp.RegisterBoundObject javascript method
To get around the problem of IPC timing, I've reversed the communication, now it's the render process requesting
the bound objects, the implementation is incomplete at this stage, more just a basic proof of concept
Rewrite BindingTest.html using QUnit
One of the tests doesn't map correctly as it requires def user interaction
TODO:
- Get objects by name
- Rename Messages.h values that relate to this change so they are more descriptive
- Better error handling
- Caching of objects within a render process
- Investigate global context options, don't think it's possible to call an async method directly in the global context
# Conflicts:
# CefSharp.Example/Resources/BindingTest.html
* JSB Improve Request/Response message names
* BindingTest.html - Output stress test results
* Remove JavascriptRootObject was leftover from time we used WCF to transmit objects
* JavascriptObjectRepository - Objects are now sent in the same list with an IsAsync flag
Separation when sending over IPC with two unique lists isn't necessary
* JavascriptObjectRepository - Return objects by name or return all by default
Untabify CefAppUnmanagedWrapper.cpp
Add minor comment to CefBrowserWrapper for a reminder that we use Frame Identifier as dictionary key
* Add //TODO: JSB comments for work that's left to be done
Ideally within a render process we cache bound objects once they've been communicated,
It would also be nice to make multiple binding requests so objects can later be added dynamically
* JSB Allow multiple calls to CefSharp.RegisterBoundObject
Update BindingTest.html to name two distinct calls to different bound objects
* JSB - Add some notes about caching, no working implementation yet
* JSB - Dynamically Register object on Request
* JSB Add ability to unbind an object and rename RegisterBoundObject to BindObjectAsync
# Conflicts:
# CefSharp.Example/Resources/BindingTest.html
* JSB BindObjectAsync - if objects already bound then return false
* JSB - Ignore Indexer properties
Were previously throwing an exception
* JSB - Add LegacyJavascriptBindingEnabled option so preserve existing behaviour
This is only useful for SPA application and those that only navigate to pages
hosting within a single domain. Any sort of cross-site navigation and a new
render process will be spawned and objects won't be bound automatically
(You can use the new methods to request they're bound yourself, at least in theory,
more testing required on this)
* Add LegacyBindingTest.html
Current disabled by default. To enable uncomment CefSharpSettings.LegacyJavascriptBindingEnabled = true;
in CefExample.cs
* RegisterJsObject and RegisterAsyncJsObject can now only be used when CefSharpSettings.LegacyJavascriptBindingEnabled = true
See https://github.com/cefsharp/CefSharp/issues/2246 for details
- Make public so users can implement their own handler (the OSR IME patch can be rewritten as a IWpfKeyboardHandler)
- Formatting for consistency
- Make methods virtual
Follow up to #2056
* Call correct base method and handle text input in case event wasn't handled
* Removed SourceHook method
* Added previous keyboard handling logic and ability to use it through a property
OffScreen
- Now maintains a raw Byte[] buffer that is used to create the GDI bitmaps
can be overridden and raw buffer access granted (eliminates the forced memory copy to the memory mapped view)
WPF
- MemoryMappedFile.CreateNew is now used to create the in memory view and copy the buffer
- InteropBitmapFactory only create new MemoryMappedFile selectively. If the MemoryMappedFile is larger than we require then just reuse it rather than
releasing then allocating a smaller section of memory that's used for double buffering with InteropBitmap and WritableBitmap
- Removed CefDirtyRect and used existing Rect class
- Rename rendering event to Paint, still preferable to implement IBitmapFactory or subclass ChromiumWebBrowser
- Update ChromiumWebBrowserWithScreenshotSupport to support new rendering method - not very well tested.
Resolves#2237
This reverts the change from #1962 where we manually rounded up - it's still possible to do this by inheriting from ChromiumWebBrowser and overriding GetViewRect should you choose to
Easy way to test the rounding changes is to add Margin="0.5,0.5,0,0" to a ChromiumWebBrowser instance in xaml
You can manually disable layout rounding of course UseLayoutRounding="False" in xaml on the control
Allow user to override and then specify their own behaviour
Call base methods in overrides - reference source shows the protected methods are empty,
we're just doing this for correctness (compiler should optimise the calls away)
WPF - Add checks so if RequestContext is set after browser created an exception is thrown
WinForms - Add checks so if RequestContext is set after browser created an exception is thrown
Remove call to PresentationSource.FromVisual(this) as it's very expensive, walks up the tree, it's also unnecessary as we keep a reference to the visual HwndSource
* Fix exception when PresentationSource not set
Prevent PointToScreen() being called if the visual is not yet connected
to a presentation source
* Fix typo
Fix typo
Still maintain the explicit interface methods - prefer the additional compiler checks and readability
Rename IRenderWebBrowser.InvokeRenderAsync to OnPaint - keeps inline with CEF naming
Added better comments to IRenderWebBrowser.OnPaint
Review classes and structs
Added constructor to structs where all fields were required
Made some classes sealed, mostly those that are passed into the framework where subclassing and adding methods/properties wouldn't make sense