diff options
Diffstat (limited to 'WebCore/page/Page.cpp')
-rw-r--r-- | WebCore/page/Page.cpp | 61 |
1 files changed, 36 insertions, 25 deletions
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp index 379d3f3..5609e28 100644 --- a/WebCore/page/Page.cpp +++ b/WebCore/page/Page.cpp @@ -20,7 +20,6 @@ #include "config.h" #include "Page.h" -#include "DeviceMotionController.h" #include "BackForwardController.h" #include "BackForwardList.h" #include "Base64.h" @@ -30,6 +29,7 @@ #include "ContextMenuClient.h" #include "ContextMenuController.h" #include "DOMWindow.h" +#include "DeviceMotionController.h" #include "DeviceOrientationController.h" #include "DragController.h" #include "EditorClient.h" @@ -46,7 +46,6 @@ #include "HTMLElement.h" #include "HistoryItem.h" #include "InspectorController.h" -#include "InspectorTimelineAgent.h" #include "Logging.h" #include "MediaCanStartListener.h" #include "Navigator.h" @@ -55,6 +54,7 @@ #include "PluginData.h" #include "PluginHalter.h" #include "PluginView.h" +#include "PluginViewBase.h" #include "ProgressTracker.h" #include "RenderTheme.h" #include "RenderWidget.h" @@ -72,6 +72,10 @@ #include <wtf/StdLibExtras.h> #include <wtf/text/StringHash.h> +#if ENABLE(ACCELERATED_2D_CANVAS) +#include "SharedGraphicsContext3D.h" +#endif + #if ENABLE(DOM_STORAGE) #include "StorageArea.h" #include "StorageNamespace.h" @@ -434,6 +438,15 @@ void Page::scheduleForcedStyleRecalcForAllPages() frame->document()->scheduleForcedStyleRecalc(); } +void Page::updateViewportArguments() +{ + if (!mainFrame() || !mainFrame()->document() || mainFrame()->document()->viewportArguments() == m_viewportArguments) + return; + + m_viewportArguments = mainFrame()->document()->viewportArguments(); + chrome()->dispatchViewportDataDidChange(m_viewportArguments); +} + void Page::refreshPlugins(bool reload) { if (!allPages) @@ -639,22 +652,17 @@ void Page::userStyleSheetLocationChanged() m_didLoadUserStyleSheet = false; m_userStyleSheet = String(); m_userStyleSheetModificationTime = 0; - + // Data URLs with base64-encoded UTF-8 style sheets are common. We can process them // synchronously and avoid using a loader. - if (url.protocolIs("data") && url.string().startsWith("data:text/css;charset=utf-8;base64,")) { + if (url.protocolIsData() && url.string().startsWith("data:text/css;charset=utf-8;base64,")) { m_didLoadUserStyleSheet = true; - - const unsigned prefixLength = 35; - Vector<char> encodedData(url.string().length() - prefixLength); - for (unsigned i = prefixLength; i < url.string().length(); ++i) - encodedData[i - prefixLength] = static_cast<char>(url.string()[i]); Vector<char> styleSheetAsUTF8; - if (base64Decode(encodedData, styleSheetAsUTF8)) + if (base64Decode(decodeURLEscapeSequences(url.string().substring(35)), styleSheetAsUTF8, IgnoreWhitespace)) m_userStyleSheet = String::fromUTF8(styleSheetAsUTF8.data(), styleSheetAsUTF8.size()); } - + for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { if (frame->document()) frame->document()->updatePageUserSheet(); @@ -773,6 +781,18 @@ void Page::setDebugger(JSC::Debugger* debugger) frame->script()->attachDebugger(m_debugger); } +SharedGraphicsContext3D* Page::sharedGraphicsContext3D() +{ +#if ENABLE(ACCELERATED_2D_CANVAS) + if (!m_sharedGraphicsContext3D) + m_sharedGraphicsContext3D = SharedGraphicsContext3D::create(chrome()); + + return m_sharedGraphicsContext3D.get(); +#else + return 0; +#endif +} + #if ENABLE(DOM_STORAGE) StorageNamespace* Page::sessionStorage(bool optionalCreate) { @@ -838,13 +858,6 @@ bool Page::javaScriptURLsAreAllowed() const return m_javaScriptURLsAreAllowed; } -#if ENABLE(INSPECTOR) -InspectorTimelineAgent* Page::inspectorTimelineAgent() const -{ - return m_inspectorController->timelineAgent(); -} -#endif - #if ENABLE(INPUT_SPEECH) SpeechInput* Page::speechInput() { @@ -861,8 +874,7 @@ void Page::privateBrowsingStateChanged() // Collect the PluginViews in to a vector to ensure that action the plug-in takes // from below privateBrowsingStateChanged does not affect their lifetime. - - Vector<RefPtr<PluginView>, 32> pluginViews; + Vector<RefPtr<PluginViewBase>, 32> pluginViewBases; for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) { FrameView* view = frame->view(); if (!view) @@ -874,14 +886,13 @@ void Page::privateBrowsingStateChanged() HashSet<RefPtr<Widget> >::const_iterator end = children->end(); for (HashSet<RefPtr<Widget> >::const_iterator it = children->begin(); it != end; ++it) { Widget* widget = (*it).get(); - if (!widget->isPluginView()) - continue; - pluginViews.append(static_cast<PluginView*>(widget)); + if (widget->isPluginViewBase()) + pluginViewBases.append(static_cast<PluginViewBase*>(widget)); } } - for (size_t i = 0; i < pluginViews.size(); i++) - pluginViews[i]->privateBrowsingStateChanged(privateBrowsingEnabled); + for (size_t i = 0; i < pluginViewBases.size(); ++i) + pluginViewBases[i]->privateBrowsingStateChanged(privateBrowsingEnabled); } void Page::pluginAllowedRunTimeChanged() |