diff options
author | Ben Murdoch <benm@google.com> | 2013-07-26 10:21:05 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2013-07-26 10:21:05 +0100 |
commit | 02772c6a72f1ee0b226341a4f4439970c29fc861 (patch) | |
tree | af72440e6f1c348a109699acc99126ea98beadf6 /Source/web | |
parent | 8927772a2075f976427f8b8e86881055b8fae6ce (diff) | |
download | WebKit-02772c6a72f1ee0b226341a4f4439970c29fc861.tar.gz |
Merge from Chromium at DEPS revision r213780
This commit was generated by merge_to_master.py.
Change-Id: I702915ad75bd2cc5201b0239db771978b0a8137d
Diffstat (limited to 'Source/web')
28 files changed, 124 insertions, 64 deletions
diff --git a/Source/web/ApplicationCacheHostInternal.h b/Source/web/ApplicationCacheHostInternal.h index 5225ded81..81ce9819f 100644 --- a/Source/web/ApplicationCacheHostInternal.h +++ b/Source/web/ApplicationCacheHostInternal.h @@ -59,7 +59,7 @@ public: m_innerHost->notifyDOMApplicationCache(static_cast<ApplicationCacheHost::EventID>(eventID), 0, 0); } - virtual void notifyProgressEventListener(const WebKit::WebURL&, int progressTotal, int progressDone) + virtual void notifyProgressEventListener(const WebKit::WebURL&, int progressTotal, int progressDone) { m_innerHost->notifyDOMApplicationCache(ApplicationCacheHost::PROGRESS_EVENT, progressTotal, progressDone); } diff --git a/Source/web/AssociatedURLLoader.cpp b/Source/web/AssociatedURLLoader.cpp index 56a1f2fcf..ccf03cb17 100644 --- a/Source/web/AssociatedURLLoader.cpp +++ b/Source/web/AssociatedURLLoader.cpp @@ -151,7 +151,7 @@ public: void enableErrorNotifications(); // Stops loading and releases the DocumentThreadableLoader as early as possible. - void clearClient() { m_client = 0; } + void clearClient() { m_client = 0; } private: ClientAdapter(AssociatedURLLoader*, WebURLLoaderClient*, const WebURLLoaderOptions&); diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp index 82a1b0d82..d2509cb75 100644 --- a/Source/web/ChromeClientImpl.cpp +++ b/Source/web/ChromeClientImpl.cpp @@ -1002,9 +1002,9 @@ NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* we } void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) -{ +{ m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); -} +} #endif } // namespace WebKit diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp index cf87198f3..aeca1fcab 100644 --- a/Source/web/ContextMenuClientImpl.cpp +++ b/Source/web/ContextMenuClientImpl.cpp @@ -316,7 +316,7 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM m_webView->spellCheckClient()->spellCheck(data.misspelledWord, misspelledOffset, misspelledLength, &data.dictionarySuggestions); } } else { - data.isSpellCheckingEnabled = + data.isSpellCheckingEnabled = m_webView->focusedWebCoreFrame()->editor()->isContinuousSpellCheckingEnabled(); // Spellchecking might be enabled for the field, but could be disabled on the node. if (m_webView->focusedWebCoreFrame()->editor()->isSpellCheckingEnabledInFocusedNode()) { diff --git a/Source/web/MIDIClientImpl.cpp b/Source/web/MIDIClientImpl.cpp index eef236f8a..70369bf44 100644 --- a/Source/web/MIDIClientImpl.cpp +++ b/Source/web/MIDIClientImpl.cpp @@ -52,7 +52,7 @@ void MIDIClientImpl::requestSysExPermission(PassRefPtr<MIDIAccess> access) if (m_client) m_client->requestSysExPermission(WebMIDIPermissionRequest(access)); else - access->enableSysEx(false); + access->setSysExEnabled(false); } void MIDIClientImpl::cancelSysExPermissionRequest(MIDIAccess* access) diff --git a/Source/web/WebAccessibilityObject.cpp b/Source/web/WebAccessibilityObject.cpp index 2f64d055c..02d71810b 100644 --- a/Source/web/WebAccessibilityObject.cpp +++ b/Source/web/WebAccessibilityObject.cpp @@ -684,7 +684,7 @@ WebURL WebAccessibilityObject::url() const { if (isDetached()) return WebURL(); - + return m_private->url(); } diff --git a/Source/web/WebDOMActivityLogger.cpp b/Source/web/WebDOMActivityLogger.cpp index 7d7fbac10..d69d7a0e6 100644 --- a/Source/web/WebDOMActivityLogger.cpp +++ b/Source/web/WebDOMActivityLogger.cpp @@ -48,8 +48,8 @@ public: } virtual void log(const String& apiName, int argc, const v8::Handle<v8::Value>* argv, const String& extraInfo) - { - m_domActivityLogger->log(WebString(apiName), argc, argv, WebString(extraInfo)); + { + m_domActivityLogger->log(WebString(apiName), argc, argv, WebString(extraInfo)); } private: diff --git a/Source/web/WebFontImpl.cpp b/Source/web/WebFontImpl.cpp index c8ec94bbd..59f06ff04 100644 --- a/Source/web/WebFontImpl.cpp +++ b/Source/web/WebFontImpl.cpp @@ -153,7 +153,7 @@ WebRect WebFontImpl::estimateTextBounds(const WebTextRun& run, const WebFloatPoi return WebRect(leftBaseline.x - (fontMetrics.ascent() + fontMetrics.descent()) / 2, leftBaseline.y - fontMetrics.ascent() - fontMetrics.lineGap(), totalWidth + fontMetrics.ascent() + fontMetrics.descent(), - fontMetrics.lineSpacing()); + fontMetrics.lineSpacing()); } } // namespace WebKit diff --git a/Source/web/WebFrameImpl.cpp b/Source/web/WebFrameImpl.cpp index 7fa22c843..e7ce6efff 100644 --- a/Source/web/WebFrameImpl.cpp +++ b/Source/web/WebFrameImpl.cpp @@ -2212,7 +2212,7 @@ void WebFrameImpl::createFrameView() if (isMainFrame) webView->suppressInvalidations(true); - frame()->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0); + frame()->createView(webView->size(), webView->baseBackgroundColor(), webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0); if (webView->shouldAutoResize() && isMainFrame) frame()->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize()); diff --git a/Source/web/WebHelperPluginImpl.cpp b/Source/web/WebHelperPluginImpl.cpp index 8eb199a2f..5a0592904 100644 --- a/Source/web/WebHelperPluginImpl.cpp +++ b/Source/web/WebHelperPluginImpl.cpp @@ -92,7 +92,7 @@ private: { // This should never be called since the only way to close the // invisible page is via closeHelperPlugin(). - ASSERT_NOT_REACHED(); + ASSERT_NOT_REACHED(); m_widget->closeHelperPlugin(); } diff --git a/Source/web/WebInputEvent.cpp b/Source/web/WebInputEvent.cpp index ee4309159..5b810249b 100644 --- a/Source/web/WebInputEvent.cpp +++ b/Source/web/WebInputEvent.cpp @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 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 @@ -14,7 +14,7 @@ * * 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 diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp index 6e21fb8a8..b61f9ad7e 100644 --- a/Source/web/WebInputEventConversion.cpp +++ b/Source/web/WebInputEventConversion.cpp @@ -124,7 +124,7 @@ PlatformWheelEventBuilder::PlatformWheelEventBuilder(Widget* widget, const WebMo m_wheelTicksY = e.wheelTicksY; m_granularity = e.scrollByPage ? ScrollByPageWheelEvent : ScrollByPixelWheelEvent; - + m_type = PlatformEvent::Wheel; m_modifiers = 0; diff --git a/Source/web/WebMIDIPermissionRequest.cpp b/Source/web/WebMIDIPermissionRequest.cpp index 2e82e9534..8d663aa66 100644 --- a/Source/web/WebMIDIPermissionRequest.cpp +++ b/Source/web/WebMIDIPermissionRequest.cpp @@ -67,7 +67,7 @@ WebSecurityOrigin WebMIDIPermissionRequest::securityOrigin() const void WebMIDIPermissionRequest::setIsAllowed(bool allowed) { - m_private->enableSysEx(allowed); + m_private->setSysExEnabled(allowed); } } // namespace WebKit diff --git a/Source/web/WebPageSerializer.cpp b/Source/web/WebPageSerializer.cpp index 0a9e5922c..7ca6d8a89 100644 --- a/Source/web/WebPageSerializer.cpp +++ b/Source/web/WebPageSerializer.cpp @@ -99,7 +99,7 @@ KURL getSubResourceURLFromElement(Element* element) // Ignore javascript content. if (value.isEmpty() || value.stripWhiteSpace().startsWith("javascript:", false)) return KURL(); - + return element->document()->completeURL(value); } @@ -164,7 +164,7 @@ void retrieveResourcesForFrame(Frame* frame, visitedFrames->append(frame); if (!frameURLs->contains(frameURL)) frameURLs->append(frameURL); - + // Now get the resources associated with each node of the document. RefPtr<HTMLCollection> allNodes = frame->document()->all(); for (unsigned i = 0; i < allNodes->length(); ++i) { @@ -198,7 +198,7 @@ void WebPageSerializer::serialize(WebView* view, WebVector<WebPageSerializer::Re result.append(resource); } - *resourcesParam = result; + *resourcesParam = result; } static PassRefPtr<SharedBuffer> serializePageToMHTML(Page* page, MHTMLArchive::EncodingPolicy encodingPolicy) @@ -248,7 +248,7 @@ bool WebPageSerializer::retrieveAllResources(WebView* view, 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()) { @@ -274,7 +274,7 @@ bool WebPageSerializer::retrieveAllResources(WebView* view, for (size_t i = 0; i < frameKURLs.size(); ++i) resultFrameURLs[i] = frameKURLs[i]; *frameURLs = resultFrameURLs; - + return true; } diff --git a/Source/web/WebPageSerializerImpl.cpp b/Source/web/WebPageSerializerImpl.cpp index 0ce48995d..41aa2ba99 100644 --- a/Source/web/WebPageSerializerImpl.cpp +++ b/Source/web/WebPageSerializerImpl.cpp @@ -285,7 +285,7 @@ void WebPageSerializerImpl::encodeAndFlushBuffer( String content = m_dataBuffer.toString(); m_dataBuffer.clear(); - CString encodedContent = param->textEncoding.encode(content, WTF::EntitiesForUnencodables); + CString encodedContent = param->textEncoding.normalizeAndEncode(content, WTF::EntitiesForUnencodables); // Send result to the client. m_client->didSerializeDataForFrame(param->url, @@ -327,7 +327,7 @@ void WebPageSerializerImpl::openTagToString(Element* element, else { // Get the absolute link WebFrameImpl* subFrame = WebFrameImpl::fromFrameOwnerElement(element); - String completeURL = subFrame ? subFrame->frame()->document()->url() : + String completeURL = subFrame ? subFrame->frame()->document()->url() : param->document->completeURL(attrValue); // Check whether we have local files for those link. if (m_localLinks.contains(completeURL)) { diff --git a/Source/web/WebScopedMicrotaskSuppression.cpp b/Source/web/WebScopedMicrotaskSuppression.cpp index 53844ce68..f4773a781 100644 --- a/Source/web/WebScopedMicrotaskSuppression.cpp +++ b/Source/web/WebScopedMicrotaskSuppression.cpp @@ -1,10 +1,10 @@ /* * Copyright (C) 2009 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 @@ -14,7 +14,7 @@ * * 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 diff --git a/Source/web/WebSearchableFormData.cpp b/Source/web/WebSearchableFormData.cpp index 31bd3ca68..08a51d460 100644 --- a/Source/web/WebSearchableFormData.cpp +++ b/Source/web/WebSearchableFormData.cpp @@ -149,10 +149,10 @@ bool IsInDefaultState(HTMLFormControlElement* formElement) return true; } -// Look for a suitable search text field in a given HTMLFormElement +// Look for a suitable search text field in a given HTMLFormElement // Return nothing if one of those items are found: // - A text area field -// - A file upload field +// - A file upload field // - A Password field // - More than one text field HTMLInputElement* findSuitableSearchInputElement(const HTMLFormElement* form) @@ -192,14 +192,14 @@ HTMLInputElement* findSuitableSearchInputElement(const HTMLFormElement* form) } // Build a search string based on a given HTMLFormElement and HTMLInputElement -// +// // Search string output example from www.google.com: // "hl=en&source=hp&biw=1085&bih=854&q={searchTerms}&btnG=Google+Search&aq=f&aqi=&aql=&oq=" -// +// // Return false if the provided HTMLInputElement is not found in the form bool buildSearchString(const HTMLFormElement* form, Vector<char>* encodedString, WTF::TextEncoding* encoding, const HTMLInputElement* textElement) { - bool isElementFound = false; + bool isElementFound = false; // FIXME: Consider refactoring this code so that we don't call form->associatedElements() twice. for (Vector<FormAssociatedElement*>::const_iterator i(form->associatedElements().begin()); i != form->associatedElements().end(); ++i) { @@ -246,8 +246,8 @@ WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W HTMLInputElement* inputElement = selectedInputElement.operator PassRefPtr<HTMLInputElement>().get(); // Only consider forms that GET data. - // Allow HTTPS only when an input element is provided. - if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") + // Allow HTTPS only when an input element is provided. + if (equalIgnoringCase(formElement->getAttribute(methodAttr), "post") || (!IsHTTPFormSubmit(formElement.get()) && !inputElement)) return; @@ -260,9 +260,9 @@ WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W // If the encoding isn't found webkit ends up replacing the params with // empty strings. So, we don't try to do anything here. return; - } + } - // Look for a suitable search text field in the form when a + // Look for a suitable search text field in the form when a // selectedInputElement is not provided. if (!inputElement) { inputElement = findSuitableSearchInputElement(formElement.get()); @@ -285,7 +285,7 @@ WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W if (firstSubmitButton) firstSubmitButton->setActivatedSubmit(false); - // Return if the search string is not valid. + // Return if the search string is not valid. if (!isValidSearchString) return; @@ -294,7 +294,7 @@ WebSearchableFormData::WebSearchableFormData(const WebFormElement& form, const W RefPtr<FormData> formData = FormData::create(encodedString); url.setQuery(formData->flattenToString()); m_url = url; - m_encoding = String(encoding.name()); + m_encoding = String(encoding.name()); } } // namespace WebKit diff --git a/Source/web/WebTestingSupport.cpp b/Source/web/WebTestingSupport.cpp index 78455ffcd..f74f9f0a1 100644 --- a/Source/web/WebTestingSupport.cpp +++ b/Source/web/WebTestingSupport.cpp @@ -22,7 +22,7 @@ * (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 "WebTestingSupport.h" diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp index dcad19b35..0b84acfcf 100644 --- a/Source/web/WebViewImpl.cpp +++ b/Source/web/WebViewImpl.cpp @@ -87,6 +87,7 @@ #include "WebSettingsImpl.h" #include "WebTextInputInfo.h" #include "WebViewClient.h" +#include "WebWindowFeatures.h" #include "core/accessibility/AXObjectCache.h" #include "core/css/resolver/StyleResolver.h" #include "core/dom/Document.h" @@ -427,6 +428,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client) , m_showDebugBorders(false) , m_continuousPaintingEnabled(false) , m_showScrollBottleneckRects(false) + , m_baseBackgroundColor(Color::white) { Page::PageClients pageClients; pageClients.chromeClient = &m_chromeClientImpl; @@ -1833,7 +1835,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions opt FrameView* view = page()->mainFrame()->view(); PaintBehavior oldPaintBehavior = view->paintBehavior(); if (isAcceleratedCompositingActive()) { - ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); + ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); view->setPaintBehavior(oldPaintBehavior | PaintBehaviorFlattenCompositingLayers); } @@ -1845,7 +1847,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect, PaintOptions opt WebKit::Platform::current()->histogramCustomCounts("Renderer4.SoftwarePaintMegapixPerSecond", pixelsPerSec / 1000000, 10, 210, 30); if (isAcceleratedCompositingActive()) { - ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); + ASSERT(option == ForceSoftwareRenderingAndIgnoreGPUResidentContent); view->setPaintBehavior(oldPaintBehavior); } } @@ -2461,11 +2463,11 @@ WebColor WebViewImpl::backgroundColor() const if (isTransparent()) return Color::transparent; if (!m_page) - return Color::white; + return m_baseBackgroundColor; FrameView* view = m_page->mainFrame()->view(); StyleColor backgroundColor = view->documentBackgroundColor(); if (!backgroundColor.isValid()) - return Color::white; + return m_baseBackgroundColor; return backgroundColor.rgb(); } @@ -3383,6 +3385,9 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo void WebViewImpl::sendResizeEventAndRepaint() { + // FIXME: This is wrong. The FrameView is responsible sending a resizeEvent + // as part of layout. Layout is also responsible for sending invalidations + // to the embedder. This method and all callers may be wrong. -- eseidel. if (mainFrameImpl()->frameView()) { // Enqueues the resize event. mainFrameImpl()->frame()->eventHandler()->sendResizeEvent(); @@ -3578,6 +3583,19 @@ bool WebViewImpl::isTransparent() const return m_isTransparent; } +void WebViewImpl::setBaseBackgroundColor(WebColor color) +{ + if (m_baseBackgroundColor == color) + return; + + m_baseBackgroundColor = color; + + m_page->mainFrame()->view()->setBaseBackgroundColor(color); + + if (m_layerTreeView) + m_layerTreeView->setBackgroundColor(backgroundColor()); +} + void WebViewImpl::setIsActive(bool active) { if (page() && page()->focusController()) @@ -3594,6 +3612,11 @@ void WebViewImpl::setDomainRelaxationForbidden(bool forbidden, const WebString& SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, String(scheme)); } +void WebViewImpl::setWindowFeatures(const WebWindowFeatures& features) +{ + m_page->chrome().setWindowFeatures(features); +} + void WebViewImpl::setScrollbarColors(unsigned inactiveColor, unsigned activeColor, unsigned trackColor) { diff --git a/Source/web/WebViewImpl.h b/Source/web/WebViewImpl.h index 303f7c443..50d50c520 100644 --- a/Source/web/WebViewImpl.h +++ b/Source/web/WebViewImpl.h @@ -198,6 +198,7 @@ public: virtual void setPageEncoding(const WebString& encoding); virtual bool isTransparent() const; virtual void setIsTransparent(bool value); + virtual void setBaseBackgroundColor(WebColor); virtual bool tabsToLinks() const; virtual void setTabsToLinks(bool value); virtual bool tabKeyCyclesThroughElements() const; @@ -205,6 +206,7 @@ public: virtual bool isActive() const; virtual void setIsActive(bool value); virtual void setDomainRelaxationForbidden(bool, const WebString& scheme); + virtual void setWindowFeatures(const WebWindowFeatures&); virtual bool dispatchBeforeUnloadEvent(); virtual void dispatchUnloadEvent(); virtual WebFrame* mainFrame(); @@ -324,6 +326,8 @@ public: void setIgnoreInputEvents(bool newValue); WebDevToolsAgentPrivate* devToolsAgentPrivate() { return m_devToolsAgent.get(); } + WebCore::Color baseBackgroundColor() const { return m_baseBackgroundColor; } + PageOverlayList* pageOverlays() const { return m_pageOverlays.get(); } void setOverlayLayer(WebCore::GraphicsLayer*); @@ -833,6 +837,7 @@ private: bool m_showDebugBorders; bool m_continuousPaintingEnabled; bool m_showScrollBottleneckRects; + WebColor m_baseBackgroundColor; }; } // namespace WebKit diff --git a/Source/web/WebWorkerInfo.cpp b/Source/web/WebWorkerInfo.cpp index 3ad0f4a3b..896ea6721 100644 --- a/Source/web/WebWorkerInfo.cpp +++ b/Source/web/WebWorkerInfo.cpp @@ -35,7 +35,7 @@ namespace WebKit { -unsigned WebWorkerInfo::dedicatedWorkerCount() +unsigned WebWorkerInfo::dedicatedWorkerCount() { return WebCore::WorkerThread::workerThreadCount(); } diff --git a/Source/web/WorkerAsyncFileWriterChromium.h b/Source/web/WorkerAsyncFileWriterChromium.h index b52d18ee2..96ebd354a 100644 --- a/Source/web/WorkerAsyncFileWriterChromium.h +++ b/Source/web/WorkerAsyncFileWriterChromium.h @@ -65,7 +65,7 @@ public: return adoptPtr(new WorkerAsyncFileWriterChromium(webFileSystem, path, workerGlobalScope, client, type)); } ~WorkerAsyncFileWriterChromium(); - + bool waitForOperationToComplete(); // FileWriter diff --git a/Source/web/WorkerFileWriterCallbacksBridge.cpp b/Source/web/WorkerFileWriterCallbacksBridge.cpp index 159cbc6ce..96aaa3344 100644 --- a/Source/web/WorkerFileWriterCallbacksBridge.cpp +++ b/Source/web/WorkerFileWriterCallbacksBridge.cpp @@ -62,7 +62,7 @@ void WorkerFileWriterCallbacksBridge::postWriteToMainThread(long long position, { ASSERT(!m_operationInProgress); m_operationInProgress = true; - dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, + dispatchTaskToMainThread(createCallbackTask(&writeOnMainThread, this, position, data)); } @@ -70,7 +70,7 @@ void WorkerFileWriterCallbacksBridge::postTruncateToMainThread(long long length) { ASSERT(!m_operationInProgress); m_operationInProgress = true; - dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, + dispatchTaskToMainThread(createCallbackTask(&truncateOnMainThread, this, length)); } diff --git a/Source/web/tests/IDBBindingUtilitiesTest.cpp b/Source/web/tests/IDBBindingUtilitiesTest.cpp index 41dc1ab09..d033c93df 100644 --- a/Source/web/tests/IDBBindingUtilitiesTest.cpp +++ b/Source/web/tests/IDBBindingUtilitiesTest.cpp @@ -50,7 +50,7 @@ PassRefPtr<IDBKey> checkKeyFromValueAndKeyPathInternal(const ScriptValue& value, { IDBKeyPath idbKeyPath(keyPath); EXPECT_TRUE(idbKeyPath.isValid()); - + return createIDBKeyFromScriptValueAndKeyPath(0, value, idbKeyPath); } diff --git a/Source/web/tests/PrerenderingTest.cpp b/Source/web/tests/PrerenderingTest.cpp index 07eb47db7..39001c1ea 100644 --- a/Source/web/tests/PrerenderingTest.cpp +++ b/Source/web/tests/PrerenderingTest.cpp @@ -81,7 +81,7 @@ public: m_webPrerenders.pop_front(); return retval; } - + bool empty() const { return m_webPrerenders.empty(); @@ -129,7 +129,7 @@ public: { return m_addedPrerenders.size() + m_canceledPrerenders.size() + m_abandonedPrerenders.size(); } - + size_t addCount(const WebPrerender& prerender) const { return std::count_if(m_addedPrerenders.begin(), m_addedPrerenders.end(), std::bind1st(WebPrerenderEqual(), prerender)); @@ -187,7 +187,7 @@ public: if (m_webView) close(); } - + void initialize(const char* baseURL, const char* fileName) { ASSERT(!m_webView); @@ -239,7 +239,7 @@ public: WebNode textNode = consoleListItem.firstChild(); ASSERT(textNode.nodeName() == "#text"); - + return textNode.nodeValue().utf8().data(); } @@ -304,7 +304,7 @@ TEST_F(PrerenderingTest, CancelPrerender) EXPECT_EQ(1u, prerenderingSupport()->totalCount()); executeScript("removePrerender()"); - + EXPECT_EQ(1u, prerenderingSupport()->cancelCount(webPrerender)); EXPECT_EQ(2u, prerenderingSupport()->totalCount()); } @@ -320,7 +320,7 @@ TEST_F(PrerenderingTest, AbandonPrerender) EXPECT_EQ(1u, prerenderingSupport()->totalCount()); navigateAway(); - + EXPECT_EQ(1u, prerenderingSupport()->abandonCount(webPrerender)); EXPECT_EQ(2u, prerenderingSupport()->totalCount()); } @@ -358,7 +358,7 @@ TEST_F(PrerenderingTest, ExtraData) TEST_F(PrerenderingTest, TwoPrerenders) { initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - + WebPrerender firstPrerender = prerendererClient()->releaseWebPrerender(); EXPECT_FALSE(firstPrerender.isNull()); EXPECT_EQ(toWebURL("http://first-prerender.com/"), firstPrerender.url()); @@ -383,7 +383,7 @@ TEST_F(PrerenderingTest, TwoPrerenders) TEST_F(PrerenderingTest, TwoPrerendersRemovingFirstThenNavigating) { initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - + WebPrerender firstPrerender = prerendererClient()->releaseWebPrerender(); WebPrerender secondPrerender = prerendererClient()->releaseWebPrerender(); @@ -406,7 +406,7 @@ TEST_F(PrerenderingTest, TwoPrerendersRemovingFirstThenNavigating) TEST_F(PrerenderingTest, TwoPrerendersAddingThird) { initialize("http://www.foo.com/", "prerender/multiple_prerenders.html"); - + WebPrerender firstPrerender = prerendererClient()->releaseWebPrerender(); WebPrerender secondPrerender = prerendererClient()->releaseWebPrerender(); diff --git a/Source/web/tests/WebFrameTest.cpp b/Source/web/tests/WebFrameTest.cpp index 1bcee0fe6..96601bbcf 100644 --- a/Source/web/tests/WebFrameTest.cpp +++ b/Source/web/tests/WebFrameTest.cpp @@ -238,7 +238,7 @@ TEST_F(WebFrameTest, FormWithNullFrame) TEST_F(WebFrameTest, ChromePageJavascript) { registerMockedChromeURLLoad("history.html"); - + // Pass true to enable JavaScript. m_webView = FrameTestHelpers::createWebViewAndLoad(m_chromeURL + "history.html", true); @@ -278,7 +278,7 @@ TEST_F(WebFrameTest, DispatchMessageEventWithOriginCheck) // Pass true to enable JavaScript. m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "postmessage_test.html", true); - + // Send a message with the correct origin. WebSecurityOrigin correctOrigin(WebSecurityOrigin::create(toKURL(m_baseURL))); WebDOMEvent event = m_webView->mainFrame()->document().createEvent("MessageEvent"); @@ -1955,13 +1955,13 @@ public: { } - virtual void didCreateFrame(WebFrame* parent, WebFrame* child) + virtual void didCreateFrame(WebFrame* parent, WebFrame* child) { m_frameCount++; if (!m_parent) m_parent = parent; } - + int m_frameCount; WebFrame* m_parent; }; @@ -1976,7 +1976,7 @@ TEST_F(WebFrameTest, DidCreateFrame) TestDidCreateFrameWebFrameClient webFrameClient; m_webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "iframes_test.html", false, &webFrameClient); - EXPECT_EQ(webFrameClient.m_frameCount, 3); + EXPECT_EQ(webFrameClient.m_frameCount, 3); EXPECT_EQ(webFrameClient.m_parent, m_webView->mainFrame()); m_webView->close(); @@ -3176,7 +3176,7 @@ public: EXPECT_TRUE(!m_didAccessInitialDocument); m_didAccessInitialDocument = true; } - + bool m_didAccessInitialDocument; }; diff --git a/Source/web/tests/WebViewTest.cpp b/Source/web/tests/WebViewTest.cpp index b55bf1b23..09bb6cf9a 100644 --- a/Source/web/tests/WebViewTest.cpp +++ b/Source/web/tests/WebViewTest.cpp @@ -185,6 +185,38 @@ protected: std::string m_baseURL; }; +TEST_F(WebViewTest, SetBaseBackgroundColor) +{ + const WebColor kWhite = 0xFFFFFFFF; + const WebColor kBlue = 0xFF0000FF; + const WebColor kDarkCyan = 0xFF227788; + const WebColor kTranslucentPutty = 0x80BFB196; + + WebView* webView = FrameTestHelpers::createWebView(); + EXPECT_EQ(kWhite, webView->backgroundColor()); + + webView->setBaseBackgroundColor(kBlue); + EXPECT_EQ(kBlue, webView->backgroundColor()); + + WebURL baseURL = URLTestHelpers::toKURL("http://example.com/"); + webView->mainFrame()->loadHTMLString( + "<html><head><style>body {background-color:#227788}</style></head></html>", baseURL); + Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); + EXPECT_EQ(kDarkCyan, webView->backgroundColor()); + + webView->mainFrame()->loadHTMLString( + "<html><head><style>body {background-color:rgba(255,0,0,0.5)}</style></head></html>", baseURL); + Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(); + // Expected: red (50% alpha) blended atop base of kBlue. + EXPECT_EQ(0xFF7F0080, webView->backgroundColor()); + + webView->setBaseBackgroundColor(kTranslucentPutty); + // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha. + EXPECT_EQ(0xBFE93B32, webView->backgroundColor()); + + webView->close(); +} + TEST_F(WebViewTest, FocusIsInactive) { URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c_str()), "visible_iframe.html"); diff --git a/Source/web/tests/data/shadow_dom_test.html b/Source/web/tests/data/shadow_dom_test.html index af971408c..c8b83f094 100644 --- a/Source/web/tests/data/shadow_dom_test.html +++ b/Source/web/tests/data/shadow_dom_test.html @@ -9,7 +9,7 @@ <script type="text/javascript"> window.addEventListener('load', function(e) { // Give one of the elements a shadow root. - document.getElementById('shadowroot').webkitCreateShadowRoot(); + document.getElementById('shadowroot').createShadowRoot(); }); </script> </head> |