mirror of
https://github.com/servo/servo.git
synced 2025-07-08 16:03:40 +01:00
canvas: Use strum::{Display, EnumString} for canvas enums (#37670)
This makes it easier to add variants, I also added some spec links and reordered enum variants to match the spec. Testing: Just refactor, but the code is covered by WPT tests. Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
2dc62c504f
commit
ef7be66c56
5 changed files with 82 additions and 202 deletions
|
@ -1197,8 +1197,8 @@ impl CanvasState {
|
|||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-globalcompositeoperation
|
||||
pub(crate) fn global_composite_operation(&self) -> DOMString {
|
||||
match self.state.borrow().global_composition {
|
||||
CompositionOrBlending::Composition(op) => DOMString::from(op.to_str()),
|
||||
CompositionOrBlending::Blending(op) => DOMString::from(op.to_str()),
|
||||
CompositionOrBlending::Composition(op) => DOMString::from(op.to_string()),
|
||||
CompositionOrBlending::Blending(op) => DOMString::from(op.to_string()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue