diff options
Diffstat (limited to 'WebKit/chromium')
63 files changed, 2439 insertions, 286 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index 009dc60..2c720e1 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,561 @@ +2010-07-28 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Dimitri Glazkov. + + Add access to the computed style display to WebAccessibilityObject. + https://bugs.webkit.org/show_bug.cgi?id=43044 + + * public/WebAccessibilityObject.h: + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::hasComputedStyle): + (WebKit::WebAccessibilityObject::computedStyleDisplay): + +2010-07-28 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Set ENABLE_DEVICE_ORIENTATION=1 in features.gypi for chromium + https://bugs.webkit.org/show_bug.cgi?id=43122 + + Enable the compile-time switch for device orientation. + The switch was already enabled in features_override.gypi in the Chromium + repository (in revision 53317), and should be set here as well. + + The feature is being implemented behind a run-time flag which + defaults to off in Chromium. + + * features.gypi: Set ENABLE_DEVICE_ORIENTATION=1. + +2010-07-28 Gene Gutnik <gene@google.com> + + Reviewed by Darin Fisher. + + Fix mouse coordinate conversion. WindowX,Y is an absolute + mouse coordinates within browser window, x,y - are coordinates + relative to the plugin. + https://bugs.webkit.org/show_bug.cgi?id=42987 + + * src/WebInputEventConversion.cpp: + (WebKit::WebMouseEventBuilder::WebMouseEventBuilder): + (WebKit::WebMouseWheelEventBuilder::WebMouseWheelEventBuilder): + * src/WebInputEventConversion.h: + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleMouseEvent): + (WebKit::WebPluginContainerImpl::handleWheelEvent): + +2010-07-28 James Robinson <jamesr@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Add a bool to Settings to control accelerated 2d canvas + https://bugs.webkit.org/show_bug.cgi?id=43094 + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setAccelerated2dCanvasEnabled): + * src/WebSettingsImpl.h: + +2010-07-28 Brett Wilson <brettw@chromium.org> + + Reviewed by Darin Fisher. + + Fix forward declares to be struct instead of class. + https://bugs.webkit.org/show_bug.cgi?id=43127 + + * public/WebFont.h: + +2010-07-28 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Dimitri Glazkov. + + Chromium DevTools: [REGRESSION] sourceURL is not respected. + + https://bugs.webkit.org/show_bug.cgi?id=43124 + + * src/js/DebuggerScript.js: + +2010-07-28 Andrei Popescu <andreip@google.com> + + Reviewed by Jeremy Orlow. + + [IndexedDB] WebDOMStringList default ctor does not initialize its m_private member + variable so any attempt to append strings to a WebDOMStringList instance results in a crash. + https://bugs.webkit.org/show_bug.cgi?id=43120 + + Makes the default WebKit::WebDOMStringList ctor actually create its wrapped + WebCore::DOMStringList instance. + + * public/WebDOMStringList.h: + * src/WebDOMStringList.cpp: + (WebKit::WebDOMStringList::WebDOMStringList): + +2010-07-26 Steve Block <steveblock@google.com> + + Reviewed by Jeremy Orlow. + + Page clients should be passed to Page constructor via structure of pointers + https://bugs.webkit.org/show_bug.cgi?id=42834 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + +2010-07-28 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: chromium tests fix. + Chromium Dev Tools: [REGRESSION] Pause is not working. + + https://bugs.webkit.org/show_bug.cgi?id=43118 + + * src/js/DevTools.js: + (InspectorBackend.pause): + +2010-07-27 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by Ojan Vafai. + + Add FILE_SYSTEM build flag for FileSystem API + https://bugs.webkit.org/show_bug.cgi?id=42915 + + * features.gypi: + +2010-07-27 James Hawkins <jhawkins@chromium.org> + + Unreviewed Build Fix. + + Add a missing itemIcon() method to TestPopupMenuClient. + + * tests/PopupMenuTest.cpp: + (WebKit::TestPopupMenuClient::itemIcon): + +2010-07-27 James Hawkins <jhawkins@chromium.org> + + Reviewed by Darin Fisher. + + [Chromium] Add the ability to show right-aligned icons in the AutoFill popup. + https://bugs.webkit.org/show_bug.cgi?id=43076 + + * public/WebView.h: + * src/AutoFillPopupMenuClient.cpp: + (WebKit::AutoFillPopupMenuClient::getIcon): + (WebKit::AutoFillPopupMenuClient::removeSuggestionAtIndex): + (WebKit::AutoFillPopupMenuClient::itemIcon): + (WebKit::AutoFillPopupMenuClient::initialize): + (WebKit::AutoFillPopupMenuClient::setSuggestions): + * src/AutoFillPopupMenuClient.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::applyAutoFillSuggestions): + (WebKit::WebViewImpl::applyAutocompleteSuggestions): + * src/WebViewImpl.h: + +2010-07-27 Brett Wilson <brettw@chromium.org> + + Reviewed by Darin Fisher. + + Add the ability to select fonts and do basic text drawing to the + Chromium WebKit API. + https://bugs.webkit.org/show_bug.cgi?id=42999 + + * WebKit.gyp: + * public/WebFloatPoint.h: Added. + (WebKit::WebFloatPoint::WebFloatPoint): + (WebKit::WebFloatPoint::operator=): + (WebKit::WebFloatPoint::operator WebCore::FloatPoint): + (WebKit::operator==): + (WebKit::operator!=): + * public/WebFloatRect.h: Added. + (WebKit::WebFloatRect::isEmpty): + (WebKit::WebFloatRect::WebFloatRect): + (WebKit::WebFloatRect::operator=): + (WebKit::WebFloatRect::operator WebCore::FloatRect): + (WebKit::operator==): + (WebKit::operator!=): + * public/WebFont.h: Added. + * public/WebFontDescription.h: Added. + (WebKit::WebFontDescription::): + (WebKit::WebFontDescription::WebFontDescription): + * public/WebTextRun.h: Added. + (WebKit::WebTextRun::WebTextRun): + * src/AssertMatchingEnums.cpp: + * src/WebFontDescription.cpp: Added. + (WebKit::WebFontDescription::WebFontDescription): + (WebKit::WebFontDescription::operator WebCore::FontDescription): + * src/WebFontImpl.cpp: Added. + (WebKit::WebFont::Create): + (WebKit::WebFontImpl::WebFontImpl): + (WebKit::WebFontImpl::fontDescription): + (WebKit::WebFontImpl::ascent): + (WebKit::WebFontImpl::descent): + (WebKit::WebFontImpl::height): + (WebKit::WebFontImpl::lineSpacing): + (WebKit::WebFontImpl::xHeight): + (WebKit::WebFontImpl::drawText): + (WebKit::WebFontImpl::width): + (WebKit::WebFontImpl::offsetForPosition): + (WebKit::WebFontImpl::selectionRectForText): + * src/WebFontImpl.h: Added. + * src/WebTextRun.cpp: Added. + (WebKit::WebTextRun::operator WebCore::TextRun): + +2010-07-27 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by David Levin. + + Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE). + https://bugs.webkit.org/show_bug.cgi?id=43035 + + Make Chromium compile with ENABLE_DATABASE=0. + + * src/ChromiumBridge.cpp: + (WebCore::ChromiumBridge::databaseGetFileSize): + * src/DatabaseObserver.cpp: + * src/WebDatabase.cpp: + (WebCore::AbstractDatabase::stringIdentifier): + (WebCore::AbstractDatabase::displayName): + (WebCore::AbstractDatabase::estimatedSize): + (WebCore::AbstractDatabase::securityOrigin): + (WebKit::WebDatabase::updateDatabaseSize): + (WebKit::WebDatabase::closeDatabaseImmediately): + +2010-07-27 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: if breakpoints were deactivated, add new breakpoints as disabled. + https://bugs.webkit.org/show_bug.cgi?id=41461 + + * src/js/DebuggerScript.js: + (): + +2010-07-27 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + WebInspector: Current implementation of message based inspector + transport generated by CodeGeneratorInspector should be upstreamed + from WebKit/chromium to WebCore. + https://bugs.webkit.org/show_bug.cgi?id=42983 + + * WebKit.gypi: + * src/InspectorFrontendClientImpl.cpp: + (WebKit::InspectorFrontendClientImpl::sendMessageToBackend): + * src/InspectorFrontendClientImpl.h: + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController): + (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost): + * src/WebDevToolsAgentImpl.h: + * src/js/InspectorControllerImpl.js: Removed. + +2010-07-27 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Chris Fleizach. + + Add accessors for node and document to WebAccessibilityObject, + needed to support some Windows screenreader functionality. + + https://bugs.webkit.org/show_bug.cgi?id=43001 + + * public/WebAccessibilityObject.h: + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::node): + (WebKit::WebAccessibilityObject::document): + +2010-07-27 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Chris Fleizach. + + For Windows accessibility, have WebElement provide access + to its attributes. + + https://bugs.webkit.org/show_bug.cgi?id=43004 + + * WebKit.gyp: + * public/WebAttribute.h: Added. + (WebKit::WebAttribute::~WebAttribute): + (WebKit::WebAttribute::WebAttribute): + (WebKit::WebAttribute::operator=): + * public/WebElement.h: + * public/WebNamedNodeMap.h: Added. + (WebKit::WebNamedNodeMap::~WebNamedNodeMap): + (WebKit::WebNamedNodeMap::WebNamedNodeMap): + (WebKit::WebNamedNodeMap::operator=): + * src/WebAttribute.cpp: Added. + (WebKit::WebAttribute::reset): + (WebKit::WebAttribute::assign): + (WebKit::WebAttribute::WebAttribute): + (WebKit::WebAttribute::localName): + (WebKit::WebAttribute::value): + * src/WebElement.cpp: + (WebKit::WebElement::attributes): + * src/WebNamedNodeMap.cpp: Added. + (WebKit::WebNamedNodeMap::reset): + (WebKit::WebNamedNodeMap::assign): + (WebKit::WebNamedNodeMap::WebNamedNodeMap): + (WebKit::WebNamedNodeMap::length): + (WebKit::WebNamedNodeMap::attributeItem): + +2010-07-27 Satish Sampath <satish@chromium.org> + + Reviewed by Kent Tamura. + + Simplify speech input plumbing in webcore and webkit + https://bugs.webkit.org/show_bug.cgi?id=43008 + + * src/SpeechInputClientImpl.cpp: Move functionality to WebCore::SpeechInput and make this a dummy proxy. + (WebKit::SpeechInputClientImpl::startRecognition): + (WebKit::SpeechInputClientImpl::cancelRecognition): + (WebKit::SpeechInputClientImpl::didCompleteRecording): + (WebKit::SpeechInputClientImpl::didCompleteRecognition): + (WebKit::SpeechInputClientImpl::setRecognitionResult): + * src/SpeechInputClientImpl.h: + +2010-07-26 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Chris Fleizach. + + Add accessor to get the doctype of a WebDocument, needed to + implement Windows accessibility. + + https://bugs.webkit.org/show_bug.cgi?id=43003 + + * WebKit.gyp: + * public/WebDocument.h: + * public/WebDocumentType.h: Added. + (WebKit::WebDocumentType::WebDocumentType): + (WebKit::WebDocumentType::operator=): + (WebKit::WebDocumentType::assign): + * src/WebDocument.cpp: + (WebKit::WebDocument::doctype): + * src/WebDocumentType.cpp: Added. + (WebKit::WebDocumentType::name): + (WebKit::WebDocumentType::WebDocumentType): + (WebKit::WebDocumentType::operator=): + (WebKit::WebDocumentType::operator PassRefPtr<DocumentType>): + +2010-07-26 Satish Sampath <satish@chromium.org> + + Reviewed by Steve Block. + + Add WebKit plumbing to connect speech requests and callbacks between WebCore and the embedder. + https://bugs.webkit.org/show_bug.cgi?id=42367 + + No new tests, the relevant LayoutTestController bindings and tests will be added in the next patch. + + * public/WebSpeechInputController.h: Added new interface, implemented by embedder and called by WebKit + (WebKit::WebSpeechInputController::~WebSpeechInputController): + * public/WebSpeechInputListener.h: Added new interface, implemented by WebKit and called by embedder. + (WebKit::WebSpeechInputListener::~WebSpeechInputListener): + * public/WebViewClient.h: + (WebKit::WebViewClient::createSpeechInputClient): New method to get the embedder's speech input client interface. + * src/SpeechInputClientImpl.cpp: Added new class, implementation of a two way connector between WebCore + and the embedder for requests and responses. + (WebKit::SpeechInputClientImpl::SpeechInputClientImpl): + (WebKit::SpeechInputClientImpl::~SpeechInputClientImpl): + (WebKit::SpeechInputClientImpl::startRecognition): + (WebKit::SpeechInputClientImpl::stopRecording): + (WebKit::SpeechInputClientImpl::didCompleteRecording): + (WebKit::SpeechInputClientImpl::setRecognitionResult): + (WebKit::SpeechInputClientImpl::didCompleteRecognition): + * src/SpeechInputClientImpl.h: Added. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): Pass on the above mentioned speech input connector to WebCore. + * src/WebViewImpl.h: + +2010-07-26 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + Chromium DevTools: refactor query params, add basic + support for WebSocket-based backend. + + https://bugs.webkit.org/show_bug.cgi?id=42893 + + * src/js/DevTools.js: + (devtools.ToolsAgent.prototype.dispatchOnClient_): + (WebInspector.loaded): + (WebInspector.doLoadedDone): + (devtools.domContentLoaded): + * src/js/InspectorControllerImpl.js: + +2010-07-24 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: chromium build fix. + + * src/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::fillResourceList): + +2010-07-23 Kavita Kanetkar <kkanetkar@chromium.org> + + Reviewed by Joseph Pecoraro. + + Implement remaining Inspector support for chrome's appcache + https://bugs.webkit.org/show_bug.cgi?id=42426 + + * src/ApplicationCacheHost.cpp: Plugging in chrome's appcache info. + (WebCore::ApplicationCacheHost::applicationCacheInfo): + (WebCore::ApplicationCacheHost::fillResourceList): + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Reviewed by Yury Semikhatsky. + + Chromium DevTools: migrate from utility context-based injected + script dispatch to upstream schema. + + https://bugs.webkit.org/show_bug.cgi?id=42883 + + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebDevToolsAgentImpl.h: + * src/js/DevToolsHostStub.js: + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: rolling out r63963. + + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::dispatchOnInjectedScript): + * src/WebDevToolsAgentImpl.h: + * src/js/DevToolsHostStub.js: + (.window.dispatchOnInjectedScript): + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + (devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript): + +2010-07-23 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Reviewed by Yury Semikhatsky. + + Chromium DevTools: migrate from utility context-based injected + script dispatch to upstream schema. + + https://bugs.webkit.org/show_bug.cgi?id=42883 + + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebDevToolsAgentImpl.h: + * src/js/DevToolsHostStub.js: + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-07-23 Kent Tamura <tkent@chromium.org> + + Reviewed by Shinichiro Hamaji. + + Roll Chromium revision + https://bugs.webkit.org/show_bug.cgi?id=42876 + + * DEPS: Roll Chromium revision to r53434 in order to have the + logger initialization change (r53303) + +2010-07-22 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + WebInspector: CodeGeneratorInspector was extended and now it can + generate InspectorBackedDispatcher's code. This dispatcher will + validate and dispatch incoming inspector commands only by native + code without using javaScript. That is necessary step for + RemoteDebugging support. + https://bugs.webkit.org/show_bug.cgi?id=42588 + + * src/ToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::dispatchOnInspectorController): + * src/WebDevToolsAgentImpl.h: + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl.prototype.callInspectorController_): + +2010-07-22 Darin Fisher <darin@chromium.org> + + Reviewed by David Levin. + + [Chromium] Propagate return value of EventHandler::handleMouseWheelEvent + to caller of WebViewImpl::handleInputEvent. + + https://bugs.webkit.org/show_bug.cgi?id=42835 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::mouseWheel): + (WebKit::WebViewImpl::handleInputEvent): + * src/WebViewImpl.h: + +2010-07-22 Darin Fisher <darin@chromium.org> + + Reviewed by Kent Tamura. + + https://bugs.webkit.org/show_bug.cgi?id=42808 + Pass context menu events through WebInputEvent to WebPlugin::handleInputEvent. + + The DOM treats a context menu event as a type of mouse event. We therefore + do the same here, and reuse the WebMouseEvent subclass. This makes sense + since a context menu event has (x,y)-coordinates. + + * public/WebInputEvent.h: + (WebKit::WebInputEvent::): + (WebKit::WebInputEvent::isMouseEventType): + * src/WebInputEventConversion.cpp: + (WebKit::WebMouseEventBuilder::WebMouseEventBuilder): + +2010-07-22 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Stop granting universal access to inspector front-end page. + https://bugs.webkit.org/show_bug.cgi?id=42817 + + * src/WebDevToolsFrontendImpl.cpp: + (WebKit::WebDevToolsFrontendImpl::frontendLoaded): + +2010-07-22 Alexander Pavlov <apavlov@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Rename method for CSS rule source range retrieval and fix return object format + https://bugs.webkit.org/show_bug.cgi?id=42379 + + * src/js/InspectorControllerImpl.js: + (devtools.InspectorBackendImpl): + +2010-07-21 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Chromium Dev Tools: Separators are missing in the context menu. + + https://bugs.webkit.org/show_bug.cgi?id=42761 + + * src/ContextMenuClientImpl.cpp: + (WebKit::ContextMenuClientImpl::populateCustomMenuItems): + +2010-07-21 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [DRT/Chromium] Copy the test plugin into DumpRenderTree.app/ + https://bugs.webkit.org/show_bug.cgi?id=42733 + + This was dropped in plugin copy refactoring. + + * WebKit.gyp: + +2010-07-21 Brady Eidson <beidson@apple.com> + + Reviewed by Geoffrey Garen. + + Break out "scheme registration" functionality from SecurityOrigin to a SchemeRegistry + https://bugs.webkit.org/show_bug.cgi?id=42783 + + * src/WebSecurityPolicy.cpp: + (WebKit::WebSecurityPolicy::registerURLSchemeAsLocal): + (WebKit::WebSecurityPolicy::registerURLSchemeAsNoAccess): + (WebKit::WebSecurityPolicy::registerURLSchemeAsSecure): + 2010-07-21 Bo Liu <boliu@chromium.org> Reviewed by Darin Fisher. diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 24bf389..7c7d7e7 100644 --- a/WebKit/chromium/DEPS +++ b/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '52869', + 'chromium_rev': '53434', } deps = { diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 8abc159..97efddc 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -116,6 +116,7 @@ 'public/WebAnimationController.h', 'public/WebApplicationCacheHost.h', 'public/WebApplicationCacheHostClient.h', + 'public/WebAttribute.h', 'public/WebBindings.h', 'public/WebCache.h', 'public/WebCanvas.h', @@ -144,6 +145,7 @@ 'public/WebDevToolsMessageData.h', 'public/WebDevToolsMessageTransport.h', 'public/WebDocument.h', + 'public/WebDocumentType.h', 'public/WebDragData.h', 'public/WebEditingAction.h', 'public/WebElement.h', @@ -154,6 +156,10 @@ 'public/WebFileInfo.h', 'public/WebFileSystem.h', 'public/WebFindOptions.h', + 'public/WebFloatPoint.h', + 'public/WebFloatRect.h', + 'public/WebFont.h', + 'public/WebFontDescription.h', 'public/WebFrame.h', 'public/WebFrameClient.h', 'public/WebFontCache.h', @@ -191,6 +197,7 @@ 'public/WebMessagePortChannelClient.h', 'public/WebMimeRegistry.h', 'public/WebMutationEvent.h', + 'public/WebNamedNodeMap.h', 'public/WebNavigationType.h', 'public/WebNode.h', 'public/WebNodeCollection.h', @@ -234,6 +241,8 @@ 'public/WebSocketStreamError.h', 'public/WebSocketStreamHandle.h', 'public/WebSocketStreamHandleClient.h', + 'public/WebSpeechInputController.h', + 'public/WebSpeechInputListener.h', 'public/WebStorageArea.h', 'public/WebStorageEventDispatcher.h', 'public/WebStorageNamespace.h', @@ -242,6 +251,7 @@ 'public/WebTextCaseSensitivity.h', 'public/WebTextDirection.h', 'public/WebTextInputType.h', + 'public/WebTextRun.h', 'public/WebThemeEngine.h', 'public/WebURL.h', 'public/WebURLError.h', @@ -339,6 +349,8 @@ 'src/ResourceHandle.cpp', 'src/SharedWorkerRepository.cpp', 'src/SocketStreamHandle.cpp', + 'src/SpeechInputClientImpl.cpp', + 'src/SpeechInputClientImpl.h', 'src/StorageAreaProxy.cpp', 'src/StorageAreaProxy.h', 'src/StorageEventDispatcherChromium.cpp', @@ -354,6 +366,7 @@ 'src/WebAccessibilityObject.cpp', 'src/WebAnimationControllerImpl.cpp', 'src/WebAnimationControllerImpl.h', + 'src/WebAttribute.cpp', 'src/WebBindings.cpp', 'src/WebCache.cpp', 'src/WebColor.cpp', @@ -371,6 +384,7 @@ 'src/WebDevToolsFrontendImpl.cpp', 'src/WebDevToolsFrontendImpl.h', 'src/WebDocument.cpp', + 'src/WebDocumentType.cpp', 'src/WebDragData.cpp', 'src/WebElement.cpp', 'src/WebEntities.cpp', @@ -382,6 +396,9 @@ 'src/WebFileChooserCompletionImpl.cpp', 'src/WebFileChooserCompletionImpl.h', 'src/WebFontCache.cpp', + 'src/WebFontDescription.cpp', + 'src/WebFontImpl.cpp', + 'src/WebFontImpl.h', 'src/WebFormControlElement.cpp', 'src/WebFormElement.cpp', 'src/WebFrameImpl.cpp', @@ -420,6 +437,7 @@ 'src/WebMediaPlayerClientImpl.cpp', 'src/WebMediaPlayerClientImpl.h', 'src/WebMutationEvent.cpp', + 'src/WebNamedNodeMap.cpp', 'src/WebNode.cpp', 'src/WebNodeCollection.cpp', 'src/WebNodeList.cpp', @@ -462,6 +480,7 @@ 'src/WebStorageNamespaceImpl.cpp', 'src/WebStorageNamespaceImpl.h', 'src/WebString.cpp', + 'src/WebTextRun.cpp', 'src/WebURL.cpp', 'src/WebURLLoadTiming.cpp', 'src/WebURLRequest.cpp', @@ -823,6 +842,11 @@ '../../WebKitTools/DumpRenderTree/fonts/WebKitWeightWatcher900.ttf', '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png', ], + # Workaround for http://code.google.com/p/gyp/issues/detail?id=160 + 'copies': [{ + 'destination': '<(PRODUCT_DIR)/DumpRenderTree.app/Contents/PlugIns/', + 'files': ['<(PRODUCT_DIR)/TestNetscapePlugIn.plugin/'], + }], },{ # OS!="mac" 'sources/': [ # .mm is already excluded by common.gypi diff --git a/WebKit/chromium/WebKit.gypi b/WebKit/chromium/WebKit.gypi index 7d7b19c..b45e3e7 100644 --- a/WebKit/chromium/WebKit.gypi +++ b/WebKit/chromium/WebKit.gypi @@ -33,7 +33,6 @@ # List of DevTools source files, ordered by dependencies. It is used both # for copying them to resource dir, and for generating 'devtools.html' file. 'devtools_js_files': [ - 'src/js/InspectorControllerImpl.js', 'src/js/ProfilerAgent.js', 'src/js/ProfilerProcessor.js', 'src/js/HeapProfilerPanel.js', diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi index eadce7e..559ebd8 100644 --- a/WebKit/chromium/features.gypi +++ b/WebKit/chromium/features.gypi @@ -45,11 +45,13 @@ 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', + 'ENABLE_DEVICE_ORIENTATION=1', 'ENABLE_DIRECTORY_UPLOAD=1', 'ENABLE_DOM_STORAGE=1', 'ENABLE_EVENTSOURCE=1', 'ENABLE_FILE_READER=1', 'ENABLE_FILE_WRITER=1', + 'ENABLE_FILE_SYSTEM=1', 'ENABLE_FILTERS=1', 'ENABLE_GEOLOCATION=1', 'ENABLE_ICONDATABASE=0', diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h index f1b2474..ddb9bda 100644 --- a/WebKit/chromium/public/WebAccessibilityObject.h +++ b/WebKit/chromium/public/WebAccessibilityObject.h @@ -42,6 +42,8 @@ namespace WTF { template <typename T> class PassRefPtr; } namespace WebKit { class WebAccessibilityObjectPrivate; +class WebNode; +class WebDocument; class WebString; struct WebPoint; struct WebRect; @@ -103,6 +105,11 @@ public: WEBKIT_API WebString stringValue() const; WEBKIT_API WebString title() const; + WEBKIT_API WebNode node() const; + WEBKIT_API WebDocument document() const; + WEBKIT_API bool hasComputedStyle() const; + WEBKIT_API WebString computedStyleDisplay() const; + #if WEBKIT_IMPLEMENTATION WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); WebAccessibilityObject& operator=(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); diff --git a/WebKit/chromium/public/WebAttribute.h b/WebKit/chromium/public/WebAttribute.h new file mode 100644 index 0000000..56e140b --- /dev/null +++ b/WebKit/chromium/public/WebAttribute.h @@ -0,0 +1,74 @@ +/* + * 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: + * + * * 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 WebAttribute_h +#define WebAttribute_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" + +namespace WebCore { class Attribute; } +#if WEBKIT_IMPLEMENTATION +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { +class WebString; + +// Provides readonly access to some properties of a DOM attribute. +class WebAttribute { +public: + ~WebAttribute() { reset(); } + + WebAttribute() { } + WebAttribute(const WebAttribute& n) { assign(n); } + WebAttribute& operator=(const WebAttribute& n) + { + assign(n); + return *this; + } + + WEBKIT_API void reset(); + WEBKIT_API void assign(const WebAttribute&); + + WEBKIT_API WebString localName() const; + WEBKIT_API WebString value() const; + +#if WEBKIT_IMPLEMENTATION + WebAttribute(const WTF::PassRefPtr<WebCore::Attribute>&); +#endif + +private: + WebPrivatePtr<WebCore::Attribute> m_private; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebDOMStringList.h b/WebKit/chromium/public/WebDOMStringList.h index b3fb533..d88fcee 100644 --- a/WebKit/chromium/public/WebDOMStringList.h +++ b/WebKit/chromium/public/WebDOMStringList.h @@ -46,7 +46,7 @@ class WebDOMStringList { public: ~WebDOMStringList() { reset(); } - WebDOMStringList() { } + WebDOMStringList(); WebDOMStringList(const WebDOMStringList& l) { assign(l); } WebDOMStringList& operator=(const WebDOMStringList& l) { diff --git a/WebKit/chromium/public/WebDocument.h b/WebKit/chromium/public/WebDocument.h index c093c58..d9f7386 100644 --- a/WebKit/chromium/public/WebDocument.h +++ b/WebKit/chromium/public/WebDocument.h @@ -34,11 +34,15 @@ #include "WebNode.h" #if WEBKIT_IMPLEMENTATION -namespace WebCore { class Document; } +namespace WebCore { +class Document; +class DocumentType; +} namespace WTF { template <typename T> class PassRefPtr; } #endif namespace WebKit { +class WebDocumentType; class WebElement; class WebFrame; class WebNodeCollection; @@ -74,6 +78,7 @@ public: WEBKIT_API WebURL completeURL(const WebString&) const; WEBKIT_API WebElement getElementById(const WebString&) const; WEBKIT_API WebNode focusedNode() const; + WEBKIT_API WebDocumentType doctype() const; #if WEBKIT_IMPLEMENTATION WebDocument(const WTF::PassRefPtr<WebCore::Document>&); diff --git a/WebKit/chromium/public/WebDocumentType.h b/WebKit/chromium/public/WebDocumentType.h new file mode 100644 index 0000000..b339320 --- /dev/null +++ b/WebKit/chromium/public/WebDocumentType.h @@ -0,0 +1,68 @@ +/* + * 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: + * + * * 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 WebDocumentType_h +#define WebDocumentType_h + +#include "WebNode.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class DocumentType; } +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { +class WebString; + +// Provides readonly access to some properties of a DOM document type. +class WebDocumentType : public WebNode { +public: + WebDocumentType() { } + WebDocumentType(const WebDocumentType& e) : WebNode(e) { } + + WebDocumentType& operator=(const WebDocumentType& e) + { + WebNode::assign(e); + return *this; + } + void assign(const WebDocumentType& e) { WebNode::assign(e); } + + WEBKIT_API WebString name() const; + +#if WEBKIT_IMPLEMENTATION + WebDocumentType(const WTF::PassRefPtr<WebCore::DocumentType>&); + WebDocumentType& operator=(const WTF::PassRefPtr<WebCore::DocumentType>&); + operator WTF::PassRefPtr<WebCore::DocumentType>() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebElement.h b/WebKit/chromium/public/WebElement.h index 1be40bc..16a82d8 100644 --- a/WebKit/chromium/public/WebElement.h +++ b/WebKit/chromium/public/WebElement.h @@ -38,6 +38,8 @@ namespace WebCore { class Element; } #endif namespace WebKit { +class WebNamedNodeMap; + // Provides access to some properties of a DOM element node. class WebElement : public WebNode { public: @@ -53,6 +55,7 @@ namespace WebKit { WEBKIT_API bool hasAttribute(const WebString&) const; WEBKIT_API WebString getAttribute(const WebString&) const; WEBKIT_API bool setAttribute(const WebString& name, const WebString& value); + WEBKIT_API WebNamedNodeMap attributes() const; WEBKIT_API WebString innerText() const; #if WEBKIT_IMPLEMENTATION diff --git a/WebKit/chromium/public/WebFloatPoint.h b/WebKit/chromium/public/WebFloatPoint.h new file mode 100644 index 0000000..c053ed6 --- /dev/null +++ b/WebKit/chromium/public/WebFloatPoint.h @@ -0,0 +1,91 @@ +/* + * 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: + * + * * 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 WebFloatPoint_h +#define WebFloatPoint_h + +#include "WebCommon.h" + +#if WEBKIT_IMPLEMENTATION +#include "IntPoint.h" +#endif + +namespace WebKit { + +struct WebFloatPoint { + float x; + float y; + + WebFloatPoint() + : x(0.0f) + , y(0.0f) + { + } + + WebFloatPoint(float x, float y) + : x(x) + , y(y) + { + } + +#if WEBKIT_IMPLEMENTATION + WebFloatPoint(const WebCore::FloatPoint& p) + : x(p.x()) + , y(p.y()) + { + } + + WebFloatPoint& operator=(const WebCore::FloatPoint& p) + { + x = p.x(); + y = p.y(); + return *this; + } + + operator WebCore::FloatPoint() const + { + return WebCore::FloatPoint(x, y); + } +#endif +}; + +inline bool operator==(const WebFloatPoint& a, const WebFloatPoint& b) +{ + return a.x == b.x && a.y == b.y; +} + +inline bool operator!=(const WebFloatPoint& a, const WebFloatPoint& b) +{ + return !(a == b); +} + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFloatRect.h b/WebKit/chromium/public/WebFloatRect.h new file mode 100644 index 0000000..a883513 --- /dev/null +++ b/WebKit/chromium/public/WebFloatRect.h @@ -0,0 +1,103 @@ +/* + * 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: + * + * * 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 WebFloatRect_h +#define WebFloatRect_h + +#include "WebCommon.h" + +#if WEBKIT_IMPLEMENTATION +#include "FloatRect.h" +#endif + +namespace WebKit { + +struct WebFloatRect { + float x; + float y; + float width; + float height; + + bool isEmpty() const { return width <= 0 || height <= 0; } + + WebFloatRect() + : x(0.0f) + , y(0.0f) + , width(0.0f) + , height(0.0f) + { + } + + WebFloatRect(float x, float y, float width, float height) + : x(x) + , y(y) + , width(width) + , height(height) + { + } + +#if WEBKIT_IMPLEMENTATION + WebFloatRect(const WebCore::FloatRect& r) + : x(r.x()) + , y(r.y()) + , width(r.width()) + , height(r.height()) + { + } + + WebFloatRect& operator=(const WebCore::FloatRect& r) + { + x = r.x(); + y = r.y(); + width = r.width(); + height = r.height(); + return *this; + } + + operator WebCore::FloatRect() const + { + return WebCore::FloatRect(x, y, width, height); + } +#endif +}; + +inline bool operator==(const WebFloatRect& a, const WebFloatRect& b) +{ + return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; +} + +inline bool operator!=(const WebFloatRect& a, const WebFloatRect& b) +{ + return !(a == b); +} + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFont.h b/WebKit/chromium/public/WebFont.h new file mode 100644 index 0000000..a20d52f --- /dev/null +++ b/WebKit/chromium/public/WebFont.h @@ -0,0 +1,100 @@ +/* + * 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: + * + * * 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 WebFont_h +#define WebFont_h + +#include "WebCanvas.h" +#include "WebColor.h" +#include "WebCommon.h" + +namespace WebKit { + +struct WebFontDescription; +struct WebFloatPoint; +struct WebFloatRect; +struct WebPoint; +struct WebRect; +struct WebTextRun; + +class WebFont { +public: + virtual ~WebFont() { } + + WEBKIT_API static WebFont* create(const WebFontDescription&); + + virtual WebFontDescription fontDescription() const = 0; + + virtual int ascent() const = 0; + virtual int descent() const = 0; + virtual int height() const = 0; + virtual int lineSpacing() const = 0; + virtual float xHeight() const = 0; + + // Draws the text run to the given canvas. The text is positioned at the + // given left-hand point at the baseline. + // + // The text will be clipped to the given clip rect. |canvasIsOpaque| is + // used to control whether subpixel antialiasing is possible. If there is a + // possibility the area drawn could be semi-transparent, subpixel + // antialiasing will be disabled. + // + // |from| and |to| allow the caller to specify a subrange of the given text + // run to draw. If |to| is -1, the entire run will be drawn. + virtual void drawText(WebCanvas*, const WebTextRun&, const WebFloatPoint& leftBaseline, WebColor, + const WebRect& clip, bool canvasIsOpaque, + int from = 0, int to = -1) const = 0; + + // Measures the width in pixels of the given text run. + virtual int calculateWidth(const WebTextRun&) const = 0; + + // Returns the character offset corresponding to the given horizontal pixel + // position as measured from from the left of the run. + virtual int offsetForPosition(const WebTextRun&, float position) const = 0; + + // Returns the rectangle representing the selection rect for the subrange + // |from| -> |to| of the given text run. You can use -1 for |to| to specify + // the entire run (this will do something similar to calling width()). + // + // The rect will be positioned as if the text was drawn at the given + // |leftBaseline| position. |height| indicates the height of the selection + // rect you want, typically this will just be the height() of this font. + // + // To get the pixel offset of some character (the opposite of + // offsetForPosition()), pass in a |leftBaseline| = (0, 0), |from| = 0, and + // |to| = the character you want. The right edge of the resulting selection + // rect will tell you the right side of the character. + virtual WebFloatRect selectionRectForText(const WebTextRun&, const WebFloatPoint& leftBaseline, + int height, int from = 0, int to = -1) const = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebFontDescription.h b/WebKit/chromium/public/WebFontDescription.h new file mode 100644 index 0000000..d4bb07e --- /dev/null +++ b/WebKit/chromium/public/WebFontDescription.h @@ -0,0 +1,106 @@ +/* + * 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: + * + * * 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 WebFontDescription_h +#define WebFontDescription_h + +#include "WebString.h" + +#if WEBKIT_IMPLEMENTATION +namespace WebCore { class FontDescription; } +#endif + +namespace WebKit { + +struct WebFontDescription { + enum GenericFamily { + GenericFamilyNone, + GenericFamilyStandard, + GenericFamilySerif, + GenericFamilySansSerif, + GenericFamilyMonospace, + GenericFamilyCursive, + GenericFamilyFantasy + }; + + enum Smoothing { + SmoothingAuto, + SmoothingNone, + SmoothingGrayscale, + SmoothingSubpixel + }; + + enum Weight { + Weight100, + Weight200, + Weight300, + Weight400, + Weight500, + Weight600, + Weight700, + Weight800, + Weight900, + WeightNormal = Weight400, + WeightBold = Weight700 + }; + + WebFontDescription() + : genericFamily(GenericFamilyNone) + , size(0) + , italic(false) + , smallCaps(false) + , weight(WeightNormal) + , smoothing(SmoothingAuto) + , letterSpacing(0) + , wordSpacing(0) + { + } + + WebString family; + GenericFamily genericFamily; + float size; + bool italic; + bool smallCaps; + Weight weight; + Smoothing smoothing; + + short letterSpacing; + short wordSpacing; + +#if WEBKIT_IMPLEMENTATION + WebFontDescription(const WebCore::FontDescription&, short fontLetterSpacing, short fontWordSpacing); + + operator WebCore::FontDescription() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h index 2ac7475..f8b057b 100644 --- a/WebKit/chromium/public/WebInputEvent.h +++ b/WebKit/chromium/public/WebInputEvent.h @@ -89,6 +89,7 @@ public: MouseMove, MouseEnter, MouseLeave, + ContextMenu, // WebMouseWheelEvent MouseWheel, @@ -135,7 +136,8 @@ public: || type == MouseUp || type == MouseMove || type == MouseEnter - || type == MouseLeave; + || type == MouseLeave + || type == ContextMenu; } // Returns true if the WebInputEvent |type| is a keyboard event. diff --git a/WebKit/chromium/public/WebNamedNodeMap.h b/WebKit/chromium/public/WebNamedNodeMap.h new file mode 100644 index 0000000..0b7e296 --- /dev/null +++ b/WebKit/chromium/public/WebNamedNodeMap.h @@ -0,0 +1,74 @@ +/* + * 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: + * + * * 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 WebNamedNodeMap_h +#define WebNamedNodeMap_h + +#include "WebCommon.h" +#include "WebPrivatePtr.h" + +namespace WebCore { class NamedNodeMap; } +#if WEBKIT_IMPLEMENTATION +namespace WTF { template <typename T> class PassRefPtr; } +#endif + +namespace WebKit { +class WebAttribute; + +// Provides readonly access to some properties of a DOM attribute map. +class WebNamedNodeMap { +public: + ~WebNamedNodeMap() { reset(); } + + WebNamedNodeMap() { } + WebNamedNodeMap(const WebNamedNodeMap& n) { assign(n); } + WebNamedNodeMap& operator=(const WebNamedNodeMap& n) + { + assign(n); + return *this; + } + + WEBKIT_API void reset(); + WEBKIT_API void assign(const WebNamedNodeMap&); + + WEBKIT_API unsigned length() const; + WEBKIT_API WebAttribute attributeItem(unsigned) const; + +#if WEBKIT_IMPLEMENTATION + WebNamedNodeMap(const WTF::PassRefPtr<WebCore::NamedNodeMap>&); +#endif + +private: + WebPrivatePtr<WebCore::NamedNodeMap> m_private; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebSettings.h b/WebKit/chromium/public/WebSettings.h index 32cefa1..90b8553 100644 --- a/WebKit/chromium/public/WebSettings.h +++ b/WebKit/chromium/public/WebSettings.h @@ -91,6 +91,7 @@ public: virtual void setShowDebugBorders(bool) = 0; virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; + virtual void setAccelerated2dCanvasEnabled(bool) = 0; virtual void setHTML5ParserEnabled(bool) = 0; virtual void setMemoryInfoEnabled(bool) = 0; diff --git a/WebKit/chromium/public/WebSpeechInputController.h b/WebKit/chromium/public/WebSpeechInputController.h new file mode 100644 index 0000000..3dba5fb --- /dev/null +++ b/WebKit/chromium/public/WebSpeechInputController.h @@ -0,0 +1,67 @@ +/* + * 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: + * + * * 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 WebSpeechInputController_h +#define WebSpeechInputController_h + +#include "WebCommon.h" + +namespace WebKit { + +// Provides an embedder API called by WebKit. +class WebSpeechInputController { +public: + // Starts speech recognition. Speech will get recorded until the endpointer detects silence, + // runs to the limit or stopRecording is called. Progress indications and the recognized + // text are returned via the listener interface. + virtual bool startRecognition() + { + WEBKIT_ASSERT_NOT_REACHED(); + return false; + } + + // Cancels an ongoing recognition and discards any audio recorded so far. No partial + // recognition results are returned to the listener. + virtual void cancelRecognition() { WEBKIT_ASSERT_NOT_REACHED(); } + + // Stops audio recording and performs recognition with the audio recorded until now + // (does not discard audio). This is an optional call and is typically invoked if the user + // wants to stop recording audio as soon as they finished speaking. Otherwise, the speech + // recording 'endpointer' should detect silence in the input and stop recording automatically. + // Call startRecognition() to record audio and recognize speech again. + virtual void stopRecording() { WEBKIT_ASSERT_NOT_REACHED(); } + +protected: + virtual ~WebSpeechInputController() { } +}; + +} // namespace WebKit + +#endif // WebSpeechInputController_h diff --git a/WebKit/chromium/public/WebSpeechInputListener.h b/WebKit/chromium/public/WebSpeechInputListener.h new file mode 100644 index 0000000..f1756af --- /dev/null +++ b/WebKit/chromium/public/WebSpeechInputListener.h @@ -0,0 +1,70 @@ +/* + * 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: + * + * * 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 WebSpeechInputListener_h +#define WebSpeechInputListener_h + +namespace WebKit { + +class WebString; + +// Provides a WebKit API called by the embedder. +// A typical sequence of calls to the listener would be +// 1 call to didCompleteRecording +// 0 or more calls to setRecognitionResult +// 1 call to didCompleteRecognition +class WebSpeechInputListener { +public: + // Informs that audio recording has completed and recognition is underway. This gets invoked + // irrespective of whether recording was stopped automatically by the 'endpointer' or if + // WebSpeechInputController::stopRecording() was called. + // Typically after this call the listener would update the UI to reflect that recognition is + // in progress. + virtual void didCompleteRecording() = 0; + + // Gives results from speech recognition, either partial or the final results. + // This method can potentially get called multiple times if there are partial results + // available as the user keeps speaking. If the speech could not be recognized properly + // or if there was any other errors in the process, this method may never be called. + virtual void setRecognitionResult(const WebString&) = 0; + + // Informs that speech recognition has completed. This gets invoked irrespective of whether + // recognition was succesful or not, whether setRecognitionResult() was invoked or not. The + // handler typically frees up any temporary resources allocated and waits for the next speech + // recognition request. + virtual void didCompleteRecognition() = 0; + +protected: + ~WebSpeechInputListener() { } +}; + +} // namespace WebKit + +#endif // WebSpeechInputListener_h diff --git a/WebKit/chromium/public/WebTextRun.h b/WebKit/chromium/public/WebTextRun.h new file mode 100644 index 0000000..cb1373a --- /dev/null +++ b/WebKit/chromium/public/WebTextRun.h @@ -0,0 +1,68 @@ +/* + * 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: + * + * * 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 WebTextRun_h +#define WebTextRun_h + +#include "WebString.h" + +#ifdef WEBKIT_IMPLEMENTATION +namespace WebCore { class TextRun; } +#endif + +namespace WebKit { + +struct WebTextRun { + WebTextRun(const WebString& t, bool isRTL, bool hasDirectionalOverride) + : text(t) + , rtl(isRTL) + , directionalOverride(hasDirectionalOverride) + { + } + WebTextRun() + : rtl(false) + , directionalOverride(false) + { + } + + WebString text; + bool rtl; + bool directionalOverride; + +#ifdef WEBKIT_IMPLEMENTATION + // The resulting WebCore::TextRun will refer to the text in this + // struct, so "this" must outlive the WebCore text run. + operator WebCore::TextRun() const; +#endif +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index 26d7269..1b94da2 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -253,6 +253,7 @@ public: const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<int>& uniqueIDs, int separatorIndex) = 0; // Notifies the WebView that AutoFill suggestions are available for a node. @@ -262,6 +263,7 @@ public: const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex) = 0; diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 11fb233..4628c2f 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -55,6 +55,8 @@ class WebKeyboardEvent; class WebNode; class WebNotificationPresenter; class WebRange; +class WebSpeechInputController; +class WebSpeechInputListener; class WebStorageNamespace; class WebURL; class WebView; @@ -331,7 +333,13 @@ public: // Geolocation --------------------------------------------------------- // Access the embedder API for geolocation services. - virtual WebKit::WebGeolocationService* geolocationService() { return 0; } + virtual WebGeolocationService* geolocationService() { return 0; } + + // Speech -------------------------------------------------------------- + + // Access the embedder API for speech input services. + virtual WebSpeechInputController* speechInputController( + WebSpeechInputListener*) { return 0; } protected: ~WebViewClient() { } diff --git a/WebKit/chromium/src/ApplicationCacheHost.cpp b/WebKit/chromium/src/ApplicationCacheHost.cpp index b90126f..dfd4754 100644 --- a/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -37,11 +37,15 @@ #include "DocumentLoader.h" #include "DOMApplicationCache.h" #include "Frame.h" +#include "InspectorApplicationCacheAgent.h" +#include "InspectorController.h" +#include "Page.h" #include "ProgressEvent.h" #include "Settings.h" #include "WebURL.h" #include "WebURLError.h" #include "WebURLResponse.h" +#include "WebVector.h" #include "WrappedResourceRequest.h" #include "WrappedResourceResponse.h" @@ -206,6 +210,32 @@ void ApplicationCacheHost::notifyDOMApplicationCache(EventID id, int total, int dispatchDOMEvent(id, total, done); } +#if ENABLE(INSPECTOR) +ApplicationCacheHost::CacheInfo ApplicationCacheHost::applicationCacheInfo() +{ + if (!m_internal) + return CacheInfo(KURL(), 0, 0, 0); + + WebKit::WebApplicationCacheHost::CacheInfo webInfo; + m_internal->m_outerHost->getAssociatedCacheInfo(&webInfo); + return CacheInfo(webInfo.manifestURL, webInfo.creationTime, webInfo.updateTime, webInfo.totalSize); +} + +void ApplicationCacheHost::fillResourceList(ResourceInfoList* resources) +{ + if (!m_internal) + return; + + WebKit::WebVector<WebKit::WebApplicationCacheHost::ResourceInfo> webResources; + m_internal->m_outerHost->getResourceList(&webResources); + for (size_t i = 0; i < webResources.size(); ++i) { + resources->append(ResourceInfo( + webResources[i].url, webResources[i].isMaster, webResources[i].isManifest, webResources[i].isFallback, + webResources[i].isForeign, webResources[i].isExplicit, webResources[i].size)); + } +} +#endif + void ApplicationCacheHost::stopDeferringEvents() { RefPtr<DocumentLoader> protect(documentLoader()); diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp index 1f946f3..093ac11 100644 --- a/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -36,6 +36,8 @@ #include "AccessibilityObject.h" #include "ApplicationCacheHost.h" #include "EditorInsertAction.h" +#include "FontDescription.h" +#include "FontSmoothingMode.h" #include "HTMLInputElement.h" #include "IDBKey.h" #include "MediaPlayer.h" @@ -52,6 +54,7 @@ #include "WebClipboard.h" #include "WebCursorInfo.h" #include "WebEditingAction.h" +#include "WebFontDescription.h" #include "WebIDBKey.h" #include "WebInputElement.h" #include "WebMediaPlayer.h" @@ -235,6 +238,31 @@ COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionTyped, EditorInsertActionTyped); COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionPasted, EditorInsertActionPasted); COMPILE_ASSERT_MATCHING_ENUM(WebEditingActionDropped, EditorInsertActionDropped); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyNone, FontDescription::NoFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyStandard, FontDescription::StandardFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilySerif, FontDescription::SerifFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilySansSerif, FontDescription::SansSerifFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyMonospace, FontDescription::MonospaceFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyCursive, FontDescription::CursiveFamily); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::GenericFamilyFantasy, FontDescription::FantasyFamily); + +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingAuto, AutoSmoothing); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingNone, NoSmoothing); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingGrayscale, Antialiased); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::SmoothingSubpixel, SubpixelAntialiased); + +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight100, FontWeight100); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight200, FontWeight200); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight300, FontWeight300); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight400, FontWeight400); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight500, FontWeight500); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight600, FontWeight600); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight700, FontWeight700); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight800, FontWeight800); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::Weight900, FontWeight900); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightNormal, FontWeightNormal); +COMPILE_ASSERT_MATCHING_ENUM(WebFontDescription::WeightBold, FontWeightBold); + COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Text, HTMLInputElement::TEXT); COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::Password, HTMLInputElement::PASSWORD); COMPILE_ASSERT_MATCHING_ENUM(WebInputElement::IsIndex, HTMLInputElement::ISINDEX); @@ -326,3 +354,5 @@ COMPILE_ASSERT_MATCHING_ENUM(WebView::UserContentInjectInTopFrameOnly, InjectInT COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NullType, IDBKey::NullType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); + + diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp index 6b74f60..b14840c 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp @@ -84,6 +84,16 @@ WebString AutoFillPopupMenuClient::getLabel(unsigned listIndex) const return m_labels[index]; } +WebString AutoFillPopupMenuClient::getIcon(unsigned listIndex) const +{ + int index = convertListIndexToInternalIndex(listIndex); + if (index == -1) + return WebString(); + + ASSERT(index >= 0 && static_cast<size_t>(index) < m_icons.size()); + return m_icons[index]; +} + void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) { if (!canRemoveSuggestionAtIndex(listIndex)) @@ -95,6 +105,8 @@ void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) m_names.remove(index); m_labels.remove(index); + m_icons.remove(index); + m_uniqueIDs.remove(index); // Shift the separator index if necessary. if (m_separatorIndex != -1) @@ -177,6 +189,11 @@ String AutoFillPopupMenuClient::itemLabel(unsigned listIndex) const return getLabel(listIndex); } +String AutoFillPopupMenuClient::itemIcon(unsigned listIndex) const +{ + return getIcon(listIndex); +} + PopupMenuStyle AutoFillPopupMenuClient::itemStyle(unsigned listIndex) const { return *m_style; @@ -249,10 +266,12 @@ void AutoFillPopupMenuClient::initialize( HTMLInputElement* textField, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex) { ASSERT(names.size() == labels.size()); + ASSERT(names.size() == icons.size()); ASSERT(names.size() == uniqueIDs.size()); ASSERT(separatorIndex < static_cast<int>(names.size())); @@ -261,7 +280,7 @@ void AutoFillPopupMenuClient::initialize( // The suggestions must be set before initializing the // AutoFillPopupMenuClient. - setSuggestions(names, labels, uniqueIDs, separatorIndex); + setSuggestions(names, labels, icons, uniqueIDs, separatorIndex); FontDescription fontDescription; RenderTheme::defaultTheme()->systemFont(CSSValueWebkitControl, @@ -280,19 +299,23 @@ void AutoFillPopupMenuClient::initialize( void AutoFillPopupMenuClient::setSuggestions(const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex) { ASSERT(names.size() == labels.size()); + ASSERT(names.size() == icons.size()); ASSERT(names.size() == uniqueIDs.size()); ASSERT(separatorIndex < static_cast<int>(names.size())); m_names.clear(); m_labels.clear(); + m_icons.clear(); m_uniqueIDs.clear(); for (size_t i = 0; i < names.size(); ++i) { m_names.append(names[i]); m_labels.append(labels[i]); + m_icons.append(icons[i]); m_uniqueIDs.append(uniqueIDs[i]); } diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.h b/WebKit/chromium/src/AutoFillPopupMenuClient.h index 289c8d0..223cf16 100644 --- a/WebKit/chromium/src/AutoFillPopupMenuClient.h +++ b/WebKit/chromium/src/AutoFillPopupMenuClient.h @@ -60,6 +60,9 @@ public: // Returns the label at |listIndex|. virtual WebString getLabel(unsigned listIndex) const; + // Returns the icon at |listIndex|. + virtual WebString getIcon(unsigned listIndex) const; + // Removes the suggestion at |listIndex| from the list of suggestions. virtual void removeSuggestionAtIndex(unsigned listIndex); @@ -72,6 +75,7 @@ public: virtual void selectionCleared(); virtual WebCore::String itemText(unsigned listIndex) const; virtual WebCore::String itemLabel(unsigned listIndex) const; + virtual WebCore::String itemIcon(unsigned listIndex) const; virtual WebCore::String itemToolTip(unsigned lastIndex) const { return WebCore::String(); } virtual WebCore::String itemAccessibilityText(unsigned lastIndex) const { return WebCore::String(); } virtual bool itemIsEnabled(unsigned listIndex) const { return true; } @@ -100,11 +104,13 @@ public: void initialize(WebCore::HTMLInputElement*, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex); void setSuggestions(const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex); @@ -124,9 +130,10 @@ private: int getSelectedIndex() const { return m_selectedIndex; } void setSelectedIndex(int index) { m_selectedIndex = index; } - // The names and labels that make up the text of the menu items. + // The names, labels and icons that make up the contents of the menu items. Vector<WebCore::String> m_names; Vector<WebCore::String> m_labels; + Vector<WebCore::String> m_icons; Vector<int> m_uniqueIDs; // The index of the separator. -1 if there is no separator. diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp index 333020f..78e0693 100644 --- a/WebKit/chromium/src/ChromiumBridge.cpp +++ b/WebKit/chromium/src/ChromiumBridge.cpp @@ -469,9 +469,8 @@ GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(Geoloca return createGeolocationServiceBridgeImpl(geolocationServiceChromium); } -// HTML5 DB ------------------------------------------------------------------- +// Databases ------------------------------------------------------------------ -#if ENABLE(DATABASE) PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags) { return webKitClient()->databaseOpenFile(WebString(vfsFileName), desiredFlags); @@ -491,7 +490,6 @@ long long ChromiumBridge::databaseGetFileSize(const String& vfsFileName) { return webKitClient()->databaseGetFileSize(WebString(vfsFileName)); } -#endif // Indexed Database ----------------------------------------------------------- diff --git a/WebKit/chromium/src/ContextMenuClientImpl.cpp b/WebKit/chromium/src/ContextMenuClientImpl.cpp index d0d09bf..1dc2ee7 100644 --- a/WebKit/chromium/src/ContextMenuClientImpl.cpp +++ b/WebKit/chromium/src/ContextMenuClientImpl.cpp @@ -277,7 +277,7 @@ void ContextMenuClientImpl::populateCustomMenuItems(WebCore::ContextMenu* defaul Vector<WebMenuItemInfo> customItems; for (size_t i = 0; i < defaultMenu->itemCount(); ++i) { ContextMenuItem* inputItem = defaultMenu->itemAtIndex(i, defaultMenu->platformDescription()); - if (inputItem->action() < ContextMenuItemBaseCustomTag || inputItem->action() >= ContextMenuItemBaseApplicationTag) + if (inputItem->action() < ContextMenuItemBaseCustomTag || inputItem->action() > ContextMenuItemLastCustomTag) continue; WebMenuItemInfo outputItem; diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp index e1b7cbe..f43c9bd 100644 --- a/WebKit/chromium/src/DatabaseObserver.cpp +++ b/WebKit/chromium/src/DatabaseObserver.cpp @@ -31,6 +31,8 @@ #include "config.h" #include "DatabaseObserver.h" +#if ENABLE(DATABASE) + #include "AbstractDatabase.h" #include "Document.h" #include "ScriptExecutionContext.h" @@ -84,3 +86,5 @@ void DatabaseObserver::databaseClosed(AbstractDatabase* database) } } // namespace WebCore + +#endif // ENABLE(DATABASE) diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp index 73cedfa..870bdee 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp @@ -124,4 +124,15 @@ void InspectorFrontendClientImpl::inspectedURLChanged(const String& url) m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url); } +void InspectorFrontendClientImpl::sendMessageToBackend(const String& message) +{ + WebDevToolsMessageData messageData; + messageData.className = "ToolsAgent"; + messageData.methodName = "dispatchOnInspectorController"; + WebVector<WebString> args(static_cast<size_t>(1)); + args[0] = message; + messageData.arguments.swap(args); + m_client->sendMessageToAgent(messageData); +} + } // namespace WebKit diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.h b/WebKit/chromium/src/InspectorFrontendClientImpl.h index f869ac3..f7174ce 100644 --- a/WebKit/chromium/src/InspectorFrontendClientImpl.h +++ b/WebKit/chromium/src/InspectorFrontendClientImpl.h @@ -68,6 +68,7 @@ public: virtual void inspectedURLChanged(const WebCore::String&); + virtual void sendMessageToBackend(const WebCore::String&); private: WebCore::Page* m_frontendPage; WebDevToolsFrontendClient* m_client; diff --git a/WebKit/chromium/src/SpeechInputClientImpl.cpp b/WebKit/chromium/src/SpeechInputClientImpl.cpp new file mode 100644 index 0000000..8bccacf --- /dev/null +++ b/WebKit/chromium/src/SpeechInputClientImpl.cpp @@ -0,0 +1,94 @@ +/* + * 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: + * + * * 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 "SpeechInputClientImpl.h" + +#include "PlatformString.h" +#include "WebSpeechInputController.h" +#include "WebString.h" +#include "WebViewClient.h" +#include "page/SpeechInputListener.h" + +#if ENABLE(INPUT_SPEECH) + +namespace WebKit { + +SpeechInputClientImpl::SpeechInputClientImpl(WebViewClient* web_view_client) + : m_controller(web_view_client->speechInputController(this)) + , m_listener(0) +{ + ASSERT(m_controller); +} + +SpeechInputClientImpl::~SpeechInputClientImpl() +{ +} + +bool SpeechInputClientImpl::startRecognition(WebCore::SpeechInputListener* listener) +{ + m_listener = listener; + return m_controller->startRecognition(); +} + +void SpeechInputClientImpl::stopRecording() +{ + ASSERT(m_listener); + m_controller->stopRecording(); +} + +void SpeechInputClientImpl::cancelRecognition() +{ + ASSERT(m_listener); + m_controller->cancelRecognition(); +} + +void SpeechInputClientImpl::didCompleteRecording() +{ + ASSERT(m_listener); + m_listener->didCompleteRecording(); +} + +void SpeechInputClientImpl::didCompleteRecognition() +{ + ASSERT(m_listener); + m_listener->didCompleteRecognition(); + m_listener = 0; +} + +void SpeechInputClientImpl::setRecognitionResult(const WebString& result) +{ + ASSERT(m_listener); + m_listener->setRecognitionResult(result); +} + +} // namespace WebKit + +#endif // ENABLE(INPUT_SPEECH) diff --git a/WebKit/chromium/src/SpeechInputClientImpl.h b/WebKit/chromium/src/SpeechInputClientImpl.h new file mode 100644 index 0000000..5762da8 --- /dev/null +++ b/WebKit/chromium/src/SpeechInputClientImpl.h @@ -0,0 +1,74 @@ +/* + * 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: + * + * 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 SpeechInputClientImpl_h +#define SpeechInputClientImpl_h + +#if ENABLE(INPUT_SPEECH) + +#include "WebSpeechInputListener.h" +#include "page/SpeechInputClient.h" + +namespace WebCore { +class SpeechInputListener; +} + +namespace WebKit { + +class WebSpeechInputController; +class WebViewClient; + +class SpeechInputClientImpl + : public WebCore::SpeechInputClient, + public WebSpeechInputListener { +public: + SpeechInputClientImpl(WebViewClient*); + virtual ~SpeechInputClientImpl(); + + // SpeechInputClient methods. + bool startRecognition(WebCore::SpeechInputListener*); + void stopRecording(); + void cancelRecognition(); + + // WebSpeechInputListener methods. + void didCompleteRecording(); + void setRecognitionResult(const WebString&); + void didCompleteRecognition(); + +private: + WebSpeechInputController* m_controller; // To call into the embedder. + WebCore::SpeechInputListener* m_listener; // Valid when recognition is in progress. +}; + +} // namespace WebKit + +#endif // ENABLE(INPUT_SPEECH) + +#endif // SpeechInputClientImpl_h diff --git a/WebKit/chromium/src/ToolsAgent.h b/WebKit/chromium/src/ToolsAgent.h index c748c8a..937fcf0 100644 --- a/WebKit/chromium/src/ToolsAgent.h +++ b/WebKit/chromium/src/ToolsAgent.h @@ -39,13 +39,7 @@ namespace WebKit { // API for auxiliary UI functions such as dom elements highlighting. #define TOOLS_AGENT_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \ /* Dispatches given function on the InspectorController object */ \ - METHOD3(dispatchOnInspectorController, int /* call_id */, \ - String /* function_name */, String /* json_args */) \ - \ - /* Dispatches given function on the InjectedScript object */ \ - METHOD5(dispatchOnInjectedScript, int /* call_id */, \ - int /* injected_script_id */, String /* function_name */, \ - String /* json_args */, bool /* async */) + METHOD1(dispatchOnInspectorController, String /* message */) \ DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT) diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp index e59a1a2..4263e8b 100644 --- a/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -32,9 +32,15 @@ #include "WebAccessibilityObject.h" #include "AccessibilityObject.h" +#include "CSSPrimitiveValueMappings.h" +#include "Document.h" #include "EventHandler.h" #include "FrameView.h" +#include "Node.h" #include "PlatformKeyboardEvent.h" +#include "RenderStyle.h" +#include "WebDocument.h" +#include "WebNode.h" #include "WebPoint.h" #include "WebRect.h" #include "WebString.h" @@ -401,6 +407,65 @@ WebString WebAccessibilityObject::title() const return m_private->title(); } + +WebNode WebAccessibilityObject::node() const +{ + if (!m_private) + return WebNode(); + + m_private->updateBackingStore(); + + Node* node = m_private->node(); + if (!node) + return WebNode(); + + return WebNode(node); +} + +WebDocument WebAccessibilityObject::document() const +{ + if (!m_private) + return WebDocument(); + + m_private->updateBackingStore(); + + Document* document = m_private->document(); + if (!document) + return WebDocument(); + + return WebDocument(document); +} + +bool WebAccessibilityObject::hasComputedStyle() const +{ + Document* document = m_private->document(); + if (document) + document->updateStyleIfNeeded(); + + Node* node = m_private->node(); + if (!node) + return false; + + return node->computedStyle(); +} + +WebString WebAccessibilityObject::computedStyleDisplay() const +{ + Document* document = m_private->document(); + if (document) + document->updateStyleIfNeeded(); + + Node* node = m_private->node(); + if (!node) + return WebString(); + + RenderStyle* renderStyle = node->computedStyle(); + if (!renderStyle) + return WebString(); + + return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStringValue()); +} + WebAccessibilityObject::WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>& object) : m_private(static_cast<WebAccessibilityObjectPrivate*>(object.releaseRef())) { diff --git a/WebKit/chromium/src/WebAttribute.cpp b/WebKit/chromium/src/WebAttribute.cpp new file mode 100644 index 0000000..0bc3b91 --- /dev/null +++ b/WebKit/chromium/src/WebAttribute.cpp @@ -0,0 +1,68 @@ +/* + * 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: + * + * * 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 "WebAttribute.h" + +#include "Attribute.h" +#include <wtf/PassRefPtr.h> + +#include "WebString.h" + +using namespace WebCore; + +namespace WebKit { + +void WebAttribute::reset() +{ + m_private.reset(); +} + +void WebAttribute::assign(const WebAttribute& other) +{ + m_private = other.m_private; +} + +WebAttribute::WebAttribute(const PassRefPtr<Attribute>& other) + : m_private(other) +{ +} + +WebString WebAttribute::localName() const +{ + return WebString(m_private->localName()); +} + +WebString WebAttribute::value() const +{ + return WebString(m_private->value()); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebDOMStringList.cpp b/WebKit/chromium/src/WebDOMStringList.cpp index cd145bf..4be7fab 100644 --- a/WebKit/chromium/src/WebDOMStringList.cpp +++ b/WebKit/chromium/src/WebDOMStringList.cpp @@ -38,6 +38,11 @@ using namespace WebCore; namespace WebKit { +WebDOMStringList::WebDOMStringList() +{ + m_private = WebCore::DOMStringList::create(); +} + void WebDOMStringList::reset() { m_private.reset(); diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp index 89522f1..561d7c4 100644 --- a/WebKit/chromium/src/WebDatabase.cpp +++ b/WebKit/chromium/src/WebDatabase.cpp @@ -40,6 +40,18 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> +#if !ENABLE(DATABASE) +namespace WebCore { +class AbstractDatabase { +public: + String stringIdentifier() const { return String(); } + String displayName() const { return String(); } + unsigned long long estimatedSize() const { return 0; } + SecurityOrigin* securityOrigin() const { return 0; } +}; +} +#endif // !ENABLE(DATABASE) + using namespace WebCore; namespace WebKit { @@ -84,17 +96,21 @@ void WebDatabase::updateDatabaseSize( const WebString& originIdentifier, const WebString& databaseName, unsigned long long databaseSize, unsigned long long spaceAvailable) { +#if ENABLE(DATABASE) WebCore::QuotaTracker::instance().updateDatabaseSizeAndSpaceAvailableToOrigin( originIdentifier, databaseName, databaseSize, spaceAvailable); +#endif // ENABLE(DATABASE) } void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName) { +#if ENABLE(DATABASE) HashSet<RefPtr<AbstractDatabase> > databaseHandles; RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(originIdentifier); DatabaseTracker::tracker().getOpenDatabases(origin.get(), databaseName, &databaseHandles); for (HashSet<RefPtr<AbstractDatabase> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it) it->get()->closeImmediately(); +#endif // ENABLE(DATABASE) } WebDatabase::WebDatabase(const AbstractDatabase* database) diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 0d8cbad..1a65bfe 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -38,6 +38,7 @@ #include "EventListener.h" #include "InjectedScriptHost.h" #include "InspectorBackend.h" +#include "InspectorBackendDispatcher.h" #include "InspectorController.h" #include "InspectorFrontend.h" #include "InspectorResource.h" @@ -54,7 +55,6 @@ #include "ScriptState.h" #include "ScriptValue.h" #include "V8Binding.h" -#include "V8InspectorBackend.h" #include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" @@ -92,7 +92,6 @@ using WebCore::ScriptState; using WebCore::ScriptValue; using WebCore::String; using WebCore::V8DOMWrapper; -using WebCore::V8InspectorBackend; using WebCore::V8Proxy; namespace WebKit { @@ -308,23 +307,9 @@ void WebDevToolsAgentImpl::forceRepaint() m_client->forceRepaint(); } -void WebDevToolsAgentImpl::dispatchOnInspectorController(int callId, const String& functionName, const String& jsonArgs) +void WebDevToolsAgentImpl::dispatchOnInspectorController(const String& message) { - String result; - String exception; - result = m_debuggerAgentImpl->executeUtilityFunction(m_utilityContext, callId, - "InspectorControllerDispatcher", functionName, jsonArgs, false /* is sync */, &exception); - m_toolsAgentDelegateStub->didDispatchOn(callId, result, exception); -} - -void WebDevToolsAgentImpl::dispatchOnInjectedScript(int callId, int injectedScriptId, const String& functionName, const String& jsonArgs, bool async) -{ - inspectorController()->inspectorBackend()->dispatchOnInjectedScript( - callId, - injectedScriptId, - functionName, - jsonArgs, - async); + inspectorController()->inspectorBackendDispatcher()->dispatch(message); } void WebDevToolsAgentImpl::dispatchMessageFromFrontend(const WebDevToolsMessageData& data) @@ -386,38 +371,6 @@ void WebDevToolsAgentImpl::initDevToolsAgentHost() "dispatch", WebDevToolsAgentImpl::jsDispatchOnClient); devtoolsAgentHost.build(); - - v8::HandleScope scope; - v8::Context::Scope utilityScope(m_utilityContext); - // Call custom code to create inspector backend wrapper in the utility context - // instead of calling V8DOMWrapper::convertToV8Object that would create the - // wrapper in the Page main frame context. - v8::Handle<v8::Object> backendWrapper = createInspectorBackendV8Wrapper(); - if (backendWrapper.IsEmpty()) - return; - m_utilityContext->Global()->Set(v8::String::New("InspectorBackend"), backendWrapper); -} - -v8::Local<v8::Object> WebDevToolsAgentImpl::createInspectorBackendV8Wrapper() -{ - v8::Handle<v8::Function> function = V8InspectorBackend::GetTemplate()->GetFunction(); - if (function.IsEmpty()) { - // Return if allocation failed. - return v8::Local<v8::Object>(); - } - v8::Local<v8::Object> instance = SafeAllocation::newInstance(function); - if (instance.IsEmpty()) { - // Avoid setting the wrapper if allocation failed. - return v8::Local<v8::Object>(); - } - InspectorBackend* backend = m_webViewImpl->page()->inspectorController()->inspectorBackend(); - V8DOMWrapper::setDOMWrapper(instance, &V8InspectorBackend::info, backend); - // Create a weak reference to the v8 wrapper of InspectorBackend to deref - // InspectorBackend when the wrapper is garbage collected. - backend->ref(); - v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(instance); - weakHandle.MakeWeak(backend, &InspectorBackendWeakReferenceCallback); - return instance; } void WebDevToolsAgentImpl::createInspectorFrontendProxy() diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index 12f51f9..c8e22b0 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -72,8 +72,7 @@ public: virtual ~WebDevToolsAgentImpl(); // ToolsAgent implementation. - virtual void dispatchOnInspectorController(int callId, const WebCore::String& functionName, const WebCore::String& jsonArgs); - virtual void dispatchOnInjectedScript(int callId, int injectedScriptId, const WebCore::String& functionName, const WebCore::String& jsonArgs, bool async); + virtual void dispatchOnInspectorController(const WebCore::String& message); // WebDevToolsAgentPrivate implementation. virtual void didClearWindowObject(WebFrameImpl* frame); @@ -128,12 +127,6 @@ private: WebCore::InspectorController* inspectorController(); - // Creates InspectorBackend v8 wrapper in the utility context so that it's - // methods prototype is Function.protoype object from the utility context. - // Otherwise some useful methods defined on Function.prototype(such as bind) - // are missing for InspectorController native methods. - v8::Local<v8::Object> createInspectorBackendV8Wrapper(); - int m_hostId; WebDevToolsAgentClient* m_client; WebViewImpl* m_webViewImpl; diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp index 3e83f18..592a532 100644 --- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp @@ -150,10 +150,6 @@ void WebDevToolsFrontendImpl::frontendLoaded() { m_loaded = true; - // Grant the devtools page the ability to have source view iframes. - SecurityOrigin* origin = m_webViewImpl->page()->mainFrame()->domWindow()->securityOrigin(); - origin->grantUniversalAccess(); - for (Vector<Vector<String> >::iterator it = m_pendingIncomingMessages.begin(); it != m_pendingIncomingMessages.end(); ++it) { diff --git a/WebKit/chromium/src/WebDocument.cpp b/WebKit/chromium/src/WebDocument.cpp index 017716d..a983bf7 100644 --- a/WebKit/chromium/src/WebDocument.cpp +++ b/WebKit/chromium/src/WebDocument.cpp @@ -32,6 +32,7 @@ #include "WebDocument.h" #include "Document.h" +#include "DocumentType.h" #include "Element.h" #include "HTMLAllCollection.h" #include "HTMLBodyElement.h" @@ -40,6 +41,7 @@ #include "HTMLHeadElement.h" #include "NodeList.h" +#include "WebDocumentType.h" #include "WebElement.h" #include "WebFrameImpl.h" #include "WebNodeCollection.h" @@ -122,6 +124,11 @@ WebNode WebDocument::focusedNode() const return WebNode(constUnwrap<Document>()->focusedNode()); } +WebDocumentType WebDocument::doctype() const +{ + return WebDocumentType(constUnwrap<Document>()->doctype()); +} + WebDocument::WebDocument(const PassRefPtr<Document>& elem) : WebNode(elem) { diff --git a/WebKit/chromium/src/WebDocumentType.cpp b/WebKit/chromium/src/WebDocumentType.cpp new file mode 100644 index 0000000..bbf28e7 --- /dev/null +++ b/WebKit/chromium/src/WebDocumentType.cpp @@ -0,0 +1,64 @@ +/* + * 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: + * + * * 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 "WebDocumentType.h" + +#include "DocumentType.h" +#include "WebString.h" + +#include <wtf/PassRefPtr.h> + +using namespace WebCore; + +namespace WebKit { + +WebString WebDocumentType::name() const +{ + return WebString(constUnwrap<DocumentType>()->name()); +} + +WebDocumentType::WebDocumentType(const PassRefPtr<DocumentType>& elem) + : WebNode(elem) +{ +} + +WebDocumentType& WebDocumentType::operator=(const PassRefPtr<DocumentType>& elem) +{ + m_private = elem; + return *this; +} + +WebDocumentType::operator PassRefPtr<DocumentType>() const +{ + return static_cast<DocumentType*>(m_private.get()); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebElement.cpp b/WebKit/chromium/src/WebElement.cpp index 25a396e..f45cba9 100644 --- a/WebKit/chromium/src/WebElement.cpp +++ b/WebKit/chromium/src/WebElement.cpp @@ -36,6 +36,8 @@ #include "RenderObject.h" #include <wtf/PassRefPtr.h> +#include "WebNamedNodeMap.h" + using namespace WebCore; namespace WebKit { @@ -73,6 +75,11 @@ bool WebElement::setAttribute(const WebString& attrName, const WebString& attrVa return !exceptionCode; } +WebNamedNodeMap WebElement::attributes() const +{ + return WebNamedNodeMap(m_private->attributes()); +} + WebString WebElement::innerText() const { return constUnwrap<Element>()->innerText(); diff --git a/WebKit/chromium/src/WebFontDescription.cpp b/WebKit/chromium/src/WebFontDescription.cpp new file mode 100644 index 0000000..18f6830 --- /dev/null +++ b/WebKit/chromium/src/WebFontDescription.cpp @@ -0,0 +1,71 @@ +/* + * 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: + * + * * 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 "WebFontDescription.h" + +#include "FontDescription.h" + +using namespace WebCore; + +namespace WebKit { + +WebFontDescription::WebFontDescription(const FontDescription& desc, + short fontLetterSpacing, short fontWordSpacing) +{ + family = desc.family().family(); + genericFamily = static_cast<GenericFamily>(desc.genericFamily()); + size = desc.specifiedSize(); + italic = desc.italic(); + smallCaps = desc.smallCaps(); + weight = static_cast<Weight>(desc.weight()); + smoothing = static_cast<Smoothing>(desc.fontSmoothing()); + letterSpacing = fontLetterSpacing; + wordSpacing = fontWordSpacing; +} + +WebFontDescription::operator WebCore::FontDescription() const +{ + FontFamily fontFamily; + fontFamily.setFamily(family); + + FontDescription desc; + desc.setFamily(fontFamily); + desc.setGenericFamily(static_cast<FontDescription::GenericFamilyType>(genericFamily)); + desc.setSpecifiedSize(size); + desc.setComputedSize(size); + desc.setItalic(italic); + desc.setSmallCaps(smallCaps); + desc.setWeight(static_cast<FontWeight>(weight)); + desc.setFontSmoothing(static_cast<FontSmoothingMode>(smoothing)); + return desc; +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebFontImpl.cpp b/WebKit/chromium/src/WebFontImpl.cpp new file mode 100644 index 0000000..6fa5494 --- /dev/null +++ b/WebKit/chromium/src/WebFontImpl.cpp @@ -0,0 +1,126 @@ +/* + * 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: + * + * * 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 "WebFontImpl.h" + +#include "Font.h" +#include "FontDescription.h" +#include "GraphicsContext.h" +#include "PlatformContextSkia.h" +#include "WebFloatPoint.h" +#include "WebFloatRect.h" +#include "WebFontDescription.h" +#include "WebRect.h" +#include "WebTextRun.h" + +using namespace WebCore; + +namespace WebKit { + +WebFont* WebFont::create(const WebFontDescription& desc) +{ + return new WebFontImpl(desc, desc.letterSpacing, desc.wordSpacing); +} + +WebFontImpl::WebFontImpl(const FontDescription& desc, short letterSpacing, short wordSpacing) + : m_font(desc, letterSpacing, wordSpacing) +{ + m_font.update(0); +} + +WebFontDescription WebFontImpl::fontDescription() const +{ + return WebFontDescription(m_font.fontDescription(), m_font.letterSpacing(), m_font.wordSpacing()); +} + +int WebFontImpl::ascent() const +{ + return m_font.ascent(); +} + +int WebFontImpl::descent() const +{ + return m_font.descent(); +} + +int WebFontImpl::height() const +{ + return m_font.height(); +} + +int WebFontImpl::lineSpacing() const +{ + return m_font.lineSpacing(); +} + +float WebFontImpl::xHeight() const +{ + return m_font.xHeight(); +} + +void WebFontImpl::drawText(WebCanvas* canvas, const WebTextRun& run, const WebFloatPoint& leftBaseline, + WebColor color, const WebRect& clip, bool canvasIsOpaque, + int from, int to) const +{ + // FIXME hook canvasIsOpaque up to the platform-specific indicators for + // whether subpixel AA can be used for this draw. On Windows, this is + // PlatformContextSkia::setDrawingToImageBuffer. +#if WEBKIT_USING_CG + GraphicsContext gc(canvas); +#elif WEBKIT_USING_SKIA + PlatformContextSkia context(canvas); + // PlatformGraphicsContext is actually a pointer to PlatformContextSkia. + GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); +#else + notImplemented(); +#endif + + gc.setFillColor(color, DeviceColorSpace); + gc.clip(WebCore::FloatRect(clip)); + m_font.drawText(&gc, run, leftBaseline, from, to); +} + +int WebFontImpl::calculateWidth(const WebTextRun& run) const +{ + return m_font.width(run, 0); +} + +int WebFontImpl::offsetForPosition(const WebTextRun& run, float position) const +{ + return m_font.offsetForPosition(run, position, true); +} + +WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebFloatPoint& leftBaseline, int height, int from, int to) const +{ + return m_font.selectionRectForText(run, leftBaseline, height, from, to); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebFontImpl.h b/WebKit/chromium/src/WebFontImpl.h new file mode 100644 index 0000000..3ac9031 --- /dev/null +++ b/WebKit/chromium/src/WebFontImpl.h @@ -0,0 +1,66 @@ +/* + * 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: + * + * * 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 WebFontImpl_h +#define WebFontImpl_h + +#include "Font.h" +#include "WebFont.h" + +namespace WebCore { class FontDescription; } + +namespace WebKit { + +class WebFontImpl : public WebFont { +public: + WebFontImpl(const WebCore::FontDescription&, short letterSpacing, short wordSpacing); + + virtual WebFontDescription fontDescription() const; + + virtual int ascent() const; + virtual int descent() const; + virtual int height() const; + virtual int lineSpacing() const; + virtual float xHeight() const; + + virtual void drawText(WebCanvas*, const WebTextRun&, const WebFloatPoint& leftBaseline, WebColor, + const WebRect& clip, bool canvasIsOpaque, int from = 0, int to = -1) const; + virtual int calculateWidth(const WebTextRun&) const; + virtual int offsetForPosition(const WebTextRun&, float position) const; + virtual WebFloatRect selectionRectForText(const WebTextRun&, const WebFloatPoint& leftBaseline, + int height, int from = 0, int to = -1) const; + +private: + WebCore::Font m_font; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/WebInputEventConversion.cpp b/WebKit/chromium/src/WebInputEventConversion.cpp index f68e3ab..1c6d59c 100644 --- a/WebKit/chromium/src/WebInputEventConversion.cpp +++ b/WebKit/chromium/src/WebInputEventConversion.cpp @@ -241,7 +241,7 @@ static int getWebInputModifiers(const UIEventWithKeyState& event) return modifiers; } -WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEvent& event) +WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const MouseEvent& event) { if (event.type() == eventNames().mousemoveEvent) type = WebInputEvent::MouseMove; @@ -253,6 +253,8 @@ WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEv type = WebInputEvent::MouseDown; else if (event.type() == eventNames().mouseupEvent) type = WebInputEvent::MouseUp; + else if (event.type() == eventNames().contextmenuEvent) + type = WebInputEvent::ContextMenu; else return; // Skip all other mouse events. timeStampSeconds = event.timeStamp() * 1.0e-3; @@ -281,30 +283,34 @@ WebMouseEventBuilder::WebMouseEventBuilder(const ScrollView* view, const MouseEv break; } } - IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY())); + ScrollView* view = widget->parent(); + IntPoint p = view->contentsToWindow( + IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y())); globalX = event.screenX(); globalY = event.screenY(); windowX = p.x(); windowY = p.y(); - x = event.offsetX(); - y = event.offsetY(); + x = event.absoluteLocation().x() - widget->pos().x(); + y = event.absoluteLocation().y() - widget->pos().y(); clickCount = event.detail(); } -WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const ScrollView* view, const WheelEvent& event) +WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(const Widget* widget, const WheelEvent& event) { if (event.type() != eventNames().mousewheelEvent) return; type = WebInputEvent::MouseWheel; timeStampSeconds = event.timeStamp() * 1.0e-3; modifiers = getWebInputModifiers(event); - IntPoint p = view->contentsToWindow(IntPoint(event.pageX(), event.pageY())); + ScrollView* view = widget->parent(); + IntPoint p = view->contentsToWindow( + IntPoint(event.absoluteLocation().x(), event.absoluteLocation().y())); globalX = event.screenX(); globalY = event.screenY(); windowX = p.x(); windowY = p.y(); - x = event.offsetX(); - y = event.offsetY(); + x = event.absoluteLocation().x() - widget->pos().x(); + y = event.absoluteLocation().y() - widget->pos().y(); deltaX = static_cast<float>(event.rawDeltaX()); deltaY = static_cast<float>(event.rawDeltaY()); // The 120 is from WheelEvent::initWheelEvent(). diff --git a/WebKit/chromium/src/WebInputEventConversion.h b/WebKit/chromium/src/WebInputEventConversion.h index dc5db35..63991a9 100644 --- a/WebKit/chromium/src/WebInputEventConversion.h +++ b/WebKit/chromium/src/WebInputEventConversion.h @@ -91,14 +91,14 @@ public: // be set to Undefined. class WebMouseEventBuilder : public WebMouseEvent { public: - WebMouseEventBuilder(const WebCore::ScrollView*, const WebCore::MouseEvent&); + WebMouseEventBuilder(const WebCore::Widget*, const WebCore::MouseEvent&); }; // Converts a WebCore::WheelEvent to a corresponding WebMouseWheelEvent. // If the event mapping fails, the event type will be set to Undefined. class WebMouseWheelEventBuilder : public WebMouseWheelEvent { public: - WebMouseWheelEventBuilder(const WebCore::ScrollView*, const WebCore::WheelEvent&); + WebMouseWheelEventBuilder(const WebCore::Widget*, const WebCore::WheelEvent&); }; // Converts a WebCore::KeyboardEvent to a corresponding WebKeyboardEvent. diff --git a/WebKit/chromium/src/WebNamedNodeMap.cpp b/WebKit/chromium/src/WebNamedNodeMap.cpp new file mode 100644 index 0000000..e2455e6 --- /dev/null +++ b/WebKit/chromium/src/WebNamedNodeMap.cpp @@ -0,0 +1,69 @@ +/* + * 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: + * + * * 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 "WebNamedNodeMap.h" + +#include "NamedNodeMap.h" +#include "Node.h" +#include "WebAttribute.h" +#include "WebNode.h" +#include <wtf/PassRefPtr.h> + +using namespace WebCore; + +namespace WebKit { + +void WebNamedNodeMap::reset() +{ + m_private.reset(); +} + +void WebNamedNodeMap::assign(const WebNamedNodeMap& other) +{ + m_private = other.m_private; +} + +WebNamedNodeMap::WebNamedNodeMap(const PassRefPtr<NamedNodeMap>& other) + : m_private(other) +{ +} + +unsigned WebNamedNodeMap::length() const +{ + return m_private->length(); +} + +WebAttribute WebNamedNodeMap::attributeItem(unsigned index) const +{ + return WebAttribute(m_private->attributeItem(index)); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebPluginContainerImpl.cpp b/WebKit/chromium/src/WebPluginContainerImpl.cpp index e24e372..7f74db2 100644 --- a/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -403,7 +403,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) // in the call to HandleEvent. See http://b/issue?id=1362948 FrameView* parentView = static_cast<FrameView*>(parent()); - WebMouseEventBuilder webEvent(parentView, *event); + WebMouseEventBuilder webEvent(this, *event); if (webEvent.type == WebInputEvent::Undefined) return; @@ -433,8 +433,7 @@ void WebPluginContainerImpl::handleMouseEvent(MouseEvent* event) void WebPluginContainerImpl::handleWheelEvent(WheelEvent* event) { - FrameView* parentView = static_cast<FrameView*>(parent()); - WebMouseWheelEventBuilder webEvent(parentView, *event); + WebMouseWheelEventBuilder webEvent(this, *event); if (webEvent.type == WebInputEvent::Undefined) return; diff --git a/WebKit/chromium/src/WebSecurityPolicy.cpp b/WebKit/chromium/src/WebSecurityPolicy.cpp index 4b2b557..58d0893 100644 --- a/WebKit/chromium/src/WebSecurityPolicy.cpp +++ b/WebKit/chromium/src/WebSecurityPolicy.cpp @@ -32,6 +32,7 @@ #include "WebSecurityPolicy.h" #include "FrameLoader.h" +#include "SchemeRegistry.h" #include "SecurityOrigin.h" #include "WebString.h" @@ -43,17 +44,17 @@ namespace WebKit { void WebSecurityPolicy::registerURLSchemeAsLocal(const WebString& scheme) { - SecurityOrigin::registerURLSchemeAsLocal(scheme); + SchemeRegistry::registerURLSchemeAsLocal(scheme); } void WebSecurityPolicy::registerURLSchemeAsNoAccess(const WebString& scheme) { - SecurityOrigin::registerURLSchemeAsNoAccess(scheme); + SchemeRegistry::registerURLSchemeAsNoAccess(scheme); } void WebSecurityPolicy::registerURLSchemeAsSecure(const WebString& scheme) { - SecurityOrigin::registerURLSchemeAsSecure(scheme); + SchemeRegistry::registerURLSchemeAsSecure(scheme); } void WebSecurityPolicy::addOriginAccessWhitelistEntry( diff --git a/WebKit/chromium/src/WebSettingsImpl.cpp b/WebKit/chromium/src/WebSettingsImpl.cpp index 6a02ed6..6569e2e 100644 --- a/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/WebKit/chromium/src/WebSettingsImpl.cpp @@ -279,6 +279,11 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) m_settings->setAcceleratedCompositingEnabled(enabled); } +void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled) +{ + m_settings->setAccelerated2dCanvasEnabled(enabled); +} + void WebSettingsImpl::setHTML5ParserEnabled(bool enabled) { m_settings->setHTML5ParserEnabled(enabled); diff --git a/WebKit/chromium/src/WebSettingsImpl.h b/WebKit/chromium/src/WebSettingsImpl.h index fe5db51..9eedba8 100644 --- a/WebKit/chromium/src/WebSettingsImpl.h +++ b/WebKit/chromium/src/WebSettingsImpl.h @@ -87,6 +87,7 @@ public: virtual void setShowDebugBorders(bool); virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); + virtual void setAccelerated2dCanvasEnabled(bool); virtual void setHTML5ParserEnabled(bool); virtual void setMemoryInfoEnabled(bool); diff --git a/WebKit/chromium/src/WebTextRun.cpp b/WebKit/chromium/src/WebTextRun.cpp new file mode 100644 index 0000000..58d9fac --- /dev/null +++ b/WebKit/chromium/src/WebTextRun.cpp @@ -0,0 +1,45 @@ +/* + * 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: + * + * * 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 "WebTextRun.h" + +#include "TextRun.h" + +using namespace WebCore; + +namespace WebKit { + +WebTextRun::operator WebCore::TextRun() const +{ + return TextRun(text, false, 0, 0, rtl, directionalOverride); +} + +} // namespace WebKit diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 83c8822..bb6d07c 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -258,6 +258,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_layerRenderer(0) , m_isAcceleratedCompositingActive(false) #endif +#if ENABLE(INPUT_SPEECH) + , m_speechInputClient(client) +#endif , m_gles2Context(0) { // WebKit/win/WebView.cpp does the same thing, except they call the @@ -272,7 +275,16 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools if (devToolsClient) m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); - m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0, 0)); + Page::PageClients pageClients; + pageClients.chromeClient = &m_chromeClientImpl; + pageClients.contextMenuClient = &m_contextMenuClientImpl; + pageClients.editorClient = &m_editorClientImpl; + pageClients.dragClient = &m_dragClientImpl; + pageClients.inspectorClient = &m_inspectorClientImpl; +#if ENABLE(INPUT_SPEECH) + pageClients.speechInputClient = &m_speechInputClient; +#endif + m_page.set(new Page(pageClients)); // the page will take ownership of the various clients @@ -489,10 +501,10 @@ void WebViewImpl::mouseUp(const WebMouseEvent& event) #endif } -void WebViewImpl::mouseWheel(const WebMouseWheelEvent& event) +bool WebViewImpl::mouseWheel(const WebMouseWheelEvent& event) { PlatformWheelEventBuilder platformEvent(mainFrameImpl()->frameView(), event); - mainFrameImpl()->frame()->eventHandler()->handleWheelEvent(platformEvent); + return mainFrameImpl()->frame()->eventHandler()->handleWheelEvent(platformEvent); } bool WebViewImpl::keyEvent(const WebKeyboardEvent& event) @@ -1018,7 +1030,7 @@ bool WebViewImpl::handleInputEvent(const WebInputEvent& inputEvent) break; case WebInputEvent::MouseWheel: - mouseWheel(*static_cast<const WebMouseWheelEvent*>(&inputEvent)); + handled = mouseWheel(*static_cast<const WebMouseWheelEvent*>(&inputEvent)); break; case WebInputEvent::MouseDown: @@ -1731,16 +1743,18 @@ void WebViewImpl::applyAutoFillSuggestions( const WebNode& node, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<int>& uniqueIDs, int separatorIndex) { - WebVector<int> uniqueIDs(names.size()); - applyAutoFillSuggestions(node, names, labels, uniqueIDs, separatorIndex); + WebVector<WebString> icons(names.size()); + applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, separatorIndex); } void WebViewImpl::applyAutoFillSuggestions( const WebNode& node, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex) { @@ -1771,7 +1785,7 @@ void WebViewImpl::applyAutoFillSuggestions( m_autoFillPopupClient.set(new AutoFillPopupMenuClient); m_autoFillPopupClient->initialize( - inputElem, names, labels, uniqueIDs, separatorIndex); + inputElem, names, labels, icons, uniqueIDs, separatorIndex); if (!m_autoFillPopup.get()) { m_autoFillPopup = PopupContainer::create(m_autoFillPopupClient.get(), @@ -1781,7 +1795,7 @@ void WebViewImpl::applyAutoFillSuggestions( if (m_autoFillPopupShowing) { m_autoFillPopupClient->setSuggestions( - names, labels, uniqueIDs, separatorIndex); + names, labels, icons, uniqueIDs, separatorIndex); refreshAutoFillPopup(); } else { m_autoFillPopup->show(focusedNode->getRect(), @@ -1803,12 +1817,13 @@ void WebViewImpl::applyAutocompleteSuggestions( { WebVector<WebString> names(suggestions.size()); WebVector<WebString> labels(suggestions.size()); + WebVector<WebString> icons(suggestions.size()); WebVector<int> uniqueIDs(suggestions.size()); for (size_t i = 0; i < suggestions.size(); ++i) names[i] = suggestions[i]; - applyAutoFillSuggestions(node, names, labels, uniqueIDs, -1); + applyAutoFillSuggestions(node, names, labels, icons, uniqueIDs, -1); if (m_autoFillPopupClient) m_autoFillPopupClient->setAutocompleteMode(true); } diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index 312f20f..530fbf5 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -47,6 +47,7 @@ #include "InspectorClientImpl.h" #include "LayerRendererChromium.h" #include "NotificationPresenterImpl.h" +#include "SpeechInputClientImpl.h" #include <wtf/OwnPtr.h> #include <wtf/RefCounted.h> @@ -170,11 +171,13 @@ public: const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<int>& uniqueIDs, int separatorIndex); virtual void applyAutoFillSuggestions( const WebNode&, const WebVector<WebString>& names, const WebVector<WebString>& labels, + const WebVector<WebString>& icons, const WebVector<int>& uniqueIDs, int separatorIndex); // DEPRECATED: replacing with applyAutoFillSuggestions. @@ -239,7 +242,7 @@ public: void mouseUp(const WebMouseEvent&); void mouseContextMenu(const WebMouseEvent&); void mouseDoubleClick(const WebMouseEvent&); - void mouseWheel(const WebMouseWheelEvent&); + bool mouseWheel(const WebMouseWheelEvent&); bool keyEvent(const WebKeyboardEvent&); bool charEvent(const WebKeyboardEvent&); bool touchEvent(const WebTouchEvent&); @@ -511,6 +514,10 @@ private: #endif static const WebInputEvent* m_currentInputEvent; +#if ENABLE(INPUT_SPEECH) + SpeechInputClientImpl m_speechInputClient; +#endif + OwnPtr<WebGLES2Context> m_gles2Context; }; diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js index 7181d74..51787f6 100644 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ b/WebKit/chromium/src/js/DebuggerScript.js @@ -32,6 +32,7 @@ var DebuggerScript = {}; DebuggerScript._breakpoints = {}; +DebuggerScript._breakpointsActivated = true; DebuggerScript.PauseOnExceptionsState = { DontPauseOnExceptions : 0, @@ -82,7 +83,7 @@ DebuggerScript._formatScript = function(script) scriptWorldType = DebuggerScript.ScriptWorldType.ExtensionsWorld; return { id: script.id, - name: script.name, + name: script.nameOrSourceURL(), source: script.source, lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset), lineCount: script.lineCount(), @@ -94,7 +95,7 @@ DebuggerScript.setBreakpoint = function(execState, args) { args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber); var breakId = Debug.setScriptBreakPointById(args.scriptId, args.lineNumber, 0 /* column */, args.condition); - if (!args.enabled) + if (!args.enabled || !DebuggerScript._breakpointsActivated) Debug.disableScriptBreakPoint(breakId); var locations = Debug.findBreakPointActualLocations(breakId); @@ -204,6 +205,7 @@ DebuggerScript.setBreakpointsActivated = function(execState, args) else Debug.disableScriptBreakPoint(breakId); } + DebuggerScript._breakpointsActivated = args.enabled; } DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index 35cca2f..640474b 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -93,7 +93,7 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function() */ devtools.ToolsAgent.prototype.dispatchOnClient_ = function(message) { - var args = JSON.parse(message); + var args = typeof message === "string" ? JSON.parse(message) : message; var methodName = args[0]; var parameters = args.slice(1); WebInspector[methodName].apply(WebInspector, parameters); @@ -129,6 +129,28 @@ devtools.tools = null; var context = {}; // Used by WebCore's inspector routines. +(function() { + WebInspector._paramsObject = {}; + + var queryParams = window.location.search; + if (queryParams) { + var params = queryParams.substring(1).split("&"); + for (var i = 0; i < params.length; ++i) { + var pair = params[i].split("="); + WebInspector._paramsObject[pair[0]] = pair[1]; + } + } + if ("page" in WebInspector._paramsObject) { + WebInspector.socket = new WebSocket("ws://" + window.location.host + "/devtools/page/" + WebInspector._paramsObject.page); + WebInspector.socket.onmessage = function(message) { eval(message.data); } + WebInspector.socket.onerror = function(error) { console.err(error); } + WebInspector.socket.onopen = function() { + WebInspector.socketOpened = true; + if (WebInspector.loadedDone) + WebInspector.doLoadedDone(); + }; + } +})(); /////////////////////////////////////////////////////////////////////////////// // Here and below are overrides to existing WebInspector methods only. // TODO(pfeldman): Patch WebCore and upstream changes. @@ -145,25 +167,25 @@ WebInspector.loaded = function() Preferences.canEditScriptSource = true; Preferences.appCacheEnabled = false; - oldLoaded.call(this); + if ("page" in WebInspector._paramsObject) { + WebInspector.loadedDone = true; + if (WebInspector.socketOpened) + WebInspector.doLoadedDone(); + return; + } + WebInspector.doLoadedDone(); +} +WebInspector.doLoadedDone = function() { + oldLoaded.call(this); InspectorFrontendHost.loaded(); -}; +} devtools.domContentLoaded = function() { - var queryParams = window.location.search; - if (queryParams) { - var params = queryParams.substring(1).split("&"); - var paramsObject = {}; - for (var i = 0; i < params.length; ++i) { - var pair = params[i].split("="); - paramsObject[pair[0]] = pair[1]; - } - WebInspector.setAttachedWindow(paramsObject.docked === "true"); - if (paramsObject.toolbar_color && paramsObject.text_color) - WebInspector.setToolbarColors(paramsObject.toolbar_color, paramsObject.text_color); - } + WebInspector.setAttachedWindow(WebInspector._paramsObject.docked === "true"); + if (WebInspector._paramsObject.toolbar_color && WebInspector._paramsObject.text_color) + WebInspector.setToolbarColors(WebInspector._paramsObject.toolbar_color, WebInspector._paramsObject.text_color); } document.addEventListener("DOMContentLoaded", devtools.domContentLoaded, false); @@ -275,3 +297,10 @@ WebInspector.resetToolbarColors = function() if (window.RemoteDebuggerAgent) { RemoteDebuggerAgent.setContextId = function() {}; } + + +// Support for pause while renderer is busy (is dispatched on IO thread). +InspectorBackend.pause = function() +{ + RemoteDebuggerCommandExecutor.DebuggerPauseScript(); +}; diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js index a2f356f..52b28bb 100644 --- a/WebKit/chromium/src/js/DevToolsHostStub.js +++ b/WebKit/chromium/src/js/DevToolsHostStub.js @@ -37,7 +37,6 @@ if (!window["RemoteDebuggerCommandExecutor"]) { window["RemoteDebuggerCommandExecutor"] = {}; window["RemoteProfilerAgent"] = {}; window["RemoteToolsAgent"] = { - dispatchOnInjectedScript: function() {}, dispatchOnInspectorController: function() {} }; } diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js deleted file mode 100644 index 5ed506a..0000000 --- a/WebKit/chromium/src/js/InspectorControllerImpl.js +++ /dev/null @@ -1,161 +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: - * - * * 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. - */ - -/** - * @fileoverview DevTools' implementation of the InspectorController API. - */ - -if (!this.devtools) - devtools = {}; - -devtools.InspectorBackendImpl = function() -{ - WebInspector.InspectorBackendStub.call(this); - this.installInspectorControllerDelegate_("addInspectedNode"); - this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad"); - this.installInspectorControllerDelegate_("changeTagName"); - this.installInspectorControllerDelegate_("clearConsoleMessages"); - this.installInspectorControllerDelegate_("copyNode"); - this.installInspectorControllerDelegate_("deleteCookie"); - this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend"); - this.installInspectorControllerDelegate_("disableMonitoringXHR"); - this.installInspectorControllerDelegate_("disableResourceTracking"); - this.installInspectorControllerDelegate_("disableSearchingForNode"); - this.installInspectorControllerDelegate_("disableTimeline"); - this.installInspectorControllerDelegate_("enableMonitoringXHR"); - this.installInspectorControllerDelegate_("enableResourceTracking"); - this.installInspectorControllerDelegate_("enableSearchingForNode"); - this.installInspectorControllerDelegate_("enableTimeline"); - this.installInspectorControllerDelegate_("getChildNodes"); - this.installInspectorControllerDelegate_("getCookies"); - this.installInspectorControllerDelegate_("getDatabaseTableNames"); - this.installInspectorControllerDelegate_("getDOMStorageEntries"); - this.installInspectorControllerDelegate_("getEventListenersForNode"); - this.installInspectorControllerDelegate_("getOuterHTML"); - this.installInspectorControllerDelegate_("getProfile"); - this.installInspectorControllerDelegate_("getProfileHeaders"); - this.installInspectorControllerDelegate_("removeProfile"); - this.installInspectorControllerDelegate_("clearProfiles"); - this.installInspectorControllerDelegate_("getResourceContent"); - this.installInspectorControllerDelegate_("highlightDOMNode"); - this.installInspectorControllerDelegate_("hideDOMNodeHighlight"); - this.installInspectorControllerDelegate_("performSearch"); - this.installInspectorControllerDelegate_("pushNodeByPathToFrontend"); - this.installInspectorControllerDelegate_("releaseWrapperObjectGroup"); - this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad"); - this.installInspectorControllerDelegate_("reloadPage"); - this.installInspectorControllerDelegate_("removeAttribute"); - this.installInspectorControllerDelegate_("removeDOMStorageItem"); - this.installInspectorControllerDelegate_("removeNode"); - this.installInspectorControllerDelegate_("saveApplicationSettings"); - this.installInspectorControllerDelegate_("saveSessionSettings"); - this.installInspectorControllerDelegate_("searchCanceled"); - this.installInspectorControllerDelegate_("setAttribute"); - this.installInspectorControllerDelegate_("setDOMStorageItem"); - this.installInspectorControllerDelegate_("setInjectedScriptSource"); - this.installInspectorControllerDelegate_("setOuterHTML"); - this.installInspectorControllerDelegate_("setTextNodeValue"); - this.installInspectorControllerDelegate_("startProfiling"); - this.installInspectorControllerDelegate_("startTimelineProfiler"); - this.installInspectorControllerDelegate_("stopProfiling"); - this.installInspectorControllerDelegate_("stopTimelineProfiler"); - this.installInspectorControllerDelegate_("storeLastActivePanel"); - this.installInspectorControllerDelegate_("takeHeapSnapshot"); - - this.installInspectorControllerDelegate_("getAllStyles"); - this.installInspectorControllerDelegate_("getStyles"); - this.installInspectorControllerDelegate_("getComputedStyle"); - this.installInspectorControllerDelegate_("getInlineStyle"); - this.installInspectorControllerDelegate_("getStyleSheet"); - this.installInspectorControllerDelegate_("getRuleRangesForStyleSheetId"); - this.installInspectorControllerDelegate_("applyStyleText"); - this.installInspectorControllerDelegate_("setStyleText"); - this.installInspectorControllerDelegate_("setStyleProperty"); - this.installInspectorControllerDelegate_("toggleStyleEnabled"); - this.installInspectorControllerDelegate_("setRuleSelector"); - this.installInspectorControllerDelegate_("addRule"); - - this.installInspectorControllerDelegate_("disableDebugger"); - this.installInspectorControllerDelegate_("editScriptSource"); - this.installInspectorControllerDelegate_("getScriptSource"); - this.installInspectorControllerDelegate_("enableDebugger"); - this.installInspectorControllerDelegate_("setBreakpoint"); - this.installInspectorControllerDelegate_("removeBreakpoint"); - this.installInspectorControllerDelegate_("activateBreakpoints"); - this.installInspectorControllerDelegate_("deactivateBreakpoints"); - this.installInspectorControllerDelegate_("resume"); - this.installInspectorControllerDelegate_("stepIntoStatement"); - this.installInspectorControllerDelegate_("stepOutOfFunction"); - this.installInspectorControllerDelegate_("stepOverStatement"); - this.installInspectorControllerDelegate_("setPauseOnExceptionsState"); -}; -devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype; - - -devtools.InspectorBackendImpl.prototype.pause = function() -{ - RemoteDebuggerCommandExecutor.DebuggerPauseScript(); -}; - - -/** - * @override - */ -devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = function(callId, injectedScriptId, methodName, argsString, async) -{ - // Encode injectedScriptId into callId - if (typeof injectedScriptId !== "number") - injectedScriptId = 0; - RemoteToolsAgent.dispatchOnInjectedScript(callId, injectedScriptId, methodName, argsString, async); -}; - - -/** - * Installs delegating handler into the inspector controller. - * @param {string} methodName Method to install delegating handler for. - */ -devtools.InspectorBackendImpl.prototype.installInspectorControllerDelegate_ = function(methodName) -{ - this[methodName] = this.callInspectorController_.bind(this, methodName); -}; - - -/** - * Bound function with the installInjectedScriptDelegate_ actual - * implementation. - */ -devtools.InspectorBackendImpl.prototype.callInspectorController_ = function(methodName, var_arg) -{ - var args = Array.prototype.slice.call(arguments, 1); - RemoteToolsAgent.dispatchOnInspectorController(WebInspector.Callback.wrap(function(){}), methodName, JSON.stringify(args)); -}; - - -InspectorBackend = new devtools.InspectorBackendImpl(); diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp index 9aad6bb..44b262d 100644 --- a/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/WebKit/chromium/tests/PopupMenuTest.cpp @@ -69,6 +69,7 @@ public: return str; } virtual String itemLabel(unsigned) const { return String(); } + virtual String itemIcon(unsigned) const { return String(); } virtual String itemToolTip(unsigned listIndex) const { return itemText(listIndex); } virtual String itemAccessibilityText(unsigned listIndex) const { return itemText(listIndex); } virtual bool itemIsEnabled(unsigned listIndex) const { return true; } |