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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 m_context.clear(); // Ensure this goes away before the ImageBuffer. | 100 m_context.clear(); // Ensure this goes away before the ImageBuffer. |
101 } | 101 } |
102 | 102 |
103 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 103 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
104 { | 104 { |
105 if (name == widthAttr || name == heightAttr) | 105 if (name == widthAttr || name == heightAttr) |
106 reset(); | 106 reset(); |
107 HTMLElement::parseAttribute(name, value); | 107 HTMLElement::parseAttribute(name, value); |
108 } | 108 } |
109 | 109 |
110 RenderObject* HTMLCanvasElement::createRenderer(RenderArena* arena, RenderStyle*
style) | 110 RenderObject* HTMLCanvasElement::createRenderer(RenderStyle* style) |
111 { | 111 { |
112 Frame* frame = document()->frame(); | 112 Frame* frame = document()->frame(); |
113 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { | 113 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { |
114 m_rendererIsCanvas = true; | 114 m_rendererIsCanvas = true; |
115 return new (arena) RenderHTMLCanvas(this); | 115 return new RenderHTMLCanvas(this); |
116 } | 116 } |
117 | 117 |
118 m_rendererIsCanvas = false; | 118 m_rendererIsCanvas = false; |
119 return HTMLElement::createRenderer(arena, style); | 119 return HTMLElement::createRenderer(style); |
120 } | 120 } |
121 | 121 |
122 void HTMLCanvasElement::attach(const AttachContext& context) | 122 void HTMLCanvasElement::attach(const AttachContext& context) |
123 { | 123 { |
124 setIsInCanvasSubtree(true); | 124 setIsInCanvasSubtree(true); |
125 HTMLElement::attach(context); | 125 HTMLElement::attach(context); |
126 } | 126 } |
127 | 127 |
128 void HTMLCanvasElement::addObserver(CanvasObserver* observer) | 128 void HTMLCanvasElement::addObserver(CanvasObserver* observer) |
129 { | 129 { |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 HTMLElement::reportMemoryUsage(memoryObjectInfo); | 581 HTMLElement::reportMemoryUsage(memoryObjectInfo); |
582 info.addMember(m_observers, "observers"); | 582 info.addMember(m_observers, "observers"); |
583 info.addMember(m_context, "context"); | 583 info.addMember(m_context, "context"); |
584 info.addMember(m_imageBuffer, "imageBuffer"); | 584 info.addMember(m_imageBuffer, "imageBuffer"); |
585 info.addMember(m_contextStateSaver, "contextStateSaver"); | 585 info.addMember(m_contextStateSaver, "contextStateSaver"); |
586 info.addMember(m_presentedImage, "presentedImage"); | 586 info.addMember(m_presentedImage, "presentedImage"); |
587 info.addMember(m_copiedImage, "copiedImage"); | 587 info.addMember(m_copiedImage, "copiedImage"); |
588 } | 588 } |
589 | 589 |
590 } | 590 } |
OLD | NEW |