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

Side by Side Diff: sky/engine/core/html/HTMLImageElement.cpp

Issue 772133003: Mostly merge HTMLElement into Element. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | sky/engine/public/web/WebElement.h » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Apple Inc. All rights reserv ed.
5 * Copyright (C) 2010 Google Inc. All rights reserved. 5 * Copyright (C) 2010 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 { 313 {
314 return imageLoader().imageComplete(); 314 return imageLoader().imageComplete();
315 } 315 }
316 316
317 void HTMLImageElement::didMoveToNewDocument(Document& oldDocument) 317 void HTMLImageElement::didMoveToNewDocument(Document& oldDocument)
318 { 318 {
319 imageLoader().elementDidMoveToNewDocument(); 319 imageLoader().elementDidMoveToNewDocument();
320 HTMLElement::didMoveToNewDocument(oldDocument); 320 HTMLElement::didMoveToNewDocument(oldDocument);
321 } 321 }
322 322
323 Image* HTMLImageElement::imageContents()
324 {
325 if (!imageLoader().imageComplete())
326 return 0;
327
328 return imageLoader().image()->image();
329 }
330
331 PassRefPtr<Image> HTMLImageElement::getSourceImageForCanvas(SourceImageMode, Sou rceImageStatus* status) const 323 PassRefPtr<Image> HTMLImageElement::getSourceImageForCanvas(SourceImageMode, Sou rceImageStatus* status) const
332 { 324 {
333 if (!complete() || !cachedImage()) { 325 if (!complete() || !cachedImage()) {
334 *status = IncompleteSourceImageStatus; 326 *status = IncompleteSourceImageStatus;
335 return nullptr; 327 return nullptr;
336 } 328 }
337 329
338 if (cachedImage()->errorOccurred()) { 330 if (cachedImage()->errorOccurred()) {
339 *status = UndecodableSourceImageStatus; 331 *status = UndecodableSourceImageStatus;
340 return nullptr; 332 return nullptr;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 } 375 }
384 imageLoader().updateFromElement(behavior); 376 imageLoader().updateFromElement(behavior);
385 } 377 }
386 378
387 const KURL& HTMLImageElement::sourceURL() const 379 const KURL& HTMLImageElement::sourceURL() const
388 { 380 {
389 return cachedImage()->response().url(); 381 return cachedImage()->response().url();
390 } 382 }
391 383
392 } 384 }
OLDNEW
« no previous file with comments | « sky/engine/core/html/HTMLImageElement.h ('k') | sky/engine/public/web/WebElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698