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 17 matching lines...) Expand all Loading... | |
28 #include "core/rendering/RenderVideo.h" | 28 #include "core/rendering/RenderVideo.h" |
29 | 29 |
30 #include "HTMLNames.h" | 30 #include "HTMLNames.h" |
31 #include "core/dom/Document.h" | 31 #include "core/dom/Document.h" |
32 #include "core/html/HTMLVideoElement.h" | 32 #include "core/html/HTMLVideoElement.h" |
33 #include "core/page/Frame.h" | 33 #include "core/page/Frame.h" |
34 #include "core/page/FrameView.h" | 34 #include "core/page/FrameView.h" |
35 #include "core/page/Page.h" | 35 #include "core/page/Page.h" |
36 #include "core/platform/graphics/MediaPlayer.h" | 36 #include "core/platform/graphics/MediaPlayer.h" |
37 #include "core/rendering/PaintInfo.h" | 37 #include "core/rendering/PaintInfo.h" |
38 #include "core/rendering/RenderFullScreen.h" | |
39 | 38 |
40 namespace WebCore { | 39 namespace WebCore { |
41 | 40 |
42 using namespace HTMLNames; | 41 using namespace HTMLNames; |
43 | 42 |
44 RenderVideo::RenderVideo(HTMLVideoElement* video) | 43 RenderVideo::RenderVideo(HTMLVideoElement* video) |
45 : RenderMedia(video) | 44 : RenderMedia(video) |
46 { | 45 { |
47 setIntrinsicSize(calculateIntrinsicSize()); | 46 setIntrinsicSize(calculateIntrinsicSize()); |
48 } | 47 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 | 259 |
261 bool RenderVideo::supportsAcceleratedRendering() const | 260 bool RenderVideo::supportsAcceleratedRendering() const |
262 { | 261 { |
263 MediaPlayer* p = mediaElement()->player(); | 262 MediaPlayer* p = mediaElement()->player(); |
264 if (p) | 263 if (p) |
265 return p->supportsAcceleratedRendering(); | 264 return p->supportsAcceleratedRendering(); |
266 | 265 |
267 return false; | 266 return false; |
268 } | 267 } |
269 | 268 |
270 static const RenderBlock* rendererPlaceholder(const RenderObject* renderer) | |
271 { | |
272 RenderObject* parent = renderer->parent(); | |
273 if (!parent) | |
274 return 0; | |
275 | |
276 RenderFullScreen* fullScreen = parent->isRenderFullScreen() ? toRenderFullSc reen(parent) : 0; | |
277 if (!fullScreen) | |
278 return 0; | |
279 | |
280 return fullScreen->placeholder(); | |
281 } | |
282 | |
283 LayoutUnit RenderVideo::offsetLeft() const | |
284 { | |
285 if (const RenderBlock* block = rendererPlaceholder(this)) | |
286 return block->offsetLeft(); | |
287 return RenderMedia::offsetLeft(); | |
288 } | |
289 | |
290 LayoutUnit RenderVideo::offsetTop() const | |
291 { | |
292 if (const RenderBlock* block = rendererPlaceholder(this)) | |
293 return block->offsetTop(); | |
294 return RenderMedia::offsetTop(); | |
295 } | |
296 | |
297 LayoutUnit RenderVideo::offsetWidth() const | |
298 { | |
299 if (const RenderBlock* block = rendererPlaceholder(this)) | |
300 return block->offsetWidth(); | |
301 return RenderMedia::offsetWidth(); | |
302 } | |
303 | |
304 LayoutUnit RenderVideo::offsetHeight() const | |
305 { | |
306 if (const RenderBlock* block = rendererPlaceholder(this)) | |
307 return block->offsetHeight(); | |
308 return RenderMedia::offsetHeight(); | |
309 } | |
310 | |
falken
2013/07/09 12:50:22
These were added in https://bugs.webkit.org/show_b
| |
311 } // namespace WebCore | 269 } // namespace WebCore |
OLD | NEW |