diff options
Diffstat (limited to 'WebKit/chromium')
81 files changed, 2575 insertions, 1089 deletions
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog index e9f6354..dd23f6f 100644 --- a/WebKit/chromium/ChangeLog +++ b/WebKit/chromium/ChangeLog @@ -1,3 +1,961 @@ +2010-09-20 Darin Adler <darin@apple.com> + + Reviewed by James Robinson. + + Deprecate the inputType function on HTMLInputElement + https://bugs.webkit.org/show_bug.cgi?id=46023 + + * src/WebInputElement.cpp: + (WebKit::WebInputElement::inputType): + * src/WebPasswordFormUtils.cpp: + (WebKit::findPasswordFormFields): + * src/WebSearchableFormData.cpp: + (WebCore::HasSuitableTextElement): + Use deprecatedInputType instead of inputType. + +2010-09-20 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Change compositor to use GraphicsContext3D rather than GLES2Context + https://bugs.webkit.org/show_bug.cgi?id=45912 + + Switched Chromium's compositor to use GraphicsContext3D to issue + its OpenGL rendering calls rather than the Chromium-specific + GLES2Context and command buffer OpenGL implementation. + + The in-process software rendering path for GraphicsContext3D does + not yet work with the compositor, at least not on Mac OS X. This + will be worked on in subsequent bugs. + + Tested manually with 3D CSS, WebGL and video content on Mac OS X + and Linux. No new tests. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3DInternal::initialize): + (WebCore::GraphicsContext3DInternal::extractWebGraphicsContext3D): + (WebCore::GraphicsContext3D::create): + * src/GraphicsContext3DInternal.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::gles2Context): + (WebKit::WebViewImpl::graphicsContext3D): + * src/WebViewImpl.h: + +2010-09-20 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + [chromium] Roll forward Chromium DEPS to pick up WebGraphicsContext3D implementation changes + https://bugs.webkit.org/show_bug.cgi?id=46115 + + * DEPS: + +2010-09-20 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: merge Inspector client runtime events into the serialized inspector state object. + + Drive-by rename getBackendSettings -> getInspectorState to better reflect the nature of the data. + + https://bugs.webkit.org/show_bug.cgi?id=45974 + + * src/InspectorClientImpl.cpp: + (WebKit::InspectorClientImpl::updateInspectorStateCookie): + * src/InspectorClientImpl.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setRuntimeProperty): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + (WebKit::WebDevToolsAgentImpl::updateInspectorStateCookie): + * src/WebDevToolsAgentImpl.h: + +2010-09-19 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r67749. + http://trac.webkit.org/changeset/67749 + https://bugs.webkit.org/show_bug.cgi?id=46068 + + breaking ToT chromium canary build (Requested by shans on + #webkit). + + * public/WebFrameClient.h: + * public/WebScriptController.h: + * src/FrameLoaderClientImpl.cpp: + * src/FrameLoaderClientImpl.h: + * src/WebScriptController.cpp: + (WebKit::WebScriptController::registerExtension): + +2010-09-19 Kent Tamura <tkent@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] Add is<input type>() functions to WebInputElement + https://bugs.webkit.org/show_bug.cgi?id=46035 + + We're going to stop exposing HTMLInputElemnt::InputType. So, add + isFoo() functions in order to remove WebInputElement::InputType. + + * public/WebInputElement.h: + * src/WebInputElement.cpp: + (WebKit::WebInputElement::isTextField): + (WebKit::WebInputElement::isText): + (WebKit::WebInputElement::isPasswordField): + (WebKit::WebInputElement::isImageButton): + +2010-09-17 Darin Adler <darin@apple.com> + + Reviewed by Sam Weinig. + + REGRESSION (r60104): Zoom level is unexpectedly reset on page reload + https://bugs.webkit.org/show_bug.cgi?id=42863 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::createPlugin): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): + Call functions on Frame instead of FrameView. + +2010-09-17 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Roll forward Chromium DEPS to pick up Mesa DRT changes + https://bugs.webkit.org/show_bug.cgi?id=46006 + + * DEPS: + +2010-09-17 Kenneth Russell <kbr@google.com> + + Reviewed by Dimitri Glazkov. + + [chromium] Add mesa as DumpRenderTree dependency + https://bugs.webkit.org/show_bug.cgi?id=46001 + + * WebKit.gyp: + +2010-09-13 Matt Perry <mpcomplete@chromium.org> + + Reviewed by Darin Fisher. + + Have V8DOMWindowShell ask the embedder whether to run a V8 extension + in a particular script context. + https://bugs.webkit.org/show_bug.cgi?id=45721 + + * public/WebFrameClient.h: + (WebKit::WebFrameClient::allowScriptExtension): + * public/WebScriptController.h: + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::allowScriptExtension): + * src/FrameLoaderClientImpl.h: + * src/WebScriptController.cpp: + (WebKit::WebScriptController::registerExtension): + +2010-09-17 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + Remove unimplemented destructor declaration to fix Chromium build. + https://bugs.webkit.org/show_bug.cgi?id=45987 + + * src/AsyncFileWriterChromium.h: + +2010-09-16 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r67693. + http://trac.webkit.org/changeset/67693 + https://bugs.webkit.org/show_bug.cgi?id=45946 + + "Need to pick up a chromium change first" (Requested by dumi + on #webkit). + + * public/WebHTTPBody.h: + * src/WebHTTPBody.cpp: + (WebKit::WebHTTPBody::elementAt): + (WebKit::WebHTTPBody::appendFileRange): + +2010-09-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Darin Fisher. + + Remove WebHTTPBody::appendFileRange(..., const WebFileInfo&). + + * public/WebHTTPBody.h: + * src/WebHTTPBody.cpp: + (WebKit::WebHTTPBody::elementAt): + +2010-09-16 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + Add entry points to GraphicsContext3D needed for Chromium compositor port + https://bugs.webkit.org/show_bug.cgi?id=45939 + + Added entry points for two Chromium-specific extensions, and added + a flag to the GraphicsContext3D constructor, currently unsupported + by all ports (including Chromium), indicating whether the context + should render directly to the passed HostWindow or off-screen per + the current semantics. The switch to use GraphicsContext3D in + Chromium's compositor will follow in a subsequent patch. + + No new tests; functionality is unchanged. Built and tested + Chromium and WebKit on Mac OS X. + + * src/GraphicsContext3D.cpp: + (WebCore::GraphicsContext3D::GraphicsContext3D): + (WebCore::GraphicsContext3D::create): + * src/GraphicsContext3DInternal.h: + +2010-09-16 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Add needed entry points to WebGraphicsContext3D for compositor + https://bugs.webkit.org/show_bug.cgi?id=45921 + + * public/WebGraphicsContext3D.h: + * src/WebGraphicsContext3DDefaultImpl.cpp: + (WebKit::WebGraphicsContext3DDefaultImpl::initialize): + (WebKit::WebGraphicsContext3DDefaultImpl::supportsMapSubCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::mapBufferSubDataCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::unmapBufferSubDataCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::mapTexSubImage2DCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM): + (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM): + * src/WebGraphicsContext3DDefaultImpl.h: + +2010-09-15 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [Chromium] Needs DRT queueLoadHTMLString and setDeferMainResourceLoad-implementations + https://bugs.webkit.org/show_bug.cgi?id=42151 + + * public/WebDataSource.h: + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::applicationCacheHost): + (WebKit::WebDataSourceImpl::setDeferMainResourceDataLoad): Added so DRT can set this flag before a load. + * src/WebDataSourceImpl.h: + +2010-09-16 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + Roll forward Chromium DEPS to r59706 + https://bugs.webkit.org/show_bug.cgi?id=45916 + + * DEPS: + +2010-09-16 Darin Adler <darin@apple.com> + + Reviewed by Andreas Kling. + + Reduce use of HTMLInputElement::inputType so we can remove it later + https://bugs.webkit.org/show_bug.cgi?id=45903 + + * src/DOMUtilitiesPrivate.cpp: + (WebKit::elementHasLegalLinkAttribute): Use isImageButton. + * src/WebPasswordFormUtils.cpp: + (WebKit::findPasswordFormFields): Use isPasswordField. + * src/WebSearchableFormData.cpp: + (WebCore::IsInDefaultState): Use isCheckbox and isRadioButton. + (WebCore::HasSuitableTextElement): Use isFileUpload and isPasswordField. + +2010-09-16 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Expose separate GraphicsContext3DInternal.h + https://bugs.webkit.org/show_bug.cgi?id=45914 + + * WebKit.gyp: + * src/GraphicsContext3D.cpp: + * src/GraphicsContext3DInternal.h: Added. + +2010-09-16 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] Add WebGraphicsContext3D accessor to WebView + https://bugs.webkit.org/show_bug.cgi?id=45913 + + * public/WebView.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::graphicsContext3D): + * src/WebViewImpl.h: + +2010-09-16 Ilya Tikhonovsky <loislo@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: move resourceTracking flag under control of BackendSettings. + + Four Inspector API methods about resourceTracking flag were removed. + Actual state of the flag is transfered as the response of setResourceTracking request. + Initial state of the flag on the frontend side is obtained from settings.backend. + + https://bugs.webkit.org/show_bug.cgi?id=45887 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setRuntimeProperty): + (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled): + +2010-09-16 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [REGRESSION] Scripts disappear from scripts panel after navigation + https://bugs.webkit.org/show_bug.cgi?id=45890 + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::setRuntimeProperty): make sure debugger and profiler + are initialized when inspected page navigation leads to renderer process change. + +2010-09-16 Eric Uhrhane <ericu@chromium.org> + + Reviewed by Jian Li. + + Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM. + https://bugs.webkit.org/show_bug.cgi?id=45798 + + * src/AsyncFileWriterChromium.h: + * src/AsyncFileWriterChromium.cpp: + +2010-09-16 Nat Duca <nduca@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Make compositor obey finish flag + https://bugs.webkit.org/show_bug.cgi?id=45552 + + The compositor should obey the finish flag on doComposite. This + flag causes the compositor to finish rendering before returning, + which is needed when resizing the window to avoid flashes of green. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::composite): + +2010-09-15 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Allow the embedder to specify the base path for IndexedDB. + https://bugs.webkit.org/show_bug.cgi?id=45815 + + Need to add the extra .open() parameter to make this all work. + + * public/WebIDBFactory.h: + (WebKit::WebIDBFactory::open): + * src/IDBFactoryBackendProxy.cpp: + (WebCore::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::open): + * src/WebIDBFactoryImpl.h: + +2010-09-16 Jeremy Orlow <jorlow@chromium.org> + + Speculative build fix. + + * src/IDBIndexBackendProxy.cpp: + +2010-09-08 Jeremy Orlow <jorlow@chromium.org> + + Reviewed by Steve Block. + + Complete index support for IndexedDB + https://bugs.webkit.org/show_bug.cgi?id=45386 + + * public/WebIDBCursor.h: + (WebKit::WebIDBCursor::direction): + (WebKit::WebIDBCursor::key): + (WebKit::WebIDBCursor::value): + (WebKit::WebIDBCursor::update): + (WebKit::WebIDBCursor::continueFunction): + (WebKit::WebIDBCursor::remove): + * public/WebIDBIndex.h: + (WebKit::WebIDBIndex::storeName): + (WebKit::WebIDBIndex::openObjectCursor): + (WebKit::WebIDBIndex::openCursor): + (WebKit::WebIDBIndex::getObject): + (WebKit::WebIDBIndex::get): + * public/WebIDBKey.h: + * src/IDBCursorBackendProxy.cpp: + (WebCore::IDBCursorBackendProxy::value): + * src/IDBCursorBackendProxy.h: + * src/IDBIndexBackendProxy.cpp: + (WebCore::IDBIndexBackendProxy::storeName): + (WebCore::IDBIndexBackendProxy::openObjectCursor): + (WebCore::IDBIndexBackendProxy::openCursor): + (WebCore::IDBIndexBackendProxy::getObject): + (WebCore::IDBIndexBackendProxy::get): + * src/IDBIndexBackendProxy.h: + * src/WebIDBCursorImpl.cpp: + (WebKit::WebIDBCursorImpl::value): + * src/WebIDBCursorImpl.h: + * src/WebIDBIndexImpl.cpp: + (WebKit::WebIDBIndexImpl::storeName): + (WebKit::WebIDBIndexImpl::openCursor): + (WebKit::WebIDBIndexImpl::openObjectCursor): + (WebKit::WebIDBIndexImpl::getObject): + (WebKit::WebIDBIndexImpl::get): + * src/WebIDBIndexImpl.h: + +2010-09-15 Dumitru Daniliuc <dumi@chromium.org> + + Reviewed by Darin Fisher. + + Overload WebHTTPBody::appendFileRange() to take a double modification time argument. + https://bugs.webkit.org/show_bug.cgi?id=45829 + + The plan is to change all callers of + WebHTTPBody::appendFileRange(..., const WebFileInfo&) to use the + new method, and then remove it. + + * public/WebHTTPBody.h: + * src/WebHTTPBody.cpp: + (WebKit::WebHTTPBody::elementAt): + (WebKit::WebHTTPBody::appendFileRange): + +2010-09-14 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Provide network-based load timing. + Before this change, inspector used timers taken from + within WebCore notifications (that are by definition + synchronous and serialized). As a result, timing was + affected by the routines running on the main thread + (JavaScript and such). + https://bugs.webkit.org/show_bug.cgi?id=45664 + + * public/WebURLLoadTiming.h: + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didFinishLoading): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didFinishLoading): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didFinishLoading): + * src/WebURLLoadTiming.cpp: + (WebKit::WebURLLoadTiming::receiveHeadersStart): + (WebKit::WebURLLoadTiming::setReceiveHeadersStart): + +2010-09-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r67551. + http://trac.webkit.org/changeset/67551 + https://bugs.webkit.org/show_bug.cgi?id=45816 + + "Plugin tests fail" (Requested by yurys on #webkit). + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didFinishLoading): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didFinishLoading): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didFinishLoading): + +2010-09-14 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: Provide network-based load timing. + Before this change, inspector used timers taken from + within WebCore notifications (that are by definition + synchronous and serialized). As a result, timing was + affected by the routines running on the main thread + (JavaScript and such). + https://bugs.webkit.org/show_bug.cgi?id=45664 + + * public/WebURLLoadTiming.h: + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didFinishLoading): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didFinishLoading): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didFinishLoading): + * src/WebURLLoadTiming.cpp: + (WebKit::WebURLLoadTiming::receiveHeadersStart): + (WebKit::WebURLLoadTiming::setReceiveHeadersStart): + +2010-09-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r67503. + http://trac.webkit.org/changeset/67503 + https://bugs.webkit.org/show_bug.cgi?id=45802 + + This patch broke GTK builds (Requested by jianli_ on #webkit). + + * src/ResourceHandle.cpp: + +2010-09-14 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Links from "Profiles" don't lead to "Scripts" + https://bugs.webkit.org/show_bug.cgi?id=45756 + + * src/js/DevTools.js: remove obsolete code + +2010-09-14 Tony Chang <tony@chromium.org> + + Reviewed by Kent Tamura. + + [chromium] fix http/tests/security/local-user-CSS-from-remote.html + https://bugs.webkit.org/show_bug.cgi?id=45788 + + * DEPS: Include webkit_support::LocalFileToDataURL + +2010-09-14 Tony Chang <tony@chromium.org> + + Reviewed by Ojan Vafai. + + [chromium] Remove WebKit::areLayoutTestImagesOpaque since it's no longer needed + https://bugs.webkit.org/show_bug.cgi?id=45768 + + * public/WebKit.h: + * src/WebKit.cpp: + +2010-09-14 Mihai Parparita <mihaip@chromium.org> + + Reviewed by Tony Chang. + + blob: URL scheme does not work with Chromium DRT + https://bugs.webkit.org/show_bug.cgi?id=45772 + + Roll Chromium forward to r59406, which registers the blob + URL scheme for the Chromium DRT too. + + * DEPS: + +2010-09-14 Jian Li <jianli@chromium.org> + + Reviewed by David Levin. + + fast/files/apply-blob-url-to-img.html timeout on Leopard + https://bugs.webkit.org/show_bug.cgi?id=45576 + + * src/ResourceHandle.cpp: Remove the no longer applicable static comment. + +2010-09-14 Chris Guillory <chris.guillory@google.com> + + Reviewed by Chris Fleizach. + + Send all accessibility notifications to Chromium. + https://bugs.webkit.org/show_bug.cgi?id=45156 + + Use postAccessibilityNotification to pass accessibility notifications + to chromium. + + * WebKit.gyp: + * public/WebAccessibilityNotification.h: Added. + * public/WebViewClient.h: + (WebKit::WebViewClient::postAccessibilityNotification): + * src/AssertMatchingEnums.h: Added. + * src/ChromeClientImpl.cpp: + (WebKit::toWebAccessibilityNotification): + (WebKit::ChromeClientImpl::didChangeAccessibilityObjectChildren): + (WebKit::ChromeClientImpl::postAccessibilityNotification): + * src/ChromeClientImpl.h: + +2010-09-14 Tony Chang <tony@chromium.org> + + Unreviewed, fix chromium win compile. + + * public/WebView.h: + +2010-09-14 Tony Chang <tony@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] implement layoutTestController.setDomainRelaxationForbiddenForURLScheme + https://bugs.webkit.org/show_bug.cgi?id=45762 + + * public/WebView.h: add WebView::setDomainRelaxationForbidden + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setDomainRelaxationForbidden): + * src/WebViewImpl.h: + +2010-09-14 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Andreas Kling. + + Move DebuggerScript.js from WebKit/chromium/src/js to WebCore/bindings/v8 + https://bugs.webkit.org/show_bug.cgi?id=45739 + + * WebKit.grd: + * WebKit.gypi: + * src/js/DebuggerScript.js: Removed. + * src/js/DevToolsHostStub.js: Removed. + +2010-09-14 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Make WebDeviceOrientationClientMock constructor private. + https://bugs.webkit.org/show_bug.cgi?id=45743 + + Clients should use the create member function instead. DumpRenderTree + and the Chromium test_shell have previously been updated to call create. + + * public/WebDeviceOrientationClientMock.h: + (WebKit::WebDeviceOrientationClientMock::WebDeviceOrientationClientMock): + +2010-09-13 Eric Uhrhane <ericu@chromium.org> + + Reviewed by Darin Fisher. + + Add Chromium API for FileWriter + https://bugs.webkit.org/show_bug.cgi?id=44360 + + Build file changes. + * WebKit.gyp: + + Added a way to get a WebFileWriter. + * public/WebFileSystem.h: + (WebKit::WebFileSystem::createFileWriter): + + WebFileWriter writes and truncates files. + * public/WebFileWriter.h: Added. + + WebFileWriterClient reports success/failure and progress events. + * public/WebFileWriterClient.h: Added. + + AsyncFileWriterChromium is a connector that links FileWriter and WebFileWriter, FileWriterClient and WebFileWriterClient. + * src/AsyncFileWriterChromium.cpp: Added. + * src/AsyncFileWriterChromium.h: Added. + +2010-09-13 W. James MacLean <wjmaclean@google.com> + + Reviewed by Darin Fisher. + + [chromium] Thumbnails not generated for GPU Rendered Pages + https://bugs.webkit.org/show_bug.cgi?id=44127 + + Modified WebViewImpl::paint() to detect non-null canvas pointers when + accelerated compositing is active, and instead fills the pixel buffer + from the GPU framebuffer. Includes re-scaling support when provided + canvas does not match size of current render layer. Limits pixel + readback to rect passed to paint(), clipped by size of rootLayerTexture. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::doPixelReadbackToCanvas): + (WebKit::WebViewImpl::paint): + * src/WebViewImpl.h: + +2010-09-13 James Robinson <jamesr@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Return NULL from getSharedGraphicsContext3D if we couldn't initialize + https://bugs.webkit.org/show_bug.cgi?id=45731 + + If we can't create a GraphicsContext3D, return NULL from getSharedGraphicsContext3D rather + than an object with NULL internal pointers. Callers know how to handle a null return value + but not one that has inconsistent internal state. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::getSharedGraphicsContext3D): + +2010-09-13 Chris Guillory <chris.guillory@google.com> + + Reviewed by Chris Fleizach. + + WebAccessibilityCacheImpl needs to handle invalid accessibility object ids. + https://bugs.webkit.org/show_bug.cgi?id=45572 + + * public/WebAccessibilityObject.h: + * src/WebAccessibilityCacheImpl.cpp: + (WebKit::WebAccessibilityCacheImpl::addOrGetId): + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::isAxObjectIdValid): + +2010-09-13 Pavel Podivilov <podivilov@chromium.org> + + Reviewed by Dimitri Glazkov. + + [Chromium] fix broken dependency in ImageDiff + https://bugs.webkit.org/show_bug.cgi?id=45684 + + * WebKit.gyp: + +2010-09-13 Enrica Casucci <enrica@apple.com> + + Reviewed by Sam Weinig. + + Paste should be implemented in WebCore like Copy and Cut for Mac also. + https://bugs.webkit.org/show_bug.cgi?id=45494 + <rdar://problem/7660537> + + On the Mac platform, the implementation of the paste operation is all done + at the WebKit level. In order to support it on WebKit2 it is necessary to + refactor the code and move this functionality at the level of WebCore like + we already have on Windows. + The original code relies on some in AppKit functions that call back into + WebKit causing problems in WebKit2. All this functionality has been moved + at the level of the editor client where it can be dealt with appropriately. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::canShowMIMETypeAsHTML): Added stub. + * src/FrameLoaderClientImpl.h: + +2010-09-13 Jonathan Dixon <joth@chromium.org> + + Reviewed by Steve Block. + + [chromium] Port test shell geolocation fixes to DRT + https://bugs.webkit.org/show_bug.cgi?id=45313 + + Ports over fixes from test shell: + - http://codereview.chromium.org/3294007 + - http://codereview.chromium.org/333800 + + Resets state between service instances, which fixes delayed-permission-allowed-for-multiple-requests.html + + Also re-apply rolled out patch http://trac.webkit.org/changeset/66886 :- + Access to out-of-scope WebGeolocationServiceBridgeImpl + https://bugs.webkit.org/show_bug.cgi?id=45112 + + Keep the WebGeolocationService pointer for lifetime of the bridge, to + ensure it can be detached reliably + + Includes follow-up review comment to rename onWebGeolocationServiceDestroyed to didDestroyGeolocationService + + * public/WebGeolocationService.h: + (WebKit::WebGeolocationService::~WebGeolocationService): + * public/WebGeolocationServiceBridge.h: + (WebKit::WebGeolocationServiceBridge::onWebGeolocationServiceDestroyed): + * public/WebGeolocationServiceMock.h: + * src/WebGeolocationServiceBridgeImpl.cpp: + (WebKit::WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl): + (WebKit::WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl): + (WebKit::WebGeolocationServiceBridgeImpl::startUpdating): + (WebKit::WebGeolocationServiceBridgeImpl::stopUpdating): + (WebKit::WebGeolocationServiceBridgeImpl::suspend): + (WebKit::WebGeolocationServiceBridgeImpl::resume): + (WebKit::WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded): + (WebKit::WebGeolocationServiceBridgeImpl::setIsAllowed): + (WebKit::WebGeolocationServiceBridgeImpl::setLastPosition): + (WebKit::WebGeolocationServiceBridgeImpl::setLastError): + (WebKit::WebGeolocationServiceBridgeImpl::didDestroyGeolocationService): + (WebKit::WebGeolocationServiceBridgeImpl::isAttached): + * src/WebGeolocationServiceMock.cpp: + (WebKit::WebGeolocationServiceMock::setMockGeolocationPermission): + (WebKit::WebGeolocationServiceMockImpl::WebGeolocationServiceMockImpl): + (WebKit::WebGeolocationServiceMockImpl::~WebGeolocationServiceMockImpl): + (WebKit::WebGeolocationServiceMockImpl::setMockGeolocationPermission): + (WebKit::WebGeolocationServiceMockImpl::requestPermissionForFrame): + (WebKit::WebGeolocationServiceMockImpl::notifyPendingPermissions): + +2010-09-13 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: upstream testExpandScope debugger test + https://bugs.webkit.org/show_bug.cgi?id=45260 + + * src/js/DebuggerScript.js: copy scope variables into a new object, but for global scope object, + with statement parameter and catch block exception variable pass the object itself to the injected + script. + * src/js/Tests.js: moved testExpandScope to LayoutTests + +2010-09-13 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + Add WebDeviceOrientationClientMock::create() and use it from DRT. + https://bugs.webkit.org/show_bug.cgi?id=45650 + + Since the virtual member functions of WebDeviceOrientationClientMock + are not exported from the DLL, construction of the object must be done inside + the DLL, or else the linker will complain (because the vtable cannot + be set up). Clients should use the create() member function, and the constructor + will be made private in a subsequent patch. + + * public/WebDeviceOrientationClientMock.h: + (WebKit::WebDeviceOrientationClientMock::WebDeviceOrientationClientMock): + * src/WebDeviceOrientationClientMock.cpp: + (WebKit::WebDeviceOrientationClientMock::create): + +2010-09-12 Kent Tamura <tkent@chromium.org> + + Reviewed by Tony Chang. + + [DRT/Chromium] Remove dependency to base/string16.h and gfx/codec/png_codec.h + https://bugs.webkit.org/show_bug.cgi?id=45517 + + * DEPS: Roll Chromium revision to r59033 to have webkit_support_gfx.h. + * WebKit.gyp: + +2010-09-10 MORITA Hajime <morrita@google.com> + + Reviewed by Tony Chang. + + [Chromium] Implement textInputController.hasSpellingMarker() for Chromium + https://bugs.webkit.org/show_bug.cgi?id=45441 + + Exported Frame::selectionStartHasSpellingMarkerFor() for DRT use. + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::selectionStartHasSpellingMarkerFor): + * src/WebFrameImpl.h: + +2010-09-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org> + + Reviewed by Darin Adler. + + Add NetworkingContext to avoid layer violations + https://bugs.webkit.org/show_bug.cgi?id=42292 + + * src/ResourceHandle.cpp: + (WebCore::ResourceHandle::create): + (WebCore::ResourceHandle::start): + (WebCore::ResourceHandle::loadResourceSynchronously): + +2010-09-10 Sam Weinig <sam@webkit.org> + + Fix chromium build. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): + +2010-09-10 Ryosuke Niwa <rniwa@webkit.org> + + Unreviewed, speculative chromium build fix. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setZoomLevel): + +2010-09-10 Sam Weinig <sam@webkit.org> + + Reviewed by Darin Adler. + + Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom. + Precursor to <rdar://problem/7660657> + https://bugs.webkit.org/show_bug.cgi?id=45522 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::createPlugin): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::setZoomLevel): + * src/WebViewImpl.h: + (WebKit::WebViewImpl::zoomTextOnly): + Move tracking of text only zoom here from WebCore. + +2010-09-10 Adam Barth <abarth@webkit.org> + + Reviewed by Darin Fisher. + + Move code from WebKit-layer to DocumentLoader + https://bugs.webkit.org/show_bug.cgi?id=45569 + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::committedLoad): + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::commitDocumentData): + +2010-09-10 Tony Chang <tony@chromium.org> + + Unreviewed, fix chromium compile after r67238. + + shouldChangeSelection was removed from Frame. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::selectWordAroundPosition): + +2010-09-10 Nat Duca <nduca@chromium.org> + + Reviewed by Darin Fisher. + + [chromium] Accelerated Compositing: screen garbage when scrolling + https://bugs.webkit.org/show_bug.cgi?id=45092 + + Introduce a new API on WebWidget for painting with accelerated + compositing that allows the compositor to properly distingiush + scrolling, invalidation and repainting from one another. The key + change is that in accelerated rendering case, invalidates and + scrolling pass directly to the compositor, rather than passing up + to the client as was the case in the software path. For + accelerated rendering, the previous paint() method is replaced by + composite(). + + * public/WebWidget.h: + * public/WebWidgetClient.h: + (WebKit::WebWidgetClient::scheduleComposite): + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::invalidateContentsAndWindow): + (WebKit::ChromeClientImpl::scroll): + * src/WebPopupMenuImpl.cpp: + (WebKit::WebPopupMenuImpl::themeChanged): + (WebKit::WebPopupMenuImpl::composite): + * src/WebPopupMenuImpl.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + (WebKit::WebViewImpl::paint): + (WebKit::WebViewImpl::themeChanged): + (WebKit::WebViewImpl::composite): + (WebKit::WebViewImpl::setRootGraphicsLayer): + (WebKit::WebViewImpl::setRootLayerNeedsDisplay): + (WebKit::WebViewImpl::scrollRootLayerRect): + (WebKit::WebViewImpl::invalidateRootLayerRect): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::updateRootLayerContents): + (WebKit::WebViewImpl::doComposite): + * src/WebViewImpl.h: + * tests/PopupMenuTest.cpp: + (WebKit::TestWebWidget::themeChanged): + (WebKit::TestWebWidget::composite): + +2010-09-10 David Holloway <dhollowa@chromium.org> + + Reviewed by Adam Barth. + + Change WebKit::WebFormElement::wasUserSubmitted to use WebCore::HTMLFormElement::submittedByUserGesture + instead of WebCore::HTMLFormElement::submissionTrigger. + Chromium AutoFill feature semantics changed with respect to what we mean by "user submitted" form. A + more accurate measure of the user manually submitting a form is via user gesture. + https://bugs.webkit.org/show_bug.cgi?id=45128 + + * src/WebFormElement.cpp: + (WebKit::WebFormElement::wasUserSubmitted): + +2010-09-09 Darin Adler <darin@apple.com> + + Reviewed by Adam Barth. + + Move functions from Frame to SelectionController as planned + https://bugs.webkit.org/show_bug.cgi?id=45508 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::selectionBoundsRect): + Call functions on selection(). + +2010-09-10 Adam Barth <abarth@webkit.org> + + Chromium build fix (one hopes!) + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::commitDocumentData): + +2010-09-10 Adam Barth <abarth@webkit.org> + + Reviewed by Eric Seidel. + + Main resource bytes shouldn't bounce through FrameLoader + https://bugs.webkit.org/show_bug.cgi?id=45496 + + Now return the bytes to the DocumentLoader. + + Also, removed comment about wrong code in the Mac port. + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::commitDocumentData): + 2010-09-08 Darin Adler <darin@apple.com> Reviewed by Adam Barth. @@ -53,13 +1011,22 @@ * src/WebKit.cpp: (WebKit::areLayoutTestImagesOpaque): Make linux match windows. +2010-09-10 Jay Civelli <jcivelli@chromium.org> + + Reviewed by Darin Fisher. + + Add the destructor to WebDOMEvent to prevent a leak. + https://bugs.webkit.org/show_bug.cgi?id=45287 + + * public/WebDOMEvent.h: + (WebKit::WebDOMEvent::~WebDOMEvent): + 2010-09-09 Chris Guillory <chris.guillory@google.com> Reviewed by Chris Fleizach. Add methods used to determine accessibility state. https://bugs.webkit.org/show_bug.cgi?id=45434 - * public/WebAccessibilityObject.h: * src/WebAccessibilityObject.cpp: diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS index 2fc218b..17cf7b5 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': '58277', + 'chromium_rev': '59961', } deps = { diff --git a/WebKit/chromium/WebKit.grd b/WebKit/chromium/WebKit.grd index 92ee008..3b7209a 100644 --- a/WebKit/chromium/WebKit.grd +++ b/WebKit/chromium/WebKit.grd @@ -9,7 +9,7 @@ </outputs> <release seq="1"> <includes> - <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="src\js\DebuggerScript.js" type="BINDATA"/> + <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="..\..\WebCore\bindings\v8\DebuggerScript.js" type="BINDATA"/> <include name="IDR_DEVTOOLS_INJECT_WEBKIT_JS" file="..\..\WebCore\inspector\front-end\InjectedScript.js" type="BINDATA"/> </includes> </release> diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp index 11246fa..3523f21 100644 --- a/WebKit/chromium/WebKit.gyp +++ b/WebKit/chromium/WebKit.gyp @@ -98,6 +98,7 @@ 'public/mac/WebSandboxSupport.h', 'public/mac/WebScreenInfoFactory.h', 'public/WebAccessibilityCache.h', + 'public/WebAccessibilityNotification.h', 'public/WebAccessibilityObject.h', 'public/WebAccessibilityRole.h', 'public/WebAnimationController.h', @@ -153,6 +154,8 @@ 'public/WebFileSystemCallbacks.h', 'public/WebFileSystemEntry.h', 'public/WebFileUtilities.h', + 'public/WebFileWriter.h', + 'public/WebFileWriterClient.h', 'public/WebFindOptions.h', 'public/WebFloatPoint.h', 'public/WebFloatRect.h', @@ -280,6 +283,8 @@ 'src/AssertMatchingEnums.cpp', 'src/AsyncFileSystemChromium.cpp', 'src/AsyncFileSystemChromium.h', + 'src/AsyncFileWriterChromium.cpp', + 'src/AsyncFileWriterChromium.h', 'src/AutoFillPopupMenuClient.cpp', 'src/AutoFillPopupMenuClient.h', 'src/BackForwardListClientImpl.cpp', @@ -322,6 +327,7 @@ 'src/GLES2ContextInternal.cpp', 'src/GLES2ContextInternal.h', 'src/GraphicsContext3D.cpp', + 'src/GraphicsContext3DInternal.h', 'src/gtk/WebFontInfo.cpp', 'src/gtk/WebFontInfo.h', 'src/gtk/WebInputEventFactory.cpp', @@ -781,7 +787,8 @@ 'dependencies': [ 'webkit', '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf', - '<(chromium_src_dir)/gfx/gfx.gyp:gfx', + '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob', + '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', ], 'include_dirs': [ '../../JavaScriptCore', @@ -801,6 +808,7 @@ 'webkit', '../../JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp:wtf_config', '<(chromium_src_dir)/third_party/icu/icu.gyp:icuuc', + '<(chromium_src_dir)/third_party/mesa/mesa.gyp:osmesa', '<(chromium_src_dir)/webkit/support/webkit_support.gyp:blob', '<(chromium_src_dir)/webkit/support/webkit_support.gyp:copy_npapi_layout_test_plugin', '<(chromium_src_dir)/webkit/support/webkit_support.gyp:webkit_support', diff --git a/WebKit/chromium/WebKit.gypi b/WebKit/chromium/WebKit.gypi index 4c6ac37..035015b 100644 --- a/WebKit/chromium/WebKit.gypi +++ b/WebKit/chromium/WebKit.gypi @@ -34,7 +34,6 @@ # for copying them to resource dir, and for generating 'devtools.html' file. 'devtools_js_files': [ 'src/js/DevTools.js', - 'src/js/DevToolsHostStub.js', 'src/js/Tests.js', ], 'devtools_css_files': [ diff --git a/WebKit/chromium/public/WebAccessibilityNotification.h b/WebKit/chromium/public/WebAccessibilityNotification.h new file mode 100644 index 0000000..c4a9551 --- /dev/null +++ b/WebKit/chromium/public/WebAccessibilityNotification.h @@ -0,0 +1,57 @@ +/* + * 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 WebAccessibilityNotification_h +#define WebAccessibilityNotification_h + +namespace WebKit { + +enum WebAccessibilityNotification { + WebAccessibilityNotificationActiveDescendantChanged, + WebAccessibilityNotificationCheckedStateChanged, + WebAccessibilityNotificationChildrenChanged, + WebAccessibilityNotificationFocusedUIElementChanged, + WebAccessibilityNotificationLayoutComplete, + WebAccessibilityNotificationLoadComplete, + WebAccessibilityNotificationSelectedChildrenChanged, + WebAccessibilityNotificationSelectedTextChanged, + WebAccessibilityNotificationValueChanged, + WebAccessibilityNotificationScrolledToAnchor, + WebAccessibilityNotificationLiveRegionChanged, + WebAccessibilityNotificationMenuListValueChanged, + WebAccessibilityNotificationRowCountChanged, + WebAccessibilityNotificationRowCollapsed, + WebAccessibilityNotificationRowExpanded, + WebAccessibilityNotificationInvalid +}; + +} // namespace WebKit + +#endif // WebAccessibilityNotification_h diff --git a/WebKit/chromium/public/WebAccessibilityObject.h b/WebKit/chromium/public/WebAccessibilityObject.h index 6b55376..f7c93f2 100644 --- a/WebKit/chromium/public/WebAccessibilityObject.h +++ b/WebKit/chromium/public/WebAccessibilityObject.h @@ -70,6 +70,7 @@ public: WEBKIT_API WebString actionVerb() const; WEBKIT_API bool canSetFocusAttribute() const; WEBKIT_API bool canSetValueAttribute() const; + WEBKIT_API bool isValid() const; WEBKIT_API unsigned childCount() const; diff --git a/WebKit/chromium/public/WebDOMEvent.h b/WebKit/chromium/public/WebDOMEvent.h index d34c8d4..fa02b0c 100644 --- a/WebKit/chromium/public/WebDOMEvent.h +++ b/WebKit/chromium/public/WebDOMEvent.h @@ -50,6 +50,8 @@ public: BubblingPhase = 3 }; + ~WebDOMEvent() { reset(); } + WebDOMEvent() : m_private(0) { } WebDOMEvent(const WebDOMEvent& e) : m_private(0) { assign(e); } WebDOMEvent& operator=(const WebDOMEvent& e) diff --git a/WebKit/chromium/public/WebDataSource.h b/WebKit/chromium/public/WebDataSource.h index 1aa7a98..1a8c270 100644 --- a/WebKit/chromium/public/WebDataSource.h +++ b/WebKit/chromium/public/WebDataSource.h @@ -95,6 +95,10 @@ public: // The application cache host associated with this datasource. virtual WebApplicationCacheHost* applicationCacheHost() = 0; + // Set deferMainResourceDataLoad flag on the loader. This is used for + // testing. + virtual void setDeferMainResourceDataLoad(bool) = 0; + protected: ~WebDataSource() { } }; diff --git a/WebKit/chromium/public/WebDeviceOrientationClientMock.h b/WebKit/chromium/public/WebDeviceOrientationClientMock.h index 9cbccf7..7fae792 100644 --- a/WebKit/chromium/public/WebDeviceOrientationClientMock.h +++ b/WebKit/chromium/public/WebDeviceOrientationClientMock.h @@ -36,7 +36,7 @@ namespace WebKit { class WebDeviceOrientationClientMock : public WebDeviceOrientationClient { public: - WebDeviceOrientationClientMock() { initialize(); } + WEBKIT_API static WebDeviceOrientationClientMock* create(); ~WebDeviceOrientationClientMock() { reset(); } virtual void setController(WebDeviceOrientationController*); @@ -47,6 +47,7 @@ public: WEBKIT_API void setOrientation(WebDeviceOrientation&); private: + WebDeviceOrientationClientMock() { initialize(); } WEBKIT_API void initialize(); WEBKIT_API void reset(); diff --git a/WebKit/chromium/public/WebFileSystem.h b/WebKit/chromium/public/WebFileSystem.h index 641c169..b21235d 100644 --- a/WebKit/chromium/public/WebFileSystem.h +++ b/WebKit/chromium/public/WebFileSystem.h @@ -37,6 +37,8 @@ namespace WebKit { class WebFileSystemCallbacks; +class WebFileWriter; +class WebFileWriterClient; class WebFileSystem { public: @@ -100,6 +102,10 @@ public: // WebFileSystemCallbacks::didFail() must be called otherwise. virtual void readDirectory(const WebString& path, WebFileSystemCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + // Creates a WebFileWriter that can be used to write to the given file. + // This is a fast, synchronous call, and should not stat the filesystem. + virtual WebFileWriter* createFileWriter(const WebString& path, WebFileWriterClient*) { WEBKIT_ASSERT_NOT_REACHED(); return 0; } + protected: virtual ~WebFileSystem() { } }; diff --git a/WebKit/chromium/public/WebFileWriter.h b/WebKit/chromium/public/WebFileWriter.h new file mode 100644 index 0000000..9cde098 --- /dev/null +++ b/WebKit/chromium/public/WebFileWriter.h @@ -0,0 +1,57 @@ +/* + * 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 WebFileWriter_h +#define WebFileWriter_h + +#include "WebCommon.h" +#include "WebString.h" + +namespace WebKit { + +class WebURL; + +class WebFileWriter { +public: + virtual ~WebFileWriter() { } + + // Only one write or one truncate operation can be in progress at a time. + // These functions are asynchronous and will report results through the WebFileWriter's associated WebFileWriterClient. + virtual void write(long long position, const WebURL& blobURL) = 0; + virtual void truncate(long long length) = 0; + + // Cancel will attempt to abort a running write or truncate. However, it may not be possible to cancel an in-progress action, or the call may have come in too late. Partial writes are possible. + // Do not call cancel when there is no write or truncate in progress. + virtual void cancel() = 0; +}; + +} // namespace WebKit + +#endif diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/public/WebFileWriterClient.h index d3333e2..d371582 100644 --- a/WebKit/chromium/src/js/DevToolsHostStub.js +++ b/WebKit/chromium/public/WebFileWriterClient.h @@ -28,11 +28,30 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/** - * @fileoverview These stubs emulate backend functionality and allows - * DevTools frontend to function as a standalone web app. - */ +#ifndef WebFileWriterClient_h +#define WebFileWriterClient_h + +#include "WebCommon.h" +#include "WebFileError.h" + +namespace WebKit { + +class WebFileWriterClient { +public: + // Called for each chunk of a write, to indicate progress. + // On the final chunk, when the write is finished, complete will be true. + virtual void didWrite(long long bytes, bool complete) = 0; + + // Called once when the truncate completes successfully. + virtual void didTruncate(long long length) = 0; + + // Called if the write or truncate fails, or if it is cancelled before the write or truncate completes. Completion of an operation will be signalled exactly once, either by didFail, didTruncate, or didWrite(..., true). + virtual void didFail(WebFileError) = 0; + +protected: + virtual ~WebFileWriterClient() { } +}; + +} // namespace WebKit -if (!window["RemoteDebuggerCommandExecutor"]) { - window["RemoteDebuggerCommandExecutor"] = {}; -} +#endif diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h index d8eca6a..6725f58 100644 --- a/WebKit/chromium/public/WebFrame.h +++ b/WebKit/chromium/public/WebFrame.h @@ -533,6 +533,9 @@ public: // empty ((0,0), (0,0)). virtual WebRect selectionBoundsRect() const = 0; + // Only for testing purpose: + // Returns true if selection.anchorNode has a marker on range from |from| with |length|. + virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const = 0; protected: ~WebFrame() { } }; diff --git a/WebKit/chromium/public/WebGeolocationService.h b/WebKit/chromium/public/WebGeolocationService.h index ed8c4e8..ea91b58 100644 --- a/WebKit/chromium/public/WebGeolocationService.h +++ b/WebKit/chromium/public/WebGeolocationService.h @@ -31,10 +31,9 @@ #ifndef WebGeolocationService_h #define WebGeolocationService_h -#include "WebGeolocationServiceBridge.h" - namespace WebKit { +class WebGeolocationServiceBridge; class WebString; class WebURL; @@ -50,10 +49,14 @@ public: // Attaches the WebGeolocationServiceBridge to the embedder and returns its // id, which should be used on subsequent calls for the methods above. + // An ID of zero indicates the attach failed. virtual int attachBridge(WebGeolocationServiceBridge*) { return 0; } // Detaches the WebGeolocationServiceBridge from the embedder. virtual void detachBridge(int bridgeId) { } + +protected: + virtual ~WebGeolocationService() {} }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebGeolocationServiceBridge.h b/WebKit/chromium/public/WebGeolocationServiceBridge.h index 422b32b..d209c23 100644 --- a/WebKit/chromium/public/WebGeolocationServiceBridge.h +++ b/WebKit/chromium/public/WebGeolocationServiceBridge.h @@ -47,7 +47,11 @@ public: virtual void setIsAllowed(bool allowed) = 0; virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) = 0; virtual void setLastError(int errorCode, const WebString& message) = 0; - virtual void onWebGeolocationServiceDestroyed() = 0; + // Called when the WebGeolocationService to which this bridge is attached is going out of scope. On receiving + // this call the bridge implementation must not make any further access to the service. + virtual void didDestroyGeolocationService() = 0; + // FIXME: Remove this badly named method when all callers are using didDestroyGeolocationService directly. + void onWebGeolocationServiceDestroyed() { didDestroyGeolocationService(); } protected: virtual ~WebGeolocationServiceBridge() {} diff --git a/WebKit/chromium/public/WebGeolocationServiceMock.h b/WebKit/chromium/public/WebGeolocationServiceMock.h index 407fe9d..820975e 100644 --- a/WebKit/chromium/public/WebGeolocationServiceMock.h +++ b/WebKit/chromium/public/WebGeolocationServiceMock.h @@ -44,9 +44,6 @@ public: WEBKIT_API static void setMockGeolocationPermission(bool allowed); WEBKIT_API static void setMockGeolocationPosition(double latitude, double longitude, double accuracy); WEBKIT_API static void setMockGeolocationError(int errorCode, const WebString& message); - -protected: - static bool s_mockGeolocationPermission; }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h index 44a0498..9857174 100644 --- a/WebKit/chromium/public/WebGraphicsContext3D.h +++ b/WebKit/chromium/public/WebGraphicsContext3D.h @@ -83,6 +83,11 @@ public: // Initializes the graphics context; should be the first operation performed // on newly-constructed instances. Returns true on success. + virtual bool initialize(Attributes, WebView*, bool renderDirectlyToWebView) = 0; + + // Initializes the graphics context; should be the first operation performed + // on newly-constructed instances. Returns true on success. + // FIXME: remove this entry point once the compositor is switched to use GraphicsContext3D. virtual bool initialize(Attributes, WebView*) = 0; // Makes the OpenGL context current on the current thread. Returns true on @@ -134,8 +139,20 @@ public: // getError in the order they were added. virtual void synthesizeGLError(unsigned long error) = 0; + // EXT_texture_format_BGRA8888 virtual bool supportsBGRA() = 0; + // GL_CHROMIUM_map_sub + virtual bool supportsMapSubCHROMIUM() = 0; + virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) = 0; + virtual void unmapBufferSubDataCHROMIUM(const void*) = 0; + virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) = 0; + virtual void unmapTexSubImage2DCHROMIUM(const void*) = 0; + + // GL_CHROMIUM_copy_texture_to_parent_texture + virtual bool supportsCopyTextureToParentTextureCHROMIUM() = 0; + virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture) = 0; + // The entry points below map directly to the OpenGL ES 2.0 API. // See: http://www.khronos.org/registry/gles/ // and: http://www.khronos.org/opengles/sdk/docs/man/ diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h index a2bb5cd..6e45bf6 100644 --- a/WebKit/chromium/public/WebHTTPBody.h +++ b/WebKit/chromium/public/WebHTTPBody.h @@ -54,7 +54,9 @@ public: WebString filePath; long long fileStart; long long fileLength; // -1 means to the end of the file. + // FIXME: remove this field once all users of Element have been switched to use 'modificationTime'. WebFileInfo fileInfo; + double modificationTime; WebURL blobURL; }; @@ -85,6 +87,8 @@ public: WEBKIT_API void appendData(const WebData&); WEBKIT_API void appendFile(const WebString&); // Passing -1 to fileLength means to the end of the file. + WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, double modificationTime); + // FIXME: Remove this method once all callers have been switched to use the method above. WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&); WEBKIT_API void appendBlob(const WebURL&); diff --git a/WebKit/chromium/public/WebIDBCursor.h b/WebKit/chromium/public/WebIDBCursor.h index 27eb924..f47a44c 100644 --- a/WebKit/chromium/public/WebIDBCursor.h +++ b/WebKit/chromium/public/WebIDBCursor.h @@ -44,33 +44,30 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return 0; } - virtual WebIDBKey key() const { WEBKIT_ASSERT_NOT_REACHED(); - return WebIDBKey(""); + return WebIDBKey::createInvalid(); } - + // FIXME: Remove the legacy version of value() (the first version) as soon as a WebKit roll happens. virtual WebSerializedScriptValue value() const { - WEBKIT_ASSERT_NOT_REACHED(); - return WebSerializedScriptValue(); - } - - virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*) - { - WEBKIT_ASSERT_NOT_REACHED(); + WebSerializedScriptValue serializedScriptValue; + WebIDBKey idbKey; + value(serializedScriptValue, idbKey); + WEBKIT_ASSERT(!serializedScriptValue.isNull()); + WEBKIT_ASSERT(idbKey.type() == WebIDBKey::InvalidType); + return serializedScriptValue; } - - virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*) + // One or the other will set, depending on what type of cursor this is. + virtual void value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const { - WEBKIT_ASSERT_NOT_REACHED(); + serializedScriptValue = value(); } - virtual void remove(WebIDBCallbacks*) - { - WEBKIT_ASSERT_NOT_REACHED(); - } + virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void remove(WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h index 7c070a2..ab05b06 100755 --- a/WebKit/chromium/public/WebIDBFactory.h +++ b/WebKit/chromium/public/WebIDBFactory.h @@ -52,16 +52,14 @@ public: virtual ~WebIDBFactory() { } // The WebKit implementation of open ignores the WebFrame* parameter. - virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame) + virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir) { - int exceptionCode; - open(name, description, callbacks, origin, webFrame, exceptionCode); + open(name, description, callbacks, origin, webFrame); } // FIXME: Delete soon. Compatability hack. - virtual void open(const WebString& name, const WebString& description, - WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode) + virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame) { - open(name, description, callbacks, origin, webFrame); + open(name, description, callbacks, origin, webFrame, "/tmp/temporary-indexed-db-files"); } virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/WebKit/chromium/public/WebIDBIndex.h b/WebKit/chromium/public/WebIDBIndex.h index dafea0e..e03fc58 100644 --- a/WebKit/chromium/public/WebIDBIndex.h +++ b/WebKit/chromium/public/WebIDBIndex.h @@ -30,6 +30,10 @@ namespace WebKit { +class WebIDBCallbacks; +class WebIDBKey; +class WebIDBKeyRange; + // See comment in WebIndexedDatabase for a high level overview of these classes. class WebIDBIndex { public: @@ -40,6 +44,11 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return WebString(); } + virtual WebString storeName() const + { + WEBKIT_ASSERT_NOT_REACHED(); + return WebString(); + } virtual WebString keyPath() const { WEBKIT_ASSERT_NOT_REACHED(); @@ -50,6 +59,11 @@ public: WEBKIT_ASSERT_NOT_REACHED(); return false; } + + virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void getObject(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } + virtual void get(const WebIDBKey&, WebIDBCallbacks*) { WEBKIT_ASSERT_NOT_REACHED(); } }; } // namespace WebKit diff --git a/WebKit/chromium/public/WebIDBKey.h b/WebKit/chromium/public/WebIDBKey.h index 6aef332..60d3325 100644 --- a/WebKit/chromium/public/WebIDBKey.h +++ b/WebKit/chromium/public/WebIDBKey.h @@ -42,7 +42,7 @@ public: // Please use one of the factory methods. This is public only to allow WebVector. WebIDBKey() { } ~WebIDBKey() { reset(); } - + WEBKIT_API static WebIDBKey createNull(); WEBKIT_API static WebIDBKey createInvalid(); WEBKIT_API static WebIDBKey createFromValueAndKeyPath(const WebSerializedScriptValue&, const WebIDBKeyPath&); diff --git a/WebKit/chromium/public/WebInputElement.h b/WebKit/chromium/public/WebInputElement.h index ef3b577..3ef92de 100644 --- a/WebKit/chromium/public/WebInputElement.h +++ b/WebKit/chromium/public/WebInputElement.h @@ -79,9 +79,17 @@ namespace WebKit { Week }; + // This returns true for all of textfield-looking types such as text, + // password, search, email, url, and number. + WEBKIT_API bool isTextField() const; + // This returns true only for type=text. + WEBKIT_API bool isText() const; + WEBKIT_API bool isPasswordField() const; + WEBKIT_API bool isImageButton() const; WEBKIT_API bool autoComplete() const; WEBKIT_API bool isReadOnly() const; WEBKIT_API bool isEnabledFormControl() const; + // Deperated. WEBKIT_API InputType inputType() const; WEBKIT_API int maxLength() const; WEBKIT_API bool isActivatedSubmit() const; diff --git a/WebKit/chromium/public/WebKit.h b/WebKit/chromium/public/WebKit.h index 5550db1..732cac6 100644 --- a/WebKit/chromium/public/WebKit.h +++ b/WebKit/chromium/public/WebKit.h @@ -55,11 +55,6 @@ WEBKIT_API WebKitClient* webKitClient(); WEBKIT_API void setLayoutTestMode(bool); WEBKIT_API bool layoutTestMode(); -// This is a temporary flag while we try to get Linux to match Windows' -// checksum computation. It specifies whether or not the baseline images -// should be opaque or not. -WEBKIT_API bool areLayoutTestImagesOpaque(); - // Enables the named log channel. See WebCore/platform/Logging.h for details. WEBKIT_API void enableLogChannel(const char*); diff --git a/WebKit/chromium/public/WebURLLoaderClient.h b/WebKit/chromium/public/WebURLLoaderClient.h index c716e5d..7614ea3 100644 --- a/WebKit/chromium/public/WebURLLoaderClient.h +++ b/WebKit/chromium/public/WebURLLoaderClient.h @@ -64,7 +64,10 @@ public: virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) { } // Called when the load completes successfully. - virtual void didFinishLoading(WebURLLoader*) { } + virtual void didFinishLoading(WebURLLoader*, double finishTime) { } + + // FIXME: remove this once clients are updated. + virtual void didFinishLoading(WebURLLoader* loader) { didFinishLoading(loader, 0); } // Called when the load completes with an error. virtual void didFail(WebURLLoader*, const WebURLError&) { } diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h index 1b94da2..d162f26 100644 --- a/WebKit/chromium/public/WebView.h +++ b/WebKit/chromium/public/WebView.h @@ -45,6 +45,7 @@ class WebDragData; class WebFrame; class WebFrameClient; class WebGLES2Context; +class WebGraphicsContext3D; class WebNode; class WebSettings; class WebString; @@ -109,6 +110,9 @@ public: virtual bool isActive() const = 0; virtual void setIsActive(bool) = 0; + // Allows disabling domain relaxation. + virtual void setDomainRelaxationForbidden(bool, const WebString& scheme) = 0; + // Closing ------------------------------------------------------------- @@ -339,8 +343,17 @@ public: // Returns the GLES2Context associated with this WebView. One will be // created if it doesn't already exist. + // FIXME: remove this method once the compositor is fully switched + // over to GraphicsContext3D. virtual WebGLES2Context* gles2Context() = 0; + // Returns the (on-screen) WebGraphicsContext3D associated with + // this WebView. One will be created if it doesn't already exist. + // This is used to set up sharing between this context (which is + // that used by the compositor) and contexts for WebGL and other + // APIs. + virtual WebGraphicsContext3D* graphicsContext3D() = 0; + protected: ~WebView() {} }; diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h index 5c9a79b..f686419 100644 --- a/WebKit/chromium/public/WebViewClient.h +++ b/WebKit/chromium/public/WebViewClient.h @@ -31,6 +31,7 @@ #ifndef WebViewClient_h #define WebViewClient_h +#include "WebAccessibilityNotification.h" #include "WebDragOperation.h" #include "WebEditingAction.h" #include "WebFileChooserCompletion.h" @@ -280,6 +281,9 @@ public: // Notifies embedder that the children of an accessibility object has changed. virtual void didChangeAccessibilityObjectChildren(const WebAccessibilityObject&) { } + + // Notifies embedder about an accessibility notification. + virtual void postAccessibilityNotification(const WebAccessibilityObject&, WebAccessibilityNotification) { } // Developer tools ----------------------------------------------------- diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h index 5c9f54e..d010270 100644 --- a/WebKit/chromium/public/WebWidget.h +++ b/WebKit/chromium/public/WebWidget.h @@ -60,13 +60,26 @@ public: // and it may result in calls to WebWidgetClient::didInvalidateRect. virtual void layout() = 0; - // Called to paint the specified region of the WebWidget onto the given - // canvas. You MUST call Layout before calling this method. It is - // okay to call paint multiple times once layout has been called, - // assuming no other changes are made to the WebWidget (e.g., once - // events are processed, it should be assumed that another call to - // layout is warranted before painting again). - virtual void paint(WebCanvas*, const WebRect&) = 0; + // Called to paint the rectangular region within the WebWidget + // onto the specified canvas at (viewPort.x,viewPort.y). You MUST call + // Layout before calling this method. It is okay to call paint + // multiple times once layout has been called, assuming no other + // changes are made to the WebWidget (e.g., once events are + // processed, it should be assumed that another call to layout is + // warranted before painting again). + virtual void paint(WebCanvas*, const WebRect& viewPort) = 0; + + // Triggers compositing of the current layers onto the screen. + // The finish argument controls whether the compositor will wait for the + // GPU to finish rendering before returning. You MUST call Layout + // before calling this method, for the same reasons described in + // the paint method above. + virtual void composite(bool finish) = 0; + + // Called to inform the WebWidget of a change in theme. + // Implementors that cache rendered copies of widgets need to re-render + // on receiving this message + virtual void themeChanged() = 0; // Called to inform the WebWidget of an input event. Returns true if // the event has been processed, false otherwise. diff --git a/WebKit/chromium/public/WebWidgetClient.h b/WebKit/chromium/public/WebWidgetClient.h index bd7bd6a..9bd553f 100644 --- a/WebKit/chromium/public/WebWidgetClient.h +++ b/WebKit/chromium/public/WebWidgetClient.h @@ -50,6 +50,9 @@ public: // scrolled by the specified dx and dy amounts. virtual void didScrollRect(int dx, int dy, const WebRect& clipRect) { } + // Called when a call to WebWidget::composite is required + virtual void scheduleComposite() { } + // Called when the widget acquires or loses focus, respectively. virtual void didFocus() { } virtual void didBlur() { } diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.cpp b/WebKit/chromium/src/AsyncFileWriterChromium.cpp new file mode 100644 index 0000000..4bfc988 --- /dev/null +++ b/WebKit/chromium/src/AsyncFileWriterChromium.cpp @@ -0,0 +1,92 @@ +/* + * 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 "AsyncFileWriterChromium.h" + +#if ENABLE(FILE_SYSTEM) + +#include "Blob.h" +#include "FileWriterClient.h" +#include "WebFileWriter.h" +#include "WebURL.h" + +using namespace WebCore; + +namespace WebKit { + +AsyncFileWriterChromium::AsyncFileWriterChromium(FileWriterClient* client) + : m_client(client) +{ +} + +void AsyncFileWriterChromium::setWebFileWriter(WebFileWriter* writer) +{ + ASSERT(!m_writer); + m_writer = writer; +} + +void AsyncFileWriterChromium::write(long long position, Blob* data) +{ + ASSERT(m_writer); + m_writer->write(position, WebURL(data->url())); +} + +void AsyncFileWriterChromium::truncate(long long length) +{ + ASSERT(m_writer); + m_writer->truncate(length); +} + +void AsyncFileWriterChromium::abort() +{ + ASSERT(m_writer); + m_writer->cancel(); +} + +void AsyncFileWriterChromium::didWrite(long long bytes, bool complete) +{ + ASSERT(m_writer); + m_client->didWrite(bytes, complete); +} + +void AsyncFileWriterChromium::didTruncate(long long length) +{ + m_client->didTruncate(length); +} + +void AsyncFileWriterChromium::didFail(WebFileError error) +{ + m_client->didFail(error); +} + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) diff --git a/WebKit/chromium/src/AsyncFileWriterChromium.h b/WebKit/chromium/src/AsyncFileWriterChromium.h new file mode 100644 index 0000000..92743ca --- /dev/null +++ b/WebKit/chromium/src/AsyncFileWriterChromium.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 AsyncFileWriterChromium_h +#define AsyncFileWriterChromium_h + +#if ENABLE(FILE_SYSTEM) + +#include "AsyncFileWriter.h" +#include "WebFileError.h" +#include "WebFileWriterClient.h" + +namespace WebCore { +class Blob; +class FileWriterClient; +} + +namespace WebKit { + +class WebFileWriter; + +class AsyncFileWriterChromium : public WebCore::AsyncFileWriter, public WebFileWriterClient { +public: + AsyncFileWriterChromium(WebCore::FileWriterClient* client); + + void setWebFileWriter(WebFileWriter* writer); + + // FileWriter + virtual void write(long long position, WebCore::Blob* data); + virtual void truncate(long long length); + virtual void abort(); + + // WebFileWriterClient + virtual void didWrite(long long bytes, bool complete); + virtual void didTruncate(long long length); + virtual void didFail(WebFileError); + +private: + OwnPtr<WebFileWriter> m_writer; + WebCore::FileWriterClient* m_client; +}; + +} // namespace + +#endif // ENABLE(FILE_SYSTEM) + +#endif // AsyncFileWriterChromium_h diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp index 8a3eda6..8c13cbb 100644 --- a/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/WebKit/chromium/src/ChromeClientImpl.cpp @@ -56,11 +56,10 @@ #include "NotificationPresenterImpl.h" #include "Page.h" #include "PopupMenuChromium.h" -#include "SearchPopupMenuChromium.h" #include "ScriptController.h" +#include "SearchPopupMenuChromium.h" #include "SecurityOrigin.h" #include "SharedGraphicsContext3D.h" -#include "WebGeolocationService.h" #if USE(V8) #include "V8Proxy.h" #endif @@ -70,6 +69,7 @@ #include "WebFileChooserCompletionImpl.h" #include "WebFrameClient.h" #include "WebFrameImpl.h" +#include "WebGeolocationService.h" #include "WebInputEvent.h" #include "WebKit.h" #include "WebNode.h" @@ -103,6 +103,46 @@ static WebPopupType convertPopupType(PopupContainer::PopupType type) } } +// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAccessibilityNotification +static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache::AXNotification notification) +{ + switch (notification) { + case AXObjectCache::AXActiveDescendantChanged: + return WebAccessibilityNotificationActiveDescendantChanged; + case AXObjectCache::AXCheckedStateChanged: + return WebAccessibilityNotificationCheckedStateChanged; + case AXObjectCache::AXChildrenChanged: + return WebAccessibilityNotificationChildrenChanged; + case AXObjectCache::AXFocusedUIElementChanged: + return WebAccessibilityNotificationFocusedUIElementChanged; + case AXObjectCache::AXLayoutComplete: + return WebAccessibilityNotificationLayoutComplete; + case AXObjectCache::AXLoadComplete: + return WebAccessibilityNotificationLoadComplete; + case AXObjectCache::AXSelectedChildrenChanged: + return WebAccessibilityNotificationSelectedChildrenChanged; + case AXObjectCache::AXSelectedTextChanged: + return WebAccessibilityNotificationSelectedTextChanged; + case AXObjectCache::AXValueChanged: + return WebAccessibilityNotificationValueChanged; + case AXObjectCache::AXScrolledToAnchor: + return WebAccessibilityNotificationScrolledToAnchor; + case AXObjectCache::AXLiveRegionChanged: + return WebAccessibilityNotificationLiveRegionChanged; + case AXObjectCache::AXMenuListValueChanged: + return WebAccessibilityNotificationMenuListValueChanged; + case AXObjectCache::AXRowCountChanged: + return WebAccessibilityNotificationRowCountChanged; + case AXObjectCache::AXRowCollapsed: + return WebAccessibilityNotificationRowCollapsed; + case AXObjectCache::AXRowExpanded: + return WebAccessibilityNotificationRowExpanded; + default: + ASSERT_NOT_REACHED(); + return WebAccessibilityNotificationInvalid; + } +} + ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView) : m_webView(webView) , m_toolbarsVisible(true) @@ -343,9 +383,9 @@ bool ChromeClientImpl::statusbarVisible() void ChromeClientImpl::setScrollbarsVisible(bool value) { m_scrollbarsVisible = value; - WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); - if (web_frame) - web_frame->setCanHaveScrollbars(value); + WebFrameImpl* webFrame = static_cast<WebFrameImpl*>(m_webView->mainFrame()); + if (webFrame) + webFrame->setCanHaveScrollbars(value); } bool ChromeClientImpl::scrollbarsVisible() @@ -493,8 +533,15 @@ void ChromeClientImpl::invalidateContentsAndWindow(const IntRect& updateRect, bo { if (updateRect.isEmpty()) return; - if (m_webView->client()) - m_webView->client()->didInvalidateRect(updateRect); +#if USE(ACCELERATED_COMPOSITING) + if (!m_webView->isAcceleratedCompositingActive()) { +#endif + if (m_webView->client()) + m_webView->client()->didInvalidateRect(updateRect); +#if USE(ACCELERATED_COMPOSITING) + } else + m_webView->invalidateRootLayerRect(updateRect); +#endif } void ChromeClientImpl::invalidateContentsForSlowScroll(const IntRect& updateRect, bool immediate) @@ -508,11 +555,18 @@ void ChromeClientImpl::scroll( const IntRect& clipRect) { m_webView->hidePopups(); - if (m_webView->client()) { - int dx = scrollDelta.width(); - int dy = scrollDelta.height(); - m_webView->client()->didScrollRect(dx, dy, clipRect); - } +#if USE(ACCELERATED_COMPOSITING) + if (!m_webView->isAcceleratedCompositingActive()) { +#endif + if (m_webView->client()) { + int dx = scrollDelta.width(); + int dy = scrollDelta.height(); + m_webView->client()->didScrollRect(dx, dy, clipRect); + } +#if USE(ACCELERATED_COMPOSITING) + } else + m_webView->scrollRootLayerRect(scrollDelta, clipRect); +#endif } IntPoint ChromeClientImpl::screenToWindow(const IntPoint&) const @@ -720,6 +774,13 @@ void ChromeClientImpl::didChangeAccessibilityObjectChildren(WebCore::Accessibili m_webView->client()->didChangeAccessibilityObjectChildren(WebAccessibilityObject(obj)); } +void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification) +{ + // Alert assistive technology about the accessibility object notification. + if (obj) + m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification)); +} + #if ENABLE(NOTIFICATIONS) NotificationPresenter* ChromeClientImpl::notificationPresenter() const { diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h index d16d8f6..fbaac87 100644 --- a/WebKit/chromium/src/ChromeClientImpl.h +++ b/WebKit/chromium/src/ChromeClientImpl.h @@ -168,6 +168,7 @@ public: virtual void popupClosed(WebCore::PopupContainer* popupContainer); virtual void didChangeAccessibilityObjectState(WebCore::AccessibilityObject*); virtual void didChangeAccessibilityObjectChildren(WebCore::AccessibilityObject*); + virtual void postAccessibilityNotification(WebCore::AccessibilityObject*, WebCore::AXObjectCache::AXNotification); // ChromeClientImpl: void setCursor(const WebCursorInfo& cursor); diff --git a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp index 4081db6..6f952f7 100644 --- a/WebKit/chromium/src/DOMUtilitiesPrivate.cpp +++ b/WebKit/chromium/src/DOMUtilitiesPrivate.cpp @@ -97,7 +97,7 @@ bool elementHasLegalLinkAttribute(const Element* element, if (element->hasTagName(HTMLNames::inputTag)) { const HTMLInputElement* input = static_cast<const HTMLInputElement*>(element); - if (input->inputType() == HTMLInputElement::IMAGE) + if (input->isImageButton()) return true; } } else if (attrName == HTMLNames::hrefAttr) { diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp index ea668c7..61d43df 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1053,8 +1053,7 @@ void FrameLoaderClientImpl::committedLoad(DocumentLoader* loader, const char* da // If we are sending data to MediaDocument, we should stop here // and cancel the request. - if (m_webFrame->frame()->document() - && m_webFrame->frame()->document()->isMediaDocument()) + if (m_webFrame->frame()->document()->isMediaDocument()) loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response())); // The plugin widget could have been created in the m_webFrame->DidReceiveData @@ -1207,6 +1206,12 @@ bool FrameLoaderClientImpl::canHandleRequest(const ResourceRequest& request) con m_webFrame, WrappedResourceRequest(request)); } +bool FrameLoaderClientImpl::canShowMIMETypeAsHTML(const String& MIMEType) const +{ + notImplemented(); + return false; +} + bool FrameLoaderClientImpl::canShowMIMEType(const String& mimeType) const { // This method is called to determine if the media type can be shown @@ -1398,12 +1403,12 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createPlugin( if (!webPlugin->initialize(container.get())) return 0; - if (m_webFrame->frame()->view()->zoomFactor() != 1) { + bool zoomTextOnly = m_webFrame->viewImpl()->zoomTextOnly(); + float zoomFactor = zoomTextOnly ? m_webFrame->frame()->textZoomFactor() : m_webFrame->frame()->pageZoomFactor(); + if (zoomFactor != 1) { // There's a saved zoom level, so tell the plugin about it since // WebViewImpl::setZoomLevel was called before the plugin was created. - webPlugin->setZoomFactor( - m_webFrame->frame()->view()->zoomFactor(), - m_webFrame->frame()->page()->settings()->zoomMode() == ZoomTextOnly); + webPlugin->setZoomFactor(zoomFactor, zoomTextOnly); } // The element might have been removed during plugin initialization! diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.h b/WebKit/chromium/src/FrameLoaderClientImpl.h index 361bae4..57105de 100644 --- a/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -149,6 +149,7 @@ public: virtual bool shouldFallBack(const WebCore::ResourceError&); virtual bool canHandleRequest(const WebCore::ResourceRequest&) const; virtual bool canShowMIMEType(const WTF::String& MIMEType) const; + virtual bool canShowMIMETypeAsHTML(const String& MIMEType) const; virtual bool representationExistsForURLScheme(const WTF::String& URLScheme) const; virtual WTF::String generatedMIMETypeForURLScheme(const WTF::String& URLScheme) const; virtual void frameLoadCompleted(); diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp index 3051b9b..c78d334 100644 --- a/WebKit/chromium/src/GraphicsContext3D.cpp +++ b/WebKit/chromium/src/GraphicsContext3D.cpp @@ -39,6 +39,7 @@ #include "CanvasRenderingContext.h" #include "Chrome.h" #include "ChromeClientImpl.h" +#include "GraphicsContext3DInternal.h" #include "HTMLCanvasElement.h" #include "HTMLImageElement.h" #include "ImageBuffer.h" @@ -60,8 +61,6 @@ #include <CoreGraphics/CGImage.h> #endif -// using namespace std; - // There are two levels of delegation in this file: // // 1. GraphicsContext3D delegates to GraphicsContext3DInternal. This is done @@ -82,239 +81,6 @@ namespace WebCore { //---------------------------------------------------------------------- // GraphicsContext3DInternal -class GraphicsContext3DInternal { -public: - GraphicsContext3DInternal(); - ~GraphicsContext3DInternal(); - - bool initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow); - - PlatformGraphicsContext3D platformGraphicsContext3D() const; - Platform3DObject platformTexture() const; - - bool makeContextCurrent(); - - int sizeInBytes(int type); - - void reshape(int width, int height); - - void paintRenderingResultsToCanvas(CanvasRenderingContext* context); - bool paintsIntoCanvasBuffer() const; - - void prepareTexture(); - -#if USE(ACCELERATED_COMPOSITING) - WebGLLayerChromium* platformLayer() const; -#endif - bool isGLES2Compliant() const; - bool isGLES2NPOTStrict() const; - bool isErrorGeneratedOnOutOfBoundsAccesses() const; - - //---------------------------------------------------------------------- - // Entry points for WebGL. - // - void activeTexture(unsigned long texture); - void attachShader(Platform3DObject program, Platform3DObject shader); - void bindAttribLocation(Platform3DObject, unsigned long index, const String& name); - void bindBuffer(unsigned long target, Platform3DObject); - void bindFramebuffer(unsigned long target, Platform3DObject); - void bindRenderbuffer(unsigned long target, Platform3DObject); - void bindTexture(unsigned long target, Platform3DObject texture); - void blendColor(double red, double green, double blue, double alpha); - void blendEquation(unsigned long mode); - void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha); - void blendFunc(unsigned long sfactor, unsigned long dfactor); - void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha); - - void bufferData(unsigned long target, int size, unsigned long usage); - void bufferData(unsigned long target, int size, const void* data, unsigned long usage); - void bufferSubData(unsigned long target, long offset, int size, const void* data); - - unsigned long checkFramebufferStatus(unsigned long target); - void clear(unsigned long mask); - void clearColor(double red, double green, double blue, double alpha); - void clearDepth(double depth); - void clearStencil(long s); - void colorMask(bool red, bool green, bool blue, bool alpha); - void compileShader(Platform3DObject); - - void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border); - void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height); - void cullFace(unsigned long mode); - void depthFunc(unsigned long func); - void depthMask(bool flag); - void depthRange(double zNear, double zFar); - void detachShader(Platform3DObject, Platform3DObject); - void disable(unsigned long cap); - void disableVertexAttribArray(unsigned long index); - void drawArrays(unsigned long mode, long first, long count); - void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset); - - void enable(unsigned long cap); - void enableVertexAttribArray(unsigned long index); - void finish(); - void flush(); - void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject); - void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level); - void frontFace(unsigned long mode); - void generateMipmap(unsigned long target); - - bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&); - bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&); - - void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders); - - int getAttribLocation(Platform3DObject, const String& name); - - void getBooleanv(unsigned long pname, unsigned char* value); - - void getBufferParameteriv(unsigned long target, unsigned long pname, int* value); - - GraphicsContext3D::Attributes getContextAttributes(); - - unsigned long getError(); - - void getFloatv(unsigned long pname, float* value); - - void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value); - - void getIntegerv(unsigned long pname, int* value); - - void getProgramiv(Platform3DObject program, unsigned long pname, int* value); - - String getProgramInfoLog(Platform3DObject); - - void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value); - - void getShaderiv(Platform3DObject, unsigned long pname, int* value); - - String getShaderInfoLog(Platform3DObject); - - String getShaderSource(Platform3DObject); - String getString(unsigned long name); - - void getTexParameterfv(unsigned long target, unsigned long pname, float* value); - void getTexParameteriv(unsigned long target, unsigned long pname, int* value); - - void getUniformfv(Platform3DObject program, long location, float* value); - void getUniformiv(Platform3DObject program, long location, int* value); - - long getUniformLocation(Platform3DObject, const String& name); - - void getVertexAttribfv(unsigned long index, unsigned long pname, float* value); - void getVertexAttribiv(unsigned long index, unsigned long pname, int* value); - - long getVertexAttribOffset(unsigned long index, unsigned long pname); - - void hint(unsigned long target, unsigned long mode); - bool isBuffer(Platform3DObject); - bool isEnabled(unsigned long cap); - bool isFramebuffer(Platform3DObject); - bool isProgram(Platform3DObject); - bool isRenderbuffer(Platform3DObject); - bool isShader(Platform3DObject); - bool isTexture(Platform3DObject); - void lineWidth(double); - void linkProgram(Platform3DObject); - void pixelStorei(unsigned long pname, long param); - void polygonOffset(double factor, double units); - - void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data); - - void releaseShaderCompiler(); - void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height); - void sampleCoverage(double value, bool invert); - void scissor(long x, long y, unsigned long width, unsigned long height); - void shaderSource(Platform3DObject, const String& string); - void stencilFunc(unsigned long func, long ref, unsigned long mask); - void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask); - void stencilMask(unsigned long mask); - void stencilMaskSeparate(unsigned long face, unsigned long mask); - void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass); - void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass); - - // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode. - // Currently they return -1 on any error. - int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels); - - void texParameterf(unsigned target, unsigned pname, float param); - void texParameteri(unsigned target, unsigned pname, int param); - - int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels); - - void uniform1f(long location, float x); - void uniform1fv(long location, float* v, int size); - void uniform1i(long location, int x); - void uniform1iv(long location, int* v, int size); - void uniform2f(long location, float x, float y); - void uniform2fv(long location, float* v, int size); - void uniform2i(long location, int x, int y); - void uniform2iv(long location, int* v, int size); - void uniform3f(long location, float x, float y, float z); - void uniform3fv(long location, float* v, int size); - void uniform3i(long location, int x, int y, int z); - void uniform3iv(long location, int* v, int size); - void uniform4f(long location, float x, float y, float z, float w); - void uniform4fv(long location, float* v, int size); - void uniform4i(long location, int x, int y, int z, int w); - void uniform4iv(long location, int* v, int size); - void uniformMatrix2fv(long location, bool transpose, float* value, int size); - void uniformMatrix3fv(long location, bool transpose, float* value, int size); - void uniformMatrix4fv(long location, bool transpose, float* value, int size); - - void useProgram(Platform3DObject); - void validateProgram(Platform3DObject); - - void vertexAttrib1f(unsigned long indx, float x); - void vertexAttrib1fv(unsigned long indx, float* values); - void vertexAttrib2f(unsigned long indx, float x, float y); - void vertexAttrib2fv(unsigned long indx, float* values); - void vertexAttrib3f(unsigned long indx, float x, float y, float z); - void vertexAttrib3fv(unsigned long indx, float* values); - void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w); - void vertexAttrib4fv(unsigned long indx, float* values); - void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, - unsigned long stride, unsigned long offset); - - void viewport(long x, long y, unsigned long width, unsigned long height); - - unsigned createBuffer(); - unsigned createFramebuffer(); - unsigned createProgram(); - unsigned createRenderbuffer(); - unsigned createShader(unsigned long); - unsigned createTexture(); - - void deleteBuffer(unsigned); - void deleteFramebuffer(unsigned); - void deleteProgram(unsigned); - void deleteRenderbuffer(unsigned); - void deleteShader(unsigned); - void deleteTexture(unsigned); - - void synthesizeGLError(unsigned long error); - bool supportsBGRA(); - -private: - OwnPtr<WebKit::WebGraphicsContext3D> m_impl; - WebKit::WebViewImpl* m_webViewImpl; -#if USE(ACCELERATED_COMPOSITING) - RefPtr<WebGLLayerChromium> m_compositingLayer; -#endif -#if PLATFORM(SKIA) - // If the width and height of the Canvas's backing store don't - // match those that we were given in the most recent call to - // reshape(), then we need an intermediate bitmap to read back the - // frame buffer into. This seems to happen when CSS styles are - // used to resize the Canvas. - SkBitmap m_resizingBitmap; -#endif - -#if PLATFORM(CG) - unsigned char* m_renderOutput; -#endif -}; - GraphicsContext3DInternal::GraphicsContext3DInternal() : m_webViewImpl(0) #if PLATFORM(SKIA) @@ -334,8 +100,7 @@ GraphicsContext3DInternal::~GraphicsContext3DInternal() #endif } -bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, - HostWindow* hostWindow) +bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow) { WebKit::WebGraphicsContext3D::Attributes webAttributes; webAttributes.alpha = attrs.alpha; @@ -354,7 +119,7 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, if (!m_webViewImpl) return false; - if (!webContext->initialize(webAttributes, m_webViewImpl)) { + if (!webContext->initialize(webAttributes, m_webViewImpl, renderDirectlyToHostWindow)) { delete webContext; return false; } @@ -366,6 +131,13 @@ bool GraphicsContext3DInternal::initialize(GraphicsContext3D::Attributes attrs, return true; } +WebKit::WebGraphicsContext3D* GraphicsContext3DInternal::extractWebGraphicsContext3D(GraphicsContext3D* context) +{ + if (!context) + return 0; + return context->m_internal->m_impl.get(); +} + PlatformGraphicsContext3D GraphicsContext3DInternal::platformGraphicsContext3D() const { return m_impl.get(); @@ -528,6 +300,12 @@ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ m_impl->name(a1, a2, a3, a4); \ } +#define DELEGATE_TO_IMPL_4R(name, t1, t2, t3, t4, rt) \ +rt GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4) \ +{ \ + return m_impl->name(a1, a2, a3, a4); \ +} + #define DELEGATE_TO_IMPL_5(name, t1, t2, t3, t4, t5) \ void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \ { \ @@ -898,6 +676,13 @@ DELEGATE_TO_IMPL_1(deleteTexture, unsigned) DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long) DELEGATE_TO_IMPL_R(supportsBGRA, bool) +DELEGATE_TO_IMPL_R(supportsMapSubCHROMIUM, bool) +DELEGATE_TO_IMPL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*) +DELEGATE_TO_IMPL_1(unmapBufferSubDataCHROMIUM, const void*) +DELEGATE_TO_IMPL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*) +DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) +DELEGATE_TO_IMPL_R(supportsCopyTextureToParentTextureCHROMIUM, bool) +DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned) //---------------------------------------------------------------------- // GraphicsContext3D @@ -960,6 +745,12 @@ void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \ m_internal->name(a1, a2, a3, a4); \ } +#define DELEGATE_TO_INTERNAL_4R(name, t1, t2, t3, t4, rt) \ +rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4) \ +{ \ + return m_internal->name(a1, a2, a3, a4); \ +} + #define DELEGATE_TO_INTERNAL_5(name, t1, t2, t3, t4, t5) \ void GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5) \ { \ @@ -1002,7 +793,7 @@ rt GraphicsContext3D::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a return m_internal->name(a1, a2, a3, a4, a5, a6, a7, a8, a9); \ } -GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*) +GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes, HostWindow*, bool) { } @@ -1010,15 +801,14 @@ GraphicsContext3D::~GraphicsContext3D() { } -PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow) +PassOwnPtr<GraphicsContext3D> GraphicsContext3D::create(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, GraphicsContext3D::RenderStyle renderStyle) { - GraphicsContext3DInternal* internal = new GraphicsContext3DInternal(); - if (!internal->initialize(attrs, hostWindow)) { - delete internal; + OwnPtr<GraphicsContext3DInternal> internal = adoptPtr(new GraphicsContext3DInternal()); + if (!internal->initialize(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow)) { return 0; } - PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow); - result->m_internal.set(internal); + PassOwnPtr<GraphicsContext3D> result = new GraphicsContext3D(attrs, hostWindow, renderStyle == RenderDirectlyToHostWindow); + result->m_internal = internal.release(); return result; } @@ -1234,6 +1024,13 @@ DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned) DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long) DELEGATE_TO_INTERNAL_R(supportsBGRA, bool) +DELEGATE_TO_INTERNAL_R(supportsMapSubCHROMIUM, bool) +DELEGATE_TO_INTERNAL_4R(mapBufferSubDataCHROMIUM, unsigned, int, int, unsigned, void*) +DELEGATE_TO_INTERNAL_1(unmapBufferSubDataCHROMIUM, const void*) +DELEGATE_TO_INTERNAL_9R(mapTexSubImage2DCHROMIUM, unsigned, int, int, int, int, int, unsigned, unsigned, unsigned, void*) +DELEGATE_TO_INTERNAL_1(unmapTexSubImage2DCHROMIUM, const void*) +DELEGATE_TO_INTERNAL_R(supportsCopyTextureToParentTextureCHROMIUM, bool) +DELEGATE_TO_INTERNAL_2(copyTextureToParentTextureCHROMIUM, unsigned, unsigned) bool GraphicsContext3D::isGLES2Compliant() const { diff --git a/WebKit/chromium/src/GraphicsContext3DInternal.h b/WebKit/chromium/src/GraphicsContext3DInternal.h new file mode 100644 index 0000000..f12fff0 --- /dev/null +++ b/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -0,0 +1,301 @@ +/* + * Copyright (C) 2010 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef GraphicsContext3DInternal_h +#define GraphicsContext3DInternal_h + +#include "GraphicsContext3D.h" +#include <wtf/OwnPtr.h> +#if PLATFORM(SKIA) +#include "SkBitmap.h" +#endif + +namespace WebKit { +class WebGraphicsContext3D; +class WebViewImpl; +} // namespace WebKit + +namespace WebCore { + +#if USE(ACCELERATED_COMPOSITING) +class WebGLLayerChromium; +#endif + +class GraphicsContext3DInternal { +public: + GraphicsContext3DInternal(); + ~GraphicsContext3DInternal(); + + bool initialize(GraphicsContext3D::Attributes attrs, HostWindow* hostWindow, bool renderDirectlyToHostWindow); + + // Helper function to provide access to the lower-level WebGraphicsContext3D, + // which is needed for subordinate contexts like WebGL's to share resources + // with the compositor's context. + static WebKit::WebGraphicsContext3D* extractWebGraphicsContext3D(GraphicsContext3D* context); + + PlatformGraphicsContext3D platformGraphicsContext3D() const; + Platform3DObject platformTexture() const; + + bool makeContextCurrent(); + + int sizeInBytes(int type); + + void reshape(int width, int height); + + void paintRenderingResultsToCanvas(CanvasRenderingContext*); + bool paintsIntoCanvasBuffer() const; + + void prepareTexture(); + +#if USE(ACCELERATED_COMPOSITING) + WebGLLayerChromium* platformLayer() const; +#endif + bool isGLES2Compliant() const; + bool isGLES2NPOTStrict() const; + bool isErrorGeneratedOnOutOfBoundsAccesses() const; + + //---------------------------------------------------------------------- + // Entry points for WebGL. + // + void activeTexture(unsigned long texture); + void attachShader(Platform3DObject program, Platform3DObject shader); + void bindAttribLocation(Platform3DObject, unsigned long index, const String& name); + void bindBuffer(unsigned long target, Platform3DObject); + void bindFramebuffer(unsigned long target, Platform3DObject); + void bindRenderbuffer(unsigned long target, Platform3DObject); + void bindTexture(unsigned long target, Platform3DObject texture); + void blendColor(double red, double green, double blue, double alpha); + void blendEquation(unsigned long mode); + void blendEquationSeparate(unsigned long modeRGB, unsigned long modeAlpha); + void blendFunc(unsigned long sfactor, unsigned long dfactor); + void blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha); + + void bufferData(unsigned long target, int size, unsigned long usage); + void bufferData(unsigned long target, int size, const void* data, unsigned long usage); + void bufferSubData(unsigned long target, long offset, int size, const void* data); + + unsigned long checkFramebufferStatus(unsigned long target); + void clear(unsigned long mask); + void clearColor(double red, double green, double blue, double alpha); + void clearDepth(double depth); + void clearStencil(long s); + void colorMask(bool red, bool green, bool blue, bool alpha); + void compileShader(Platform3DObject); + + void copyTexImage2D(unsigned long target, long level, unsigned long internalformat, long x, long y, unsigned long width, unsigned long height, long border); + void copyTexSubImage2D(unsigned long target, long level, long xoffset, long yoffset, long x, long y, unsigned long width, unsigned long height); + void cullFace(unsigned long mode); + void depthFunc(unsigned long func); + void depthMask(bool flag); + void depthRange(double zNear, double zFar); + void detachShader(Platform3DObject, Platform3DObject); + void disable(unsigned long cap); + void disableVertexAttribArray(unsigned long index); + void drawArrays(unsigned long mode, long first, long count); + void drawElements(unsigned long mode, unsigned long count, unsigned long type, long offset); + + void enable(unsigned long cap); + void enableVertexAttribArray(unsigned long index); + void finish(); + void flush(); + void framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject); + void framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject, long level); + void frontFace(unsigned long mode); + void generateMipmap(unsigned long target); + + bool getActiveAttrib(Platform3DObject program, unsigned long index, ActiveInfo&); + bool getActiveUniform(Platform3DObject program, unsigned long index, ActiveInfo&); + + void getAttachedShaders(Platform3DObject program, int maxCount, int* count, unsigned int* shaders); + + int getAttribLocation(Platform3DObject, const String& name); + + void getBooleanv(unsigned long pname, unsigned char* value); + + void getBufferParameteriv(unsigned long target, unsigned long pname, int* value); + + GraphicsContext3D::Attributes getContextAttributes(); + + unsigned long getError(); + + void getFloatv(unsigned long pname, float* value); + + void getFramebufferAttachmentParameteriv(unsigned long target, unsigned long attachment, unsigned long pname, int* value); + + void getIntegerv(unsigned long pname, int* value); + + void getProgramiv(Platform3DObject program, unsigned long pname, int* value); + + String getProgramInfoLog(Platform3DObject); + + void getRenderbufferParameteriv(unsigned long target, unsigned long pname, int* value); + + void getShaderiv(Platform3DObject, unsigned long pname, int* value); + + String getShaderInfoLog(Platform3DObject); + + String getShaderSource(Platform3DObject); + String getString(unsigned long name); + + void getTexParameterfv(unsigned long target, unsigned long pname, float* value); + void getTexParameteriv(unsigned long target, unsigned long pname, int* value); + + void getUniformfv(Platform3DObject program, long location, float* value); + void getUniformiv(Platform3DObject program, long location, int* value); + + long getUniformLocation(Platform3DObject, const String& name); + + void getVertexAttribfv(unsigned long index, unsigned long pname, float* value); + void getVertexAttribiv(unsigned long index, unsigned long pname, int* value); + + long getVertexAttribOffset(unsigned long index, unsigned long pname); + + void hint(unsigned long target, unsigned long mode); + bool isBuffer(Platform3DObject); + bool isEnabled(unsigned long cap); + bool isFramebuffer(Platform3DObject); + bool isProgram(Platform3DObject); + bool isRenderbuffer(Platform3DObject); + bool isShader(Platform3DObject); + bool isTexture(Platform3DObject); + void lineWidth(double); + void linkProgram(Platform3DObject); + void pixelStorei(unsigned long pname, long param); + void polygonOffset(double factor, double units); + + void readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* data); + + void releaseShaderCompiler(); + void renderbufferStorage(unsigned long target, unsigned long internalformat, unsigned long width, unsigned long height); + void sampleCoverage(double value, bool invert); + void scissor(long x, long y, unsigned long width, unsigned long height); + void shaderSource(Platform3DObject, const String& string); + void stencilFunc(unsigned long func, long ref, unsigned long mask); + void stencilFuncSeparate(unsigned long face, unsigned long func, long ref, unsigned long mask); + void stencilMask(unsigned long mask); + void stencilMaskSeparate(unsigned long face, unsigned long mask); + void stencilOp(unsigned long fail, unsigned long zfail, unsigned long zpass); + void stencilOpSeparate(unsigned long face, unsigned long fail, unsigned long zfail, unsigned long zpass); + + // These next several functions return an error code (0 if no errors) rather than using an ExceptionCode. + // Currently they return -1 on any error. + int texImage2D(unsigned target, unsigned level, unsigned internalformat, unsigned width, unsigned height, unsigned border, unsigned format, unsigned type, void* pixels); + + void texParameterf(unsigned target, unsigned pname, float param); + void texParameteri(unsigned target, unsigned pname, int param); + + int texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset, unsigned width, unsigned height, unsigned format, unsigned type, void* pixels); + + void uniform1f(long location, float x); + void uniform1fv(long location, float* v, int size); + void uniform1i(long location, int x); + void uniform1iv(long location, int* v, int size); + void uniform2f(long location, float x, float y); + void uniform2fv(long location, float* v, int size); + void uniform2i(long location, int x, int y); + void uniform2iv(long location, int* v, int size); + void uniform3f(long location, float x, float y, float z); + void uniform3fv(long location, float* v, int size); + void uniform3i(long location, int x, int y, int z); + void uniform3iv(long location, int* v, int size); + void uniform4f(long location, float x, float y, float z, float w); + void uniform4fv(long location, float* v, int size); + void uniform4i(long location, int x, int y, int z, int w); + void uniform4iv(long location, int* v, int size); + void uniformMatrix2fv(long location, bool transpose, float* value, int size); + void uniformMatrix3fv(long location, bool transpose, float* value, int size); + void uniformMatrix4fv(long location, bool transpose, float* value, int size); + + void useProgram(Platform3DObject); + void validateProgram(Platform3DObject); + + void vertexAttrib1f(unsigned long indx, float x); + void vertexAttrib1fv(unsigned long indx, float* values); + void vertexAttrib2f(unsigned long indx, float x, float y); + void vertexAttrib2fv(unsigned long indx, float* values); + void vertexAttrib3f(unsigned long indx, float x, float y, float z); + void vertexAttrib3fv(unsigned long indx, float* values); + void vertexAttrib4f(unsigned long indx, float x, float y, float z, float w); + void vertexAttrib4fv(unsigned long indx, float* values); + void vertexAttribPointer(unsigned long indx, int size, int type, bool normalized, + unsigned long stride, unsigned long offset); + + void viewport(long x, long y, unsigned long width, unsigned long height); + + unsigned createBuffer(); + unsigned createFramebuffer(); + unsigned createProgram(); + unsigned createRenderbuffer(); + unsigned createShader(unsigned long); + unsigned createTexture(); + + void deleteBuffer(unsigned); + void deleteFramebuffer(unsigned); + void deleteProgram(unsigned); + void deleteRenderbuffer(unsigned); + void deleteShader(unsigned); + void deleteTexture(unsigned); + + void synthesizeGLError(unsigned long error); + + void swapBuffers(); + + // EXT_texture_format_BGRA8888 + bool supportsBGRA(); + + // GL_CHROMIUM_map_sub + bool supportsMapSubCHROMIUM(); + void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access); + void unmapBufferSubDataCHROMIUM(const void*); + void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access); + void unmapTexSubImage2DCHROMIUM(const void*); + + // GL_CHROMIUM_copy_texture_to_parent_texture + bool supportsCopyTextureToParentTextureCHROMIUM(); + void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture); + +private: + OwnPtr<WebKit::WebGraphicsContext3D> m_impl; + WebKit::WebViewImpl* m_webViewImpl; +#if USE(ACCELERATED_COMPOSITING) + RefPtr<WebGLLayerChromium> m_compositingLayer; +#endif +#if PLATFORM(SKIA) + // If the width and height of the Canvas's backing store don't + // match those that we were given in the most recent call to + // reshape(), then we need an intermediate bitmap to read back the + // frame buffer into. This seems to happen when CSS styles are + // used to resize the Canvas. + SkBitmap m_resizingBitmap; +#endif + +#if PLATFORM(CG) + unsigned char* m_renderOutput; +#endif +}; + +} // namespace WebCore + +#endif // GraphicsContext3D_h diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.cpp b/WebKit/chromium/src/IDBCursorBackendProxy.cpp index b4711eb..cf18917 100644 --- a/WebKit/chromium/src/IDBCursorBackendProxy.cpp +++ b/WebKit/chromium/src/IDBCursorBackendProxy.cpp @@ -30,9 +30,11 @@ #include "IDBAny.h" #include "IDBCallbacks.h" +#include "IDBKey.h" #include "SerializedScriptValue.h" #include "WebIDBCallbacksImpl.h" #include "WebIDBKey.h" +#include "WebSerializedScriptValue.h" namespace WebCore { @@ -60,9 +62,17 @@ PassRefPtr<IDBKey> IDBCursorBackendProxy::key() const return m_idbCursor->key(); } -PassRefPtr<SerializedScriptValue> IDBCursorBackendProxy::value() const +PassRefPtr<IDBAny> IDBCursorBackendProxy::value() const { - return m_idbCursor->value(); + WebKit::WebSerializedScriptValue webScriptValue; + WebKit::WebIDBKey webKey; + m_idbCursor->value(webScriptValue, webKey); + if (!webScriptValue.isNull()) { + ASSERT(webKey.type() == WebKit::WebIDBKey::InvalidType); + return IDBAny::create<SerializedScriptValue>(webScriptValue); + } + ASSERT(webKey.type() != WebKit::WebIDBKey::InvalidType); + return IDBAny::create<IDBKey>(webKey); } void IDBCursorBackendProxy::update(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBCallbacks> callbacks) diff --git a/WebKit/chromium/src/IDBCursorBackendProxy.h b/WebKit/chromium/src/IDBCursorBackendProxy.h index 8af27cf..d8b621a 100644 --- a/WebKit/chromium/src/IDBCursorBackendProxy.h +++ b/WebKit/chromium/src/IDBCursorBackendProxy.h @@ -44,7 +44,7 @@ public: virtual unsigned short direction() const; virtual PassRefPtr<IDBKey> key() const; - virtual PassRefPtr<SerializedScriptValue> value() const; + virtual PassRefPtr<IDBAny> value() const; virtual void update(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>); virtual void continueFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>); virtual void remove(PassRefPtr<IDBCallbacks>); diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 114e7e1..18101e4 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -59,10 +59,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() { } -void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame) +void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir) { WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame); + m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir); } void IDBFactoryBackendProxy::abortPendingTransactions(const Vector<int>& pendingIDs) diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h index 9efc7af..ac30cf2 100755 --- a/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -45,7 +45,7 @@ public: virtual ~IDBFactoryBackendProxy(); PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*); + virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir); virtual void abortPendingTransactions(const Vector<int>& pendingIDs); private: diff --git a/WebKit/chromium/src/IDBIndexBackendProxy.cpp b/WebKit/chromium/src/IDBIndexBackendProxy.cpp index 5f1b9d9..f92f4f2 100644 --- a/WebKit/chromium/src/IDBIndexBackendProxy.cpp +++ b/WebKit/chromium/src/IDBIndexBackendProxy.cpp @@ -26,10 +26,15 @@ #include "config.h" #include "IDBIndexBackendProxy.h" +#if ENABLE(INDEXED_DATABASE) + +#include "IDBCallbacks.h" +#include "IDBKeyRange.h" +#include "WebIDBCallbacksImpl.h" #include "WebIDBDatabaseError.h" #include "WebIDBIndex.h" - -#if ENABLE(INDEXED_DATABASE) +#include "WebIDBKey.h" +#include "WebIDBKeyRange.h" namespace WebCore { @@ -52,6 +57,11 @@ String IDBIndexBackendProxy::name() return m_webIDBIndex->name(); } +String IDBIndexBackendProxy::storeName() +{ + return m_webIDBIndex->storeName(); +} + String IDBIndexBackendProxy::keyPath() { return m_webIDBIndex->keyPath(); @@ -62,6 +72,26 @@ bool IDBIndexBackendProxy::unique() return m_webIDBIndex->unique(); } +void IDBIndexBackendProxy::openObjectCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks) +{ + m_webIDBIndex->openObjectCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks)); +} + +void IDBIndexBackendProxy::openCursor(PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, PassRefPtr<IDBCallbacks> callbacks) +{ + m_webIDBIndex->openCursor(keyRange, direction, new WebIDBCallbacksImpl(callbacks)); +} + +void IDBIndexBackendProxy::getObject(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks) +{ + m_webIDBIndex->getObject(key, new WebIDBCallbacksImpl(callbacks)); +} + +void IDBIndexBackendProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks) +{ + m_webIDBIndex->get(key, new WebIDBCallbacksImpl(callbacks)); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/IDBIndexBackendProxy.h b/WebKit/chromium/src/IDBIndexBackendProxy.h index 1b378dd..6aafdfa 100644 --- a/WebKit/chromium/src/IDBIndexBackendProxy.h +++ b/WebKit/chromium/src/IDBIndexBackendProxy.h @@ -42,10 +42,14 @@ public: virtual ~IDBIndexBackendProxy(); virtual String name(); + virtual String storeName(); virtual String keyPath(); virtual bool unique(); - // FIXME: Add other methods. + virtual void openObjectCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>); + virtual void openCursor(PassRefPtr<IDBKeyRange>, unsigned short direction, PassRefPtr<IDBCallbacks>); + virtual void getObject(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>); + virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>); private: IDBIndexBackendProxy(PassOwnPtr<WebKit::WebIDBIndex>); diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp index 76acbb2..77150bb 100644 --- a/WebKit/chromium/src/InspectorClientImpl.cpp +++ b/WebKit/chromium/src/InspectorClientImpl.cpp @@ -100,28 +100,10 @@ bool InspectorClientImpl::sendMessageToFrontend(const WTF::String& message) return false; } -void InspectorClientImpl::resourceTrackingWasEnabled() +void InspectorClientImpl::updateInspectorStateCookie(const WTF::String& inspectorState) { if (WebDevToolsAgentImpl* agent = devToolsAgent()) - agent->resourceTrackingWasEnabled(); -} - -void InspectorClientImpl::resourceTrackingWasDisabled() -{ - if (WebDevToolsAgentImpl* agent = devToolsAgent()) - agent->resourceTrackingWasDisabled(); -} - -void InspectorClientImpl::timelineProfilerWasStarted() -{ - if (WebDevToolsAgentImpl* agent = devToolsAgent()) - agent->timelineProfilerWasStarted(); -} - -void InspectorClientImpl::timelineProfilerWasStopped() -{ - if (WebDevToolsAgentImpl* agent = devToolsAgent()) - agent->timelineProfilerWasStopped(); + agent->updateInspectorStateCookie(inspectorState); } WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent() diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h index 34fcdc3..78d34e3 100644 --- a/WebKit/chromium/src/InspectorClientImpl.h +++ b/WebKit/chromium/src/InspectorClientImpl.h @@ -58,10 +58,7 @@ public: virtual bool sendMessageToFrontend(const WTF::String&); - virtual void resourceTrackingWasEnabled(); - virtual void resourceTrackingWasDisabled(); - virtual void timelineProfilerWasStarted(); - virtual void timelineProfilerWasStopped(); + virtual void updateInspectorStateCookie(const WTF::String&); private: WebDevToolsAgentImpl* devToolsAgent(); diff --git a/WebKit/chromium/src/ResourceHandle.cpp b/WebKit/chromium/src/ResourceHandle.cpp index 88f7f39..83e0017 100644 --- a/WebKit/chromium/src/ResourceHandle.cpp +++ b/WebKit/chromium/src/ResourceHandle.cpp @@ -74,7 +74,7 @@ public: virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); - virtual void didFinishLoading(WebURLLoader*); + virtual void didFinishLoading(WebURLLoader*, double finishTime); virtual void didFail(WebURLLoader*, const WebURLError&); enum ConnectionState { @@ -182,13 +182,13 @@ void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* m_client->didReceiveCachedMetadata(m_owner, data, dataLength); } -void ResourceHandleInternal::didFinishLoading(WebURLLoader*) +void ResourceHandleInternal::didFinishLoading(WebURLLoader*, double finishTime) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateFinishedLoading; - m_client->didFinishLoading(m_owner); + m_client->didFinishLoading(m_owner, finishTime); } void ResourceHandleInternal::didFail(WebURLLoader*, const WebURLError& error) @@ -211,16 +211,16 @@ ResourceHandle::ResourceHandle(const ResourceRequest& request, // FIXME: Figure out what to do with the bool params. } -PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, +PassRefPtr<ResourceHandle> ResourceHandle::create(NetworkingContext* context, + const ResourceRequest& request, ResourceHandleClient* client, - Frame* deprecated, bool defersLoading, bool shouldContentSniff) { RefPtr<ResourceHandle> newHandle = adoptRef(new ResourceHandle( request, client, defersLoading, shouldContentSniff)); - if (newHandle->start(deprecated)) + if (newHandle->start(context)) return newHandle.release(); return 0; @@ -246,7 +246,7 @@ void ResourceHandle::setDefersLoading(bool value) d->setDefersLoading(value); } -bool ResourceHandle::start(Frame* deprecated) +bool ResourceHandle::start(NetworkingContext* context) { d->start(); return true; @@ -288,12 +288,12 @@ bool ResourceHandle::supportsBufferedData() } // static -void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, +void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, + const ResourceRequest& request, StoredCredentials storedCredentials, ResourceError& error, ResourceResponse& response, - Vector<char>& data, - Frame* deprecated) + Vector<char>& data) { OwnPtr<WebURLLoader> loader(webKitClient()->createURLLoader()); ASSERT(loader.get()); diff --git a/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp b/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp index abb63cc..8304878 100644 --- a/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp +++ b/WebKit/chromium/src/WebAccessibilityCacheImpl.cpp @@ -63,7 +63,6 @@ WebAccessibilityCache* WebAccessibilityCache::create() PassRefPtr<WebAccessibilityCacheImpl::WeakHandle> WebAccessibilityCacheImpl::WeakHandle::create(AccessibilityObject* object) { - // FIXME: Remove resetting ref-count from AccessibilityObjectWrapper RefPtr<WebAccessibilityCacheImpl::WeakHandle> weakHandle = adoptRef(new WebAccessibilityCacheImpl::WeakHandle(object)); weakHandle->m_object->setWrapper(weakHandle.get()); @@ -149,7 +148,7 @@ void WebAccessibilityCacheImpl::clear() int WebAccessibilityCacheImpl::addOrGetId(const WebAccessibilityObject& object) { - if (object.isNull()) + if (!object.isValid()) return invalidObjectId; RefPtr<AccessibilityObject> o = toAccessibilityObject(object); diff --git a/WebKit/chromium/src/WebAccessibilityObject.cpp b/WebKit/chromium/src/WebAccessibilityObject.cpp index 3a3e94b..96a3173 100644 --- a/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -101,6 +101,15 @@ bool WebAccessibilityObject::canSetValueAttribute() const return m_private->canSetValueAttribute(); } +bool WebAccessibilityObject::isValid() const +{ + if (!m_private) + return false; + + m_private->updateBackingStore(); + return m_private->axObjectID(); +} + unsigned WebAccessibilityObject::childCount() const { if (!m_private) diff --git a/WebKit/chromium/src/WebDataSourceImpl.cpp b/WebKit/chromium/src/WebDataSourceImpl.cpp index ac2a02d..d5b1d79 100644 --- a/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -109,7 +109,8 @@ void WebDataSourceImpl::setExtraData(ExtraData* extraData) m_extraData.set(extraData); } -WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost() { +WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost() +{ #if ENABLE(OFFLINE_WEB_APPLICATIONS) return ApplicationCacheHostInternal::toWebApplicationCacheHost(DocumentLoader::applicationCacheHost()); #else @@ -117,6 +118,11 @@ WebApplicationCacheHost* WebDataSourceImpl::applicationCacheHost() { #endif } +void WebDataSourceImpl::setDeferMainResourceDataLoad(bool defer) +{ + DocumentLoader::setDeferMainResourceDataLoad(defer); +} + WebNavigationType WebDataSourceImpl::toWebNavigationType(NavigationType type) { switch (type) { diff --git a/WebKit/chromium/src/WebDataSourceImpl.h b/WebKit/chromium/src/WebDataSourceImpl.h index be32217..05329ff 100644 --- a/WebKit/chromium/src/WebDataSourceImpl.h +++ b/WebKit/chromium/src/WebDataSourceImpl.h @@ -68,6 +68,7 @@ public: virtual ExtraData* extraData() const; virtual void setExtraData(ExtraData*); virtual WebApplicationCacheHost* applicationCacheHost(); + virtual void setDeferMainResourceDataLoad(bool); static WebNavigationType toWebNavigationType(WebCore::NavigationType type); diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 971c290..c7bb050 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -36,7 +36,6 @@ #include "InjectedScriptHost.h" #include "InspectorBackendDispatcher.h" #include "InspectorController.h" -#include "InspectorValues.h" #include "Page.h" #include "PageGroup.h" #include "PlatformString.h" @@ -58,6 +57,7 @@ #include "WebURLResponse.h" #include "WebViewClient.h" #include "WebViewImpl.h" +#include <wtf/CurrentTime.h> #include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> @@ -67,8 +67,6 @@ using WebCore::InjectedScriptHost; using WebCore::InspectorArray; using WebCore::InspectorBackendDispatcher; using WebCore::InspectorController; -using WebCore::InspectorObject; -using WebCore::InspectorValue; using WebCore::Node; using WebCore::Page; using WebCore::ResourceError; @@ -82,10 +80,9 @@ namespace WebKit { namespace { -static const char kFrontendConnectedFeatureName[] = "frontend-connected"; -static const char kResourceTrackingFeatureName[] = "resource-tracking"; -static const char kTimelineFeatureName[] = "timeline-profiler"; static const char kApuAgentFeatureName[] = "apu-agent"; +static const char kFrontendConnectedFeatureName[] = "frontend-connected"; +static const char kInspectorStateFeatureName[] = "inspector-state"; class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop { public: @@ -223,9 +220,7 @@ void WebDevToolsAgentImpl::detach() void WebDevToolsAgentImpl::frontendLoaded() { - inspectorController()->connectFrontend(); - // We know that by this time injected script has already been pushed to the backend. - m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource()); + connectFrontend(false); } void WebDevToolsAgentImpl::didNavigate() @@ -253,17 +248,12 @@ void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebSt { if (name == kApuAgentFeatureName) setApuAgentEnabled(value == "true"); - else if (name == kTimelineFeatureName) - setTimelineProfilingEnabled(value == "true"); - else if (name == kResourceTrackingFeatureName) { + else if (name == kInspectorStateFeatureName) { InspectorController* ic = inspectorController(); - if (value == "true") - ic->enableResourceTracking(false /* not sticky */, false /* no reload */); - else - ic->disableResourceTracking(false /* not sticky */); + ic->restoreInspectorStateFromCookie(value); } else if (name == kFrontendConnectedFeatureName && !inspectorController()->hasFrontend()) { inspectorController()->injectedScriptHost()->setInjectedScriptSource(value); - frontendLoaded(); + connectFrontend(true); } } @@ -273,19 +263,19 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) InspectorController* ic = inspectorController(); if (enabled) { if (!ic->hasFrontend()) - frontendLoaded(); + connectFrontend(true); m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled(); ic->startTimelineProfiler(); if (!m_resourceTrackingWasEnabled) { // TODO(knorton): Introduce some kind of agents dependency here so that // user could turn off resource tracking while apu agent is on. - ic->enableResourceTracking(false, false); + ic->setResourceTrackingEnabled(true); } m_debuggerAgentImpl->setAutoContinueOnException(true); } else { ic->stopTimelineProfiler(); if (!m_resourceTrackingWasEnabled) - ic->disableResourceTracking(false); + ic->setResourceTrackingEnabled(false); m_resourceTrackingWasEnabled = false; } m_client->runtimePropertyChanged( @@ -293,6 +283,16 @@ void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled) enabled ? String("true") : String("false")); } +void WebDevToolsAgentImpl::connectFrontend(bool afterNavigation) +{ + if (afterNavigation) + inspectorController()->reuseFrontend(); + else + inspectorController()->connectFrontend(); + // We know that by this time injected script has already been pushed to the backend. + m_client->runtimePropertyChanged(kFrontendConnectedFeatureName, inspectorController()->injectedScriptHost()->injectedScriptSource()); +} + WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController() { if (Page* page = m_webViewImpl->page()) @@ -336,7 +336,7 @@ void WebDevToolsAgentImpl::didReceiveResponse(unsigned long resourceId, const We void WebDevToolsAgentImpl::didFinishLoading(unsigned long resourceId) { if (InspectorController* ic = inspectorController()) - ic->didFinishLoading(resourceId); + ic->didFinishLoading(resourceId, 0); } void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURLError& error) @@ -402,24 +402,9 @@ bool WebDevToolsAgentImpl::sendMessageToFrontend(const WTF::String& message) return true; } -void WebDevToolsAgentImpl::resourceTrackingWasEnabled() -{ - m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "true"); -} - -void WebDevToolsAgentImpl::resourceTrackingWasDisabled() -{ - m_client->runtimePropertyChanged(kResourceTrackingFeatureName, "false"); -} - -void WebDevToolsAgentImpl::timelineProfilerWasStarted() -{ - m_client->runtimePropertyChanged(kTimelineFeatureName, "true"); -} - -void WebDevToolsAgentImpl::timelineProfilerWasStopped() +void WebDevToolsAgentImpl::updateInspectorStateCookie(const WTF::String& state) { - m_client->runtimePropertyChanged(kTimelineFeatureName, "false"); + m_client->runtimePropertyChanged(kInspectorStateFeatureName, state); } void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script) diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h index 36cafcf..47c4ccf 100644 --- a/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -93,16 +93,14 @@ public: virtual void hideHighlight(); virtual void populateSetting(const WTF::String& key, WTF::String* value); virtual void storeSetting(const WTF::String& key, const WTF::String& value); - virtual void resourceTrackingWasEnabled(); - virtual void resourceTrackingWasDisabled(); - virtual void timelineProfilerWasStarted(); - virtual void timelineProfilerWasStopped(); + virtual void updateInspectorStateCookie(const WTF::String&); virtual bool sendMessageToFrontend(const WTF::String&); int hostId() { return m_hostId; } private: void setApuAgentEnabled(bool enabled); + void connectFrontend(bool afterNavigation); WebCore::InspectorController* inspectorController(); diff --git a/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp index 820c970..8a75ca1 100644 --- a/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp +++ b/WebKit/chromium/src/WebDeviceOrientationClientMock.cpp @@ -32,6 +32,11 @@ namespace WebKit { +WebDeviceOrientationClientMock* WebDeviceOrientationClientMock::create() +{ + return new WebDeviceOrientationClientMock(); +} + void WebDeviceOrientationClientMock::setController(WebDeviceOrientationController* controller) { m_clientMock->setController(controller->controller()); diff --git a/WebKit/chromium/src/WebFormElement.cpp b/WebKit/chromium/src/WebFormElement.cpp index 9c77732..7a01053 100644 --- a/WebKit/chromium/src/WebFormElement.cpp +++ b/WebKit/chromium/src/WebFormElement.cpp @@ -68,7 +68,7 @@ WebString WebFormElement::method() const bool WebFormElement::wasUserSubmitted() const { - return constUnwrap<HTMLFormElement>()->submissionTrigger() == NotSubmittedByJavaScript; + return constUnwrap<HTMLFormElement>()->wasUserSubmitted(); } void WebFormElement::submit() diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp index a2d6a46..2d42f4b 100644 --- a/WebKit/chromium/src/WebFrameImpl.cpp +++ b/WebKit/chromium/src/WebFrameImpl.cpp @@ -1012,22 +1012,9 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) 0, 0, request.toMutableResourceRequest(), response); } -void WebFrameImpl::commitDocumentData(const char* data, size_t dataLen) +void WebFrameImpl::commitDocumentData(const char* data, size_t length) { - DocumentLoader* documentLoader = m_frame->loader()->documentLoader(); - - // Set the text encoding. This calls begin() for us. It is safe to call - // this multiple times (Mac does: page/mac/WebCoreFrameBridge.mm). - bool userChosen = true; - String encoding = documentLoader->overrideEncoding(); - if (encoding.isNull()) { - userChosen = false; - encoding = documentLoader->response().textEncodingName(); - } - m_frame->loader()->writer()->setEncoding(encoding, userChosen); - - // NOTE: mac only does this if there is a document - m_frame->loader()->addData(data, dataLen); + m_frame->loader()->documentLoader()->commitData(data, length); } unsigned WebFrameImpl::unloadListenerCount() const @@ -1229,7 +1216,7 @@ void WebFrameImpl::selectWordAroundPosition(Frame* frame, VisiblePosition pos) VisibleSelection selection(pos); selection.expandUsingGranularity(WordGranularity); - if (frame->shouldChangeSelection(selection)) { + if (frame->selection()->shouldChangeSelection(selection)) { TextGranularity granularity = selection.isRange() ? WordGranularity : CharacterGranularity; frame->selection()->setSelection(selection, granularity); } @@ -1713,11 +1700,18 @@ int WebFrameImpl::pageNumberForElementById(const WebString& id, WebRect WebFrameImpl::selectionBoundsRect() const { if (hasSelection()) - return IntRect(frame()->selectionBounds(false)); + return IntRect(frame()->selection()->bounds(false)); return WebRect(); } +bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) const +{ + if (!m_frame) + return false; + return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length); +} + // WebFrameImpl public --------------------------------------------------------- PassRefPtr<WebFrameImpl> WebFrameImpl::create(WebFrameClient* client) diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h index 14217fa..25e7004 100644 --- a/WebKit/chromium/src/WebFrameImpl.h +++ b/WebKit/chromium/src/WebFrameImpl.h @@ -182,6 +182,8 @@ public: float pageHeightInPixels) const; virtual WebRect selectionBoundsRect() const; + virtual bool selectionStartHasSpellingMarkerFor(int from, int length) const; + static PassRefPtr<WebFrameImpl> create(WebFrameClient* client); ~WebFrameImpl(); diff --git a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp index bbb7162..bbc852f 100644 --- a/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceBridgeImpl.cpp @@ -79,13 +79,15 @@ public: virtual void setIsAllowed(bool allowed); virtual void setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp); virtual void setLastError(int errorCode, const WebString& message); - virtual void onWebGeolocationServiceDestroyed(); + virtual void didDestroyGeolocationService(); private: - WebViewClient* getWebViewClient(); - + bool isAttached() const; + // Pointer back to the WebKit geolocation client. We obtain this via the frame's page, but need to cache it + // as it may still be alive after the page has detached from the frame. + WebGeolocationService* m_webGeolocationService; // GeolocationServiceChromium owns us, we only have a pointer back to it. - GeolocationServiceChromium* m_GeolocationServiceChromium; + GeolocationServiceChromium* m_geolocationServiceChromium; int m_bridgeId; }; @@ -95,49 +97,47 @@ GeolocationServiceBridge* createGeolocationServiceBridgeImpl(GeolocationServiceC } WebGeolocationServiceBridgeImpl::WebGeolocationServiceBridgeImpl(GeolocationServiceChromium* geolocationServiceChromium) - : m_GeolocationServiceChromium(geolocationServiceChromium) + : m_webGeolocationService(0) + , m_geolocationServiceChromium(geolocationServiceChromium) , m_bridgeId(0) { } WebGeolocationServiceBridgeImpl::~WebGeolocationServiceBridgeImpl() { - WebKit::WebViewClient* webViewClient = getWebViewClient(); - // Geolocation has an OwnPtr to us, and it's destroyed after the frame has - // been potentially disconnected. In this case, it calls stopUpdating() - // has been called and we have already detached ourselves. - if (!webViewClient) - ASSERT(!m_bridgeId); - else if (m_bridgeId) - webViewClient->geolocationService()->detachBridge(m_bridgeId); + if (isAttached()) + m_webGeolocationService->detachBridge(m_bridgeId); } bool WebGeolocationServiceBridgeImpl::startUpdating(PositionOptions* positionOptions) { attachBridgeIfNeeded(); - getWebViewClient()->geolocationService()->startUpdating(m_bridgeId, m_GeolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy()); + if (!isAttached()) + return false; + m_webGeolocationService->startUpdating(m_bridgeId, m_geolocationServiceChromium->frame()->document()->url(), positionOptions->enableHighAccuracy()); return true; } void WebGeolocationServiceBridgeImpl::stopUpdating() { - WebViewClient* webViewClient = getWebViewClient(); - if (m_bridgeId && webViewClient) { - WebGeolocationService* geolocationService = webViewClient->geolocationService(); - geolocationService->stopUpdating(m_bridgeId); - geolocationService->detachBridge(m_bridgeId); + if (isAttached()) { + m_webGeolocationService->stopUpdating(m_bridgeId); + m_webGeolocationService->detachBridge(m_bridgeId); + m_bridgeId = 0; + m_webGeolocationService = 0; } - m_bridgeId = 0; } void WebGeolocationServiceBridgeImpl::suspend() { - getWebViewClient()->geolocationService()->suspend(m_bridgeId); + if (isAttached()) + m_webGeolocationService->suspend(m_bridgeId); } void WebGeolocationServiceBridgeImpl::resume() { - getWebViewClient()->geolocationService()->resume(m_bridgeId); + if (isAttached()) + m_webGeolocationService->resume(m_bridgeId); } int WebGeolocationServiceBridgeImpl::getBridgeId() const @@ -147,38 +147,54 @@ int WebGeolocationServiceBridgeImpl::getBridgeId() const void WebGeolocationServiceBridgeImpl::attachBridgeIfNeeded() { - if (!m_bridgeId) - m_bridgeId = getWebViewClient()->geolocationService()->attachBridge(this); + if (isAttached()) + return; + // Lazy attach to the geolocation service of the associated page if there is one. + Frame* frame = m_geolocationServiceChromium->frame(); + if (!frame || !frame->page()) + return; + WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client()); + WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client(); + m_webGeolocationService = webViewClient->geolocationService(); + ASSERT(m_webGeolocationService); + m_bridgeId = m_webGeolocationService->attachBridge(this); + if (!m_bridgeId) { + // Attach failed. Release association with this service. + m_webGeolocationService = 0; + } } void WebGeolocationServiceBridgeImpl::setIsAllowed(bool allowed) { - m_GeolocationServiceChromium->setIsAllowed(allowed); + m_geolocationServiceChromium->setIsAllowed(allowed); } void WebGeolocationServiceBridgeImpl::setLastPosition(double latitude, double longitude, bool providesAltitude, double altitude, double accuracy, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed, long long timestamp) { RefPtr<Geoposition> geoposition = Geoposition::create(Coordinates::create(latitude, longitude, providesAltitude, altitude, accuracy, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed), timestamp); - m_GeolocationServiceChromium->setLastPosition(geoposition); + m_geolocationServiceChromium->setLastPosition(geoposition); } void WebGeolocationServiceBridgeImpl::setLastError(int errorCode, const WebString& message) { - m_GeolocationServiceChromium->setLastError(errorCode, message); + m_geolocationServiceChromium->setLastError(errorCode, message); } -WebViewClient* WebGeolocationServiceBridgeImpl::getWebViewClient() +void WebGeolocationServiceBridgeImpl::didDestroyGeolocationService() { - Frame* frame = m_GeolocationServiceChromium->frame(); - if (!frame || !frame->page()) - return 0; - WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(frame->page()->chrome()->client()); - WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client(); - return webViewClient; + m_bridgeId = 0; + m_webGeolocationService = 0; } -void WebGeolocationServiceBridgeImpl::onWebGeolocationServiceDestroyed() +bool WebGeolocationServiceBridgeImpl::isAttached() const { + // Test the class invariant. + if (m_webGeolocationService) + ASSERT(m_bridgeId); + else + ASSERT(!m_bridgeId); + + return m_webGeolocationService; } } // namespace WebKit diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp index 2a10c96..e149cf1 100644 --- a/WebKit/chromium/src/WebGeolocationServiceMock.cpp +++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp @@ -34,9 +34,11 @@ #include "GeolocationService.h" #include "GeolocationServiceChromium.h" #include "GeolocationServiceMock.h" +#include "WebGeolocationServiceBridge.h" #include "WebString.h" #include <wtf/CurrentTime.h> #include <wtf/HashMap.h> +#include <wtf/Vector.h> #if ENABLE(GEOLOCATION) @@ -51,6 +53,7 @@ using WebCore::Geoposition; using WebCore::PositionError; using WebCore::PositionOptions; using WTF::String; +using WTF::Vector; namespace WebCore { class GeolocationServiceChromiumMock : public GeolocationServiceChromium, public GeolocationServiceClient { @@ -124,17 +127,34 @@ namespace WebKit { class WebGeolocationServiceMockImpl : public WebGeolocationServiceMock { public: - virtual ~WebGeolocationServiceMockImpl() { } + WebGeolocationServiceMockImpl(); + virtual ~WebGeolocationServiceMockImpl(); + static void setMockGeolocationPermission(bool allowed); + + // WebGeolocationService virtual void requestPermissionForFrame(int bridgeId, const WebURL& url); virtual int attachBridge(WebGeolocationServiceBridge*); virtual void detachBridge(int bridgeId); private: + void notifyPendingPermissions(); + typedef HashMap<int, WebGeolocationServiceBridge*> IdToBridgeMap; IdToBridgeMap m_idToBridgeMap; + Vector<int> m_pendingPermissionRequests; + + // In addition to the singleton instance pointer, we need to keep the setMockGeolocationPermission() state + // as a static (not object members) as this call may come in before the service has been created. + static enum PermissionState { + PermissionStateUnset, + PermissionStateAllowed, + PermissionStateDenied, + } s_permissionState; + static WebGeolocationServiceMockImpl* s_instance; }; -bool WebGeolocationServiceMock::s_mockGeolocationPermission = false; +WebGeolocationServiceMockImpl::PermissionState WebGeolocationServiceMockImpl::s_permissionState = WebGeolocationServiceMockImpl::PermissionStateUnset; +WebGeolocationServiceMockImpl* WebGeolocationServiceMockImpl::s_instance = 0; WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServiceMock() { @@ -143,7 +163,7 @@ WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServic void WebGeolocationServiceMock::setMockGeolocationPermission(bool allowed) { - s_mockGeolocationPermission = allowed; + WebGeolocationServiceMockImpl::setMockGeolocationPermission(allowed); } void WebGeolocationServiceMock::setMockGeolocationPosition(double latitude, double longitude, double accuracy) @@ -160,12 +180,35 @@ void WebGeolocationServiceMock::setMockGeolocationError(int errorCode, const Web GeolocationServiceMock::setError(positionError); } +WebGeolocationServiceMockImpl::WebGeolocationServiceMockImpl() +{ + ASSERT(!s_instance); + s_instance = this; +} + +WebGeolocationServiceMockImpl::~WebGeolocationServiceMockImpl() +{ + ASSERT(this == s_instance); + s_instance = 0; + // Reset the permission state, so any future service instance (e.g. running + // multiple tests in a single DRT run) will see a clean call sequence. + s_permissionState = PermissionStateUnset; + for (IdToBridgeMap::iterator it = m_idToBridgeMap.begin(); it != m_idToBridgeMap.end(); ++it) + it->second->didDestroyGeolocationService(); +} + +void WebGeolocationServiceMockImpl::setMockGeolocationPermission(bool allowed) +{ + s_permissionState = allowed ? PermissionStateAllowed : PermissionStateDenied; + if (s_instance) + s_instance->notifyPendingPermissions(); +} + void WebGeolocationServiceMockImpl::requestPermissionForFrame(int bridgeId, const WebURL& url) { - IdToBridgeMap::iterator iter = m_idToBridgeMap.find(bridgeId); - if (iter == m_idToBridgeMap.end()) - return; - iter->second->setIsAllowed(s_mockGeolocationPermission); + m_pendingPermissionRequests.append(bridgeId); + if (s_permissionState != PermissionStateUnset) + notifyPendingPermissions(); } int WebGeolocationServiceMockImpl::attachBridge(WebGeolocationServiceBridge* bridge) @@ -183,6 +226,19 @@ void WebGeolocationServiceMockImpl::detachBridge(int bridgeId) m_idToBridgeMap.remove(bridgeId); } +void WebGeolocationServiceMockImpl::notifyPendingPermissions() +{ + ASSERT(s_permissionState == PermissionStateAllowed || s_permissionState == PermissionStateDenied); + Vector<int> pendingPermissionRequests; + pendingPermissionRequests.swap(m_pendingPermissionRequests); + for (Vector<int>::const_iterator it = pendingPermissionRequests.begin(); it != pendingPermissionRequests.end(); ++it) { + ASSERT(*it > 0); + IdToBridgeMap::iterator iter = m_idToBridgeMap.find(*it); + if (iter != m_idToBridgeMap.end()) + iter->second->setIsAllowed(s_permissionState == PermissionStateAllowed); + } +} + } // namespace WebKit #endif // ENABLE(GEOLOCATION) diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp index 6e1adca..24dcf9a 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp @@ -97,11 +97,16 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl() } } -bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView) +bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView, bool renderDirectlyToWebView) { + if (renderDirectlyToWebView) { + // This mode isn't supported with the in-process implementation yet. (FIXME) + return false; + } + if (!gfx::GLContext::InitializeOneOff()) return false; - + m_glContext = WTF::adoptPtr(gfx::GLContext::CreateOffscreenGLContext(0)); if (!m_glContext) return false; @@ -114,6 +119,11 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute return true; } +bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attributes attributes, WebView* webView) +{ + return initialize(attributes, webView, false); +} + void WebGraphicsContext3DDefaultImpl::validateAttributes() { const char* extensions = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)); @@ -463,6 +473,40 @@ bool WebGraphicsContext3DDefaultImpl::supportsBGRA() return false; } +bool WebGraphicsContext3DDefaultImpl::supportsMapSubCHROMIUM() +{ + // We don't claim support for this extension at this time + return false; +} + +void* WebGraphicsContext3DDefaultImpl::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) +{ + return 0; +} + +void WebGraphicsContext3DDefaultImpl::unmapBufferSubDataCHROMIUM(const void* mem) +{ +} + +void* WebGraphicsContext3DDefaultImpl::mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access) +{ + return 0; +} + +void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem) +{ +} + +bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM() +{ + // We don't claim support for this extension at this time + return false; +} + +void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2) +{ +} + // Helper macros to reduce the amount of code. #define DELEGATE_TO_GL(name, glname) \ diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h index a4c5b4b..5bf439a 100644 --- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h +++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h @@ -59,6 +59,8 @@ public: //---------------------------------------------------------------------- // WebGraphicsContext3D methods + virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*, bool); + // FIXME: remove once compositor is switched over to GraphicsContext3D. virtual bool initialize(WebGraphicsContext3D::Attributes attributes, WebView*); virtual bool makeContextCurrent(); @@ -80,6 +82,13 @@ public: virtual void synthesizeGLError(unsigned long error); virtual bool supportsBGRA(); + virtual bool supportsMapSubCHROMIUM(); + virtual void* mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access); + virtual void unmapBufferSubDataCHROMIUM(const void*); + virtual void* mapTexSubImage2DCHROMIUM(unsigned target, int level, int xoffset, int yoffset, int width, int height, unsigned format, unsigned type, unsigned access); + virtual void unmapTexSubImage2DCHROMIUM(const void*); + virtual bool supportsCopyTextureToParentTextureCHROMIUM(); + virtual void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture); virtual void activeTexture(unsigned long texture); virtual void attachShader(WebGLId program, WebGLId shader); diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp index e54b4e5..93b94c2 100644 --- a/WebKit/chromium/src/WebHTTPBody.cpp +++ b/WebKit/chromium/src/WebHTTPBody.cpp @@ -78,7 +78,9 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const result.filePath.reset(); result.fileStart = 0; result.fileLength = 0; + // FIXME: remove this line once all users of Element have been switched to use 'modificationTime'. result.fileInfo.modificationTime = 0.0; + result.modificationTime = 0.0; result.blobURL = KURL(); switch (element.m_type) { @@ -92,7 +94,9 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const #if ENABLE(BLOB) result.fileStart = element.m_fileStart; result.fileLength = element.m_fileLength; + // FIXME: remove this line once all users of Element have been switched to use 'modificationTime'. result.fileInfo.modificationTime = element.m_expectedFileModificationTime; + result.modificationTime = element.m_expectedFileModificationTime; #endif break; #if ENABLE(BLOB) @@ -123,14 +127,20 @@ void WebHTTPBody::appendFile(const WebString& filePath) m_private->appendFile(filePath); } -void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo) +void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, double modificationTime) { #if ENABLE(BLOB) ensureMutable(); - m_private->appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime); + m_private->appendFileRange(filePath, fileStart, fileLength, modificationTime); #endif } +// FIXME: Remove this method once all callers have been switched to use the method above. +void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo) +{ + return appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime); +} + void WebHTTPBody::appendBlob(const WebURL& blobURL) { #if ENABLE(BLOB) diff --git a/WebKit/chromium/src/WebIDBCursorImpl.cpp b/WebKit/chromium/src/WebIDBCursorImpl.cpp index b74d680..6a1053e 100644 --- a/WebKit/chromium/src/WebIDBCursorImpl.cpp +++ b/WebKit/chromium/src/WebIDBCursorImpl.cpp @@ -55,9 +55,19 @@ WebIDBKey WebIDBCursorImpl::key() const return WebIDBKey(m_idbCursorBackend->key()); } -WebSerializedScriptValue WebIDBCursorImpl::value() const +void WebIDBCursorImpl::value(WebSerializedScriptValue& serializedScriptValue, WebIDBKey& idbKey) const { - return m_idbCursorBackend->value(); + // Verify we're starting off with blank slates. + ASSERT(serializedScriptValue.isNull()); + ASSERT(idbKey.type() == WebIDBKey::InvalidType); + + RefPtr<IDBAny> any = m_idbCursorBackend->value(); + if (any->type() == IDBAny::SerializedScriptValueType) + serializedScriptValue.assign(any->serializedScriptValue()); + else if (any->type() == IDBAny::IDBKeyType) + idbKey.assign(any->idbKey()); + else + ASSERT_NOT_REACHED(); } void WebIDBCursorImpl::update(const WebSerializedScriptValue& value, WebIDBCallbacks* callbacks) diff --git a/WebKit/chromium/src/WebIDBCursorImpl.h b/WebKit/chromium/src/WebIDBCursorImpl.h index 565e86a..5fb9e1c 100644 --- a/WebKit/chromium/src/WebIDBCursorImpl.h +++ b/WebKit/chromium/src/WebIDBCursorImpl.h @@ -43,7 +43,7 @@ public: virtual unsigned short direction() const; virtual WebIDBKey key() const; - virtual WebSerializedScriptValue value() const; + virtual void value(WebSerializedScriptValue&, WebIDBKey&) const; virtual void update(const WebSerializedScriptValue&, WebIDBCallbacks*); virtual void continueFunction(const WebIDBKey&, WebIDBCallbacks*); virtual void remove(WebIDBCallbacks*); diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp index 564be36..3c8d459 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl() { } -void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*) +void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir) { - m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0); + m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir); } void WebIDBFactoryImpl::abortPendingTransactions(const WebVector<int>& pendingIDs) diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h index aeab478..4dc0a10 100755 --- a/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -42,7 +42,7 @@ public: WebIDBFactoryImpl(); virtual ~WebIDBFactoryImpl(); - virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*); + virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir); virtual void abortPendingTransactions(const WebVector<int>& pendingIDs); private: diff --git a/WebKit/chromium/src/WebIDBIndexImpl.cpp b/WebKit/chromium/src/WebIDBIndexImpl.cpp index 777ec32..c049aac 100644 --- a/WebKit/chromium/src/WebIDBIndexImpl.cpp +++ b/WebKit/chromium/src/WebIDBIndexImpl.cpp @@ -26,7 +26,12 @@ #include "config.h" #include "WebIDBIndexImpl.h" +#include "IDBCallbacksProxy.h" #include "IDBIndex.h" +#include "IDBKeyRange.h" +#include "WebIDBCallbacks.h" +#include "WebIDBKey.h" +#include "WebIDBKeyRange.h" #if ENABLE(INDEXED_DATABASE) @@ -48,6 +53,11 @@ WebString WebIDBIndexImpl::name() const return m_backend->name(); } +WebString WebIDBIndexImpl::storeName() const +{ + return m_backend->storeName(); +} + WebString WebIDBIndexImpl::keyPath() const { return m_backend->keyPath(); @@ -58,6 +68,26 @@ bool WebIDBIndexImpl::unique() const return m_backend->unique(); } +void WebIDBIndexImpl::openCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks) +{ + m_backend->openCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks)); +} + +void WebIDBIndexImpl::openObjectCursor(const WebIDBKeyRange& keyRange, unsigned short direction, WebIDBCallbacks* callbacks) +{ + m_backend->openObjectCursor(keyRange, direction, IDBCallbacksProxy::create(callbacks)); +} + +void WebIDBIndexImpl::getObject(const WebIDBKey& keyRange, WebIDBCallbacks* callbacks) +{ + m_backend->getObject(keyRange, IDBCallbacksProxy::create(callbacks)); +} + +void WebIDBIndexImpl::get(const WebIDBKey& keyRange, WebIDBCallbacks* callbacks) +{ + m_backend->get(keyRange, IDBCallbacksProxy::create(callbacks)); +} + } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) diff --git a/WebKit/chromium/src/WebIDBIndexImpl.h b/WebKit/chromium/src/WebIDBIndexImpl.h index 73f3819..2108001 100644 --- a/WebKit/chromium/src/WebIDBIndexImpl.h +++ b/WebKit/chromium/src/WebIDBIndexImpl.h @@ -42,9 +42,15 @@ public: virtual ~WebIDBIndexImpl(); virtual WebString name() const; + virtual WebString storeName() const; virtual WebString keyPath() const; virtual bool unique() const; + virtual void openObjectCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*); + virtual void openCursor(const WebIDBKeyRange&, unsigned short direction, WebIDBCallbacks*); + virtual void getObject(const WebIDBKey&, WebIDBCallbacks*); + virtual void get(const WebIDBKey&, WebIDBCallbacks*); + private: WTF::RefPtr<WebCore::IDBIndexBackendInterface> m_backend; }; diff --git a/WebKit/chromium/src/WebInputElement.cpp b/WebKit/chromium/src/WebInputElement.cpp index 7bf6407..25d484c 100644 --- a/WebKit/chromium/src/WebInputElement.cpp +++ b/WebKit/chromium/src/WebInputElement.cpp @@ -40,6 +40,26 @@ using namespace WebCore; namespace WebKit { +bool WebInputElement::isTextField() const +{ + return constUnwrap<HTMLInputElement>()->isTextField(); +} + +bool WebInputElement::isText() const +{ + return constUnwrap<HTMLInputElement>()->isText(); +} + +bool WebInputElement::isPasswordField() const +{ + return constUnwrap<HTMLInputElement>()->isPasswordField(); +} + +bool WebInputElement::isImageButton() const +{ + return constUnwrap<HTMLInputElement>()->isImageButton(); +} + bool WebInputElement::autoComplete() const { return constUnwrap<HTMLInputElement>()->autoComplete(); @@ -57,7 +77,7 @@ bool WebInputElement::isEnabledFormControl() const WebInputElement::InputType WebInputElement::inputType() const { - return static_cast<InputType>(constUnwrap<HTMLInputElement>()->inputType()); + return static_cast<InputType>(constUnwrap<HTMLInputElement>()->deprecatedInputType()); } int WebInputElement::maxLength() const diff --git a/WebKit/chromium/src/WebKit.cpp b/WebKit/chromium/src/WebKit.cpp index f3336ea..cadcb6c 100644 --- a/WebKit/chromium/src/WebKit.cpp +++ b/WebKit/chromium/src/WebKit.cpp @@ -103,11 +103,6 @@ bool layoutTestMode() return s_layoutTestMode; } -bool areLayoutTestImagesOpaque() -{ - return true; -} - void enableLogChannel(const char* name) { WTFLogChannel* channel = WebCore::getChannelFromName(name); diff --git a/WebKit/chromium/src/WebPasswordFormUtils.cpp b/WebKit/chromium/src/WebPasswordFormUtils.cpp index e5d5411..6968e1a 100644 --- a/WebKit/chromium/src/WebPasswordFormUtils.cpp +++ b/WebKit/chromium/src/WebPasswordFormUtils.cpp @@ -79,8 +79,8 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields) continue; if ((fields->passwords.size() < maxPasswords) - && (inputElement->inputType() == HTMLInputElement::PASSWORD) - && (inputElement->autoComplete())) { + && inputElement->isPasswordField() + && inputElement->autoComplete()) { if (fields->passwords.isEmpty()) firstPasswordIndex = i; fields->passwords.append(inputElement); @@ -98,7 +98,9 @@ void findPasswordFormFields(HTMLFormElement* form, PasswordFormFields* fields) if (!inputElement->isEnabledFormControl()) continue; - if ((inputElement->inputType() == HTMLInputElement::TEXT) + // FIXME: This needs to use a function other than deprecatedInputType. + // Does this really want to special-case TEXT, and not other text-field-like input elements? + if ((inputElement->deprecatedInputType() == HTMLInputElement::TEXT) && (inputElement->autoComplete())) { fields->userName = inputElement; break; diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp index 75d6cc1..085a157 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.cpp +++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp @@ -174,6 +174,16 @@ void WebPopupMenuImpl::paint(WebCanvas* canvas, const WebRect& rect) } } +void WebPopupMenuImpl::themeChanged() +{ + notImplemented(); +} + +void WebPopupMenuImpl::composite(bool finish) +{ + notImplemented(); +} + bool WebPopupMenuImpl::handleInputEvent(const WebInputEvent& inputEvent) { if (!m_widget) diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h index edbb4ab..221ba03 100644 --- a/WebKit/chromium/src/WebPopupMenuImpl.h +++ b/WebKit/chromium/src/WebPopupMenuImpl.h @@ -63,6 +63,8 @@ public: virtual void resize(const WebSize&); virtual void layout(); virtual void paint(WebCanvas* canvas, const WebRect& rect); + virtual void themeChanged(); + virtual void composite(bool finish); virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp index 1864514..5fc51ca 100644 --- a/WebKit/chromium/src/WebSearchableFormData.cpp +++ b/WebKit/chromium/src/WebSearchableFormData.cpp @@ -131,7 +131,7 @@ bool IsInDefaultState(const HTMLFormControlElement* formElement) { if (formElement->hasTagName(HTMLNames::inputTag)) { const HTMLInputElement* inputElement = static_cast<const HTMLInputElement*>(formElement); - if (inputElement->inputType() == HTMLInputElement::CHECKBOX || inputElement->inputType() == HTMLInputElement::RADIO) + if (inputElement->isCheckbox() || inputElement->isRadioButton()) return inputElement->checked() == inputElement->defaultChecked(); } else if (formElement->hasTagName(HTMLNames::selectTag)) return IsSelectInDefaultState(static_cast<const HTMLSelectElement*>(formElement)); @@ -166,19 +166,24 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt bool isTextElement = false; if (formElement->hasTagName(HTMLNames::inputTag)) { - switch (static_cast<const HTMLInputElement*>(formElement)->inputType()) { + if (static_cast<const HTMLInputElement*>(formElement)->isFileUpload()) { + // Too big, don't try to index this. + return 0; + } + + if (static_cast<const HTMLInputElement*>(formElement)->isPasswordField()) { + // Don't store passwords! This is most likely an https anyway. + return 0; + } + + // FIXME: This needs to use a function on HTMLInputElement other than deprecatedInputType. + // Also, it's not clear why TEXT should be handled differently than, say, SEARCH. + switch (static_cast<const HTMLInputElement*>(formElement)->deprecatedInputType()) { case HTMLInputElement::TEXT: case HTMLInputElement::ISINDEX: isTextElement = true; break; - case HTMLInputElement::PASSWORD: - // Don't store passwords! This is most likely an https anyway. - // Fall through. - case HTMLInputElement::FILE: - // Too big, don't try to index this. - return 0; default: - // All other input types are indexable. break; } } diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp index 137bf06..a1c6578 100644 --- a/WebKit/chromium/src/WebViewImpl.cpp +++ b/WebKit/chromium/src/WebViewImpl.cpp @@ -34,6 +34,7 @@ #include "AutoFillPopupMenuClient.h" #include "AXObjectCache.h" #include "Chrome.h" +#include "ColorSpace.h" #include "CompositionUnderlineVectorBuilder.h" #include "ContextMenu.h" #include "ContextMenuController.h" @@ -55,17 +56,17 @@ #include "FrameLoader.h" #include "FrameTree.h" #include "FrameView.h" -#include "GLES2Context.h" -#include "GLES2ContextInternal.h" #include "GraphicsContext.h" #include "GraphicsContext3D.h" +#include "GraphicsContext3DInternal.h" #include "HTMLInputElement.h" #include "HTMLMediaElement.h" #include "HitTestResult.h" #include "HTMLNames.h" #include "Image.h" +#include "ImageBuffer.h" +#include "ImageData.h" #include "InspectorController.h" -#include "IntRect.h" #include "KeyboardCodes.h" #include "KeyboardEvent.h" #include "MIMETypeRegistry.h" @@ -115,7 +116,11 @@ #include "WebString.h" #include "WebVector.h" #include "WebViewClient.h" -#include "wtf/OwnPtr.h" +#include <wtf/RefPtr.h> + +#if PLATFORM(CG) +#include <CoreGraphics/CGContext.h> +#endif #if OS(WINDOWS) #include "RenderThemeChromiumWin.h" @@ -245,6 +250,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_newNavigationLoader(0) #endif , m_zoomLevel(0) + , m_zoomTextOnly(false) , m_contextMenuAllowed(false) , m_doingDragAndDrop(false) , m_ignoreInputEvents(false) @@ -270,7 +276,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools #if ENABLE(INPUT_SPEECH) , m_speechInputClient(client) #endif - , m_gles2Context(0) , m_deviceOrientationClientProxy(new DeviceOrientationClientProxy(client ? client->deviceOrientationClient() : 0)) { // WebKit/win/WebView.cpp does the same thing, except they call the @@ -912,13 +917,18 @@ void WebViewImpl::resize(const WebSize& newSize) if (m_client) { WebRect damagedRect(0, 0, m_size.width, m_size.height); - m_client->didInvalidateRect(damagedRect); + if (isAcceleratedCompositingActive()) { +#if USE(ACCELERATED_COMPOSITING) + invalidateRootLayerRect(damagedRect); +#endif + } else + m_client->didInvalidateRect(damagedRect); } #if OS(DARWIN) - if (m_gles2Context) { - m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width), - std::max(1, m_size.height))); + if (m_layerRenderer) { + m_layerRenderer->resizeOnscreenContent(WebCore::IntSize(std::max(1, m_size.width), + std::max(1, m_size.height))); } #endif } @@ -944,35 +954,90 @@ void WebViewImpl::layout() } } -void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) +#if USE(ACCELERATED_COMPOSITING) +void WebViewImpl::doPixelReadbackToCanvas(WebCanvas* canvas, const IntRect& rect) { + ASSERT(rect.right() <= m_layerRenderer->rootLayerTextureSize().width() + && rect.bottom() <= m_layerRenderer->rootLayerTextureSize().height()); + +#if PLATFORM(SKIA) + PlatformContextSkia context(canvas); + + // PlatformGraphicsContext is actually a pointer to PlatformContextSkia + GraphicsContext gc(reinterpret_cast<PlatformGraphicsContext*>(&context)); + int bitmapHeight = canvas->getDevice()->accessBitmap(false).height(); +#elif PLATFORM(CG) + GraphicsContext gc(canvas); + int bitmapHeight = CGBitmapContextGetHeight(reinterpret_cast<CGContextRef>(canvas)); +#else + notImplemented(); +#endif + // Compute rect to sample from inverted GPU buffer. + IntRect invertRect(rect.x(), bitmapHeight - rect.bottom(), rect.width(), rect.height()); + + OwnPtr<ImageBuffer> imageBuffer(ImageBuffer::create(rect.size())); + RefPtr<ImageData> imageData(ImageData::create(rect.width(), rect.height())); + if (imageBuffer.get() && imageData.get()) { + m_layerRenderer->getFramebufferPixels(imageData->data()->data()->data(), invertRect); + imageBuffer->putPremultipliedImageData(imageData.get(), IntRect(IntPoint(), rect.size()), IntPoint()); + gc.save(); + gc.translate(FloatSize(0.0f, bitmapHeight)); + gc.scale(FloatSize(1.0f, -1.0f)); + // Use invertRect in next line, so that transform above inverts it back to + // desired destination rect. + gc.drawImageBuffer(imageBuffer.get(), DeviceColorSpace, invertRect.location()); + gc.restore(); + } +} +#endif +void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) +{ + if (isAcceleratedCompositingActive()) { #if USE(ACCELERATED_COMPOSITING) - if (!isAcceleratedCompositingActive()) { + doComposite(); + + // If a canvas was passed in, we use it to grab a copy of the + // freshly-rendered pixels. + if (canvas) { + // Clip rect to the confines of the rootLayerTexture. + IntRect resizeRect(rect); + resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->rootLayerTextureSize())); + doPixelReadbackToCanvas(canvas, resizeRect); + } + + // Temporarily present so the downstream Chromium renderwidget still renders. + // FIXME: remove this call once the changes to Chromium's renderwidget have landed. + m_layerRenderer->present(); #endif + } else { WebFrameImpl* webframe = mainFrameImpl(); if (webframe) webframe->paint(canvas, rect); -#if USE(ACCELERATED_COMPOSITING) - } else { - // Draw the contents of the root layer. - updateRootLayerContents(rect); + } +} - WebFrameImpl* webframe = mainFrameImpl(); - if (!webframe) - return; - FrameView* view = webframe->frameView(); - if (!view) - return; +void WebViewImpl::themeChanged() +{ + if (!page()) + return; + FrameView* view = page()->mainFrame()->view(); - // The visibleRect includes scrollbars whereas the contentRect doesn't. - IntRect visibleRect = view->visibleContentRect(true); - IntRect contentRect = view->visibleContentRect(false); + WebRect damagedRect(0, 0, m_size.width, m_size.height); + view->invalidateRect(damagedRect); +} - // Ask the layer compositor to redraw all the layers. - ASSERT(m_layerRenderer->hardwareCompositing()); - m_layerRenderer->drawLayers(rect, visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY())); - } +void WebViewImpl::composite(bool finish) +{ +#if USE(ACCELERATED_COMPOSITING) + doComposite(); + + // Finish if requested. + if (finish) + m_layerRenderer->finish(); + + // Put result onscreen. + m_layerRenderer->present(); #endif } @@ -1474,16 +1539,23 @@ int WebViewImpl::setZoomLevel(bool textOnly, int zoomLevel) maxTextSizeMultiplier), minTextSizeMultiplier)); Frame* frame = mainFrameImpl()->frame(); - FrameView* view = frame->view(); - if (!view) - return m_zoomLevel; - if (zoomFactor != view->zoomFactor()) { - view->setZoomFactor(zoomFactor, textOnly ? ZoomTextOnly : ZoomPage); + + float oldZoomFactor = m_zoomTextOnly ? frame->textZoomFactor() : frame->pageZoomFactor(); + + if (textOnly) + frame->setPageAndTextZoomFactors(1, zoomFactor); + else + frame->setPageAndTextZoomFactors(zoomFactor, 1); + + if (oldZoomFactor != zoomFactor || textOnly != m_zoomTextOnly) { WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromFrame(frame); if (pluginContainer) pluginContainer->plugin()->setZoomFactor(zoomFactor, textOnly); - m_zoomLevel = zoomLevel; } + + m_zoomLevel = zoomLevel; + m_zoomTextOnly = textOnly; + return m_zoomLevel; } @@ -1904,6 +1976,11 @@ bool WebViewImpl::isActive() const return (page() && page()->focusController()) ? page()->focusController()->isActive() : false; } +void WebViewImpl::setDomainRelaxationForbidden(bool forbidden, const WebString& scheme) +{ + SecurityOrigin::setDomainRelaxationForbiddenForURLScheme(forbidden, String(scheme)); +} + void WebViewImpl::setScrollbarColors(unsigned inactiveColor, unsigned activeColor, unsigned trackColor) { @@ -2114,24 +2191,126 @@ bool WebViewImpl::allowsAcceleratedCompositing() void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) { + bool wasActive = m_isAcceleratedCompositingActive; setIsAcceleratedCompositingActive(layer ? true : false); if (m_layerRenderer) m_layerRenderer->setRootLayer(layer); + if (wasActive != m_isAcceleratedCompositingActive) { + IntRect damagedRect(0, 0, m_size.width, m_size.height); + if (m_isAcceleratedCompositingActive) + invalidateRootLayerRect(damagedRect); + else + m_client->didInvalidateRect(damagedRect); + } +} + +void WebViewImpl::setRootLayerNeedsDisplay() +{ + if (m_layerRenderer) + m_layerRenderer->setNeedsDisplay(); + m_client->scheduleComposite(); + // FIXME: To avoid breaking the downstream Chrome render_widget while downstream + // changes land, we also have to pass a 1x1 invalidate up to the client + { + WebRect damageRect(0, 0, 1, 1); + m_client->didInvalidateRect(damageRect); + } } + +void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& clipRect) +{ + // FIXME: To avoid breaking the Chrome render_widget when the new compositor render + // path is not checked in, we must still pass scroll damage up to the client. This + // code will be backed out in a followup CL once the Chromium changes have landed. + m_client->didScrollRect(scrollDelta.width(), scrollDelta.height(), clipRect); + + ASSERT(m_layerRenderer); + // Compute the damage rect in viewport space. + WebFrameImpl* webframe = mainFrameImpl(); + if (!webframe) + return; + FrameView* view = webframe->frameView(); + if (!view) + return; + + IntRect contentRect = view->visibleContentRect(false); + + // We support fast scrolling in one direction at a time. + if (scrollDelta.width() && scrollDelta.height()) { + invalidateRootLayerRect(WebRect(contentRect)); + return; + } + + // Compute the region we will expose by scrolling. We use the + // content rect for invalidation. Using this space for damage + // rects allows us to intermix invalidates with scrolls. + IntRect damagedContentsRect; + if (scrollDelta.width()) { + float dx = static_cast<float>(scrollDelta.width()); + damagedContentsRect.setY(contentRect.y()); + damagedContentsRect.setHeight(contentRect.height()); + if (dx > 0) { + damagedContentsRect.setX(contentRect.x()); + damagedContentsRect.setWidth(dx); + } else { + damagedContentsRect.setX(contentRect.right() + dx); + damagedContentsRect.setWidth(-dx); + } + } else { + float dy = static_cast<float>(scrollDelta.height()); + damagedContentsRect.setX(contentRect.x()); + damagedContentsRect.setWidth(contentRect.width()); + if (dy > 0) { + damagedContentsRect.setY(contentRect.y()); + damagedContentsRect.setHeight(dy); + } else { + damagedContentsRect.setY(contentRect.bottom() + dy); + damagedContentsRect.setHeight(-dy); + } + } + + m_scrollDamage.unite(damagedContentsRect); + setRootLayerNeedsDisplay(); +} + +void WebViewImpl::invalidateRootLayerRect(const IntRect& rect) +{ + // FIXME: To avoid breaking the Chrome render_widget when the new compositor render + // path is not checked in, we must still pass damage up to the client. This + // code will be backed out in a followup CL once the Chromium changes have landed. + m_client->didInvalidateRect(rect); + + ASSERT(m_layerRenderer); + + if (!page()) + return; + FrameView* view = page()->mainFrame()->view(); + + // rect is in viewport space. Convert to content space + // so that invalidations and scroll invalidations play well with one-another. + FloatRect contentRect = view->windowToContents(rect); + + // FIXME: add a smarter damage aggregation logic? Right now, LayerChromium does simple union-ing. + m_layerRenderer->rootLayer()->setNeedsDisplay(contentRect); +} + + void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { if (m_isAcceleratedCompositingActive == active) return; if (active) { - m_layerRenderer = LayerRendererChromium::create(getOnscreenGLES2Context()); + OwnPtr<GraphicsContext3D> context = m_temporaryOnscreenGraphicsContext3D.release(); + if (!context) { + context = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + if (context) + context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + } + m_layerRenderer = LayerRendererChromium::create(context.release()); if (m_layerRenderer) { m_isAcceleratedCompositingActive = true; - - // Force a redraw the entire view so that the compositor gets the entire view, - // rather than just the currently-dirty subset. - m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height)); } else { m_isAcceleratedCompositingActive = false; m_compositorCreationFailed = true; @@ -2142,17 +2321,11 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) } } -void WebViewImpl::updateRootLayerContents(const WebRect& rect) +void WebViewImpl::updateRootLayerContents(const IntRect& rect) { if (!isAcceleratedCompositingActive()) return; - // FIXME: The accelerated compositing path invalidates a 1x1 rect at (0, 0) - // in order to get the renderer to ask the compositor to redraw. This is only - // temporary until we get the compositor to render directly from its own thread. - if (!rect.x && !rect.y && rect.width == 1 && rect.height == 1) - return; - WebFrameImpl* webframe = mainFrameImpl(); if (!webframe) return; @@ -2164,7 +2337,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) if (rootLayer) { IntRect visibleRect = view->visibleContentRect(true); - m_layerRenderer->setRootLayerCanvasSize(IntSize(rect.width, rect.height)); + m_layerRenderer->setRootLayerCanvasSize(IntSize(rect.width(), rect.height())); GraphicsContext* rootLayerContext = m_layerRenderer->rootLayerGraphicsContext(); #if PLATFORM(SKIA) @@ -2174,7 +2347,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) platformCanvas->save(); // Bring the canvas into the coordinate system of the paint rect. - platformCanvas->translate(static_cast<SkScalar>(-rect.x), static_cast<SkScalar>(-rect.y)); + platformCanvas->translate(static_cast<SkScalar>(-rect.x()), static_cast<SkScalar>(-rect.y())); rootLayerContext->save(); @@ -2188,7 +2361,7 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) CGContextSaveGState(cgContext); // Bring the CoreGraphics context into the coordinate system of the paint rect. - CGContextTranslateCTM(cgContext, -rect.x, -rect.y); + CGContextTranslateCTM(cgContext, -rect.x(), -rect.y()); rootLayerContext->save(); @@ -2202,62 +2375,88 @@ void WebViewImpl::updateRootLayerContents(const WebRect& rect) } } -void WebViewImpl::setRootLayerNeedsDisplay() +void WebViewImpl::doComposite() { - // FIXME: For now we're posting a repaint event for the entire page which is an overkill. - if (WebFrameImpl* webframe = mainFrameImpl()) { - if (FrameView* view = webframe->frameView()) { - // FIXME: Temporary hack to invalidate part of the page so that we get called to render - // again. - IntRect visibleRect = view->visibleContentRect(true); - m_client->didInvalidateRect(IntRect(0, 0, 1, 1)); + ASSERT(isAcceleratedCompositingActive()); + if (!page()) + return; + FrameView* view = page()->mainFrame()->view(); + + // The visibleRect includes scrollbars whereas the contentRect doesn't. + IntRect visibleRect = view->visibleContentRect(true); + IntRect contentRect = view->visibleContentRect(false); + IntRect viewPort = IntRect(0, 0, m_size.width, m_size.height); + + // Give the compositor a chance to setup/resize the root texture handle and perform scrolling. + m_layerRenderer->prepareToDrawLayers(visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY())); + + // Draw the contents of the root layer. + Vector<FloatRect> damageRects; + damageRects.append(m_scrollDamage); + damageRects.append(m_layerRenderer->rootLayer()->dirtyRect()); + for (size_t i = 0; i < damageRects.size(); ++i) { + // The damage rect for the root layer is in content space [e.g. unscrolled]. + // Convert from content space to viewPort space. + const FloatRect damagedContentRect = damageRects[i]; + IntRect damagedRect = view->contentsToWindow(IntRect(damagedContentRect)); + + // Intersect this rectangle with the viewPort. + damagedRect.intersect(viewPort); + + // Now render it. + if (damagedRect.width() && damagedRect.height()) { + updateRootLayerContents(damagedRect); + m_layerRenderer->updateRootLayerTextureRect(damagedRect); } } + m_layerRenderer->rootLayer()->resetNeedsDisplay(); + m_scrollDamage = WebRect(); - if (m_layerRenderer) - m_layerRenderer->setNeedsDisplay(); + // Draw the actual layers... + m_layerRenderer->drawLayers(visibleRect, contentRect); } -#endif // USE(ACCELERATED_COMPOSITING) +#endif -PassOwnPtr<GLES2Context> WebViewImpl::getOnscreenGLES2Context() -{ - WebGLES2Context* context = gles2Context(); - if (!context) - return 0; - return GLES2Context::create(GLES2ContextInternal::create(context, false)); -} SharedGraphicsContext3D* WebViewImpl::getSharedGraphicsContext3D() { if (!m_sharedContext3D) { GraphicsContext3D::Attributes attr; OwnPtr<GraphicsContext3D> context = GraphicsContext3D::create(attr, m_page->chrome()); + if (!context) + return 0; m_sharedContext3D = SharedGraphicsContext3D::create(context.release()); } return m_sharedContext3D.get(); } -// Returns the GLES2 context associated with this View. If one doesn't exist -// it will get created first. WebGLES2Context* WebViewImpl::gles2Context() { - if (!m_gles2Context) { - m_gles2Context = webKitClient()->createGLES2Context(); - if (!m_gles2Context) - return 0; - - if (!m_gles2Context->initialize(this, 0)) { - m_gles2Context.clear(); - return 0; - } + return 0; +} +WebGraphicsContext3D* WebViewImpl::graphicsContext3D() +{ +#if USE(ACCELERATED_COMPOSITING) + GraphicsContext3D* context = 0; + if (m_layerRenderer) + context = m_layerRenderer->context(); + else if (m_temporaryOnscreenGraphicsContext3D) + context = m_temporaryOnscreenGraphicsContext3D.get(); + else { + GraphicsContext3D::Attributes attributes; + m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); #if OS(DARWIN) - m_gles2Context->resizeOnscreenContent(WebSize(std::max(1, m_size.width), - std::max(1, m_size.height))); + if (m_temporaryOnscreenGraphicsContext3D) + m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); #endif + context = m_temporaryOnscreenGraphicsContext3D.get(); } - return m_gles2Context.get(); + return GraphicsContext3DInternal::extractWebGraphicsContext3D(context); +#else + return 0; +#endif } } // namespace WebKit diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h index a42099c..bbd25a2 100644 --- a/WebKit/chromium/src/WebViewImpl.h +++ b/WebKit/chromium/src/WebViewImpl.h @@ -31,9 +31,9 @@ #ifndef WebViewImpl_h #define WebViewImpl_h -#include "WebGLES2Context.h" #include "WebNavigationPolicy.h" #include "WebPoint.h" +#include "WebRect.h" #include "WebSize.h" #include "WebString.h" #include "WebView.h" @@ -43,8 +43,10 @@ #include "ContextMenuClientImpl.h" #include "DragClientImpl.h" #include "EditorClientImpl.h" +#include "GraphicsContext3D.h" #include "GraphicsLayer.h" #include "InspectorClientImpl.h" +#include "IntRect.h" #include "LayerRendererChromium.h" #include "NotificationPresenterImpl.h" #include "SpeechInputClientImpl.h" @@ -54,7 +56,6 @@ namespace WebCore { class ChromiumDataObject; class Frame; -class GLES2Context; class HistoryItem; class HitTestResult; class KeyboardEvent; @@ -92,6 +93,8 @@ public: virtual void resize(const WebSize&); virtual void layout(); virtual void paint(WebCanvas*, const WebRect&); + virtual void themeChanged(); + virtual void composite(bool finish); virtual bool handleInputEvent(const WebInputEvent&); virtual void mouseCaptureLost(); virtual void setFocus(bool enable); @@ -119,6 +122,7 @@ public: virtual void setTabKeyCyclesThroughElements(bool value); virtual bool isActive() const; virtual void setIsActive(bool value); + virtual void setDomainRelaxationForbidden(bool, const WebString& scheme); virtual bool dispatchBeforeUnloadEvent(); virtual void dispatchUnloadEvent(); virtual WebFrame* mainFrame(); @@ -322,21 +326,28 @@ public: } #if USE(ACCELERATED_COMPOSITING) - void setRootLayerNeedsDisplay(); - void setRootGraphicsLayer(WebCore::PlatformLayer*); bool allowsAcceleratedCompositing(); + void setRootGraphicsLayer(WebCore::PlatformLayer*); + void setRootLayerNeedsDisplay(); + void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect); + void invalidateRootLayerRect(const WebCore::IntRect&); #endif - // Onscreen contexts display to the screen associated with this view. - // Offscreen contexts render offscreen but can share resources with the - // onscreen context and thus can be composited. - PassOwnPtr<WebCore::GLES2Context> getOnscreenGLES2Context(); - - // Returns an onscreen context + // FIXME: remove this method once the compositor is fully switched + // over to GraphicsContext3D. virtual WebGLES2Context* gles2Context(); + + // Returns the onscreen 3D context used by the compositor. This is + // used by the renderer's code to set up resource sharing between + // the compositor's context and subordinate contexts for APIs like + // WebGL. Returns 0 if compositing support is not compiled in. + virtual WebGraphicsContext3D* graphicsContext3D(); + virtual WebCore::SharedGraphicsContext3D* getSharedGraphicsContext3D(); WebCore::PopupContainer* selectPopup() const { return m_selectPopup.get(); } + bool zoomTextOnly() const { return m_zoomTextOnly; } + // Returns true if the event leads to scrolling. static bool mapKeyCodeForScroll(int keyCode, WebCore::ScrollDirection* scrollDirection, @@ -386,7 +397,9 @@ private: #if USE(ACCELERATED_COMPOSITING) void setIsAcceleratedCompositingActive(bool); - void updateRootLayerContents(const WebRect&); + void updateRootLayerContents(const WebCore::IntRect&); + void doComposite(); + void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); #endif WebViewClient* m_client; @@ -433,6 +446,8 @@ private: // mean zoom in, negative numbers mean zoom out. int m_zoomLevel; + bool m_zoomTextOnly; + bool m_contextMenuAllowed; bool m_doingDragAndDrop; @@ -511,6 +526,7 @@ private: RefPtr<WebCore::Node> m_mouseCaptureNode; #if USE(ACCELERATED_COMPOSITING) + WebCore::IntRect m_scrollDamage; OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer; bool m_isAcceleratedCompositingActive; bool m_compositorCreationFailed; @@ -520,8 +536,10 @@ private: #if ENABLE(INPUT_SPEECH) SpeechInputClientImpl m_speechInputClient; #endif - - OwnPtr<WebGLES2Context> m_gles2Context; + // If we attempt to fetch the on-screen GraphicsContext3D before + // the compositor has been turned on, we need to instantiate it + // early. This member holds on to the GC3D in this case. + OwnPtr<WebCore::GraphicsContext3D> m_temporaryOnscreenGraphicsContext3D; RefPtr<WebCore::SharedGraphicsContext3D> m_sharedContext3D; diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js deleted file mode 100644 index 5a8a7bf..0000000 --- a/WebKit/chromium/src/js/DebuggerScript.js +++ /dev/null @@ -1,271 +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. - */ - -(function () { - -var DebuggerScript = {}; -DebuggerScript._breakpoints = {}; - -DebuggerScript.PauseOnExceptionsState = { - DontPauseOnExceptions : 0, - PauseOnAllExceptions : 1, - PauseOnUncaughtExceptions: 2 -}; - -DebuggerScript.ScriptWorldType = { - MainWorld : 0, - ExtensionsWorld : 1 -}; - -DebuggerScript._pauseOnExceptionsState = DebuggerScript.PauseOnExceptionsState.DontPauseOnExceptions; -Debug.clearBreakOnException(); -Debug.clearBreakOnUncaughtException(); - -DebuggerScript.getAfterCompileScript = function(eventData) -{ - return DebuggerScript._formatScript(eventData.script_.script_); -} - -DebuggerScript.getScripts = function(contextData) -{ - var result = []; - - if (!contextData) - return result; - var comma = contextData.indexOf(","); - if (comma === -1) - return result; - // Context data is a string in the following format: - // ("page"|"injected")","<page id> - var idSuffix = contextData.substring(comma); // including the comma - - var scripts = Debug.scripts(); - for (var i = 0; i < scripts.length; ++i) { - var script = scripts[i]; - if (script.context_data && script.context_data.lastIndexOf(idSuffix) != -1) - result.push(DebuggerScript._formatScript(script)); - } - return result; -} - -DebuggerScript._formatScript = function(script) -{ - var scriptWorldType = DebuggerScript.ScriptWorldType.MainWorld; - if (script.context_data && script.context_data.indexOf("injected") == 0) - scriptWorldType = DebuggerScript.ScriptWorldType.ExtensionsWorld; - return { - id: script.id, - name: script.nameOrSourceURL(), - source: script.source, - lineOffset: DebuggerScript._v8ToWebkitLineNumber(script.line_offset), - lineCount: script.lineCount(), - scriptWorldType: scriptWorldType - }; -} - -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) - Debug.disableScriptBreakPoint(breakId); - - var locations = Debug.findBreakPointActualLocations(breakId); - var actualLineNumber = locations.length ? locations[0].line : args.lineNumber; - - var key = args.scriptId + ":" + actualLineNumber; - if (key in DebuggerScript._breakpoints) { - // Remove old breakpoint. - Debug.findBreakPoint(DebuggerScript._breakpoints[key], true); - } - DebuggerScript._breakpoints[key] = breakId; - return DebuggerScript._v8ToWebkitLineNumber(actualLineNumber); -} - -DebuggerScript.removeBreakpoint = function(execState, args) -{ - args.lineNumber = DebuggerScript._webkitToV8LineNumber(args.lineNumber); - var key = args.scriptId + ":" + args.lineNumber; - var breakId = DebuggerScript._breakpoints[key]; - if (breakId) - Debug.findBreakPoint(breakId, true); - delete DebuggerScript._breakpoints[key]; -} - -DebuggerScript.pauseOnExceptionsState = function() -{ - return DebuggerScript._pauseOnExceptionsState; -} - -DebuggerScript.setPauseOnExceptionsState = function(newState) -{ - DebuggerScript._pauseOnExceptionsState = newState; - - if (DebuggerScript.PauseOnExceptionsState.PauseOnAllExceptions === newState) - Debug.setBreakOnException(); - else - Debug.clearBreakOnException(); - - if (DebuggerScript.PauseOnExceptionsState.PauseOnUncaughtExceptions === newState) - Debug.setBreakOnUncaughtException(); - else - Debug.clearBreakOnUncaughtException(); -} - -DebuggerScript.currentCallFrame = function(execState, args) -{ - var frameCount = execState.frameCount(); - if (frameCount === 0) - return undefined; - - var topFrame; - for (var i = frameCount - 1; i >= 0; i--) { - var frameMirror = execState.frame(i); - topFrame = DebuggerScript._frameMirrorToJSCallFrame(frameMirror, topFrame); - } - return topFrame; -} - -DebuggerScript.stepIntoStatement = function(execState) -{ - execState.prepareStep(Debug.StepAction.StepIn, 1); -} - -DebuggerScript.stepOverStatement = function(execState) -{ - execState.prepareStep(Debug.StepAction.StepNext, 1); -} - -DebuggerScript.stepOutOfFunction = function(execState) -{ - execState.prepareStep(Debug.StepAction.StepOut, 1); -} - -DebuggerScript.editScriptSource = function(scriptId, newSource) -{ - var scripts = Debug.scripts(); - var scriptToEdit = null; - for (var i = 0; i < scripts.length; i++) { - if (scripts[i].id == scriptId) { - scriptToEdit = scripts[i]; - break; - } - } - if (!scriptToEdit) - throw("Script not found"); - - var changeLog = []; - Debug.LiveEdit.SetScriptSource(scriptToEdit, newSource, false, changeLog); - return scriptToEdit.source; -} - -DebuggerScript.clearBreakpoints = function(execState, args) -{ - for (var key in DebuggerScript._breakpoints) { - var breakId = DebuggerScript._breakpoints[key]; - Debug.findBreakPoint(breakId, true); - } - DebuggerScript._breakpoints = {}; -} - -DebuggerScript.setBreakpointsActivated = function(execState, args) -{ - Debug.debuggerFlags().breakPointsActive.setValue(args.enabled); -} - -DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame) -{ - // Get function name. - var func; - try { - func = frameMirror.func(); - } catch(e) { - } - var functionName; - if (func) - functionName = func.name() || func.inferredName(); - - // Get script ID. - var script = func.script(); - var sourceID = script && script.id(); - - // Get line number. - var line = DebuggerScript._v8ToWebkitLineNumber(frameMirror.sourceLine()); - - // Get this object. - var thisObject = frameMirror.details_.receiver(); - - // Get scope chain array in format: [<scope type>, <scope object>, <scope type>, <scope object>,...] - var scopeChain = []; - var scopeType = []; - for (var i = 0; i < frameMirror.scopeCount(); i++) { - var scopeMirror = frameMirror.scope(i); - var scopeObjectMirror = scopeMirror.scopeObject(); - var properties = scopeObjectMirror.properties(); - var scopeObject = {}; - for (var j = 0; j < properties.length; j++) - scopeObject[properties[j].name()] = properties[j].value_; - // Reset scope object prototype to null so that the proto properties - // don't appear in th local scope section. - scopeObject.__proto__ = null; - scopeType.push(scopeMirror.scopeType()); - scopeChain.push(scopeObject); - } - - function evaluate(expression) { - return frameMirror.evaluate(expression, false).value(); - } - - return { - "sourceID": sourceID, - "line": line, - "functionName": functionName, - "type": "function", - "thisObject": thisObject, - "scopeChain": scopeChain, - "scopeType": scopeType, - "evaluate": evaluate, - "caller": callerFrame - }; -} - -DebuggerScript._webkitToV8LineNumber = function(line) -{ - return line - 1; -}; - -DebuggerScript._v8ToWebkitLineNumber = function(line) -{ - return line + 1; -}; - -return DebuggerScript; - -})(); diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js index f55be4e..0c7241d 100644 --- a/WebKit/chromium/src/js/DevTools.js +++ b/WebKit/chromium/src/js/DevTools.js @@ -162,7 +162,3 @@ WebInspector.resetToolbarColors = function() } -// TODO(yurys): should be removed when eclipse debugger stops using it. -if (window.RemoteDebuggerAgent) { - RemoteDebuggerAgent.setContextId = function() {}; -} diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js index 2233463..5cebb52 100644 --- a/WebKit/chromium/src/js/Tests.js +++ b/WebKit/chromium/src/js/Tests.js @@ -953,230 +953,6 @@ TestSuite.prototype._waitUntilScriptsAreParsed = function(expectedScripts, callb /** - * Gets a XPathResult matching given xpath. - * @param {string} xpath - * @param {number} resultType - * @param {Node} opt_ancestor Context node. If not specified documentElement - * will be used - * @return {XPathResult} Type of returned value is determined by "resultType" parameter - */ - -TestSuite.prototype._evaluateXpath = function(xpath, resultType, opt_ancestor) -{ - if (!opt_ancestor) - opt_ancestor = document.documentElement; - try { - return document.evaluate(xpath, opt_ancestor, null, resultType, null); - } catch(e) { - this.fail('Error in expression: "' + xpath + '".' + e); - } -}; - - -/** - * Gets first Node matching given xpath. - * @param {string} xpath - * @param {Node} opt_ancestor Context node. If not specified documentElement - * will be used - * @return {?Node} - */ -TestSuite.prototype._findNode = function(xpath, opt_ancestor) -{ - var result = this._evaluateXpath(xpath, XPathResult.FIRST_ORDERED_NODE_TYPE, opt_ancestor).singleNodeValue; - this.assertTrue(!!result, "Cannot find node on path: " + xpath); - return result; -}; - - -/** - * Gets a text matching given xpath. - * @param {string} xpath - * @param {Node} opt_ancestor Context node. If not specified documentElement - * will be used - * @return {?string} - */ -TestSuite.prototype._findText = function(xpath, opt_ancestor) -{ - var result = this._evaluateXpath(xpath, XPathResult.STRING_TYPE, opt_ancestor).stringValue; - this.assertTrue(!!result, "Cannot find text on path: " + xpath); - return result; -}; - - -/** - * Gets an iterator over nodes matching given xpath. - * @param {string} xpath - * @param {Node} opt_ancestor Context node. If not specified, documentElement - * will be used - * @return {XPathResult} Iterator over the nodes - */ -TestSuite.prototype._nodeIterator = function(xpath, opt_ancestor) -{ - return this._evaluateXpath(xpath, XPathResult.ORDERED_NODE_ITERATOR_TYPE, opt_ancestor); -}; - - -/** - * Checks the scopeSectionDiv against the expectations. - * @param {Node} scopeSectionDiv The section div - * @param {Object} expectations Expectations dictionary - */ -TestSuite.prototype._checkScopeSectionDiv = function(scopeSectionDiv, expectations) -{ - var scopeTitle = this._findText('./div[@class="header"]/div[@class="title"]/text()', scopeSectionDiv); - this.assertEquals(expectations.title, scopeTitle, "Unexpected scope section title."); - if (!expectations.properties) - return; - this.assertTrue(scopeSectionDiv.hasStyleClass("expanded"), 'Section "' + scopeTitle + '" is collapsed.'); - - var propertyIt = this._nodeIterator("./ol/li", scopeSectionDiv); - var propertyLi; - var foundProps = []; - while (propertyLi = propertyIt.iterateNext()) { - var name = this._findText('./span[@class="name"]/text()', propertyLi); - var value = this._findText('./span[@class="value"]/text()', propertyLi); - this.assertTrue(!!name, 'Invalid variable name: "' + name + '"'); - this.assertTrue(name in expectations.properties, "Unexpected property: " + name); - this.assertEquals(expectations.properties[name], value, 'Unexpected "' + name + '" property value.'); - delete expectations.properties[name]; - foundProps.push(name + " = " + value); - } - - // Check that all expected properties were found. - for (var p in expectations.properties) - this.fail('Property "' + p + '" was not found in scope "' + scopeTitle + '". Found properties: "' + foundProps.join(",") + '"'); -}; - - -/** - * Expands scope sections matching the filter and invokes the callback on - * success. - * @param {function(WebInspector.ObjectPropertiesSection, number):boolean} - * filter - * @param {Function} callback - */ -TestSuite.prototype._expandScopeSections = function(filter, callback) -{ - var sections = WebInspector.currentPanel.sidebarPanes.scopechain.sections; - - var toBeUpdatedCount = 0; - function updateListener() { - --toBeUpdatedCount; - if (toBeUpdatedCount === 0) { - // Report when all scopes are expanded and populated. - callback(); - } - } - - // Global scope is always the last one. - for (var i = 0; i < sections.length - 1; i++) { - var section = sections[i]; - if (!filter(sections, i)) - continue; - ++toBeUpdatedCount; - var populated = section.populated; - - this._hookGetPropertiesCallback(updateListener, - function() { - section.expand(); - if (populated) { - // Make sure "updateProperties" callback will be called at least once - // after it was overridden. - section.update(); - } - }); - } -}; - - -/** - * Tests that scopes can be expanded and contain expected data. - */ -TestSuite.prototype.testExpandScope = function() -{ - this.showPanel("scripts"); - var test = this; - - this._executeCodeWhenScriptsAreParsed("handleClick()", ["debugger_closure.html"]); - - this._waitForScriptPause( - { - functionsOnStack: ["innerFunction", "handleClick", ""], - lineNumber: 8, - lineText: " debugger;" - }, - expandAllSectionsExceptGlobal); - - // Expanding Global scope takes for too long so we skeep it. - function expandAllSectionsExceptGlobal() { - test._expandScopeSections(function(sections, i) { - return i < sections.length - 1; - }, - examineScopes /* When all scopes are expanded and populated check them. */); - } - - // Check scope sections contents. - function examineScopes() { - var scopeVariablesSection = test._findNode('//div[@id="scripts-sidebar"]/div[div[@class="title"]/text()="Scope Variables"]'); - var expectedScopes = [ - { - title: "Local", - properties: { - x:"2009", - innerFunctionLocalVar:"2011", - "this": "DOMWindow", - } - }, - { - title: "Closure", - properties: { - n: '"TextParam"', - makeClosureLocalVar: '"local.TextParam"', - } - }, - { - title: "Global", - }, - ]; - var it = test._nodeIterator('./div[@class="body"]/div', scopeVariablesSection); - var scopeIndex = 0; - var scopeDiv; - while (scopeDiv = it.iterateNext()) { - test.assertTrue(scopeIndex < expectedScopes.length, "Too many scopes."); - test._checkScopeSectionDiv(scopeDiv, expectedScopes[scopeIndex]); - ++scopeIndex; - } - test.assertEquals(expectedScopes.length, scopeIndex, "Unexpected number of scopes."); - - test.releaseControl(); - } - - test.takeControl(); -}; - - -/** - * Returns child tree element for a property with given name. - * @param {TreeElement} parent Parent tree element. - * @param {string} childName - * @param {string} objectPath Path to the object. Will be printed in the case - * of failure. - * @return {TreeElement} - */ -TestSuite.prototype._findChildProperty = function(parent, childName, objectPath) -{ - var children = parent.children; - for (var i = 0; i < children.length; i++) { - var treeElement = children[i]; - var property = treeElement.property; - if (property.name === childName) - return treeElement; - } - this.fail('Cannot find property "' + childName + '" in ' + objectPath); -}; - - -/** * Executes the 'code' with InjectedScriptAccess.getProperties overriden * so that all callbacks passed to InjectedScriptAccess.getProperties are * extended with the "hook". diff --git a/WebKit/chromium/tests/PopupMenuTest.cpp b/WebKit/chromium/tests/PopupMenuTest.cpp index 50319af..aef29cf 100644 --- a/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/WebKit/chromium/tests/PopupMenuTest.cpp @@ -128,6 +128,8 @@ public: virtual void resize(const WebSize&) { } virtual void layout() { } virtual void paint(WebCanvas*, const WebRect&) { } + virtual void themeChanged() { } + virtual void composite(bool finish) { } virtual bool handleInputEvent(const WebInputEvent&) { return true; } virtual void mouseCaptureLost() { } virtual void setFocus(bool) { } |