diff options
Diffstat (limited to 'Source/WebKit/chromium')
125 files changed, 3462 insertions, 789 deletions
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog index e5e6149..8becdba 100644 --- a/Source/WebKit/chromium/ChangeLog +++ b/Source/WebKit/chromium/ChangeLog @@ -1,3 +1,1713 @@ +2011-03-29 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Tony Chang. + + [chromium]: Remove the code that called WebViewClient for spelling now that chromium is updated + https://bugs.webkit.org/show_bug.cgi?id=57396 + + * DEPS: + * public/WebFrame.h: + * public/WebView.h: + * public/WebViewClient.h: + (WebKit::WebViewClient::handleCurrentKeyboardEvent): + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::checkSpellingOfString): + (WebKit::EditorClientImpl::requestCheckingOfString): + (WebKit::EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord): + (WebKit::EditorClientImpl::updateSpellingUIWithMisspelledWord): + (WebKit::EditorClientImpl::showSpellingUI): + (WebKit::EditorClientImpl::spellingUIIsShowing): + * src/WebViewImpl.cpp: + (WebKit::WebView::create): + * src/WebViewImpl.h: + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::initializeLoader): + * tests/PopupMenuTest.cpp: + (WebKit::SelectPopupMenuTest::SetUp): + * tests/WebFrameTest.cpp: + (WebKit::TEST_F): + * tests/WebPageSerializerTest.cpp: + (WebKit::WebPageSerializerTest::SetUp): + +2011-03-30 MORITA Hajime <morrita@google.com> + + Reviewed by Dimitri Glazkov. + + [Chromium] Expose the shadow DOM to DumpRenderTree JS tests. + https://bugs.webkit.org/show_bug.cgi?id=56573 + + Added: + - WebBindins::makeNode() to convert WebNode to a JS object, and + - WebElement::shadowRoot(). + + * public/WebBindings.h: + * public/WebElement.h: + * src/WebBindings.cpp: + (WebKit::makeNodeImpl): + (WebKit::WebBindings::makeNode): + * src/WebElement.cpp: + (WebKit::WebElement::shadowRoot): + +2011-03-30 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Chris Fleizach. + + AX: GTK: ARIA role is not respected on <p> <label> <div> and <form> + https://bugs.webkit.org/show_bug.cgi?id=47636 + + Duplicate new internal WebCore roles in the Chromium port. + + * public/WebAccessibilityRole.h: Update enumeration + WebAccessibilityRole to reflect newly added roles in WebCore. + * src/AssertMatchingEnums.cpp: Added new assertions. + +2011-03-30 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: split debugger agent into Page and Worker-specific ones + https://bugs.webkit.org/show_bug.cgi?id=57345 + + ScriptDebugServer and InspectorDebuggerAgent contain only functionality common + for Worker and Page debugger. All specifics is moved into Page/WorkerScriptDebugServer + and Page/WorkerDebuggerAgent. + + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgent::interruptAndDispatch): + (WebKit::WebDevToolsAgent::processPendingMessages): + +2011-03-30 Yury Semikhatsky <yurys@chromium.org> + + Unreviewed. Rollout r82438 and r82436. + + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgent::interruptAndDispatch): + (WebKit::WebDevToolsAgent::processPendingMessages): + +2011-03-30 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: split debugger agent into Page and Worker-specific ones + https://bugs.webkit.org/show_bug.cgi?id=57345 + + ScriptDebugServer and InspectorDebuggerAgent contain only functionality common + for Worker and Page debugger. All specifics is moved into Page/WorkerScriptDebugServer + and Page/WorkerDebuggerAgent. + + * src/DebuggerAgentManager.cpp: + (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgent::interruptAndDispatch): + (WebKit::WebDevToolsAgent::processPendingMessages): + +2011-03-29 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r82293. + http://trac.webkit.org/changeset/82293 + https://bugs.webkit.org/show_bug.cgi?id=57390 + + Breaks RetrieveCSSResources (Requested by abarth|gardener on + #webkit). + + * WebKit.gyp: + * src/WebPageSerializer.cpp: + (WebCore::getSubResourceURLFromElement): + (WebCore::retrieveResourcesForElement): + (WebCore::retrieveResourcesForFrame): + (WebKit::WebPageSerializer::retrieveAllResources): + * tests/WebPageSerializerTest.cpp: + * tests/data/pageserialization/css_test_page.html: Removed. + * tests/data/pageserialization/import_style_from_link.css: Removed. + * tests/data/pageserialization/import_styles.css: Removed. + * tests/data/pageserialization/link_styles.css: Removed. + +2011-03-29 Tony Chang <tony@chromium.org> + + Roll chromium version to r79710 to pick up libpng changes. + + * DEPS: + +2011-03-29 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r82295 and r82300. + http://trac.webkit.org/changeset/82295 + http://trac.webkit.org/changeset/82300 + https://bugs.webkit.org/show_bug.cgi?id=57380 + + This patch breaks compile on Chromium (Requested by + abarth|gardener on #webkit). + + * public/WebAccessibilityRole.h: + * src/AssertMatchingEnums.cpp: + +2011-03-29 Mario Sanchez Prada <msanchez@igalia.com> + + Reviewed by Adam Barth. + + REGRESSION(r82295): This patch does not compile on Chromium (Requested by abarth|gardener on #webkit). + https://bugs.webkit.org/show_bug.cgi?id=57377 + + Fix build errors on Chromium bots. + + * public/WebAccessibilityRole.h: Update to reflect newly added roles in WebCore. + * src/AssertMatchingEnums.cpp: Ditto. + +2011-03-29 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPS + https://bugs.webkit.org/show_bug.cgi?id=57361 + + * DEPS: + +2011-03-29 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Adding retrieval off CSS resources to WebPageSerializer::retrieveAllResources. + https://bugs.webkit.org/show_bug.cgi?id=56650 + + * WebKit.gyp: + * src/WebPageSerializer.cpp: + (WebCore::getResourceAttributeForElement): + (WebCore::retrieveStyleSheetForElement): + (WebCore::retrieveResourcesForElement): + (WebCore::retrieveResourcesForFrame): + (WebCore::retrieveResourcesForCSSRule): + (WebCore::retrieveResourcesForCSSStyleDeclaration): + (WebCore::retrieveResourcesForCSSStyleSheet): + (WebKit::WebPageSerializer::retrieveAllResources): + * tests/WebPageSerializerTest.cpp: + (WebKit::TestWebFrameClient::TestWebFrameClient): + (WebKit::TestWebFrameClient::allowScript): + (WebKit::WebPageSerializerTest::enableJS): + (WebKit::WebPageSerializerTest::runOnLoad): + (WebKit::TEST_F): + * tests/data/pageserialization/css_test_page.html: Added. + * tests/data/pageserialization/import_style_from_link.css: Added. + (#divOrange): + * tests/data/pageserialization/import_styles.css: Added. + (#divYellow): + * tests/data/pageserialization/link_styles.css: Added. + (#divRed): + +2011-03-29 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Inspector does not always shows transferred size correctly (e.g. gzipped/chunked content) + https://bugs.webkit.org/show_bug.cgi?id=56602 + + Added new methods to interface while keeping the old ones to keep + chromium working until it is also patched. + + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData2): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + (WebCore::ResourceHandleInternal::didReceiveData2): + +2011-03-29 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: [Chromium] DevTools shows two resources for each plugin resource loaded + https://bugs.webkit.org/show_bug.cgi?id=57101 + + Remove DevToolsAgent network callbacks as this information is now available through ResourceLoader + + * public/WebDevToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebDevToolsAgentImpl.h: + +2011-03-29 Emil A Eklund <eae@chromium.org> + + Reviewed by Dimitri Glazkov. + + Relative mouse coordinates recalculated for each target + https://bugs.webkit.org/show_bug.cgi?id=57130 + + * public/WebDOMMouseEvent.h: + * src/WebDOMMouseEvent.cpp: + (WebKit::WebDOMMouseEvent::layerX): + (WebKit::WebDOMMouseEvent::layerY): + (WebKit::WebDOMMouseEvent::offsetX): + (WebKit::WebDOMMouseEvent::offsetY): + +2011-03-29 Yuta Kitamura <yutak@chromium.org> + + Unreviewed, rolling out r82195. + http://trac.webkit.org/changeset/82195 + https://bugs.webkit.org/show_bug.cgi?id=56602 + + Broke Chromium Clang builds. + + * public/WebDevToolsAgent.h: + * public/WebURLLoaderClient.h: + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didReceiveData): + * src/WebDevToolsAgentImpl.h: + +2011-03-29 Yuta Kitamura <yutak@chromium.org> + + Unreviewed. Another build fix. The last fix was incorrect. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::supportsFullscreenForNode): + (WebKit::ChromeClientImpl::supportsFullScreenForElement): + * src/ChromeClientImpl.h: + +2011-03-29 Yuta Kitamura <yutak@chromium.org> + + Unreviewed. Build fix for Chromium Clang bot. + + * src/ChromeClientImpl.cpp: + (WebKit::ChromeClientImpl::supportsFullscreenForNode): + * src/ChromeClientImpl.h: + +2011-03-28 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Inspector does not always shows transferred size correctly (e.g. gzipped/chunked content) + https://bugs.webkit.org/show_bug.cgi?id=56602 + + Added new methods to interface while keeping the old ones to keep + chromium working until it is also patched. + + * public/WebDevToolsAgent.h: + * public/WebURLLoaderClient.h: + (WebKit::WebURLLoaderClient::didReceiveData): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didReceiveData): + * src/WebDevToolsAgentImpl.h: + +2011-03-28 Tony Chang <tony@chromium.org> + + Reviewed by Adam Barth. + + [chromium] have DRT write the png checksum into a png comment + https://bugs.webkit.org/show_bug.cgi?id=57255 + + * DEPS: Pull in version of chromium with comment writing + +2011-03-28 Adele Peterson <adele@apple.com> + + Build fix. + + * src/WebFrameImpl.cpp: (WebKit::WebFrameImpl::selectionStartHasSpellingMarkerFor): + Call new selectionStartHasMarkerFor method instead of selectionStartHasSpellingMarkerFor. + +2011-03-28 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: fixed chromium build. + + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgent::shouldInterruptForMessage): + +2011-03-25 Andy Estes <aestes@apple.com> + + Reviewed by Adele Peterson. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::objectContentType): + * src/FrameLoaderClientImpl.h: + +2011-03-25 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Data race between ~WorkerFileSystemCallbacksBridge and runTasksOnWorkerThread + https://bugs.webkit.org/show_bug.cgi?id=56138 + Stopped passing the WorkerFileSystemCallbacksBridge's reference to + MainThreadFileSystemCallbacks so that in most cases (in normal cases) + its reference is only maintained by WorkerThread. + + * src/WorkerFileSystemCallbacksBridge.cpp: + (WebKit::MainThreadFileSystemCallbacks::createLeakedPtr): + (WebKit::MainThreadFileSystemCallbacks::MainThreadFileSystemCallbacks): + (WebKit::WorkerFileSystemCallbacksBridge::mayPostTaskToWorker): + * src/WorkerFileSystemCallbacksBridge.h: + +2011-03-24 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Dimitri Glazkov. + + [chromium] Add setters for various client interfaces, and add WebSpellCheckClient + https://bugs.webkit.org/show_bug.cgi?id=57070 + + * public/WebSpellCheckClient.h: Added. + (WebKit::WebSpellCheckClient::spellCheck): + (WebKit::WebSpellCheckClient::requestCheckingOfText): + (WebKit::WebSpellCheckClient::autoCorrectWord): + (WebKit::WebSpellCheckClient::showSpellingUI): + (WebKit::WebSpellCheckClient::isShowingSpellingUI): + (WebKit::WebSpellCheckClient::updateSpellingUIWithMisspelledWord): + (WebKit::WebSpellCheckClient::~WebSpellCheckClient): + * public/WebView.h: + * public/WebViewClient.h: + * src/EditorClientImpl.cpp: + (WebKit::EditorClientImpl::checkSpellingOfString): + (WebKit::EditorClientImpl::requestCheckingOfString): + (WebKit::EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord): + (WebKit::EditorClientImpl::updateSpellingUIWithMisspelledWord): + (WebKit::EditorClientImpl::showSpellingUI): + (WebKit::EditorClientImpl::spellingUIIsShowing): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setWebDevToolsAgentClient): + (WebKit::WebViewImpl::setWebAutoFillClient): + (WebKit::WebViewImpl::setWebSpellCheckClient): + (WebKit::WebViewImpl::WebViewImpl): + * src/WebViewImpl.h: + (WebKit::WebViewImpl::spellCheckClient): + +2011-03-25 Cary Clark <caryclark@google.com> + + Reviewed by Dimitri Glazkov. + + Add CGBitmapContext.h include to WebViewImpl.cpp + https://bugs.webkit.org/show_bug.cgi?id=57097 + + No tests. Exposes no new functionality. + + * src/WebViewImpl.cpp: + +2011-03-25 Adam Klein <adamk@chromium.org> + + Reviewed by David Levin. + + [chromium] Remove deprecated overload of openFileSystem for workers + https://bugs.webkit.org/show_bug.cgi?id=57062 + + * public/WebCommonWorkerClient.h: + +2011-03-25 Chang Shu <cshu@webkit.org> + + Reviewed by Ryosuke Niwa. + + rename Node::isContentEditable and all call sites to rendererIsEditable + https://bugs.webkit.org/show_bug.cgi?id=54290 + + This is part of the effort to separate JS API HTMLElement isContentEditable from + internal Node::rendererIsEditable. + + * src/WebNode.cpp: + (WebKit::WebNode::isContentEditable): + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::setFocus): + (WebKit::WebViewImpl::setComposition): + (WebKit::WebViewImpl::confirmComposition): + +2011-03-25 Mikhail Naganov <mnaganov@chromium.org> + + Roll forward Chromium deps to r79379 to pick up V8 3.2.4.2. + + * DEPS: + +2011-03-24 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81916 and r81917. + http://trac.webkit.org/changeset/81916 + http://trac.webkit.org/changeset/81917 + https://bugs.webkit.org/show_bug.cgi?id=57071 + + broke a test on platforms that do not have QuickTime installed + (Requested by estes on #webkit). + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::objectContentType): + * src/FrameLoaderClientImpl.h: + +2011-03-24 Min Qin <qinmin@google.com> + + Reviewed by James Robinson. + + Allow WebMediaPlayerClient to notify MediaPlayer that the playback state has changed + + https://bugs.webkit.org/show_bug.cgi?id=56837 + + * public/WebMediaPlayerClient.h: + * src/WebMediaPlayerClientImpl.cpp: + (WebKit::WebMediaPlayerClientImpl::playbackStateChanged): + * src/WebMediaPlayerClientImpl.h: + +2011-03-23 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Get rid of WEB_TEXT_CHECKING_RESULT_IS_A_STRUCT since it's not needed anymore + https://bugs.webkit.org/show_bug.cgi?id=56955 + + * DEPS: + * public/WebTextCheckingResult.h: + +2011-03-24 Bill Budge <bbudge@chromium.org> + + Reviewed by Eric Seidel. + + Change a forward declaration of WebURLLoaderOptions to struct to prevent a build break in Chromium. + https://bugs.webkit.org/show_bug.cgi?id=57064 + + No tests. Exposes no new functionality. + + * public/WebFrame.h: + +2011-03-24 Andy Estes <aestes@apple.com> + + Fix the chromium build. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::objectContentType): + +2011-03-24 Andy Estes <aestes@apple.com> + + Reviewed by Darin Adler. + + REGRESSION (r70748): latest nightly builds kills AC_QuickTime.js + https://bugs.webkit.org/show_bug.cgi?id=49016 + + Update objectContentType() implementation to handle the + shouldPreferPlugInsForImages flag. + + * src/FrameLoaderClientImpl.cpp: + (WebKit::FrameLoaderClientImpl::objectContentType): + * src/FrameLoaderClientImpl.h: + +2011-03-24 Bill Budge <bbudge@chromium.org> + + Reviewed by Dmitry Titov. + + Add an overloaded WebFrame::createAssociatedURLLoader method that takes WebURLLoaderOptions, so clients can specify CORS options to allow cross-origin requests. + https://bugs.webkit.org/show_bug.cgi?id=56885 + + No new tests. Exposes no new functionality. + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::createAssociatedURLLoader): + * src/WebFrameImpl.h: + +2011-03-24 Sam Weinig <sam@webkit.org> + + Reviewed by Anders Carlsson. + + Remove legacy version of findPlainText. + https://bugs.webkit.org/show_bug.cgi?id=57056 + + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::scopeStringMatches): + Replace use of legacy findPlainText with a version that + takes an options parameter. + +2011-03-24 Nat Duca <nduca@chromium.org> + + Reviewed by Kenneth Russell. + + [chromium] Add traceEvents to compositor + https://bugs.webkit.org/show_bug.cgi?id=56965 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::composite): + +2011-03-24 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Dimitri Glazkov. + + Add accessibilityObject accessor to WebDocument (needed for + building an accessibility tree that includes iframes). + https://bugs.webkit.org/show_bug.cgi?id=56984 + + * public/WebDocument.h: + * src/WebDocument.cpp: + (WebKit::WebDocument::accessibilityObject): + +2011-03-24 Ilya Sherman <isherman@chromium.org> + + Reviewed by Dimitri Glazkov. + + Expose Node::isFocusable() in the Chromium WebKit API + In service of https://code.google.com/p/chromium/issues/detail?id=72918 + https://bugs.webkit.org/show_bug.cgi?id=56809 + + * public/WebNode.h: + * src/WebNode.cpp: + (WebKit::WebNode::isFocusable): + +2011-03-24 Pavel Feldman <pfeldman@chromium.org> + + Not reviewed: fix chromium compilation. + + * public/WebDevToolsAgent.h: + +2011-03-24 Pavel Feldman <pfeldman@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: brush up Network agent API. + https://bugs.webkit.org/show_bug.cgi?id=57001 + + * public/WebDevToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::identifierForInitialRequest): + (WebKit::WebDevToolsAgentImpl::willSendRequest): + * src/WebDevToolsAgentImpl.h: + +2011-03-24 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Ojan Vafai. + + [chromium] WebBindings::getRangeImpl() should NULL check its NPObject argument + https://bugs.webkit.org/show_bug.cgi?id=56996 + + * src/WebBindings.cpp: + (WebKit::getRangeImpl): + +2011-03-23 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Ojan Vafai. + + [chromium] WebBindings{.h,.cpp}: should use consistent argument naming + https://bugs.webkit.org/show_bug.cgi?id=56898 + + Address FIXME I noted/added in r81676. Wanted to just copy/paste the checking + code from elsewhere in the file, but inconsistent argument naming made it more + difficult than it need be, so first step: use consistent naming. + + * public/WebBindings.h: + * src/WebBindings.cpp: + (WebKit::WebBindings::construct): + (WebKit::WebBindings::enumerate): + (WebKit::WebBindings::evaluate): + (WebKit::WebBindings::evaluateHelper): + (WebKit::WebBindings::getProperty): + (WebKit::WebBindings::hasMethod): + (WebKit::WebBindings::hasProperty): + (WebKit::WebBindings::invoke): + (WebKit::WebBindings::invokeDefault): + (WebKit::WebBindings::releaseObject): + (WebKit::WebBindings::removeProperty): + (WebKit::WebBindings::retainObject): + (WebKit::WebBindings::setException): + (WebKit::WebBindings::setProperty): + (WebKit::WebBindings::unregisterObject): + (WebKit::WebBindings::extractIdentifierData): + (WebKit::getRangeImpl): + (WebKit::getElementImpl): + (WebKit::makeIntArrayImpl): + (WebKit::WebBindings::getRange): + (WebKit::WebBindings::makeIntArray): + +2011-03-23 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Relanding: + Moving the method that is used to retrieve all the resources in + a page from the Chromium code (dom_operations.cc) to WebKit. + https://bugs.webkit.org/show_bug.cgi?id=55859 + + * WebKit.gyp: + * public/WebPageSerializer.h: + * public/WebURL.h: + (WebKit::operator==): + (WebKit::operator!=): + * public/WebVector.h: + (WebKit::WebVector::contains): + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::WebDataSourceImpl): + * src/WebPageSerializer.cpp: + (WebCore::getSubResourceURLFromElement): + (WebCore::retrieveResourcesForElement): + (WebCore::retrieveResourcesForFrame): + (WebKit::WebPageSerializer::retrieveAllResources): + * tests/WebFrameTest.cpp: + * tests/WebPageSerializerTest.cpp: Added. + * tests/data/pageserialization/awesome.png: Added. + * tests/data/pageserialization/embed_iframe.html: Added. + * tests/data/pageserialization/object_iframe.html: Added. + * tests/data/pageserialization/simple_iframe.html: Added. + * tests/data/pageserialization/simple_page.html: Added. + * tests/data/pageserialization/top_frame.html: Added. + +2011-03-23 Kenneth Russell <kbr@google.com> + + Rolled forward Chromium DEPS again to fix DumpRenderTree build + failure caused by r81821. + + * DEPS: + +2011-03-23 Kenneth Russell <kbr@google.com> + + Rolled forward Chromium DEPS to fix build breakage after r81821. + + * DEPS: + +2011-03-23 Kenneth Russell <kbr@google.com> + + Reviewed by James Robinson. + + [chromium] WebGLRenderingContext and other DOMWindow properties should remain if WebGL is disabled + https://bugs.webkit.org/show_bug.cgi?id=56947 + + Removed the WebRuntimeFeatures setting for WebGL. WebGL support is + now controlled exclusively through the page's Settings. + + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + +2011-03-23 Chris Rogers <crogers@google.com> + + Reviewed by Kenneth Russell. + + Add API to retrieve the audio hardware sample-rate + https://bugs.webkit.org/show_bug.cgi?id=56882 + + * public/WebAudioDevice.h: + * public/WebKitClient.h: + (WebKit::WebKitClient::audioHardwareSampleRate): + * src/AudioDestinationChromium.cpp: + (WebCore::AudioDestination::hardwareSampleRate): + +2011-03-23 Cris Neckar <cdn@chromium.org> + + Reviewed by Eric Seidel. + + Add refptr for widget. Mutations can happen within the event handler. + https://bugs.webkit.org/show_bug.cgi?id=56774 + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::handleEvent): + +2011-03-23 Viet-Trung Luu <viettrungluu@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Add FormatPlainText to WebClipboard::Format enumeration. + https://bugs.webkit.org/show_bug.cgi?id=56868 + + Chromium's WebClipboard::isFormatAvailable() will be correspondingly + extended. + + * public/WebClipboard.h: + * src/AssertMatchingEnums.cpp: + +2011-03-23 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Web Inspector: Remove DebuggerScript.js from Chromium resource bundle. + https://bugs.webkit.org/show_bug.cgi?id=56916 + + * DEPS: bump up Chromium dependency to the revision where no references to the DebuggerScript.js resource are left. + * WebKit.grd: + +2011-03-23 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Web Inspector: remove inspectNode method from WebDevToolsAgent + https://bugs.webkit.org/show_bug.cgi?id=56926 + + * public/WebDevToolsAgent.h: + * src/WebDevToolsAgentImpl.cpp: + * src/WebDevToolsAgentImpl.h: + +2011-03-23 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81686. + http://trac.webkit.org/changeset/81686 + https://bugs.webkit.org/show_bug.cgi?id=56914 + + Breaks webkit_tests in Chromium again. (Requested by pfeldman + on #webkit). + + * WebKit.gyp: + * public/WebPageSerializer.h: + * public/WebURL.h: + * public/WebVector.h: + (WebKit::WebVector::operator[]): + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::WebDataSourceImpl): + * src/WebPageSerializer.cpp: + * tests/WebFrameTest.cpp: + * tests/WebPageSerializerTest.cpp: Removed. + * tests/data/pageserialization/awesome.png: Removed. + * tests/data/pageserialization/embed_iframe.html: Removed. + * tests/data/pageserialization/object_iframe.html: Removed. + * tests/data/pageserialization/simple_iframe.html: Removed. + * tests/data/pageserialization/simple_page.html: Removed. + * tests/data/pageserialization/top_frame.html: Removed. + +2011-03-22 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [V8] Web Inspector: compile DebuggerScript.js into DebuggerScriptSource.h + https://bugs.webkit.org/show_bug.cgi?id=56843 + + * public/WebDevToolsAgentClient.h: the script source is now compiled along with the inspector code. + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::attach): + +2011-03-22 Yury Semikhatsky <yurys@chromium.org> + + Reviewed by Pavel Feldman. + + [Chromium] Web Inspector: remove obsolete methods from WebDevToolsAgentClient.h + https://bugs.webkit.org/show_bug.cgi?id=56897 + + * public/WebDevToolsAgentClient.h: + +2011-03-22 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Tony Chang. + + [chromium] Remove identity from dragTargetDragEnter() function signature + https://bugs.webkit.org/show_bug.cgi?id=56875 + + First part of 3-sided patch. Add new function signature sans identity. + + * public/WebView.h: + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::dragTargetDragEnter): + * src/WebViewImpl.h: + +2011-03-22 John Bauman <jbauman@chromium.org> + + Reviewed by Kenneth Russell. + + Add support for preserveDrawingBuffer context creation attribute + https://bugs.webkit.org/show_bug.cgi?id=56431 + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::markContextChanged): + (WebCore::GraphicsContext3DInternal::markLayerComposited): + (WebCore::GraphicsContext3DInternal::layerComposited): + (WebCore::GraphicsContext3D::layerComposited): + * src/GraphicsContext3DInternal.h: + +2011-03-22 John Abd-El-Malek <jam@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Make WebTextCheckingResult's members be public in preparation for converting it to a struct + https://bugs.webkit.org/show_bug.cgi?id=56857 + + * DEPS: + * public/WebTextCheckingResult.h: + +2011-03-22 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Relanding: + Moving the method that is used to retrieve all the resources in + a page from the Chromium code (dom_operations.cc) to WebKit. + https://bugs.webkit.org/show_bug.cgi?id=55859 + + + * WebKit.gyp: + * public/WebPageSerializer.h: + * public/WebURL.h: + (WebKit::operator==): + (WebKit::operator!=): + * public/WebVector.h: + (WebKit::WebVector::contains): + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::WebDataSourceImpl): + * src/WebPageSerializer.cpp: + (WebCore::getSubResourceURLFromElement): + (WebCore::retrieveResourcesForElement): + (WebCore::retrieveResourcesForFrame): + (WebKit::WebPageSerializer::retrieveAllResources): + * tests/WebFrameTest.cpp: + * tests/WebPageSerializerTest.cpp: Added. + * tests/data/pageserialization/awesome.png: Added. + * tests/data/pageserialization/embed_iframe.html: Added. + * tests/data/pageserialization/object_iframe.html: Added. + * tests/data/pageserialization/simple_iframe.html: Added. + * tests/data/pageserialization/simple_page.html: Added. + * tests/data/pageserialization/top_frame.html: Added. + +2011-03-22 Noel Gordon <noel.gordon@gmail.com> + + Reviewed by Tony Chang. + + [chromium] Remove Gears from Chromium WebKit + https://bugs.webkit.org/show_bug.cgi?id=56808 + + Gears has been removed from Chromium 12. Remove Gears drag drop support + from WebKit. That work lead to http://webkit.org/b/25916, a proposal to + add native file drag drop, and its subsequent standardization in HTML5. + + * public/WebBindings.h: + * public/WebView.h: + * src/WebBindings.cpp: + (WebKit::getRangeImpl): FIXME note added. + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + (WebKit::WebViewImpl::dragTargetDragEnter): + (WebKit::WebViewImpl::dragTargetDragLeave): + (WebKit::WebViewImpl::dragTargetDrop): + (WebKit::WebViewImpl::dragTargetDragEnterOrOver): + * src/WebViewImpl.h: + +2011-03-21 Adam Klein <adamk@chromium.org> + + Reviewed by David Levin. + + [fileapi] Add URI resolution support to WorkerContext + https://bugs.webkit.org/show_bug.cgi?id=55644 + + Pass "create" bool through to allow opening + a filesystem without allowing creation. + + * src/LocalFileSystemChromium.cpp: + (WebCore::LocalFileSystem::readFileSystem): + (WebCore::LocalFileSystem::requestFileSystem): + * src/WebWorkerBase.cpp: + (WebKit::WebWorkerBase::openFileSystemForWorker): + * src/WebWorkerBase.h: + * src/WorkerFileSystemCallbacksBridge.cpp: + (WebKit::WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread): + (WebKit::WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread): + * src/WorkerFileSystemCallbacksBridge.h: + +2011-03-21 Ilya Sherman <isherman@chromium.org> + + Reviewed by James Robinson. + + Remove WebInputElement::isEnabledFormControl() from Chromium WebKit API + Clients should instead call into WebFormControlElement::isEnabled(). + https://bugs.webkit.org/show_bug.cgi?id=56364 + + * public/WebInputElement.h: Removed isEnabledFormControl(). + * src/WebInputElement.cpp: Removed isEnabledFormControl(). + +2011-03-21 Robert Kroeger <rjkroege@chromium.org> + + Reviewed by Antonio Gomes. + + Flag to enable a platform specific GestureReocognizer framework in Chromium. + + https://bugs.webkit.org/show_bug.cgi?id=49345 + + * features.gypi: + +2011-03-21 Tony Chang <tony@chromium.org> + + Reviewed by Pavel Feldman. + + [chromium] remove devtools_html's dependency on WebKit.gypi + https://bugs.webkit.org/show_bug.cgi?id=56661 + + We want to depend on the values in the gypi file, not the gypi file + itself. Actually, if someone edits a gypi file, s/he should re-run + gyp to pick up the new dependencies. + + It turns out that this doesn't matter much for this target anymore + since we pull the .js dependencies from the inspector html file. + + * WebKit.gyp: cleanup dependencies + * scripts/generate_devtools_html.py: remove unused param + +2011-03-21 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81377. + http://trac.webkit.org/changeset/81377 + https://bugs.webkit.org/show_bug.cgi?id=56765 + + WebPageSerializerTest.MultipleFrames is broken (Requested by + simonjam on #webkit). + + * WebKit.gyp: + * public/WebPageSerializer.h: + * public/WebURL.h: + * public/WebVector.h: + (WebKit::WebVector::operator[]): + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::WebDataSourceImpl): + * src/WebPageSerializer.cpp: + * tests/WebFrameTest.cpp: + * tests/WebPageSerializerTest.cpp: Removed. + * tests/data/pageserialization/awesome.png: Removed. + * tests/data/pageserialization/embed_iframe.html: Removed. + * tests/data/pageserialization/object_iframe.html: Removed. + * tests/data/pageserialization/simple_iframe.html: Removed. + * tests/data/pageserialization/simple_page.html: Removed. + * tests/data/pageserialization/top_frame.html: Removed. + +2011-03-21 Daniel Sievers <sievers@google.com> + + Reviewed by Simon Fraser. + + [Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline + https://bugs.webkit.org/show_bug.cgi?id=56139 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::renderTreeAsText): + (WebKit::WebFrameImpl::layerTreeAsText): + * src/WebFrameImpl.h: + +2011-03-21 Eric Uhrhane <ericu@chromium.org> + + Reviewed by David Levin. + + [fileapi/chromium] Fetch platform path using GetMetadata before creating File from FileEntry* + https://bugs.webkit.org/show_bug.cgi?id=56704 + + * src/WebFileSystemCallbacksImpl.cpp: + (WebFileSystemCallbacksImpl::didReadMetadata) + Pass new platformPath member through. + + * src/WorkerFileSystemCallbacksBridge.cpp: + (CrossThreadCopierBase) + Copy new platformPath member. + + * public/WebFileInfo.h: + (struct WebFileInfo) + Add new platformPath member. + +2011-03-21 Leandro Gracia Gil <leandrogracia@chromium.org> + + Reviewed by Steve Block. + + Media Stream API patch 0: adding compilation guards. + https://bugs.webkit.org/show_bug.cgi?id=56458 + + Enabling the feature by default for chromium builds. + + * features.gypi: + +2011-03-21 Vsevolod Vlasov <vsevik@chromium.org> + + Reviewed by Pavel Feldman. + + Web Inspector: Inspector does not always show correct transfer size (for compressed/chunked data) + https://bugs.webkit.org/show_bug.cgi?id=56691 + + Added transfer size support in inspector for compressed data. + + * src/ResourceHandle.cpp: + (WebCore::ResourceHandleInternal::didReceiveData): + * src/WebDevToolsAgentImpl.cpp: + (WebKit::WebDevToolsAgentImpl::didReceiveData): + +2011-03-20 Bill Budge <bbudge@chromium.org> + + Reviewed by Adam Barth. + + Rename ThreadSafeShared to ThreadSafeRefCounted + https://bugs.webkit.org/show_bug.cgi?id=56714 + + No new tests. Exposes no new functionality. + + * src/PlatformMessagePortChannel.h: + * src/WebWorkerBase.cpp: + * src/WorkerFileSystemCallbacksBridge.h: + * src/WorkerFileWriterCallbacksBridge.h: + +2011-03-18 Tony Chang <tony@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] make devtool concatenation targets conditional based on debug_devtools + https://bugs.webkit.org/show_bug.cgi?id=56667 + + We don't want to run these targets when debug_devtools=1 because it + will overwrite the devtools.js and devtools.css files copied by + inspector_resources. On Linux, this triggers a warning because + there are two commands that target the same output file when + debug_devtools=1. + + I also removed the 'sources' lines since I don't think they do + anything for actions. + + * WebKit.gyp: + +2011-03-17 Alexey Marinichev <amarinichev@chromium.org> + + Reviewed by Kenneth Russell. + + chromium: uninitialized field in WebViewImpl + https://bugs.webkit.org/show_bug.cgi?id=56620 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::WebViewImpl): + +2011-03-17 Adrienne Walker <enne@google.com> + + Reviewed by James Robinson. + + [chromium] Turn off accelerated compositing for RTL style pages. + https://bugs.webkit.org/show_bug.cgi?id=56585 + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::layout): + (WebKit::WebViewImpl::pageHasRTLStyle): + (WebKit::WebViewImpl::setRootGraphicsLayer): + * src/WebViewImpl.h: + +2011-03-17 Jay Civelli <jcivelli@chromium.org> + + Reviewed by David Levin. + + Moving the method that is used to retrieve all the resources in + a page from the Chromium code (dom_operations.cc) to WebKit. + https://bugs.webkit.org/show_bug.cgi?id=55859 + + * WebKit.gyp: + * public/WebPageSerializer.h: + * public/WebURL.h: + (WebKit::operator==): + (WebKit::operator!=): + * public/WebVector.h: + (WebKit::WebVector::contains): + * src/WebDataSourceImpl.cpp: + (WebKit::WebDataSourceImpl::WebDataSourceImpl): + * src/WebPageSerializer.cpp: + (WebCore::getSubResourceURLFromElement): + (WebCore::retrieveResourcesForElement): + (WebCore::retrieveResourcesForFrame): + (WebKit::WebPageSerializer::retrieveAllResources): + * tests/WebFrameTest.cpp: + * tests/WebPageSerializerTest.cpp: Added. + * tests/data/pageserialization: Added. + * tests/data/pageserialization/awesome.png: Added. + * tests/data/pageserialization/embed_iframe.html: Added. + * tests/data/pageserialization/object_iframe.html: Added. + * tests/data/pageserialization/simple_iframe.html: Added. + * tests/data/pageserialization/simple_page.html: Added. + * tests/data/pageserialization/top_frame.html: Added. + +2011-03-17 Tony Chang <tony@chromium.org> + + Reviewed by Pavel Feldman. + + [chromium] don't concatenate devtools files when debug_devtools=1 + https://bugs.webkit.org/show_bug.cgi?id=56572 + + * WebKit.gyp: + +2011-03-17 Tony Chang <tony@chromium.org> + + Reviewed by Eric Seidel. + + [chromium] minor cleanup of devtools_files variable in WebKit.gyp + https://bugs.webkit.org/show_bug.cgi?id=56503 + + * WebKit.gyp: Moving duplicate variables out of a condition. + +2011-03-16 Adam Barth <abarth@webkit.org> + + Reviewed by James Robinson. + + Remove USE(BUILTIN_UTF8_CODEC) + https://bugs.webkit.org/show_bug.cgi?id=56508 + + * features.gypi: + +2011-03-16 Tony Chang <tony@chromium.org> + + Reviewed by Adam Barth. + + [chromium] include inspector gif files in the list of resources + https://bugs.webkit.org/show_bug.cgi?id=56504 + + * scripts/generate_devtools_grd.py: + +2011-03-16 Bill Budge <bbudge@chromium.org> + + Reviewed by David Levin. + + AssociatedURLLoader does not support Cross Origin Requests + https://bugs.webkit.org/show_bug.cgi?id=53925 + + No new tests. Exposes no new functionality. + + * public/WebURLLoader.h: + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::isDocumentThreadableLoaderClient): + (WebKit::AssociatedURLLoader::ClientAdapter::clearClient): + (WebKit::AssociatedURLLoader::ClientAdapter::create): + (WebKit::AssociatedURLLoader::ClientAdapter::ClientAdapter): + (WebKit::AssociatedURLLoader::ClientAdapter::willSendRequest): + (WebKit::AssociatedURLLoader::ClientAdapter::didSendData): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveResponse): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata): + (WebKit::AssociatedURLLoader::ClientAdapter::didFinishLoading): + (WebKit::AssociatedURLLoader::ClientAdapter::didFail): + (WebKit::AssociatedURLLoader::AssociatedURLLoader): + (WebKit::AssociatedURLLoader::~AssociatedURLLoader): + (WebKit::AssociatedURLLoader::loadSynchronously): + (WebKit::AssociatedURLLoader::loadAsynchronously): + (WebKit::AssociatedURLLoader::cancel): + (WebKit::AssociatedURLLoader::setDefersLoading): + * src/AssociatedURLLoader.h: + +2011-03-16 Adam Barth <abarth@webkit.org> + + Roll Chromium DEPS. + + * DEPS: + +2011-03-16 Daniel Sievers <sievers@google.com> + + Reviewed by James Robinson. + + Add setting to always force compositing mode + https://bugs.webkit.org/show_bug.cgi?id=56156 + + * public/WebSettings.h: + * src/WebSettingsImpl.cpp: + (WebKit::WebSettingsImpl::setForceCompositingMode): + * src/WebSettingsImpl.h: + +2011-03-16 Sreeram Ramachandran <sreeram@google.com> + + Reviewed by Dimitri Glazkov. + + Revert of r80451. Decided to do this in WebCore instead. + https://bugs.webkit.org/show_bug.cgi?id=55844 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + * src/WebFrameImpl.h: + +2011-03-15 Ilya Sherman <isherman@chromium.org> + + Reviewed by Darin Fisher. + + Move isReadOnly() from WebInputElement to WebFormControlElement + https://bugs.webkit.org/show_bug.cgi?id=55760 + + * public/WebFormControlElement.h: + * public/WebInputElement.h: + * src/WebFormControlElement.cpp: + (WebKit::WebFormControlElement::isReadOnly): + * src/WebInputElement.cpp: + +2011-03-15 John Bauman <jbauman@chromium.org> + + Reviewed by Kenneth Russell. + + Non-premultiplied-alpha canvas attribute is ignore for toDataURL, drawImage, texImage2D + https://bugs.webkit.org/show_bug.cgi?id=56238 + + Add support for reading a webgl context into an ImageData. + + * src/GraphicsContext3DChromium.cpp: + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToCanvas): + (WebCore::GraphicsContext3DInternal::paintRenderingResultsToImageData): + * src/GraphicsContext3DInternal.h: + +2011-03-15 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81144. + http://trac.webkit.org/changeset/81144 + https://bugs.webkit.org/show_bug.cgi?id=56432 + + It broke the ui test + NPAPITesterBase.GetURLRedirectNotification. (Requested by + dave_levin on #webkit). + + * public/WebURLLoader.h: + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::AssociatedURLLoader): + (WebKit::AssociatedURLLoader::~AssociatedURLLoader): + (WebKit::AssociatedURLLoader::loadSynchronously): + (WebKit::AssociatedURLLoader::loadAsynchronously): + (WebKit::AssociatedURLLoader::cancel): + (WebKit::AssociatedURLLoader::setDefersLoading): + (WebKit::AssociatedURLLoader::prepareRequest): + (WebKit::AssociatedURLLoader::willSendRequest): + (WebKit::AssociatedURLLoader::didSendData): + (WebKit::AssociatedURLLoader::didReceiveResponse): + (WebKit::AssociatedURLLoader::didDownloadData): + (WebKit::AssociatedURLLoader::didReceiveData): + (WebKit::AssociatedURLLoader::didReceiveCachedMetadata): + (WebKit::AssociatedURLLoader::didFinishLoading): + (WebKit::AssociatedURLLoader::didFail): + * src/AssociatedURLLoader.h: + +2011-03-15 Tony Chang <tony@chromium.org> + + Reviewed by Adam Barth. + + pngcrush images used by inspector + https://bugs.webkit.org/show_bug.cgi?id=56426 + + This saves 120k in WebCore and 8k in WebKit/chromium. I ran + pngcrush -brute, so none of the meta data (ancillary chunks) + are modified. + + * src/js/Images/segmentChromium.png: + * src/js/Images/segmentHoverChromium.png: + * src/js/Images/segmentHoverEndChromium.png: + * src/js/Images/segmentSelectedChromium.png: + * src/js/Images/segmentSelectedEndChromium.png: + * src/js/Images/statusbarBackgroundChromium.png: + * src/js/Images/statusbarBottomBackgroundChromium.png: + * src/js/Images/statusbarMenuButtonChromium.png: + * src/js/Images/statusbarMenuButtonSelectedChromium.png: + +2011-03-15 Michael Nordman <michaeln@google.com> + + Reviewed by Alexey Proskuryakov. + + When initiating a main resource load, let the application cache + know which frame the load is being conducted for. This patch doesn't + resolve the following bug, but the additional WebFrame parameter + should provide the chromium port with enough info to pick the + "most appropiate" cached resource. + https://bugs.webkit.org/show_bug.cgi?id=55505 + + Also fixup a stale comment in stopLoadingInFrame. + + * public/WebApplicationCacheHost.h: + (WebKit::WebApplicationCacheHost::willStartMainResourceRequest): + * src/ApplicationCacheHost.cpp: + (WebCore::ApplicationCacheHost::maybeLoadMainResource): + (WebCore::ApplicationCacheHost::stopLoadingInFrame): + +2011-03-15 Tony Chang <tony@chromium.org> + + Reviewed by Adam Barth. + + [chromium] add a build target to create a grd file with devtool resources + https://bugs.webkit.org/show_bug.cgi?id=56335 + + Reland with a fix to avoid really long command lines on Windows. + + * WebKit.gyp: + * scripts/generate_devtools_grd.py: Added. + +2011-03-15 Alok priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Valgrind error due to uninitialized PluginLayerChromium::m_textureId + https://bugs.webkit.org/show_bug.cgi?id=56390 + + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::setBackingTextureId): + (WebKit::WebPluginContainerImpl::platformLayer): + +2011-03-15 Brett Wilson <brettw@chromium.org> + + Reviewed by Adam Barth. + + Make WebConsoleMessage properly respect the log level. + https://bugs.webkit.org/show_bug.cgi?id=56386 + + * public/WebConsoleMessage.h: + (WebKit::WebConsoleMessage::WebConsoleMessage): + +2011-03-15 Tony Chang <tony@chromium.org> + + Revert r81147 and r81149, broke the chromium win build. + + * WebKit.gyp: + * scripts/generate_devtools_grd.py: Removed. + +2011-03-15 Tony Chang <tony@chromium.org> + + Fix chromium build using python 2.5 (with statement). + + * scripts/generate_devtools_grd.py: + +2011-03-15 Tony Chang <tony@chromium.org> + + Reviewed by Adam Barth. + + [chromium] add a build target to create a grd file with devtool resources + https://bugs.webkit.org/show_bug.cgi?id=56335 + + This is the webkit side of the fix for + http://code.google.com/p/chromium/issues/detail?id=35793 + + * WebKit.gyp: + * scripts/generate_devtools_grd.py: Added. + +2011-03-15 Bill Budge <bbudge@chromium.org> + + Reviewed by David Levin. + + AssociatedURLLoader does not support Cross Origin Requests + https://bugs.webkit.org/show_bug.cgi?id=53925 + + No new tests. No new functionality exposed. + + * public/WebURLLoader.h: + (WebKit::WebURLLoaderOptions::WebURLLoaderOptions): + * src/AssociatedURLLoader.cpp: + (WebKit::AssociatedURLLoader::ClientAdapter::clearClient): + (WebKit::AssociatedURLLoader::ClientAdapter::create): + (WebKit::AssociatedURLLoader::ClientAdapter::ClientAdapter): + (WebKit::AssociatedURLLoader::ClientAdapter::willSendRequest): + (WebKit::AssociatedURLLoader::ClientAdapter::didSendData): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveResponse): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveData): + (WebKit::AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata): + (WebKit::AssociatedURLLoader::ClientAdapter::didFinishLoading): + (WebKit::AssociatedURLLoader::ClientAdapter::didFail): + (WebKit::AssociatedURLLoader::AssociatedURLLoader): + (WebKit::AssociatedURLLoader::~AssociatedURLLoader): + (WebKit::AssociatedURLLoader::loadSynchronously): + (WebKit::AssociatedURLLoader::loadAsynchronously): + (WebKit::AssociatedURLLoader::cancel): + (WebKit::AssociatedURLLoader::setDefersLoading): + * src/AssociatedURLLoader.h: + +2011-03-15 Alok priyadarshi <alokp@chromium.org> + + Reviewed by James Robinson. + + Remove unnecessary function WebPlugin::getBackingTextureId + https://bugs.webkit.org/show_bug.cgi?id=56122 + + It will be tested by Pepper2D and Pepper3D layout/smoke tests + on the Chromium side. + + * public/WebPlugin.h: + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::platformLayer): + +2011-03-15 Mikhail Naganov <mnaganov@chromium.org> + + Unreviewed. Update chromium deps to pick up the latest V8. + + * DEPS: + +2011-03-14 Alexey Marinichev <amarinichev@chromium.org> + + Reviewed by Kenneth Russell. + + Graphics Context is not properly recovered if the GPU process dies. + https://bugs.webkit.org/show_bug.cgi?id=56148 + + Split context recreation into two steps. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::composite): + (WebKit::WebViewImpl::doComposite): + (WebKit::WebViewImpl::reallocateRenderer): + * src/WebViewImpl.h: + +2011-03-14 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r81094. + http://trac.webkit.org/changeset/81094 + https://bugs.webkit.org/show_bug.cgi?id=56355 + + Broke the chromium DRT related build. (Requested by dave_levin + on #webkit). + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::renderTreeAsText): + (WebKit::WebFrameImpl::layerTreeAsText): + * src/WebFrameImpl.h: + +2011-03-14 Daniel Sievers <sievers@google.com> + + Reviewed by Simon Fraser. + + [Chromium] Make RenderAsTextBehavior and LayerTreeAsTextBehavior tweakable from the DumpRenderTree commandline + https://bugs.webkit.org/show_bug.cgi?id=56139 + + * public/WebFrame.h: + * src/WebFrameImpl.cpp: + (WebKit::WebFrameImpl::renderTreeAsText): + (WebKit::WebFrameImpl::layerTreeAsText): + * src/WebFrameImpl.h: + +2011-03-14 John Knottenbelt <jknotten@chromium.org> + + Reviewed by Steve Block. + + Detach Geolocation from Frame when Page destroyed. + https://bugs.webkit.org/show_bug.cgi?id=52877 + + Add accessors to the WebGeolocationClientMock to allow the number of + pending geolocation permission requests to be queried. + + * public/WebGeolocationClientMock.h: + * src/WebGeolocationClientMock.cpp: + (WebKit::WebGeolocationClientMock::numberOfPendingPermissionRequests): + +2011-03-11 David Levin <levin@chromium.org> + + Rollout the chromium deps roll as it adds a dependency on a header + that the bots building for WebKit don't seem to have. + + Specifically gfx\gl\gl_context_egl.cc depends on d3dcompiler.h + + * DEPS: + +2011-03-11 Daniel Cheng <dcheng@chromium.org> + + Reviewed by Tony Chang. + + [chromium] Correct return type of WebClipboard::readImage. + https://bugs.webkit.org/show_bug.cgi?id=56234 + + Update the return type to reflect that we are returning a blob of PNG + data, not a bitmap. + + * public/WebClipboard.h: + (WebKit::WebClipboard::readImage): + +2011-03-11 David Levin <levin@chromium.org> + + Update chromium deps to pick up the skia roll. + + * DEPS: + +2011-03-11 Adrienne Walker <enne@google.com> + + Reviewed by Kenneth Russell. + + Add missing unit tests to TilingData. + https://bugs.webkit.org/show_bug.cgi?id=54143 + + * tests/TilingDataTest.cpp: + (WebCore::TEST): + +2011-03-11 Anton D'Auria <adauria@apple.com> + + Reviewed and landed by Brady Eidson. + + Add WebKit1 API to view and delete local storage + https://bugs.webkit.org/show_bug.cgi?id=51878 + + * src/StorageNamespaceProxy.cpp: + (WebCore::StorageNamespaceProxy::clearOriginForDeletion): + (WebCore::StorageNamespaceProxy::clearAllOriginsForDeletion): + (WebCore::StorageNamespaceProxy::sync): + * src/StorageNamespaceProxy.h: + +2011-03-11 Dominic Mazzoni <dmazzoni@google.com> + + Reviewed by Dimitri Glazkov. + + Add an accessibilityIsIgnored method to WebAccessibilityObject. + https://bugs.webkit.org/show_bug.cgi?id=50969 + + * public/WebAccessibilityObject.h: + * src/WebAccessibilityObject.cpp: + (WebKit::WebAccessibilityObject::accessibilityIsIgnored): + +2011-03-11 Avi Drissman <avi@google.com> + + Reviewed by Tony Chang. + + Fix missing initialization of new member variables. + https://bugs.webkit.org/show_bug.cgi?id=50969 + + * public/WebMenuItemInfo.h: + (WebKit::WebMenuItemInfo::WebMenuItemInfo): + +2011-03-11 Roland Steiner <rolandsteiner@chromium.org> + + Reviewed by Ryosuke Niwa. + + Bug 55570 - Remove dependency of dom/InputElement.cpp on html/ and wml/ + https://bugs.webkit.org/show_bug.cgi?id=55570 + + Add a virtual function toInputElement() to Node that has a default + implementation of returning 0. + For HTMLInputElement and WMLInputElement (which derive from InputElement) + override this to return the object. + Change all calling sites of the old toInputElement to use the new member + function. This also allows us to save some casts. + + No new tests (refactoring). + + * src/WebInputElement.cpp: + (WebKit::toWebInputElement): + +2011-03-10 Takayoshi Kochi <kochi@chromium.org> + + Reviewed by Tony Chang. + + Remove default parameter declaration for familiForChars(), which is no longer necessary. + + * public/gtk/WebFontInfo.h: + +2011-03-10 Nat Duca <nduca@chromium.org> + + Reviewed by James Robinson. + + [chromium] Make updateAndDrawLayers argumentless. + https://bugs.webkit.org/show_bug.cgi?id=55985 + + Made the TilePainters and viewport parameters for + LayerRendererChromium member variables instead of arguments on + updateAndDrawLayers. In a future change, this will allows us to + draw the layer tree without the WebView's assistance. + + * src/WebViewImpl.cpp: + (WebKit::WebViewImpl::resize): + (WebKit::WebViewImpl::paint): + (WebKit::WebViewImpl::scrollRootLayerRect): + (WebKit::WebViewImpl::invalidateRootLayerRect): + (WebKit::WebViewImplContentPainter::create): + (WebKit::WebViewImplContentPainter::paint): + (WebKit::WebViewImplContentPainter::WebViewImplContentPainter): + (WebKit::WebViewImplScrollbarPainter::create): + (WebKit::WebViewImplScrollbarPainter::paint): + (WebKit::WebViewImplScrollbarPainter::WebViewImplScrollbarPainter): + (WebKit::WebViewImpl::setIsAcceleratedCompositingActive): + (WebKit::WebViewImpl::doComposite): + (WebKit::WebViewImpl::reallocateRenderer): + (WebKit::WebViewImpl::updateLayerRendererViewport): + * src/WebViewImpl.h: + +2011-03-10 Tony Chang <tony@chromium.org> + + Unreviewed, roll chromium version to r77259 to pick up + webfontinfo api change. + + * DEPS: + +2011-03-10 Sheriff Bot <webkit.review.bot@gmail.com> + + Unreviewed, rolling out r80701. + http://trac.webkit.org/changeset/80701 + https://bugs.webkit.org/show_bug.cgi?id=56126 + + fast/dom/Geolocation/window-close-crash.html fails on Snow + Leopard release builds (Requested by mihaip on #webkit). + + * public/WebGeolocationClientMock.h: + * src/WebGeolocationClientMock.cpp: + +2011-03-10 Andrey Kosyakov <caseq@chromium.org> + + Reviewed by Yury Semikhatsky. + + Web Inspector: better names for HAR export commands + https://bugs.webkit.org/show_bug.cgi?id=56097 + + Rename Export to HAR to Copy entry/network log as HAR + Expose Copy as HAR unconditionally, remove related settings entry. + + * src/js/DevTools.js: removed override for resourceExportEnabled + +2011-01-26 John Knottenbelt <jknotten@chromium.org> + + Reviewed by Dmitry Titov. + + Detach Geolocation from Frame when Page destroyed. + https://bugs.webkit.org/show_bug.cgi?id=52877 + + Add accessors to the WebGeolocationClientMock to allow the number of + pending geolocation permission requests to be queried. + + * public/WebGeolocationClientMock.h: + * src/WebGeolocationClientMock.cpp: + (WebKit::WebGeolocationClientMock::numberOfPendingPermissionRequests): + +2011-03-08 Hans Wennborg <hans@chromium.org> + + Reviewed by Jeremy Orlow. + + IndexedDB: Add BackingStoreType parameter to IDBFactoryBackendInterface::open + https://bugs.webkit.org/show_bug.cgi?id=55948 + + Add a parameter that allows for selection of alternative backing store + implementations. + + * public/WebIDBFactory.h: + (WebKit::WebIDBFactory::open): + * src/AssertMatchingEnums.cpp: + * src/IDBFactoryBackendProxy.cpp: + (WebCore::IDBFactoryBackendProxy::open): + * src/IDBFactoryBackendProxy.h: + * src/WebIDBFactoryImpl.cpp: + (WebKit::WebIDBFactoryImpl::open): + * src/WebIDBFactoryImpl.h: + +2011-03-08 Kinuko Yasuda <kinuko@chromium.org> + + Reviewed by David Levin. + + Destroying WorkerFileSystemCallbacksBridge on main thread results in ASSERT in WorkerContext::Observer::~Observer + https://bugs.webkit.org/show_bug.cgi?id=55895 + + * src/WorkerFileSystemCallbacksBridge.cpp: + (WebKit::WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread): + Added stopObserving() so that releasing the bridge on the main thread + (this could happen before or after the runTaskOnWorkerThread) does + not cause the assertion error. + +2011-03-08 Alok priyadarshi <alokp@chromium.org> + + Reviewed by Dimitri Glazkov. + + Plugins needs a way to trigger style recalc + https://bugs.webkit.org/show_bug.cgi?id=55242 + + It will be tested by Pepper2D and Pepper3D layout/smoke tests + on the Chromium side. + + * public/WebPluginContainer.h: + * src/WebPluginContainerImpl.cpp: + (WebKit::WebPluginContainerImpl::setBackingTextureId): + * src/WebPluginContainerImpl.h: + +2011-03-08 Andrei Popescu <andreip@google.com> + + Reviewed by Steve Block. + + IDBCallbacks::onsuccess(IDBIndex*) is unused and should be removed. + https://bugs.webkit.org/show_bug.cgi?id=55938 + + * public/WebIDBCallbacks.h: + * src/IDBCallbacksProxy.cpp: + * src/IDBCallbacksProxy.h: + * src/WebIDBCallbacksImpl.cpp: + * src/WebIDBCallbacksImpl.h: + * src/WebIDBObjectStoreImpl.cpp: + +2011-03-07 Daniel Cheng <dcheng@chromium.org> + + Reviewed by David Levin. + + Add support for DataTransferItems + https://bugs.webkit.org/show_bug.cgi?id=55115 + + Add new runtime enabled flag for data transfer items feature. + + * public/WebRuntimeFeatures.h: + * src/WebRuntimeFeatures.cpp: + (WebKit::WebRuntimeFeatures::enableDataTransferItems): + (WebKit::WebRuntimeFeatures::isDataTransferItemsEnabled): + 2011-03-07 Ryosuke Niwa <rniwa@webkit.org> Chromium build fix. diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS index 0e8c529..3ab2e78 100644 --- a/Source/WebKit/chromium/DEPS +++ b/Source/WebKit/chromium/DEPS @@ -32,7 +32,7 @@ vars = { 'chromium_svn': 'http://src.chromium.org/svn/trunk/src', - 'chromium_rev': '77152' + 'chromium_rev': '79759' } deps = { diff --git a/Source/WebKit/chromium/WebKit.grd b/Source/WebKit/chromium/WebKit.grd index 38570b9..4da7600 100644 --- a/Source/WebKit/chromium/WebKit.grd +++ b/Source/WebKit/chromium/WebKit.grd @@ -9,7 +9,6 @@ </outputs> <release seq="1"> <includes> - <include name="IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS" file="..\..\..\Source\WebCore\bindings\v8\DebuggerScript.js" type="BINDATA"/> <include name="IDR_AUDIO_SPATIALIZATION_T000_P000" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T000_P000.wav" type="BINDATA"/> <include name="IDR_AUDIO_SPATIALIZATION_T000_P015" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T000_P015.wav" type="BINDATA"/> <include name="IDR_AUDIO_SPATIALIZATION_T000_P030" file="..\..\WebCore\platform\audio\resources\IRC_Composite_C_R0195_T000_P030.wav" type="BINDATA"/> diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp index 1cb68f9..d47248e 100644 --- a/Source/WebKit/chromium/WebKit.gyp +++ b/Source/WebKit/chromium/WebKit.gyp @@ -44,22 +44,10 @@ # e.g. via build-webkit --chromium 'chromium_src_dir': '../../WebKit/chromium', 'webkit_target_type': 'static_library', - - # List of DevTools source files, ordered by dependencies. It is used both - # for copying them to resource dir, and for generating 'devtools.html' file. - 'devtools_files': [ - '<@(devtools_css_files)', - '<@(devtools_js_files)', - ], },{ # WebKit is checked out in src/chromium/third_party/WebKit 'chromium_src_dir': '../../../../..', 'webkit_target_type': '<(library)', - - 'devtools_files': [ - '<@(devtools_css_files)', - '<@(devtools_js_files)', - ], }], ], 'ahem_path': '../../../Tools/DumpRenderTree/qt/fonts/AHEM____.TTF', @@ -67,6 +55,13 @@ # If debug_devtools is set to 1, JavaScript files for DevTools are # stored as is. Otherwise, a concatenated file is stored. 'debug_devtools%': 0, + + # List of DevTools source files, ordered by dependencies. It is used both + # for copying them to resource dir, and for generating 'devtools.html' file. + 'devtools_files': [ + '<@(devtools_css_files)', + '<@(devtools_js_files)', + ], }, 'targets': [ { @@ -732,67 +727,57 @@ 'sources': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'], 'actions': [{ 'action_name': 'devtools_html', - 'inputs': [ - 'scripts/generate_devtools_html.py', - # See issue 29695: WebKit.gypi is a source file for devtools.html. - 'WebKit.gypi', - '../../WebCore/inspector/front-end/inspector.html', - ], - 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'], - 'action': ['python', '<@(_inputs)', '<@(_outputs)', '<@(debug_devtools)', '<@(devtools_files)'], - }], - }, - { - 'target_name': 'concatenated_devtools_js', - 'type': 'none', - 'dependencies': [ - 'devtools_html', - '../../WebCore/WebCore.gyp/WebCore.gyp:inspector_protocol_sources' - ], - 'sources': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], - 'actions': [{ - 'action_name': 'concatenate_devtools_js', - 'script_name': 'scripts/concatenate_js_files.py', + 'script_name': 'scripts/generate_devtools_html.py', 'input_page': '../../WebCore/inspector/front-end/inspector.html', 'inputs': [ '<@(_script_name)', '<@(_input_page)', - '<@(webinspector_files)', '<@(devtools_files)', - '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js' - ], - 'search_path': [ - '../../WebCore/inspector/front-end', - 'src/js', - '<(SHARED_INTERMEDIATE_DIR)/webcore', ], - 'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], - 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devtools.html'], + 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_outputs)', '<@(debug_devtools)', '<@(devtools_files)'], }], }, { - 'target_name': 'concatenated_devtools_css', + 'target_name': 'generate_devtools_grd', 'type': 'none', 'dependencies': [ - 'devtools_html' + 'devtools_html', + ], + 'conditions': [ + ['debug_devtools==0', { + 'dependencies': ['concatenated_devtools_js', + 'concatenated_devtools_css'], + },{ + # If we're not concatenating devtools files, we want to + # run after the original files have been copied to + # <(PRODUCT_DIR)/resources/inspector. + 'dependencies': ['inspector_resources'], + }], ], - 'sources': ['<(PRODUCT_DIR)/resources/inspector/devTools.css'], 'actions': [{ - 'action_name': 'concatenate_devtools_css', - 'script_name': 'scripts/concatenate_css_files.py', - 'input_page': '../../WebCore/inspector/front-end/inspector.html', + 'action_name': 'generate_devtools_grd', + 'script_name': 'scripts/generate_devtools_grd.py', + 'input_pages': [ + '<(PRODUCT_DIR)/resources/inspector/devtools.html', + '<(PRODUCT_DIR)/resources/inspector/DevTools.js', + '<(PRODUCT_DIR)/resources/inspector/devTools.css', + ], + 'images': [ + '<@(webinspector_image_files)', + '<@(devtools_image_files)', + ], 'inputs': [ '<@(_script_name)', - '<@(_input_page)', - '<@(webinspector_files)', - '<@(devtools_files)' + '<@(_input_pages)', + '<@(_images)', ], 'search_path': [ - '../../WebCore/inspector/front-end', - 'src/js', + '../../WebCore/inspector/front-end/Images', + 'src/js/Images', ], - 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devTools.css'], - 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], + 'outputs': ['<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd'], + 'action': ['python', '<@(_script_name)', '<@(_input_pages)', '--images', '<@(_search_path)', '--output', '<@(_outputs)'], }], }, { @@ -832,6 +817,7 @@ 'tests/TransparencyWinTest.cpp', 'tests/UniscribeHelperTest.cpp', 'tests/WebFrameTest.cpp', + 'tests/WebPageSerializerTest.cpp', ], }], ['OS=="mac"', { @@ -1151,6 +1137,61 @@ }, ], }], + ['debug_devtools==0', { + 'targets': [ + { + 'target_name': 'concatenated_devtools_js', + 'type': 'none', + 'dependencies': [ + 'devtools_html', + '../../WebCore/WebCore.gyp/WebCore.gyp:inspector_protocol_sources' + ], + 'actions': [{ + 'action_name': 'concatenate_devtools_js', + 'script_name': 'scripts/concatenate_js_files.py', + 'input_page': '../../WebCore/inspector/front-end/inspector.html', + 'inputs': [ + '<@(_script_name)', + '<@(_input_page)', + '<@(webinspector_files)', + '<@(devtools_files)', + '<(SHARED_INTERMEDIATE_DIR)/webcore/InspectorBackendStub.js' + ], + 'search_path': [ + '../../WebCore/inspector/front-end', + 'src/js', + '<(SHARED_INTERMEDIATE_DIR)/webcore', + ], + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/DevTools.js'], + 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], + }], + }, + { + 'target_name': 'concatenated_devtools_css', + 'type': 'none', + 'dependencies': [ + 'devtools_html' + ], + 'actions': [{ + 'action_name': 'concatenate_devtools_css', + 'script_name': 'scripts/concatenate_css_files.py', + 'input_page': '../../WebCore/inspector/front-end/inspector.html', + 'inputs': [ + '<@(_script_name)', + '<@(_input_page)', + '<@(webinspector_files)', + '<@(devtools_files)' + ], + 'search_path': [ + '../../WebCore/inspector/front-end', + 'src/js', + ], + 'outputs': ['<(PRODUCT_DIR)/resources/inspector/devTools.css'], + 'action': ['python', '<@(_script_name)', '<@(_input_page)', '<@(_search_path)', '<@(_outputs)'], + }], + }, + ], + }], ], # conditions } diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi index 4e91d60..7354eb8 100644 --- a/Source/WebKit/chromium/features.gypi +++ b/Source/WebKit/chromium/features.gypi @@ -59,6 +59,7 @@ 'ENABLE_FILTERS=1', 'ENABLE_FULLSCREEN_API=1', 'ENABLE_GEOLOCATION=1', + 'ENABLE_GESTURE_RECOGNIZER=1', 'ENABLE_ICONDATABASE=0', 'ENABLE_INDEXED_DATABASE=1', 'ENABLE_INPUT_SPEECH=1', @@ -67,6 +68,7 @@ 'ENABLE_LINK_PREFETCH=1', 'ENABLE_MATHML=0', 'ENABLE_MEDIA_STATISTICS=1', + 'ENABLE_MEDIA_STREAM=1', 'ENABLE_METER_TAG=1', 'ENABLE_NOTIFICATIONS=1', 'ENABLE_OFFLINE_WEB_APPLICATIONS=1', @@ -93,7 +95,6 @@ 'ENABLE_XPATH=1', 'ENABLE_XSLT=1', 'WTF_USE_ACCELERATED_COMPOSITING=1', - 'WTF_USE_BUILTIN_UTF8_CODEC=1', 'WTF_USE_WEBP=1', 'WTF_USE_WEBKIT_IMAGE_DECODERS=1', ], diff --git a/Source/WebKit/chromium/public/WebAccessibilityObject.h b/Source/WebKit/chromium/public/WebAccessibilityObject.h index 67a79e0..bdc3d09d 100644 --- a/Source/WebKit/chromium/public/WebAccessibilityObject.h +++ b/Source/WebKit/chromium/public/WebAccessibilityObject.h @@ -118,6 +118,7 @@ public: WEBKIT_API WebDocument document() const; WEBKIT_API bool hasComputedStyle() const; WEBKIT_API WebString computedStyleDisplay() const; + WEBKIT_API bool accessibilityIsIgnored() const; #if WEBKIT_IMPLEMENTATION WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>&); diff --git a/Source/WebKit/chromium/public/WebAccessibilityRole.h b/Source/WebKit/chromium/public/WebAccessibilityRole.h index b0748a7..391b3e2 100644 --- a/Source/WebKit/chromium/public/WebAccessibilityRole.h +++ b/Source/WebKit/chromium/public/WebAccessibilityRole.h @@ -116,6 +116,11 @@ enum WebAccessibilityRole { WebAccessibilityRoleMenuListPopup, WebAccessibilityRoleMenuListOption, + WebAccessibilityRoleParagraph, + WebAccessibilityRoleLabel, + WebAccessibilityRoleDiv, + WebAccessibilityRoleForm, + WebAccessibilityRoleLandmarkApplication, WebAccessibilityRoleLandmarkBanner, WebAccessibilityRoleLandmarkComplementary, diff --git a/Source/WebKit/chromium/public/WebApplicationCacheHost.h b/Source/WebKit/chromium/public/WebApplicationCacheHost.h index acbc106..8539d82 100644 --- a/Source/WebKit/chromium/public/WebApplicationCacheHost.h +++ b/Source/WebKit/chromium/public/WebApplicationCacheHost.h @@ -38,6 +38,7 @@ namespace WebKit { class WebApplicationCacheHostClient; +class WebFrame; class WebURL; class WebURLRequest; class WebURLResponse; @@ -73,9 +74,11 @@ public: virtual ~WebApplicationCacheHost() { } // Called for every request made within the context. - virtual void willStartMainResourceRequest(WebURLRequest&) { } + virtual void willStartMainResourceRequest(WebURLRequest& r, const WebFrame*) { willStartMainResourceRequest(r); } virtual void willStartSubResourceRequest(WebURLRequest&) { } + virtual void willStartMainResourceRequest(WebURLRequest&) { } // DEPRECATED, remove after derived classes have caught up. + // One or the other selectCache methods is called after having parsed the <html> tag. // The latter returns false if the current document has been identified as a "foreign" // entry, in which case the frame navigation will be restarted by webkit. diff --git a/Source/WebKit/chromium/public/WebAudioDevice.h b/Source/WebKit/chromium/public/WebAudioDevice.h index a9f5a1c..00aea97 100644 --- a/Source/WebKit/chromium/public/WebAudioDevice.h +++ b/Source/WebKit/chromium/public/WebAudioDevice.h @@ -48,6 +48,7 @@ public: virtual void start() = 0; virtual void stop() = 0; + virtual double sampleRate() = 0; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebBindings.h b/Source/WebKit/chromium/public/WebBindings.h index cb33781..149bff3 100644 --- a/Source/WebKit/chromium/public/WebBindings.h +++ b/Source/WebKit/chromium/public/WebBindings.h @@ -40,6 +40,7 @@ namespace WebKit { class WebDragData; class WebElement; +class WebNode; class WebRange; // A haphazard collection of functions for dealing with plugins. @@ -55,7 +56,7 @@ public: WEBKIT_API static NPObject* createObject(NPP, NPClass*); // NPN_Enumerate - WEBKIT_API static bool enumerate(NPP, NPObject*, NPIdentifier**, uint32_t* count); + WEBKIT_API static bool enumerate(NPP, NPObject*, NPIdentifier**, uint32_t* identifierCount); // NPN_Evaluate WEBKIT_API static bool evaluate(NPP, NPObject*, NPString* script, NPVariant* result); @@ -67,7 +68,7 @@ public: WEBKIT_API static NPIdentifier getIntIdentifier(int32_t number); // NPN_GetProperty - WEBKIT_API static bool getProperty(NPP, NPObject*, NPIdentifier propertyName, NPVariant *result); + WEBKIT_API static bool getProperty(NPP, NPObject*, NPIdentifier property, NPVariant *result); // NPN_GetStringIdentifier WEBKIT_API static NPIdentifier getStringIdentifier(const NPUTF8* string); @@ -76,10 +77,10 @@ public: WEBKIT_API static void getStringIdentifiers(const NPUTF8** names, int32_t nameCount, NPIdentifier*); // NPN_HasMethod - WEBKIT_API static bool hasMethod(NPP, NPObject*, NPIdentifier methodName); + WEBKIT_API static bool hasMethod(NPP, NPObject*, NPIdentifier method); // NPN_HasProperty - WEBKIT_API static bool hasProperty(NPP, NPObject*, NPIdentifier propertyName); + WEBKIT_API static bool hasProperty(NPP, NPObject*, NPIdentifier property); // NPN_IdentifierIsString WEBKIT_API static bool identifierIsString(NPIdentifier); @@ -91,10 +92,10 @@ public: WEBKIT_API static int32_t intFromIdentifier(NPIdentifier); // NPN_Invoke - WEBKIT_API static bool invoke(NPP, NPObject*, NPIdentifier methodName, const NPVariant* args, uint32_t count, NPVariant* result); + WEBKIT_API static bool invoke(NPP, NPObject*, NPIdentifier method, const NPVariant* args, uint32_t argCount, NPVariant* result); // NPN_InvokeDefault - WEBKIT_API static bool invokeDefault(NPP, NPObject*, const NPVariant* args, uint32_t count, NPVariant* result); + WEBKIT_API static bool invokeDefault(NPP, NPObject*, const NPVariant* args, uint32_t argCount, NPVariant* result); // NPN_ReleaseObject WEBKIT_API static void releaseObject(NPObject*); @@ -127,17 +128,6 @@ public: // undefined. If iString is false, the opposite is true. WEBKIT_API static void extractIdentifierData(const NPIdentifier&, const NPUTF8*& string, int32_t& number, bool& isString); - // Return true (success) if the given npobj is the current drag event in browser dispatch, - // and is accessible based on context execution frames and their security origins and - // WebKit clipboard access policy. If so, return the event id and the clipboard data (WebDragData). - // This only works with V8. If compiled without V8, it'll always return false. - WEBKIT_API static bool getDragData(NPObject* event, int* eventId, WebDragData*); - - // Invoke the event access policy checks listed above with GetDragData(). No need for clipboard - // data or event_id outputs, just confirm the given npobj is the current & accessible drag event. - // This only works with V8. If compiled without V8, it'll always return false. - WEBKIT_API static bool isDragEvent(NPObject* event); - // Return true (success) if the given npobj is a range object. // If so, return that range as a WebRange object. WEBKIT_API static bool getRange(NPObject* range, WebRange*); @@ -148,6 +138,7 @@ public: WEBKIT_API static NPObject* makeIntArray(const WebVector<int>&); WEBKIT_API static NPObject* makeStringArray(const WebVector<WebString>&); + WEBKIT_API static NPObject* makeNode(const WebNode&); // Exceptions ------------------------------------------------------------- diff --git a/Source/WebKit/chromium/public/WebClipboard.h b/Source/WebKit/chromium/public/WebClipboard.h index f9a06cf..1be255a 100644 --- a/Source/WebKit/chromium/public/WebClipboard.h +++ b/Source/WebKit/chromium/public/WebClipboard.h @@ -32,18 +32,20 @@ #define WebClipboard_h #include "WebCommon.h" -#include "WebImage.h" +#include "WebData.h" #include "WebString.h" #include "WebVector.h" namespace WebKit { class WebDragData; +class WebImage; class WebURL; class WebClipboard { public: enum Format { + FormatPlainText, FormatHTML, FormatBookmark, FormatSmartPaste @@ -62,7 +64,7 @@ public: virtual WebString readPlainText(Buffer) { return WebString(); } virtual WebString readHTML(Buffer, WebURL*) { return WebString(); } - virtual WebImage readImage(Buffer) { return WebImage(); } + virtual WebData readImage(Buffer) { return WebData(); } virtual void writePlainText(const WebString&) { } virtual void writeHTML( diff --git a/Source/WebKit/chromium/public/WebCommonWorkerClient.h b/Source/WebKit/chromium/public/WebCommonWorkerClient.h index b99d39d..9f11aa2 100644 --- a/Source/WebKit/chromium/public/WebCommonWorkerClient.h +++ b/Source/WebKit/chromium/public/WebCommonWorkerClient.h @@ -92,12 +92,6 @@ public: WEBKIT_ASSERT_NOT_REACHED(); } - // This will be removed once changes in chromium use the new method above. - virtual void openFileSystem(WebFileSystem::Type, long long size, WebFileSystemCallbacks*) - { - WEBKIT_ASSERT_NOT_REACHED(); - } - protected: ~WebCommonWorkerClient() { } }; diff --git a/Source/WebKit/chromium/public/WebConsoleMessage.h b/Source/WebKit/chromium/public/WebConsoleMessage.h index d7a0ead..3dcbc77 100644 --- a/Source/WebKit/chromium/public/WebConsoleMessage.h +++ b/Source/WebKit/chromium/public/WebConsoleMessage.h @@ -49,7 +49,7 @@ struct WebConsoleMessage { WebConsoleMessage() : level(LevelLog) { } WebConsoleMessage(Level level, const WebString& text) - : level(LevelLog) + : level(level) , text(text) { } }; diff --git a/Source/WebKit/chromium/public/WebDOMMouseEvent.h b/Source/WebKit/chromium/public/WebDOMMouseEvent.h index 4c38b56..c3de098 100644 --- a/Source/WebKit/chromium/public/WebDOMMouseEvent.h +++ b/Source/WebKit/chromium/public/WebDOMMouseEvent.h @@ -44,10 +44,10 @@ public: WEBKIT_API int screenY() const; WEBKIT_API int clientX() const; WEBKIT_API int clientY() const; - WEBKIT_API int layerX() const; - WEBKIT_API int layerY() const; - WEBKIT_API int offsetX() const; - WEBKIT_API int offsetY() const; + WEBKIT_API int layerX(); + WEBKIT_API int layerY(); + WEBKIT_API int offsetX(); + WEBKIT_API int offsetY(); WEBKIT_API int pageX() const; WEBKIT_API int pageY() const; WEBKIT_API int x() const; diff --git a/Source/WebKit/chromium/public/WebDevToolsAgent.h b/Source/WebKit/chromium/public/WebDevToolsAgent.h index d6a7bcd..03303f7 100644 --- a/Source/WebKit/chromium/public/WebDevToolsAgent.h +++ b/Source/WebKit/chromium/public/WebDevToolsAgent.h @@ -33,13 +33,6 @@ #include "WebCommon.h" -#if WEBKIT_USING_V8 -namespace v8 { -class Value; -template <class T> class Handle; -} -#endif - namespace WebKit { class WebDevToolsAgentClient; class WebDevToolsMessageTransport; @@ -65,9 +58,6 @@ public: virtual void dispatchOnInspectorBackend(const WebString& message) = 0; virtual void inspectElementAt(const WebPoint&) = 0; -#if WEBKIT_USING_V8 - virtual void inspectNode(v8::Handle<v8::Value>) = 0; -#endif virtual void setRuntimeProperty(const WebString& name, const WebString& value) = 0; // Exposed for LayoutTestController. @@ -98,13 +88,6 @@ public: // Installs dispatch handle that is going to be called periodically // while on a breakpoint. WEBKIT_API static void setMessageLoopDispatchHandler(MessageLoopDispatchHandler); - - virtual void identifierForInitialRequest(unsigned long resourceId, WebFrame*, const WebURLRequest&) = 0; - virtual void willSendRequest(unsigned long resourceId, WebURLRequest&) = 0; - virtual void didReceiveData(unsigned long resourceId, int length) = 0; - virtual void didReceiveResponse(unsigned long resourceId, const WebURLResponse&) = 0; - virtual void didFinishLoading(unsigned long resourceId) = 0; - virtual void didFailLoading(unsigned long resourceId, const WebURLError&) = 0; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebDevToolsAgentClient.h b/Source/WebKit/chromium/public/WebDevToolsAgentClient.h index b373b60..3ec5487 100644 --- a/Source/WebKit/chromium/public/WebDevToolsAgentClient.h +++ b/Source/WebKit/chromium/public/WebDevToolsAgentClient.h @@ -42,7 +42,6 @@ class WebDevToolsAgentClient { public: virtual void sendMessageToInspectorFrontend(const WebString&) { } virtual void sendDebuggerOutput(const WebString&) { } - virtual void sendDispatchToAPU(const WebString&) { } // Returns the identifier of the entity hosting this agent. virtual int hostIdentifier() { return -1; } @@ -50,8 +49,6 @@ public: // Notifies host upon runtime feature being enabled/disabled. virtual void runtimePropertyChanged(const WebString& name, const WebString& value) { } - virtual WebCString debuggerScriptSource() { return WebCString(); } - class WebKitClientMessageLoop { public: virtual ~WebKitClientMessageLoop() { } diff --git a/Source/WebKit/chromium/public/WebDocument.h b/Source/WebKit/chromium/public/WebDocument.h index d9f7386..23f28c3 100644 --- a/Source/WebKit/chromium/public/WebDocument.h +++ b/Source/WebKit/chromium/public/WebDocument.h @@ -42,6 +42,7 @@ namespace WTF { template <typename T> class PassRefPtr; } #endif namespace WebKit { +class WebAccessibilityObject; class WebDocumentType; class WebElement; class WebFrame; @@ -79,6 +80,7 @@ public: WEBKIT_API WebElement getElementById(const WebString&) const; WEBKIT_API WebNode focusedNode() const; WEBKIT_API WebDocumentType doctype() const; + WEBKIT_API WebAccessibilityObject accessibilityObject() const; #if WEBKIT_IMPLEMENTATION WebDocument(const WTF::PassRefPtr<WebCore::Document>&); diff --git a/Source/WebKit/chromium/public/WebElement.h b/Source/WebKit/chromium/public/WebElement.h index 8d51e98..2072dd3 100644 --- a/Source/WebKit/chromium/public/WebElement.h +++ b/Source/WebKit/chromium/public/WebElement.h @@ -58,6 +58,7 @@ class WebNamedNodeMap; WEBKIT_API bool setAttribute(const WebString& name, const WebString& value); WEBKIT_API WebNamedNodeMap attributes() const; WEBKIT_API WebString innerText() const; + WEBKIT_API WebNode shadowRoot(); // Returns the language code specified for this element. This attribute // is inherited, so the returned value is drawn from the closest parent diff --git a/Source/WebKit/chromium/public/WebFileInfo.h b/Source/WebKit/chromium/public/WebFileInfo.h index be0b3e4..d326e06 100644 --- a/Source/WebKit/chromium/public/WebFileInfo.h +++ b/Source/WebKit/chromium/public/WebFileInfo.h @@ -31,6 +31,8 @@ #ifndef WebFileInfo_h #define WebFileInfo_h +#include "WebString.h" + namespace WebKit { struct WebFileInfo { @@ -50,6 +52,8 @@ struct WebFileInfo { Type type; + WebString platformPath; + WebFileInfo() : modificationTime(0.0), length(-1), type(TypeUnknown) { } }; diff --git a/Source/WebKit/chromium/public/WebFormControlElement.h b/Source/WebKit/chromium/public/WebFormControlElement.h index e70b995..53ef850 100644 --- a/Source/WebKit/chromium/public/WebFormControlElement.h +++ b/Source/WebKit/chromium/public/WebFormControlElement.h @@ -54,6 +54,7 @@ public: void assign(const WebFormControlElement& e) { WebElement::assign(e); } WEBKIT_API bool isEnabled() const; + WEBKIT_API bool isReadOnly() const; WEBKIT_API WebString formControlName() const; WEBKIT_API WebString formControlType() const; diff --git a/Source/WebKit/chromium/public/WebFrame.h b/Source/WebKit/chromium/public/WebFrame.h index f3f5ba6..d5d2ff4 100644 --- a/Source/WebKit/chromium/public/WebFrame.h +++ b/Source/WebKit/chromium/public/WebFrame.h @@ -70,11 +70,9 @@ struct WebFindOptions; struct WebRect; struct WebScriptSource; struct WebSize; +struct WebURLLoaderOptions; template <typename T> class WebVector; -// FIXME(jam): take this out once Chromium has this -#define WEBFRAME_PRINTBEGIN_TAKES_NODE - class WebFrame { public: // Returns the number of live WebFrame objects, used for leak checking. @@ -345,10 +343,13 @@ public: // DEPRECATED: Please use createAssociatedURLLoader instead. virtual void dispatchWillSendRequest(WebURLRequest&) = 0; + // FIXME: Remove this overload when clients have been changed to pass options. + virtual WebURLLoader* createAssociatedURLLoader() = 0; + // Returns a WebURLLoader that is associated with this frame. The loader // will, for example, be cancelled when WebFrame::stopLoading is called. // FIXME: stopLoading does not yet cancel an associated loader!! - virtual WebURLLoader* createAssociatedURLLoader() = 0; + virtual WebURLLoader* createAssociatedURLLoader(const WebURLLoaderOptions&) = 0; // Called from within WebFrameClient::didReceiveDocumentData to commit // data for the frame that will be used to construct the frame's @@ -365,10 +366,6 @@ public: // with a suppressed opener. virtual bool willSuppressOpenerInNewFrame() const = 0; - // Returns true if this frame is in the midst of executing a beforeunload - // or unload event handler. - virtual bool pageDismissalEventBeingDispatched() const = 0; - // Editing ------------------------------------------------------------- @@ -549,7 +546,7 @@ public: // Returns a text representation of the render tree. This method is used // to support layout tests. - virtual WebString renderTreeAsText() const = 0; + virtual WebString renderTreeAsText(bool showDebugInfo = false) const = 0; // Returns the counter value for the specified element. This method is // used to support layout tests. @@ -582,7 +579,7 @@ public: // Dumps the layer tree, used by the accelerated compositor, in // text form. This is used only by layout tests. - virtual WebString layerTreeAsText() const = 0; + virtual WebString layerTreeAsText(bool showDebugInfo = false) const = 0; protected: ~WebFrame() { } diff --git a/Source/WebKit/chromium/public/WebGeolocationClientMock.h b/Source/WebKit/chromium/public/WebGeolocationClientMock.h index 08a85e2..9a39e2e 100644 --- a/Source/WebKit/chromium/public/WebGeolocationClientMock.h +++ b/Source/WebKit/chromium/public/WebGeolocationClientMock.h @@ -51,6 +51,7 @@ public: WEBKIT_API void setPosition(double latitude, double longitude, double accuracy); WEBKIT_API void setError(int errorCode, const WebString& message); WEBKIT_API void setPermission(bool); + WEBKIT_API int numberOfPendingPermissionRequests() const; WEBKIT_API void resetMock(); virtual void startUpdating(); diff --git a/Source/WebKit/chromium/public/WebIDBCallbacks.h b/Source/WebKit/chromium/public/WebIDBCallbacks.h index 1eb6d3a..ec7c095 100644 --- a/Source/WebKit/chromium/public/WebIDBCallbacks.h +++ b/Source/WebKit/chromium/public/WebIDBCallbacks.h @@ -49,8 +49,8 @@ public: virtual void onSuccess(WebIDBCursor*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(WebIDBDatabase*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(const WebIDBKey&) { WEBKIT_ASSERT_NOT_REACHED(); } + // FIXME: remove after Webkit roll. virtual void onSuccess(WebIDBIndex*) { WEBKIT_ASSERT_NOT_REACHED(); } - virtual void onSuccess(WebIDBObjectStore*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(WebIDBTransaction*) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onSuccess(const WebSerializedScriptValue&) { WEBKIT_ASSERT_NOT_REACHED(); } virtual void onBlocked() { WEBKIT_ASSERT_NOT_REACHED(); } diff --git a/Source/WebKit/chromium/public/WebIDBFactory.h b/Source/WebKit/chromium/public/WebIDBFactory.h index 977510f..29414e8 100755 --- a/Source/WebKit/chromium/public/WebIDBFactory.h +++ b/Source/WebKit/chromium/public/WebIDBFactory.h @@ -51,8 +51,18 @@ public: virtual ~WebIDBFactory() { } + enum BackingStoreType { + DefaultBackingStore, + LevelDBBackingStore + }; + // The WebKit implementation of open ignores the WebFrame* parameter. - virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize) { WEBKIT_ASSERT_NOT_REACHED(); } + // FIXME: Assert not reached when Chromium side is updated. + virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { open(name, callbacks, origin, frame, dataDir, maximumSize); } + + // FIXME: Remove this when Chromium side is updated. + virtual void open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* frame, const WebString& dataDir, unsigned long long maximumSize) { open(name, callbacks, origin, frame, dataDir, maximumSize, DefaultBackingStore); } + virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); } }; diff --git a/Source/WebKit/chromium/public/WebInputElement.h b/Source/WebKit/chromium/public/WebInputElement.h index 1f0836b..3ae6578 100644 --- a/Source/WebKit/chromium/public/WebInputElement.h +++ b/Source/WebKit/chromium/public/WebInputElement.h @@ -60,8 +60,6 @@ namespace WebKit { 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; WEBKIT_API int maxLength() const; WEBKIT_API bool isActivatedSubmit() const; WEBKIT_API void setActivatedSubmit(bool); diff --git a/Source/WebKit/chromium/public/WebKitClient.h b/Source/WebKit/chromium/public/WebKitClient.h index 208ecdd..eb99531 100644 --- a/Source/WebKit/chromium/public/WebKitClient.h +++ b/Source/WebKit/chromium/public/WebKitClient.h @@ -286,6 +286,7 @@ public: // Audio -------------------------------------------------------------- + virtual double audioHardwareSampleRate() { return 0; } virtual WebAudioDevice* createAudioDevice(size_t bufferSize, unsigned numberOfChannels, double sampleRate, WebAudioDevice::RenderCallback*) { return 0; } // FileSystem ---------------------------------------------------------- diff --git a/Source/WebKit/chromium/public/WebMediaPlayerClient.h b/Source/WebKit/chromium/public/WebMediaPlayerClient.h index 7e5dd68..5f60870 100644 --- a/Source/WebKit/chromium/public/WebMediaPlayerClient.h +++ b/Source/WebKit/chromium/public/WebMediaPlayerClient.h @@ -49,6 +49,7 @@ public: virtual void sizeChanged() = 0; virtual void sawUnsupportedTracks() = 0; virtual float volume() const = 0; + virtual void playbackStateChanged() = 0; protected: ~WebMediaPlayerClient() { } diff --git a/Source/WebKit/chromium/public/WebMenuItemInfo.h b/Source/WebKit/chromium/public/WebMenuItemInfo.h index f6e622a..742b4ef 100644 --- a/Source/WebKit/chromium/public/WebMenuItemInfo.h +++ b/Source/WebKit/chromium/public/WebMenuItemInfo.h @@ -49,6 +49,8 @@ struct WebMenuItemInfo { WebMenuItemInfo() : type(Option) , action(0) + , textDirection(WebTextDirectionDefault) + , hasTextDirectionOverride(false) , enabled(false) , checked(false) { diff --git a/Source/WebKit/chromium/public/WebNode.h b/Source/WebKit/chromium/public/WebNode.h index 7116dfa..92b17d4 100644 --- a/Source/WebKit/chromium/public/WebNode.h +++ b/Source/WebKit/chromium/public/WebNode.h @@ -96,6 +96,7 @@ public: WEBKIT_API WebNodeList childNodes(); WEBKIT_API WebString createMarkup() const; WEBKIT_API bool isTextNode() const; + WEBKIT_API bool isFocusable() const; WEBKIT_API bool isContentEditable() const; WEBKIT_API bool isElementNode() const; WEBKIT_API void addEventListener(const WebString& eventType, WebDOMEventListener* listener, bool useCapture); diff --git a/Source/WebKit/chromium/public/WebPageSerializer.h b/Source/WebKit/chromium/public/WebPageSerializer.h index 94f7994..b4d5715 100644 --- a/Source/WebKit/chromium/public/WebPageSerializer.h +++ b/Source/WebKit/chromium/public/WebPageSerializer.h @@ -34,10 +34,12 @@ #include "WebCommon.h" namespace WebKit { +class WebCString; class WebFrame; class WebPageSerializerClient; class WebString; class WebURL; +class WebView; template <typename T> class WebVector; // Get html data by serializing all frames of current page with lists @@ -69,6 +71,14 @@ public: const WebVector<WebString>& localPaths, const WebString& localDirectoryName); + // Retrieve all the resource for the passed view, including the main frame + // and sub-frames. Returns true if all resources were retrieved + // successfully. + WEBKIT_API static bool retrieveAllResources(WebView*, + const WebVector<WebCString>& supportedSchemes, + WebVector<WebURL>* resources, + WebVector<WebURL>* frames); + // FIXME: The following are here for unit testing purposes. Consider // changing the unit tests instead. @@ -80,6 +90,6 @@ public: WEBKIT_API static WebString generateBaseTagDeclaration(const WebString& baseTarget); }; -} // namespace WebKit +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/public/WebPlugin.h b/Source/WebKit/chromium/public/WebPlugin.h index 4a6f081..17e29e2 100644 --- a/Source/WebKit/chromium/public/WebPlugin.h +++ b/Source/WebKit/chromium/public/WebPlugin.h @@ -64,10 +64,6 @@ public: virtual void updateGeometry( const WebRect& frameRect, const WebRect& clipRect, const WebVector<WebRect>& cutOutsRects, bool isVisible) = 0; - - // If the plugin instance is backed by an OpenGL texture, return its ID in the - // compositors namespace. Otherwise return 0. Returns 0 by default. - virtual unsigned getBackingTextureId() { return 0; } virtual void updateFocus(bool) = 0; virtual void updateVisibility(bool) = 0; diff --git a/Source/WebKit/chromium/public/WebPluginContainer.h b/Source/WebKit/chromium/public/WebPluginContainer.h index c580f81..026028b 100644 --- a/Source/WebKit/chromium/public/WebPluginContainer.h +++ b/Source/WebKit/chromium/public/WebPluginContainer.h @@ -55,6 +55,10 @@ public: // WebPlugin::updateGeometry. virtual void reportGeometry() = 0; + // Sets the id of the texture used for hw-accel compositing. + // The default value for id is zero which indicates software rendering. + // A non-zero value will trigger hw-accelerated compositing. + virtual void setBackingTextureId(unsigned) = 0; // Called when the backing texture is ready to be composited. virtual void commitBackingTexture() {} diff --git a/Source/WebKit/chromium/public/WebRuntimeFeatures.h b/Source/WebKit/chromium/public/WebRuntimeFeatures.h index c9e32f5..dfaae5e 100644 --- a/Source/WebKit/chromium/public/WebRuntimeFeatures.h +++ b/Source/WebKit/chromium/public/WebRuntimeFeatures.h @@ -63,6 +63,9 @@ public: WEBKIT_API static void enableApplicationCache(bool); WEBKIT_API static bool isApplicationCacheEnabled(); + + WEBKIT_API static void enableDataTransferItems(bool); + WEBKIT_API static bool isDataTransferItemsEnabled(); WEBKIT_API static void enableGeolocation(bool); WEBKIT_API static bool isGeolocationEnabled(); @@ -73,9 +76,6 @@ public: WEBKIT_API static void enableWebAudio(bool); WEBKIT_API static bool isWebAudioEnabled(); - WEBKIT_API static void enableWebGL(bool); - WEBKIT_API static bool isWebGLEnabled(); - WEBKIT_API static void enablePushState(bool); WEBKIT_API static bool isPushStateEnabled(bool); diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h index 11ed49d..113de52 100644 --- a/Source/WebKit/chromium/public/WebSettings.h +++ b/Source/WebKit/chromium/public/WebSettings.h @@ -101,6 +101,7 @@ public: virtual bool showPlatformLayerTree() const = 0; virtual void setEditingBehavior(EditingBehavior) = 0; virtual void setAcceleratedCompositingEnabled(bool) = 0; + virtual void setForceCompositingMode(bool) = 0; virtual void setCompositeToTextureEnabled(bool) = 0; virtual bool compositeToTextureEnabled() const = 0; virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool) = 0; diff --git a/Source/WebKit/chromium/public/WebSpellCheckClient.h b/Source/WebKit/chromium/public/WebSpellCheckClient.h new file mode 100755 index 0000000..87bdf9e --- /dev/null +++ b/Source/WebKit/chromium/public/WebSpellCheckClient.h @@ -0,0 +1,73 @@ +/* + * 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 WebSpellCheckClient_h +#define WebSpellCheckClient_h + +#include "WebString.h" + +namespace WebKit { + +class WebString; +class WebTextCheckingCompletion; + +class WebSpellCheckClient { +public: + // The client should perform spell-checking on the given text. If the + // text contains a misspelled word, then upon return misspelledOffset + // will point to the start of the misspelled word, and misspelledLength + // will indicates its length. Otherwise, if there was not a spelling + // error, then upon return misspelledLength is 0. + virtual void spellCheck( + const WebString& text, int& misspelledOffset, int& misspelledLength) { } + // Requests asynchronous spelling and grammar checking, whose result should be + // returned by passed completion object. + virtual void requestCheckingOfText(const WebString&, WebTextCheckingCompletion*) { } + + // Computes an auto-corrected replacement for a misspelled word. If no + // replacement is found, then an empty string is returned. + virtual WebString autoCorrectWord(const WebString& misspelledWord) { return WebString(); } + + // Show or hide the spelling UI. + virtual void showSpellingUI(bool show) { } + + // Returns true if the spelling UI is showing. + virtual bool isShowingSpellingUI() { return false; } + + // Update the spelling UI with the given word. + virtual void updateSpellingUIWithMisspelledWord(const WebString& word) { } + +protected: + ~WebSpellCheckClient() { } +}; + +} // namespace WebKit + +#endif diff --git a/Source/WebKit/chromium/public/WebTextCheckingCompletion.h b/Source/WebKit/chromium/public/WebTextCheckingCompletion.h index 7e6526d..a207a27 100644 --- a/Source/WebKit/chromium/public/WebTextCheckingCompletion.h +++ b/Source/WebKit/chromium/public/WebTextCheckingCompletion.h @@ -35,7 +35,7 @@ namespace WebKit { -class WebTextCheckingResult; +struct WebTextCheckingResult; template <typename T> class WebVector; // Gets called back when WebViewClient finished an asynchronous spell checking. diff --git a/Source/WebKit/chromium/public/WebTextCheckingResult.h b/Source/WebKit/chromium/public/WebTextCheckingResult.h index 4d16d31..79fbb56 100644 --- a/Source/WebKit/chromium/public/WebTextCheckingResult.h +++ b/Source/WebKit/chromium/public/WebTextCheckingResult.h @@ -36,28 +36,22 @@ namespace WebKit { // A checked entry of text checking. -class WebTextCheckingResult { -public: +struct WebTextCheckingResult { enum Error { ErrorSpelling = 1 << 0, ErrorGrammar = 1 << 1 }; - Error error() const { return m_error; } - int position() const { return m_position; } - int length() const { return m_length; } - - explicit WebTextCheckingResult(Error error = ErrorSpelling, int position = 0, int length = 0) - : m_error(error) - , m_position(position) - , m_length(length) + explicit WebTextCheckingResult(Error e = ErrorSpelling, int p = 0, int l = 0) + : error(e) + , position(p) + , length(l) { } - -private: - Error m_error; - int m_position; - int m_length; + + Error error; + int position; + int length; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/public/WebURL.h b/Source/WebKit/chromium/public/WebURL.h index bb90e32..707ba08 100644 --- a/Source/WebKit/chromium/public/WebURL.h +++ b/Source/WebKit/chromium/public/WebURL.h @@ -143,6 +143,16 @@ inline bool operator<(const WebURL& a, const WebURL& b) return a.spec() < b.spec(); } +inline bool operator==(const WebURL& a, const WebURL& b) +{ + return !a.spec().compare(b.spec()); +} + +inline bool operator!=(const WebURL& a, const WebURL& b) +{ + return !(a == b); +} + } // namespace WebKit #endif diff --git a/Source/WebKit/chromium/public/WebURLLoader.h b/Source/WebKit/chromium/public/WebURLLoader.h index 54d105e..38efcb4 100644 --- a/Source/WebKit/chromium/public/WebURLLoader.h +++ b/Source/WebKit/chromium/public/WebURLLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2009, 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -41,6 +41,21 @@ class WebURLRequest; class WebURLResponse; struct WebURLError; +enum WebCrossOriginRequestPolicy { + DenyCrossOriginRequests, + UseAccessControl, + AllowCrossOriginRequests +}; + +struct WebURLLoaderOptions { + WebURLLoaderOptions() : sniffContent(false), allowCredentials(false), forcePreflight(false), crossOriginRequestPolicy(DenyCrossOriginRequests) { } + + bool sniffContent; // Whether to sniff content. + bool allowCredentials; // Whether to send HTTP credentials and cookies with the request. + bool forcePreflight; // If AccessControl is used, whether to force a preflight. + WebCrossOriginRequestPolicy crossOriginRequestPolicy; +}; + class WebURLLoader { public: // The WebURLLoader may be deleted in a call to its client. diff --git a/Source/WebKit/chromium/public/WebURLLoaderClient.h b/Source/WebKit/chromium/public/WebURLLoaderClient.h index 87d100f..e306b19 100644 --- a/Source/WebKit/chromium/public/WebURLLoaderClient.h +++ b/Source/WebKit/chromium/public/WebURLLoaderClient.h @@ -58,6 +58,10 @@ public: virtual void didDownloadData(WebURLLoader*, int dataLength) { } // Called when a chunk of response data is received. + // FIXME(vsevik): rename once original didReceiveData() is removed. + virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) { } + + // FIXME(vsevik): remove once not used downstream virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength) { } // Called when a chunk of renderer-generated metadata is received from the cache. diff --git a/Source/WebKit/chromium/public/WebVector.h b/Source/WebKit/chromium/public/WebVector.h index cf3ec95..bb02abc 100644 --- a/Source/WebKit/chromium/public/WebVector.h +++ b/Source/WebKit/chromium/public/WebVector.h @@ -125,6 +125,15 @@ public: WEBKIT_ASSERT(i < m_size); return m_ptr[i]; } + + bool contains(const T& value) const + { + for (size_t i = 0; i < m_size; i++) { + if (m_ptr[i] == value) + return true; + } + return false; + } T* data() { return m_ptr; } const T* data() const { return m_ptr; } @@ -172,6 +181,6 @@ private: size_t m_size; }; -} // namespace WebKit +} // namespace WebKit #endif diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h index 081fddb..d32e09c 100644 --- a/Source/WebKit/chromium/public/WebView.h +++ b/Source/WebKit/chromium/public/WebView.h @@ -36,9 +36,6 @@ #include "WebVector.h" #include "WebWidget.h" -// FIXME(jam): take out once Chromium rolls past this revision -#define WEBKIT_HAS_WEB_AUTO_FILL_CLIENT - namespace WebKit { class WebAccessibilityObject; @@ -51,6 +48,7 @@ class WebFrameClient; class WebGraphicsContext3D; class WebNode; class WebSettings; +class WebSpellCheckClient; class WebString; class WebViewClient; struct WebMediaPlayerAction; @@ -86,9 +84,7 @@ public: // Creates a WebView that is NOT yet initialized. You will need to // call initializeMainFrame to finish the initialization. It is valid // to pass null client pointers. - WEBKIT_API static WebView* create(WebViewClient*, - WebDevToolsAgentClient*, - WebAutoFillClient*); + WEBKIT_API static WebView* create(WebViewClient*); // After creating a WebView, you should immediately call this method. // You can optionally modify the settings before calling this method. @@ -96,6 +92,11 @@ public: // child frames. It is valid to pass a null WebFrameClient pointer. virtual void initializeMainFrame(WebFrameClient*) = 0; + // Initializes the various client interfaces. + virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; + virtual void setAutoFillClient(WebAutoFillClient*) = 0; + virtual void setSpellCheckClient(WebSpellCheckClient*) = 0; + // Options ------------------------------------------------------------- @@ -229,7 +230,11 @@ public: // Callback methods when a drag-and-drop operation is trying to drop // something on the WebView. virtual WebDragOperation dragTargetDragEnter( - const WebDragData&, int identity, + const WebDragData&, int identity, // FIXME: remove identity from this function signature. + const WebPoint& clientPoint, const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed) = 0; + virtual WebDragOperation dragTargetDragEnter( + const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) = 0; virtual WebDragOperation dragTargetDragOver( @@ -239,13 +244,6 @@ public: virtual void dragTargetDrop( const WebPoint& clientPoint, const WebPoint& screenPoint) = 0; - virtual int dragIdentity() = 0; - - // Helper method for drag and drop target operations: override the - // default drop effect with either a "copy" (accept true) or "none" - // (accept false) effect. Return true on success. - virtual bool setDropEffect(bool accept) = 0; - // Support for resource loading initiated by plugins ------------------- diff --git a/Source/WebKit/chromium/public/WebViewClient.h b/Source/WebKit/chromium/public/WebViewClient.h index 2588788..c168ef2 100644 --- a/Source/WebKit/chromium/public/WebViewClient.h +++ b/Source/WebKit/chromium/public/WebViewClient.h @@ -64,7 +64,6 @@ class WebRange; class WebSpeechInputController; class WebSpeechInputListener; class WebStorageNamespace; -class WebTextCheckingCompletion; class WebURL; class WebURLRequest; class WebView; @@ -170,32 +169,6 @@ public: virtual bool handleCurrentKeyboardEvent() { return false; } - // Spellchecker -------------------------------------------------------- - - // The client should perform spell-checking on the given text. If the - // text contains a misspelled word, then upon return misspelledOffset - // will point to the start of the misspelled word, and misspelledLength - // will indicates its length. Otherwise, if there was not a spelling - // error, then upon return misspelledLength is 0. - virtual void spellCheck( - const WebString& text, int& misspelledOffset, int& misspelledLength) { } - // Requests asynchronous spelling and grammar checking, whose result should be - // returned by passed completion object. - virtual void requestCheckingOfText(const WebString&, WebTextCheckingCompletion*) { } - // Computes an auto-corrected replacement for a misspelled word. If no - // replacement is found, then an empty string is returned. - virtual WebString autoCorrectWord(const WebString& misspelledWord) { return WebString(); } - - // Show or hide the spelling UI. - virtual void showSpellingUI(bool show) { } - - // Returns true if the spelling UI is showing. - virtual bool isShowingSpellingUI() { return false; } - - // Update the spelling UI with the given word. - virtual void updateSpellingUIWithMisspelledWord(const WebString& word) { } - - // Dialogs ------------------------------------------------------------- // This method returns immediately after showing the dialog. When the diff --git a/Source/WebKit/chromium/public/gtk/WebFontInfo.h b/Source/WebKit/chromium/public/gtk/WebFontInfo.h index d603372..aa31faf 100644 --- a/Source/WebKit/chromium/public/gtk/WebFontInfo.h +++ b/Source/WebKit/chromium/public/gtk/WebFontInfo.h @@ -50,7 +50,7 @@ public: // // Returns: the font family or an empty string if the request could not be // satisfied. - WEBKIT_API static WebCString familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale = 0); + WEBKIT_API static WebCString familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale); // Fill out the given WebFontRenderStyle with the user's preferences for // rendering the given font at the given size. diff --git a/Source/WebKit/chromium/scripts/generate_devtools_grd.py b/Source/WebKit/chromium/scripts/generate_devtools_grd.py new file mode 100644 index 0000000..fabe64b --- /dev/null +++ b/Source/WebKit/chromium/scripts/generate_devtools_grd.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# +# Copyright (C) 2011 Google Inc. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Creates a grd file for packaging the inspector files.""" + +from __future__ import with_statement + +import errno +import os +import shutil +import sys +from xml.dom import minidom + +kDevToolsResourcePrefix = 'IDR_DEVTOOLS_' +kGrdTemplate = '''<?xml version="1.0" encoding="UTF-8"?> +<grit latest_public_release="0" current_release="1"> + <outputs> + <output filename="grit/devtools_resources.h" type="rc_header"> + <emit emit_type='prepend'></emit> + </output> + <output filename="grit/devtools_resources_map.cc" type="resource_file_map_source" /> + <output filename="grit/devtools_resources_map.h" type="resource_map_header" /> + + <output filename="devtools_resources.pak" type="data_package" /> + </outputs> + <release seq="1"> + <includes></includes> + </release> +</grit> +''' + + +class ParsedArgs: + def __init__(self, source_files, image_dirs, output_filename): + self.source_files = source_files + self.image_dirs = image_dirs + self.output_filename = output_filename + + +def parse_args(argv): + images_position = argv.index('--images') + output_position = argv.index('--output') + source_files = argv[:images_position] + image_dirs = argv[images_position + 1:output_position] + return ParsedArgs(source_files, image_dirs, argv[output_position + 1]) + + +def make_name_from_filename(filename): + return (filename.replace('/', '_') + .replace('\\', '_') + .replace('.', '_')).upper() + + +def add_file_to_grd(grd_doc, filename): + includes_node = grd_doc.getElementsByTagName('includes')[0] + includes_node.appendChild(grd_doc.createTextNode('\n ')) + + new_include_node = grd_doc.createElement('include') + new_include_node.setAttribute('name', make_name_from_filename(filename)) + new_include_node.setAttribute('file', filename) + new_include_node.setAttribute('type', 'BINDATA') + includes_node.appendChild(new_include_node) + + +def main(argv): + parsed_args = parse_args(argv[1:]) + + doc = minidom.parseString(kGrdTemplate) + output_directory = os.path.dirname(parsed_args.output_filename) + + try: + os.makedirs(os.path.join(output_directory, 'Images')) + except OSError, e: + if e.errno != errno.EEXIST: + raise e + + for filename in parsed_args.source_files: + shutil.copy(filename, output_directory) + add_file_to_grd(doc, os.path.basename(filename)) + + for dirname in parsed_args.image_dirs: + for filename in os.listdir(dirname): + if not filename.endswith('.png') and not filename.endswith('.gif'): + continue + shutil.copy(os.path.join(dirname, filename), + os.path.join(output_directory, 'Images')) + add_file_to_grd(doc, os.path.join('Images', filename)) + + with open(parsed_args.output_filename, 'w') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff --git a/Source/WebKit/chromium/scripts/generate_devtools_html.py b/Source/WebKit/chromium/scripts/generate_devtools_html.py index b9b5fff..b8eab09 100644 --- a/Source/WebKit/chromium/scripts/generate_devtools_html.py +++ b/Source/WebKit/chromium/scripts/generate_devtools_html.py @@ -45,17 +45,17 @@ def GenerateIncludeTag(resource_path): def main(argv): - if len(argv) < 5: - print('usage: %s ignored inspector_html devtools_html debug' + if len(argv) < 4: + print('usage: %s inspector_html devtools_html debug' ' css_and_js_files_list' % argv[0]) return 1 # The first argument is ignored. We put 'webkit.gyp' in the inputs list # for this script, so every time the list of script gets changed, our html # file is rebuilt. - inspector_html_name = argv[2] - devtools_html_name = argv[3] - debug = argv[4] != '0' + inspector_html_name = argv[1] + devtools_html_name = argv[2] + debug = argv[3] != '0' inspector_html = open(inspector_html_name, 'r') devtools_html = open(devtools_html_name, 'w') @@ -66,7 +66,7 @@ def main(argv): continue if '</head>' in line: if debug: - for resource in argv[5:]: + for resource in argv[4:]: devtools_html.write(GenerateIncludeTag(resource)) else: devtools_html.write(GenerateIncludeTag("devTools.css")) diff --git a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp index 2696b2c..3981ee9 100644 --- a/Source/WebKit/chromium/src/ApplicationCacheHost.cpp +++ b/Source/WebKit/chromium/src/ApplicationCacheHost.cpp @@ -42,6 +42,7 @@ #include "Page.h" #include "ProgressEvent.h" #include "Settings.h" +#include "WebFrameImpl.h" #include "WebURL.h" #include "WebURLError.h" #include "WebURLResponse.h" @@ -81,7 +82,7 @@ void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, Subst m_internal.set(new ApplicationCacheHostInternal(this)); if (m_internal->m_outerHost) { WrappedResourceRequest wrapped(request); - m_internal->m_outerHost->willStartMainResourceRequest(wrapped); + m_internal->m_outerHost->willStartMainResourceRequest(wrapped, WebFrameImpl::fromFrame(m_documentLoader->frame())); } else m_internal.clear(); @@ -259,7 +260,7 @@ void ApplicationCacheHost::stopDeferringEvents() void ApplicationCacheHost::stopLoadingInFrame(Frame* frame) { - // FIXME: Implement this method. + // N/A to the chromium port } void ApplicationCacheHost::dispatchDOMEvent(EventID id, int total, int done) diff --git a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp index 20fbcd5..7baaf8a 100644 --- a/Source/WebKit/chromium/src/AssertMatchingEnums.cpp +++ b/Source/WebKit/chromium/src/AssertMatchingEnums.cpp @@ -45,6 +45,7 @@ #include "GeolocationError.h" #include "GeolocationPosition.h" #include "HTMLInputElement.h" +#include "IDBFactoryBackendInterface.h" #include "IDBKey.h" #include "MediaPlayer.h" #include "NotificationPresenter.h" @@ -67,6 +68,7 @@ #include "WebFontDescription.h" #include "WebGeolocationError.h" #include "WebGeolocationPosition.h" +#include "WebIDBFactory.h" #include "WebIDBKey.h" #include "WebInputElement.h" #include "WebMediaPlayer.h" @@ -171,6 +173,10 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTreeItemRole, TreeItemRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDirectory, DirectoryRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleEditableText, EditableTextRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleListItem, ListItemRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleParagraph, ParagraphRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLabel, LabelRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDiv, DivRole); +COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleForm, FormRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkApplication, LandmarkApplicationRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkBanner, LandmarkBannerRole); COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleLandmarkComplementary, LandmarkComplementaryRole); @@ -209,6 +215,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::CachedEvent, ApplicationCa COMPILE_ASSERT_MATCHING_ENUM(WebApplicationCacheHost::ObsoleteEvent, ApplicationCacheHost::OBSOLETE_EVENT); #endif +COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatPlainText, PasteboardPrivate::PlainTextFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatHTML, PasteboardPrivate::HTMLFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatBookmark, PasteboardPrivate::BookmarkFormat); COMPILE_ASSERT_MATCHING_ENUM(WebClipboard::FormatSmartPaste, PasteboardPrivate::WebSmartPasteFormat); @@ -377,6 +384,9 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::StringType, IDBKey::StringType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::DateType, IDBKey::DateType); COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType); +COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::DefaultBackingStore, IDBFactoryBackendInterface::DefaultBackingStore); +COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBackendInterface::LevelDBBackingStore); + #if ENABLE(FILE_SYSTEM) COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary); COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypePersistent, AsyncFileSystem::Persistent); diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp index 34a4055..1ca9900 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.cpp +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010, 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,103 +31,206 @@ #include "config.h" #include "AssociatedURLLoader.h" +#include "DocumentThreadableLoader.h" +#include "DocumentThreadableLoaderClient.h" +#include "SubresourceLoader.h" #include "WebApplicationCacheHost.h" #include "WebDataSource.h" #include "WebFrameImpl.h" #include "WebKit.h" #include "WebKitClient.h" +#include "WebURLError.h" +#include "WebURLLoaderClient.h" #include "WebURLRequest.h" +#include "WrappedResourceRequest.h" +#include "WrappedResourceResponse.h" + +using namespace WebCore; +using namespace WebKit; +using namespace WTF; namespace WebKit { -AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) - : m_frameImpl(frameImpl), - m_realLoader(webKitClient()->createURLLoader()), - m_realClient(0) +// This class bridges the interface differences between WebCore and WebKit loader clients. +// It forwards its ThreadableLoaderClient notifications to a WebURLLoaderClient. +class AssociatedURLLoader::ClientAdapter : public DocumentThreadableLoaderClient { +public: + static PassOwnPtr<ClientAdapter> create(AssociatedURLLoader*, WebURLLoaderClient*, bool /*downloadToFile*/); + + virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/); + virtual void willSendRequest(ResourceRequest& /*newRequest*/, const ResourceResponse& /*redirectResponse*/); + + virtual void didReceiveResponse(const ResourceResponse&); + virtual void didReceiveData(const char*, int /*dataLength*/); + virtual void didReceiveCachedMetadata(const char*, int /*dataLength*/); + virtual void didFinishLoading(unsigned long /*identifier*/, double /*finishTime*/); + virtual void didFail(const ResourceError&); + + virtual bool isDocumentThreadableLoaderClient() { return true; } + + // This method stops loading and releases the DocumentThreadableLoader as early as possible. + void clearClient() { m_client = 0; } + +private: + ClientAdapter(AssociatedURLLoader*, WebURLLoaderClient*, bool /*downloadToFile*/); + + AssociatedURLLoader* m_loader; + WebURLLoaderClient* m_client; + unsigned long m_downloadLength; + bool m_downloadToFile; +}; + +PassOwnPtr<AssociatedURLLoader::ClientAdapter> AssociatedURLLoader::ClientAdapter::create(AssociatedURLLoader* loader, WebURLLoaderClient* client, bool downloadToFile) { + return adoptPtr(new ClientAdapter(loader, client, downloadToFile)); } -AssociatedURLLoader::~AssociatedURLLoader() +AssociatedURLLoader::ClientAdapter::ClientAdapter(AssociatedURLLoader* loader, WebURLLoaderClient* client, bool downloadToFile) + : m_loader(loader) + , m_client(client) + , m_downloadLength(0) + , m_downloadToFile(downloadToFile) { + ASSERT(m_loader); + ASSERT(m_client); } -void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) +void AssociatedURLLoader::ClientAdapter::willSendRequest(ResourceRequest& newRequest, const ResourceResponse& redirectResponse) { - ASSERT(!m_realClient); - - WebURLRequest requestCopy(request); - prepareRequest(requestCopy); + if (!m_client) + return; - m_realLoader->loadSynchronously(requestCopy, response, error, data); + WrappedResourceRequest wrappedNewRequest(newRequest); + WrappedResourceResponse wrappedRedirectResponse(redirectResponse); + m_client->willSendRequest(m_loader, wrappedNewRequest, wrappedRedirectResponse); } -void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) +void AssociatedURLLoader::ClientAdapter::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) { - ASSERT(!m_realClient); + if (!m_client) + return; - WebURLRequest requestCopy(request); - prepareRequest(requestCopy); + m_client->didSendData(m_loader, bytesSent, totalBytesToBeSent); +} - m_realClient = client; - m_realLoader->loadAsynchronously(requestCopy, this); +void AssociatedURLLoader::ClientAdapter::didReceiveResponse(const ResourceResponse& response) +{ + WrappedResourceResponse wrappedResponse(response); + m_client->didReceiveResponse(m_loader, wrappedResponse); } -void AssociatedURLLoader::cancel() +void AssociatedURLLoader::ClientAdapter::didReceiveData(const char* data, int dataLength) { - m_realLoader->cancel(); + if (!m_client) + return; + + // FIXME(vsevik): add -1 to params once migrated. + m_client->didReceiveData(m_loader, data, dataLength); + m_downloadLength += dataLength; } -void AssociatedURLLoader::setDefersLoading(bool defersLoading) +void AssociatedURLLoader::ClientAdapter::didReceiveCachedMetadata(const char* data, int lengthReceived) { - m_realLoader->setDefersLoading(defersLoading); + if (!m_client) + return; + + m_client->didReceiveCachedMetadata(m_loader, data, lengthReceived); } -void AssociatedURLLoader::prepareRequest(WebURLRequest& request) +void AssociatedURLLoader::ClientAdapter::didFinishLoading(unsigned long identifier, double finishTime) { - WebApplicationCacheHost* applicationCacheHost = m_frameImpl->dataSource()->applicationCacheHost(); - if (applicationCacheHost) - applicationCacheHost->willStartSubResourceRequest(request); - m_frameImpl->dispatchWillSendRequest(request); + if (!m_client) + return; + + if (m_downloadToFile) { + int downloadLength = m_downloadLength <= INT_MAX ? m_downloadLength : INT_MAX; + m_client->didDownloadData(m_loader, downloadLength); + // While the client could have cancelled, continue, since the load finished. + } + + m_client->didFinishLoading(m_loader, finishTime); } -void AssociatedURLLoader::willSendRequest(WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse) +void AssociatedURLLoader::ClientAdapter::didFail(const ResourceError& error) { - m_realClient->willSendRequest(this, newRequest, redirectResponse); + if (!m_client) + return; + + WebURLError webError(error); + m_client->didFail(m_loader, webError); } -void AssociatedURLLoader::didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) +AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl) + : m_frameImpl(frameImpl) + , m_client(0) { - m_realClient->didSendData(this, bytesSent, totalBytesToBeSent); + ASSERT(m_frameImpl); + + m_options.sniffContent = false; + m_options.allowCredentials = true; + m_options.forcePreflight = false; + m_options.crossOriginRequestPolicy = AllowCrossOriginRequests; // TODO(bbudge) Default should be DenyCrossOriginRequests, but this would break some tests. } -void AssociatedURLLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& response) +AssociatedURLLoader::AssociatedURLLoader(PassRefPtr<WebFrameImpl> frameImpl, const WebURLLoaderOptions& options) + : m_frameImpl(frameImpl) + , m_options(options) + , m_client(0) { - m_realClient->didReceiveResponse(this, response); + ASSERT(m_frameImpl); } -void AssociatedURLLoader::didDownloadData(WebURLLoader*, int dataLength) +AssociatedURLLoader::~AssociatedURLLoader() { - m_realClient->didDownloadData(this, dataLength); + if (m_clientAdapter) + m_clientAdapter->clearClient(); } -void AssociatedURLLoader::didReceiveData(WebURLLoader*, const char* data, int dataLength) +#define COMPILE_ASSERT_MATCHING_ENUM(webkit_name, webcore_name) \ + COMPILE_ASSERT(static_cast<int>(WebKit::webkit_name) == static_cast<int>(WebCore::webcore_name), mismatching_enums) + +COMPILE_ASSERT_MATCHING_ENUM(DenyCrossOriginRequests, DenyCrossOriginRequests); +COMPILE_ASSERT_MATCHING_ENUM(UseAccessControl, UseAccessControl); +COMPILE_ASSERT_MATCHING_ENUM(AllowCrossOriginRequests, AllowCrossOriginRequests); + +void AssociatedURLLoader::loadSynchronously(const WebURLRequest& request, WebURLResponse& response, WebURLError& error, WebData& data) { - m_realClient->didReceiveData(this, data, dataLength); + ASSERT(0); // Synchronous loading is not supported. } -void AssociatedURLLoader::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) +void AssociatedURLLoader::loadAsynchronously(const WebURLRequest& request, WebURLLoaderClient* client) { - m_realClient->didReceiveCachedMetadata(this, data, dataLength); + ASSERT(!m_client); + + m_client = client; + ASSERT(m_client); + + ThreadableLoaderOptions options; + options.sendLoadCallbacks = true; // Always send callbacks. + options.sniffContent = m_options.sniffContent; + options.allowCredentials = m_options.allowCredentials; + options.forcePreflight = m_options.forcePreflight; + options.crossOriginRequestPolicy = static_cast<WebCore::CrossOriginRequestPolicy>(m_options.crossOriginRequestPolicy); + + const ResourceRequest& webcoreRequest = request.toResourceRequest(); + Document* webcoreDocument = m_frameImpl->frame()->document(); + m_clientAdapter = ClientAdapter::create(this, m_client, request.downloadToFile()); + + m_loader = DocumentThreadableLoader::create(webcoreDocument, m_clientAdapter.get(), webcoreRequest, options); } -void AssociatedURLLoader::didFinishLoading(WebURLLoader*, double finishTime) +void AssociatedURLLoader::cancel() { - m_realClient->didFinishLoading(this, finishTime); + if (m_loader) { + m_clientAdapter->clearClient(); + m_loader->cancel(); + } } -void AssociatedURLLoader::didFail(WebURLLoader*, const WebURLError& error) +void AssociatedURLLoader::setDefersLoading(bool defersLoading) { - m_realClient->didFail(this, error); + if (m_loader) + m_loader->setDefersLoading(defersLoading); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/AssociatedURLLoader.h b/Source/WebKit/chromium/src/AssociatedURLLoader.h index 91cb0bf..ed183e5 100644 --- a/Source/WebKit/chromium/src/AssociatedURLLoader.h +++ b/Source/WebKit/chromium/src/AssociatedURLLoader.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010, 2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -32,20 +32,22 @@ #define AssociatedURLLoader_h #include "WebURLLoader.h" -#include "WebURLLoaderClient.h" +#include <wtf/Noncopyable.h> #include <wtf/OwnPtr.h> #include <wtf/RefPtr.h> +namespace WebCore { class DocumentThreadableLoader; } + namespace WebKit { class WebFrameImpl; // This class is used to implement WebFrame::createAssociatedURLLoader. -// FIXME: Implement in terms of WebCore::SubresourceLoader. -class AssociatedURLLoader : public WebURLLoader, - public WebURLLoaderClient { +class AssociatedURLLoader : public WebURLLoader { + WTF_MAKE_NONCOPYABLE(AssociatedURLLoader); public: AssociatedURLLoader(PassRefPtr<WebFrameImpl>); + AssociatedURLLoader(PassRefPtr<WebFrameImpl>, const WebURLLoaderOptions&); ~AssociatedURLLoader(); // WebURLLoader methods: @@ -54,22 +56,15 @@ public: virtual void cancel(); virtual void setDefersLoading(bool); - // WebURLLoaderClient methods: - virtual void willSendRequest(WebURLLoader*, WebURLRequest& newRequest, const WebURLResponse& redirectResponse); - virtual void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); - virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); - virtual void didDownloadData(WebURLLoader*, int dataLength); - virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); - virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); - virtual void didFinishLoading(WebURLLoader*, double finishTime); - virtual void didFail(WebURLLoader*, const WebURLError&); - private: - void prepareRequest(WebURLRequest&); + + class ClientAdapter; RefPtr<WebFrameImpl> m_frameImpl; - OwnPtr<WebURLLoader> m_realLoader; - WebURLLoaderClient* m_realClient; + WebURLLoaderOptions m_options; + WebURLLoaderClient* m_client; + OwnPtr<ClientAdapter> m_clientAdapter; + RefPtr<WebCore::DocumentThreadableLoader> m_loader; }; } // namespace WebKit diff --git a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp index a483308..6fc51db 100644 --- a/Source/WebKit/chromium/src/AudioDestinationChromium.cpp +++ b/Source/WebKit/chromium/src/AudioDestinationChromium.cpp @@ -98,8 +98,7 @@ void AudioDestinationChromium::stop() double AudioDestination::hardwareSampleRate() { - // FIXME: implement this properly for Chromium. - return 44100.0; + return webKitClient()->audioHardwareSampleRate(); } // Pulls on our provider to get the rendered audio stream. diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.cpp b/Source/WebKit/chromium/src/ChromeClientImpl.cpp index 1e639ec..99302cc 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +++ b/Source/WebKit/chromium/src/ChromeClientImpl.cpp @@ -857,7 +857,7 @@ void ChromeClientImpl::exitFullscreenForNode(WebCore::Node* node) } #if ENABLE(FULLSCREEN_API) -bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element) +bool ChromeClientImpl::supportsFullScreenForElement(const WebCore::Element* element, bool withKeyboard) { return m_webView->page()->settings()->fullScreenEnabled(); } diff --git a/Source/WebKit/chromium/src/ChromeClientImpl.h b/Source/WebKit/chromium/src/ChromeClientImpl.h index e70b766..f3a48ee 100644 --- a/Source/WebKit/chromium/src/ChromeClientImpl.h +++ b/Source/WebKit/chromium/src/ChromeClientImpl.h @@ -166,7 +166,7 @@ public: virtual void exitFullscreenForNode(WebCore::Node*); #if ENABLE(FULLSCREEN_API) - virtual bool supportsFullScreenForElement(const WebCore::Element*); + virtual bool supportsFullScreenForElement(const WebCore::Element*, bool withKeyboard); virtual void enterFullScreenForElement(WebCore::Element*); virtual void exitFullScreenForElement(WebCore::Element*); virtual void fullScreenRendererChanged(WebCore::RenderBox*); diff --git a/Source/WebKit/chromium/src/DebuggerAgentManager.cpp b/Source/WebKit/chromium/src/DebuggerAgentManager.cpp index b76bcfe..368b78c 100644 --- a/Source/WebKit/chromium/src/DebuggerAgentManager.cpp +++ b/Source/WebKit/chromium/src/DebuggerAgentManager.cpp @@ -34,7 +34,7 @@ #include "DebuggerAgentImpl.h" #include "Frame.h" #include "PageGroupLoadDeferrer.h" -#include "ScriptDebugServer.h" +#include "PageScriptDebugServer.h" #include "V8Proxy.h" #include "WebDevToolsAgentImpl.h" #include "WebFrameImpl.h" @@ -247,7 +247,7 @@ void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::Messa void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value) { s_exposeV8DebuggerProtocol = value; - WebCore::ScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol); + WebCore::PageScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol); } void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId) diff --git a/Source/WebKit/chromium/src/EditorClientImpl.cpp b/Source/WebKit/chromium/src/EditorClientImpl.cpp index 38d4f5e..6f2231d 100644 --- a/Source/WebKit/chromium/src/EditorClientImpl.cpp +++ b/Source/WebKit/chromium/src/EditorClientImpl.cpp @@ -54,6 +54,7 @@ #include "WebNode.h" #include "WebPasswordAutocompleteListener.h" #include "WebRange.h" +#include "WebSpellCheckClient.h" #include "WebTextAffinity.h" #include "WebTextCheckingCompletionImpl.h" #include "WebViewClient.h" @@ -856,8 +857,8 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, int spellLength = 0; // Check to see if the provided text is spelled correctly. - if (isContinuousSpellCheckingEnabled() && m_webView->client()) - m_webView->client()->spellCheck(WebString(text, length), spellLocation, spellLength); + if (isContinuousSpellCheckingEnabled() && m_webView->spellCheckClient()) + m_webView->spellCheckClient()->spellCheck(WebString(text, length), spellLocation, spellLength); else { spellLocation = 0; spellLength = 0; @@ -873,7 +874,8 @@ void EditorClientImpl::checkSpellingOfString(const UChar* text, int length, void EditorClientImpl::requestCheckingOfString(SpellChecker* sender, int identifier, const String& text) { - m_webView->client()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->requestCheckingOfText(text, new WebTextCheckingCompletionImpl(identifier, sender)); } String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) @@ -888,7 +890,9 @@ String EditorClientImpl::getAutoCorrectSuggestionForMisspelledWord(const String& return String(); } - return m_webView->client()->autoCorrectWord(WebString(misspelledWord)); + if (m_webView->spellCheckClient()) + return m_webView->spellCheckClient()->autoCorrectWord(WebString(misspelledWord)); + return String(); } void EditorClientImpl::checkGrammarOfString(const UChar*, int length, @@ -911,20 +915,20 @@ void EditorClientImpl::updateSpellingUIWithGrammarString(const String&, void EditorClientImpl::updateSpellingUIWithMisspelledWord(const String& misspelledWord) { - if (m_webView->client()) - m_webView->client()->updateSpellingUIWithMisspelledWord(WebString(misspelledWord)); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->updateSpellingUIWithMisspelledWord(WebString(misspelledWord)); } void EditorClientImpl::showSpellingUI(bool show) { - if (m_webView->client()) - m_webView->client()->showSpellingUI(show); + if (m_webView->spellCheckClient()) + m_webView->spellCheckClient()->showSpellingUI(show); } bool EditorClientImpl::spellingUIIsShowing() { - if (m_webView->client()) - return m_webView->client()->isShowingSpellingUI(); + if (m_webView->spellCheckClient()) + return m_webView->spellCheckClient()->isShowingSpellingUI(); return false; } diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp index dc47923..647a70c 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -1479,7 +1480,8 @@ PassRefPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget( ObjectContentType FrameLoaderClientImpl::objectContentType( const KURL& url, - const String& explicitMimeType) + const String& explicitMimeType, + bool shouldPreferPlugInsForImages) { // This code is based on Apple's implementation from // WebCoreSupport/WebFrameBridge.mm. @@ -1503,12 +1505,14 @@ ObjectContentType FrameLoaderClientImpl::objectContentType( return ObjectContentFrame; } - if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) - return ObjectContentImage; - // If Chrome is started with the --disable-plugins switch, pluginData is 0. PluginData* pluginData = m_webFrame->frame()->page()->pluginData(); - if (pluginData && pluginData->supportsMimeType(mimeType)) + bool plugInSupportsMIMEType = pluginData && pluginData->supportsMimeType(mimeType); + + if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) + return shouldPreferPlugInsForImages && plugInSupportsMIMEType ? ObjectContentNetscapePlugin : ObjectContentImage; + + if (plugInSupportsMIMEType) return ObjectContentNetscapePlugin; if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)) diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h index 7abf617..f19c26c 100644 --- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -197,7 +198,7 @@ public: const Vector<WTF::String>& paramNames, const Vector<WTF::String>& paramValues); virtual WebCore::ObjectContentType objectContentType( - const WebCore::KURL& url, const WTF::String& mimeType); + const WebCore::KURL&, const WTF::String& mimeType, bool shouldPreferPlugInsForImages); virtual WTF::String overrideMediaType() const; virtual void didPerformFirstNavigation() const; virtual void registerForIconNotification(bool listen = true); diff --git a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp index 3d937ac..54c18e3 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp +++ b/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp @@ -82,6 +82,7 @@ namespace WebCore { GraphicsContext3DInternal::GraphicsContext3DInternal() : m_webViewImpl(0) , m_initializedAvailableExtensions(false) + , m_layerComposited(false) #if USE(SKIA) #elif PLATFORM(CG) , m_renderOutput(0) @@ -160,6 +161,24 @@ WebGLLayerChromium* GraphicsContext3DInternal::platformLayer() const } #endif +void GraphicsContext3DInternal::markContextChanged() +{ +#if USE(ACCELERATED_COMPOSITING) + platformLayer()->setTextureUpdated(); +#endif + m_layerComposited = false; +} + +void GraphicsContext3DInternal::markLayerComposited() +{ + m_layerComposited = true; +} + +bool GraphicsContext3DInternal::layerComposited() const +{ + return m_layerComposited; +} + void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingContext* context) { HTMLCanvasElement* canvas = context->canvas(); @@ -200,6 +219,16 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon m_impl->readBackFramebuffer(pixels, 4 * m_impl->width() * m_impl->height()); + if (!m_impl->getContextAttributes().premultipliedAlpha) { + size_t bufferSize = 4 * m_impl->width() * m_impl->height(); + + for (size_t i = 0; i < bufferSize; i += 4) { + pixels[i + 0] = std::min(255, pixels[i + 0] * pixels[i + 3] / 255); + pixels[i + 1] = std::min(255, pixels[i + 1] * pixels[i + 3] / 255); + pixels[i + 2] = std::min(255, pixels[i + 2] * pixels[i + 3] / 255); + } + } + #if USE(SKIA) if (m_resizingBitmap.readyToDraw()) { // We need to draw the resizing bitmap into the canvas's backing store. @@ -218,6 +247,23 @@ void GraphicsContext3DInternal::paintRenderingResultsToCanvas(CanvasRenderingCon #endif } +PassRefPtr<ImageData> GraphicsContext3DInternal::paintRenderingResultsToImageData() +{ + if (m_impl->getContextAttributes().premultipliedAlpha) + return 0; + + RefPtr<ImageData> imageData = ImageData::create(IntSize(m_impl->width(), m_impl->height())); + unsigned char* pixels = imageData->data()->data()->data(); + size_t bufferSize = 4 * m_impl->width() * m_impl->height(); + + m_impl->readBackFramebuffer(pixels, bufferSize); + + for (size_t i = 0; i < bufferSize; i += 4) + std::swap(pixels[i], pixels[i + 2]); + + return imageData.release(); +} + bool GraphicsContext3DInternal::paintsIntoCanvasBuffer() const { // If the gpu compositor is on then skip the readback and software rendering path. @@ -1058,7 +1104,16 @@ DELEGATE_TO_INTERNAL_6(vertexAttribPointer, GC3Duint, GC3Dint, GC3Denum, GC3Dboo DELEGATE_TO_INTERNAL_4(viewport, GC3Dint, GC3Dint, GC3Dsizei, GC3Dsizei) +DELEGATE_TO_INTERNAL(markLayerComposited) +DELEGATE_TO_INTERNAL(markContextChanged) + +bool GraphicsContext3D::layerComposited() const +{ + return m_internal->layerComposited(); +} + DELEGATE_TO_INTERNAL_1(paintRenderingResultsToCanvas, CanvasRenderingContext*) +DELEGATE_TO_INTERNAL_R(paintRenderingResultsToImageData, PassRefPtr<ImageData>) bool GraphicsContext3D::paintsIntoCanvasBuffer() const { diff --git a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h index c8f7c7a..0af291e 100644 --- a/Source/WebKit/chromium/src/GraphicsContext3DInternal.h +++ b/Source/WebKit/chromium/src/GraphicsContext3DInternal.h @@ -66,7 +66,12 @@ public: void reshape(int width, int height); IntSize getInternalFramebufferSize(); + void markContextChanged(); + bool layerComposited() const; + void markLayerComposited(); + void paintRenderingResultsToCanvas(CanvasRenderingContext*); + PassRefPtr<ImageData> paintRenderingResultsToImageData(); bool paintsIntoCanvasBuffer() const; void prepareTexture(); @@ -273,6 +278,7 @@ private: bool m_initializedAvailableExtensions; HashSet<String> m_enabledExtensions; HashSet<String> m_requestableExtensions; + bool m_layerComposited; #if USE(ACCELERATED_COMPOSITING) RefPtr<WebGLLayerChromium> m_compositingLayer; #endif diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp index ea0f433..727092a 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.cpp @@ -35,7 +35,6 @@ #include "WebIDBCursorImpl.h" #include "WebIDBDatabaseImpl.h" #include "WebIDBDatabaseError.h" -#include "WebIDBIndexImpl.h" #include "WebIDBKey.h" #include "WebIDBTransactionImpl.h" #include "WebSerializedScriptValue.h" @@ -73,11 +72,6 @@ void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backen m_callbacks->onSuccess(new WebKit::WebIDBDatabaseImpl(backend)); } -void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBIndexBackendInterface> backend) -{ - m_callbacks->onSuccess(new WebKit::WebIDBIndexImpl(backend)); -} - void IDBCallbacksProxy::onSuccess(PassRefPtr<IDBKey> idbKey) { m_callbacks->onSuccess(WebKit::WebIDBKey(idbKey)); diff --git a/Source/WebKit/chromium/src/IDBCallbacksProxy.h b/Source/WebKit/chromium/src/IDBCallbacksProxy.h index 912cb86..6829845 100644 --- a/Source/WebKit/chromium/src/IDBCallbacksProxy.h +++ b/Source/WebKit/chromium/src/IDBCallbacksProxy.h @@ -50,7 +50,6 @@ public: virtual void onError(PassRefPtr<IDBDatabaseError>); virtual void onSuccess(PassRefPtr<IDBCursorBackendInterface>); virtual void onSuccess(PassRefPtr<IDBDatabaseBackendInterface>); - virtual void onSuccess(PassRefPtr<IDBIndexBackendInterface>); virtual void onSuccess(PassRefPtr<IDBKey>); virtual void onSuccess(PassRefPtr<IDBTransactionBackendInterface>); virtual void onSuccess(PassRefPtr<SerializedScriptValue>); diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp index 67504a3..9e5ccc0 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp @@ -59,13 +59,12 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy() { } -void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize) +void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType) { WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame); - m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize); + m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebKit::WebIDBFactory::BackingStoreType>(backingStoreType)); } } // namespace WebCore #endif // ENABLE(INDEXED_DATABASE) - diff --git a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h index 5950a68..593051e 100755 --- a/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h +++ b/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h @@ -45,7 +45,7 @@ public: virtual ~IDBFactoryBackendProxy(); PassRefPtr<DOMStringList> databases(void) const; - virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize); + virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); private: IDBFactoryBackendProxy(); @@ -59,4 +59,3 @@ private: #endif #endif // IDBFactoryBackendProxy_h - diff --git a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp index 35e4de8..b377bdb 100644 --- a/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp +++ b/Source/WebKit/chromium/src/LocalFileSystemChromium.cpp @@ -57,29 +57,40 @@ LocalFileSystem& LocalFileSystem::localFileSystem() return *localFileSystem; } -void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks) -{ - ASSERT(context && context->isDocument()); - Document* document = static_cast<Document*>(context); - WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), 0, false, new WebFileSystemCallbacksImpl(callbacks, type)); -} +namespace { -void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +enum CreationFlag { + OpenExisting, + CreateIfNotPresent +}; + +} // namespace + +static void openFileSystemHelper(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous, long long size, CreationFlag create) { ASSERT(context); if (context->isDocument()) { Document* document = static_cast<Document*>(context); WebFrameImpl* webFrame = WebFrameImpl::fromFrame(document->frame()); - webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, true, new WebFileSystemCallbacksImpl(callbacks, type)); + webFrame->client()->openFileSystem(webFrame, static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type)); } else { WorkerContext* workerContext = static_cast<WorkerContext*>(context); WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy(); WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy); - webWorker->openFileSystemForWorker(static_cast<WebFileSystem::Type>(type), size, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous), synchronous); + webWorker->openFileSystemForWorker(static_cast<WebFileSystem::Type>(type), size, create == CreateIfNotPresent, new WebFileSystemCallbacksImpl(callbacks, type, context, synchronous), synchronous); } } +void LocalFileSystem::readFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +{ + openFileSystemHelper(context, type, callbacks, synchronous, 0, OpenExisting); +} + +void LocalFileSystem::requestFileSystem(ScriptExecutionContext* context, AsyncFileSystem::Type type, long long size, PassOwnPtr<AsyncFileSystemCallbacks> callbacks, bool synchronous) +{ + openFileSystemHelper(context, type, callbacks, synchronous, size, CreateIfNotPresent); +} + } // namespace WebCore #endif // ENABLE(FILE_SYSTEM) diff --git a/Source/WebKit/chromium/src/LocalizedStrings.cpp b/Source/WebKit/chromium/src/LocalizedStrings.cpp index 18f9fb8..35e03c4 100644 --- a/Source/WebKit/chromium/src/LocalizedStrings.cpp +++ b/Source/WebKit/chromium/src/LocalizedStrings.cpp @@ -257,7 +257,7 @@ String contextMenuItemTagNoGuessesFound() { return String(); } String contextMenuItemTagIgnoreSpelling() { return String(); } String contextMenuItemTagLearnSpelling() { return String(); } String contextMenuItemTagSearchWeb() { return String(); } -String contextMenuItemTagLookUpInDictionary() { return String(); } +String contextMenuItemTagLookUpInDictionary(const String&) { return String(); } String contextMenuItemTagOpenLink() { return String(); } String contextMenuItemTagIgnoreGrammar() { return String(); } String contextMenuItemTagSpellingMenu() { return String(); } diff --git a/Source/WebKit/chromium/src/PlatformMessagePortChannel.h b/Source/WebKit/chromium/src/PlatformMessagePortChannel.h index 5416145..9cd7001 100644 --- a/Source/WebKit/chromium/src/PlatformMessagePortChannel.h +++ b/Source/WebKit/chromium/src/PlatformMessagePortChannel.h @@ -46,7 +46,7 @@ namespace WebCore { class MessagePort; // PlatformMessagePortChannel is a platform-dependent interface to the remote side of a message channel. -class PlatformMessagePortChannel : public ThreadSafeShared<PlatformMessagePortChannel>, +class PlatformMessagePortChannel : public ThreadSafeRefCounted<PlatformMessagePortChannel>, public WebKit::WebMessagePortChannelClient { public: static void createChannel(PassRefPtr<MessagePort>, PassRefPtr<MessagePort>); diff --git a/Source/WebKit/chromium/src/ResourceHandle.cpp b/Source/WebKit/chromium/src/ResourceHandle.cpp index 72f60bb..f88a48a 100644 --- a/Source/WebKit/chromium/src/ResourceHandle.cpp +++ b/Source/WebKit/chromium/src/ResourceHandle.cpp @@ -72,7 +72,11 @@ public: virtual void didSendData( WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent); virtual void didReceiveResponse(WebURLLoader*, const WebURLResponse&); + virtual void didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived); + + // FIXME(vsevik): remove once not used downstream virtual void didReceiveData(WebURLLoader*, const char* data, int dataLength); + virtual void didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength); virtual void didFinishLoading(WebURLLoader*, double finishTime); virtual void didFail(WebURLLoader*, const WebURLError&); @@ -159,18 +163,20 @@ void ResourceHandleInternal::didReceiveResponse(WebURLLoader*, const WebURLRespo m_client->didReceiveResponse(m_owner, response.toResourceResponse()); } -void ResourceHandleInternal::didReceiveData( - WebURLLoader*, const char* data, int dataLength) +// FIXME(vsevik): remove once not used +void ResourceHandleInternal::didReceiveData(WebURLLoader* webURLLoader, const char* data, int dataLength) +{ + didReceiveData2(webURLLoader, data, dataLength, -1); +} + +void ResourceHandleInternal::didReceiveData2(WebURLLoader*, const char* data, int dataLength, int lengthReceived) { ASSERT(m_client); if (m_state != ConnectionStateReceivedResponse && m_state != ConnectionStateReceivingData) CRASH(); m_state = ConnectionStateReceivingData; - // FIXME(yurys): it looks like lengthReceived is always the same as - // dataLength and that the latter parameter can be eliminated. - // See WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=31019 - m_client->didReceiveData(m_owner, data, dataLength, dataLength); + m_client->didReceiveData(m_owner, data, dataLength, lengthReceived); } void ResourceHandleInternal::didReceiveCachedMetadata(WebURLLoader*, const char* data, int dataLength) diff --git a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp index ec0dbce..ef19b2f 100644 --- a/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp +++ b/Source/WebKit/chromium/src/StorageNamespaceProxy.cpp @@ -92,6 +92,21 @@ void StorageNamespaceProxy::unlock() // FIXME: Implement. } +void StorageNamespaceProxy::clearOriginForDeletion(SecurityOrigin* origin) +{ + ASSERT_NOT_REACHED(); +} + +void StorageNamespaceProxy::clearAllOriginsForDeletion() +{ + ASSERT_NOT_REACHED(); +} + +void StorageNamespaceProxy::sync() +{ + ASSERT_NOT_REACHED(); +} + } // namespace WebCore #endif // ENABLE(DOM_STORAGE) diff --git a/Source/WebKit/chromium/src/StorageNamespaceProxy.h b/Source/WebKit/chromium/src/StorageNamespaceProxy.h index 28d7a23..9388531 100644 --- a/Source/WebKit/chromium/src/StorageNamespaceProxy.h +++ b/Source/WebKit/chromium/src/StorageNamespaceProxy.h @@ -43,6 +43,11 @@ public: virtual PassRefPtr<StorageNamespace> copy(); virtual void close(); virtual void unlock(); + + virtual void clearOriginForDeletion(SecurityOrigin*); + virtual void clearAllOriginsForDeletion(); + + virtual void sync(); private: OwnPtr<WebKit::WebStorageNamespace> m_storageNamespace; diff --git a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp index 30305bd..8df112a 100644 --- a/Source/WebKit/chromium/src/WebAccessibilityObject.cpp +++ b/Source/WebKit/chromium/src/WebAccessibilityObject.cpp @@ -537,6 +537,12 @@ WebString WebAccessibilityObject::computedStyleDisplay() const return WebString(CSSPrimitiveValue::create(renderStyle->display())->getStringValue()); } +bool WebAccessibilityObject::accessibilityIsIgnored() const +{ + m_private->updateBackingStore(); + return m_private->accessibilityIsIgnored(); +} + WebAccessibilityObject::WebAccessibilityObject(const WTF::PassRefPtr<WebCore::AccessibilityObject>& object) : m_private(static_cast<WebAccessibilityObjectPrivate*>(object.releaseRef())) { diff --git a/Source/WebKit/chromium/src/WebBindings.cpp b/Source/WebKit/chromium/src/WebBindings.cpp index 0882e38..4012d1c 100644 --- a/Source/WebKit/chromium/src/WebBindings.cpp +++ b/Source/WebKit/chromium/src/WebBindings.cpp @@ -35,25 +35,18 @@ #include "npruntime_priv.h" #if USE(V8) -#include "ChromiumDataObject.h" -#include "ClipboardChromium.h" -#include "EventNames.h" -#include "MouseEvent.h" #include "NPV8Object.h" // for PrivateIdentifier #include "Range.h" #include "V8BindingState.h" #include "V8DOMWrapper.h" #include "V8Element.h" -#include "V8Event.h" -#include "V8Helpers.h" -#include "V8HiddenPropertyName.h" #include "V8NPUtils.h" +#include "V8Node.h" #include "V8Proxy.h" #include "V8Range.h" #elif USE(JSC) #include "bridge/c/c_utility.h" #endif -#include "WebDragData.h" #include "WebElement.h" #include "WebRange.h" @@ -65,9 +58,9 @@ using namespace WebCore; namespace WebKit { -bool WebBindings::construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant* result) +bool WebBindings::construct(NPP npp, NPObject* object, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_Construct(npp, npobj, args, argCount, result); + return _NPN_Construct(npp, object, args, argCount, result); } NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) @@ -75,19 +68,19 @@ NPObject* WebBindings::createObject(NPP npp, NPClass* npClass) return _NPN_CreateObject(npp, npClass); } -bool WebBindings::enumerate(NPP id, NPObject* obj, NPIdentifier** identifier, uint32_t* val) +bool WebBindings::enumerate(NPP npp, NPObject* object, NPIdentifier** identifier, uint32_t* identifierCount) { - return _NPN_Enumerate(id, obj, identifier, val); + return _NPN_Enumerate(npp, object, identifier, identifierCount); } -bool WebBindings::evaluate(NPP npp, NPObject* npObject, NPString* npScript, NPVariant* result) +bool WebBindings::evaluate(NPP npp, NPObject* object, NPString* script, NPVariant* result) { - return _NPN_Evaluate(npp, npObject, npScript, result); + return _NPN_Evaluate(npp, object, script, result); } -bool WebBindings::evaluateHelper(NPP npp, bool popups_allowed, NPObject* npobj, NPString* npscript, NPVariant* result) +bool WebBindings::evaluateHelper(NPP npp, bool popupsAllowed, NPObject* object, NPString* script, NPVariant* result) { - return _NPN_EvaluateHelper(npp, popups_allowed, npobj, npscript, result); + return _NPN_EvaluateHelper(npp, popupsAllowed, object, script, result); } NPIdentifier WebBindings::getIntIdentifier(int32_t number) @@ -95,9 +88,9 @@ NPIdentifier WebBindings::getIntIdentifier(int32_t number) return _NPN_GetIntIdentifier(number); } -bool WebBindings::getProperty(NPP npp, NPObject* obj, NPIdentifier propertyName, NPVariant *result) +bool WebBindings::getProperty(NPP npp, NPObject* object, NPIdentifier property, NPVariant* result) { - return _NPN_GetProperty(npp, obj, propertyName, result); + return _NPN_GetProperty(npp, object, property, result); } NPIdentifier WebBindings::getStringIdentifier(const NPUTF8* string) @@ -110,14 +103,14 @@ void WebBindings::getStringIdentifiers(const NPUTF8** names, int32_t nameCount, _NPN_GetStringIdentifiers(names, nameCount, identifiers); } -bool WebBindings::hasMethod(NPP npp, NPObject* npObject, NPIdentifier methodName) +bool WebBindings::hasMethod(NPP npp, NPObject* object, NPIdentifier method) { - return _NPN_HasMethod(npp, npObject, methodName); + return _NPN_HasMethod(npp, object, method); } -bool WebBindings::hasProperty(NPP npp, NPObject* npObject, NPIdentifier propertyName) +bool WebBindings::hasProperty(NPP npp, NPObject* object, NPIdentifier property) { - return _NPN_HasProperty(npp, npObject, propertyName); + return _NPN_HasProperty(npp, object, property); } bool WebBindings::identifierIsString(NPIdentifier identifier) @@ -139,19 +132,19 @@ void WebBindings::initializeVariantWithStringCopy(NPVariant* variant, const NPSt #endif } -bool WebBindings::invoke(NPP npp, NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result) +bool WebBindings::invoke(NPP npp, NPObject* object, NPIdentifier method, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_Invoke(npp, npObject, methodName, arguments, argumentCount, result); + return _NPN_Invoke(npp, object, method, args, argCount, result); } -bool WebBindings::invokeDefault(NPP id, NPObject* obj, const NPVariant* args, uint32_t count, NPVariant* result) +bool WebBindings::invokeDefault(NPP npp, NPObject* object, const NPVariant* args, uint32_t argCount, NPVariant* result) { - return _NPN_InvokeDefault(id, obj, args, count, result); + return _NPN_InvokeDefault(npp, object, args, argCount, result); } -void WebBindings::releaseObject(NPObject* npObject) +void WebBindings::releaseObject(NPObject* object) { - return _NPN_ReleaseObject(npObject); + return _NPN_ReleaseObject(object); } void WebBindings::releaseVariantValue(NPVariant* variant) @@ -159,30 +152,30 @@ void WebBindings::releaseVariantValue(NPVariant* variant) _NPN_ReleaseVariantValue(variant); } -bool WebBindings::removeProperty(NPP id, NPObject* object, NPIdentifier identifier) +bool WebBindings::removeProperty(NPP npp, NPObject* object, NPIdentifier identifier) { - return _NPN_RemoveProperty(id, object, identifier); + return _NPN_RemoveProperty(npp, object, identifier); } -NPObject* WebBindings::retainObject(NPObject* npObject) +NPObject* WebBindings::retainObject(NPObject* object) { - return _NPN_RetainObject(npObject); + return _NPN_RetainObject(object); } -void WebBindings::setException(NPObject* obj, const NPUTF8* message) +void WebBindings::setException(NPObject* object, const NPUTF8* message) { - _NPN_SetException(obj, message); + _NPN_SetException(object, message); } -bool WebBindings::setProperty(NPP id, NPObject* obj, NPIdentifier identifier, const NPVariant* variant) +bool WebBindings::setProperty(NPP npp, NPObject* object, NPIdentifier identifier, const NPVariant* value) { - return _NPN_SetProperty(id, obj, identifier, variant); + return _NPN_SetProperty(npp, object, identifier, value); } -void WebBindings::unregisterObject(NPObject* npObject) +void WebBindings::unregisterObject(NPObject* object) { #if USE(V8) - _NPN_UnregisterObject(npObject); + _NPN_UnregisterObject(object); #endif } @@ -193,116 +186,46 @@ NPUTF8* WebBindings::utf8FromIdentifier(NPIdentifier identifier) void WebBindings::extractIdentifierData(const NPIdentifier& identifier, const NPUTF8*& string, int32_t& number, bool& isString) { - PrivateIdentifier* priv = static_cast<PrivateIdentifier*>(identifier); - if (!priv) { + PrivateIdentifier* data = static_cast<PrivateIdentifier*>(identifier); + if (!data) { isString = false; number = 0; return; } - isString = priv->isString; + isString = data->isString; if (isString) - string = priv->value.string; + string = data->value.string; else - number = priv->value.number; + number = data->value.number; } #if USE(V8) -static v8::Local<v8::Value> getEvent(const v8::Handle<v8::Context>& context) +static bool getRangeImpl(NPObject* object, WebRange* webRange) { - return context->Global()->GetHiddenValue(V8HiddenPropertyName::event()); -} - -static bool getDragDataImpl(NPObject* npobj, int* eventId, WebDragData* data) -{ - if (!npobj) - return false; - if (npobj->_class != npScriptObjectClass) - return false; - - v8::HandleScope handleScope; - v8::Handle<v8::Context> context = v8::Context::GetEntered(); - if (context.IsEmpty()) - return false; - - // Get the current WebCore event. - v8::Handle<v8::Value> currentEvent(getEvent(context)); - Event* event = V8Event::toNative(v8::Handle<v8::Object>::Cast(currentEvent)); - if (!event) - return false; - - // Check that the given npobj is that event. - V8NPObject* object = reinterpret_cast<V8NPObject*>(npobj); - Event* given = V8Event::toNative(object->v8Object); - if (given != event) - return false; - - // Check the execution frames are same origin. - V8Proxy* current = V8Proxy::retrieve(V8Proxy::retrieveFrameForCurrentContext()); - Frame* frame = V8Proxy::retrieveFrame(context); - if (!current || !V8BindingSecurity::canAccessFrame(V8BindingState::Only(), frame, false)) - return false; - - const EventNames& names(eventNames()); - const AtomicString& eventType(event->type()); - - enum DragTargetMouseEventId { - DragEnterId = 1, DragOverId = 2, DragLeaveId = 3, DropId = 4 - }; - - // The event type should be a drag event. - if (eventType == names.dragenterEvent) - *eventId = DragEnterId; - else if (eventType == names.dragoverEvent) - *eventId = DragOverId; - else if (eventType == names.dragleaveEvent) - *eventId = DragLeaveId; - else if (eventType == names.dropEvent) - *eventId = DropId; - else - return false; - - // Drag events are mouse events and should have a clipboard. - MouseEvent* me = static_cast<MouseEvent*>(event); - Clipboard* clipboard = me->clipboard(); - if (!clipboard) + if (!object || (object->_class != npScriptObjectClass)) return false; - // And that clipboard should be accessible by WebKit policy. - ClipboardChromium* chrome = static_cast<ClipboardChromium*>(clipboard); - HashSet<String> accessible(chrome->types()); - if (accessible.isEmpty()) - return false; - - RefPtr<ChromiumDataObject> dataObject(chrome->dataObject()); - if (dataObject && data) - *data = WebDragData(dataObject); - - return dataObject; -} - -static bool getRangeImpl(NPObject* npobj, WebRange* range) -{ - V8NPObject* v8npobject = reinterpret_cast<V8NPObject*>(npobj); - v8::Handle<v8::Object> v8object(v8npobject->v8Object); - if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8object))) + V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); + v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); + if (!V8Range::info.equals(V8DOMWrapper::domWrapperType(v8Object))) return false; - Range* native = V8Range::toNative(v8object); + Range* native = V8Range::toNative(v8Object); if (!native) return false; - *range = WebRange(native); + *webRange = WebRange(native); return true; } -static bool getElementImpl(NPObject* npObj, WebElement* webElement) +static bool getElementImpl(NPObject* object, WebElement* webElement) { - if (!npObj || (npObj->_class != npScriptObjectClass)) + if (!object || (object->_class != npScriptObjectClass)) return false; - V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(npObj); + V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object); v8::Handle<v8::Object> v8Object(v8NPObject->v8Object); Element* native = V8Element::toNative(v8Object); if (!native) @@ -316,7 +239,7 @@ static NPObject* makeIntArrayImpl(const WebVector<int>& data) { v8::HandleScope handleScope; v8::Handle<v8::Array> result = v8::Array::New(data.size()); - for (size_t i = 0; i < data.size(); i++) + for (size_t i = 0; i < data.size(); ++i) result->Set(i, v8::Number::New(data[i])); WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); @@ -334,28 +257,22 @@ static NPObject* makeStringArrayImpl(const WebVector<WebString>& data) return npCreateV8ScriptObject(0, result, window); } -#endif - -bool WebBindings::getDragData(NPObject* event, int* eventId, WebDragData* data) +static NPObject* makeNodeImpl(WebNode data) { -#if USE(V8) - return getDragDataImpl(event, eventId, data); -#else - // Not supported on other ports (JSC, etc). - return false; -#endif + v8::HandleScope handleScope; + if (data.isNull()) + return 0; + v8::Handle<v8::Object> result = V8Node::wrap(data.unwrap<Node>()); + WebCore::DOMWindow* window = WebCore::V8Proxy::retrieveWindow(WebCore::V8Proxy::currentContext()); + return npCreateV8ScriptObject(0, result, window); } -bool WebBindings::isDragEvent(NPObject* event) -{ - int eventId; - return getDragData(event, &eventId, 0); -} +#endif -bool WebBindings::getRange(NPObject* range, WebRange* webrange) +bool WebBindings::getRange(NPObject* range, WebRange* webRange) { #if USE(V8) - return getRangeImpl(range, webrange); + return getRangeImpl(range, webRange); #else // Not supported on other ports (JSC, etc). return false; @@ -372,7 +289,7 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement) #endif } -NPObject* WebBindings::makeIntArray(const WebVector<int> & data) +NPObject* WebBindings::makeIntArray(const WebVector<int>& data) { #if USE(V8) return makeIntArrayImpl(data); @@ -392,6 +309,16 @@ NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data) #endif } +NPObject* WebBindings::makeNode(const WebNode& data) +{ +#if USE(V8) + return makeNodeImpl(data); +#else + // Not supported on other ports (JSC, etc.). + return 0; +#endif +} + void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data) { WebCore::pushExceptionHandler(handler, data); diff --git a/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp b/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp index bfeae37..1e65888 100644 --- a/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp +++ b/Source/WebKit/chromium/src/WebDOMMouseEvent.cpp @@ -57,24 +57,24 @@ int WebDOMMouseEvent::clientY() const return constUnwrap<MouseEvent>()->clientY(); } -int WebDOMMouseEvent::layerX() const +int WebDOMMouseEvent::layerX() { - return constUnwrap<MouseEvent>()->layerX(); + return unwrap<MouseEvent>()->layerX(); } -int WebDOMMouseEvent::layerY() const +int WebDOMMouseEvent::layerY() { - return constUnwrap<MouseEvent>()->layerY(); + return unwrap<MouseEvent>()->layerY(); } -int WebDOMMouseEvent::offsetX() const +int WebDOMMouseEvent::offsetX() { - return constUnwrap<MouseEvent>()->offsetX(); + return unwrap<MouseEvent>()->offsetX(); } -int WebDOMMouseEvent::offsetY() const +int WebDOMMouseEvent::offsetY() { - return constUnwrap<MouseEvent>()->offsetY(); + return unwrap<MouseEvent>()->offsetY(); } int WebDOMMouseEvent::pageX() const diff --git a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp index 65147fa..1366a80 100644 --- a/Source/WebKit/chromium/src/WebDataSourceImpl.cpp +++ b/Source/WebKit/chromium/src/WebDataSourceImpl.cpp @@ -174,7 +174,7 @@ WebDataSourceImpl::WebDataSourceImpl(const ResourceRequest& request, const Subst // frame, which results in a second data source being created. We want // to wait to attach the WebPluginLoadObserver to that data source. if (!request.url().isEmpty()) { - ASSERT(m_nextPluginLoadObserver->url() == request.url()); + ASSERT(m_nextPluginLoadObserver->url() == WebURL(request.url())); m_pluginLoadObserver.set(m_nextPluginLoadObserver); m_nextPluginLoadObserver = 0; } diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp index 6329d76..c1a5f9c 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Google Inc. All rights reserved. + * Copyright (C) 2010-2011 Google Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -40,13 +40,12 @@ #include "InspectorInstrumentation.h" #include "Page.h" #include "PageGroup.h" +#include "PageScriptDebugServer.h" #include "PlatformString.h" #include "ResourceError.h" #include "ResourceRequest.h" #include "ResourceResponse.h" -#include "ScriptDebugServer.h" #include "V8Binding.h" -#include "V8Node.h" #include "V8Proxy.h" #include "V8Utilities.h" #include "WebDataSource.h" @@ -73,14 +72,14 @@ namespace { static const char kFrontendConnectedFeatureName[] = "frontend-connected"; static const char kInspectorStateFeatureName[] = "inspector-state"; -class ClientMessageLoopAdapter : public ScriptDebugServer::ClientMessageLoop { +class ClientMessageLoopAdapter : public PageScriptDebugServer::ClientMessageLoop { public: static void ensureClientMessageLoopCreated(WebDevToolsAgentClient* client) { if (s_instance) return; s_instance = new ClientMessageLoopAdapter(client->createClientMessageLoop()); - ScriptDebugServer::shared().setClientMessageLoop(s_instance); + PageScriptDebugServer::shared().setClientMessageLoop(s_instance); } static void inspectedViewClosed(WebViewImpl* view) @@ -93,7 +92,7 @@ public: { // Release render thread if necessary. if (s_instance && s_instance->m_running) - ScriptDebugServer::shared().continueProgram(); + PageScriptDebugServer::shared().continueProgram(); } private: @@ -187,9 +186,6 @@ void WebDevToolsAgentImpl::attach() m_debuggerAgentImpl.set( new DebuggerAgentImpl(m_webViewImpl, this, m_client)); - WebCString debuggerScriptJs = m_client->debuggerScriptSource(); - ScriptDebugServer::shared().setDebuggerScriptSource( - String(debuggerScriptJs.data(), debuggerScriptJs.length())); m_attached = true; } @@ -230,14 +226,6 @@ void WebDevToolsAgentImpl::inspectElementAt(const WebPoint& point) m_webViewImpl->inspectElementAt(point); } -void WebDevToolsAgentImpl::inspectNode(v8::Handle<v8::Value> node) -{ - if (!V8Node::HasInstance(node)) - V8Proxy::setDOMException(TYPE_MISMATCH_ERR); - else - inspectorController()->inspect(V8Node::toNative(v8::Handle<v8::Object>::Cast(node))); -} - void WebDevToolsAgentImpl::setRuntimeProperty(const WebString& name, const WebString& value) { if (name == kInspectorStateFeatureName) { @@ -260,49 +248,6 @@ Frame* WebDevToolsAgentImpl::mainFrame() return 0; } - -//------- plugin resource load notifications --------------- -void WebDevToolsAgentImpl::identifierForInitialRequest( - unsigned long resourceId, - WebFrame* webFrame, - const WebURLRequest& request) -{ - WebFrameImpl* webFrameImpl = static_cast<WebFrameImpl*>(webFrame); - Frame* frame = webFrameImpl->frame(); - DocumentLoader* loader = frame->loader()->activeDocumentLoader(); - InspectorInstrumentation::identifierForInitialRequest(frame, resourceId, loader, request.toResourceRequest()); -} - -void WebDevToolsAgentImpl::willSendRequest(unsigned long resourceId, WebURLRequest& request) -{ - if (InspectorController* ic = inspectorController()) { - InspectorInstrumentation::willSendRequest(mainFrame(), resourceId, request.toMutableResourceRequest(), ResourceResponse()); - if (ic->hasFrontend() && request.reportLoadTiming()) - request.setReportRawHeaders(true); - } -} - -void WebDevToolsAgentImpl::didReceiveData(unsigned long resourceId, int length) -{ - InspectorInstrumentation::didReceiveContentLength(mainFrame(), resourceId, length); -} - -void WebDevToolsAgentImpl::didReceiveResponse(unsigned long resourceId, const WebURLResponse& response) -{ - InspectorInstrumentationCookie cookie = InspectorInstrumentation::willReceiveResourceResponse(mainFrame(), resourceId, response.toResourceResponse()); - InspectorInstrumentation::didReceiveResourceResponse(cookie, resourceId, 0, response.toResourceResponse()); -} - -void WebDevToolsAgentImpl::didFinishLoading(unsigned long resourceId) -{ - InspectorInstrumentation::didFinishLoading(mainFrame(), resourceId, 0); -} - -void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURLError& error) -{ - InspectorInstrumentation::didFailLoading(mainFrame(), resourceId, error); -} - void WebDevToolsAgentImpl::inspectorDestroyed() { // Our lifetime is bound to the WebViewImpl. @@ -374,7 +319,7 @@ void WebDevToolsAgent::debuggerPauseScript() void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d) { - class DebuggerTask : public ScriptDebugServer::Task { + class DebuggerTask : public PageScriptDebugServer::Task { public: DebuggerTask(WebDevToolsAgent::MessageDescriptor* descriptor) : m_descriptor(descriptor) { } virtual ~DebuggerTask() { } @@ -386,7 +331,7 @@ void WebDevToolsAgent::interruptAndDispatch(MessageDescriptor* d) private: OwnPtr<WebDevToolsAgent::MessageDescriptor> m_descriptor; }; - ScriptDebugServer::interruptAndRun(new DebuggerTask(d)); + PageScriptDebugServer::interruptAndRun(new DebuggerTask(d)); } bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) @@ -395,18 +340,18 @@ bool WebDevToolsAgent::shouldInterruptForMessage(const WebString& message) if (!InspectorBackendDispatcher::getCommandName(message, &commandName)) return false; return commandName == InspectorBackendDispatcher::Debugger_pauseCmd - || commandName == InspectorBackendDispatcher::Debugger_setJavaScriptBreakpointCmd - || commandName == InspectorBackendDispatcher::Debugger_removeJavaScriptBreakpointCmd - || commandName == InspectorBackendDispatcher::Debugger_activateBreakpointsCmd - || commandName == InspectorBackendDispatcher::Debugger_deactivateBreakpointsCmd - || commandName == InspectorBackendDispatcher::Inspector_startProfilingCmd - || commandName == InspectorBackendDispatcher::Inspector_stopProfilingCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointByUrlCmd + || commandName == InspectorBackendDispatcher::Debugger_removeBreakpointCmd + || commandName == InspectorBackendDispatcher::Debugger_setBreakpointsActiveCmd + || commandName == InspectorBackendDispatcher::Profiler_startCmd + || commandName == InspectorBackendDispatcher::Profiler_stopCmd || commandName == InspectorBackendDispatcher::Profiler_getProfileCmd; } void WebDevToolsAgent::processPendingMessages() { - ScriptDebugServer::shared().runPendingTasks(); + PageScriptDebugServer::shared().runPendingTasks(); } void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler handler) diff --git a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h index 2bc197d..33ca232 100644 --- a/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h +++ b/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h @@ -35,7 +35,6 @@ #include "WebDevToolsAgentPrivate.h" -#include <v8.h> #include <wtf/Forward.h> #include <wtf/OwnPtr.h> @@ -76,18 +75,10 @@ public: virtual void didNavigate(); virtual void dispatchOnInspectorBackend(const WebString& message); virtual void inspectElementAt(const WebPoint& point); - virtual void inspectNode(v8::Handle<v8::Value> node); virtual void evaluateInWebInspector(long callId, const WebString& script); virtual void setRuntimeProperty(const WebString& name, const WebString& value); virtual void setTimelineProfilingEnabled(bool enable); - virtual void identifierForInitialRequest(unsigned long, WebFrame*, const WebURLRequest&); - virtual void willSendRequest(unsigned long, WebURLRequest&); - virtual void didReceiveData(unsigned long, int length); - virtual void didReceiveResponse(unsigned long, const WebURLResponse&); - virtual void didFinishLoading(unsigned long); - virtual void didFailLoading(unsigned long, const WebURLError&); - // InspectorClient implementation. virtual void inspectorDestroyed(); virtual void openInspectorFrontend(WebCore::InspectorController*); diff --git a/Source/WebKit/chromium/src/WebDocument.cpp b/Source/WebKit/chromium/src/WebDocument.cpp index a983bf7..0abf307 100644 --- a/Source/WebKit/chromium/src/WebDocument.cpp +++ b/Source/WebKit/chromium/src/WebDocument.cpp @@ -31,6 +31,7 @@ #include "config.h" #include "WebDocument.h" +#include "AXObjectCache.h" #include "Document.h" #include "DocumentType.h" #include "Element.h" @@ -41,6 +42,7 @@ #include "HTMLHeadElement.h" #include "NodeList.h" +#include "WebAccessibilityObject.h" #include "WebDocumentType.h" #include "WebElement.h" #include "WebFrameImpl.h" @@ -129,6 +131,13 @@ WebDocumentType WebDocument::doctype() const return WebDocumentType(constUnwrap<Document>()->doctype()); } +WebAccessibilityObject WebDocument::accessibilityObject() const +{ + const Document* document = constUnwrap<Document>(); + return WebAccessibilityObject( + document->axObjectCache()->getOrCreate(document->renderer())); +} + WebDocument::WebDocument(const PassRefPtr<Document>& elem) : WebNode(elem) { diff --git a/Source/WebKit/chromium/src/WebElement.cpp b/Source/WebKit/chromium/src/WebElement.cpp index 34daa34..ee7ec09 100644 --- a/Source/WebKit/chromium/src/WebElement.cpp +++ b/Source/WebKit/chromium/src/WebElement.cpp @@ -90,6 +90,11 @@ WebString WebElement::innerText() const return constUnwrap<Element>()->innerText(); } +WebNode WebElement::shadowRoot() +{ + return adoptRef(unwrap<Element>()->shadowRoot()); +} + WebString WebElement::computeInheritedLanguage() const { return WebString(constUnwrap<Element>()->computeInheritedLanguage()); diff --git a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp index 0c71f80..58d56e9 100644 --- a/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp @@ -72,6 +72,7 @@ void WebFileSystemCallbacksImpl::didReadMetadata(const WebFileInfo& webFileInfo) fileMetadata.modificationTime = webFileInfo.modificationTime; fileMetadata.length = webFileInfo.length; fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type); + fileMetadata.platformPath = webFileInfo.platformPath; m_callbacks->didReadMetadata(fileMetadata); delete this; } diff --git a/Source/WebKit/chromium/src/WebFormControlElement.cpp b/Source/WebKit/chromium/src/WebFormControlElement.cpp index d2bc8ab..f00b058 100644 --- a/Source/WebKit/chromium/src/WebFormControlElement.cpp +++ b/Source/WebKit/chromium/src/WebFormControlElement.cpp @@ -43,6 +43,11 @@ bool WebFormControlElement::isEnabled() const return constUnwrap<HTMLFormControlElement>()->isEnabledFormControl(); } +bool WebFormControlElement::isReadOnly() const +{ + return constUnwrap<HTMLFormControlElement>()->readOnly(); +} + WebString WebFormControlElement::formControlName() const { return constUnwrap<HTMLFormControlElement>()->name(); diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp index 53e1d44..fdfb14e 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp @@ -1052,11 +1052,17 @@ void WebFrameImpl::dispatchWillSendRequest(WebURLRequest& request) 0, 0, request.toMutableResourceRequest(), response); } +// FIXME: Remove this overload when clients have been changed to pass options. WebURLLoader* WebFrameImpl::createAssociatedURLLoader() { return new AssociatedURLLoader(this); } +WebURLLoader* WebFrameImpl::createAssociatedURLLoader(const WebURLLoaderOptions& options) +{ + return new AssociatedURLLoader(this, options); +} + void WebFrameImpl::commitDocumentData(const char* data, size_t length) { m_frame->loader()->documentLoader()->commitData(data, length); @@ -1077,11 +1083,6 @@ bool WebFrameImpl::willSuppressOpenerInNewFrame() const return frame()->loader()->suppressOpenerInNewFrame(); } -bool WebFrameImpl::pageDismissalEventBeingDispatched() const -{ - return frame()->loader()->pageDismissalEventBeingDispatched(); -} - void WebFrameImpl::replaceSelection(const WebString& text) { RefPtr<DocumentFragment> fragment = createFragmentFromText( @@ -1583,8 +1584,7 @@ void WebFrameImpl::scopeStringMatches(int identifier, // find an alternative. RefPtr<Range> resultRange(findPlainText(searchRange.get(), searchText, - true, - options.matchCase)); + options.matchCase ? 0 : CaseInsensitive)); if (resultRange->collapsed(ec)) { if (!resultRange->startContainer()->isInShadowTree()) break; @@ -1742,9 +1742,18 @@ WebString WebFrameImpl::contentAsMarkup() const return createFullMarkup(m_frame->document()); } -WebString WebFrameImpl::renderTreeAsText() const +WebString WebFrameImpl::renderTreeAsText(bool showDebugInfo) const { - return externalRepresentation(m_frame); + RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal; + + if (showDebugInfo) { + behavior |= RenderAsTextShowCompositedLayers + | RenderAsTextShowAddresses + | RenderAsTextShowIDAndClass + | RenderAsTextShowLayerNesting; + } + + return externalRepresentation(m_frame, behavior); } WebString WebFrameImpl::counterValueForElementById(const WebString& id) const @@ -1791,7 +1800,7 @@ bool WebFrameImpl::selectionStartHasSpellingMarkerFor(int from, int length) cons { if (!m_frame) return false; - return m_frame->editor()->selectionStartHasSpellingMarkerFor(from, length); + return m_frame->editor()->selectionStartHasMarkerFor(DocumentMarker::Spelling, from, length); } bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time, const WebString& elementId) @@ -1814,11 +1823,11 @@ bool WebFrameImpl::pauseSVGAnimation(const WebString& animationId, double time, #endif } -WebString WebFrameImpl::layerTreeAsText() const +WebString WebFrameImpl::layerTreeAsText(bool showDebugInfo) const { if (!m_frame) return WebString(); - return WebString(m_frame->layerTreeAsText()); + return WebString(m_frame->layerTreeAsText(showDebugInfo)); } // WebFrameImpl public --------------------------------------------------------- diff --git a/Source/WebKit/chromium/src/WebFrameImpl.h b/Source/WebKit/chromium/src/WebFrameImpl.h index 179051e..6129de1 100644 --- a/Source/WebKit/chromium/src/WebFrameImpl.h +++ b/Source/WebKit/chromium/src/WebFrameImpl.h @@ -133,12 +133,13 @@ public: virtual bool isViewSourceModeEnabled() const; virtual void setReferrerForRequest(WebURLRequest&, const WebURL& referrer); virtual void dispatchWillSendRequest(WebURLRequest&); + // FIXME: Remove this overload when clients have been changed to pass options. virtual WebURLLoader* createAssociatedURLLoader(); + virtual WebURLLoader* createAssociatedURLLoader(const WebURLLoaderOptions&); virtual void commitDocumentData(const char* data, size_t length); virtual unsigned unloadListenerCount() const; virtual bool isProcessingUserGesture() const; virtual bool willSuppressOpenerInNewFrame() const; - virtual bool pageDismissalEventBeingDispatched() const; virtual void replaceSelection(const WebString&); virtual void insertText(const WebString&); virtual void setMarkedText(const WebString&, unsigned location, unsigned length); @@ -187,7 +188,7 @@ public: virtual WebString contentAsText(size_t maxChars) const; virtual WebString contentAsMarkup() const; - virtual WebString renderTreeAsText() const; + virtual WebString renderTreeAsText(bool showDebugInfo = false) const; virtual WebString counterValueForElementById(const WebString& id) const; virtual WebString markerTextForListItem(const WebElement&) const; virtual int pageNumberForElementById(const WebString& id, @@ -199,7 +200,7 @@ public: virtual bool pauseSVGAnimation(const WebString& animationId, double time, const WebString& elementId); - virtual WebString layerTreeAsText() const; + virtual WebString layerTreeAsText(bool showDebugInfo = false) const; static PassRefPtr<WebFrameImpl> create(WebFrameClient* client); ~WebFrameImpl(); diff --git a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp index 1ec3dd1..0ad47da 100644 --- a/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp +++ b/Source/WebKit/chromium/src/WebGeolocationClientMock.cpp @@ -82,6 +82,11 @@ void WebGeolocationClientMock::setPermission(bool allowed) m_clientMock->setPermission(allowed); } +int WebGeolocationClientMock::numberOfPendingPermissionRequests() const +{ + return m_clientMock->numberOfPendingPermissionRequests(); +} + void WebGeolocationClientMock::resetMock() { m_clientMock->reset(); diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp index 38ac360..ce307a4 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.cpp @@ -30,13 +30,11 @@ #include "IDBCursorBackendProxy.h" #include "IDBDatabaseError.h" #include "IDBDatabaseProxy.h" -#include "IDBIndexBackendProxy.h" #include "IDBKey.h" #include "IDBTransactionBackendProxy.h" #include "WebIDBCallbacks.h" #include "WebIDBDatabase.h" #include "WebIDBDatabaseError.h" -#include "WebIDBIndex.h" #include "WebIDBKey.h" #include "WebIDBTransaction.h" #include "WebSerializedScriptValue.h" @@ -74,11 +72,6 @@ void WebIDBCallbacksImpl::onSuccess(const WebKit::WebIDBKey& key) m_callbacks->onSuccess(key); } -void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBIndex* webKitInstance) -{ - m_callbacks->onSuccess(IDBIndexBackendProxy::create(webKitInstance)); -} - void WebIDBCallbacksImpl::onSuccess(WebKit::WebIDBTransaction* webKitInstance) { m_callbacks->onSuccess(IDBTransactionBackendProxy::create(webKitInstance)); diff --git a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h index 9dd59a5..057aa25 100644 --- a/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h +++ b/Source/WebKit/chromium/src/WebIDBCallbacksImpl.h @@ -45,7 +45,6 @@ public: virtual void onSuccess(WebKit::WebIDBCursor*); virtual void onSuccess(WebKit::WebIDBDatabase*); virtual void onSuccess(const WebKit::WebIDBKey&); - virtual void onSuccess(WebKit::WebIDBIndex*); virtual void onSuccess(WebKit::WebIDBTransaction*); virtual void onSuccess(const WebKit::WebSerializedScriptValue&); virtual void onBlocked(); diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp index a509076..3e21af5 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp @@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl() { } -void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize) +void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType backingStoreType) { - m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize); + m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType)); } } // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h index 9ed6e3f..0ffd289 100755 --- a/Source/WebKit/chromium/src/WebIDBFactoryImpl.h +++ b/Source/WebKit/chromium/src/WebIDBFactoryImpl.h @@ -42,7 +42,7 @@ public: WebIDBFactoryImpl(); virtual ~WebIDBFactoryImpl(); - virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize); + virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType); private: WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend; diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp index 9fe6166..56e354d 100755 --- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp +++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp @@ -28,6 +28,7 @@ #include "DOMStringList.h" #include "IDBCallbacksProxy.h" +#include "IDBIndexBackendInterface.h" #include "IDBKeyRange.h" #include "IDBObjectStoreBackendInterface.h" #include "WebIDBIndexImpl.h" diff --git a/Source/WebKit/chromium/src/WebInputElement.cpp b/Source/WebKit/chromium/src/WebInputElement.cpp index 548f1bb..3448bb6 100644 --- a/Source/WebKit/chromium/src/WebInputElement.cpp +++ b/Source/WebKit/chromium/src/WebInputElement.cpp @@ -65,16 +65,6 @@ bool WebInputElement::autoComplete() const return constUnwrap<HTMLInputElement>()->autoComplete(); } -bool WebInputElement::isReadOnly() const -{ - return constUnwrap<HTMLInputElement>()->readOnly(); -} - -bool WebInputElement::isEnabledFormControl() const -{ - return constUnwrap<HTMLInputElement>()->isEnabledFormControl(); -} - int WebInputElement::maxLength() const { return constUnwrap<HTMLInputElement>()->maxLength(); @@ -183,7 +173,7 @@ WebInputElement::operator PassRefPtr<HTMLInputElement>() const WebInputElement* toWebInputElement(WebElement* webElement) { - InputElement* inputElement = toInputElement(webElement->unwrap<Element>()); + InputElement* inputElement = webElement->unwrap<Element>()->toInputElement(); if (!inputElement) return 0; diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp index a1b428c..abe9cbf 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp @@ -183,6 +183,12 @@ float WebMediaPlayerClientImpl::volume() const return 0.0f; } +void WebMediaPlayerClientImpl::playbackStateChanged() +{ + ASSERT(m_mediaPlayer); + m_mediaPlayer->playbackStateChanged(); +} + // MediaPlayerPrivateInterface ------------------------------------------------- void WebMediaPlayerClientImpl::load(const String& url) diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h index 5d44626..22030b3 100644 --- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h +++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h @@ -76,6 +76,7 @@ public: virtual void sizeChanged(); virtual void sawUnsupportedTracks(); virtual float volume() const; + virtual void playbackStateChanged(); // MediaPlayerPrivateInterface methods: virtual void load(const WTF::String& url); diff --git a/Source/WebKit/chromium/src/WebNode.cpp b/Source/WebKit/chromium/src/WebNode.cpp index e91d1ee..68b6f13 100644 --- a/Source/WebKit/chromium/src/WebNode.cpp +++ b/Source/WebKit/chromium/src/WebNode.cpp @@ -145,9 +145,14 @@ bool WebNode::isTextNode() const return m_private->isTextNode(); } +bool WebNode::isFocusable() const +{ + return m_private->isFocusable(); +} + bool WebNode::isContentEditable() const { - return m_private->isContentEditable(); + return m_private->rendererIsEditable(); } bool WebNode::isElementNode() const diff --git a/Source/WebKit/chromium/src/WebPageSerializer.cpp b/Source/WebKit/chromium/src/WebPageSerializer.cpp index 1fda484..c8c7529 100644 --- a/Source/WebKit/chromium/src/WebPageSerializer.cpp +++ b/Source/WebKit/chromium/src/WebPageSerializer.cpp @@ -31,19 +31,152 @@ #include "config.h" #include "WebPageSerializer.h" +#include "DocumentLoader.h" +#include "Element.h" +#include "Frame.h" +#include "HTMLAllCollection.h" +#include "HTMLFrameOwnerElement.h" +#include "HTMLInputElement.h" +#include "HTMLNames.h" #include "KURL.h" +#include "Vector.h" +#include "WebCString.h" #include "WebFrame.h" +#include "WebFrameImpl.h" #include "WebPageSerializerClient.h" #include "WebPageSerializerImpl.h" #include "WebString.h" #include "WebURL.h" #include "WebVector.h" +#include "WebView.h" #include <wtf/text/StringConcatenate.h> using namespace WebCore; +namespace { + +KURL getSubResourceURLFromElement(Element* element) +{ + ASSERT(element); + const QualifiedName* attributeName = 0; + if (element->hasTagName(HTMLNames::imgTag) || element->hasTagName(HTMLNames::scriptTag)) + attributeName = &HTMLNames::srcAttr; + else if (element->hasTagName(HTMLNames::inputTag)) { + HTMLInputElement* input = static_cast<HTMLInputElement*>(element); + if (input->isImageButton()) + attributeName = &HTMLNames::srcAttr; + } else if (element->hasTagName(HTMLNames::bodyTag) + || element->hasTagName(HTMLNames::tableTag) + || element->hasTagName(HTMLNames::trTag) + || element->hasTagName(HTMLNames::tdTag)) + attributeName = &HTMLNames::backgroundAttr; + else if (element->hasTagName(HTMLNames::blockquoteTag) + || element->hasTagName(HTMLNames::qTag) + || element->hasTagName(HTMLNames::delTag) + || element->hasTagName(HTMLNames::insTag)) + attributeName = &HTMLNames::citeAttr; + else if (element->hasTagName(HTMLNames::linkTag)) { + // If the link element is not css, ignore it. + if (equalIgnoringCase(element->getAttribute(HTMLNames::typeAttr), "text/css")) { + // FIXME: Add support for extracting links of sub-resources which + // are inside style-sheet such as @import, @font-face, url(), etc. + attributeName = &HTMLNames::hrefAttr; + } + } else if (element->hasTagName(HTMLNames::objectTag)) + attributeName = &HTMLNames::dataAttr; + else if (element->hasTagName(HTMLNames::embedTag)) + attributeName = &HTMLNames::srcAttr; + + if (!attributeName) + return KURL(); + + String value = element->getAttribute(*attributeName); + // Ignore javascript content. + if (value.isEmpty() || value.stripWhiteSpace().startsWith("javascript:", false)) + return KURL(); + + return element->document()->completeURL(value); +} + +void retrieveResourcesForElement(Element* element, + Vector<Frame*>* visitedFrames, + Vector<Frame*>* framesToVisit, + Vector<KURL>* frameURLs, + Vector<KURL>* resourceURLs) +{ + // If the node is a frame, we'll process it later in retrieveResourcesForFrame. + if ((element->hasTagName(HTMLNames::iframeTag) || element->hasTagName(HTMLNames::frameTag) + || element->hasTagName(HTMLNames::objectTag) || element->hasTagName(HTMLNames::embedTag)) + && element->isFrameOwnerElement()) { + Frame* frame = static_cast<HTMLFrameOwnerElement*>(element)->contentFrame(); + if (frame) { + if (!visitedFrames->contains(frame)) + framesToVisit->append(frame); + return; + } + } + + KURL url = getSubResourceURLFromElement(element); + if (url.isEmpty() || !url.isValid()) + return; // No subresource for this node. + + // Ignore URLs that have a non-standard protocols. Since the FTP protocol + // does no have a cache mechanism, we skip it as well. + if (!url.protocolInHTTPFamily() && !url.isLocalFile()) + return; + + if (!resourceURLs->contains(url)) + resourceURLs->append(url); +} + +void retrieveResourcesForFrame(Frame* frame, + const WebKit::WebVector<WebKit::WebCString>& supportedSchemes, + Vector<Frame*>* visitedFrames, + Vector<Frame*>* framesToVisit, + Vector<KURL>* frameURLs, + Vector<KURL>* resourceURLs) +{ + KURL frameURL = frame->loader()->documentLoader()->request().url(); + + // If the frame's URL is invalid, ignore it, it is not retrievable. + if (!frameURL.isValid()) + return; + + // Ignore frames from unsupported schemes. + bool isValidScheme = false; + for (size_t i = 0; i < supportedSchemes.size(); ++i) { + if (frameURL.protocolIs(static_cast<CString>(supportedSchemes[i]).data())) { + isValidScheme = true; + break; + } + } + if (!isValidScheme) + return; + + // If we have already seen that frame, ignore it. + if (visitedFrames->contains(frame)) + return; + visitedFrames->append(frame); + if (!frameURLs->contains(frameURL)) + frameURLs->append(frameURL); + + // Now get the resources associated with each node of the document. + RefPtr<HTMLAllCollection> allNodes = frame->document()->all(); + for (unsigned i = 0; i < allNodes->length(); ++i) { + Node* node = allNodes->item(i); + // We are only interested in HTML resources. + if (!node->isElementNode()) + continue; + retrieveResourcesForElement(static_cast<Element*>(node), + visitedFrames, framesToVisit, + frameURLs, resourceURLs); + } +} + +} // namespace + namespace WebKit { bool WebPageSerializer::serialize(WebFrame* frame, @@ -58,6 +191,48 @@ bool WebPageSerializer::serialize(WebFrame* frame, return serializerImpl.serialize(); } +bool WebPageSerializer::retrieveAllResources(WebView* view, + const WebVector<WebCString>& supportedSchemes, + WebVector<WebURL>* resourceURLs, + WebVector<WebURL>* frameURLs) { + WebFrameImpl* mainFrame = static_cast<WebFrameImpl*>(view->mainFrame()); + if (!mainFrame) + return false; + + Vector<Frame*> framesToVisit; + Vector<Frame*> visitedFrames; + Vector<KURL> frameKURLs; + Vector<KURL> resourceKURLs; + + // Let's retrieve the resources from every frame in this page. + framesToVisit.append(mainFrame->frame()); + while (!framesToVisit.isEmpty()) { + Frame* frame = framesToVisit[0]; + framesToVisit.remove(0); + retrieveResourcesForFrame(frame, supportedSchemes, + &visitedFrames, &framesToVisit, + &frameKURLs, &resourceKURLs); + } + + // Converts the results to WebURLs. + WebVector<WebURL> resultResourceURLs(resourceKURLs.size()); + for (size_t i = 0; i < resourceKURLs.size(); ++i) { + resultResourceURLs[i] = resourceKURLs[i]; + // A frame's src can point to the same URL as another resource, keep the + // resource URL only in such cases. + size_t index = frameKURLs.find(resourceKURLs[i]); + if (index != notFound) + frameKURLs.remove(index); + } + *resourceURLs = resultResourceURLs; + WebVector<WebURL> resultFrameURLs(frameKURLs.size()); + for (size_t i = 0; i < frameKURLs.size(); ++i) + resultFrameURLs[i] = frameKURLs[i]; + *frameURLs = resultFrameURLs; + + return true; +} + WebString WebPageSerializer::generateMetaCharsetDeclaration(const WebString& charset) { return makeString("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=", static_cast<const String&>(charset), "\">"); @@ -77,4 +252,4 @@ WebString WebPageSerializer::generateBaseTagDeclaration(const WebString& baseTar return makeString("<base href=\".\" target=\"", static_cast<const String&>(baseTarget), "\">"); } -} // namespace WebKit +} // namespace WebKit diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp index bb1b083..40f8625 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp @@ -164,6 +164,7 @@ void WebPluginContainerImpl::handleEvent(Event* event) if (!m_webPlugin->acceptsInputEvents()) return; + RefPtr<WebPluginContainerImpl> protector(this); // The events we pass are defined at: // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/structures5.html#1000000 // Don't take the documentation as truth, however. There are many cases @@ -307,6 +308,22 @@ void WebPluginContainerImpl::reportGeometry() m_webPlugin->updateGeometry(windowRect, clipRect, cutOutRects, isVisible()); } +void WebPluginContainerImpl::setBackingTextureId(unsigned id) +{ +#if USE(ACCELERATED_COMPOSITING) + unsigned currId = m_platformLayer->textureId(); + if (currId == id) + return; + + m_platformLayer->setTextureId(id); + // If anyone of the IDs is zero we need to switch between hardware + // and software compositing. This is done by triggering a style recalc + // on the container element. + if (!(currId * id)) + m_element->setNeedsStyleRecalc(WebCore::SyntheticStyleChange); +#endif +} + void WebPluginContainerImpl::commitBackingTexture() { #if USE(ACCELERATED_COMPOSITING) @@ -427,15 +444,7 @@ void WebPluginContainerImpl::willDestroyPluginLoadObserver(WebPluginLoadObserver #if USE(ACCELERATED_COMPOSITING) WebCore::LayerChromium* WebPluginContainerImpl::platformLayer() const { - // FIXME: In the event of a context lost, the texture needs to be recreated on the compositor's - // context and rebound to the platform layer here. - unsigned backingTextureId = m_webPlugin->getBackingTextureId(); - if (!backingTextureId) - return 0; - - m_platformLayer->setTextureId(backingTextureId); - - return m_platformLayer.get(); + return m_platformLayer->textureId() ? m_platformLayer.get() : 0; } #endif diff --git a/Source/WebKit/chromium/src/WebPluginContainerImpl.h b/Source/WebKit/chromium/src/WebPluginContainerImpl.h index ebe6983..9922932 100644 --- a/Source/WebKit/chromium/src/WebPluginContainerImpl.h +++ b/Source/WebKit/chromium/src/WebPluginContainerImpl.h @@ -84,6 +84,7 @@ public: virtual void invalidateRect(const WebRect&); virtual void scrollRect(int dx, int dy, const WebRect&); virtual void reportGeometry(); + virtual void setBackingTextureId(unsigned); virtual void commitBackingTexture(); virtual void clearScriptObjects(); virtual NPObject* scriptableObjectForElement(); diff --git a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp index e3ece6e..256bf56 100644 --- a/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp +++ b/Source/WebKit/chromium/src/WebRuntimeFeatures.cpp @@ -152,6 +152,22 @@ bool WebRuntimeFeatures::isApplicationCacheEnabled() #endif } +void WebRuntimeFeatures::enableDataTransferItems(bool enable) +{ +#if ENABLE(DATA_TRANSFER_ITEMS) + RuntimeEnabledFeatures::setDataTransferItemsEnabled(enable); +#endif +} + +bool WebRuntimeFeatures::isDataTransferItemsEnabled() +{ +#if ENABLE(DATA_TRANSFER_ITEMS) + return RuntimeEnabledFeatures::dataTransferItemsEnabled(); +#else + return false; +#endif +} + void WebRuntimeFeatures::enableGeolocation(bool enable) { #if ENABLE(GEOLOCATION) @@ -200,22 +216,6 @@ bool WebRuntimeFeatures::isWebAudioEnabled() #endif } -void WebRuntimeFeatures::enableWebGL(bool enable) -{ -#if ENABLE(WEBGL) - RuntimeEnabledFeatures::setWebGLEnabled(enable); -#endif -} - -bool WebRuntimeFeatures::isWebGLEnabled() -{ -#if ENABLE(WEBGL) - return RuntimeEnabledFeatures::webGLRenderingContextEnabled(); -#else - return false; -#endif -} - void WebRuntimeFeatures::enablePushState(bool enable) { RuntimeEnabledFeatures::setPushStateEnabled(enable); diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp index e5d172e..1089af9 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp +++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp @@ -308,6 +308,11 @@ void WebSettingsImpl::setAcceleratedCompositingEnabled(bool enabled) m_settings->setAcceleratedCompositingEnabled(enabled); } +void WebSettingsImpl::setForceCompositingMode(bool enabled) +{ + m_settings->setForceCompositingMode(enabled); +} + void WebSettingsImpl::setCompositeToTextureEnabled(bool enabled) { m_compositeToTextureEnabled = enabled; diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h index 323a5b3..d0319f8 100644 --- a/Source/WebKit/chromium/src/WebSettingsImpl.h +++ b/Source/WebKit/chromium/src/WebSettingsImpl.h @@ -94,6 +94,7 @@ public: virtual bool showPlatformLayerTree() const { return m_showPlatformLayerTree; } virtual void setEditingBehavior(EditingBehavior); virtual void setAcceleratedCompositingEnabled(bool); + virtual void setForceCompositingMode(bool); virtual void setCompositeToTextureEnabled(bool); virtual bool compositeToTextureEnabled() const { return m_compositeToTextureEnabled; } virtual void setAcceleratedCompositingFor3DTransformsEnabled(bool); diff --git a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp index 2759790..b9e5227 100644 --- a/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp +++ b/Source/WebKit/chromium/src/WebTextCheckingCompletionImpl.cpp @@ -43,7 +43,7 @@ static Vector<SpellCheckingResult> toCoreResults(const WebVector<WebTextChecking { Vector<SpellCheckingResult> coreResults; for (size_t i = 0; i < results.size(); ++i) - coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error()), results[i].position(), results[i].length())); + coreResults.append(SpellCheckingResult(static_cast<DocumentMarker::MarkerType>(results[i].error), results[i].position, results[i].length)); return coreResults; } diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp index 6ae4f35..4efa880 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.cpp +++ b/Source/WebKit/chromium/src/WebViewImpl.cpp @@ -77,7 +77,6 @@ #include "PageGroup.h" #include "PageGroupLoadDeferrer.h" #include "Pasteboard.h" -#include "PlatformBridge.h" #include "PlatformContextSkia.h" #include "PlatformKeyboardEvent.h" #include "PlatformMouseEvent.h" @@ -93,6 +92,7 @@ #include "Settings.h" #include "SpeechInputClientImpl.h" #include "Timer.h" +#include "TraceEvent.h" #include "TypingCommand.h" #include "UserGestureIndicator.h" #include "Vector.h" @@ -126,6 +126,7 @@ #include <wtf/RefPtr.h> #if PLATFORM(CG) +#include <CoreGraphics/CGBitmapContext.h> #include <CoreGraphics/CGContext.h> #endif @@ -211,13 +212,13 @@ static bool shouldUseExternalPopupMenus = false; // WebView ---------------------------------------------------------------- -WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient) +WebView* WebView::create(WebViewClient* client) { // Keep runtime flag for device motion turned off until it's implemented. WebRuntimeFeatures::enableDeviceMotion(false); // Pass the WebViewImpl's self-reference to the caller. - return adoptRef(new WebViewImpl(client, devToolsClient, autoFillClient)).leakRef(); + return adoptRef(new WebViewImpl(client)).leakRef(); } void WebView::setUseExternalPopupMenus(bool useExternalPopupMenus) @@ -269,9 +270,28 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient) SecurityOrigin::setLocalLoadPolicy(SecurityOrigin::AllowLocalLoadsForLocalOnly); } -WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient, WebAutoFillClient* autoFillClient) +void WebViewImpl::setDevToolsAgentClient(WebDevToolsAgentClient* devToolsClient) +{ + if (devToolsClient) + m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); + else + m_devToolsAgent.clear(); +} + +void WebViewImpl::setAutoFillClient(WebAutoFillClient* autoFillClient) +{ + m_autoFillClient = autoFillClient; +} + +void WebViewImpl::setSpellCheckClient(WebSpellCheckClient* spellCheckClient) +{ + m_spellCheckClient = spellCheckClient; +} + +WebViewImpl::WebViewImpl(WebViewClient* client) : m_client(client) - , m_autoFillClient(autoFillClient) + , m_autoFillClient(0) + , m_spellCheckClient(0) , m_chromeClientImpl(this) , m_contextMenuClientImpl(this) , m_dragClientImpl(this) @@ -290,9 +310,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_suppressNextKeypressEvent(false) , m_initialNavigationPolicy(WebNavigationPolicyIgnore) , m_imeAcceptEvents(true) - , m_dragTargetDispatch(false) - , m_dragIdentity(0) - , m_dropEffect(DropEffectDefault) , m_operationsAllowed(WebDragOperationNone) , m_dragOperation(WebDragOperationNone) , m_autoFillPopupShowing(false) @@ -305,6 +322,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools , m_layerRenderer(0) , m_isAcceleratedCompositingActive(false) , m_compositorCreationFailed(false) + , m_recreatingGraphicsContext(false) #endif #if ENABLE(INPUT_SPEECH) , m_speechInputClient(SpeechInputClientImpl::create(client)) @@ -321,9 +339,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools // set to impossible point so we always get the first mouse pos m_lastMousePosition = WebPoint(-1, -1); - if (devToolsClient) - m_devToolsAgent = new WebDevToolsAgentImpl(this, devToolsClient); - Page::PageClients pageClients; pageClients.chromeClient = &m_chromeClientImpl; pageClients.contextMenuClient = &m_contextMenuClientImpl; @@ -962,13 +977,14 @@ void WebViewImpl::resize(const WebSize& newSize) } if (m_client) { - WebRect damagedRect(0, 0, m_size.width, m_size.height); if (isAcceleratedCompositingActive()) { #if USE(ACCELERATED_COMPOSITING) - invalidateRootLayerRect(damagedRect); + updateLayerRendererViewport(); #endif - } else + } else { + WebRect damagedRect(0, 0, m_size.width, m_size.height); m_client->didInvalidateRect(damagedRect); + } } #if USE(ACCELERATED_COMPOSITING) @@ -993,6 +1009,12 @@ void WebViewImpl::animate() void WebViewImpl::layout() { +#if USE(ACCELERATED_COMPOSITING) + // FIXME: RTL style not supported by the compositor yet. + if (isAcceleratedCompositingActive() && pageHasRTLStyle()) + setIsAcceleratedCompositingActive(false); +#endif + WebFrameImpl* webframe = mainFrameImpl(); if (webframe) { // In order for our child HWNDs (NativeWindowWidgets) to update properly, @@ -1057,7 +1079,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect) if (canvas) { // Clip rect to the confines of the rootLayerTexture. IntRect resizeRect(rect); - resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->visibleRectSize())); + resizeRect.intersect(IntRect(IntPoint(), m_layerRenderer->viewportSize())); doPixelReadbackToCanvas(canvas, resizeRect); } #endif @@ -1081,6 +1103,14 @@ void WebViewImpl::themeChanged() void WebViewImpl::composite(bool finish) { #if USE(ACCELERATED_COMPOSITING) + TRACE_EVENT("WebViewImpl::composite", this, 0); + if (m_recreatingGraphicsContext) { + // reallocateRenderer will request a repaint whether or not it succeeded + // in creating a new context. + reallocateRenderer(); + m_recreatingGraphicsContext = false; + return; + } doComposite(); // Finish if requested. @@ -1091,8 +1121,16 @@ void WebViewImpl::composite(bool finish) m_layerRenderer->present(); GraphicsContext3D* context = m_layerRenderer->context(); - if (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) - reallocateRenderer(); + if (context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) { + // Trying to recover the context right here will not work if GPU process + // died. This is because GpuChannelHost::OnErrorMessage will only be + // called at the next iteration of the message loop, reverting our + // recovery attempts here. Instead, we detach the root layer from the + // renderer, recreate the renderer at the next message loop iteration + // and request a repaint yet again. + m_recreatingGraphicsContext = true; + setRootLayerNeedsDisplay(); + } #endif } @@ -1235,7 +1273,7 @@ void WebViewImpl::setFocus(bool enable) Element* element = static_cast<Element*>(focusedNode); if (element->isTextFormControl()) element->updateFocusAppearance(true); - else if (focusedNode->isContentEditable()) { + else if (focusedNode->rendererIsEditable()) { // updateFocusAppearance() selects all the text of // contentseditable DIVs. So we set the selection explicitly // instead. Note that this has the side effect of moving the @@ -1297,7 +1335,7 @@ bool WebViewImpl::setComposition( PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->isContentEditable()) + if (!node || !node->rendererIsEditable()) return false; } @@ -1346,7 +1384,7 @@ bool WebViewImpl::confirmComposition(const WebString& text) PassRefPtr<Range> range = editor->compositionRange(); if (range) { const Node* node = range->startContainer(); - if (!node || !node->isContentEditable()) + if (!node || !node->rendererIsEditable()) return false; } @@ -1755,7 +1793,22 @@ void WebViewImpl::dragSourceSystemDragEnded() } WebDragOperation WebViewImpl::dragTargetDragEnter( - const WebDragData& webDragData, int identity, + const WebDragData& webDragData, int identity, // FIXME: remove identity from this function signature. + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed) +{ + ASSERT(!m_currentDragData.get()); + + m_currentDragData = webDragData; + UNUSED_PARAM(identity); + m_operationsAllowed = operationsAllowed; + + return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); +} + +WebDragOperation WebViewImpl::dragTargetDragEnter( + const WebDragData& webDragData, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed) @@ -1763,7 +1816,6 @@ WebDragOperation WebViewImpl::dragTargetDragEnter( ASSERT(!m_currentDragData.get()); m_currentDragData = webDragData; - m_dragIdentity = identity; m_operationsAllowed = operationsAllowed; return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter); @@ -1789,14 +1841,12 @@ void WebViewImpl::dragTargetDragLeave() IntPoint(), static_cast<DragOperation>(m_operationsAllowed)); - m_dragTargetDispatch = true; m_page->dragController()->dragExited(&dragData); - m_dragTargetDispatch = false; - m_currentDragData = 0; - m_dropEffect = DropEffectDefault; + // FIXME: why is the drag scroll timer not stopped here? + m_dragOperation = WebDragOperationNone; - m_dragIdentity = 0; + m_currentDragData = 0; } void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, @@ -1822,22 +1872,12 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint, screenPoint, static_cast<DragOperation>(m_operationsAllowed)); - m_dragTargetDispatch = true; m_page->dragController()->performDrag(&dragData); - m_dragTargetDispatch = false; - m_currentDragData = 0; - m_dropEffect = DropEffectDefault; m_dragOperation = WebDragOperationNone; - m_dragIdentity = 0; - m_dragScrollTimer->stop(); -} + m_currentDragData = 0; -int WebViewImpl::dragIdentity() -{ - if (m_dragTargetDispatch) - return m_dragIdentity; - return 0; + m_dragScrollTimer->stop(); } WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPoint, const WebPoint& screenPoint, DragAction dragAction) @@ -1850,27 +1890,23 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo screenPoint, static_cast<DragOperation>(m_operationsAllowed)); - m_dropEffect = DropEffectDefault; - m_dragTargetDispatch = true; - DragOperation effect = dragAction == DragEnter ? m_page->dragController()->dragEntered(&dragData) - : m_page->dragController()->dragUpdated(&dragData); - // Mask the operation against the drag source's allowed operations. - if (!(effect & dragData.draggingSourceOperationMask())) - effect = DragOperationNone; - m_dragTargetDispatch = false; - - if (m_dropEffect != DropEffectDefault) { - m_dragOperation = (m_dropEffect != DropEffectNone) ? WebDragOperationCopy - : WebDragOperationNone; - } else - m_dragOperation = static_cast<WebDragOperation>(effect); + DragOperation dropEffect; + if (dragAction == DragEnter) + dropEffect = m_page->dragController()->dragEntered(&dragData); + else + dropEffect = m_page->dragController()->dragUpdated(&dragData); + + // Mask the drop effect operation against the drag source's allowed operations. + if (!(dropEffect & dragData.draggingSourceOperationMask())) + dropEffect = DragOperationNone; + + m_dragOperation = static_cast<WebDragOperation>(dropEffect); if (dragAction == DragOver) m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint); else m_dragScrollTimer->stop(); - return m_dragOperation; } @@ -2010,15 +2046,6 @@ void WebViewImpl::performCustomContextMenuAction(unsigned action) // WebView -------------------------------------------------------------------- -bool WebViewImpl::setDropEffect(bool accept) -{ - if (m_dragTargetDispatch) { - m_dropEffect = accept ? DropEffectCopy : DropEffectNone; - return true; - } - return false; -} - void WebViewImpl::setIsTransparent(bool isTransparent) { // Set any existing frames to be transparent. @@ -2258,9 +2285,26 @@ bool WebViewImpl::allowsAcceleratedCompositing() return !m_compositorCreationFailed; } +bool WebViewImpl::pageHasRTLStyle() const +{ + if (!page()) + return false; + Document* document = page()->mainFrame()->document(); + if (!document) + return false; + RenderView* renderView = document->renderView(); + if (!renderView) + return false; + RenderStyle* style = renderView->style(); + if (!style) + return false; + return (style->direction() == RTL); +} + void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer) { - setIsAcceleratedCompositingActive(layer ? true : false); + // FIXME: RTL style not supported by the compositor yet. + setIsAcceleratedCompositingActive(layer && !pageHasRTLStyle() ? true : false); if (m_layerRenderer) m_layerRenderer->setRootLayer(layer); @@ -2279,6 +2323,7 @@ void WebViewImpl::setRootLayerNeedsDisplay() void WebViewImpl::scrollRootLayerRect(const IntSize& scrollDelta, const IntRect& clipRect) { + updateLayerRendererViewport(); setRootLayerNeedsDisplay(); } @@ -2290,14 +2335,66 @@ void WebViewImpl::invalidateRootLayerRect(const IntRect& rect) return; FrameView* view = page()->mainFrame()->view(); - IntRect contentRect = view->visibleContentRect(false); - IntRect visibleRect = view->visibleContentRect(true); - IntRect dirtyRect = view->windowToContents(rect); - m_layerRenderer->invalidateRootLayerRect(dirtyRect, visibleRect, contentRect); + updateLayerRendererViewport(); + m_layerRenderer->invalidateRootLayerRect(dirtyRect); setRootLayerNeedsDisplay(); } +class WebViewImplContentPainter : public TilePaintInterface { + WTF_MAKE_NONCOPYABLE(WebViewImplContentPainter); +public: + static PassOwnPtr<WebViewImplContentPainter*> create(WebViewImpl* webViewImpl) + { + return adoptPtr(new WebViewImplContentPainter(webViewImpl)); + } + + virtual void paint(GraphicsContext& context, const IntRect& contentRect) + { + Page* page = m_webViewImpl->page(); + if (!page) + return; + FrameView* view = page->mainFrame()->view(); + view->paintContents(&context, contentRect); + } + +private: + explicit WebViewImplContentPainter(WebViewImpl* webViewImpl) + : m_webViewImpl(webViewImpl) + { + } + + WebViewImpl* m_webViewImpl; +}; + +class WebViewImplScrollbarPainter : public TilePaintInterface { + WTF_MAKE_NONCOPYABLE(WebViewImplScrollbarPainter); +public: + static PassOwnPtr<WebViewImplScrollbarPainter> create(WebViewImpl* webViewImpl) + { + return adoptPtr(new WebViewImplScrollbarPainter(webViewImpl)); + } + + virtual void paint(GraphicsContext& context, const IntRect& contentRect) + { + Page* page = m_webViewImpl->page(); + if (!page) + return; + FrameView* view = page->mainFrame()->view(); + + context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); + IntRect windowRect = view->contentsToWindow(contentRect); + view->paintScrollbars(&context, windowRect); + } + +private: + explicit WebViewImplScrollbarPainter(WebViewImpl* webViewImpl) + : m_webViewImpl(webViewImpl) + { + } + + WebViewImpl* m_webViewImpl; +}; void WebViewImpl::setIsAcceleratedCompositingActive(bool active) { @@ -2308,8 +2405,11 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (!active) { m_isAcceleratedCompositingActive = false; + // We need to finish all GL rendering before sending + // didActivateAcceleratedCompositing(false) to prevent + // flickering when compositing turns off. if (m_layerRenderer) - m_layerRenderer->finish(); // finish all GL rendering before we hide the window? + m_layerRenderer->finish(); m_client->didActivateAcceleratedCompositing(false); } else if (m_layerRenderer) { m_isAcceleratedCompositingActive = true; @@ -2324,7 +2424,8 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) if (context) context->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); } - m_layerRenderer = LayerRendererChromium::create(context.release()); + + m_layerRenderer = LayerRendererChromium::create(context.release(), WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); if (m_layerRenderer) { m_client->didActivateAcceleratedCompositing(true); m_isAcceleratedCompositingActive = true; @@ -2339,95 +2440,67 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active) page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositingActive); } -class WebViewImplTilePaintInterface : public TilePaintInterface { -public: - explicit WebViewImplTilePaintInterface(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - view->paintContents(&context, contentRect); - } - -private: - WebViewImpl* m_webViewImpl; -}; - - -class WebViewImplScrollbarPaintInterface : public TilePaintInterface { -public: - explicit WebViewImplScrollbarPaintInterface(WebViewImpl* webViewImpl) - : m_webViewImpl(webViewImpl) - { - } - - virtual void paint(GraphicsContext& context, const IntRect& contentRect) - { - Page* page = m_webViewImpl->page(); - if (!page) - return; - FrameView* view = page->mainFrame()->view(); - - context.translate(static_cast<float>(view->scrollX()), static_cast<float>(view->scrollY())); - IntRect windowRect = view->contentsToWindow(contentRect); - view->paintScrollbars(&context, windowRect); - } - -private: - WebViewImpl* m_webViewImpl; -}; - void WebViewImpl::doComposite() { + ASSERT(m_layerRenderer); + if (!m_layerRenderer) { + setIsAcceleratedCompositingActive(false); + return; + } + 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); - IntPoint scroll(view->scrollX(), view->scrollY()); - - WebViewImplTilePaintInterface tilePaint(this); - - WebViewImplScrollbarPaintInterface scrollbarPaint(this); m_layerRenderer->setCompositeOffscreen(settings()->compositeToTextureEnabled()); CCHeadsUpDisplay* hud = m_layerRenderer->headsUpDisplay(); hud->setShowFPSCounter(settings()->showFPSCounter()); hud->setShowPlatformLayerTree(settings()->showPlatformLayerTree()); - m_layerRenderer->updateAndDrawLayers(visibleRect, contentRect, scroll, tilePaint, scrollbarPaint); - - if (m_layerRenderer->isCompositingOffscreen()) - m_layerRenderer->copyOffscreenTextureToDisplay(); + m_layerRenderer->updateAndDrawLayers(); } void WebViewImpl::reallocateRenderer() { - GraphicsContext3D* context = m_layerRenderer->context(); - RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create(context->getContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); + RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create( + getCompositorContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow); // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0. - RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext); + RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext, WebViewImplContentPainter::create(this), WebViewImplScrollbarPainter::create(this)); // Reattach the root layer. Child layers will get reattached as a side effect of updateLayersRecursive. - if (layerRenderer) + if (layerRenderer) { m_layerRenderer->transferRootLayer(layerRenderer.get()); - m_layerRenderer = layerRenderer; - - // Enable or disable accelerated compositing and request a refresh. - setRootGraphicsLayer(m_layerRenderer ? m_layerRenderer->rootLayer() : 0); + m_layerRenderer = layerRenderer; + // FIXME: In MacOS newContext->reshape method needs to be called to + // allocate IOSurfaces. All calls to create a context followed by + // reshape should really be extracted into one function; it is not + // immediately obvious that GraphicsContext3D object will not + // function properly until its reshape method is called. + newContext->reshape(std::max(1, m_size.width), std::max(1, m_size.height)); + setRootGraphicsLayer(m_layerRenderer->rootLayer()); + // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so + // that the browser process can reacquire surfaces. + m_client->didActivateAcceleratedCompositing(true); + } else + setRootGraphicsLayer(0); } #endif +void WebViewImpl::updateLayerRendererViewport() +{ + ASSERT(m_layerRenderer); + + if (!page()) + return; + + FrameView* view = page()->mainFrame()->view(); + IntRect contentRect = view->visibleContentRect(false); + IntRect visibleRect = view->visibleContentRect(true); + IntPoint scroll(view->scrollX(), view->scrollY()); + + m_layerRenderer->setViewport(visibleRect, contentRect, scroll); +} WebGraphicsContext3D* WebViewImpl::graphicsContext3D() { diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h index 2163725..66b2908 100644 --- a/Source/WebKit/chromium/src/WebViewImpl.h +++ b/Source/WebKit/chromium/src/WebViewImpl.h @@ -114,6 +114,9 @@ public: // WebView methods: virtual void initializeMainFrame(WebFrameClient*); + virtual void setDevToolsAgentClient(WebDevToolsAgentClient*); + virtual void setAutoFillClient(WebAutoFillClient*); + virtual void setSpellCheckClient(WebSpellCheckClient*); virtual WebSettings* settings(); virtual WebString pageEncoding() const; virtual void setPageEncoding(const WebString& encoding); @@ -154,7 +157,12 @@ public: WebDragOperation operation); virtual void dragSourceSystemDragEnded(); virtual WebDragOperation dragTargetDragEnter( - const WebDragData& dragData, int identity, + const WebDragData&, int identity, // FIXME: remove identity from this function signature. + const WebPoint& clientPoint, + const WebPoint& screenPoint, + WebDragOperationsMask operationsAllowed); + virtual WebDragOperation dragTargetDragEnter( + const WebDragData&, const WebPoint& clientPoint, const WebPoint& screenPoint, WebDragOperationsMask operationsAllowed); @@ -166,8 +174,6 @@ public: virtual void dragTargetDrop( const WebPoint& clientPoint, const WebPoint& screenPoint); - virtual int dragIdentity(); - virtual bool setDropEffect(bool accept); virtual unsigned long createUniqueIdentifierForRequest(); virtual void inspectElementAt(const WebPoint& point); virtual WebString inspectorSettings() const; @@ -221,6 +227,11 @@ public: return m_autoFillClient; } + WebSpellCheckClient* spellCheckClient() + { + return m_spellCheckClient; + } + // Returns the page object associated with this view. This may be null when // the page is shutting down, but will be valid at all other times. WebCore::Page* page() const @@ -327,6 +338,7 @@ public: #if USE(ACCELERATED_COMPOSITING) bool allowsAcceleratedCompositing(); + bool pageHasRTLStyle() const; void setRootGraphicsLayer(WebCore::PlatformLayer*); void setRootLayerNeedsDisplay(); void scrollRootLayerRect(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& clipRect); @@ -361,7 +373,7 @@ private: DragOver }; - WebViewImpl(WebViewClient*, WebDevToolsAgentClient*, WebAutoFillClient*); + WebViewImpl(WebViewClient*); ~WebViewImpl(); // Returns true if the event was actually processed. @@ -399,10 +411,12 @@ private: void doComposite(); void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&); void reallocateRenderer(); + void updateLayerRendererViewport(); #endif WebViewClient* m_client; WebAutoFillClient* m_autoFillClient; + WebSpellCheckClient* m_spellCheckClient; ChromeClientImpl m_chromeClientImpl; ContextMenuClientImpl m_contextMenuClientImpl; @@ -467,22 +481,6 @@ private: // Represents whether or not this object should process incoming IME events. bool m_imeAcceptEvents; - // True while dispatching system drag and drop events to drag/drop targets - // within this WebView. - bool m_dragTargetDispatch; - - // Valid when m_dragTargetDispatch is true; the identity of the drag data - // copied from the WebDropData object sent from the browser process. - int m_dragIdentity; - - // Valid when m_dragTargetDispatch is true. Used to override the default - // browser drop effect with the effects "none" or "copy". - enum DragTargetDropEffect { - DropEffectDefault = -1, - DropEffectNone, - DropEffectCopy - } m_dropEffect; - // The available drag operations (copy, move link...) allowed by the source. WebDragOperation m_operationsAllowed; @@ -531,6 +529,8 @@ private: RefPtr<WebCore::LayerRendererChromium> m_layerRenderer; bool m_isAcceleratedCompositingActive; bool m_compositorCreationFailed; + // If true, the graphics context is being restored. + bool m_recreatingGraphicsContext; #endif static const WebInputEvent* m_currentInputEvent; diff --git a/Source/WebKit/chromium/src/WebWorkerBase.cpp b/Source/WebKit/chromium/src/WebWorkerBase.cpp index b16b6d4..0cd5f41 100644 --- a/Source/WebKit/chromium/src/WebWorkerBase.cpp +++ b/Source/WebKit/chromium/src/WebWorkerBase.cpp @@ -65,7 +65,7 @@ namespace { // This class is used to route the result of the WebWorkerBase::allowDatabase // call back to the worker context. -class AllowDatabaseMainThreadBridge : public ThreadSafeShared<AllowDatabaseMainThreadBridge> { +class AllowDatabaseMainThreadBridge : public ThreadSafeRefCounted<AllowDatabaseMainThreadBridge> { public: static PassRefPtr<AllowDatabaseMainThreadBridge> create(WebWorkerBase* worker, const WTF::String& mode, WebCommonWorkerClient* commonClient, WebFrame* frame, const WTF::String& name, const WTF::String& displayName, unsigned long estimatedSize) { @@ -170,7 +170,7 @@ void WebWorkerBase::initializeLoader(const WebURL& url) // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. ASSERT(!m_webView); - m_webView = WebView::create(0, 0, 0); + m_webView = WebView::create(0); m_webView->settings()->setOfflineWebApplicationCacheEnabled(WebRuntimeFeatures::isApplicationCacheEnabled()); m_webView->initializeMainFrame(this); @@ -237,7 +237,7 @@ bool WebWorkerBase::allowDatabase(WebFrame*, const WebString& name, const WebStr } #if ENABLE(FILE_SYSTEM) -void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long size, WebFileSystemCallbacks* callbacks, bool synchronous) +void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks, bool synchronous) { WorkerRunLoop& runLoop = m_workerThread->runLoop(); WorkerScriptController* controller = WorkerScriptController::controllerForContext(); @@ -248,7 +248,7 @@ void WebWorkerBase::openFileSystemForWorker(WebFileSystem::Type type, long long mode.append(String::number(runLoop.createUniqueId())); RefPtr<WorkerFileSystemCallbacksBridge> bridge = WorkerFileSystemCallbacksBridge::create(this, workerContext, callbacks); - bridge->postOpenFileSystemToMainThread(commonClient(), type, size, mode); + bridge->postOpenFileSystemToMainThread(commonClient(), type, size, create, mode); if (synchronous) { if (runLoop.runInMode(workerContext, mode) == MessageQueueTerminated) diff --git a/Source/WebKit/chromium/src/WebWorkerBase.h b/Source/WebKit/chromium/src/WebWorkerBase.h index ec73505..8fb032e 100644 --- a/Source/WebKit/chromium/src/WebWorkerBase.h +++ b/Source/WebKit/chromium/src/WebWorkerBase.h @@ -92,7 +92,7 @@ public: virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize); #if ENABLE(FILE_SYSTEM) - void openFileSystemForWorker(WebFileSystem::Type, long long size, WebFileSystemCallbacks*, bool synchronous); + void openFileSystemForWorker(WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*, bool synchronous); #endif // Executes the given task on the main thread. diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp index 6c31221..d05322f 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.cpp @@ -57,6 +57,7 @@ template<> struct CrossThreadCopierBase<false, false, WebKit::WebFileInfo> { newInfo.modificationTime = info.modificationTime; newInfo.length = info.length; newInfo.type = info.type; + newInfo.platformPath.assign(info.platformPath.data(), info.platformPath.length()); return newInfo; } }; @@ -85,7 +86,7 @@ namespace WebKit { class MainThreadFileSystemCallbacks : public WebFileSystemCallbacks { public: // Callbacks are self-destructed and we always return leaked pointer here. - static MainThreadFileSystemCallbacks* createLeakedPtr(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) + static MainThreadFileSystemCallbacks* createLeakedPtr(WorkerFileSystemCallbacksBridge* bridge, const String& mode) { OwnPtr<MainThreadFileSystemCallbacks> callbacks = adoptPtr(new MainThreadFileSystemCallbacks(bridge, mode)); return callbacks.leakPtr(); @@ -126,15 +127,16 @@ public: } private: - MainThreadFileSystemCallbacks(PassRefPtr<WorkerFileSystemCallbacksBridge> bridge, const String& mode) + MainThreadFileSystemCallbacks(WorkerFileSystemCallbacksBridge* bridge, const String& mode) : m_bridge(bridge) , m_mode(mode) { - ASSERT(m_bridge.get()); + ASSERT(m_bridge); } friend class WorkerFileSystemCallbacksBridge; - RefPtr<WorkerFileSystemCallbacksBridge> m_bridge; + // The bridge pointer is kept by the bridge itself on the WorkerThread. + WorkerFileSystemCallbacksBridge* m_bridge; const String m_mode; }; @@ -150,9 +152,9 @@ void WorkerFileSystemCallbacksBridge::stop() } } -void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, const String& mode) +void WorkerFileSystemCallbacksBridge::postOpenFileSystemToMainThread(WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, const String& mode) { - dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, this, mode)); + dispatchTaskToMainThread(createCallbackTask(&openFileSystemOnMainThread, commonClient, type, size, create, this, mode)); } void WorkerFileSystemCallbacksBridge::postMoveToMainThread(WebFileSystem* fileSystem, const String& sourcePath, const String& destinationPath, const String& mode) @@ -212,12 +214,12 @@ void WorkerFileSystemCallbacksBridge::postReadDirectoryToMainThread(WebFileSyste dispatchTaskToMainThread(createCallbackTask(&readDirectoryOnMainThread, fileSystem, path, this, mode)); } -void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, WorkerFileSystemCallbacksBridge* bridge, const String& mode) +void WorkerFileSystemCallbacksBridge::openFileSystemOnMainThread(ScriptExecutionContext*, WebCommonWorkerClient* commonClient, WebFileSystem::Type type, long long size, bool create, WorkerFileSystemCallbacksBridge* bridge, const String& mode) { if (!commonClient) bridge->didFailOnMainThread(WebFileErrorAbort, mode); else { - commonClient->openFileSystem(type, size, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); + commonClient->openFileSystem(type, size, create, MainThreadFileSystemCallbacks::createLeakedPtr(bridge, mode)); } } @@ -365,6 +367,7 @@ void WorkerFileSystemCallbacksBridge::runTaskOnWorkerThread(WebCore::ScriptExecu ASSERT(bridge->m_workerContext->isContextThread()); taskToRun->performTask(scriptExecutionContext); bridge->m_callbacksOnWorkerThread = 0; + bridge->stopObserving(); } void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task> task) @@ -379,12 +382,9 @@ void WorkerFileSystemCallbacksBridge::dispatchTaskToMainThread(PassOwnPtr<WebCor void WorkerFileSystemCallbacksBridge::mayPostTaskToWorker(PassOwnPtr<ScriptExecutionContext::Task> task, const String& mode) { ASSERT(isMainThread()); - { // Let go of the mutex before possibly deleting this due to m_selfRef.clear(). - MutexLocker locker(m_mutex); - if (m_worker) - m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef, task), mode); - } - m_selfRef.clear(); + MutexLocker locker(m_mutex); + if (m_worker) + m_worker->postTaskForModeToWorkerContext(createCallbackTask(&runTaskOnWorkerThread, m_selfRef.release(), task), mode); } } // namespace WebCore diff --git a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h index fa57f38..9a869dc 100644 --- a/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileSystemCallbacksBridge.h @@ -66,7 +66,7 @@ struct WebFileSystemEntry; // --> Bridge::didXxxOnWorkerThread is called on WorkerThread // This calls the original callbacks (m_callbacksOnWorkerThread) and // releases a self-reference to the bridge. -class WorkerFileSystemCallbacksBridge : public ThreadSafeShared<WorkerFileSystemCallbacksBridge>, public WebCore::WorkerContext::Observer { +class WorkerFileSystemCallbacksBridge : public ThreadSafeRefCounted<WorkerFileSystemCallbacksBridge>, public WebCore::WorkerContext::Observer { public: ~WorkerFileSystemCallbacksBridge(); @@ -84,7 +84,7 @@ public: } // Methods that create an instance and post an initial request task to the main thread. They must be called on the worker thread. - void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, const String& mode); + void postOpenFileSystemToMainThread(WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, const String& mode); void postMoveToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode); void postCopyToMainThread(WebFileSystem*, const String& srcPath, const String& destPath, const String& mode); void postRemoveToMainThread(WebFileSystem*, const String& path, const String& mode); @@ -107,7 +107,7 @@ private: WorkerFileSystemCallbacksBridge(WebWorkerBase*, WebCore::ScriptExecutionContext*, WebFileSystemCallbacks*); // Methods that are to be called on the main thread. - static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, WorkerFileSystemCallbacksBridge*, const String& mode); + static void openFileSystemOnMainThread(WebCore::ScriptExecutionContext*, WebCommonWorkerClient*, WebFileSystem::Type, long long size, bool create, WorkerFileSystemCallbacksBridge*, const String& mode); static void moveOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode); static void copyOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& srcPath, const String& destPath, WorkerFileSystemCallbacksBridge*, const String& mode); static void removeOnMainThread(WebCore::ScriptExecutionContext*, WebFileSystem*, const String& path, WorkerFileSystemCallbacksBridge*, const String& mode); @@ -138,7 +138,7 @@ private: void dispatchTaskToMainThread(PassOwnPtr<WebCore::ScriptExecutionContext::Task>); void mayPostTaskToWorker(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode); - // m_selfRef keeps a reference to itself until a task is created for the worker thread (at which point the task holds the reference). + // m_selfRef keeps a reference to itself while there's a pending callback on the main thread. RefPtr<WorkerFileSystemCallbacksBridge> m_selfRef; Mutex m_mutex; diff --git a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h index 62e333c..7e9795e 100644 --- a/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h +++ b/Source/WebKit/chromium/src/WorkerFileWriterCallbacksBridge.h @@ -38,7 +38,7 @@ #include "WorkerContext.h" #include <wtf/PassOwnPtr.h> #include <wtf/PassRefPtr.h> -#include <wtf/ThreadSafeShared.h> +#include <wtf/ThreadSafeRefCounted.h> namespace WebCore { class AsyncFileWriterClient; @@ -79,7 +79,7 @@ class WebWorkerBase; // should call postShutdownToMainThread before dropping its reference to the // bridge. This ensures that the WebFileWriter will be cleared on the main // thread and that no further calls to the WebFileWriterClient will be made. -class WorkerFileWriterCallbacksBridge : public ThreadSafeShared<WorkerFileWriterCallbacksBridge>, public WebCore::WorkerContext::Observer, public WebFileWriterClient { +class WorkerFileWriterCallbacksBridge : public ThreadSafeRefCounted<WorkerFileWriterCallbacksBridge>, public WebCore::WorkerContext::Observer, public WebFileWriterClient { public: ~WorkerFileWriterCallbacksBridge(); diff --git a/Source/WebKit/chromium/src/js/DevTools.js b/Source/WebKit/chromium/src/js/DevTools.js index 03c72d2..7a3eb8d 100644 --- a/Source/WebKit/chromium/src/js/DevTools.js +++ b/Source/WebKit/chromium/src/js/DevTools.js @@ -48,7 +48,6 @@ var context = {}; // Used by WebCore's inspector routines. Preferences.onlineDetectionEnabled = false; Preferences.nativeInstrumentationEnabled = true; Preferences.fileSystemEnabled = false; - Preferences.resourceExportEnabled = true; Preferences.showTimingTab = true; Preferences.showCookiesTab = true; })(); diff --git a/Source/WebKit/chromium/src/js/Images/segmentChromium.png b/Source/WebKit/chromium/src/js/Images/segmentChromium.png Binary files differindex f4248e1..a636820 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png b/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png Binary files differindex 0a743d9..0510773 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentHoverChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png b/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png Binary files differindex cf62072..91be9db 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentHoverEndChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png b/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png Binary files differindex a1f7251..9df447b 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentSelectedChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png b/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png Binary files differindex 07641db..abe8db8 100755 --- a/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png +++ b/Source/WebKit/chromium/src/js/Images/segmentSelectedEndChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png Binary files differindex 7a760c1..b5a780f 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarBackgroundChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png Binary files differindex e3bc944..531a3ef 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarBottomBackgroundChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png Binary files differindex 5ff61d9..c8fbd45 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonChromium.png diff --git a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png Binary files differindex 3c0aeec..668070d 100755 --- a/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png +++ b/Source/WebKit/chromium/src/js/Images/statusbarMenuButtonSelectedChromium.png diff --git a/Source/WebKit/chromium/tests/PopupMenuTest.cpp b/Source/WebKit/chromium/tests/PopupMenuTest.cpp index acfcda5..8c53ffc 100644 --- a/Source/WebKit/chromium/tests/PopupMenuTest.cpp +++ b/Source/WebKit/chromium/tests/PopupMenuTest.cpp @@ -181,7 +181,7 @@ public: protected: virtual void SetUp() { - m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient, 0, 0)); + m_webView = static_cast<WebViewImpl*>(WebView::create(&m_webviewClient)); m_webView->initializeMainFrame(&m_webFrameClient); m_popupMenu = adoptRef(new PopupMenuChromium(&m_popupMenuClient)); } diff --git a/Source/WebKit/chromium/tests/TilingDataTest.cpp b/Source/WebKit/chromium/tests/TilingDataTest.cpp index ec18f01..a41f7fe 100755 --- a/Source/WebKit/chromium/tests/TilingDataTest.cpp +++ b/Source/WebKit/chromium/tests/TilingDataTest.cpp @@ -331,4 +331,56 @@ TEST(TilingDataTest, tileSizeY_and_tilePositionY) EXPECT_EQ(4, TilingData(3, 100, 6, true).tilePositionY(3)); } +TEST(TilingDataTest, setTotalSize) +{ + TilingData data(5, 5, 5, false); + EXPECT_EQ(5, data.totalSizeX()); + EXPECT_EQ(5, data.totalSizeY()); + EXPECT_EQ(1, data.numTilesX()); + EXPECT_EQ(5, data.tileSizeX(0)); + EXPECT_EQ(1, data.numTilesY()); + EXPECT_EQ(5, data.tileSizeY(0)); + + data.setTotalSize(6, 5); + EXPECT_EQ(6, data.totalSizeX()); + EXPECT_EQ(5, data.totalSizeY()); + EXPECT_EQ(2, data.numTilesX()); + EXPECT_EQ(5, data.tileSizeX(0)); + EXPECT_EQ(1, data.tileSizeX(1)); + EXPECT_EQ(1, data.numTilesY()); + EXPECT_EQ(5, data.tileSizeY(0)); + + data.setTotalSize(5, 12); + EXPECT_EQ(5, data.totalSizeX()); + EXPECT_EQ(12, data.totalSizeY()); + EXPECT_EQ(1, data.numTilesX()); + EXPECT_EQ(5, data.tileSizeX(0)); + EXPECT_EQ(3, data.numTilesY()); + EXPECT_EQ(5, data.tileSizeY(0)); + EXPECT_EQ(5, data.tileSizeY(1)); + EXPECT_EQ(2, data.tileSizeY(2)); +} + +TEST(TilingDataTest, setMaxTextureSize) +{ + TilingData data(8, 16, 32, false); + EXPECT_EQ(2, data.numTilesX()); + EXPECT_EQ(4, data.numTilesY()); + + data.setMaxTextureSize(32); + EXPECT_EQ(32, data.maxTextureSize()); + EXPECT_EQ(1, data.numTilesX()); + EXPECT_EQ(1, data.numTilesY()); + + data.setMaxTextureSize(2); + EXPECT_EQ(2, data.maxTextureSize()); + EXPECT_EQ(8, data.numTilesX()); + EXPECT_EQ(16, data.numTilesY()); + + data.setMaxTextureSize(5); + EXPECT_EQ(5, data.maxTextureSize()); + EXPECT_EQ(4, data.numTilesX()); + EXPECT_EQ(7, data.numTilesY()); +} + } // namespace diff --git a/Source/WebKit/chromium/tests/WebFrameTest.cpp b/Source/WebKit/chromium/tests/WebFrameTest.cpp index 7342721..891fa83 100644 --- a/Source/WebKit/chromium/tests/WebFrameTest.cpp +++ b/Source/WebKit/chromium/tests/WebFrameTest.cpp @@ -28,6 +28,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "config.h" + #include <googleurl/src/gurl.h> #include <gtest/gtest.h> #include <webkit/support/webkit_support.h> @@ -85,7 +87,7 @@ TEST_F(WebFrameTest, ContentText) // Create and initialize the WebView. TestWebFrameClient webFrameClient; - WebView* webView = WebView::create(0, 0, 0); + WebView* webView = WebView::create(0); webView->initializeMainFrame(&webFrameClient); // Load the main frame URL. diff --git a/Source/WebKit/chromium/tests/WebPageSerializerTest.cpp b/Source/WebKit/chromium/tests/WebPageSerializerTest.cpp new file mode 100644 index 0000000..1416882 --- /dev/null +++ b/Source/WebKit/chromium/tests/WebPageSerializerTest.cpp @@ -0,0 +1,193 @@ +/* + * Copyright (C) 2011 Google Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" +#include "WebPageSerializer.h" + +#include "WebFrame.h" +#include "WebFrameClient.h" +#include "WebString.h" +#include "WebURL.h" +#include "WebURLRequest.h" +#include "WebURLResponse.h" +#include "WebView.h" + +#include <googleurl/src/gurl.h> +#include <gtest/gtest.h> +#include <webkit/support/webkit_support.h> + +using namespace WebKit; + +namespace { + +class TestWebFrameClient : public WebFrameClient { +}; + +class WebPageSerializerTest : public testing::Test { +public: + WebPageSerializerTest() : m_webView(0), m_supportedSchemes(3U) + { + m_supportedSchemes[0] = "http"; + m_supportedSchemes[1] = "https"; + m_supportedSchemes[2] = "file"; + } + +protected: + virtual void SetUp() + { + // Create and initialize the WebView. + m_webView = WebView::create(0); + m_webView->initializeMainFrame(&m_webFrameClient); + } + + virtual void TearDown() + { + webkit_support::UnregisterAllMockedURLs(); + m_webView->close(); + } + + void registerMockedURLLoad(const WebURL& url, const WebString& fileName) + { + WebURLResponse response; + response.initialize(); + response.setMIMEType("text/html"); + std::string filePath = webkit_support::GetWebKitRootDir().utf8(); + filePath.append("/Source/WebKit/chromium/tests/data/pageserialization/"); + filePath.append(fileName.utf8()); + webkit_support::RegisterMockedURL(url, response, WebString::fromUTF8(filePath)); + } + + void loadURLInTopFrame(const GURL& url) + { + WebURLRequest urlRequest; + urlRequest.initialize(); + urlRequest.setURL(WebURL(url)); + m_webView->mainFrame()->loadRequest(urlRequest); + // Make sure any pending request get served. + webkit_support::ServeAsynchronousMockedRequests(); + } + + static bool webVectorContains(const WebVector<WebURL>& vector, char* url) + { + return vector.contains(WebURL(GURL(url))); + } + + // Useful for debugging. + static void printWebURLs(const WebVector<WebURL>& urls) + { + for (size_t i = 0; i < urls.size(); i++) + printf("%s\n", urls[i].spec().data()); + } + + WebView* m_webView; + WebVector<WebCString> m_supportedSchemes; + +private: + TestWebFrameClient m_webFrameClient; +}; + +TEST_F(WebPageSerializerTest, HTMLNodes) +{ + // Register the mocked frame and load it. + WebURL topFrameURL = GURL("http://www.test.com"); + registerMockedURLLoad(topFrameURL, WebString::fromUTF8("simple_page.html")); + loadURLInTopFrame(topFrameURL); + + // Retrieve all resources. + WebVector<WebURL> frames; + WebVector<WebURL> resources; + ASSERT_TRUE(WebPageSerializer::retrieveAllResources( + m_webView, m_supportedSchemes, &resources, &frames)); + + // Tests that all resources from the frame have been retrieved. + EXPECT_EQ(1, frames.size()); // There should be no duplicates. + EXPECT_TRUE(webVectorContains(frames, "http://www.test.com")); + + EXPECT_EQ(14, resources.size()); // There should be no duplicates. + EXPECT_TRUE(webVectorContains(resources, "http://www.example.com/beautifull.css")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/awesome.js")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/bodyBackground.jpg")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/awesome.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/imageButton.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/tableBackground.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/trBackground.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/tdBackground.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.evene.fr/citations/auteur.php?ida=46")); + EXPECT_TRUE(webVectorContains(resources, "http://www.brainyquote.com/quotes/authors/c/charles_darwin.html")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/why_deleted.html")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/why_inserted.html")); + EXPECT_TRUE(webVectorContains(resources, "https://www.secure.com/https.gif")); + EXPECT_TRUE(webVectorContains(resources, "file://c/my_folder/file.gif")); +} + +TEST_F(WebPageSerializerTest, MultipleFrames) +{ + // Register the mocked frames. + WebURL topFrameURL = GURL("http://www.test.com"); + registerMockedURLLoad(topFrameURL, WebString::fromUTF8("top_frame.html")); + registerMockedURLLoad(GURL("http://www.test.com/simple_iframe.html"), + WebString::fromUTF8("simple_iframe.html")); + registerMockedURLLoad(GURL("http://www.test.com/object_iframe.html"), + WebString::fromUTF8("object_iframe.html")); + registerMockedURLLoad(GURL("http://www.test.com/embed_iframe.html"), + WebString::fromUTF8("embed_iframe.html")); + // If we don't register a mocked resource for awesome.png, it causes the + // document loader of the iframe that has it as its src to assert on close, + // not sure why. + registerMockedURLLoad(GURL("http://www.test.com/awesome.png"), + WebString::fromUTF8("awesome.png")); + + loadURLInTopFrame(topFrameURL); + + // Retrieve all resources. + WebVector<WebURL> frames; + WebVector<WebURL> resources; + ASSERT_TRUE(WebPageSerializer::retrieveAllResources( + m_webView, m_supportedSchemes, &resources, &frames)); + + // Tests that all resources from the frame have been retrieved. + EXPECT_EQ(4, frames.size()); // There should be no duplicates. + EXPECT_TRUE(webVectorContains(frames, "http://www.test.com")); + EXPECT_TRUE(webVectorContains(frames, "http://www.test.com/simple_iframe.html")); + EXPECT_TRUE(webVectorContains(frames, "http://www.test.com/object_iframe.html")); + EXPECT_TRUE(webVectorContains(frames, "http://www.test.com/embed_iframe.html")); + + EXPECT_EQ(5, resources.size()); // There should be no duplicates. + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/awesome.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/innerFrame.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/flash.swf")); + // FIXME: for some reason the following resources is missing on one of the bot + // causing the test to fail. Probably a plugin issue. + // EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/music.mid")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/object.png")); + EXPECT_TRUE(webVectorContains(resources, "http://www.test.com/embed.png")); +} + +} diff --git a/Source/WebKit/chromium/tests/data/pageserialization/awesome.png b/Source/WebKit/chromium/tests/data/pageserialization/awesome.png new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/awesome.png @@ -0,0 +1 @@ + diff --git a/Source/WebKit/chromium/tests/data/pageserialization/embed_iframe.html b/Source/WebKit/chromium/tests/data/pageserialization/embed_iframe.html new file mode 100644 index 0000000..174a8a9 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/embed_iframe.html @@ -0,0 +1,5 @@ +<html> + +<img src="embed.png"/> + +</html> diff --git a/Source/WebKit/chromium/tests/data/pageserialization/object_iframe.html b/Source/WebKit/chromium/tests/data/pageserialization/object_iframe.html new file mode 100644 index 0000000..662bc5f --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/object_iframe.html @@ -0,0 +1,5 @@ +<html> + +<img src="object.png"/> + +</html> diff --git a/Source/WebKit/chromium/tests/data/pageserialization/simple_iframe.html b/Source/WebKit/chromium/tests/data/pageserialization/simple_iframe.html new file mode 100644 index 0000000..65dca17 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/simple_iframe.html @@ -0,0 +1,14 @@ +<html> +<!-- + This page is used to test that WebPageSerializer::retrieveAllResources retrieves + correctly the expected resources when dealing with multiple frames. +--> + +<body> + +<img src="awesome.png"/> +<img src="innerFrame.png"/> + +</body> + +</html> diff --git a/Source/WebKit/chromium/tests/data/pageserialization/simple_page.html b/Source/WebKit/chromium/tests/data/pageserialization/simple_page.html new file mode 100644 index 0000000..66d09e1 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/simple_page.html @@ -0,0 +1,50 @@ +<html> +<!-- + This page is used to test that WebPageSerializer::retrieveAllResources retrieves + correctly the expected resources from various HTML nodes. +--> + +<head> +<!-- Style sheet links should be retrieved --> +<link rel="stylesheet" type="text/css" href="http://www.example.com/beautifull.css"/> +<!-- Other link should NOT be retrieved --> +<link rel="copyright" type="text/plain" href="http://www.example.com/copyright"/> +<!-- Scripts should be retrieved --> +<script src="awesome.js"></script> +</head> + +<!-- Images are always retrieved --> +<body background="bodyBackground.jpg"> + +<!-- Twice to make sure we only report each resource once --> +<img src="awesome.png"/> +<img src="awesome.png"/> + +<form> + <input type="image" src="imageButton.png"/> +</form> + +<table background="tableBackground.png"> + <tr background="trBackground.png"> + <td background="tdBackground.png"></td> + </tr> + <tr background="trBackground.png"> + <td background="tdBackground.png"></td> + </tr> +</table> + +<!-- Some more obscure tags --> +<blockquote cite="http://www.evene.fr/citations/auteur.php?ida=46"></blockquote> +<q CITE="http://www.brainyquote.com/quotes/authors/c/charles_darwin.html"></q> +<p>My favorite color is <del cite="why_deleted.html">blue</del> <ins>red</ins>!</p> +<p>My favorite color is <del>blue</del> <ins cite="why_inserted.html">red</ins>!</p> + +<!-- Make sure we only retrieve URLs with the right schemes --> +<img src="https://www.secure.com/https.gif"/> <!-- HTTPS is OK --> +<img src="file://c/my_folder/file.gif"/> <!-- file is OK --> +<img src="ftp://ftp.com/ftp.gif"/> <!-- FTP is not OK --> +<img src="unknown://unkown.com/unknown.gif"/> <!-- Unknown schemes are not OK --> + +</body> + +</html> diff --git a/Source/WebKit/chromium/tests/data/pageserialization/top_frame.html b/Source/WebKit/chromium/tests/data/pageserialization/top_frame.html new file mode 100755 index 0000000..edc8ab2 --- /dev/null +++ b/Source/WebKit/chromium/tests/data/pageserialization/top_frame.html @@ -0,0 +1,28 @@ +<html> +<!-- + This page is used to test that WebPageSerializer::retrieveAllResources retrieves + correctly the expected resources when dealing with multiple frames. +--> + +<body> + +<!-- Resources used by a frame and a tag should be only reported once --> +<iframe src="awesome.png"></iframe> +<img src="awesome.png"/> + +<iframe src="simple_iframe.html"></iframe> +<iframe src="simple_iframe.html"></iframe> + +<!-- Object tags can be used to create iframes --> + +<object data="object_iframe.html"></object> +<object data="flash.swf"></object> + +<!-- Embed tags can be used to create iframes as well --> +<embed src="embed_iframe.html"></object> +<!-- +<embed src="music.mid"></embed> +--> +</body> + +</html> |