Changeset 78817 in webkit
- Timestamp:
- Feb 17, 2011 5:39:46 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r78816 r78817 1 2011-02-17 Hui Huang <hui.2.huang@nokia.com> 2 3 Reviewed by Laszlo Gombos. 4 5 The URL of HTML5 Video Element is percent encoded at websites such as youtube. 6 It is percent encoded again by QUrl constructor QUrl::QUrl(QString). This causes 7 the HTTP GET request for the video to be rejected by the service provider. 8 https://bugs.webkit.org/show_bug.cgi?id=53973. 9 10 The bug is fixed by constructing QUrl from the encoded URL. 11 12 New test function tst_QWebPage::loadHtml5Video() is added in 13 Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp 14 15 * platform/graphics/qt/MediaPlayerPrivateQt.cpp: 16 (WebCore::MediaPlayerPrivateQt::commitLoad): 17 1 18 2011-02-17 Andreas Kling <kling@webkit.org> 2 19 -
trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
r78263 r78817 188 188 } 189 189 190 const QUrl rUrl = QUrl(QString(url)); 190 KURL kUrl(ParsedURLString, url); 191 const QUrl rUrl = kUrl; 191 192 const QString scheme = rUrl.scheme().toLower(); 192 193 -
trunk/Source/WebKit/qt/ChangeLog
r78816 r78817 1 2011-02-17 Hui Huang <hui.2.huang@nokia.com> 2 3 Reviewed by Laszlo Gombos. 4 5 The URL of HTML5 Video Element is percent encoded at websites such as youtube. 6 It is percent encoded again by QUrl constructor QUrl::QUrl(QString). This causes 7 the HTTP GET request for the video to be rejected by the service provider. 8 https://bugs.webkit.org/show_bug.cgi?id=53973. 9 10 The bug is fixed by constructing QUrl from the encoded URL in 11 MediaPlayerPrivateQt::commitLoad. 12 13 New test function tst_QWebPage::loadHtml5Video() is added to load HTML content with 14 HTML5 Video element. A new public method DumpRenderTreeSupportQt::mediaContentUrlByElementId 15 is added to retrieve the URL of the media content from WebCore MediaPlayerPrivateQt. 16 A new macro ENABLE_QT_MULTIMEDIA is introduced in tests.pri to make sure that the test 17 is skipped if Qt Multimedia is not available. 18 19 * WebCoreSupport/DumpRenderTreeSupportQt.cpp: 20 (DumpRenderTreeSupportQt::mediaContentUrlByElementId): 21 * WebCoreSupport/DumpRenderTreeSupportQt.h: 22 * tests/qwebpage/tst_qwebpage.cpp: 23 (tst_QWebPage::loadHtml5Video): 24 * tests/tests.pri: 25 1 26 2011-02-17 Andreas Kling <kling@webkit.org> 2 27 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
r78620 r78817 81 81 #include "qwebscriptworld.h" 82 82 83 #if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) 84 #include "HTMLVideoElement.h" 85 #include "MediaPlayerPrivateQt.h" 86 #endif 87 83 88 using namespace WebCore; 84 89 … … 958 963 } 959 964 965 QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const QString& elementId) 966 { 967 QUrl res; 968 969 #if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) 970 Frame* coreFrame = QWebFramePrivate::core(frame); 971 if (!coreFrame) 972 return res; 973 974 Document* doc = coreFrame->document(); 975 if (!doc) 976 return res; 977 978 Node* coreNode = doc->getElementById(elementId); 979 if (!coreNode) 980 return res; 981 982 HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(coreNode); 983 PlatformMedia platformMedia = videoElement->platformMedia(); 984 if (platformMedia.type != PlatformMedia::QtMediaPlayerType) 985 return res; 986 987 MediaPlayerPrivateQt* mediaPlayerQt = static_cast<MediaPlayerPrivateQt*>(platformMedia.media.qtMediaPlayer); 988 if (mediaPlayerQt && mediaPlayerQt->mediaPlayer()) 989 res = mediaPlayerQt->mediaPlayer()->media().canonicalUrl(); 990 #endif 991 992 return res; 993 } 994 960 995 // Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release 961 996 -
trunk/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
r78620 r78817 52 52 class QWebHistoryItem; 53 53 class QWebScriptWorld; 54 class QUrl; 54 55 55 56 extern QMap<int, QWebScriptWorld*> m_worldMap; … … 193 194 static double defaultMinimumTimerInterval(); // Not really tied to WebView 194 195 static void setMinimumTimerInterval(QWebPage*, double); 196 197 static QUrl mediaContentUrlByElementId(QWebFrame*, const QString& elementId); 195 198 }; 196 199 -
trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r78490 r78817 86 86 void acceptNavigationRequestWithNewWindow(); 87 87 void userStyleSheet(); 88 void loadHtml5Video(); 88 89 void modified(); 89 90 void contextMenuCrash(); … … 428 429 QVERIFY(networkManager->requestedUrls.count() >= 1); 429 430 QCOMPARE(networkManager->requestedUrls.at(0), QUrl("http://does.not/exist.png")); 431 } 432 433 void tst_QWebPage::loadHtml5Video() 434 { 435 #if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA 436 QByteArray url("http://does.not/exist?a=1%2Cb=2"); 437 m_view->setHtml("<p><video id ='video' src='" + url + "' autoplay/></p>"); 438 QTest::qWait(2000); 439 QUrl mUrl = DumpRenderTreeSupportQt::mediaContentUrlByElementId(m_page->mainFrame(), "video"); 440 QCOMPARE(mUrl.toEncoded(), url); 441 #else 442 QSKIP("This test requires Qt Multimedia", SkipAll); 443 #endif 430 444 } 431 445 -
trunk/Source/WebKit/qt/tests/tests.pri
r76496 r78817 6 6 CONFIG(QTDIR_build) { load(qttest_p4) } 7 7 ELSE { TARGET = tst_$$TARGET } 8 9 # Load mobilityconfig if Qt Mobility is available 10 load(mobilityconfig, true) 11 contains(MOBILITY_CONFIG, multimedia) { 12 # This define is used by tests depending on Qt Multimedia 13 DEFINES -= ENABLE_QT_MULTIMEDIA=0 14 DEFINES += ENABLE_QT_MULTIMEDIA=1 15 } 16 8 17 SOURCES += $${TARGET}.cpp 9 18 INCLUDEPATH += \
Note: See TracChangeset
for help on using the changeset viewer.