diff options
author | Steve Block <steveblock@google.com> | 2010-04-29 02:02:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-04-29 02:02:09 -0700 |
commit | fbcad591f3f2962b92aa61c017c360ddaef5ebba (patch) | |
tree | a1e6f4d2b649801f5455f51739d75f4f34a7d190 /WebCore/page | |
parent | 5a0626b52e267a829822dd9fc9f2863ebc3259c0 (diff) | |
parent | ec79cd2f7baa7ba941c8343f6d79f0dbfdd5be2a (diff) | |
download | external_webkit-fbcad591f3f2962b92aa61c017c360ddaef5ebba.zip external_webkit-fbcad591f3f2962b92aa61c017c360ddaef5ebba.tar.gz external_webkit-fbcad591f3f2962b92aa61c017c360ddaef5ebba.tar.bz2 |
Merge changes Ie9ba4c69,I35363367,I18aaae5f,I2c315360,I4f163c97,Ib640e64c,I98a4af82
* changes:
Merge webkit.org at r55033 : Update WebKit revision
Merge webkit.org at r55033 : Update Android-specific LayoutTest expected result
Merge webkit.org at r55033 : Implement FrameLoaderClient::didTransferChildFrameToNewDocument for Android
Merge webkit.org at r55033 : Implement PluginPackage::NPVersion for Android
Merge webkit.org at r55033 : Implement new ChromeClient::iconForFiles method for Android
Merge webkit.org at r55033 : Fix merge conflicts
Merge webkit.org at r55033 : Initial merge by git
Diffstat (limited to 'WebCore/page')
-rw-r--r-- | WebCore/page/Chrome.cpp | 5 | ||||
-rw-r--r-- | WebCore/page/Chrome.h | 1 | ||||
-rw-r--r-- | WebCore/page/ChromeClient.h | 3 | ||||
-rw-r--r-- | WebCore/page/DOMTimer.cpp | 4 | ||||
-rw-r--r-- | WebCore/page/DOMTimer.h | 7 | ||||
-rw-r--r-- | WebCore/page/DOMWindow.cpp | 4 | ||||
-rw-r--r-- | WebCore/page/DOMWindow.h | 4 | ||||
-rw-r--r-- | WebCore/page/DragController.cpp | 11 | ||||
-rw-r--r-- | WebCore/page/Frame.cpp | 65 | ||||
-rw-r--r-- | WebCore/page/Frame.h | 2 | ||||
-rw-r--r-- | WebCore/page/FrameView.cpp | 20 | ||||
-rw-r--r-- | WebCore/page/FrameView.h | 6 | ||||
-rw-r--r-- | WebCore/page/Geolocation.h | 3 | ||||
-rw-r--r-- | WebCore/page/MediaCanStartListener.h | 40 | ||||
-rw-r--r-- | WebCore/page/Page.cpp | 39 | ||||
-rw-r--r-- | WebCore/page/Page.h | 23 | ||||
-rw-r--r-- | WebCore/page/SecurityOrigin.cpp | 5 | ||||
-rw-r--r-- | WebCore/page/SecurityOrigin.h | 3 | ||||
-rw-r--r-- | WebCore/page/Settings.cpp | 6 | ||||
-rw-r--r-- | WebCore/page/Settings.h | 4 | ||||
-rw-r--r-- | WebCore/page/win/PageWin.cpp | 31 |
21 files changed, 203 insertions, 83 deletions
diff --git a/WebCore/page/Chrome.cpp b/WebCore/page/Chrome.cpp index d3b46ad..cb7f6bf 100644 --- a/WebCore/page/Chrome.cpp +++ b/WebCore/page/Chrome.cpp @@ -427,6 +427,11 @@ void Chrome::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser) m_client->runOpenPanel(frame, fileChooser); } +void Chrome::iconForFiles(const Vector<String>& filenames, PassRefPtr<FileChooser> fileChooser) +{ + m_client->iconForFiles(filenames, fileChooser); +} + bool Chrome::setCursor(PlatformCursorHandle cursor) { return m_client->setCursor(cursor); diff --git a/WebCore/page/Chrome.h b/WebCore/page/Chrome.h index 3039b90..9227f87 100644 --- a/WebCore/page/Chrome.h +++ b/WebCore/page/Chrome.h @@ -136,6 +136,7 @@ namespace WebCore { void cancelGeolocationPermissionRequestForFrame(Frame*); void runOpenPanel(Frame*, PassRefPtr<FileChooser>); + void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>); bool setCursor(PlatformCursorHandle); diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h index 1615f3a..1b8b734 100644 --- a/WebCore/page/ChromeClient.h +++ b/WebCore/page/ChromeClient.h @@ -190,6 +190,9 @@ namespace WebCore { virtual void cancelGeolocationPermissionRequestForFrame(Frame*) = 0; virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) = 0; + // Asynchronous request to load an icon for specified filenames. + // This is called only if Icon::createIconForFiles() returns 0. + virtual void iconForFiles(const Vector<String>&, PassRefPtr<FileChooser>) = 0; virtual bool setCursor(PlatformCursorHandle) = 0; diff --git a/WebCore/page/DOMTimer.cpp b/WebCore/page/DOMTimer.cpp index 8971bb7..72dc9ac 100644 --- a/WebCore/page/DOMTimer.cpp +++ b/WebCore/page/DOMTimer.cpp @@ -43,7 +43,7 @@ double DOMTimer::s_minTimerInterval = 0.010; // 10 milliseconds static int timerNestingLevel = 0; -DOMTimer::DOMTimer(ScriptExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot) +DOMTimer::DOMTimer(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot) : ActiveDOMObject(context, this) , m_action(action) , m_nextFireInterval(0) @@ -82,7 +82,7 @@ DOMTimer::~DOMTimer() scriptExecutionContext()->removeTimeout(m_timeoutId); } -int DOMTimer::install(ScriptExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot) +int DOMTimer::install(ScriptExecutionContext* context, PassOwnPtr<ScheduledAction> action, int timeout, bool singleShot) { // DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'. // The timer is deleted when context is deleted (DOMTimer::contextDestroyed) or explicitly via DOMTimer::removeById(), diff --git a/WebCore/page/DOMTimer.h b/WebCore/page/DOMTimer.h index 460430f..da38178 100644 --- a/WebCore/page/DOMTimer.h +++ b/WebCore/page/DOMTimer.h @@ -28,20 +28,21 @@ #define DOMTimer_h #include "ActiveDOMObject.h" +#include "ScheduledAction.h" #include "Timer.h" #include <wtf/OwnPtr.h> +#include <wtf/PassOwnPtr.h> namespace WebCore { class InspectorTimelineAgent; - class ScheduledAction; class DOMTimer : public TimerBase, public ActiveDOMObject { public: virtual ~DOMTimer(); // Creates a new timer owned by specified ScriptExecutionContext, starts it // and returns its Id. - static int install(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot); + static int install(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot); static void removeById(ScriptExecutionContext*, int timeoutId); // ActiveDOMObject @@ -59,7 +60,7 @@ namespace WebCore { static void setMinTimerInterval(double value) { s_minTimerInterval = value; } private: - DOMTimer(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot); + DOMTimer(ScriptExecutionContext*, PassOwnPtr<ScheduledAction>, int timeout, bool singleShot); virtual void fired(); int m_timeoutId; diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp index 2f0f84f..6af22c3 100644 --- a/WebCore/page/DOMWindow.cpp +++ b/WebCore/page/DOMWindow.cpp @@ -1252,7 +1252,7 @@ void DOMWindow::resizeTo(float width, float height) const page->chrome()->setWindowRect(fr); } -int DOMWindow::setTimeout(ScheduledAction* action, int timeout, ExceptionCode& ec) +int DOMWindow::setTimeout(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec) { ScriptExecutionContext* context = scriptExecutionContext(); if (!context) { @@ -1270,7 +1270,7 @@ void DOMWindow::clearTimeout(int timeoutId) DOMTimer::removeById(context, timeoutId); } -int DOMWindow::setInterval(ScheduledAction* action, int timeout, ExceptionCode& ec) +int DOMWindow::setInterval(PassOwnPtr<ScheduledAction> action, int timeout, ExceptionCode& ec) { ScriptExecutionContext* context = scriptExecutionContext(); if (!context) { diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h index dc1e68c..4452dbb 100644 --- a/WebCore/page/DOMWindow.h +++ b/WebCore/page/DOMWindow.h @@ -237,9 +237,9 @@ namespace WebCore { void resizeTo(float width, float height) const; // Timers - int setTimeout(ScheduledAction*, int timeout, ExceptionCode&); + int setTimeout(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&); void clearTimeout(int timeoutId); - int setInterval(ScheduledAction*, int timeout, ExceptionCode&); + int setInterval(PassOwnPtr<ScheduledAction>, int timeout, ExceptionCode&); void clearInterval(int timeoutId); // Events diff --git a/WebCore/page/DragController.cpp b/WebCore/page/DragController.cpp index c9769df..18e3195 100644 --- a/WebCore/page/DragController.cpp +++ b/WebCore/page/DragController.cpp @@ -556,14 +556,9 @@ static CachedImage* getCachedImage(Element* element) static Image* getImage(Element* element) { ASSERT(element); - RenderObject* renderer = element->renderer(); - if (!renderer || !renderer->isImage()) - return 0; - - RenderImage* image = toRenderImage(renderer); - if (image->cachedImage() && !image->cachedImage()->errorOccurred()) - return image->cachedImage()->image(); - return 0; + CachedImage* cachedImage = getCachedImage(element); + return (cachedImage && !cachedImage->errorOccurred()) ? + cachedImage->image() : 0; } static void prepareClipboardForImageDrag(Frame* src, Clipboard* clipboard, Element* node, const KURL& linkURL, const KURL& imageURL, const String& label) diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp index 947cb06..87c9733 100644 --- a/WebCore/page/Frame.cpp +++ b/WebCore/page/Frame.cpp @@ -674,10 +674,6 @@ bool Frame::shouldApplyTextZoom() const { if (m_zoomFactor == 1.0f || !isZoomFactorTextOnly()) return false; -#if ENABLE(SVG) - if (m_doc->isSVGDocument()) - return false; -#endif return true; } @@ -685,10 +681,6 @@ bool Frame::shouldApplyPageZoom() const { if (m_zoomFactor == 1.0f || isZoomFactorTextOnly()) return false; -#if ENABLE(SVG) - if (m_doc->isSVGDocument()) - return false; -#endif return true; } @@ -698,16 +690,13 @@ void Frame::setZoomFactor(float percent, bool isTextOnly) return; #if ENABLE(SVG) - // SVG doesn't care if the zoom factor is text only. It will always apply a - // zoom to the whole SVG. + // Respect SVGs zoomAndPan="disabled" property in standalone SVG documents. + // FIXME: How to handle compound documents + zoomAndPan="disabled"? Needs SVG WG clarification. if (m_doc->isSVGDocument()) { if (!static_cast<SVGDocument*>(m_doc.get())->zoomAndPanEnabled()) return; - m_zoomFactor = percent; - m_page->settings()->setZoomsTextOnly(true); // We do this to avoid doing any scaling of CSS pixels, since the SVG has its own notion of zoom. if (m_doc->renderer()) - m_doc->renderer()->repaint(); - return; + m_doc->renderer()->setNeedsLayout(true); } #endif @@ -1631,6 +1620,54 @@ void Frame::disconnectOwnerElement() m_ownerElement = 0; } +// The frame is moved in DOM, potentially to another page. +void Frame::transferChildFrameToNewDocument() +{ + ASSERT(m_ownerElement); + Frame* newParent = m_ownerElement->document()->frame(); + bool didTransfer = false; + + // Switch page. + Page* newPage = newParent ? newParent->page() : 0; + if (m_page != newPage) { + if (page()->focusController()->focusedFrame() == this) + page()->focusController()->setFocusedFrame(0); + + if (m_page) + m_page->decrementFrameCount(); + + m_page = newPage; + + if (newPage) + newPage->incrementFrameCount(); + + didTransfer = true; + } + + // Update the frame tree. + Frame* oldParent = tree()->parent(); + if (oldParent != newParent) { + if (oldParent) + oldParent->tree()->removeChild(this); + if (newParent) { + newParent->tree()->appendChild(this); + m_ownerElement->setName(); + } + didTransfer = true; + } + + // Avoid unnecessary calls to client and frame subtree if the frame ended + // up on the same page and under the same parent frame. + if (didTransfer) { + // Let external clients update themselves. + loader()->client()->didTransferChildFrameToNewDocument(); + + // Do the same for all the children. + for (Frame* child = tree()->firstChild(); child; child = child->tree()->nextSibling()) + child->transferChildFrameToNewDocument(); + } +} + String Frame::documentTypeString() const { if (DocumentType* doctype = document()->doctype()) diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h index 33bb435..26d1efa 100644 --- a/WebCore/page/Frame.h +++ b/WebCore/page/Frame.h @@ -76,6 +76,8 @@ namespace WebCore { Page* page() const; void detachFromPage(); + void transferChildFrameToNewDocument(); + HTMLFrameOwnerElement* ownerElement() const; void pageDestroyed(); diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp index fb078a9..356ada2 100644 --- a/WebCore/page/FrameView.cpp +++ b/WebCore/page/FrameView.cpp @@ -496,6 +496,19 @@ bool FrameView::syncCompositingStateRecursive() #endif } +bool FrameView::isSoftwareRenderable() const +{ +#if USE(ACCELERATED_COMPOSITING) + RenderView* view = m_frame->contentRenderer(); + if (!view) + return true; + + return !view->compositor()->has3DContent(); +#else + return true; +#endif +} + void FrameView::didMoveOnscreen() { RenderView* view = m_frame->contentRenderer(); @@ -1795,7 +1808,12 @@ void FrameView::setPaintBehavior(PaintBehavior behavior) { m_paintBehavior = behavior; } - + +PaintBehavior FrameView::paintBehavior() const +{ + return m_paintBehavior; +} + bool FrameView::isPainting() const { return m_isPainting; diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h index b27ffd8..1d5a312 100644 --- a/WebCore/page/FrameView.h +++ b/WebCore/page/FrameView.h @@ -106,6 +106,10 @@ public: // Returns true if the sync was completed. bool syncCompositingStateRecursive(); + // Returns true when a paint with the PaintBehaviorFlattenCompositingLayers flag set gives + // a faithful representation of the content. + bool isSoftwareRenderable() const; + void didMoveOnscreen(); void willMoveOffscreen(); @@ -170,7 +174,7 @@ public: virtual void paintContents(GraphicsContext*, const IntRect& damageRect); void setPaintBehavior(PaintBehavior); - PaintBehavior paintBehavior() const { return m_paintBehavior; } + PaintBehavior paintBehavior() const; bool isPainting() const; void setNodeToDraw(Node*); diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index b30deac..358e4a3 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -85,10 +85,13 @@ public: void setShouldClearCache(bool shouldClearCache) { m_shouldClearCache = shouldClearCache; } bool shouldClearCache() const { return m_shouldClearCache; } + Frame* frame() const { return m_frame; } #if ENABLE(CLIENT_BASED_GEOLOCATION) void setPosition(GeolocationPosition*); void setError(GeolocationError*); +#else + GeolocationService* getGeolocationService() const { return m_service.get(); } #endif private: diff --git a/WebCore/page/MediaCanStartListener.h b/WebCore/page/MediaCanStartListener.h new file mode 100644 index 0000000..317babf --- /dev/null +++ b/WebCore/page/MediaCanStartListener.h @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Apple Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR + * 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 MediaCanStartListener_h +#define MediaCanStartListener_h + +namespace WebCore { + +class MediaCanStartListener { +public: + virtual void mediaCanStart() = 0; +protected: + virtual ~MediaCanStartListener() { } +}; + +} + +#endif diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index a3e89b5..d348d73 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007, 2008 Apple Inc. All Rights Reserved. + * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All Rights Reserved. * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * * This library is free software; you can redistribute it and/or @@ -46,6 +46,7 @@ #include "InspectorController.h" #include "InspectorTimelineAgent.h" #include "Logging.h" +#include "MediaCanStartListener.h" #include "Navigator.h" #include "NetworkStateNotifier.h" #include "PageGroup.h" @@ -159,7 +160,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi , m_debugger(0) , m_customHTMLTokenizerTimeDelay(-1) , m_customHTMLTokenizerChunkSize(-1) - , m_canStartPlugins(true) + , m_canStartMedia(true) { #if !ENABLE(CONTEXT_MENUS) UNUSED_PARAM(contextMenuClient); @@ -413,17 +414,37 @@ PluginData* Page::pluginData() const return m_pluginData.get(); } -void Page::addUnstartedPlugin(PluginView* view) +void Page::addMediaCanStartListener(MediaCanStartListener* listener) { - ASSERT(!m_canStartPlugins); - m_unstartedPlugins.add(view); + ASSERT(!m_canStartMedia); + ASSERT(!m_mediaCanStartListeners.contains(listener)); + m_mediaCanStartListeners.add(listener); } -void Page::removeUnstartedPlugin(PluginView* view) +void Page::removeMediaCanStartListener(MediaCanStartListener* listener) { - ASSERT(!m_canStartPlugins); - ASSERT(m_unstartedPlugins.contains(view)); - m_unstartedPlugins.remove(view); + ASSERT(!m_canStartMedia); + ASSERT(m_mediaCanStartListeners.contains(listener)); + m_mediaCanStartListeners.remove(listener); +} + +void Page::setCanStartMedia(bool canStartMedia) +{ + if (m_canStartMedia == canStartMedia) + return; + + m_canStartMedia = canStartMedia; + + if (!m_canStartMedia || m_mediaCanStartListeners.isEmpty()) + return; + + Vector<MediaCanStartListener*> listeners; + copyToVector(m_mediaCanStartListeners, listeners); + m_mediaCanStartListeners.clear(); + + size_t size = listeners.size(); + for (size_t i = 0; i < size; ++i) + listeners[i]->mediaCanStart(); } static Frame* incrementFrame(Frame* curr, bool forward, bool wrapFlag) diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h index 1417c87..04a545c 100644 --- a/WebCore/page/Page.h +++ b/WebCore/page/Page.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * * This library is free software; you can redistribute it and/or @@ -59,26 +59,27 @@ namespace WebCore { class InspectorClient; class InspectorController; class InspectorTimelineAgent; + class MediaCanStartListener; class Node; class PageGroup; class PluginData; class PluginHalter; class PluginHalterClient; - class PluginView; class ProgressTracker; class RenderTheme; class VisibleSelection; class SelectionController; class Settings; + #if ENABLE(DOM_STORAGE) class StorageNamespace; #endif -#if ENABLE(WML) - class WMLPageState; -#endif #if ENABLE(NOTIFICATIONS) class NotificationPresenter; #endif +#if ENABLE(WML) + class WMLPageState; +#endif typedef uint64_t LinkHash; @@ -96,10 +97,10 @@ namespace WebCore { static void refreshPlugins(bool reload); PluginData* pluginData() const; - void setCanStartPlugins(bool); - bool canStartPlugins() const { return m_canStartPlugins; } - void addUnstartedPlugin(PluginView*); - void removeUnstartedPlugin(PluginView*); + void setCanStartMedia(bool); + bool canStartMedia() const { return m_canStartMedia; } + void addMediaCanStartListener(MediaCanStartListener*); + void removeMediaCanStartListener(MediaCanStartListener*); EditorClient* editorClient() const { return m_editorClient; } @@ -310,8 +311,8 @@ namespace WebCore { double m_customHTMLTokenizerTimeDelay; int m_customHTMLTokenizerChunkSize; - bool m_canStartPlugins; - HashSet<PluginView*> m_unstartedPlugins; + bool m_canStartMedia; + HashSet<MediaCanStartListener*> m_mediaCanStartListeners; OwnPtr<PluginHalter> m_pluginHalter; diff --git a/WebCore/page/SecurityOrigin.cpp b/WebCore/page/SecurityOrigin.cpp index af63637..fe6efbd 100644 --- a/WebCore/page/SecurityOrigin.cpp +++ b/WebCore/page/SecurityOrigin.cpp @@ -286,6 +286,11 @@ void SecurityOrigin::grantUniversalAccess() m_universalAccess = true; } +void SecurityOrigin::makeUnique() +{ + m_isUnique = true; +} + bool SecurityOrigin::isLocal() const { return shouldTreatURLSchemeAsLocal(m_protocol); diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h index b441474..c96bb83 100644 --- a/WebCore/page/SecurityOrigin.h +++ b/WebCore/page/SecurityOrigin.h @@ -138,6 +138,9 @@ public: // addition, the SandboxOrigin flag is inherited by iframes. bool isUnique() const { return m_isUnique; } + // Marks an origin as being unique. + void makeUnique(); + // Convert this SecurityOrigin into a string. The string // representation of a SecurityOrigin is similar to a URL, except it // lacks a path component. The string representation does not encode diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp index c495a23..c59bdd0 100644 --- a/WebCore/page/Settings.cpp +++ b/WebCore/page/Settings.cpp @@ -87,6 +87,7 @@ Settings::Settings(Page* page) , m_isJavaScriptEnabled(false) , m_isWebSecurityEnabled(true) , m_allowUniversalAccessFromFileURLs(true) + , m_allowFileAccessFromFileURLs(true) , m_javaScriptCanOpenWindowsAutomatically(false) , m_shouldPrintBackgrounds(false) , m_textAreasAreResizable(false) @@ -265,6 +266,11 @@ void Settings::setAllowUniversalAccessFromFileURLs(bool allowUniversalAccessFrom m_allowUniversalAccessFromFileURLs = allowUniversalAccessFromFileURLs; } +void Settings::setAllowFileAccessFromFileURLs(bool allowFileAccessFromFileURLs) +{ + m_allowFileAccessFromFileURLs = allowFileAccessFromFileURLs; +} + void Settings::setJavaEnabled(bool isJavaEnabled) { m_isJavaEnabled = isJavaEnabled; diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h index 652c13d..44b4642 100644 --- a/WebCore/page/Settings.h +++ b/WebCore/page/Settings.h @@ -135,6 +135,9 @@ namespace WebCore { void setAllowUniversalAccessFromFileURLs(bool); bool allowUniversalAccessFromFileURLs() const { return m_allowUniversalAccessFromFileURLs; } + void setAllowFileAccessFromFileURLs(bool); + bool allowFileAccessFromFileURLs() const { return m_allowFileAccessFromFileURLs; } + void setJavaScriptCanOpenWindowsAutomatically(bool); bool javaScriptCanOpenWindowsAutomatically() const { return m_javaScriptCanOpenWindowsAutomatically; } @@ -423,6 +426,7 @@ namespace WebCore { bool m_isJavaScriptEnabled : 1; bool m_isWebSecurityEnabled : 1; bool m_allowUniversalAccessFromFileURLs: 1; + bool m_allowFileAccessFromFileURLs: 1; bool m_javaScriptCanOpenWindowsAutomatically : 1; bool m_shouldPrintBackgrounds : 1; bool m_textAreasAreResizable : 1; diff --git a/WebCore/page/win/PageWin.cpp b/WebCore/page/win/PageWin.cpp index 5d7450c..3ef7728 100644 --- a/WebCore/page/win/PageWin.cpp +++ b/WebCore/page/win/PageWin.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,37 +26,8 @@ #include "config.h" #include "Page.h" -#include "Frame.h" -#include "FrameLoaderClient.h" -#include "FrameView.h" -#include "FloatRect.h" -#include "PluginView.h" -#include <windows.h> - namespace WebCore { HINSTANCE Page::s_instanceHandle = 0; -void Page::setCanStartPlugins(bool canStartPlugins) -{ - if (m_canStartPlugins == canStartPlugins) - return; - - m_canStartPlugins = canStartPlugins; - - if (!m_canStartPlugins || m_unstartedPlugins.isEmpty()) - return; - - Vector<PluginView*> unstartedPlugins; - copyToVector(m_unstartedPlugins, unstartedPlugins); - m_unstartedPlugins.clear(); - - for (size_t i = 0; i < unstartedPlugins.size(); ++i) { - if (unstartedPlugins[i]->start()) - continue; - unstartedPlugins[i]->parentFrame()->loader()->client()->dispatchDidFailToStartPlugin(unstartedPlugins[i]); - } -} - } // namespace WebCore - |