OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 } | 94 } |
95 | 95 |
96 virtual void appendBytes(DocumentWriter*, const char*, size_t); | 96 virtual void appendBytes(DocumentWriter*, const char*, size_t); |
97 virtual void finish(); | 97 virtual void finish(); |
98 }; | 98 }; |
99 | 99 |
100 class ImageDocumentElement : public HTMLImageElement { | 100 class ImageDocumentElement : public HTMLImageElement { |
101 public: | 101 public: |
102 static PassRefPtr<ImageDocumentElement> create(ImageDocument*); | 102 static PassRefPtr<ImageDocumentElement> create(ImageDocument*); |
103 | 103 |
| 104 void acceptHeapVisitor(Visitor*) const OVERRIDE; |
| 105 |
104 private: | 106 private: |
105 // FIXME(oilpan): handlify ImageDocument. | 107 // FIXME(oilpan): handlify ImageDocument. |
106 ImageDocumentElement(ImageDocument* document) | 108 ImageDocumentElement(ImageDocument* document) |
107 : HTMLImageElement(imgTag, Handle<Document>(document)) | 109 : HTMLImageElement(imgTag, Handle<Document>(document)) |
108 , m_imageDocument(document) | 110 , m_imageDocument(document) |
109 { | 111 { |
110 } | 112 } |
111 | 113 |
112 virtual ~ImageDocumentElement(); | 114 virtual ~ImageDocumentElement(); |
113 virtual void didMoveToNewDocument(Handle<Document> oldDocument) OVERRIDE; | 115 virtual void didMoveToNewDocument(Handle<Document> oldDocument) OVERRIDE; |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 } | 381 } |
380 } | 382 } |
381 | 383 |
382 bool ImageEventListener::operator==(const EventListener& listener) | 384 bool ImageEventListener::operator==(const EventListener& listener) |
383 { | 385 { |
384 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) | 386 if (const ImageEventListener* imageEventListener = ImageEventListener::cast(
&listener)) |
385 return m_doc == imageEventListener->m_doc; | 387 return m_doc == imageEventListener->m_doc; |
386 return false; | 388 return false; |
387 } | 389 } |
388 | 390 |
| 391 void ImageDocument::acceptHeapVisitor(Visitor* visitor) const |
| 392 { |
| 393 visitor->visit(m_imageElement); |
| 394 HTMLDocument::acceptHeapVisitor(visitor); |
| 395 } |
| 396 |
389 // -------- | 397 // -------- |
390 | 398 |
391 ImageDocumentElement::~ImageDocumentElement() | 399 ImageDocumentElement::~ImageDocumentElement() |
392 { | 400 { |
393 if (m_imageDocument) | 401 if (m_imageDocument) |
394 m_imageDocument->disconnectImageElement(); | 402 m_imageDocument->disconnectImageElement(); |
395 } | 403 } |
396 | 404 |
397 void ImageDocumentElement::didMoveToNewDocument(Handle<Document> oldDocument) | 405 void ImageDocumentElement::didMoveToNewDocument(Handle<Document> oldDocument) |
398 { | 406 { |
399 if (m_imageDocument) { | 407 if (m_imageDocument) { |
400 m_imageDocument->disconnectImageElement(); | 408 m_imageDocument->disconnectImageElement(); |
401 m_imageDocument = 0; | 409 m_imageDocument = 0; |
402 } | 410 } |
403 HTMLImageElement::didMoveToNewDocument(oldDocument); | 411 HTMLImageElement::didMoveToNewDocument(oldDocument); |
404 } | 412 } |
405 | 413 |
| 414 void ImageDocumentElement::acceptHeapVisitor(Visitor* visitor) const |
| 415 { |
| 416 HTMLImageElement::acceptHeapVisitor(visitor); |
406 } | 417 } |
| 418 |
| 419 } |
OLD | NEW |