summaryrefslogtreecommitdiffstats
path: root/WebCore/page
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-05-26 10:11:43 +0100
committerSteve Block <steveblock@google.com>2010-05-27 11:14:42 +0100
commite78cbe89e6f337f2f1fe40315be88f742b547151 (patch)
treed778000b84a04f24bbad50c7fa66244365e960e9 /WebCore/page
parent7b582e96e4e909ed7dba1e07153d20fbddaec3f7 (diff)
downloadexternal_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.zip
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.gz
external_webkit-e78cbe89e6f337f2f1fe40315be88f742b547151.tar.bz2
Merge WebKit at r60074: Initial merge by git
Change-Id: I18a2dc5439e36c928351ea829d8fb4e39b062fc7
Diffstat (limited to 'WebCore/page')
-rw-r--r--WebCore/page/DOMWindow.h4
-rw-r--r--WebCore/page/DOMWindow.idl12
-rw-r--r--WebCore/page/EventHandler.cpp2
-rw-r--r--WebCore/page/Frame.cpp3
-rw-r--r--WebCore/page/Page.cpp11
-rw-r--r--WebCore/page/Page.h10
-rw-r--r--WebCore/page/SecurityOrigin.h1
-rw-r--r--WebCore/page/Settings.cpp4
-rw-r--r--WebCore/page/Settings.h7
-rw-r--r--WebCore/page/animation/AnimationBase.cpp2
-rw-r--r--WebCore/page/animation/AnimationBase.h3
-rw-r--r--WebCore/page/brew/DragControllerBrew.cpp70
-rw-r--r--WebCore/page/mac/FrameMac.mm8
-rw-r--r--WebCore/page/qt/EventHandlerQt.cpp4
14 files changed, 129 insertions, 12 deletions
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index e4aa4cb..a1f40a8 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -325,6 +325,10 @@ namespace WebCore {
DEFINE_ATTRIBUTE_EVENT_LISTENER(orientationchange);
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
+#endif
+
DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationstart, webkitAnimationStart);
DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationiteration, webkitAnimationIteration);
DEFINE_MAPPED_ATTRIBUTE_EVENT_LISTENER(webkitanimationend, webkitAnimationEnd);
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 9314106..ec1645b 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -295,10 +295,12 @@ module window {
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
attribute EventListener onorientationchange;
#endif
- attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart;
- attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove;
- attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
- attribute [DontEnum,Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
+ attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchstart;
+ attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchmove;
+ attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchend;
+ attribute [Conditional=TOUCH_EVENTS,EnabledAtRuntime] EventListener ontouchcancel;
+
+ attribute [Conditional=DEVICE_ORIENTATION] EventListener ondeviceorientation;
// EventTarget interface
[Custom] void addEventListener(in DOMString type,
@@ -344,7 +346,7 @@ module window {
// FIXME: Implement the commented-out global constructors for interfaces listed in DOM Level 3 Core specification.
attribute DOMCoreExceptionConstructor DOMException;
-// attribute DOMStringListConstructor DOMStringList;
+ attribute DOMStringListConstructor DOMStringList;
// attribute NameListConstructor NameList;
// attribute DOMImplementationListConstructor DOMImplementationList;
// attribute DOMImplementationSourceConstructor DOMImplementationSource;
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index 042f3d4..579cecc 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1287,7 +1287,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
#if ENABLE(PAN_SCROLLING)
Page* page = m_frame->page();
- if (page && page->mainFrame()->eventHandler()->panScrollInProgress() || m_autoscrollInProgress) {
+ if ((page && page->mainFrame()->eventHandler()->panScrollInProgress()) || m_autoscrollInProgress) {
stopAutoscrollTimer();
invalidateClick();
return true;
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index f971b96..216f6b3 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -536,6 +536,9 @@ String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* e
void Frame::notifyRendererOfSelectionChange(bool userTriggered)
{
RenderObject* renderer = 0;
+
+ document()->updateStyleIfNeeded();
+
if (selection()->rootEditableElement())
renderer = selection()->rootEditableElement()->shadowAncestorNode()->renderer();
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 4d8692e..1988040 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -29,6 +29,7 @@
#include "ContextMenuClient.h"
#include "ContextMenuController.h"
#include "DOMWindow.h"
+#include "DeviceOrientation.h"
#include "DragController.h"
#include "EditorClient.h"
#include "Event.h"
@@ -112,6 +113,7 @@ static void networkStateChanged()
frames[i]->document()->dispatchWindowEvent(Event::create(eventName, false, false));
}
+<<<<<<< HEAD
#if PLATFORM(ANDROID) && ENABLE(APPLICATION_INSTALLED)
static void onPackageResultAvailable()
{
@@ -124,6 +126,9 @@ static void onPackageResultAvailable()
#endif
Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient, PluginHalterClient* pluginHalterClient, GeolocationControllerClient* geolocationControllerClient)
+=======
+Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, EditorClient* editorClient, DragClient* dragClient, InspectorClient* inspectorClient, PluginHalterClient* pluginHalterClient, GeolocationControllerClient* geolocationControllerClient, DeviceOrientationClient* deviceOrientationClient)
+>>>>>>> webkit.org at r60074
: m_chrome(new Chrome(this, chromeClient))
, m_dragCaretController(new SelectionController(0, true))
#if ENABLE(DRAG_SUPPORT)
@@ -139,6 +144,9 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
#if ENABLE(CLIENT_BASED_GEOLOCATION)
, m_geolocationController(new GeolocationController(this, geolocationControllerClient))
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ , m_deviceOrientation(new DeviceOrientation(this, deviceOrientationClient))
+#endif
, m_settings(new Settings(this))
, m_progress(new ProgressTracker)
, m_backForwardList(BackForwardList::create(this))
@@ -173,6 +181,9 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
UNUSED_PARAM(geolocationControllerClient);
#endif
+#if !ENABLE(CLIENT_DEVICE_ORIENTATION)
+ UNUSED_PARAM(deviceOrientationClient);
+#endif
if (!allPages) {
allPages = new HashSet<Page*>;
diff --git a/WebCore/page/Page.h b/WebCore/page/Page.h
index f38c3b7..aa7bae1 100644
--- a/WebCore/page/Page.h
+++ b/WebCore/page/Page.h
@@ -42,6 +42,8 @@ namespace WebCore {
class ChromeClient;
class ContextMenuClient;
class ContextMenuController;
+ class DeviceOrientation;
+ class DeviceOrientationClient;
class Document;
class DragClient;
class DragController;
@@ -85,7 +87,7 @@ namespace WebCore {
public:
static void setNeedsReapplyStyles();
- Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*, PluginHalterClient*, GeolocationControllerClient*);
+ Page(ChromeClient*, ContextMenuClient*, EditorClient*, DragClient*, InspectorClient*, PluginHalterClient*, GeolocationControllerClient*, DeviceOrientationClient*);
~Page();
RenderTheme* theme() const { return m_theme.get(); };
@@ -145,6 +147,9 @@ namespace WebCore {
#if ENABLE(CLIENT_BASED_GEOLOCATION)
GeolocationController* geolocationController() const { return m_geolocationController.get(); }
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ DeviceOrientation* deviceOrientation() const { return m_deviceOrientation.get(); }
+#endif
Settings* settings() const { return m_settings.get(); }
ProgressTracker* progress() const { return m_progress.get(); }
@@ -253,6 +258,9 @@ namespace WebCore {
#if ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationController> m_geolocationController;
#endif
+#if ENABLE(DEVICE_ORIENTATION)
+ OwnPtr<DeviceOrientation> m_deviceOrientation;
+#endif
OwnPtr<Settings> m_settings;
OwnPtr<ProgressTracker> m_progress;
diff --git a/WebCore/page/SecurityOrigin.h b/WebCore/page/SecurityOrigin.h
index a6c3a7a..2254096 100644
--- a/WebCore/page/SecurityOrigin.h
+++ b/WebCore/page/SecurityOrigin.h
@@ -119,6 +119,7 @@ public:
bool canAccessDatabase() const { return !isUnique(); }
bool canAccessLocalStorage() const { return !isUnique(); }
bool canAccessCookies() const { return !isUnique(); }
+ bool canAccessPasswordManager() const { return !isUnique(); }
// Technically, we should always allow access to sessionStorage, but we
// currently don't handle creating a sessionStorage area for unique
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index 58c9629..883875b 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -144,9 +144,13 @@ Settings::Settings(Page* page)
, m_webGLEnabled(false)
, m_loadDeferringEnabled(true)
, m_tiledBackingStoreEnabled(false)
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
#endif
+=======
+ , m_html5ParserEnabled(false)
+>>>>>>> webkit.org at r60074
{
// A Frame may not have been created yet, so we initialize the AtomicString
// hash before trying to use it.
diff --git a/WebCore/page/Settings.h b/WebCore/page/Settings.h
index 5f567c2..9b76517 100644
--- a/WebCore/page/Settings.h
+++ b/WebCore/page/Settings.h
@@ -374,6 +374,9 @@ namespace WebCore {
void setTiledBackingStoreEnabled(bool);
bool tiledBackingStoreEnabled() const { return m_tiledBackingStoreEnabled; }
+ void setHTML5ParserEnabled(bool flag) { m_html5ParserEnabled = flag; }
+ bool html5ParserEnabled() const { return m_html5ParserEnabled; }
+
private:
Page* m_page;
@@ -490,9 +493,13 @@ namespace WebCore {
bool m_webGLEnabled : 1;
bool m_loadDeferringEnabled : 1;
bool m_tiledBackingStoreEnabled : 1;
+<<<<<<< HEAD
#ifdef ANDROID_PLUGINS
bool m_pluginsOnDemand : 1;
#endif
+=======
+ bool m_html5ParserEnabled: 1;
+>>>>>>> webkit.org at r60074
#if USE(SAFARI_THEME)
static bool gShouldPaintNativeControls;
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index a49c754..6ab56e9 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -562,7 +562,7 @@ static int gPropertyWrapperMap[numCSSProperties];
static const int cInvalidPropertyWrapperIndex = -1;
-static void ensurePropertyMap()
+void AnimationBase::ensurePropertyMap()
{
// FIXME: This data is never destroyed. Maybe we should ref count it and toss it when the last AnimationController is destroyed?
if (gPropertyWrappers == 0) {
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index a957119..ac55a2b 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -225,6 +225,9 @@ protected:
double m_totalDuration, m_nextIterationDuration;
AnimationBase* m_next;
+
+private:
+ static void ensurePropertyMap();
};
} // namespace WebCore
diff --git a/WebCore/page/brew/DragControllerBrew.cpp b/WebCore/page/brew/DragControllerBrew.cpp
new file mode 100644
index 0000000..ef89821
--- /dev/null
+++ b/WebCore/page/brew/DragControllerBrew.cpp
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2010 Company 100, Inc.
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#include "config.h"
+#include "DragController.h"
+
+#include "DragData.h"
+
+namespace WebCore {
+
+// FIXME: These values are straight out of DragControllerMac, so probably have
+// little correlation with BREW standards...
+const int DragController::LinkDragBorderInset = 2;
+const int DragController::MaxOriginalImageArea = 1500 * 1500;
+const int DragController::DragIconRightInset = 7;
+const int DragController::DragIconBottomInset = 3;
+
+const float DragController::DragImageAlpha = 0.75f;
+
+
+bool DragController::isCopyKeyDown()
+{
+ return false;
+}
+
+DragOperation DragController::dragOperation(DragData* dragData)
+{
+ // FIXME: This logic is incomplete
+ if (dragData->containsURL())
+ return DragOperationCopy;
+
+ return DragOperationNone;
+}
+
+const IntSize& DragController::maxDragImageSize()
+{
+ static const IntSize maxDragImageSize(400, 400);
+
+ return maxDragImageSize;
+}
+
+void DragController::cleanupAfterSystemDrag()
+{
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/page/mac/FrameMac.mm b/WebCore/page/mac/FrameMac.mm
index 356503f..bb11ac9 100644
--- a/WebCore/page/mac/FrameMac.mm
+++ b/WebCore/page/mac/FrameMac.mm
@@ -407,14 +407,14 @@ NSDictionary* Frame::fontAttributesForSelectionStart() const
NSMutableDictionary* result = [NSMutableDictionary dictionary];
- if (style->backgroundColor().isValid() && style->backgroundColor().alpha() != 0)
- [result setObject:nsColor(style->backgroundColor()) forKey:NSBackgroundColorAttributeName];
+ if (style->visitedDependentColor(CSSPropertyBackgroundColor).isValid() && style->visitedDependentColor(CSSPropertyBackgroundColor).alpha() != 0)
+ [result setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName];
if (style->font().primaryFont()->getNSFont())
[result setObject:style->font().primaryFont()->getNSFont() forKey:NSFontAttributeName];
- if (style->color().isValid() && style->color() != Color::black)
- [result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName];
+ if (style->visitedDependentColor(CSSPropertyColor).isValid() && style->visitedDependentColor(CSSPropertyColor) != Color::black)
+ [result setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName];
const ShadowData* shadow = style->textShadow();
if (shadow) {
diff --git a/WebCore/page/qt/EventHandlerQt.cpp b/WebCore/page/qt/EventHandlerQt.cpp
index 5b24eae..ace8e54 100644
--- a/WebCore/page/qt/EventHandlerQt.cpp
+++ b/WebCore/page/qt/EventHandlerQt.cpp
@@ -56,7 +56,11 @@ QT_END_NAMESPACE
namespace WebCore {
+#if defined(Q_WS_MAC)
+const double EventHandler::TextDragDelay = 0.15;
+#else
const double EventHandler::TextDragDelay = 0.0;
+#endif
static bool isKeyboardOptionTab(KeyboardEvent* event)
{