servo: Merge #5701 - Add specification links to canvas line cap and line join (from mmatyas:canvas_linecapjoin_url); r=jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 045831748e08f0b82ca84bd7d93844cb1c7eab60
This commit is contained in:
Mátyás Mustoha 2015-04-15 10:44:42 -05:00
Родитель 2258a4a7bb
Коммит 4872b079c3
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -859,6 +859,7 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
self.renderer.send(CanvasMsg::SetLineWidth(width as f32)).unwrap()
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap
fn LineCap(self) -> DOMString {
match self.line_cap.get() {
LineCapStyle::Butt => "butt".to_owned(),
@ -867,6 +868,7 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
}
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linecap
fn SetLineCap(self, cap_str: DOMString) {
if let Some(cap) = LineCapStyle::from_str(&cap_str) {
self.line_cap.set(cap);
@ -874,6 +876,7 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
}
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linejoin
fn LineJoin(self) -> DOMString {
match self.line_join.get() {
LineJoinStyle::Round => "round".to_owned(),
@ -882,6 +885,7 @@ impl<'a> CanvasRenderingContext2DMethods for JSRef<'a, CanvasRenderingContext2D>
}
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-linejoin
fn SetLineJoin(self, join_str: DOMString) {
if let Some(join) = LineJoinStyle::from_str(&join_str) {
self.line_join.set(join);