mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Extract canvas operations for reuse by OffscreenCanvas.
This commit is contained in:
parent
6fb7a8cdc7
commit
85c20db495
257 changed files with 1857 additions and 1870 deletions
File diff suppressed because it is too large
Load diff
|
@ -38,6 +38,7 @@ use js::jsapi::{JSAutoRealm, JSContext};
|
|||
use js::jsval::UndefinedValue;
|
||||
use js::rust::HandleValue;
|
||||
use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId};
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use net_traits::request::{CredentialsMode, Destination, ParserMetadata};
|
||||
use net_traits::request::{Referrer, RequestBuilder, RequestMode};
|
||||
use net_traits::IpcSend;
|
||||
|
@ -174,6 +175,8 @@ pub struct DedicatedWorkerGlobalScope {
|
|||
#[ignore_malloc_size_of = "Can't measure trait objects"]
|
||||
/// Sender to the parent thread.
|
||||
parent_sender: Box<ScriptChan + Send>,
|
||||
#[ignore_malloc_size_of = "Arc"]
|
||||
image_cache: Arc<ImageCache>,
|
||||
}
|
||||
|
||||
impl WorkerEventLoopMethods for DedicatedWorkerGlobalScope {
|
||||
|
@ -225,6 +228,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>,
|
||||
closing: Arc<AtomicBool>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
) -> DedicatedWorkerGlobalScope {
|
||||
DedicatedWorkerGlobalScope {
|
||||
workerglobalscope: WorkerGlobalScope::new_inherited(
|
||||
|
@ -242,6 +246,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_port: timer_event_port,
|
||||
parent_sender: parent_sender,
|
||||
worker: DomRefCell::new(None),
|
||||
image_cache: image_cache,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -259,6 +264,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_chan: IpcSender<TimerEvent>,
|
||||
timer_event_port: Receiver<(TrustedWorkerAddress, TimerEvent)>,
|
||||
closing: Arc<AtomicBool>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
) -> DomRoot<DedicatedWorkerGlobalScope> {
|
||||
let cx = runtime.cx();
|
||||
let scope = Box::new(DedicatedWorkerGlobalScope::new_inherited(
|
||||
|
@ -274,6 +280,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_event_chan,
|
||||
timer_event_port,
|
||||
closing,
|
||||
image_cache,
|
||||
));
|
||||
unsafe { DedicatedWorkerGlobalScopeBinding::Wrap(cx, scope) }
|
||||
}
|
||||
|
@ -292,6 +299,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
worker_name: String,
|
||||
worker_type: WorkerType,
|
||||
closing: Arc<AtomicBool>,
|
||||
image_cache: Arc<dyn ImageCache>,
|
||||
) {
|
||||
let serialized_worker_url = worker_url.to_string();
|
||||
let name = format!("WebWorker for {}", serialized_worker_url);
|
||||
|
@ -363,6 +371,7 @@ impl DedicatedWorkerGlobalScope {
|
|||
timer_ipc_chan,
|
||||
timer_rx,
|
||||
closing,
|
||||
image_cache,
|
||||
);
|
||||
// FIXME(njn): workers currently don't have a unique ID suitable for using in reporter
|
||||
// registration (#6631), so we instead use a random number and cross our fingers.
|
||||
|
@ -428,6 +437,10 @@ impl DedicatedWorkerGlobalScope {
|
|||
.expect("Thread spawning failed");
|
||||
}
|
||||
|
||||
pub fn image_cache(&self) -> Arc<dyn ImageCache> {
|
||||
self.image_cache.clone()
|
||||
}
|
||||
|
||||
pub fn script_chan(&self) -> Box<dyn ScriptChan + Send> {
|
||||
Box::new(WorkerThreadWorkerChan {
|
||||
sender: self.own_sender.clone(),
|
||||
|
|
|
@ -20,6 +20,7 @@ use crate::dom::errorevent::ErrorEvent;
|
|||
use crate::dom::event::{Event, EventBubbles, EventCancelable, EventStatus};
|
||||
use crate::dom::eventsource::EventSource;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
|
||||
use crate::dom::performance::Performance;
|
||||
use crate::dom::window::Window;
|
||||
use crate::dom::workerglobalscope::WorkerGlobalScope;
|
||||
|
@ -51,6 +52,7 @@ use js::rust::{get_object_class, CompileOptionsWrapper, ParentRuntime, Runtime};
|
|||
use js::rust::{HandleValue, MutableHandleValue};
|
||||
use js::{JSCLASS_IS_DOMJSCLASS, JSCLASS_IS_GLOBAL};
|
||||
use msg::constellation_msg::PipelineId;
|
||||
use net_traits::image_cache::ImageCache;
|
||||
use net_traits::{CoreResourceThread, IpcSend, ResourceThreads};
|
||||
use profile_traits::{mem as profile_mem, time as profile_time};
|
||||
use script_traits::{MsDuration, ScriptToConstellationChan, TimerEvent};
|
||||
|
@ -376,6 +378,19 @@ impl GlobalScope {
|
|||
&self.origin
|
||||
}
|
||||
|
||||
pub fn image_cache(&self) -> Arc<dyn ImageCache> {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
return window.image_cache();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<DedicatedWorkerGlobalScope>() {
|
||||
return worker.image_cache();
|
||||
}
|
||||
if let Some(worker) = self.downcast::<PaintWorkletGlobalScope>() {
|
||||
return worker.image_cache();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
||||
/// Get the [base url](https://html.spec.whatwg.org/multipage/#api-base-url)
|
||||
/// for this global scope.
|
||||
pub fn api_base_url(&self) -> ServoUrl {
|
||||
|
|
|
@ -93,7 +93,12 @@ impl OffscreenCanvas {
|
|||
};
|
||||
}
|
||||
let size = self.get_size();
|
||||
let context = OffscreenCanvasRenderingContext2D::new(&self.global(), self, size);
|
||||
let context = OffscreenCanvasRenderingContext2D::new(
|
||||
&self.global(),
|
||||
self,
|
||||
size,
|
||||
self.placeholder.as_ref().map(|c| &**c),
|
||||
);
|
||||
*self.context.borrow_mut() = Some(OffscreenCanvasContext::OffscreenContext2d(
|
||||
Dom::from_ref(&*context),
|
||||
));
|
||||
|
|
|
@ -3,12 +3,25 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasFillRule;
|
||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasImageSource;
|
||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasLineCap;
|
||||
use crate::dom::bindings::codegen::Bindings::CanvasRenderingContext2DBinding::CanvasLineJoin;
|
||||
use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding;
|
||||
use crate::dom::bindings::codegen::Bindings::OffscreenCanvasRenderingContext2DBinding::OffscreenCanvasRenderingContext2DMethods;
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
||||
use crate::dom::bindings::codegen::UnionTypes::StringOrCanvasGradientOrCanvasPattern;
|
||||
use crate::dom::bindings::error::ErrorResult;
|
||||
use crate::dom::bindings::error::Fallible;
|
||||
use crate::dom::bindings::num::Finite;
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot};
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::canvasgradient::CanvasGradient;
|
||||
use crate::dom::canvaspattern::CanvasPattern;
|
||||
use crate::dom::canvasrenderingcontext2d::CanvasState;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::htmlcanvaselement::HTMLCanvasElement;
|
||||
use crate::dom::imagedata::ImageData;
|
||||
use crate::dom::offscreencanvas::OffscreenCanvas;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::Size2D;
|
||||
|
@ -18,18 +31,24 @@ pub struct OffscreenCanvasRenderingContext2D {
|
|||
reflector_: Reflector,
|
||||
canvas: Option<Dom<OffscreenCanvas>>,
|
||||
canvas_state: DomRefCell<CanvasState>,
|
||||
htmlcanvas: Option<Dom<HTMLCanvasElement>>,
|
||||
}
|
||||
|
||||
impl OffscreenCanvasRenderingContext2D {
|
||||
pub fn new_inherited(
|
||||
fn new_inherited(
|
||||
global: &GlobalScope,
|
||||
canvas: Option<&OffscreenCanvas>,
|
||||
size: Size2D<u64>,
|
||||
htmlcanvas: Option<&HTMLCanvasElement>,
|
||||
) -> OffscreenCanvasRenderingContext2D {
|
||||
OffscreenCanvasRenderingContext2D {
|
||||
reflector_: Reflector::new(),
|
||||
canvas: canvas.map(Dom::from_ref),
|
||||
canvas_state: DomRefCell::new(CanvasState::new(global, size)),
|
||||
htmlcanvas: htmlcanvas.map(Dom::from_ref),
|
||||
canvas_state: DomRefCell::new(CanvasState::new(
|
||||
global,
|
||||
Size2D::new(size.width as u64, size.height as u64),
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,11 +56,13 @@ impl OffscreenCanvasRenderingContext2D {
|
|||
global: &GlobalScope,
|
||||
canvas: &OffscreenCanvas,
|
||||
size: Size2D<u64>,
|
||||
htmlcanvas: Option<&HTMLCanvasElement>,
|
||||
) -> DomRoot<OffscreenCanvasRenderingContext2D> {
|
||||
let boxed = Box::new(OffscreenCanvasRenderingContext2D::new_inherited(
|
||||
global,
|
||||
Some(canvas),
|
||||
size,
|
||||
htmlcanvas,
|
||||
));
|
||||
reflect_dom_object(
|
||||
boxed,
|
||||
|
@ -71,4 +92,424 @@ impl OffscreenCanvasRenderingContext2DMethods for OffscreenCanvasRenderingContex
|
|||
fn StrokeRect(&self, x: f64, y: f64, width: f64, height: f64) {
|
||||
self.canvas_state.borrow().StrokeRect(x, y, width, height);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsetx
|
||||
fn ShadowOffsetX(&self) -> f64 {
|
||||
self.canvas_state.borrow().ShadowOffsetX()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsetx
|
||||
fn SetShadowOffsetX(&self, value: f64) {
|
||||
self.canvas_state.borrow().SetShadowOffsetX(value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsety
|
||||
fn ShadowOffsetY(&self) -> f64 {
|
||||
self.canvas_state.borrow().ShadowOffsetY()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowoffsety
|
||||
fn SetShadowOffsetY(&self, value: f64) {
|
||||
self.canvas_state.borrow().SetShadowOffsetY(value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowblur
|
||||
fn ShadowBlur(&self) -> f64 {
|
||||
self.canvas_state.borrow().ShadowBlur()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowblur
|
||||
fn SetShadowBlur(&self, value: f64) {
|
||||
self.canvas_state.borrow().SetShadowBlur(value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowcolor
|
||||
fn ShadowColor(&self) -> DOMString {
|
||||
self.canvas_state.borrow().ShadowColor()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-shadowcolor
|
||||
fn SetShadowColor(&self, value: DOMString) {
|
||||
self.canvas_state.borrow().SetShadowColor(value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokestyle
|
||||
fn StrokeStyle(&self) -> StringOrCanvasGradientOrCanvasPattern {
|
||||
self.canvas_state.borrow().StrokeStyle()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokestyle
|
||||
fn SetStrokeStyle(&self, value: StringOrCanvasGradientOrCanvasPattern) {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.SetStrokeStyle(self.htmlcanvas.as_ref().map(|c| &**c), value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokestyle
|
||||
fn FillStyle(&self) -> StringOrCanvasGradientOrCanvasPattern {
|
||||
self.canvas_state.borrow().FillStyle()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-strokestyle
|
||||
fn SetFillStyle(&self, value: StringOrCanvasGradientOrCanvasPattern) {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.SetFillStyle(self.htmlcanvas.as_ref().map(|c| &**c), value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createlineargradient
|
||||
fn CreateLinearGradient(
|
||||
&self,
|
||||
x0: Finite<f64>,
|
||||
y0: Finite<f64>,
|
||||
x1: Finite<f64>,
|
||||
y1: Finite<f64>,
|
||||
) -> DomRoot<CanvasGradient> {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.CreateLinearGradient(&self.global(), x0, y0, x1, y1)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createradialgradient
|
||||
fn CreateRadialGradient(
|
||||
&self,
|
||||
x0: Finite<f64>,
|
||||
y0: Finite<f64>,
|
||||
r0: Finite<f64>,
|
||||
x1: Finite<f64>,
|
||||
y1: Finite<f64>,
|
||||
r1: Finite<f64>,
|
||||
) -> Fallible<DomRoot<CanvasGradient>> {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.CreateRadialGradient(&self.global(), x0, y0, r0, x1, y1, r1)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createpattern
|
||||
fn CreatePattern(
|
||||
&self,
|
||||
image: CanvasImageSource,
|
||||
repetition: DOMString,
|
||||
) -> Fallible<DomRoot<CanvasPattern>> {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.CreatePattern(&self.global(), image, repetition)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-save
|
||||
fn Save(&self) {
|
||||
self.canvas_state.borrow().Save()
|
||||
}
|
||||
|
||||
#[allow(unrooted_must_root)]
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-restore
|
||||
fn Restore(&self) {
|
||||
self.canvas_state.borrow().Restore()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalalpha
|
||||
fn GlobalAlpha(&self) -> f64 {
|
||||
self.canvas_state.borrow().GlobalAlpha()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalalpha
|
||||
fn SetGlobalAlpha(&self, alpha: f64) {
|
||||
self.canvas_state.borrow().SetGlobalAlpha(alpha)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalcompositeoperation
|
||||
fn GlobalCompositeOperation(&self) -> DOMString {
|
||||
self.canvas_state.borrow().GlobalCompositeOperation()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalcompositeoperation
|
||||
fn SetGlobalCompositeOperation(&self, op_str: DOMString) {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.SetGlobalCompositeOperation(op_str)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-imagesmoothingenabled
|
||||
fn ImageSmoothingEnabled(&self) -> bool {
|
||||
self.canvas_state.borrow().ImageSmoothingEnabled()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-imagesmoothingenabled
|
||||
fn SetImageSmoothingEnabled(&self, value: bool) {
|
||||
self.canvas_state.borrow().SetImageSmoothingEnabled(value)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-filltext
|
||||
fn FillText(&self, text: DOMString, x: f64, y: f64, max_width: Option<f64>) {
|
||||
self.canvas_state.borrow().FillText(text, x, y, max_width)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linewidth
|
||||
fn LineWidth(&self) -> f64 {
|
||||
self.canvas_state.borrow().LineWidth()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linewidth
|
||||
fn SetLineWidth(&self, width: f64) {
|
||||
self.canvas_state.borrow().SetLineWidth(width)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap
|
||||
fn LineCap(&self) -> CanvasLineCap {
|
||||
self.canvas_state.borrow().LineCap()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap
|
||||
fn SetLineCap(&self, cap: CanvasLineCap) {
|
||||
self.canvas_state.borrow().SetLineCap(cap)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linejoin
|
||||
fn LineJoin(&self) -> CanvasLineJoin {
|
||||
self.canvas_state.borrow().LineJoin()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linejoin
|
||||
fn SetLineJoin(&self, join: CanvasLineJoin) {
|
||||
self.canvas_state.borrow().SetLineJoin(join)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-miterlimit
|
||||
fn MiterLimit(&self) -> f64 {
|
||||
self.canvas_state.borrow().MiterLimit()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-miterlimit
|
||||
fn SetMiterLimit(&self, limit: f64) {
|
||||
self.canvas_state.borrow().SetMiterLimit(limit)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createimagedata
|
||||
fn CreateImageData(&self, sw: i32, sh: i32) -> Fallible<DomRoot<ImageData>> {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.CreateImageData(&self.global(), sw, sh)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-createimagedata
|
||||
fn CreateImageData_(&self, imagedata: &ImageData) -> Fallible<DomRoot<ImageData>> {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.CreateImageData_(&self.global(), imagedata)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-getimagedata
|
||||
fn GetImageData(&self, sx: i32, sy: i32, sw: i32, sh: i32) -> Fallible<DomRoot<ImageData>> {
|
||||
self.canvas_state.borrow().GetImageData(
|
||||
self.htmlcanvas.as_ref().map(|c| &**c),
|
||||
&self.global(),
|
||||
sx,
|
||||
sy,
|
||||
sw,
|
||||
sh,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
|
||||
fn PutImageData(&self, imagedata: &ImageData, dx: i32, dy: i32) {
|
||||
self.canvas_state.borrow().PutImageData(
|
||||
self.htmlcanvas.as_ref().map(|c| &**c),
|
||||
imagedata,
|
||||
dx,
|
||||
dy,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
|
||||
#[allow(unsafe_code)]
|
||||
fn PutImageData_(
|
||||
&self,
|
||||
imagedata: &ImageData,
|
||||
dx: i32,
|
||||
dy: i32,
|
||||
dirty_x: i32,
|
||||
dirty_y: i32,
|
||||
dirty_width: i32,
|
||||
dirty_height: i32,
|
||||
) {
|
||||
self.canvas_state.borrow().PutImageData_(
|
||||
self.htmlcanvas.as_ref().map(|c| &**c),
|
||||
imagedata,
|
||||
dx,
|
||||
dy,
|
||||
dirty_x,
|
||||
dirty_y,
|
||||
dirty_width,
|
||||
dirty_height,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
|
||||
fn DrawImage(&self, image: CanvasImageSource, dx: f64, dy: f64) -> ErrorResult {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.DrawImage(self.htmlcanvas.as_ref().map(|c| &**c), image, dx, dy)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
|
||||
fn DrawImage_(
|
||||
&self,
|
||||
image: CanvasImageSource,
|
||||
dx: f64,
|
||||
dy: f64,
|
||||
dw: f64,
|
||||
dh: f64,
|
||||
) -> ErrorResult {
|
||||
self.canvas_state.borrow().DrawImage_(
|
||||
self.htmlcanvas.as_ref().map(|c| &**c),
|
||||
image,
|
||||
dx,
|
||||
dy,
|
||||
dw,
|
||||
dh,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-drawimage
|
||||
fn DrawImage__(
|
||||
&self,
|
||||
image: CanvasImageSource,
|
||||
sx: f64,
|
||||
sy: f64,
|
||||
sw: f64,
|
||||
sh: f64,
|
||||
dx: f64,
|
||||
dy: f64,
|
||||
dw: f64,
|
||||
dh: f64,
|
||||
) -> ErrorResult {
|
||||
self.canvas_state.borrow().DrawImage__(
|
||||
self.htmlcanvas.as_ref().map(|c| &**c),
|
||||
image,
|
||||
sx,
|
||||
sy,
|
||||
sw,
|
||||
sh,
|
||||
dx,
|
||||
dy,
|
||||
dw,
|
||||
dh,
|
||||
)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-beginpath
|
||||
fn BeginPath(&self) {
|
||||
self.canvas_state.borrow().BeginPath()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-fill
|
||||
fn Fill(&self, fill_rule: CanvasFillRule) {
|
||||
self.canvas_state.borrow().Fill(fill_rule)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-stroke
|
||||
fn Stroke(&self) {
|
||||
self.canvas_state.borrow().Stroke()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-clip
|
||||
fn Clip(&self, fill_rule: CanvasFillRule) {
|
||||
self.canvas_state.borrow().Clip(fill_rule)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-ispointinpath
|
||||
fn IsPointInPath(&self, x: f64, y: f64, fill_rule: CanvasFillRule) -> bool {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.IsPointInPath(&self.global(), x, y, fill_rule)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-scale
|
||||
fn Scale(&self, x: f64, y: f64) {
|
||||
self.canvas_state.borrow().Scale(x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-rotate
|
||||
fn Rotate(&self, angle: f64) {
|
||||
self.canvas_state.borrow().Rotate(angle)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-translate
|
||||
fn Translate(&self, x: f64, y: f64) {
|
||||
self.canvas_state.borrow().Translate(x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-transform
|
||||
fn Transform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) {
|
||||
self.canvas_state.borrow().Transform(a, b, c, d, e, f)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-settransform
|
||||
fn SetTransform(&self, a: f64, b: f64, c: f64, d: f64, e: f64, f: f64) {
|
||||
self.canvas_state.borrow().SetTransform(a, b, c, d, e, f)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-resettransform
|
||||
fn ResetTransform(&self) {
|
||||
self.canvas_state.borrow().ResetTransform()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-closepath
|
||||
fn ClosePath(&self) {
|
||||
self.canvas_state.borrow().ClosePath()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-moveto
|
||||
fn MoveTo(&self, x: f64, y: f64) {
|
||||
self.canvas_state.borrow().MoveTo(x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-lineto
|
||||
fn LineTo(&self, x: f64, y: f64) {
|
||||
self.canvas_state.borrow().LineTo(x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-rect
|
||||
fn Rect(&self, x: f64, y: f64, width: f64, height: f64) {
|
||||
self.canvas_state.borrow().Rect(x, y, width, height)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-quadraticcurveto
|
||||
fn QuadraticCurveTo(&self, cpx: f64, cpy: f64, x: f64, y: f64) {
|
||||
self.canvas_state.borrow().QuadraticCurveTo(cpx, cpy, x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-beziercurveto
|
||||
fn BezierCurveTo(&self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, x: f64, y: f64) {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.BezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-arc
|
||||
fn Arc(&self, x: f64, y: f64, r: f64, start: f64, end: f64, ccw: bool) -> ErrorResult {
|
||||
self.canvas_state.borrow().Arc(x, y, r, start, end, ccw)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-arcto
|
||||
fn ArcTo(&self, cp1x: f64, cp1y: f64, cp2x: f64, cp2y: f64, r: f64) -> ErrorResult {
|
||||
self.canvas_state.borrow().ArcTo(cp1x, cp1y, cp2x, cp2y, r)
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-ellipse
|
||||
fn Ellipse(
|
||||
&self,
|
||||
x: f64,
|
||||
y: f64,
|
||||
rx: f64,
|
||||
ry: f64,
|
||||
rotation: f64,
|
||||
start: f64,
|
||||
end: f64,
|
||||
ccw: bool,
|
||||
) -> ErrorResult {
|
||||
self.canvas_state
|
||||
.borrow()
|
||||
.Ellipse(x, y, rx, ry, rotation, start, end, ccw)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ use crate::dom::canvasgradient::CanvasGradient;
|
|||
use crate::dom::canvaspattern::CanvasPattern;
|
||||
use crate::dom::canvasrenderingcontext2d::CanvasRenderingContext2D;
|
||||
use crate::dom::paintworkletglobalscope::PaintWorkletGlobalScope;
|
||||
use crate::dom::workletglobalscope::WorkletGlobalScope;
|
||||
use canvas_traits::canvas::CanvasImageData;
|
||||
use canvas_traits::canvas::CanvasMsg;
|
||||
use canvas_traits::canvas::FromLayoutMsg;
|
||||
|
@ -44,16 +43,8 @@ pub struct PaintRenderingContext2D {
|
|||
impl PaintRenderingContext2D {
|
||||
fn new_inherited(global: &PaintWorkletGlobalScope) -> PaintRenderingContext2D {
|
||||
let size = Size2D::zero();
|
||||
let image_cache = global.image_cache();
|
||||
let base_url = global.upcast::<WorkletGlobalScope>().base_url();
|
||||
PaintRenderingContext2D {
|
||||
context: CanvasRenderingContext2D::new_inherited(
|
||||
global.upcast(),
|
||||
None,
|
||||
image_cache,
|
||||
base_url,
|
||||
size,
|
||||
),
|
||||
context: CanvasRenderingContext2D::new_inherited(global.upcast(), None, size),
|
||||
device_pixel_ratio: Cell::new(TypedScale::new(1.0)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#canvasgradient
|
||||
[Exposed=(Window, PaintWorklet)]
|
||||
[Exposed=(Window, PaintWorklet, Worker)]
|
||||
interface CanvasGradient {
|
||||
// opaque object
|
||||
[Throws]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#canvaspattern
|
||||
[Exposed=(Window, PaintWorklet)]
|
||||
[Exposed=(Window, PaintWorklet, Worker)]
|
||||
interface CanvasPattern {
|
||||
//void setTransform(SVGMatrix matrix);
|
||||
};
|
||||
|
|
|
@ -39,14 +39,14 @@ CanvasRenderingContext2D implements CanvasPathDrawingStyles;
|
|||
CanvasRenderingContext2D implements CanvasTextDrawingStyles;
|
||||
CanvasRenderingContext2D implements CanvasPath;
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasState {
|
||||
// state
|
||||
void save(); // push state on state stack
|
||||
void restore(); // pop state stack and restore state
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasTransform {
|
||||
// transformations (default transform is the identity matrix)
|
||||
void scale(unrestricted double x, unrestricted double y);
|
||||
|
@ -70,21 +70,21 @@ interface CanvasTransform {
|
|||
void resetTransform();
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasCompositing {
|
||||
// compositing
|
||||
attribute unrestricted double globalAlpha; // (default 1.0)
|
||||
attribute DOMString globalCompositeOperation; // (default source-over)
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasImageSmoothing {
|
||||
// image smoothing
|
||||
attribute boolean imageSmoothingEnabled; // (default true)
|
||||
// attribute ImageSmoothingQuality imageSmoothingQuality; // (default low)
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasFillStrokeStyles {
|
||||
// colours and styles (see also the CanvasDrawingStyles interface)
|
||||
attribute (DOMString or CanvasGradient or CanvasPattern) strokeStyle; // (default black)
|
||||
|
@ -96,7 +96,7 @@ interface CanvasFillStrokeStyles {
|
|||
CanvasPattern createPattern(CanvasImageSource image, [TreatNullAs=EmptyString] DOMString repetition);
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasShadowStyles {
|
||||
// shadows
|
||||
attribute unrestricted double shadowOffsetX; // (default 0)
|
||||
|
@ -105,7 +105,7 @@ interface CanvasShadowStyles {
|
|||
attribute DOMString shadowColor; // (default transparent black)
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasFilters {
|
||||
// filters
|
||||
//attribute DOMString filter; // (default "none")
|
||||
|
@ -119,7 +119,7 @@ interface CanvasRect {
|
|||
void strokeRect(unrestricted double x, unrestricted double y, unrestricted double w, unrestricted double h);
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasDrawPath {
|
||||
// path API (see also CanvasPath)
|
||||
void beginPath();
|
||||
|
@ -145,7 +145,7 @@ interface CanvasUserInterface {
|
|||
//void scrollPathIntoView(Path2D path);
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasText {
|
||||
// text (see also the CanvasPathDrawingStyles and CanvasTextDrawingStyles interfaces)
|
||||
[Pref="dom.canvas-text.enabled"]
|
||||
|
@ -156,7 +156,7 @@ interface CanvasText {
|
|||
//TextMetrics measureText(DOMString text);
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasDrawImage {
|
||||
// drawing images
|
||||
[Throws]
|
||||
|
@ -171,7 +171,7 @@ interface CanvasDrawImage {
|
|||
unrestricted double dw, unrestricted double dh);
|
||||
};
|
||||
|
||||
[Exposed=Window, NoInterfaceObject]
|
||||
[Exposed=(Window, Worker), NoInterfaceObject]
|
||||
interface CanvasImageData {
|
||||
// pixel manipulation
|
||||
[Throws]
|
||||
|
@ -193,7 +193,7 @@ enum CanvasTextAlign { "start", "end", "left", "right", "center" };
|
|||
enum CanvasTextBaseline { "top", "hanging", "middle", "alphabetic", "ideographic", "bottom" };
|
||||
enum CanvasDirection { "ltr", "rtl", "inherit" };
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasPathDrawingStyles {
|
||||
// line caps/joins
|
||||
attribute unrestricted double lineWidth; // (default 1)
|
||||
|
@ -207,7 +207,7 @@ interface CanvasPathDrawingStyles {
|
|||
//attribute unrestricted double lineDashOffset;
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasTextDrawingStyles {
|
||||
// text
|
||||
//attribute DOMString font; // (default 10px sans-serif)
|
||||
|
@ -217,7 +217,7 @@ interface CanvasTextDrawingStyles {
|
|||
//attribute CanvasDirection direction; // "ltr", "rtl", "inherit" (default: "inherit")
|
||||
};
|
||||
|
||||
[Exposed=(PaintWorklet, Window), NoInterfaceObject]
|
||||
[Exposed=(PaintWorklet, Window, Worker), NoInterfaceObject]
|
||||
interface CanvasPath {
|
||||
// shared path API methods
|
||||
void closePath();
|
||||
|
|
|
@ -8,23 +8,22 @@ interface OffscreenCanvasRenderingContext2D {
|
|||
//void commit();
|
||||
readonly attribute OffscreenCanvas canvas;
|
||||
};
|
||||
OffscreenCanvasRenderingContext2D implements CanvasState;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasCompositing;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasImageSmoothing;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasFillStrokeStyles;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasShadowStyles;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasFilters;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasRect;
|
||||
|
||||
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasState;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasTransform;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasCompositing;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasImageSmoothing;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasFillStrokeStyles;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasShadowStyles;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasFilters;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasDrawPath;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasText;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasDrawImage;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasImageData;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasPathDrawingStyles;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasTextDrawingStyles;
|
||||
//OffscreenCanvasRenderingContext2D includes CanvasPath;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasTransform;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasDrawPath;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasText;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasDrawImage;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasImageData;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasPathDrawingStyles;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasTextDrawingStyles;
|
||||
OffscreenCanvasRenderingContext2D implements CanvasPath;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -125,6 +125,7 @@ impl Worker {
|
|||
String::from(&*worker_options.name),
|
||||
worker_options.type_,
|
||||
closing,
|
||||
global.image_cache(),
|
||||
);
|
||||
|
||||
Ok(worker)
|
||||
|
|
|
@ -297,9 +297,6 @@
|
|||
[OffscreenCanvasRenderingContext2D interface: operation getLineDash()]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface: existence and properties of interface object]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: attribute globalCompositeOperation]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -348,9 +345,6 @@
|
|||
[OffscreenCanvasRenderingContext2D interface: attribute shadowColor]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface: operation addColorStop(double, DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[DedicatedWorkerGlobalScope interface: attribute name]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -396,9 +390,6 @@
|
|||
[ImageBitmap interface: existence and properties of interface prototype object's @@unscopables property]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface: existence and properties of interface prototype object's @@unscopables property]
|
||||
expected: FAIL
|
||||
|
||||
[MessageEvent interface: operation initMessageEvent(DOMString, boolean, boolean, any, USVString, DOMString, MessageEventSource, [object Object\])]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -429,9 +420,6 @@
|
|||
[WorkerGlobalScope interface: operation createImageBitmap(ImageBitmapSource, ImageBitmapOptions)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface object length]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -465,9 +453,6 @@
|
|||
[OffscreenCanvasRenderingContext2D interface: attribute lineJoin]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface: existence and properties of interface prototype object's "constructor" property]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation rect(unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -495,9 +480,6 @@
|
|||
[OffscreenCanvas interface: attribute height]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface object name]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation setTransform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -534,9 +516,6 @@
|
|||
[WorkerNavigator interface: self.navigator must inherit property "hardwareConcurrency" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface: existence and properties of interface prototype object's "constructor" property]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation isPointInPath(Path2D, unrestricted double, unrestricted double, CanvasFillRule)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -546,9 +525,6 @@
|
|||
[OffscreenCanvasRenderingContext2D interface: operation createImageData(long, long)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface: existence and properties of interface prototype object]
|
||||
expected: FAIL
|
||||
|
||||
[Path2D interface: operation lineTo(unrestricted double, unrestricted double)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -585,9 +561,6 @@
|
|||
[OffscreenCanvasRenderingContext2D interface: operation createPattern(CanvasImageSource, DOMString)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface: existence and properties of interface object]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation transform(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double)]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -627,9 +600,6 @@
|
|||
[Path2D interface: operation ellipse(unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, unrestricted double, boolean)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface: existence and properties of interface prototype object's @@unscopables property]
|
||||
expected: FAIL
|
||||
|
||||
[MessageEvent interface: new MessageEvent("message", { data: 5 }) must inherit property "ports" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -687,9 +657,6 @@
|
|||
[Path2D interface: operation addPath(Path2D, DOMMatrix2DInit)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface: existence and properties of interface prototype object]
|
||||
expected: FAIL
|
||||
|
||||
[WorkerGlobalScope interface: self must inherit property "createImageBitmap(ImageBitmapSource, long, long, long, long, ImageBitmapOptions)" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -705,9 +672,6 @@
|
|||
[OffscreenCanvas interface: existence and properties of interface prototype object's @@unscopables property]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasPattern interface object length]
|
||||
expected: FAIL
|
||||
|
||||
[WorkerNavigator interface: self.navigator must inherit property "languages" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
|
@ -720,9 +684,6 @@
|
|||
[OffscreenCanvas interface: operation convertToBlob(ImageEncodeOptions)]
|
||||
expected: FAIL
|
||||
|
||||
[CanvasGradient interface object name]
|
||||
expected: FAIL
|
||||
|
||||
[OffscreenCanvasRenderingContext2D interface: operation clip(CanvasFillRule)]
|
||||
expected: FAIL
|
||||
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.default.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.default]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.default.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.invalid.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.invalid]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.invalid.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.range.html]
|
||||
[OffscreenCanvas test: 2d.composite.globalAlpha.range]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.globalAlpha.range.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.casesensitive.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.casesensitive]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.casesensitive.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.operation.clear.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.clear]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
[2d.composite.operation.clear.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.darker.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.darker]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.darker.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.default.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.default]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.default.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.highlight.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.highlight]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.highlight.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.nullsuffix.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.nullsuffix]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.nullsuffix.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.over.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.over]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.over.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.unrecognised.html]
|
||||
[OffscreenCanvas test: 2d.composite.operation.unrecognised]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.operation.unrecognised.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.destination-out.html]
|
||||
[OffscreenCanvas test: 2d.composite.solid.destination-out]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.destination-out.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.source-out.html]
|
||||
[OffscreenCanvas test: 2d.composite.solid.source-out]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.source-out.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.xor.html]
|
||||
[OffscreenCanvas test: 2d.composite.solid.xor]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.solid.xor.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.copy.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.copy.worker.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.destination-atop.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.destination-atop.worker.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.destination-in.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.destination-in.worker.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.source-in.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.source-in.worker.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.source-out.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.composite.uncovered.fill.source-out.worker.html]
|
||||
[fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.missingargs.html]
|
||||
[Missing arguments cause TypeError]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.missingargs.worker.html]
|
||||
[Missing arguments cause TypeError]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.clip.html]
|
||||
[OffscreenCanvas test: 2d.drawImage.clip]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.clip.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.path.html]
|
||||
[OffscreenCanvas test: 2d.drawImage.path]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.path.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.transform.html]
|
||||
[OffscreenCanvas test: 2d.drawImage.transform]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.drawImage.transform.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.basic.html]
|
||||
[clearRect clears to transparent black]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.basic.worker.html]
|
||||
[clearRect clears to transparent black]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.globalalpha.html]
|
||||
[clearRect is not affected by globalAlpha]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.globalalpha.worker.html]
|
||||
[clearRect is not affected by globalAlpha]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.globalcomposite.html]
|
||||
[clearRect is not affected by globalCompositeOperation]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.globalcomposite.worker.html]
|
||||
[clearRect is not affected by globalCompositeOperation]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.negative.html]
|
||||
[clearRect of negative sizes works]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.negative.worker.html]
|
||||
[clearRect of negative sizes works]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.transform.html]
|
||||
[clearRect is affected by transforms]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.clearRect.transform.worker.html]
|
||||
[clearRect is affected by transforms]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.globalalpha.html]
|
||||
[strokeRect is affected by globalAlpha]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.globalalpha.worker.html]
|
||||
[strokeRect is affected by globalAlpha]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.globalcomposite.html]
|
||||
[strokeRect is not affected by globalCompositeOperation]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.globalcomposite.worker.html]
|
||||
[strokeRect is not affected by globalCompositeOperation]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.1.html]
|
||||
[strokeRect of 0x0 pixels draws nothing]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.1.worker.html]
|
||||
[strokeRect of 0x0 pixels draws nothing]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.2.html]
|
||||
[strokeRect of 0x0 pixels draws nothing, including caps and joins]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.2.worker.html]
|
||||
[strokeRect of 0x0 pixels draws nothing, including caps and joins]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.4.html]
|
||||
[strokeRect of Nx0 pixels draws a closed line with no caps]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.strokeRect.zero.4.worker.html]
|
||||
[strokeRect of Nx0 pixels draws a closed line with no caps]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.default.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.default]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.default.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.semitransparent.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.get.semitransparent]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.semitransparent.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.solid.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.get.solid]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.solid.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.transparent.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.get.transparent]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.get.transparent.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.hsla-clamp-6.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-6]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.hsla-clamp-6.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.rgba-clamp-1.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.parse.rgba-clamp-1]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.rgba-clamp-1.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.transparent-1.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.parse.transparent-1]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.transparent-1.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.transparent-2.html]
|
||||
[OffscreenCanvas test: 2d.fillStyle.parse.transparent-2]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.fillStyle.parse.transparent-2.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.compare.html]
|
||||
[OffscreenCanvas test: 2d.gradient.object.compare]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.compare.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.invalidcolour.html]
|
||||
[OffscreenCanvas test: 2d.gradient.object.invalidcolour]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.invalidcolour.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.invalidoffset.html]
|
||||
[OffscreenCanvas test: 2d.gradient.object.invalidoffset]
|
||||
expected: FAIL
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[2d.gradient.object.invalidoffset.worker.html]
|
||||
[2d]
|
||||
expected: FAIL
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue