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 112 matching lines...) Loading... |
123 | 123 |
124 bool HTMLVideoElement::supportsFullscreen() const | 124 bool HTMLVideoElement::supportsFullscreen() const |
125 { | 125 { |
126 Page* page = document() ? document()->page() : 0; | 126 Page* page = document() ? document()->page() : 0; |
127 if (!page) | 127 if (!page) |
128 return false; | 128 return false; |
129 | 129 |
130 if (!player() || !player()->supportsFullscreen()) | 130 if (!player() || !player()->supportsFullscreen()) |
131 return false; | 131 return false; |
132 | 132 |
133 // If the full screen API is enabled and is supported for the current elemen
t | 133 return true; |
134 // do not require that the player has a video track to enter full screen. | |
135 if (page->chrome()->client()->supportsFullScreenForElement(this, false)) | |
136 return true; | |
137 | |
138 if (!player()->hasVideo()) | |
139 return false; | |
140 | |
141 return page->chrome()->client()->supportsFullscreenForNode(this); | |
142 } | 134 } |
143 | 135 |
144 unsigned HTMLVideoElement::videoWidth() const | 136 unsigned HTMLVideoElement::videoWidth() const |
145 { | 137 { |
146 if (!player()) | 138 if (!player()) |
147 return 0; | 139 return 0; |
148 return player()->naturalSize().width(); | 140 return player()->naturalSize().width(); |
149 } | 141 } |
150 | 142 |
151 unsigned HTMLVideoElement::videoHeight() const | 143 unsigned HTMLVideoElement::videoHeight() const |
(...skipping 153 matching lines...) Loading... |
305 | 297 |
306 KURL HTMLVideoElement::posterImageURL() const | 298 KURL HTMLVideoElement::posterImageURL() const |
307 { | 299 { |
308 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); | 300 String url = stripLeadingAndTrailingHTMLSpaces(imageSourceURL()); |
309 if (url.isEmpty()) | 301 if (url.isEmpty()) |
310 return KURL(); | 302 return KURL(); |
311 return document()->completeURL(url); | 303 return document()->completeURL(url); |
312 } | 304 } |
313 | 305 |
314 } | 306 } |
OLD | NEW |