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

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

Issue 2001453002: Set ComputedStyle on Node and use that in buildOwnLayout() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@storage
Patch Set: Created 4 years, 5 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) 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 void HTMLVideoElement::attach(const AttachContext& context) 86 void HTMLVideoElement::attach(const AttachContext& context)
87 { 87 {
88 HTMLMediaElement::attach(context); 88 HTMLMediaElement::attach(context);
89 89
90 updateDisplayState(); 90 updateDisplayState();
91 if (shouldDisplayPosterImage()) { 91 if (shouldDisplayPosterImage()) {
92 if (!m_imageLoader) 92 if (!m_imageLoader)
93 m_imageLoader = HTMLImageLoader::create(this); 93 m_imageLoader = HTMLImageLoader::create(this);
94 m_imageLoader->updateFromElement(); 94 m_imageLoader->updateFromElement();
95 if (layoutObject()) 95 if (hasLayoutObject())
96 toLayoutImage(layoutObject())->imageResource()->setImageResource(m_i mageLoader->image()); 96 toLayoutImage(layoutObject())->imageResource()->setImageResource(m_i mageLoader->image());
97 } 97 }
98 } 98 }
99 99
100 void HTMLVideoElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style) 100 void HTMLVideoElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStylePropertySet* style)
101 { 101 {
102 if (name == widthAttr) 102 if (name == widthAttr)
103 addHTMLLengthToStyle(style, CSSPropertyWidth, value); 103 addHTMLLengthToStyle(style, CSSPropertyWidth, value);
104 else if (name == heightAttr) 104 else if (name == heightAttr)
105 addHTMLLengthToStyle(style, CSSPropertyHeight, value); 105 addHTMLLengthToStyle(style, CSSPropertyHeight, value);
(...skipping 16 matching lines...) Expand all
122 if (getDisplayMode() < Video || !hasAvailableVideoFrame()) { 122 if (getDisplayMode() < Video || !hasAvailableVideoFrame()) {
123 // Force a poster recalc by setting m_displayMode to Unknown directl y before calling updateDisplayState. 123 // Force a poster recalc by setting m_displayMode to Unknown directl y before calling updateDisplayState.
124 HTMLMediaElement::setDisplayMode(Unknown); 124 HTMLMediaElement::setDisplayMode(Unknown);
125 updateDisplayState(); 125 updateDisplayState();
126 } 126 }
127 if (!posterImageURL().isEmpty()) { 127 if (!posterImageURL().isEmpty()) {
128 if (!m_imageLoader) 128 if (!m_imageLoader)
129 m_imageLoader = HTMLImageLoader::create(this); 129 m_imageLoader = HTMLImageLoader::create(this);
130 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousEr ror); 130 m_imageLoader->updateFromElement(ImageLoader::UpdateIgnorePreviousEr ror);
131 } else { 131 } else {
132 if (layoutObject()) 132 if (hasLayoutObject())
133 toLayoutImage(layoutObject())->imageResource()->setImageResource (0); 133 toLayoutImage(layoutObject())->imageResource()->setImageResource (0);
134 } 134 }
135 // Notify the player when the poster image URL changes. 135 // Notify the player when the poster image URL changes.
136 if (webMediaPlayer()) 136 if (webMediaPlayer())
137 webMediaPlayer()->setPoster(posterImageURL()); 137 webMediaPlayer()->setPoster(posterImageURL());
138 } else { 138 } else {
139 HTMLMediaElement::parseAttribute(name, oldValue, value); 139 HTMLMediaElement::parseAttribute(name, oldValue, value);
140 } 140 }
141 } 141 }
142 142
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 return ScriptPromise(); 339 return ScriptPromise();
340 } 340 }
341 if (!sw || !sh) { 341 if (!sw || !sh) {
342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou rce %s provided is 0.", sw ? "height" : "width")); 342 exceptionState.throwDOMException(IndexSizeError, String::format("The sou rce %s provided is 0.", sw ? "height" : "width"));
343 return ScriptPromise(); 343 return ScriptPromise();
344 } 344 }
345 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt ions)); 345 return ImageBitmapSource::fulfillImageBitmap(scriptState, ImageBitmap::creat e(this, IntRect(sx, sy, sw, sh), eventTarget.toLocalDOMWindow()->document(), opt ions));
346 } 346 }
347 347
348 } // namespace blink 348 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698