| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
| 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 105 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
| 106 { | 106 { |
| 107 if (name == widthAttr || name == heightAttr) | 107 if (name == widthAttr || name == heightAttr) |
| 108 reset(); | 108 reset(); |
| 109 HTMLElement::parseAttribute(name, value); | 109 HTMLElement::parseAttribute(name, value); |
| 110 } | 110 } |
| 111 | 111 |
| 112 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style) | 112 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style) |
| 113 { | 113 { |
| 114 Frame* frame = document().frame(); | 114 Frame* frame = document().frame(); |
| 115 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { | 115 if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript)) { |
| 116 m_rendererIsCanvas = true; | 116 m_rendererIsCanvas = true; |
| 117 return new RenderHTMLCanvas(this); | 117 return new RenderHTMLCanvas(this); |
| 118 } | 118 } |
| 119 | 119 |
| 120 m_rendererIsCanvas = false; | 120 m_rendererIsCanvas = false; |
| 121 return HTMLElement::createRenderer(style); | 121 return HTMLElement::createRenderer(style); |
| 122 } | 122 } |
| 123 | 123 |
| 124 Node::InsertionNotificationRequest HTMLCanvasElement::insertedInto(ContainerNode
* node) | 124 Node::InsertionNotificationRequest HTMLCanvasElement::insertedInto(ContainerNode
* node) |
| 125 { | 125 { |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 FloatSize unscaledSize = size(); | 580 FloatSize unscaledSize = size(); |
| 581 FloatSize deviceSize = convertLogicalToDevice(unscaledSize); | 581 FloatSize deviceSize = convertLogicalToDevice(unscaledSize); |
| 582 IntSize size(deviceSize.width(), deviceSize.height()); | 582 IntSize size(deviceSize.width(), deviceSize.height()); |
| 583 AffineTransform transform; | 583 AffineTransform transform; |
| 584 if (size.width() && size.height()) | 584 if (size.width() && size.height()) |
| 585 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig
ht() / unscaledSize.height()); | 585 transform.scaleNonUniform(size.width() / unscaledSize.width(), size.heig
ht() / unscaledSize.height()); |
| 586 return m_imageBuffer->baseTransform() * transform; | 586 return m_imageBuffer->baseTransform() * transform; |
| 587 } | 587 } |
| 588 | 588 |
| 589 } | 589 } |
| OLD | NEW |