mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
CanGc changes from fontfaceset.rs (#33920)
* CanGc changes from fontfaceset.rs Signed-off-by: L Ashwin B <lashwinib@gmail.com> * Update components/script/dom/bindings/codegen/Bindings.conf Co-authored-by: Josh Matthews <josh@joshmatthews.net> Signed-off-by: chickenleaf <lashwinib@gmail.com> --------- Signed-off-by: L Ashwin B <lashwinib@gmail.com> Signed-off-by: chickenleaf <lashwinib@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
66695d2f7e
commit
9acb25521e
32 changed files with 425 additions and 274 deletions
|
@ -16,6 +16,7 @@ use crate::dom::bindings::reflector::{reflect_dom_object, Reflector};
|
|||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::bindings::str::DOMString;
|
||||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::script_runtime::CanGc;
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#canvasgradient
|
||||
#[dom_struct]
|
||||
|
@ -48,12 +49,12 @@ impl CanvasGradient {
|
|||
|
||||
impl CanvasGradientMethods for CanvasGradient {
|
||||
// https://html.spec.whatwg.org/multipage/#dom-canvasgradient-addcolorstop
|
||||
fn AddColorStop(&self, offset: Finite<f64>, color: DOMString) -> ErrorResult {
|
||||
fn AddColorStop(&self, offset: Finite<f64>, color: DOMString, can_gc: CanGc) -> ErrorResult {
|
||||
if *offset < 0f64 || *offset > 1f64 {
|
||||
return Err(Error::IndexSize);
|
||||
}
|
||||
|
||||
let color = match parse_color(None, &color) {
|
||||
let color = match parse_color(None, &color, can_gc) {
|
||||
Ok(color) => color,
|
||||
Err(_) => return Err(Error::Syntax),
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue