Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 33523002: Have Frame::script() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/Navigator.cpp ('k') | Source/core/html/HTMLDocument.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/frame/Navigator.cpp ('k') | Source/core/html/HTMLDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698