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

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

Issue 2623513005: Introduce Element::AttributeModificationParams (Closed)
Patch Set: Created 3 years, 11 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 m_context->detachCanvas(); 157 m_context->detachCanvas();
158 m_context = nullptr; 158 m_context = nullptr;
159 } 159 }
160 160
161 if (m_imageBuffer) { 161 if (m_imageBuffer) {
162 m_imageBuffer->setClient(nullptr); 162 m_imageBuffer->setClient(nullptr);
163 m_imageBuffer = nullptr; 163 m_imageBuffer = nullptr;
164 } 164 }
165 } 165 }
166 166
167 void HTMLCanvasElement::parseAttribute(const QualifiedName& name, 167 void HTMLCanvasElement::parseAttribute(
168 const AtomicString& oldValue, 168 const AttributeModificationParams& params) {
169 const AtomicString& value) { 169 if (params.name == widthAttr || params.name == heightAttr)
170 if (name == widthAttr || name == heightAttr)
171 reset(); 170 reset();
172 HTMLElement::parseAttribute(name, oldValue, value); 171 HTMLElement::parseAttribute(params);
173 } 172 }
174 173
175 LayoutObject* HTMLCanvasElement::createLayoutObject( 174 LayoutObject* HTMLCanvasElement::createLayoutObject(
176 const ComputedStyle& style) { 175 const ComputedStyle& style) {
177 LocalFrame* frame = document().frame(); 176 LocalFrame* frame = document().frame();
178 if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript)) 177 if (frame && frame->script().canExecuteScripts(NotAboutToExecuteScript))
179 return new LayoutHTMLCanvas(this); 178 return new LayoutHTMLCanvas(this);
180 return HTMLElement::createLayoutObject(style); 179 return HTMLElement::createLayoutObject(style);
181 } 180 }
182 181
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this)); 1413 m_surfaceLayerBridge = WTF::wrapUnique(new CanvasSurfaceLayerBridge(this));
1415 // Creates a placeholder layer first before Surface is created. 1414 // Creates a placeholder layer first before Surface is created.
1416 m_surfaceLayerBridge->createSolidColorLayer(); 1415 m_surfaceLayerBridge->createSolidColorLayer();
1417 } 1416 }
1418 1417
1419 void HTMLCanvasElement::OnWebLayerReplaced() { 1418 void HTMLCanvasElement::OnWebLayerReplaced() {
1420 setNeedsCompositingUpdate(); 1419 setNeedsCompositingUpdate();
1421 } 1420 }
1422 1421
1423 } // namespace blink 1422 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.h ('k') | third_party/WebKit/Source/core/html/HTMLContentElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698