summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp44
1 files changed, 36 insertions, 8 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 60ca6781a..c91c73ed1 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -60,6 +60,7 @@
#include "WebEvent.h"
#include "WebEventConversion.h"
#include "WebFrame.h"
+#include "WebFrameNetworkingContext.h"
#include "WebFullScreenManager.h"
#include "WebFullScreenManagerMessages.h"
#include "WebGeolocationClient.h"
@@ -276,6 +277,7 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
, m_visibilityState(WebCore::PageVisibilityStateVisible)
#endif
, m_inspectorClient(0)
+ , m_backgroundColor(Color::white)
{
ASSERT(m_pageID);
// FIXME: This is a non-ideal location for this Setting and
@@ -1021,6 +1023,7 @@ void WebPage::sendViewportAttributesChanged()
int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height();
ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), m_viewportSize);
+ attr.initialScale = m_page->viewportArguments().zoom; // Resets auto (-1) if no value was set by user.
// This also takes care of the relayout.
setFixedLayoutSize(IntSize(static_cast<int>(attr.layoutSize.width()), static_cast<int>(attr.layoutSize.height())));
@@ -1034,7 +1037,7 @@ void WebPage::setViewportSize(const IntSize& size)
if (m_viewportSize == size)
return;
- m_viewportSize = size;
+ m_viewportSize = size;
sendViewportAttributesChanged();
}
@@ -1695,17 +1698,21 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize&
#endif
// Find the node to highlight. This is not the same as the node responding the tap gesture, because many
// pages has a global click handler and we do not want to highlight the body.
- // Instead find the enclosing link or focusable element, or the last enclosing inline element.
for (Node* node = adjustedNode; node; node = node->parentOrHostNode()) {
if (node->isDocumentNode() || node->isFrameOwnerElement())
break;
- if (node->isMouseFocusable() || node->willRespondToMouseClickEvents()) {
+
+ // We always highlight focusable (form-elements), image links or content-editable elements.
+ if (node->isMouseFocusable() || node->isLink() || node->isContentEditable())
activationNode = node;
- break;
+ else if (node->willRespondToMouseClickEvents()) {
+ // Highlight elements with default mouse-click handlers, but highlight only inline elements with
+ // scripted event-handlers.
+ if (!node->Node::willRespondToMouseClickEvents() || (node->renderer() && node->renderer()->isInline()))
+ activationNode = node;
}
- if (node->renderer() && node->renderer()->isInline())
- activationNode = node;
- else if (activationNode)
+
+ if (activationNode)
break;
}
@@ -2174,7 +2181,16 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
settings->setLocalStorageEnabled(store.getBoolValueForKey(WebPreferencesKey::localStorageEnabledKey()));
settings->setXSSAuditorEnabled(store.getBoolValueForKey(WebPreferencesKey::xssAuditorEnabledKey()));
settings->setFrameFlatteningEnabled(store.getBoolValueForKey(WebPreferencesKey::frameFlatteningEnabledKey()));
- settings->setPrivateBrowsingEnabled(store.getBoolValueForKey(WebPreferencesKey::privateBrowsingEnabledKey()));
+
+ bool privateBrowsingEnabled = store.getBoolValueForKey(WebPreferencesKey::privateBrowsingEnabledKey());
+#if (PLATFORM(MAC) || USE(CFNETWORK)) && !PLATFORM(WIN)
+ if (privateBrowsingEnabled)
+ WebFrameNetworkingContext::ensurePrivateBrowsingSession();
+ else
+ WebFrameNetworkingContext::destroyPrivateBrowsingSession();
+#endif
+ settings->setPrivateBrowsingEnabled(privateBrowsingEnabled);
+
settings->setDeveloperExtrasEnabled(store.getBoolValueForKey(WebPreferencesKey::developerExtrasEnabledKey()));
settings->setJavaScriptExperimentsEnabled(store.getBoolValueForKey(WebPreferencesKey::javaScriptExperimentsEnabledKey()));
settings->setTextAreasAreResizable(store.getBoolValueForKey(WebPreferencesKey::textAreasAreResizableKey()));
@@ -2763,6 +2779,18 @@ void WebPage::mainFrameDidLayout()
send(Messages::WebPageProxy::DidChangePageCount(pageCount));
m_cachedPageCount = pageCount;
}
+
+#if USE(TILED_BACKING_STORE) && USE(ACCELERATED_COMPOSITING)
+ if (m_drawingArea && m_drawingArea->layerTreeHost()) {
+ double red, green, blue, alpha;
+ m_mainFrame->getDocumentBackgroundColor(&red, &green, &blue, &alpha);
+ RGBA32 rgba = makeRGBA32FromFloats(red, green, blue, alpha);
+ if (m_backgroundColor.rgb() != rgba) {
+ m_backgroundColor.setRGB(rgba);
+ m_drawingArea->layerTreeHost()->setBackgroundColor(m_backgroundColor);
+ }
+ }
+#endif
}
void WebPage::addPluginView(PluginView* pluginView)