Changeset 173533 in webkit
- Timestamp:
- Sep 11, 2014, 12:57:33 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dom/Document.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r173531 r173533 1 2014-09-11 Jer Noble <jer.noble@apple.com> 2 3 Add site-specific quirk for entering fullscreen on YouTube.com. 4 https://bugs.webkit.org/show_bug.cgi?id=136742 5 6 Reviewed by Eric Carlson. 7 8 YouTube only resizes its <video> content when entering fullscreen after receiving the "webkitfullscreenchange" 9 event, which is fired once the animation to enter fullscreen completes. This leaves the apparent <video> content 10 too small during the animation, especially at the beginning of the animation. Add a site-specific hack for 11 YouTube sites which fires the "webkitfullscreenchange" event synchronously with the beginning of the enter 12 fullscreen animation. This will cause YouTube to resize their <video> content during the period of time where we 13 disable screen updates, and makes the enter fullscreen animation seamless. 14 15 Add a static utility method, hostIsYouTube(), for the various pieces of this site-specific hack, and expand it 16 to match youtube.co.uk, youtube.fr, etc. 17 18 * dom/Document.cpp: 19 (WebCore::hostIsYouTube): Added. 20 (WebCore::Document::webkitWillEnterFullScreenForElement): Fire fullscreenchange event if hacks are enabled. 21 (WebCore::Document::webkitDidEnterFullScreenForElement): Don't fire the event if same. 22 (WebCore::Document::webkitDidExitFullScreenForElement): Use hostIsYouTube(). 23 1 24 2014-09-11 Bear Travis <betravis@adobe.com> 2 25 -
trunk/Source/WebCore/dom/Document.cpp
r173528 r173533 159 159 #include <wtf/TemporaryChange.h> 160 160 #include <wtf/text/StringBuffer.h> 161 #include <yarr/RegularExpression.h> 161 162 162 163 #if ENABLE(SHARED_WORKERS) … … 5332 5333 } 5333 5334 5335 static bool hostIsYouTube(const String& host) 5336 { 5337 // Match .youtube.com, youtube.com, youtube.co.uk, and all two-letter country codes. 5338 static NeverDestroyed<JSC::Yarr::RegularExpression> youtubePattern("(^|\\.)youtube.(com|co.uk|[a-z]{2})$", TextCaseInsensitive); 5339 ASSERT(youtubePattern.get().isValid()); 5340 5341 return youtubePattern.get().match(host); 5342 } 5343 5334 5344 void Document::webkitWillEnterFullScreenForElement(Element* element) 5335 5345 { … … 5369 5379 5370 5380 m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); 5371 5381 5382 if (settings() && settings()->needsSiteSpecificQuirks() && hostIsYouTube(url().host())) 5383 fullScreenChangeDelayTimerFired(m_fullScreenChangeDelayTimer); 5384 5372 5385 recalcStyle(Style::Force); 5373 5386 } … … 5383 5396 m_fullScreenElement->didBecomeFullscreenElement(); 5384 5397 5385 m_fullScreenChangeDelayTimer.startOneShot(0); 5398 if (!settings() || !settings()->needsSiteSpecificQuirks() || !hostIsYouTube(url().host())) 5399 m_fullScreenChangeDelayTimer.startOneShot(0); 5386 5400 } 5387 5401 … … 5422 5436 // FIXME(136605): Remove this quirk once YouTube moves to relative widths and heights for 5423 5437 // fullscreen mode. 5424 String host = url().host(); 5425 if (settings() && settings()->needsSiteSpecificQuirks() && (host.endsWith(".youtube.com", false) || equalIgnoringCase("youtube.com", host))) 5438 if (settings() && settings()->needsSiteSpecificQuirks() && hostIsYouTube(url().host())) 5426 5439 exitingDocument.fullScreenChangeDelayTimerFired(exitingDocument.m_fullScreenChangeDelayTimer); 5427 5440 else
Note:
See TracChangeset
for help on using the changeset viewer.