diff --git a/src/lib.rs b/src/lib.rs index 98084704..e1365c52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -321,6 +321,8 @@ impl Surface { /// /// - On X11, the window must be visible. /// - On macOS, Redox and Wayland, this function is unimplemented. + /// - On Web, this will fail if the content was supplied by + /// a different origin depending on the sites CORS rules. pub fn fetch(&mut self) -> Result, SoftBufferError> { self.surface_impl.fetch() } diff --git a/src/web.rs b/src/web.rs index d6c84174..95bcfa72 100644 --- a/src/web.rs +++ b/src/web.rs @@ -126,6 +126,10 @@ impl WebImpl { /// Extension methods for the Wasm target on [`Surface`](crate::Surface). pub trait SurfaceExtWeb: Sized { /// Creates a new instance of this struct, using the provided [`HtmlCanvasElement`]. + /// + /// # Errors + /// - If the canvas was already controlled by an `OffscreenCanvas`. + /// - If a another context then "2d" was already created for this canvas. fn from_canvas(canvas: HtmlCanvasElement) -> Result; }