| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 void HTMLVideoElement::attach(const AttachContext& context) | 84 void HTMLVideoElement::attach(const AttachContext& context) |
| 85 { | 85 { |
| 86 HTMLMediaElement::attach(context); | 86 HTMLMediaElement::attach(context); |
| 87 | 87 |
| 88 updateDisplayState(); | 88 updateDisplayState(); |
| 89 if (shouldDisplayPosterImage()) { | 89 if (shouldDisplayPosterImage()) { |
| 90 if (!m_imageLoader) | 90 if (!m_imageLoader) |
| 91 m_imageLoader = HTMLImageLoader::create(this); | 91 m_imageLoader = HTMLImageLoader::create(this); |
| 92 m_imageLoader->updateFromElement(); | 92 m_imageLoader->updateFromElement(0); |
| 93 if (layoutObject()) | 93 if (layoutObject()) |
| 94 toLayoutImage(layoutObject())->imageResource()->setImageResource(m_i
mageLoader->image()); | 94 toLayoutImage(layoutObject())->imageResource()->setImageResource(m_i
mageLoader->image()); |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 | 97 |
| 98 void HTMLVideoElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) | 98 void HTMLVideoElement::collectStyleForPresentationAttribute(const QualifiedName&
name, const AtomicString& value, MutableStylePropertySet* style) |
| 99 { | 99 { |
| 100 if (name == widthAttr) | 100 if (name == widthAttr) |
| 101 addHTMLLengthToStyle(style, CSSPropertyWidth, value); | 101 addHTMLLengthToStyle(style, CSSPropertyWidth, value); |
| 102 else if (name == heightAttr) | 102 else if (name == heightAttr) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 118 // In case the poster attribute is set after playback, don't update the | 118 // In case the poster attribute is set after playback, don't update the |
| 119 // display state, post playback the correct state will be picked up. | 119 // display state, post playback the correct state will be picked up. |
| 120 if (displayMode() < Video || !hasAvailableVideoFrame()) { | 120 if (displayMode() < Video || !hasAvailableVideoFrame()) { |
| 121 // Force a poster recalc by setting m_displayMode to Unknown directl
y before calling updateDisplayState. | 121 // Force a poster recalc by setting m_displayMode to Unknown directl
y before calling updateDisplayState. |
| 122 HTMLMediaElement::setDisplayMode(Unknown); | 122 HTMLMediaElement::setDisplayMode(Unknown); |
| 123 updateDisplayState(); | 123 updateDisplayState(); |
| 124 } | 124 } |
| 125 if (!posterImageURL().isEmpty()) { | 125 if (!posterImageURL().isEmpty()) { |
| 126 if (!m_imageLoader) | 126 if (!m_imageLoader) |
| 127 m_imageLoader = HTMLImageLoader::create(this); | 127 m_imageLoader = HTMLImageLoader::create(this); |
| 128 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousEr
ror); | 128 m_imageLoader->updateFromElement(0, ImageLoader::UpdateIgnorePreviou
sError); |
| 129 } else { | 129 } else { |
| 130 if (layoutObject()) | 130 if (layoutObject()) |
| 131 toLayoutImage(layoutObject())->imageResource()->setImageResource
(0); | 131 toLayoutImage(layoutObject())->imageResource()->setImageResource
(0); |
| 132 } | 132 } |
| 133 // Notify the player when the poster image URL changes. | 133 // Notify the player when the poster image URL changes. |
| 134 if (webMediaPlayer()) | 134 if (webMediaPlayer()) |
| 135 webMediaPlayer()->setPoster(posterImageURL()); | 135 webMediaPlayer()->setPoster(posterImageURL()); |
| 136 } else { | 136 } else { |
| 137 HTMLMediaElement::parseAttribute(name, value); | 137 HTMLMediaElement::parseAttribute(name, value); |
| 138 } | 138 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 { | 313 { |
| 314 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); | 314 return !isMediaDataCORSSameOrigin(destinationSecurityOrigin); |
| 315 } | 315 } |
| 316 | 316 |
| 317 FloatSize HTMLVideoElement::elementSize() const | 317 FloatSize HTMLVideoElement::elementSize() const |
| 318 { | 318 { |
| 319 return FloatSize(videoWidth(), videoHeight()); | 319 return FloatSize(videoWidth(), videoHeight()); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace blink | 322 } // namespace blink |
| OLD | NEW |