| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 26 matching lines...) Expand all Loading... |
| 37 using namespace std; | 37 using namespace std; |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 using namespace HTMLNames; | 41 using namespace HTMLNames; |
| 42 | 42 |
| 43 inline HTMLSourceElement::HTMLSourceElement(const QualifiedName& tagName, Docume
nt* document) | 43 inline HTMLSourceElement::HTMLSourceElement(const QualifiedName& tagName, Docume
nt* document) |
| 44 : HTMLElement(tagName, document) | 44 : HTMLElement(tagName, document) |
| 45 , m_errorEventTimer(this, &HTMLSourceElement::errorEventTimerFired) | 45 , m_errorEventTimer(this, &HTMLSourceElement::errorEventTimerFired) |
| 46 { | 46 { |
| 47 LOG(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); | 47 LOG_INFO(Media, "HTMLSourceElement::HTMLSourceElement - %p", this); |
| 48 ASSERT(hasTagName(sourceTag)); | 48 ASSERT(hasTagName(sourceTag)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tag
Name, Document* document) | 51 PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tag
Name, Document* document) |
| 52 { | 52 { |
| 53 return adoptRef(new HTMLSourceElement(tagName, document)); | 53 return adoptRef(new HTMLSourceElement(tagName, document)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
* insertionPoint) | 56 Node::InsertionNotificationRequest HTMLSourceElement::insertedInto(ContainerNode
* insertionPoint) |
| 57 { | 57 { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 return getAttribute(typeAttr); | 92 return getAttribute(typeAttr); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void HTMLSourceElement::setType(const String& type) | 95 void HTMLSourceElement::setType(const String& type) |
| 96 { | 96 { |
| 97 setAttribute(typeAttr, type); | 97 setAttribute(typeAttr, type); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void HTMLSourceElement::scheduleErrorEvent() | 100 void HTMLSourceElement::scheduleErrorEvent() |
| 101 { | 101 { |
| 102 LOG(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this); | 102 LOG_INFO(Media, "HTMLSourceElement::scheduleErrorEvent - %p", this); |
| 103 if (m_errorEventTimer.isActive()) | 103 if (m_errorEventTimer.isActive()) |
| 104 return; | 104 return; |
| 105 | 105 |
| 106 m_errorEventTimer.startOneShot(0); | 106 m_errorEventTimer.startOneShot(0); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void HTMLSourceElement::cancelPendingErrorEvent() | 109 void HTMLSourceElement::cancelPendingErrorEvent() |
| 110 { | 110 { |
| 111 LOG(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this); | 111 LOG_INFO(Media, "HTMLSourceElement::cancelPendingErrorEvent - %p", this); |
| 112 m_errorEventTimer.stop(); | 112 m_errorEventTimer.stop(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void HTMLSourceElement::errorEventTimerFired(Timer<HTMLSourceElement>*) | 115 void HTMLSourceElement::errorEventTimerFired(Timer<HTMLSourceElement>*) |
| 116 { | 116 { |
| 117 LOG(Media, "HTMLSourceElement::errorEventTimerFired - %p", this); | 117 LOG_INFO(Media, "HTMLSourceElement::errorEventTimerFired - %p", this); |
| 118 dispatchEvent(Event::create(eventNames().errorEvent, false, true)); | 118 dispatchEvent(Event::create(eventNames().errorEvent, false, true)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const | 121 bool HTMLSourceElement::isURLAttribute(const Attribute& attribute) const |
| 122 { | 122 { |
| 123 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute)
; | 123 return attribute.name() == srcAttr || HTMLElement::isURLAttribute(attribute)
; |
| 124 } | 124 } |
| 125 | 125 |
| 126 #if ENABLE(MICRODATA) | 126 #if ENABLE(MICRODATA) |
| 127 String HTMLSourceElement::itemValueText() const | 127 String HTMLSourceElement::itemValueText() const |
| 128 { | 128 { |
| 129 return getURLAttribute(srcAttr); | 129 return getURLAttribute(srcAttr); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void HTMLSourceElement::setItemValueText(const String& value, ExceptionCode&) | 132 void HTMLSourceElement::setItemValueText(const String& value, ExceptionCode&) |
| 133 { | 133 { |
| 134 setAttribute(srcAttr, value); | 134 setAttribute(srcAttr, value); |
| 135 } | 135 } |
| 136 #endif | 136 #endif |
| 137 | 137 |
| 138 } | 138 } |
| 139 | 139 |
| 140 #endif | 140 #endif |
| OLD | NEW |