diff options
Diffstat (limited to 'Source/WebKit')
346 files changed, 9800 insertions, 3537 deletions
diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt index a5fd0ab..cee9456 100644 --- a/Source/WebKit/CMakeLists.txt +++ b/Source/WebKit/CMakeLists.txt @@ -36,7 +36,7 @@ SET(WebKit_INCLUDE_DIRECTORIES "${JAVASCRIPTCORE_DIR}/assembler" "${JAVASCRIPTCORE_DIR}/bytecode" "${JAVASCRIPTCORE_DIR}/bytecompiler" - "${JAVASCRIPTCORE_DIR}/collector/handles" + "${JAVASCRIPTCORE_DIR}/heap" "${JAVASCRIPTCORE_DIR}/debugger" "${JAVASCRIPTCORE_DIR}/interpreter" "${JAVASCRIPTCORE_DIR}/jit" @@ -45,7 +45,7 @@ SET(WebKit_INCLUDE_DIRECTORIES "${JAVASCRIPTCORE_DIR}/runtime" "${JAVASCRIPTCORE_DIR}/wtf" "${JAVASCRIPTCORE_DIR}/wtf/unicode" - "${DERIVED_SOURCES_DIR}" + "${DERIVED_SOURCES_WEBCORE_DIR}" "${CMAKE_BINARY_DIR}" ) diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog index d786ce1..ac05a54 100644 --- a/Source/WebKit/ChangeLog +++ b/Source/WebKit/ChangeLog @@ -1,3 +1,114 @@ +2011-04-18 Timothy Hatcher <timothy@apple.com> + + Make update-webkit-localizable-strings put WebKit/win strings in WebCore + now that all localized strings in WebKit/win use WEB_UI_STRING. + + https://webkit.org/b/58747 + + Reviewed by Dan Bernstein. + + * English.lproj/Localizable.strings: Removed. + +2011-04-17 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Timothy Hatcher. + + Move WebNodeHighlighter into its own file + https://bugs.webkit.org/show_bug.cgi?id=58746 + + * WebKit.xcodeproj/project.pbxproj: Add WebNodeHighlighter.{h,mm}. + +2011-04-13 Ryuan Choi <ryuan.choi@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [CMAKE] Separate DerivedSources. + https://bugs.webkit.org/show_bug.cgi?id=58427 + + * CMakeLists.txt: Change DERIVED_SOURCES_DIR to DERIVED_SOURCES_WEBCORE_DIR + +2011-04-11 Alexis Menard <alexis.menard@openbossa.org> + + Unreviewed build fix for Mac. + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-11 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Setup ENABLE(TRACK) feature define + initial HTMLTrackElement + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-08 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Oliver Hunt. + + A few heap-related renames and file moves. + + WeakGCPtr<T> => Weak<T> + Global<T> => Strong<T> + collector/ => heap/ + collector/* => heap/* + runtime/WeakGCPtr.h => heap/Weak.h + + (Eventually, even more files should move into the heap directory. Like + Heap.h and Heap.cpp, for example.) + + * CMakeLists.txt: + +2011-04-08 Dan Bernstein <mitz@apple.com> + + No need to compile .js files, that is what the JIT is for. + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-08 Alpha Lam <hclam@chromium.org> + + Unreviewed, rolling out r83335. + http://trac.webkit.org/changeset/83335 + https://bugs.webkit.org/show_bug.cgi?id=53556 + + GTK and QT bots are broken + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-07 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Setup ENABLE(TRACK) feature define + initial HTMLTrackElement + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-07 Andrew Scherkus <scherkus@chromium.org> + + Revert ENABLE_TRACK patch due to compile failures. + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-07 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r64712): Microsoft Outlook 2011: original message contents + not included when replying to an email. + https://bugs.webkit.org/show_bug.cgi?id=57794 + + * WebKit.xcodeproj/project.pbxproj: + +2011-04-05 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + Move attributedStringFromRange down to WebCore + https://bugs.webkit.org/show_bug.cgi?id=57905 + + * WebKit.xcodeproj/project.pbxproj: Removed WebNSAttributedStringExtras, which is now in WebCore. + 2011-03-29 Timothy Hatcher <timothy@apple.com> Update WebKit Localizable.strings to only contain WebKit/win strings. diff --git a/Source/WebKit/English.lproj/Localizable.strings b/Source/WebKit/English.lproj/Localizable.strings Binary files differdeleted file mode 100644 index eebf03f..0000000 --- a/Source/WebKit/English.lproj/Localizable.strings +++ /dev/null diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj index 06a5566..e0dc140 100644 --- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj +++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj @@ -81,6 +81,7 @@ 226E9E6A09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = 226E9E6809D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.h */; }; 226E9E6B09D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c in Sources */ = {isa = PBXBuildFile; fileRef = 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; }; 22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */ = {isa = PBXBuildFile; fileRef = 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */; }; 37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 37B6FB4C1063530C000FDB3B /* WebPDFDocumentExtras.h */; }; 37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 37B6FB4D1063530C000FDB3B /* WebPDFDocumentExtras.mm */; }; 37D1DCA81065928C0068F7EF /* WebJSPDFDoc.h in Headers */ = {isa = PBXBuildFile; fileRef = 37D1DCA61065928C0068F7EF /* WebJSPDFDoc.h */; }; @@ -327,6 +328,8 @@ 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */; }; 93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; }; 93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; }; + A5687BDA135B791A0074CBCB /* WebNodeHighlighter.h in Headers */ = {isa = PBXBuildFile; fileRef = A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */; }; + A5687BDB135B791A0074CBCB /* WebNodeHighlighter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5687BD9135B791A0074CBCB /* WebNodeHighlighter.mm */; }; A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */ = {isa = PBXBuildFile; fileRef = A57E2F22120749E600048DF3 /* WebQuotaManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */; }; A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */; }; @@ -378,8 +381,6 @@ E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E169836111346D1B00894115 /* ProxyRuntimeObject.h */; }; E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = E169836B11346D5600894115 /* ProxyRuntimeObject.mm */; }; ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED5B9523111B725A00472298 /* WebLocalizableStrings.mm */; }; - ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */; }; - ED6BE2E8088C32B50044DEDC /* WebNSAttributedStringExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */; }; ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */; }; EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */; }; @@ -466,6 +467,7 @@ 226E9E6909D0AA8200F3A2BC /* WebNetscapeDeprecatedFunctions.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = WebNetscapeDeprecatedFunctions.c; sourceTree = "<group>"; }; 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2568C72C0174912D0ECA149E /* WebKit.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebKit.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; + 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = OutlookQuirksUserScript.js; sourceTree = "<group>"; }; 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -645,6 +647,8 @@ 9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebImageRendererFactory.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 9CF0E249021361B00ECA16EA /* WebFramePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFramePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; + A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNodeHighlighter.h; sourceTree = "<group>"; }; + A5687BD9135B791A0074CBCB /* WebNodeHighlighter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNodeHighlighter.mm; sourceTree = "<group>"; }; A57E2F22120749E600048DF3 /* WebQuotaManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebQuotaManager.h; sourceTree = "<group>"; }; A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; }; A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; }; @@ -711,8 +715,6 @@ ED2B2474033A2DA800C1A526 /* WebNSPasteboardExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPasteboardExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED2B2475033A2DA800C1A526 /* WebNSPasteboardExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSPasteboardExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED5B9523111B725A00472298 /* WebLocalizableStrings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebLocalizableStrings.mm; sourceTree = "<group>"; }; - ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSAttributedStringExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; - ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNSAttributedStringExtras.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; ED7F6D8A0980683500C235ED /* WebNSDataExtrasPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNSDataExtrasPrivate.h; sourceTree = "<group>"; }; EDD1A5C605C83987008E3150 /* WebNSPrintOperationExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSPrintOperationExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; EDD1A5C705C83987008E3150 /* WebNSPrintOperationExtras.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebNSPrintOperationExtras.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; @@ -916,6 +918,8 @@ B804176E1217A83100466BAE /* WebInspectorFrontend.mm */, 1C68F663095B5FC100C2984E /* WebNodeHighlight.h */, 1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */, + A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */, + A5687BD9135B791A0074CBCB /* WebNodeHighlighter.mm */, 1C68F665095B5FC100C2984E /* WebNodeHighlightView.h */, 1C68F666095B5FC100C2984E /* WebNodeHighlightView.mm */, ); @@ -943,6 +947,7 @@ 254DC334016E1D3F0ECA149E /* Misc */ = { isa = PBXGroup; children = ( + 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */, A864B3E5123ED83D00C2A612 /* MailQuirksUserScript.js */, 1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */, 5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */, @@ -981,8 +986,6 @@ BC42D34C131ED3880075FA4B /* WebLocalizableStringsInternal.mm */, EDE9837E0BCDF5FE00FDAE28 /* WebNSArrayExtras.h */, EDE9837F0BCDF5FE00FDAE28 /* WebNSArrayExtras.m */, - ED6BE2E5088C32B50044DEDC /* WebNSAttributedStringExtras.h */, - ED6BE2E6088C32B50044DEDC /* WebNSAttributedStringExtras.mm */, 9345DDB20365FFD0008635CE /* WebNSControlExtras.h */, 9345DDB30365FFD0008635CE /* WebNSControlExtras.m */, BECD14290565830A005BB09C /* WebNSDataExtras.h */, @@ -1560,7 +1563,6 @@ 1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */, 1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */, EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */, - ED6BE2E7088C32B50044DEDC /* WebNSAttributedStringExtras.h in Headers */, 939810210824BF01008DF038 /* WebNSControlExtras.h in Headers */, 939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */, ED7F6D8B0980683500C235ED /* WebNSDataExtrasPrivate.h in Headers */, @@ -1652,6 +1654,7 @@ 3ABB3C7A1309C3B500E93D94 /* WebStorageTrackerClient.h in Headers */, BC42D324131ED1E00075FA4B /* WebLocalizableStringsInternal.h in Headers */, B82958D3132707D0000D0E79 /* CorrectionPanel.h in Headers */, + A5687BDA135B791A0074CBCB /* WebNodeHighlighter.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1719,6 +1722,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */, A864B3F6123ED9FA00C2A612 /* MailQuirksUserScript.js in Resources */, 939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */, 939810B70824BF01008DF038 /* url_icon.tiff in Resources */, @@ -1957,7 +1961,6 @@ 1C68F670095B5FC100C2984E /* WebNodeHighlight.mm in Sources */, 1C68F672095B5FC100C2984E /* WebNodeHighlightView.mm in Sources */, EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */, - ED6BE2E8088C32B50044DEDC /* WebNSAttributedStringExtras.mm in Sources */, 939810C60824BF01008DF038 /* WebNSControlExtras.m in Sources */, 939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */, 65488DA2084FBCCB00831AD0 /* WebNSDictionaryExtras.m in Sources */, @@ -2023,6 +2026,7 @@ 3ABB3C7B1309C3B500E93D94 /* WebStorageTrackerClient.mm in Sources */, BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */, B82958D4132707D0000D0E79 /* CorrectionPanel.mm in Sources */, + A5687BDB135B791A0074CBCB /* WebNodeHighlighter.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index 8becdba..dce7bf9 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,1452 @@ +2011-04-19 Evan Martin <evan@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] didReceiveTitle API signature should not change + https://bugs.webkit.org/show_bug.cgi?id=58909 + + My previous attempt at a temporary shim was wrong. + This second try should correctly work with older clients. + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::didReceiveTitle): + +2011-04-19 Jungshik Shin <jshin@chromium.org> + + Reviewed by Adam Barth + + Fix the compile failure in UniscribeHelperTest.cpp due to + a change in UniscribeHelper made by the CL for bug 48860 + (r84264) + + http://bugs.webkit.org/show_bug.cgi?id=48860 + + * tests/UniscribeHelperTest.cpp: + (TEST_F): + +2011-04-19 Stuart Morgan <stuartmorgan@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Clicking on plugin for first time blocks focus shift + https://bugs.webkit.org/show_bug.cgi?id=58419 + + Switched to using FocusController when moving focus to a plugin + so that cross-frame focus changes are handled correctly. + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleMouseEvent): + +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + Renamed lengthReceived to encodedDataLength/dataLength. + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata): + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveContentLength): + * src/FrameLoaderClientImpl.h: + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Chromium DevTools: Network panel timing test is flaky + https://bugs.webkit.org/show_bug.cgi?id=58699 + + Fixed network timing test flakiness. + + * src/js/Tests.js: + (.TestSuite.prototype.testNetworkTiming.finishResource): + +2011-04-19 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: add chrome.devTools alias to webInspector namespace for chromium port + https://bugs.webkit.org/show_bug.cgi?id=58894 + + * src/js/DevTools.js: + (WebInspector.platformExtensionAPI): + +2011-04-19 Kinuko Yasuda <kinuko@chromium.org> + + Not reviewed; another build fix attempt. + + * src/StorageInfoChromium.cpp: + (WebCore::StorageInfo::queryUsageAndQuota): + (WebCore::StorageInfo::requestQuota): + * src/WebStorageQuotaCallbacksImpl.cpp: + (WebKit::WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl): + * src/WebStorageQuotaCallbacksImpl.h: + +2011-04-19 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + [Chromium] Enable QUOTA API at runtime if enable-quota flag is given + https://bugs.webkit.org/show_bug.cgi?id=58784 + + * features.gypi: Added ENABLE_QUOTA=1. + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableQuota): Added. + (WebKit::WebRuntimeFeatures::isQuotaEnabled): Added. + +2011-04-19 John Gregg <johnnyg@google.com> + + Reviewed by Darin Fisher. + + Enable folder drag-n-drop when using a "webkitdirectory" file input + https://bugs.webkit.org/show_bug.cgi?id=58401 + + This uses a new ChromeClient API to enumerate the directory and + return all the files, as if the user had selected that directory + by clicking the control in the normal way. + + * public/WebViewClient.h: + (WebKit::WebViewClient::enumerateChosenDirectory): + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::enumerateChosenDirectory): + * src/ChromeClientImpl.h: + +2011-04-18 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] expose title direction to webkit client + https://bugs.webkit.org/show_bug.cgi?id=58823 + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::didReceiveTitle): + Add new param to API. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveTitle): + Pass new param in API. + +2011-04-17 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Adam Barth. + + Rename PLATFORM(CG) to USE(CG) + https://bugs.webkit.org/show_bug.cgi?id=58729 + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::~GraphicsContext3DInternal): + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DInternal::reshape): + * src/GraphicsContext3DInternal.h: + * src/PlatformBridge.cpp: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::doPixelReadbackToCanvas): + +2011-04-15 John Bates <jbates@google.com> + + Reviewed by Kenneth Russell. + + Change WebGraphicsContext3D virtuals to pure virtuals as intended + https://bugs.webkit.org/show_bug.cgi?id=58479 + + * public/WebGraphicsContext3D.h: + +2011-04-15 Shishir Agrawal <shishir@chromium.org> + + Reviewed by James Robinson. + + Add a flag to guard Page Visibility API changes. + https://bugs.webkit.org/show_bug.cgi?id=58464 + + * features.gypi: + +2011-04-15 Charlie Reis <creis@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] fast/events/popup-allowed-from-gesture-initiated-form-submit.html causing debug ASSERT + https://bugs.webkit.org/show_bug.cgi?id=44079 + + Remove an assert whose invariant doesn't hold. + + * src/FrameLoaderClientImpl.cpp: + +2011-04-15 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Expose unified Quota API if QUOTA build flag is enabled + https://bugs.webkit.org/show_bug.cgi?id=58648 + + * src/AssertMatchingEnums.cpp: Added enum assertions. + * src/StorageInfoChromium.cpp: Made a build fix. + +2011-04-15 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename rawRequestHeadersText and RawResponseHeadersText to requestHeadersText and responseHeadersText + https://bugs.webkit.org/show_bug.cgi?id=58650 + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::requestHeadersText): + (WebKit::WebHTTPLoadInfo::setRequestHeadersText): + (WebKit::WebHTTPLoadInfo::responseHeadersText): + (WebKit::WebHTTPLoadInfo::setResponseHeadersText): + +2011-04-15 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by Darin Fisher. + + Added enums for external file system type and exposed factory function + for creating File- and DirectoryEntry objects from Chromium side. + https://bugs.webkit.org/show_bug.cgi?id=58456 + + * public/WebFileSystem.h: + * public/WebFrame.h: + * src/AssertMatchingEnums.cpp: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::createFileSystem): + (WebKit::WebFrameImpl::createFileEntry): + * src/WebFrameImpl.h: + +2011-04-15 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Create tests for network panel timing, size and raw headers text + https://bugs.webkit.org/show_bug.cgi?id=58566 + + Added network timing, size and raw headers tests for Inspector + Since chromium used different version of network stack for layout + tests, these are interactive ui tests (DevToolsSanityTest.TestNetwork*) + + * src/js/Tests.js: + (.TestSuite.prototype.testNetworkSize.finishResource): + (.TestSuite.prototype.testNetworkSyncSize.finishResource): + (.TestSuite.prototype.testNetworkRawHeadersText.finishResource): + (.TestSuite.prototype.testNetworkTiming.finishResource): + +2011-04-14 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Enable raw HTTP headers support + https://bugs.webkit.org/show_bug.cgi?id=58259 + + Added raw headers text support to inspector. + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::rawRequestHeadersText): + (WebKit::WebHTTPLoadInfo::setRawRequestHeadersText): + (WebKit::WebHTTPLoadInfo::rawResponseHeadersText): + (WebKit::WebHTTPLoadInfo::setRawResponseHeadersText): + +2011-04-14 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: ResourceResponse should have encodedDataLength field for synchronous requests transfer size + https://bugs.webkit.org/show_bug.cgi?id=58447 + + FrameLoader now takes encoded data length for synchronous requests from the field with the same name. + + * public/WebHTTPLoadInfo.h: + * src/WebHTTPLoadInfo.cpp: + (WebKit::WebHTTPLoadInfo::encodedDataLength): + (WebKit::WebHTTPLoadInfo::setEncodedDataLength): + +2011-04-14 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Remove dependency on chromium skia::PlatformCanvas + https://bugs.webkit.org/show_bug.cgi?id=57563 + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-14 Brian Salomon <bsalomon@google.com> + + Reviewed by Kenneth Russell. + + In skia platform call SkBitmap::notifyPixelsChanged on WebGL readback + https://bugs.webkit.org/show_bug.cgi?id=58543 + + No new tests. Tested by fast/canvas/webgl/canvas-test.html + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + +2011-04-14 Adrienne Walker <enne@google.com> + + Reviewed by James Robinson. + + [chromium] TilingData should return 1 tile if tile size is texture size. + https://bugs.webkit.org/show_bug.cgi?id=58364 + + Update test to properly handle this case. + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2011-04-14 Bill Budge <bbudge@chromium.org> + + Reviewed by Darin Fisher. + + Make WebURLLoaderOptions disallow cross origin requests by default. + https://bugs.webkit.org/show_bug.cgi?id=58475 + + No new tests. Exposes no new functionality. + + * public/WebURLLoaderOptions.h: + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + +2011-04-13 James Robinson <jamesr@chromium.org> + + Reviewed by Simon Fraser. + + Allow setting composited backing stores for scrollbars and scroll corners + https://bugs.webkit.org/show_bug.cgi?id=57202 + + Remove a lot of scrollbar hacks from the chromium compositor implementation now that + scrollbars go to real layers. + + * src/WebScrollbarImpl.cpp: + (WebKit::WebScrollbarImpl::invalidateScrollCornerRect): + (WebKit::WebScrollbarImpl::scrollCornerPresent): + * src/WebScrollbarImpl.h: + (WebKit::WebScrollbarImpl::scrollCornerRect): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::reallocateRenderer): + +2011-04-13 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Jian Li. + + [chromium] Remove unnecessary #define now that chrome has rolled to the latest WebKit + https://bugs.webkit.org/show_bug.cgi?id=58474 + + * DEPS: + * public/WebSpellCheckClient.h: + +2011-04-13 Zhenyao Mo <zmo@google.com> + + Reviewed by Kenneth Russell. + + Extension3D needs to provide a way to check if an extension is enabled + https://bugs.webkit.org/show_bug.cgi?id=58410 + + Implement isEnabled() in chromium port. + + * src/Extensions3DChromium.cpp: + (WebCore::Extensions3DChromium::isEnabled): + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::isExtensionEnabled): + * src/GraphicsContext3DInternal.h: + +2011-04-13 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Add mock implementation and plumbing code for unified Quota API + https://bugs.webkit.org/show_bug.cgi?id=57927 + + Added plumbing code for the quota API, that is based on the + discussion on public-webapps: + http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html + + * WebKit.gyp: Added new file entries. + * src/StorageInfoChromium.cpp: Added. + * src/WebStorageQuotaCallbacksImpl.cpp: Added. An implementation of + WebStorageQuotaCallbacks. + * src/WebStorageQuotaCallbacksImpl.h: Added. + +2011-04-12 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Chromium: Set ENABLE_LEVELDB=1 and add leveldb and snappy to DEPS + https://bugs.webkit.org/show_bug.cgi?id=58343 + + Set ENABLE_LEVELDB=1 so that code gets compiled by the EWS bots. + Add the necessary dependencies to the DEPS file. + + * DEPS: + * features.gypi: + +2011-04-12 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Add WebSettings::setValidationMessageTimerMagnification() + https://bugs.webkit.org/show_bug.cgi?id=57426 + + * public/WebSettings.h: Declare new function. + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setValidationMessageTimerMagnification): + Passing the specified value to WebCore::Settings. + * src/WebSettingsImpl.h: Declare new function. + +2011-04-12 Antoine Labour <piman@chromium.org> + + Reviewed by Kenneth Russell. + + Allow WebView users to recreate dependent contexts after a context lost + event. Similarly to the startup case, a temporary context gets created, + that gets used by the layer renderer once it itself gets recreated. + https://bugs.webkit.org/show_bug.cgi?id=58385 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::reallocateRenderer): use the temporary context to + recreate the layer renderer if it's valid. + (WebKit::WebViewImpl::graphicsContext3D): create a temporary context if + the layer renderer's context is lost. + +2011-04-12 Adrienne Walker <enne@google.com> + + Reviewed by James Robinson. + + [chromium] TilingData mishandles very small texture sizes + https://bugs.webkit.org/show_bug.cgi?id=58364 + + Update test to properly handle texture sizes of 0-3. + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2011-04-12 Jian Li <jianli@chromium.org> + + Unreviewed, rolling out r83649. + http://trac.webkit.org/changeset/83649 + https://bugs.webkit.org/show_bug.cgi?id=57563 + + This patch causes compiling errors for chromium + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-12 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Jian Li. + + [chromium] Fix spellcheck regression in context menus + https://bugs.webkit.org/show_bug.cgi?id=58386 + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + +2011-04-12 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Tony Chang. + + [chromium] Use new dragTargetDragEnter() function signature + https://bugs.webkit.org/show_bug.cgi?id=58303 + + After WebKit/chromium/DEPS rolls to chromium r80907, the drag identity + based version of dragTargetDragEnter() is no longer used; remove it. + + * public/WebView.h: + * src/WebViewImpl.cpp: + * src/WebViewImpl.h: + +2011-04-12 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Remove dependency on chromium skia::PlatformCanvas + https://bugs.webkit.org/show_bug.cgi?id=57563 + + * public/WebCanvas.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::printPage): + * tests/TransparencyWinTest.cpp: + (WebCore::drawNativeRect): + (WebCore::getPixelAt): + (WebCore::clearTopLayerAlphaChannel): + (WebCore::clearTopLayerAlphaPixel): + (WebCore::TEST): + +2011-04-12 Adam Barth <abarth@webkit.org> + + Revert unintentional changes to WebKit. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + * src/WebSettingsImpl.h: + +2011-04-11 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Darin Fisher. + + [chromium]: Get the list of misspelled words in the WebKit code insetad of in chromium's RenderView + https://bugs.webkit.org/show_bug.cgi?id=58260 + + * public/WebContextMenuData.h: + * public/WebSpellCheckClient.h: + (WebKit::WebSpellCheckClient::spellCheck): + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::checkSpellingOfString): + +2011-04-12 Bill Budge <bbudge@chromium.org> + + Reviewed by Darin Fisher. + + Move the WebURLLoaderOptions struct into its own file and rename the CrossOriginRequestPolicy enum to conform to the WebKit coding standard. + https://bugs.webkit.org/show_bug.cgi?id=58287 + + No new tests. No new functionality exposed. + + * WebKit.gyp: + * public/WebURLLoader.h: + * public/WebURLLoaderOptions.h: Added. + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::AssociatedURLLoader): + * src/AssociatedURLLoader.h: + +2011-04-11 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [chromium] script formatting doesn't work when chromium is built with debug_devtools=1. + https://bugs.webkit.org/show_bug.cgi?id=58232 + + * WebKit.gyp: + +2011-04-11 John Bates <jbates@google.com> + + Reviewed by Kenneth Russell. + + chromium support for glSetLatch and glWaitLatch between 3D contexts + https://bugs.webkit.org/show_bug.cgi?id=58003 + + * public/WebGraphicsContext3D.h: + (WebKit::WebGraphicsContext3D::getParentToChildLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::getChildToParentLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::waitLatchCHROMIUM): + (WebKit::WebGraphicsContext3D::setLatchCHROMIUM): + * src/Extensions3DChromium.cpp: + (WebCore::Extensions3DChromium::waitLatchCHROMIUM): + (WebCore::Extensions3DChromium::setLatchCHROMIUM): + * src/GraphicsContext3DChromium.cpp: + * src/GraphicsContext3DInternal.h: + +2011-04-11 Ryosuke Niwa <rniwa@webkit.org> + + Reviewed by Tony Chang. + + [chromium] Crash in WebViewImpl::caretOrSelectionBounds + https://bugs.webkit.org/show_bug.cgi?id=58269 + + The bug was caused by caretOrSelectionBounds's incorrectly assuming + SelectionController::toNormalizedRange to always return a non-null Range. + + Fixed the bug by adding a null pointer check. Also replaced calls to deprecatedNode + by containerNode() and calls to SelectionController::start() and SelectionController::end() + by calls to SelectionController::base() and SelectionController::extent() because + selection extends from base to extent, not from start to end. + + Test: editing/selection/extend-over-file-input-by-drag-crash.html + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::caretOrSelectionBounds): + +2011-04-11 Dimitri Glazkov <dglazkov@chromium.org> + + Reviewed by Eric Carlson. + + Rename MediaControls to MediaControlRootElement. + https://bugs.webkit.org/show_bug.cgi?id=58250 + + Mechanical move using do-webcore-rename. + +2011-04-11 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Dmitry Titov. + + [chromium] Implement image/png support in DataTransferItems + https://bugs.webkit.org/show_bug.cgi?id=58106 + + Add glue for reading image data from clipboard. + + * DEPS: + * src/PlatformBridge.cpp: + (WebCore::PlatformBridge::clipboardReadImage): + +2011-04-05 Hans Wennborg <hans@chromium.org> + + Reviewed by Steve Block. + + IndexedDB: Introduce skeleton for LevelDB backend + https://bugs.webkit.org/show_bug.cgi?id=57827 + + * features.gypi: + Add ENABLE_LEVELDB=0. + * public/WebIDBFactory.h: + (WebKit::WebIDBFactory::open): + Remove pre-roll open() function. + +2011-04-10 Kent Tamura <tkent@chromium.org> + + [Chromium] Fix build errors on "Win Shared Builder (dbg)" + + * WebKit.gyp: Exclude WebFrameTest.cpp for WEBKIT_DLL. + +2011-04-10 Kent Tamura <tkent@chromium.org> + + Unreviewed, rolling out r83353. + http://trac.webkit.org/changeset/83353 + https://bugs.webkit.org/show_bug.cgi?id=58106 + + The new test doesn't pass on all Chromium platforms. + + * DEPS: + * src/PlatformBridge.cpp: + +2011-04-09 Sreeram Ramachandran <sreeram@google.com> + + Reviewed by Ryosuke Niwa. + + Gather data on modal dialogs shown during unload events + https://bugs.webkit.org/show_bug.cgi?id=58115 + + Implementation of the new API to receive notifications of modal dialogs + dispatched during unload events. Count the notifications through a histogram. + + No tests because it's not clear how to test chromium histograms from webkit. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::willRunModalDialogDuringPageDismissal): + * src/ChromeClientImpl.h: + +2011-04-08 Aaron Boodman <aa@chromium.org> + + Reviewed by Dmitry Titov. + + Re-land http://trac.webkit.org/changeset/83007. This works + without changes after https://bugs.webkit.org/show_bug.cgi?id=58110. + + https://bugs.webkit.org/show_bug.cgi?id=58096 + + * WebKit.gyp: + * WebKit.gypi: + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrame::frameForContext): + * tests/WebFrameTest.cpp: + (WebKit::WebFrameTest::WebFrameTest): + (WebKit::WebFrameTest::registerMockedURLLoad): + (WebKit::WebFrameTest::loadFrame): + (WebKit::TEST_F): + +2011-04-08 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Dmitry Titov. + + [chromium] Implement image/png support in DataTransferItems + https://bugs.webkit.org/show_bug.cgi?id=58106 + + Add glue for reading image data from clipboard. + + * DEPS: + * src/PlatformBridge.cpp: + (WebCore::PlatformBridge::clipboardReadImage): + +2011-04-08 Alpha Lam <hclam@chromium.org> + + Unreviewed, rolling out r83335. + http://trac.webkit.org/changeset/83335 + https://bugs.webkit.org/show_bug.cgi?id=53556 + + GTK and QT bots are broken + + * features.gypi: + +2011-04-07 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Setup ENABLE(TRACK) feature define + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * features.gypi: + +2011-04-08 Dmitry Titov <dimich@chromium.org> + + Reviewed by Adam Barth. + + [Chromium] Remove unneeded usage of V8::Lockers in IDB tests. + https://bugs.webkit.org/show_bug.cgi?id=58110 + Since they are simple one-thread tests. + This code parallels the code in Chromium's idb bindings that uses v8 Lockers in utility process, + which is equally not needed since there is only one thread running v8 in that process. + + * tests/IDBBindingUtilitiesTest.cpp: + +2011-04-07 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: add test for script formatter worker. + https://bugs.webkit.org/show_bug.cgi?id=57447 + + * WebKit.gyp: + +2011-04-08 Kent Tamura <tkent@chromium.org> + + [Chromium] The second attempt of fixing for Windows (dbg)(shared) build. + + * WebKit.gyp: webkit should not depend on webkit_support. + +2011-04-08 Kent Tamura <tkent@chromium.org> + + [Chromium] Build fix for Windows (dbg)(shared). + + * WebKit.gyp: Add webkit_support dependency, which is required for webkit_unittest_files. + +2011-04-07 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Add WebKit API to query and request unified offline-storage quota + https://bugs.webkit.org/show_bug.cgi?id=57849 + Just adding the API, this does not do anything yet. + + The API is based on the public discussion for unified quota API: + http://lists.w3.org/Archives/Public/public-webapps/2011JanMar/0346.html + (The detail is not yet fully specified and might be subject to change.) + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::queryStorageUsageAndQuota): Added. + (WebKit::WebFrameClient::requestStorageQuota): Added. + * public/WebStorageQuotaCallbacks.h: Added. + (WebKit::WebStorageQuotaCallbacks::~WebStorageQuotaCallbacks): + * public/WebStorageQuotaType.h: Added. + +2011-04-07 Dominic Cooney <dominicc@google.com> + + Reviewed by Dimitri Glazkov. + + Let shadow DOM have a list of nodes at the top level of a shadow. + https://bugs.webkit.org/show_bug.cgi?id=57813 + + * src/WebElement.cpp: + (WebKit::WebElement::shadowRoot): shadow roots are ContainerNodes now + +2011-04-07 Magnus Danielsson <public@fuzzac.com> + + Reviewed by Darin Fisher. + + [chromium] WebPageSerializerImpl doesn't serialize sub-frames correctly + https://bugs.webkit.org/show_bug.cgi?id=53897 + + When serializing a web page using 'save page as', sub-frames and resources gets + saved in a sub-directory. However, frame elements didn't get updated to reference + these saved sub-frames, but were still referencing the original url. So when opening + a saved web page, any sub-frames would get pulled in from the original url rather than + what was saved. + + In addition to this, sub-frames in the sub-directory erroneously had the name of the + sub-directory prepended to the path of resources located in the same sub-directory. + + * src/WebPageSerializerImpl.cpp: + (WebKit::WebPageSerializerImpl::openTagToStrne: Fixed resource paths in sub-frames. + Also made sure sub-frames are referenced correctly from parent frame. + (WebKit::WebPageSerializerImpl::endTagToString): Removed constness from argument. + (WebKit::WebPageSerializerImpl::buildContentForNode): Ditto. + * src/WebPageSerializerImpl.h: + +2011-04-07 Nat Duca <nduca@chromium.org> + + Reviewed by David Levin. + + [chromium] Compositor thread infrastructure + https://bugs.webkit.org/show_bug.cgi?id=56131 + + Tests for chrome compositor thread and related infrastructure. + + * WebKit.gyp: + * WebKit.gypi: + * tests/CCThreadTaskTest.cpp: Added. + (WebCore::TEST): + * tests/CCThreadTest.cpp: Added. + (WebCore::TEST): + (WebCore::PingPongUsingCondition::ping): + (WebCore::PingPongTestUsingTasks::ping): + (WebCore::PingPongTestUsingTasks::pong): + * tests/RunAllTests.cpp: + (main): + +2011-04-07 Andrew Scherkus <scherkus@chromium.org> + + Revert ENABLE_TRACK patch due to compile failures. + + * features.gypi: + +2011-04-07 Pavel Feldman <pfeldman@google.com> + + Not reviewed: rolling chromium DEPS 80421:80767. + + * DEPS: + +2011-04-07 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Rename didReceiveData2 to didReceiveData as part of enabling transfer size support. + https://bugs.webkit.org/show_bug.cgi?id=58036 + + Renamed didReceiveData2 to didReceiveData. + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + +2011-04-07 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] Migrate didReceiveData in upstream for plugins as part of enabling transfer size support. + https://bugs.webkit.org/show_bug.cgi?id=58034 + + Migrated didReceiveData to support new lengthReceived parameter. + + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + +2011-04-06 Asanka Herath <asanka@chromium.org> + + Reviewed by Darin Fisher. + + Add new TargetType: TargetIsFavicon + + https://bugs.webkit.org/show_bug.cgi?id=57659 + + * public/WebURLRequest.h: + +2011-04-06 Alok Priyadarshi <alokp@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] Add settings API to enable accelerated drawing + https://bugs.webkit.org/show_bug.cgi?id=57863 + + If accelerated drawing is enabled we try to render content and + root layers using GPU. Please note that this setting is ignored if + accelerated compositing is disabled. + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAcceleratedDrawingEnabled): + * src/WebSettingsImpl.h: + +2011-04-05 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by David Levin. + + Added MediaTypeFile enum value to WebContextMenuData::MediaType. + https://bugs.webkit.org/show_bug.cgi?id=57566 + + * public/WebContextMenuData.h: + +2011-04-05 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r83007. + http://trac.webkit.org/changeset/83007 + https://bugs.webkit.org/show_bug.cgi?id=57920 + + Broke WebFrameTest.FrameForEnteredContext on Chromium-win and + Chromium-mac (Requested by tkent on #webkit). + + * WebKit.gyp: + * WebKit.gypi: + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + * tests/WebFrameTest.cpp: + (WebKit::WebFrameTest::WebFrameTest): + (WebKit::WebFrameTest::registerMockedURLLoad): + (WebKit::WebFrameTest::serveRequests): + (WebKit::TEST_F): + +2011-04-05 James Kozianski <koz@chromium.org> + + Unreviewed, rolling out r82976. + http://trac.webkit.org/changeset/82976 + https://bugs.webkit.org/show_bug.cgi?id=57566 + + Breaks chromium canary build + + * public/WebContextMenuData.h: + +2011-04-05 Aaron Boodman <aa@chromium.org> + + Reviewed by Adam Barth. + + Add ability to get frame from v8 context to chromium WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57516 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrame::frameForV8Context): + +2011-04-05 Nico Weber <thakis@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Don't have 'using namespace' declarations in header files + https://bugs.webkit.org/show_bug.cgi?id=57882 + + * src/EventListenerWrapper.cpp: + * src/EventListenerWrapper.h: + * src/VideoFrameChromiumImpl.h: + * src/WebDOMEventListener.cpp: + * src/WebDOMEventListenerPrivate.cpp: + * src/WebDOMEventListenerPrivate.h: + (WebKit::WebDOMEventListenerPrivate::ListenerInfo::ListenerInfo): + +2011-04-05 Zelidrag Hornung <zelidrag@chromium.org> + + Reviewed by David Levin. + + Added MediaTypeFile enum value to WebContextMenuData::MediaType. + https://bugs.webkit.org/show_bug.cgi?id=57566 + + * public/WebContextMenuData.h: + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + Followed the signature change. + + * src/EditorClientImpl.h: + * src/EditorClientImpl.cpp: + * src/WebTextCheckingCompletionImpl.cpp + +2011-04-05 Hans Wennborg <hans@chromium.org> + + Reviewed by Adam Barth + + Clean up IndexedDB WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57507 + + Rename the backend proxy files that didn't have Backend in their name. + Everything in WebKit should be in the WebKit namespace. + Put everything behind the feature flag so we're consistient. + Put the feature flag #if above includes. + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebKit::IDBCallbacksProxy::create): + (WebKit::IDBCallbacksProxy::IDBCallbacksProxy): + (WebKit::IDBCallbacksProxy::onError): + (WebKit::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebKit::IDBCursorBackendProxy::create): + (WebKit::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseBackendProxy.cpp: + (WebKit::IDBDatabaseBackendProxy::create): + (WebKit::IDBDatabaseBackendProxy::IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::name): + (WebKit::IDBDatabaseBackendProxy::version): + (WebKit::IDBDatabaseBackendProxy::objectStoreNames): + (WebKit::IDBDatabaseBackendProxy::createObjectStore): + (WebKit::IDBDatabaseBackendProxy::deleteObjectStore): + (WebKit::IDBDatabaseBackendProxy::setVersion): + (WebKit::IDBDatabaseBackendProxy::transaction): + (WebKit::IDBDatabaseBackendProxy::close): + (WebKit::IDBDatabaseBackendProxy::open): + * src/IDBDatabaseCallbacksProxy.cpp: + (WebKit::IDBDatabaseCallbacksProxy::create): + (WebKit::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBFactoryBackendProxy.cpp: + (WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebKit::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebKit::IDBIndexBackendProxy::create): + (WebKit::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::create): + (WebKit::IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::name): + (WebKit::IDBObjectStoreBackendProxy::keyPath): + (WebKit::IDBObjectStoreBackendProxy::indexNames): + (WebKit::IDBObjectStoreBackendProxy::get): + (WebKit::IDBObjectStoreBackendProxy::put): + (WebKit::IDBObjectStoreBackendProxy::deleteFunction): + (WebKit::IDBObjectStoreBackendProxy::clear): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + (WebKit::IDBObjectStoreBackendProxy::openCursor): + * src/IDBObjectStoreBackendProxy.h: Added. + * src/IDBObjectStoreProxy.h: Removed. + * src/IDBTransactionBackendProxy.cpp: + (WebKit::IDBTransactionBackendProxy::create): + (WebKit::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebKit::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebKit::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebKit::IDBTransactionCallbacksProxy::create): + (WebKit::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebKit::WebIDBCallbacksImpl::onError): + (WebKit::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-04-05 Sailesh Agrawal <sail@chromium.org> + + Reviewed by Darin Fisher. + + Don't clear existing files if the user cancels the file chooser dialog. + https://bugs.webkit.org/show_bug.cgi?id=55200 + + * src/WebFileChooserCompletionImpl.cpp: + (WebKit::WebFileChooserCompletionImpl::didChooseFile): + +2011-04-05 John Mellor <johnme@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Minor cleanup: simplify WebFrameImpl by using contentsToWindow instead of convertToContainingWindow. + https://bugs.webkit.org/show_bug.cgi?id=55681 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::find): + (WebKit::WebFrameImpl::scopeStringMatches): + +2011-04-05 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPS. + + * DEPS: Rolled! + +2011-04-04 Chang Shu <cshu@webkit.org> + + Reviewed by Ryosuke Niwa. + + setContentEditable with true/false/inherit string is not working properly + https://bugs.webkit.org/show_bug.cgi?id=52058 + + Move isContentEditable from HTMLElement to Node. WebKit should only access isContentEditable + as rendererIsEditable is for WebCore internal use. + + * src/WebNode.cpp: + (WebKit::WebNode::isContentEditable): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setFocus): + (WebKit::WebViewImpl::setComposition): + (WebKit::WebViewImpl::confirmComposition): + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * src/WebViewImpl.cpp: (WebKit::WebViewImpl::keyEvent): Moved Caps Lock handling from + WebKits to WebCore, because WebKit shouldn't be smart. + +2011-04-01 Adam Barth <abarth@webkit.org> + + Attempt to fix the Chromium build using the great and powerful git. + This patch should be the remaining part of reverting Jeremy's ill-fated + refactoring. + + * src/IDBDatabaseProxy.cpp: + (WebCore::IDBDatabaseProxy::create): + (WebCore::IDBDatabaseProxy::IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::name): + (WebCore::IDBDatabaseProxy::version): + (WebCore::IDBDatabaseProxy::objectStoreNames): + (WebCore::IDBDatabaseProxy::createObjectStore): + (WebCore::IDBDatabaseProxy::deleteObjectStore): + (WebCore::IDBDatabaseProxy::setVersion): + (WebCore::IDBDatabaseProxy::transaction): + (WebCore::IDBDatabaseProxy::close): + (WebCore::IDBDatabaseProxy::open): + * src/IDBDatabaseProxy.h: + * src/IDBObjectStoreProxy.cpp: + (WebCore::IDBObjectStoreProxy::create): + (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::name): + (WebCore::IDBObjectStoreProxy::keyPath): + (WebCore::IDBObjectStoreProxy::indexNames): + (WebCore::IDBObjectStoreProxy::get): + (WebCore::IDBObjectStoreProxy::put): + (WebCore::IDBObjectStoreProxy::deleteFunction): + (WebCore::IDBObjectStoreProxy::clear): + (WebCore::IDBObjectStoreProxy::createIndex): + (WebCore::IDBObjectStoreProxy::index): + (WebCore::IDBObjectStoreProxy::deleteIndex): + (WebCore::IDBObjectStoreProxy::openCursor): + +2011-04-01 Adam Barth <abarth@webkit.org> + + Move these files back to their old locations. I'm not sure why the + rollout didn't move them properly. + + * src/IDBDatabaseBackendProxy.cpp: Removed. + * src/IDBDatabaseBackendProxy.h: Removed. + * src/IDBDatabaseProxy.cpp: Copied from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp. + * src/IDBDatabaseProxy.h: Copied from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h. + * src/IDBObjectStoreBackendProxy.cpp: Removed. + * src/IDBObjectStoreProxy.cpp: Copied from Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp. + +2011-04-01 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r82738. + http://trac.webkit.org/changeset/82738 + https://bugs.webkit.org/show_bug.cgi?id=57684 + + Broke storage/indexeddb/objectstore-autoincrement.html and + InjectIDBKey (Requested by abarth|gardening on #webkit). + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebCore::IDBCallbacksProxy::create): + (WebCore::IDBCallbacksProxy::IDBCallbacksProxy): + (WebCore::IDBCallbacksProxy::onError): + (WebCore::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebCore::IDBCursorBackendProxy::create): + (WebCore::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseCallbacksProxy.cpp: + (WebCore::IDBDatabaseCallbacksProxy::create): + (WebCore::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBDatabaseProxy.cpp: Renamed from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp. + (WebCore::IDBDatabaseProxy::create): + (WebCore::IDBDatabaseProxy::IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::~IDBDatabaseProxy): + (WebCore::IDBDatabaseProxy::name): + (WebCore::IDBDatabaseProxy::version): + (WebCore::IDBDatabaseProxy::objectStoreNames): + (WebCore::IDBDatabaseProxy::createObjectStore): + (WebCore::IDBDatabaseProxy::deleteObjectStore): + (WebCore::IDBDatabaseProxy::setVersion): + (WebCore::IDBDatabaseProxy::transaction): + (WebCore::IDBDatabaseProxy::close): + (WebCore::IDBDatabaseProxy::open): + * src/IDBDatabaseProxy.h: Renamed from Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h. + * src/IDBFactoryBackendProxy.cpp: + (WebCore::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebCore::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebCore::IDBIndexBackendProxy::create): + (WebCore::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.h: Removed. + * src/IDBObjectStoreProxy.cpp: Renamed from Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp. + (WebCore::IDBObjectStoreProxy::create): + (WebCore::IDBObjectStoreProxy::IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::~IDBObjectStoreProxy): + (WebCore::IDBObjectStoreProxy::name): + (WebCore::IDBObjectStoreProxy::keyPath): + (WebCore::IDBObjectStoreProxy::indexNames): + (WebCore::IDBObjectStoreProxy::get): + (WebCore::IDBObjectStoreProxy::put): + (WebCore::IDBObjectStoreProxy::deleteFunction): + (WebCore::IDBObjectStoreProxy::clear): + (WebCore::IDBObjectStoreProxy::createIndex): + (WebCore::IDBObjectStoreProxy::index): + (WebCore::IDBObjectStoreProxy::deleteIndex): + (WebCore::IDBObjectStoreProxy::openCursor): + * src/IDBObjectStoreProxy.h: Added. + * src/IDBTransactionBackendProxy.cpp: + (WebCore::IDBTransactionBackendProxy::create): + (WebCore::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebCore::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebCore::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebCore::IDBTransactionCallbacksProxy::create): + (WebCore::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebCore::WebIDBCallbacksImpl::onError): + (WebCore::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebCore::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-03-30 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Nate Chapin. + + Clean up IndexedDB WebKit API + https://bugs.webkit.org/show_bug.cgi?id=57507 + + Rename the backend proxy files that didn't have Backend in their name. + Everything in WebKit should be in the WebKit namespace. + Put everything behind the feature flag so we're consistient. + Put the feature flag #if above includes. + + * WebKit.gyp: + * src/IDBCallbacksProxy.cpp: + (WebKit::IDBCallbacksProxy::create): + (WebKit::IDBCallbacksProxy::IDBCallbacksProxy): + (WebKit::IDBCallbacksProxy::onError): + (WebKit::IDBCallbacksProxy::onSuccess): + * src/IDBCallbacksProxy.h: + * src/IDBCursorBackendProxy.cpp: + (WebKit::IDBCursorBackendProxy::create): + (WebKit::IDBCursorBackendProxy::IDBCursorBackendProxy): + * src/IDBCursorBackendProxy.h: + * src/IDBDatabaseBackendProxy.cpp: + (WebKit::IDBDatabaseBackendProxy::create): + (WebKit::IDBDatabaseBackendProxy::IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy): + (WebKit::IDBDatabaseBackendProxy::name): + (WebKit::IDBDatabaseBackendProxy::version): + (WebKit::IDBDatabaseBackendProxy::objectStoreNames): + (WebKit::IDBDatabaseBackendProxy::createObjectStore): + (WebKit::IDBDatabaseBackendProxy::deleteObjectStore): + (WebKit::IDBDatabaseBackendProxy::setVersion): + (WebKit::IDBDatabaseBackendProxy::transaction): + (WebKit::IDBDatabaseBackendProxy::close): + (WebKit::IDBDatabaseBackendProxy::open): + * src/IDBDatabaseCallbacksProxy.cpp: + (WebKit::IDBDatabaseCallbacksProxy::create): + (WebKit::IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy): + * src/IDBDatabaseCallbacksProxy.h: + * src/IDBFactoryBackendProxy.cpp: + (WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy): + (WebKit::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebKit::IDBIndexBackendProxy::create): + (WebKit::IDBIndexBackendProxy::IDBIndexBackendProxy): + * src/IDBIndexBackendProxy.h: + * src/IDBObjectStoreBackendProxy.cpp: + (WebKit::IDBObjectStoreBackendProxy::create): + (WebKit::IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy): + (WebKit::IDBObjectStoreBackendProxy::name): + (WebKit::IDBObjectStoreBackendProxy::keyPath): + (WebKit::IDBObjectStoreBackendProxy::indexNames): + (WebKit::IDBObjectStoreBackendProxy::get): + (WebKit::IDBObjectStoreBackendProxy::put): + (WebKit::IDBObjectStoreBackendProxy::deleteFunction): + (WebKit::IDBObjectStoreBackendProxy::clear): + (WebKit::IDBObjectStoreBackendProxy::createIndex): + (WebKit::IDBObjectStoreBackendProxy::index): + (WebKit::IDBObjectStoreBackendProxy::deleteIndex): + (WebKit::IDBObjectStoreBackendProxy::openCursor): + * src/IDBObjectStoreBackendProxy.h: Added. + * src/IDBObjectStoreProxy.h: Removed. + * src/IDBTransactionBackendProxy.cpp: + (WebKit::IDBTransactionBackendProxy::create): + (WebKit::IDBTransactionBackendProxy::IDBTransactionBackendProxy): + (WebKit::IDBTransactionBackendProxy::objectStore): + * src/IDBTransactionBackendProxy.h: + (WebKit::IDBTransactionBackendProxy::getWebIDBTransaction): + * src/IDBTransactionCallbacksProxy.cpp: + (WebKit::IDBTransactionCallbacksProxy::create): + (WebKit::IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy): + * src/IDBTransactionCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + (WebKit::WebIDBCallbacksImpl::onError): + (WebKit::WebIDBCallbacksImpl::onSuccess): + * src/WebIDBCallbacksImpl.h: + * src/WebIDBCursorImpl.cpp: + * src/WebIDBCursorImpl.h: + * src/WebIDBDatabaseCallbacksImpl.cpp: + (WebKit::WebIDBDatabaseCallbacksImpl::onVersionChange): + * src/WebIDBDatabaseCallbacksImpl.h: + * src/WebIDBDatabaseError.cpp: + * src/WebIDBDatabaseImpl.cpp: + * src/WebIDBDatabaseImpl.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): + * src/WebIDBFactoryImpl.h: + * src/WebIDBIndexImpl.cpp: + * src/WebIDBIndexImpl.h: + * src/WebIDBKey.cpp: + (WebKit::WebIDBKey::createFromValueAndKeyPath): + (WebKit::WebIDBKey::injectIDBKeyIntoSerializedValue): + * src/WebIDBKeyPath.cpp: + (WebKit::WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&): + * src/WebIDBKeyRange.cpp: + * src/WebIDBObjectStoreImpl.cpp: + * src/WebIDBObjectStoreImpl.h: + * src/WebIDBTransactionCallbacksImpl.cpp: + * src/WebIDBTransactionCallbacksImpl.h: + * src/WebIDBTransactionImpl.cpp: + * src/WebIDBTransactionImpl.h: + +2011-03-30 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [chromium] script formatting doesn't work when all scripts are concatenated. + https://bugs.webkit.org/show_bug.cgi?id=57446 + + * WebKit.gyp: + * scripts/inline_js_imports.py: Added. + +2011-03-31 Victoria Kirst <vrk@google.com> + + Reviewed by Eric Carlson. + + [chromium] Implement preload=none, setPreload hooks to media player + https://bugs.webkit.org/show_bug.cgi?id=56983 + + This patch implements preload=none in Chromium. It also replaces + the now-deprecated setAutobuffer method with setPreload. + + * public/WebMediaPlayer.h: + (WebKit::WebMediaPlayer::setPreload): + * public/WebMediaPlayerClient.h: + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::preload): + (WebKit::WebMediaPlayerClientImpl::load): + (WebKit::WebMediaPlayerClientImpl::loadInternal): + (WebKit::WebMediaPlayerClientImpl::prepareToPlay): + (WebKit::WebMediaPlayerClientImpl::setPreload): + (WebKit::WebMediaPlayerClientImpl::startDelayedLoad): + (WebKit::WebMediaPlayerClientImpl::WebMediaPlayerClientImpl): + * src/WebMediaPlayerClientImpl.h: + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::dispatchDidReceiveTitle): + (WebKit::FrameLoaderClientImpl::setTitle): + * src/FrameLoaderClientImpl.h: + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::pageTitle): + +2011-03-30 David Levin <levin@chromium.org> + + Reviewed by Dmitry Titov. + + UnlockNonLocked condition reached in WorkerFileSystemsCallbackBridge::mayPostTaskToWorker + https://bugs.webkit.org/show_bug.cgi?id=57382 + + There were two issues to address: + 1. The use of a non-thread safe class (RefPtr) in a ThreadSafeRefCounted class. + The problem was that this RefPtr could be changed on either thread. + 2. Keeping WorkerFileSystemCallbacksBridge alive for while it was being used + including while its mutex was in use. + + * src/WorkerFileSystemCallbacksBridge.cpp: + (WebKit::WorkerFileSystemCallbacksBridge::runTaskOnMainThread): + Changed to take a PassRefPtr and leak the ref count as opposed to relying on + dispatchTaskToMainThread to store the pointer in m_selfRef. + (WebKit::WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread): Remove the + m_selfRef and hand off a PassRefPtr instead. + (WebKit::WorkerFileSystemCallbacksBridge::mayPostTaskToWorker): Balance out the leaked ref + and ensure that WorkerFileSystemCallbacksBridge stays alive while the mutex is held. + * src/WorkerFileSystemCallbacksBridge.h: Removed m_selfRef and derefIfWorkerIsStopped which + was simply due to m_selfRef. + 2011-03-29 John Abd-El-Malek <jam@chromium.org> Reviewed by Tony Chang. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 3ab2e78..c0e5a6c 100644 --- a/Source/WebKit/chromium/DEPS +++ b/Source/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '79759' + 'chromium_rev': '81564' } deps = { @@ -123,6 +123,10 @@ deps = { From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'), 'third_party/libjpeg_turbo': From('chromium_deps', 'src/third_party/libjpeg_turbo'), + 'third_party/leveldb': + From('chromium_deps', 'src/third_party/leveldb'), + 'third_party/snappy/src': + From('chromium_deps', 'src/third_party/snappy/src'), 'third_party': Var('chromium_svn')+'/third_party@'+Var('chromium_rev'), } diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index d47248e..0ee5dd6 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -266,6 +266,8 @@ 'public/WebSpeechInputResult.h', 'public/WebStorageArea.h', 'public/WebStorageEventDispatcher.h', + 'public/WebStorageQuotaCallbacks.h', + 'public/WebStorageQuotaType.h', 'public/WebStorageNamespace.h', 'public/WebString.h', 'public/WebTextAffinity.h', @@ -279,6 +281,7 @@ 'public/WebURL.h', 'public/WebURLError.h', 'public/WebURLLoader.h', + 'public/WebURLLoaderOptions.h', 'public/WebURLLoadTiming.h', 'public/WebURLLoaderClient.h', 'public/WebURLRequest.h', @@ -359,14 +362,14 @@ 'src/IDBCursorBackendProxy.h', 'src/IDBDatabaseCallbacksProxy.cpp', 'src/IDBDatabaseCallbacksProxy.h', - 'src/IDBDatabaseProxy.cpp', - 'src/IDBDatabaseProxy.h', + 'src/IDBDatabaseBackendProxy.cpp', + 'src/IDBDatabaseBackendProxy.h', 'src/IDBFactoryBackendProxy.cpp', 'src/IDBFactoryBackendProxy.h', 'src/IDBIndexBackendProxy.cpp', 'src/IDBIndexBackendProxy.h', - 'src/IDBObjectStoreProxy.cpp', - 'src/IDBObjectStoreProxy.h', + 'src/IDBObjectStoreBackendProxy.cpp', + 'src/IDBObjectStoreBackendProxy.h', 'src/IDBTransactionBackendProxy.cpp', 'src/IDBTransactionBackendProxy.h', 'src/IDBTransactionCallbacksProxy.cpp', @@ -400,6 +403,7 @@ 'src/StorageEventDispatcherChromium.cpp', 'src/StorageEventDispatcherImpl.cpp', 'src/StorageEventDispatcherImpl.h', + 'src/StorageInfoChromium.cpp', 'src/StorageNamespaceProxy.cpp', 'src/StorageNamespaceProxy.h', 'src/TemporaryGlue.h', @@ -552,6 +556,8 @@ 'src/WebStorageEventDispatcherImpl.h', 'src/WebStorageNamespaceImpl.cpp', 'src/WebStorageNamespaceImpl.h', + 'src/WebStorageQuotaCallbacksImpl.cpp', + 'src/WebStorageQuotaCallbacksImpl.h', 'src/WebString.cpp', 'src/WebTextRun.cpp', 'src/WebThreadSafeData.cpp', @@ -597,6 +603,7 @@ '<(chromium_src_dir)/base/base.gyp:test_support_base', '<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl', '<(chromium_src_dir)/testing/gtest.gyp:gtest', + '<(chromium_src_dir)/testing/gmock.gyp:gmock', '<(chromium_src_dir)/third_party/icu/icu.gyp:*', '<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg', '<(chromium_src_dir)/third_party/libpng/libpng.gyp:libpng', @@ -607,6 +614,7 @@ '<(chromium_src_dir)/third_party/ots/ots.gyp:ots', '<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib', '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', + # We must not add webkit_support here because of cyclic dependency. ], 'direct_dependent_settings': { 'defines': [ @@ -623,6 +631,13 @@ 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', 'tests/WebUnitTests.cpp' + ], + 'sources!' : [ + # We should not include files dpending on webkit_support. + 'tests/CCThreadTest.cpp', + # WebFrameTest.cpp depends on webkit_support and + # functions defined only in !WEBKIT_IMPLEMENTATION. + 'tests/WebFrameTest.cpp', ] }], ], @@ -695,6 +710,7 @@ 'conditions': [ ['debug_devtools==0', { 'dependencies': ['concatenated_devtools_js', + 'concatenated_script_formatter_worker_js', 'concatenated_devtools_css'], }], ], @@ -713,6 +729,17 @@ ], }, { + 'destination': '<(PRODUCT_DIR)/resources/inspector/UglifyJS', + 'files': [ + '<@(webinspector_uglifyjs_files)', + ], + 'conditions': [ + ['debug_devtools==0', { + 'files/': [['exclude', '\\.(js|css|html)$']], + }], + ], + }, + { 'destination': '<(PRODUCT_DIR)/resources/inspector/Images', 'files': [ '<@(webinspector_image_files)', @@ -747,6 +774,7 @@ 'conditions': [ ['debug_devtools==0', { 'dependencies': ['concatenated_devtools_js', + 'concatenated_script_formatter_worker_js', 'concatenated_devtools_css'], },{ # If we're not concatenating devtools files, we want to @@ -761,6 +789,7 @@ 'input_pages': [ '<(PRODUCT_DIR)/resources/inspector/devtools.html', '<(PRODUCT_DIR)/resources/inspector/DevTools.js', + '<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js', '<(PRODUCT_DIR)/resources/inspector/devTools.css', ], 'images': [ @@ -788,6 +817,7 @@ 'webkit', '../../WebCore/WebCore.gyp/WebCore.gyp:webcore', '<(chromium_src_dir)/testing/gtest.gyp:gtest', + '<(chromium_src_dir)/testing/gmock.gyp:gmock', '<(chromium_src_dir)/base/base.gyp:base', '<(chromium_src_dir)/base/base.gyp:base_i18n', '<(chromium_src_dir)/base/base.gyp:test_support_base', @@ -812,11 +842,10 @@ 'conditions': [ ['OS=="win"', { 'sources': [ - # FIXME: Port PopupMenuTest and WebFrameTest to Linux and Mac. + # FIXME: Port PopupMenuTest to Linux and Mac. 'tests/PopupMenuTest.cpp', 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', - 'tests/WebFrameTest.cpp', 'tests/WebPageSerializerTest.cpp', ], }], @@ -1167,6 +1196,22 @@ }], }, { + 'target_name': 'concatenated_script_formatter_worker_js', + 'type': 'none', + 'actions': [{ + 'action_name': 'concatenate_script_formatter_worker_js', + 'script_name': 'scripts/inline_js_imports.py', + 'input_file': '../../WebCore/inspector/front-end/ScriptFormatterWorker.js', + 'inputs': [ + '<@(_script_name)', + '<@(webinspector_uglifyjs_files)' + ], + 'search_path': '../../WebCore/inspector/front-end', + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/ScriptFormatterWorker.js'], + 'action': ['python', '<@(_script_name)', '<@(_input_file)', '<@(_search_path)', '<@(_outputs)'], + }], + }, + { 'target_name': 'concatenated_devtools_css', 'type': 'none', 'dependencies': [ diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi index 016cf1a..c23c9ed 100644 --- a/Source/WebKit/chromium/WebKit.gypi +++ b/Source/WebKit/chromium/WebKit.gypi @@ -53,6 +53,8 @@ ], 'webkit_unittest_files': [ 'tests/ArenaTestHelpers.h', + 'tests/CCThreadTaskTest.cpp', + 'tests/CCThreadTest.cpp', 'tests/DragImageTest.cpp', 'tests/IDBBindingUtilitiesTest.cpp', 'tests/IDBKeyPathTest.cpp', @@ -64,6 +66,7 @@ 'tests/TilingDataTest.cpp', 'tests/TreeTestHelpers.cpp', 'tests/TreeTestHelpers.h', + 'tests/WebFrameTest.cpp', ], }, } diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index 7354eb8..01f5c78 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -65,6 +65,7 @@ 'ENABLE_INPUT_SPEECH=1', 'ENABLE_JAVASCRIPT_DEBUGGER=1', 'ENABLE_JSC_MULTIPLE_THREADS=0', + 'ENABLE_LEVELDB=1', 'ENABLE_LINK_PREFETCH=1', 'ENABLE_MATHML=0', 'ENABLE_MEDIA_STATISTICS=1', @@ -74,7 +75,9 @@ 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', 'ENABLE_OPENTYPE_SANITIZER=1', 'ENABLE_ORIENTATION_EVENTS=0', + 'ENABLE_PAGE_VISIBILITY_API=0', 'ENABLE_PROGRESS_TAG=1', + 'ENABLE_QUOTA=1', 'ENABLE_REGISTER_PROTOCOL_HANDLER=0', 'ENABLE_REQUEST_ANIMATION_FRAME=1', 'ENABLE_SHARED_WORKERS=1', diff --git a/Source/WebKit/chromium/public/WebCanvas.h b/Source/WebKit/chromium/public/WebCanvas.h index 4675487..4cf729e 100644 --- a/Source/WebKit/chromium/public/WebCanvas.h +++ b/Source/WebKit/chromium/public/WebCanvas.h @@ -34,7 +34,7 @@ #include "WebCommon.h" #if WEBKIT_USING_SKIA -namespace skia { class PlatformCanvas; } +class SkCanvas; #elif WEBKIT_USING_CG struct CGContext; #endif @@ -42,7 +42,7 @@ struct CGContext; namespace WebKit { #if WEBKIT_USING_SKIA -typedef skia::PlatformCanvas WebCanvas; +typedef SkCanvas WebCanvas; #elif WEBKIT_USING_CG typedef struct CGContext WebCanvas; #else diff --git a/Source/WebKit/chromium/public/WebContextMenuData.h b/Source/WebKit/chromium/public/WebContextMenuData.h index 5fad616..5bdd2fe 100644 --- a/Source/WebKit/chromium/public/WebContextMenuData.h +++ b/Source/WebKit/chromium/public/WebContextMenuData.h @@ -39,6 +39,8 @@ #include "WebURL.h" #include "WebVector.h" +#define WEBCONTEXT_MEDIATYPEFILE_DEFINED + namespace WebKit { // This struct is passed to WebViewClient::ShowContextMenu. @@ -52,6 +54,8 @@ struct WebContextMenuData { MediaTypeVideo, // An audio node is selected. MediaTypeAudio, + // A file node is selected. + MediaTypeFile, // A plugin node is selected. MediaTypePlugin, }; @@ -91,7 +95,7 @@ struct WebContextMenuData { MediaCanSave = 0x10, MediaHasAudio = 0x20, MediaHasVideo = 0x40, - MediaControls = 0x80, + MediaControlRootElement = 0x80, MediaCanPrint = 0x100, }; @@ -107,6 +111,9 @@ struct WebContextMenuData { // The editable (possibily) misspelled word. WebString misspelledWord; + // If misspelledWord is not empty, holds suggestions from the dictionary. + WebVector<WebString> dictionarySuggestions; + // Whether context is editable. bool isEditable; diff --git a/Source/WebKit/chromium/public/WebFileSystem.h b/Source/WebKit/chromium/public/WebFileSystem.h index 7198f31..773a1f5 100644 --- a/Source/WebKit/chromium/public/WebFileSystem.h +++ b/Source/WebKit/chromium/public/WebFileSystem.h @@ -40,11 +40,15 @@ class WebFileSystemCallbacks; class WebFileWriter; class WebFileWriterClient; +// FIXME(zelidrag): Remove this define once Chromium side catches up. +#define WEB_FILE_SYSTEM_TYPE_EXTERNAL + class WebFileSystem { public: enum Type { TypeTemporary, TypePersistent, + TypeExternal, }; // Moves a file or directory at |srcPath| to |destPath|. diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h index d5d2ff4..701936f 100644 --- a/Source/WebKit/chromium/public/WebFrame.h +++ b/Source/WebKit/chromium/public/WebFrame.h @@ -32,6 +32,7 @@ #define WebFrame_h #include "WebCanvas.h" +#include "WebFileSystem.h" #include "WebNode.h" #include "WebURL.h" @@ -67,10 +68,12 @@ class WebURLRequest; class WebView; struct WebConsoleMessage; struct WebFindOptions; +struct WebPoint; struct WebRect; struct WebScriptSource; struct WebSize; struct WebURLLoaderOptions; + template <typename T> class WebVector; class WebFrame { @@ -97,6 +100,13 @@ public: WEBKIT_API static WebFrame* frameForEnteredContext(); WEBKIT_API static WebFrame* frameForCurrentContext(); +#if WEBKIT_USING_V8 + // Returns the frame corresponding to the given context. This can return 0 + // if the context is detached from the frame, or if the context doesn't + // correspond to a frame (e.g., workers). + WEBKIT_API static WebFrame* frameForContext(v8::Handle<v8::Context>); +#endif + // Returns the frame inside a given frame or iframe element. Returns 0 if // the given element is not a frame, iframe or if the frame is empty. WEBKIT_API static WebFrame* fromFrameOwnerElement(const WebElement&); @@ -255,9 +265,15 @@ public: virtual v8::Local<v8::Context> mainWorldScriptContext() const = 0; // Creates an instance of file system object. - virtual v8::Handle<v8::Value> createFileSystem(int type, + virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, const WebString& name, const WebString& path) = 0; + // Creates an instance of file or directory entry object. + virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory) = 0; #endif @@ -408,6 +424,8 @@ public: // there is ranged selection. virtual bool selectWordAroundCaret() = 0; + virtual void selectRange(const WebPoint& start, const WebPoint& end) = 0; + // Printing ------------------------------------------------------------ diff --git a/Source/WebKit/chromium/public/WebFrameClient.h b/Source/WebKit/chromium/public/WebFrameClient.h index 2c21ee6..a542c1e 100644 --- a/Source/WebKit/chromium/public/WebFrameClient.h +++ b/Source/WebKit/chromium/public/WebFrameClient.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -35,6 +35,8 @@ #include "WebFileSystem.h" #include "WebNavigationPolicy.h" #include "WebNavigationType.h" +#include "WebStorageQuotaType.h" +#include "WebTextDirection.h" #include "WebURLError.h" namespace WebKit { @@ -51,6 +53,7 @@ class WebNode; class WebPlugin; class WebSecurityOrigin; class WebSharedWorker; +class WebStorageQuotaCallbacks; class WebString; class WebURL; class WebURLRequest; @@ -204,7 +207,12 @@ public: virtual void didCreateDocumentElement(WebFrame*) { } // The page title is available. + // FIXME: remove override once Chrome is updated to new API. virtual void didReceiveTitle(WebFrame*, const WebString& title) { } + virtual void didReceiveTitle(WebFrame* frame, const WebString& title, WebTextDirection direction) + { + didReceiveTitle(frame, title); + } // The icons for the page have changed. virtual void didChangeIcons(WebFrame*) { } @@ -362,6 +370,33 @@ public: WebFrame*, WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*) { } + // Quota --------------------------------------------------------- + + // Queries the origin's storage usage and quota information. + // WebStorageQuotaCallbacks::didQueryStorageUsageAndQuota will be called + // with the current usage and quota information for the origin. When + // an error occurs WebStorageQuotaCallbacks::didFail is called with an + // error code. + // The callbacks object is deleted when the callback method is called + // and does not need to be (and should not be) deleted manually. + virtual void queryStorageUsageAndQuota( + WebFrame*, WebStorageQuotaType, WebStorageQuotaCallbacks*) { } + + // Requests a new quota size for the origin's storage. + // |newQuotaInBytes| indicates how much storage space (in bytes) the + // caller expects to need. + // WebStorageQuotaCallbacks::didGrantStorageQuota will be called when + // a new quota is granted. WebStorageQuotaCallbacks::didFail + // is called with an error code otherwise. + // Note that the requesting quota size may not always be granted and + // a smaller amount of quota than requested might be returned. + // The callbacks object is deleted when the callback method is called + // and does not need to be (and should not be) deleted manually. + virtual void requestStorageQuota( + WebFrame*, WebStorageQuotaType, + unsigned long long newQuotaInBytes, + WebStorageQuotaCallbacks*) { } + protected: ~WebFrameClient() { } }; diff --git a/Source/WebKit/chromium/public/WebGraphicsContext3D.h b/Source/WebKit/chromium/public/WebGraphicsContext3D.h index 984f79d..2d7b0a5 100644 --- a/Source/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/Source/WebKit/chromium/public/WebGraphicsContext3D.h @@ -168,6 +168,12 @@ public: virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0; virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0; + // GL_CHROMIUM_latch + virtual void getParentToChildLatchCHROMIUM(WGC3Duint* latchId) = 0; + virtual void getChildToParentLatchCHROMIUM(WGC3Duint* latchId) = 0; + virtual void waitLatchCHROMIUM(WGC3Duint latchId) = 0; + virtual void setLatchCHROMIUM(WGC3Duint latchId) = 0; + // The entry points below map directly to the OpenGL ES 2.0 API. // See: http://www.khronos.org/registry/gles/ // and: http://www.khronos.org/opengles/sdk/docs/man/ diff --git a/Source/WebKit/chromium/public/WebHTTPLoadInfo.h b/Source/WebKit/chromium/public/WebHTTPLoadInfo.h index 9ff9153..0024878 100644 --- a/Source/WebKit/chromium/public/WebHTTPLoadInfo.h +++ b/Source/WebKit/chromium/public/WebHTTPLoadInfo.h @@ -62,9 +62,18 @@ public: WEBKIT_API WebString httpStatusText() const; WEBKIT_API void setHTTPStatusText(const WebString&); + WEBKIT_API long long encodedDataLength() const; + WEBKIT_API void setEncodedDataLength(long long); + WEBKIT_API void addRequestHeader(const WebString& name, const WebString& value); WEBKIT_API void addResponseHeader(const WebString& name, const WebString& value); + WEBKIT_API WebString requestHeadersText() const; + WEBKIT_API void setRequestHeadersText(const WebString&); + + WEBKIT_API WebString responseHeadersText() const; + WEBKIT_API void setResponseHeadersText(const WebString&); + #if WEBKIT_IMPLEMENTATION WebHTTPLoadInfo(WTF::PassRefPtr<WebCore::ResourceLoadInfo>); operator WTF::PassRefPtr<WebCore::ResourceLoadInfo>() const; diff --git a/Source/WebKit/chromium/public/WebIDBFactory.h b/Source/WebKit/chromium/public/WebIDBFactory.h index 29414e8..97588d5 100755 --- a/Source/WebKit/chromium/public/WebIDBFactory.h +++ b/Source/WebKit/chromium/public/WebIDBFactory.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,11 +57,7 @@ public: }; // The WebKit implementation of open ignores the WebFrame* parameter. - // FIXME: Assert not reached when Chromium side is updated. - virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { open(name, callbacks, origin, frame, dataDir, maximumSize); } - - // FIXME: Remove this when Chromium side is updated. - virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize) { open(name, callbacks, origin, frame, dataDir, maximumSize, DefaultBackingStore); } + virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); } }; diff --git a/Source/WebKit/chromium/public/WebMediaPlayer.h b/Source/WebKit/chromium/public/WebMediaPlayer.h index c0084db..3b2aaaa 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayer.h +++ b/Source/WebKit/chromium/public/WebMediaPlayer.h @@ -79,6 +79,12 @@ public: LiveStream, }; + enum Preload { + None, + MetaData, + Auto, + }; + virtual ~WebMediaPlayer() {} virtual void load(const WebURL&) = 0; @@ -94,7 +100,7 @@ public: virtual void setRate(float) = 0; virtual void setVolume(float) = 0; virtual void setVisible(bool) = 0; - virtual bool setAutoBuffer(bool) = 0; + virtual void setPreload(Preload) { }; virtual bool totalBytesKnown() = 0; virtual const WebTimeRanges& buffered() = 0; virtual float maxTimeSeekable() const = 0; diff --git a/Source/WebKit/chromium/public/WebMediaPlayerClient.h b/Source/WebKit/chromium/public/WebMediaPlayerClient.h index 5f60870..6919717 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayerClient.h +++ b/Source/WebKit/chromium/public/WebMediaPlayerClient.h @@ -31,6 +31,8 @@ #ifndef WebMediaPlayerClient_h #define WebMediaPlayerClient_h +#include "WebMediaPlayer.h" + namespace WebKit { class WebRequest; @@ -50,6 +52,7 @@ public: virtual void sawUnsupportedTracks() = 0; virtual float volume() const = 0; virtual void playbackStateChanged() = 0; + virtual WebMediaPlayer::Preload preload() const = 0; protected: ~WebMediaPlayerClient() { } diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h index dfaae5e..276a166 100644 --- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h @@ -100,6 +100,9 @@ public: WEBKIT_API static void enableJavaScriptI18NAPI(bool); WEBKIT_API static bool isJavaScriptI18NAPIEnabled(); + WEBKIT_API static void enableQuota(bool); + WEBKIT_API static bool isQuotaEnabled(); + private: WebRuntimeFeatures(); }; diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index 113de52..ed4e6ef 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -110,11 +110,13 @@ public: virtual void setAcceleratedCompositingForPluginsEnabled(bool) = 0; virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0; virtual void setAccelerated2dCanvasEnabled(bool) = 0; + virtual void setAcceleratedDrawingEnabled(bool) = 0; virtual void setMemoryInfoEnabled(bool) = 0; virtual void setHyperlinkAuditingEnabled(bool) = 0; virtual void setAsynchronousSpellCheckingEnabled(bool) = 0; virtual void setCaretBrowsingEnabled(bool) = 0; virtual void setInteractiveFormValidationEnabled(bool) = 0; + virtual void setValidationMessageTimerMagnification(int) = 0; virtual void setMinimumTimerInterval(double) = 0; virtual void setFullScreenEnabled(bool) = 0; diff --git a/Source/WebKit/chromium/public/WebSpellCheckClient.h b/Source/WebKit/chromium/public/WebSpellCheckClient.h index 87bdf9e..5190428 100755 --- a/Source/WebKit/chromium/public/WebSpellCheckClient.h +++ b/Source/WebKit/chromium/public/WebSpellCheckClient.h @@ -32,6 +32,7 @@ #define WebSpellCheckClient_h #include "WebString.h" +#include "WebVector.h" namespace WebKit { @@ -44,9 +45,12 @@ public: // text contains a misspelled word, then upon return misspelledOffset // will point to the start of the misspelled word, and misspelledLength // will indicates its length. Otherwise, if there was not a spelling - // error, then upon return misspelledLength is 0. - virtual void spellCheck( - const WebString& text, int& misspelledOffset, int& misspelledLength) { } + // error, then upon return misspelledLength is 0. If optional_suggestions + // is given, then it will be filled with suggested words (not a cheap step). + virtual void spellCheck(const WebString& text, + int& misspelledOffset, + int& misspelledLength, + WebVector<WebString>* optionalSuggestions) { } // Requests asynchronous spelling and grammar checking, whose result should be // returned by passed completion object. virtual void requestCheckingOfText(const WebString&, WebTextCheckingCompletion*) { } diff --git a/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h b/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h new file mode 100644 index 0000000..ee7dc5e --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaCallbacks.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaCallbacks_h +#define WebStorageQuotaCallbacks_h + +#include "WebStorageQuotaError.h" + +namespace WebKit { + +class WebStorageQuotaCallbacks { +public: + // Callback for WebFrameClient::queryStorageUsageAndQuota. + virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) = 0; + + // Callback for WebFrameClient::requestStorageQuota. + // This may return a smaller amount of quota than the requested. + virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes) = 0; + + virtual void didFail(WebStorageQuotaError) = 0; + +protected: + virtual ~WebStorageQuotaCallbacks() { } +}; + +} // namespace WebKit + +#endif // WebStorageQuotaCallbacks_h diff --git a/Source/WebKit/chromium/public/WebStorageQuotaError.h b/Source/WebKit/chromium/public/WebStorageQuotaError.h new file mode 100644 index 0000000..13e5c03 --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaError.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaError_h +#define WebStorageQuotaError_h + +namespace WebKit { + +// The error code used for WebStorageQuota. +enum WebStorageQuotaError { + WebStorageQuotaErrorNotSupported = 9, + WebStorageQuotaErrorAbort = 20, +}; + +} // namespace WebKit + +#endif // WebStorageQuotaError_h diff --git a/Source/WebKit/chromium/public/WebStorageQuotaType.h b/Source/WebKit/chromium/public/WebStorageQuotaType.h new file mode 100644 index 0000000..b18caf8 --- /dev/null +++ b/Source/WebKit/chromium/public/WebStorageQuotaType.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaType_h +#define WebStorageQuotaType_h + +namespace WebKit { + +enum WebStorageQuotaType { + WebStorageQuotaTypeTemporary, + WebStorageQuotaTypePersistent, +}; + +} // namespace WebKit + +#endif // WebStorageQuotaType_h diff --git a/Source/WebKit/chromium/public/WebURLLoader.h b/Source/WebKit/chromium/public/WebURLLoader.h index 38efcb4..a47b986 100644 --- a/Source/WebKit/chromium/public/WebURLLoader.h +++ b/Source/WebKit/chromium/public/WebURLLoader.h @@ -41,21 +41,6 @@ class WebURLRequest; class WebURLResponse; struct WebURLError; -enum WebCrossOriginRequestPolicy { - DenyCrossOriginRequests, - UseAccessControl, - AllowCrossOriginRequests -}; - -struct WebURLLoaderOptions { - WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { } - - bool sniffContent; // Whether to sniff content. - bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. - bool forcePreflight; // If AccessControl is used, whether to force a preflight. - WebCrossOriginRequestPolicy crossOriginRequestPolicy; -}; - class WebURLLoader { public: // The WebURLLoader may be deleted in a call to its client. diff --git a/Source/WebKit/chromium/public/WebURLLoaderClient.h b/Source/WebKit/chromium/public/WebURLLoaderClient.h index e306b19..20a3b44 100644 --- a/Source/WebKit/chromium/public/WebURLLoaderClient.h +++ b/Source/WebKit/chromium/public/WebURLLoaderClient.h @@ -58,11 +58,7 @@ public: virtual void didDownloadData(WebURLLoader*, int dataLength) { } // Called when a chunk of response data is received. - // FIXME(vsevik): rename once original didReceiveData() is removed. - virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) { } - - // FIXME(vsevik): remove once not used downstream - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) { } + virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { } // Called when a chunk of renderer-generated metadata is received from the cache. virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { } diff --git a/Source/WebKit/chromium/public/WebURLLoaderOptions.h b/Source/WebKit/chromium/public/WebURLLoaderOptions.h new file mode 100644 index 0000000..bd10763 --- /dev/null +++ b/Source/WebKit/chromium/public/WebURLLoaderOptions.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2009, 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebURLLoaderOptions_h +#define WebURLLoaderOptions_h + +namespace WebKit { + +struct WebURLLoaderOptions { + + enum CrossOriginRequestPolicy { + CrossOriginRequestPolicyDeny, + CrossOriginRequestPolicyUseAccessControl, + CrossOriginRequestPolicyAllow + }; + + WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(CrossOriginRequestPolicyDeny) { } + + bool sniffContent; // Whether to sniff content. + bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. + bool forcePreflight; // If policy is to use access control, whether to force a preflight for GET, HEAD, and POST requests. + CrossOriginRequestPolicy crossOriginRequestPolicy; +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebURLRequest.h b/Source/WebKit/chromium/public/WebURLRequest.h index 7dd97ca..d88c7b9 100644 --- a/Source/WebKit/chromium/public/WebURLRequest.h +++ b/Source/WebKit/chromium/public/WebURLRequest.h @@ -69,6 +69,7 @@ public: TargetIsWorker = 9, TargetIsSharedWorker = 10, TargetIsPrefetch = 11, + TargetIsFavicon = 12, }; ~WebURLRequest() { reset(); } diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index d32e09c..6b69e7c 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -230,10 +230,6 @@ public: // Callback methods when a drag-and-drop operation is trying to drop // something on the WebView. virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed) = 0; - virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) = 0; diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h index c168ef2..5174351 100644 --- a/Source/WebKit/chromium/public/WebViewClient.h +++ b/Source/WebKit/chromium/public/WebViewClient.h @@ -122,6 +122,12 @@ public: // The icon is shown in a file upload control. virtual bool queryIconForFiles(const WebVector<WebString>& filenames, WebIconLoadingCompletion*) { return false; } + // This method enumerates all the files in the path. It returns immediately + // and asynchronously invokes the WebFileChooserCompletion with all the + // files in the directory. Returns false if the WebFileChooserCompletion + // will never be called. + virtual bool enumerateChosenDirectory(const WebString& path, WebFileChooserCompletion*) { return false; } + // Navigational -------------------------------------------------------- diff --git a/Source/WebKit/chromium/public/WebWidget.h b/Source/WebKit/chromium/public/WebWidget.h index 36fbf31..1290ad8 100644 --- a/Source/WebKit/chromium/public/WebWidget.h +++ b/Source/WebKit/chromium/public/WebWidget.h @@ -41,6 +41,7 @@ namespace WebKit { class WebInputEvent; class WebString; +struct WebPoint; struct WebRect; struct WebSize; template <typename T> class WebVector; @@ -126,6 +127,10 @@ public: // will be returned if a selection range is available. virtual WebRect caretOrSelectionBounds() = 0; + // Returns the start and end point for the current selection, aligned to the + // bottom of the selected line. + virtual bool selectionRange(WebPoint& start, WebPoint& end) const = 0; + // Changes the text direction of the selected input node. virtual void setTextDirection(WebTextDirection) = 0; diff --git a/Source/WebKit/chromium/scripts/inline_js_imports.py b/Source/WebKit/chromium/scripts/inline_js_imports.py new file mode 100644 index 0000000..2655016 --- /dev/null +++ b/Source/WebKit/chromium/scripts/inline_js_imports.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +# This script replaces calls to importScripts with script sources +# in input script file and dumps result into output script file. + +from cStringIO import StringIO + +import jsmin +import os.path +import re +import sys + + +def main(argv): + + if len(argv) < 3: + print('usage: %s input_file imports_dir output_file' % argv[0]) + return 1 + + input_file_name = argv[1] + imports_dir = argv[2] + output_file_name = argv[3] + + input_file = open(input_file_name, 'r') + input_script = input_file.read() + input_file.close() + + def replace(match): + import_file_name = match.group(1) + full_path = os.path.join(imports_dir, import_file_name) + if not os.access(full_path, os.F_OK): + raise Exception('File %s referenced in %s not found on any source paths, ' + 'check source tree for consistency' % + (import_file_name, input_file_name)) + import_file = open(full_path, 'r') + import_script = import_file.read() + import_file.close() + return import_script + + output_script = re.sub(r'importScripts\([\'"]([^\'"]+)[\'"]\)', replace, input_script) + + output_file = open(output_file_name, 'w') + output_file.write(jsmin.jsmin(output_script)) + output_file.close() + + # Touch output file directory to make sure that Xcode will copy + # modified resource files. + if sys.platform == 'darwin': + output_dir_name = os.path.dirname(output_file_name) + os.utime(output_dir_name, None) + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 7baaf8a..533e8ec 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -38,6 +38,7 @@ #include "AsyncFileSystem.h" #include "DocumentMarker.h" #include "EditorInsertAction.h" +#include "ExceptionCode.h" #include "FileError.h" #include "FileMetadata.h" #include "FontDescription.h" @@ -52,6 +53,7 @@ #include "PasteboardPrivate.h" #include "PlatformCursor.h" #include "Settings.h" +#include "StorageInfo.h" #include "TextAffinity.h" #include "UserContentTypes.h" #include "UserScriptTypes.h" @@ -75,6 +77,8 @@ #include "WebNotificationPresenter.h" #include "WebScrollbar.h" #include "WebSettings.h" +#include "WebStorageQuotaError.h" +#include "WebStorageQuotaType.h" #include "WebTextAffinity.h" #include "WebTextCaseSensitivity.h" #include "WebTextCheckingResult.h" @@ -390,6 +394,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBacke #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); +COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeExternal, AsyncFileSystem::External); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeUnknown, FileMetadata::TypeUnknown); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeFile, FileMetadata::TypeFile); COMPILE_ASSERT_MATCHING_ENUM(WebFileInfo::TypeDirectory, FileMetadata::TypeDirectory); @@ -414,6 +419,17 @@ COMPILE_ASSERT_MATCHING_ENUM(WebGeolocationError::ErrorPositionUnavailable, Geol COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorSpelling, DocumentMarker::Spelling); COMPILE_ASSERT_MATCHING_ENUM(WebTextCheckingResult::ErrorGrammar, DocumentMarker::Grammar); +#if ENABLE(QUOTA) +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypeTemporary, StorageInfo::TEMPORARY); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaTypePersistent, StorageInfo::PERSISTENT); + +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorNotSupported, NOT_SUPPORTED_ERR); +COMPILE_ASSERT_MATCHING_ENUM(WebStorageQuotaErrorAbort, ABORT_ERR); +#endif + #if OS(DARWIN) COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateDisabled, PlatformBridge::StateDisabled); COMPILE_ASSERT_MATCHING_ENUM(WebThemeEngine::StateInactive, PlatformBridge::StateInactive); diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp index 1ca9900..acb7687 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp @@ -124,17 +124,16 @@ void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int da if (!m_client) return; - // FIXME(vsevik): add -1 to params once migrated. - m_client->didReceiveData(m_loader, data, dataLength); + m_client->didReceiveData(m_loader, data, dataLength, -1); m_downloadLength += dataLength; } -void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int lengthReceived) +void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int dataLength) { if (!m_client) return; - m_client->didReceiveCachedMetadata(m_loader, data, lengthReceived); + m_client->didReceiveCachedMetadata(m_loader, data, dataLength); } void AssociatedURLLoader::ClientAdapter::didFinishLoading(unsigned long identifier, double finishTime) @@ -169,7 +168,7 @@ AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) m_options.sniffContent = false; m_options.allowCredentials = true; m_options.forcePreflight = false; - m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests. + m_options.crossOriginRequestPolicy = WebURLLoaderOptions::CrossOriginRequestPolicyAllow; // FIXME We should deny by default, but this would break some tests. } AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl, const WebURLLoaderOptions& options) @@ -189,9 +188,9 @@ AssociatedURLLoader::~AssociatedURLLoader() #define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) -COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests); -COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl); -COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyDeny, DenyCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyUseAccessControl, UseAccessControl); +COMPILE_ASSERT_MATCHING_ENUM(WebURLLoaderOptions::CrossOriginRequestPolicyAllow, AllowCrossOriginRequests); void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h index ed183e5..9458986 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.h +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h @@ -32,6 +32,7 @@ #define AssociatedURLLoader_h #include "WebURLLoader.h" +#include "WebURLLoaderOptions.h" #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> #include <wtf/RefPtr.h> diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 99302cc..f12bf03 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -54,6 +54,7 @@ #include "Node.h" #include "NotificationPresenterImpl.h" #include "Page.h" +#include "PlatformBridge.h" #include "PopupMenuChromium.h" #include "RenderWidget.h" #include "ScriptController.h" @@ -682,6 +683,22 @@ void ChromeClientImpl::chooseIconForFiles(const Vector<String>& filenames, FileC iconCompletion->didLoadIcon(WebData()); } +#if ENABLE(DIRECTORY_UPLOAD) +void ChromeClientImpl::enumerateChosenDirectory(const String& path, FileChooser* fileChooser) +{ + WebViewClient* client = m_webView->client(); + if (!client) + return; + + WebFileChooserCompletionImpl* chooserCompletion = + new WebFileChooserCompletionImpl(fileChooser); + + // If the enumeration can't happen, call the callback with an empty list. + if (!client->enumerateChosenDirectory(path, chooserCompletion)) + chooserCompletion->didChooseFile(WebVector<WebString>()); +} +#endif + void ChromeClientImpl::popupOpened(PopupContainer* popupContainer, const IntRect& bounds, bool handleExternally) @@ -905,4 +922,9 @@ PassRefPtr<SearchPopupMenu> ChromeClientImpl::createSearchPopupMenu(PopupMenuCli return adoptRef(new SearchPopupMenuChromium(client)); } +void ChromeClientImpl::willRunModalDialogDuringPageDismissal(const DialogType& dialogType) const +{ + PlatformBridge::histogramEnumeration("Renderer.ModalDialogsDuringPageDismissal", static_cast<int>(dialogType), static_cast<int>(NumDialogTypes)); +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h index f3a48ee..6a65522 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.h +++ b/Source/WebKit/chromium/src/ChromeClientImpl.h @@ -139,6 +139,9 @@ public: virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*); virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual void chooseIconForFiles(const Vector<WTF::String>&, WebCore::FileChooser*); +#if ENABLE(DIRECTORY_UPLOAD) + virtual void enumerateChosenDirectory(const WTF::String&, WebCore::FileChooser*); +#endif virtual void setCursor(const WebCore::Cursor&); virtual void formStateDidChange(const WebCore::Node*); #if ENABLE(TOUCH_EVENTS) @@ -191,6 +194,8 @@ public: virtual void showContextMenu() { } #endif + virtual void willRunModalDialogDuringPageDismissal(const DialogType&) const; + private: void getPopupMenuInfo(WebCore::PopupContainer*, WebPopupMenuInfo*); void setCursor(const WebCursorInfo&); diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp index 9c137c9..0f82d38 100644 --- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -61,6 +61,7 @@ #include "WebPlugin.h" #include "WebPluginContainerImpl.h" #include "WebPoint.h" +#include "WebSpellCheckClient.h" #include "WebString.h" #include "WebURL.h" #include "WebURLResponse.h" @@ -206,7 +207,7 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (mediaElement->hasVideo()) data.mediaFlags |= WebContextMenuData::MediaHasVideo; if (mediaElement->controls()) - data.mediaFlags |= WebContextMenuData::MediaControls; + data.mediaFlags |= WebContextMenuData::MediaControlRootElement; } else if (r.innerNonSharedNode()->hasTagName(HTMLNames::objectTag) || r.innerNonSharedNode()->hasTagName(HTMLNames::embedTag)) { RenderObject* object = r.innerNonSharedNode()->renderer(); @@ -256,8 +257,17 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems( if (m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled()) { data.isSpellCheckingEnabled = true; // Spellchecking might be enabled for the field, but could be disabled on the node. - if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) + if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) { data.misspelledWord = selectMisspelledWord(defaultMenu, selectedFrame); + if (m_webView->spellCheckClient()) { + int misspelledOffset, misspelledLength; + m_webView->spellCheckClient()->spellCheck( + data.misspelledWord, misspelledOffset, misspelledLength, + &data.dictionarySuggestions); + if (!misspelledLength) + data.misspelledWord.reset(); + } + } } } diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 6f2231d..1141ea4 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -858,7 +858,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, // Check to see if the provided text is spelled correctly. if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient()) - m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength); + m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength, 0); else { spellLocation = 0; spellLength = 0; @@ -872,7 +872,7 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, *misspellingLength = spellLength; } -void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text) +void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, TextCheckingTypeMask, const String& text) { if (m_webView->spellCheckClient()) m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); diff --git a/Source/WebKit/chromium/src/EditorClientImpl.h b/Source/WebKit/chromium/src/EditorClientImpl.h index b81fb56..2ebc6ea 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.h +++ b/Source/WebKit/chromium/src/EditorClientImpl.h @@ -114,7 +114,7 @@ public: WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&); + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&); virtual WebCore::TextCheckerClient* textChecker() { return this; } diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.cpp b/Source/WebKit/chromium/src/EventListenerWrapper.cpp index 6360932..b352d81 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.cpp +++ b/Source/WebKit/chromium/src/EventListenerWrapper.cpp @@ -37,6 +37,8 @@ #include "WebDOMEvent.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { EventListenerWrapper::EventListenerWrapper(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/EventListenerWrapper.h b/Source/WebKit/chromium/src/EventListenerWrapper.h index 75b6a95..83e1cf1 100644 --- a/Source/WebKit/chromium/src/EventListenerWrapper.h +++ b/Source/WebKit/chromium/src/EventListenerWrapper.h @@ -37,21 +37,19 @@ namespace WebCore { class ScriptExecutionContext; } -using namespace WebCore; - namespace WebKit { class WebDOMEventListener; // FIXME: Remove the DeprecatedEventListenerWrapper class below once Chromium // switched to using WebDOMEvent. -class EventListenerWrapper : public EventListener { +class EventListenerWrapper : public WebCore::EventListener { public: EventListenerWrapper(WebDOMEventListener*); ~EventListenerWrapper(); - virtual bool operator==(const EventListener&); - virtual void handleEvent(ScriptExecutionContext*, Event*); + virtual bool operator==(const WebCore::EventListener&); + virtual void handleEvent(WebCore::ScriptExecutionContext*, WebCore::Event*); void webDOMEventListenerDeleted(); diff --git a/Source/WebKit/chromium/src/Extensions3DChromium.cpp b/Source/WebKit/chromium/src/Extensions3DChromium.cpp index 30101c7..81fa520 100644 --- a/Source/WebKit/chromium/src/Extensions3DChromium.cpp +++ b/Source/WebKit/chromium/src/Extensions3DChromium.cpp @@ -57,6 +57,11 @@ void Extensions3DChromium::ensureEnabled(const String& name) ASSERT(result); } +bool Extensions3DChromium::isEnabled(const String& name) +{ + return m_internal->isExtensionEnabled(name); +} + int Extensions3DChromium::getGraphicsResetStatusARB() { return m_internal->isContextLost() ? static_cast<int>(Extensions3D::UNKNOWN_CONTEXT_RESET_ARB) : static_cast<int>(GraphicsContext3D::NO_ERROR); @@ -97,6 +102,26 @@ void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture, m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture); } +void Extensions3DChromium::getParentToChildLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getParentToChildLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::getChildToParentLatchCHROMIUM(GC3Duint* latchId) +{ + m_internal->getChildToParentLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::waitLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->waitLatchCHROMIUM(latchId); +} + +void Extensions3DChromium::setLatchCHROMIUM(GC3Duint latchId) +{ + m_internal->setLatchCHROMIUM(latchId); +} + Platform3DObject Extensions3DChromium::createVertexArrayOES() { return 0; diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index 647a70c..d640b65 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -380,7 +380,7 @@ void FrameLoaderClientImpl::dispatchDidReceiveResponse(DocumentLoader* loader, void FrameLoaderClientImpl::dispatchDidReceiveContentLength( DocumentLoader* loader, unsigned long identifier, - int lengthReceived) + int dataLength) { } @@ -714,10 +714,18 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() // m_expectedClientRedirectDest could be something like // "javascript:history.go(-1)" thus we need to exclude url starts with // "javascript:". See bug: 1080873 - ASSERT(m_expectedClientRedirectDest.protocolIs("javascript") - || m_expectedClientRedirectDest == url); - ds->appendRedirect(m_expectedClientRedirectSrc); - completingClientRedirect = true; + if (m_expectedClientRedirectDest.protocolIs("javascript") + || m_expectedClientRedirectDest == url) { + ds->appendRedirect(m_expectedClientRedirectSrc); + completingClientRedirect = true; + } else { + // Any pending redirect is no longer in progress. This can happen + // if the navigation was canceled with PolicyIgnore, or if the + // redirect was scheduled on the wrong frame (e.g., due to a form + // submission targeted to _blank, as in http://webkit.org/b/44079). + m_expectedClientRedirectSrc = KURL(); + m_expectedClientRedirectDest = KURL(); + } } ds->appendRedirect(url); @@ -734,10 +742,10 @@ void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad() } } -void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientImpl::dispatchDidReceiveTitle(const StringWithDirection& title) { if (m_webFrame->client()) - m_webFrame->client()->didReceiveTitle(m_webFrame, title); + m_webFrame->client()->didReceiveTitle(m_webFrame, title.string(), title.direction() == LTR ? WebTextDirectionLeftToRight : WebTextDirectionRightToLeft); } void FrameLoaderClientImpl::dispatchDidChangeIcons() @@ -1328,7 +1336,7 @@ PassRefPtr<DocumentLoader> FrameLoaderClientImpl::createDocumentLoader( return ds.release(); } -void FrameLoaderClientImpl::setTitle(const String& title, const KURL& url) +void FrameLoaderClientImpl::setTitle(const StringWithDirection& title, const KURL& url) { // FIXME: inform consumer of changes to the title. } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index f19c26c..042b462 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -88,7 +88,7 @@ public: virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); @@ -104,7 +104,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String& title); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -166,7 +166,7 @@ public: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader( const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual WTF::String userAgent(const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 54c18e3..611103c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -54,7 +54,7 @@ #include <wtf/FastMalloc.h> #include <wtf/text/CString.h> -#if PLATFORM(CG) +#if USE(CG) #include "GraphicsContext.h" #include "WebGLRenderingContext.h" #include <CoreGraphics/CGContext.h> @@ -84,7 +84,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() , m_initializedAvailableExtensions(false) , m_layerComposited(false) #if USE(SKIA) -#elif PLATFORM(CG) +#elif USE(CG) , m_renderOutput(0) #else #error Must port to your platform @@ -94,7 +94,7 @@ GraphicsContext3DInternal::GraphicsContext3DInternal() GraphicsContext3DInternal::~GraphicsContext3DInternal() { -#if PLATFORM(CG) +#if USE(CG) if (m_renderOutput) delete[] m_renderOutput; #endif @@ -210,7 +210,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon // Read back the frame buffer. SkAutoLockPixels bitmapLock(*readbackBitmap); pixels = static_cast<unsigned char*>(readbackBitmap->getPixels()); -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput) pixels = m_renderOutput; #else @@ -230,6 +230,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon } #if USE(SKIA) + readbackBitmap->notifyPixelsChanged(); if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. SkCanvas canvas(*canvasBitmap); @@ -237,7 +238,7 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon dst.set(SkIntToScalar(0), SkIntToScalar(0), SkIntToScalar(canvasBitmap->width()), SkIntToScalar(canvasBitmap->height())); canvas.drawBitmapRect(m_resizingBitmap, 0, dst); } -#elif PLATFORM(CG) +#elif USE(CG) if (m_renderOutput && context->is3d()) { WebGLRenderingContext* webGLContext = static_cast<WebGLRenderingContext*>(context); webGLContext->graphicsContext3D()->paintToCanvas(m_renderOutput, m_impl->width(), m_impl->height(), canvas->width(), canvas->height(), imageBuffer->context()->platformContext()); @@ -277,7 +278,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) m_impl->reshape(width, height); -#if PLATFORM(CG) +#if USE(CG) // Need to reallocate the client-side backing store. // FIXME: make this more efficient. if (m_renderOutput) { @@ -286,7 +287,7 @@ void GraphicsContext3DInternal::reshape(int width, int height) } int rowBytes = width * 4; m_renderOutput = new unsigned char[height * rowBytes]; -#endif // PLATFORM(CG) +#endif // USE(CG) } IntSize GraphicsContext3DInternal::getInternalFramebufferSize() @@ -793,6 +794,13 @@ bool GraphicsContext3DInternal::ensureExtensionEnabled(const String& name) return m_enabledExtensions.contains(mappedName); } +bool GraphicsContext3DInternal::isExtensionEnabled(const String& name) +{ + initializeExtensions(); + String mappedName = mapExtensionName(name); + return m_enabledExtensions.contains(mappedName); +} + DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, GC3Denum, GC3Dsizeiptr, GC3Dsizei, GC3Denum, void*) DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*) DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, GC3Denum, GC3Dint, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei, GC3Denum, GC3Denum, GC3Denum, void*) @@ -800,6 +808,10 @@ DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject) DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum) DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei) +DELEGATE_TO_IMPL_1(getParentToChildLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(getChildToParentLatchCHROMIUM, GC3Duint*) +DELEGATE_TO_IMPL_1(waitLatchCHROMIUM, GC3Duint) +DELEGATE_TO_IMPL_1(setLatchCHROMIUM, GC3Duint) //---------------------------------------------------------------------- // GraphicsContext3D diff --git a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h index 0af291e..c02491c 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -251,6 +251,7 @@ public: Extensions3D* getExtensions(); bool supportsExtension(const String& name); bool ensureExtensionEnabled(const String& name); + bool isExtensionEnabled(const String& name); // EXT_texture_format_BGRA8888 bool supportsBGRA(); @@ -270,6 +271,12 @@ public: void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter); void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height); + // Latch support + void getParentToChildLatchCHROMIUM(GC3Duint* latchId); + void getChildToParentLatchCHROMIUM(GC3Duint* latchId); + void waitLatchCHROMIUM(GC3Duint latchId); + void setLatchCHROMIUM(GC3Duint latchId); + private: OwnPtr<WebKit::WebGraphicsContext3D> m_impl; OwnPtr<Extensions3DChromium> m_extensions; @@ -291,7 +298,7 @@ private: SkBitmap m_resizingBitmap; #endif -#if PLATFORM(CG) +#if USE(CG) unsigned char* m_renderOutput; #endif diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index 727092a..c536c38 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,8 +29,10 @@ #include "config.h" #include "IDBCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" @@ -39,16 +41,16 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +PassRefPtr<IDBCallbacksProxy> IDBCallbacksProxy::create(PassOwnPtr<WebIDBCallbacks> callbacks) { return adoptRef(new IDBCallbacksProxy(callbacks)); } -IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks> callbacks) +IDBCallbacksProxy::IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,32 +61,32 @@ IDBCallbacksProxy::~IDBCallbacksProxy() void IDBCallbacksProxy::onError(PassRefPtr<IDBDatabaseError> idbDatabaseError) { - m_callbacks->onError(WebKit::WebIDBDatabaseError(idbDatabaseError)); + m_callbacks->onError(WebIDBDatabaseError(idbDatabaseError)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBCursorBackendInterface> idbCursorBackend) { - m_callbacks->onSuccess(new WebKit::WebIDBCursorImpl(idbCursorBackend)); + m_callbacks->onSuccess(new WebIDBCursorImpl(idbCursorBackend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); + m_callbacks->onSuccess(new WebIDBDatabaseImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) { - m_callbacks->onSuccess(WebKit::WebIDBKey(idbKey)); + m_callbacks->onSuccess(WebIDBKey(idbKey)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBTransactionBackendInterface> backend) { - m_callbacks->onSuccess(new WebKit::WebIDBTransactionImpl(backend)); + m_callbacks->onSuccess(new WebIDBTransactionImpl(backend)); } void IDBCallbacksProxy::onSuccess(PassRefPtr<SerializedScriptValue> serializedScriptValue) { - m_callbacks->onSuccess(WebKit::WebSerializedScriptValue(serializedScriptValue)); + m_callbacks->onSuccess(WebSerializedScriptValue(serializedScriptValue)); } void IDBCallbacksProxy::onBlocked() @@ -92,6 +94,6 @@ void IDBCallbacksProxy::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h index 6829845..e9f45ff 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,40 +29,37 @@ #ifndef IDBCallbacksProxy_h #define IDBCallbacksProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - namespace WebKit { -class WebIDBCallbacks; -} -namespace WebCore { +class WebIDBCallbacks; -class IDBCallbacksProxy : public IDBCallbacks { +class IDBCallbacksProxy : public WebCore::IDBCallbacks { public: - static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBCallbacks>); + static PassRefPtr<IDBCallbacksProxy> create(PassOwnPtr<WebIDBCallbacks>); virtual ~IDBCallbacksProxy(); - virtual void onError(PassRefPtr<IDBDatabaseError>); - virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBKey>); - virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>); - virtual void onSuccess(PassRefPtr<SerializedScriptValue>); + virtual void onError(PassRefPtr<WebCore::IDBDatabaseError>); + virtual void onSuccess(PassRefPtr<WebCore::IDBCursorBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBDatabaseBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::IDBKey>); + virtual void onSuccess(PassRefPtr<WebCore::IDBTransactionBackendInterface>); + virtual void onSuccess(PassRefPtr<WebCore::SerializedScriptValue>); virtual void onBlocked(); private: - IDBCallbacksProxy(PassOwnPtr<WebKit::WebIDBCallbacks>); + IDBCallbacksProxy(PassOwnPtr<WebIDBCallbacks>); - OwnPtr<WebKit::WebIDBCallbacks> m_callbacks; + OwnPtr<WebIDBCallbacks> m_callbacks; }; - -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp index b3b9ea7..7dab6a2 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -36,14 +36,16 @@ #include "WebIDBKey.h" #include "WebSerializedScriptValue.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +namespace WebKit { + +PassRefPtr<IDBCursorBackendInterface> IDBCursorBackendProxy::create(PassOwnPtr<WebIDBCursor> idbCursor) { return adoptRef(new IDBCursorBackendProxy(idbCursor)); } -IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor> idbCursor) +IDBCursorBackendProxy::IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor> idbCursor) : m_idbCursor(idbCursor) { } @@ -87,6 +89,6 @@ void IDBCursorBackendProxy::deleteFunction(PassRefPtr<IDBCallbacks> callbacks, E m_idbCursor->deleteFunction(new WebIDBCallbacksImpl(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h index 0c2e1c7..d725360 100644 --- a/Source/WebKit/chromium/src/IDBCursorBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -35,28 +35,28 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebKit { -class IDBCursorBackendProxy : public IDBCursorBackendInterface { +class IDBCursorBackendProxy : public WebCore::IDBCursorBackendInterface { public: - static PassRefPtr<IDBCursorBackendInterface> create(PassOwnPtr<WebKit::WebIDBCursor>); + static PassRefPtr<WebCore::IDBCursorBackendInterface> create(PassOwnPtr<WebIDBCursor>); virtual ~IDBCursorBackendProxy(); virtual unsigned short direction() const; - virtual PassRefPtr<IDBKey> key() const; - virtual PassRefPtr<IDBKey> primaryKey() const; - virtual PassRefPtr<SerializedScriptValue> value() const; - virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBCallbacks>, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBKey> key() const; + virtual PassRefPtr<WebCore::IDBKey> primaryKey() const; + virtual PassRefPtr<WebCore::SerializedScriptValue> value() const; + virtual void update(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void continueFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBCallbacks>, WebCore::ExceptionCode&); private: - IDBCursorBackendProxy(PassOwnPtr<WebKit::WebIDBCursor>); + IDBCursorBackendProxy(PassOwnPtr<WebIDBCursor>); - OwnPtr<WebKit::WebIDBCursor> m_idbCursor; + OwnPtr<WebIDBCursor> m_idbCursor; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp index 7fe7378..7e5ecc3 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,12 +24,14 @@ */ #include "config.h" -#include "IDBDatabaseProxy.h" +#include "IDBDatabaseBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" #include "IDBDatabaseCallbacks.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionBackendProxy.h" #include "WebDOMStringList.h" #include "WebFrameImpl.h" @@ -40,51 +42,51 @@ #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseProxy::create(PassOwnPtr<WebKit::WebIDBDatabase> database) +PassRefPtr<IDBDatabaseBackendInterface> IDBDatabaseBackendProxy::create(PassOwnPtr<WebIDBDatabase> database) { - return adoptRef(new IDBDatabaseProxy(database)); + return adoptRef(new IDBDatabaseBackendProxy(database)); } -IDBDatabaseProxy::IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase> database) +IDBDatabaseBackendProxy::IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase> database) : m_webIDBDatabase(database) { } -IDBDatabaseProxy::~IDBDatabaseProxy() +IDBDatabaseBackendProxy::~IDBDatabaseBackendProxy() { } -String IDBDatabaseProxy::name() const +String IDBDatabaseBackendProxy::name() const { return m_webIDBDatabase->name(); } -String IDBDatabaseProxy::version() const +String IDBDatabaseBackendProxy::version() const { return m_webIDBDatabase->version(); } -PassRefPtr<DOMStringList> IDBDatabaseProxy::objectStoreNames() const +PassRefPtr<DOMStringList> IDBDatabaseBackendProxy::objectStoreNames() const { return m_webIDBDatabase->objectStoreNames(); } -PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBObjectStoreBackendInterface> IDBDatabaseBackendProxy::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBObjectStore* objectStore = m_webIDBDatabase->createObjectStore(name, keyPath, autoIncrement, *transactionProxy->getWebIDBTransaction(), ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } -void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBDatabaseBackendProxy::deleteObjectStore(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -92,15 +94,15 @@ void IDBDatabaseProxy::deleteObjectStore(const String& name, IDBTransactionBacke m_webIDBDatabase->deleteObjectStore(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBDatabaseProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) +void IDBDatabaseBackendProxy::setVersion(const String& version, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks, ExceptionCode& ec) { m_webIDBDatabase->setVersion(version, new WebIDBCallbacksImpl(callbacks), ec); } -PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) +PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseBackendProxy::transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) { - WebKit::WebDOMStringList names(storeNames); - WebKit::WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); + WebDOMStringList names(storeNames); + WebIDBTransaction* transaction = m_webIDBDatabase->transaction(names, mode, ec); if (!transaction) { ASSERT(ec); return 0; @@ -108,16 +110,16 @@ PassRefPtr<IDBTransactionBackendInterface> IDBDatabaseProxy::transaction(DOMStri return IDBTransactionBackendProxy::create(transaction); } -void IDBDatabaseProxy::close(PassRefPtr<IDBDatabaseCallbacks>) +void IDBDatabaseBackendProxy::close(PassRefPtr<IDBDatabaseCallbacks>) { m_webIDBDatabase->close(); } -void IDBDatabaseProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) +void IDBDatabaseBackendProxy::open(PassRefPtr<IDBDatabaseCallbacks> databaseCallbacks) { m_webIDBDatabase->open(new WebIDBDatabaseCallbacksImpl(databaseCallbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseProxy.h b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h index c3e8346..5a5baf2 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,45 +23,45 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef IDBDatabaseProxy_h -#define IDBDatabaseProxy_h +#ifndef IDBDatabaseBackendProxy_h +#define IDBDatabaseBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) #include "IDBDatabaseBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBDatabase; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabase; -class IDBDatabaseProxy : public IDBDatabaseBackendInterface { +class IDBDatabaseBackendProxy : public WebCore::IDBDatabaseBackendInterface { public: - static PassRefPtr<IDBDatabaseBackendInterface> create(PassOwnPtr<WebKit::WebIDBDatabase>); - virtual ~IDBDatabaseProxy(); + static PassRefPtr<WebCore::IDBDatabaseBackendInterface> create(PassOwnPtr<WebIDBDatabase>); + virtual ~IDBDatabaseBackendProxy(); virtual String name() const; virtual String version() const; - virtual PassRefPtr<DOMStringList> objectStoreNames() const; + virtual PassRefPtr<WebCore::DOMStringList> objectStoreNames() const; - virtual PassRefPtr<IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteObjectStore(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void setVersion(const String& version, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBDatabaseCallbacks>, ExceptionCode&); - virtual PassRefPtr<IDBTransactionBackendInterface> transaction(DOMStringList* storeNames, unsigned short mode, ExceptionCode&); - virtual void close(PassRefPtr<IDBDatabaseCallbacks>); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteObjectStore(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void setVersion(const String& version, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::IDBDatabaseCallbacks>, WebCore::ExceptionCode&); + virtual PassRefPtr<WebCore::IDBTransactionBackendInterface> transaction(WebCore::DOMStringList* storeNames, unsigned short mode, WebCore::ExceptionCode&); + virtual void close(PassRefPtr<WebCore::IDBDatabaseCallbacks>); - virtual void open(PassRefPtr<IDBDatabaseCallbacks>); + virtual void open(PassRefPtr<WebCore::IDBDatabaseCallbacks>); private: - IDBDatabaseProxy(PassOwnPtr<WebKit::WebIDBDatabase>); + IDBDatabaseBackendProxy(PassOwnPtr<WebIDBDatabase>); - OwnPtr<WebKit::WebIDBDatabase> m_webIDBDatabase; + OwnPtr<WebIDBDatabase> m_webIDBDatabase; }; -} // namespace WebCore +} // namespace WebKit #endif -#endif // IDBDatabaseProxy_h +#endif // IDBDatabaseBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp index 28c134f..816faf6 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.cpp @@ -30,14 +30,16 @@ #include "WebIDBDatabaseCallbacks.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +namespace WebKit { + +PassRefPtr<IDBDatabaseCallbacksProxy> IDBDatabaseCallbacksProxy::create(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) { return adoptRef(new IDBDatabaseCallbacksProxy(callbacks)); } -IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks> callbacks) +IDBDatabaseCallbacksProxy::IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -51,6 +53,6 @@ void IDBDatabaseCallbacksProxy::onVersionChange(const String& requestedVersion) m_callbacks->onVersionChange(requestedVersion); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h index 9fd7a0b..affdce7 100644 --- a/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBDatabaseCallbacksProxy.h @@ -26,30 +26,29 @@ #ifndef IDBDatabaseCallbacksProxy_h #define IDBDatabaseCallbacksProxy_h -#include "IDBDatabaseCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBDatabaseCallbacks.h" #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBDatabaseCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBDatabaseCallbacks; -class IDBDatabaseCallbacksProxy : public IDBDatabaseCallbacks { +class IDBDatabaseCallbacksProxy : public WebCore::IDBDatabaseCallbacks { public: - static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + static PassRefPtr<IDBDatabaseCallbacksProxy> create(PassOwnPtr<WebIDBDatabaseCallbacks>); virtual ~IDBDatabaseCallbacksProxy(); virtual void onVersionChange(const String& requestedVersion); private: - IDBDatabaseCallbacksProxy(PassOwnPtr<WebKit::WebIDBDatabaseCallbacks>); + IDBDatabaseCallbacksProxy(PassOwnPtr<WebIDBDatabaseCallbacks>); - OwnPtr<WebKit::WebIDBDatabaseCallbacks> m_callbacks; + OwnPtr<WebIDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 9e5ccc0..1824eb8 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,9 +29,11 @@ #include "config.h" #include "IDBFactoryBackendProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "WebFrameImpl.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBDatabase.h" @@ -41,9 +43,9 @@ #include "WebKitClient.h" #include "WebVector.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() { @@ -51,7 +53,7 @@ PassRefPtr<IDBFactoryBackendInterface> IDBFactoryBackendProxy::create() } IDBFactoryBackendProxy::IDBFactoryBackendProxy() - : m_webIDBFactory(WebKit::webKitClient()->idbFactory()) + : m_webIDBFactory(webKitClient()->idbFactory()) { } @@ -61,10 +63,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType) { - WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebKit::WebIDBFactory::BackingStoreType>(backingStoreType)); + WebFrame* webFrame = WebFrameImpl::fromFrame(frame); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h index 593051e..89ed355 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,32 +29,32 @@ #ifndef IDBFactoryBackendProxy_h #define IDBFactoryBackendProxy_h -#include "IDBFactoryBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) -namespace WebKit { class WebIDBFactory; } +#include "IDBFactoryBackendInterface.h" + +namespace WebCore { class DOMStringList; } -namespace WebCore { +namespace WebKit { -class DOMStringList; +class WebIDBFactory; -class IDBFactoryBackendProxy : public IDBFactoryBackendInterface { +class IDBFactoryBackendProxy : public WebCore::IDBFactoryBackendInterface { public: - static PassRefPtr<IDBFactoryBackendInterface> create(); + static PassRefPtr<WebCore::IDBFactoryBackendInterface> create(); virtual ~IDBFactoryBackendProxy(); - PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); + PassRefPtr<WebCore::DOMStringList> databases(void) const; + virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); private: IDBFactoryBackendProxy(); // We don't own this pointer (unlike all the other proxy classes which do). - WebKit::WebIDBFactory* m_webIDBFactory; + WebIDBFactory* m_webIDBFactory; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 410750e..556c9b6 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,14 +37,16 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebKit::WebIDBIndex> index) +namespace WebKit { + +PassRefPtr<IDBIndexBackendInterface> IDBIndexBackendProxy::create(PassOwnPtr<WebIDBIndex> index) { return adoptRef(new IDBIndexBackendProxy(index)); } -IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex> index) +IDBIndexBackendProxy::IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex> index) : m_webIDBIndex(index) { } @@ -105,6 +107,6 @@ void IDBIndexBackendProxy::getKey(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallback m_webIDBIndex->getKey(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h index e9de05a..b63640f 100644 --- a/Source/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef IDBIndexBackendProxy_h #define IDBIndexBackendProxy_h +#if ENABLE(INDEXED_DATABASE) + #include "IDBIndexBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBIndex; } +namespace WebKit { -namespace WebCore { +class WebIDBIndex; -class IDBIndexBackendProxy : public IDBIndexBackendInterface { +class IDBIndexBackendProxy : public WebCore::IDBIndexBackendInterface { public: - static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebKit::WebIDBIndex>); + static PassRefPtr<IDBIndexBackendInterface> create(PassOwnPtr<WebIDBIndex>); virtual ~IDBIndexBackendProxy(); virtual String name(); @@ -46,18 +46,18 @@ public: virtual String keyPath(); virtual bool unique(); - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void openKeyCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void getKey(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void openKeyCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void getKey(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); private: - IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex>); + IDBIndexBackendProxy(PassOwnPtr<WebIDBIndex>); - OwnPtr<WebKit::WebIDBIndex> m_webIDBIndex; + OwnPtr<WebIDBIndex> m_webIDBIndex; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp index d6871e0..2a0e075 100755 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -24,7 +24,9 @@ */ #include "config.h" -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" + +#if ENABLE(INDEXED_DATABASE) #include "DOMStringList.h" #include "IDBCallbacks.h" @@ -39,40 +41,40 @@ #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreProxy::create(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +PassRefPtr<IDBObjectStoreBackendInterface> IDBObjectStoreBackendProxy::create(PassOwnPtr<WebIDBObjectStore> objectStore) { - return adoptRef(new IDBObjectStoreProxy(objectStore)); + return adoptRef(new IDBObjectStoreBackendProxy(objectStore)); } -IDBObjectStoreProxy::IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore> objectStore) +IDBObjectStoreBackendProxy::IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore> objectStore) : m_webIDBObjectStore(objectStore) { } -IDBObjectStoreProxy::~IDBObjectStoreProxy() +IDBObjectStoreBackendProxy::~IDBObjectStoreBackendProxy() { } -String IDBObjectStoreProxy::name() const +String IDBObjectStoreBackendProxy::name() const { return m_webIDBObjectStore->name(); } -String IDBObjectStoreProxy::keyPath() const +String IDBObjectStoreBackendProxy::keyPath() const { return m_webIDBObjectStore->keyPath(); } -PassRefPtr<DOMStringList> IDBObjectStoreProxy::indexNames() const +PassRefPtr<DOMStringList> IDBObjectStoreBackendProxy::indexNames() const { return m_webIDBObjectStore->indexNames(); } -void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -80,15 +82,15 @@ void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> c m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - m_webIDBObjectStore->put(value, key, static_cast<WebKit::WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); + m_webIDBObjectStore->put(value, key, static_cast<WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -96,7 +98,7 @@ void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBC m_webIDBObjectStore->deleteFunction(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -104,26 +106,26 @@ void IDBObjectStoreProxy::clear(PassRefPtr<IDBCallbacks> callbacks, IDBTransacti m_webIDBObjectStore->clear(new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction); - WebKit::WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); + WebIDBIndex* index = m_webIDBObjectStore->createIndex(name, keyPath, unique, *transactionProxy->getWebIDBTransaction(), ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreProxy::index(const String& name, ExceptionCode& ec) +PassRefPtr<IDBIndexBackendInterface> IDBObjectStoreBackendProxy::index(const String& name, ExceptionCode& ec) { - WebKit::WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); + WebIDBIndex* index = m_webIDBObjectStore->index(name, ec); if (!index) return 0; return IDBIndexBackendProxy::create(index); } -void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::deleteIndex(const String& name, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -131,7 +133,7 @@ void IDBObjectStoreProxy::deleteIndex(const String& name, IDBTransactionBackendI m_webIDBObjectStore->deleteIndex(name, *transactionProxy->getWebIDBTransaction(), ec); } -void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) +void IDBObjectStoreBackendProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec) { // The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer, // all implementations of IDB interfaces are proxy objects. @@ -139,6 +141,6 @@ void IDBObjectStoreProxy::openCursor(PassRefPtr<IDBKeyRange> range, unsigned sho m_webIDBObjectStore->openCursor(range, direction, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h new file mode 100755 index 0000000..cb0ee32 --- /dev/null +++ b/Source/WebKit/chromium/src/IDBObjectStoreBackendProxy.h @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef IDBObjectStoreBackendProxy_h +#define IDBObjectStoreBackendProxy_h + +#if ENABLE(INDEXED_DATABASE) + +#include "IDBObjectStoreBackendInterface.h" +#include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> + +namespace WebKit { + +class WebIDBObjectStore; + +class IDBObjectStoreBackendProxy : public WebCore::IDBObjectStoreBackendInterface { +public: + static PassRefPtr<WebCore::IDBObjectStoreBackendInterface> create(PassOwnPtr<WebIDBObjectStore>); + virtual ~IDBObjectStoreBackendProxy(); + + virtual String name() const; + virtual String keyPath() const; + virtual PassRefPtr<WebCore::DOMStringList> indexNames() const; + + virtual void get(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void put(PassRefPtr<WebCore::SerializedScriptValue>, PassRefPtr<WebCore::IDBKey>, PutMode, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void deleteFunction(PassRefPtr<WebCore::IDBKey>, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + virtual void clear(PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + PassRefPtr<WebCore::IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + PassRefPtr<WebCore::IDBIndexBackendInterface> index(const String& name, WebCore::ExceptionCode&); + void deleteIndex(const String& name, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + + virtual void openCursor(PassRefPtr<WebCore::IDBKeyRange>, unsigned short direction, PassRefPtr<WebCore::IDBCallbacks>, WebCore::IDBTransactionBackendInterface*, WebCore::ExceptionCode&); + +private: + IDBObjectStoreBackendProxy(PassOwnPtr<WebIDBObjectStore>); + + OwnPtr<WebIDBObjectStore> m_webIDBObjectStore; +}; + +} // namespace WebKit + +#endif + +#endif // IDBObjectStoreBackendProxy_h diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreProxy.h deleted file mode 100755 index a6e3748..0000000 --- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (C) 2010 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef IDBObjectStoreProxy_h -#define IDBObjectStoreProxy_h - -#include "IDBObjectStoreBackendInterface.h" -#include <wtf/OwnPtr.h> -#include <wtf/PassOwnPtr.h> -#include <wtf/PassRefPtr.h> - -#if ENABLE(INDEXED_DATABASE) - -namespace WebKit { class WebIDBObjectStore; } - -namespace WebCore { - -class IDBObjectStoreProxy : public IDBObjectStoreBackendInterface { -public: - static PassRefPtr<IDBObjectStoreBackendInterface> create(PassOwnPtr<WebKit::WebIDBObjectStore>); - virtual ~IDBObjectStoreProxy(); - - virtual String name() const; - virtual String keyPath() const; - virtual PassRefPtr<DOMStringList> indexNames() const; - - virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - virtual void clear(PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - - PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&); - PassRefPtr<IDBIndexBackendInterface> index(const String& name, ExceptionCode&); - void deleteIndex(const String& name, IDBTransactionBackendInterface*, ExceptionCode&); - - virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&); - -private: - IDBObjectStoreProxy(PassOwnPtr<WebKit::WebIDBObjectStore>); - - OwnPtr<WebKit::WebIDBObjectStore> m_webIDBObjectStore; -}; - -} // namespace WebCore - -#endif - -#endif // IDBObjectStoreProxy_h diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp index 95c90d5..6d91f48 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,21 +28,23 @@ #if ENABLE(INDEXED_DATABASE) -#include "IDBObjectStoreProxy.h" +#include "IDBObjectStoreBackendProxy.h" #include "IDBTransactionCallbacks.h" #include "WebIDBDatabaseError.h" #include "WebIDBObjectStore.h" #include "WebIDBTransaction.h" #include "WebIDBTransactionCallbacksImpl.h" -namespace WebCore { +using namespace WebCore; -PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +namespace WebKit { + +PassRefPtr<IDBTransactionBackendInterface> IDBTransactionBackendProxy::create(PassOwnPtr<WebIDBTransaction> transaction) { return adoptRef(new IDBTransactionBackendProxy(transaction)); } -IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction> transaction) +IDBTransactionBackendProxy::IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction> transaction) : m_webIDBTransaction(transaction) { ASSERT(m_webIDBTransaction); @@ -54,10 +56,10 @@ IDBTransactionBackendProxy::~IDBTransactionBackendProxy() PassRefPtr<IDBObjectStoreBackendInterface> IDBTransactionBackendProxy::objectStore(const String& name, ExceptionCode& ec) { - WebKit::WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); + WebIDBObjectStore* objectStore = m_webIDBTransaction->objectStore(name, ec); if (!objectStore) return 0; - return IDBObjectStoreProxy::create(objectStore); + return IDBObjectStoreBackendProxy::create(objectStore); } unsigned short IDBTransactionBackendProxy::mode() const @@ -88,6 +90,6 @@ void IDBTransactionBackendProxy::setCallbacks(IDBTransactionCallbacks* callbacks m_webIDBTransaction->setCallbacks(new WebIDBTransactionCallbacksImpl(callbacks)); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h index 96d7293..103f552 100644 --- a/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionBackendProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,38 +26,37 @@ #ifndef IDBTransactionBackendProxy_h #define IDBTransactionBackendProxy_h -#include "IDBTransactionBackendInterface.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionBackendInterface.h" #include <wtf/OwnPtr.h> #include <wtf/PassOwnPtr.h> -namespace WebKit { class WebIDBTransaction; } +namespace WebKit { -namespace WebCore { +class WebIDBTransaction; -class IDBTransactionBackendProxy : public IDBTransactionBackendInterface { +class IDBTransactionBackendProxy : public WebCore::IDBTransactionBackendInterface { public: - static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebKit::WebIDBTransaction>); + static PassRefPtr<IDBTransactionBackendInterface> create(PassOwnPtr<WebIDBTransaction>); virtual ~IDBTransactionBackendProxy(); - virtual PassRefPtr<IDBObjectStoreBackendInterface> objectStore(const String& name, ExceptionCode&); + virtual PassRefPtr<WebCore::IDBObjectStoreBackendInterface> objectStore(const String& name, WebCore::ExceptionCode&); virtual unsigned short mode() const; virtual void abort(); - virtual bool scheduleTask(PassOwnPtr<ScriptExecutionContext::Task>, PassOwnPtr<ScriptExecutionContext::Task>); + virtual bool scheduleTask(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); virtual void didCompleteTaskEvents(); - virtual void setCallbacks(IDBTransactionCallbacks*); + virtual void setCallbacks(WebCore::IDBTransactionCallbacks*); - WebKit::WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } + WebIDBTransaction* getWebIDBTransaction() const { return m_webIDBTransaction.get(); } private: - IDBTransactionBackendProxy(PassOwnPtr<WebKit::WebIDBTransaction>); + IDBTransactionBackendProxy(PassOwnPtr<WebIDBTransaction>); - OwnPtr<WebKit::WebIDBTransaction> m_webIDBTransaction; + OwnPtr<WebIDBTransaction> m_webIDBTransaction; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp index ebda1dd..83d7e3a 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,18 +29,20 @@ #include "config.h" #include "IDBTransactionCallbacksProxy.h" +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBTransactionCallbacks.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { -PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +PassRefPtr<IDBTransactionCallbacksProxy> IDBTransactionCallbacksProxy::create(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) { return adoptRef(new IDBTransactionCallbacksProxy(callbacks)); } -IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks> callbacks) +IDBTransactionCallbacksProxy::IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) { } @@ -59,6 +61,6 @@ void IDBTransactionCallbacksProxy::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h index 79c32f6..044eecf 100644 --- a/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBTransactionCallbacksProxy.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,33 +29,32 @@ #ifndef IDBTransactionCallbacksProxy_h #define IDBTransactionCallbacksProxy_h -#include "IDBTransactionCallbacks.h" - #if ENABLE(INDEXED_DATABASE) +#include "IDBTransactionCallbacks.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -namespace WebKit { class WebIDBTransactionCallbacks; } +namespace WebKit { -namespace WebCore { +class WebIDBTransactionCallbacks; -class IDBTransactionCallbacksProxy : public IDBTransactionCallbacks { +class IDBTransactionCallbacksProxy : public WebCore::IDBTransactionCallbacks { public: - static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + static PassRefPtr<IDBTransactionCallbacksProxy> create(PassOwnPtr<WebIDBTransactionCallbacks>); virtual ~IDBTransactionCallbacksProxy(); virtual void onAbort(); virtual void onComplete(); private: - IDBTransactionCallbacksProxy(PassOwnPtr<WebKit::WebIDBTransactionCallbacks>); + IDBTransactionCallbacksProxy(PassOwnPtr<WebIDBTransactionCallbacks>); - OwnPtr<WebKit::WebIDBTransactionCallbacks> m_callbacks; + OwnPtr<WebIDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/src/PlatformBridge.cpp b/Source/WebKit/chromium/src/PlatformBridge.cpp index d825d24..bbed1ba 100644 --- a/Source/WebKit/chromium/src/PlatformBridge.cpp +++ b/Source/WebKit/chromium/src/PlatformBridge.cpp @@ -61,7 +61,7 @@ #include "WebViewImpl.h" #include "WebWorkerClientImpl.h" -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGContext.h> #endif @@ -178,6 +178,12 @@ void PlatformBridge::clipboardReadHTML( *sourceURL = url; } +PassRefPtr<SharedBuffer> PlatformBridge::clipboardReadImage( + PasteboardPrivate::ClipboardBuffer buffer) +{ + return webKitClient()->clipboard()->readImage(static_cast<WebClipboard::Buffer>(buffer)); +} + void PlatformBridge::clipboardWriteSelection(const String& htmlText, const KURL& sourceURL, const String& plainText, diff --git a/Source/WebKit/chromium/src/ResourceHandle.cpp b/Source/WebKit/chromium/src/ResourceHandle.cpp index f88a48a..a11e0c3 100644 --- a/Source/WebKit/chromium/src/ResourceHandle.cpp +++ b/Source/WebKit/chromium/src/ResourceHandle.cpp @@ -72,10 +72,7 @@ public: virtual void didSendData( WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); - virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived); - - // FIXME(vsevik): remove once not used downstream - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength); virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*, double finishTime); @@ -163,20 +160,14 @@ void ResourceHandleInternal::didReceiveResponse(WebURLLoader*, const WebURLRespo m_client->didReceiveResponse(m_owner, response.toResourceResponse()); } -// FIXME(vsevik): remove once not used -void ResourceHandleInternal::didReceiveData(WebURLLoader* webURLLoader, const char* data, int dataLength) -{ - didReceiveData2(webURLLoader, data, dataLength, -1); -} - -void ResourceHandleInternal::didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) +void ResourceHandleInternal::didReceiveData(WebURLLoader*, const char* data, int dataLength, int encodedDataLength) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateReceivingData; - m_client->didReceiveData(m_owner, data, dataLength, lengthReceived); + m_client->didReceiveData(m_owner, data, dataLength, encodedDataLength); } void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) diff --git a/Source/WebKit/chromium/src/StorageInfoChromium.cpp b/Source/WebKit/chromium/src/StorageInfoChromium.cpp new file mode 100644 index 0000000..5f58c2c --- /dev/null +++ b/Source/WebKit/chromium/src/StorageInfoChromium.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "StorageInfo.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "Document.h" +#include "ScriptExecutionContext.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" +#include "WebFrameClient.h" +#include "WebFrameImpl.h" +#include "WebStorageQuotaCallbacksImpl.h" +#include "WebStorageQuotaType.h" + +using namespace WebKit; + +namespace WebCore { + +namespace { +void fireStorageInfoErrorCallback(PassRefPtr<StorageInfoErrorCallback> errorCallback, ExceptionCode ec) +{ + ASSERT(errorCallback); + ExceptionCodeDescription description; + getExceptionCodeDescription(ec, description); + errorCallback->handleEvent(DOMCoreException::create(description).get()); +} +} + +void StorageInfo::queryUsageAndQuota(ScriptExecutionContext* context, int storageType, PassRefPtr<StorageInfoUsageCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->queryStorageUsageAndQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +void StorageInfo::requestQuota(ScriptExecutionContext* context, int storageType, unsigned long long newQuotaInBytes, PassRefPtr<StorageInfoQuotaCallback> successCallback, PassRefPtr<StorageInfoErrorCallback> errorCallback) +{ + ASSERT(context); + if (storageType != WebStorageQuotaTypeTemporary && storageType != WebStorageQuotaTypePersistent) { + // Unknown storage type is requested. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + return; + } + if (context->isDocument()) { + Document* document = static_cast<Document*>(context); + WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); + webFrame->client()->requestStorageQuota(webFrame, static_cast<WebStorageQuotaType>(storageType), newQuotaInBytes, new WebStorageQuotaCallbacksImpl(successCallback, errorCallback)); + } else if (errorCallback) { + // FIXME: calling this on worker is not yet supported. + fireStorageInfoErrorCallback(errorCallback, NOT_SUPPORTED_ERR); + } +} + +} // namespace WebCore + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h index ca7f88b..44a3cc7 100644 --- a/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h +++ b/Source/WebKit/chromium/src/VideoFrameChromiumImpl.h @@ -34,16 +34,14 @@ #include "VideoFrameChromium.h" #include "WebVideoFrame.h" -using namespace WebCore; - namespace WebKit { // A wrapper class for WebKit::WebVideoFrame. Objects can be created in WebKit // and used in WebCore because of the VideoFrameChromium interface. -class VideoFrameChromiumImpl : public VideoFrameChromium { +class VideoFrameChromiumImpl : public WebCore::VideoFrameChromium { public: // Converts a WebCore::VideoFrameChromium to a WebKit::WebVideoFrame. - static WebVideoFrame* toWebVideoFrame(VideoFrameChromium*); + static WebVideoFrame* toWebVideoFrame(WebCore::VideoFrameChromium*); // Creates a VideoFrameChromiumImpl object to wrap the given WebVideoFrame. // The VideoFrameChromiumImpl does not take ownership of the WebVideoFrame @@ -59,7 +57,7 @@ public: virtual int stride(unsigned plane) const; virtual const void* data(unsigned plane) const; virtual unsigned texture(unsigned plane) const; - virtual const IntSize requiredTextureSize(unsigned plane) const; + virtual const WebCore::IntSize requiredTextureSize(unsigned plane) const; virtual bool hasPaddingBytes(unsigned plane) const; private: diff --git a/Source/WebKit/chromium/src/WebDOMEventListener.cpp b/Source/WebKit/chromium/src/WebDOMEventListener.cpp index 93c1640..55d71a7 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListener.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListener.cpp @@ -33,6 +33,8 @@ #include "WebDOMEventListenerPrivate.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListener::WebDOMEventListener() diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp index 4edbeef..fb05823 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.cpp @@ -34,6 +34,8 @@ #include "EventListenerWrapper.h" #include "WebDOMEventListener.h" +using namespace WebCore; + namespace WebKit { WebDOMEventListenerPrivate::WebDOMEventListenerPrivate(WebDOMEventListener* webDOMEventListener) diff --git a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h index c86f427..2fe443f 100644 --- a/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h +++ b/Source/WebKit/chromium/src/WebDOMEventListenerPrivate.h @@ -39,8 +39,6 @@ namespace WebCore { class Node; } -using namespace WebCore; - namespace WebKit { class EventListenerWrapper; @@ -52,12 +50,12 @@ public: ~WebDOMEventListenerPrivate(); EventListenerWrapper* createEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Gets the ListenerEventWrapper for a specific node. // Used by WebNode::removeDOMEventListener(). EventListenerWrapper* getEventListenerWrapper( - const WebString& eventType, bool useCapture, Node* node); + const WebString& eventType, bool useCapture, WebCore::Node*); // Called by the WebDOMEventListener when it is about to be deleted. void webDOMEventListenerDeleted(); @@ -68,7 +66,7 @@ public: struct ListenerInfo { ListenerInfo(const WebString& eventType, bool useCapture, EventListenerWrapper* eventListenerWrapper, - Node* node) + WebCore::Node* node) : eventType(eventType) , useCapture(useCapture) , eventListenerWrapper(eventListenerWrapper) @@ -79,7 +77,7 @@ public: WebString eventType; bool useCapture; EventListenerWrapper* eventListenerWrapper; - Node* node; + WebCore::Node* node; }; private: diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp index 1366a80..3170aff 100644 --- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -82,7 +82,8 @@ void WebDataSourceImpl::redirectChain(WebVector<WebURL>& result) const WebString WebDataSourceImpl::pageTitle() const { - return title(); + // FIXME: use direction of title as well. + return title().string(); } WebNavigationType WebDataSourceImpl::navigationType() const diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index ee7ec09..66e3e95 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -92,7 +92,7 @@ WebString WebElement::innerText() const WebNode WebElement::shadowRoot() { - return adoptRef(unwrap<Element>()->shadowRoot()); + return adoptRef(static_cast<Node*>(unwrap<Element>()->shadowRoot())); } WebString WebElement::computeInheritedLanguage() const diff --git a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp index ef2409c..d7583c5 100644 --- a/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileChooserCompletionImpl.cpp @@ -46,8 +46,7 @@ void WebFileChooserCompletionImpl::didChooseFile(const WebVector<WebString>& fil { if (fileNames.size() == 1) m_fileChooser->chooseFile(fileNames[0]); - else { - // This clause handles a case of file_names.size()==0 too. + else if (fileNames.size() > 0) { Vector<WTF::String> paths; for (size_t i = 0; i < fileNames.size(); ++i) paths.append(fileNames[i]); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index fdfb14e..c06087d 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -90,6 +90,7 @@ #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" +#include "HitTestResult.h" #include "HTMLCollection.h" #include "HTMLFormElement.h" #include "HTMLFrameOwnerElement.h" @@ -106,6 +107,7 @@ #include "PluginDocument.h" #include "PrintContext.h" #include "RenderFrame.h" +#include "RenderLayer.h" #include "RenderObject.h" #include "RenderTreeAsText.h" #include "RenderView.h" @@ -140,6 +142,7 @@ #include "WebPerformance.h" #include "WebPlugin.h" #include "WebPluginContainerImpl.h" +#include "WebPoint.h" #include "WebRange.h" #include "WebRect.h" #include "WebScriptSource.h" @@ -161,8 +164,13 @@ #if USE(V8) #include "AsyncFileSystem.h" #include "AsyncFileSystemChromium.h" +#include "DirectoryEntry.h" #include "DOMFileSystem.h" +#include "FileEntry.h" +#include "V8DirectoryEntry.h" #include "V8DOMFileSystem.h" +#include "V8FileEntry.h" +#include "WebFileSystem.h" #endif using namespace WebCore; @@ -473,6 +481,13 @@ WebFrame* WebFrame::frameForCurrentContext() return WebFrameImpl::fromFrame(frame); } +#if WEBKIT_USING_V8 +WebFrame* WebFrame::frameForContext(v8::Handle<v8::Context> context) +{ + return WebFrameImpl::fromFrame(V8Proxy::retrieveFrame(context)); +} +#endif + WebFrame* WebFrame::fromFrameOwnerElement(const WebElement& element) { return WebFrameImpl::fromFrameOwnerElement( @@ -841,12 +856,24 @@ v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const return V8Proxy::mainWorldContext(m_frame); } -v8::Handle<v8::Value> WebFrameImpl::createFileSystem(int type, +v8::Handle<v8::Value> WebFrameImpl::createFileSystem(WebFileSystem::Type type, const WebString& name, const WebString& path) { return toV8(DOMFileSystem::create(frame()->document(), name, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), path))); } + +v8::Handle<v8::Value> WebFrameImpl::createFileEntry(WebFileSystem::Type type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory) +{ + RefPtr<DOMFileSystemBase> fileSystem = DOMFileSystem::create(frame()->document(), fileSystemName, AsyncFileSystemChromium::create(static_cast<AsyncFileSystem::Type>(type), fileSystemPath)); + if (isDirectory) + return toV8(DirectoryEntry::create(fileSystem, filePath)); + return toV8(FileEntry::create(fileSystem, filePath)); +} #endif bool WebFrameImpl::insertStyleText( @@ -1305,6 +1332,39 @@ bool WebFrameImpl::selectWordAroundCaret() return true; } +void WebFrameImpl::selectRange(const WebPoint& start, const WebPoint& end) +{ + VisibleSelection selection(visiblePositionForWindowPoint(start), + visiblePositionForWindowPoint(end)); + + if (frame()->selection()->shouldChangeSelection(selection)) + frame()->selection()->setSelection(selection, CharacterGranularity, + MakeNonDirectionalSelection); +} + +VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point) +{ + HitTestRequest::HitTestRequestType hitType = HitTestRequest::MouseMove; + hitType |= HitTestRequest::ReadOnly; + hitType |= HitTestRequest::Active; + HitTestRequest request(hitType); + FrameView* view = frame()->view(); + HitTestResult result(view->windowToContents( + view->convertFromContainingWindow(IntPoint(point.x, point.y)))); + + frame()->document()->renderView()->layer()->hitTest(request, result); + + // Matching the logic in MouseEventWithHitTestResults::targetNode() + Node* node = result.innerNode(); + if (!node) + return VisiblePosition(); + Element* element = node->parentElement(); + if (!node->inDocument() && element && element->inDocument()) + node = element; + + return node->renderer()->positionForPoint(result.localPoint()); +} + int WebFrameImpl::printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -1366,7 +1426,13 @@ float WebFrameImpl::printPage(int page, WebCanvas* canvas) return 0; } - return m_printContext->spoolPage(GraphicsContextBuilder(canvas).context(), page); + GraphicsContextBuilder builder(canvas); + GraphicsContext& gc = builder.context(); +#if WEBKIT_USING_SKIA + gc.platformContext()->setPrinting(true); +#endif + + return m_printContext->spoolPage(gc, page); } void WebFrameImpl::printEnd() @@ -1482,12 +1548,8 @@ bool WebFrameImpl::find(int identifier, m_activeMatchIndex = m_lastMatchCount - 1; } if (selectionRect) { - WebRect rect = frame()->view()->convertToContainingWindow(currSelectionRect); - rect.x -= frameView()->scrollOffset().width(); - rect.y -= frameView()->scrollOffset().height(); - *selectionRect = rect; - - reportFindInPageSelection(rect, m_activeMatchIndex + 1, identifier); + *selectionRect = frameView()->contentsToWindow(currSelectionRect); + reportFindInPageSelection(*selectionRect, m_activeMatchIndex + 1, identifier); } } } else { @@ -1624,10 +1686,8 @@ void WebFrameImpl::scopeStringMatches(int identifier, m_locatingActiveRect = false; // Notify browser of new location for the selected rectangle. - resultBounds.move(-frameView()->scrollOffset().width(), - -frameView()->scrollOffset().height()); reportFindInPageSelection( - frame()->view()->convertToContainingWindow(resultBounds), + frameView()->contentsToWindow(resultBounds), m_activeMatchIndex + 1, identifier); } diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 6129de1..572408a 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -109,9 +109,14 @@ public: virtual v8::Handle<v8::Value> executeScriptAndReturnValue( const WebScriptSource&); virtual v8::Local<v8::Context> mainWorldScriptContext() const; - virtual v8::Handle<v8::Value> createFileSystem(int type, + virtual v8::Handle<v8::Value> createFileSystem(WebFileSystem::Type, const WebString& name, const WebString& path); + virtual v8::Handle<v8::Value> createFileEntry(WebFileSystem::Type, + const WebString& fileSystemName, + const WebString& fileSystemPath, + const WebString& filePath, + bool isDirectory); #endif virtual bool insertStyleText(const WebString& css, const WebString& id); virtual void reload(bool ignoreCache); @@ -157,6 +162,7 @@ public: virtual WebString selectionAsText() const; virtual WebString selectionAsMarkup() const; virtual bool selectWordAroundCaret(); + virtual void selectRange(const WebPoint& start, const WebPoint& end); virtual int printBegin(const WebSize& pageSize, const WebNode& constrainToNode, int printerDPI, @@ -326,6 +332,9 @@ private: void loadJavaScriptURL(const WebCore::KURL&); + // Returns a hit-tested VisiblePosition for the given point + WebCore::VisiblePosition visiblePositionForWindowPoint(const WebPoint&); + FrameLoaderClientImpl m_frameLoaderClient; WebFrameClient* m_client; diff --git a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp index 876a489..9cb4aaa 100644 --- a/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp +++ b/Source/WebKit/chromium/src/WebHTTPLoadInfo.cpp @@ -89,6 +89,18 @@ void WebHTTPLoadInfo::setHTTPStatusText(const WebString& statusText) m_private->httpStatusText = statusText; } +long long WebHTTPLoadInfo::encodedDataLength() const +{ + ASSERT(!m_private.isNull()); + return m_private->encodedDataLength; +} + +void WebHTTPLoadInfo::setEncodedDataLength(long long encodedDataLength) +{ + ASSERT(!m_private.isNull()); + m_private->encodedDataLength = encodedDataLength; +} + static void addHeader(HTTPHeaderMap* map, const WebString& name, const WebString& value) { pair<HTTPHeaderMap::iterator, bool> result = map->add(name, value); @@ -108,4 +120,28 @@ void WebHTTPLoadInfo::addResponseHeader(const WebString& name, const WebString& addHeader(&m_private->responseHeaders, name, value); } +WebString WebHTTPLoadInfo::requestHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->requestHeadersText; +} + +void WebHTTPLoadInfo::setRequestHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->requestHeadersText = headersText; +} + +WebString WebHTTPLoadInfo::responseHeadersText() const +{ + ASSERT(!m_private.isNull()); + return m_private->responseHeadersText; +} + +void WebHTTPLoadInfo::setResponseHeadersText(const WebString& headersText) +{ + ASSERT(!m_private.isNull()); + m_private->responseHeadersText = headersText; +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index ce307a4..24d3f6c 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,10 +26,12 @@ #include "config.h" #include "WebIDBCallbacksImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacks.h" #include "IDBCursorBackendProxy.h" +#include "IDBDatabaseBackendProxy.h" #include "IDBDatabaseError.h" -#include "IDBDatabaseProxy.h" #include "IDBKey.h" #include "IDBTransactionBackendProxy.h" #include "WebIDBCallbacks.h" @@ -39,9 +41,9 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) +using namespace WebCore; -namespace WebCore { +namespace WebKit { WebIDBCallbacksImpl::WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks> callbacks) : m_callbacks(callbacks) @@ -52,32 +54,32 @@ WebIDBCallbacksImpl::~WebIDBCallbacksImpl() { } -void WebIDBCallbacksImpl::onError(const WebKit::WebIDBDatabaseError& error) +void WebIDBCallbacksImpl::onError(const WebIDBDatabaseError& error) { m_callbacks->onError(error); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBCursor* cursor) +void WebIDBCallbacksImpl::onSuccess(WebIDBCursor* cursor) { m_callbacks->onSuccess(IDBCursorBackendProxy::create(cursor)); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBDatabase* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBDatabase* webKitInstance) { - m_callbacks->onSuccess(IDBDatabaseProxy::create(webKitInstance)); + m_callbacks->onSuccess(IDBDatabaseBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebIDBKey& key) +void WebIDBCallbacksImpl::onSuccess(const WebIDBKey& key) { m_callbacks->onSuccess(key); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBTransaction* webKitInstance) +void WebIDBCallbacksImpl::onSuccess(WebIDBTransaction* webKitInstance) { m_callbacks->onSuccess(IDBTransactionBackendProxy::create(webKitInstance)); } -void WebIDBCallbacksImpl::onSuccess(const WebKit::WebSerializedScriptValue& serializedScriptValue) +void WebIDBCallbacksImpl::onSuccess(const WebSerializedScriptValue& serializedScriptValue) { m_callbacks->onSuccess(serializedScriptValue); } @@ -87,6 +89,6 @@ void WebIDBCallbacksImpl::onBlocked() m_callbacks->onBlocked(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h index 057aa25..c486601 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,35 +26,35 @@ #ifndef WebIDBCallbacksImpl_h #define WebIDBCallbacksImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebIDBCallbacks.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -#if ENABLE(INDEXED_DATABASE) - -namespace WebCore { +namespace WebCore { class IDBCallbacks; } -class IDBCallbacks; +namespace WebKit { -class WebIDBCallbacksImpl : public WebKit::WebIDBCallbacks { +class WebIDBCallbacksImpl : public WebIDBCallbacks { public: - WebIDBCallbacksImpl(PassRefPtr<IDBCallbacks>); + WebIDBCallbacksImpl(PassRefPtr<WebCore::IDBCallbacks>); virtual ~WebIDBCallbacksImpl(); - virtual void onError(const WebKit::WebIDBDatabaseError&); - virtual void onSuccess(WebKit::WebIDBCursor*); - virtual void onSuccess(WebKit::WebIDBDatabase*); - virtual void onSuccess(const WebKit::WebIDBKey&); - virtual void onSuccess(WebKit::WebIDBTransaction*); - virtual void onSuccess(const WebKit::WebSerializedScriptValue&); + virtual void onError(const WebIDBDatabaseError&); + virtual void onSuccess(WebIDBCursor*); + virtual void onSuccess(WebIDBDatabase*); + virtual void onSuccess(const WebIDBKey&); + virtual void onSuccess(WebIDBTransaction*); + virtual void onSuccess(const WebSerializedScriptValue&); virtual void onBlocked(); private: - RefPtr<IDBCallbacks> m_callbacks; + RefPtr<WebCore::IDBCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp index 86c4f57..6c0012e 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBCursorImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBAny.h" #include "IDBCallbacksProxy.h" #include "IDBCursorBackendInterface.h" @@ -80,4 +82,6 @@ void WebIDBCursorImpl::deleteFunction(WebIDBCallbacks* callbacks, WebExceptionCo m_idbCursorBackend->deleteFunction(IDBCallbacksProxy::create(callbacks), ec); } -} // namespace WebCore +} // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBCursorImpl.h b/Source/WebKit/chromium/src/WebIDBCursorImpl.h index de17a99..c237920 100644 --- a/Source/WebKit/chromium/src/WebIDBCursorImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCursorImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBCursorImpl_h #define WebIDBCursorImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBCursor.h" @@ -56,4 +58,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBCursorImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp index 3ca0274..0fec84a 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.cpp @@ -31,7 +31,9 @@ #include "IDBDatabaseCallbacks.h" #include "WebString.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBDatabaseCallbacksImpl::WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks> callbacks) : m_callbacks(callbacks) @@ -42,11 +44,11 @@ WebIDBDatabaseCallbacksImpl::~WebIDBDatabaseCallbacksImpl() { } -void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebKit::WebString& version) +void WebIDBDatabaseCallbacksImpl::onVersionChange(const WebString& version) { m_callbacks->onVersionChange(version); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h index ba3dc5e..d4916af 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseCallbacksImpl.h @@ -34,23 +34,23 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBDatabaseCallbacks; } -class IDBDatabaseCallbacks; +namespace WebKit { -class WebIDBDatabaseCallbacksImpl : public WebKit::WebIDBDatabaseCallbacks { +class WebIDBDatabaseCallbacksImpl : public WebIDBDatabaseCallbacks { public: - WebIDBDatabaseCallbacksImpl(PassRefPtr<IDBDatabaseCallbacks>); + WebIDBDatabaseCallbacksImpl(PassRefPtr<WebCore::IDBDatabaseCallbacks>); virtual ~WebIDBDatabaseCallbacksImpl(); - virtual void onVersionChange(const WebKit::WebString& version); + virtual void onVersionChange(const WebString& version); private: - RefPtr<IDBDatabaseCallbacks> m_callbacks; + RefPtr<WebCore::IDBDatabaseCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBDatabaseCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp index 7413ae6..25e202c 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,11 +31,11 @@ #include "config.h" #include "WebIDBDatabaseError.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBDatabaseError.h" #include "WebString.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp index 2a97923..92dd5ad 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBDatabaseImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBDatabaseBackendInterface.h" @@ -36,8 +38,6 @@ #include "WebIDBObjectStoreImpl.h" #include "WebIDBTransactionImpl.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -112,6 +112,6 @@ void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks) m_databaseBackend->open(m_databaseCallbacks); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h index 0e1d03e..061f5c2 100644 --- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h +++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +26,19 @@ #ifndef WebIDBDatabaseImpl_h #define WebIDBDatabaseImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebExceptionCode.h" #include "WebIDBDatabase.h" #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { -class IDBDatabaseBackendInterface; -class IDBDatabaseCallbacksProxy; -} +namespace WebCore { class IDBDatabaseBackendInterface; } namespace WebKit { +class IDBDatabaseCallbacksProxy; class WebIDBDatabaseCallbacks; class WebIDBObjectStore; class WebIDBTransaction; @@ -63,9 +63,11 @@ public: private: WTF::RefPtr<WebCore::IDBDatabaseBackendInterface> m_databaseBackend; - WTF::RefPtr<WebCore::IDBDatabaseCallbacksProxy> m_databaseCallbacks; + WTF::RefPtr<IDBDatabaseCallbacksProxy> m_databaseCallbacks; }; } // namespace WebKit #endif // WebIDBDatabaseImpl_h + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 3e21af5..793698e 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,6 +31,8 @@ #include "config.h" #include "WebIDBFactoryImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBFactoryBackendImpl.h" @@ -38,8 +40,6 @@ #include "WebIDBDatabaseError.h" #include <wtf/OwnPtr.h> -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -50,7 +50,7 @@ WebIDBFactory* WebIDBFactory::create() } WebIDBFactoryImpl::WebIDBFactoryImpl() - : m_idbFactoryBackend(WebCore::IDBFactoryBackendImpl::create()) + : m_idbFactoryBackend(IDBFactoryBackendImpl::create()) { } diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h index 0ffd289..62bd9ed 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +29,8 @@ #ifndef WebIDBFactoryImpl_h #define WebIDBFactoryImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebDOMStringList.h" #include "WebIDBFactory.h" #include <wtf/RefPtr.h> @@ -50,4 +52,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBFactoryImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp index 6e8e1f2..fa33da9 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBIndexImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBCallbacksProxy.h" #include "IDBIndex.h" #include "IDBKeyRange.h" @@ -33,8 +35,6 @@ #include "WebIDBKey.h" #include "WebIDBKeyRange.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -88,6 +88,6 @@ void WebIDBIndexImpl::getKey(const WebIDBKey& keyRange, WebIDBCallbacks* callbac m_backend->getKey(keyRange, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBIndexImpl.h b/Source/WebKit/chromium/src/WebIDBIndexImpl.h index f68da7f..b047c2f 100644 --- a/Source/WebKit/chromium/src/WebIDBIndexImpl.h +++ b/Source/WebKit/chromium/src/WebIDBIndexImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBIndexImpl_h #define WebIDBIndexImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBIndex.h" #include <wtf/PassRefPtr.h> @@ -57,4 +59,6 @@ private: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBIndexImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBKey.cpp b/Source/WebKit/chromium/src/WebIDBKey.cpp index a20146e..f20347a 100644 --- a/Source/WebKit/chromium/src/WebIDBKey.cpp +++ b/Source/WebKit/chromium/src/WebIDBKey.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -80,7 +80,7 @@ WebIDBKey WebIDBKey::createFromValueAndKeyPath(const WebSerializedScriptValue& s { if (serializedScriptValue.isNull()) return WebIDBKey::createInvalid(); - return WebCore::createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); + return createIDBKeyFromSerializedValueAndKeyPath(serializedScriptValue, idbKeyPath); } WebSerializedScriptValue WebIDBKey::injectIDBKeyIntoSerializedValue(const WebIDBKey& key, const WebSerializedScriptValue& value, const WebIDBKeyPath& path) diff --git a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp index 9eb33d6..309c0d9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyPath.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyPath.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,7 +67,7 @@ void WebIDBKeyPath::reset() m_private.reset(0); } -WebIDBKeyPath::operator const WTF::Vector<WebCore::IDBKeyPathElement, 0>&() const +WebIDBKeyPath::operator const WTF::Vector<IDBKeyPathElement, 0>&() const { return *m_private.get(); } diff --git a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp index 517ff00..ea641e9 100644 --- a/Source/WebKit/chromium/src/WebIDBKeyRange.cpp +++ b/Source/WebKit/chromium/src/WebIDBKeyRange.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,11 +26,13 @@ #include "config.h" #include "WebIDBKeyRange.h" +#if ENABLE(INDEXED_DATABASE) + #include "IDBKey.h" #include "IDBKeyRange.h" #include "WebIDBKey.h" -using WebCore::IDBKeyRange; +using namespace WebCore; namespace WebKit { @@ -93,3 +95,5 @@ WebIDBKeyRange::operator PassRefPtr<IDBKeyRange>() const } } // namespace WebKit + +#endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 56e354d..0a67f36 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #include "config.h" #include "WebIDBObjectStoreImpl.h" +#if ENABLE(INDEXED_DATABASE) + #include "DOMStringList.h" #include "IDBCallbacksProxy.h" #include "IDBIndexBackendInterface.h" @@ -37,8 +39,6 @@ #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" -#if ENABLE(INDEXED_DATABASE) - using namespace WebCore; namespace WebKit { @@ -113,6 +113,6 @@ void WebIDBObjectStoreImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned m_objectStore->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h index 3e2dfab..f1093ed 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,6 +26,8 @@ #ifndef WebIDBObjectStoreImpl_h #define WebIDBObjectStoreImpl_h +#if ENABLE(INDEXED_DATABASE) + #include "WebCommon.h" #include "WebIDBObjectStore.h" #include <wtf/PassRefPtr.h> @@ -64,4 +66,6 @@ public: } // namespace WebKit +#endif // ENABLE(INDEXED_DATABASE) + #endif // WebIDBObjectStoreImpl_h diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp index 848182e..2f16477 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,7 +30,9 @@ #include "IDBTransactionCallbacks.h" -namespace WebCore { +using namespace WebCore; + +namespace WebKit { WebIDBTransactionCallbacksImpl::WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks> callbacks) : m_callbacks(callbacks) @@ -51,6 +53,6 @@ void WebIDBTransactionCallbacksImpl::onComplete() m_callbacks->onComplete(); } -} // namespace WebCore +} // namespace WebKit #endif // ENABLE(INDEXED_DATABASE) diff --git a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h index 416ac3c..8acb095 100644 --- a/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBTransactionCallbacksImpl.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,24 +32,24 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> -namespace WebCore { +namespace WebCore { class IDBTransactionCallbacks; } -class IDBTransactionCallbacks; +namespace WebKit { -class WebIDBTransactionCallbacksImpl : public WebKit::WebIDBTransactionCallbacks { +class WebIDBTransactionCallbacksImpl : public WebIDBTransactionCallbacks { public: - WebIDBTransactionCallbacksImpl(PassRefPtr<IDBTransactionCallbacks>); + WebIDBTransactionCallbacksImpl(PassRefPtr<WebCore::IDBTransactionCallbacks>); virtual ~WebIDBTransactionCallbacksImpl(); virtual void onAbort(); virtual void onComplete(); private: - RefPtr<IDBTransactionCallbacks> m_callbacks; + RefPtr<WebCore::IDBTransactionCallbacks> m_callbacks; }; -} // namespace WebCore +} // namespace WebKit -#endif +#endif // ENABLE(INDEXED_DATABASE) #endif // WebIDBTransactionCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index abe9cbf..dbea93e 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -189,12 +189,18 @@ void WebMediaPlayerClientImpl::playbackStateChanged() m_mediaPlayer->playbackStateChanged(); } +WebMediaPlayer::Preload WebMediaPlayerClientImpl::preload() const +{ + if (m_mediaPlayer) + return static_cast<WebMediaPlayer::Preload>(m_mediaPlayer->preload()); + return static_cast<WebMediaPlayer::Preload>(m_preload); +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) { - Frame* frame = static_cast<HTMLMediaElement*>( - m_mediaPlayer->mediaPlayerClient())->document()->frame(); + m_url = url; // Video frame object is owned by WebMediaPlayer. Before destroying // WebMediaPlayer all frames need to be released. @@ -203,9 +209,19 @@ void WebMediaPlayerClientImpl::load(const String& url) m_videoLayer->releaseCurrentFrame(); #endif + if (m_preload == MediaPlayer::None) { + m_webMediaPlayer.clear(); + m_delayingLoad = true; + } else + loadInternal(); +} + +void WebMediaPlayerClientImpl::loadInternal() +{ + Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame(); m_webMediaPlayer.set(createWebMediaPlayer(this, frame)); if (m_webMediaPlayer.get()) - m_webMediaPlayer->load(KURL(ParsedURLString, url)); + m_webMediaPlayer->load(KURL(ParsedURLString, m_url)); } void WebMediaPlayerClientImpl::cancelLoad() @@ -242,6 +258,12 @@ void WebMediaPlayerClientImpl::pause() m_webMediaPlayer->pause(); } +void WebMediaPlayerClientImpl::prepareToPlay() +{ + if (m_delayingLoad) + startDelayedLoad(); +} + IntSize WebMediaPlayerClientImpl::naturalSize() const { if (m_webMediaPlayer.get()) @@ -438,10 +460,15 @@ void WebMediaPlayerClientImpl::paintCurrentFrameInContext(GraphicsContext* conte } } -void WebMediaPlayerClientImpl::setAutobuffer(bool autoBuffer) +void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) { + m_preload = preload; + if (m_webMediaPlayer.get()) - m_webMediaPlayer->setAutoBuffer(autoBuffer); + m_webMediaPlayer->setPreload(static_cast<WebMediaPlayer::Preload>(preload)); + + if (m_delayingLoad && m_preload != MediaPlayer::None) + startDelayedLoad(); } bool WebMediaPlayerClientImpl::hasSingleSecurityOrigin() const @@ -566,8 +593,20 @@ MediaPlayer::SupportsType WebMediaPlayerClientImpl::supportsType(const String& t return MediaPlayer::IsNotSupported; } +void WebMediaPlayerClientImpl::startDelayedLoad() +{ + ASSERT(m_delayingLoad); + ASSERT(!m_webMediaPlayer.get()); + + m_delayingLoad = false; + + loadInternal(); +} + WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() : m_mediaPlayer(0) + , m_delayingLoad(false) + , m_preload(MediaPlayer::MetaData) #if USE(ACCELERATED_COMPOSITING) , m_videoLayer(0) , m_supportsAcceleratedCompositing(false) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 22030b3..a08bb3a 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -77,6 +77,7 @@ public: virtual void sawUnsupportedTracks(); virtual float volume() const; virtual void playbackStateChanged(); + virtual WebMediaPlayer::Preload preload() const; // MediaPlayerPrivateInterface methods: virtual void load(const WTF::String& url); @@ -87,6 +88,7 @@ public: virtual WebCore::PlatformMedia platformMedia() const; virtual void play(); virtual void pause(); + virtual void prepareToPlay(); virtual bool supportsFullscreen() const; virtual bool supportsSave() const; virtual WebCore::IntSize naturalSize() const; @@ -106,13 +108,13 @@ public: virtual float maxTimeSeekable() const; virtual WTF::PassRefPtr<WebCore::TimeRanges> buffered() const; virtual int dataRate() const; - virtual void setAutobuffer(bool); virtual bool totalBytesKnown() const; virtual unsigned totalBytes() const; virtual unsigned bytesLoaded() const; virtual void setSize(const WebCore::IntSize&); virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); virtual void paintCurrentFrameInContext(WebCore::GraphicsContext*, const WebCore::IntRect&); + virtual void setPreload(WebCore::MediaPlayer::Preload); virtual bool hasSingleSecurityOrigin() const; virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; virtual unsigned decodedFrameCount() const; @@ -129,6 +131,8 @@ public: private: WebMediaPlayerClientImpl(); + void startDelayedLoad(); + void loadInternal(); static WebCore::MediaPlayerPrivateInterface* create(WebCore::MediaPlayer*); static void getSupportedTypes(WTF::HashSet<WTF::String>&); @@ -140,6 +144,9 @@ private: WebCore::MediaPlayer* m_mediaPlayer; OwnPtr<WebMediaPlayer> m_webMediaPlayer; + String m_url; + bool m_delayingLoad; + WebCore::MediaPlayer::Preload m_preload; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebCore::VideoLayerChromium> m_videoLayer; bool m_supportsAcceleratedCompositing; diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index 68b6f13..cfb8528 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -152,7 +152,7 @@ bool WebNode::isFocusable() const bool WebNode::isContentEditable() const { - return m_private->rendererIsEditable(); + return m_private->isContentEditable(); } bool WebNode::isElementNode() const diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp index 4b65b9e..280747f 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.cpp @@ -295,7 +295,7 @@ void WebPageSerializerImpl::encodeAndFlushBuffer( status); } -void WebPageSerializerImpl::openTagToString(const Element* element, +void WebPageSerializerImpl::openTagToString(Element* element, SerializeDomParam* param) { // FIXME: use StringBuilder instead of String. @@ -328,11 +328,13 @@ void WebPageSerializerImpl::openTagToString(const Element* element, result += attrValue; else { // Get the absolute link - String completeURL = param->document->completeURL(attrValue); + WebFrameImpl* subFrame = WebFrameImpl::fromFrameOwnerElement(element); + String completeURL = subFrame ? subFrame->frame()->document()->url() : + param->document->completeURL(attrValue); // Check whether we have local files for those link. if (m_localLinks.contains(completeURL)) { - if (!m_localDirectoryName.isEmpty()) - result += "./" + m_localDirectoryName + "/"; + if (!param->directoryName.isEmpty()) + result += "./" + param->directoryName + "/"; result += m_localLinks.get(completeURL); } else result += completeURL; @@ -360,7 +362,7 @@ void WebPageSerializerImpl::openTagToString(const Element* element, } // Serialize end tag of an specified element. -void WebPageSerializerImpl::endTagToString(const Element* element, +void WebPageSerializerImpl::endTagToString(Element* element, SerializeDomParam* param) { bool needSkip; @@ -397,18 +399,18 @@ void WebPageSerializerImpl::endTagToString(const Element* element, saveHTMLContentToBuffer(result, param); } -void WebPageSerializerImpl::buildContentForNode(const Node* node, +void WebPageSerializerImpl::buildContentForNode(Node* node, SerializeDomParam* param) { switch (node->nodeType()) { case Node::ELEMENT_NODE: // Process open tag of element. - openTagToString(static_cast<const Element*>(node), param); + openTagToString(static_cast<Element*>(node), param); // Walk through the children nodes and process it. - for (const Node *child = node->firstChild(); child; child = child->nextSibling()) + for (Node *child = node->firstChild(); child; child = child->nextSibling()) buildContentForNode(child, param); // Process end tag of element. - endTagToString(static_cast<const Element*>(node), param); + endTagToString(static_cast<Element*>(node), param); break; case Node::TEXT_NODE: saveHTMLContentToBuffer(createMarkup(node), param); diff --git a/Source/WebKit/chromium/src/WebPageSerializerImpl.h b/Source/WebKit/chromium/src/WebPageSerializerImpl.h index 5ee8805..b53bd66 100644 --- a/Source/WebKit/chromium/src/WebPageSerializerImpl.h +++ b/Source/WebKit/chromium/src/WebPageSerializerImpl.h @@ -174,13 +174,13 @@ private: SerializeDomParam* param, FlushOption); // Serialize open tag of an specified element. - void openTagToString(const WebCore::Element* element, + void openTagToString(WebCore::Element*, SerializeDomParam* param); // Serialize end tag of an specified element. - void endTagToString(const WebCore::Element* element, + void endTagToString(WebCore::Element*, SerializeDomParam* param); // Build content for a specified node - void buildContentForNode(const WebCore::Node* node, + void buildContentForNode(WebCore::Node*, SerializeDomParam* param); }; diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index 40f8625..150f173 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -480,12 +480,11 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) return; if (event->type() == eventNames().mousedownEvent) { - // Ensure that the frame containing the plugin has focus. Frame* containingFrame = parentView->frame(); if (Page* currentPage = containingFrame->page()) - currentPage->focusController()->setFocusedFrame(containingFrame); - // Give focus to our containing HTMLPluginElement. - containingFrame->document()->setFocusedNode(m_element); + currentPage->focusController()->setFocusedNode(m_element, containingFrame); + else + containingFrame->document()->setFocusedNode(m_element); } WebCursorInfo cursorInfo; diff --git a/Source/WebKit/chromium/src/WebPopupMenuImpl.h b/Source/WebKit/chromium/src/WebPopupMenuImpl.h index 7bb9f7e..58a883f 100644 --- a/Source/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/Source/WebKit/chromium/src/WebPopupMenuImpl.h @@ -78,6 +78,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const { return false; } diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index 256bf56..5d64cc8 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -320,4 +320,20 @@ bool WebRuntimeFeatures::isJavaScriptI18NAPIEnabled() #endif } +void WebRuntimeFeatures::enableQuota(bool enable) +{ +#if ENABLE(QUOTA) + RuntimeEnabledFeatures::setQuotaEnabled(enable); +#endif +} + +bool WebRuntimeFeatures::isQuotaEnabled() +{ +#if ENABLE(QUOTA) + return RuntimeEnabledFeatures::quotaEnabled(); +#else + return false; +#endif +} + } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp index 57ea92e..41fac66 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.cpp +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.cpp @@ -281,12 +281,16 @@ void WebScrollbarImpl::invalidateScrollbarRect(Scrollbar*, const IntRect& rect) m_client->invalidateScrollbarRect(this, webrect); } +void WebScrollbarImpl::invalidateScrollCornerRect(const IntRect&) +{ +} + bool WebScrollbarImpl::isActive() const { return true; } -bool WebScrollbarImpl::scrollbarCornerPresent() const +bool WebScrollbarImpl::isScrollCornerVisible() const { return false; } diff --git a/Source/WebKit/chromium/src/WebScrollbarImpl.h b/Source/WebKit/chromium/src/WebScrollbarImpl.h index ac120cf..82fdbfd 100644 --- a/Source/WebKit/chromium/src/WebScrollbarImpl.h +++ b/Source/WebKit/chromium/src/WebScrollbarImpl.h @@ -62,8 +62,10 @@ public: virtual int scrollPosition(WebCore::Scrollbar*) const; virtual void setScrollOffset(const WebCore::IntPoint&); virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); + virtual void invalidateScrollCornerRect(const WebCore::IntRect&); virtual bool isActive() const; - virtual bool scrollbarCornerPresent() const; + virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } + virtual bool isScrollCornerVisible() const; virtual void getTickmarks(Vector<WebCore::IntRect>&) const; virtual WebCore::Scrollbar* horizontalScrollbar() const; virtual WebCore::Scrollbar* verticalScrollbar() const; diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index 1089af9..c5b60cc 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -343,6 +343,11 @@ void WebSettingsImpl::setAcceleratedCompositingForAnimationEnabled(bool enabled) m_settings->setAcceleratedCompositingForAnimationEnabled(enabled); } +void WebSettingsImpl::setAcceleratedDrawingEnabled(bool enabled) +{ + m_settings->setAcceleratedDrawingEnabled(enabled); +} + void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) { m_settings->setAccelerated2dCanvasEnabled(enabled); @@ -373,6 +378,11 @@ void WebSettingsImpl::setInteractiveFormValidationEnabled(bool enabled) m_settings->setInteractiveFormValidationEnabled(enabled); } +void WebSettingsImpl::setValidationMessageTimerMagnification(int newValue) +{ + m_settings->setValidationMessageTimerMagnification(newValue); +} + void WebSettingsImpl::setMinimumTimerInterval(double interval) { m_settings->setMinDOMTimerInterval(interval); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index d0319f8..57aa804 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -101,13 +101,15 @@ public: virtual void setAcceleratedCompositingForVideoEnabled(bool); virtual void setAcceleratedCompositingForPluginsEnabled(bool); virtual void setAcceleratedCompositingForCanvasEnabled(bool); - virtual void setAcceleratedCompositingForAnimationEnabled(bool); + virtual void setAcceleratedCompositingForAnimationEnabled(bool); virtual void setAccelerated2dCanvasEnabled(bool); + virtual void setAcceleratedDrawingEnabled(bool); virtual void setMemoryInfoEnabled(bool); virtual void setHyperlinkAuditingEnabled(bool); virtual void setAsynchronousSpellCheckingEnabled(bool); virtual void setCaretBrowsingEnabled(bool); virtual void setInteractiveFormValidationEnabled(bool); + virtual void setValidationMessageTimerMagnification(int); virtual void setMinimumTimerInterval(double); virtual void setFullScreenEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp new file mode 100644 index 0000000..75a3a8a --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebStorageQuotaCallbacksImpl.h" + +#if ENABLE(QUOTA) + +#include "DOMCoreException.h" +#include "StorageInfoErrorCallback.h" +#include "StorageInfoQuotaCallback.h" +#include "StorageInfoUsageCallback.h" + +using namespace WebCore; + +namespace WebKit { + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback> usageCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_usageCallback(usageCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback> quotaCallback, PassRefPtr<WebCore::StorageInfoErrorCallback> errorCallback) + : m_quotaCallback(quotaCallback) + , m_errorCallback(errorCallback) +{ +} + +WebStorageQuotaCallbacksImpl::~WebStorageQuotaCallbacksImpl() +{ +} + +void WebStorageQuotaCallbacksImpl::didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes) +{ + if (m_usageCallback) + m_usageCallback->handleEvent(usageInBytes, quotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didGrantStorageQuota(unsigned long long grantedQuotaInBytes) +{ + if (m_quotaCallback) + m_quotaCallback->handleEvent(grantedQuotaInBytes); + delete this; +} + +void WebStorageQuotaCallbacksImpl::didFail(WebStorageQuotaError error) +{ + if (m_errorCallback) { + ExceptionCodeDescription description; + getExceptionCodeDescription(static_cast<ExceptionCode>(error), description); + m_errorCallback->handleEvent(DOMCoreException::create(description).get()); + } + delete this; +} + +} // namespace WebKit + +#endif // ENABLE(QUOTA) diff --git a/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h new file mode 100644 index 0000000..e8209f5 --- /dev/null +++ b/Source/WebKit/chromium/src/WebStorageQuotaCallbacksImpl.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef WebStorageQuotaCallbacksImpl_h +#define WebStorageQuotaCallbacksImpl_h + +#include "WebStorageQuotaCallbacks.h" +#include <wtf/PassOwnPtr.h> +#include <wtf/PassRefPtr.h> +#include <wtf/RefPtr.h> + +namespace WebCore { +class StorageInfoErrorCallback; +class StorageInfoQuotaCallback; +class StorageInfoUsageCallback; +} + +namespace WebKit { + +class WebStorageQuotaCallbacksImpl : public WebStorageQuotaCallbacks { +public: + // The class is self-destructed and thus we have bare constructors. + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoUsageCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + WebStorageQuotaCallbacksImpl(PassRefPtr<WebCore::StorageInfoQuotaCallback>, PassRefPtr<WebCore::StorageInfoErrorCallback>); + + virtual ~WebStorageQuotaCallbacksImpl(); + + virtual void didQueryStorageUsageAndQuota(unsigned long long usageInBytes, unsigned long long quotaInBytes); + virtual void didGrantStorageQuota(unsigned long long grantedQuotaInBytes); + virtual void didFail(WebStorageQuotaError); + +private: + RefPtr<WebCore::StorageInfoUsageCallback> m_usageCallback; + RefPtr<WebCore::StorageInfoQuotaCallback> m_quotaCallback; + RefPtr<WebCore::StorageInfoErrorCallback> m_errorCallback; +}; + +} // namespace WebKit + +#endif // WebStorageQuotaCallbacksImpl_h diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index b9e5227..f5a6604 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -34,16 +34,31 @@ #include "SpellChecker.h" #include "WebTextCheckingResult.h" #include "WebVector.h" +#include <wtf/Assertions.h> using namespace WebCore; namespace WebKit { -static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +static TextCheckingType toCoreCheckingType(WebTextCheckingResult::Error error) { - Vector<SpellCheckingResult> coreResults; - for (size_t i = 0; i < results.size(); ++i) - coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length)); + if (error == WebTextCheckingResult::ErrorSpelling) + return TextCheckingTypeSpelling; + ASSERT(error == WebTextCheckingResult::ErrorGrammar); + return TextCheckingTypeGrammar; +} + +static Vector<TextCheckingResult> toCoreResults(const WebVector<WebTextCheckingResult>& results) +{ + Vector<TextCheckingResult> coreResults; + for (size_t i = 0; i < results.size(); ++i) { + TextCheckingResult coreResult; + coreResult.type = toCoreCheckingType(results[i].error); + coreResult.location = results[i].position; + coreResult.length = results[i].length; + coreResults.append(coreResult); + } + return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 4efa880..2438a94 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -102,6 +102,7 @@ #include "WebDevToolsAgentPrivate.h" #include "WebDragData.h" #include "WebFrameImpl.h" +#include "WebGraphicsContext3D.h" #include "WebImage.h" #include "WebInputElement.h" #include "WebInputEvent.h" @@ -125,7 +126,7 @@ #include <wtf/CurrentTime.h> #include <wtf/RefPtr.h> -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> #endif @@ -620,11 +621,6 @@ bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) } #endif // OS(WINDOWS) || OS(LINUX) || OS(FREEBSD) - // It's not clear if we should continue after detecting a capslock keypress. - // I'll err on the side of continuing, which is the pre-existing behaviour. - if (event.windowsKeyCode == VKEY_CAPITAL) - handler->capsLockStateMayHaveChanged(); - PlatformKeyboardEventBuilder evt(event); if (handler->keyEvent(evt)) { @@ -1043,7 +1039,7 @@ void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect // PlatformGraphicsContext is actually a pointer to PlatformContextSkia GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); -#elif PLATFORM(CG) +#elif USE(CG) GraphicsContext gc(canvas); int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); #else @@ -1273,7 +1269,7 @@ void WebViewImpl::setFocus(bool enable) Element* element = static_cast<Element*>(focusedNode); if (element->isTextFormControl()) element->updateFocusAppearance(true); - else if (focusedNode->rendererIsEditable()) { + else if (focusedNode->isContentEditable()) { // updateFocusAppearance() selects all the text of // contentseditable DIVs. So we set the selection explicitly // instead. Note that this has the side effect of moving the @@ -1335,7 +1331,7 @@ bool WebViewImpl::setComposition( PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1384,7 +1380,7 @@ bool WebViewImpl::confirmComposition(const WebString& text) PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->rendererIsEditable()) + if (!node || !node->isContentEditable()) return false; } @@ -1443,22 +1439,53 @@ WebRect WebViewImpl::caretOrSelectionBounds() if (!view) return rect; - const Node* node = controller->start().deprecatedNode(); + const Node* node = controller->base().containerNode(); if (!node || !node->renderer()) return rect; if (controller->isCaret()) rect = view->contentsToWindow(controller->absoluteCaretBounds()); else if (controller->isRange()) { - node = controller->end().deprecatedNode(); - if (!node || !node->renderer()) - return rect; + node = controller->extent().containerNode(); RefPtr<Range> range = controller->toNormalizedRange(); + if (!node || !node->renderer() || !range) + return rect; rect = view->contentsToWindow(focused->editor()->firstRectForRange(range.get())); } return rect; } +bool WebViewImpl::selectionRange(WebPoint& start, WebPoint& end) const +{ + const Frame* frame = focusedWebCoreFrame(); + if (!frame) + return false; + RefPtr<Range> selectedRange = frame->selection()->toNormalizedRange(); + RefPtr<Range> range(Range::create(selectedRange->startContainer()->document(), + selectedRange->startContainer(), + selectedRange->startOffset(), + selectedRange->startContainer(), + selectedRange->startOffset())); + + IntRect rect = frame->editor()->firstRectForRange(range.get()); + start.x = rect.x(); + start.y = rect.y() + rect.height() - 1; + + range = Range::create(selectedRange->endContainer()->document(), + selectedRange->endContainer(), + selectedRange->endOffset(), + selectedRange->endContainer(), + selectedRange->endOffset()); + + rect = frame->editor()->firstRectForRange(range.get()); + end.x = rect.x() + rect.width() - 1; + end.y = rect.y() + rect.height() - 1; + + start = frame->view()->contentsToWindow(start); + end = frame->view()->contentsToWindow(end); + return true; +} + void WebViewImpl::setTextDirection(WebTextDirection direction) { // The Editor::setBaseWritingDirection() function checks if we can change @@ -1793,21 +1820,6 @@ void WebViewImpl::dragSourceSystemDragEnded() } WebDragOperation WebViewImpl::dragTargetDragEnter( - const WebDragData& webDragData, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed) -{ - ASSERT(!m_currentDragData.get()); - - m_currentDragData = webDragData; - UNUSED_PARAM(identity); - m_operationsAllowed = operationsAllowed; - - return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); -} - -WebDragOperation WebViewImpl::dragTargetDragEnter( const WebDragData& webDragData, const WebPoint& clientPoint, const WebPoint& screenPoint, @@ -2367,35 +2379,6 @@ private: WebViewImpl* m_webViewImpl; }; -class WebViewImplScrollbarPainter : public TilePaintInterface { - WTF_MAKE_NONCOPYABLE(WebViewImplScrollbarPainter); -public: - static PassOwnPtr<WebViewImplScrollbarPainter> create(WebViewImpl* webViewImpl) - { - return adoptPtr(new WebViewImplScrollbarPainter(webViewImpl)); - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - - context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); - IntRect windowRect = view->contentsToWindow(contentRect); - view->paintScrollbars(&context, windowRect); - } - -private: - explicit WebViewImplScrollbarPainter(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - WebViewImpl* m_webViewImpl; -}; - void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { PlatformBridge::histogramEnumeration("GPU.setIsAcceleratedCompositingActive", active * 2 + m_isAcceleratedCompositingActive, 4); @@ -2425,7 +2408,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } - m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + + m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this)); if (m_layerRenderer) { m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; @@ -2463,10 +2447,13 @@ void WebViewImpl::doComposite() void WebViewImpl::reallocateRenderer() { - RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create( + RefPtr<GraphicsContext3D> newContext = m_temporaryOnscreenGraphicsContext3D.get(); + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(newContext.get()); + if (!newContext || !webContext || webContext->isContextLost()) + newContext = GraphicsContext3D::create( getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. - RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this)); // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. if (layerRenderer) { @@ -2506,18 +2493,20 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D() { #if USE(ACCELERATED_COMPOSITING) if (m_page->settings()->acceleratedCompositingEnabled() && allowsAcceleratedCompositing()) { - GraphicsContext3D* context = 0; - if (m_layerRenderer) - context = m_layerRenderer->context(); - else if (m_temporaryOnscreenGraphicsContext3D) - context = m_temporaryOnscreenGraphicsContext3D.get(); - else { - m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); - if (m_temporaryOnscreenGraphicsContext3D) - m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); - context = m_temporaryOnscreenGraphicsContext3D.get(); + if (m_layerRenderer) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_layerRenderer->context()); + if (webContext && !webContext->isContextLost()) + return webContext; + } + if (m_temporaryOnscreenGraphicsContext3D) { + WebGraphicsContext3D* webContext = GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); + if (webContext && !webContext->isContextLost()) + return webContext; } - return GraphicsContext3DInternal::extractWebGraphicsContext3D(context); + m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + if (m_temporaryOnscreenGraphicsContext3D) + m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + return GraphicsContext3DInternal::extractWebGraphicsContext3D(m_temporaryOnscreenGraphicsContext3D.get()); } #endif return 0; diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 66b2908..f10202f 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -109,6 +109,7 @@ public: virtual bool confirmComposition(const WebString& text); virtual WebTextInputType textInputType(); virtual WebRect caretOrSelectionBounds(); + virtual bool selectionRange(WebPoint& start, WebPoint& end) const; virtual void setTextDirection(WebTextDirection direction); virtual bool isAcceleratedCompositingActive() const; @@ -157,11 +158,6 @@ public: WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, // FIXME: remove identity from this function signature. - const WebPoint& clientPoint, - const WebPoint& screenPoint, - WebDragOperationsMask operationsAllowed); - virtual WebDragOperation dragTargetDragEnter( const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp index d05322f..5147e15 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp @@ -45,6 +45,7 @@ #include "WorkerThread.h" #include <wtf/MainThread.h> #include <wtf/Threading.h> +#include <wtf/UnusedParam.h> namespace WebCore { @@ -337,26 +338,14 @@ void WorkerFileSystemCallbacksBridge::didReadDirectoryOnWorkerThread(ScriptExecu bridge->m_callbacksOnWorkerThread->didReadDirectory(entries, hasMore); } -bool WorkerFileSystemCallbacksBridge::derefIfWorkerIsStopped() -{ - WebWorkerBase* worker = 0; - { - MutexLocker locker(m_mutex); - worker = m_worker; - } - if (!worker) { - m_selfRef.clear(); - return true; - } - return false; -} - -void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, WorkerFileSystemCallbacksBridge* bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) +void WorkerFileSystemCallbacksBridge::runTaskOnMainThread(WebCore::ScriptExecutionContext* scriptExecutionContext, PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, PassOwnPtr<WebCore::ScriptExecutionContext::Task> taskToRun) { ASSERT(isMainThread()); - if (bridge->derefIfWorkerIsStopped()) - return; + + // Every task run will result in one call to mayPostTaskToWorker, which is where this ref is released. + WorkerFileSystemCallbacksBridge* leaked = bridge.leakRef(); + UNUSED_PARAM(leaked); taskToRun->performTask(scriptExecutionContext); } @@ -372,19 +361,22 @@ void WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread(WebCore::ScriptExecu void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task> task) { - ASSERT(!m_selfRef); ASSERT(m_worker); ASSERT(m_workerContext->isContextThread()); - m_selfRef = this; - m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, this, task)); + m_worker->dispatchTaskToMainThread(createCallbackTask(&runTaskOnMainThread, RefPtr<WorkerFileSystemCallbacksBridge>(this).release(), task)); } void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode) { ASSERT(isMainThread()); + + // Balancing out the ref() done in runTaskOnMainThread. (Since m_mutex is a member and the deref may result + // in the destruction of WorkerFileSystemCallbacksBridge, the ordering of the RefPtr and the MutexLocker + // is very important, to ensure that the m_mutex is still valid when it gets unlocked.) + RefPtr<WorkerFileSystemCallbacksBridge> bridge = adoptRef(this); MutexLocker locker(m_mutex); if (m_worker) - m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef.release(), task), mode); + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, bridge, task), mode); } } // namespace WebCore diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index 9a869dc..5af8529 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -122,25 +122,18 @@ private: friend class MainThreadFileSystemCallbacks; // Methods that dispatch WebFileSystemCallbacks on the worker threads. - // They release a selfRef of the WorkerFileSystemCallbacksBridge. static void didFailOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, WebFileError); static void didOpenFileSystemOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const String& name, const String& rootPath); static void didSucceedOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*); static void didReadMetadataOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebFileInfo&); static void didReadDirectoryOnWorkerThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, const WebVector<WebFileSystemEntry>&, bool hasMore); - // For early-exist; this deref's selfRef and returns true if the worker is already null. - bool derefIfWorkerIsStopped(); - - static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, WorkerFileSystemCallbacksBridge*, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); + static void runTaskOnMainThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); static void runTaskOnWorkerThread(WebCore::ScriptExecutionContext*, PassRefPtr<WorkerFileSystemCallbacksBridge>, PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode); - // m_selfRef keeps a reference to itself while there's a pending callback on the main thread. - RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef; - Mutex m_mutex; WebWorkerBase* m_worker; WebCore::ScriptExecutionContext* m_workerContext; diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 7a3eb8d..e6b7537 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -169,6 +169,10 @@ WebInspector.platformExtensionAPI = function(tabId) return tabId; } webInspector.inspectedWindow.__proto__.__defineGetter__("tabId", getTabId); + chrome = window.chrome || {}; + chrome.devTools = chrome.devTools || {}; + for (var property in webInspector) + chrome.devTools[property] = webInspector[property]; } WebInspector.buildPlatformExtensionAPI = function() diff --git a/Source/WebKit/chromium/src/js/Tests.js b/Source/WebKit/chromium/src/js/Tests.js index 1d98656..220cf89 100644 --- a/Source/WebKit/chromium/src/js/Tests.js +++ b/Source/WebKit/chromium/src/js/Tests.js @@ -81,7 +81,6 @@ TestSuite.prototype.assertEquals = function(expected, actual, opt_message) } }; - /** * True assertion tests that value == true. * @param {Object} value Actual object. @@ -522,6 +521,105 @@ TestSuite.prototype.testPauseWhenScriptIsRunning = function() /** + * Tests network size. + */ +TestSuite.prototype.testNetworkSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network sync size. + */ +TestSuite.prototype.testNetworkSyncSize = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertEquals(221, resource.transferSize, "Incorrect total encoded data length"); + test.assertEquals(25, resource.resourceSize, "Incorrect total data length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Send synchronous XHR to sniff network events + test.evaluateInConsole_("var xhr = new XMLHttpRequest(); xhr.open(\"GET\", \"chunked\", false); xhr.send(null);", function() {}); + + this.takeControl(); +}; + + +/** + * Tests network raw headers text. + */ +TestSuite.prototype.testNetworkRawHeadersText = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + var rawResponseHeadersText = resource.rawResponseHeadersText + if (!rawResponseHeadersText) + test.fail("Failure: resource does not have raw response header text"); + test.assertEquals(166, resource.rawResponseHeadersText.length, "Incorrect raw response header text length"); + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** + * Tests network timing. + */ +TestSuite.prototype.testNetworkTiming = function() +{ + var test = this; + + function finishResource(resource, finishTime) + { + test.assertTrue(resource.timing.receiveHeadersEnd - resource.timing.connectStart >= 100, + "Time between receiveHeadersEnd and connectStart should be >=100ms, but was " + + "receiveHeadersEnd=" + resource.timing.receiveHeadersEnd + ", connectStart=" + resource.timing.connectStart + "."); + test.assertTrue(resource.endTime - resource.startTime >= 0.2, + "Time between endTime and startTime should be >=200ms, but was " + + "endtime=" + resource.endTime + ", startTime=" + resource.startTime + "."); + + test.releaseControl(); + } + + this.addSniffer(WebInspector.NetworkDispatcher.prototype, "_finishResource", finishResource); + + // Reload inspected page to sniff network events + test.evaluateInConsole_("window.location.reload(true);", function(resultText) {}); + + this.takeControl(); +}; + + +/** * Serializes options collection to string. * @param {HTMLOptionsCollection} options * @return {string} diff --git a/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp new file mode 100644 index 0000000..1c5f877 --- /dev/null +++ b/Source/WebKit/chromium/tests/CCThreadTaskTest.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "cc/CCThreadTask.h" + +#include <gmock/gmock.h> +#include <gtest/gtest.h> + +using namespace WTF; +using namespace WebCore; + +namespace { + +class Mock { +public: + MOCK_METHOD0(method0, void()); + MOCK_METHOD1(method1, void(int a1)); + MOCK_METHOD2(method2, void(int a1, int a2)); + MOCK_METHOD3(method3, void(int a1, int a2, int a3)); + MOCK_METHOD4(method4, void(int a1, int a2, int a3, int a4)); +}; + +TEST(CCThreadTaskTest, runnableMethods) +{ + Mock mock; + EXPECT_CALL(mock, method0()).Times(1); + EXPECT_CALL(mock, method1(9)).Times(1); + EXPECT_CALL(mock, method2(9, 8)).Times(1); + EXPECT_CALL(mock, method3(9, 8, 7)).Times(1); + EXPECT_CALL(mock, method4(9, 8, 7, 6)).Times(1); + + createCCThreadTask(&mock, &Mock::method0)->performTask(); + createCCThreadTask(&mock, &Mock::method1, 9)->performTask(); + createCCThreadTask(&mock, &Mock::method2, 9, 8)->performTask(); + createCCThreadTask(&mock, &Mock::method3, 9, 8, 7)->performTask(); + createCCThreadTask(&mock, &Mock::method4, 9, 8, 7, 6)->performTask(); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/CCThreadTest.cpp b/Source/WebKit/chromium/tests/CCThreadTest.cpp new file mode 100644 index 0000000..04fba46 --- /dev/null +++ b/Source/WebKit/chromium/tests/CCThreadTest.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "cc/CCThread.h" + +#include "cc/CCCompletionEvent.h" +#include "cc/CCMainThreadTask.h" +#include "cc/CCThreadTask.h" +#include <gtest/gtest.h> +#include <webkit/support/webkit_support.h> + +using namespace WebCore; + +namespace { + +class PingPongUsingCondition { +public: + void ping(CCCompletionEvent* completion) + { + hitThreadID = currentThread(); + completion->signal(); + } + + ThreadIdentifier hitThreadID; +}; + + +TEST(CCThreadTest, pingPongUsingCondition) +{ + OwnPtr<CCThread> thread = CCThread::create(); + PingPongUsingCondition target; + CCCompletionEvent completion; + thread->postTask(createCCThreadTask(&target, &PingPongUsingCondition::ping, &completion)); + completion.wait(); + + EXPECT_EQ(thread->threadID(), target.hitThreadID); +} + +class PingPongTestUsingTasks { +public: + void ping() + { + CCMainThread::postTask(createMainThreadTask(this, &PingPongTestUsingTasks::pong)); + hit = true; + } + + void pong() + { + EXPECT_TRUE(isMainThread()); + webkit_support::QuitMessageLoop(); + } + + bool hit; +}; + +TEST(CCThreadTest, startPostAndWaitOnCondition) +{ + OwnPtr<CCThread> thread = CCThread::create(); + + PingPongTestUsingTasks target; + thread->postTask(createCCThreadTask(&target, &PingPongTestUsingTasks::ping)); + webkit_support::RunMessageLoop(); + + EXPECT_TRUE(target.hit); +} + +} // namespace diff --git a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp index 0454ea9..ac4282b 100644 --- a/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/WebKit/chromium/tests/IDBBindingUtilitiesTest.cpp @@ -53,7 +53,6 @@ public: } private: - v8::Locker m_locker; v8::HandleScope m_scope; v8::Persistent<v8::Context> m_context; }; diff --git a/Source/WebKit/chromium/tests/PopupMenuTest.cpp b/Source/WebKit/chromium/tests/PopupMenuTest.cpp index 8c53ffc..5a18708 100644 --- a/Source/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/Source/WebKit/chromium/tests/PopupMenuTest.cpp @@ -142,6 +142,7 @@ public: virtual bool confirmComposition(const WebString& text) { return true; } virtual WebTextInputType textInputType() { return WebKit::WebTextInputTypeNone; } virtual WebRect caretOrSelectionBounds() { return WebRect(); } + virtual bool selectionRange(WebPoint& start, WebPoint& end) const { return false; } virtual void setTextDirection(WebTextDirection) { } }; diff --git a/Source/WebKit/chromium/tests/RunAllTests.cpp b/Source/WebKit/chromium/tests/RunAllTests.cpp index b213de7..500c3dc 100644 --- a/Source/WebKit/chromium/tests/RunAllTests.cpp +++ b/Source/WebKit/chromium/tests/RunAllTests.cpp @@ -39,8 +39,11 @@ #include "WebUnitTests.h" #endif +#include <gmock/gmock.h> + int main(int argc, char** argv) { + ::testing::InitGoogleMock(&argc, argv); TestSuite testSuite(argc, argv); // TestSuite must be created before SetUpTestEnvironment so it performs // initializations needed by WebKit support. diff --git a/Source/WebKit/chromium/tests/TilingDataTest.cpp b/Source/WebKit/chromium/tests/TilingDataTest.cpp index a41f7fe..7573dc7 100755 --- a/Source/WebKit/chromium/tests/TilingDataTest.cpp +++ b/Source/WebKit/chromium/tests/TilingDataTest.cpp @@ -49,6 +49,24 @@ TEST(TilingDataTest, numTiles_NoTiling) TEST(TilingDataTest, numTiles_TilingNoBorders) { + EXPECT_EQ(0, TilingData(0, 0, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 4, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 0, 4, false).numTiles()); + EXPECT_EQ(0, TilingData(4, 4, 0, false).numTiles()); + EXPECT_EQ(0, TilingData(4, 0, 4, false).numTiles()); + EXPECT_EQ(0, TilingData(-8, 1, 1, false).numTiles()); + EXPECT_EQ(0, TilingData(-1, 1, 1, false).numTiles()); + EXPECT_EQ(0, TilingData(0, 1, 1, false).numTiles()); + + EXPECT_EQ(1, TilingData(1, 1, 1, false).numTiles()); + EXPECT_EQ(2, TilingData(1, 1, 2, false).numTiles()); + EXPECT_EQ(2, TilingData(1, 2, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 2, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 1, false).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 2, false).numTiles()); + EXPECT_EQ(1, TilingData(3, 3, 3, false).numTiles()); + EXPECT_EQ(1, TilingData(4, 1, 4, false).numTiles()); EXPECT_EQ(1, TilingData(4, 2, 4, false).numTiles()); EXPECT_EQ(1, TilingData(4, 3, 4, false).numTiles()); @@ -82,6 +100,23 @@ TEST(TilingDataTest, numTiles_TilingNoBorders) TEST(TilingDataTest, numTiles_TilingWithBorders) { + EXPECT_EQ(0, TilingData(0, 0, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 4, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 0, 4, true).numTiles()); + EXPECT_EQ(0, TilingData(4, 4, 0, true).numTiles()); + EXPECT_EQ(0, TilingData(4, 0, 4, true).numTiles()); + EXPECT_EQ(0, TilingData(-8, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(-1, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(0, 1, 1, true).numTiles()); + + EXPECT_EQ(1, TilingData(1, 1, 1, true).numTiles()); + EXPECT_EQ(0, TilingData(1, 1, 2, true).numTiles()); + EXPECT_EQ(0, TilingData(1, 2, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 1, 2, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 1, true).numTiles()); + EXPECT_EQ(1, TilingData(2, 2, 2, true).numTiles()); + EXPECT_EQ(1, TilingData(3, 1, 3, true).numTiles()); EXPECT_EQ(1, TilingData(3, 2, 3, true).numTiles()); EXPECT_EQ(1, TilingData(3, 3, 3, true).numTiles()); @@ -361,7 +396,7 @@ TEST(TilingDataTest, setTotalSize) EXPECT_EQ(2, data.tileSizeY(2)); } -TEST(TilingDataTest, setMaxTextureSize) +TEST(TilingDataTest, setMaxTextureSizeNoBorders) { TilingData data(8, 16, 32, false); EXPECT_EQ(2, data.numTilesX()); @@ -383,4 +418,26 @@ TEST(TilingDataTest, setMaxTextureSize) EXPECT_EQ(7, data.numTilesY()); } +TEST(TilingDataTest, setMaxTextureSizeBorders) +{ + TilingData data(8, 16, 32, true); + EXPECT_EQ(3, data.numTilesX()); + EXPECT_EQ(5, data.numTilesY()); + + data.setMaxTextureSize(32); + EXPECT_EQ(32, data.maxTextureSize()); + EXPECT_EQ(1, data.numTilesX()); + EXPECT_EQ(1, data.numTilesY()); + + data.setMaxTextureSize(2); + EXPECT_EQ(2, data.maxTextureSize()); + EXPECT_EQ(0, data.numTilesX()); + EXPECT_EQ(0, data.numTilesY()); + + data.setMaxTextureSize(5); + EXPECT_EQ(5, data.maxTextureSize()); + EXPECT_EQ(5, data.numTilesX()); + EXPECT_EQ(10, data.numTilesY()); +} + } // namespace diff --git a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp index ee3307f..191bf9e 100644 --- a/Source/WebKit/chromium/tests/TransparencyWinTest.cpp +++ b/Source/WebKit/chromium/tests/TransparencyWinTest.cpp @@ -50,8 +50,8 @@ static FloatRect RECTToFloatRect(const RECT* rect) static void drawNativeRect(GraphicsContext* context, int x, int y, int w, int h) { - skia::PlatformCanvas* canvas = context->platformContext()->canvas(); - HDC dc = canvas->beginPlatformPaint(); + SkCanvas* canvas = context->platformContext()->canvas(); + HDC dc = skia::BeginPlatformPaint(canvas); RECT innerRc; innerRc.left = x; @@ -61,13 +61,12 @@ static void drawNativeRect(GraphicsContext* context, FillRect(dc, &innerRc, reinterpret_cast<HBRUSH>(GetStockObject(BLACK_BRUSH))); - canvas->endPlatformPaint(); + skia::EndPlatformPaint(canvas); } static Color getPixelAt(GraphicsContext* context, int x, int y) { - const SkBitmap& bitmap = context->platformContext()->canvas()-> - getTopPlatformDevice().accessBitmap(false); + const SkBitmap& bitmap = context->platformContext()->canvas()->getTopDevice()->accessBitmap(false); return Color(*reinterpret_cast<const RGBA32*>(bitmap.getAddr32(x, y))); } @@ -75,8 +74,7 @@ static Color getPixelAt(GraphicsContext* context, int x, int y) // Windows messing it up. static void clearTopLayerAlphaChannel(GraphicsContext* context) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()-> - canvas()->getTopPlatformDevice().accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); for (int y = 0; y < bitmap.height(); y++) { uint32_t* row = bitmap.getAddr32(0, y); for (int x = 0; x < bitmap.width(); x++) @@ -87,8 +85,7 @@ static void clearTopLayerAlphaChannel(GraphicsContext* context) // Clears the alpha channel on the specified pixel. static void clearTopLayerAlphaPixel(GraphicsContext* context, int x, int y) { - SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()-> - canvas()->getTopPlatformDevice().accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(context->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); *bitmap.getAddr32(x, y) &= 0x00FFFFFF; } @@ -559,9 +556,7 @@ TEST(TransparencyWin, Scale) // the helper goes out of scope. We don't want to call // clearTopLayerAlphaChannel because that will actually clear the whole // canvas (since we have no extra layer!). - SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()-> - platformContext()->canvas()->getTopPlatformDevice(). - accessBitmap(false)); + SkBitmap& bitmap = const_cast<SkBitmap&>(helper.context()->platformContext()->canvas()->getTopDevice()->accessBitmap(false)); *bitmap.getAddr32(2, 2) &= 0x00FFFFFF; helper.composite(); } diff --git a/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp b/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp index 8aaed11..ec88f43 100644 --- a/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp +++ b/Source/WebKit/chromium/tests/UniscribeHelperTest.cpp @@ -115,7 +115,7 @@ TEST_F(UniscribeTest, TooBig) { UniscribeHelper uniscribe( input.characters(), static_cast<int>(input.length()), - false, hfont, scriptCache, &properties); + false, hfont, scriptCache, &properties, 0); uniscribe.initWithOptionalLengthProtection(false); // There should be one shaping entry, with nothing in it. @@ -148,7 +148,7 @@ TEST_F(UniscribeTest, TooBig) { UniscribeHelper uniscribe( input.characters(), static_cast<int>(input.length()), - false, hfont, scriptCache, &properties); + false, hfont, scriptCache, &properties, 0); uniscribe.initWithOptionalLengthProtection(true); // There should be 0 runs and shapes. diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 891fa83..b38d544 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -35,11 +35,13 @@ #include <webkit/support/webkit_support.h> #include "WebFrame.h" #include "WebFrameClient.h" +#include "WebSettings.h" #include "WebString.h" #include "WebURL.h" #include "WebURLRequest.h" #include "WebURLResponse.h" #include "WebView.h" +#include "v8.h" using namespace WebKit; @@ -47,25 +49,44 @@ namespace { class WebFrameTest : public testing::Test { public: - WebFrameTest() {} + WebFrameTest() + : baseURL("http://www.test.com/") + { + } virtual void TearDown() { webkit_support::UnregisterAllMockedURLs(); } - void registerMockedURLLoad(const WebURL& url, const WebURLResponse& response, const WebString& fileName) + void registerMockedURLLoad(const std::string& fileName) { + WebURLResponse response; + response.initialize(); + response.setMIMEType("text/html"); + std::string filePath = webkit_support::GetWebKitRootDir().utf8(); - filePath.append("/Source/WebKit/chromium/tests/data/"); - filePath.append(fileName.utf8()); - webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); + filePath += "/Source/WebKit/chromium/tests/data/"; + filePath += fileName; + + webkit_support::RegisterMockedURL(WebURL(GURL(baseURL + fileName)), response, WebString::fromUTF8(filePath)); } void serveRequests() { webkit_support::ServeAsynchronousMockedRequests(); } + + void loadFrame(WebFrame* frame, const std::string& fileName) + { + WebURLRequest urlRequest; + urlRequest.initialize(); + urlRequest.setURL(WebURL(GURL(baseURL + fileName))); + frame->loadRequest(urlRequest); + } + +protected: + std::string baseURL; }; class TestWebFrameClient : public WebFrameClient { @@ -73,31 +94,17 @@ class TestWebFrameClient : public WebFrameClient { TEST_F(WebFrameTest, ContentText) { - // Register our resources. - WebURLResponse response; - response.initialize(); - response.setMIMEType("text/html"); - std::string rootURL = "http://www.test.com/"; - const char* files[] = { "iframes_test.html", "visible_iframe.html", - "invisible_iframe.html", "zero_sized_iframe.html" }; - for (int i = 0; i < (sizeof(files) / sizeof(char*)); ++i) { - WebURL webURL = GURL(rootURL + files[i]); - registerMockedURLLoad(webURL, response, WebString::fromUTF8(files[i])); - } + registerMockedURLLoad("iframes_test.html"); + registerMockedURLLoad("visible_iframe.html"); + registerMockedURLLoad("invisible_iframe.html"); + registerMockedURLLoad("zero_sized_iframe.html"); - // Create and initialize the WebView. + // Create and initialize the WebView. TestWebFrameClient webFrameClient; WebView* webView = WebView::create(0); webView->initializeMainFrame(&webFrameClient); - // Load the main frame URL. - WebURL testURL(GURL(rootURL + files[0])); - WebURLRequest urlRequest; - urlRequest.initialize(); - urlRequest.setURL(testURL); - webView->mainFrame()->loadRequest(urlRequest); - - // Load all pending asynchronous requests. + loadFrame(webView->mainFrame(), "iframes_test.html"); serveRequests(); // Now retrieve the frames text and test it only includes visible elements. @@ -111,4 +118,31 @@ TEST_F(WebFrameTest, ContentText) webView->close(); } +TEST_F(WebFrameTest, FrameForEnteredContext) +{ + registerMockedURLLoad("iframes_test.html"); + registerMockedURLLoad("visible_iframe.html"); + registerMockedURLLoad("invisible_iframe.html"); + registerMockedURLLoad("zero_sized_iframe.html"); + + // Create and initialize the WebView. + TestWebFrameClient webFrameClient; + WebView* webView = WebView::create(0); + webView->settings()->setJavaScriptEnabled(true); + webView->initializeMainFrame(&webFrameClient); + + loadFrame(webView->mainFrame(), "iframes_test.html"); + serveRequests(); + + v8::HandleScope scope; + EXPECT_EQ(webView->mainFrame(), + WebFrame::frameForContext( + webView->mainFrame()->mainWorldScriptContext())); + EXPECT_EQ(webView->mainFrame()->firstChild(), + WebFrame::frameForContext( + webView->mainFrame()->firstChild()->mainWorldScriptContext())); + + webView->close(); +} + } diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog index 35da09c..aac8298 100644..100755 --- a/Source/WebKit/efl/ChangeLog +++ b/Source/WebKit/efl/ChangeLog @@ -1,3 +1,132 @@ +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchDidReceiveContentLength): + * WebCoreSupport/FrameLoaderClientEfl.h: + +2011-04-18 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r84155. + http://trac.webkit.org/changeset/84155 + https://bugs.webkit.org/show_bug.cgi?id=58802 + + "paintEntireContents flag is used for painting outside of the + screen. It's not the right way to fix EFL tiled backing + store." (Requested by demarchi on #webkit). + + * ewk/ewk_view_tiled.c: + (_ewk_view_tiled_smart_add): + +2011-04-18 Eunsol Park <eunsol47.park@samsung.com> + + Reviewed by Eric Seidel. + + [EFL] Scroll doesn't work on tiled backing store + https://bugs.webkit.org/show_bug.cgi?id=55021 + + Scroll doesn't work on tiled backing store, but it works on single. + If ewk_frame_paint_full_set() set True, view size return content size and scroll can't be made. + so, ewk_frame_paint_full_set() is removed from ewk_tiled_smart_add(). + + * ewk/ewk_view_tiled.c: + (_ewk_view_tiled_smart_add): + +2011-04-14 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + Reviewed by Antonio Gomes. + + Memory cache API + https://bugs.webkit.org/show_bug.cgi?id=58016 + + * ewk/ewk_settings.cpp: + (ewk_settings_cache_enable_get): + (ewk_settings_cache_enable_set): + (ewk_settings_cache_capacity_set): + * ewk/ewk_settings.h: + +2011-04-13 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + Reviewed by Kent Tamura. + + [EFL] Doxygen documentation for ewk_main, ewk_history and tools + https://bugs.webkit.org/show_bug.cgi?id=58428 + + * ewk/EWebKit.h: + * ewk/ewk_eapi.h: + * ewk/ewk_history.h: + * ewk/ewk_logging.h: + * ewk/ewk_main.cpp: + * ewk/ewk_main.h: + * ewk/ewk_private.h: + * ewk/ewk_util.cpp: + * ewk/ewk_util.h: + +2011-04-11 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Adjust dpi value to viewport computation. + https://bugs.webkit.org/show_bug.cgi?id=58130 + + In viewport computation, EFL port have used 160 value for DPI since now. + But, we have to use device's dpi value for viewport meta tag computation. + + * ewk/ewk_view.cpp: + (_ewk_view_viewport_attributes_compute): + +2011-04-10 Gyuyoung Kim <gyuyoung.kim@samsung.com> + + Reviewed by Eric Carlson. + + [EFL] Add seek forward / backward buttons to MediaControl UI. + https://bugs.webkit.org/show_bug.cgi?id=56810 + + Add seek forward / backward buttons to media control. + + * DefaultTheme/default.edc: + * DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackward_button.edc: Added. + * DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png: Added. + * DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforward_button.edc: Added. + * DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforwardbutton.png: Added. + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/EditorClientEfl.h: + (WebCore::EditorClientEfl::requestCheckingOfString): + +2011-04-01 Grzegorz Czajkowski <g.czajkowski@samsung.com> + + Reviewed by Kenneth Rohde Christiansen. + + [EFL] Synchronization between WebCore's ContextMenuItem.h and ewk_contextmenu.h + https://bugs.webkit.org/show_bug.cgi?id=57000 + + * ewk/ewk_contextmenu.h: + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/FrameLoaderClientEfl.cpp: + (WebCore::FrameLoaderClientEfl::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientEfl::setTitle): + * WebCoreSupport/FrameLoaderClientEfl.h: + 2011-03-29 Gyuyoung Kim <gyuyoung.kim@samsung.com> Reviewed by Antonio Gomes. diff --git a/Source/WebKit/efl/DefaultTheme/default.edc b/Source/WebKit/efl/DefaultTheme/default.edc index f77bd86..e6fbde5 100644 --- a/Source/WebKit/efl/DefaultTheme/default.edc +++ b/Source/WebKit/efl/DefaultTheme/default.edc @@ -78,4 +78,6 @@ collections { #include "widget/slider/slider.edc" #include "widget/mediacontrol/playpausebutton/playpause_button.edc" #include "widget/mediacontrol/mutebutton/mute_button.edc" +#include "widget/mediacontrol/seekforwardbutton/seekforward_button.edc" +#include "widget/mediacontrol/seekbackwardbutton/seekbackward_button.edc" } diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackward_button.edc b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackward_button.edc new file mode 100644 index 0000000..1bb253c --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackward_button.edc @@ -0,0 +1,50 @@ +/* + Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009,2010 ProFUSION embedded systems + Copyright (C) 2011 Samsung Electronics + + This file is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + group { + name: "webkit/widget/mediacontrol/seekbackward_button"; + + images { + image: "widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png" COMP; + } + + parts { + part { + name: "seekbackward_button"; + type: IMAGE; + description { state: "default" 0.0; + min: 25 25; + } + description { state: "seekbackward" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png"; + } + } + } + + programs { + program { + signal: "seekbackward"; + action: STATE_SET "seekbackward" 0.0; + target: "seekbackward_button"; + } + } + } diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png Binary files differnew file mode 100755 index 0000000..f3467cd --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekbackwardbutton/seekbackwardbutton.png diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforward_button.edc b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforward_button.edc new file mode 100644 index 0000000..e34e7f7 --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforward_button.edc @@ -0,0 +1,50 @@ +/* + Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia + Copyright (C) 2009,2010 ProFUSION embedded systems + Copyright (C) 2011 Samsung Electronics + + This file is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + group { + name: "webkit/widget/mediacontrol/seekforward_button"; + + images { + image: "widget/mediacontrol/seekforwardbutton/seekforwardbutton.png" COMP; + } + + parts { + part { + name: "seekforward_button"; + type: IMAGE; + description { state: "default" 0.0; + min: 25 25; + } + description { state: "seekforward" 0.0; + inherit: "default" 0.0; + image.normal: "widget/mediacontrol/seekforwardbutton/seekforwardbutton.png"; + } + } + } + + programs { + program { + signal: "seekforward"; + action: STATE_SET "seekforward" 0.0; + target: "seekforward_button"; + } + } + } diff --git a/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforwardbutton.png b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforwardbutton.png Binary files differnew file mode 100755 index 0000000..c2fe828 --- /dev/null +++ b/Source/WebKit/efl/DefaultTheme/widget/mediacontrol/seekforwardbutton/seekforwardbutton.png diff --git a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h index 575a50d..56b3300 100644 --- a/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/EditorClientEfl.h @@ -114,7 +114,7 @@ public: virtual void getGuessesForWord(const String& word, const String& context, WTF::Vector<String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {} + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {} virtual TextCheckerClient* textChecker() { return this; } private: diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp index fa34ac9..9a409f2 100644 --- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp +++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp @@ -576,9 +576,10 @@ void FrameLoaderClientEfl::dispatchDidStartProvisionalLoad() ewk_view_load_provisional(m_view); } -void FrameLoaderClientEfl::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientEfl::dispatchDidReceiveTitle(const StringWithDirection& title) { - CString cs = title.utf8(); + // FIXME: use direction of title. + CString cs = title.string().utf8(); ewk_frame_title_set(m_frame, cs.data()); if (ewk_view_frame_main_get(m_view) != m_frame) @@ -709,12 +710,12 @@ void FrameLoaderClientEfl::prepareForDataSourceReplacement() notImplemented(); } -void FrameLoaderClientEfl::setTitle(const String& title, const KURL& url) +void FrameLoaderClientEfl::setTitle(const StringWithDirection& title, const KURL& url) { // no need for, dispatchDidReceiveTitle is the right callback } -void FrameLoaderClientEfl::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived) +void FrameLoaderClientEfl::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int dataLength) { notImplemented(); } diff --git a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h index 5ea4e8c..3efa2f5 100644 --- a/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h +++ b/Source/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.h @@ -88,7 +88,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { virtual void dispatchDidCancelAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(DocumentLoader*, unsigned long identifier, const ResourceResponse&); - virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length); @@ -102,7 +102,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const String&); + virtual void dispatchDidReceiveTitle(const StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const ResourceError&); @@ -193,7 +193,7 @@ class FrameLoaderClientEfl : public FrameLoaderClient { virtual void prepareForDataSourceReplacement(); virtual WTF::PassRefPtr<DocumentLoader> createDocumentLoader(const ResourceRequest&, const SubstituteData&); - virtual void setTitle(const String& title, const KURL&); + virtual void setTitle(const StringWithDirection& title, const KURL&); virtual String userAgent(const KURL&); diff --git a/Source/WebKit/efl/ewk/EWebKit.h b/Source/WebKit/efl/ewk/EWebKit.h index 183e9dc..6d741e9 100644 --- a/Source/WebKit/efl/ewk/EWebKit.h +++ b/Source/WebKit/efl/ewk/EWebKit.h @@ -19,6 +19,13 @@ Boston, MA 02110-1301, USA. */ +/** + * @file EWebKit.h + * @brief Contains the header files that are required by WebKit-EFL. + * + * It includes the all header files that are exported to public API and Evas header. + */ + #ifndef EWebKit_h #define EWebKit_h diff --git a/Source/WebKit/efl/ewk/ewk_contextmenu.h b/Source/WebKit/efl/ewk/ewk_contextmenu.h index 7b60410..d9e3e83 100644 --- a/Source/WebKit/efl/ewk/ewk_contextmenu.h +++ b/Source/WebKit/efl/ewk/ewk_contextmenu.h @@ -98,11 +98,21 @@ enum _Ewk_Context_Menu_Action { EWK_CONTEXT_MENU_ITEM_TAG_RIGHT_TO_LEFT, EWK_CONTEXT_MENU_ITEM_TAG_PDFSINGLE_PAGE_SCROLLING, EWK_CONTEXT_MENU_ITEM_TAG_PDFFACING_PAGES_SCROLLING, + // EWK_CONTEXT_MENU_ITEM_TAG_INSPECT_ELEMENT, /**< This feature is disabled in WebKit-EFL - it is a subject to INSPECTOR build variable */ EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_MENU, /**< text direction sub-menu */ EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_DEFAULT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_LEFT_TO_RIGHT, EWK_CONTEXT_MENU_ITEM_TAG_TEXT_DIRECTION_RIGHT_TO_LEFT, + EWK_CONTEXT_MENU_ITEM_OPEN_MEDIA_IN_NEW_WINDOW, + EWK_CONTEXT_MENU_ITEM_TAG_COPY_MEDIA_LINK_TO_CLIPBOARD, + EWK_CONTEXT_MENU_ITEM_TAG_TOGGLE_MEDIA_CONTROLS, + EWK_CONTEXT_MENU_ITEM_TAG_TOGGLE_MEDIA_LOOP, + EWK_CONTEXT_MENU_ITEM_TAG_ENTER_VIDEO_FULLSCREEN, + EWK_CONTEXT_MENU_ITEM_TAG_MEDIA_PLAY_PAUSE, + EWK_CONTEXT_MENU_ITEM_TAG_MEDIA_MUTE, EWK_CONTEXT_MENU_ITEM_BASE_CUSTOM_TAG = 5000, + EWK_CONTEXT_MENU_ITEM_CUSTOM_TAG_NO_ACTION = 5998, + EWK_CONTEXT_MENU_ITEM_LAST_CUSTOM_TAG = 5999, EWK_CONTEXT_MENU_ITEM_BASE_APPLICATION_TAG = 10000 }; /** Creates a type name for _Ewk_Context_Menu_Action */ diff --git a/Source/WebKit/efl/ewk/ewk_eapi.h b/Source/WebKit/efl/ewk/ewk_eapi.h index adb8d7b..11f4371 100644 --- a/Source/WebKit/efl/ewk/ewk_eapi.h +++ b/Source/WebKit/efl/ewk/ewk_eapi.h @@ -18,6 +18,15 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_eapi.h + * @brief Defines EAPI macro. + * + * The macro must be used in declaration of public functions. + * Functions without EAPI macro have hidden most of symbols and + * they are not visible for target applications. + */ + #ifndef ewk_eapi_h #define ewk_eapi_h diff --git a/Source/WebKit/efl/ewk/ewk_history.h b/Source/WebKit/efl/ewk/ewk_history.h index 3943d7e..3cae74e 100644 --- a/Source/WebKit/efl/ewk/ewk_history.h +++ b/Source/WebKit/efl/ewk/ewk_history.h @@ -32,7 +32,8 @@ extern "C" { #endif /** - * The history (back-forward list) associated with a given ewk_view. + * @file ewk_history.h + * @brief The history (back-forward list) associated with a given ewk_view. * * Changing the history affects immediately the view, changing the * current uri, for example. diff --git a/Source/WebKit/efl/ewk/ewk_logging.h b/Source/WebKit/efl/ewk/ewk_logging.h index 045bd9c..f8a7f41 100644 --- a/Source/WebKit/efl/ewk/ewk_logging.h +++ b/Source/WebKit/efl/ewk/ewk_logging.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_logging.h + * @brief Provides macros for logging. + */ + #ifndef ewk_logging_h #define ewk_logging_h diff --git a/Source/WebKit/efl/ewk/ewk_main.cpp b/Source/WebKit/efl/ewk/ewk_main.cpp index 0c7cc70..9687f10 100644 --- a/Source/WebKit/efl/ewk/ewk_main.cpp +++ b/Source/WebKit/efl/ewk/ewk_main.cpp @@ -56,10 +56,25 @@ #endif static int _ewk_init_count = 0; + +/** + * \var _ewk_log_dom + * @brief the log domain identifier that is used with EINA's macros + */ int _ewk_log_dom = -1; static Eina_Bool _ewk_init_body(void); +/** + * Initializes webkit's instance. + * + * - initializes components needed by Efl, + * - sets web database location, + * - sets page cache capacity, + * - increases a reference count of webkit's instance. + * + * @return a reference count of webkit's instance on success or 0 on failure + */ int ewk_init(void) { if (_ewk_init_count) @@ -113,6 +128,13 @@ error_eina: return 0; } +/** + * Decreases a reference count of webkit's instance, possibly destroying it. + * + * If the reference count reaches 0 webkit's instance is destroyed. + * + * @return a reference count of webkit's instance + */ int ewk_shutdown(void) { _ewk_init_count--; diff --git a/Source/WebKit/efl/ewk/ewk_main.h b/Source/WebKit/efl/ewk/ewk_main.h index 3730e88..257babc 100644 --- a/Source/WebKit/efl/ewk/ewk_main.h +++ b/Source/WebKit/efl/ewk/ewk_main.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_main.h + * @brief The main file of WebKit-EFL, not tied to any view object. + */ + #ifndef ewk_main_h #define ewk_main_h diff --git a/Source/WebKit/efl/ewk/ewk_private.h b/Source/WebKit/efl/ewk/ewk_private.h index 114c39e..c3de98a 100644 --- a/Source/WebKit/efl/ewk/ewk_private.h +++ b/Source/WebKit/efl/ewk/ewk_private.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_private.h + * @brief Private methods of WebKit-EFL. + */ + #ifndef ewk_private_h #define ewk_private_h diff --git a/Source/WebKit/efl/ewk/ewk_settings.cpp b/Source/WebKit/efl/ewk/ewk_settings.cpp index 3a185d9..16abdc7 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.cpp +++ b/Source/WebKit/efl/ewk/ewk_settings.cpp @@ -29,6 +29,7 @@ #include "Image.h" #include "IntSize.h" #include "KURL.h" +#include "MemoryCache.h" #include "ewk_private.h" #include <Eina.h> @@ -326,6 +327,46 @@ const char* ewk_settings_proxy_uri_get(void) } /** + * Gets status of the memory cache of WebCore. + * + * @return @c EINA_TRUE if the cache is enabled or @c EINA_FALSE if not + */ +Eina_Bool ewk_settings_cache_enable_get(void) +{ + WebCore::MemoryCache* cache = WebCore::memoryCache(); + return !cache->disabled(); +} + +/** + * Enables/disables the memory cache of WebCore, possibly clearing it. + * + * Disabling the cache will remove all resources from the cache. + * They may still live on if they are referenced by some Web page though. + * + * @param set @c EINA_TRUE to enable memory cache, @c EINA_FALSE to disable + */ +void ewk_settings_cache_enable_set(Eina_Bool set) +{ + WebCore::MemoryCache* cache = WebCore::memoryCache(); + set = !set; + if (cache->disabled() != set) + cache->setDisabled(set); +} + +/** + * Sets capacity of memory cache of WebCore. + * + * WebCore sets default value of memory cache on 8192 * 1024 bytes. + * + * @param capacity the maximum number of bytes that the cache should consume overall + */ +void ewk_settings_cache_capacity_set(unsigned capacity) +{ + WebCore::MemoryCache* cache = WebCore::memoryCache(); + cache->setCapacities(0, capacity, capacity); +} + +/** * @internal * * Gets the default user agent string. diff --git a/Source/WebKit/efl/ewk/ewk_settings.h b/Source/WebKit/efl/ewk/ewk_settings.h index 3e5ca47..0bbdb48 100644 --- a/Source/WebKit/efl/ewk/ewk_settings.h +++ b/Source/WebKit/efl/ewk/ewk_settings.h @@ -54,6 +54,10 @@ EAPI const char *ewk_settings_cache_directory_path_get(void); EAPI void ewk_settings_proxy_uri_set(const char* proxy); EAPI const char* ewk_settings_proxy_uri_get(void); +EAPI Eina_Bool ewk_settings_cache_enable_get(void); +EAPI void ewk_settings_cache_enable_set(Eina_Bool set); +EAPI void ewk_settings_cache_capacity_set(unsigned capacity); + #ifdef __cplusplus } #endif diff --git a/Source/WebKit/efl/ewk/ewk_util.cpp b/Source/WebKit/efl/ewk/ewk_util.cpp index 6830f76..b01be72 100644 --- a/Source/WebKit/efl/ewk/ewk_util.cpp +++ b/Source/WebKit/efl/ewk/ewk_util.cpp @@ -24,6 +24,13 @@ #include "ewk_private.h" #include <eina_safety_checks.h> +/** + * Converts an image from cairo_surface to the Evas_Object. + * + * @param canvas display canvas + * @param surface cairo representation of an image + * @return converted cairo_surface object to the Evas_Object + */ Evas_Object* ewk_util_image_from_cairo_surface_add(Evas* canvas, cairo_surface_t* surface) { cairo_status_t status; diff --git a/Source/WebKit/efl/ewk/ewk_util.h b/Source/WebKit/efl/ewk/ewk_util.h index d9c8f9c..2371888 100644 --- a/Source/WebKit/efl/ewk/ewk_util.h +++ b/Source/WebKit/efl/ewk/ewk_util.h @@ -18,6 +18,11 @@ Boston, MA 02110-1301, USA. */ +/** + * @file ewk_util.h + * @brief Helpfull methods for WebKit-EFL. + */ + #ifndef ewk_util_h #define ewk_util_h diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp index 8a3b04d..a6749de 100644 --- a/Source/WebKit/efl/ewk/ewk_view.cpp +++ b/Source/WebKit/efl/ewk/ewk_view.cpp @@ -1010,7 +1010,7 @@ static WebCore::ViewportAttributes _ewk_view_viewport_attributes_compute(Evas_Ob EWK_VIEW_PRIV_GET(sd, priv); int desktop_width = 980; - int device_dpi = 160; + int device_dpi = ewk_view_dpi_get(); int available_width = (int) priv->page->chrome()->client()->pageRect().width(); int available_height = (int) priv->page->chrome()->client()->pageRect().height(); diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index 88452c2..65dfcc8 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,6 +1,143 @@ -2011-03-30 Martin Robinson <mrobinson@igalia.com> +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> - Reviewed by Dirk Schulze. + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::dispatchDidReceiveContentLength): + * WebCoreSupport/FrameLoaderClientGtk.h: + * webkit/webkitdownload.cpp: + (DownloadClient::didReceiveData): + +2011-04-18 Zan Dobersek <zandobersek@gmail.com> + + Reviewed by Martin Robinson. + + [GTK] Need support for dumping focus rectangles in pixel results + https://bugs.webkit.org/show_bug.cgi?id=53647 + + Add a support function that returns the rectangle of the current + selection in frame. + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::rectangleForSelection): + * WebCoreSupport/DumpRenderTreeSupportGtk.h: + +2011-04-12 Xan Lopez <xlopez@igalia.com> + + Unreviewed build fix. + + * webkit/webkitwebhistoryitem.cpp: + +2011-04-12 Stephanie Lewis <slewis@apple.com> + + Reviewed by Oliver Hunt. + + https://bugs.webkit.org/show_bug.cgi?id=58280 + <rdar://problem/9252824> javascript in an inconsistent state due to serialization returning an un-handled exception. + + Add a header include. Fallout from untangling some header files in WebCore. + + * webkit/webkitwebhistoryitem.cpp: + +2011-02-03 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Eric Seidel. + + [GTK] The GTK+ DRT needs an implementation of the PlainTextController + https://bugs.webkit.org/show_bug.cgi?id=53605 + + Added jsValueToDOMRange to DumpRenderTreeSupportGtk. This static method can convert + a JSValueRef to a WebKitDOMRange. When it's possible to do this with the public + API, we can remove this method. + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::jsValueToDOMRange): Added. + * WebCoreSupport/DumpRenderTreeSupportGtk.h: Added declaration. + +2011-04-11 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Chris Fleizach. + + [Gtk] Implement support for Embedded Objects + https://bugs.webkit.org/show_bug.cgi?id=52148 + + New accessibility unit test for embedded objects. + + * tests/testatk.c: + (testWebkitAtkEmbeddedObjects): New unit test. + (main): Added the new unit test. + +2011-04-08 Dominic Cooney <dominicc@google.com> + + Reviewed by Adam Roben. + + Make layoutTestController.shadowRoot return null, not undefined, + when its argument is invalid. + https://bugs.webkit.org/show_bug.cgi?id=58121 + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::shadowRoot): + +2011-04-08 Dominic Cooney <dominicc@google.com> + + Reviewed by Kent Tamura. + + layoutTestController.shadowRoot should return undefined if its + argument is not an element. + https://bugs.webkit.org/show_bug.cgi?id=58119 + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::shadowRoot): + +2011-04-08 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Implement increment() and decrement() functions in DRT's AccessibilityUIElement + https://bugs.webkit.org/show_bug.cgi?id=58039 + + Implemented missing functions in GTK's DRT. + + * WebCoreSupport/DumpRenderTreeSupportGtk.h: + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (modifyAccessibilityValue): Helper function to increment or decrement + the current value for an object through the AccessibilityObject's API. + (DumpRenderTreeSupportGtk::incrementAccessibilityValue): New function, + to be used from GTK's DRT. + (DumpRenderTreeSupportGtk::decrementAccessibilityValue): Ditto. + +2011-04-06 Gustavo Noronha Silva <gns@gnome.org> + + Reviewed by Martin Robinson. + + [GTK] Need a way to get the path to a WebKitWebPlugin + https://bugs.webkit.org/show_bug.cgi?id=57968 + + Expose the path of the plugin through the WebKitWebPlugin object. + + * webkit/webkitwebplugin.cpp: + (webkit_web_plugin_get_path): + * webkit/webkitwebplugin.h: + * webkit/webkitwebpluginprivate.h: + +2011-04-07 Alice Boxhall <aboxhall@chromium.org> + + Reviewed by Ryosuke Niwa. + + Move the MouseEventWithHitTestResults::targetNode() method on to EventHandler. + https://bugs.webkit.org/show_bug.cgi?id=57921 + + * webkit/webkitwebview.cpp: + (webkit_web_view_forward_context_menu_event): + Call subframeForHitTestResult rather than subframeForTargetNode as the targetNode() + method has moved on to EventHandler. + +2011-04-05 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Eric Seidel. [Cairo] Better separate the concerns of GraphicsContextCairo https://bugs.webkit.org/show_bug.cgi?id=55150 @@ -15,6 +152,124 @@ (webkit_web_view_expose_event): (webkit_web_view_draw): +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/TextCheckerClientEnchant.h: + (WebKit::TextCheckerClientEnchant::requestCheckingOfString): + +2011-04-04 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Gustavo Noronha Silva. + + [GTK] WebGL support + https://bugs.webkit.org/show_bug.cgi?id=31517 + + Add support for toggling WebGL at runtime when it's enabled. + + * webkit/webkitwebsettings.cpp: Add the enable-webgl property. When ENABLE_WEBGL + is not enabled, it's a no-op. + (webkit_web_settings_class_init): Update to support enable-webgl. + (webkit_web_settings_set_property): Ditto. + (webkit_web_settings_get_property): Ditto. + * webkit/webkitwebview.cpp: + (webkit_web_view_update_settings): Ditto. + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * webkit/webkitwebview.cpp: (webkit_web_view_key_release_event): Moved Caps Lock handling from + WebKits to WebCore, because WebKit shouldn't be smart. + +2011-04-04 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Xan Lopez. + + [Gtk] webkit_web_view_popup_menu_handler should call SelectionController::localCaretRect + https://bugs.webkit.org/show_bug.cgi?id=54633 + + Remove use of legacy editing positions when positioning keyboard-driven context + menus. Simplify the code greatly. + + * webkit/webkitwebview.cpp: + (getLocationForKeyboardGeneratedContextMenu): Added this helper which calculates + the context menu position. + (webkit_web_view_popup_menu_handler): Simplify code preventing the menu from bumping + into the edges of the view. Remove (0,-1) hack as it no longer seems to be important. + +2011-04-02 Dominic Cooney <dominicc@google.com> + + Reviewed by Martin Robinson. + + Add layoutTestController.shadowRoot to GTK DumpRenderTree. + https://bugs.webkit.org/show_bug.cgi?id=57551 + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::shadowRoot): + * WebCoreSupport/DumpRenderTreeSupportGtk.h: + +2011-04-01 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r82721. + http://trac.webkit.org/changeset/82721 + https://bugs.webkit.org/show_bug.cgi?id=57687 + + This patch introduced assertion failures on the GTK+ bots. + (Requested by mrobinson on #webkit). + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + * WebCoreSupport/DumpRenderTreeSupportGtk.h: + +2011-04-01 Dominic Cooney <dominicc@google.com> + + Reviewed by Martin Robinson. + + Add layoutTestController.shadowRoot to GTK DumpRenderTree. + https://bugs.webkit.org/show_bug.cgi?id=57551 + + * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: + (DumpRenderTreeSupportGtk::shadowRoot): + * WebCoreSupport/DumpRenderTreeSupportGtk.h: + +2011-03-31 Xan Lopez <xlopez@igalia.com> + + Reviewed by Martin Robinson. + + [GTK] Link explicitly with XRender on Linux/Unix + https://bugs.webkit.org/show_bug.cgi?id=57558 + + * GNUmakefile.am: add XRender LIBS. + +2011-03-31 Evan Martin <evan@chromium.org> + + Build fix from previous change. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::dispatchDidReceiveTitle): + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/FrameLoaderClientGtk.cpp: + (WebKit::FrameLoaderClient::dispatchDidReceiveTitle): + (WebKit::FrameLoaderClient::setTitle): + * WebCoreSupport/FrameLoaderClientGtk.h: + 2011-03-29 Philippe Normand <pnormand@igalia.com> Unreviewed, disable an assert in testwebview due to diff --git a/Source/WebKit/gtk/GNUmakefile.am b/Source/WebKit/gtk/GNUmakefile.am index 7030ea8..20567cc 100644 --- a/Source/WebKit/gtk/GNUmakefile.am +++ b/Source/WebKit/gtk/GNUmakefile.am @@ -98,10 +98,12 @@ libwebkitgtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBA $(LIBSOUP_LIBS) \ $(LIBXML_LIBS) \ $(LIBXSLT_LIBS) \ + $(OPENGL_LIBS) \ $(PANGO_LIBS) \ $(PNG_LIBS) \ $(SQLITE3_LIBS) \ $(UNICODE_LIBS) \ + $(XRENDER_LIBS) \ $(XT_LIBS) \ $(WINMM_LIBS) \ $(SHLWAPI_LIBS) \ diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp index 1336f11..1ce0ada 100644 --- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp @@ -28,6 +28,7 @@ #include "AnimationController.h" #include "DOMWrapperWorld.h" #include "Document.h" +#include "Element.h" #include "FocusController.h" #include "FrameLoaderClientGtk.h" #include "FrameTree.h" @@ -41,6 +42,7 @@ #include "JSElement.h" #include "JSLock.h" #include "JSNodeList.h" +#include "JSRange.h" #include "JSValue.h" #include "NodeList.h" #include "PageGroup.h" @@ -52,6 +54,7 @@ #include "SecurityOrigin.h" #include "Settings.h" #include "TextIterator.h" +#include "WebKitDOMRangePrivate.h" #include "WorkerThread.h" #include "webkitglobalsprivate.h" #include "webkitwebframe.h" @@ -126,6 +129,20 @@ JSValueRef DumpRenderTreeSupportGtk::nodesFromRect(JSContextRef context, JSValue return toRef(exec, toJS(exec, jsDocument->globalObject(), nodes.get())); } +WebKitDOMRange* DumpRenderTreeSupportGtk::jsValueToDOMRange(JSContextRef context, JSValueRef value) +{ + if (!value) + return 0; + + JSLock lock(SilenceAssertionsOnly); + ExecState* exec = toJS(context); + + Range* range = toRange(toJS(exec, value)); + if (!range) + return 0; + return kit(range); +} + /** * getFrameChildren: * @frame: a #WebKitWebFrame @@ -636,6 +653,17 @@ void DumpRenderTreeSupportGtk::clearOpener(WebKitWebFrame* frame) coreFrame->loader()->setOpener(0); } +JSValueRef DumpRenderTreeSupportGtk::shadowRoot(JSContextRef context, JSValueRef value) +{ + JSLock lock(SilenceAssertionsOnly); + JSC::ExecState* exec = toJS(context); + Element* element = toElement(toJS(exec, value)); + if (!element) + return JSValueMakeNull(context); + + return toRef(exec, toJS(exec, element->shadowRoot())); +} + unsigned int DumpRenderTreeSupportGtk::workerThreadCount() { #if ENABLE(WORKERS) @@ -667,6 +695,31 @@ void DumpRenderTreeSupportGtk::setMinimumTimerInterval(WebKitWebView* webView, d core(webView)->settings()->setMinDOMTimerInterval(interval); } +static void modifyAccessibilityValue(AtkObject* axObject, bool increment) +{ + if (!axObject || !WEBKIT_IS_ACCESSIBLE(axObject)) + return; + + AccessibilityObject* coreObject = webkit_accessible_get_accessibility_object(WEBKIT_ACCESSIBLE(axObject)); + if (!coreObject) + return; + + if (increment) + coreObject->increment(); + else + coreObject->decrement(); +} + +void DumpRenderTreeSupportGtk::incrementAccessibilityValue(AtkObject* axObject) +{ + modifyAccessibilityValue(axObject, true); +} + +void DumpRenderTreeSupportGtk::decrementAccessibilityValue(AtkObject* axObject) +{ + modifyAccessibilityValue(axObject, false); +} + void DumpRenderTreeSupportGtk::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { JSC::ExecState* exec = toJS(context); @@ -695,3 +748,16 @@ void DumpRenderTreeSupportGtk::setValueForUser(JSContextRef context, JSValueRef JSStringGetUTF8CString(value, valueBuffer.get(), bufferSize); inputElement->setValueForUser(String::fromUTF8(valueBuffer.get())); } + +void DumpRenderTreeSupportGtk::rectangleForSelection(WebKitWebFrame* frame, GdkRectangle* rectangle) +{ + Frame* coreFrame = core(frame); + if (!coreFrame) + return; + + IntRect bounds = enclosingIntRect(coreFrame->selection()->bounds()); + rectangle->x = bounds.x(); + rectangle->y = bounds.y(); + rectangle->width = bounds.width(); + rectangle->height = bounds.height(); +} diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h index 7ad5af6..7731798 100644 --- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h +++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h @@ -20,12 +20,10 @@ #define DumpRenderTreeSupportGtk_h #include "JSStringRef.h" -#include <webkit/webkitdefines.h> - #include <atk/atk.h> #include <glib.h> #include <webkit/webkitdefines.h> -#include <webkit/webkitwebframe.h> +#include <webkit/webkitdomdefines.h> #include <wtf/text/CString.h> namespace WebKit { @@ -61,6 +59,9 @@ public: static void clearOpener(WebKitWebFrame*); + static JSValueRef shadowRoot(JSContextRef, JSValueRef); + static WebKitDOMRange* jsValueToDOMRange(JSContextRef, JSValueRef); + // FIXME: Move these to webkitwebframe.h once their API has been discussed. static GSList* getFrameChildren(WebKitWebFrame*); static WTF::CString getInnerText(WebKitWebFrame*); @@ -97,6 +98,11 @@ public: static bool selectedRange(WebKitWebView*, int* start, int* end); static double defaultMinimumTimerInterval(); // Not really tied to WebView static void setMinimumTimerInterval(WebKitWebView*, double); + static void rectangleForSelection(WebKitWebFrame*, GdkRectangle*); + + // Accessibility + static void incrementAccessibilityValue(AtkObject*); + static void decrementAccessibilityValue(AtkObject*); // GC static void gcCollectJavascriptObjects(); diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp index ca8bf9a..539675a 100644 --- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp @@ -949,21 +949,22 @@ void FrameLoaderClient::dispatchDidStartProvisionalLoad() notifyStatus(m_frame, WEBKIT_LOAD_PROVISIONAL); } -void FrameLoaderClient::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) { if (m_loadingErrorPage) return; WebKitWebFramePrivate* priv = m_frame->priv; g_free(priv->title); - priv->title = g_strdup(title.utf8().data()); + // FIXME: use direction of title. + priv->title = g_strdup(title.string().utf8().data()); g_signal_emit_by_name(m_frame, "title-changed", priv->title); g_object_notify(G_OBJECT(m_frame), "title"); WebKitWebView* webView = getViewFromFrame(m_frame); if (m_frame == webkit_web_view_get_main_frame(webView)) { - g_signal_emit_by_name(webView, "title-changed", m_frame, title.utf8().data()); + g_signal_emit_by_name(webView, "title-changed", m_frame, title.string().utf8().data()); g_object_notify(G_OBJECT(webView), "title"); } } @@ -1119,14 +1120,15 @@ void FrameLoaderClient::prepareForDataSourceReplacement() notImplemented(); } -void FrameLoaderClient::setTitle(const String& title, const KURL& url) +void FrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) { WebKitWebFramePrivate* frameData = m_frame->priv; g_free(frameData->title); - frameData->title = g_strdup(title.utf8().data()); + // FIXME: use direction of title. + frameData->title = g_strdup(title.string().utf8().data()); } -void FrameLoaderClient::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived) +void FrameLoaderClient::dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength) { notImplemented(); } diff --git a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h index b7ead7a..ed9ac37 100644 --- a/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h +++ b/Source/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h @@ -65,7 +65,7 @@ namespace WebKit { virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); @@ -81,7 +81,7 @@ namespace WebKit { virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String&); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -174,7 +174,7 @@ namespace WebKit { virtual void prepareForDataSourceReplacement(); virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection& title, const WebCore::KURL&); virtual WTF::String userAgent(const WebCore::KURL&); diff --git a/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h b/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h index c294a3d..5d93c07 100644 --- a/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h +++ b/Source/WebKit/gtk/WebCoreSupport/TextCheckerClientEnchant.h @@ -49,7 +49,7 @@ class TextCheckerClientEnchant : public WebCore::TextCheckerClient { virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {} + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {} void updateSpellCheckingLanguage(const char*); static void freeSpellCheckingLanguage(gpointer, gpointer); diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c index 161b4b8..603c6c8 100644 --- a/Source/WebKit/gtk/tests/testatk.c +++ b/Source/WebKit/gtk/tests/testatk.c @@ -50,6 +50,8 @@ static const char* contentsWithExtraneousWhiteSpaces = "<html><head><body><p>Thi static const char* comboBoxSelector = "<html><body><select><option selected value='foo'>foo</option><option value='bar'>bar</option></select></body></html>"; +static const char* embeddedObjects = "<html><body><p>Choose: <input value='foo' type='checkbox'/>foo <input value='bar' type='checkbox'/>bar (pick one)</p><p>Choose: <select name='foo'><option>bar</option><option>baz</option></select> (pick one)</p><p><input name='foobarbutton' value='foobar' type='button'/></p></body></html>"; + static const char* formWithTextInputs = "<html><body><form><input type='text' name='entry' /></form></body></html>"; static const char* hypertextAndHyperlinks = "<html><body><p>A paragraph with no links at all</p><p><a href='http://foo.bar.baz/'>A line</a> with <a href='http://bar.baz.foo/'>a link in the middle</a> as well as at the beginning and <a href='http://baz.foo.bar/'>at the end</a></p><ol><li>List item with a <span><a href='http://foo.bar.baz/'>link inside a span node</a></span></li></ol></body></html>"; @@ -480,6 +482,92 @@ static void testWebkitAtkComboBox() g_object_unref(webView); } +static void testWebkitAtkEmbeddedObjects() +{ + WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); + g_object_ref_sink(webView); + GtkAllocation allocation = { 0, 0, 800, 600 }; + gtk_widget_size_allocate(GTK_WIDGET(webView), &allocation); + webkit_web_view_load_string(webView, embeddedObjects, 0, 0, 0); + + /* Wait for the accessible objects to be created. */ + waitForAccessibleObjects(); + + AtkObject* object = gtk_widget_get_accessible(GTK_WIDGET(webView)); + g_assert(object); + + AtkText* paragraph1 = ATK_TEXT(atk_object_ref_accessible_child(object, 0)); + g_assert(ATK_IS_TEXT(paragraph1)); + g_assert(ATK_IS_HYPERTEXT(paragraph1)); + + const gchar* expectedText = "Choose: \357\277\274foo \357\277\274bar (pick one)"; + char* text = atk_text_get_text(paragraph1, 0, -1); + g_assert_cmpstr(text, ==, expectedText); + g_free(text); + + gint nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph1)); + g_assert_cmpint(nLinks, ==, 2); + + AtkHyperlink* hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph1), 0); + g_assert(ATK_HYPERLINK(hLink)); + AtkObject* hLinkObject = atk_hyperlink_get_object(hLink, 0); + g_assert(ATK_OBJECT(hLinkObject)); + g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_CHECK_BOX); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 8); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 9); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); + + AtkText* paragraph2 = ATK_TEXT(atk_object_ref_accessible_child(object, 1)); + g_assert(ATK_IS_TEXT(paragraph2)); + g_assert(ATK_IS_HYPERTEXT(paragraph2)); + + expectedText = "Choose: \357\277\274 (pick one)"; + text = atk_text_get_text(paragraph2, 0, -1); + g_assert_cmpstr(text, ==, expectedText); + g_free(text); + + nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph2)); + g_assert_cmpint(nLinks, ==, 1); + + hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph2), 0); + g_assert(ATK_HYPERLINK(hLink)); + hLinkObject = atk_hyperlink_get_object(hLink, 0); + g_assert(ATK_OBJECT(hLinkObject)); + g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_COMBO_BOX); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 8); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 9); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); + + AtkText* paragraph3 = ATK_TEXT(atk_object_ref_accessible_child(object, 2)); + g_assert(ATK_IS_TEXT(paragraph3)); + g_assert(ATK_IS_HYPERTEXT(paragraph3)); + + expectedText = "\357\277\274"; + text = atk_text_get_text(paragraph3, 0, -1); + g_assert_cmpstr(text, ==, expectedText); + g_free(text); + + nLinks = atk_hypertext_get_n_links(ATK_HYPERTEXT(paragraph3)); + g_assert_cmpint(nLinks, ==, 1); + + hLink = atk_hypertext_get_link(ATK_HYPERTEXT(paragraph3), 0); + g_assert(ATK_HYPERLINK(hLink)); + hLinkObject = atk_hyperlink_get_object(hLink, 0); + g_assert(ATK_OBJECT(hLinkObject)); + g_assert(atk_object_get_role(hLinkObject) == ATK_ROLE_PUSH_BUTTON); + g_assert_cmpint(atk_hyperlink_get_start_index(hLink), ==, 0); + g_assert_cmpint(atk_hyperlink_get_end_index(hLink), ==, 1); + g_assert_cmpint(atk_hyperlink_get_n_anchors(hLink), ==, 1); + g_assert_cmpstr(atk_hyperlink_get_uri(hLink, 0), ==, 0); + + g_object_unref(paragraph1); + g_object_unref(paragraph2); + g_object_unref(paragraph3); + g_object_unref(webView); +} + static void testWebkitAtkGetTextAtOffsetForms() { WebKitWebView* webView = WEBKIT_WEB_VIEW(webkit_web_view_new()); @@ -1579,6 +1667,7 @@ int main(int argc, char** argv) g_test_add_func("/webkit/atk/caretOffsets", testWebkitAtkCaretOffsets); g_test_add_func("/webkit/atk/caretOffsetsAndExtranousWhiteSpaces", testWebkitAtkCaretOffsetsAndExtranousWhiteSpaces); g_test_add_func("/webkit/atk/comboBox", testWebkitAtkComboBox); + g_test_add_func("/webkit/atk/embeddedObjects", testWebkitAtkEmbeddedObjects); g_test_add_func("/webkit/atk/getTextAtOffset", testWebkitAtkGetTextAtOffset); g_test_add_func("/webkit/atk/getTextAtOffsetForms", testWebkitAtkGetTextAtOffsetForms); g_test_add_func("/webkit/atk/getTextAtOffsetNewlines", testWebkitAtkGetTextAtOffsetNewlines); diff --git a/Source/WebKit/gtk/webkit/webkitdownload.cpp b/Source/WebKit/gtk/webkit/webkitdownload.cpp index a7890c1..f2d706f 100644 --- a/Source/WebKit/gtk/webkit/webkitdownload.cpp +++ b/Source/WebKit/gtk/webkit/webkitdownload.cpp @@ -927,7 +927,7 @@ void DownloadClient::didReceiveResponse(ResourceHandle*, const ResourceResponse& webkit_download_set_response(m_download, response); } -void DownloadClient::didReceiveData(ResourceHandle*, const char* data, int length, int lengthReceived) +void DownloadClient::didReceiveData(ResourceHandle*, const char* data, int length, int encodedDataLength) { webkit_download_received_data(m_download, data, length); } diff --git a/Source/WebKit/gtk/webkit/webkitwebhistoryitem.cpp b/Source/WebKit/gtk/webkit/webkitwebhistoryitem.cpp index eabdc49..015d770 100644 --- a/Source/WebKit/gtk/webkit/webkitwebhistoryitem.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebhistoryitem.cpp @@ -22,6 +22,7 @@ #include "webkitwebhistoryitem.h" #include "HistoryItem.h" +#include "KURL.h" #include "PlatformString.h" #include "webkitglobalsprivate.h" #include "webkitwebhistoryitemprivate.h" diff --git a/Source/WebKit/gtk/webkit/webkitwebplugin.cpp b/Source/WebKit/gtk/webkit/webkitwebplugin.cpp index 52d5965..95ac614 100644 --- a/Source/WebKit/gtk/webkit/webkitwebplugin.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebplugin.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Igalia S.L. + * Copyright (C) 2011 Gustavo Noronha Silva <gns@gnome.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -62,6 +63,8 @@ static void webkit_web_plugin_finalize(GObject* object) WebKitWebPlugin* plugin = WEBKIT_WEB_PLUGIN(object); WebKitWebPluginPrivate* priv = plugin->priv; + g_free(priv->path); + g_slist_foreach(priv->mimeTypes, (GFunc)freeMIMEType, 0); g_slist_free(priv->mimeTypes); @@ -173,6 +176,43 @@ const char* webkit_web_plugin_get_description(WebKitWebPlugin* plugin) } /** + * webkit_web_plugin_get_path: + * @plugin: a #WebKitWebPlugin + * + * Returns: the absolute path to @plugin in system filename encoding + * or %NULL on failure to convert the filename from UTF-8. + * + * Since: 1.4.0 + */ +const char* webkit_web_plugin_get_path(WebKitWebPlugin* plugin) +{ + g_return_val_if_fail(WEBKIT_IS_WEB_PLUGIN(plugin), 0); + + WebKitWebPluginPrivate* priv = plugin->priv; + + if (priv->path) + return priv->path; + + GError* error = 0; + priv->path = g_filename_from_utf8(priv->corePlugin->path().utf8().data(), -1, 0, 0, &error); + + if (!error) + return priv->path; + + // In the unlikely case the convertion fails, report the error and make sure we free + // any partial convertion that ended up in the variable. + g_free(priv->path); + priv->path = 0; + + g_warning("Failed to convert '%s' to system filename encoding: %s", priv->corePlugin->path().utf8().data(), error->message); + + g_clear_error(&error); + + return 0; +} + + +/** * webkit_web_plugin_get_mimetypes: * @plugin: a #WebKitWebPlugin * diff --git a/Source/WebKit/gtk/webkit/webkitwebplugin.h b/Source/WebKit/gtk/webkit/webkitwebplugin.h index 3514d1e..9205674 100644 --- a/Source/WebKit/gtk/webkit/webkitwebplugin.h +++ b/Source/WebKit/gtk/webkit/webkitwebplugin.h @@ -73,6 +73,9 @@ webkit_web_plugin_get_name (WebKitWebPlugin*); WEBKIT_API const char* webkit_web_plugin_get_description (WebKitWebPlugin*); +WEBKIT_API const char* +webkit_web_plugin_get_path (WebKitWebPlugin*); + WEBKIT_API GSList* webkit_web_plugin_get_mimetypes (WebKitWebPlugin*); diff --git a/Source/WebKit/gtk/webkit/webkitwebpluginprivate.h b/Source/WebKit/gtk/webkit/webkitwebpluginprivate.h index 4ae204b..8a1ba1b 100644 --- a/Source/WebKit/gtk/webkit/webkitwebpluginprivate.h +++ b/Source/WebKit/gtk/webkit/webkitwebpluginprivate.h @@ -38,6 +38,7 @@ struct _WebKitWebPluginPrivate { RefPtr<WebCore::PluginPackage> corePlugin; CString name; CString description; + char* path; GSList* mimeTypes; }; diff --git a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp index 3b4cf57..e833de9 100644 --- a/Source/WebKit/gtk/webkit/webkitwebsettings.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebsettings.cpp @@ -113,6 +113,7 @@ struct _WebKitWebSettingsPrivate { gboolean enable_hyperlink_auditing; gboolean enable_fullscreen; gboolean enable_dns_prefetching; + gboolean enable_webgl; }; #define WEBKIT_WEB_SETTINGS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), WEBKIT_TYPE_WEB_SETTINGS, WebKitWebSettingsPrivate)) @@ -166,7 +167,8 @@ enum { PROP_ENABLE_JAVA_APPLET, PROP_ENABLE_HYPERLINK_AUDITING, PROP_ENABLE_FULLSCREEN, - PROP_ENABLE_DNS_PREFETCHING + PROP_ENABLE_DNS_PREFETCHING, + PROP_ENABLE_WEBGL }; // Create a default user agent string @@ -912,6 +914,22 @@ static void webkit_web_settings_class_init(WebKitWebSettingsClass* klass) _("Whether the Mozilla style API should be enabled."), FALSE, flags)); + /** + * WebKitWebSettings:enable-webgl: + * + * Enable or disable support for WebGL on pages. WebGL is an experimental + * proposal for allowing web pages to use OpenGL ES-like calls directly. The + * standard is currently a work-in-progress by the Khronos Group. + * + * Since: 1.3.14 + */ + g_object_class_install_property(gobject_class, + PROP_ENABLE_WEBGL, + g_param_spec_boolean("enable-webgl", + _("Enable WebGL"), + _("Whether WebGL content should be rendered"), + FALSE, + flags)); /** * WebKitWebSettings:enable-dns-prefetching @@ -1117,6 +1135,9 @@ static void webkit_web_settings_set_property(GObject* object, guint prop_id, con case PROP_ENABLE_DNS_PREFETCHING: priv->enable_dns_prefetching = g_value_get_boolean(value); break; + case PROP_ENABLE_WEBGL: + priv->enable_webgl = g_value_get_boolean(value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; @@ -1270,6 +1291,9 @@ static void webkit_web_settings_get_property(GObject* object, guint prop_id, GVa case PROP_ENABLE_DNS_PREFETCHING: g_value_set_boolean(value, priv->enable_dns_prefetching); break; + case PROP_ENABLE_WEBGL: + g_value_set_boolean(value, priv->enable_webgl); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); break; diff --git a/Source/WebKit/gtk/webkit/webkitwebview.cpp b/Source/WebKit/gtk/webkit/webkitwebview.cpp index bf74d7b..85ad904 100644 --- a/Source/WebKit/gtk/webkit/webkitwebview.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebview.cpp @@ -319,7 +319,7 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie IntPoint point = mainFrame->view()->windowToContents(event.pos()); MouseEventWithHitTestResults mev = mainFrame->document()->prepareMouseEvent(request, point, event); - Frame* targetFrame = EventHandler::subframeForTargetNode(mev.targetNode()); + Frame* targetFrame = EventHandler::subframeForHitTestResult(mev); if (!targetFrame) targetFrame = mainFrame; @@ -381,84 +381,43 @@ static gboolean webkit_web_view_forward_context_menu_event(WebKitWebView* webVie return TRUE; } +static const int gContextMenuMargin = 1; +static IntPoint getLocationForKeyboardGeneratedContextMenu(Frame* frame) +{ + SelectionController* selection = frame->selection(); + if (!selection->selection().isNonOrphanedCaretOrRange() + || (selection->selection().isCaret() && !selection->selection().isContentEditable())) { + if (Node* focusedNode = getFocusedNode(frame)) + return focusedNode->getRect().location(); + + // There was no selection and no focused node, so just put the context + // menu into the corner of the view, offset slightly. + return IntPoint(gContextMenuMargin, gContextMenuMargin); + } + + // selection->selection().firstRange can return 0 here, but if that was the case + // selection->selection().isNonOrphanedCaretOrRange() would have returned false + // above, so we do not have to check it. + IntRect firstRect = frame->editor()->firstRectForRange(selection->selection().firstRange().get()); + return IntPoint(firstRect.x(), firstRect.maxY()); +} + static gboolean webkit_web_view_popup_menu_handler(GtkWidget* widget) { - static const int contextMenuMargin = 1; + Frame* frame = core(WEBKIT_WEB_VIEW(widget))->focusController()->focusedOrMainFrame(); + IntPoint location = getLocationForKeyboardGeneratedContextMenu(frame); - // The context menu event was generated from the keyboard, so show the context menu by the current selection. - Page* page = core(WEBKIT_WEB_VIEW(widget)); - Frame* frame = page->focusController()->focusedOrMainFrame(); FrameView* view = frame->view(); if (!view) - return FALSE; - - Position start = frame->selection()->selection().start(); - Position end = frame->selection()->selection().end(); - - int rightAligned = FALSE; - IntPoint location; - - if (!start.deprecatedNode() || !end.deprecatedNode() - || (frame->selection()->selection().isCaret() && !frame->selection()->selection().isContentEditable())) { - // If there's a focused elment, use its location. - if (Node* focusedNode = getFocusedNode(frame)) { - IntRect focusedNodeRect = focusedNode->getRect(); - location = IntPoint(rightAligned ? focusedNodeRect.maxX() : focusedNodeRect.x(), focusedNodeRect.maxY()); - } else - location = IntPoint(rightAligned ? view->contentsWidth() - contextMenuMargin : contextMenuMargin, contextMenuMargin); - } else { - RenderObject* renderer = start.deprecatedNode()->renderer(); - if (!renderer) - return FALSE; - - // Calculate the rect of the first line of the selection (cribbed from -[WebCoreFrameBridge firstRectForDOMRange:], - // now Frame::firstRectForRange(), which perhaps this should call). - int extraWidthToEndOfLine = 0; - - InlineBox* startInlineBox; - int startCaretOffset; - start.getInlineBoxAndOffset(DOWNSTREAM, startInlineBox, startCaretOffset); - IntRect startCaretRect = renderer->localCaretRect(startInlineBox, startCaretOffset, &extraWidthToEndOfLine); - if (startCaretRect != IntRect()) - startCaretRect = renderer->localToAbsoluteQuad(FloatRect(startCaretRect)).enclosingBoundingBox(); - - InlineBox* endInlineBox; - int endCaretOffset; - end.getInlineBoxAndOffset(UPSTREAM, endInlineBox, endCaretOffset); - IntRect endCaretRect = renderer->localCaretRect(endInlineBox, endCaretOffset); - if (endCaretRect != IntRect()) - endCaretRect = renderer->localToAbsoluteQuad(FloatRect(endCaretRect)).enclosingBoundingBox(); - - IntRect firstRect; - if (startCaretRect.y() == endCaretRect.y()) - firstRect = IntRect(MIN(startCaretRect.x(), endCaretRect.x()), - startCaretRect.y(), - abs(endCaretRect.x() - startCaretRect.x()), - MAX(startCaretRect.height(), endCaretRect.height())); - else - firstRect = IntRect(startCaretRect.x(), - startCaretRect.y(), - startCaretRect.width() + extraWidthToEndOfLine, - startCaretRect.height()); - - location = IntPoint(rightAligned ? firstRect.maxX() : firstRect.x(), firstRect.maxY()); - } + return FALSE; - // FIXME: The IntSize(0, -1) is a hack to get the hit-testing to result in the selected element. - // Ideally we'd have the position of a context menu event be separate from its target node. - location = view->contentsToWindow(location) + IntSize(0, -1); - if (location.y() < 0) - location.setY(contextMenuMargin); - else if (location.y() > view->height()) - location.setY(view->height() - contextMenuMargin); - if (location.x() < 0) - location.setX(contextMenuMargin); - else if (location.x() > view->width()) - location.setX(view->width() - contextMenuMargin); - IntPoint global(globalPointForClientPoint(gtk_widget_get_window(widget), location)); - - PlatformMouseEvent event(location, global, RightButton, MouseEventPressed, 0, false, false, false, false, gtk_get_current_event_time()); + // Never let the context menu touch the very edge of the view. + location = view->contentsToWindow(location); + location.expandedTo(IntPoint(gContextMenuMargin, gContextMenuMargin)); + location.shrunkTo(IntPoint(view->width() - gContextMenuMargin, view->height() - gContextMenuMargin)); + IntPoint globalPoint(globalPointForClientPoint(gtk_widget_get_window(widget), location)); + PlatformMouseEvent event(location, globalPoint, RightButton, MouseEventPressed, 0, false, false, false, false, gtk_get_current_event_time()); return webkit_web_view_forward_context_menu_event(WEBKIT_WEB_VIEW(widget), event); } @@ -790,9 +749,6 @@ static gboolean webkit_web_view_key_release_event(GtkWidget* widget, GdkEventKey if (!frame->view()) return FALSE; - if (event->keyval == GDK_Caps_Lock) - frame->eventHandler()->capsLockStateMayHaveChanged(); - PlatformKeyboardEvent keyboardEvent(event); if (frame->eventHandler()->keyEvent(keyboardEvent)) return TRUE; @@ -3292,7 +3248,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) enableXSSAuditor, enableSpatialNavigation, enableFrameFlattening, javascriptCanOpenWindows, javaScriptCanAccessClipboard, enableOfflineWebAppCache, enableUniversalAccessFromFileURI, enableFileAccessFromFileURI, - enableDOMPaste, tabKeyCyclesThroughElements, + enableDOMPaste, tabKeyCyclesThroughElements, enableWebGL, enableSiteSpecificQuirks, usePageCache, enableJavaApplet, enableHyperlinkAuditing, enableFullscreen, enableDNSPrefetching; @@ -3336,6 +3292,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) "spell-checking-languages", &defaultSpellCheckingLanguages, "enable-fullscreen", &enableFullscreen, "enable-dns-prefetching", &enableDNSPrefetching, + "enable-webgl", &enableWebGL, NULL); settings->setDefaultTextEncodingName(defaultEncoding); @@ -3373,14 +3330,20 @@ static void webkit_web_view_update_settings(WebKitWebView* webView) settings->setUsesPageCache(usePageCache); settings->setJavaEnabled(enableJavaApplet); settings->setHyperlinkAuditingEnabled(enableHyperlinkAuditing); + settings->setDNSPrefetchingEnabled(enableDNSPrefetching); + #if ENABLE(FULLSCREEN_API) settings->setFullScreenEnabled(enableFullscreen); #endif + #if ENABLE(SPELLCHECK) WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient()); static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(defaultSpellCheckingLanguages); #endif - settings->setDNSPrefetchingEnabled(enableDNSPrefetching); + +#if ENABLE(WEBGL) + settings->setWebGLEnabled(enableWebGL); +#endif Page* page = core(webView); if (page) @@ -3498,12 +3461,19 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar settings->setJavaEnabled(g_value_get_boolean(&value)); else if (name == g_intern_string("enable-hyperlink-auditing")) settings->setHyperlinkAuditingEnabled(g_value_get_boolean(&value)); + #if ENABLE(SPELLCHECK) else if (name == g_intern_string("spell-checking-languages")) { WebKit::EditorClient* client = static_cast<WebKit::EditorClient*>(core(webView)->editorClient()); static_cast<WebKit::TextCheckerClientEnchant*>(client->textChecker())->updateSpellCheckingLanguage(g_value_get_string(&value)); } #endif + +#if ENABLE(WEBGL) + else if (name == g_intern_string("enable-webgl")) + settings->setWebGLEnabled(g_value_get_boolean(&value)); +#endif + else if (!g_object_class_find_property(G_OBJECT_GET_CLASS(webSettings), name)) g_warning("Unexpected setting '%s'", name); g_value_unset(&value); diff --git a/Source/WebKit/haiku/ChangeLog b/Source/WebKit/haiku/ChangeLog index 7757fe7..6ae3da1 100644 --- a/Source/WebKit/haiku/ChangeLog +++ b/Source/WebKit/haiku/ChangeLog @@ -1,3 +1,39 @@ +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/EditorClientHaiku.h: + (WebCore::EditorClientHaiku::requestCheckingOfString): + +2011-04-04 Chang Shu <cshu@webkit.org> + + Reviewed by Ryosuke Niwa. + + setContentEditable with true/false/inherit string is not working properly + https://bugs.webkit.org/show_bug.cgi?id=52058 + + Move isContentEditable from HTMLElement to Node. WebKit should only access isContentEditable + as rendererIsEditable is for WebCore internal use. + + * WebCoreSupport/EditorClientHaiku.cpp: + (WebCore::EditorClientHaiku::handleKeyboardEvent): + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/FrameLoaderClientHaiku.cpp: + (WebCore::FrameLoaderClientHaiku::dispatchDidReceiveTitle): + * WebCoreSupport/FrameLoaderClientHaiku.h: + 2011-03-25 Andy Estes <aestes@apple.com> Reviewed by Adele Peterson. diff --git a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp index 1a84dab..5c1b13f 100644 --- a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp +++ b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp @@ -254,7 +254,7 @@ void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) if (!start) return; - if (start->rendererIsEditable()) { + if (start->isContentEditable()) { switch (kevent->windowsVirtualKeyCode()) { case VK_BACK: frame->editor()->deleteWithDirection(DirectionBackward, diff --git a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h index bb0d8ac..cc21fcb 100644 --- a/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h +++ b/Source/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h @@ -111,7 +111,7 @@ class EditorClientHaiku : public EditorClient, public TextCheckerClient { virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(SpellChecker*, int, const String&) {} + virtual void requestCheckingOfString(SpellChecker*, int, WebCore::TextCheckingTypeMask, const String&) {} virtual TextCheckerClient* textChecker() { return this; } bool isEditing() const; diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp index 24a98d5..c04cb7d 100644 --- a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp +++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp @@ -237,13 +237,13 @@ void FrameLoaderClientHaiku::dispatchDidStartProvisionalLoad() } } -void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientHaiku::dispatchDidReceiveTitle(const StringWithTitle& title) { if (m_webView) { - m_webView->SetPageTitle(title); - + // FIXME: use direction of title. + m_webView->SetPageTitle(title.m_string()); BMessage message(TITLE_CHANGED); - message.AddString("title", title); + message.AddString("title", title.string()); m_messenger->SendMessage(&message); } } diff --git a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h index dbd3084..f576545 100644 --- a/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h +++ b/Source/WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.h @@ -102,7 +102,7 @@ namespace WebCore { virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidReceiveTitle(const StringWithDirection& title); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); virtual void dispatchDidFinishLoad(); @@ -143,7 +143,7 @@ namespace WebCore { virtual void addHistoryItemForFragmentScroll(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); - virtual void setTitle(const String& title, const KURL&); + virtual void setTitle(const StringWithDirection&, const KURL&); virtual String userAgent(const KURL&); diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog index afaa1e3..5139734 100644 --- a/Source/WebKit/mac/ChangeLog +++ b/Source/WebKit/mac/ChangeLog @@ -1,3 +1,665 @@ +2011-04-19 Matthew Delaney <mdelaney@apple.com> + + Reviewed by Simon Fraser. + + WebPreferences in WebKit1 should have CanvasUsesAcceleratedDrawing set to NO by default + https://bugs.webkit.org/show_bug.cgi?id=58936 + + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): + +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::dispatchDidReceiveContentLength): + +2011-04-18 Jia Pu <jpu@apple.com> + + Reviewed by Mark Rowe. + + WebKit needs to stop importing <AppKit/NSTextChecker.h> + https://bugs.webkit.org/show_bug.cgi?id=58798 + <rdar://problem/9294938> + + Use public header <AppKit/NSSpellChecker.h> instead. + + * WebCoreSupport/CorrectionPanel.h: + * WebCoreSupport/CorrectionPanel.mm: + (correctionIndicatorType): + (CorrectionPanel::show): + (CorrectionPanel::dismissInternal): + (CorrectionPanel::handleAcceptedReplacement): + * WebCoreSupport/WebEditorClient.mm: + * WebView/WebView.mm: + +2011-04-17 Cameron Zwarich <zwarich@apple.com> + + Reviewed by Timothy Hatcher. + + Stop using -[NSString initWithContentsOfFile:] + https://bugs.webkit.org/show_bug.cgi?id=58763 + + -[NSString initWithContentsOfFile:] was deprecated in 10.4, so we should stop using it. + + * WebView/WebView.mm: + (leakMailQuirksUserScriptContents): + (leakOutlookQuirksUserScriptContents): + +2011-04-17 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/58463> Switch HTTP pipelining from user default to private setting + <rdar://problem/9268729> + + Reviewed by Dan Bernstein. + + This replaces support for the WebKitEnableHTTPPipelining user + default with methods on the WebCore::ResourceRequest class in + WebCore, the WebView class in WebKit1, and the WebContext class + in WebKit2. It also removes support for the + WebKitForceHTTPPipeliningPriorityHigh user default which was not + needed. + + * WebView/WebView.mm: + (+[WebView(WebPrivate) _HTTPPipeliningEnabled]): Added. + (+[WebView(WebPrivate) _setHTTPPipeliningEnabled:]): Added. + * WebView/WebViewPrivate.h: + (+[WebView(WebPrivate) _HTTPPipeliningEnabled]): Added declaration. + (+[WebView(WebPrivate) _setHTTPPipeliningEnabled:]): Added declaration. + +2011-04-17 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Dan Bernstein. + + Assign to self in WebInspectorWindowController constructors + https://bugs.webkit.org/show_bug.cgi?id=58749 + + * WebCoreSupport/WebInspectorClient.mm: + (-[WebInspectorWindowController init]): + (-[WebInspectorWindowController initWithInspectedWebView:]): + +2011-04-17 Joseph Pecoraro <joepeck@webkit.org> + + Reviewed by Timothy Hatcher. + + Move WebNodeHighlighter into its own file + https://bugs.webkit.org/show_bug.cgi?id=58746 + + Extract this class into its own file alongside the + other WebNodeHighlight files. In doing so do some + cleanup on WebInspectorClient removing some methods + that were never called. + + * WebCoreSupport/WebInspectorClient.mm: + (WebInspectorClient::WebInspectorClient): style fix. + * WebInspector/WebNodeHighlighter.h: Added. + * WebInspector/WebNodeHighlighter.mm: Added. + (-[WebNodeHighlighter initWithInspectedWebView:]): call super init. + (-[WebNodeHighlighter dealloc]): + (-[WebNodeHighlighter highlightNode:]): + (-[WebNodeHighlighter hideHighlight]): + (-[WebNodeHighlighter didAttachWebNodeHighlight:]): + (-[WebNodeHighlighter willDetachWebNodeHighlight:]): + +2011-04-15 Jia Pu <jpu@apple.com> + + Reviewed by Dan Bernstein. + + [Mac] WebKit needs to convert the bounding box of autocorrected word to view coordinate. + https://bugs.webkit.org/show_bug.cgi?id=58717 + + Convert the bounding box from window coordinate to view coordinate, which is expected by NSCorrectionPanel. + + * WebCoreSupport/CorrectionPanel.mm: + (CorrectionPanel::show): + +2011-04-15 Shishir Agrawal <shishir@chromium.org> + + Reviewed by James Robinson. + + Add a flag to guard Page Visibility API changes. + https://bugs.webkit.org/show_bug.cgi?id=58464 + + * Configurations/FeatureDefines.xcconfig: + +2011-04-15 Oliver Hunt <oliver@apple.com> + + GC allocate Structure + https://bugs.webkit.org/show_bug.cgi?id=58483 + + Rolling r83894 r83827 r83810 r83809 r83808 back in with + a workaround for the gcc bug seen by the gtk bots + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/ProxyInstance.mm: + (WebKit::ProxyRuntimeMethod::createStructure): + * Plugins/Hosted/ProxyRuntimeObject.h: + (WebKit::ProxyRuntimeObject::createStructure): + +2011-04-14 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + WebKit2: Password field input does not switch to ASCII-compatible source + https://bugs.webkit.org/show_bug.cgi?id=58583 + <rdar://problem/9059651> + + Now that WebCore doesn't set secure input mode, WebKit has to. Happily, it already has the + necessary logic, needed to return a nil text input context when in password fields. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView close]): If the view is still enforcing secure event mode, stop. + (-[WebHTMLView windowDidBecomeKey:]): Call _updateSecureInputState. + (-[WebHTMLView windowDidResignKey:]): Ditto. + (-[WebHTMLView becomeFirstResponder]): Call _updateSecureInputState. It's a bit tricky + because the first responder is still different an this point, so set a boolean variable to + let _updateSecureInputState know what's going on. + (-[WebHTMLView resignFirstResponder]): Disable secure event mode if it's on. + (-[WebHTMLView _updateSecureInputState]): Update HIToolbox secure event input state and + allowed input sources accorsing to current selection. + (-[WebHTMLView _updateSelectionForInputManager]): Call _updateSecureInputState. + +2011-04-15 Sam Weinig <sam@webkit.org> + + Reviewed by Maciej Stachowiak. + + Make mac WebKit1 use the default localization strategy + https://bugs.webkit.org/show_bug.cgi?id=58628 + + * WebCoreSupport/WebPlatformStrategies.h: + * WebCoreSupport/WebPlatformStrategies.mm: + Remove the localization strategy code. The equivalent is now + in WebCore/platform/DefaultLocalizationStrategy.cpp. + +2011-04-15 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Renaming TRACK feature define to VIDEO_TRACK + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * Configurations/FeatureDefines.xcconfig: + +2011-04-14 Pratik Solanki <psolanki@apple.com> + + Reviewed by David Kilzer. + + Set minimum priority for fast lane connections + https://bugs.webkit.org/show_bug.cgi?id=58353 + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Support for new WKSI method WKSetHTTPPipeliningMinimumFastLanePriority. + +2011-04-13 Sam Weinig <sam@webkit.org> + + Reviewed by Gavin Barraclough. + + WebKit2 doesn't keep overlay scrollers shown while scroll gesture held + <rdar://problem/9260518> + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): + Initialize new WKSI functions. + +2011-04-13 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/58172> Fix -Wcast-align warning in WebBasePluginPackage.mm + + Reviewed by Anders Carlsson. + + Fixes the following warning with -Wcast-align enabled: + + Source/WebKit/mac/Plugins/WebBasePluginPackage.mm:402:21:{402:21-402:93}{402:39-402:93}: error: cast from 'uint8_t *' (aka 'unsigned char *') to 'struct fat_arch *' increases required alignment from 1 to 4 [-Werror,-Wcast-align,3] + archs = (struct fat_arch*)((uint8_t*)rawData.data() + sizeof(struct fat_header)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + * Plugins/WebBasePluginPackage.mm: + (-[WebBasePluginPackage isNativeLibraryData:]): Added + COMPILE_ASSERT() to make sure our pointer math is valid. + Removed cast to (uint8_t*) and divide sizeof(struct fat_header) + by sizeof(uint32_t) to fix the pointer math. Replaced C-style + casts with reinterpret_cast. + +2011-04-12 Enrica Casucci <enrica@apple.com> + + Reviewed by Alexey Proskuryakov. + + Infinite recursion in WebHTMLView executeSavedKeypressCommands. + https://bugs.webkit.org/show_bug.cgi?id=58382 + <rdar://problem/9239370> + + Execution of some editing commands could trigger a call to selectedRange that + internally calls executeSavedKeypressCommands creating an infinite recursion. + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _executeSavedKeypressCommands]): Added a flag to avoid recursion. + (-[WebHTMLView _interpretKeyEvent:savingCommands:]): Added flag initialization. + +2011-04-12 Alice Liu <alice.liu@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=58292 + Provide new setting to allow site icon loading despite disabling automatic image loading in general. + + * WebView/WebPreferenceKeysPrivate.h: Add preference key. + * WebView/WebPreferences.mm: + (+[WebPreferences initialize]): Initialize to false. + (-[WebPreferences setLoadsSiteIconsIgnoringImageLoadingPreference:]): Added. + (-[WebPreferences loadsSiteIconsIgnoringImageLoadingPreference]): Added. + * WebView/WebPreferencesPrivate.h: Add setter/getter definitions. + * WebView/WebView.mm: + (-[WebView _preferencesChanged:]): Add to settings that get propagated upon changes. + +2011-04-11 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Maciej Stachowiak. + + WebKit2: Safari doesn't respect cmd-arrows (and variations) as custom keyboard shortcuts + https://bugs.webkit.org/show_bug.cgi?id=58175 + <rdar://problem/9060555> + + * WebView/WebFrameView.mm: (-[WebFrameView keyDown:]): Added a comment explaining how this + should be changed to match WebKit2. + +2011-04-06 Timothy Hatcher <timothy@apple.com> + + Fix a bug where the context menu does not show in PDF documents if there is no + UI delegate or the UI delegate does not respond to the context menu selector. + + https://webkit.org/b/57958 + + Reviewed by Darin Adler. + + * WebView/WebView.mm: + (-[WebView _menuForElement:defaultItems:]): CallUIDelegate returns nil + if UIDelegate is nil or doesn't respond to the selector. So check that + here to distinguish between using defaultMenuItems or the delegate + really returning nil to say "no context menu". + +2011-04-11 Jer Noble <jer.noble@apple.com> + + Unreviewed; roll out unintentional change to WebFullScreenController.mm. + + * WebView/WebFullScreenController.mm: + (-[WebFullScreenController enterFullscreen:]): + +2011-04-08 Geoffrey Garen <ggaren@apple.com> + + Reviewed by Oliver Hunt. + + A few heap-related renames and file moves. + + WeakGCPtr<T> => Weak<T> + Global<T> => Strong<T> + collector/ => heap/ + collector/* => heap/* + runtime/WeakGCPtr.h => heap/Weak.h + + (Eventually, even more files should move into the heap directory. Like + Heap.h and Heap.cpp, for example.) + + * Plugins/Hosted/NetscapePluginInstanceProxy.h: + * Plugins/Hosted/NetscapePluginInstanceProxy.mm: + (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject): + (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget): + (WebKit::NetscapePluginInstanceProxy::evaluate): + * WebView/WebScriptDebugger.h: + +2011-04-08 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + WebKit2: Safari doesn't respect cmd-arrows (and variations) as custom keyboard shortcuts + https://bugs.webkit.org/show_bug.cgi?id=58175 + <rdar://problem/9060555> + + * WebView/WebFrameView.mm: (-[WebFrameView keyDown:]): Added a comment explaining how this + should be changed to match WebKit2. + +2011-04-08 Alpha Lam <hclam@chromium.org> + + Unreviewed, rolling out r83335. + http://trac.webkit.org/changeset/83335 + https://bugs.webkit.org/show_bug.cgi?id=53556 + + GTK and QT bots are broken + + * Configurations/FeatureDefines.xcconfig: + +2011-04-07 Anna Cavender <annacc@chromium.org> + + Reviewed by Eric Carlson. + + Setup ENABLE(TRACK) feature define + https://bugs.webkit.org/show_bug.cgi?id=53556 + + * Configurations/FeatureDefines.xcconfig: + +2011-04-08 Maciej Stachowiak <mjs@apple.com> + + Reviewed by Darin Adler. + + -[WebView setPreferences:] can take a lot of time if loading lots of webviews at once + https://bugs.webkit.org/show_bug.cgi?id=58128 + <rdar://problem/9244553> + + The root of the problem here was an O(N^2) issue - each WebView, + upon having its preferences initialized, would broadcast a + notification that was listened to by all other WebViews sharing + its preferences. + + To maintain the API contract, I split the notification into two, + one that is for public API consumption, and the other which is for + internal use only. Changes that don't need to be picked up by + other WebViews broadcast the public notification only. And we + avoid WebView broadcasting a notification just to get itself to + update. + + * Misc/WebIconDatabase.mm: + (-[WebIconDatabase _startUpIconDatabase]): + (-[WebIconDatabase _shutDownIconDatabase]): + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView viewWillMoveToWindow:]): + (-[WebBaseNetscapePluginView viewWillMoveToSuperview:]): + (-[WebBaseNetscapePluginView viewDidMoveToWindow]): + (-[WebBaseNetscapePluginView viewWillMoveToHostWindow:]): + * WebView/WebPreferences.mm: + (-[WebPreferences initWithIdentifier:]): + (-[WebPreferences _setStringValue:forKey:]): + (-[WebPreferences _setIntegerValue:forKey:]): + (-[WebPreferences _setFloatValue:forKey:]): + (-[WebPreferences _setBoolValue:forKey:]): + (-[WebPreferences _setLongLongValue:forKey:]): + (-[WebPreferences _setUnsignedLongLongValue:forKey:]): + (-[WebPreferences _postPreferencesChangedNotification]): + (-[WebPreferences _postPreferencesChangedAPINotification]): + * WebView/WebPreferencesPrivate.h: + * WebView/WebView.mm: + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + (-[WebView _preferencesChangedNotification:]): + (-[WebView _preferencesChanged:]): + (-[WebView setUsesPageCache:]): + (+[WebView initialize]): + (-[WebView setPreferences:]): + (-[WebView _keyboardUIMode]): + * WebView/WebViewInternal.h: + +2011-04-07 Andrew Scherkus <scherkus@chromium.org> + + Revert ENABLE_TRACK patch due to compile failures. + + * Configurations/FeatureDefines.xcconfig: + +2011-04-07 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Anders Carlsson. + + REGRESSION (WebKit2): Reverse conversion doesn't work in Kotoeri + https://bugs.webkit.org/show_bug.cgi?id=58066 + <rdar://problem/8965302> + + * WebView/WebHTMLRepresentation.mm: + (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): + * WebView/WebHTMLView.mm: + (-[WebHTMLView attributedSubstringFromRange:]): + (-[WebHTMLView attributedString]): + (-[WebHTMLView selectedAttributedString]): + Updated for editingAttributedStringFromRange: now taking a WebCore::Range instead of DOMRange. + +2011-04-07 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r64712): Microsoft Outlook 2011: original message contents + not included when replying to an email. + https://bugs.webkit.org/show_bug.cgi?id=57794 + + Outlook populates a reply message by creating an empty WebView and + using DOM API to populate the WebView's empty document with content + from the original message. It expects the initial empty document to + simply be "<html></html>", and it proceeds to dynamically create and + append a BODY node and add the original message content as a child of + that node. Outlook then takes the innerHTML of the frame's first body + element and copies it into a *new* document that is displayed and + edited in the reply message window. + + Due to implementing the HTML5 tree building algorithm in r64712, + initial empty documents went from being "<html></html>" to being + "<html><head></head><body></body></html>". Outlook still dynamically + creates a BODY node to parent the original message content, but this + BODY node duplicates the one created by the tree builder. When Outlook + then takes the innerHTML of the first body element to populate the + reply message window it gets the empty body element created by the + parser, not the one it created with the original message content. + + Fix this by injecting a user script into the initial empty document + that removes the HEAD and BODY nodes created by the parser. This + ensures that the BODY created by Outlook is the only BODY in the + document. + + * Misc/OutlookQuirksUserScript.js: Added. + * WebView/WebView.mm: + (leakMailQuirksUserScriptContents): + (-[WebView _injectMailQuirksScript]): + (needsOutlookQuirksScript): + (leakOutlookQuirksUserScriptContents): + (-[WebView _injectOutlookQuirksScript]): + (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]): + +2011-04-06 Dai Mikurube <dmikurube@chromium.org> + + Reviewed by David Levin. + + Add QUOTA build flag for unified quota API + https://bugs.webkit.org/show_bug.cgi?id=57918 + + * Configurations/FeatureDefines.xcconfig: Added QUOTA build flag + +2011-04-06 Robert Sesek <rsesek@chromium.org> + + Reviewed by Alexey Proskuryakov. + + Move code duplicated between the WebKit/mac and WebKit2 down to WebCore because Chromium will need it too + https://bugs.webkit.org/show_bug.cgi?id=54969 + + * WebView/WebFrame.mm: + (-[WebFrame _convertToNSRange:]): Moved duplicated code to WebCore + (-[WebFrame _characterRangeAtPoint:]): Moved duplicated code to WebCore + +2011-04-05 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + Move attributedStringFromRange down to WebCore + https://bugs.webkit.org/show_bug.cgi?id=57905 + + * Misc/WebNSAttributedStringExtras.h: Removed. + * Misc/WebNSAttributedStringExtras.mm: Removed. + * WebView/WebHTMLRepresentation.mm: + (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]): + * WebView/WebHTMLView.mm: + (-[WebHTMLView _writeSelectionWithPasteboardTypes:toPasteboard:cachedAttributedString:]): + (-[WebHTMLView attributedSubstringFromRange:]): + (-[WebHTMLView attributedString]): + (-[WebHTMLView selectedAttributedString]): + * WebView/WebPDFView.mm: + (-[WebPDFView writeSelectionWithPasteboardTypes:toPasteboard:]): + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + Removed NSTextCheckingResult to SpellCheckingResult convertion, and extracted + NSTextCheckingResult to TextCheckingResult convertio from checkTextOfParagraph method. + for requestCheckingOfString method. + + * WebCoreSupport/WebEditorClient.h: + * WebCoreSupport/WebEditorClient.mm: + (toCoreTextCheckingResults): + (WebEditorClient::checkTextOfParagraph): + (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:types:WebCore::results:]): + (-[WebEditorSpellCheckResponder perform]): + (WebEditorClient::requestCheckingOfString): + * WebView/WebFrame.mm: + (-[WebFrame markersForSelectionStartAsText]): + * WebView/WebFramePrivate.h: + +2011-04-05 Anders Carlsson <andersca@apple.com> + + Didn't mean to land this. + + * Plugins/WebNetscapePluginView.mm: + (-[WebNetscapePluginView getVariable:value:]): + +2011-04-04 David Kilzer <ddkilzer@apple.com> + + <http://webkit.org/b/57384> CFNetwork and WebCore load priorities should match + + Reviewed by Alexey Proskuryakov. + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Added initialization for + wkSetHTTPPipeliningMaximumPriority(). + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * WebView/WebHTMLView.mm: (-[WebHTMLView flagsChanged:]): Moved Caps Lock handling from + WebKits to WebCore, because WebKit shouldn't be smart. + +2011-04-01 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + REGRESSION: Assertion failure when executing a complex custom key binding + https://bugs.webkit.org/show_bug.cgi?id=57681 + + * WebView/WebHTMLView.mm: (-[WebHTMLView hasMarkedText]): There is no need to execute saved + commands when they can't possibly change the result. + +2011-04-01 Anders Carlsson <andersca@apple.com> + + Reviewed by Sam Weinig. + + Shockwave plug-in doesn't accept mouse events + https://bugs.webkit.org/show_bug.cgi?id=57653 + <rdar://problem/8483273> + + Fix an unrelated bug found by the added test. + + * Plugins/WebBaseNetscapePluginView.mm: + (-[WebBaseNetscapePluginView convertFromX:andY:space:toX:andY:space:]): + Make sure to always set destX and destY. + +2011-04-01 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + Make WebKit2 text input handling more like WebKit1 + https://bugs.webkit.org/show_bug.cgi?id=57649 + + * WebView/WebFrameInternal.h: Expose _convertToDOMRange for use in WebHTMLView. + * WebView/WebHTMLView.mm: + (-[WebHTMLView _executeSavedKeypressCommands]): Renamed, since these are not editor commands. + (-[WebHTMLView _interpretKeyEvent:savingCommands:]): Updated for the renamed _executeSavedKeypressCommands. + (-[WebHTMLView characterIndexForPoint:]): Ditto. + (-[WebHTMLView firstRectForCharacterRange:]): Ditto. + (-[WebHTMLView selectedRange]): Ditto. + (-[WebHTMLView markedRange]): Ditto. + (-[WebHTMLView attributedSubstringFromRange:]): Ditto. + (-[WebHTMLView hasMarkedText]): Ditto. + (-[WebHTMLView unmarkText]): Ditto. + (-[WebHTMLView setMarkedText:selectedRange:]): Ditto. Changed the comment about the argument + type into an assertion. Removed resetting interpretKeyEventsParameters to 0, as we shouldn't + be able to call text input protocol methods from here (and we didn't even reset it back on + return). Changed to retrieve all data before starting to apply actions to better match WK2 code. + (-[WebHTMLView insertText:]): Ditto. + +2011-04-01 Timothy Hatcher <timothy@apple.com> + + Make momentum scroll event latching work in WebKit2 on Mac. + + <rdar://problem/8751861> + + Reviewed by Darin Adler. + + * WebCoreSupport/WebSystemInterface.mm: + (InitWebCoreSystemInterface): Remove IsLatchingWheelEvent, add GetNSEventMomentumPhase. + * WebView/WebDynamicScrollBarsView.mm: + (-[WebDynamicScrollBarsView scrollWheel:]): Use WKGetNSEventMomentumPhase to set isLatchingEvent. + +2011-03-31 Darin Adler <darin@apple.com> + + Reviewed by Anders Carlsson. + + Assertion failure in -[WebHTMLView _handleStyleKeyEquivalent:] + https://bugs.webkit.org/show_bug.cgi?id=26667 + + * WebView/WebHTMLView.mm: + (-[WebHTMLView _handleStyleKeyEquivalent:]): Handle the case where WebView is + nil rather than asserting that it is non-nil. One case where WebView will be nil + is when the frame is closed, but in any case where it is nil, the correct thing + to do is to not try to handle the style key. + +2011-03-31 Alexey Proskuryakov <ap@apple.com> + + Patch by John Harvey, reviewed and tweaked by me. + + <rdar://problem/8644403> Should notify TSM that plug-ins would show a bottom input window for marked text. + + * Plugins/Hosted/WebTextInputWindowController.m: + (-[WebTextInputPanel _interpretKeyEvent:string:]): + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/WebFrameLoaderClient.h: + * WebCoreSupport/WebFrameLoaderClient.mm: + (WebFrameLoaderClient::dispatchDidReceiveTitle): + (WebFrameLoaderClient::setTitle): + +2011-03-30 Dominic Cooney <dominicc@google.com> + + Reviewed by Dimitri Glazkov. + + Adds layoutTestController.shadowRoot accessor to Mac DRT. + https://bugs.webkit.org/show_bug.cgi?id=57415 + + * DOM/WebDOMOperations.mm: + (-[DOMElement _shadowRoot:]): + * DOM/WebDOMOperationsPrivate.h: + +2011-03-30 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Darin Adler. + + WebHTMLView shouldn't resend noop: commands + https://bugs.webkit.org/show_bug.cgi?id=57504 + <rdar://problem/9209390> + + * WebView/WebHTMLView.mm: (-[WebHTMLView _executeSavedEditingCommands]): Filter out NOOPs, + which we get e.g. when handling Cmd-key combos. + 2011-03-30 Alexey Proskuryakov <ap@apple.com> Reviewed by Darin Adler. diff --git a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig index 0c1d13c..73d3a47 100644 --- a/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig +++ b/Source/WebKit/mac/Configurations/FeatureDefines.xcconfig @@ -23,8 +23,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // The contents of this file must be kept in sync with FeatureDefines.xcconfig in JavaScriptCore, -// WebCore and WebKit. Also the default values of the ENABLE_FEATURE_NAME macros in build-webkit -// should match the values below, but they do not need to be in the same order. +// WebCore, WebKit and WebKit2. Also the default values of the ENABLE_FEATURE_NAME macros in +// build-webkit should match the values below, but they do not need to be in the same order. // Keep this list of features (not enabled/disabled state) in sync with FeatureDefines.vsprops // and FeatureDefinesCairo.vsprops in WebKitLibraries/win/tools/vsprops. @@ -91,8 +91,11 @@ ENABLE_MATHML = ENABLE_MATHML; ENABLE_METER_TAG = ENABLE_METER_TAG; ENABLE_NOTIFICATIONS = ; ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; +ENABLE_PAGE_VISIBILITY_API = ; ENABLE_PROGRESS_TAG = ENABLE_PROGRESS_TAG; +ENABLE_QUOTA = ; + ENABLE_REGISTER_PROTOCOL_HANDLER = ; ENABLE_SHARED_WORKERS = $(ENABLE_SHARED_WORKERS_$(REAL_PLATFORM_NAME)); @@ -109,6 +112,7 @@ ENABLE_SVG_FONTS = ENABLE_SVG_FONTS; ENABLE_SVG_FOREIGN_OBJECT = ENABLE_SVG_FOREIGN_OBJECT; ENABLE_SVG_USE = ENABLE_SVG_USE; ENABLE_VIDEO = ENABLE_VIDEO; +ENABLE_VIDEO_TRACK = ; ENABLE_MEDIA_STATISTICS = ; @@ -127,4 +131,4 @@ ENABLE_XHTMLMP = ; ENABLE_XPATH = ENABLE_XPATH; ENABLE_XSLT = ENABLE_XSLT; -FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); +FEATURE_DEFINES = $(ENABLE_LINK_PREFETCH) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_WEBGL) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_SYSTEM) $(ENABLE_FULLSCREEN_API) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PROGRESS_TAG) $(ENABLE_REGISTER_PROTOCOL_HANDLER) $(ENABLE_QUOTA) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT); diff --git a/Source/WebKit/mac/Configurations/Version.xcconfig b/Source/WebKit/mac/Configurations/Version.xcconfig index 5e8e50b..025f4a3 100644 --- a/Source/WebKit/mac/Configurations/Version.xcconfig +++ b/Source/WebKit/mac/Configurations/Version.xcconfig @@ -22,7 +22,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. MAJOR_VERSION = 534; -MINOR_VERSION = 27; +MINOR_VERSION = 30; TINY_VERSION = 0; FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION); diff --git a/Source/WebKit/mac/DOM/WebDOMOperations.mm b/Source/WebKit/mac/DOM/WebDOMOperations.mm index 979433d..20e9ace 100644 --- a/Source/WebKit/mac/DOM/WebDOMOperations.mm +++ b/Source/WebKit/mac/DOM/WebDOMOperations.mm @@ -39,6 +39,7 @@ #import "WebKitNSStringExtras.h" #import <JavaScriptCore/APICast.h> #import <WebCore/Document.h> +#import <WebCore/Element.h> #import <WebCore/HTMLInputElement.h> #import <WebCore/HTMLParserIdioms.h> #import <WebCore/JSElement.h> @@ -73,6 +74,13 @@ using namespace JSC; return WebCore::markerTextForListItem(core(self)); } +- (JSValueRef)_shadowRoot:(JSContextRef)context +{ + JSLock lock(SilenceAssertionsOnly); + ExecState* execState = toJS(context); + return toRef(execState, toJS(execState, core(self)->shadowRoot())); +} + @end @implementation DOMNode (WebDOMNodeOperations) diff --git a/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h b/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h index b579a6f..cd5ff20 100644 --- a/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h +++ b/Source/WebKit/mac/DOM/WebDOMOperationsPrivate.h @@ -32,6 +32,7 @@ @interface DOMElement (WebDOMElementOperationsPrivate) + (DOMElement *)_DOMElementFromJSContext:(JSContextRef)context value:(JSValueRef)value; - (NSString *)_markerTextForListItem; +- (JSValueRef)_shadowRoot:(JSContextRef)context; @end @interface DOMDocument (WebDOMDocumentOperationsPrivate) diff --git a/Source/WebKit/mac/Misc/OutlookQuirksUserScript.js b/Source/WebKit/mac/Misc/OutlookQuirksUserScript.js new file mode 100644 index 0000000..65f6107 --- /dev/null +++ b/Source/WebKit/mac/Misc/OutlookQuirksUserScript.js @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ +(function() { + // This should only apply to the initial empty document, which should look like: + // <html><head></head><body></body></html> + if (document.documentElement.outerHTML != "<html><head></head><body></body></html>") + return; + + // Outlook expects the initial empty document to only contain the document + // element. It will explicitly insert a BODY node. + document.documentElement.removeChild(document.head); + document.documentElement.removeChild(document.body); +})(); + +
\ No newline at end of file diff --git a/Source/WebKit/mac/Misc/WebIconDatabase.mm b/Source/WebKit/mac/Misc/WebIconDatabase.mm index f223f09..e9aa8ec 100644 --- a/Source/WebKit/mac/Misc/WebIconDatabase.mm +++ b/Source/WebKit/mac/Misc/WebIconDatabase.mm @@ -35,7 +35,7 @@ #import "WebNSFileManagerExtras.h" #import "WebNSNotificationCenterExtras.h" #import "WebNSURLExtras.h" -#import "WebPreferences.h" +#import "WebPreferencesPrivate.h" #import "WebTypesInternal.h" #import <WebCore/IconDatabase.h> #import <WebCore/Image.h> @@ -313,7 +313,7 @@ static WebIconDatabaseClient* defaultClient() object:NSApp]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_resetCachedWebPreferences:) - name:WebPreferencesChangedNotification + name:WebPreferencesChangedInternalNotification object:nil]; } @@ -324,7 +324,7 @@ static WebIconDatabaseClient* defaultClient() name:NSApplicationWillTerminateNotification object:NSApp]; [[NSNotificationCenter defaultCenter] removeObserver:self - name:WebPreferencesChangedNotification + name:WebPreferencesChangedInternalNotification object:nil]; } diff --git a/Source/WebKit/mac/Misc/WebNSAttributedStringExtras.mm b/Source/WebKit/mac/Misc/WebNSAttributedStringExtras.mm deleted file mode 100644 index 2469da8..0000000 --- a/Source/WebKit/mac/Misc/WebNSAttributedStringExtras.mm +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright (C) 2005, 2007, 2008 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#import "WebNSAttributedStringExtras.h" - -#import "DOMRangeInternal.h" -#import "WebDataSourcePrivate.h" -#import "WebFrame.h" -#import "WebFrameInternal.h" -#import "WebTypesInternal.h" -#import <WebCore/BlockExceptions.h> -#import <WebCore/ColorMac.h> -#import <WebCore/CSSHelper.h> -#import <WebCore/Document.h> -#import <WebCore/Element.h> -#import <WebCore/Frame.h> -#import <WebCore/FrameLoader.h> -#import <WebCore/HTMLNames.h> -#import <WebCore/Image.h> -#import <WebCore/InlineTextBox.h> -#import <WebCore/Range.h> -#import <WebCore/RenderImage.h> -#import <WebCore/RenderListItem.h> -#import <WebCore/RenderObject.h> -#import <WebCore/RenderStyle.h> -#import <WebCore/RenderText.h> -#import <WebCore/SimpleFontData.h> -#import <WebCore/Text.h> -#import <WebCore/TextIterator.h> - -using namespace WebCore; -using namespace HTMLNames; - -struct ListItemInfo { - unsigned start; - unsigned end; -}; - -static NSFileWrapper *fileWrapperForElement(Element* e) -{ - NSFileWrapper *wrapper = nil; - BEGIN_BLOCK_OBJC_EXCEPTIONS; - - const AtomicString& attr = e->getAttribute(srcAttr); - if (!attr.isEmpty()) { - NSURL *URL = e->document()->completeURL(attr); - wrapper = [[kit(e->document()->frame()) _dataSource] _fileWrapperForURL:URL]; - } - if (!wrapper) { - RenderImage* renderer = toRenderImage(e->renderer()); - if (renderer->cachedImage() && !renderer->cachedImage()->errorOccurred()) { - wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)(renderer->cachedImage()->image()->getTIFFRepresentation())]; - [wrapper setPreferredFilename:@"image.tiff"]; - [wrapper autorelease]; - } - } - - return wrapper; - - END_BLOCK_OBJC_EXCEPTIONS; - - return nil; -} - -@implementation NSAttributedString (WebKitExtras) - -- (NSAttributedString *)_web_attributedStringByStrippingAttachmentCharacters -{ - // This code was originally copied from NSTextView - NSRange attachmentRange; - NSString *originalString = [self string]; - static NSString *attachmentCharString = nil; - - if (!attachmentCharString) { - unichar chars[2]; - if (!attachmentCharString) { - chars[0] = NSAttachmentCharacter; - chars[1] = 0; - attachmentCharString = [[NSString alloc] initWithCharacters:chars length:1]; - } - } - - attachmentRange = [originalString rangeOfString:attachmentCharString]; - if (attachmentRange.location != NSNotFound && attachmentRange.length > 0) { - NSMutableAttributedString *newAttributedString = [[self mutableCopyWithZone:NULL] autorelease]; - - while (attachmentRange.location != NSNotFound && attachmentRange.length > 0) { - [newAttributedString replaceCharactersInRange:attachmentRange withString:@""]; - attachmentRange = [[newAttributedString string] rangeOfString:attachmentCharString]; - } - return newAttributedString; - } - - return self; -} - -+ (NSAttributedString *)_web_attributedStringFromRange:(Range*)range -{ - NSMutableAttributedString *string = [[NSMutableAttributedString alloc] init]; - NSUInteger stringLength = 0; - RetainPtr<NSMutableDictionary> attrs(AdoptNS, [[NSMutableDictionary alloc] init]); - - for (TextIterator it(range); !it.atEnd(); it.advance()) { - RefPtr<Range> currentTextRange = it.range(); - ExceptionCode ec = 0; - Node* startContainer = currentTextRange->startContainer(ec); - Node* endContainer = currentTextRange->endContainer(ec); - int startOffset = currentTextRange->startOffset(ec); - int endOffset = currentTextRange->endOffset(ec); - - if (startContainer == endContainer && (startOffset == endOffset - 1)) { - Node* node = startContainer->childNode(startOffset); - if (node && node->hasTagName(imgTag)) { - NSFileWrapper *fileWrapper = fileWrapperForElement(static_cast<Element*>(node)); - NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:fileWrapper]; - [string appendAttributedString:[NSAttributedString attributedStringWithAttachment:attachment]]; - [attachment release]; - } - } - - int currentTextLength = it.length(); - if (!currentTextLength) - continue; - - RenderObject* renderer = startContainer->renderer(); - ASSERT(renderer); - if (!renderer) - continue; - RenderStyle* style = renderer->style(); - NSFont *font = style->font().primaryFont()->getNSFont(); - [attrs.get() setObject:font forKey:NSFontAttributeName]; - if (style->visitedDependentColor(CSSPropertyColor).alpha()) - [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName]; - else - [attrs.get() removeObjectForKey:NSForegroundColorAttributeName]; - if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha()) - [attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName]; - else - [attrs.get() removeObjectForKey:NSBackgroundColorAttributeName]; - - RetainPtr<NSString> substring(AdoptNS, [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(it.characters()) length:currentTextLength freeWhenDone:NO]); - [string replaceCharactersInRange:NSMakeRange(stringLength, 0) withString:substring.get()]; - [string setAttributes:attrs.get() range:NSMakeRange(stringLength, currentTextLength)]; - stringLength += currentTextLength; - } - - return [string autorelease]; -} - -@end diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h index 7828460..bf36fbd 100644 --- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h +++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h @@ -28,7 +28,8 @@ #ifndef NetscapePluginInstanceProxy_h #define NetscapePluginInstanceProxy_h -#include <JavaScriptCore/Global.h> +#include <JavaScriptCore/JSGlobalData.h> +#include <JavaScriptCore/Strong.h> #include <WebCore/Timer.h> #include <WebKit/npapi.h> #include <wtf/Deque.h> @@ -327,7 +328,7 @@ private: JSC::JSObject* get(uint32_t) const; private: - HashMap<uint32_t, JSC::Global<JSC::JSObject> > m_idToJSObjectMap; + HashMap<uint32_t, JSC::Strong<JSC::JSObject> > m_idToJSObjectMap; // The pair consists of object ID and a reference count. One reference belongs to remote plug-in, // and the proxy will add transient references for arguments that are being sent out. HashMap<JSC::JSObject*, pair<uint32_t, uint32_t> > m_jsObjectToIDMap; diff --git a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm index ed646d3..63b0899 100644 --- a/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm +++ b/Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm @@ -148,7 +148,7 @@ uint32_t NetscapePluginInstanceProxy::LocalObjectMap::idForObject(JSGlobalData& objectID = ++m_objectIDCounter; } while (!m_objectIDCounter || m_objectIDCounter == static_cast<uint32_t>(-1) || m_idToJSObjectMap.contains(objectID)); - m_idToJSObjectMap.set(objectID, Global<JSObject>(globalData, object)); + m_idToJSObjectMap.set(objectID, Strong<JSObject>(globalData, object)); m_jsObjectToIDMap.set(object, make_pair<uint32_t, uint32_t>(objectID, 1)); return objectID; @@ -188,7 +188,7 @@ bool NetscapePluginInstanceProxy::LocalObjectMap::forget(uint32_t objectID) return true; } - HashMap<uint32_t, JSC::Global<JSC::JSObject> >::iterator iter = m_idToJSObjectMap.find(objectID); + HashMap<uint32_t, JSC::Strong<JSC::JSObject> >::iterator iter = m_idToJSObjectMap.find(objectID); if (iter == m_idToJSObjectMap.end()) { LOG_ERROR("NetscapePluginInstanceProxy::LocalObjectMap::forget: local object %u doesn't exist.", objectID); return true; @@ -866,7 +866,7 @@ bool NetscapePluginInstanceProxy::evaluate(uint32_t objectID, const String& scri JSLock lock(SilenceAssertionsOnly); - Global<JSGlobalObject> globalObject(*pluginWorld()->globalData(), frame->script()->globalObject(pluginWorld())); + Strong<JSGlobalObject> globalObject(*pluginWorld()->globalData(), frame->script()->globalObject(pluginWorld())); ExecState* exec = globalObject->globalExec(); bool oldAllowPopups = frame->script()->allowPopupsFromPlugin(); diff --git a/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm b/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm index f26b85d..1f96c53 100644 --- a/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm +++ b/Source/WebKit/mac/Plugins/Hosted/ProxyInstance.mm @@ -187,7 +187,7 @@ public: ASSERT(inherits(&s_info)); } - static PassRefPtr<Structure> createStructure(JSGlobalData& globalData, JSValue prototype) + static Structure* createStructure(JSGlobalData& globalData, JSValue prototype) { return Structure::create(globalData, prototype, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } diff --git a/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h b/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h index a07c86c..da6de88 100644 --- a/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h +++ b/Source/WebKit/mac/Plugins/Hosted/ProxyRuntimeObject.h @@ -41,7 +41,7 @@ public: ProxyInstance* getInternalProxyInstance() const; - static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) + static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } diff --git a/Source/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m b/Source/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m index c168e6e..8b59d34 100644 --- a/Source/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m +++ b/Source/WebKit/mac/Plugins/Hosted/WebTextInputWindowController.m @@ -92,7 +92,14 @@ BOOL hadMarkedText = [_inputTextView hasMarkedText]; *string = nil; - + + // Let TSM know that a bottom input window would be created for marked text. + EventRef carbonEvent = (EventRef)[event eventRef]; + if (carbonEvent) { + Boolean ignorePAH = true; + SetEventParameter(carbonEvent, 'iPAH', typeBoolean, sizeof(ignorePAH), &ignorePAH); + } + if (![[_inputTextView inputContext] handleEvent:event]) return NO; diff --git a/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm index 59a80c9..f1eecde 100644 --- a/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm +++ b/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm @@ -619,9 +619,9 @@ String WebHaltablePlugin::pluginName() const // View will have no associated windows. [self stop]; - // Stop observing WebPreferencesChangedNotification -- we only need to observe this when installed in the view hierarchy. + // Stop observing WebPreferencesChangedInternalNotification -- we only need to observe this when installed in the view hierarchy. // When not in the view hierarchy, -viewWillMoveToWindow: and -viewDidMoveToWindow will start/stop the plugin as needed. - [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedInternalNotification object:nil]; } } } @@ -634,9 +634,9 @@ String WebHaltablePlugin::pluginName() const // There is no need to start the plug-in when moving into a superview. -viewDidMoveToWindow takes care of that. [self stop]; - // Stop observing WebPreferencesChangedNotification -- we only need to observe this when installed in the view hierarchy. + // Stop observing WebPreferencesChangedInternalNotification -- we only need to observe this when installed in the view hierarchy. // When not in the view hierarchy, -viewWillMoveToWindow: and -viewDidMoveToWindow will start/stop the plugin as needed. - [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedInternalNotification object:nil]; } } @@ -645,11 +645,11 @@ String WebHaltablePlugin::pluginName() const [self resetTrackingRect]; if ([self window]) { - // While in the view hierarchy, observe WebPreferencesChangedNotification so that we can start/stop depending + // While in the view hierarchy, observe WebPreferencesChangedInternalNotification so that we can start/stop depending // on whether plugins are enabled. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(preferencesHaveChanged:) - name:WebPreferencesChangedNotification + name:WebPreferencesChangedInternalNotification object:nil]; _isPrivateBrowsingEnabled = [[[self webView] preferences] privateBrowsingEnabled]; @@ -677,8 +677,8 @@ String WebHaltablePlugin::pluginName() const // View will have no associated windows. [self stop]; - // Remove WebPreferencesChangedNotification observer -- we will observe once again when we move back into the window - [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:nil]; + // Remove WebPreferencesChangedInternalNotification observer -- we will observe once again when we move back into the window + [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedInternalNotification object:nil]; } } @@ -857,8 +857,13 @@ String WebHaltablePlugin::pluginName() const toX:(double *)destX andY:(double *)destY space:(NPCoordinateSpace)destSpace { // Nothing to do - if (sourceSpace == destSpace) - return TRUE; + if (sourceSpace == destSpace) { + if (destX) + *destX = sourceX; + if (destY) + *destY = sourceY; + return YES; + } NSPoint sourcePoint = NSMakePoint(sourceX, sourceY); diff --git a/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm b/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm index 3fb86cb..128834e 100644 --- a/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm +++ b/Source/WebKit/mac/Plugins/WebBasePluginPackage.mm @@ -403,8 +403,9 @@ static inline void swapIntsInHeader(uint32_t* rawData, size_t length) if (magic == FAT_CIGAM) swapIntsInHeader(rawData.data(), rawData.size()); - archs = (struct fat_arch*)((uint8_t*)rawData.data() + sizeof(struct fat_header)); - numArchs = ((struct fat_header *)rawData.data())->nfat_arch; + COMPILE_ASSERT(sizeof(struct fat_header) % sizeof(uint32_t) == 0, struct_fat_header_must_be_integral_size_of_uint32_t); + archs = reinterpret_cast<struct fat_arch*>(rawData.data() + sizeof(struct fat_header) / sizeof(uint32_t)); + numArchs = reinterpret_cast<struct fat_header*>(rawData.data())->nfat_arch; unsigned maxArchs = (sizeInBytes - sizeof(struct fat_header)) / sizeof(struct fat_arch); if (numArchs > maxArchs) diff --git a/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h b/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h index 8adb79f..15b2c67 100644 --- a/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h +++ b/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.h @@ -27,8 +27,8 @@ #define CorrectionPanel_h #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -#import <AppKit/NSTextChecker.h> -#import <WebCore/CorrectionPanelInfo.h> +#import <AppKit/NSSpellChecker.h> +#import <WebCore/SpellingCorrectionController.h> #import <wtf/RetainPtr.h> @class WebView; @@ -46,7 +46,7 @@ public: private: bool isShowing() const { return m_view; } void dismissInternal(WebCore::ReasonForDismissingCorrectionPanel, bool dismissingExternally); - void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionBubbleType); + void handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType); bool m_wasDismissedExternally; WebCore::ReasonForDismissingCorrectionPanel m_reasonForDismissing; diff --git a/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm b/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm index 05f3f69..ce52b74 100644 --- a/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm +++ b/Source/WebKit/mac/WebCoreSupport/CorrectionPanel.mm @@ -29,18 +29,18 @@ #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) using namespace WebCore; -static inline NSCorrectionBubbleType correctionBubbleType(CorrectionPanelInfo::PanelType panelType) +static inline NSCorrectionIndicatorType correctionIndicatorType(CorrectionPanelInfo::PanelType panelType) { switch (panelType) { case CorrectionPanelInfo::PanelTypeCorrection: - return NSCorrectionBubbleTypeCorrection; + return NSCorrectionIndicatorTypeDefault; case CorrectionPanelInfo::PanelTypeReversion: - return NSCorrectionBubbleTypeReversion; + return NSCorrectionIndicatorTypeReversion; case CorrectionPanelInfo::PanelTypeSpellingSuggestions: - return NSCorrectionBubbleTypeGuesses; + return NSCorrectionIndicatorTypeGuesses; } ASSERT_NOT_REACHED(); - return NSCorrectionBubbleTypeCorrection; + return NSCorrectionIndicatorTypeDefault; } CorrectionPanel::CorrectionPanel() @@ -65,7 +65,7 @@ void CorrectionPanel::show(WebView* view, CorrectionPanelInfo::PanelType type, c NSString* replacedStringAsNSString = replacedString; NSString* replacementStringAsNSString = replacementString; m_view = view; - NSCorrectionBubbleType bubbleType = correctionBubbleType(type); + NSCorrectionIndicatorType indicatorType = correctionIndicatorType(type); NSMutableArray* alternativeStrings = 0; if (!alternativeReplacementStrings.isEmpty()) { @@ -75,8 +75,8 @@ void CorrectionPanel::show(WebView* view, CorrectionPanelInfo::PanelType type, c [alternativeStrings addObject:(NSString*)alternativeReplacementStrings[i]]; } - [[NSSpellChecker sharedSpellChecker] showCorrectionBubbleOfType:bubbleType primaryString:replacementStringAsNSString alternativeStrings:alternativeStrings forStringInRect:boundingBoxOfReplacedString view:m_view.get() completionHandler:^(NSString* acceptedString) { - handleAcceptedReplacement(acceptedString, replacedStringAsNSString, replacementStringAsNSString, bubbleType); + [[NSSpellChecker sharedSpellChecker] showCorrectionIndicatorOfType:indicatorType primaryString:replacementStringAsNSString alternativeStrings:alternativeStrings forStringInRect:[view convertRect:boundingBoxOfReplacedString fromView:nil] view:m_view.get() completionHandler:^(NSString* acceptedString) { + handleAcceptedReplacement(acceptedString, replacedStringAsNSString, replacementStringAsNSString, indicatorType); }]; } @@ -106,7 +106,7 @@ void CorrectionPanel::dismissInternal(ReasonForDismissingCorrectionPanel reason, m_reasonForDismissing = reason; m_resultForSynchronousDismissal.clear(); - [[NSSpellChecker sharedSpellChecker] dismissCorrectionBubbleForView:m_view.get()]; + [[NSSpellChecker sharedSpellChecker] dismissCorrectionIndicatorForView:m_view.get()]; m_view.clear(); } @@ -115,13 +115,13 @@ void CorrectionPanel::recordAutocorrectionResponse(WebView* view, NSCorrectionRe [[NSSpellChecker sharedSpellChecker] recordResponse:response toCorrection:replacementString forWord:replacedString language:nil inSpellDocumentWithTag:[view spellCheckerDocumentTag]]; } -void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionBubbleType correctionBubbleType) +void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, NSString* replaced, NSString* proposedReplacement, NSCorrectionIndicatorType correctionIndicatorType) { NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker]; NSInteger documentTag = [m_view.get() spellCheckerDocumentTag]; - switch (correctionBubbleType) { - case NSCorrectionBubbleTypeCorrection: + switch (correctionIndicatorType) { + case NSCorrectionIndicatorTypeDefault: if (acceptedReplacement) [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; else { @@ -131,11 +131,11 @@ void CorrectionPanel::handleAcceptedReplacement(NSString* acceptedReplacement, N [spellChecker recordResponse:NSCorrectionResponseIgnored toCorrection:proposedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; } break; - case NSCorrectionBubbleTypeReversion: + case NSCorrectionIndicatorTypeReversion: if (acceptedReplacement) [spellChecker recordResponse:NSCorrectionResponseReverted toCorrection:replaced forWord:acceptedReplacement language:nil inSpellDocumentWithTag:documentTag]; break; - case NSCorrectionBubbleTypeGuesses: + case NSCorrectionIndicatorTypeGuesses: if (acceptedReplacement) [spellChecker recordResponse:NSCorrectionResponseAccepted toCorrection:acceptedReplacement forWord:replaced language:nil inSpellDocumentWithTag:documentTag]; break; diff --git a/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h b/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h index 412cb45..0e52102 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebEditorClient.h @@ -130,7 +130,7 @@ public: virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, int* misspellingLength); virtual WTF::String getAutoCorrectSuggestionForMisspelledWord(const WTF::String&); virtual void checkGrammarOfString(const UChar*, int length, WTF::Vector<WebCore::GrammarDetail>&, int* badGrammarLocation, int* badGrammarLength); - virtual void checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results); + virtual void checkTextOfParagraph(const UChar* text, int length, WebCore::TextCheckingTypeMask checkingTypes, WTF::Vector<WebCore::TextCheckingResult>& results); virtual void updateSpellingUIWithGrammarString(const WTF::String&, const WebCore::GrammarDetail&); virtual void updateSpellingUIWithMisspelledWord(const WTF::String&); virtual void showSpellingUI(bool show); @@ -138,7 +138,7 @@ public: virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&); + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&); #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) virtual void showCorrectionPanel(WebCore::CorrectionPanelInfo::PanelType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings); virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingCorrectionPanel); diff --git a/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm index c205ef6..2300be1 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebEditorClient.mm @@ -69,28 +69,15 @@ #import <runtime/InitializeThreading.h> #import <wtf/PassRefPtr.h> #import <wtf/Threading.h> -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -#import <AppKit/NSTextChecker.h> -#endif using namespace WebCore; using namespace HTMLNames; #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -static inline NSCorrectionBubbleType correctionBubbleType(CorrectionPanelInfo::PanelType panelType) -{ - switch (panelType) { - case CorrectionPanelInfo::PanelTypeCorrection: - return NSCorrectionBubbleTypeCorrection; - case CorrectionPanelInfo::PanelTypeReversion: - return NSCorrectionBubbleTypeReversion; - case CorrectionPanelInfo::PanelTypeSpellingSuggestions: - return NSCorrectionBubbleTypeGuesses; - } - ASSERT_NOT_REACHED(); - return NSCorrectionBubbleTypeCorrection; -} +@interface NSSpellChecker (WebNSSpellCheckerDetails) +- (NSString *)languageForWordRange:(NSRange)range inString:(NSString *)string orthography:(NSOrthography *)orthography; +@end #endif @interface NSAttributedString (WebNSAttributedStringDetails) @@ -790,12 +777,11 @@ void WebEditorClient::checkGrammarOfString(const UChar* text, int length, Vector #endif } -void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64_t checkingTypes, Vector<TextCheckingResult>& results) -{ #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]; - NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL]; - [textString release]; +static Vector<TextCheckingResult> core(NSArray *incomingResults, TextCheckingTypeMask checkingTypes) +{ + Vector<TextCheckingResult> results; + for (NSTextCheckingResult *incomingResult in incomingResults) { NSRange resultRange = [incomingResult range]; NSTextCheckingType resultType = [incomingResult resultType]; @@ -867,6 +853,18 @@ void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, uint64 results.append(result); } } + + return results; +} +#endif + +void WebEditorClient::checkTextOfParagraph(const UChar* text, int length, TextCheckingTypeMask checkingTypes, Vector<TextCheckingResult>& results) +{ +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + NSString *textString = [[NSString alloc] initWithCharactersNoCopy:const_cast<UChar*>(text) length:length freeWhenDone:NO]; + NSArray *incomingResults = [[NSSpellChecker sharedSpellChecker] checkString:textString range:NSMakeRange(0, [textString length]) types:(checkingTypes|NSTextCheckingTypeOrthography) options:nil inSpellDocumentWithTag:spellCheckerDocumentTag() orthography:NULL wordCount:NULL]; + [textString release]; + results = core(incomingResults, checkingTypes); #endif } @@ -965,58 +963,35 @@ void WebEditorClient::setInputMethodState(bool) { WebCore::SpellChecker* _sender; int _sequence; + TextCheckingTypeMask _types; RetainPtr<NSArray> _results; } -- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence results:(NSArray*)results; +- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence types:(WebCore::TextCheckingTypeMask)types results:(NSArray*)results; - (void)perform; -- (WTF::Vector<WebCore::SpellCheckingResult>) _coreResults; @end @implementation WebEditorSpellCheckResponder -- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence results:(NSArray*)results +- (id)initWithSender:(WebCore::SpellChecker*)sender sequence:(int)sequence types:(WebCore::TextCheckingTypeMask)types results:(NSArray*)results { self = [super init]; if (!self) return nil; _sender = sender; _sequence = sequence; + _types = types; _results = results; return self; } - (void)perform { - _sender->didCheck(_sequence, [self _coreResults]); -} - -static SpellCheckingResult toCoreSpellingResult(NSTextCheckingResult* result) -{ - NSTextCheckingType type = [result resultType]; - NSRange range = [result range]; - DocumentMarker::MarkerType coreType; - if (type & NSTextCheckingTypeSpelling) - coreType = DocumentMarker::Spelling; - else if (type & NSTextCheckingTypeGrammar) - coreType = DocumentMarker::Grammar; - else - coreType = DocumentMarker::AllMarkers; - - return SpellCheckingResult(coreType, range.location, range.length); -} - -- (WTF::Vector<WebCore::SpellCheckingResult>)_coreResults -{ - WTF::Vector<WebCore::SpellCheckingResult> coreResults; - coreResults.reserveCapacity([_results.get() count]); - for (NSTextCheckingResult* result in _results.get()) - coreResults.append(toCoreSpellingResult(result)); - return coreResults; + _sender->didCheck(_sequence, core(_results.get(), _types)); } @end #endif -void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, const String& text) +void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int sequence, WebCore::TextCheckingTypeMask checkingTypes, const String& text) { #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) NSRange range = NSMakeRange(0, text.length()); @@ -1024,7 +999,7 @@ void WebEditorClient::requestCheckingOfString(WebCore::SpellChecker* sender, int [[NSSpellChecker sharedSpellChecker] requestCheckingOfString:text range:range types:NSTextCheckingAllSystemTypes options:0 inSpellDocumentWithTag:0 completionHandler:^(NSInteger, NSArray* results, NSOrthography*, NSInteger) { [currentLoop performSelector:@selector(perform) - target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:sequence results:results] autorelease] + target:[[[WebEditorSpellCheckResponder alloc] initWithSender:sender sequence:sequence types:checkingTypes results:results] autorelease] argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; }]; #endif diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h index 4fe5664..c415c10 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h +++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h @@ -83,7 +83,7 @@ private: virtual bool canAuthenticateAgainstProtectionSpace(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ProtectionSpace&); #endif virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); @@ -101,7 +101,7 @@ private: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String& title); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -196,7 +196,7 @@ private: virtual void prepareForDataSourceReplacement(); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WTF::String& name, WebCore::HTMLFrameOwnerElement*, const WTF::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); diff --git a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm index 92c2b03..1b5766a 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm @@ -491,13 +491,13 @@ NSCachedURLResponse* WebFrameLoaderClient::willCacheResponse(DocumentLoader* loa return response; } -void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long identifier, int lengthReceived) +void WebFrameLoaderClient::dispatchDidReceiveContentLength(DocumentLoader* loader, unsigned long identifier, int dataLength) { WebView *webView = getWebView(m_webFrame.get()); WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(webView); if (implementations->didReceiveContentLengthFunc) { if (id resource = [webView _objectForIdentifier:identifier]) - CallResourceLoadDelegate(implementations->didReceiveContentLengthFunc, webView, @selector(webView:resource:didReceiveContentLength:fromDataSource:), resource, (NSInteger)lengthReceived, dataSource(loader)); + CallResourceLoadDelegate(implementations->didReceiveContentLengthFunc, webView, @selector(webView:resource:didReceiveContentLength:fromDataSource:), resource, (NSInteger)dataLength, dataSource(loader)); } } @@ -624,12 +624,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() CallFrameLoadDelegate(implementations->didStartProvisionalLoadForFrameFunc, webView, @selector(webView:didStartProvisionalLoadForFrame:), m_webFrame.get()); } -void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) +void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) { WebView *webView = getWebView(m_webFrame.get()); WebFrameLoadDelegateImplementationCache* implementations = WebViewGetFrameLoadDelegateImplementations(webView); if (implementations->didReceiveTitleForFrameFunc) - CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title, m_webFrame.get()); + // FIXME: use direction of title. + CallFrameLoadDelegate(implementations->didReceiveTitleForFrameFunc, webView, @selector(webView:didReceiveTitle:forFrame:), (NSString *)title.string(), m_webFrame.get()); } void WebFrameLoaderClient::dispatchDidChangeIcons() @@ -893,7 +894,7 @@ void WebFrameLoaderClient::updateGlobalHistory() WebHistoryDelegateImplementationCache* implementations = WebViewGetHistoryDelegateImplementations(view); if (implementations->navigatedFunc) { WebNavigationData *data = [[WebNavigationData alloc] initWithURLString:loader->urlForHistory() - title:loader->title() + title:loader->title().string() originalRequest:loader->originalRequestCopy().nsURLRequest() response:loader->response().nsURLResponse() hasSubstituteData:loader->substituteData().isValid() @@ -907,7 +908,7 @@ void WebFrameLoaderClient::updateGlobalHistory() } [[WebHistory optionalSharedHistory] _visitedURL:loader->urlForHistory() - withTitle:loader->title() + withTitle:loader->title().string() method:loader->originalRequestCopy().httpMethod() wasFailure:loader->urlForHistoryReflectsFailure() increaseVisitCount:!loader->clientRedirectSourceForHistory()]; // Do not increase visit count due to navigations that were not initiated by the user directly, avoiding growth from programmatic reloads. @@ -1179,7 +1180,7 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso return loader.release(); } -void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) +void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) { WebView* view = getWebView(m_webFrame.get()); @@ -1188,7 +1189,8 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) if (!implementations->setTitleFunc) return; - CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title, (NSString *)url); + // FIXME: use direction of title. + CallHistoryDelegate(implementations->setTitleFunc, view, @selector(webView:updateHistoryTitle:forURL:), (NSString *)title.string(), (NSString *)url); return; } @@ -1196,7 +1198,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) nsURL = [nsURL _webkit_canonicalize]; if(!nsURL) return; - NSString *titleNSString = title; + NSString *titleNSString = title.string(); [[[WebHistory optionalSharedHistory] itemForURL:nsURL] setTitle:titleNSString]; } @@ -1285,7 +1287,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage() // like the ones that Safari uses for bookmarks it is the only way the DocumentLoader // will get the proper title. if (DocumentLoader* documentLoader = [dataSource _documentLoader]) - documentLoader->setTitle([dataSource pageTitle]); + documentLoader->setTitle(StringWithDirection([dataSource pageTitle], LTR)); } if (HTMLFrameOwnerElement* owner = coreFrame->ownerElement()) diff --git a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm index 9b0c893..e701495 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebInspectorClient.mm @@ -36,7 +36,7 @@ #import "WebInspectorPrivate.h" #import "WebInspectorFrontend.h" #import "WebLocalizableStringsInternal.h" -#import "WebNodeHighlight.h" +#import "WebNodeHighlighter.h" #import "WebUIDelegate.h" #import "WebViewInternal.h" #import <WebCore/InspectorController.h> @@ -70,25 +70,13 @@ using namespace WebCore; - (void)destroyInspectorView:(bool)notifyInspectorController; @end -// MARK: - - -@interface WebNodeHighlighter : NSObject { -@private - WebView *_inspectedWebView; - WebNodeHighlight *_currentHighlight; -} -- (id)initWithInspectedWebView:(WebView *)webView; -- (void)highlightNode:(DOMNode *)node; -- (void)hideHighlight; -@end // MARK: - - WebInspectorClient::WebInspectorClient(WebView *webView) -: m_webView(webView) -, m_highlighter(AdoptNS, [[WebNodeHighlighter alloc] initWithInspectedWebView:webView]) -, m_frontendPage(0) + : m_webView(webView) + , m_highlighter(AdoptNS, [[WebNodeHighlighter alloc] initWithInspectedWebView:webView]) + , m_frontendPage(0) { } @@ -228,7 +216,7 @@ void WebInspectorFrontendClient::updateWindowTitle() const @implementation WebInspectorWindowController - (id)init { - if (![super initWithWindow:nil]) + if (!(self = [super initWithWindow:nil])) return nil; // Keep preferences separate from the rest of the client, making sure we are using expected preference values. @@ -272,10 +260,10 @@ void WebInspectorFrontendClient::updateWindowTitle() const - (id)initWithInspectedWebView:(WebView *)webView { - if (![self init]) + if (!(self = [self init])) return nil; - // Don't retain to avoid a circular reference + // Don't retain to avoid a circular reference. _inspectedWebView = webView; return self; } @@ -482,19 +470,6 @@ void WebInspectorFrontendClient::updateWindowTitle() const } // MARK: - -// MARK: WebNodeHighlight delegate - -- (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight -{ - [_inspectedWebView setCurrentNodeHighlight:highlight]; -} - -- (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight -{ - [_inspectedWebView setCurrentNodeHighlight:nil]; -} - -// MARK: - // MARK: UI delegate - (NSUInteger)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo @@ -548,60 +523,3 @@ void WebInspectorFrontendClient::updateWindowTitle() const } @end - - -// MARK: - - -@implementation WebNodeHighlighter -- (id)initWithInspectedWebView:(WebView *)webView -{ - // Don't retain to avoid a circular reference - _inspectedWebView = webView; - return self; -} - -- (void)dealloc -{ - ASSERT(!_currentHighlight); - [super dealloc]; -} - -// MARK: - - -- (void)highlightNode:(DOMNode *)node -{ - // The scrollview's content view stays around between page navigations, so target it - NSView *view = [[[[[_inspectedWebView mainFrame] frameView] documentView] enclosingScrollView] contentView]; - if (![view window]) - return; // skip the highlight if we have no window (e.g. hidden tab) - - if (!_currentHighlight) { - _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()]; - [_currentHighlight setDelegate:self]; - [_currentHighlight attach]; - } else - [[_currentHighlight highlightView] setNeedsDisplay:YES]; -} - -- (void)hideHighlight -{ - [_currentHighlight detach]; - [_currentHighlight setDelegate:nil]; - [_currentHighlight release]; - _currentHighlight = nil; -} - -// MARK: - -// MARK: WebNodeHighlight delegate - -- (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight -{ - [_inspectedWebView setCurrentNodeHighlight:highlight]; -} - -- (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight -{ - [_inspectedWebView setCurrentNodeHighlight:nil]; -} - -@end diff --git a/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h index 29bdb8a..87471f6 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h +++ b/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h @@ -29,10 +29,9 @@ #include <WebCore/CookiesStrategy.h> #include <WebCore/PlatformStrategies.h> #include <WebCore/PluginStrategy.h> -#include <WebCore/LocalizationStrategy.h> #include <WebCore/VisitedLinkStrategy.h> -class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy { public: static void initialize(); @@ -42,7 +41,6 @@ private: // WebCore::PlatformStrategies virtual WebCore::CookiesStrategy* createCookiesStrategy(); virtual WebCore::PluginStrategy* createPluginStrategy(); - virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); // WebCore::CookiesStrategy @@ -52,125 +50,6 @@ private: virtual void refreshPlugins(); virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&); - // WebCore::LocalizationStrategy - virtual WTF::String inputElementAltText(); - virtual WTF::String resetButtonDefaultLabel(); - virtual WTF::String searchableIndexIntroduction(); - virtual WTF::String submitButtonDefaultLabel(); - virtual WTF::String fileButtonChooseFileLabel(); - virtual WTF::String fileButtonNoFileSelectedLabel(); - virtual WTF::String copyImageUnknownFileLabel(); - virtual WTF::String defaultDetailsSummaryText(); -#if ENABLE(CONTEXT_MENUS) - virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); - virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); - virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); - virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); - virtual WTF::String contextMenuItemTagDownloadImageToDisk(); - virtual WTF::String contextMenuItemTagCopyImageToClipboard(); - virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); - virtual WTF::String contextMenuItemTagCopy(); - virtual WTF::String contextMenuItemTagGoBack(); - virtual WTF::String contextMenuItemTagGoForward(); - virtual WTF::String contextMenuItemTagStop(); - virtual WTF::String contextMenuItemTagReload(); - virtual WTF::String contextMenuItemTagCut(); - virtual WTF::String contextMenuItemTagPaste(); - virtual WTF::String contextMenuItemTagNoGuessesFound(); - virtual WTF::String contextMenuItemTagIgnoreSpelling(); - virtual WTF::String contextMenuItemTagLearnSpelling(); - virtual WTF::String contextMenuItemTagSearchWeb(); - virtual WTF::String contextMenuItemTagLookUpInDictionary(const WTF::String& selectedString); - virtual WTF::String contextMenuItemTagOpenLink(); - virtual WTF::String contextMenuItemTagIgnoreGrammar(); - virtual WTF::String contextMenuItemTagSpellingMenu(); - virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); - virtual WTF::String contextMenuItemTagCheckSpelling(); - virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); - virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); - virtual WTF::String contextMenuItemTagFontMenu(); - virtual WTF::String contextMenuItemTagBold(); - virtual WTF::String contextMenuItemTagItalic(); - virtual WTF::String contextMenuItemTagUnderline(); - virtual WTF::String contextMenuItemTagOutline(); - virtual WTF::String contextMenuItemTagWritingDirectionMenu(); - virtual WTF::String contextMenuItemTagTextDirectionMenu(); - virtual WTF::String contextMenuItemTagDefaultDirection(); - virtual WTF::String contextMenuItemTagLeftToRight(); - virtual WTF::String contextMenuItemTagRightToLeft(); - virtual WTF::String contextMenuItemTagSearchInSpotlight(); - virtual WTF::String contextMenuItemTagShowFonts(); - virtual WTF::String contextMenuItemTagStyles(); - virtual WTF::String contextMenuItemTagShowColors(); - virtual WTF::String contextMenuItemTagSpeechMenu(); - virtual WTF::String contextMenuItemTagStartSpeaking(); - virtual WTF::String contextMenuItemTagStopSpeaking(); - virtual WTF::String contextMenuItemTagCorrectSpellingAutomatically(); - virtual WTF::String contextMenuItemTagSubstitutionsMenu(); - virtual WTF::String contextMenuItemTagShowSubstitutions(bool show); - virtual WTF::String contextMenuItemTagSmartCopyPaste(); - virtual WTF::String contextMenuItemTagSmartQuotes(); - virtual WTF::String contextMenuItemTagSmartDashes(); - virtual WTF::String contextMenuItemTagSmartLinks(); - virtual WTF::String contextMenuItemTagTextReplacement(); - virtual WTF::String contextMenuItemTagTransformationsMenu(); - virtual WTF::String contextMenuItemTagMakeUpperCase(); - virtual WTF::String contextMenuItemTagMakeLowerCase(); - virtual WTF::String contextMenuItemTagCapitalize(); - virtual WTF::String contextMenuItemTagChangeBack(const WTF::String& replacedString); - virtual WTF::String contextMenuItemTagInspectElement(); - virtual WTF::String contextMenuItemTagOpenVideoInNewWindow(); - virtual WTF::String contextMenuItemTagOpenAudioInNewWindow(); - virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard(); - virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard(); - virtual WTF::String contextMenuItemTagToggleMediaControls(); - virtual WTF::String contextMenuItemTagToggleMediaLoop(); - virtual WTF::String contextMenuItemTagEnterVideoFullscreen(); - virtual WTF::String contextMenuItemTagMediaPlay(); - virtual WTF::String contextMenuItemTagMediaPause(); - virtual WTF::String contextMenuItemTagMediaMute(); -#endif // ENABLE(CONTEXT_MENUS) - virtual WTF::String searchMenuNoRecentSearchesText(); - virtual WTF::String searchMenuRecentSearchesText(); - virtual WTF::String searchMenuClearRecentSearchesText(); - virtual WTF::String AXWebAreaText(); - virtual WTF::String AXLinkText(); - virtual WTF::String AXListMarkerText(); - virtual WTF::String AXImageMapText(); - virtual WTF::String AXHeadingText(); - virtual WTF::String AXDefinitionListTermText(); - virtual WTF::String AXDefinitionListDefinitionText(); - virtual WTF::String AXARIAContentGroupText(const WTF::String& ariaType); - virtual WTF::String AXButtonActionVerb(); - virtual WTF::String AXRadioButtonActionVerb(); - virtual WTF::String AXTextFieldActionVerb(); - virtual WTF::String AXCheckedCheckBoxActionVerb(); - virtual WTF::String AXUncheckedCheckBoxActionVerb(); - virtual WTF::String AXMenuListActionVerb(); - virtual WTF::String AXMenuListPopupActionVerb(); - virtual WTF::String AXLinkActionVerb(); - virtual WTF::String missingPluginText(); - virtual WTF::String crashedPluginText(); - virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); - virtual WTF::String unknownFileSizeText(); - virtual WTF::String keygenMenuItem512(); - virtual WTF::String keygenMenuItem1024(); - virtual WTF::String keygenMenuItem2048(); - virtual WTF::String keygenKeychainItemName(const WTF::String& host); - virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize& size); - virtual WTF::String mediaElementLoadingStateText(); - virtual WTF::String mediaElementLiveBroadcastStateText(); - virtual WTF::String localizedMediaControlElementString(const WTF::String&); - virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); - virtual WTF::String localizedMediaTimeDescription(float); - virtual WTF::String validationMessageValueMissingText(); - virtual WTF::String validationMessageTypeMismatchText(); - virtual WTF::String validationMessagePatternMismatchText(); - virtual WTF::String validationMessageTooLongText(); - virtual WTF::String validationMessageRangeUnderflowText(); - virtual WTF::String validationMessageRangeOverflowText(); - virtual WTF::String validationMessageStepMismatchText(); - // WebCore::VisitedLinkStrategy virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); diff --git a/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm index 59ba436..f8e1a7a 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm @@ -25,14 +25,11 @@ #import "WebPlatformStrategies.h" -#import "WebLocalizableStringsInternal.h" #import "WebPluginDatabase.h" #import "WebPluginPackage.h" #import <WebCore/BlockExceptions.h> -#import <WebCore/IntSize.h> #import <WebCore/Page.h> #import <WebCore/PageGroup.h> -#import <wtf/StdLibExtras.h> using namespace WebCore; @@ -56,11 +53,6 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy() return this; } -LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() -{ - return this; -} - VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() { return this; @@ -89,775 +81,6 @@ void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore:: END_BLOCK_OBJC_EXCEPTIONS; } -// LocalizationStrategy - -String WebPlatformStrategies::inputElementAltText() -{ - return UI_STRING_KEY_INTERNAL("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); -} - -String WebPlatformStrategies::resetButtonDefaultLabel() -{ - return UI_STRING_INTERNAL("Reset", "default label for Reset buttons in forms on web pages"); -} - -String WebPlatformStrategies::searchableIndexIntroduction() -{ - return UI_STRING_INTERNAL("This is a searchable index. Enter search keywords: ", - "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); -} - -String WebPlatformStrategies::submitButtonDefaultLabel() -{ - return UI_STRING_INTERNAL("Submit", "default label for Submit buttons in forms on web pages"); -} - -String WebPlatformStrategies::defaultDetailsSummaryText() -{ - return UI_STRING_INTERNAL("Details", "text to display in <details> tag when it has no <summary> child"); -} - -String WebPlatformStrategies::fileButtonChooseFileLabel() -{ - return UI_STRING_INTERNAL("Choose File", "title for file button used in HTML forms"); -} - -String WebPlatformStrategies::fileButtonNoFileSelectedLabel() -{ - return UI_STRING_INTERNAL("no file selected", "text to display in file button used in HTML forms when no file is selected"); -} - -String WebPlatformStrategies::copyImageUnknownFileLabel() -{ - return UI_STRING_INTERNAL("unknown", "Unknown filename"); -} - -#if ENABLE(CONTEXT_MENUS) - -String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow() -{ - return UI_STRING_INTERNAL("Open Link in New Window", "Open in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk() -{ - return UI_STRING_INTERNAL("Download Linked File", "Download Linked File context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard() -{ - return UI_STRING_INTERNAL("Copy Link", "Copy Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow() -{ - return UI_STRING_INTERNAL("Open Image in New Window", "Open Image in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk() -{ - return UI_STRING_INTERNAL("Download Image", "Download Image context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard() -{ - return UI_STRING_INTERNAL("Copy Image", "Copy Image context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow() -{ - return UI_STRING_INTERNAL("Open Video in New Window", "Open Video in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow() -{ - return UI_STRING_INTERNAL("Open Audio in New Window", "Open Audio in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard() -{ - return UI_STRING_INTERNAL("Copy Video Address", "Copy Video Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard() -{ - return UI_STRING_INTERNAL("Copy Audio Address", "Copy Audio Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaControls() -{ - return UI_STRING_INTERNAL("Controls", "Media Controls context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop() -{ - return UI_STRING_INTERNAL("Loop", "Media Loop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen() -{ - return UI_STRING_INTERNAL("Enter Fullscreen", "Video Enter Fullscreen context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPlay() -{ - return UI_STRING_INTERNAL("Play", "Media Play context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPause() -{ - return UI_STRING_INTERNAL("Pause", "Media Pause context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaMute() -{ - return UI_STRING_INTERNAL("Mute", "Media Mute context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow() -{ - return UI_STRING_INTERNAL("Open Frame in New Window", "Open Frame in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopy() -{ - return UI_STRING_INTERNAL("Copy", "Copy context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoBack() -{ - return UI_STRING_INTERNAL("Back", "Back context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoForward() -{ - return UI_STRING_INTERNAL("Forward", "Forward context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStop() -{ - return UI_STRING_INTERNAL("Stop", "Stop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagReload() -{ - return UI_STRING_INTERNAL("Reload", "Reload context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCut() -{ - return UI_STRING_INTERNAL("Cut", "Cut context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagPaste() -{ - return UI_STRING_INTERNAL("Paste", "Paste context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagNoGuessesFound() -{ - return UI_STRING_INTERNAL("No Guesses Found", "No Guesses Found context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling() -{ - return UI_STRING_INTERNAL("Ignore Spelling", "Ignore Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLearnSpelling() -{ - return UI_STRING_INTERNAL("Learn Spelling", "Learn Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSearchWeb() -{ - return UI_STRING_INTERNAL("Search in Google", "Search in Google context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary(const String& selectedString) -{ -#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) - return UI_STRING_INTERNAL("Look Up in Dictionary", "Look Up in Dictionary context menu item"); -#else - return [NSString stringWithFormat:UI_STRING_INTERNAL("Look Up “%@â€", "Look Up context menu item with selected word"), (NSString *)selectedString]; -#endif -} - -String WebPlatformStrategies::contextMenuItemTagOpenLink() -{ - return UI_STRING_INTERNAL("Open Link", "Open Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar() -{ - return UI_STRING_INTERNAL("Ignore Grammar", "Ignore Grammar context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSpellingMenu() -{ -#ifndef BUILDING_ON_TIGER - return UI_STRING_INTERNAL("Spelling and Grammar", "Spelling and Grammar context sub-menu item"); -#else - return UI_STRING_INTERNAL("Spelling", "Spelling context sub-menu item"); -#endif -} - -String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show) -{ -#ifndef BUILDING_ON_TIGER - if (show) - return UI_STRING_INTERNAL("Show Spelling and Grammar", "menu item title"); - return UI_STRING_INTERNAL("Hide Spelling and Grammar", "menu item title"); -#else - return UI_STRING_INTERNAL("Spelling...", "menu item title"); -#endif -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpelling() -{ -#ifndef BUILDING_ON_TIGER - return UI_STRING_INTERNAL("Check Document Now", "Check spelling context menu item"); -#else - return UI_STRING_INTERNAL("Check Spelling", "Check spelling context menu item"); -#endif -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping() -{ -#ifndef BUILDING_ON_TIGER - return UI_STRING_INTERNAL("Check Spelling While Typing", "Check spelling while typing context menu item"); -#else - return UI_STRING_INTERNAL("Check Spelling as You Type", "Check spelling while typing context menu item"); -#endif -} - -String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling() -{ - return UI_STRING_INTERNAL("Check Grammar With Spelling", "Check grammar with spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagFontMenu() -{ - return UI_STRING_INTERNAL("Font", "Font context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagBold() -{ - return UI_STRING_INTERNAL("Bold", "Bold context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagItalic() -{ - return UI_STRING_INTERNAL("Italic", "Italic context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagUnderline() -{ - return UI_STRING_INTERNAL("Underline", "Underline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOutline() -{ - return UI_STRING_INTERNAL("Outline", "Outline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu() -{ -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - return UI_STRING_INTERNAL("Paragraph Direction", "Paragraph direction context sub-menu item"); -#else - return UI_STRING_INTERNAL("Writing Direction", "Writing direction context sub-menu item"); -#endif -} - -String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu() -{ - return UI_STRING_INTERNAL("Selection Direction", "Selection direction context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDefaultDirection() -{ - return UI_STRING_INTERNAL("Default", "Default writing direction context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLeftToRight() -{ - return UI_STRING_INTERNAL("Left to Right", "Left to Right context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagRightToLeft() -{ - return UI_STRING_INTERNAL("Right to Left", "Right to Left context menu item"); -} - -#if PLATFORM(MAC) - -String WebPlatformStrategies::contextMenuItemTagSearchInSpotlight() -{ - return UI_STRING_INTERNAL("Search in Spotlight", "Search in Spotlight context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowFonts() -{ - return UI_STRING_INTERNAL("Show Fonts", "Show fonts context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStyles() -{ - return UI_STRING_INTERNAL("Styles...", "Styles context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowColors() -{ - return UI_STRING_INTERNAL("Show Colors", "Show colors context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSpeechMenu() -{ - return UI_STRING_INTERNAL("Speech", "Speech context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStartSpeaking() -{ - return UI_STRING_INTERNAL("Start Speaking", "Start speaking context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStopSpeaking() -{ - return UI_STRING_INTERNAL("Stop Speaking", "Stop speaking context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCorrectSpellingAutomatically() -{ - return UI_STRING_INTERNAL("Correct Spelling Automatically", "Correct Spelling Automatically context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSubstitutionsMenu() -{ - return UI_STRING_INTERNAL("Substitutions", "Substitutions context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowSubstitutions(bool show) -{ - if (show) - return UI_STRING_INTERNAL("Show Substitutions", "menu item title"); - return UI_STRING_INTERNAL("Hide Substitutions", "menu item title"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartCopyPaste() -{ - return UI_STRING_INTERNAL("Smart Copy/Paste", "Smart Copy/Paste context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartQuotes() -{ - return UI_STRING_INTERNAL("Smart Quotes", "Smart Quotes context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartDashes() -{ - return UI_STRING_INTERNAL("Smart Dashes", "Smart Dashes context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSmartLinks() -{ - return UI_STRING_INTERNAL("Smart Links", "Smart Links context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTextReplacement() -{ - return UI_STRING_INTERNAL("Text Replacement", "Text Replacement context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTransformationsMenu() -{ - return UI_STRING_INTERNAL("Transformations", "Transformations context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMakeUpperCase() -{ - return UI_STRING_INTERNAL("Make Upper Case", "Make Upper Case context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMakeLowerCase() -{ - return UI_STRING_INTERNAL("Make Lower Case", "Make Lower Case context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCapitalize() -{ - return UI_STRING_INTERNAL("Capitalize", "Capitalize context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagChangeBack(const String& replacedString) -{ - static NSString *formatString = nil; -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - static bool lookedUpString = false; - if (!lookedUpString) { - formatString = [[[NSBundle bundleForClass:[NSSpellChecker class]] localizedStringForKey:@"Change Back to \\U201C%@\\U201D" value:nil table:@"MenuCommands"] retain]; - lookedUpString = true; - } -#endif - if (!formatString) - return replacedString; - return [NSString stringWithFormat:formatString, (NSString *)replacedString]; -} - -#endif - -String WebPlatformStrategies::contextMenuItemTagInspectElement() -{ - return UI_STRING_INTERNAL("Inspect Element", "Inspect Element context menu item"); -} - -#endif // ENABLE(CONTEXT_MENUS) - -String WebPlatformStrategies::searchMenuNoRecentSearchesText() -{ - return UI_STRING_INTERNAL("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); -} - -String WebPlatformStrategies::searchMenuRecentSearchesText() -{ - return UI_STRING_INTERNAL("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); -} - -String WebPlatformStrategies::searchMenuClearRecentSearchesText() -{ - return UI_STRING_INTERNAL("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents"); -} - -String WebPlatformStrategies::AXWebAreaText() -{ - return UI_STRING_INTERNAL("HTML content", "accessibility role description for web area"); -} - -String WebPlatformStrategies::AXLinkText() -{ - return UI_STRING_INTERNAL("link", "accessibility role description for link"); -} - -String WebPlatformStrategies::AXListMarkerText() -{ - return UI_STRING_INTERNAL("list marker", "accessibility role description for list marker"); -} - -String WebPlatformStrategies::AXImageMapText() -{ - return UI_STRING_INTERNAL("image map", "accessibility role description for image map"); -} - -String WebPlatformStrategies::AXHeadingText() -{ - return UI_STRING_INTERNAL("heading", "accessibility role description for headings"); -} - -String WebPlatformStrategies::AXDefinitionListTermText() -{ - return UI_STRING_INTERNAL("term", "term word of a definition"); -} - -String WebPlatformStrategies::AXDefinitionListDefinitionText() -{ - return UI_STRING_INTERNAL("definition", "definition phrase"); -} - -String WebPlatformStrategies::AXARIAContentGroupText(const String& ariaType) -{ - if (ariaType == "ARIAApplicationAlert") - return UI_STRING_INTERNAL("alert", "An ARIA accessibility group that acts as an alert."); - if (ariaType == "ARIAApplicationAlertDialog") - return UI_STRING_INTERNAL("alert dialog", "An ARIA accessibility group that acts as an alert dialog."); - if (ariaType == "ARIAApplicationDialog") - return UI_STRING_INTERNAL("dialog", "An ARIA accessibility group that acts as an dialog."); - if (ariaType == "ARIAApplicationLog") - return UI_STRING_INTERNAL("log", "An ARIA accessibility group that acts as a console log."); - if (ariaType == "ARIAApplicationMarquee") - return UI_STRING_INTERNAL("marquee", "An ARIA accessibility group that acts as a marquee."); - if (ariaType == "ARIAApplicationStatus") - return UI_STRING_INTERNAL("application status", "An ARIA accessibility group that acts as a status update."); - if (ariaType == "ARIAApplicationTimer") - return UI_STRING_INTERNAL("timer", "An ARIA accessibility group that acts as an updating timer."); - if (ariaType == "ARIADocument") - return UI_STRING_INTERNAL("document", "An ARIA accessibility group that acts as a document."); - if (ariaType == "ARIADocumentArticle") - return UI_STRING_INTERNAL("article", "An ARIA accessibility group that acts as an article."); - if (ariaType == "ARIADocumentNote") - return UI_STRING_INTERNAL("note", "An ARIA accessibility group that acts as a note in a document."); - if (ariaType == "ARIADocumentRegion") - return UI_STRING_INTERNAL("region", "An ARIA accessibility group that acts as a distinct region in a document."); - if (ariaType == "ARIALandmarkApplication") - return UI_STRING_INTERNAL("application", "An ARIA accessibility group that acts as an application."); - if (ariaType == "ARIALandmarkBanner") - return UI_STRING_INTERNAL("banner", "An ARIA accessibility group that acts as a banner."); - if (ariaType == "ARIALandmarkComplementary") - return UI_STRING_INTERNAL("complementary", "An ARIA accessibility group that acts as a region of complementary information."); - if (ariaType == "ARIALandmarkContentInfo") - return UI_STRING_INTERNAL("content", "An ARIA accessibility group that contains content."); - if (ariaType == "ARIALandmarkMain") - return UI_STRING_INTERNAL("main", "An ARIA accessibility group that is the main portion of the website."); - if (ariaType == "ARIALandmarkNavigation") - return UI_STRING_INTERNAL("navigation", "An ARIA accessibility group that contains the main navigation elements of a website."); - if (ariaType == "ARIALandmarkSearch") - return UI_STRING_INTERNAL("search", "An ARIA accessibility group that contains a search feature of a website."); - if (ariaType == "ARIAUserInterfaceTooltip") - return UI_STRING_INTERNAL("tooltip", "An ARIA accessibility group that acts as a tooltip."); - if (ariaType == "ARIATabPanel") - return UI_STRING_INTERNAL("tab panel", "An ARIA accessibility group that contains the content of a tab."); - if (ariaType == "ARIADocumentMath") - return UI_STRING_INTERNAL("math", "An ARIA accessibility group that contains mathematical symbols."); - return String(); -} - -String WebPlatformStrategies::AXButtonActionVerb() -{ - return UI_STRING_INTERNAL("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility"); -} - -String WebPlatformStrategies::AXRadioButtonActionVerb() -{ - return UI_STRING_INTERNAL("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXTextFieldActionVerb() -{ - return UI_STRING_INTERNAL("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility"); -} - -String WebPlatformStrategies::AXCheckedCheckBoxActionVerb() -{ - return UI_STRING_INTERNAL("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb() -{ - return UI_STRING_INTERNAL("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXMenuListActionVerb() -{ - return String(); -} - -String WebPlatformStrategies::AXMenuListPopupActionVerb() -{ - return String(); -} - -String WebPlatformStrategies::AXLinkActionVerb() -{ - return UI_STRING_INTERNAL("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::missingPluginText() -{ - return UI_STRING_INTERNAL("Missing Plug-in", "Label text to be used when a plugin is missing"); -} - -String WebPlatformStrategies::crashedPluginText() -{ - return UI_STRING_INTERNAL("Plug-in Failure", "Label text to be used if plugin host process has crashed"); -} - -String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles) -{ - return [NSString stringWithFormat:UI_STRING_INTERNAL("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles]; -} - -String WebPlatformStrategies::unknownFileSizeText() -{ - return UI_STRING_INTERNAL("Unknown", "Unknown filesize FTP directory listing item"); -} - -String WebPlatformStrategies::keygenMenuItem512() -{ - return UI_STRING_INTERNAL("512 (Low Grade)", "Menu item title for KEYGEN pop-up menu"); -} - -String WebPlatformStrategies::keygenMenuItem1024() -{ - return UI_STRING_INTERNAL("1024 (Medium Grade)", "Menu item title for KEYGEN pop-up menu"); -} - -String WebPlatformStrategies::keygenMenuItem2048() -{ - return UI_STRING_INTERNAL("2048 (High Grade)", "Menu item title for KEYGEN pop-up menu"); -} - -String WebPlatformStrategies::keygenKeychainItemName(const WTF::String& host) -{ - return [NSString stringWithFormat:UI_STRING_INTERNAL("Key from %@", "Name of keychain key generated by the KEYGEN tag"), (NSString *)host]; -} - -String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) -{ -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) - NSString *widthString = [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInt:size.width()] numberStyle:NSNumberFormatterDecimalStyle]; - NSString *heightString = [NSNumberFormatter localizedStringFromNumber:[NSNumber numberWithInt:size.height()] numberStyle:NSNumberFormatterDecimalStyle]; - return [NSString localizedStringWithFormat:UI_STRING_INTERNAL("%@ %@×%@ pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, widthString, heightString]; -#else - return [NSString stringWithFormat:UI_STRING_INTERNAL("%@ %d×%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), (NSString *)filename, size.width(), size.height()]; -#endif -} - -String WebPlatformStrategies::mediaElementLoadingStateText() -{ - return UI_STRING_INTERNAL("Loading...", "Media controller status message when the media is loading"); -} - -String WebPlatformStrategies::mediaElementLiveBroadcastStateText() -{ - return UI_STRING_INTERNAL("Live Broadcast", "Media controller status message when watching a live broadcast"); -} - -String WebPlatformStrategies::localizedMediaControlElementString(const String& name) -{ - if (name == "AudioElement") - return UI_STRING_INTERNAL("audio element controller", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING_INTERNAL("video element controller", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING_INTERNAL("mute", "accessibility role description for mute button"); - if (name == "UnMuteButton") - return UI_STRING_INTERNAL("unmute", "accessibility role description for turn mute off button"); - if (name == "PlayButton") - return UI_STRING_INTERNAL("play", "accessibility role description for play button"); - if (name == "PauseButton") - return UI_STRING_INTERNAL("pause", "accessibility role description for pause button"); - if (name == "Slider") - return UI_STRING_INTERNAL("movie time", "accessibility role description for timeline slider"); - if (name == "SliderThumb") - return UI_STRING_INTERNAL("timeline slider thumb", "accessibility role description for timeline thumb"); - if (name == "RewindButton") - return UI_STRING_INTERNAL("back 30 seconds", "accessibility role description for seek back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING_INTERNAL("return to realtime", "accessibility role description for return to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING_INTERNAL("elapsed time", "accessibility role description for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING_INTERNAL("remaining time", "accessibility role description for time remaining display"); - if (name == "StatusDisplay") - return UI_STRING_INTERNAL("status", "accessibility role description for movie status"); - if (name == "FullscreenButton") - return UI_STRING_INTERNAL("fullscreen", "accessibility role description for enter fullscreen button"); - if (name == "SeekForwardButton") - return UI_STRING_INTERNAL("fast forward", "accessibility role description for fast forward button"); - if (name == "SeekBackButton") - return UI_STRING_INTERNAL("fast reverse", "accessibility role description for fast reverse button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING_INTERNAL("show closed captions", "accessibility role description for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING_INTERNAL("hide closed captions", "accessibility role description for hide closed captions button"); - - // FIXME: the ControlsPanel container should never be visible in the accessibility hierarchy. - if (name == "ControlsPanel") - return String(); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) -{ - if (name == "AudioElement") - return UI_STRING_INTERNAL("audio element playback controls and status display", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING_INTERNAL("video element playback controls and status display", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING_INTERNAL("mute audio tracks", "accessibility help text for mute button"); - if (name == "UnMuteButton") - return UI_STRING_INTERNAL("unmute audio tracks", "accessibility help text for un mute button"); - if (name == "PlayButton") - return UI_STRING_INTERNAL("begin playback", "accessibility help text for play button"); - if (name == "PauseButton") - return UI_STRING_INTERNAL("pause playback", "accessibility help text for pause button"); - if (name == "Slider") - return UI_STRING_INTERNAL("movie time scrubber", "accessibility help text for timeline slider"); - if (name == "SliderThumb") - return UI_STRING_INTERNAL("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); - if (name == "RewindButton") - return UI_STRING_INTERNAL("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING_INTERNAL("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING_INTERNAL("current movie time in seconds", "accessibility help text for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING_INTERNAL("number of seconds of movie remaining", "accessibility help text for remaining time display"); - if (name == "StatusDisplay") - return UI_STRING_INTERNAL("current movie status", "accessibility help text for movie status display"); - if (name == "SeekBackButton") - return UI_STRING_INTERNAL("seek quickly back", "accessibility help text for fast rewind button"); - if (name == "SeekForwardButton") - return UI_STRING_INTERNAL("seek quickly forward", "accessibility help text for fast forward button"); - if (name == "FullscreenButton") - return UI_STRING_INTERNAL("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING_INTERNAL("start displaying closed captions", "accessibility help text for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING_INTERNAL("stop displaying closed captions", "accessibility help text for hide closed captions button"); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaTimeDescription(float time) -{ - if (!isfinite(time)) - return UI_STRING_INTERNAL("indefinite time", "accessibility help text for an indefinite media controller time value"); - - int seconds = (int)fabsf(time); - int days = seconds / (60 * 60 * 24); - int hours = seconds / (60 * 60); - int minutes = (seconds / 60) % 60; - seconds %= 60; - - if (days) - return [NSString stringWithFormat:UI_STRING_INTERNAL("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds]; - else if (hours) - return [NSString stringWithFormat:UI_STRING_INTERNAL("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds]; - else if (minutes) - return [NSString stringWithFormat:UI_STRING_INTERNAL("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds]; - - return [NSString stringWithFormat:UI_STRING_INTERNAL("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds]; -} - -String WebPlatformStrategies::validationMessageValueMissingText() -{ - return UI_STRING_INTERNAL("value missing", "Validation message for required form control elements that have no value"); -} - -String WebPlatformStrategies::validationMessageTypeMismatchText() -{ - return UI_STRING_INTERNAL("type mismatch", "Validation message for input form controls with a value not matching type"); -} - -String WebPlatformStrategies::validationMessagePatternMismatchText() -{ - return UI_STRING_INTERNAL("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern"); -} - -String WebPlatformStrategies::validationMessageTooLongText() -{ - return UI_STRING_INTERNAL("too long", "Validation message for form control elements with a value longer than maximum allowed length"); -} - -String WebPlatformStrategies::validationMessageRangeUnderflowText() -{ - return UI_STRING_INTERNAL("range underflow", "Validation message for input form controls with value lower than allowed minimum"); -} - -String WebPlatformStrategies::validationMessageRangeOverflowText() -{ - return UI_STRING_INTERNAL("range overflow", "Validation message for input form controls with value higher than allowed maximum"); -} - -String WebPlatformStrategies::validationMessageStepMismatchText() -{ - return UI_STRING_INTERNAL("step mismatch", "Validation message for input form controls with value not respecting the step attribute"); -} - -// VisitedLinkStrategy bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) { return page->group().isLinkVisited(hash); diff --git a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm index 1b212a7..de2a1f4 100644 --- a/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm +++ b/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm @@ -68,7 +68,6 @@ void InitWebCoreSystemInterface(void) INIT(GetWheelEventDeltas); INIT(HitTestMediaUIPart); INIT(InitializeMaximumHTTPConnectionCountPerHost); - INIT(IsLatchingWheelEvent); INIT(MeasureMediaUIPart); INIT(MediaControllerThemeAvailable); INIT(PopupMenu); @@ -77,7 +76,9 @@ void InitWebCoreSystemInterface(void) INIT(SetCONNECTProxyForStream); INIT(SetCookieStoragePrivateBrowsingEnabled); INIT(SetDragImage); + INIT(SetHTTPPipeliningMaximumPriority); INIT(SetHTTPPipeliningPriority); + INIT(SetHTTPPipeliningMinimumFastLanePriority); INIT(SetNSURLConnectionDefersCallbacks); INIT(SetNSURLRequestShouldContentSniff); INIT(SetPatternBaseCTM); @@ -119,9 +120,11 @@ void InitWebCoreSystemInterface(void) #if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) INIT(GetHyphenationLocationBeforeIndex); + INIT(GetNSEventMomentumPhase); #endif INIT(CreateCTLineWithUniCharProvider); + #if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) INIT(IOSurfaceContextCreate); INIT(IOSurfaceContextCreateImage); @@ -155,6 +158,8 @@ void InitWebCoreSystemInterface(void) INIT(WillEndLiveResize); INIT(ContentAreaDidShow); INIT(ContentAreaDidHide); + INIT(DidBeginScrollGesture); + INIT(DidEndScrollGesture); INIT(ScrollbarPainterUsesOverlayScrollers); #endif diff --git a/Source/WebKit/mac/Misc/WebNSAttributedStringExtras.h b/Source/WebKit/mac/WebInspector/WebNodeHighlighter.h index a4ee9fc..4fca732 100644 --- a/Source/WebKit/mac/Misc/WebNSAttributedStringExtras.h +++ b/Source/WebKit/mac/WebInspector/WebNodeHighlighter.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -20,19 +20,22 @@ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -namespace WebCore { - class Range; -} - -@interface NSAttributedString (WebKitExtras) - -+ (NSAttributedString *)_web_attributedStringFromRange:(WebCore::Range*)range; -- (NSAttributedString *)_web_attributedStringByStrippingAttachmentCharacters; +@class DOMNode; +@class WebView; +@class WebNodeHighlight; +@interface WebNodeHighlighter : NSObject { +@private + WebView *_inspectedWebView; + WebNodeHighlight *_currentHighlight; +} +- (id)initWithInspectedWebView:(WebView *)webView; +- (void)highlightNode:(DOMNode *)node; +- (void)hideHighlight; @end diff --git a/Source/WebKit/mac/WebInspector/WebNodeHighlighter.mm b/Source/WebKit/mac/WebInspector/WebNodeHighlighter.mm new file mode 100644 index 0000000..56bee2e --- /dev/null +++ b/Source/WebKit/mac/WebInspector/WebNodeHighlighter.mm @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "WebNodeHighlighter.h" + +#import "DOMNodeInternal.h" +#import "WebNodeHighlight.h" +#import "WebViewInternal.h" +#import <WebCore/Page.h> + +@implementation WebNodeHighlighter + +- (id)initWithInspectedWebView:(WebView *)webView +{ + if (!(self = [super init])) + return nil; + + // Don't retain to avoid a circular reference. + _inspectedWebView = webView; + + return self; +} + +- (void)dealloc +{ + ASSERT(!_currentHighlight); + [super dealloc]; +} + +// MARK: - + +- (void)highlightNode:(DOMNode *)node +{ + // The scrollview's content view stays around between page navigations, so target it. + NSView *view = [[[[[_inspectedWebView mainFrame] frameView] documentView] enclosingScrollView] contentView]; + if (![view window]) + return; // Skip the highlight if we have no window (e.g. hidden tab). + + if (!_currentHighlight) { + _currentHighlight = [[WebNodeHighlight alloc] initWithTargetView:view inspectorController:[_inspectedWebView page]->inspectorController()]; + [_currentHighlight setDelegate:self]; + [_currentHighlight attach]; + } else + [[_currentHighlight highlightView] setNeedsDisplay:YES]; +} + +- (void)hideHighlight +{ + [_currentHighlight detach]; + [_currentHighlight setDelegate:nil]; + [_currentHighlight release]; + _currentHighlight = nil; +} + +// MARK: - +// MARK: WebNodeHighlight delegate + +- (void)didAttachWebNodeHighlight:(WebNodeHighlight *)highlight +{ + [_inspectedWebView setCurrentNodeHighlight:highlight]; +} + +- (void)willDetachWebNodeHighlight:(WebNodeHighlight *)highlight +{ + [_inspectedWebView setCurrentNodeHighlight:nil]; +} + +@end diff --git a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm index 9f0dd8d..1b245ec 100644 --- a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm +++ b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm @@ -515,7 +515,13 @@ static const unsigned cMaxUpdateScrollbarsPass = 2; BOOL isContinuous; WKGetWheelEventDeltas(event, &deltaX, &deltaY, &isContinuous); - BOOL isLatchingEvent = WKIsLatchingWheelEvent(event); +#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + NSEventPhase momentumPhase = [event momentumPhase]; + BOOL isLatchingEvent = momentumPhase & NSEventPhaseBegan || momentumPhase & NSEventPhaseChanged; +#else + int momentumPhase = WKGetNSEventMomentumPhase(event); + BOOL isLatchingEvent = momentumPhase == WKEventPhaseBegan || momentumPhase == WKEventPhaseChanged; +#endif if (fabsf(deltaY) > fabsf(deltaX)) { if (![self allowsVerticalScrolling]) { diff --git a/Source/WebKit/mac/WebView/WebFrame.mm b/Source/WebKit/mac/WebView/WebFrame.mm index 584b09e..ab8c34d 100644 --- a/Source/WebKit/mac/WebView/WebFrame.mm +++ b/Source/WebKit/mac/WebView/WebFrame.mm @@ -670,30 +670,15 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (NSRange)_convertToNSRange:(Range *)range { - if (!range || !range->startContainer()) + if (!range) return NSMakeRange(NSNotFound, 0); - Element* selectionRoot = _private->coreFrame->selection()->rootEditableElement(); - Element* scope = selectionRoot ? selectionRoot : _private->coreFrame->document()->documentElement(); - - // Mouse events may cause TSM to attempt to create an NSRange for a portion of the view - // that is not inside the current editable region. These checks ensure we don't produce - // potentially invalid data when responding to such requests. - if (range->startContainer() != scope && !range->startContainer()->isDescendantOf(scope)) - return NSMakeRange(NSNotFound, 0); - if (range->endContainer() != scope && !range->endContainer()->isDescendantOf(scope)) + size_t location; + size_t length; + if (!TextIterator::locationAndLengthFromRange(range, location, length)) return NSMakeRange(NSNotFound, 0); - - RefPtr<Range> testRange = Range::create(scope->document(), scope, 0, range->startContainer(), range->startOffset()); - ASSERT(testRange->startContainer() == scope); - int startPosition = TextIterator::rangeLength(testRange.get()); - - ExceptionCode ec; - testRange->setEnd(range->endContainer(), range->endOffset(), ec); - ASSERT(testRange->startContainer() == scope); - int endPosition = TextIterator::rangeLength(testRange.get()); - return NSMakeRange(startPosition, endPosition - startPosition); + return NSMakeRange(location, length); } - (PassRefPtr<Range>)_convertToDOMRange:(NSRange)nsrange @@ -820,27 +805,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader) - (DOMRange *)_characterRangeAtPoint:(NSPoint)point { - VisiblePosition position = [self _visiblePositionForPoint:point]; - if (position.isNull()) - return nil; - - VisiblePosition previous = position.previous(); - if (previous.isNotNull()) { - DOMRange *previousCharacterRange = kit(makeRange(previous, position).get()); - NSRect rect = [self _firstRectForDOMRange:previousCharacterRange]; - if (NSPointInRect(point, rect)) - return previousCharacterRange; - } - - VisiblePosition next = position.next(); - if (next.isNotNull()) { - DOMRange *nextCharacterRange = kit(makeRange(position, next).get()); - NSRect rect = [self _firstRectForDOMRange:nextCharacterRange]; - if (NSPointInRect(point, rect)) - return nextCharacterRange; - } - - return nil; + return kit(_private->coreFrame->rangeForPoint(IntPoint(point)).get()); } - (DOMCSSStyleDeclaration *)_typingStyle diff --git a/Source/WebKit/mac/WebView/WebFrameInternal.h b/Source/WebKit/mac/WebView/WebFrameInternal.h index c13b721..ff382d4 100644 --- a/Source/WebKit/mac/WebView/WebFrameInternal.h +++ b/Source/WebKit/mac/WebView/WebFrameInternal.h @@ -142,6 +142,7 @@ WebView *getWebView(WebFrame *webFrame); - (NSRange)_convertToNSRange:(WebCore::Range*)range; - (DOMRange *)_convertNSRangeToDOMRange:(NSRange)range; - (NSRange)_convertDOMRangeToNSRange:(DOMRange *)range; +- (PassRefPtr<WebCore::Range>)_convertToDOMRange:(NSRange)nsrange; - (DOMDocumentFragment *)_documentFragmentWithMarkupString:(NSString *)markupString baseURLString:(NSString *)baseURLString; - (DOMDocumentFragment *)_documentFragmentWithNodesAsParagraphs:(NSArray *)nodes; diff --git a/Source/WebKit/mac/WebView/WebFrameView.mm b/Source/WebKit/mac/WebView/WebFrameView.mm index c42738c..41ac9ed 100644 --- a/Source/WebKit/mac/WebView/WebFrameView.mm +++ b/Source/WebKit/mac/WebView/WebFrameView.mm @@ -771,6 +771,13 @@ static inline void addTypesFromClass(NSMutableDictionary *allTypes, Class objCCl - (void)keyDown:(NSEvent *)event { + // Implement common browser behaviors for all kinds of content. + + // FIXME: This is not a good time to execute commands for WebHTMLView. We should run these at the time commands sent by key bindings + // are executed for consistency. + // This doesn't work automatically because most of the keys handled here are translated into moveXXX commands, which are not handled + // by Editor when focus is not in editable content. + NSString *characters = [event characters]; int index, count; BOOL callSuper = YES; diff --git a/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm b/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm index 03edd5d..1802ca8 100644 --- a/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm +++ b/Source/WebKit/mac/WebView/WebHTMLRepresentation.mm @@ -38,7 +38,6 @@ #import "WebFrameInternal.h" #import "WebKitNSStringExtras.h" #import "WebKitStatisticsPrivate.h" -#import "WebNSAttributedStringExtras.h" #import "WebNSObjectExtras.h" #import "WebTypesInternal.h" #import "WebView.h" @@ -48,6 +47,7 @@ #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameLoaderClient.h> +#import <WebCore/HTMLConverter.h> #import <WebCore/HTMLFormControlElement.h> #import <WebCore/HTMLFormElement.h> #import <WebCore/HTMLInputElement.h> @@ -261,7 +261,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second) - (NSString *)title { - return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title()); + return nsStringNilIfEmpty([_private->dataSource _documentLoader]->title().string()); } - (DOMDocument *)DOMDocument @@ -277,7 +277,7 @@ static NSArray *concatenateArrays(NSArray *first, NSArray *second) - (NSAttributedString *)attributedStringFrom:(DOMNode *)startNode startOffset:(int)startOffset to:(DOMNode *)endNode endOffset:(int)endOffset { - return [NSAttributedString _web_attributedStringFromRange:Range::create(core(startNode)->document(), core(startNode), startOffset, core(endNode), endOffset).get()]; + return [WebHTMLConverter editingAttributedStringFromRange:Range::create(core(startNode)->document(), core(startNode), startOffset, core(endNode), endOffset).get()]; } static HTMLFormElement* formElementFromDOMElement(DOMElement *element) diff --git a/Source/WebKit/mac/WebView/WebHTMLView.mm b/Source/WebKit/mac/WebView/WebHTMLView.mm index e611e2b..fb1d794 100644 --- a/Source/WebKit/mac/WebView/WebHTMLView.mm +++ b/Source/WebKit/mac/WebView/WebHTMLView.mm @@ -53,7 +53,6 @@ #import "WebKitNSStringExtras.h" #import "WebKitVersionChecks.h" #import "WebLocalizableStringsInternal.h" -#import "WebNSAttributedStringExtras.h" #import "WebNSEventExtras.h" #import "WebNSFileManagerExtras.h" #import "WebNSImageExtras.h" @@ -94,6 +93,7 @@ #import <WebCore/Frame.h> #import <WebCore/FrameLoader.h> #import <WebCore/FrameView.h> +#import <WebCore/HTMLConverter.h> #import <WebCore/HTMLNames.h> #import <WebCore/HitTestResult.h> #import <WebCore/Image.h> @@ -112,6 +112,7 @@ #import <WebCore/Text.h> #import <WebCore/WebCoreObjCExtras.h> #import <WebCore/WebFontCache.h> +#import <WebCore/WebNSAttributedStringExtras.h> #import <WebCore/markup.h> #import <WebKit/DOM.h> #import <WebKit/DOMExtensions.h> @@ -431,6 +432,7 @@ static CachedResourceClient* promisedDataClient() @interface WebHTMLView (WebForwardDeclaration) // FIXME: Put this in a normal category and stop doing the forward declaration trick. - (void)_setPrinting:(BOOL)printing minimumPageLogicalWidth:(float)minPageWidth logicalHeight:(float)minPageHeight maximumPageLogicalWidth:(float)maxPageWidth adjustViewSize:(BOOL)adjustViewSize paginateScreenContent:(BOOL)paginateScreenContent; +- (void)_updateSecureInputState; @end @class NSTextInputContext; @@ -465,6 +467,7 @@ struct WebHTMLViewInterpretKeyEventsParameters { bool eventInterpretationHadSideEffects; bool shouldSaveCommands; bool consumedByIM; + bool executingSavedKeypressCommands; }; @interface WebHTMLViewPrivate : NSObject { @@ -493,6 +496,11 @@ struct WebHTMLViewInterpretKeyEventsParameters { // This state is saved each time selection changes, because computing it causes style recalc, which is not always safe to do. BOOL exposeInputContext; + // Track whether the view has set a secure input state. + BOOL isInSecureInputState; + + BOOL _forceUpdateSecureInputState; + NSPoint lastScrollPosition; #ifndef BUILDING_ON_TIGER BOOL inScrollPositionChanged; @@ -1041,12 +1049,10 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart) [pasteboard setData:RTFDData forType:NSRTFDPboardType]; } if ([types containsObject:NSRTFPboardType]) { - if (attributedString == nil) { + if (!attributedString) attributedString = [self selectedAttributedString]; - } - if ([attributedString containsAttachments]) { - attributedString = [attributedString _web_attributedStringByStrippingAttachmentCharacters]; - } + if ([attributedString containsAttachments]) + attributedString = attributedStringByStrippingAttachmentCharacters(attributedString); NSData *RTFData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFData forType:NSRTFPboardType]; } @@ -1994,6 +2000,11 @@ static void _updateMouseoverTimerCallback(CFRunLoopTimerRef timer, void *info) // remove tooltips before clearing _private so removeTrackingRect: will work correctly [self removeAllToolTips]; + if (_private->isInSecureInputState) { + DisableSecureEventInput(); + _private->isInSecureInputState = NO; + } + [_private clear]; } @@ -3459,8 +3470,10 @@ static void setMenuTargets(NSMenu* menu) NSWindow *keyWindow = [notification object]; - if (keyWindow == [self window]) + if (keyWindow == [self window]) { [self addMouseMovedObserver]; + [self _updateSecureInputState]; + } } - (void)windowDidResignKey:(NSNotification *)notification @@ -3475,8 +3488,10 @@ static void setMenuTargets(NSMenu* menu) if (formerKeyWindow == [self window]) [self removeMouseMovedObserver]; - if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) + if (formerKeyWindow == [self window] || formerKeyWindow == [[self window] attachedSheet]) { + [self _updateSecureInputState]; [_private->completionController endRevertingChange:NO moveLeft:NO]; + } } - (void)windowWillClose:(NSNotification *)notification @@ -3809,6 +3824,10 @@ static BOOL isInPasswordField(Frame* coreFrame) [NSApp updateWindows]; } + _private->_forceUpdateSecureInputState = YES; + [self _updateSecureInputState]; + _private->_forceUpdateSecureInputState = NO; + frame->editor()->setStartNewKillRingSequence(true); Page* page = frame->page(); @@ -3834,6 +3853,10 @@ static BOOL isInPasswordField(Frame* coreFrame) { BOOL resign = [super resignFirstResponder]; if (resign) { + if (_private->isInSecureInputState) { + DisableSecureEventInput(); + _private->isInSecureInputState = NO; + } [_private->completionController endRevertingChange:NO moveLeft:NO]; Frame* coreFrame = core([self _frame]); if (!coreFrame) @@ -4163,15 +4186,12 @@ static BOOL isInPasswordField(Frame* coreFrame) // the current event prevents that from causing a problem inside WebKit or AppKit code. [[event retain] autorelease]; - Frame* coreFrame = core([self _frame]); - if (coreFrame) - coreFrame->eventHandler()->capsLockStateMayHaveChanged(); - RetainPtr<WebHTMLView> selfProtector = self; + Frame* coreFrame = core([self _frame]); unsigned short keyCode = [event keyCode]; - //Don't make an event from the num lock and function keys + // Don't make an event from the num lock and function keys. if (coreFrame && keyCode != 0 && keyCode != 10 && keyCode != 63) { coreFrame->eventHandler()->keyEvent(PlatformKeyboardEvent(event)); return; @@ -4370,8 +4390,11 @@ static BOOL isInPasswordField(Frame* coreFrame) - (BOOL)_handleStyleKeyEquivalent:(NSEvent *)event { - ASSERT([self _webView]); - if (![[[self _webView] preferences] respectStandardStyleKeyEquivalents]) + WebView *webView = [self _webView]; + if (!webView) + return NO; + + if (![[webView preferences] respectStandardStyleKeyEquivalents]) return NO; if (![self _canEdit]) @@ -5428,26 +5451,35 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) [self _updateMouseoverWithFakeEvent]; } -- (void)_executeSavedEditingCommands +- (void)_executeSavedKeypressCommands { WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; if (!parameters || parameters->event->keypressCommands().isEmpty()) return; + // We could be called again if the execution of one command triggers a call to selectedRange. + // In this case, the state is up to date, and we don't need to execute any more saved commands to return a result + if (parameters->executingSavedKeypressCommands) + return; + // Avoid an infinite loop that would occur if executing a command appended it to event->keypressCommands() again. bool wasSavingCommands = parameters->shouldSaveCommands; parameters->shouldSaveCommands = false; - + parameters->executingSavedKeypressCommands = true; + const Vector<KeypressCommand>& commands = parameters->event->keypressCommands(); for (size_t i = 0; i < commands.size(); ++i) { if (commands[i].commandName == "insertText:") [self insertText:commands[i].text]; + else if (commands[i].commandName == "noop:") + ; // Do nothing. This case can be removed once <rdar://problem/9025012> is fixed. else [self doCommandBySelector:NSSelectorFromString(commands[i].commandName)]; } parameters->event->keypressCommands().clear(); parameters->shouldSaveCommands = wasSavingCommands; + parameters->executingSavedKeypressCommands = false; } - (BOOL)_interpretKeyEvent:(KeyboardEvent*)event savingCommands:(BOOL)savingCommands @@ -5458,6 +5490,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) WebHTMLViewInterpretKeyEventsParameters parameters; parameters.eventInterpretationHadSideEffects = false; parameters.shouldSaveCommands = savingCommands; + parameters.executingSavedKeypressCommands = false; // If we're intercepting the initial IM call we assume that the IM has consumed the event, // and only change this assumption if one of the NSTextInput/Responder callbacks is used. // We assume the IM will *not* consume hotkey sequences @@ -5501,7 +5534,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) // If there are no text insertion commands, default keydown handler is the right time to execute the commands. // Keypress (Char event) handler is the latest opportunity to execute. if (!haveTextInsertionCommands || platformEvent->type() == PlatformKeyboardEvent::Char) - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; } _private->interpretKeyEventsParameters = 0; @@ -5746,7 +5779,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (NSUInteger)characterIndexForPoint:(NSPoint)thePoint { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; NSWindow *window = [self window]; WebFrame *frame = [self _frame]; @@ -5768,7 +5801,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (NSRect)firstRectForCharacterRange:(NSRange)theRange { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; WebFrame *frame = [self _frame]; @@ -5800,7 +5833,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (NSRange)selectedRange { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; if (!isTextInput(core([self _frame]))) { LOG(TextInput, "selectedRange -> (NSNotFound, 0)"); @@ -5814,7 +5847,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (NSRange)markedRange { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; WebFrame *webFrame = [self _frame]; Frame* coreFrame = core(webFrame); @@ -5828,7 +5861,7 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (NSAttributedString *)attributedSubstringFromRange:(NSRange)nsRange { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; WebFrame *frame = [self _frame]; Frame* coreFrame = core(frame); @@ -5836,15 +5869,15 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length); return nil; } - DOMRange *domRange = [frame _convertNSRangeToDOMRange:nsRange]; - if (!domRange) { + RefPtr<Range> range = [frame _convertToDOMRange:nsRange]; + if (!range) { LOG(TextInput, "attributedSubstringFromRange:(%u, %u) -> nil", nsRange.location, nsRange.length); return nil; } - NSAttributedString *result = [NSAttributedString _web_attributedStringFromRange:core(domRange)]; + NSAttributedString *result = [WebHTMLConverter editingAttributedStringFromRange:range.get()]; - // [NSAttributedString(WebKitExtras) _web_attributedStringFromRange:] insists on inserting a trailing + // [WebHTMLConverter editingAttributedStringFromRange:] insists on inserting a trailing // whitespace at the end of the string which breaks the ATOK input method. <rdar://problem/5400551> // To work around this we truncate the resultant string to the correct length. if ([result length] > nsRange.length) { @@ -5871,23 +5904,27 @@ static CGPoint coreGraphicsScreenPointForAppKitScreenPoint(NSPoint point) - (BOOL)hasMarkedText { - [self _executeSavedEditingCommands]; - Frame* coreFrame = core([self _frame]); BOOL result = coreFrame && coreFrame->editor()->hasComposition(); + + if (result) { + // A saved command can confirm a composition, but it cannot start a new one. + [self _executeSavedKeypressCommands]; + result = coreFrame->editor()->hasComposition(); + } + LOG(TextInput, "hasMarkedText -> %u", result); return result; } - (void)unmarkText { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; LOG(TextInput, "unmarkText"); // Use pointer to get parameters passed to us by the caller of interpretKeyEvents. WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; - _private->interpretKeyEventsParameters = 0; if (parameters) { parameters->eventInterpretationHadSideEffects = true; @@ -5920,15 +5957,15 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (void)setMarkedText:(id)string selectedRange:(NSRange)newSelRange { - [self _executeSavedEditingCommands]; + [self _executeSavedKeypressCommands]; - BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; // Otherwise, NSString + BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; + ASSERT(isAttributedString || [string isKindOfClass:[NSString class]]); LOG(TextInput, "setMarkedText:\"%@\" selectedRange:(%u, %u)", isAttributedString ? [string string] : string, newSelRange.location, newSelRange.length); // Use pointer to get parameters passed to us by the caller of interpretKeyEvents. WebHTMLViewInterpretKeyEventsParameters* parameters = _private->interpretKeyEventsParameters; - _private->interpretKeyEventsParameters = 0; if (parameters) { parameters->eventInterpretationHadSideEffects = true; @@ -5943,20 +5980,25 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde return; Vector<CompositionUnderline> underlines; - NSString *text = string; + NSString *text; + NSRange replacementRange = { NSNotFound, 0 }; if (isAttributedString) { - unsigned markedTextLength = [(NSString *)string length]; - NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:0 inRange:NSMakeRange(0, markedTextLength)]; + // FIXME: We ignore most attributes from the string, so an input method cannot specify e.g. a font or a glyph variation. + text = [string string]; + NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:0 inRange:NSMakeRange(0, [text length])]; LOG(TextInput, " ReplacementRange: %@", rangeString); // The AppKit adds a 'secret' property to the string that contains the replacement range. // The replacement range is the range of the the text that should be replaced with the new string. if (rangeString) - [[self _frame] _selectNSRange:NSRangeFromString(rangeString)]; + replacementRange = NSRangeFromString(rangeString); - text = [string string]; extractUnderlines(string, underlines); - } + } else + text = string; + + if (replacementRange.location != NSNotFound) + [[self _frame] _selectNSRange:replacementRange]; coreFrame->editor()->setComposition(text, underlines, newSelRange.location, NSMaxRange(newSelRange)); } @@ -6018,7 +6060,8 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde - (void)insertText:(id)string { - BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; // Otherwise, NSString + BOOL isAttributedString = [string isKindOfClass:[NSAttributedString class]]; + ASSERT(isAttributedString || [string isKindOfClass:[NSString class]]); LOG(TextInput, "insertText:\"%@\"", isAttributedString ? [string string] : string); @@ -6026,20 +6069,19 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde if (parameters) parameters->consumedByIM = false; - // We don't support inserting an attributed string but input methods don't appear to require this. RefPtr<Frame> coreFrame = core([self _frame]); NSString *text; + NSRange replacementRange = { NSNotFound, 0 }; bool isFromInputMethod = coreFrame && coreFrame->editor()->hasComposition(); + if (isAttributedString) { + // FIXME: We ignore most attributes from the string, so for example inserting from Character Palette loses font and glyph variation data. + // It does not look like any input methods ever use insertText: with attributes other than NSTextInputReplacementRangeAttributeName. text = [string string]; - // We deal with the NSTextInputReplacementRangeAttributeName attribute from NSAttributedString here - // simply because it is used by at least one Input Method -- it corresonds to the kEventParamTextInputSendReplaceRange - // event in TSM. This behavior matches that of -[WebHTMLView setMarkedText:selectedRange:] when it receives an - // NSAttributedString NSString *rangeString = [string attribute:NSTextInputReplacementRangeAttributeName atIndex:0 longestEffectiveRange:0 inRange:NSMakeRange(0, [text length])]; LOG(TextInput, " ReplacementRange: %@", rangeString); if (rangeString) { - [[self _frame] _selectNSRange:NSRangeFromString(rangeString)]; + replacementRange = NSRangeFromString(rangeString); isFromInputMethod = true; } } else @@ -6062,6 +6104,9 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde if (!coreFrame || !coreFrame->editor()->canEdit()) return; + if (replacementRange.location != NSNotFound) + [[self _frame] _selectNSRange:replacementRange]; + bool eventHandled = false; String eventText = text; eventText.replace(NSBackTabCharacter, NSTabCharacter); // same thing is done in KeyEventMac.mm in WebCore @@ -6078,6 +6123,37 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde parameters->eventInterpretationHadSideEffects |= eventHandled; } +- (void)_updateSecureInputState +{ + if (![[self window] isKeyWindow] || ([[self window] firstResponder] != self && !_private->_forceUpdateSecureInputState)) { + if (_private->isInSecureInputState) { + DisableSecureEventInput(); + _private->isInSecureInputState = NO; + } + return; + } + + Frame* coreFrame = core([self _frame]); + if (!coreFrame) + return; + + if (isInPasswordField(coreFrame)) { + if (!_private->isInSecureInputState) + EnableSecureEventInput(); + _private->isInSecureInputState = YES; + // WebKit substitutes nil for input context when in password field, which corresponds to null TSMDocument. So, there is + // no need to call TSMGetActiveDocument(), which may return an incorrect result when selection hasn't been yet updated + // after focusing a node. + static CFArrayRef inputSources = TISCreateASCIICapableInputSourceList(); + TSMSetDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag, sizeof(CFArrayRef), &inputSources); + } else { + if (_private->isInSecureInputState) + DisableSecureEventInput(); + _private->isInSecureInputState = NO; + TSMRemoveDocumentProperty(0, kTSMDocumentEnabledInputSourcesPropertyTag); + } +} + - (void)_updateSelectionForInputManager { Frame* coreFrame = core([self _frame]); @@ -6093,6 +6169,8 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde [NSApp updateWindows]; } + [self _updateSecureInputState]; + if (!coreFrame->editor()->hasComposition()) return; @@ -6214,7 +6292,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde NSAttributedString *attributedString = [self _attributeStringFromDOMRange:[document _documentRange]]; if (!attributedString) { Document* coreDocument = core(document); - attributedString = [NSAttributedString _web_attributedStringFromRange:Range::create(coreDocument, coreDocument, 0, coreDocument, coreDocument->childNodeCount()).get()]; + attributedString = [WebHTMLConverter editingAttributedStringFromRange:Range::create(coreDocument, coreDocument, 0, coreDocument, coreDocument->childNodeCount()).get()]; } return attributedString; } @@ -6231,7 +6309,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde Frame* coreFrame = core([self _frame]); if (coreFrame) { RefPtr<Range> range = coreFrame->selection()->selection().toNormalizedRange(); - attributedString = [NSAttributedString _web_attributedStringFromRange:range.get()]; + attributedString = [WebHTMLConverter editingAttributedStringFromRange:range.get()]; } } return attributedString; diff --git a/Source/WebKit/mac/WebView/WebPDFView.mm b/Source/WebKit/mac/WebView/WebPDFView.mm index 10ba829..5c9f3b7 100644 --- a/Source/WebKit/mac/WebView/WebPDFView.mm +++ b/Source/WebKit/mac/WebView/WebPDFView.mm @@ -39,7 +39,6 @@ #import "WebFrameView.h" #import "WebLocalizableStringsInternal.h" #import "WebNSArrayExtras.h" -#import "WebNSAttributedStringExtras.h" #import "WebNSPasteboardExtras.h" #import "WebNSViewExtras.h" #import "WebPDFRepresentation.h" @@ -61,6 +60,7 @@ #import <WebCore/MouseEvent.h> #import <WebCore/PlatformKeyboardEvent.h> #import <WebCore/RuntimeApplicationChecks.h> +#import <WebCore/WebNSAttributedStringExtras.h> #import <wtf/Assertions.h> using namespace WebCore; @@ -924,7 +924,7 @@ static BOOL isFrameInRange(WebFrame *frame, DOMRange *range) if ([types containsObject:NSRTFPboardType]) { if ([attributedString containsAttachments]) - attributedString = [attributedString _web_attributedStringByStrippingAttachmentCharacters]; + attributedString = attributedStringByStrippingAttachmentCharacters(attributedString); NSData *RTFData = [attributedString RTFFromRange:NSMakeRange(0, [attributedString length]) documentAttributes:nil]; [pasteboard setData:RTFData forType:NSRTFPboardType]; diff --git a/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h index a2f176a..c5c101b 100644 --- a/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h +++ b/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h @@ -60,6 +60,7 @@ #define WebKitAllowAnimatedImagesPreferenceKey @"WebKitAllowAnimatedImagesPreferenceKey" #define WebKitAllowAnimatedImageLoopingPreferenceKey @"WebKitAllowAnimatedImageLoopingPreferenceKey" #define WebKitDisplayImagesKey @"WebKitDisplayImagesKey" +#define WebKitLoadSiteIconsKey @"WebKitLoadSiteIconsKey" #define WebKitBackForwardCacheExpirationIntervalKey @"WebKitBackForwardCacheExpirationIntervalKey" #define WebKitTabToLinksPreferenceKey @"WebKitTabToLinksPreferenceKey" #define WebKitPrivateBrowsingEnabledPreferenceKey @"WebKitPrivateBrowsingEnabled" diff --git a/Source/WebKit/mac/WebView/WebPreferences.mm b/Source/WebKit/mac/WebView/WebPreferences.mm index a5f24e0..e69a06b 100644 --- a/Source/WebKit/mac/WebView/WebPreferences.mm +++ b/Source/WebKit/mac/WebView/WebPreferences.mm @@ -42,6 +42,7 @@ NSString *WebPreferencesChangedNotification = @"WebPreferencesChangedNotification"; NSString *WebPreferencesRemovedNotification = @"WebPreferencesRemovedNotification"; +NSString *WebPreferencesChangedInternalNotification = @"WebPreferencesChangedInternalNotification"; #define KEY(x) (_private->identifier ? [_private->identifier stringByAppendingString:(x)] : (x)) @@ -232,7 +233,7 @@ static bool useQuickLookQuirks(void) [[self class] _setInstance:self forIdentifier:_private->identifier]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; return self; } @@ -345,6 +346,7 @@ static bool useQuickLookQuirks(void) [NSNumber numberWithBool:YES], WebKitAllowAnimatedImagesPreferenceKey, [NSNumber numberWithBool:YES], WebKitAllowAnimatedImageLoopingPreferenceKey, [NSNumber numberWithBool:YES], WebKitDisplayImagesKey, + [NSNumber numberWithBool:NO], WebKitLoadSiteIconsKey, @"1800", WebKitBackForwardCacheExpirationIntervalKey, [NSNumber numberWithBool:NO], WebKitTabToLinksPreferenceKey, [NSNumber numberWithBool:NO], WebKitPrivateBrowsingEnabledPreferenceKey, @@ -375,7 +377,7 @@ static bool useQuickLookQuirks(void) [NSNumber numberWithBool:YES], WebKitXSSAuditorEnabledPreferenceKey, [NSNumber numberWithBool:YES], WebKitAcceleratedCompositingEnabledPreferenceKey, [NSNumber numberWithBool:NO], WebKitAcceleratedDrawingEnabledPreferenceKey, - [NSNumber numberWithBool:YES], WebKitCanvasUsesAcceleratedDrawingPreferenceKey, + [NSNumber numberWithBool:NO], WebKitCanvasUsesAcceleratedDrawingPreferenceKey, [NSNumber numberWithBool:NO], WebKitShowDebugBordersPreferenceKey, [NSNumber numberWithBool:NO], WebKitShowRepaintCounterPreferenceKey, [NSNumber numberWithBool:NO], WebKitWebGLEnabledPreferenceKey, @@ -436,7 +438,7 @@ static bool useQuickLookQuirks(void) [_private->values setObject:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setObject:value forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (int)_integerValueForKey:(NSString *)key @@ -453,7 +455,7 @@ static bool useQuickLookQuirks(void) [_private->values _webkit_setInt:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setInteger:value forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (float)_floatValueForKey:(NSString *)key @@ -470,7 +472,7 @@ static bool useQuickLookQuirks(void) [_private->values _webkit_setFloat:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setFloat:value forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (BOOL)_boolValueForKey:(NSString *)key @@ -486,7 +488,7 @@ static bool useQuickLookQuirks(void) [_private->values _webkit_setBool:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setBool:value forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (long long)_longLongValueForKey:(NSString *)key @@ -503,7 +505,7 @@ static bool useQuickLookQuirks(void) [_private->values _webkit_setLongLong:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithLongLong:value] forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (unsigned long long)_unsignedLongLongValueForKey:(NSString *)key @@ -520,7 +522,7 @@ static bool useQuickLookQuirks(void) [_private->values _webkit_setUnsignedLongLong:value forKey:_key]; if (_private->autosaves) [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithUnsignedLongLong:value] forKey:_key]; - [self _postPreferencesChangesNotification]; + [self _postPreferencesChangedNotification]; } - (NSString *)standardFontFamily @@ -1173,16 +1175,25 @@ static bool useQuickLookQuirks(void) [self performSelector:@selector(_checkLastReferenceForIdentifier:) withObject:[self _concatenateKeyWithIBCreatorID:ident] afterDelay:0.1]; } -- (void)_postPreferencesChangesNotification +- (void)_postPreferencesChangedNotification { if (!pthread_main_np()) { [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO]; return; } - [[NSNotificationCenter defaultCenter] - postNotificationName:WebPreferencesChangedNotification object:self - userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedInternalNotification object:self userInfo:nil]; + [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil]; +} + +- (void)_postPreferencesChangedAPINotification +{ + if (!pthread_main_np()) { + [self performSelectorOnMainThread:_cmd withObject:nil waitUntilDone:NO]; + return; + } + + [[NSNotificationCenter defaultCenter] postNotificationName:WebPreferencesChangedNotification object:self userInfo:nil]; } + (CFStringEncoding)_systemCFStringEncoding @@ -1463,6 +1474,16 @@ static NSString *classIBCreatorID = nil; setWebKitLinkTimeVersion(version); } +- (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag +{ + [self _setBoolValue: flag forKey: WebKitLoadSiteIconsKey]; +} + +- (BOOL)loadsSiteIconsIgnoringImageLoadingPreference +{ + return [self _boolValueForKey: WebKitLoadSiteIconsKey]; +} + @end @implementation WebPreferences (WebInternal) diff --git a/Source/WebKit/mac/WebView/WebPreferencesPrivate.h b/Source/WebKit/mac/WebView/WebPreferencesPrivate.h index 7e1f6a2..e66604a 100644 --- a/Source/WebKit/mac/WebView/WebPreferencesPrivate.h +++ b/Source/WebKit/mac/WebView/WebPreferencesPrivate.h @@ -51,6 +51,7 @@ typedef enum { extern NSString *WebPreferencesChangedNotification; extern NSString *WebPreferencesRemovedNotification; +extern NSString *WebPreferencesChangedInternalNotification; @interface WebPreferences (WebPrivate) @@ -210,7 +211,8 @@ extern NSString *WebPreferencesRemovedNotification; - (void)setHyperlinkAuditingEnabled:(BOOL)enabled; // Other private methods -- (void)_postPreferencesChangesNotification; +- (void)_postPreferencesChangedNotification; +- (void)_postPreferencesChangedAPINotification; + (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier; + (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier; + (void)_removeReferenceForIdentifier:(NSString *)identifier; @@ -238,4 +240,7 @@ extern NSString *WebPreferencesRemovedNotification; - (BOOL)useQuickLookResourceCachingQuirks; +- (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag; +- (BOOL)loadsSiteIconsIgnoringImageLoadingPreference; + @end diff --git a/Source/WebKit/mac/WebView/WebScriptDebugger.h b/Source/WebKit/mac/WebView/WebScriptDebugger.h index 8f7fcaa..784a802 100644 --- a/Source/WebKit/mac/WebView/WebScriptDebugger.h +++ b/Source/WebKit/mac/WebView/WebScriptDebugger.h @@ -29,7 +29,7 @@ #ifndef WebScriptDebugger_h #define WebScriptDebugger_h -#include <collector/handles/Global.h> +#include <heap/Strong.h> #include <debugger/Debugger.h> #include <wtf/RetainPtr.h> @@ -69,7 +69,7 @@ private: bool m_callingDelegate; RetainPtr<WebScriptCallFrame> m_topCallFrame; - JSC::Global<JSC::JSGlobalObject> m_globalObject; + JSC::Strong<JSC::JSGlobalObject> m_globalObject; RetainPtr<WebScriptCallFrame> m_globalCallFrame; }; diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm index 3d42be0..c36acb9 100644 --- a/Source/WebKit/mac/WebView/WebView.mm +++ b/Source/WebKit/mac/WebView/WebView.mm @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. * Copyright (C) 2006 David Smith (catfish.man@gmail.com) * Copyright (C) 2010 Igalia S.L * @@ -148,6 +148,7 @@ #import <WebCore/RenderWidget.h> #import <WebCore/ResourceHandle.h> #import <WebCore/ResourceLoadScheduler.h> +#import <WebCore/ResourceRequest.h> #import <WebCore/RuntimeApplicationChecks.h> #import <WebCore/SchemeRegistry.h> #import <WebCore/ScriptController.h> @@ -179,10 +180,6 @@ #import <wtf/StdLibExtras.h> #import <wtf/Threading.h> -#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) -#import <AppKit/NSTextChecker.h> -#endif - #if ENABLE(DASHBOARD_SUPPORT) #import <WebKit/WebDashboardRegion.h> #endif @@ -639,17 +636,39 @@ static bool shouldEnableLoadDeferring() return _private->usesDocumentViews; } -static NSString *leakMailQuirksUserScriptPath() +static NSString *leakMailQuirksUserScriptContents() { NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"MailQuirksUserScript" ofType:@"js"]; - return [[NSString alloc] initWithContentsOfFile:scriptPath]; + NSStringEncoding encoding; + return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0]; } - (void)_injectMailQuirksScript { - static NSString *mailQuirksScriptPath = leakMailQuirksUserScriptPath(); + static NSString *mailQuirksScriptContents = leakMailQuirksUserScriptContents(); + core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), + mailQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); +} + +static bool needsOutlookQuirksScript() +{ + static bool isOutlookNeedingQuirksScript = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_HTML5_PARSER) + && applicationIsMicrosoftOutlook(); + return isOutlookNeedingQuirksScript; +} + +static NSString *leakOutlookQuirksUserScriptContents() +{ + NSString *scriptPath = [[NSBundle bundleForClass:[WebView class]] pathForResource:@"OutlookQuirksUserScript" ofType:@"js"]; + NSStringEncoding encoding; + return [[NSString alloc] initWithContentsOfFile:scriptPath usedEncoding:&encoding error:0]; +} + +-(void)_injectOutlookQuirksScript +{ + static NSString *outlookQuirksScriptContents = leakOutlookQuirksUserScriptContents(); core(self)->group().addUserScriptToWorld(core([WebScriptWorld world]), - mailQuirksScriptPath, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); + outlookQuirksScriptContents, KURL(), 0, 0, InjectAtDocumentEnd, InjectInAllFrames); } - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName usesDocumentViews:(BOOL)usesDocumentViews @@ -720,6 +739,11 @@ static NSString *leakMailQuirksUserScriptPath() _private->page->setCanStartMedia([self window]); _private->page->settings()->setLocalStorageDatabasePath([[self preferences] _localStorageDatabasePath]); + if (needsOutlookQuirksScript()) { + _private->page->settings()->setShouldInjectUserScriptsInInitialEmptyDocument(true); + [self _injectOutlookQuirksScript]; + } + [WebFrame _createMainFrameWithPage:_private->page frameName:frameName frameView:frameView]; #ifndef BUILDING_ON_TIGER @@ -752,10 +776,10 @@ static NSString *leakMailQuirksUserScriptPath() WebPreferences *prefs = [self preferences]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) - name:WebPreferencesChangedNotification object:prefs]; + name:WebPreferencesChangedInternalNotification object:prefs]; - // Post a notification so the WebCore settings update. - [[self preferences] _postPreferencesChangesNotification]; + [self _preferencesChanged:[self preferences]]; + [[self preferences] _postPreferencesChangedAPINotification]; if (!WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITH_LOCAL_RESOURCE_SECURITY_RESTRICTION)) { // Originally, we allowed all local loads. @@ -1272,10 +1296,16 @@ static bool fastDocumentTeardownEnabled() - (NSMenu *)_menuForElement:(NSDictionary *)element defaultItems:(NSArray *)items { NSArray *defaultMenuItems = [[WebDefaultUIDelegate sharedUIDelegate] webView:self contextMenuItemsForElement:element defaultMenuItems:items]; - - NSArray *menuItems = CallUIDelegate(self, @selector(webView:contextMenuItemsForElement:defaultMenuItems:), element, defaultMenuItems); - if (!menuItems) - return nil; + NSArray *menuItems = defaultMenuItems; + + // CallUIDelegate returns nil if UIDelegate is nil or doesn't respond to the selector. So we need to check that here + // to distinguish between using defaultMenuItems or the delegate really returning nil to say "no context menu". + SEL selector = @selector(webView:contextMenuItemsForElement:defaultMenuItems:); + if (_private->UIDelegate && [_private->UIDelegate respondsToSelector:selector]) { + menuItems = CallUIDelegate(self, selector, element, defaultMenuItems); + if (!menuItems) + return nil; + } unsigned count = [menuItems count]; if (!count) @@ -1416,8 +1446,12 @@ static bool fastDocumentTeardownEnabled() - (void)_preferencesChangedNotification:(NSNotification *)notification { WebPreferences *preferences = (WebPreferences *)[notification object]; + [self _preferencesChanged:preferences]; +} + +- (void)_preferencesChanged:(WebPreferences *)preferences +{ ASSERT(preferences == [self preferences]); - if (!_private->userAgentOverridden) _private->userAgent = String(); @@ -1459,6 +1493,7 @@ static bool fastDocumentTeardownEnabled() settings->setSerifFontFamily([preferences serifFontFamily]); settings->setStandardFontFamily([preferences standardFontFamily]); settings->setLoadsImagesAutomatically([preferences loadsImagesAutomatically]); + settings->setLoadsSiteIconsIgnoringImageLoadingSetting([preferences loadsSiteIconsIgnoringImageLoadingPreference]); settings->setShouldPrintBackgrounds([preferences shouldPrintBackgrounds]); settings->setTextAreasAreResizable([preferences textAreasAreResizable]); settings->setShrinksStandaloneImagesToFit([preferences shrinksStandaloneImagesToFit]); @@ -2262,8 +2297,9 @@ static inline IMP getMethod(id o, SEL s) { _private->usesPageCache = usesPageCache; - // Post a notification so the WebCore settings update. - [[self preferences] _postPreferencesChangesNotification]; + // Update our own settings and post the public notification only + [self _preferencesChanged:[self preferences]]; + [[self preferences] _postPreferencesChangedAPINotification]; } - (WebHistoryItem *)_globalHistoryItem @@ -2790,6 +2826,16 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) _private->page->settings()->setMinDOMTimerInterval(intervalInSeconds); } ++ (BOOL)_HTTPPipeliningEnabled +{ + return ResourceRequest::httpPipeliningEnabled(); +} + ++ (void)_setHTTPPipeliningEnabled:(BOOL)enabled +{ + ResourceRequest::setHTTPPipeliningEnabled(enabled); +} + @end @implementation _WebSafeForwarder @@ -2848,7 +2894,7 @@ static PassOwnPtr<Vector<String> > toStringVector(NSArray* patterns) WTF::initializeMainThreadToProcessMainThread(); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_applicationWillTerminate) name:NSApplicationWillTerminateNotification object:NSApp]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) name:WebPreferencesChangedInternalNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesRemovedNotification:) name:WebPreferencesRemovedNotification object:nil]; continuousSpellCheckingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:WebContinuousSpellCheckingEnabled]; @@ -3353,15 +3399,16 @@ static bool needsWebViewInitThreadWorkaround() WebPreferences *oldPrefs = _private->preferences; - [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedNotification object:[self preferences]]; + [[NSNotificationCenter defaultCenter] removeObserver:self name:WebPreferencesChangedInternalNotification object:[self preferences]]; [WebPreferences _removeReferenceForIdentifier:[oldPrefs identifier]]; _private->preferences = [prefs retain]; // After registering for the notification, post it so the WebCore settings update. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_preferencesChangedNotification:) - name:WebPreferencesChangedNotification object:[self preferences]]; - [[self preferences] _postPreferencesChangesNotification]; + name:WebPreferencesChangedInternalNotification object:[self preferences]]; + [self _preferencesChanged:[self preferences]]; + [[self preferences] _postPreferencesChangedAPINotification]; [oldPrefs didRemoveFromWebView]; [oldPrefs release]; @@ -5964,7 +6011,7 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_retrieveKeyboardUIModeFromPreferences:) - name:WebPreferencesChangedNotification object:nil]; + name:WebPreferencesChangedInternalNotification object:nil]; } return _private->_keyboardUIMode; } diff --git a/Source/WebKit/mac/WebView/WebViewInternal.h b/Source/WebKit/mac/WebView/WebViewInternal.h index 65cb4d8..aeef7eb 100644 --- a/Source/WebKit/mac/WebView/WebViewInternal.h +++ b/Source/WebKit/mac/WebView/WebViewInternal.h @@ -183,6 +183,8 @@ namespace WebCore { - (void)_setInsertionPasteboard:(NSPasteboard *)pasteboard; +- (void)_preferencesChanged:(WebPreferences *)preferences; + #if ENABLE(VIDEO) && defined(__cplusplus) - (void)_enterFullscreenForNode:(WebCore::Node*)node; - (void)_exitFullscreen; diff --git a/Source/WebKit/mac/WebView/WebViewPrivate.h b/Source/WebKit/mac/WebView/WebViewPrivate.h index 7d7537e..fa4844f 100644 --- a/Source/WebKit/mac/WebView/WebViewPrivate.h +++ b/Source/WebKit/mac/WebView/WebViewPrivate.h @@ -594,6 +594,22 @@ Could be worth adding to the API. */ - (void)_setMinimumTimerInterval:(double)intervalInSeconds; +/*! + @method _HTTPPipeliningEnabled + @abstract Checks the HTTP pipelining status. + @discussion Defaults to NO. + @result YES if HTTP pipelining is enabled, NO if not enabled. + */ ++ (BOOL)_HTTPPipeliningEnabled; + +/*! + @method _setHTTPPipeliningEnabled: + @abstract Set the HTTP pipelining status. + @discussion Defaults to NO. + @param enabled The new HTTP pipelining status. + */ ++ (void)_setHTTPPipeliningEnabled:(BOOL)enabled; + @end @interface WebView (WebViewPrintingPrivate) diff --git a/Source/WebKit/qt/Api/qwebframe.cpp b/Source/WebKit/qt/Api/qwebframe.cpp index e5124bd..026a7df 100644 --- a/Source/WebKit/qt/Api/qwebframe.cpp +++ b/Source/WebKit/qt/Api/qwebframe.cpp @@ -313,7 +313,7 @@ void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, con #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) renderCompositedLayers(context, IntRect(clip.boundingRect())); - renderRelativeCoords(context, (QWebFrame::RenderLayer)(QWebFrame::ScrollBarLayer | QWebFrame::PanIconLayer), clip); + renderFrameExtras(context, QFlags<QWebFrame::RenderLayer>(QWebFrame::ScrollBarLayer) | QWebFrame::PanIconLayer, clip); #endif } #endif @@ -342,7 +342,7 @@ void QWebFramePrivate::renderCompositedLayers(GraphicsContext* context, const In } #endif -void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip) +void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QFlags<QWebFrame::RenderLayer> layers, const QRegion& clip) { if (!frame->view() || !frame->contentRenderer()) return; @@ -356,7 +356,7 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: WebCore::FrameView* view = frame->view(); view->updateLayoutAndStyleIfNeededRecursive(); - if (layer & QWebFrame::ContentsLayer) { + if (layers & QWebFrame::ContentsLayer) { for (int i = 0; i < vector.size(); ++i) { const QRect& clipRect = vector.at(i); @@ -385,47 +385,67 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: renderCompositedLayers(context, IntRect(clip.boundingRect())); #endif } - if (layer & (QWebFrame::PanIconLayer | QWebFrame::ScrollBarLayer)) { - for (int i = 0; i < vector.size(); ++i) { - const QRect& clipRect = vector.at(i); + renderFrameExtras(context, layers, clip); +#if ENABLE(INSPECTOR) + if (frame->page()->inspectorController()->highlightedNode()) { + context->save(); + frame->page()->inspectorController()->drawNodeHighlight(*context); + context->restore(); + } +#endif +} - QRect intersectedRect = clipRect.intersected(view->frameRect()); +void QWebFramePrivate::renderFrameExtras(GraphicsContext* context, QFlags<QWebFrame::RenderLayer> layers, const QRegion& clip) +{ + if (!(layers & (QWebFrame::PanIconLayer | QWebFrame::ScrollBarLayer))) + return; + QPainter* painter = context->platformContext(); + WebCore::FrameView* view = frame->view(); + QVector<QRect> vector = clip.rects(); + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); - painter->save(); - painter->setClipRect(clipRect, Qt::IntersectClip); + QRect intersectedRect = clipRect.intersected(view->frameRect()); - int x = view->x(); - int y = view->y(); + painter->save(); + painter->setClipRect(clipRect, Qt::IntersectClip); - if (layer & QWebFrame::ScrollBarLayer - && !view->scrollbarsSuppressed() - && (view->horizontalScrollbar() || view->verticalScrollbar())) { - QRect rect = intersectedRect; - context->translate(x, y); - rect.translate(-x, -y); + int x = view->x(); + int y = view->y(); - view->paintScrollbars(context, rect); + if (layers & QWebFrame::ScrollBarLayer + && !view->scrollbarsSuppressed() + && (view->horizontalScrollbar() || view->verticalScrollbar())) { - context->translate(-x, -y); - } + QRect rect = intersectedRect; + context->translate(x, y); + rect.translate(-x, -y); + view->paintScrollbars(context, rect); + context->translate(-x, -y); + } #if ENABLE(PAN_SCROLLING) - if (layer & QWebFrame::PanIconLayer) - view->paintPanScrollIcon(context); + if (layers & QWebFrame::PanIconLayer) + view->paintPanScrollIcon(context); #endif - painter->restore(); - } + painter->restore(); } } -void QWebFrame::orientationChanged() +void QWebFramePrivate::emitUrlChanged() +{ + url = frame->document()->url(); + emit q->urlChanged(url); +} + +void QWebFramePrivate::_q_orientationChanged() { #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) int orientation; - WebCore::Frame* frame = QWebFramePrivate::core(this); + WebCore::Frame* frame = core(q); - switch (d->m_orientation.reading()->orientation()) { + switch (m_orientation.reading()->orientation()) { case QtMobility::QOrientationReading::TopUp: orientation = 0; break; @@ -522,7 +542,7 @@ QWebFrame::QWebFrame(QWebPage *parent, QWebFrameData *frameData) d->frame->loader()->load(request, frameData->name, false); } #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) - connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); + connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(_q_orientationChanged())); d->m_orientation.start(); #endif } @@ -534,7 +554,7 @@ QWebFrame::QWebFrame(QWebFrame *parent, QWebFrameData *frameData) d->page = parent->d->page; d->init(this, frameData); #if ENABLE(ORIENTATION_EVENTS) && ENABLE(DEVICE_ORIENTATION) - connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(orientationChanged())); + connect(&d->m_orientation, SIGNAL(readingChanged()), this, SLOT(_q_orientationChanged())); d->m_orientation.start(); #endif } @@ -678,7 +698,7 @@ QString QWebFrame::renderTreeDump() const QString QWebFrame::title() const { if (d->frame->document()) - return d->frame->loader()->documentLoader()->title(); + return d->frame->loader()->documentLoader()->title().string(); return QString(); } @@ -729,6 +749,17 @@ QMultiMap<QString, QString> QWebFrame::metaData() const return map; } +static inline void clearCoreFrame(WebCore::Frame* frame) +{ + frame->loader()->activeDocumentLoader()->writer()->begin(); + frame->loader()->activeDocumentLoader()->writer()->end(); +} + +static inline bool isCoreFrameClear(WebCore::Frame* frame) +{ + return frame->document()->url().isEmpty(); +} + static inline QUrl ensureAbsoluteUrl(const QUrl &url) { if (!url.isValid() || !url.isRelative()) @@ -758,15 +789,15 @@ static inline QUrl ensureAbsoluteUrl(const QUrl &url) void QWebFrame::setUrl(const QUrl &url) { + clearCoreFrame(d->frame); const QUrl absolute = ensureAbsoluteUrl(url); - d->frame->loader()->activeDocumentLoader()->writer()->begin(absolute); - d->frame->loader()->activeDocumentLoader()->writer()->end(); + d->url = absolute; load(absolute); } QUrl QWebFrame::url() const { - return d->frame->document()->url(); + return d->url; } /*! @@ -791,7 +822,9 @@ QUrl QWebFrame::requestedUrl() const QUrl QWebFrame::baseUrl() const { - return d->frame->loader()->baseURL(); + if (isCoreFrameClear(d->frame)) + return QUrl(d->url).resolved(QUrl()); + return d->frame->document()->baseURL(); } /*! @@ -1913,3 +1946,5 @@ QWebFrame *QWebHitTestResult::frame() const return 0; return d->frame; } + +#include "moc_qwebframe.cpp" diff --git a/Source/WebKit/qt/Api/qwebframe.h b/Source/WebKit/qt/Api/qwebframe.h index 8410962..3c5a28e 100644 --- a/Source/WebKit/qt/Api/qwebframe.h +++ b/Source/WebKit/qt/Api/qwebframe.h @@ -205,9 +205,6 @@ public Q_SLOTS: void print(QPrinter *printer) const; #endif -private Q_SLOTS: - void orientationChanged(); - Q_SIGNALS: void javaScriptWindowObjectCleared(); @@ -237,6 +234,7 @@ private: friend class WebCore::ChromeClientQt; friend class WebCore::PlatformLayerProxyQt; QWebFramePrivate *d; + Q_PRIVATE_SLOT(d, void _q_orientationChanged()) }; #endif diff --git a/Source/WebKit/qt/Api/qwebframe_p.h b/Source/WebKit/qt/Api/qwebframe_p.h index ee8c463..4108972 100644 --- a/Source/WebKit/qt/Api/qwebframe_p.h +++ b/Source/WebKit/qt/Api/qwebframe_p.h @@ -96,20 +96,25 @@ public: static WebCore::Frame* core(const QWebFrame*); static QWebFrame* kit(const WebCore::Frame*); - void renderRelativeCoords(WebCore::GraphicsContext*, QWebFrame::RenderLayer, const QRegion& clip); + void renderRelativeCoords(WebCore::GraphicsContext*, QFlags<QWebFrame::RenderLayer>, const QRegion& clip); #if ENABLE(TILED_BACKING_STORE) void renderFromTiledBackingStore(WebCore::GraphicsContext*, const QRegion& clip); #endif #if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) - void renderCompositedLayers(WebCore::GraphicsContext* context, const WebCore::IntRect& clip); + void renderCompositedLayers(WebCore::GraphicsContext*, const WebCore::IntRect& clip); #endif + void renderFrameExtras(WebCore::GraphicsContext*, QFlags<QWebFrame::RenderLayer>, const QRegion& clip); + void emitUrlChanged(); + void _q_orientationChanged(); + QWebFrame *q; Qt::ScrollBarPolicy horizontalScrollBarPolicy; Qt::ScrollBarPolicy verticalScrollBarPolicy; WebCore::FrameLoaderClientQt *frameLoaderClient; WebCore::Frame *frame; QWebPage *page; + WebCore::KURL url; bool allowsScrolling; int marginWidth; diff --git a/Source/WebKit/qt/Api/qwebkitplatformplugin.h b/Source/WebKit/qt/Api/qwebkitplatformplugin.h index f274a0b..9a84973 100644 --- a/Source/WebKit/qt/Api/qwebkitplatformplugin.h +++ b/Source/WebKit/qt/Api/qwebkitplatformplugin.h @@ -29,7 +29,7 @@ #include <QColor> #include <QObject> #include <QUrl> -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA #include <QMediaPlayer> #endif @@ -123,7 +123,7 @@ public: virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; }; -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA class QWebFullScreenVideoHandler : public QObject { Q_OBJECT public: diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp index ac1d562..2f51e6f 100644 --- a/Source/WebKit/qt/Api/qwebpage.cpp +++ b/Source/WebKit/qt/Api/qwebpage.cpp @@ -747,7 +747,7 @@ void QWebPagePrivate::handleClipboard(QEvent* ev, Qt::MouseButton button) WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame(); if (button == Qt::LeftButton) { if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) { - focusFrame->editor()->copy(); + Pasteboard::generalPasteboard()->writeSelection(focusFrame->editor()->selectedRange().get(), focusFrame->editor()->canSmartCopyOrDelete(), focusFrame); ev->setAccepted(true); } } else if (button == Qt::MidButton) { @@ -979,8 +979,7 @@ void QWebPagePrivate::dragEnterEvent(T* ev) QCursor::pos(), dropActionToDragOp(ev->possibleActions())); Qt::DropAction action = dragOpToDropAction(page->dragController()->dragEntered(&dragData)); ev->setDropAction(action); - if (action != Qt::IgnoreAction) - ev->acceptProposedAction(); + ev->acceptProposedAction(); #endif } diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog index 1a922ad..97d648d 100644 --- a/Source/WebKit/qt/ChangeLog +++ b/Source/WebKit/qt/ChangeLog @@ -1,3 +1,671 @@ +2011-04-19 Igor Oliveira <igor.oliveira@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] X11: Text selection is causing oncopy event to be called + https://bugs.webkit.org/show_bug.cgi?id=58656 + + Always when text is selected the oncopy event is fired, this behavior does + not exist in Firefox or Chrome. Now, when selecting a text, QtWebKit + is making multi part-copies (with rich text metadata), the multi-part + data can be obtained by data transfer items interface when supported by QtWebKit. + Also, copies to the clipboard of a selected image, is not supported by Chrome and + Firefox and was removed from QtWebKit. + + + * Api/qwebpage.cpp: + (QWebPagePrivate::handleClipboard): + +2011-04-18 Csaba Osztrogonác <ossy@webkit.org> + + [Qt][WK2] Unreviewed buildfix after r84174. + + * QtWebKit.pro: Missing includepath added. + +2011-04-18 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt][Symbian] Fix Api test failure -- tst_QWebFrame::inputFieldFocus + https://bugs.webkit.org/show_bug.cgi?id=57546 + + Disable the fullscreen VKB when testing inputFieldFocus(). + + * tests/qwebframe/tst_qwebframe.cpp: + +2011-04-18 Andreas Kling <kling@webkit.org> + + [Qt] DRT: Unreviewed test fix after r84168. + + Dump the original request KURL for blocked access attempts. + Turns out converting it to a QUrl lower-cases the hostname. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + +2011-04-18 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] Fix Api tests for QWebPage on Symbian + https://bugs.webkit.org/show_bug.cgi?id=56924 + + Ignores the style attribute that selectedHtml() returns. + + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::cursorMovements): + (tst_QWebPage::textSelection): + (tst_QWebPage::findText): + +2011-04-18 Andreas Kling <kling@webkit.org> + + Reviewed by Adam Barth. + + REGRESSION (r84010): [Qt] DRT: Unbreak redirection of http:/ URLs. + https://bugs.webkit.org/show_bug.cgi?id=58779 + + KURL::host() doesn't return the host part of [broken] http:/ URLs, so use + QUrl instead to match the behavior of other ports. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + +2011-04-18 Dominic Cooney <dominicc@chromium.org> + + Reviewed by Andreas Kling. + + Add layoutTestController.shadowRoot to Qt DRT. + https://bugs.webkit.org/show_bug.cgi?id=58759 + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::shadowRoot): Added. + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2011-04-16 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] Autotest got missed in the handover of the QML WebView element + https://bugs.webkit.org/show_bug.cgi?id=41449 + + Importing WebView QML element test cases from Qt repository. I did some + style modifications and simplifications in the original code but hopefully + without changing the behavior. + + Tests that do not pass are marked with QEXPECT_FAIL or QSKIP. The two major + issues currently are: + + - pixelCache() test checked the usage of pixel cache by using a subclass of + QDeclarativeWebView. We can't do that right now because this class is not + exported. We may need a Q_AUTOTEST_EXPORT thing for QtWebKit if we want + this kind of test. + - elementAtArea() test uses a function that is not exported. But in this case + I think we should test it's user, the public method "heuristicZoom". + + * tests/qdeclarativewebview/resources/basic.html: Added. + * tests/qdeclarativewebview/resources/basic.png: Added. + * tests/qdeclarativewebview/resources/basic.qml: Added. + * tests/qdeclarativewebview/resources/elements.html: Added. + * tests/qdeclarativewebview/resources/elements.qml: Added. + * tests/qdeclarativewebview/resources/forward.html: Added. + * tests/qdeclarativewebview/resources/forward.png: Added. + * tests/qdeclarativewebview/resources/javaScript.html: Added. + * tests/qdeclarativewebview/resources/javaScript.qml: Added. + * tests/qdeclarativewebview/resources/loadError.qml: Added. + * tests/qdeclarativewebview/resources/newwindows.html: Added. + * tests/qdeclarativewebview/resources/newwindows.qml: Added. + * tests/qdeclarativewebview/resources/propertychanges.qml: Added. + * tests/qdeclarativewebview/resources/sethtml.qml: Added. + * tests/qdeclarativewebview/tst_qdeclarativewebview.cpp: + (tst_QDeclarativeWebView::tmpDir): + (strippedHtml): + (fileContents): + (removeRecursive): + (tst_QDeclarativeWebView::cleanupTestCase): + (tst_QDeclarativeWebView::basicProperties): + (tst_QDeclarativeWebView::elementAreaAt): + (tst_QDeclarativeWebView::historyNav): + (callEvaluateJavaScript): + (tst_QDeclarativeWebView::javaScript): + (tst_QDeclarativeWebView::loadError): + (tst_QDeclarativeWebView::multipleWindows): + (tst_QDeclarativeWebView::newWindowComponent): + (tst_QDeclarativeWebView::newWindowParent): + (tst_QDeclarativeWebView::pressGrabTime): + (tst_QDeclarativeWebView::renderingEnabled): + (tst_QDeclarativeWebView::setHtml): + (tst_QDeclarativeWebView::settings): + (tst_QDeclarativeWebView::checkNoErrors): + * tests/qdeclarativewebview/tst_qdeclarativewebview.qrc: + +2011-04-08 Luiz Agostini <luiz.agostini@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] QWebPage MIME type handling inconsistency with other web browsers + https://bugs.webkit.org/show_bug.cgi?id=46968 + + Implementing mime type sniffing based on + http://tools.ietf.org/html/draft-abarth-mime-sniff-06. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::createNetworkingContext): + * WebCoreSupport/FrameNetworkingContextQt.cpp: + (WebCore::FrameNetworkingContextQt::FrameNetworkingContextQt): + (WebCore::FrameNetworkingContextQt::create): + (WebCore::FrameNetworkingContextQt::MIMESniffingEnabled): + * WebCoreSupport/FrameNetworkingContextQt.h: + * tests/MIMESniffing/MIMESniffing.pro: Added. + * tests/MIMESniffing/TestData.h: Added. + * tests/MIMESniffing/resources.qrc: Added. + * tests/MIMESniffing/resources/application_atom+xml: Added. + * tests/MIMESniffing/resources/application_ogg: Added. + * tests/MIMESniffing/resources/application_pdf: Added. + * tests/MIMESniffing/resources/application_postscript: Added. + * tests/MIMESniffing/resources/application_rdf+xml: Added. + * tests/MIMESniffing/resources/application_rss+xml: Added. + * tests/MIMESniffing/resources/application_x-gzip: Added. + * tests/MIMESniffing/resources/application_x-rar-compressed: Added. + * tests/MIMESniffing/resources/application_zip: Added. + * tests/MIMESniffing/resources/audio_x-wave: Added. + * tests/MIMESniffing/resources/image_bmp: Added. + * tests/MIMESniffing/resources/image_gif: Added. + * tests/MIMESniffing/resources/image_jpeg: Added. + * tests/MIMESniffing/resources/image_png: Added. + * tests/MIMESniffing/resources/image_vnd.microsoft.icon: Added. + * tests/MIMESniffing/resources/image_webp: Added. + * tests/MIMESniffing/resources/text_html: Added. + * tests/MIMESniffing/resources/text_xml: Added. + * tests/MIMESniffing/resources/video_webm: Added. + * tests/MIMESniffing/tst_MIMESniffing.cpp: Added. + (tst_MIMESniffing::tst_MIMESniffing): + (errorText): + (tst_MIMESniffing::testCase1): + * tests/tests.pro: + +2011-04-15 Andreas Kling <kling@webkit.org> + + Reviewed by Antonio Gomes. + + [Qt] DRT: Block access to external URLs. + + Implement the "Blocked access to external URL" behavior for Qt's DRT, + based on what other ports are doing. + + Fixes <http://webkit.org/b/57306> and <http://webkit.org/b/58523>. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + +2011-01-26 Ragner Magalhaes <ragner.magalhaes@openbossa.org> + + Reviewed by Antonio Gomes. + + [Qt] Web Inspector does not highlight elements + https://bugs.webkit.org/show_bug.cgi?id=35125 + + Adjust Web inspector to highlight elements on the page when the mouse + hovers the element on DOM inspector. + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderRelativeCoords): + * WebCoreSupport/InspectorClientQt.cpp: + (WebCore::InspectorClientQt::highlight): + (WebCore::InspectorClientQt::hideHighlight): + +2011-04-12 George Guo <George.Guo@nokia.com> + + Reviewed by Laszlo Gombos. + + [Qt] On Symbian got "Update Error" when installing QtWebkit.sis + http://bugs.webkit.org/show_bug.cgi?id=58141 + + If QtWebKit is already in Symbian ROM, we need package to be + both SA and RU type + + * QtWebKit.pro: + +2011-04-12 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] Private Q_SLOTS void orientationChanged() can't be in qwebframe.h public header file. + https://bugs.webkit.org/show_bug.cgi?id=58251 + + Fix an issue with slot names after http://trac.webkit.org/changeset/83512. + + * Api/qwebframe.cpp: + (QWebFrame::QWebFrame): + +2011-04-11 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Benjamin Poulain. + + [Qt] Private Q_SLOTS void orientationChanged() can't be in qwebframe.h public header file. + https://bugs.webkit.org/show_bug.cgi?id=58251 + + Qt coding conventions states that private slots should be located in private implementation of + the class. This allows us to rename/delete the slots in the future without breaking anything. + + No new tests added, just a simple refactoring. + + * Api/qwebframe.cpp: + (QWebFramePrivate::_q_orientationChanged): + * Api/qwebframe.h: + * Api/qwebframe_p.h: + +2011-04-11 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Sub-Frame content is not updated when scrolling in certain circumstances + https://bugs.webkit.org/show_bug.cgi?id=50373 + + Make sure that we invalidate the backing store when using TILED_BACKING_STORE + and the page contains sub frames. This bug appears only when frame flattening is + disabled and scrollable subframes. + + Original patch from Thomas Thrainer. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::invalidateWindow): + +2011-04-11 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Andreas Kling. + + [Qt] HTML5 Drag and Drop demos not working + https://bugs.webkit.org/show_bug.cgi?id=56486 + + Handling the drop with JavaScript was not working with Qt because if the action is ignored + in response to DragEnter, no further events are sent to the view. + + Drag and drop is defined and used differently by webpages. The drag move events are determining + what action should take place. To adopt this behavior for Qt, we always accept drag enter events + on the widget. + + * Api/qwebpage.cpp: + (QWebPagePrivate::dragEnterEvent): + +2011-04-11 Andras Becsi <abecsi@webkit.org> + + Reviewed by Andreas Kling. + + [Qt] REGRESSION(83122): tst_QWebElement::style() fails + https://bugs.webkit.org/show_bug.cgi?id=58032 + + According to the documentation of QWebElement the styleProperty method should + not respect style inheritance and other CSS rules for the InlineStyle enum. + + r83122 fixed this behaviour. + + * tests/qwebelement/tst_qwebelement.cpp: + (tst_QWebElement::style): Fix the expected color for QWebElement::InlineStyle. + +2011-04-11 Andreas Kling <andreas.kling@nokia.com> + + Build fix after r83436. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): + +2011-04-11 Andreas Kling <andreas.kling@nokia.com> + + Reviewed by Benjamin Poulain. + + [Qt] dumpResourceResponseMIMETypes shouldn't strip URL query string. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveResponse): Use KURL::lastPathComponent() + for the dumpResourceResponseMIMETypes display string instead of QFileInfo::fileName(). + This is in line with the Mac port. + +2011-04-08 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r83295. + http://trac.webkit.org/changeset/83295 + https://bugs.webkit.org/show_bug.cgi?id=58144 + + Broke 4 tests in QtWebKit (Requested by tonikitoo on #webkit). + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleInputMethodKeydown): + +2011-04-08 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Antonio Gomes. + + [Qt]REGRESSION(r82243): fast/events/onsearch-enter.html fails + https://bugs.webkit.org/show_bug.cgi?id=57472 + + Avoid to insert new line for both keydown event & keypress event. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleInputMethodKeydown): + +2011-04-07 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> + + Reviewed by Benjamin Poulain. + + [Qt] QWebFrame::setUrl works only from second time if url fragment is present + https://bugs.webkit.org/show_bug.cgi?id=32723 + + When clearing the frame, instead of using the URL passed to QWebFrame::setUrl(), + use an invalid URL (the begin() without arguments). Clearing the document + with the same URL was causing problems when we had a fragment because it assume that + only scrolling was enough and did not loaded the document again. + + When setUrl() is called but fails, url() is expected to return the requested value. The + begin(url) guaranteed that before. This patch adds a member to track the URL, which is + updated when the URL changes and also when setUrl() is called. + + KURL was used for the member so that when setUrl() is called, and then url() is checked + before the page gets loaded, we perform the same conversion that will be performed by a + successful load, e.g. add trailing '/' to an address. This behavior is checked by + tst_QWebFrame::requestedUrl() test. + + For the record: the second QWebPage::setUrl() worked because the load was considered a + FrameLoadTypeSame, and because of that, was not fit for just scrolling, a reload was + needed. See FrameLoader::shouldScrollToAnchor() for details on this classification. + + * Api/qwebframe.cpp: + (QWebFramePrivate::emitUrlChanged): update our URL member and emit the signal. + (clearCoreFrame): + (isCoreFrameClear): + (QWebFrame::setUrl): + (QWebFrame::url): + (QWebFrame::baseUrl): look in the document for the baseURL since its contents can change + the baseURL, e.g. by using the <base> tag. + * Api/qwebframe_p.h: + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidChangeLocationWithinPage): + (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad): + + * tests/qwebframe/tst_qwebframe.cpp: + (tst_QWebFrame::setUrlWithFragment): unskip test. + +2011-04-07 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + Build fix when using Phonon as a backend for the multimedia support. + + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + * WebCoreSupport/ChromeClientQt.h: + +2011-04-06 Benjamin Poulain <benjamin.poulain@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] LayoutTestController needs to implement numberOfPendingGeolocationPermissionRequests + https://bugs.webkit.org/show_bug.cgi?id=56086 + + Add the accessor numberOfPendingGeolocationPermissionRequests to call GeolocationClientMock::numberOfPendingPermissionRequests() + from the LayoutTestController. + + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests): + * WebCoreSupport/DumpRenderTreeSupportQt.h: + +2011-04-06 Anders Bakken <agbakken@gmail.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] FrameLoaderClientQt.cpp has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40254 + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (drtDescriptionSuitableForTestResult): + (WebCore::FrameLoaderClientQt::hasWebView): + (WebCore::FrameLoaderClientQt::setCopiesOnScroll): + (WebCore::FrameLoaderClientQt::dispatchDidHandleOnloadEvents): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientQt::dispatchDidChangeIcons): + (WebCore::FrameLoaderClientQt::cancelPolicyCheck): + (WebCore::FrameLoaderClientQt::dispatchWillSubmitForm): + (WebCore::FrameLoaderClientQt::postProgressStartedNotification): + (WebCore::FrameLoaderClientQt::postProgressFinishedNotification): + (WebCore::FrameLoaderClientQt::setMainFrameDocumentReady): + (WebCore::FrameLoaderClientQt::willChangeTitle): + (WebCore::FrameLoaderClientQt::didChangeTitle): + (WebCore::FrameLoaderClientQt::finishedLoading): + (WebCore::FrameLoaderClientQt::frameLoadCompleted): + (WebCore::FrameLoaderClientQt::provisionalLoadStarted): + (WebCore::FrameLoaderClientQt::didFinishLoad): + (WebCore::FrameLoaderClientQt::setTitle): + (WebCore::FrameLoaderClientQt::dispatchDidReceiveIcon): + (WebCore::FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld): + (WebCore::FrameLoaderClientQt::updateGlobalHistory): + (WebCore::FrameLoaderClientQt::shouldGoToHistoryItem): + (WebCore::FrameLoaderClientQt::shouldStopLoadingForHistoryItem): + (WebCore::FrameLoaderClientQt::committedLoad): + (WebCore::FrameLoaderClientQt::download): + (WebCore::FrameLoaderClientQt::dispatchWillSendRequest): + (WebCore::FrameLoaderClientQt::shouldUseCredentialStorage): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForResponse): + (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction): + (WebCore::FrameLoaderClientQt::createFrame): + (WebCore::FrameLoaderClientQt::objectContentType): + (WebCore::FrameLoaderClientQt::createPlugin): + +2011-04-06 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] We should use USE(QT_MULTIMEDIA) rather than ENABLE(QT_MULTIMEDIA). + https://bugs.webkit.org/show_bug.cgi?id=57974 + + We should use USE(QT_MULTIMEDIA) rather than ENABLE(QT_MULTIMEDIA). + + No new tests needed, just a config flag rename. + + * Api/qwebkitplatformplugin.h: + * WebCoreSupport/ChromeClientQt.cpp: + * WebCoreSupport/DumpRenderTreeSupportQt.cpp: + (DumpRenderTreeSupportQt::mediaContentUrlByElementId): + * WebCoreSupport/FullScreenVideoQt.cpp: + (WebCore::FullScreenVideoQt::FullScreenVideoQt): + (WebCore::FullScreenVideoQt::~FullScreenVideoQt): + (WebCore::FullScreenVideoQt::enterFullScreenForNode): + (WebCore::FullScreenVideoQt::exitFullScreenForNode): + (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback): + (WebCore::FullScreenVideoQt::isValid): + * WebCoreSupport/FullScreenVideoQt.h: + * WebCoreSupport/QtPlatformPlugin.cpp: + * WebCoreSupport/QtPlatformPlugin.h: + * examples/platformplugin/WebPlugin.cpp: + (WebPlugin::supportsExtension): + (WebPlugin::createExtension): + * examples/platformplugin/WebPlugin.h: + * examples/platformplugin/platformplugin.pro: + * examples/platformplugin/qwebkitplatformplugin.h: + * tests/qwebpage/tst_qwebpage.cpp: + (tst_QWebPage::loadHtml5Video): + * tests/tests.pri: + +2011-04-06 Alexis Menard <alexis.menard@openbossa.org> + + Reviewed by Andreas Kling. + + [Qt] Implement fullscreen playback for the GStreamer backend. + https://bugs.webkit.org/show_bug.cgi?id=56826 + + Implement support for fullscreen playback when building the + Qt port with the GStreamer backend (DEFINES+=USE_GSTREAMER=1). + The implementation is done in FullScreenVideoQt alongside with + the Qt Multimedia support. + + No new tests because layout tests cover it. They are not yet activated + but will be any time soon. + + * QtWebKit.pro: + * WebCoreSupport/ChromeClientQt.cpp: + (WebCore::ChromeClientQt::ChromeClientQt): + (WebCore::ChromeClientQt::~ChromeClientQt): + (WebCore::ChromeClientQt::enterFullscreenForNode): + (WebCore::ChromeClientQt::exitFullscreenForNode): + * WebCoreSupport/ChromeClientQt.h: + * WebCoreSupport/FullScreenVideoQt.cpp: + (WebCore::GStreamerFullScreenVideoHandler::GStreamerFullScreenVideoHandler): + (WebCore::GStreamerFullScreenVideoHandler::setVideoElement): + (WebCore::GStreamerFullScreenVideoHandler::enterFullScreen): + (WebCore::GStreamerFullScreenVideoHandler::windowClosed): + (WebCore::GStreamerFullScreenVideoHandler::exitFullScreen): + (WebCore::DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler): + (WebCore::FullScreenVideoQt::FullScreenVideoQt): + (WebCore::FullScreenVideoQt::~FullScreenVideoQt): + (WebCore::FullScreenVideoQt::enterFullScreenForNode): + (WebCore::FullScreenVideoQt::exitFullScreenForNode): + (WebCore::FullScreenVideoQt::requiresFullScreenForVideoPlayback): + (WebCore::FullScreenVideoQt::isValid): + * WebCoreSupport/FullScreenVideoQt.h: + (WebCore::GStreamerFullScreenVideoHandler::~GStreamerFullScreenVideoHandler): + +2011-04-06 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Improve tests for QWebFrame::url() and related methods + https://bugs.webkit.org/show_bug.cgi?id=57865 + + * tests/qwebframe/tst_qwebframe.cpp: + (FakeReply::FakeReply): make more URLs reply HostNotFound. We needed two different URLs in the test. + (tst_QWebFrame::requestedUrlAfterSetAndLoadFailures): check the properties after an setUrl() + that fails and a load() that fails (for a different URL). + + (tst_QWebFrame::setUrlWithFragment_data): + (tst_QWebFrame::setUrlWithFragment): add other test cases similar to the original, but changing + the URL in the frame before the test starts. + + (tst_QWebFrame::setUrlSameUrl): document existing behavior of calling setUrl() twice with + the same URL as argument. + + (extractBaseUrl): + (tst_QWebFrame::setUrlThenLoads_data): + (tst_QWebFrame::setUrlThenLoads): check the URL related properties of the frame after a + sequence of set and loads. Those tests are interesting because the properties + react different to setUrl() and load(): 'requestedUrl' always change, 'url' only when setUrl() + is used or after the load() is committed and baseUrl() is similar to url() but also depends + on the contents of the page when it loads. + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/EditorClientQt.h: + (WebCore::EditorClientQt::requestCheckingOfString): + +2011-04-04 Chang Shu <cshu@webkit.org> + + Reviewed by Ryosuke Niwa. + + setContentEditable with true/false/inherit string is not working properly + https://bugs.webkit.org/show_bug.cgi?id=52058 + + Move isContentEditable from HTMLElement to Node. WebKit should only access isContentEditable + as rendererIsEditable is for WebCore internal use. + + * WebCoreSupport/EditorClientQt.cpp: + (WebCore::EditorClientQt::handleKeyboardEvent): + +2011-04-01 Carol Szabo <carol.szabo@nokia.com> + + Reviewed by Benjamin Poulain. + + Changed QWebFramePrivate::renderFromTiledBackingStore to call directly into + Scrollbar/PanIcon rendering, bypassing the potential relayout in renderRelativeCoords. + + Tiled painting still causes synchronous layout when + accelerated compositing and texture mapper are enabled + https://bugs.webkit.org/show_bug.cgi?id=56929 + + * Api/qwebframe.cpp: + (QWebFramePrivate::renderFromTiledBackingStore): + (QWebFramePrivate::renderRelativeCoords): + (QWebFramePrivate::renderFrameWidgets): + * Api/qwebframe_p.h: + +2011-04-01 Nancy Piedra <nancy.piedra@nokia.com> + + Reviewed by Benjamin Poulain. + + [Qt] DragClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40425 + + * WebCoreSupport/DragClientQt.h: + +2011-03-31 Marius Storm-Olsen <marius.storm-olsen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt] Properly detect phonon include, and avoid double qtLibraryTarget() call + https://bugs.webkit.org/show_bug.cgi?id=57017 + + Build fix. No new tests. + + * QtWebKit.pro: + +2011-03-31 Evan Martin <evan@chromium.org> + + Another build fix. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::updateGlobalHistory): + +2011-03-31 Nancy Piedra <nancy.piedra@nokia.com> + + Reviewed by Benjamin Poulain. + + [Qt] ChromeClientQt.h has coding-style errors + https://bugs.webkit.org/show_bug.cgi?id=40239 + + * WebCoreSupport/ChromeClientQt.h: + (WebCore::ChromeClientQt::scrollbarsModeDidChange): + (WebCore::ChromeClientQt::needTouchEvents): + (WebCore::ChromeClientQt::formStateDidChange): + (WebCore::ChromeClientQt::scrollRectIntoView): + (WebCore::ChromeClientQt::requestGeolocationPermissionForFrame): + (WebCore::ChromeClientQt::cancelGeolocationPermissionRequestForFrame): + +2011-03-31 Evan Martin <evan@chromium.org> + + Build fix from previous change. + + * Api/qwebframe.cpp: + (QWebFrame::title): + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/FrameLoaderClientQt.cpp: + (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientQt::setTitle): + * WebCoreSupport/FrameLoaderClientQt.h: + +2011-03-30 Yi Shen <yi.4.shen@nokia.com> + + Reviewed by Kenneth Rohde Christiansen. + + [Qt][Symbian] Fix Api test failure -- tst_QWebView::focusInputTypes + https://bugs.webkit.org/show_bug.cgi?id=57020 + + Added a macro 'VERIFY_INPUTMETHOD_HINTS' to test inputmethodhints(). + + * tests/qwebview/tst_qwebview.cpp: + (tst_QWebView::focusInputTypes): + 2011-03-30 Robert Hogan <robert@webkit.org> Reviewed by Antonio Gomes. diff --git a/Source/WebKit/qt/QtWebKit.pro b/Source/WebKit/qt/QtWebKit.pro index 8836c4a..7529ace 100644 --- a/Source/WebKit/qt/QtWebKit.pro +++ b/Source/WebKit/qt/QtWebKit.pro @@ -31,6 +31,7 @@ include($$SOURCE_DIR/JavaScriptCore/JavaScriptCore.pri) webkit2 { include($$SOURCE_DIR/WebKit2/WebKit2.pri) include($$SOURCE_DIR/WebKit2/WebKit2API.pri) + INCLUDEPATH += $$OUTPUT_DIR/WebKit2/generated } include($$SOURCE_DIR/WebCore/WebCore.pri) @@ -104,6 +105,11 @@ symbian { } else { TARGET.UID3 = 0xE00267C2 } + + sisheader = "; SIS header: name, uid, version" \ + "$${LITERAL_HASH}{\"$$TARGET\"},($$TARGET.UID3),$$QT_WEBKIT_MAJOR_VERSION,$$QT_WEBKIT_MINOR_VERSION,$$QT_WEBKIT_PATCH_VERSION,TYPE=SA,RU" + webkitsisheader.pkg_prerules = sisheader + webkitlibs.sources = QtWebKit$${QT_LIBINFIX}.dll v8:webkitlibs.sources += v8.dll @@ -128,7 +134,7 @@ symbian { DEPLOYMENT += declarativeImport } - DEPLOYMENT += webkitlibs webkitbackup + DEPLOYMENT += webkitsisheader webkitlibs webkitbackup !CONFIG(production):CONFIG-=def_files # Need to build these sources here because of exported symbols @@ -211,13 +217,13 @@ contains(DEFINES, ENABLE_NETSCAPE_PLUGIN_API=1) { contains(DEFINES, ENABLE_VIDEO=1) { !contains(DEFINES, USE_GSTREAMER=1):contains(MOBILITY_CONFIG, multimedia) { - HEADERS += \ - $$PWD/WebCoreSupport/FullScreenVideoQt.h \ - $$PWD/WebCoreSupport/FullScreenVideoWidget.h + HEADERS += $$PWD/WebCoreSupport/FullScreenVideoWidget.h + SOURCES += $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp + } - SOURCES += \ - $$PWD/WebCoreSupport/FullScreenVideoQt.cpp \ - $$PWD/WebCoreSupport/FullScreenVideoWidget.cpp + contains(DEFINES, USE_GSTREAMER=1) | contains(MOBILITY_CONFIG, multimedia) { + HEADERS += $$PWD/WebCoreSupport/FullScreenVideoQt.h + SOURCES += $$PWD/WebCoreSupport/FullScreenVideoQt.cpp } } @@ -322,7 +328,7 @@ contains(CONFIG, texmap) { CONFIG += build_all } else { - debug_and_release:TARGET = $$qtLibraryTarget($$TARGET) + isEmpty(QT_SOURCE_TREE):debug_and_release:TARGET = $$qtLibraryTarget($$TARGET) } CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index bec4bc4..ea2c826 100644 --- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -75,13 +75,15 @@ #include <qtooltip.h> #include <wtf/OwnPtr.h> -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) #include "FullScreenVideoQt.h" #include "HTMLMediaElement.h" #include "HTMLNames.h" #include "HTMLVideoElement.h" +#if USE(QT_MULTIMEDIA) #include "MediaPlayerPrivateQt.h" #endif +#endif namespace WebCore { @@ -90,7 +92,7 @@ bool ChromeClientQt::dumpVisitedLinksCallbacks = false; ChromeClientQt::ChromeClientQt(QWebPage* webPage) : m_webPage(webPage) , m_eventLoop(0) -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) , m_fullScreenVideo(0) #endif { @@ -102,7 +104,7 @@ ChromeClientQt::~ChromeClientQt() if (m_eventLoop) m_eventLoop->exit(); -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) delete m_fullScreenVideo; #endif } @@ -397,9 +399,18 @@ IntRect ChromeClientQt::windowResizerRect() const #endif } -void ChromeClientQt::invalidateWindow(const IntRect&, bool) +void ChromeClientQt::invalidateWindow(const IntRect& windowRect, bool) { - notImplemented(); +#if ENABLE(TILED_BACKING_STORE) + if (platformPageClient()) { + WebCore::TiledBackingStore* backingStore = QWebFramePrivate::core(m_webPage->mainFrame())->tiledBackingStore(); + if (!backingStore) + return; + backingStore->invalidate(windowRect); + } +#else + Q_UNUSED(windowRect); +#endif } void ChromeClientQt::invalidateContentsAndWindow(const IntRect& windowRect, bool immediate) @@ -650,7 +661,7 @@ IntRect ChromeClientQt::visibleRectForTiledBackingStore() const } #endif -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) FullScreenVideoQt* ChromeClientQt::fullScreenVideo() { if (!m_fullScreenVideo) @@ -673,13 +684,6 @@ void ChromeClientQt::enterFullscreenForNode(Node* node) { ASSERT(node && node->hasTagName(HTMLNames::videoTag)); - HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); - PlatformMedia platformMedia = videoElement->platformMedia(); - - ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); - if (platformMedia.type != PlatformMedia::QtMediaPlayerType) - return; - fullScreenVideo()->enterFullScreenForNode(node); } @@ -687,13 +691,6 @@ void ChromeClientQt::exitFullscreenForNode(Node* node) { ASSERT(node && node->hasTagName(HTMLNames::videoTag)); - HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); - PlatformMedia platformMedia = videoElement->platformMedia(); - - ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); - if (platformMedia.type != PlatformMedia::QtMediaPlayerType) - return; - fullScreenVideo()->exitFullScreenForNode(node); } #endif diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h index a12c2ec..c69daf5 100644 --- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -26,15 +26,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ChromeClientQt_H -#define ChromeClientQt_H +#ifndef ChromeClientQt_h +#define ChromeClientQt_h #include "ChromeClient.h" #include "FloatRect.h" -#include "RefCounted.h" #include "KURL.h" #include "PlatformString.h" #include "QtPlatformPlugin.h" +#include <wtf/RefCounted.h> QT_BEGIN_NAMESPACE class QEventLoop; @@ -44,176 +44,172 @@ class QWebPage; namespace WebCore { - class FileChooser; - class FloatRect; - class Page; - struct FrameLoadRequest; - class QtAbstractWebPopup; - struct ViewportArguments; -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) - class FullScreenVideoQt; +class FileChooser; +class FloatRect; +class Page; +struct FrameLoadRequest; +class QtAbstractWebPopup; +struct ViewportArguments; +#if ENABLE(VIDEO) +class FullScreenVideoQt; #endif - class ChromeClientQt : public ChromeClient - { - public: - ChromeClientQt(QWebPage* webPage); - virtual ~ChromeClientQt(); - virtual void chromeDestroyed(); +class ChromeClientQt : public ChromeClient { +public: + ChromeClientQt(QWebPage*); + virtual ~ChromeClientQt(); + virtual void chromeDestroyed(); - virtual void setWindowRect(const FloatRect&); - virtual FloatRect windowRect(); + virtual void setWindowRect(const FloatRect&); + virtual FloatRect windowRect(); - virtual FloatRect pageRect(); + virtual FloatRect pageRect(); - virtual float scaleFactor(); + virtual float scaleFactor(); - virtual void focus(); - virtual void unfocus(); + virtual void focus(); + virtual void unfocus(); - virtual bool canTakeFocus(FocusDirection); - virtual void takeFocus(FocusDirection); + virtual bool canTakeFocus(FocusDirection); + virtual void takeFocus(FocusDirection); - virtual void focusedNodeChanged(Node*); - virtual void focusedFrameChanged(Frame*); + virtual void focusedNodeChanged(Node*); + virtual void focusedFrameChanged(Frame*); - virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); - virtual void show(); + virtual Page* createWindow(Frame*, const FrameLoadRequest&, const WindowFeatures&, const NavigationAction&); + virtual void show(); - virtual bool canRunModal(); - virtual void runModal(); + virtual bool canRunModal(); + virtual void runModal(); - virtual void setToolbarsVisible(bool); - virtual bool toolbarsVisible(); + virtual void setToolbarsVisible(bool); + virtual bool toolbarsVisible(); - virtual void setStatusbarVisible(bool); - virtual bool statusbarVisible(); + virtual void setStatusbarVisible(bool); + virtual bool statusbarVisible(); - virtual void setScrollbarsVisible(bool); - virtual bool scrollbarsVisible(); + virtual void setScrollbarsVisible(bool); + virtual bool scrollbarsVisible(); - virtual void setMenubarVisible(bool); - virtual bool menubarVisible(); + virtual void setMenubarVisible(bool); + virtual bool menubarVisible(); - virtual void setResizable(bool); + virtual void setResizable(bool); - virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, - unsigned int lineNumber, const String& sourceID); + virtual void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned int lineNumber, const String& sourceID); - virtual bool canRunBeforeUnloadConfirmPanel(); - virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame); + virtual bool canRunBeforeUnloadConfirmPanel(); + virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame*); - virtual void closeWindowSoon(); + virtual void closeWindowSoon(); - virtual void runJavaScriptAlert(Frame*, const String&); - virtual bool runJavaScriptConfirm(Frame*, const String&); - virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); - virtual bool shouldInterruptJavaScript(); + virtual void runJavaScriptAlert(Frame*, const String&); + virtual bool runJavaScriptConfirm(Frame*, const String&); + virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result); + virtual bool shouldInterruptJavaScript(); - virtual void setStatusbarText(const String&); + virtual void setStatusbarText(const String&); - virtual WebCore::KeyboardUIMode keyboardUIMode(); - virtual IntRect windowResizerRect() const; + virtual KeyboardUIMode keyboardUIMode(); + virtual IntRect windowResizerRect() const; - virtual void invalidateWindow(const IntRect&, bool); - virtual void invalidateContentsAndWindow(const IntRect&, bool); - virtual void invalidateContentsForSlowScroll(const IntRect&, bool); - virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); + virtual void invalidateWindow(const IntRect&, bool); + virtual void invalidateContentsAndWindow(const IntRect&, bool); + virtual void invalidateContentsForSlowScroll(const IntRect&, bool); + virtual void scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect); #if ENABLE(TILED_BACKING_STORE) - virtual void delegatedScrollRequested(const IntPoint& scrollPoint); + virtual void delegatedScrollRequested(const IntPoint& scrollPoint); #endif - virtual IntPoint screenToWindow(const IntPoint&) const; - virtual IntRect windowToScreen(const IntRect&) const; - virtual PlatformPageClient platformPageClient() const; - virtual void contentsSizeChanged(Frame*, const IntSize&) const; + virtual IntPoint screenToWindow(const IntPoint&) const; + virtual IntRect windowToScreen(const IntRect&) const; + virtual PlatformPageClient platformPageClient() const; + virtual void contentsSizeChanged(Frame*, const IntSize&) const; - virtual void scrollbarsModeDidChange() const { } - virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); + virtual void scrollbarsModeDidChange() const { } + virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags); - virtual void setToolTip(const String&, TextDirection); + virtual void setToolTip(const String&, TextDirection); - virtual void print(Frame*); + virtual void print(Frame*); #if ENABLE(DATABASE) - virtual void exceededDatabaseQuota(Frame*, const String&); + virtual void exceededDatabaseQuota(Frame*, const String&); #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) - virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); - virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); + virtual void reachedMaxAppCacheSize(int64_t spaceNeeded); + virtual void reachedApplicationCacheOriginQuota(SecurityOrigin*); #endif #if ENABLE(CONTEXT_MENUS) virtual void showContextMenu() { } #endif #if ENABLE(NOTIFICATIONS) - virtual NotificationPresenter* notificationPresenter() const; + virtual NotificationPresenter* notificationPresenter() const; #endif #if USE(ACCELERATED_COMPOSITING) - // see ChromeClient.h - // this is a hook for WebCore to tell us what we need to do with the GraphicsLayers - virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*); - virtual void setNeedsOneShotDrawingSynchronization(); - virtual void scheduleCompositingLayerSync(); - virtual CompositingTriggerFlags allowedCompositingTriggers() const; + // This is a hook for WebCore to tell us what we need to do with the GraphicsLayers. + virtual void attachRootGraphicsLayer(Frame*, GraphicsLayer*); + virtual void setNeedsOneShotDrawingSynchronization(); + virtual void scheduleCompositingLayerSync(); + virtual CompositingTriggerFlags allowedCompositingTriggers() const; #endif #if ENABLE(TILED_BACKING_STORE) - virtual IntRect visibleRectForTiledBackingStore() const; + virtual IntRect visibleRectForTiledBackingStore() const; #endif #if ENABLE(TOUCH_EVENTS) - virtual void needTouchEvents(bool) { } + virtual void needTouchEvents(bool) { } #endif -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) - virtual bool supportsFullscreenForNode(const Node*); - virtual void enterFullscreenForNode(Node*); - virtual void exitFullscreenForNode(Node*); - virtual bool requiresFullscreenForVideoPlayback(); - FullScreenVideoQt* fullScreenVideo(); +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) + virtual bool supportsFullscreenForNode(const Node*); + virtual void enterFullscreenForNode(Node*); + virtual void exitFullscreenForNode(Node*); + virtual bool requiresFullscreenForVideoPlayback(); + FullScreenVideoQt* fullScreenVideo(); #endif + virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); + virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); - virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); - virtual void chooseIconForFiles(const Vector<String>&, FileChooser*); + virtual void formStateDidChange(const Node*) { } - virtual void formStateDidChange(const Node*) { } + virtual void setCursor(const Cursor&); - virtual void setCursor(const Cursor&); + virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const { } - virtual void scrollRectIntoView(const IntRect&, const ScrollView*) const { } + virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*) { } + virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } - virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*) { } - virtual void cancelGeolocationPermissionRequestForFrame(Frame*, Geolocation*) { } + virtual bool selectItemWritingDirectionIsNatural(); + virtual bool selectItemAlignmentFollowsMenuWritingDirection(); + virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; + virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; + virtual void populateVisitedLinks(); - virtual bool selectItemWritingDirectionIsNatural(); - virtual bool selectItemAlignmentFollowsMenuWritingDirection(); - virtual PassRefPtr<PopupMenu> createPopupMenu(PopupMenuClient*) const; - virtual PassRefPtr<SearchPopupMenu> createSearchPopupMenu(PopupMenuClient*) const; - virtual void populateVisitedLinks(); + QWebSelectMethod* createSelectPopup() const; - QWebSelectMethod* createSelectPopup() const; + virtual void dispatchViewportDataDidChange(const ViewportArguments&) const; - virtual void dispatchViewportDataDidChange(const ViewportArguments&) const; + QWebPage* m_webPage; + KURL lastHoverURL; + String lastHoverTitle; + String lastHoverContent; - QWebPage* m_webPage; - WebCore::KURL lastHoverURL; - WTF::String lastHoverTitle; - WTF::String lastHoverContent; + bool toolBarsVisible; + bool statusBarVisible; + bool menuBarVisible; + QEventLoop* m_eventLoop; - bool toolBarsVisible; - bool statusBarVisible; - bool menuBarVisible; - QEventLoop* m_eventLoop; - -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) - FullScreenVideoQt* m_fullScreenVideo; +#if ENABLE(VIDEO) && (USE(GSTREAMER) || USE(QT_MULTIMEDIA)) + FullScreenVideoQt* m_fullScreenVideo; #endif - static bool dumpVisitedLinksCallbacks; + static bool dumpVisitedLinksCallbacks; - mutable QtPlatformPlugin m_platformPlugin; - }; + mutable QtPlatformPlugin m_platformPlugin; +}; } #endif diff --git a/Source/WebKit/qt/WebCoreSupport/DragClientQt.h b/Source/WebKit/qt/WebCoreSupport/DragClientQt.h index 38b463b..15724f1 100644 --- a/Source/WebKit/qt/WebCoreSupport/DragClientQt.h +++ b/Source/WebKit/qt/WebCoreSupport/DragClientQt.h @@ -23,23 +23,28 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef DragClientQt_h +#define DragClientQt_h + #include "DragClient.h" + class QWebPage; + namespace WebCore { class DragClientQt : public DragClient { public: DragClientQt(QWebPage* webPage) : m_webPage(webPage) {}; - virtual void willPerformDragDestinationAction(DragDestinationAction, - DragData*); - virtual WebCore::DragDestinationAction actionMaskForDrag(DragData*); + virtual void willPerformDragDestinationAction(DragDestinationAction, DragData*); + virtual DragDestinationAction actionMaskForDrag(DragData*); virtual void dragControllerDestroyed(); virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&); virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*); - virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false); + virtual void startDrag(DragImageRef, const IntPoint& dragImageOrigin, const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false); private: QWebPage* m_webPage; }; } +#endif diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp index ba712d1..81102c3 100644 --- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp @@ -26,6 +26,7 @@ #include "ApplicationCacheStorage.h" #include "CSSComputedStyleDeclaration.h" #include "ChromeClientQt.h" +#include "ContainerNode.h" #include "ContextMenu.h" #include "ContextMenuClientQt.h" #include "ContextMenuController.h" @@ -82,7 +83,7 @@ #include "qwebpage_p.h" #include "qwebscriptworld.h" -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) #include "HTMLVideoElement.h" #include "MediaPlayerPrivateQt.h" #endif @@ -822,6 +823,17 @@ void DumpRenderTreeSupportQt::setMockGeolocationError(QWebPage* page, int errorC #endif } +int DumpRenderTreeSupportQt::numberOfPendingGeolocationPermissionRequests(QWebPage* page) +{ +#if ENABLE(CLIENT_BASED_GEOLOCATION) + Page* corePage = QWebPagePrivate::core(page); + GeolocationClientMock* mockClient = toGeolocationClientMock(corePage->geolocationController()->client()); + return mockClient->numberOfPendingPermissionRequests(); +#else + return -1; +#endif +} + bool DumpRenderTreeSupportQt::isTargetItem(const QWebHistoryItem& historyItem) { QWebHistoryItem it = historyItem; @@ -1014,7 +1026,7 @@ QUrl DumpRenderTreeSupportQt::mediaContentUrlByElementId(QWebFrame* frame, const { QUrl res; -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) Frame* coreFrame = QWebFramePrivate::core(frame); if (!coreFrame) return res; @@ -1052,6 +1064,19 @@ void DumpRenderTreeSupportQt::setAlternateHtml(QWebFrame* frame, const QString& coreFrame->loader()->load(request, substituteData, false); } +QVariant DumpRenderTreeSupportQt::shadowRoot(const QWebElement& element) +{ + WebCore::Element* webElement = element.m_element; + if (!webElement) + return QVariant(); + + ContainerNode* webShadowRoot = webElement->shadowRoot(); + if (!webShadowRoot) + return QVariant(); + + return QVariant::fromValue(QDRTNode(webShadowRoot)); +} + // Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame) diff --git a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h index 78752d8..4be6053 100644 --- a/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h +++ b/Source/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h @@ -147,6 +147,7 @@ public: static void setMockGeolocationPermission(QWebPage*, bool allowed); static void setMockGeolocationPosition(QWebPage*, double latitude, double longitude, double accuracy); static void setMockGeolocationError(QWebPage*, int errorCode, const QString& message); + static int numberOfPendingGeolocationPermissionRequests(QWebPage*); static int workerThreadCount(); @@ -199,6 +200,8 @@ public: static QUrl mediaContentUrlByElementId(QWebFrame*, const QString& elementId); static void setAlternateHtml(QWebFrame*, const QString& html, const QUrl& baseUrl, const QUrl& failingUrl); + + static QVariant shadowRoot(const QWebElement&); }; #endif diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp index e7bbd2c..0110144 100644 --- a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp @@ -420,7 +420,7 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event) return; // FIXME: refactor all of this to use Actions or something like them - if (start->rendererIsEditable()) { + if (start->isContentEditable()) { bool doSpatialNavigation = false; if (isSpatialNavigationEnabled(frame)) { if (!kevent->modifiers()) { diff --git a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h index 0450603..0d8e8c6 100644 --- a/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h +++ b/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h @@ -109,7 +109,7 @@ public: virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(SpellChecker*, int, const String&) {} + virtual void requestCheckingOfString(SpellChecker*, int, WebCore::TextCheckingTypeMask, const String&) {} virtual TextCheckerClient* textChecker() { return this; } bool isEditing() const; diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp index d318494..d083f8f 100644 --- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp @@ -31,71 +31,72 @@ */ #include "config.h" +#include "FrameLoaderClientQt.h" + #include "CSSComputedStyleDeclaration.h" #include "CSSPropertyNames.h" +#include "DocumentLoader.h" #include "FormState.h" -#include "FrameLoaderClientQt.h" #include "FrameNetworkingContextQt.h" #include "FrameTree.h" #include "FrameView.h" -#include "DocumentLoader.h" +#include "HTMLAppletElement.h" +#include "HTMLFormElement.h" +#include "HTMLPlugInElement.h" +#include "HTTPParsers.h" +#include "HistoryItem.h" #include "HitTestResult.h" #if ENABLE(ICONDATABASE) #include "IconDatabaseClientQt.h" #endif #if USE(JSC) #include "JSDOMWindowBase.h" -#elif USE(V8) -#include "V8DOMWindow.h" #endif #include "MIMETypeRegistry.h" #include "MouseEvent.h" -#include "ResourceResponse.h" +#include "NotImplemented.h" #include "Page.h" #include "PluginData.h" #include "PluginDatabase.h" #include "ProgressTracker.h" -#include "RenderPart.h" -#include "ResourceRequest.h" -#include "HistoryItem.h" -#include "HTMLAppletElement.h" -#include "HTMLFormElement.h" -#include "HTMLPlugInElement.h" -#include "HTTPParsers.h" -#include "NotImplemented.h" #include "QNetworkReplyHandler.h" -#include "ResourceHandleInternal.h" +#include "QWebPageClient.h" +#include "RenderPart.h" #include "ResourceHandle.h" +#include "ResourceHandleInternal.h" +#include "ResourceRequest.h" +#include "ResourceResponse.h" #include "ScriptController.h" #include "Settings.h" -#include "QWebPageClient.h" +#if USE(V8) +#include "V8DOMWindow.h" +#endif #include "ViewportArguments.h" -#include "qwebpage.h" -#include "qwebpage_p.h" #include "qwebframe.h" #include "qwebframe_p.h" +#include "qwebhistory_p.h" #include "qwebhistoryinterface.h" +#include "qwebpage.h" +#include "qwebpage_p.h" #include "qwebpluginfactory.h" -#include <qfileinfo.h> - #include <QCoreApplication> #include <QDebug> +#include <QFileInfo> #include <QGraphicsScene> #include <QGraphicsWidget> -#include <QNetworkRequest> #include <QNetworkReply> +#include <QNetworkRequest> #include <QStringList> -#include "qwebhistory_p.h" #include <wtf/OwnPtr.h> static QMap<unsigned long, QString> dumpAssignedUrls; -// Compare with WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm -static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame) +// Compare with the file "WebKit/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm". +static QString drtDescriptionSuitableForTestResult(WebCore::Frame* webCoreFrame) { - QWebFrame* frame = QWebFramePrivate::kit(_frame); + QWebFrame* frame = QWebFramePrivate::kit(webCoreFrame); QString name = frame->frameName(); bool isMainFrame = frame == frame->page()->mainFrame(); @@ -103,11 +104,10 @@ static QString drtDescriptionSuitableForTestResult(WebCore::Frame* _frame) if (!name.isEmpty()) return QString::fromLatin1("main frame \"%1\"").arg(name); return QLatin1String("main frame"); - } else { - if (!name.isEmpty()) - return QString::fromLatin1("frame \"%1\"").arg(name); - return QLatin1String("frame (anonymous)"); } + if (!name.isEmpty()) + return QString::fromLatin1("frame \"%1\"").arg(name); + return QLatin1String("frame (anonymous)"); } static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame) @@ -117,12 +117,12 @@ static QString drtPrintFrameUserGestureStatus(WebCore::Frame* frame) return QString::fromLatin1("Frame with user gesture \"%1\"").arg(QLatin1String("false")); } -static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& _url) +static QString drtDescriptionSuitableForTestResult(const WebCore::KURL& kurl) { - if (_url.isEmpty() || !_url.isLocalFile()) - return _url.string(); - // Remove the leading path from file urls - return QString(_url.string()).remove(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath).mid(1); + if (kurl.isEmpty() || !kurl.isLocalFile()) + return kurl.string(); + // Remove the leading path from file urls. + return QString(kurl.string()).remove(WebCore::FrameLoaderClientQt::dumpResourceLoadCallbacksPath).mid(1); } static QString drtDescriptionSuitableForTestResult(const WebCore::ResourceError& error) @@ -166,8 +166,7 @@ static QString drtDescriptionSuitableForTestResult(const RefPtr<WebCore::Node> n return result; } -namespace WebCore -{ +namespace WebCore { bool FrameLoaderClientQt::dumpFrameLoaderCallbacks = false; bool FrameLoaderClientQt::dumpUserGestureInFrameLoaderCallbacks = false; @@ -184,7 +183,7 @@ bool FrameLoaderClientQt::policyDelegateEnabled = false; bool FrameLoaderClientQt::policyDelegatePermissive = false; QMap<QString, QString> FrameLoaderClientQt::URLsToRedirect = QMap<QString, QString>(); -// Taken from DumpRenderTree/chromium/WebViewHost.cpp +// Taken from the file "WebKit/Tools/DumpRenderTree/chromium/WebViewHost.cpp". static const char* navigationTypeToString(NavigationType type) { switch (type) { @@ -250,7 +249,7 @@ void FrameLoaderClientQt::callPolicyFunction(FramePolicyFunction function, Polic bool FrameLoaderClientQt::hasWebView() const { - //notImplemented(); + // notImplemented(); return true; } @@ -331,7 +330,7 @@ void FrameLoaderClientQt::forceLayoutForNonHTML() void FrameLoaderClientQt::setCopiesOnScroll() { - // apparently mac specific + // Apparently this is mac specific. } @@ -346,7 +345,7 @@ void FrameLoaderClientQt::detachedFromParent3() void FrameLoaderClientQt::dispatchDidHandleOnloadEvents() { - // don't need this one + // Don't need this one. if (dumpFrameLoaderCallbacks) printf("%s - didHandleOnloadEventsForFrame\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame))); } @@ -387,7 +386,7 @@ void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage() if (!m_webFrame) return; - emit m_webFrame->urlChanged(m_webFrame->url()); + m_webFrame->d->emitUrlChanged(); m_webFrame->page()->d->updateNavigationActions(); } @@ -447,15 +446,16 @@ void FrameLoaderClientQt::dispatchDidStartProvisionalLoad() } -void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientQt::dispatchDidReceiveTitle(const StringWithDirection& title) { + // FIXME: Use direction of title. if (dumpFrameLoaderCallbacks) - printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title))); + printf("%s - didReceiveTitle: %s\n", qPrintable(drtDescriptionSuitableForTestResult(m_frame)), qPrintable(QString(title.string()))); if (!m_webFrame) return; - emit titleChanged(title); + emit titleChanged(title.string()); } @@ -467,7 +467,7 @@ void FrameLoaderClientQt::dispatchDidChangeIcons() if (!m_webFrame) return; - // FIXME: To be notified of changing icon URLS add notification + // FIXME: In order to get notified of icon URLS' changes, add a notification. // emit iconsChanged(); } @@ -480,7 +480,7 @@ void FrameLoaderClientQt::dispatchDidCommitLoad() if (m_frame->tree()->parent() || !m_webFrame) return; - emit m_webFrame->urlChanged(m_webFrame->url()); + m_webFrame->d->emitUrlChanged(); m_webFrame->page()->d->updateNavigationActions(); // We should assume first the frame has no title. If it has, then the above dispatchDidReceiveTitle() @@ -546,7 +546,7 @@ void FrameLoaderClientQt::dispatchShow() void FrameLoaderClientQt::cancelPolicyCheck() { -// qDebug() << "FrameLoaderClientQt::cancelPolicyCheck"; + // qDebug() << "FrameLoaderClientQt::cancelPolicyCheck"; } @@ -554,7 +554,7 @@ void FrameLoaderClientQt::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState>) { notImplemented(); - // FIXME: This is surely too simple + // FIXME: This is surely too simple. callPolicyFunction(function, PolicyUse); } @@ -573,7 +573,7 @@ void FrameLoaderClientQt::revertToProvisionalState(DocumentLoader*) void FrameLoaderClientQt::postProgressStartedNotification() { if (m_webFrame && m_frame->page()) { - // A new load starts, so lets clear the previous error. + // As a new load have started, clear the previous error. m_loadError = ResourceError(); emit loadStarted(); postProgressEstimateChangedNotification(); @@ -591,9 +591,9 @@ void FrameLoaderClientQt::postProgressEstimateChangedNotification() void FrameLoaderClientQt::postProgressFinishedNotification() { - // send a mousemove event to - // (1) update the cursor to change according to whatever is underneath the mouse cursor right now - // (2) display the tool tip if the mouse hovers a node which has a tool tip + // Send a mousemove event to: + // (1) update the cursor to change according to whatever is underneath the mouse cursor right now; + // (2) display the tool tip if the mouse hovers a node which has a tool tip. if (m_frame && m_frame->eventHandler() && m_webFrame->page()) { QWidget* view = m_webFrame->page()->view(); if (view && view->hasFocus()) { @@ -611,19 +611,19 @@ void FrameLoaderClientQt::postProgressFinishedNotification() void FrameLoaderClientQt::setMainFrameDocumentReady(bool) { - // this is only interesting once we provide an external API for the DOM + // This is only interesting once we provide an external API for the DOM. } void FrameLoaderClientQt::willChangeTitle(DocumentLoader*) { - // no need for, dispatchDidReceiveTitle is the right callback + // No need for, dispatchDidReceiveTitle is the right callback. } void FrameLoaderClientQt::didChangeTitle(DocumentLoader*) { - // no need for, dispatchDidReceiveTitle is the right callback + // No need for, dispatchDidReceiveTitle is the right callback. } @@ -631,8 +631,8 @@ void FrameLoaderClientQt::finishedLoading(DocumentLoader* loader) { if (!m_pluginView) { // This is necessary to create an empty document. See bug 634004. - // However, we only want to do this if makeRepresentation has been called, to - // match the behavior on the Mac. + // However, we only want to do this if makeRepresentation has been called, + // to match the behavior on the Mac. if (m_hasRepresentation) loader->writer()->setEncoding("", false); return; @@ -681,7 +681,7 @@ String FrameLoaderClientQt::generatedMIMETypeForURLScheme(const String&) const void FrameLoaderClientQt::frameLoadCompleted() { - // Note: Can be called multiple times. + // Note that this can be called multiple times. } @@ -695,13 +695,13 @@ void FrameLoaderClientQt::restoreViewState() void FrameLoaderClientQt::provisionalLoadStarted() { - // don't need to do anything here + // Don't need to do anything here. } void FrameLoaderClientQt::didFinishLoad() { -// notImplemented(); + // notImplemented(); } @@ -709,16 +709,17 @@ void FrameLoaderClientQt::prepareForDataSourceReplacement() { } -void FrameLoaderClientQt::setTitle(const String& title, const KURL& url) +void FrameLoaderClientQt::setTitle(const StringWithDirection& title, const KURL& url) { // Used by Apple WebKit to update the title of an existing history item. // QtWebKit doesn't accomodate this on history items. If it ever does, - // it should be privateBrowsing-aware.For now, we are just passing + // it should be privateBrowsing-aware. For now, we are just passing // globalhistory layout tests. + // FIXME: Use direction of title. if (dumpHistoryCallbacks) { printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", qPrintable(drtDescriptionSuitableForTestResult(url)), - qPrintable(QString(title))); + qPrintable(QString(title.string()))); } } @@ -733,9 +734,8 @@ String FrameLoaderClientQt::userAgent(const KURL& url) void FrameLoaderClientQt::dispatchDidReceiveIcon() { - if (m_webFrame) { + if (m_webFrame) emit m_webFrame->iconChanged(); - } } void FrameLoaderClientQt::frameLoaderDestroyed() @@ -757,9 +757,8 @@ void FrameLoaderClientQt::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld* w if (world != mainThreadNormalWorld()) return; - if (m_webFrame) { + if (m_webFrame) emit m_webFrame->javaScriptWindowObjectCleared(); - } } void FrameLoaderClientQt::documentElementAvailable() @@ -795,7 +794,7 @@ void FrameLoaderClientQt::onIconLoadedForPageURL(const QString& url) void FrameLoaderClientQt::updateGlobalHistory() { - QWebHistoryInterface *history = QWebHistoryInterface::defaultInterface(); + QWebHistoryInterface* history = QWebHistoryInterface::defaultInterface(); WebCore::DocumentLoader* loader = m_frame->loader()->documentLoader(); if (history) history->addHistoryEntry(loader->urlForHistory().prettyURL()); @@ -803,7 +802,7 @@ void FrameLoaderClientQt::updateGlobalHistory() if (dumpHistoryCallbacks) { printf("WebView navigated to url \"%s\" with title \"%s\" with HTTP equivalent method \"%s\". The navigation was %s and was %s%s.\n", qPrintable(drtDescriptionSuitableForTestResult(loader->urlForHistory())), - qPrintable(QString(loader->title())), + qPrintable(QString(loader->title().string())), qPrintable(QString(loader->request().httpMethod())), ((loader->substituteData().isValid() || (loader->response().httpStatusCode() >= 400)) ? "a failure" : "successful"), ((!loader->clientRedirectSourceForHistory().isEmpty()) ? "a client redirect from " : "not a client redirect"), @@ -840,12 +839,12 @@ void FrameLoaderClientQt::updateGlobalHistoryRedirectLinks() } } -bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem *) const +bool FrameLoaderClientQt::shouldGoToHistoryItem(WebCore::HistoryItem*) const { return true; } -bool FrameLoaderClientQt::shouldStopLoadingForHistoryItem(WebCore::HistoryItem *) const +bool FrameLoaderClientQt::shouldStopLoadingForHistoryItem(WebCore::HistoryItem*) const { return true; } @@ -905,13 +904,13 @@ void FrameLoaderClientQt::committedLoad(WebCore::DocumentLoader* loader, const c if (!m_pluginView) loader->commitData(data, length); - // We re-check here as the plugin can have been created + // We re-check here as the plugin can have been created. if (m_pluginView && m_pluginView->isPluginView()) { if (!m_hasSentResponseToPlugin) { m_pluginView->didReceiveResponse(loader->response()); - // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in - // setting up this stream can cause the main document load to be cancelled, setting m_pluginView - // to null + // The function didReceiveResponse sets up a new stream to the plug-in. + // On a full-page plug-in, a failure in setting up this stream can cause the + // main document load to be cancelled, setting m_pluginView to null. if (!m_pluginView) return; m_hasSentResponseToPlugin = true; @@ -928,12 +927,12 @@ WebCore::ResourceError FrameLoaderClientQt::cancelledError(const WebCore::Resour return error; } -// copied from WebKit/Misc/WebKitErrors[Private].h +// This was copied from file "WebKit/Source/WebKit/mac/Misc/WebKitErrors.h". enum { WebKitErrorCannotShowMIMEType = 100, WebKitErrorCannotShowURL = 101, WebKitErrorFrameLoadInterruptedByPolicyChange = 102, - WebKitErrorCannotUseRestrictedPort = 103, + WebKitErrorCannotUseRestrictedPort = 103, WebKitErrorCannotFindPlugIn = 200, WebKitErrorCannotLoadPlugIn = 201, WebKitErrorJavaUnavailable = 202, @@ -1011,7 +1010,7 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor QNetworkReplyHandler* handler = handle->getInternal()->m_job; QNetworkReply* reply = handler->release(); if (reply) { - QWebPage *page = m_webFrame->page(); + QWebPage* page = m_webFrame->page(); if (page->forwardUnsupportedContent()) emit page->unsupportedContent(reply); else @@ -1027,6 +1026,7 @@ void FrameLoaderClientQt::assignIdentifierToInitialRequest(unsigned long identif void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsigned long identifier, WebCore::ResourceRequest& newRequest, const WebCore::ResourceResponse& redirectResponse) { + QUrl url = newRequest.url(); if (dumpResourceLoadCallbacks) printf("%s - willSendRequest %s redirectResponse %s\n", @@ -1034,28 +1034,42 @@ void FrameLoaderClientQt::dispatchWillSendRequest(WebCore::DocumentLoader*, unsi qPrintable(drtDescriptionSuitableForTestResult(newRequest)), (redirectResponse.isNull()) ? "(null)" : qPrintable(drtDescriptionSuitableForTestResult(redirectResponse))); - if (sendRequestReturnsNull) + if (sendRequestReturnsNull) { newRequest.setURL(QUrl()); + return; + } if (sendRequestReturnsNullOnRedirect && !redirectResponse.isNull()) { printf("Returning null for this redirect\n"); newRequest.setURL(QUrl()); + return; + } + + if (QWebPagePrivate::drtRun + && url.isValid() + && (url.scheme().toLower() == QLatin1String("http") || url.scheme().toLower() == QLatin1String("https")) + && url.host() != QLatin1String("127.0.0.1") + && url.host() != QLatin1String("255.255.255.255") + && url.host().toLower() != QLatin1String("localhost")) { + + printf("Blocked access to external URL %s\n", qPrintable(drtDescriptionSuitableForTestResult(newRequest.url()))); + newRequest.setURL(QUrl()); + return; } for (int i = 0; i < sendRequestClearHeaders.size(); ++i) newRequest.setHTTPHeaderField(sendRequestClearHeaders.at(i).toLocal8Bit().constData(), QString()); if (QWebPagePrivate::drtRun) { - QString url = newRequest.url().string(); - if (URLsToRedirect.contains(url)) - newRequest.setURL(QUrl(URLsToRedirect[url])); + QMap<QString, QString>::const_iterator it = URLsToRedirect.constFind(url.toString()); + if (it != URLsToRedirect.constEnd()) + newRequest.setURL(QUrl(it.value())); } - // seems like the Mac code doesn't do anything here by default neither - //qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << request.url().string`(); + // Seems like the Mac code doesn't do anything here by default neither. + // qDebug() << "FrameLoaderClientQt::dispatchWillSendRequest" << request.isNull() << url; } -bool -FrameLoaderClientQt::shouldUseCredentialStorage(DocumentLoader*, unsigned long) +bool FrameLoaderClientQt::shouldUseCredentialStorage(DocumentLoader*, unsigned long) { notImplemented(); return false; @@ -1082,7 +1096,7 @@ void FrameLoaderClientQt::dispatchDidReceiveResponse(WebCore::DocumentLoader*, u if (dumpResourceResponseMIMETypes) { printf("%s has MIME type %s\n", - qPrintable(QFileInfo(drtDescriptionSuitableForTestResult(response.url())).fileName()), + qPrintable(QString(response.url().lastPathComponent())), qPrintable(QString(response.mimeType()))); } } @@ -1178,7 +1192,7 @@ WebCore::Frame* FrameLoaderClientQt::dispatchCreatePage(const WebCore::Navigatio void FrameLoaderClientQt::dispatchDecidePolicyForResponse(FramePolicyFunction function, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest&) { - // we need to call directly here + // We need to call directly here. if (WebCore::contentDispositionType(response.httpHeaderField("Content-Disposition")) == WebCore::ContentDispositionAttachment) callPolicyFunction(function, PolicyDownload); else if (canShowMIMEType(response.mimeType())) @@ -1215,7 +1229,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun QWebPage*page = m_webFrame->page(); PolicyAction result; - // Currently, this is only enabled by DRT + // Currently, this is only enabled by DRT. if (policyDelegateEnabled) { RefPtr<Node> node; for (const Event* event = action.event(); event; event = event->underlyingEvent()) { @@ -1296,7 +1310,7 @@ PassRefPtr<Frame> FrameLoaderClientQt::createFrame(const KURL& url, const String emit m_webFrame->page()->frameCreated(webFrame); - // ### set override encoding if we have one + // FIXME: Set override encoding if we have one. m_frame->loader()->loadURLIntoChildFrame(frameData.url, frameData.referrer, frameData.frame.get()); @@ -1331,7 +1345,7 @@ void FrameLoaderClientQt::transferLoadingResourceFromPage(unsigned long, Documen ObjectContentType FrameLoaderClientQt::objectContentType(const KURL& url, const String& mimeTypeIn, bool shouldPreferPlugInsForImages) { -// qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<mimeTypeIn; + // qDebug()<<" ++++++++++++++++ url is "<<url.prettyURL()<<", mime = "<<mimeTypeIn; QFileInfo fi(url.path()); String extension = fi.suffix(); if (mimeTypeIn == "application/x-qt-plugin" || mimeTypeIn == "application/x-qt-styled-widget") @@ -1432,8 +1446,8 @@ private: if (!isVisible()) return; - // if setMask is set with an empty QRegion, no clipping will - // be performed, so in that case we hide the platformWidget + // If setMask is set with an empty QRegion, no clipping will + // be performed, so in that case we hide the platformWidget. QRegion mask = platformWidget()->mask(); platformWidget()->setVisible(!mask.isEmpty()); } @@ -1467,7 +1481,7 @@ public: IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height())); graphicsWidget->setGeometry(QRect(windowRect)); - // FIXME: clipping of graphics widgets + // FIXME: Make the code handle clipping of graphics widgets. } virtual void show() { @@ -1494,8 +1508,8 @@ private: PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) { -// qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType; -// qDebug()<<"------\t url = "<<url.prettyURL(); + // qDebug()<<"------ Creating plugin in FrameLoaderClientQt::createPlugin for "<<url.prettyURL() << mimeType; + // qDebug()<<"------\t url = "<<url.prettyURL(); if (!m_webFrame) return 0; @@ -1553,12 +1567,12 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, QWidget* parentWidget = 0; if (m_webFrame->page()->d->client) parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent()); - if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. + if (parentWidget) // Don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. widget->setParent(parentWidget); widget->hide(); RefPtr<QtPluginWidget> w = adoptRef(new QtPluginWidget()); w->setPlatformWidget(widget); - // Make sure it's invisible until properly placed into the layout + // Make sure it's invisible until properly placed into the layout. w->setFrameRect(IntRect(0, 0, 0, 0)); return w; } @@ -1570,16 +1584,16 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, if (m_webFrame->page()->d->client) parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent()); graphicsWidget->hide(); - if (parentWidget) // don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. + if (parentWidget) // Don't reparent to nothing (i.e. keep whatever parent QWebPage::createPlugin() chose. graphicsWidget->setParentItem(parentWidget); RefPtr<QtPluginGraphicsWidget> w = QtPluginGraphicsWidget::create(graphicsWidget); - // Make sure it's invisible until properly placed into the layout + // Make sure it's invisible until properly placed into the layout. w->setFrameRect(IntRect(0, 0, 0, 0)); return w; } #endif // QT_NO_GRAPHICSVIEW - // FIXME: make things work for widgetless plugins as well + // FIXME: Make things work for widgetless plugins as well. delete object; } #if ENABLE(NETSCAPE_PLUGIN_API) @@ -1592,16 +1606,16 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize, #if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5) size_t wmodeIndex = params.find("wmode"); if (wmodeIndex == -1) { - // Disable XEmbed mode and force it to opaque mode + // Disable XEmbed mode and force it to opaque mode. params.append("wmode"); values.append("opaque"); } else if (!isQWebView) { - // Disable transparency if client is not a QWebView + // Disable transparency if client is not a QWebView. values[wmodeIndex] = "opaque"; } #else if (!isQWebView) { - // inject wmode=opaque when there is no client or the client is not a QWebView + // Inject wmode=opaque when there is no client or the client is not a QWebView. size_t wmodeIndex = params.find("wmode"); if (wmodeIndex == -1) { params.append("wmode"); @@ -1646,7 +1660,10 @@ QString FrameLoaderClientQt::chooseFile(const QString& oldFile) PassRefPtr<FrameNetworkingContext> FrameLoaderClientQt::createNetworkingContext() { - return FrameNetworkingContextQt::create(m_frame, m_webFrame, m_webFrame->page()->networkAccessManager()); + QVariant value = m_webFrame->page()->property("_q_MIMESniffingDisabled"); + bool MIMESniffingDisabled = value.isValid() && value.toBool(); + + return FrameNetworkingContextQt::create(m_frame, m_webFrame, !MIMESniffingDisabled, m_webFrame->page()->networkAccessManager()); } } diff --git a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h index 3ec5f20..900489d 100644 --- a/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h +++ b/Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h @@ -110,7 +110,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidReceiveTitle(const StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const ResourceError&); @@ -186,7 +186,7 @@ public: virtual void prepareForDataSourceReplacement(); virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const String& title, const KURL&); + virtual void setTitle(const StringWithDirection&, const KURL&); virtual String userAgent(const WebCore::KURL&); diff --git a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp index b3b0f00..502a418 100644 --- a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.cpp @@ -28,16 +28,17 @@ namespace WebCore { -FrameNetworkingContextQt::FrameNetworkingContextQt(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager) +FrameNetworkingContextQt::FrameNetworkingContextQt(Frame* frame, QObject* originatingObject, bool mimeSniffingEnabled, QNetworkAccessManager* networkAccessManager) : FrameNetworkingContext(frame) , m_originatingObject(originatingObject) , m_networkAccessManager(networkAccessManager) + , m_mimeSniffingEnabled(mimeSniffingEnabled) { } -PassRefPtr<FrameNetworkingContextQt> FrameNetworkingContextQt::create(Frame* frame, QObject* originatingObject, QNetworkAccessManager* networkAccessManager) +PassRefPtr<FrameNetworkingContextQt> FrameNetworkingContextQt::create(Frame* frame, QObject* originatingObject, bool mimeSniffingEnabled, QNetworkAccessManager* networkAccessManager) { - return adoptRef(new FrameNetworkingContextQt(frame, originatingObject, networkAccessManager)); + return adoptRef(new FrameNetworkingContextQt(frame, originatingObject, mimeSniffingEnabled, networkAccessManager)); } QObject* FrameNetworkingContextQt::originatingObject() const @@ -50,4 +51,9 @@ QNetworkAccessManager* FrameNetworkingContextQt::networkAccessManager() const return (qobject_cast<QWebFrame*>(m_originatingObject))->page()->networkAccessManager(); } +bool FrameNetworkingContextQt::mimeSniffingEnabled() const +{ + return m_mimeSniffingEnabled; +} + } diff --git a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h index 461023e..f23ba95 100644 --- a/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h +++ b/Source/WebKit/qt/WebCoreSupport/FrameNetworkingContextQt.h @@ -26,16 +26,18 @@ namespace WebCore { class FrameNetworkingContextQt : public FrameNetworkingContext { public: - static PassRefPtr<FrameNetworkingContextQt> create(Frame*, QObject* originatingObject, QNetworkAccessManager*); + static PassRefPtr<FrameNetworkingContextQt> create(Frame*, QObject* originatingObject, bool mimeSniffingEnabled, QNetworkAccessManager*); private: - FrameNetworkingContextQt(Frame*, QObject* originatingObject, QNetworkAccessManager*); + FrameNetworkingContextQt(Frame*, QObject* originatingObject, bool mimeSniffingEnabled, QNetworkAccessManager*); virtual QObject* originatingObject() const; virtual QNetworkAccessManager* networkAccessManager() const; + virtual bool mimeSniffingEnabled() const; QObject* m_originatingObject; QNetworkAccessManager* m_networkAccessManager; + bool m_mimeSniffingEnabled; }; } diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp index ccca43c..7939370 100644 --- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.cpp @@ -22,18 +22,71 @@ #include "FullScreenVideoQt.h" #include "ChromeClientQt.h" +#if USE(QT_MULTIMEDIA) #include "FullScreenVideoWidget.h" +#include "MediaPlayerPrivateQt.h" +#endif #include "HTMLNames.h" #include "HTMLVideoElement.h" -#include "MediaPlayerPrivateQt.h" #include "Node.h" +#if USE(GSTREAMER) +#include "GStreamerGWorld.h" +#include "PlatformVideoWindowPrivate.h" +#endif +#if USE(QT_MULTIMEDIA) #include <QGraphicsVideoItem> #include <QMediaPlayer> +#endif +#include <QWidget> namespace WebCore { +#if USE(GSTREAMER) +GStreamerFullScreenVideoHandler::GStreamerFullScreenVideoHandler() + : m_videoElement(0) + , m_fullScreenWidget(0) +{ +} + +void GStreamerFullScreenVideoHandler::setVideoElement(HTMLVideoElement* element) +{ + m_videoElement = element; +} + +void GStreamerFullScreenVideoHandler::enterFullScreen() +{ + if (m_videoElement->platformMedia().type != WebCore::PlatformMedia::GStreamerGWorldType) + return; + + GStreamerGWorld* gstreamerGWorld = m_videoElement->platformMedia().media.gstreamerGWorld; + + if (!gstreamerGWorld->enterFullscreen()) + return; + + m_fullScreenWidget = reinterpret_cast<FullScreenVideoWindow*>(gstreamerGWorld->platformVideoWindow()->window()); + m_fullScreenWidget->setVideoElement(m_videoElement); + connect(m_fullScreenWidget, SIGNAL(closed()), this, SLOT(windowClosed())); + m_fullScreenWidget->showFullScreen(); +} + +void GStreamerFullScreenVideoHandler::windowClosed() +{ + m_videoElement->exitFullscreen(); +} + +void GStreamerFullScreenVideoHandler::exitFullScreen() +{ + if (m_videoElement->platformMedia().type == WebCore::PlatformMedia::GStreamerGWorldType) + m_videoElement->platformMedia().media.gstreamerGWorld->exitFullscreen(); + + m_fullScreenWidget->setVideoElement(0); + m_fullScreenWidget->close(); +} +#endif + +#if USE(QT_MULTIMEDIA) bool DefaultFullScreenVideoHandler::s_shouldForceFullScreenVideoPlayback = false; DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler() @@ -42,6 +95,8 @@ DefaultFullScreenVideoHandler::DefaultFullScreenVideoHandler() { connect(m_fullScreenWidget, SIGNAL(didExitFullScreen()), this, SIGNAL(fullScreenClosed())); m_fullScreenWidget->hide(); + + m_fullScreenWidget->close(); } DefaultFullScreenVideoHandler::~DefaultFullScreenVideoHandler() @@ -72,24 +127,36 @@ void DefaultFullScreenVideoHandler::exitFullScreen() { m_fullScreenWidget->close(); } +#endif FullScreenVideoQt::FullScreenVideoQt(ChromeClientQt* chromeClient) : m_chromeClient(chromeClient) , m_videoElement(0) { Q_ASSERT(m_chromeClient); - m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler(); +#if USE(QT_MULTIMEDIA) + m_FullScreenVideoHandler = m_chromeClient->m_platformPlugin.createFullScreenVideoHandler(); if (!m_FullScreenVideoHandler) m_FullScreenVideoHandler = new DefaultFullScreenVideoHandler; if (m_FullScreenVideoHandler) connect(m_FullScreenVideoHandler, SIGNAL(fullScreenClosed()), this, SLOT(aboutToClose())); +#endif + +#if USE(GSTREAMER) + m_FullScreenVideoHandlerGStreamer = new GStreamerFullScreenVideoHandler; +#endif } FullScreenVideoQt::~FullScreenVideoQt() { +#if USE(QT_MULTIMEDIA) delete m_FullScreenVideoHandler; +#endif +#if USE(GSTREAMER) + delete m_FullScreenVideoHandlerGStreamer; +#endif } void FullScreenVideoQt::enterFullScreenForNode(Node* node) @@ -97,25 +164,54 @@ void FullScreenVideoQt::enterFullScreenForNode(Node* node) Q_ASSERT(node); Q_ASSERT(m_FullScreenVideoHandler); + m_videoElement = static_cast<HTMLVideoElement*>(node); + +#if USE(QT_MULTIMEDIA) + HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); + PlatformMedia platformMedia = videoElement->platformMedia(); + + ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); + if (platformMedia.type != PlatformMedia::QtMediaPlayerType) + return; + if (!m_FullScreenVideoHandler) return; - MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayerForNode(node); + MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayer(); mediaPlayerQt->removeVideoItem(); m_FullScreenVideoHandler->enterFullScreen(mediaPlayerQt->mediaPlayer()); +#endif + +#if USE(GSTREAMER) + m_FullScreenVideoHandlerGStreamer->setVideoElement(m_videoElement); + m_FullScreenVideoHandlerGStreamer->enterFullScreen(); +#endif } void FullScreenVideoQt::exitFullScreenForNode(Node* node) { Q_ASSERT(node); + +#if USE(QT_MULTIMEDIA) + HTMLVideoElement* videoElement = static_cast<HTMLVideoElement*>(node); + PlatformMedia platformMedia = videoElement->platformMedia(); + + ASSERT(platformMedia.type == PlatformMedia::QtMediaPlayerType); + if (platformMedia.type != PlatformMedia::QtMediaPlayerType) + return; + Q_ASSERT(m_FullScreenVideoHandler); if (!m_FullScreenVideoHandler) return; m_FullScreenVideoHandler->exitFullScreen(); - MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayerForNode(node); + MediaPlayerPrivateQt* mediaPlayerQt = mediaPlayer(); mediaPlayerQt->restoreVideoItem(); +#endif +#if USE(GSTREAMER) + m_FullScreenVideoHandlerGStreamer->exitFullScreen(); +#endif } void FullScreenVideoQt::aboutToClose() @@ -124,24 +220,33 @@ void FullScreenVideoQt::aboutToClose() m_videoElement->exitFullscreen(); } +#if USE(QT_MULTIMEDIA) MediaPlayerPrivateQt* FullScreenVideoQt::mediaPlayer() { Q_ASSERT(m_videoElement); PlatformMedia platformMedia = m_videoElement->platformMedia(); return static_cast<MediaPlayerPrivateQt*>(platformMedia.media.qtMediaPlayer); } +#endif -MediaPlayerPrivateQt* FullScreenVideoQt::mediaPlayerForNode(Node* node) +bool FullScreenVideoQt::requiresFullScreenForVideoPlayback() { - Q_ASSERT(node); - if (node) - m_videoElement = static_cast<HTMLVideoElement*>(node); - return mediaPlayer(); +#if USE(QT_MULTIMEDIA) + return m_FullScreenVideoHandler ? m_FullScreenVideoHandler->requiresFullScreenForVideoPlayback() : false; +#endif +#if USE(GSTREAMER) + return false; +#endif } -bool FullScreenVideoQt::requiresFullScreenForVideoPlayback() +bool FullScreenVideoQt::isValid() const { - return m_FullScreenVideoHandler ? m_FullScreenVideoHandler->requiresFullScreenForVideoPlayback() : false; +#if USE(QT_MULTIMEDIA) + return m_FullScreenVideoHandler; +#endif +#if USE(GSTREAMER) + return m_FullScreenVideoHandlerGStreamer; +#endif } } diff --git a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h index a48a882..fda153d 100644 --- a/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h +++ b/Source/WebKit/qt/WebCoreSupport/FullScreenVideoQt.h @@ -22,6 +22,7 @@ #include "qwebkitplatformplugin.h" #include <QObject> +#include <wtf/Platform.h> QT_BEGIN_NAMESPACE class QGraphicsVideoItem; @@ -34,8 +35,35 @@ class ChromeClientQt; class FullScreenVideoWidget; class HTMLVideoElement; class Node; +#if USE(QT_MULTIMEDIA) class MediaPlayerPrivateQt; +#endif +// We do not use ENABLE or USE because moc does not expand these macros. +#if defined(WTF_USE_GSTREAMER) && WTF_USE_GSTREAMER +class FullScreenVideoWindow; + +class GStreamerFullScreenVideoHandler : public QObject { + Q_OBJECT +public: + GStreamerFullScreenVideoHandler(); + ~GStreamerFullScreenVideoHandler() { } + void setVideoElement(HTMLVideoElement*); + + void enterFullScreen(); + void exitFullScreen(); + +public Q_SLOTS: + void windowClosed(); + +private: + HTMLVideoElement* m_videoElement; + FullScreenVideoWindow* m_fullScreenWidget; +}; +#endif + +// We do not use ENABLE or USE because moc does not expand these macros. +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA class DefaultFullScreenVideoHandler : public QWebFullScreenVideoHandler { Q_OBJECT public: @@ -51,6 +79,7 @@ private: static bool s_shouldForceFullScreenVideoPlayback; FullScreenVideoWidget *m_fullScreenWidget; }; +#endif class FullScreenVideoQt : public QObject { Q_OBJECT @@ -61,11 +90,12 @@ public: virtual void enterFullScreenForNode(Node*); virtual void exitFullScreenForNode(Node*); bool requiresFullScreenForVideoPlayback(); - bool isValid() const { return m_FullScreenVideoHandler; } + bool isValid() const; private: +#if USE(QT_MULTIMEDIA) MediaPlayerPrivateQt* mediaPlayer(); - MediaPlayerPrivateQt* mediaPlayerForNode(Node* = 0); +#endif private slots: void aboutToClose(); @@ -73,7 +103,12 @@ private slots: private: ChromeClientQt* m_chromeClient; HTMLVideoElement* m_videoElement; +#if USE(QT_MULTIMEDIA) QWebFullScreenVideoHandler* m_FullScreenVideoHandler; +#endif +#if USE(GSTREAMER) + GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer; +#endif }; } diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp index 6b557db..36ec697 100644 --- a/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp +++ b/Source/WebKit/qt/WebCoreSupport/InspectorClientQt.cpp @@ -32,6 +32,7 @@ #include "InspectorClientQt.h" #include "Frame.h" +#include "FrameView.h" #include "InspectorController.h" #include "InspectorFrontend.h" #include "InspectorServerQt.h" @@ -262,12 +263,17 @@ void InspectorClientQt::detachRemoteFrontend() void InspectorClientQt::highlight(Node*) { - notImplemented(); + hideHighlight(); } void InspectorClientQt::hideHighlight() { - notImplemented(); + WebCore::Frame* frame = m_inspectedWebPage->d->page->mainFrame(); + if (frame) { + QRect rect = m_inspectedWebPage->mainFrame()->geometry(); + if (!rect.isEmpty()) + frame->view()->invalidateRect(rect); + } } bool InspectorClientQt::sendMessageToFrontend(const String& message) diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp index ea56134..12204ac 100644 --- a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp +++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp @@ -127,7 +127,7 @@ QWebTouchModifier* QtPlatformPlugin::createTouchModifier() return p ? static_cast<QWebTouchModifier*>(p->createExtension(QWebKitPlatformPlugin::TouchInteraction)) : 0; } -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) QWebFullScreenVideoHandler* QtPlatformPlugin::createFullScreenVideoHandler() { QWebKitPlatformPlugin* p = plugin(); diff --git a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h index 71ee2bb..685195d 100644 --- a/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h +++ b/Source/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h @@ -29,7 +29,7 @@ class QWebNotificationPresenter; class QWebHapticFeedbackPlayer; class QWebSelectData; class QWebTouchModifier; -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) class QWebFullScreenVideoHandler; #endif @@ -44,7 +44,7 @@ public: QWebNotificationPresenter* createNotificationPresenter(); QWebHapticFeedbackPlayer* createHapticFeedbackPlayer(); QWebTouchModifier* createTouchModifier(); -#if ENABLE(VIDEO) && ENABLE(QT_MULTIMEDIA) +#if ENABLE(VIDEO) && USE(QT_MULTIMEDIA) QWebFullScreenVideoHandler* createFullScreenVideoHandler(); #endif diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp index 320079f..b3ff4c1 100644 --- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp +++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.cpp @@ -210,7 +210,7 @@ MultipleSelectionPopup::MultipleSelectionPopup(const QWebSelectData& data) resize(size().width(), visibleItemCount * gMaemoListItemSize); } -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA FullScreenVideoWidget::FullScreenVideoWidget(QMediaPlayer* player) : QVideoWidget() , m_mediaPlayer(player) @@ -286,7 +286,7 @@ bool WebPlugin::supportsExtension(Extension extension) const #endif case TouchInteraction: return true; -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA case FullScreenVideoPlayer: return true; #endif @@ -306,7 +306,7 @@ QObject* WebPlugin::createExtension(Extension extension) const #endif case TouchInteraction: return new TouchModifier(); -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA case FullScreenVideoPlayer: return new FullScreenVideoHandler(); #endif diff --git a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h index 4994669..a739ee9 100644 --- a/Source/WebKit/qt/examples/platformplugin/WebPlugin.h +++ b/Source/WebKit/qt/examples/platformplugin/WebPlugin.h @@ -24,7 +24,7 @@ #include "WebNotificationPresenter.h" #include <QDialog> -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA #include <QVideoWidget> #endif @@ -97,7 +97,7 @@ public: } }; -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA class FullScreenVideoWidget : public QVideoWidget { Q_OBJECT public: diff --git a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro index ccc0b3a..80cecb3 100644 --- a/Source/WebKit/qt/examples/platformplugin/platformplugin.pro +++ b/Source/WebKit/qt/examples/platformplugin/platformplugin.pro @@ -14,8 +14,8 @@ load(mobilityconfig, true) MOBILITY += multimedia DEFINES -= ENABLE_VIDEO=0 DEFINES += ENABLE_VIDEO=1 - DEFINES -= ENABLE_QT_MULTIMEDIA=0 - DEFINES += ENABLE_QT_MULTIMEDIA=1 + DEFINES -= WTF_USE_QT_MULTIMEDIA=0 + DEFINES += WTF_USE_QT_MULTIMEDIA=1 } } diff --git a/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h index 2a94e0c..7a76fe7 100644 --- a/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h +++ b/Source/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h @@ -28,7 +28,7 @@ #include <QObject> #include <QUrl> -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA #include <QMediaPlayer> #endif @@ -118,7 +118,7 @@ public: virtual unsigned hitTestPaddingForTouch(const PaddingDirection) const = 0; }; -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA class QWebFullScreenVideoHandler : public QObject { Q_OBJECT public: diff --git a/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro b/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro new file mode 100644 index 0000000..53d80c8 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/MIMESniffing.pro @@ -0,0 +1,19 @@ +isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../.. +include(../tests.pri) +TARGET = MIMESniffing +CONFIG += console + +SOURCES += ../../../../WebCore/platform/network/MIMESniffing.cpp +HEADERS += \ + ../../../../WebCore/platform/network/MIMESniffing.h \ + TestData.h + +INCLUDEPATH += \ + ../../../../WebCore/platform/network \ + ../../../../JavaScriptCore + +debug { + SOURCES += ../../../../JavaScriptCore/wtf/Assertions.cpp +} + +RESOURCES += resources.qrc diff --git a/Source/WebKit/qt/tests/MIMESniffing/TestData.h b/Source/WebKit/qt/tests/MIMESniffing/TestData.h new file mode 100644 index 0000000..c04bd6b --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/TestData.h @@ -0,0 +1,984 @@ +/* + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef TestData_h +#define TestData_h + +typedef struct _TestData { + const char* file; + const char* advertisedType; + bool isImage; + const char* sniffedType; +} TestData; + +static const TestData testList[] = { + {":/application_atom+xml", "text/plain", false, "text/plain"}, + {":/application_atom+xml", "text/plain", true, "text/plain"}, + {":/application_atom+xml", "unknown/unknown", false, "text/xml"}, + {":/application_atom+xml", "unknown/unknown", true, "text/xml"}, + {":/application_atom+xml", "application/unknown", false, "text/xml"}, + {":/application_atom+xml", "application/unknown", true, "text/xml"}, + {":/application_atom+xml", "*/*", false, "text/xml"}, + {":/application_atom+xml", "*/*", true, "text/xml"}, + {":/application_atom+xml", "text/xml", false, 0}, + {":/application_atom+xml", "text/xml", true, 0}, + {":/application_atom+xml", "application/xml", false, 0}, + {":/application_atom+xml", "application/xml", true, 0}, + {":/application_atom+xml", "text/html", false, "application/atom+xml"}, + {":/application_atom+xml", "text/html", true, 0}, + {":/application_atom+xml", "text/xml", false, 0}, + {":/application_atom+xml", "text/xml", true, 0}, + {":/application_atom+xml", "application/pdf", false, 0}, + {":/application_atom+xml", "application/pdf", true, 0}, + {":/application_atom+xml", "application/postscript", false, 0}, + {":/application_atom+xml", "application/postscript", true, 0}, + {":/application_atom+xml", "application/ogg", false, 0}, + {":/application_atom+xml", "application/ogg", true, 0}, + {":/application_atom+xml", "video/webm", false, 0}, + {":/application_atom+xml", "video/webm", true, 0}, + {":/application_atom+xml", "application/x-rar-compressed", false, 0}, + {":/application_atom+xml", "application/x-rar-compressed", true, 0}, + {":/application_atom+xml", "application/zip", false, 0}, + {":/application_atom+xml", "application/zip", true, 0}, + {":/application_atom+xml", "application/x-gzip", false, 0}, + {":/application_atom+xml", "application/x-gzip", true, 0}, + {":/application_atom+xml", "audio/x-wave", false, 0}, + {":/application_atom+xml", "audio/x-wave", true, 0}, + {":/application_atom+xml", "image/webp", false, 0}, + {":/application_atom+xml", "image/webp", true, 0}, + {":/application_atom+xml", "image/gif", false, 0}, + {":/application_atom+xml", "image/gif", true, 0}, + {":/application_atom+xml", "image/png", false, 0}, + {":/application_atom+xml", "image/png", true, 0}, + {":/application_atom+xml", "image/jpeg", false, 0}, + {":/application_atom+xml", "image/jpeg", true, 0}, + {":/application_atom+xml", "image/bmp", false, 0}, + {":/application_atom+xml", "image/bmp", true, 0}, + {":/application_atom+xml", "image/vnd.microsoft.icon", false, 0}, + {":/application_atom+xml", "image/vnd.microsoft.icon", true, 0}, + {":/application_atom+xml", "application/rdf+xml", false, 0}, + {":/application_atom+xml", "application/rdf+xml", true, 0}, + {":/application_atom+xml", "application/rss+xml", false, 0}, + {":/application_atom+xml", "application/rss+xml", true, 0}, + {":/application_atom+xml", "application/atom+xml", false, 0}, + {":/application_atom+xml", "application/atom+xml", true, 0}, + {":/application_ogg", "text/plain", false, "application/ogg"}, + {":/application_ogg", "text/plain", true, "application/ogg"}, + {":/application_ogg", "unknown/unknown", false, "application/ogg"}, + {":/application_ogg", "unknown/unknown", true, "application/ogg"}, + {":/application_ogg", "application/unknown", false, "application/ogg"}, + {":/application_ogg", "application/unknown", true, "application/ogg"}, + {":/application_ogg", "*/*", false, "application/ogg"}, + {":/application_ogg", "*/*", true, "application/ogg"}, + {":/application_ogg", "text/xml", false, 0}, + {":/application_ogg", "text/xml", true, 0}, + {":/application_ogg", "application/xml", false, 0}, + {":/application_ogg", "application/xml", true, 0}, + {":/application_ogg", "text/html", false, 0}, + {":/application_ogg", "text/html", true, 0}, + {":/application_ogg", "text/xml", false, 0}, + {":/application_ogg", "text/xml", true, 0}, + {":/application_ogg", "application/pdf", false, 0}, + {":/application_ogg", "application/pdf", true, 0}, + {":/application_ogg", "application/postscript", false, 0}, + {":/application_ogg", "application/postscript", true, 0}, + {":/application_ogg", "application/ogg", false, 0}, + {":/application_ogg", "application/ogg", true, 0}, + {":/application_ogg", "video/webm", false, 0}, + {":/application_ogg", "video/webm", true, 0}, + {":/application_ogg", "application/x-rar-compressed", false, 0}, + {":/application_ogg", "application/x-rar-compressed", true, 0}, + {":/application_ogg", "application/zip", false, 0}, + {":/application_ogg", "application/zip", true, 0}, + {":/application_ogg", "application/x-gzip", false, 0}, + {":/application_ogg", "application/x-gzip", true, 0}, + {":/application_ogg", "audio/x-wave", false, 0}, + {":/application_ogg", "audio/x-wave", true, 0}, + {":/application_ogg", "image/webp", false, 0}, + {":/application_ogg", "image/webp", true, 0}, + {":/application_ogg", "image/gif", false, 0}, + {":/application_ogg", "image/gif", true, 0}, + {":/application_ogg", "image/png", false, 0}, + {":/application_ogg", "image/png", true, 0}, + {":/application_ogg", "image/jpeg", false, 0}, + {":/application_ogg", "image/jpeg", true, 0}, + {":/application_ogg", "image/bmp", false, 0}, + {":/application_ogg", "image/bmp", true, 0}, + {":/application_ogg", "image/vnd.microsoft.icon", false, 0}, + {":/application_ogg", "image/vnd.microsoft.icon", true, 0}, + {":/application_ogg", "application/rdf+xml", false, 0}, + {":/application_ogg", "application/rdf+xml", true, 0}, + {":/application_ogg", "application/rss+xml", false, 0}, + {":/application_ogg", "application/rss+xml", true, 0}, + {":/application_ogg", "application/atom+xml", false, 0}, + {":/application_ogg", "application/atom+xml", true, 0}, + {":/application_pdf", "text/plain", false, "application/octet-stream"}, + {":/application_pdf", "text/plain", true, "application/octet-stream"}, + {":/application_pdf", "unknown/unknown", false, "application/pdf"}, + {":/application_pdf", "unknown/unknown", true, "application/pdf"}, + {":/application_pdf", "application/unknown", false, "application/pdf"}, + {":/application_pdf", "application/unknown", true, "application/pdf"}, + {":/application_pdf", "*/*", false, "application/pdf"}, + {":/application_pdf", "*/*", true, "application/pdf"}, + {":/application_pdf", "text/xml", false, 0}, + {":/application_pdf", "text/xml", true, 0}, + {":/application_pdf", "application/xml", false, 0}, + {":/application_pdf", "application/xml", true, 0}, + {":/application_pdf", "text/html", false, 0}, + {":/application_pdf", "text/html", true, 0}, + {":/application_pdf", "text/xml", false, 0}, + {":/application_pdf", "text/xml", true, 0}, + {":/application_pdf", "application/pdf", false, 0}, + {":/application_pdf", "application/pdf", true, 0}, + {":/application_pdf", "application/postscript", false, 0}, + {":/application_pdf", "application/postscript", true, 0}, + {":/application_pdf", "application/ogg", false, 0}, + {":/application_pdf", "application/ogg", true, 0}, + {":/application_pdf", "video/webm", false, 0}, + {":/application_pdf", "video/webm", true, 0}, + {":/application_pdf", "application/x-rar-compressed", false, 0}, + {":/application_pdf", "application/x-rar-compressed", true, 0}, + {":/application_pdf", "application/zip", false, 0}, + {":/application_pdf", "application/zip", true, 0}, + {":/application_pdf", "application/x-gzip", false, 0}, + {":/application_pdf", "application/x-gzip", true, 0}, + {":/application_pdf", "audio/x-wave", false, 0}, + {":/application_pdf", "audio/x-wave", true, 0}, + {":/application_pdf", "image/webp", false, 0}, + {":/application_pdf", "image/webp", true, 0}, + {":/application_pdf", "image/gif", false, 0}, + {":/application_pdf", "image/gif", true, 0}, + {":/application_pdf", "image/png", false, 0}, + {":/application_pdf", "image/png", true, 0}, + {":/application_pdf", "image/jpeg", false, 0}, + {":/application_pdf", "image/jpeg", true, 0}, + {":/application_pdf", "image/bmp", false, 0}, + {":/application_pdf", "image/bmp", true, 0}, + {":/application_pdf", "image/vnd.microsoft.icon", false, 0}, + {":/application_pdf", "image/vnd.microsoft.icon", true, 0}, + {":/application_pdf", "application/rdf+xml", false, 0}, + {":/application_pdf", "application/rdf+xml", true, 0}, + {":/application_pdf", "application/rss+xml", false, 0}, + {":/application_pdf", "application/rss+xml", true, 0}, + {":/application_pdf", "application/atom+xml", false, 0}, + {":/application_pdf", "application/atom+xml", true, 0}, + {":/application_postscript", "text/plain", false, "text/plain"}, + {":/application_postscript", "text/plain", true, "text/plain"}, + {":/application_postscript", "unknown/unknown", false, "application/postscript"}, + {":/application_postscript", "unknown/unknown", true, "application/postscript"}, + {":/application_postscript", "application/unknown", false, "application/postscript"}, + {":/application_postscript", "application/unknown", true, "application/postscript"}, + {":/application_postscript", "*/*", false, "application/postscript"}, + {":/application_postscript", "*/*", true, "application/postscript"}, + {":/application_postscript", "text/xml", false, 0}, + {":/application_postscript", "text/xml", true, 0}, + {":/application_postscript", "application/xml", false, 0}, + {":/application_postscript", "application/xml", true, 0}, + {":/application_postscript", "text/html", false, 0}, + {":/application_postscript", "text/html", true, 0}, + {":/application_postscript", "text/xml", false, 0}, + {":/application_postscript", "text/xml", true, 0}, + {":/application_postscript", "application/pdf", false, 0}, + {":/application_postscript", "application/pdf", true, 0}, + {":/application_postscript", "application/postscript", false, 0}, + {":/application_postscript", "application/postscript", true, 0}, + {":/application_postscript", "application/ogg", false, 0}, + {":/application_postscript", "application/ogg", true, 0}, + {":/application_postscript", "video/webm", false, 0}, + {":/application_postscript", "video/webm", true, 0}, + {":/application_postscript", "application/x-rar-compressed", false, 0}, + {":/application_postscript", "application/x-rar-compressed", true, 0}, + {":/application_postscript", "application/zip", false, 0}, + {":/application_postscript", "application/zip", true, 0}, + {":/application_postscript", "application/x-gzip", false, 0}, + {":/application_postscript", "application/x-gzip", true, 0}, + {":/application_postscript", "audio/x-wave", false, 0}, + {":/application_postscript", "audio/x-wave", true, 0}, + {":/application_postscript", "image/webp", false, 0}, + {":/application_postscript", "image/webp", true, 0}, + {":/application_postscript", "image/gif", false, 0}, + {":/application_postscript", "image/gif", true, 0}, + {":/application_postscript", "image/png", false, 0}, + {":/application_postscript", "image/png", true, 0}, + {":/application_postscript", "image/jpeg", false, 0}, + {":/application_postscript", "image/jpeg", true, 0}, + {":/application_postscript", "image/bmp", false, 0}, + {":/application_postscript", "image/bmp", true, 0}, + {":/application_postscript", "image/vnd.microsoft.icon", false, 0}, + {":/application_postscript", "image/vnd.microsoft.icon", true, 0}, + {":/application_postscript", "application/rdf+xml", false, 0}, + {":/application_postscript", "application/rdf+xml", true, 0}, + {":/application_postscript", "application/rss+xml", false, 0}, + {":/application_postscript", "application/rss+xml", true, 0}, + {":/application_postscript", "application/atom+xml", false, 0}, + {":/application_postscript", "application/atom+xml", true, 0}, + {":/application_rdf+xml", "text/plain", false, "text/plain"}, + {":/application_rdf+xml", "text/plain", true, "text/plain"}, + {":/application_rdf+xml", "unknown/unknown", false, "text/xml"}, + {":/application_rdf+xml", "unknown/unknown", true, "text/xml"}, + {":/application_rdf+xml", "application/unknown", false, "text/xml"}, + {":/application_rdf+xml", "application/unknown", true, "text/xml"}, + {":/application_rdf+xml", "*/*", false, "text/xml"}, + {":/application_rdf+xml", "*/*", true, "text/xml"}, + {":/application_rdf+xml", "text/xml", false, 0}, + {":/application_rdf+xml", "text/xml", true, 0}, + {":/application_rdf+xml", "application/xml", false, 0}, + {":/application_rdf+xml", "application/xml", true, 0}, + {":/application_rdf+xml", "text/html", false, "application/rdf+xml"}, + {":/application_rdf+xml", "text/html", true, 0}, + {":/application_rdf+xml", "text/xml", false, 0}, + {":/application_rdf+xml", "text/xml", true, 0}, + {":/application_rdf+xml", "application/pdf", false, 0}, + {":/application_rdf+xml", "application/pdf", true, 0}, + {":/application_rdf+xml", "application/postscript", false, 0}, + {":/application_rdf+xml", "application/postscript", true, 0}, + {":/application_rdf+xml", "application/ogg", false, 0}, + {":/application_rdf+xml", "application/ogg", true, 0}, + {":/application_rdf+xml", "video/webm", false, 0}, + {":/application_rdf+xml", "video/webm", true, 0}, + {":/application_rdf+xml", "application/x-rar-compressed", false, 0}, + {":/application_rdf+xml", "application/x-rar-compressed", true, 0}, + {":/application_rdf+xml", "application/zip", false, 0}, + {":/application_rdf+xml", "application/zip", true, 0}, + {":/application_rdf+xml", "application/x-gzip", false, 0}, + {":/application_rdf+xml", "application/x-gzip", true, 0}, + {":/application_rdf+xml", "audio/x-wave", false, 0}, + {":/application_rdf+xml", "audio/x-wave", true, 0}, + {":/application_rdf+xml", "image/webp", false, 0}, + {":/application_rdf+xml", "image/webp", true, 0}, + {":/application_rdf+xml", "image/gif", false, 0}, + {":/application_rdf+xml", "image/gif", true, 0}, + {":/application_rdf+xml", "image/png", false, 0}, + {":/application_rdf+xml", "image/png", true, 0}, + {":/application_rdf+xml", "image/jpeg", false, 0}, + {":/application_rdf+xml", "image/jpeg", true, 0}, + {":/application_rdf+xml", "image/bmp", false, 0}, + {":/application_rdf+xml", "image/bmp", true, 0}, + {":/application_rdf+xml", "image/vnd.microsoft.icon", false, 0}, + {":/application_rdf+xml", "image/vnd.microsoft.icon", true, 0}, + {":/application_rdf+xml", "application/rdf+xml", false, 0}, + {":/application_rdf+xml", "application/rdf+xml", true, 0}, + {":/application_rdf+xml", "application/rss+xml", false, 0}, + {":/application_rdf+xml", "application/rss+xml", true, 0}, + {":/application_rdf+xml", "application/atom+xml", false, 0}, + {":/application_rdf+xml", "application/atom+xml", true, 0}, + {":/application_rss+xml", "text/plain", false, "text/plain"}, + {":/application_rss+xml", "text/plain", true, "text/plain"}, + {":/application_rss+xml", "unknown/unknown", false, "text/xml"}, + {":/application_rss+xml", "unknown/unknown", true, "text/xml"}, + {":/application_rss+xml", "application/unknown", false, "text/xml"}, + {":/application_rss+xml", "application/unknown", true, "text/xml"}, + {":/application_rss+xml", "*/*", false, "text/xml"}, + {":/application_rss+xml", "*/*", true, "text/xml"}, + {":/application_rss+xml", "text/xml", false, 0}, + {":/application_rss+xml", "text/xml", true, 0}, + {":/application_rss+xml", "application/xml", false, 0}, + {":/application_rss+xml", "application/xml", true, 0}, + {":/application_rss+xml", "text/html", false, "application/rss+xml"}, + {":/application_rss+xml", "text/html", true, 0}, + {":/application_rss+xml", "text/xml", false, 0}, + {":/application_rss+xml", "text/xml", true, 0}, + {":/application_rss+xml", "application/pdf", false, 0}, + {":/application_rss+xml", "application/pdf", true, 0}, + {":/application_rss+xml", "application/postscript", false, 0}, + {":/application_rss+xml", "application/postscript", true, 0}, + {":/application_rss+xml", "application/ogg", false, 0}, + {":/application_rss+xml", "application/ogg", true, 0}, + {":/application_rss+xml", "video/webm", false, 0}, + {":/application_rss+xml", "video/webm", true, 0}, + {":/application_rss+xml", "application/x-rar-compressed", false, 0}, + {":/application_rss+xml", "application/x-rar-compressed", true, 0}, + {":/application_rss+xml", "application/zip", false, 0}, + {":/application_rss+xml", "application/zip", true, 0}, + {":/application_rss+xml", "application/x-gzip", false, 0}, + {":/application_rss+xml", "application/x-gzip", true, 0}, + {":/application_rss+xml", "audio/x-wave", false, 0}, + {":/application_rss+xml", "audio/x-wave", true, 0}, + {":/application_rss+xml", "image/webp", false, 0}, + {":/application_rss+xml", "image/webp", true, 0}, + {":/application_rss+xml", "image/gif", false, 0}, + {":/application_rss+xml", "image/gif", true, 0}, + {":/application_rss+xml", "image/png", false, 0}, + {":/application_rss+xml", "image/png", true, 0}, + {":/application_rss+xml", "image/jpeg", false, 0}, + {":/application_rss+xml", "image/jpeg", true, 0}, + {":/application_rss+xml", "image/bmp", false, 0}, + {":/application_rss+xml", "image/bmp", true, 0}, + {":/application_rss+xml", "image/vnd.microsoft.icon", false, 0}, + {":/application_rss+xml", "image/vnd.microsoft.icon", true, 0}, + {":/application_rss+xml", "application/rdf+xml", false, 0}, + {":/application_rss+xml", "application/rdf+xml", true, 0}, + {":/application_rss+xml", "application/rss+xml", false, 0}, + {":/application_rss+xml", "application/rss+xml", true, 0}, + {":/application_rss+xml", "application/atom+xml", false, 0}, + {":/application_rss+xml", "application/atom+xml", true, 0}, + {":/application_x-gzip", "text/plain", false, "application/x-gzip"}, + {":/application_x-gzip", "text/plain", true, "application/x-gzip"}, + {":/application_x-gzip", "unknown/unknown", false, "application/x-gzip"}, + {":/application_x-gzip", "unknown/unknown", true, "application/x-gzip"}, + {":/application_x-gzip", "application/unknown", false, "application/x-gzip"}, + {":/application_x-gzip", "application/unknown", true, "application/x-gzip"}, + {":/application_x-gzip", "*/*", false, "application/x-gzip"}, + {":/application_x-gzip", "*/*", true, "application/x-gzip"}, + {":/application_x-gzip", "text/xml", false, 0}, + {":/application_x-gzip", "text/xml", true, 0}, + {":/application_x-gzip", "application/xml", false, 0}, + {":/application_x-gzip", "application/xml", true, 0}, + {":/application_x-gzip", "text/html", false, 0}, + {":/application_x-gzip", "text/html", true, 0}, + {":/application_x-gzip", "text/xml", false, 0}, + {":/application_x-gzip", "text/xml", true, 0}, + {":/application_x-gzip", "application/pdf", false, 0}, + {":/application_x-gzip", "application/pdf", true, 0}, + {":/application_x-gzip", "application/postscript", false, 0}, + {":/application_x-gzip", "application/postscript", true, 0}, + {":/application_x-gzip", "application/ogg", false, 0}, + {":/application_x-gzip", "application/ogg", true, 0}, + {":/application_x-gzip", "video/webm", false, 0}, + {":/application_x-gzip", "video/webm", true, 0}, + {":/application_x-gzip", "application/x-rar-compressed", false, 0}, + {":/application_x-gzip", "application/x-rar-compressed", true, 0}, + {":/application_x-gzip", "application/zip", false, 0}, + {":/application_x-gzip", "application/zip", true, 0}, + {":/application_x-gzip", "application/x-gzip", false, 0}, + {":/application_x-gzip", "application/x-gzip", true, 0}, + {":/application_x-gzip", "audio/x-wave", false, 0}, + {":/application_x-gzip", "audio/x-wave", true, 0}, + {":/application_x-gzip", "image/webp", false, 0}, + {":/application_x-gzip", "image/webp", true, 0}, + {":/application_x-gzip", "image/gif", false, 0}, + {":/application_x-gzip", "image/gif", true, 0}, + {":/application_x-gzip", "image/png", false, 0}, + {":/application_x-gzip", "image/png", true, 0}, + {":/application_x-gzip", "image/jpeg", false, 0}, + {":/application_x-gzip", "image/jpeg", true, 0}, + {":/application_x-gzip", "image/bmp", false, 0}, + {":/application_x-gzip", "image/bmp", true, 0}, + {":/application_x-gzip", "image/vnd.microsoft.icon", false, 0}, + {":/application_x-gzip", "image/vnd.microsoft.icon", true, 0}, + {":/application_x-gzip", "application/rdf+xml", false, 0}, + {":/application_x-gzip", "application/rdf+xml", true, 0}, + {":/application_x-gzip", "application/rss+xml", false, 0}, + {":/application_x-gzip", "application/rss+xml", true, 0}, + {":/application_x-gzip", "application/atom+xml", false, 0}, + {":/application_x-gzip", "application/atom+xml", true, 0}, + {":/application_x-rar-compressed", "text/plain", false, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "text/plain", true, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "unknown/unknown", false, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "unknown/unknown", true, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "application/unknown", false, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "application/unknown", true, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "*/*", false, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "*/*", true, "application/x-rar-compressed"}, + {":/application_x-rar-compressed", "text/xml", false, 0}, + {":/application_x-rar-compressed", "text/xml", true, 0}, + {":/application_x-rar-compressed", "application/xml", false, 0}, + {":/application_x-rar-compressed", "application/xml", true, 0}, + {":/application_x-rar-compressed", "text/html", false, 0}, + {":/application_x-rar-compressed", "text/html", true, 0}, + {":/application_x-rar-compressed", "text/xml", false, 0}, + {":/application_x-rar-compressed", "text/xml", true, 0}, + {":/application_x-rar-compressed", "application/pdf", false, 0}, + {":/application_x-rar-compressed", "application/pdf", true, 0}, + {":/application_x-rar-compressed", "application/postscript", false, 0}, + {":/application_x-rar-compressed", "application/postscript", true, 0}, + {":/application_x-rar-compressed", "application/ogg", false, 0}, + {":/application_x-rar-compressed", "application/ogg", true, 0}, + {":/application_x-rar-compressed", "video/webm", false, 0}, + {":/application_x-rar-compressed", "video/webm", true, 0}, + {":/application_x-rar-compressed", "application/x-rar-compressed", false, 0}, + {":/application_x-rar-compressed", "application/x-rar-compressed", true, 0}, + {":/application_x-rar-compressed", "application/zip", false, 0}, + {":/application_x-rar-compressed", "application/zip", true, 0}, + {":/application_x-rar-compressed", "application/x-gzip", false, 0}, + {":/application_x-rar-compressed", "application/x-gzip", true, 0}, + {":/application_x-rar-compressed", "audio/x-wave", false, 0}, + {":/application_x-rar-compressed", "audio/x-wave", true, 0}, + {":/application_x-rar-compressed", "image/webp", false, 0}, + {":/application_x-rar-compressed", "image/webp", true, 0}, + {":/application_x-rar-compressed", "image/gif", false, 0}, + {":/application_x-rar-compressed", "image/gif", true, 0}, + {":/application_x-rar-compressed", "image/png", false, 0}, + {":/application_x-rar-compressed", "image/png", true, 0}, + {":/application_x-rar-compressed", "image/jpeg", false, 0}, + {":/application_x-rar-compressed", "image/jpeg", true, 0}, + {":/application_x-rar-compressed", "image/bmp", false, 0}, + {":/application_x-rar-compressed", "image/bmp", true, 0}, + {":/application_x-rar-compressed", "image/vnd.microsoft.icon", false, 0}, + {":/application_x-rar-compressed", "image/vnd.microsoft.icon", true, 0}, + {":/application_x-rar-compressed", "application/rdf+xml", false, 0}, + {":/application_x-rar-compressed", "application/rdf+xml", true, 0}, + {":/application_x-rar-compressed", "application/rss+xml", false, 0}, + {":/application_x-rar-compressed", "application/rss+xml", true, 0}, + {":/application_x-rar-compressed", "application/atom+xml", false, 0}, + {":/application_x-rar-compressed", "application/atom+xml", true, 0}, + {":/application_zip", "text/plain", false, "application/zip"}, + {":/application_zip", "text/plain", true, "application/zip"}, + {":/application_zip", "unknown/unknown", false, "application/zip"}, + {":/application_zip", "unknown/unknown", true, "application/zip"}, + {":/application_zip", "application/unknown", false, "application/zip"}, + {":/application_zip", "application/unknown", true, "application/zip"}, + {":/application_zip", "*/*", false, "application/zip"}, + {":/application_zip", "*/*", true, "application/zip"}, + {":/application_zip", "text/xml", false, 0}, + {":/application_zip", "text/xml", true, 0}, + {":/application_zip", "application/xml", false, 0}, + {":/application_zip", "application/xml", true, 0}, + {":/application_zip", "text/html", false, 0}, + {":/application_zip", "text/html", true, 0}, + {":/application_zip", "text/xml", false, 0}, + {":/application_zip", "text/xml", true, 0}, + {":/application_zip", "application/pdf", false, 0}, + {":/application_zip", "application/pdf", true, 0}, + {":/application_zip", "application/postscript", false, 0}, + {":/application_zip", "application/postscript", true, 0}, + {":/application_zip", "application/ogg", false, 0}, + {":/application_zip", "application/ogg", true, 0}, + {":/application_zip", "video/webm", false, 0}, + {":/application_zip", "video/webm", true, 0}, + {":/application_zip", "application/x-rar-compressed", false, 0}, + {":/application_zip", "application/x-rar-compressed", true, 0}, + {":/application_zip", "application/zip", false, 0}, + {":/application_zip", "application/zip", true, 0}, + {":/application_zip", "application/x-gzip", false, 0}, + {":/application_zip", "application/x-gzip", true, 0}, + {":/application_zip", "audio/x-wave", false, 0}, + {":/application_zip", "audio/x-wave", true, 0}, + {":/application_zip", "image/webp", false, 0}, + {":/application_zip", "image/webp", true, 0}, + {":/application_zip", "image/gif", false, 0}, + {":/application_zip", "image/gif", true, 0}, + {":/application_zip", "image/png", false, 0}, + {":/application_zip", "image/png", true, 0}, + {":/application_zip", "image/jpeg", false, 0}, + {":/application_zip", "image/jpeg", true, 0}, + {":/application_zip", "image/bmp", false, 0}, + {":/application_zip", "image/bmp", true, 0}, + {":/application_zip", "image/vnd.microsoft.icon", false, 0}, + {":/application_zip", "image/vnd.microsoft.icon", true, 0}, + {":/application_zip", "application/rdf+xml", false, 0}, + {":/application_zip", "application/rdf+xml", true, 0}, + {":/application_zip", "application/rss+xml", false, 0}, + {":/application_zip", "application/rss+xml", true, 0}, + {":/application_zip", "application/atom+xml", false, 0}, + {":/application_zip", "application/atom+xml", true, 0}, + {":/audio_x-wave", "text/plain", false, "audio/x-wave"}, + {":/audio_x-wave", "text/plain", true, "audio/x-wave"}, + {":/audio_x-wave", "unknown/unknown", false, "audio/x-wave"}, + {":/audio_x-wave", "unknown/unknown", true, "audio/x-wave"}, + {":/audio_x-wave", "application/unknown", false, "audio/x-wave"}, + {":/audio_x-wave", "application/unknown", true, "audio/x-wave"}, + {":/audio_x-wave", "*/*", false, "audio/x-wave"}, + {":/audio_x-wave", "*/*", true, "audio/x-wave"}, + {":/audio_x-wave", "text/xml", false, 0}, + {":/audio_x-wave", "text/xml", true, 0}, + {":/audio_x-wave", "application/xml", false, 0}, + {":/audio_x-wave", "application/xml", true, 0}, + {":/audio_x-wave", "text/html", false, 0}, + {":/audio_x-wave", "text/html", true, 0}, + {":/audio_x-wave", "text/xml", false, 0}, + {":/audio_x-wave", "text/xml", true, 0}, + {":/audio_x-wave", "application/pdf", false, 0}, + {":/audio_x-wave", "application/pdf", true, 0}, + {":/audio_x-wave", "application/postscript", false, 0}, + {":/audio_x-wave", "application/postscript", true, 0}, + {":/audio_x-wave", "application/ogg", false, 0}, + {":/audio_x-wave", "application/ogg", true, 0}, + {":/audio_x-wave", "video/webm", false, 0}, + {":/audio_x-wave", "video/webm", true, 0}, + {":/audio_x-wave", "application/x-rar-compressed", false, 0}, + {":/audio_x-wave", "application/x-rar-compressed", true, 0}, + {":/audio_x-wave", "application/zip", false, 0}, + {":/audio_x-wave", "application/zip", true, 0}, + {":/audio_x-wave", "application/x-gzip", false, 0}, + {":/audio_x-wave", "application/x-gzip", true, 0}, + {":/audio_x-wave", "audio/x-wave", false, 0}, + {":/audio_x-wave", "audio/x-wave", true, 0}, + {":/audio_x-wave", "image/webp", false, 0}, + {":/audio_x-wave", "image/webp", true, 0}, + {":/audio_x-wave", "image/gif", false, 0}, + {":/audio_x-wave", "image/gif", true, 0}, + {":/audio_x-wave", "image/png", false, 0}, + {":/audio_x-wave", "image/png", true, 0}, + {":/audio_x-wave", "image/jpeg", false, 0}, + {":/audio_x-wave", "image/jpeg", true, 0}, + {":/audio_x-wave", "image/bmp", false, 0}, + {":/audio_x-wave", "image/bmp", true, 0}, + {":/audio_x-wave", "image/vnd.microsoft.icon", false, 0}, + {":/audio_x-wave", "image/vnd.microsoft.icon", true, 0}, + {":/audio_x-wave", "application/rdf+xml", false, 0}, + {":/audio_x-wave", "application/rdf+xml", true, 0}, + {":/audio_x-wave", "application/rss+xml", false, 0}, + {":/audio_x-wave", "application/rss+xml", true, 0}, + {":/audio_x-wave", "application/atom+xml", false, 0}, + {":/audio_x-wave", "application/atom+xml", true, 0}, + {":/image_bmp", "text/plain", false, "image/bmp"}, + {":/image_bmp", "text/plain", true, "image/bmp"}, + {":/image_bmp", "unknown/unknown", false, "image/bmp"}, + {":/image_bmp", "unknown/unknown", true, "image/bmp"}, + {":/image_bmp", "application/unknown", false, "image/bmp"}, + {":/image_bmp", "application/unknown", true, "image/bmp"}, + {":/image_bmp", "*/*", false, "image/bmp"}, + {":/image_bmp", "*/*", true, "image/bmp"}, + {":/image_bmp", "text/xml", false, 0}, + {":/image_bmp", "text/xml", true, 0}, + {":/image_bmp", "application/xml", false, 0}, + {":/image_bmp", "application/xml", true, 0}, + {":/image_bmp", "text/html", false, 0}, + {":/image_bmp", "text/html", true, "image/bmp"}, + {":/image_bmp", "text/xml", false, 0}, + {":/image_bmp", "text/xml", true, 0}, + {":/image_bmp", "application/pdf", false, 0}, + {":/image_bmp", "application/pdf", true, "image/bmp"}, + {":/image_bmp", "application/postscript", false, 0}, + {":/image_bmp", "application/postscript", true, "image/bmp"}, + {":/image_bmp", "application/ogg", false, 0}, + {":/image_bmp", "application/ogg", true, "image/bmp"}, + {":/image_bmp", "video/webm", false, 0}, + {":/image_bmp", "video/webm", true, "image/bmp"}, + {":/image_bmp", "application/x-rar-compressed", false, 0}, + {":/image_bmp", "application/x-rar-compressed", true, "image/bmp"}, + {":/image_bmp", "application/zip", false, 0}, + {":/image_bmp", "application/zip", true, "image/bmp"}, + {":/image_bmp", "application/x-gzip", false, 0}, + {":/image_bmp", "application/x-gzip", true, "image/bmp"}, + {":/image_bmp", "audio/x-wave", false, 0}, + {":/image_bmp", "audio/x-wave", true, "image/bmp"}, + {":/image_bmp", "image/webp", false, 0}, + {":/image_bmp", "image/webp", true, "image/bmp"}, + {":/image_bmp", "image/gif", false, 0}, + {":/image_bmp", "image/gif", true, "image/bmp"}, + {":/image_bmp", "image/png", false, 0}, + {":/image_bmp", "image/png", true, "image/bmp"}, + {":/image_bmp", "image/jpeg", false, 0}, + {":/image_bmp", "image/jpeg", true, "image/bmp"}, + {":/image_bmp", "image/bmp", false, 0}, + {":/image_bmp", "image/bmp", true, "image/bmp"}, + {":/image_bmp", "image/vnd.microsoft.icon", false, 0}, + {":/image_bmp", "image/vnd.microsoft.icon", true, "image/bmp"}, + {":/image_bmp", "application/rdf+xml", false, 0}, + {":/image_bmp", "application/rdf+xml", true, 0}, + {":/image_bmp", "application/rss+xml", false, 0}, + {":/image_bmp", "application/rss+xml", true, 0}, + {":/image_bmp", "application/atom+xml", false, 0}, + {":/image_bmp", "application/atom+xml", true, 0}, + {":/image_gif", "text/plain", false, "image/gif"}, + {":/image_gif", "text/plain", true, "image/gif"}, + {":/image_gif", "unknown/unknown", false, "image/gif"}, + {":/image_gif", "unknown/unknown", true, "image/gif"}, + {":/image_gif", "application/unknown", false, "image/gif"}, + {":/image_gif", "application/unknown", true, "image/gif"}, + {":/image_gif", "*/*", false, "image/gif"}, + {":/image_gif", "*/*", true, "image/gif"}, + {":/image_gif", "text/xml", false, 0}, + {":/image_gif", "text/xml", true, 0}, + {":/image_gif", "application/xml", false, 0}, + {":/image_gif", "application/xml", true, 0}, + {":/image_gif", "text/html", false, 0}, + {":/image_gif", "text/html", true, "image/gif"}, + {":/image_gif", "text/xml", false, 0}, + {":/image_gif", "text/xml", true, 0}, + {":/image_gif", "application/pdf", false, 0}, + {":/image_gif", "application/pdf", true, "image/gif"}, + {":/image_gif", "application/postscript", false, 0}, + {":/image_gif", "application/postscript", true, "image/gif"}, + {":/image_gif", "application/ogg", false, 0}, + {":/image_gif", "application/ogg", true, "image/gif"}, + {":/image_gif", "video/webm", false, 0}, + {":/image_gif", "video/webm", true, "image/gif"}, + {":/image_gif", "application/x-rar-compressed", false, 0}, + {":/image_gif", "application/x-rar-compressed", true, "image/gif"}, + {":/image_gif", "application/zip", false, 0}, + {":/image_gif", "application/zip", true, "image/gif"}, + {":/image_gif", "application/x-gzip", false, 0}, + {":/image_gif", "application/x-gzip", true, "image/gif"}, + {":/image_gif", "audio/x-wave", false, 0}, + {":/image_gif", "audio/x-wave", true, "image/gif"}, + {":/image_gif", "image/webp", false, 0}, + {":/image_gif", "image/webp", true, "image/gif"}, + {":/image_gif", "image/gif", false, 0}, + {":/image_gif", "image/gif", true, "image/gif"}, + {":/image_gif", "image/png", false, 0}, + {":/image_gif", "image/png", true, "image/gif"}, + {":/image_gif", "image/jpeg", false, 0}, + {":/image_gif", "image/jpeg", true, "image/gif"}, + {":/image_gif", "image/bmp", false, 0}, + {":/image_gif", "image/bmp", true, "image/gif"}, + {":/image_gif", "image/vnd.microsoft.icon", false, 0}, + {":/image_gif", "image/vnd.microsoft.icon", true, "image/gif"}, + {":/image_gif", "application/rdf+xml", false, 0}, + {":/image_gif", "application/rdf+xml", true, 0}, + {":/image_gif", "application/rss+xml", false, 0}, + {":/image_gif", "application/rss+xml", true, 0}, + {":/image_gif", "application/atom+xml", false, 0}, + {":/image_gif", "application/atom+xml", true, 0}, + {":/image_jpeg", "text/plain", false, "image/jpeg"}, + {":/image_jpeg", "text/plain", true, "image/jpeg"}, + {":/image_jpeg", "unknown/unknown", false, "image/jpeg"}, + {":/image_jpeg", "unknown/unknown", true, "image/jpeg"}, + {":/image_jpeg", "application/unknown", false, "image/jpeg"}, + {":/image_jpeg", "application/unknown", true, "image/jpeg"}, + {":/image_jpeg", "*/*", false, "image/jpeg"}, + {":/image_jpeg", "*/*", true, "image/jpeg"}, + {":/image_jpeg", "text/xml", false, 0}, + {":/image_jpeg", "text/xml", true, 0}, + {":/image_jpeg", "application/xml", false, 0}, + {":/image_jpeg", "application/xml", true, 0}, + {":/image_jpeg", "text/html", false, 0}, + {":/image_jpeg", "text/html", true, "image/jpeg"}, + {":/image_jpeg", "text/xml", false, 0}, + {":/image_jpeg", "text/xml", true, 0}, + {":/image_jpeg", "application/pdf", false, 0}, + {":/image_jpeg", "application/pdf", true, "image/jpeg"}, + {":/image_jpeg", "application/postscript", false, 0}, + {":/image_jpeg", "application/postscript", true, "image/jpeg"}, + {":/image_jpeg", "application/ogg", false, 0}, + {":/image_jpeg", "application/ogg", true, "image/jpeg"}, + {":/image_jpeg", "video/webm", false, 0}, + {":/image_jpeg", "video/webm", true, "image/jpeg"}, + {":/image_jpeg", "application/x-rar-compressed", false, 0}, + {":/image_jpeg", "application/x-rar-compressed", true, "image/jpeg"}, + {":/image_jpeg", "application/zip", false, 0}, + {":/image_jpeg", "application/zip", true, "image/jpeg"}, + {":/image_jpeg", "application/x-gzip", false, 0}, + {":/image_jpeg", "application/x-gzip", true, "image/jpeg"}, + {":/image_jpeg", "audio/x-wave", false, 0}, + {":/image_jpeg", "audio/x-wave", true, "image/jpeg"}, + {":/image_jpeg", "image/webp", false, 0}, + {":/image_jpeg", "image/webp", true, "image/jpeg"}, + {":/image_jpeg", "image/gif", false, 0}, + {":/image_jpeg", "image/gif", true, "image/jpeg"}, + {":/image_jpeg", "image/png", false, 0}, + {":/image_jpeg", "image/png", true, "image/jpeg"}, + {":/image_jpeg", "image/jpeg", false, 0}, + {":/image_jpeg", "image/jpeg", true, "image/jpeg"}, + {":/image_jpeg", "image/bmp", false, 0}, + {":/image_jpeg", "image/bmp", true, "image/jpeg"}, + {":/image_jpeg", "image/vnd.microsoft.icon", false, 0}, + {":/image_jpeg", "image/vnd.microsoft.icon", true, "image/jpeg"}, + {":/image_jpeg", "application/rdf+xml", false, 0}, + {":/image_jpeg", "application/rdf+xml", true, 0}, + {":/image_jpeg", "application/rss+xml", false, 0}, + {":/image_jpeg", "application/rss+xml", true, 0}, + {":/image_jpeg", "application/atom+xml", false, 0}, + {":/image_jpeg", "application/atom+xml", true, 0}, + {":/image_png", "text/plain", false, "image/png"}, + {":/image_png", "text/plain", true, "image/png"}, + {":/image_png", "unknown/unknown", false, "image/png"}, + {":/image_png", "unknown/unknown", true, "image/png"}, + {":/image_png", "application/unknown", false, "image/png"}, + {":/image_png", "application/unknown", true, "image/png"}, + {":/image_png", "*/*", false, "image/png"}, + {":/image_png", "*/*", true, "image/png"}, + {":/image_png", "text/xml", false, 0}, + {":/image_png", "text/xml", true, 0}, + {":/image_png", "application/xml", false, 0}, + {":/image_png", "application/xml", true, 0}, + {":/image_png", "text/html", false, 0}, + {":/image_png", "text/html", true, "image/png"}, + {":/image_png", "text/xml", false, 0}, + {":/image_png", "text/xml", true, 0}, + {":/image_png", "application/pdf", false, 0}, + {":/image_png", "application/pdf", true, "image/png"}, + {":/image_png", "application/postscript", false, 0}, + {":/image_png", "application/postscript", true, "image/png"}, + {":/image_png", "application/ogg", false, 0}, + {":/image_png", "application/ogg", true, "image/png"}, + {":/image_png", "video/webm", false, 0}, + {":/image_png", "video/webm", true, "image/png"}, + {":/image_png", "application/x-rar-compressed", false, 0}, + {":/image_png", "application/x-rar-compressed", true, "image/png"}, + {":/image_png", "application/zip", false, 0}, + {":/image_png", "application/zip", true, "image/png"}, + {":/image_png", "application/x-gzip", false, 0}, + {":/image_png", "application/x-gzip", true, "image/png"}, + {":/image_png", "audio/x-wave", false, 0}, + {":/image_png", "audio/x-wave", true, "image/png"}, + {":/image_png", "image/webp", false, 0}, + {":/image_png", "image/webp", true, "image/png"}, + {":/image_png", "image/gif", false, 0}, + {":/image_png", "image/gif", true, "image/png"}, + {":/image_png", "image/png", false, 0}, + {":/image_png", "image/png", true, "image/png"}, + {":/image_png", "image/jpeg", false, 0}, + {":/image_png", "image/jpeg", true, "image/png"}, + {":/image_png", "image/bmp", false, 0}, + {":/image_png", "image/bmp", true, "image/png"}, + {":/image_png", "image/vnd.microsoft.icon", false, 0}, + {":/image_png", "image/vnd.microsoft.icon", true, "image/png"}, + {":/image_png", "application/rdf+xml", false, 0}, + {":/image_png", "application/rdf+xml", true, 0}, + {":/image_png", "application/rss+xml", false, 0}, + {":/image_png", "application/rss+xml", true, 0}, + {":/image_png", "application/atom+xml", false, 0}, + {":/image_png", "application/atom+xml", true, 0}, + {":/image_vnd.microsoft.icon", "text/plain", false, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "text/plain", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "unknown/unknown", false, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "unknown/unknown", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/unknown", false, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/unknown", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "*/*", false, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "*/*", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "text/xml", false, 0}, + {":/image_vnd.microsoft.icon", "text/xml", true, 0}, + {":/image_vnd.microsoft.icon", "application/xml", false, 0}, + {":/image_vnd.microsoft.icon", "application/xml", true, 0}, + {":/image_vnd.microsoft.icon", "text/html", false, 0}, + {":/image_vnd.microsoft.icon", "text/html", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "text/xml", false, 0}, + {":/image_vnd.microsoft.icon", "text/xml", true, 0}, + {":/image_vnd.microsoft.icon", "application/pdf", false, 0}, + {":/image_vnd.microsoft.icon", "application/pdf", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/postscript", false, 0}, + {":/image_vnd.microsoft.icon", "application/postscript", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/ogg", false, 0}, + {":/image_vnd.microsoft.icon", "application/ogg", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "video/webm", false, 0}, + {":/image_vnd.microsoft.icon", "video/webm", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/x-rar-compressed", false, 0}, + {":/image_vnd.microsoft.icon", "application/x-rar-compressed", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/zip", false, 0}, + {":/image_vnd.microsoft.icon", "application/zip", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/x-gzip", false, 0}, + {":/image_vnd.microsoft.icon", "application/x-gzip", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "audio/x-wave", false, 0}, + {":/image_vnd.microsoft.icon", "audio/x-wave", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/webp", false, 0}, + {":/image_vnd.microsoft.icon", "image/webp", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/gif", false, 0}, + {":/image_vnd.microsoft.icon", "image/gif", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/png", false, 0}, + {":/image_vnd.microsoft.icon", "image/png", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/jpeg", false, 0}, + {":/image_vnd.microsoft.icon", "image/jpeg", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/bmp", false, 0}, + {":/image_vnd.microsoft.icon", "image/bmp", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "image/vnd.microsoft.icon", false, 0}, + {":/image_vnd.microsoft.icon", "image/vnd.microsoft.icon", true, "image/vnd.microsoft.icon"}, + {":/image_vnd.microsoft.icon", "application/rdf+xml", false, 0}, + {":/image_vnd.microsoft.icon", "application/rdf+xml", true, 0}, + {":/image_vnd.microsoft.icon", "application/rss+xml", false, 0}, + {":/image_vnd.microsoft.icon", "application/rss+xml", true, 0}, + {":/image_vnd.microsoft.icon", "application/atom+xml", false, 0}, + {":/image_vnd.microsoft.icon", "application/atom+xml", true, 0}, + {":/image_webp", "text/plain", false, "image/webp"}, + {":/image_webp", "text/plain", true, "image/webp"}, + {":/image_webp", "unknown/unknown", false, "image/webp"}, + {":/image_webp", "unknown/unknown", true, "image/webp"}, + {":/image_webp", "application/unknown", false, "image/webp"}, + {":/image_webp", "application/unknown", true, "image/webp"}, + {":/image_webp", "*/*", false, "image/webp"}, + {":/image_webp", "*/*", true, "image/webp"}, + {":/image_webp", "text/xml", false, 0}, + {":/image_webp", "text/xml", true, 0}, + {":/image_webp", "application/xml", false, 0}, + {":/image_webp", "application/xml", true, 0}, + {":/image_webp", "text/html", false, 0}, + {":/image_webp", "text/html", true, "image/webp"}, + {":/image_webp", "text/xml", false, 0}, + {":/image_webp", "text/xml", true, 0}, + {":/image_webp", "application/pdf", false, 0}, + {":/image_webp", "application/pdf", true, "image/webp"}, + {":/image_webp", "application/postscript", false, 0}, + {":/image_webp", "application/postscript", true, "image/webp"}, + {":/image_webp", "application/ogg", false, 0}, + {":/image_webp", "application/ogg", true, "image/webp"}, + {":/image_webp", "video/webm", false, 0}, + {":/image_webp", "video/webm", true, "image/webp"}, + {":/image_webp", "application/x-rar-compressed", false, 0}, + {":/image_webp", "application/x-rar-compressed", true, "image/webp"}, + {":/image_webp", "application/zip", false, 0}, + {":/image_webp", "application/zip", true, "image/webp"}, + {":/image_webp", "application/x-gzip", false, 0}, + {":/image_webp", "application/x-gzip", true, "image/webp"}, + {":/image_webp", "audio/x-wave", false, 0}, + {":/image_webp", "audio/x-wave", true, "image/webp"}, + {":/image_webp", "image/webp", false, 0}, + {":/image_webp", "image/webp", true, "image/webp"}, + {":/image_webp", "image/gif", false, 0}, + {":/image_webp", "image/gif", true, "image/webp"}, + {":/image_webp", "image/png", false, 0}, + {":/image_webp", "image/png", true, "image/webp"}, + {":/image_webp", "image/jpeg", false, 0}, + {":/image_webp", "image/jpeg", true, "image/webp"}, + {":/image_webp", "image/bmp", false, 0}, + {":/image_webp", "image/bmp", true, "image/webp"}, + {":/image_webp", "image/vnd.microsoft.icon", false, 0}, + {":/image_webp", "image/vnd.microsoft.icon", true, "image/webp"}, + {":/image_webp", "application/rdf+xml", false, 0}, + {":/image_webp", "application/rdf+xml", true, 0}, + {":/image_webp", "application/rss+xml", false, 0}, + {":/image_webp", "application/rss+xml", true, 0}, + {":/image_webp", "application/atom+xml", false, 0}, + {":/image_webp", "application/atom+xml", true, 0}, + {":/text_html", "text/plain", false, "text/plain"}, + {":/text_html", "text/plain", true, "text/plain"}, + {":/text_html", "unknown/unknown", false, "text/html"}, + {":/text_html", "unknown/unknown", true, "text/html"}, + {":/text_html", "application/unknown", false, "text/html"}, + {":/text_html", "application/unknown", true, "text/html"}, + {":/text_html", "*/*", false, "text/html"}, + {":/text_html", "*/*", true, "text/html"}, + {":/text_html", "text/xml", false, 0}, + {":/text_html", "text/xml", true, 0}, + {":/text_html", "application/xml", false, 0}, + {":/text_html", "application/xml", true, 0}, + {":/text_html", "text/html", false, 0}, + {":/text_html", "text/html", true, 0}, + {":/text_html", "text/xml", false, 0}, + {":/text_html", "text/xml", true, 0}, + {":/text_html", "application/pdf", false, 0}, + {":/text_html", "application/pdf", true, 0}, + {":/text_html", "application/postscript", false, 0}, + {":/text_html", "application/postscript", true, 0}, + {":/text_html", "application/ogg", false, 0}, + {":/text_html", "application/ogg", true, 0}, + {":/text_html", "video/webm", false, 0}, + {":/text_html", "video/webm", true, 0}, + {":/text_html", "application/x-rar-compressed", false, 0}, + {":/text_html", "application/x-rar-compressed", true, 0}, + {":/text_html", "application/zip", false, 0}, + {":/text_html", "application/zip", true, 0}, + {":/text_html", "application/x-gzip", false, 0}, + {":/text_html", "application/x-gzip", true, 0}, + {":/text_html", "audio/x-wave", false, 0}, + {":/text_html", "audio/x-wave", true, 0}, + {":/text_html", "image/webp", false, 0}, + {":/text_html", "image/webp", true, 0}, + {":/text_html", "image/gif", false, 0}, + {":/text_html", "image/gif", true, 0}, + {":/text_html", "image/png", false, 0}, + {":/text_html", "image/png", true, 0}, + {":/text_html", "image/jpeg", false, 0}, + {":/text_html", "image/jpeg", true, 0}, + {":/text_html", "image/bmp", false, 0}, + {":/text_html", "image/bmp", true, 0}, + {":/text_html", "image/vnd.microsoft.icon", false, 0}, + {":/text_html", "image/vnd.microsoft.icon", true, 0}, + {":/text_html", "application/rdf+xml", false, 0}, + {":/text_html", "application/rdf+xml", true, 0}, + {":/text_html", "application/rss+xml", false, 0}, + {":/text_html", "application/rss+xml", true, 0}, + {":/text_html", "application/atom+xml", false, 0}, + {":/text_html", "application/atom+xml", true, 0}, + {":/text_xml", "text/plain", false, "text/plain"}, + {":/text_xml", "text/plain", true, "text/plain"}, + {":/text_xml", "unknown/unknown", false, "text/xml"}, + {":/text_xml", "unknown/unknown", true, "text/xml"}, + {":/text_xml", "application/unknown", false, "text/xml"}, + {":/text_xml", "application/unknown", true, "text/xml"}, + {":/text_xml", "*/*", false, "text/xml"}, + {":/text_xml", "*/*", true, "text/xml"}, + {":/text_xml", "text/xml", false, 0}, + {":/text_xml", "text/xml", true, 0}, + {":/text_xml", "application/xml", false, 0}, + {":/text_xml", "application/xml", true, 0}, + {":/text_xml", "text/html", false, 0}, + {":/text_xml", "text/html", true, 0}, + {":/text_xml", "text/xml", false, 0}, + {":/text_xml", "text/xml", true, 0}, + {":/text_xml", "application/pdf", false, 0}, + {":/text_xml", "application/pdf", true, 0}, + {":/text_xml", "application/postscript", false, 0}, + {":/text_xml", "application/postscript", true, 0}, + {":/text_xml", "application/ogg", false, 0}, + {":/text_xml", "application/ogg", true, 0}, + {":/text_xml", "video/webm", false, 0}, + {":/text_xml", "video/webm", true, 0}, + {":/text_xml", "application/x-rar-compressed", false, 0}, + {":/text_xml", "application/x-rar-compressed", true, 0}, + {":/text_xml", "application/zip", false, 0}, + {":/text_xml", "application/zip", true, 0}, + {":/text_xml", "application/x-gzip", false, 0}, + {":/text_xml", "application/x-gzip", true, 0}, + {":/text_xml", "audio/x-wave", false, 0}, + {":/text_xml", "audio/x-wave", true, 0}, + {":/text_xml", "image/webp", false, 0}, + {":/text_xml", "image/webp", true, 0}, + {":/text_xml", "image/gif", false, 0}, + {":/text_xml", "image/gif", true, 0}, + {":/text_xml", "image/png", false, 0}, + {":/text_xml", "image/png", true, 0}, + {":/text_xml", "image/jpeg", false, 0}, + {":/text_xml", "image/jpeg", true, 0}, + {":/text_xml", "image/bmp", false, 0}, + {":/text_xml", "image/bmp", true, 0}, + {":/text_xml", "image/vnd.microsoft.icon", false, 0}, + {":/text_xml", "image/vnd.microsoft.icon", true, 0}, + {":/text_xml", "application/rdf+xml", false, 0}, + {":/text_xml", "application/rdf+xml", true, 0}, + {":/text_xml", "application/rss+xml", false, 0}, + {":/text_xml", "application/rss+xml", true, 0}, + {":/text_xml", "application/atom+xml", false, 0}, + {":/text_xml", "application/atom+xml", true, 0}, + {":/video_webm", "text/plain", false, "video/webm"}, + {":/video_webm", "text/plain", true, "video/webm"}, + {":/video_webm", "unknown/unknown", false, "video/webm"}, + {":/video_webm", "unknown/unknown", true, "video/webm"}, + {":/video_webm", "application/unknown", false, "video/webm"}, + {":/video_webm", "application/unknown", true, "video/webm"}, + {":/video_webm", "*/*", false, "video/webm"}, + {":/video_webm", "*/*", true, "video/webm"}, + {":/video_webm", "text/xml", false, 0}, + {":/video_webm", "text/xml", true, 0}, + {":/video_webm", "application/xml", false, 0}, + {":/video_webm", "application/xml", true, 0}, + {":/video_webm", "text/html", false, 0}, + {":/video_webm", "text/html", true, 0}, + {":/video_webm", "text/xml", false, 0}, + {":/video_webm", "text/xml", true, 0}, + {":/video_webm", "application/pdf", false, 0}, + {":/video_webm", "application/pdf", true, 0}, + {":/video_webm", "application/postscript", false, 0}, + {":/video_webm", "application/postscript", true, 0}, + {":/video_webm", "application/ogg", false, 0}, + {":/video_webm", "application/ogg", true, 0}, + {":/video_webm", "video/webm", false, 0}, + {":/video_webm", "video/webm", true, 0}, + {":/video_webm", "application/x-rar-compressed", false, 0}, + {":/video_webm", "application/x-rar-compressed", true, 0}, + {":/video_webm", "application/zip", false, 0}, + {":/video_webm", "application/zip", true, 0}, + {":/video_webm", "application/x-gzip", false, 0}, + {":/video_webm", "application/x-gzip", true, 0}, + {":/video_webm", "audio/x-wave", false, 0}, + {":/video_webm", "audio/x-wave", true, 0}, + {":/video_webm", "image/webp", false, 0}, + {":/video_webm", "image/webp", true, 0}, + {":/video_webm", "image/gif", false, 0}, + {":/video_webm", "image/gif", true, 0}, + {":/video_webm", "image/png", false, 0}, + {":/video_webm", "image/png", true, 0}, + {":/video_webm", "image/jpeg", false, 0}, + {":/video_webm", "image/jpeg", true, 0}, + {":/video_webm", "image/bmp", false, 0}, + {":/video_webm", "image/bmp", true, 0}, + {":/video_webm", "image/vnd.microsoft.icon", false, 0}, + {":/video_webm", "image/vnd.microsoft.icon", true, 0}, + {":/video_webm", "application/rdf+xml", false, 0}, + {":/video_webm", "application/rdf+xml", true, 0}, + {":/video_webm", "application/rss+xml", false, 0}, + {":/video_webm", "application/rss+xml", true, 0}, + {":/video_webm", "application/atom+xml", false, 0}, + {":/video_webm", "application/atom+xml", true, 0} +}; +static const size_t testListSize = sizeof(testList) / sizeof(testList[0]); + +#endif // TestData_h diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources.qrc b/Source/WebKit/qt/tests/MIMESniffing/resources.qrc new file mode 100644 index 0000000..b4afb32 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources.qrc @@ -0,0 +1,23 @@ +<RCC> + <qresource prefix="/"> + <file alias="application_atom+xml">resources/application_atom+xml</file> + <file alias="application_ogg">resources/application_ogg</file> + <file alias="application_pdf">resources/application_pdf</file> + <file alias="application_postscript">resources/application_postscript</file> + <file alias="application_rdf+xml">resources/application_rdf+xml</file> + <file alias="application_rss+xml">resources/application_rss+xml</file> + <file alias="application_x-gzip">resources/application_x-gzip</file> + <file alias="application_x-rar-compressed">resources/application_x-rar-compressed</file> + <file alias="application_zip">resources/application_zip</file> + <file alias="audio_x-wave">resources/audio_x-wave</file> + <file alias="image_bmp">resources/image_bmp</file> + <file alias="image_gif">resources/image_gif</file> + <file alias="image_jpeg">resources/image_jpeg</file> + <file alias="image_png">resources/image_png</file> + <file alias="image_vnd.microsoft.icon">resources/image_vnd.microsoft.icon</file> + <file alias="image_webp">resources/image_webp</file> + <file alias="text_html">resources/text_html</file> + <file alias="text_xml">resources/text_xml</file> + <file alias="video_webm">resources/video_webm</file> + </qresource> +</RCC> diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_atom+xml b/Source/WebKit/qt/tests/MIMESniffing/resources/application_atom+xml new file mode 100644 index 0000000..54086a7 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_atom+xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<feed xmlns="http://www.w3.org/2005/Atom"> + <title>Example Feed</title> + <link href="http://example.org/"/> + <updated>2003-12-13T18:30:02Z</updated> + <author> + <name>John Doe</name> + </author> + <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id> + <entry> + <title>Atom-Powered Robots Run Amok</title> + <link href="http://example.org/2003/12/13/atom03"/> + <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> + <updated>2003-12-13T18:30:02Z</updated> + <summary>Some text.</summary> + </entry> +</feed> diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_ogg b/Source/WebKit/qt/tests/MIMESniffing/resources/application_ogg Binary files differnew file mode 100644 index 0000000..b9cc1b2 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_ogg diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_pdf b/Source/WebKit/qt/tests/MIMESniffing/resources/application_pdf Binary files differnew file mode 100644 index 0000000..7f8996f --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_pdf diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_postscript b/Source/WebKit/qt/tests/MIMESniffing/resources/application_postscript new file mode 100644 index 0000000..c4b9ae6 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_postscript @@ -0,0 +1,137 @@ +%!PS-Adobe-2.0 EPSF-1.2
+%%Creator: HiJaak 2.1
+%%CreationDate: 12/29/93 13:52:08
+%%BoundingBox:126 216 486 576
+%%EndComments
+/ld {load def} bind def
+/s /stroke ld /f /fill ld /m /moveto ld /l /lineto ld /c /curveto ld /rgb {255 div 3 1 roll 255 div 3 1 roll 255 div 3 1 roll setrgbcolor} def
+126 216 translate
+360.0000 360.0000 scale
+/picstr 124 string def
+124 124 8 [124 0 0 -124 0 124] {currentfile picstr readhexstring pop} image
+65656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565ADADADADADADADADADADADADADADADADADADADADADADADADADADADADADADAD1B1B1B1B1B1B1B1B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006565656565006565656500656565656565000000656565656565656565656565656565656565656565656565656565656565ADADAD00ADADAD000000ADAD00ADADADADAD00AD00ADADADAD00ADADADAD00000000001B1B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565000065656500006565650065006565656500656565006565656565656565656565656565656565656565656565656565656565ADADAD00ADAD00ADADAD00ADAD00ADADAD00ADAD0000ADADAD00ADADADAD001B1B1B1B001B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565000065656500006565650065006565650065656565650065656565656565656565656565656565656565656565656565656565ADADAD00AD00ADADADADADADAD00ADADAD00ADAD00AD00ADAD00ADADADAD001B1B1B1B001B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006500650065006565650065006565650065656565656565656565656565656565656565656565656565656565656565656565ADADAD00AD00ADADADADADADADAD00AD00ADADAD00AD00ADAD00ADADADAD00000000001B1B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006500650065006565006565650065650065656500000065656565656565656565656565656565656565656565656565656565ADADAD00AD00ADADADADADADADADAD00ADADADAD00ADAD00AD00ADADADAD001B1B1B1B001B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006500650065006565000000000065650065656565650065656565656565656565656565656565656565656565656565656565ADADAD00AD00ADADADADADADADADAD00ADADADAD00ADAD00AD00ADADADAD001B1B1B1B001B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006565006565006500656565656500656500656565006565656565656565656565656565656565656565656565656565656565ADADAD00ADAD00ADADAD00ADADADAD00ADADADAD00ADADAD0000ADADADAD001B1B1B1B001B001B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565006565006565006500656565656500656565000000656565656565656565656565656565656565656565656565656565656565ADADAD00ADADAD000000ADADADADAD00ADADADAD00ADADADAD00ADADADAD00000000001B1B00000000FF
+65656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565ADADAD00ADADADADADADADADADADADADADADADADADADADADADADADADADADAD1B1B1B1B1B1B1B1B1B1BFF
+65656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565ADADAD00ADADADADADADADADADADADADADADADADADADADADADADADADADADAD1B1B1B1B1B1B1B1B1B1BFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDC0000DC0000000000DC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292000000009292000000000092920000929200009292929292ADADADAD00000000ADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDC0000DC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929200009292000092000092920000920000929200009292929292ADADAD0000ADAD0000ADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC00DCDC00DCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292920000929292929292000092920000920000009200009292929292ADAD0000ADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC00000000DCDC0000000000DC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292920000929292929292000092920000920000009200009292929292ADAD0000ADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292920000929200000092000000000092920000920000009292929292ADAD0000ADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292920000929292000092000092000092920000920000009292929292ADAD0000ADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929200009292000092000092920000920000929200009292929292ADADAD0000ADAD0000ADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC0000DCDCDC0000000000DC000000000000DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292000000009292000092929200000000929200009292929292ADADADAD00000000ADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+DCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC92929292929292929292929292929292929292929292929292929292929292ADADADADADADADADADADFF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00000000004A4A00000000004A00000000004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDC0000DCDC0000DC0000000000DC0000DCDCDCDCDCDCDCDCDCDCDC00000065656500000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A4A00004A00004A4A4A4A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDC0000DCDC0000DC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDC00000065656500000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A4A00004A00004A4A4A4A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDC00DCDC00DCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDC00000000650000000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A4A00004A00000000004A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDC00000000DCDC0000000000DC0000DCDCDCDCDCDCDCDCDCDCDC00000000650000000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00000000004A4A00004A4A4A4A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDC00006500650065000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A00004A4A00004A4A4A4A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDC00006500000065000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A4A00004A00004A4A4A4A00004A4A00004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDC0000DCDCDC0000DCDCDCDC0000DCDCDCDCDCDCDCDCDCDCDC00006500000065000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A00004A4A4A000000000000004A00000000004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDC0000DCDCDC0000000000DC000000000000DCDCDCDCDCDCDC00006565006565000065FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A00000000004A4A4A4A0000004A4A4A00000000004A4A4A4A004A4A4A4A4A00000000004A00000000004A00000000004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A004A4A4A4A004A4A004A4A4A004A4A4A4A004A4A4A4A4A4A004A4A4A4A4A004A4A4A4A4A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A004A4A4A4A004A004A4A4A4A4A004A4A4A004A4A4A4A4A4A004A4A4A4A4A004A4A4A4A4A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A00000000004A4A004A4A4A4A4A004A4A4A004A4A4A4A4A4A004A4A4A4A4A00000000004A000000004A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A004A4A4A4A004A004A4A4A4A4A004A4A4A004A4A4A4A4A4A004A4A4A4A4A004A4A4A4A4A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A004A4A4A4A004A004A4A4A4A4A004A4A4A004A4A4A4A4A4A004A4A4A4A4A004A4A4A4A4A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A004A4A4A4A004A4A004A4A4A004A4A4A4A004A4A4A4A4A4A004A4A4A4A4A004A4A4A4A4A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A00000000004A4A4A4A0000004A4A4A4A4A004A4A4A4A4A4A00000000004A00000000004A004A4A4A4A4A4A4A004A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4A4ADCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDCDC65656565656565656565FF
+showpage
+
\ No newline at end of file diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_rdf+xml b/Source/WebKit/qt/tests/MIMESniffing/resources/application_rdf+xml new file mode 100644 index 0000000..e214145 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_rdf+xml @@ -0,0 +1,50 @@ +<?xml version="1.0"?> + +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/"> + + <channel rdf:about="http://www.xml.com/xml/news.rss"> + <title>XML.com</title> + <link>http://xml.com/pub</link> + <description> + XML.com features a rich mix of information and services + for the XML community. + </description> + + <image rdf:resource="http://xml.com/universal/images/xml_tiny.gif" /> + + <items> + <rdf:Seq> + <rdf:li resource="http://xml.com/pub/2000/08/09/xslt/xslt.html" /> + <rdf:li resource="http://xml.com/pub/2000/08/09/rdfdb/index.html" /> + </rdf:Seq> + </items> + + </channel> + + <image rdf:about="http://xml.com/universal/images/xml_tiny.gif"> + <title>XML.com</title> + <link>http://www.xml.com</link> + <url>http://xml.com/universal/images/xml_tiny.gif</url> + </image> + + <item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html"> + <title>Processing Inclusions with XSLT</title> + <link>http://xml.com/pub/2000/08/09/xslt/xslt.html</link> + <description> + Processing document inclusions with general XML tools can be + problematic. This article proposes a way of preserving inclusion + information through SAX-based processing. + </description> + </item> + + <item rdf:about="http://xml.com/pub/2000/08/09/rdfdb/index.html"> + <title>Putting RDF to Work</title> + <link>http://xml.com/pub/2000/08/09/rdfdb/index.html</link> + <description> + Tool and API support for the Resource Description Framework + is slowly coming of age. Edd Dumbill takes a look at RDFDB, + one of the most exciting new RDF toolkits. + </description> + </item> + +</rdf:RDF> diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_rss+xml b/Source/WebKit/qt/tests/MIMESniffing/resources/application_rss+xml new file mode 100644 index 0000000..3537c41 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_rss+xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<rss version="0.91"> +<channel> + +<title>Folha.com - Ambiente - Principal</title> +<link>http://redir.folha.com.br/redir/online/ambiente/rss091/*http://www1.folha.uol.com.br/ambiente/</link> +<description>Primeiro jornal em tempo real em língua portuguesa</description> +<language>pt-br</language> +<copyright>Copyright Folha.com. Todos os direitos reservados.</copyright> +<docs>http://redir.folha.com.br/redir/online/ambiente/rss091/*http://www1.folha.uol.com.br/folha/conheca/arquivo_e_copyright.shtml</docs> +<webMaster>webmaster@grupofolha.com.br (Webmaster Folha.com)</webMaster> + +<image> +<title>Folha.com - Ambiente - Principal</title> +<url>http://www1.folha.uol.com.br/folha/images/lgo-folha_com-88x31.gif</url> +<link>http://redir.folha.com.br/redir/online/ambiente/rss091/*http://www1.folha.uol.com.br/ambiente/</link> +<width>88</width> +<height>31</height> +<description>Primeiro jornal em tempo real em língua portuguesa</description> +</image> + +<item> +<title>Nasa dimensiona danos da seca na Amazônia em 2,4 mi de km2</title> +<link>http://redir.folha.com.br/redir/online/ambiente/rss091/*http://www1.folha.uol.com.br/ambiente/895526-nasa-dimensiona-danos-da-seca-na-amazonia-em-24-mi-de-km2.shtml</link> +<description> +Os satélites da Nasa (agência espacial americana) forneceram material para uma análise dos estragos provocados pela <a href="http://www1.folha.uol.com.br/ambiente/870588-amazonia-teve-a-pior-seca-dos-ultimos-cem-anos.shtml">pior seca a atingir a Amazônia em 2010</a>. +Pela tomada aérea, estima-se que foram 2,5 milhões de quilômetros quadrados afetados --pouco menos da metade do ecossistema amazônico. +<table class="articleGraphic"> +<tr> +<td rowspan="3" class="articleGraphicSpace"></td> +<td class="articleGraphicCredit">Universidade de Boston/Nasa</td> +<td rowspan="3" class="articleGraphicSpace"></td> +</tr> +<tr> +<td class="articleGraphicImage"><img src="http://f.i.uol.com.br/folha/ambiente/images/11090120.jpeg" alt="Área (vermelho) mostra redução do índice do verdor, onde a vegetação ficou menos verde e mais seca" border="0" /></td> +</tr> +<tr> +<td class="articleGraphicCaption">Área (vermelho) mostra redução do índice do verdor, onde a vegetação ficou menos verde e mais seca</td> +</tr> +</table> +<a href="http://redir.folha.com.br/redir/online/ambiente/rss091/*http://www1.folha.uol.com.br/ambiente/895526-nasa-dimensiona-danos-da-seca-na-amazonia-em-24-mi-de-km2.shtml">Leia mais</a> (29/03/2011 - 18h04)</description> +<pubDate>29 Mar 2011 18:04:00 -0300</pubDate> +</item> +</channel> +</rss> diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-gzip b/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-gzip Binary files differnew file mode 100644 index 0000000..a5e7d31 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-gzip diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-rar-compressed b/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-rar-compressed Binary files differnew file mode 100644 index 0000000..d9cb6ae --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_x-rar-compressed diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/application_zip b/Source/WebKit/qt/tests/MIMESniffing/resources/application_zip Binary files differnew file mode 100644 index 0000000..8aec52f --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/application_zip diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/audio_x-wave b/Source/WebKit/qt/tests/MIMESniffing/resources/audio_x-wave Binary files differnew file mode 100644 index 0000000..a0f9b85 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/audio_x-wave diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_bmp b/Source/WebKit/qt/tests/MIMESniffing/resources/image_bmp Binary files differnew file mode 100644 index 0000000..b61d368 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_bmp diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_gif b/Source/WebKit/qt/tests/MIMESniffing/resources/image_gif Binary files differnew file mode 100644 index 0000000..32b1ea2 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_gif diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_jpeg b/Source/WebKit/qt/tests/MIMESniffing/resources/image_jpeg Binary files differnew file mode 100644 index 0000000..1874576 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_jpeg diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_png b/Source/WebKit/qt/tests/MIMESniffing/resources/image_png Binary files differnew file mode 100644 index 0000000..bef59c7 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_png diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_vnd.microsoft.icon b/Source/WebKit/qt/tests/MIMESniffing/resources/image_vnd.microsoft.icon Binary files differnew file mode 100644 index 0000000..58921b8 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_vnd.microsoft.icon diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/image_webp b/Source/WebKit/qt/tests/MIMESniffing/resources/image_webp Binary files differnew file mode 100644 index 0000000..0da983e --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/image_webp diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/text_html b/Source/WebKit/qt/tests/MIMESniffing/resources/text_html new file mode 100644 index 0000000..21eeee3 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/text_html @@ -0,0 +1,3 @@ + +<!-- saved from url=(0017)http://127.0.0.1/ --> +<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></HEAD><BODY><H1>It works!</H1></BODY></HTML>
\ No newline at end of file diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/text_xml b/Source/WebKit/qt/tests/MIMESniffing/resources/text_xml new file mode 100644 index 0000000..38a9fe5 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/text_xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<CATALOG>
+ <CD>
+ <TITLE>Empire Burlesque</TITLE>
+ <ARTIST>Bob Dylan</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>Columbia</COMPANY>
+ <PRICE>10.90</PRICE>
+ <YEAR>1985</YEAR>
+ </CD>
+ <CD>
+ <TITLE>Unchain my heart</TITLE>
+ <ARTIST>Joe Cocker</ARTIST>
+ <COUNTRY>USA</COUNTRY>
+ <COMPANY>EMI</COMPANY>
+ <PRICE>8.20</PRICE>
+ <YEAR>1987</YEAR>
+ </CD>
+</CATALOG>
diff --git a/Source/WebKit/qt/tests/MIMESniffing/resources/video_webm b/Source/WebKit/qt/tests/MIMESniffing/resources/video_webm Binary files differnew file mode 100644 index 0000000..95d5031 --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/resources/video_webm diff --git a/Source/WebKit/qt/tests/MIMESniffing/tst_MIMESniffing.cpp b/Source/WebKit/qt/tests/MIMESniffing/tst_MIMESniffing.cpp new file mode 100644 index 0000000..8c5417f --- /dev/null +++ b/Source/WebKit/qt/tests/MIMESniffing/tst_MIMESniffing.cpp @@ -0,0 +1,72 @@ +/* + Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "config.h" +#include "MIMESniffing.h" + +#include "TestData.h" + +#include <QtCore/QFile> +#include <QtCore/QString> +#include <QtTest/QtTest> + +class tst_MIMESniffing : public QObject { + Q_OBJECT + +public: + tst_MIMESniffing(); + +private Q_SLOTS: + void testCase1(); +}; + +tst_MIMESniffing::tst_MIMESniffing() +{ +} + +static inline const char* errorText(const TestData& data, const char* sniffedType) +{ + return QString("file: %1, advertised: %2, image: %3. sniffed mime type was expected to be \"%4\" but instead was \"%5\"").arg(data.file).arg(data.advertisedType).arg(data.isImage).arg(data.sniffedType).arg(sniffedType).toLatin1(); +} + +void tst_MIMESniffing::testCase1() +{ + + for (int i = 0; i < testListSize; ++i) { + QFile file(testList[i].file); + QVERIFY2(file.open(QIODevice::ReadOnly), QString("unable to open file %1").arg(file.fileName()).toLatin1()); + + MIMESniffer sniffer(testList[i].advertisedType, testList[i].isImage); + QByteArray data = file.peek(sniffer.dataSize()); + + const char* sniffedType = sniffer.sniff(data.constData(), data.size()); + + QVERIFY2(!(sniffedType || testList[i].sniffedType) || (sniffedType && testList[i].sniffedType), errorText(testList[i], sniffedType)); + + if (sniffedType) + QVERIFY2(!strcmp(sniffedType, testList[i].sniffedType), errorText(testList[i], sniffedType)); + + } + + QVERIFY2(true, "Failure"); +} + +QTEST_APPLESS_MAIN(tst_MIMESniffing); + +#include "tst_MIMESniffing.moc" diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.html b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.html new file mode 100644 index 0000000..22e3e24 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.html @@ -0,0 +1,17 @@ +<html> +<head><title>Basic</title> +<link rel="icon" sizes="48x48" href="basic.png"> +<script type="text/javascript"> +<!-- +window.onload = function(){ window.status = "status here"; } +// --> +</script> +</head> +<body leftmargin="0" marginwidth="0"> +<table width="123"> +<tbody> +<tr><td>This is a basic test.</td></tr> +</tbody> +</table> +</body> +</html> diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.png b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.png Binary files differnew file mode 100644 index 0000000..35717cc --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.png diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.qml new file mode 100644 index 0000000..b5208d0 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/basic.qml @@ -0,0 +1,5 @@ +import QtWebKit 1.0 + +WebView { + url: "basic.html" +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.html b/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.html new file mode 100644 index 0000000..9236867 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.html @@ -0,0 +1,14 @@ +<body leftmargin=0 topmargin=0> +<table width="300px" border=1 cellpadding=0 cellspacing=0> +<tr> +<td align=center width=25%%><p>A</p></td> +<td width=75% height=50px> + <table width=100% border=1 cellpadding=0 cellspacing=0> + <tr> + <td align=center width=50% height=50px><p>B</p></td> + <td align=center width=50% height=50px><p>C</p></td> + </tr> + </table> +</td> +</tr> +</table> diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.qml new file mode 100644 index 0000000..8fef8c9 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/elements.qml @@ -0,0 +1,7 @@ +import QtWebKit 1.0 + +WebView { + url: "elements.html" + width: 310 + height: 100 +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.html b/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.html new file mode 100644 index 0000000..62ab62d --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.html @@ -0,0 +1,12 @@ +<html> +<head><title>Forward</title> +<link rel="icon" sizes="32x32" href="forward.png"> +</head> +<body leftmargin="0" marginwidth="0"> +<table width="123"> +<tbody> +<tr><td>This is more.</td></tr> +</tbody> +</table> +</body> +</html> diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.png b/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.png Binary files differnew file mode 100644 index 0000000..a82533e --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/forward.png diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.html b/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.html new file mode 100644 index 0000000..35270bc --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.html @@ -0,0 +1,11 @@ +<html> +<head><title>JavaScript</title> +<link rel="icon" sizes="48x48" href="basic.png"> +<script type="text/javascript"> +<!-- +window.onload = function(){ window.status = "status here"; } +// --> +</script> +</head> +<body> +This is a JS test. diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.qml new file mode 100644 index 0000000..527e3b9 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/javaScript.qml @@ -0,0 +1,12 @@ +import QtQuick 1.0 +import QtWebKit 1.0 + +WebView { + url: "javaScript.html" + javaScriptWindowObjects: [ + QtObject { + property string qmlprop: "qmlvalue" + WebView.windowObjectName: "myjsname" + } + ] +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/loadError.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/loadError.qml new file mode 100644 index 0000000..26cec8f --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/loadError.qml @@ -0,0 +1,5 @@ +import QtWebKit 1.0 + +WebView { + url: "does-not-exist.html" +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.html b/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.html new file mode 100644 index 0000000..dd541f9 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.html @@ -0,0 +1,16 @@ +<html> +<head> +<script type="text/javascript"> +<!-- +function clickTheLink() +{ + var ev = document.createEvent('MouseEvents'); + ev.initEvent( "click", true, false ); + document.getElementById('thelink').dispatchEvent(ev); +} +// --> +</script> +</head> +<h1>Multiple windows...</h1> + +<a id=thelink target="_blank" href="newwindows.html">Popup!</a> diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.qml new file mode 100644 index 0000000..e66631d --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/newwindows.qml @@ -0,0 +1,34 @@ +// Demonstrates opening new WebViews from HTML + +import QtQuick 1.0 +import QtWebKit 1.0 + +Grid { + columns: 3 + id: pages + height: 300; width: 600 + property int total: 0 + + Component { + id: webViewPage + Rectangle { + width: webView.width + height: webView.height + border.color: "gray" + + WebView { + id: webView + width: 150 // force predictable for test + newWindowComponent: webViewPage + newWindowParent: pages + url: "newwindows.html" + Timer { + interval: 10; running: total<4; repeat: false; + onTriggered: { if (webView.status==WebView.Ready) { total++; webView.evaluateJavaScript("clickTheLink()") } } + } + } + } + } + + Loader { sourceComponent: webViewPage } +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/propertychanges.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/propertychanges.qml new file mode 100644 index 0000000..db06887 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/propertychanges.qml @@ -0,0 +1,34 @@ +import QtQuick 1.0 +import QtWebKit 1.0 + +Item { + width: 240 + height: 160 + Grid { + anchors.fill: parent + objectName: "newWindowParent" + id: newWindowParent + } + + Row { + anchors.fill: parent + id: oldWindowParent + objectName: "oldWindowParent" + } + + Loader { + sourceComponent: webViewComponent + } + Component { + id: webViewComponent + WebView { + id: webView + objectName: "webView" + newWindowComponent: webViewComponent + newWindowParent: oldWindowParent + url: "basic.html" + renderingEnabled: true + pressGrabTime: 200 + } + } +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/resources/sethtml.qml b/Source/WebKit/qt/tests/qdeclarativewebview/resources/sethtml.qml new file mode 100644 index 0000000..5bff442 --- /dev/null +++ b/Source/WebKit/qt/tests/qdeclarativewebview/resources/sethtml.qml @@ -0,0 +1,5 @@ +import QtWebKit 1.0 + +WebView { + html: "<p>This is a <b>string</b> set on the WebView" +} diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp index 8fcab71..23e8bfb 100644 --- a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp +++ b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp @@ -1,14 +1,18 @@ #include "../util.h" +#include <QAction> #include <QColor> #include <QDebug> #include <QDeclarativeComponent> #include <QDeclarativeEngine> +#include <QDeclarativeItem> #include <QDeclarativeProperty> #include <QDeclarativeView> #include <QDir> #include <QGraphicsWebView> #include <QTest> +#include <QVariant> #include <QWebFrame> +#include "qdeclarativewebview_p.h" QT_BEGIN_NAMESPACE @@ -19,16 +23,36 @@ public: tst_QDeclarativeWebView(); private slots: + void cleanupTestCase(); + + void basicProperties(); + void elementAreaAt(); + void historyNav(); + void javaScript(); + void loadError(); + void multipleWindows(); + void newWindowComponent(); + void newWindowParent(); void preferredWidthTest(); void preferredHeightTest(); void preferredWidthDefaultTest(); void preferredHeightDefaultTest(); + void pressGrabTime(); + void renderingEnabled(); + void setHtml(); + void settings(); #if QT_VERSION >= 0x040703 void backgroundColor(); #endif private: void checkNoErrors(const QDeclarativeComponent&); + QString tmpDir() const + { + static QString tmpd = QDir::tempPath() + "/tst_qdeclarativewebview-" + + QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss")); + return tmpd; + } }; tst_QDeclarativeWebView::tst_QDeclarativeWebView() @@ -36,6 +60,283 @@ tst_QDeclarativeWebView::tst_QDeclarativeWebView() Q_UNUSED(waitForSignal) } +static QString strippedHtml(QString html) +{ + html.replace(QRegExp("\\s+"), ""); + return html; +} + +static QString fileContents(const QString& filename) +{ + QFile file(filename); + file.open(QIODevice::ReadOnly); + return QString::fromUtf8(file.readAll()); +} + +static void removeRecursive(const QString& dirname) +{ + QDir dir(dirname); + QFileInfoList entries(dir.entryInfoList(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot)); + for (int i = 0; i < entries.count(); ++i) + if (entries[i].isDir()) + removeRecursive(entries[i].filePath()); + else + dir.remove(entries[i].fileName()); + QDir().rmdir(dirname); +} + +void tst_QDeclarativeWebView::cleanupTestCase() +{ + removeRecursive(tmpDir()); +} + +void tst_QDeclarativeWebView::basicProperties() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/basic.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QObject* wv = component.create(); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("title").toString(), QLatin1String("Basic")); + QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48); + QEXPECT_FAIL("", "'icon' property isn't working", Continue); + QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/basic.png")); + QCOMPARE(wv->property("statusText").toString(), QLatin1String("status here")); + QCOMPARE(strippedHtml(fileContents(":/resources/basic.html")), strippedHtml(wv->property("html").toString())); + QEXPECT_FAIL("", "TODO: get preferred width from QGraphicsWebView result", Continue); + QCOMPARE(wv->property("preferredWidth").toInt(), 0); + QEXPECT_FAIL("", "TODO: get preferred height from QGraphicsWebView result", Continue); + QCOMPARE(wv->property("preferredHeight").toInt(), 0); + QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/basic.html")); + QCOMPARE(wv->property("status").toInt(), int(QDeclarativeWebView::Ready)); + + QAction* reloadAction = wv->property("reload").value<QAction*>(); + QVERIFY(reloadAction); + QVERIFY(reloadAction->isEnabled()); + QAction* backAction = wv->property("back").value<QAction*>(); + QVERIFY(backAction); + QVERIFY(!backAction->isEnabled()); + QAction* forwardAction = wv->property("forward").value<QAction*>(); + QVERIFY(forwardAction); + QVERIFY(!forwardAction->isEnabled()); + QAction* stopAction = wv->property("stop").value<QAction*>(); + QVERIFY(stopAction); + QVERIFY(!stopAction->isEnabled()); + + wv->setProperty("pixelCacheSize", 0); // mainly testing that it doesn't crash or anything! + QCOMPARE(wv->property("pixelCacheSize").toInt(), 0); + reloadAction->trigger(); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); +} + +void tst_QDeclarativeWebView::elementAreaAt() +{ + QSKIP("This test should be changed to test 'heuristicZoom' instead.", SkipAll); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/elements.qml")); + checkNoErrors(component); + QDeclarativeWebView* wv = qobject_cast<QDeclarativeWebView*>(component.create()); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + // Areas from elements.html. +// const QRect areaA(1, 1, 75, 54); +// const QRect areaB(78, 3, 110, 50); +// const QRect wholeView(0, 0, 310, 100); +// const QRect areaBC(76, 1, 223, 54); + +// QCOMPARE(wv->elementAreaAt(40, 30, 100, 100), areaA); +// QCOMPARE(wv->elementAreaAt(130, 30, 200, 100), areaB); +// QCOMPARE(wv->elementAreaAt(40, 30, 400, 400), wholeView); +// QCOMPARE(wv->elementAreaAt(130, 30, 280, 280), areaBC); +// QCOMPARE(wv->elementAreaAt(130, 30, 400, 400), wholeView); +} + +void tst_QDeclarativeWebView::historyNav() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/basic.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QObject* wv = component.create(); + QVERIFY(wv); + + QAction* reloadAction = wv->property("reload").value<QAction*>(); + QVERIFY(reloadAction); + QAction* backAction = wv->property("back").value<QAction*>(); + QVERIFY(backAction); + QAction* forwardAction = wv->property("forward").value<QAction*>(); + QVERIFY(forwardAction); + QAction* stopAction = wv->property("stop").value<QAction*>(); + QVERIFY(stopAction); + + for (int i = 1; i <= 2; ++i) { + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("title").toString(), QLatin1String("Basic")); + QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 48); + QEXPECT_FAIL("", "'icon' property isn't working", Continue); + QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///data/basic.png")); + QCOMPARE(wv->property("statusText").toString(), QLatin1String("status here")); + QCOMPARE(strippedHtml(fileContents(":/resources/basic.html")), strippedHtml(wv->property("html").toString())); + QEXPECT_FAIL("", "TODO: get preferred width from QGraphicsWebView result", Continue); + QCOMPARE(wv->property("preferredWidth").toDouble(), 0.0); + QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/basic.html")); + QCOMPARE(wv->property("status").toInt(), int(QDeclarativeWebView::Ready)); + QVERIFY(reloadAction->isEnabled()); + QVERIFY(!backAction->isEnabled()); + QVERIFY(!forwardAction->isEnabled()); + QVERIFY(!stopAction->isEnabled()); + reloadAction->trigger(); + } + + wv->setProperty("url", QUrl("qrc:///resources/forward.html")); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("title").toString(), QLatin1String("Forward")); + QTRY_COMPARE(qvariant_cast<QPixmap>(wv->property("icon")).width(), 32); + QEXPECT_FAIL("", "'icon' property isn't working", Continue); + QCOMPARE(qvariant_cast<QPixmap>(wv->property("icon")), QPixmap("qrc:///resources/forward.png")); + QCOMPARE(strippedHtml(fileContents(":/resources/forward.html")), strippedHtml(wv->property("html").toString())); + QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/forward.html")); + QCOMPARE(wv->property("status").toInt(), int(QDeclarativeWebView::Ready)); + QCOMPARE(wv->property("statusText").toString(), QString()); + + QVERIFY(reloadAction->isEnabled()); + QVERIFY(backAction->isEnabled()); + QVERIFY(!forwardAction->isEnabled()); + QVERIFY(!stopAction->isEnabled()); + + backAction->trigger(); + + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("title").toString(), QLatin1String("Basic")); + QCOMPARE(strippedHtml(fileContents(":/resources/basic.html")), strippedHtml(wv->property("html").toString())); + QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/basic.html")); + QCOMPARE(wv->property("status").toInt(), int(QDeclarativeWebView::Ready)); + + QVERIFY(reloadAction->isEnabled()); + QVERIFY(!backAction->isEnabled()); + QVERIFY(forwardAction->isEnabled()); + QVERIFY(!stopAction->isEnabled()); +} + +static inline QVariant callEvaluateJavaScript(QObject *object, const QString& snippet) +{ + QVariant result; + QMetaObject::invokeMethod(object, "evaluateJavaScript", Q_RETURN_ARG(QVariant, result), Q_ARG(QString, snippet)); + return result; +} + +void tst_QDeclarativeWebView::javaScript() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/javaScript.qml")); + checkNoErrors(component); + QObject* wv = component.create(); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + QCOMPARE(callEvaluateJavaScript(wv, "123").toInt(), 123); + QCOMPARE(callEvaluateJavaScript(wv, "window.status").toString(), QLatin1String("status here")); + QCOMPARE(callEvaluateJavaScript(wv, "window.myjsname.qmlprop").toString(), QLatin1String("qmlvalue")); +} + +void tst_QDeclarativeWebView::loadError() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/loadError.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QObject* wv = component.create(); + QVERIFY(wv); + QAction* reloadAction = wv->property("reload").value<QAction*>(); + QVERIFY(reloadAction); + + for (int i = 1; i <= 2; ++i) { + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("title").toString(), QString()); + QCOMPARE(wv->property("statusText").toString(), QString()); // HTML 'status bar' text, not error message + QCOMPARE(wv->property("url").toUrl(), QUrl("qrc:///resources/does-not-exist.html")); // Unlike QWebPage, which loses url + QCOMPARE(wv->property("status").toInt(), int(QDeclarativeWebView::Error)); + reloadAction->trigger(); + } +} + +void tst_QDeclarativeWebView::multipleWindows() +{ + QSKIP("Rework this test to not depend on QDeclarativeGrid", SkipAll); + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/newwindows.qml")); + checkNoErrors(component); + +// QDeclarativeGrid *grid = qobject_cast<QDeclarativeGrid*>(component.create()); +// QVERIFY(grid != 0); +// QTRY_COMPARE(grid->children().count(), 2+4); // Component, Loader (with 1 WebView), 4 new-window WebViews +// QDeclarativeItem* popup = qobject_cast<QDeclarativeItem*>(grid->children().at(2)); // first popup after Component and Loader. +// QVERIFY(popup != 0); +// QTRY_COMPARE(popup->x(), 150.0); +} + +void tst_QDeclarativeWebView::newWindowComponent() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/propertychanges.qml")); + checkNoErrors(component); + QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(component.create()); + QVERIFY(rootItem); + QObject* wv = rootItem->findChild<QObject*>("webView"); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + QDeclarativeComponent substituteComponent(&engine); + substituteComponent.setData("import QtQuick 1.0; WebView { objectName: 'newWebView'; url: 'basic.html'; }", QUrl::fromLocalFile("")); + QSignalSpy newWindowComponentSpy(wv, SIGNAL(newWindowComponentChanged())); + + wv->setProperty("newWindowComponent", QVariant::fromValue(&substituteComponent)); + QCOMPARE(wv->property("newWindowComponent"), QVariant::fromValue(&substituteComponent)); + QCOMPARE(newWindowComponentSpy.count(), 1); + + wv->setProperty("newWindowComponent", QVariant::fromValue(&substituteComponent)); + QCOMPARE(newWindowComponentSpy.count(), 1); + + wv->setProperty("newWindowComponent", QVariant::fromValue((QDeclarativeComponent*)0)); + QCOMPARE(newWindowComponentSpy.count(), 2); +} + +void tst_QDeclarativeWebView::newWindowParent() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/propertychanges.qml")); + checkNoErrors(component); + QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(component.create()); + QVERIFY(rootItem); + QObject* wv = rootItem->findChild<QObject*>("webView"); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + QDeclarativeItem* oldWindowParent = rootItem->findChild<QDeclarativeItem*>("oldWindowParent"); + QCOMPARE(qvariant_cast<QDeclarativeItem*>(wv->property("newWindowParent")), oldWindowParent); + QSignalSpy newWindowParentSpy(wv, SIGNAL(newWindowParentChanged())); + + QDeclarativeItem* newWindowParent = rootItem->findChild<QDeclarativeItem*>("newWindowParent"); + wv->setProperty("newWindowParent", QVariant::fromValue(newWindowParent)); + QVERIFY(newWindowParent); + QVERIFY(oldWindowParent); + QCOMPARE(oldWindowParent->childItems().count(), 0); + QCOMPARE(wv->property("newWindowParent"), QVariant::fromValue(newWindowParent)); + QCOMPARE(newWindowParentSpy.count(), 1); + + wv->setProperty("newWindowParent", QVariant::fromValue(newWindowParent)); + QCOMPARE(newWindowParentSpy.count(), 1); + + wv->setProperty("newWindowParent", QVariant::fromValue((QDeclarativeItem*)0)); + QCOMPARE(newWindowParentSpy.count(), 2); +} + void tst_QDeclarativeWebView::preferredWidthTest() { QDeclarativeEngine engine; @@ -86,6 +387,110 @@ void tst_QDeclarativeWebView::preferredHeightDefaultTest() QCOMPARE(wv->property("prefHeight").toDouble(), view.preferredHeight()); } +void tst_QDeclarativeWebView::pressGrabTime() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/propertychanges.qml")); + checkNoErrors(component); + QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(component.create()); + QVERIFY(rootItem); + QObject* wv = rootItem->findChild<QObject*>("webView"); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + QCOMPARE(wv->property("pressGrabTime").toInt(), 200); + QSignalSpy pressGrabTimeSpy(wv, SIGNAL(pressGrabTimeChanged())); + + wv->setProperty("pressGrabTime", 100); + QCOMPARE(wv->property("pressGrabTime").toInt(), 100); + QCOMPARE(pressGrabTimeSpy.count(), 1); + + wv->setProperty("pressGrabTime", 100); + QCOMPARE(pressGrabTimeSpy.count(), 1); + + wv->setProperty("pressGrabTime", 0); + QCOMPARE(pressGrabTimeSpy.count(), 2); +} + +void tst_QDeclarativeWebView::renderingEnabled() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/propertychanges.qml")); + checkNoErrors(component); + QDeclarativeItem* rootItem = qobject_cast<QDeclarativeItem*>(component.create()); + QVERIFY(rootItem); + QObject* wv = rootItem->findChild<QObject*>("webView"); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + QVERIFY(wv->property("renderingEnabled").toBool()); + QSignalSpy renderingEnabledSpy(wv, SIGNAL(renderingEnabledChanged())); + + wv->setProperty("renderingEnabled", false); + QVERIFY(!wv->property("renderingEnabled").toBool()); + QCOMPARE(renderingEnabledSpy.count(), 1); + + wv->setProperty("renderingEnabled", false); + QCOMPARE(renderingEnabledSpy.count(), 1); + + wv->setProperty("renderingEnabled", true); + QCOMPARE(renderingEnabledSpy.count(), 2); +} + +void tst_QDeclarativeWebView::setHtml() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/sethtml.qml")); + checkNoErrors(component); + QObject* wv = component.create(); + QVERIFY(wv); + QCOMPARE(wv->property("html").toString(), QLatin1String("<html><head></head><body><p>This is a <b>string</b> set on the WebView</p></body></html>")); + + QSignalSpy spy(wv, SIGNAL(htmlChanged())); + wv->setProperty("html", QLatin1String("<html><head><title>Basic</title></head><body><p>text</p></body></html>")); + QCOMPARE(spy.count(), 1); +} + +void tst_QDeclarativeWebView::settings() +{ + QDeclarativeEngine engine; + QDeclarativeComponent component(&engine, QUrl("qrc:///resources/basic.qml")); + checkNoErrors(component); + QObject* wv = component.create(); + QVERIFY(wv); + QTRY_COMPARE(wv->property("progress").toDouble(), 1.0); + + QObject* s = QDeclarativeProperty(wv, "settings").object(); + QVERIFY(s); + + QStringList settingsList; + settingsList << QString::fromAscii("autoLoadImages") + << QString::fromAscii("developerExtrasEnabled") + << QString::fromAscii("javaEnabled") + << QString::fromAscii("javascriptCanAccessClipboard") + << QString::fromAscii("javascriptCanOpenWindows") + << QString::fromAscii("javascriptEnabled") + << QString::fromAscii("linksIncludedInFocusChain") + << QString::fromAscii("localContentCanAccessRemoteUrls") + << QString::fromAscii("localStorageDatabaseEnabled") + << QString::fromAscii("offlineStorageDatabaseEnabled") + << QString::fromAscii("offlineWebApplicationCacheEnabled") + << QString::fromAscii("pluginsEnabled") + << QString::fromAscii("printElementBackgrounds") + << QString::fromAscii("privateBrowsingEnabled") + << QString::fromAscii("zoomTextOnly"); + + // Merely tests that setting gets stored (in QWebSettings), behavioural tests are in WebKit. + for (int b = 0; b <= 1; b++) { + bool value = !!b; + foreach (const QString& name, settingsList) + s->setProperty(name.toAscii().data(), value); + for (int i = 0; i < 2; i++) { + foreach (const QString& name, settingsList) + QCOMPARE(s->property(name.toAscii().data()).toBool(), value); + } + } +} + #if QT_VERSION >= 0x040703 void tst_QDeclarativeWebView::backgroundColor() { @@ -120,6 +525,16 @@ void tst_QDeclarativeWebView::checkNoErrors(const QDeclarativeComponent& compone { // Wait until the component is ready QTRY_VERIFY(component.isReady() || component.isError()); + if (component.isError()) { + QList<QDeclarativeError> errors = component.errors(); + for (int ii = 0; ii < errors.count(); ++ii) { + const QDeclarativeError &error = errors.at(ii); + QByteArray errorStr = QByteArray::number(error.line()) + ":" + + QByteArray::number(error.column()) + ":" + + error.description().toUtf8(); + qWarning() << errorStr; + } + } QVERIFY(!component.isError()); } diff --git a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.qrc b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.qrc index e14c333..fb66ad8 100644 --- a/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.qrc +++ b/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.qrc @@ -1,8 +1,22 @@ <RCC> <qresource prefix="/"> - <file>resources/webviewtestdefault.qml</file> - <file>resources/webviewtest.qml</file> + <file>resources/basic.html</file> + <file>resources/basic.png</file> + <file>resources/basic.qml</file> + <file>resources/elements.html</file> + <file>resources/elements.qml</file> + <file>resources/forward.html</file> + <file>resources/forward.png</file> + <file>resources/javaScript.html</file> + <file>resources/javaScript.qml</file> + <file>resources/loadError.qml</file> + <file>resources/newwindows.html</file> + <file>resources/newwindows.qml</file> + <file>resources/propertychanges.qml</file> <file>resources/sample.html</file> + <file>resources/sethtml.qml</file> <file>resources/webviewbackgroundcolor.qml</file> + <file>resources/webviewtestdefault.qml</file> + <file>resources/webviewtest.qml</file> </qresource> </RCC> diff --git a/Source/WebKit/qt/tests/qgraphicswebview/resources/56929.html b/Source/WebKit/qt/tests/qgraphicswebview/resources/56929.html new file mode 100644 index 0000000..2f7fa97 --- /dev/null +++ b/Source/WebKit/qt/tests/qgraphicswebview/resources/56929.html @@ -0,0 +1,8 @@ +<body style="background-color: white"> + <div id="1" style="width: 50%; height: 50%; background-color: green"/> + <script> + function resizeDiv() { + document.getElementById("1").setAttribute("style", "width: 150%; height: 150%; background-color: green"); + } + </script> +</body> diff --git a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp index 7cc88db..ed162c4 100644 --- a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp +++ b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.cpp @@ -21,6 +21,7 @@ #include <QtTest/QtTest> #include <QGraphicsSceneMouseEvent> #include <QGraphicsView> +#include <QStyleOptionGraphicsItem> #include <qgraphicswebview.h> #include <qwebpage.h> #include <qwebframe.h> @@ -43,7 +44,9 @@ private slots: void setPalette_data(); void setPalette(); void renderHints(); - +#if defined(ENABLE_TILED_BACKING_STORE) && ENABLE_TILED_BACKING_STORE + void bug56929(); +#endif #if defined(ENABLE_WEBGL) && ENABLE_WEBGL void webglSoftwareFallbackVerticalOrientation(); void webglSoftwareFallbackHorizontalOrientation(); @@ -191,6 +194,38 @@ void tst_QGraphicsWebView::widgetsRenderingThroughCache() QCOMPARE(referencePixmap.toImage(), viewWithTiling.toImage()); } +#if defined(ENABLE_TILED_BACKING_STORE) && ENABLE_TILED_BACKING_STORE +void tst_QGraphicsWebView::bug56929() +{ + // When rendering from tiles sychronous layout should not be triggered + // and scrollbars should be in sync with the size of the document in the displayed state. + + QGraphicsWebView* webView = new QGraphicsWebView(); + webView->setGeometry(QRectF(0.0, 0.0, 100.0, 100.0)); + QGraphicsView view(new QGraphicsScene()); + view.scene()->setParent(&view); + view.scene()->addItem(webView); + webView->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true); + QUrl url("qrc:///resources/56929.html"); + webView->load(url); + QVERIFY(waitForSignal(webView, SIGNAL(loadFinished(bool)))); + QStyleOptionGraphicsItem option; + option.exposedRect = webView->geometry(); + QImage img(option.exposedRect.width(), option.exposedRect.height(), QImage::Format_ARGB32_Premultiplied); + QPainter painter(&img); + // This will not paint anything as the tiles are not ready, yet. + webView->paint(&painter, &option); + QApplication::processEvents(); + webView->paint(&painter, &option); + QCOMPARE(img.pixel(option.exposedRect.width() - 2, option.exposedRect.height() / 2), qRgba(255, 255, 255, 255)); + painter.fillRect(option.exposedRect, Qt::black); + QCOMPARE(img.pixel(option.exposedRect.width() - 2, option.exposedRect.height() / 2), qRgba(0, 0, 0, 255)); + webView->page()->mainFrame()->evaluateJavaScript(QString("resizeDiv();")); + webView->paint(&painter, &option); + QCOMPARE(img.pixel(option.exposedRect.width() - 2, option.exposedRect.height() / 2), qRgba(255, 255, 255, 255)); +} +#endif + void tst_QGraphicsWebView::microFocusCoordinates() { QWebPage* page = new QWebPage; diff --git a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc index 1488fcf..f929fe7 100644 --- a/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc +++ b/Source/WebKit/qt/tests/qgraphicswebview/tst_qgraphicswebview.qrc @@ -3,5 +3,6 @@ <file>resources/input_types.html</file> <file>resources/pointing_right.html</file> <file>resources/pointing_up.html</file> + <file>resources/56929.html</file> </qresource> </RCC> diff --git a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp index c7c49a2..9e9948a 100644 --- a/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp +++ b/Source/WebKit/qt/tests/qwebelement/tst_qwebelement.cpp @@ -483,7 +483,7 @@ void tst_QWebElement::style() QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); p.setStyleProperty("color", "blue"); - QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("green")); + QCOMPARE(p.styleProperty("color", QWebElement::InlineStyle), QLatin1String("blue")); QCOMPARE(p.styleProperty("color", QWebElement::CascadedStyle), QLatin1String("green")); p.setStyleProperty("color", "blue !important"); diff --git a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 2c44e4c..3b9324d 100644 --- a/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -614,6 +614,7 @@ private slots: void urlChange(); void domCycles(); void requestedUrl(); + void requestedUrlAfterSetAndLoadFailures(); void javaScriptWindowObjectCleared_data(); void javaScriptWindowObjectCleared(); void javaScriptWindowObjectClearedOnEvaluate(); @@ -649,10 +650,14 @@ private slots: void setContent(); void setCacheLoadControlAttribute(); void setUrlWithPendingLoads(); + void setUrlWithFragment_data(); void setUrlWithFragment(); void setUrlToEmpty(); void setUrlToInvalid(); void setUrlHistory(); + void setUrlSameUrl(); + void setUrlThenLoads_data(); + void setUrlThenLoads(); private: QString evalJS(const QString&s) { @@ -2309,7 +2314,7 @@ public: else if (request.url() == QUrl("qrc:/fake-ssl-error.html")) setError(QNetworkReply::SslHandshakeFailedError, tr("Fake error !")); // force a ssl error #endif - else if (request.url() == QUrl("http://abcdef.abcdef/")) + else if (request.url().host() == QLatin1String("abcdef.abcdef")) setError(QNetworkReply::HostNotFoundError, tr("Invalid URL")); open(QIODevice::ReadOnly); @@ -2413,6 +2418,30 @@ void tst_QWebFrame::requestedUrl() #endif } +void tst_QWebFrame::requestedUrlAfterSetAndLoadFailures() +{ + QWebPage page; + QWebFrame* frame = page.mainFrame(); + + QSignalSpy spy(frame, SIGNAL(loadFinished(bool))); + + const QUrl first("http://abcdef.abcdef/"); + frame->setUrl(first); + ::waitForSignal(frame, SIGNAL(loadFinished(bool))); + QCOMPARE(frame->url(), first); + QCOMPARE(frame->requestedUrl(), first); + QVERIFY(!spy.at(0).first().toBool()); + + const QUrl second("http://abcdef.abcdef/another_page.html"); + QVERIFY(first != second); + + frame->load(second); + ::waitForSignal(frame, SIGNAL(loadFinished(bool))); + QCOMPARE(frame->url(), first); + QCOMPARE(frame->requestedUrl(), second); + QVERIFY(!spy.at(1).first().toBool()); +} + void tst_QWebFrame::javaScriptWindowObjectCleared_data() { QTest::addColumn<QString>("html"); @@ -2671,6 +2700,8 @@ void tst_QWebFrame::inputFieldFocus() int delay = qApp->cursorFlashTime() * 2; // focus the lineedit and check if it blinks + bool autoSipEnabled = qApp->autoSipEnabled(); + qApp->setAutoSipEnabled(false); const QWebElement inputElement = view.page()->mainFrame()->documentElement().findFirst(QLatin1String("input[type=text]")); QTest::mouseClick(&view, Qt::LeftButton, 0, inputElement.geometry().center()); m_inputFieldsTestView = &view; @@ -2678,6 +2709,7 @@ void tst_QWebFrame::inputFieldFocus() QTest::qWait(delay); QVERIFY2(m_inputFieldTestPaintCount >= 3, "The input field should have a blinking caret"); + qApp->setAutoSipEnabled(autoSipEnabled); } void tst_QWebFrame::hitTestContent() @@ -3323,24 +3355,42 @@ void tst_QWebFrame::setUrlWithPendingLoads() page.mainFrame()->setUrl(QUrl("about:blank")); } +void tst_QWebFrame::setUrlWithFragment_data() +{ + QTest::addColumn<QUrl>("previousUrl"); + QTest::newRow("empty") << QUrl(); + QTest::newRow("same URL no fragment") << QUrl("qrc:/test1.html"); + // See comments in setUrlSameUrl about using setUrl() with the same url(). + QTest::newRow("same URL with same fragment") << QUrl("qrc:/test1.html#"); + QTest::newRow("same URL with different fragment") << QUrl("qrc:/test1.html#anotherFragment"); + QTest::newRow("another URL") << QUrl("qrc:/test2.html"); +} + +// Based on bug report https://bugs.webkit.org/show_bug.cgi?id=32723 void tst_QWebFrame::setUrlWithFragment() { - QSKIP("Bug https://bugs.webkit.org/show_bug.cgi?id=32723", SkipAll); + QFETCH(QUrl, previousUrl); - // Based on bug report https://bugs.webkit.org/show_bug.cgi?id=32723 QWebPage page; - QSignalSpy spy(&page, SIGNAL(loadFinished(bool))); + QWebFrame* frame = page.mainFrame(); + + if (!previousUrl.isEmpty()) { + frame->load(previousUrl); + ::waitForSignal(frame, SIGNAL(loadFinished(bool))); + QCOMPARE(frame->url(), previousUrl); + } + QSignalSpy spy(frame, SIGNAL(loadFinished(bool))); const QUrl url("qrc:/test1.html#"); QVERIFY(!url.fragment().isNull()); - page.mainFrame()->setUrl(url); - ::waitForSignal(&page, SIGNAL(loadFinished(bool))); + frame->setUrl(url); + ::waitForSignal(frame, SIGNAL(loadFinished(bool))); QCOMPARE(spy.count(), 1); - QVERIFY(!page.mainFrame()->toPlainText().isEmpty()); - QCOMPARE(page.mainFrame()->requestedUrl(), url); - QCOMPARE(page.mainFrame()->url(), url); + QVERIFY(!frame->toPlainText().isEmpty()); + QCOMPARE(frame->requestedUrl(), url); + QCOMPARE(frame->url(), url); } void tst_QWebFrame::setUrlToEmpty() @@ -3486,5 +3536,110 @@ void tst_QWebFrame::setUrlHistory() QCOMPARE(m_page->history()->count(), 2); } +void tst_QWebFrame::setUrlSameUrl() +{ + const QUrl url1("qrc:/test1.html"); + const QUrl url2("qrc:/test2.html"); + + QWebPage page; + QWebFrame* frame = page.mainFrame(); + FakeNetworkManager* networkManager = new FakeNetworkManager(&page); + page.setNetworkAccessManager(networkManager); + + QSignalSpy spy(frame, SIGNAL(loadFinished(bool))); + + frame->setUrl(url1); + waitForSignal(frame, SIGNAL(loadFinished(bool))); + QVERIFY(frame->url() != url1); // Nota bene: our QNAM redirects url1 to url2 + QCOMPARE(frame->url(), url2); + QCOMPARE(spy.count(), 1); + + frame->setUrl(url1); + waitForSignal(frame, SIGNAL(loadFinished(bool))); + QVERIFY(frame->url() != url1); + QCOMPARE(frame->url(), url2); + QCOMPARE(spy.count(), 2); + + // Now a case without redirect. The existing behavior we have for setUrl() + // is more like a "clear(); load()", so the page will be loaded again, even + // if urlToBeLoaded == url(). This test should be changed if we want to + // make setUrl() early return in this case. + frame->setUrl(url2); + waitForSignal(frame, SIGNAL(loadFinished(bool))); + QCOMPARE(frame->url(), url2); + QCOMPARE(spy.count(), 3); + + frame->setUrl(url1); + waitForSignal(frame, SIGNAL(loadFinished(bool))); + QCOMPARE(frame->url(), url2); + QCOMPARE(spy.count(), 4); +} + +static inline QUrl extractBaseUrl(const QUrl& url) +{ + return url.resolved(QUrl()); +} + +void tst_QWebFrame::setUrlThenLoads_data() +{ + QTest::addColumn<QUrl>("url"); + QTest::addColumn<QUrl>("baseUrl"); + + QTest::newRow("resource file") << QUrl("qrc:/test1.html") << extractBaseUrl(QUrl("qrc:/test1.html")); + QTest::newRow("base specified in HTML") << QUrl("data:text/html,<head><base href=\"http://different.base/\"></head>") << QUrl("http://different.base/"); +} + +void tst_QWebFrame::setUrlThenLoads() +{ + QFETCH(QUrl, url); + QFETCH(QUrl, baseUrl); + QWebFrame* frame = m_page->mainFrame(); + QSignalSpy urlChangedSpy(frame, SIGNAL(urlChanged(QUrl))); + QSignalSpy startedSpy(frame, SIGNAL(loadStarted())); + QSignalSpy finishedSpy(frame, SIGNAL(loadFinished(bool))); + + frame->setUrl(url); + QCOMPARE(startedSpy.count(), 1); + ::waitForSignal(frame, SIGNAL(urlChanged(QUrl))); + QCOMPARE(urlChangedSpy.count(), 1); + QVERIFY(finishedSpy.at(0).first().toBool()); + QCOMPARE(frame->url(), url); + QCOMPARE(frame->requestedUrl(), url); + QCOMPARE(frame->baseUrl(), baseUrl); + + const QUrl urlToLoad1("qrc:/test2.html"); + const QUrl urlToLoad2("qrc:/test1.html"); + + // Just after first load. URL didn't changed yet. + frame->load(urlToLoad1); + QCOMPARE(startedSpy.count(), 2); + QCOMPARE(frame->url(), url); + QCOMPARE(frame->requestedUrl(), urlToLoad1); + QCOMPARE(frame->baseUrl(), baseUrl); + + // After first URL changed. + ::waitForSignal(frame, SIGNAL(urlChanged(QUrl))); + QCOMPARE(urlChangedSpy.count(), 2); + QVERIFY(finishedSpy.at(1).first().toBool()); + QCOMPARE(frame->url(), urlToLoad1); + QCOMPARE(frame->requestedUrl(), urlToLoad1); + QCOMPARE(frame->baseUrl(), extractBaseUrl(urlToLoad1)); + + // Just after second load. URL didn't changed yet. + frame->load(urlToLoad2); + QCOMPARE(startedSpy.count(), 3); + QCOMPARE(frame->url(), urlToLoad1); + QCOMPARE(frame->requestedUrl(), urlToLoad2); + QCOMPARE(frame->baseUrl(), extractBaseUrl(urlToLoad1)); + + // After second URL changed. + ::waitForSignal(frame, SIGNAL(urlChanged(QUrl))); + QCOMPARE(urlChangedSpy.count(), 3); + QVERIFY(finishedSpy.at(2).first().toBool()); + QCOMPARE(frame->url(), urlToLoad2); + QCOMPARE(frame->requestedUrl(), urlToLoad2); + QCOMPARE(frame->baseUrl(), extractBaseUrl(urlToLoad2)); +} + QTEST_MAIN(tst_QWebFrame) #include "tst_qwebframe.moc" diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index d43b2de..9e3337b 100644 --- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -434,7 +434,7 @@ void tst_QWebPage::userStyleSheet() void tst_QWebPage::loadHtml5Video() { -#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA +#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA QByteArray url("http://does.not/exist?a=1%2Cb=2"); m_view->setHtml("<p><video id ='video' src='" + url + "' autoplay/></p>"); QTest::qWait(2000); @@ -986,7 +986,10 @@ void tst_QWebPage::cursorMovements() "getSelection().addRange(range);"; page->mainFrame()->evaluateJavaScript(script); QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); - QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>")); + + QRegExp regExp(" style=\".*\""); + regExp.setMinimal(true); + QCOMPARE(page->selectedHtml().trimmed().replace(regExp, ""), QString::fromLatin1("<span class=\"Apple-style-span\"><p id=\"one\">The quick brown fox</p></span>")); // these actions must exist QVERIFY(page->action(QWebPage::MoveToNextChar) != 0); @@ -1217,7 +1220,9 @@ void tst_QWebPage::textSelection() "getSelection().addRange(range);"; page->mainFrame()->evaluateJavaScript(selectScript); QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox")); - QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>")); + QRegExp regExp(" style=\".*\""); + regExp.setMinimal(true); + QCOMPARE(page->selectedHtml().trimmed().replace(regExp, ""), QString::fromLatin1("<span class=\"Apple-style-span\"><p id=\"one\">The quick brown fox</p></span>")); // Make sure hasSelection returns true, since there is selected text now... QCOMPARE(page->hasSelection(), true); @@ -2671,10 +2676,12 @@ void tst_QWebPage::findText() QVERIFY(m_page->selectedText().isEmpty()); QVERIFY(m_page->selectedHtml().isEmpty()); QStringList words = (QStringList() << "foo" << "bar"); + QRegExp regExp(" style=\".*\""); + regExp.setMinimal(true); foreach (QString subString, words) { m_page->findText(subString, QWebPage::FindWrapsAroundDocument); QCOMPARE(m_page->selectedText(), subString); - QCOMPARE(m_page->selectedHtml(), QString("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \">%1</span>").arg(subString)); + QCOMPARE(m_page->selectedHtml().trimmed().replace(regExp, ""), QString("<span class=\"Apple-style-span\">%1</span>").arg(subString)); m_page->findText(""); QVERIFY(m_page->selectedText().isEmpty()); QVERIFY(m_page->selectedHtml().isEmpty()); diff --git a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp index c7600fc..f557dc1 100644 --- a/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp +++ b/Source/WebKit/qt/tests/qwebview/tst_qwebview.cpp @@ -31,6 +31,16 @@ #include <qwebelement.h> #include <qwebframe.h> +#ifdef Q_OS_SYMBIAN +#define VERIFY_INPUTMETHOD_HINTS(actual, expect) \ + QVERIFY(actual & Qt::ImhNoAutoUppercase); \ + QVERIFY(actual & Qt::ImhNoPredictiveText); \ + QVERIFY(actual & expect); +#else +#define VERIFY_INPUTMETHOD_HINTS(actual, expect) \ + QVERIFY(actual == expect); +#endif + class tst_QWebView : public QObject { Q_OBJECT @@ -253,37 +263,37 @@ void tst_QWebView::focusInputTypes() // 'password' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'tel' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=tel]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhDialableCharactersOnly); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhDialableCharactersOnly); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'number' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=number]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhDigitsOnly); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhDigitsOnly); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'email' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=email]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhEmailCharactersOnly); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhEmailCharactersOnly); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'url' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=url]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhUrlCharactersOnly); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhUrlCharactersOnly); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'password' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'text' type @@ -300,13 +310,18 @@ void tst_QWebView::focusInputTypes() // 'password' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("input[type=password]")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); - QVERIFY(webView.inputMethodHints() == Qt::ImhHiddenText); + VERIFY_INPUTMETHOD_HINTS(webView.inputMethodHints(), Qt::ImhHiddenText); QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); // 'text area' field inputElement = mainFrame->documentElement().findFirst(QLatin1String("textarea")); QTest::mouseClick(&webView, Qt::LeftButton, 0, inputElement.geometry().center()); +#if defined(Q_OS_SYMBIAN) + QVERIFY(webView.inputMethodHints() & Qt::ImhNoAutoUppercase); + QVERIFY(webView.inputMethodHints() & Qt::ImhNoPredictiveText); +#else QVERIFY(webView.inputMethodHints() == Qt::ImhNone); +#endif QVERIFY(webView.testAttribute(Qt::WA_InputMethodEnabled)); } diff --git a/Source/WebKit/qt/tests/tests.pri b/Source/WebKit/qt/tests/tests.pri index ebb6f8e..3b0c358 100644 --- a/Source/WebKit/qt/tests/tests.pri +++ b/Source/WebKit/qt/tests/tests.pri @@ -10,8 +10,8 @@ ELSE { TARGET = tst_$$TARGET } load(mobilityconfig, true) contains(MOBILITY_CONFIG, multimedia) { # This define is used by tests depending on Qt Multimedia - DEFINES -= ENABLE_QT_MULTIMEDIA=0 - DEFINES += ENABLE_QT_MULTIMEDIA=1 + DEFINES -= WTF_USE_QT_MULTIMEDIA=0 + DEFINES += WTF_USE_QT_MULTIMEDIA=1 } SOURCES += $${TARGET}.cpp diff --git a/Source/WebKit/qt/tests/tests.pro b/Source/WebKit/qt/tests/tests.pro index 529fa04..5fffd7b 100644 --- a/Source/WebKit/qt/tests/tests.pro +++ b/Source/WebKit/qt/tests/tests.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs -SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap +SUBDIRS = qwebframe qwebpage qwebelement qgraphicswebview qwebhistoryinterface qwebview qwebhistory qwebinspector hybridPixmap MIMESniffing contains(QT_CONFIG, declarative): SUBDIRS += qdeclarativewebview SUBDIRS += benchmarks/painting benchmarks/loading contains(DEFINES, ENABLE_WEBGL=1) { diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog index 870b692..21b04c7 100644 --- a/Source/WebKit/win/ChangeLog +++ b/Source/WebKit/win/ChangeLog @@ -1,6 +1,173 @@ -2011-03-30 Martin Robinson <mrobinson@igalia.com> +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> - Reviewed by Dirk Schulze. + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + * WebCoreSupport/WebFrameLoaderClient.h: + +2011-04-18 Timothy Hatcher <timothy@apple.com> + + Remove the two commands that make en.lproj and copy Localizable.strings. + + Rubber-stamped by Adam Roben. + + * WebKit.vcproj/WebKitLibPostBuild.cmd: + +2011-04-18 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Adam Roben. + + Include <WebCore/COMPtr.h> instead of "COMPtr.h" + https://bugs.webkit.org/show_bug.cgi?id=58744 + + * DOMCoreClasses.cpp: + * DOMHTMLClasses.cpp: + * WebActionPropertyBag.cpp: + * WebBackForwardList.cpp: + * WebCoreSupport/WebGeolocationClient.h: + * WebDownload.h: + * WebDropSource.h: + * WebFrame.cpp: + * WebHistoryItem.cpp: + * WebIconDatabase.cpp: + * WebNavigationData.h: + * WebPreferences.cpp: + * WebResource.h: + * WebURLAuthenticationChallenge.cpp: + * WebURLAuthenticationChallengeSender.cpp: + * WebURLAuthenticationChallengeSenderCFNet.cpp: + * WebURLAuthenticationChallengeSenderCurl.cpp: + * WebView.h: + +2011-04-17 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Adam Barth. + + Rename PLATFORM(CG) to USE(CG) + https://bugs.webkit.org/show_bug.cgi?id=58729 + + * WebFrame.cpp: + (WebFrame::spoolPages): + * WebFrame.h: + * WebPreferences.cpp: + (WebPreferences::setFontSmoothing): + (WebPreferences::setFontSmoothingContrast): + * WebView.cpp: + (systemParameterChanged): + +2011-04-16 Sam Weinig <sam@webkit.org> + + Reviewed by Simon Fraser. + + Windows should use WebCore localized strings + <rdar://problem/9119405> + https://bugs.webkit.org/show_bug.cgi?id=58733 + + * WebCoreSupport/WebEditorClient.cpp: + (undoNameForEditAction): + (WebEditorClient::registerCommandForUndo): + * WebPreferences.cpp: + (WebPreferences::initializeDefaultSettings): + * WebURLResponse.cpp: + (CFHTTPMessageCopyLocalizedShortDescriptionForStatusCode): + (WebURLResponse::localizedStringForStatusCode): + Change to use WEB_UI_STRING. + + * WebCoreSupport/WebPlatformStrategies.cpp: + * WebCoreSupport/WebPlatformStrategies.h: + Remove the localization strategy in favor of using the default one. + +2011-04-16 Patrick Gansterer <paroga@webkit.org> + + Reviewed by Eric Seidel. + + Rename PLATFORM(CAIRO) to USE(CAIRO) + https://bugs.webkit.org/show_bug.cgi?id=55192 + + * WebFrame.cpp: + (WebFrame::spoolPages): + * WebFrame.h: + +2011-04-14 Adam Roben <aroben@apple.com> + + Replace some known-to-fail assertions with FIXMEs + + These assertions get hit during various layout tests. They indicate that we're sometimes + doing some extra work when a page goes into accelerated compositing mode, but otherwise + there's no bad effect. + + See <http://webkit.org/b/58539> for more details. + + Rubber-stamped by John Sullivan. + + * WebView.cpp: + (WebView::paintIntoBackingStore): + (WebView::paintIntoWindow): + Replaced assertions with FIXMEs. + +2011-04-13 James Robinson <jamesr@chromium.org> + + Reviewed by Simon Fraser. + + Allow setting composited backing stores for scrollbars and scroll corners + https://bugs.webkit.org/show_bug.cgi?id=57202 + + Update WebScrollBar to reflect ScrollableArea interface changes. + + * WebScrollBar.h: + (WebScrollBar::invalidateScrollCornerRect): + (WebScrollBar::scrollCornerPresent): + (WebScrollBar::scrollCornerRect): + +2011-04-12 Alice Liu <alice.liu@apple.com> + + Reviewed by Sam Weinig. + + https://bugs.webkit.org/show_bug.cgi?id=58292 + Provide new setting to allow site icon loading despite disabling automatic image loading in general. + + * Interfaces/IWebPreferencesPrivate.idl: Added prefs. + * Interfaces/WebKit.idl: Touch file to force autogeneration + * WebPreferenceKeysPrivate.h: Add preference key. + * WebPreferences.cpp: + (WebPreferences::initializeDefaultSettings): Initialize setting to false. + (WebPreferences::setLoadsSiteIconsIgnoringImageLoadingPreference): Added setter + (WebPreferences::loadsSiteIconsIgnoringImageLoadingPreference): Added getter + * WebPreferences.h: + * WebView.cpp: + (WebView::notifyPreferencesChanged): Add to settings that get propagated upon changes. + +2011-04-11 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Maciej Stachowiak. + + WebKit2: Cannot use Ctrl-Delete as a custom keyboard shortcut + https://bugs.webkit.org/show_bug.cgi?id=58265 + <rdar://problem/9221468> + + * WebView.cpp: (WebView::keyDown): Removed special handling of Backspace, which is unnecessary + now that WebCore implements it. + +2011-04-06 Brian Weinstein <bweinstein@apple.com> + + Reviewed by Adam Roben. + + WebKit2: Support Windows 7 Gestures + https://bugs.webkit.org/show_bug.cgi?id=49824 + <rdar://problem/8689728> + + Move WindowsTouch.h from WebKit/win to WebCore/platform/win, so it can be + used in both WebKit and WebKit2. + + * WebKit.vcproj/WebKit.vcproj: Remove WindowsTouch.h. + * WebView.cpp: Include WindowsTouch.h from WebCore instead of WebKit. + * WindowsTouch.h: Removed. + +2011-04-05 Martin Robinson <mrobinson@igalia.com> + + Reviewed by Eric Seidel. [Cairo] Better separate the concerns of GraphicsContextCairo https://bugs.webkit.org/show_bug.cgi?id=55150 @@ -12,6 +179,90 @@ (WebFrame::spoolPages): Ditto. * WebFrame.h: Ditto. +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/WebEditorClient.h: + (WebEditorClient::requestCheckingOfString): + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * WebView.cpp: (WebView::keyDown): Moved Caps Lock handling from WebKits to WebCore, + because WebKit shouldn't be smart. + +2011-04-04 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adam Roben. + + Remove unused AnalyzeWithLargeStack code from Windows build files + https://bugs.webkit.org/show_bug.cgi?id=57771 + + This was used for us to build with prefast automatically, + but it is out-of-date and hasn't been used for some time. + Removing completely for now. + + * WebKit.vcproj/WebKitLibPreBuild.cmd: + +2011-04-01 Adam Roben <aroben@apple.com> + + Remove the WebView's "this" pointer from its HWND when WM_DESTROY is received + + This will ensure we don't try to process any window messages after the window has been + destroyed. + + Covered by existing tests. + + Fixes <http://webkit.org/b/55054>. + + Reviewed by Steve Falkenburg and John Sullivan. + + * WebView.cpp: + (WebView::setIsBeingDestroyed): Moved here from the header file, and added a call to clear + out the this pointer from the HWND. + (WebView::WebViewWndProc): Changed a runtime check into an assertion. + + * WebView.h: Moved setIsBeingDestroyed from here to the .cpp file. + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/WebFrameLoaderClient.cpp: + (WebFrameLoaderClient::dispatchDidReceiveTitle): + * WebCoreSupport/WebFrameLoaderClient.h: + +2011-03-30 Steve Falkenburg <sfalken@apple.com> + + Reviewed by Adam Roben. + + Share most vsprops between Release and Production builds in releaseproduction.vsprops + https://bugs.webkit.org/show_bug.cgi?id=57508 + + * WebKit.vcproj/InterfacesProduction.vsprops: + * WebKit.vcproj/InterfacesRelease.vsprops: + * WebKit.vcproj/InterfacesReleaseCairoCFLite.vsprops: + * WebKit.vcproj/WebKitGUIDProduction.vsprops: + * WebKit.vcproj/WebKitGUIDRelease.vsprops: + * WebKit.vcproj/WebKitGUIDReleaseCairoCFLite.vsprops: + * WebKit.vcproj/WebKitLibProduction.vsprops: + * WebKit.vcproj/WebKitLibRelease.vsprops: + * WebKit.vcproj/WebKitLibReleaseCairoCFLite.vsprops: + 2011-03-30 Steve Falkenburg <sfalken@apple.com> Reviewed by Adam Roben. diff --git a/Source/WebKit/win/DOMCoreClasses.cpp b/Source/WebKit/win/DOMCoreClasses.cpp index b0a6031..7137449 100644 --- a/Source/WebKit/win/DOMCoreClasses.cpp +++ b/Source/WebKit/win/DOMCoreClasses.cpp @@ -27,13 +27,13 @@ #include "WebKitDLL.h" #include "DOMCoreClasses.h" -#include "COMPtr.h" #include "DOMCSSClasses.h" #include "DOMEventsClasses.h" #include "DOMHTMLClasses.h" #include "WebKitGraphics.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/DOMWindow.h> #include <WebCore/Document.h> #include <WebCore/Element.h> diff --git a/Source/WebKit/win/DOMHTMLClasses.cpp b/Source/WebKit/win/DOMHTMLClasses.cpp index c163ec4..d7fdbf6 100644 --- a/Source/WebKit/win/DOMHTMLClasses.cpp +++ b/Source/WebKit/win/DOMHTMLClasses.cpp @@ -26,10 +26,10 @@ #include "config.h" #include "WebKitDLL.h" #include "DOMHTMLClasses.h" -#include "COMPtr.h" #include "WebFrame.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/Document.h> #include <WebCore/Element.h> #include <WebCore/FrameView.h> diff --git a/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl b/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl index 68cbcf3..e3fabd3 100644 --- a/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl +++ b/Source/WebKit/win/Interfaces/IWebPreferencesPrivate.idl @@ -121,4 +121,7 @@ interface IWebPreferencesPrivate : IUnknown HRESULT hyperlinkAuditingEnabled(BOOL *hyperlinkAuditingEnabled); HRESULT setHyperlinkAuditingEnabled(BOOL hyperlinkAuditingEnabled); + + HRESULT setLoadsSiteIconsIgnoringImageLoadingPreference([in] BOOL enabled); + HRESULT loadsSiteIconsIgnoringImageLoadingPreference([out, retval] BOOL* enabled); } diff --git a/Source/WebKit/win/Interfaces/WebKit.idl b/Source/WebKit/win/Interfaces/WebKit.idl index 3f401be..88158a4 100644 --- a/Source/WebKit/win/Interfaces/WebKit.idl +++ b/Source/WebKit/win/Interfaces/WebKit.idl @@ -301,4 +301,3 @@ library WebKit [default] interface IWebUserContentURLPattern; } } - diff --git a/Source/WebKit/win/WebActionPropertyBag.cpp b/Source/WebKit/win/WebActionPropertyBag.cpp index b20da91..fca83be 100644 --- a/Source/WebKit/win/WebActionPropertyBag.cpp +++ b/Source/WebKit/win/WebActionPropertyBag.cpp @@ -27,11 +27,11 @@ #include "WebKitDLL.h" #include "WebActionPropertyBag.h" -#include "COMPtr.h" #include "DOMCoreClasses.h" #include "WebElementPropertyBag.h" #include "WebKit.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/EventHandler.h> #include <WebCore/HitTestResult.h> #include <WebCore/MouseEvent.h> diff --git a/Source/WebKit/win/WebBackForwardList.cpp b/Source/WebKit/win/WebBackForwardList.cpp index 2faaf7e..bd23d26 100644 --- a/Source/WebKit/win/WebBackForwardList.cpp +++ b/Source/WebKit/win/WebBackForwardList.cpp @@ -27,12 +27,12 @@ #include "WebKitDLL.h" #include "WebBackForwardList.h" -#include "COMPtr.h" #include "WebFrame.h" #include "WebKit.h" #include "WebPreferences.h" #include <WebCore/BackForwardListImpl.h> +#include <WebCore/COMPtr.h> #include <WebCore/HistoryItem.h> using std::min; diff --git a/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp b/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp index 1105904..dda0cc3 100644 --- a/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp +++ b/Source/WebKit/win/WebCoreSupport/WebEditorClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,7 +28,6 @@ #include "WebEditorClient.h" #include "WebKit.h" -#include "WebLocalizableStrings.h" #include "WebNotification.h" #include "WebNotificationCenter.h" #include "WebView.h" @@ -40,6 +39,7 @@ #include <WebCore/HTMLInputElement.h> #include <WebCore/HTMLNames.h> #include <WebCore/KeyboardEvent.h> +#include <WebCore/LocalizedStrings.h> #include <WebCore/NotImplemented.h> #include <WebCore/PlatformKeyboardEvent.h> #include <WebCore/Range.h> @@ -482,65 +482,62 @@ ULONG STDMETHODCALLTYPE WebEditorUndoCommand::Release(void) return newRef; } -static LPCTSTR undoNameForEditAction(EditAction editAction) +static String undoNameForEditAction(EditAction editAction) { switch (editAction) { - case EditActionUnspecified: return 0; - case EditActionSetColor: return LPCTSTR_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name"); - case EditActionSetBackgroundColor: return LPCTSTR_UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); - case EditActionTurnOffKerning: return LPCTSTR_UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); - case EditActionTightenKerning: return LPCTSTR_UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); - case EditActionLoosenKerning: return LPCTSTR_UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); - case EditActionUseStandardKerning: return LPCTSTR_UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); - case EditActionTurnOffLigatures: return LPCTSTR_UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); - case EditActionUseStandardLigatures: return LPCTSTR_UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); - case EditActionUseAllLigatures: return LPCTSTR_UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); - case EditActionRaiseBaseline: return LPCTSTR_UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); - case EditActionLowerBaseline: return LPCTSTR_UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); - case EditActionSetTraditionalCharacterShape: return LPCTSTR_UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); - case EditActionSetFont: return LPCTSTR_UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name"); - case EditActionChangeAttributes: return LPCTSTR_UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); - case EditActionAlignLeft: return LPCTSTR_UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name"); - case EditActionAlignRight: return LPCTSTR_UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name"); - case EditActionCenter: return LPCTSTR_UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name"); - case EditActionJustify: return LPCTSTR_UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name"); - case EditActionSetWritingDirection: return LPCTSTR_UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); - case EditActionSubscript: return LPCTSTR_UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name"); - case EditActionSuperscript: return LPCTSTR_UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name"); - case EditActionUnderline: return LPCTSTR_UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name"); - case EditActionOutline: return LPCTSTR_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name"); - case EditActionUnscript: return LPCTSTR_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name"); - case EditActionDrag: return LPCTSTR_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name"); - case EditActionCut: return LPCTSTR_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name"); - case EditActionPaste: return LPCTSTR_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name"); - case EditActionPasteFont: return LPCTSTR_UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name"); - case EditActionPasteRuler: return LPCTSTR_UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); - case EditActionTyping: return LPCTSTR_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); - case EditActionCreateLink: return LPCTSTR_UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name"); - case EditActionUnlink: return LPCTSTR_UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name"); - case EditActionInsertList: return LPCTSTR_UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name"); - case EditActionFormatBlock: return LPCTSTR_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name"); - case EditActionIndent: return LPCTSTR_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name"); - case EditActionOutdent: return LPCTSTR_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name"); + case EditActionUnspecified: return String(); + case EditActionSetColor: return WEB_UI_STRING_KEY("Set Color", "Set Color (Undo action name)", "Undo action name"); + case EditActionSetBackgroundColor: return WEB_UI_STRING_KEY("Set Background Color", "Set Background Color (Undo action name)", "Undo action name"); + case EditActionTurnOffKerning: return WEB_UI_STRING_KEY("Turn Off Kerning", "Turn Off Kerning (Undo action name)", "Undo action name"); + case EditActionTightenKerning: return WEB_UI_STRING_KEY("Tighten Kerning", "Tighten Kerning (Undo action name)", "Undo action name"); + case EditActionLoosenKerning: return WEB_UI_STRING_KEY("Loosen Kerning", "Loosen Kerning (Undo action name)", "Undo action name"); + case EditActionUseStandardKerning: return WEB_UI_STRING_KEY("Use Standard Kerning", "Use Standard Kerning (Undo action name)", "Undo action name"); + case EditActionTurnOffLigatures: return WEB_UI_STRING_KEY("Turn Off Ligatures", "Turn Off Ligatures (Undo action name)", "Undo action name"); + case EditActionUseStandardLigatures: return WEB_UI_STRING_KEY("Use Standard Ligatures", "Use Standard Ligatures (Undo action name)", "Undo action name"); + case EditActionUseAllLigatures: return WEB_UI_STRING_KEY("Use All Ligatures", "Use All Ligatures (Undo action name)", "Undo action name"); + case EditActionRaiseBaseline: return WEB_UI_STRING_KEY("Raise Baseline", "Raise Baseline (Undo action name)", "Undo action name"); + case EditActionLowerBaseline: return WEB_UI_STRING_KEY("Lower Baseline", "Lower Baseline (Undo action name)", "Undo action name"); + case EditActionSetTraditionalCharacterShape: return WEB_UI_STRING_KEY("Set Traditional Character Shape", "Set Traditional Character Shape (Undo action name)", "Undo action name"); + case EditActionSetFont: return WEB_UI_STRING_KEY("Set Font", "Set Font (Undo action name)", "Undo action name"); + case EditActionChangeAttributes: return WEB_UI_STRING_KEY("Change Attributes", "Change Attributes (Undo action name)", "Undo action name"); + case EditActionAlignLeft: return WEB_UI_STRING_KEY("Align Left", "Align Left (Undo action name)", "Undo action name"); + case EditActionAlignRight: return WEB_UI_STRING_KEY("Align Right", "Align Right (Undo action name)", "Undo action name"); + case EditActionCenter: return WEB_UI_STRING_KEY("Center", "Center (Undo action name)", "Undo action name"); + case EditActionJustify: return WEB_UI_STRING_KEY("Justify", "Justify (Undo action name)", "Undo action name"); + case EditActionSetWritingDirection: return WEB_UI_STRING_KEY("Set Writing Direction", "Set Writing Direction (Undo action name)", "Undo action name"); + case EditActionSubscript: return WEB_UI_STRING_KEY("Subscript", "Subscript (Undo action name)", "Undo action name"); + case EditActionSuperscript: return WEB_UI_STRING_KEY("Superscript", "Superscript (Undo action name)", "Undo action name"); + case EditActionUnderline: return WEB_UI_STRING_KEY("Underline", "Underline (Undo action name)", "Undo action name"); + case EditActionOutline: return WEB_UI_STRING_KEY("Outline", "Outline (Undo action name)", "Undo action name"); + case EditActionUnscript: return WEB_UI_STRING_KEY("Unscript", "Unscript (Undo action name)", "Undo action name"); + case EditActionDrag: return WEB_UI_STRING_KEY("Drag", "Drag (Undo action name)", "Undo action name"); + case EditActionCut: return WEB_UI_STRING_KEY("Cut", "Cut (Undo action name)", "Undo action name"); + case EditActionPaste: return WEB_UI_STRING_KEY("Paste", "Paste (Undo action name)", "Undo action name"); + case EditActionPasteFont: return WEB_UI_STRING_KEY("Paste Font", "Paste Font (Undo action name)", "Undo action name"); + case EditActionPasteRuler: return WEB_UI_STRING_KEY("Paste Ruler", "Paste Ruler (Undo action name)", "Undo action name"); + case EditActionTyping: return WEB_UI_STRING_KEY("Typing", "Typing (Undo action name)", "Undo action name"); + case EditActionCreateLink: return WEB_UI_STRING_KEY("Create Link", "Create Link (Undo action name)", "Undo action name"); + case EditActionUnlink: return WEB_UI_STRING_KEY("Unlink", "Unlink (Undo action name)", "Undo action name"); + case EditActionInsertList: return WEB_UI_STRING_KEY("Insert List", "Insert List (Undo action name)", "Undo action name"); + case EditActionFormatBlock: return WEB_UI_STRING_KEY("Formatting", "Format Block (Undo action name)", "Undo action name"); + case EditActionIndent: return WEB_UI_STRING_KEY("Indent", "Indent (Undo action name)", "Undo action name"); + case EditActionOutdent: return WEB_UI_STRING_KEY("Outdent", "Outdent (Undo action name)", "Undo action name"); } - return 0; + return String(); } void WebEditorClient::registerCommandForUndo(PassRefPtr<EditCommand> command) { IWebUIDelegate* uiDelegate = 0; if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) { - LPCTSTR actionName = undoNameForEditAction(command->editingAction()); + String actionName = undoNameForEditAction(command->editingAction()); WebEditorUndoCommand* undoCommand = new WebEditorUndoCommand(command, true); if (!undoCommand) return; uiDelegate->registerUndoWithTarget(m_undoTarget, 0, undoCommand); undoCommand->Release(); // the undo manager owns the reference - BSTR actionNameBSTR = SysAllocString(actionName); - if (actionNameBSTR) { - uiDelegate->setActionTitle(actionNameBSTR); - SysFreeString(actionNameBSTR); - } + if (!actionName.isEmpty()) + uiDelegate->setActionTitle(BString(actionName)); uiDelegate->Release(); } } diff --git a/Source/WebKit/win/WebCoreSupport/WebEditorClient.h b/Source/WebKit/win/WebCoreSupport/WebEditorClient.h index 1d0a7d0..d456cc9 100644 --- a/Source/WebKit/win/WebCoreSupport/WebEditorClient.h +++ b/Source/WebKit/win/WebCoreSupport/WebEditorClient.h @@ -110,7 +110,7 @@ public: virtual void willSetInputMethodState(); virtual void setInputMethodState(bool); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {} + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {} virtual WebCore::TextCheckerClient* textChecker() { return this; } private: diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp index 10a3190..ca61d30 100644 --- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp @@ -364,12 +364,13 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad() frameLoadDelegate->didStartProvisionalLoadForFrame(webView, m_webFrame); } -void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title) +void WebFrameLoaderClient::dispatchDidReceiveTitle(const StringWithDirection& title) { WebView* webView = m_webFrame->webView(); COMPtr<IWebFrameLoadDelegate> frameLoadDelegate; if (SUCCEEDED(webView->frameLoadDelegate(&frameLoadDelegate))) - frameLoadDelegate->didReceiveTitle(webView, BString(title), m_webFrame); + // FIXME: use direction of title. + frameLoadDelegate->didReceiveTitle(webView, BString(title.string()), m_webFrame); } void WebFrameLoaderClient::dispatchDidChangeIcons() @@ -542,7 +543,7 @@ void WebFrameLoaderClient::updateGlobalHistory() COMPtr<IWebURLRequest> urlRequest(AdoptCOM, WebMutableURLRequest::createInstance(loader->originalRequestCopy())); COMPtr<IWebNavigationData> navigationData(AdoptCOM, WebNavigationData::createInstance( - loader->urlForHistory(), loader->title(), urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory())); + loader->urlForHistory(), loader->title().string(), urlRequest.get(), urlResponse.get(), loader->substituteData().isValid(), loader->clientRedirectSourceForHistory())); historyDelegate->didNavigateWithNavigationData(webView, navigationData.get(), m_webFrame); return; @@ -552,7 +553,7 @@ void WebFrameLoaderClient::updateGlobalHistory() if (!history) return; - history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory()); + history->visitedURL(loader->urlForHistory(), loader->title().string(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure(), !loader->clientRedirectSourceForHistory()); } void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks() @@ -672,13 +673,13 @@ PassRefPtr<DocumentLoader> WebFrameLoaderClient::createDocumentLoader(const Reso return loader.release(); } -void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) +void WebFrameLoaderClient::setTitle(const StringWithDirection& title, const KURL& url) { WebView* webView = m_webFrame->webView(); COMPtr<IWebHistoryDelegate> historyDelegate; webView->historyDelegate(&historyDelegate); if (historyDelegate) { - BString titleBSTR(title); + BString titleBSTR(title.string()); BString urlBSTR(url.string()); historyDelegate->updateHistoryTitle(webView, titleBSTR, urlBSTR); return; @@ -704,7 +705,7 @@ void WebFrameLoaderClient::setTitle(const String& title, const KURL& url) if (!itemPrivate) return; - itemPrivate->setTitle(BString(title)); + itemPrivate->setTitle(BString(title.string())); } void WebFrameLoaderClient::savePlatformDataToCachedFrame(CachedFrame* cachedFrame) diff --git a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h index d864b23..c80f76c 100644 --- a/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h +++ b/Source/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h @@ -53,7 +53,7 @@ public: virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length); @@ -69,7 +69,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String&); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); @@ -103,7 +103,7 @@ public: virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::KURL&); virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual void savePlatformDataToCachedFrame(WebCore::CachedFrame*); virtual void transitionToCommittedFromCachedFrame(WebCore::CachedFrame*); diff --git a/Source/WebKit/win/WebCoreSupport/WebGeolocationClient.h b/Source/WebKit/win/WebCoreSupport/WebGeolocationClient.h index c5db134..2bd29af 100644 --- a/Source/WebKit/win/WebCoreSupport/WebGeolocationClient.h +++ b/Source/WebKit/win/WebCoreSupport/WebGeolocationClient.h @@ -26,7 +26,7 @@ #ifndef WebGeolocationClient_h #define WebGeolocationClient_h -#include "COMPtr.h" +#include <WebCore/COMPtr.h> #include <WebCore/GeolocationClient.h> namespace WebCore { diff --git a/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp b/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp index e87777e..fdafa25 100644 --- a/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp +++ b/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,13 +26,9 @@ #include "config.h" #include "WebPlatformStrategies.h" -#include "WebLocalizableStrings.h" -#include <WebCore/IntSize.h> #include <WebCore/Page.h> #include <WebCore/PageGroup.h> #include <WebCore/PluginDatabase.h> -#include <wtf/MathExtras.h> -#include <wtf/RetainPtr.h> using namespace WebCore; @@ -56,11 +52,6 @@ PluginStrategy* WebPlatformStrategies::createPluginStrategy() return this; } -LocalizationStrategy* WebPlatformStrategies::createLocalizationStrategy() -{ - return this; -} - VisitedLinkStrategy* WebPlatformStrategies::createVisitedLinkStrategy() { return this; @@ -108,560 +99,6 @@ void WebPlatformStrategies::getPluginInfo(const WebCore::Page*, Vector<WebCore:: } } -// LocalizationStrategy - -String WebPlatformStrategies::searchableIndexIntroduction() -{ - return UI_STRING("This is a searchable index. Enter search keywords: ", "text that appears at the start of nearly-obsolete web pages in the form of a 'searchable index'"); -} - -String WebPlatformStrategies::submitButtonDefaultLabel() -{ - return UI_STRING("Submit", "default label for Submit buttons in forms on web pages"); -} - -String WebPlatformStrategies::inputElementAltText() -{ - return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value"); -} - -String WebPlatformStrategies::resetButtonDefaultLabel() -{ - return UI_STRING("Reset", "default label for Reset buttons in forms on web pages"); -} - -String WebPlatformStrategies::fileButtonChooseFileLabel() -{ - return UI_STRING("Choose File", "title for file button used in HTML forms"); -} - -String WebPlatformStrategies::fileButtonNoFileSelectedLabel() -{ - return UI_STRING("no file selected", "text to display in file button used in HTML forms when no file is selected"); -} - -String WebPlatformStrategies::defaultDetailsSummaryText() -{ - return UI_STRING("Details", "text to display in <details> tag when it has no <summary> child"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenLinkInNewWindow() -{ - return UI_STRING("Open Link in New Window", "Open in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadLinkToDisk() -{ - return UI_STRING("Download Linked File", "Download Linked File context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyLinkToClipboard() -{ - return UI_STRING("Copy Link", "Copy Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenImageInNewWindow() -{ - return UI_STRING("Open Image in New Window", "Open Image in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDownloadImageToDisk() -{ - return UI_STRING("Download Image", "Download Image context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyImageToClipboard() -{ - return UI_STRING("Copy Image", "Copy Image context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenVideoInNewWindow() -{ - return UI_STRING("Open Video in New Window", "Open Video in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenAudioInNewWindow() -{ - return UI_STRING("Open Audio in New Window", "Open Audio in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyVideoLinkToClipboard() -{ - return UI_STRING("Copy Video Address", "Copy Video Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopyAudioLinkToClipboard() -{ - return UI_STRING("Copy Audio Address", "Copy Audio Address Location context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaControls() -{ - return UI_STRING("Controls", "Media Controls context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagToggleMediaLoop() -{ - return UI_STRING("Loop", "Media Loop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagEnterVideoFullscreen() -{ - return UI_STRING("Enter Fullscreen", "Video Enter Fullscreen context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPlay() -{ - return UI_STRING("Play", "Media Play context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaPause() -{ - return UI_STRING("Pause", "Media Pause context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagMediaMute() -{ - return UI_STRING("Mute", "Media Mute context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenFrameInNewWindow() -{ - return UI_STRING("Open Frame in New Window", "Open Frame in New Window context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCopy() -{ - return UI_STRING("Copy", "Copy context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoBack() -{ - return UI_STRING("Back", "Back context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagGoForward() -{ - return UI_STRING("Forward", "Forward context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagStop() -{ - return UI_STRING("Stop", "Stop context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagReload() -{ - return UI_STRING("Reload", "Reload context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCut() -{ - return UI_STRING("Cut", "Cut context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagPaste() -{ - return UI_STRING("Paste", "Paste context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagNoGuessesFound() -{ - return UI_STRING("No Guesses Found", "No Guesses Found context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreSpelling() -{ - return UI_STRING("Ignore Spelling", "Ignore Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLearnSpelling() -{ - return UI_STRING("Learn Spelling", "Learn Spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSearchWeb() -{ - return UI_STRING("Search with Google", "Search in Google context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLookUpInDictionary(const String&) -{ - return UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOpenLink() -{ - return UI_STRING("Open Link", "Open Link context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagIgnoreGrammar() -{ - return UI_STRING("Ignore Grammar", "Ignore Grammar context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagSpellingMenu() -{ - return UI_STRING("Spelling and Grammar", "Spelling and Grammar context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpelling() -{ - return UI_STRING("Check Document Now", "Check spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckSpellingWhileTyping() -{ - return UI_STRING("Check Spelling While Typing", "Check spelling while typing context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagCheckGrammarWithSpelling() -{ - return UI_STRING("Check Grammar With Spelling", "Check grammar with spelling context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagFontMenu() -{ - return UI_STRING("Font", "Font context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagBold() -{ - return UI_STRING("Bold", "Bold context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagItalic() -{ - return UI_STRING("Italic", "Italic context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagUnderline() -{ - return UI_STRING("Underline", "Underline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagOutline() -{ - return UI_STRING("Outline", "Outline context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagWritingDirectionMenu() -{ - return UI_STRING("Paragraph Direction", "Paragraph direction context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagTextDirectionMenu() -{ - return UI_STRING("Selection Direction", "Selection direction context sub-menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagDefaultDirection() -{ - return UI_STRING("Default", "Default writing direction context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagLeftToRight() -{ - return UI_STRING("Left to Right", "Left to Right context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagRightToLeft() -{ - return UI_STRING("Right to Left", "Right to Left context menu item"); -} - -String WebPlatformStrategies::contextMenuItemTagShowSpellingPanel(bool show) -{ - if (show) - return UI_STRING("Show Spelling and Grammar", "menu item title"); - return UI_STRING("Hide Spelling and Grammar", "menu item title"); -} - -String WebPlatformStrategies::contextMenuItemTagInspectElement() -{ - return UI_STRING("Inspect Element", "Inspect Element context menu item"); -} - -String WebPlatformStrategies::searchMenuNoRecentSearchesText() -{ - return UI_STRING("No recent searches", "Label for only item in menu that appears when clicking on the search field image, when no searches have been performed"); -} - -String WebPlatformStrategies::searchMenuRecentSearchesText() -{ - return UI_STRING("Recent Searches", "label for first item in the menu that appears when clicking on the search field image, used as embedded menu title"); -} - -String WebPlatformStrategies::searchMenuClearRecentSearchesText() -{ - return UI_STRING("Clear Recent Searches", "menu item in Recent Searches menu that empties menu's contents"); -} - -String WebPlatformStrategies::AXWebAreaText() -{ - return UI_STRING("web area", "accessibility role description for web area"); -} - -String WebPlatformStrategies::AXLinkText() -{ - return UI_STRING("link", "accessibility role description for link"); -} - -String WebPlatformStrategies::AXListMarkerText() -{ - return UI_STRING("list marker", "accessibility role description for list marker"); -} - -String WebPlatformStrategies::AXImageMapText() -{ - return UI_STRING("image map", "accessibility role description for image map"); -} - -String WebPlatformStrategies::AXHeadingText() -{ - return UI_STRING("heading", "accessibility role description for headings"); -} - -String WebPlatformStrategies::AXDefinitionListTermText() -{ - return UI_STRING("term", "term word of a definition"); -} - -String WebPlatformStrategies::AXDefinitionListDefinitionText() -{ - return UI_STRING("definition", "definition phrase"); -} - -String WebPlatformStrategies::AXButtonActionVerb() -{ - return UI_STRING("press", "Verb stating the action that will occur when a button is pressed, as used by accessibility"); -} - -String WebPlatformStrategies::AXRadioButtonActionVerb() -{ - return UI_STRING("select", "Verb stating the action that will occur when a radio button is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXTextFieldActionVerb() -{ - return UI_STRING("activate", "Verb stating the action that will occur when a text field is selected, as used by accessibility"); -} - -String WebPlatformStrategies::AXCheckedCheckBoxActionVerb() -{ - return UI_STRING("uncheck", "Verb stating the action that will occur when a checked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXUncheckedCheckBoxActionVerb() -{ - return UI_STRING("check", "Verb stating the action that will occur when an unchecked checkbox is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXLinkActionVerb() -{ - return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXMenuListActionVerb() -{ - return UI_STRING("open", "Verb stating the action that will occur when a select element is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::AXMenuListPopupActionVerb() -{ - return UI_STRING_KEY("press", "press (select element)", "Verb stating the action that will occur when a select element's popup list is clicked, as used by accessibility"); -} - -String WebPlatformStrategies::unknownFileSizeText() -{ - return UI_STRING("Unknown", "Unknown filesize FTP directory listing item"); -} - -String WebPlatformStrategies::uploadFileText() -{ - return UI_STRING("Upload file", "(Windows) Form submit file upload dialog title"); -} - -String WebPlatformStrategies::allFilesText() -{ - return UI_STRING("All Files", "(Windows) Form submit file upload all files pop-up"); -} - -String WebPlatformStrategies::missingPluginText() -{ - return UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing"); -} - -String WebPlatformStrategies::crashedPluginText() -{ - return UI_STRING("Plug-in Failure", "Label text to be used if plugin host process has crashed"); -} - -String WebPlatformStrategies::imageTitle(const String& filename, const IntSize& size) -{ - RetainPtr<CFStringRef> filenameCF(AdoptCF, filename.createCFString()); - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%@ %d\xC3\x97%d pixels", "window title for a standalone image (uses multiplication symbol, not x)"), filenameCF.get(), size.width(), size.height())).get(); -} - -String WebPlatformStrategies::multipleFileUploadText(unsigned numberOfFiles) -{ - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles)).get(); -} - -String WebPlatformStrategies::mediaElementLoadingStateText() -{ - return UI_STRING("Loading...", "Media controller status message when the media is loading"); -} - -String WebPlatformStrategies::mediaElementLiveBroadcastStateText() -{ - return UI_STRING("Live Broadcast", "Media controller status message when watching a live broadcast"); -} - -String WebPlatformStrategies::localizedMediaControlElementString(const String& name) -{ - if (name == "AudioElement") - return UI_STRING("audio element controller", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING("video element controller", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING("mute", "accessibility role description for mute button"); - if (name == "UnMuteButton") - return UI_STRING("unmute", "accessibility role description for turn mute off button"); - if (name == "PlayButton") - return UI_STRING("play", "accessibility role description for play button"); - if (name == "PauseButton") - return UI_STRING("pause", "accessibility role description for pause button"); - if (name == "Slider") - return UI_STRING("movie time", "accessibility role description for timeline slider"); - if (name == "SliderThumb") - return UI_STRING("timeline slider thumb", "accessibility role description for timeline thumb"); - if (name == "RewindButton") - return UI_STRING("back 30 seconds", "accessibility role description for seek back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING("return to realtime", "accessibility role description for return to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING("elapsed time", "accessibility role description for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING("remaining time", "accessibility role description for time remaining display"); - if (name == "StatusDisplay") - return UI_STRING("status", "accessibility role description for movie status"); - if (name == "FullscreenButton") - return UI_STRING("fullscreen", "accessibility role description for enter fullscreen button"); - if (name == "SeekForwardButton") - return UI_STRING("fast forward", "accessibility role description for fast forward button"); - if (name == "SeekBackButton") - return UI_STRING("fast reverse", "accessibility role description for fast reverse button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING("show closed captions", "accessibility role description for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING("hide closed captions", "accessibility role description for hide closed captions button"); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaControlElementHelpText(const String& name) -{ - if (name == "AudioElement") - return UI_STRING("audio element playback controls and status display", "accessibility role description for audio element controller"); - if (name == "VideoElement") - return UI_STRING("video element playback controls and status display", "accessibility role description for video element controller"); - if (name == "MuteButton") - return UI_STRING("mute audio tracks", "accessibility help text for mute button"); - if (name == "UnMuteButton") - return UI_STRING("unmute audio tracks", "accessibility help text for un mute button"); - if (name == "PlayButton") - return UI_STRING("begin playback", "accessibility help text for play button"); - if (name == "PauseButton") - return UI_STRING("pause playback", "accessibility help text for pause button"); - if (name == "Slider") - return UI_STRING("movie time scrubber", "accessibility help text for timeline slider"); - if (name == "SliderThumb") - return UI_STRING("movie time scrubber thumb", "accessibility help text for timeline slider thumb"); - if (name == "RewindButton") - return UI_STRING("seek movie back 30 seconds", "accessibility help text for jump back 30 seconds button"); - if (name == "ReturnToRealtimeButton") - return UI_STRING("return streaming movie to real time", "accessibility help text for return streaming movie to real time button"); - if (name == "CurrentTimeDisplay") - return UI_STRING("current movie time in seconds", "accessibility help text for elapsed time display"); - if (name == "TimeRemainingDisplay") - return UI_STRING("number of seconds of movie remaining", "accessibility help text for remaining time display"); - if (name == "StatusDisplay") - return UI_STRING("current movie status", "accessibility help text for movie status display"); - if (name == "SeekBackButton") - return UI_STRING("seek quickly back", "accessibility help text for fast rewind button"); - if (name == "SeekForwardButton") - return UI_STRING("seek quickly forward", "accessibility help text for fast forward button"); - if (name == "FullscreenButton") - return UI_STRING("Play movie in fullscreen mode", "accessibility help text for enter fullscreen button"); - if (name == "ShowClosedCaptionsButton") - return UI_STRING("start displaying closed captions", "accessibility help text for show closed captions button"); - if (name == "HideClosedCaptionsButton") - return UI_STRING("stop displaying closed captions", "accessibility help text for hide closed captions button"); - - ASSERT_NOT_REACHED(); - return String(); -} - -String WebPlatformStrategies::localizedMediaTimeDescription(float time) -{ - if (!isfinite(time)) - return UI_STRING("indefinite time", "accessibility help text for an indefinite media controller time value"); - - int seconds = (int)fabsf(time); - int days = seconds / (60 * 60 * 24); - int hours = seconds / (60 * 60); - int minutes = (seconds / 60) % 60; - seconds %= 60; - - if (days) - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d days %2$d hours %3$d minutes %4$d seconds", "accessibility help text for media controller time value >= 1 day"), days, hours, minutes, seconds)).get(); - - if (hours) - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d hours %2$d minutes %3$d seconds", "accessibility help text for media controller time value >= 60 minutes"), hours, minutes, seconds)).get(); - - if (minutes) - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d minutes %2$d seconds", "accessibility help text for media controller time value >= 60 seconds"), minutes, seconds)).get(); - - return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithFormat(0, 0, UI_STRING("%1$d seconds", "accessibility help text for media controller time value < 60 seconds"), seconds)).get(); -} - -String WebPlatformStrategies::validationMessageValueMissingText() -{ - return UI_STRING("value missing", "Validation message for required form control elements that have no value"); -} - -String WebPlatformStrategies::validationMessageTypeMismatchText() -{ - return UI_STRING("type mismatch", "Validation message for input form controls with a value not matching type"); -} - -String WebPlatformStrategies::validationMessagePatternMismatchText() -{ - return UI_STRING("pattern mismatch", "Validation message for input form controls requiring a constrained value according to pattern"); -} - -String WebPlatformStrategies::validationMessageTooLongText() -{ - return UI_STRING("too long", "Validation message for form control elements with a value longer than maximum allowed length"); -} - -String WebPlatformStrategies::validationMessageRangeUnderflowText() -{ - return UI_STRING("range underflow", "Validation message for input form controls with value lower than allowed minimum"); -} - -String WebPlatformStrategies::validationMessageRangeOverflowText() -{ - return UI_STRING("range overflow", "Validation message for input form controls with value higher than allowed maximum"); -} - -String WebPlatformStrategies::validationMessageStepMismatchText() -{ - return UI_STRING("step mismatch", "Validation message for input form controls with value not respecting the step attribute"); -} - bool WebPlatformStrategies::isLinkVisited(Page* page, LinkHash hash) { return page->group().isLinkVisited(hash); diff --git a/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h b/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h index 6d2949d..c4f199b 100644 --- a/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h +++ b/Source/WebKit/win/WebCoreSupport/WebPlatformStrategies.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,12 +27,11 @@ #define WebPlatformStrategies_h #include <WebCore/CookiesStrategy.h> -#include <WebCore/LocalizationStrategy.h> #include <WebCore/PlatformStrategies.h> #include <WebCore/PluginStrategy.h> #include <WebCore/VisitedLinkStrategy.h> -class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::LocalizationStrategy, private WebCore::VisitedLinkStrategy { +class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::CookiesStrategy, private WebCore::PluginStrategy, private WebCore::VisitedLinkStrategy { public: static void initialize(); @@ -42,7 +41,6 @@ private: // WebCore::PlatformStrategies virtual WebCore::CookiesStrategy* createCookiesStrategy(); virtual WebCore::PluginStrategy* createPluginStrategy(); - virtual WebCore::LocalizationStrategy* createLocalizationStrategy(); virtual WebCore::VisitedLinkStrategy* createVisitedLinkStrategy(); // WebCore::CookiesStrategy @@ -52,101 +50,6 @@ private: virtual void refreshPlugins(); virtual void getPluginInfo(const WebCore::Page*, Vector<WebCore::PluginInfo>&); - // WebCore::LocalizationStrategy - virtual WTF::String inputElementAltText(); - virtual WTF::String resetButtonDefaultLabel(); - virtual WTF::String searchableIndexIntroduction(); - virtual WTF::String submitButtonDefaultLabel(); - virtual WTF::String fileButtonChooseFileLabel(); - virtual WTF::String fileButtonNoFileSelectedLabel(); - virtual WTF::String defaultDetailsSummaryText(); -#if ENABLE(CONTEXT_MENUS) - virtual WTF::String contextMenuItemTagOpenLinkInNewWindow(); - virtual WTF::String contextMenuItemTagDownloadLinkToDisk(); - virtual WTF::String contextMenuItemTagCopyLinkToClipboard(); - virtual WTF::String contextMenuItemTagOpenImageInNewWindow(); - virtual WTF::String contextMenuItemTagDownloadImageToDisk(); - virtual WTF::String contextMenuItemTagCopyImageToClipboard(); - virtual WTF::String contextMenuItemTagOpenFrameInNewWindow(); - virtual WTF::String contextMenuItemTagCopy(); - virtual WTF::String contextMenuItemTagGoBack(); - virtual WTF::String contextMenuItemTagGoForward(); - virtual WTF::String contextMenuItemTagStop(); - virtual WTF::String contextMenuItemTagReload(); - virtual WTF::String contextMenuItemTagCut(); - virtual WTF::String contextMenuItemTagPaste(); - virtual WTF::String contextMenuItemTagNoGuessesFound(); - virtual WTF::String contextMenuItemTagIgnoreSpelling(); - virtual WTF::String contextMenuItemTagLearnSpelling(); - virtual WTF::String contextMenuItemTagSearchWeb(); - virtual WTF::String contextMenuItemTagLookUpInDictionary(const WTF::String&); - virtual WTF::String contextMenuItemTagOpenLink(); - virtual WTF::String contextMenuItemTagIgnoreGrammar(); - virtual WTF::String contextMenuItemTagSpellingMenu(); - virtual WTF::String contextMenuItemTagShowSpellingPanel(bool show); - virtual WTF::String contextMenuItemTagCheckSpelling(); - virtual WTF::String contextMenuItemTagCheckSpellingWhileTyping(); - virtual WTF::String contextMenuItemTagCheckGrammarWithSpelling(); - virtual WTF::String contextMenuItemTagFontMenu(); - virtual WTF::String contextMenuItemTagBold(); - virtual WTF::String contextMenuItemTagItalic(); - virtual WTF::String contextMenuItemTagUnderline(); - virtual WTF::String contextMenuItemTagOutline(); - virtual WTF::String contextMenuItemTagWritingDirectionMenu(); - virtual WTF::String contextMenuItemTagTextDirectionMenu(); - virtual WTF::String contextMenuItemTagDefaultDirection(); - virtual WTF::String contextMenuItemTagLeftToRight(); - virtual WTF::String contextMenuItemTagRightToLeft(); - virtual WTF::String contextMenuItemTagInspectElement(); - virtual WTF::String contextMenuItemTagOpenVideoInNewWindow(); - virtual WTF::String contextMenuItemTagOpenAudioInNewWindow(); - virtual WTF::String contextMenuItemTagCopyVideoLinkToClipboard(); - virtual WTF::String contextMenuItemTagCopyAudioLinkToClipboard(); - virtual WTF::String contextMenuItemTagToggleMediaControls(); - virtual WTF::String contextMenuItemTagToggleMediaLoop(); - virtual WTF::String contextMenuItemTagEnterVideoFullscreen(); - virtual WTF::String contextMenuItemTagMediaPlay(); - virtual WTF::String contextMenuItemTagMediaPause(); - virtual WTF::String contextMenuItemTagMediaMute(); -#endif // ENABLE(CONTEXT_MENUS) - virtual WTF::String searchMenuNoRecentSearchesText(); - virtual WTF::String searchMenuRecentSearchesText(); - virtual WTF::String searchMenuClearRecentSearchesText(); - virtual WTF::String AXWebAreaText(); - virtual WTF::String AXLinkText(); - virtual WTF::String AXListMarkerText(); - virtual WTF::String AXImageMapText(); - virtual WTF::String AXHeadingText(); - virtual WTF::String AXDefinitionListTermText(); - virtual WTF::String AXDefinitionListDefinitionText(); - virtual WTF::String AXButtonActionVerb(); - virtual WTF::String AXRadioButtonActionVerb(); - virtual WTF::String AXTextFieldActionVerb(); - virtual WTF::String AXCheckedCheckBoxActionVerb(); - virtual WTF::String AXUncheckedCheckBoxActionVerb(); - virtual WTF::String AXMenuListActionVerb(); - virtual WTF::String AXMenuListPopupActionVerb(); - virtual WTF::String AXLinkActionVerb(); - virtual WTF::String missingPluginText(); - virtual WTF::String crashedPluginText(); - virtual WTF::String multipleFileUploadText(unsigned numberOfFiles); - virtual WTF::String unknownFileSizeText(); - virtual WTF::String uploadFileText(); - virtual WTF::String allFilesText(); - virtual WTF::String imageTitle(const WTF::String& filename, const WebCore::IntSize&); - virtual WTF::String mediaElementLoadingStateText(); - virtual WTF::String mediaElementLiveBroadcastStateText(); - virtual WTF::String localizedMediaControlElementString(const WTF::String&); - virtual WTF::String localizedMediaControlElementHelpText(const WTF::String&); - virtual WTF::String localizedMediaTimeDescription(float); - virtual WTF::String validationMessageValueMissingText(); - virtual WTF::String validationMessageTypeMismatchText(); - virtual WTF::String validationMessagePatternMismatchText(); - virtual WTF::String validationMessageTooLongText(); - virtual WTF::String validationMessageRangeUnderflowText(); - virtual WTF::String validationMessageRangeOverflowText(); - virtual WTF::String validationMessageStepMismatchText(); - // WebCore::VisitedLinkStrategy virtual bool isLinkVisited(WebCore::Page*, WebCore::LinkHash); virtual void addVisitedLink(WebCore::Page*, WebCore::LinkHash); diff --git a/Source/WebKit/win/WebDataSource.cpp b/Source/WebKit/win/WebDataSource.cpp index 0350373..1498f6e 100644 --- a/Source/WebKit/win/WebDataSource.cpp +++ b/Source/WebKit/win/WebDataSource.cpp @@ -246,7 +246,7 @@ HRESULT STDMETHODCALLTYPE WebDataSource::isLoading( HRESULT STDMETHODCALLTYPE WebDataSource::pageTitle( /* [retval][out] */ BSTR* title) { - *title = BString(m_loader->title()).release(); + *title = BString(m_loader->title().string()).release(); return S_OK; } diff --git a/Source/WebKit/win/WebDownload.h b/Source/WebKit/win/WebDownload.h index 3e8e734..446be46 100644 --- a/Source/WebKit/win/WebDownload.h +++ b/Source/WebKit/win/WebDownload.h @@ -26,8 +26,8 @@ #ifndef WebDownload_h #define WebDownload_h -#include "COMPtr.h" #include "WebKit.h" +#include <WebCore/COMPtr.h> #include <WebCore/PlatformString.h> #include <wtf/RetainPtr.h> diff --git a/Source/WebKit/win/WebDropSource.h b/Source/WebKit/win/WebDropSource.h index 5f06355..5b7ab8c 100644 --- a/Source/WebKit/win/WebDropSource.h +++ b/Source/WebKit/win/WebDropSource.h @@ -27,7 +27,7 @@ #ifndef WebDropSource_h #define WebDropSource_h -#include "COMPtr.h" +#include <WebCore/COMPtr.h> #include <objidl.h> class WebView; diff --git a/Source/WebKit/win/WebFrame.cpp b/Source/WebKit/win/WebFrame.cpp index 4b9e35d..5a99b66 100644 --- a/Source/WebKit/win/WebFrame.cpp +++ b/Source/WebKit/win/WebFrame.cpp @@ -30,7 +30,6 @@ #include "CFDictionaryPropertyBag.h" #include "COMPropertyBag.h" -#include "COMPtr.h" #include "DOMCoreClasses.h" #include "DefaultPolicyDelegate.h" #include "HTMLFrameOwnerElement.h" @@ -54,6 +53,7 @@ #include "WebURLResponse.h" #include "WebView.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/MemoryCache.h> #include <WebCore/Document.h> #include <WebCore/DocumentLoader.h> @@ -104,14 +104,14 @@ #include <JavaScriptCore/JSValue.h> #include <wtf/MathExtras.h> -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CoreGraphics.h> -#elif PLATFORM(CAIRO) +#elif USE(CAIRO) #include "PlatformContextCairo.h" #include <cairo-win32.h> #endif -#if PLATFORM(CG) +#if USE(CG) // CG SPI used for printing extern "C" { CGAffineTransform CGContextGetBaseCTM(CGContextRef c); @@ -2113,7 +2113,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::getPrintedPageCount( return S_OK; } -#if PLATFORM(CG) +#if USE(CG) void WebFrame::drawHeader(PlatformGraphicsContext* pctx, IWebUIDelegate* ui, const IntRect& pageRect, float headerHeight) { int x = pageRect.x(); @@ -2167,7 +2167,7 @@ void WebFrame::spoolPage(PlatformGraphicsContext* pctx, GraphicsContext* spoolCt CGContextEndPage(pctx); CGContextRestoreGState(pctx); } -#elif PLATFORM(CAIRO) +#elif USE(CAIRO) static float scaleFactor(HDC printDC, const IntRect& marginRect, const IntRect& pageRect) { const IntRect& printRect = printerRect(printDC); @@ -2320,12 +2320,12 @@ HRESULT STDMETHODCALLTYPE WebFrame::spoolPages( /* [in] */ UINT endPage, /* [retval][out] */ void* ctx) { -#if PLATFORM(CG) +#if USE(CG) if (!printDC || !ctx) { ASSERT_NOT_REACHED(); return E_POINTER; } -#elif PLATFORM(CAIRO) +#elif USE(CAIRO) if (!printDC) { ASSERT_NOT_REACHED(); return E_POINTER; @@ -2369,7 +2369,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::spoolPages( return E_FAIL; UINT pageCount = (UINT) m_pageRects.size(); -#if PLATFORM(CG) +#if USE(CG) PlatformGraphicsContext* pctx = (PlatformGraphicsContext*)ctx; #endif @@ -2396,7 +2396,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::spoolPages( for (UINT ii = startPage; ii < endPage; ii++) spoolPage(pctx, &spoolCtx, printDC, ui.get(), headerHeight, footerHeight, ii, pageCount); -#if PLATFORM(CAIRO) +#if USE(CAIRO) cairo_surface_finish(printSurface); ASSERT(!cairo_surface_status(printSurface)); cairo_surface_destroy(printSurface); diff --git a/Source/WebKit/win/WebFrame.h b/Source/WebKit/win/WebFrame.h index 9158fb3..95f2875 100644 --- a/Source/WebKit/win/WebFrame.h +++ b/Source/WebKit/win/WebFrame.h @@ -59,9 +59,9 @@ namespace WebCore { typedef const struct OpaqueJSContext* JSContextRef; typedef struct OpaqueJSValue* JSObjectRef; -#if PLATFORM(CG) +#if USE(CG) typedef struct CGContext PlatformGraphicsContext; -#elif PLATFORM(CAIRO) +#elif USE(CAIRO) namespace WebCore { class PlatformContextCairo; } diff --git a/Source/WebKit/win/WebHistoryItem.cpp b/Source/WebKit/win/WebHistoryItem.cpp index 031f8ab..f8ba2f1 100644 --- a/Source/WebKit/win/WebHistoryItem.cpp +++ b/Source/WebKit/win/WebHistoryItem.cpp @@ -28,10 +28,10 @@ #include "WebHistoryItem.h" #include "COMEnumVariant.h" -#include "COMPtr.h" #include "MarshallingHelpers.h" #include "WebKit.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/HistoryItem.h> #include <WebCore/KURL.h> #include <wtf/PassOwnPtr.h> diff --git a/Source/WebKit/win/WebIconDatabase.cpp b/Source/WebKit/win/WebIconDatabase.cpp index 24e8f41..664cac4 100644 --- a/Source/WebKit/win/WebIconDatabase.cpp +++ b/Source/WebKit/win/WebIconDatabase.cpp @@ -28,11 +28,11 @@ #include "WebIconDatabase.h" #include "CFDictionaryPropertyBag.h" -#include "COMPtr.h" #include "WebPreferences.h" #include "WebNotificationCenter.h" #include <WebCore/BitmapInfo.h> #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/FileSystem.h> #include <WebCore/IconDatabase.h> #include <WebCore/Image.h> diff --git a/Source/WebKit/win/WebKit.vcproj/InterfacesProduction.vsprops b/Source/WebKit/win/WebKit.vcproj/InterfacesProduction.vsprops index 5e71307..03cb439 100644 --- a/Source/WebKit/win/WebKit.vcproj/InterfacesProduction.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/InterfacesProduction.vsprops @@ -6,7 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; - $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\production.vsprops; .\InterfacesCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/InterfacesRelease.vsprops b/Source/WebKit/win/WebKit.vcproj/InterfacesRelease.vsprops index 77c4b1f..9329ecb 100644 --- a/Source/WebKit/win/WebKit.vcproj/InterfacesRelease.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/InterfacesRelease.vsprops @@ -6,6 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; .\InterfacesCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/InterfacesReleaseCairoCFLite.vsprops b/Source/WebKit/win/WebKit.vcproj/InterfacesReleaseCairoCFLite.vsprops index 5e17aee..64f5ee7 100644 --- a/Source/WebKit/win/WebKit.vcproj/InterfacesReleaseCairoCFLite.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/InterfacesReleaseCairoCFLite.vsprops @@ -6,6 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; .\InterfacesCommon.vsprops" diff --git a/Source/WebKit/win/WebKit.vcproj/WebKit.vcproj b/Source/WebKit/win/WebKit.vcproj/WebKit.vcproj index a8b9cc3..4d25f44 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKit.vcproj +++ b/Source/WebKit/win/WebKit.vcproj/WebKit.vcproj @@ -699,10 +699,6 @@ RelativePath="..\WebWorkersPrivate.h" > </File> - <File - RelativePath="..\WindowsTouch.h" - > - </File> </Filter> <Filter Name="Classes" diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDProduction.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDProduction.vsprops index 941bf46..61ade23 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDProduction.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDProduction.vsprops @@ -6,7 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; - $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\production.vsprops; .\WebKitGUIDCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDRelease.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDRelease.vsprops index 39566ea..c7628df 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDRelease.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDRelease.vsprops @@ -6,6 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; .\WebKitGUIDCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDReleaseCairoCFLite.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDReleaseCairoCFLite.vsprops index bc0b7a1..d4a09a3 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitGUIDReleaseCairoCFLite.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitGUIDReleaseCairoCFLite.vsprops @@ -6,6 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; .\WebKitGUIDCommon.vsprops" diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitLibPostBuild.cmd b/Source/WebKit/win/WebKit.vcproj/WebKitLibPostBuild.cmd index 7968952..02ecee5 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitLibPostBuild.cmd +++ b/Source/WebKit/win/WebKit.vcproj/WebKitLibPostBuild.cmd @@ -13,7 +13,5 @@ xcopy /y /d "%CONFIGURATIONBUILDDIR%\include\WebCore\nptypes.h" "%CONFIGURATIONB mkdir 2>NUL "%OUTDIR%\..\bin\WebKit.resources" xcopy /y /d "%PROJECTDIR%..\WebKit.resources\*" "%OUTDIR%\..\bin\WebKit.resources" -mkdir 2>NUL "%OUTDIR%\..\bin\WebKit.resources\en.lproj" -xcopy /y /d "%PROJECTDIR%..\..\English.lproj\Localizable.strings" "%OUTDIR%\..\bin\WebKit.resources\en.lproj\" if exist "%CONFIGURATIONBUILDDIR%\buildfailed" del "%CONFIGURATIONBUILDDIR%\buildfailed" diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitLibPreBuild.cmd b/Source/WebKit/win/WebKit.vcproj/WebKitLibPreBuild.cmd index b6f0bd4..82f02e9 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitLibPreBuild.cmd +++ b/Source/WebKit/win/WebKit.vcproj/WebKitLibPreBuild.cmd @@ -5,11 +5,6 @@ if exist "%CONFIGURATIONBUILDDIR%\buildfailed" grep XX%PROJECTNAME%XX "%CONFIGUR if errorlevel 1 exit 1 echo XX%PROJECTNAME%XX > "%CONFIGURATIONBUILDDIR%\buildfailed" -touch "%CONFIGURATIONBUILDDIR%\tmp.cpp" -cl /analyze /nologo /c "%CONFIGURATIONBUILDDIR%\tmp.cpp" /Fo"%INTDIR%\tmp.obj" 2>&1 | findstr D9040 -if ERRORLEVEL 1 (set EnablePREfast="true") else (set EnablePREfast="false") -if ERRORLEVEL 1 (set AnalyzeWithLargeStack="/analyze:65536") else (set AnalyzeWithLargeStack="") - mkdir 2>NUL "%CONFIGURATIONBUILDDIR%\include\JavaScriptCore" xcopy /y /d "%WEBKITLIBRARIESDIR%\include\JavaScriptCore\*" "%CONFIGURATIONBUILDDIR%\include\JavaScriptCore" diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitLibProduction.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitLibProduction.vsprops index 127707e..cca57e1 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitLibProduction.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitLibProduction.vsprops @@ -6,7 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; - $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\production.vsprops; .\WebKitLibCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitLibRelease.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitLibRelease.vsprops index 82f6dfd..18637a4 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitLibRelease.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitLibRelease.vsprops @@ -6,6 +6,7 @@ InheritedPropertySheets=" $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefines.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; .\WebKitLibCommon.vsprops" > diff --git a/Source/WebKit/win/WebKit.vcproj/WebKitLibReleaseCairoCFLite.vsprops b/Source/WebKit/win/WebKit.vcproj/WebKitLibReleaseCairoCFLite.vsprops index 692fdc0..4053bbe 100644 --- a/Source/WebKit/win/WebKit.vcproj/WebKitLibReleaseCairoCFLite.vsprops +++ b/Source/WebKit/win/WebKit.vcproj/WebKitLibReleaseCairoCFLite.vsprops @@ -7,6 +7,7 @@ $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\FeatureDefinesCairo.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\common.vsprops; + $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\releaseproduction.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\release.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\WinCairo.vsprops; $(WebKitVSPropsRedirectionDir)..\..\..\..\WebKitLibraries\win\tools\vsprops\cURL.vsprops; diff --git a/Source/WebKit/win/WebNavigationData.h b/Source/WebKit/win/WebNavigationData.h index f4793dc..54e5782 100644 --- a/Source/WebKit/win/WebNavigationData.h +++ b/Source/WebKit/win/WebNavigationData.h @@ -28,8 +28,8 @@ #include "WebKit.h" -#include "COMPtr.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> class WebNavigationData : public IWebNavigationData { public: diff --git a/Source/WebKit/win/WebPreferenceKeysPrivate.h b/Source/WebKit/win/WebPreferenceKeysPrivate.h index be0ebe5..9dd14ed 100644 --- a/Source/WebKit/win/WebPreferenceKeysPrivate.h +++ b/Source/WebKit/win/WebPreferenceKeysPrivate.h @@ -58,6 +58,7 @@ #define WebKitAllowAnimatedImagesPreferenceKey "WebKitAllowAnimatedImagesPreferenceKey" #define WebKitAllowAnimatedImageLoopingPreferenceKey "WebKitAllowAnimatedImageLoopingPreferenceKey" #define WebKitDisplayImagesKey "WebKitDisplayImagesKey" +#define WebKitLoadSiteIconsKey "WebKitLoadSiteIconsKey" #define WebKitBackForwardCacheExpirationIntervalKey "WebKitBackForwardCacheExpirationIntervalKey" #define WebKitTabToLinksPreferenceKey "WebKitTabToLinksPreferenceKey" #define WebKitPrivateBrowsingEnabledPreferenceKey "WebKitPrivateBrowsingEnabled" diff --git a/Source/WebKit/win/WebPreferences.cpp b/Source/WebKit/win/WebPreferences.cpp index a4869b6..0686c2b 100644 --- a/Source/WebKit/win/WebPreferences.cpp +++ b/Source/WebKit/win/WebPreferences.cpp @@ -28,16 +28,15 @@ #include "WebKitDLL.h" #include "WebPreferences.h" -#include "COMPtr.h" -#include "WebLocalizableStrings.h" #include "WebNotificationCenter.h" #include "WebPreferenceKeysPrivate.h" #include <CoreFoundation/CoreFoundation.h> #include <WebCore/CACFLayerTreeHost.h> +#include <WebCore/COMPtr.h> #include <WebCore/FileSystem.h> #include <WebCore/Font.h> -#include <WebCore/PlatformString.h> +#include <WebCore/LocalizedStrings.h> #include <limits> #include <shlobj.h> #include <wchar.h> @@ -45,8 +44,9 @@ #include <wtf/OwnArrayPtr.h> #include <wtf/text/CString.h> #include <wtf/text/StringHash.h> +#include <wtf/text/WTFString.h> -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CoreGraphics.h> #include <WebKitSystemInterface/WebKitSystemInterface.h> #endif @@ -193,7 +193,8 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitMinimumLogicalFontSizePreferenceKey), CFSTR("9")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFontSizePreferenceKey), CFSTR("16")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultFixedFontSizePreferenceKey), CFSTR("13")); - WTF::String defaultDefaultEncoding(LPCTSTR_UI_STRING("ISO-8859-1", "The default, default character encoding")); + + String defaultDefaultEncoding(WEB_UI_STRING("ISO-8859-1", "The default, default character encoding")); CFDictionaryAddValue(defaults, CFSTR(WebKitDefaultTextEncodingNamePreferenceKey), defaultDefaultEncoding.createCFString()); CFDictionaryAddValue(defaults, CFSTR(WebKitUserStyleSheetEnabledPreferenceKey), kCFBooleanFalse); @@ -217,6 +218,7 @@ void WebPreferences::initializeDefaultSettings() CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImagesPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitAllowAnimatedImageLoopingPreferenceKey), kCFBooleanTrue); CFDictionaryAddValue(defaults, CFSTR(WebKitDisplayImagesKey), kCFBooleanTrue); + CFDictionaryAddValue(defaults, CFSTR(WebKitLoadSiteIconsKey), kCFBooleanFalse); CFDictionaryAddValue(defaults, CFSTR(WebKitBackForwardCacheExpirationIntervalKey), CFSTR("1800")); CFDictionaryAddValue(defaults, CFSTR(WebKitTabToLinksPreferenceKey), kCFBooleanFalse); CFDictionaryAddValue(defaults, CFSTR(WebKitPrivateBrowsingEnabledPreferenceKey), kCFBooleanFalse); @@ -926,6 +928,20 @@ HRESULT STDMETHODCALLTYPE WebPreferences::loadsImagesAutomatically( return S_OK; } +HRESULT STDMETHODCALLTYPE WebPreferences::setLoadsSiteIconsIgnoringImageLoadingPreference( + /* [in] */ BOOL enabled) +{ + setBoolValue(CFSTR(WebKitLoadSiteIconsKey), enabled); + return S_OK; +} + +HRESULT STDMETHODCALLTYPE WebPreferences::loadsSiteIconsIgnoringImageLoadingPreference( + /* [retval][out] */ BOOL* enabled) +{ + *enabled = boolValueForKey(CFSTR(WebKitLoadSiteIconsKey)); + return S_OK; +} + HRESULT STDMETHODCALLTYPE WebPreferences::setAutosaves( /* [in] */ BOOL enabled) { @@ -1085,7 +1101,7 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothing( setIntegerValue(CFSTR(WebKitFontSmoothingTypePreferenceKey), smoothingType); if (smoothingType == FontSmoothingTypeWindows) smoothingType = FontSmoothingTypeMedium; -#if PLATFORM(CG) +#if USE(CG) wkSetFontSmoothingLevel((int)smoothingType); #endif return S_OK; @@ -1102,7 +1118,7 @@ HRESULT STDMETHODCALLTYPE WebPreferences::setFontSmoothingContrast( /* [in] */ float contrast) { setFloatValue(CFSTR(WebKitFontSmoothingContrastPreferenceKey), contrast); -#if PLATFORM(CG) +#if USE(CG) wkSetFontSmoothingContrast(contrast); #endif return S_OK; diff --git a/Source/WebKit/win/WebPreferences.h b/Source/WebKit/win/WebPreferences.h index d09945a..8996035 100644 --- a/Source/WebKit/win/WebPreferences.h +++ b/Source/WebKit/win/WebPreferences.h @@ -429,6 +429,9 @@ public: virtual HRESULT STDMETHODCALLTYPE hyperlinkAuditingEnabled(BOOL*); virtual HRESULT STDMETHODCALLTYPE setHyperlinkAuditingEnabled(BOOL); + virtual HRESULT STDMETHODCALLTYPE loadsSiteIconsIgnoringImageLoadingPreference(BOOL*); + virtual HRESULT STDMETHODCALLTYPE setLoadsSiteIconsIgnoringImageLoadingPreference(BOOL); + // WebPreferences // This method accesses a different preference key than developerExtrasEnabled. diff --git a/Source/WebKit/win/WebResource.h b/Source/WebKit/win/WebResource.h index 611803e..d5a01ac 100644 --- a/Source/WebKit/win/WebResource.h +++ b/Source/WebKit/win/WebResource.h @@ -27,7 +27,7 @@ #define WebResource_h #include "WebKit.h" -#include "COMPtr.h" +#include <WebCore/COMPtr.h> #include <WebCore/KURL.h> #include <WebCore/PlatformString.h> #include <WebCore/ResourceResponse.h> diff --git a/Source/WebKit/win/WebScrollBar.h b/Source/WebKit/win/WebScrollBar.h index 0482419..a741ffd 100644 --- a/Source/WebKit/win/WebScrollBar.h +++ b/Source/WebKit/win/WebScrollBar.h @@ -115,11 +115,13 @@ protected: virtual int scrollPosition(WebCore::Scrollbar*) const; virtual void setScrollOffset(const WebCore::IntPoint&); virtual void invalidateScrollbarRect(WebCore::Scrollbar*, const WebCore::IntRect&); + virtual void invalidateScrollCornerRect(const WebCore::IntRect&) { } // FIXME: We should provide a way to set this value. virtual bool isActive() const { return true; } - virtual bool scrollbarCornerPresent() const { return false; } + virtual bool isScrollCornerVisible() const { return false; } + virtual WebCore::IntRect scrollCornerRect() const { return WebCore::IntRect(); } virtual WebCore::Scrollbar* horizontalScrollbar() const; virtual WebCore::Scrollbar* verticalScrollbar() const; diff --git a/Source/WebKit/win/WebURLAuthenticationChallenge.cpp b/Source/WebKit/win/WebURLAuthenticationChallenge.cpp index 1663376..e12d0fd 100644 --- a/Source/WebKit/win/WebURLAuthenticationChallenge.cpp +++ b/Source/WebKit/win/WebURLAuthenticationChallenge.cpp @@ -27,7 +27,6 @@ #include "WebKitDLL.h" #include "WebURLAuthenticationChallenge.h" -#include "COMPtr.h" #include "WebError.h" #include "WebKit.h" #include "WebURLAuthenticationChallengeSender.h" @@ -36,6 +35,7 @@ #include "WebURLResponse.h" #include "WebKit.h" #include <WebCore/BString.h> +#include <WebCore/COMPtr.h> #include <WebCore/ResourceHandle.h> using namespace WebCore; diff --git a/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp b/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp index 0a9154f..69c7ca3 100644 --- a/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp +++ b/Source/WebKit/win/WebURLAuthenticationChallengeSender.cpp @@ -28,11 +28,11 @@ #include <initguid.h> #include "WebURLAuthenticationChallengeSender.h" -#include "COMPtr.h" #include "WebKit.h" #include "WebURLAuthenticationChallenge.h" #include "WebURLCredential.h" #include <WebCore/AuthenticationClient.h> +#include <WebCore/COMPtr.h> using namespace WebCore; diff --git a/Source/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp b/Source/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp index 3d329d1..8ae2c53 100644 --- a/Source/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp +++ b/Source/WebKit/win/WebURLAuthenticationChallengeSenderCFNet.cpp @@ -28,11 +28,11 @@ #include <initguid.h> #include "WebURLAuthenticationChallengeSender.h" -#include "COMPtr.h" #include "WebKit.h" #include "WebURLAuthenticationChallenge.h" #include "WebURLCredential.h" #include <WebCore/AuthenticationClient.h> +#include <WebCore/COMPtr.h> using namespace WebCore; diff --git a/Source/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp b/Source/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp index 2f49f67..df07f34 100644 --- a/Source/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp +++ b/Source/WebKit/win/WebURLAuthenticationChallengeSenderCurl.cpp @@ -28,11 +28,11 @@ #include <initguid.h> #include "WebURLAuthenticationChallengeSender.h" -#include "COMPtr.h" #include "NotImplemented.h" #include "WebKit.h" #include "WebURLAuthenticationChallenge.h" #include "WebURLCredential.h" +#include <WebCore/COMPtr.h> #include <WebCore/ResourceHandle.h> using namespace WebCore; diff --git a/Source/WebKit/win/WebURLResponse.cpp b/Source/WebKit/win/WebURLResponse.cpp index b6c94dd..f8afa9a 100644 --- a/Source/WebKit/win/WebURLResponse.cpp +++ b/Source/WebKit/win/WebURLResponse.cpp @@ -31,7 +31,6 @@ #include "COMPropertyBag.h" #include "MarshallingHelpers.h" -#include "WebLocalizableStrings.h" #if USE(CFNETWORK) #include <WebKitSystemInterface/WebKitSystemInterface.h> @@ -40,6 +39,7 @@ #include <wtf/platform.h> #include <WebCore/BString.h> #include <WebCore/KURL.h> +#include <WebCore/LocalizedStrings.h> #include <WebCore/ResourceHandle.h> #include <shlobj.h> #include <shlwapi.h> @@ -47,160 +47,160 @@ using namespace WebCore; -static LPCTSTR CFHTTPMessageCopyLocalizedShortDescriptionForStatusCode(CFIndex statusCode) +static String CFHTTPMessageCopyLocalizedShortDescriptionForStatusCode(CFIndex statusCode) { - LPCTSTR result = 0; + String result; if (statusCode < 100 || statusCode >= 600) - result = LPCTSTR_UI_STRING("server error", "HTTP result code string"); + result = WEB_UI_STRING("server error", "HTTP result code string"); else if (statusCode >= 100 && statusCode <= 199) { switch (statusCode) { case 100: - result = LPCTSTR_UI_STRING("continue", "HTTP result code string"); + result = WEB_UI_STRING("continue", "HTTP result code string"); break; case 101: - result = LPCTSTR_UI_STRING("switching protocols", "HTTP result code string"); + result = WEB_UI_STRING("switching protocols", "HTTP result code string"); break; default: - result = LPCTSTR_UI_STRING("informational", "HTTP result code string"); + result = WEB_UI_STRING("informational", "HTTP result code string"); break; } } else if (statusCode >= 200 && statusCode <= 299) { switch (statusCode) { case 200: - result = LPCTSTR_UI_STRING("no error", "HTTP result code string"); + result = WEB_UI_STRING("no error", "HTTP result code string"); break; case 201: - result = LPCTSTR_UI_STRING("created", "HTTP result code string"); + result = WEB_UI_STRING("created", "HTTP result code string"); break; case 202: - result = LPCTSTR_UI_STRING("accepted", "HTTP result code string"); + result = WEB_UI_STRING("accepted", "HTTP result code string"); break; case 203: - result = LPCTSTR_UI_STRING("non-authoritative information", "HTTP result code string"); + result = WEB_UI_STRING("non-authoritative information", "HTTP result code string"); break; case 204: - result = LPCTSTR_UI_STRING("no content", "HTTP result code string"); + result = WEB_UI_STRING("no content", "HTTP result code string"); break; case 205: - result = LPCTSTR_UI_STRING("reset content", "HTTP result code string"); + result = WEB_UI_STRING("reset content", "HTTP result code string"); break; case 206: - result = LPCTSTR_UI_STRING("partial content", "HTTP result code string"); + result = WEB_UI_STRING("partial content", "HTTP result code string"); break; default: - result = LPCTSTR_UI_STRING("success", "HTTP result code string"); + result = WEB_UI_STRING("success", "HTTP result code string"); break; } } else if (statusCode >= 300 && statusCode <= 399) { switch (statusCode) { case 300: - result = LPCTSTR_UI_STRING("multiple choices", "HTTP result code string"); + result = WEB_UI_STRING("multiple choices", "HTTP result code string"); break; case 301: - result = LPCTSTR_UI_STRING("moved permanently", "HTTP result code string"); + result = WEB_UI_STRING("moved permanently", "HTTP result code string"); break; case 302: - result = LPCTSTR_UI_STRING("found", "HTTP result code string"); + result = WEB_UI_STRING("found", "HTTP result code string"); break; case 303: - result = LPCTSTR_UI_STRING("see other", "HTTP result code string"); + result = WEB_UI_STRING("see other", "HTTP result code string"); break; case 304: - result = LPCTSTR_UI_STRING("not modified", "HTTP result code string"); + result = WEB_UI_STRING("not modified", "HTTP result code string"); break; case 305: - result = LPCTSTR_UI_STRING("needs proxy", "HTTP result code string"); + result = WEB_UI_STRING("needs proxy", "HTTP result code string"); break; case 307: - result = LPCTSTR_UI_STRING("temporarily redirected", "HTTP result code string"); + result = WEB_UI_STRING("temporarily redirected", "HTTP result code string"); break; case 306: // 306 status code unused in HTTP default: - result = LPCTSTR_UI_STRING("redirected", "HTTP result code string"); + result = WEB_UI_STRING("redirected", "HTTP result code string"); break; } } else if (statusCode >= 400 && statusCode <= 499) { switch (statusCode) { case 400: - result = LPCTSTR_UI_STRING("bad request", "HTTP result code string"); + result = WEB_UI_STRING("bad request", "HTTP result code string"); break; case 401: - result = LPCTSTR_UI_STRING("unauthorized", "HTTP result code string"); + result = WEB_UI_STRING("unauthorized", "HTTP result code string"); break; case 402: - result = LPCTSTR_UI_STRING("payment required", "HTTP result code string"); + result = WEB_UI_STRING("payment required", "HTTP result code string"); break; case 403: - result = LPCTSTR_UI_STRING("forbidden", "HTTP result code string"); + result = WEB_UI_STRING("forbidden", "HTTP result code string"); break; case 404: - result = LPCTSTR_UI_STRING("not found", "HTTP result code string"); + result = WEB_UI_STRING("not found", "HTTP result code string"); break; case 405: - result = LPCTSTR_UI_STRING("method not allowed", "HTTP result code string"); + result = WEB_UI_STRING("method not allowed", "HTTP result code string"); break; case 406: - result = LPCTSTR_UI_STRING("unacceptable", "HTTP result code string"); + result = WEB_UI_STRING("unacceptable", "HTTP result code string"); break; case 407: - result = LPCTSTR_UI_STRING("proxy authentication required", "HTTP result code string"); + result = WEB_UI_STRING("proxy authentication required", "HTTP result code string"); break; case 408: - result = LPCTSTR_UI_STRING("request timed out", "HTTP result code string"); + result = WEB_UI_STRING("request timed out", "HTTP result code string"); break; case 409: - result = LPCTSTR_UI_STRING("conflict", "HTTP result code string"); + result = WEB_UI_STRING("conflict", "HTTP result code string"); break; case 410: - result = LPCTSTR_UI_STRING("no longer exists", "HTTP result code string"); + result = WEB_UI_STRING("no longer exists", "HTTP result code string"); break; case 411: - result = LPCTSTR_UI_STRING("length required", "HTTP result code string"); + result = WEB_UI_STRING("length required", "HTTP result code string"); break; case 412: - result = LPCTSTR_UI_STRING("precondition failed", "HTTP result code string"); + result = WEB_UI_STRING("precondition failed", "HTTP result code string"); break; case 413: - result = LPCTSTR_UI_STRING("request too large", "HTTP result code string"); + result = WEB_UI_STRING("request too large", "HTTP result code string"); break; case 414: - result = LPCTSTR_UI_STRING("requested URL too long", "HTTP result code string"); + result = WEB_UI_STRING("requested URL too long", "HTTP result code string"); break; case 415: - result = LPCTSTR_UI_STRING("unsupported media type", "HTTP result code string"); + result = WEB_UI_STRING("unsupported media type", "HTTP result code string"); break; case 416: - result = LPCTSTR_UI_STRING("requested range not satisfiable", "HTTP result code string"); + result = WEB_UI_STRING("requested range not satisfiable", "HTTP result code string"); break; case 417: - result = LPCTSTR_UI_STRING("expectation failed", "HTTP result code string"); + result = WEB_UI_STRING("expectation failed", "HTTP result code string"); break; default: - result = LPCTSTR_UI_STRING("client error", "HTTP result code string"); + result = WEB_UI_STRING("client error", "HTTP result code string"); break; } } else if (statusCode >= 500 && statusCode <= 599) { switch (statusCode) { case 500: - result = LPCTSTR_UI_STRING("internal server error", "HTTP result code string"); + result = WEB_UI_STRING("internal server error", "HTTP result code string"); break; case 501: - result = LPCTSTR_UI_STRING("unimplemented", "HTTP result code string"); + result = WEB_UI_STRING("unimplemented", "HTTP result code string"); break; case 502: - result = LPCTSTR_UI_STRING("bad gateway", "HTTP result code string"); + result = WEB_UI_STRING("bad gateway", "HTTP result code string"); break; case 503: - result = LPCTSTR_UI_STRING("service unavailable", "HTTP result code string"); + result = WEB_UI_STRING("service unavailable", "HTTP result code string"); break; case 504: - result = LPCTSTR_UI_STRING("gateway timed out", "HTTP result code string"); + result = WEB_UI_STRING("gateway timed out", "HTTP result code string"); break; case 505: - result = LPCTSTR_UI_STRING("unsupported version", "HTTP result code string"); + result = WEB_UI_STRING("unsupported version", "HTTP result code string"); break; default: - result = LPCTSTR_UI_STRING("server error", "HTTP result code string"); + result = WEB_UI_STRING("server error", "HTTP result code string"); break; } } @@ -372,11 +372,11 @@ HRESULT STDMETHODCALLTYPE WebURLResponse::localizedStringForStatusCode( ASSERT(m_response.isHTTP()); if (statusString) *statusString = 0; - LPCTSTR statusText = CFHTTPMessageCopyLocalizedShortDescriptionForStatusCode(statusCode); + String statusText = CFHTTPMessageCopyLocalizedShortDescriptionForStatusCode(statusCode); if (!statusText) return E_FAIL; if (statusString) - *statusString = SysAllocString(statusText); + *statusString = BString(statusText).release(); return S_OK; } diff --git a/Source/WebKit/win/WebView.cpp b/Source/WebKit/win/WebView.cpp index 69f83de..c9f086b 100644 --- a/Source/WebKit/win/WebView.cpp +++ b/Source/WebKit/win/WebView.cpp @@ -58,7 +58,6 @@ #include "WebPluginHalterClient.h" #include "WebPreferences.h" #include "WebScriptWorld.h" -#include "WindowsTouch.h" #include "resource.h" #include <JavaScriptCore/APICast.h> #include <JavaScriptCore/InitializeThreading.h> @@ -131,6 +130,7 @@ #include <WebCore/SystemInfo.h> #include <WebCore/TypingCommand.h> #include <WebCore/WindowMessageBroadcaster.h> +#include <WebCore/WindowsTouch.h> #include <wtf/Threading.h> #if ENABLE(CLIENT_BASED_GEOLOCATION) @@ -138,7 +138,7 @@ #include <WebCore/GeolocationError.h> #endif -#if PLATFORM(CG) +#if USE(CG) #include <CoreGraphics/CGContext.h> #endif @@ -1079,9 +1079,9 @@ void WebView::paint(HDC dc, LPARAM options) void WebView::paintIntoBackingStore(FrameView* frameView, HDC bitmapDC, const IntRect& dirtyRect, WindowsToPaint windowsToPaint) { -#if USE(ACCELERATED_COMPOSITING) - ASSERT(!isAcceleratedCompositing()); -#endif + // FIXME: This function should never be called in accelerated compositing mode, and we should + // assert as such. But currently it *is* sometimes called, so we can't assert yet. See + // <http://webkit.org/b/58539>. LOCAL_GDI_COUNTER(0, __FUNCTION__); @@ -1122,9 +1122,9 @@ void WebView::paintIntoBackingStore(FrameView* frameView, HDC bitmapDC, const In void WebView::paintIntoWindow(HDC bitmapDC, HDC windowDC, const IntRect& dirtyRect) { -#if USE(ACCELERATED_COMPOSITING) - ASSERT(!isAcceleratedCompositing()); -#endif + // FIXME: This function should never be called in accelerated compositing mode, and we should + // assert as such. But currently it *is* sometimes called, so we can't assert yet. See + // <http://webkit.org/b/58539>. LOCAL_GDI_COUNTER(0, __FUNCTION__); #if FLASH_WINDOW_REDRAW @@ -1935,8 +1935,6 @@ bool WebView::handleEditingKeyboardEvent(KeyboardEvent* evt) bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (virtualKeyCode == VK_CAPITAL) - frame->eventHandler()->capsLockStateMayHaveChanged(); PlatformKeyboardEvent keyEvent(m_viewWindow, virtualKeyCode, keyData, PlatformKeyboardEvent::RawKeyDown, systemKeyDown); bool handled = frame->eventHandler()->keyEvent(keyEvent); @@ -1955,10 +1953,12 @@ bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown) return true; } - // We need to handle back/forward using either Backspace(+Shift) or Ctrl+Left/Right Arrow keys. - if ((virtualKeyCode == VK_BACK && keyEvent.shiftKey()) || (virtualKeyCode == VK_RIGHT && keyEvent.ctrlKey())) + // We need to handle back/forward using either Ctrl+Left/Right Arrow keys. + // FIXME: This logic should probably be in EventHandler::defaultArrowEventHandler(). + // FIXME: Should check that other modifiers aren't pressed. + if (virtualKeyCode == VK_RIGHT && keyEvent.ctrlKey()) return m_page->goForward(); - if (virtualKeyCode == VK_BACK || (virtualKeyCode == VK_LEFT && keyEvent.ctrlKey())) + if (virtualKeyCode == VK_LEFT && keyEvent.ctrlKey()) return m_page->goBack(); // Need to scroll the page if the arrow keys, pgup/dn, or home/end are hit. @@ -2015,6 +2015,15 @@ bool WebView::keyPress(WPARAM charCode, LPARAM keyData, bool systemKeyDown) return frame->eventHandler()->keyEvent(keyEvent); } +void WebView::setIsBeingDestroyed() +{ + m_isBeingDestroyed = true; + + // Remove our this pointer from the window so we won't try to handle any more window messages. + // See <http://webkit.org/b/55054>. + ::SetWindowLongPtrW(m_viewWindow, 0, 0); +} + bool WebView::registerWebViewWindowClass() { static bool haveRegisteredWindowClass = false; @@ -2061,9 +2070,13 @@ LRESULT CALLBACK WebView::WebViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0); WebView* webView = reinterpret_cast<WebView*>(longPtr); WebFrame* mainFrameImpl = webView ? webView->topLevelFrame() : 0; - if (!mainFrameImpl || webView->isBeingDestroyed()) + if (!mainFrameImpl) return DefWindowProc(hWnd, message, wParam, lParam); + // We shouldn't be trying to handle any window messages after WM_DESTROY. + // See <http://webkit.org/b/55054>. + ASSERT(!webView->isBeingDestroyed()); + // hold a ref, since the WebView could go away in an event handler. COMPtr<WebView> protector(webView); ASSERT(webView); @@ -3182,7 +3195,7 @@ HRESULT STDMETHODCALLTYPE WebView::preferencesIdentifier( static void systemParameterChanged(WPARAM parameter) { -#if PLATFORM(CG) +#if USE(CG) if (parameter == SPI_SETFONTSMOOTHING || parameter == SPI_SETFONTSMOOTHINGTYPE || parameter == SPI_SETFONTSMOOTHINGCONTRAST || parameter == SPI_SETFONTSMOOTHINGORIENTATION) wkSystemFontSmoothingChanged(); #endif @@ -4778,6 +4791,11 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification) return hr; settings->setHyperlinkAuditingEnabled(enabled); + hr = prefsPrivate->loadsSiteIconsIgnoringImageLoadingPreference(&enabled); + if (FAILED(hr)) + return hr; + settings->setLoadsSiteIconsIgnoringImageLoadingSetting(!!enabled); + if (!m_closeWindowTimer) m_mainFrame->invalidate(); // FIXME diff --git a/Source/WebKit/win/WebView.h b/Source/WebKit/win/WebView.h index 957f0a5..db3c2e7 100644 --- a/Source/WebKit/win/WebView.h +++ b/Source/WebKit/win/WebView.h @@ -26,10 +26,10 @@ #ifndef WebView_H #define WebView_H -#include "COMPtr.h" #include "WebKit.h" #include "WebFrame.h" #include "WebPreferences.h" +#include <WebCore/COMPtr.h> #include <WebCore/DragActions.h> #include <WebCore/IntRect.h> #include <WebCore/RefCountedGDIHandle.h> @@ -883,7 +883,7 @@ public: static WTF::String standardUserAgentWithApplicationName(const WTF::String&); - void setIsBeingDestroyed() { m_isBeingDestroyed = true; } + void setIsBeingDestroyed(); bool isBeingDestroyed() const { return m_isBeingDestroyed; } const char* interpretKeyEvent(const WebCore::KeyboardEvent*); diff --git a/Source/WebKit/win/WindowsTouch.h b/Source/WebKit/win/WindowsTouch.h deleted file mode 100644 index 9048103..0000000 --- a/Source/WebKit/win/WindowsTouch.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2009 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef WindowsTouch_h -#define WindowsTouch_h - -/* - * The following constants are used to determine multitouch and gesture behavior - * for Windows 7. For more information, see: - * http://msdn.microsoft.com/en-us/library/dd562197(VS.85).aspx - */ - -// Value used in WebViewWndProc for Gestures -#define WM_GESTURE 0x0119 -#define WM_GESTURENOTIFY 0x011A - -// Gesture Information Flags -#define GF_BEGIN 0x00000001 -#define GF_INERTIA 0x00000002 -#define GF_END 0x00000004 - -// Gesture IDs -#define GID_BEGIN 1 -#define GID_END 2 -#define GID_ZOOM 3 -#define GID_PAN 4 -#define GID_ROTATE 5 -#define GID_TWOFINGERTAP 6 -#define GID_PRESSANDTAP 7 -#define GID_ROLLOVER GID_PRESSANDTAP - -// Zoom Gesture Confiration Flags -#define GC_ZOOM 0x00000001 - -// Pan Gesture Configuration Flags -#define GC_PAN 0x00000001 -#define GC_PAN_WITH_SINGLE_FINGER_VERTICALLY 0x00000002 -#define GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY 0x00000004 -#define GC_PAN_WITH_GUTTER 0x00000008 -#define GC_PAN_WITH_INERTIA 0x00000010 - -// Rotate Gesture Configuration Flags -#define GC_ROTATE 0x00000001 - -// Two finger tap configuration flags -#define GC_TWOFINGERTAP 0x00000001 - -// Press and tap Configuration Flags -#define GC_PRESSANDTAP 0x00000001 -#define GC_ROLLOVER GC_PRESSANDTAP - -// GESTUREINFO struct definition -typedef struct tagGESTUREINFO { - UINT cbSize; // size, in bytes, of this structure (including variable length Args field) - DWORD dwFlags; // see GF_* flags - DWORD dwID; // gesture ID, see GID_* defines - HWND hwndTarget; // handle to window targeted by this gesture - POINTS ptsLocation; // current location of this gesture - DWORD dwInstanceID; // internally used - DWORD dwSequenceID; // internally used - ULONGLONG ullArguments; // arguments for gestures whose arguments fit in 8 BYTES - UINT cbExtraArgs; // size, in bytes, of extra arguments, if any, that accompany this gesture -} GESTUREINFO, *PGESTUREINFO; -typedef GESTUREINFO const * PCGESTUREINFO; - -// GESTURECONFIG struct defintion -typedef struct tagGESTURECONFIG { - DWORD dwID; // gesture ID - DWORD dwWant; // settings related to gesture ID that are to be turned on - DWORD dwBlock; // settings related to gesture ID that are to be turned off -} GESTURECONFIG, *PGESTURECONFIG; - -/* - * Gesture notification structure - * - The WM_GESTURENOTIFY message lParam contains a pointer to this structure. - * - The WM_GESTURENOTIFY message notifies a window that gesture recognition is - * in progress and a gesture will be generated if one is recognized under the - * current gesture settings. - */ -typedef struct tagGESTURENOTIFYSTRUCT { - UINT cbSize; // size, in bytes, of this structure - DWORD dwFlags; // unused - HWND hwndTarget; // handle to window targeted by the gesture - POINTS ptsLocation; // starting location - DWORD dwInstanceID; // internally used -} GESTURENOTIFYSTRUCT, *PGESTURENOTIFYSTRUCT; - -DECLARE_HANDLE(HGESTUREINFO); - -#endif diff --git a/Source/WebKit/wince/ChangeLog b/Source/WebKit/wince/ChangeLog index e595f25..f5257b6 100644 --- a/Source/WebKit/wince/ChangeLog +++ b/Source/WebKit/wince/ChangeLog @@ -1,3 +1,54 @@ +2011-04-19 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename lengthReceived to encodedDataLength/dataLength + https://bugs.webkit.org/show_bug.cgi?id=58883 + + * WebCoreSupport/FrameLoaderClientWinCE.h: + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebCoreSupport/EditorClientWinCE.h: + (WebKit::EditorClientWinCE::requestCheckingOfString): + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * WebView.cpp: (WebView::handleKeyDown): Moved Caps Lock handling from WebKits to WebCore, + because WebKit shouldn't be smart. + +2011-03-31 Patrick Gansterer <paroga@webkit.org> + + Unreviewed WinCE build fix for r82580. + + * WebCoreSupport/FrameLoaderClientWinCE.h: StringWithDirection is in WebCore + and not in WTF namespace. + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebCoreSupport/FrameLoaderClientWinCE.cpp: + (WebKit::FrameLoaderClientWinCE::dispatchDidReceiveTitle): + (WebKit::FrameLoaderClientWinCE::setTitle): + * WebCoreSupport/FrameLoaderClientWinCE.h: + 2011-03-27 Patrick Gansterer <paroga@webkit.org> Reviewed by Andreas Kling. diff --git a/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h b/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h index d93ecc5..a2b23b4 100644 --- a/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h +++ b/Source/WebKit/wince/WebCoreSupport/EditorClientWinCE.h @@ -101,7 +101,7 @@ public: virtual void getGuessesForWord(const WTF::String& word, const WTF::String& context, WTF::Vector<WTF::String>& guesses); virtual void willSetInputMethodState(); virtual void setInputMethodState(bool); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {} + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {} virtual WebCore::TextCheckerClient* textChecker() { return this; } private: diff --git a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp index 2d8812f..648c4a5 100644 --- a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp +++ b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.cpp @@ -371,7 +371,7 @@ void FrameLoaderClientWinCE::dispatchDidStartProvisionalLoad() notImplemented(); } -void FrameLoaderClientWinCE::dispatchDidReceiveTitle(const String&) +void FrameLoaderClientWinCE::dispatchDidReceiveTitle(const StringWithDirection&) { notImplemented(); } @@ -490,7 +490,7 @@ void FrameLoaderClientWinCE::prepareForDataSourceReplacement() notImplemented(); } -void FrameLoaderClientWinCE::setTitle(const String&, const KURL&) +void FrameLoaderClientWinCE::setTitle(const StringWithDirection&, const KURL&) { notImplemented(); } diff --git a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h index 401225d..b0314e5 100644 --- a/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h +++ b/Source/WebKit/wince/WebCoreSupport/FrameLoaderClientWinCE.h @@ -60,7 +60,7 @@ public: virtual void dispatchDidReceiveAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidCancelAuthenticationChallenge(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::AuthenticationChallenge&); virtual void dispatchDidReceiveResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&); - virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); + virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int dataLength); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); virtual bool dispatchDidLoadResourceFromMemoryCache(WebCore::DocumentLoader*, const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, int length); @@ -76,7 +76,7 @@ public: virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const WTF::String&); + virtual void dispatchDidReceiveTitle(const WebCore::StringWithDirection&); virtual void dispatchDidChangeIcons(); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&); @@ -169,7 +169,7 @@ public: virtual void prepareForDataSourceReplacement(); virtual WTF::PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); - virtual void setTitle(const WTF::String& title, const WebCore::KURL&); + virtual void setTitle(const WebCore::StringWithDirection&, const WebCore::KURL&); virtual WTF::String userAgent(const WebCore::KURL&); diff --git a/Source/WebKit/wince/WebView.cpp b/Source/WebKit/wince/WebView.cpp index c21a7fd..56cbf28 100644 --- a/Source/WebKit/wince/WebView.cpp +++ b/Source/WebKit/wince/WebView.cpp @@ -347,8 +347,6 @@ bool WebView::handleMouseWheel(HWND hWnd, WPARAM wParam, LPARAM lParam, bool isH bool WebView::handleKeyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown) { Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (virtualKeyCode == VK_CAPITAL) - frame->eventHandler()->capsLockStateMayHaveChanged(); PlatformKeyboardEvent keyEvent(m_windowHandle, virtualKeyCode, keyData, PlatformKeyboardEvent::RawKeyDown, systemKeyDown); bool handled = frame->eventHandler()->keyEvent(keyEvent); diff --git a/Source/WebKit/wx/ChangeLog b/Source/WebKit/wx/ChangeLog index 980fa8a..908e356 100644 --- a/Source/WebKit/wx/ChangeLog +++ b/Source/WebKit/wx/ChangeLog @@ -1,3 +1,67 @@ +2011-04-14 Kevin Ollivier <kevino@theolliviers.com> + + [wx] Unreviewed build fixes for wxMSW and wx 2.9.1.1. + + * WebKitSupport/ChromeClientWx.cpp: + (WebCore::ChromeClientWx::setCursor): + +2011-04-06 Malcolm MacLeod <malcolm.macleod@tshwanedje.com> + + Reviewed by Kevin Ollivier. + + [wx] Fix cursor handling so that we always call the chrome to set it. + + https://bugs.webkit.org/show_bug.cgi?id=57972 + + * WebKitSupport/ChromeClientWx.cpp: + (WebCore::ChromeClientWx::setCursor): + +2011-04-04 MORITA Hajime <morrita@google.com> + + Reviewed by Ryosuke Niwa. + + [Refactoring] SpellCheckingResult should be replaced with TextCheckingResult + https://bugs.webkit.org/show_bug.cgi?id=56085 + + * WebKitSupport/EditorClientWx.h: + (WebCore::EditorClientWx::requestCheckingOfString): + +2011-04-04 Malcolm MacLeod <mmacleod@webmail.co.za> + + Reviewed by Kevin Ollivier. + + Move to using FrameView::resize to handle changes in view size. + + https://bugs.webkit.org/show_bug.cgi?id=57805 + + * WebView.cpp: + (wxWebView::OnSize): + +2011-04-04 Alexey Proskuryakov <ap@apple.com> + + Reviewed by Dan Bernstein. + + REGRESSION (WebKit2): Caps-Lock indicator sometimes doesn't appear in WebKit2 + https://bugs.webkit.org/show_bug.cgi?id=51230 + <rdar://problem/8780989> + + * WebView.cpp: (wxWebView::OnKeyEvents): Moved Caps Lock handling from + WebKits to WebCore, because WebKit shouldn't be smart. + +2011-03-31 Evan Martin <evan@chromium.org> + + Reviewed by Eric Seidel. + + <title> should support dir attribute + https://bugs.webkit.org/show_bug.cgi?id=50961 + + Update to new FrameLoaderClient interface. + + * WebKitSupport/FrameLoaderClientWx.cpp: + (WebCore::FrameLoaderClientWx::dispatchDidReceiveTitle): + (WebCore::FrameLoaderClientWx::setTitle): + * WebKitSupport/FrameLoaderClientWx.h: + 2011-03-25 Andy Estes <aestes@apple.com> Reviewed by Adele Peterson. diff --git a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp index d525c09..19096de 100644 --- a/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp +++ b/Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp @@ -460,9 +460,10 @@ void ChromeClientWx::chooseIconForFiles(const Vector<String>& filenames, FileCho chooser->iconLoaded(Icon::createIconForFiles(filenames)); } -void ChromeClientWx::setCursor(const Cursor&) +void ChromeClientWx::setCursor(const Cursor& cursor) { - notImplemented(); + if (m_webView && cursor.impl()) + m_webView->SetCursor(*cursor.impl()); } void ChromeClientWx::requestGeolocationPermissionForFrame(Frame*, Geolocation*) diff --git a/Source/WebKit/wx/WebKitSupport/EditorClientWx.h b/Source/WebKit/wx/WebKitSupport/EditorClientWx.h index d1d3597..65ee493 100644 --- a/Source/WebKit/wx/WebKitSupport/EditorClientWx.h +++ b/Source/WebKit/wx/WebKitSupport/EditorClientWx.h @@ -114,7 +114,7 @@ public: virtual void willSetInputMethodState(); virtual void setInputMethodState(bool enabled); - virtual void requestCheckingOfString(WebCore::SpellChecker*, int, const WTF::String&) {} + virtual void requestCheckingOfString(WebCore::SpellChecker*, int, WebCore::TextCheckingTypeMask, const WTF::String&) {} virtual TextCheckerClient* textChecker() { return this; } private: diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp index afc255c..b408636 100644 --- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp +++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.cpp @@ -295,12 +295,13 @@ void FrameLoaderClientWx::dispatchDidStartProvisionalLoad() } -void FrameLoaderClientWx::dispatchDidReceiveTitle(const String& title) +void FrameLoaderClientWx::dispatchDidReceiveTitle(const StringWithDirection& title) { if (m_webView) { - m_webView->SetPageTitle(title); + // FIXME: use direction of title. + m_webView->SetPageTitle(title.string()); wxWebViewReceivedTitleEvent wkEvent(m_webView); - wkEvent.SetTitle(title); + wkEvent.SetTitle(title.string()); m_webView->GetEventHandler()->ProcessEvent(wkEvent); } } @@ -525,7 +526,7 @@ void FrameLoaderClientWx::prepareForDataSourceReplacement() } -void FrameLoaderClientWx::setTitle(const String& title, const KURL&) +void FrameLoaderClientWx::setTitle(const StringWithDirection& title, const KURL&) { notImplemented(); } diff --git a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h index 254f95c..b28d389 100644 --- a/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h +++ b/Source/WebKit/wx/WebKitSupport/FrameLoaderClientWx.h @@ -103,7 +103,7 @@ namespace WebCore { virtual void dispatchWillClose(); virtual void dispatchDidReceiveIcon(); virtual void dispatchDidStartProvisionalLoad(); - virtual void dispatchDidReceiveTitle(const String& title); + virtual void dispatchDidReceiveTitle(const StringWithDirection& title); virtual void dispatchDidCommitLoad(); virtual void dispatchDidFinishDocumentLoad(); virtual void dispatchDidFinishLoad(); @@ -145,7 +145,7 @@ namespace WebCore { virtual void addHistoryItemForFragmentScroll(); virtual void didFinishLoad(); virtual void prepareForDataSourceReplacement(); - virtual void setTitle(const String& title, const KURL&); + virtual void setTitle(const StringWithDirection&, const KURL&); virtual String userAgent(const KURL&); diff --git a/Source/WebKit/wx/WebView.cpp b/Source/WebKit/wx/WebView.cpp index dab3225..acfd0ee 100644 --- a/Source/WebKit/wx/WebView.cpp +++ b/Source/WebKit/wx/WebView.cpp @@ -703,8 +703,7 @@ void wxWebView::OnSize(wxSizeEvent& event) { if (m_isInitialized && m_mainFrame) { WebCore::Frame* frame = m_mainFrame->GetFrame(); - frame->view()->setFrameRect(wxRect(wxPoint(0,0), event.GetSize())); - frame->view()->forceLayout(); + frame->view()->resize(event.GetSize()); frame->view()->adjustViewSize(); } @@ -895,9 +894,6 @@ void wxWebView::OnKeyEvents(wxKeyEvent& event) if (!(frame && frame->view())) return; - if (event.GetKeyCode() == WXK_CAPITAL) - frame->eventHandler()->capsLockStateMayHaveChanged(); - WebCore::PlatformKeyboardEvent wkEvent(event); if (frame->eventHandler()->keyEvent(wkEvent)) |