summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/page
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/page')
-rw-r--r--src/3rdparty/webkit/WebCore/page/BarInfo.cpp28
-rw-r--r--src/3rdparty/webkit/WebCore/page/Chrome.cpp50
-rw-r--r--src/3rdparty/webkit/WebCore/page/ChromeClient.h11
-rw-r--r--src/3rdparty/webkit/WebCore/page/Console.cpp84
-rw-r--r--src/3rdparty/webkit/WebCore/page/ContextMenuController.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/Coordinates.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMSelection.cpp14
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMSelection.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMTimer.cpp35
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMTimer.h60
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.cpp14
-rw-r--r--src/3rdparty/webkit/WebCore/page/DOMWindow.idl1
-rw-r--r--src/3rdparty/webkit/WebCore/page/DragController.cpp212
-rw-r--r--src/3rdparty/webkit/WebCore/page/EventHandler.cpp53
-rw-r--r--src/3rdparty/webkit/WebCore/page/EventHandler.h9
-rw-r--r--src/3rdparty/webkit/WebCore/page/Frame.cpp193
-rw-r--r--src/3rdparty/webkit/WebCore/page/Frame.h456
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameTree.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.cpp13
-rw-r--r--src/3rdparty/webkit/WebCore/page/FrameView.h6
-rw-r--r--src/3rdparty/webkit/WebCore/page/NavigatorBase.cpp14
-rw-r--r--src/3rdparty/webkit/WebCore/page/Page.cpp2
-rw-r--r--src/3rdparty/webkit/WebCore/page/Page.h4
-rw-r--r--src/3rdparty/webkit/WebCore/page/PageGroup.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/PageGroupLoadDeferrer.h2
-rw-r--r--src/3rdparty/webkit/WebCore/page/Settings.cpp6
-rw-r--r--src/3rdparty/webkit/WebCore/page/Settings.h4
-rw-r--r--src/3rdparty/webkit/WebCore/page/XSSAuditor.cpp69
-rw-r--r--src/3rdparty/webkit/WebCore/page/XSSAuditor.h16
-rw-r--r--src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp20
-rw-r--r--src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp77
-rw-r--r--src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp151
-rw-r--r--src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp43
33 files changed, 1013 insertions, 644 deletions
diff --git a/src/3rdparty/webkit/WebCore/page/BarInfo.cpp b/src/3rdparty/webkit/WebCore/page/BarInfo.cpp
index f6a1210..0f6cad5 100644
--- a/src/3rdparty/webkit/WebCore/page/BarInfo.cpp
+++ b/src/3rdparty/webkit/WebCore/page/BarInfo.cpp
@@ -62,20 +62,20 @@ bool BarInfo::visible() const
return false;
switch (m_type) {
- case Locationbar:
- return m_frame->page()->chrome()->toolbarsVisible();
- case Toolbar:
- return m_frame->page()->chrome()->toolbarsVisible();
- case Personalbar:
- return m_frame->page()->chrome()->toolbarsVisible();
- case Menubar:
- return m_frame->page()->chrome()->menubarVisible();
- case Scrollbars:
- return m_frame->page()->chrome()->scrollbarsVisible();
- case Statusbar:
- return m_frame->page()->chrome()->statusbarVisible();
- default:
- return false;
+ case Locationbar:
+ return m_frame->page()->chrome()->toolbarsVisible();
+ case Toolbar:
+ return m_frame->page()->chrome()->toolbarsVisible();
+ case Personalbar:
+ return m_frame->page()->chrome()->toolbarsVisible();
+ case Menubar:
+ return m_frame->page()->chrome()->menubarVisible();
+ case Scrollbars:
+ return m_frame->page()->chrome()->scrollbarsVisible();
+ case Statusbar:
+ return m_frame->page()->chrome()->statusbarVisible();
+ default:
+ return false;
}
}
diff --git a/src/3rdparty/webkit/WebCore/page/Chrome.cpp b/src/3rdparty/webkit/WebCore/page/Chrome.cpp
index 2170723..5a5670e 100644
--- a/src/3rdparty/webkit/WebCore/page/Chrome.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Chrome.cpp
@@ -36,6 +36,7 @@
#include "InspectorController.h"
#include "Page.h"
#include "PageGroupLoadDeferrer.h"
+#include "RenderObject.h"
#include "ResourceHandle.h"
#include "ScriptController.h"
#include "SecurityOrigin.h"
@@ -115,12 +116,12 @@ FloatRect Chrome::pageRect() const
{
return m_client->pageRect();
}
-
+
float Chrome::scaleFactor()
{
return m_client->scaleFactor();
}
-
+
void Chrome::focus() const
{
m_client->focus();
@@ -140,7 +141,7 @@ void Chrome::takeFocus(FocusDirection direction) const
{
m_client->takeFocus(direction);
}
-
+
Page* Chrome::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& features) const
{
Page* newPage = m_client->createWindow(frame, request, features);
@@ -234,7 +235,7 @@ bool Chrome::canRunBeforeUnloadConfirmPanel()
bool Chrome::runBeforeUnloadConfirmPanel(const String& message, Frame* frame)
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
@@ -248,7 +249,7 @@ void Chrome::closeWindowSoon()
void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
@@ -258,7 +259,7 @@ void Chrome::runJavaScriptAlert(Frame* frame, const String& message)
bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
@@ -268,16 +269,16 @@ bool Chrome::runJavaScriptConfirm(Frame* frame, const String& message)
bool Chrome::runJavaScriptPrompt(Frame* frame, const String& prompt, const String& defaultValue, String& result)
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
ASSERT(frame);
bool ok = m_client->runJavaScriptPrompt(frame, frame->displayStringModifiedByEncoding(prompt), frame->displayStringModifiedByEncoding(defaultValue), result);
-
+
if (ok)
result = frame->displayStringModifiedByEncoding(result);
-
+
return ok;
}
@@ -289,7 +290,7 @@ void Chrome::setStatusbarText(Frame* frame, const String& status)
bool Chrome::shouldInterruptJavaScript()
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
@@ -317,7 +318,8 @@ void Chrome::mouseDidMoveOverElement(const HitTestResult& result, unsigned modif
void Chrome::setToolTip(const HitTestResult& result)
{
// First priority is a potential toolTip representing a spelling or grammar error
- String toolTip = result.spellingToolTip();
+ TextDirection toolTipDirection;
+ String toolTip = result.spellingToolTip(toolTipDirection);
// Next priority is a toolTip from a URL beneath the mouse (if preference is set to show those).
if (toolTip.isEmpty() && m_page->settings()->showsURLsInToolTips()) {
@@ -326,20 +328,28 @@ void Chrome::setToolTip(const HitTestResult& result)
if (node->hasTagName(inputTag)) {
HTMLInputElement* input = static_cast<HTMLInputElement*>(node);
if (input->inputType() == HTMLInputElement::SUBMIT)
- if (HTMLFormElement* form = input->form())
+ if (HTMLFormElement* form = input->form()) {
toolTip = form->action();
+ if (form->renderer())
+ toolTipDirection = form->renderer()->style()->direction();
+ else
+ toolTipDirection = LTR;
+ }
}
}
// Get tooltip representing link's URL
- if (toolTip.isEmpty())
+ if (toolTip.isEmpty()) {
// FIXME: Need to pass this URL through userVisibleString once that's in WebCore
toolTip = result.absoluteLinkURL().string();
+ // URL always display as LTR.
+ toolTipDirection = LTR;
+ }
}
// Next we'll consider a tooltip for element with "title" attribute
if (toolTip.isEmpty())
- toolTip = result.title();
+ toolTip = result.title(toolTipDirection);
// Lastly, for <input type="file"> that allow multiple files, we'll consider a tooltip for the selected filenames
if (toolTip.isEmpty()) {
@@ -357,13 +367,15 @@ void Chrome::setToolTip(const HitTestResult& result)
names.append('\n');
}
toolTip = String::adopt(names);
+ // filename always display as LTR.
+ toolTipDirection = LTR;
}
}
}
}
}
-
- m_client->setToolTip(toolTip);
+
+ m_client->setToolTip(toolTip, toolTipDirection);
}
void Chrome::print(Frame* frame)
@@ -373,7 +385,7 @@ void Chrome::print(Frame* frame)
void Chrome::requestGeolocationPermissionForFrame(Frame* frame, Geolocation* geolocation)
{
- // Defer loads in case the client method runs a new event loop that would
+ // Defer loads in case the client method runs a new event loop that would
// otherwise cause the load to continue while we're in the middle of executing JavaScript.
PageGroupLoadDeferrer deferrer(m_page, true);
@@ -420,10 +432,10 @@ bool ChromeClient::shouldReplaceWithGeneratedFileForUpload(const String&, String
String ChromeClient::generateReplacementFile(const String&)
{
ASSERT_NOT_REACHED();
- return String();
+ return String();
}
-bool ChromeClient::paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
+bool ChromeClient::paintCustomScrollbar(GraphicsContext*, const FloatRect&, ScrollbarControlSize,
ScrollbarControlState, ScrollbarPart, bool,
float, float, ScrollbarControlPartMask)
{
diff --git a/src/3rdparty/webkit/WebCore/page/ChromeClient.h b/src/3rdparty/webkit/WebCore/page/ChromeClient.h
index 78efa45..2a90611 100644
--- a/src/3rdparty/webkit/WebCore/page/ChromeClient.h
+++ b/src/3rdparty/webkit/WebCore/page/ChromeClient.h
@@ -131,7 +131,7 @@ namespace WebCore {
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags) = 0;
- virtual void setToolTip(const String&) = 0;
+ virtual void setToolTip(const String&, TextDirection) = 0;
virtual void print(Frame*) = 0;
@@ -139,6 +139,15 @@ namespace WebCore {
virtual void exceededDatabaseQuota(Frame*, const String& databaseName) = 0;
#endif
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ // Callback invoked when the application cache fails to save a cache object
+ // because storing it would grow the database file past its defined maximum
+ // size or past the amount of free space on the device.
+ // The chrome client would need to take some action such as evicting some
+ // old caches.
+ virtual void reachedMaxAppCacheSize(int64_t spaceNeeded) = 0;
+#endif
+
#if ENABLE(DASHBOARD_SUPPORT)
virtual void dashboardRegionsChanged();
#endif
diff --git a/src/3rdparty/webkit/WebCore/page/Console.cpp b/src/3rdparty/webkit/WebCore/page/Console.cpp
index 45ff059..de7bc72 100644
--- a/src/3rdparty/webkit/WebCore/page/Console.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Console.cpp
@@ -29,8 +29,8 @@
#include "config.h"
#include "Console.h"
-#include "ChromeClient.h"
#include "CString.h"
+#include "ChromeClient.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameTree.h"
@@ -90,48 +90,48 @@ static void printMessageSourceAndLevelPrefix(MessageSource source, MessageLevel
{
const char* sourceString;
switch (source) {
- case HTMLMessageSource:
- sourceString = "HTML";
- break;
- case WMLMessageSource:
- sourceString = "WML";
- break;
- case XMLMessageSource:
- sourceString = "XML";
- break;
- case JSMessageSource:
- sourceString = "JS";
- break;
- case CSSMessageSource:
- sourceString = "CSS";
- break;
- case OtherMessageSource:
- sourceString = "OTHER";
- break;
- default:
- ASSERT_NOT_REACHED();
- sourceString = "UNKNOWN";
- break;
+ case HTMLMessageSource:
+ sourceString = "HTML";
+ break;
+ case WMLMessageSource:
+ sourceString = "WML";
+ break;
+ case XMLMessageSource:
+ sourceString = "XML";
+ break;
+ case JSMessageSource:
+ sourceString = "JS";
+ break;
+ case CSSMessageSource:
+ sourceString = "CSS";
+ break;
+ case OtherMessageSource:
+ sourceString = "OTHER";
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ sourceString = "UNKNOWN";
+ break;
}
const char* levelString;
switch (level) {
- case TipMessageLevel:
- levelString = "TIP";
- break;
- case LogMessageLevel:
- levelString = "LOG";
- break;
- case WarningMessageLevel:
- levelString = "WARN";
- break;
- case ErrorMessageLevel:
- levelString = "ERROR";
- break;
- default:
- ASSERT_NOT_REACHED();
- levelString = "UNKNOWN";
- break;
+ case TipMessageLevel:
+ levelString = "TIP";
+ break;
+ case LogMessageLevel:
+ levelString = "LOG";
+ break;
+ case WarningMessageLevel:
+ levelString = "WARN";
+ break;
+ case ErrorMessageLevel:
+ levelString = "ERROR";
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ levelString = "UNKNOWN";
+ break;
}
printf("%s %s:", sourceString, levelString);
@@ -267,7 +267,7 @@ void Console::profile(const JSC::UString& title, ScriptCallStack* callStack)
return;
InspectorController* controller = page->inspectorController();
- // FIXME: log a console message when profiling is disabled.
+ // FIXME: log a console message when profiling is disabled.
if (!controller->profilerEnabled())
return;
@@ -305,7 +305,7 @@ void Console::profileEnd(const JSC::UString& title, ScriptCallStack* callStack)
}
#endif
-
+
void Console::time(const String& title)
{
Page* page = this->page();
@@ -316,7 +316,7 @@ void Console::time(const String& title)
// undefined for timing functions
if (title.isNull())
return;
-
+
page->inspectorController()->startTiming(title);
}
diff --git a/src/3rdparty/webkit/WebCore/page/ContextMenuController.h b/src/3rdparty/webkit/WebCore/page/ContextMenuController.h
index cb7e6ee..38095f6 100644
--- a/src/3rdparty/webkit/WebCore/page/ContextMenuController.h
+++ b/src/3rdparty/webkit/WebCore/page/ContextMenuController.h
@@ -37,7 +37,7 @@ namespace WebCore {
class Event;
class Page;
- class ContextMenuController : Noncopyable {
+ class ContextMenuController : public Noncopyable {
public:
ContextMenuController(Page*, ContextMenuClient*);
~ContextMenuController();
diff --git a/src/3rdparty/webkit/WebCore/page/Coordinates.cpp b/src/3rdparty/webkit/WebCore/page/Coordinates.cpp
index 637a8c2..728882a 100644
--- a/src/3rdparty/webkit/WebCore/page/Coordinates.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Coordinates.cpp
@@ -31,7 +31,7 @@ namespace WebCore {
String Coordinates::toString() const
{
return String::format("coordinate(%.6lg, %.6lg, %.6lg, %.6lg, %.6lg, %.6lg, %.6lg)",
- m_latitude, m_longitude, m_altitude, m_accuracy,
+ m_latitude, m_longitude, m_altitude, m_accuracy,
m_altitudeAccuracy, m_heading, m_speed);
}
diff --git a/src/3rdparty/webkit/WebCore/page/DOMSelection.cpp b/src/3rdparty/webkit/WebCore/page/DOMSelection.cpp
index 3b54f02..23c695e 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMSelection.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DOMSelection.cpp
@@ -32,12 +32,12 @@
#include "ExceptionCode.h"
#include "Frame.h"
-#include "htmlediting.h"
#include "Node.h"
#include "PlatformString.h"
#include "Range.h"
#include "SelectionController.h"
#include "TextIterator.h"
+#include "htmlediting.h"
namespace WebCore {
@@ -220,7 +220,7 @@ void DOMSelection::setBaseAndExtent(Node* baseNode, int baseOffset, Node* extent
}
VisiblePosition visibleBase = VisiblePosition(baseNode, baseOffset, DOWNSTREAM);
VisiblePosition visibleExtent = VisiblePosition(extentNode, extentOffset, DOWNSTREAM);
-
+
m_frame->selection()->moveTo(visibleBase, visibleExtent);
}
@@ -245,9 +245,9 @@ void DOMSelection::modify(const String& alterString, const String& directionStri
alter = SelectionController::EXTEND;
else if (equalIgnoringCase(alterString, "move"))
alter = SelectionController::MOVE;
- else
+ else
return;
-
+
SelectionController::EDirection direction;
if (equalIgnoringCase(directionString, "forward"))
direction = SelectionController::FORWARD;
@@ -259,7 +259,7 @@ void DOMSelection::modify(const String& alterString, const String& directionStri
direction = SelectionController::RIGHT;
else
return;
-
+
TextGranularity granularity;
if (equalIgnoringCase(granularityString, "character"))
granularity = CharacterGranularity;
@@ -336,7 +336,7 @@ void DOMSelection::addRange(Range* r)
return;
SelectionController* selection = m_frame->selection();
-
+
if (selection->isNone()) {
selection->setSelection(VisibleSelection(r));
return;
@@ -385,7 +385,7 @@ void DOMSelection::deleteFromDocument()
ExceptionCode ec = 0;
selectedRange->deleteContents(ec);
ASSERT(!ec);
-
+
setBaseAndExtent(selectedRange->startContainer(ec), selectedRange->startOffset(ec), selectedRange->startContainer(ec), selectedRange->startOffset(ec), ec);
ASSERT(!ec);
}
diff --git a/src/3rdparty/webkit/WebCore/page/DOMSelection.h b/src/3rdparty/webkit/WebCore/page/DOMSelection.h
index 6a914d6..e0fe1e3 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMSelection.h
+++ b/src/3rdparty/webkit/WebCore/page/DOMSelection.h
@@ -30,9 +30,9 @@
#ifndef DOMSelection_h
#define DOMSelection_h
-#include <wtf/RefCounted.h>
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
namespace WebCore {
diff --git a/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp b/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp
index 1cc7730..c42a0dc 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp
@@ -54,7 +54,7 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, ScheduledAction* action, int
if (lastUsedTimeoutId <= 0)
lastUsedTimeoutId = 1;
m_timeoutId = lastUsedTimeoutId;
-
+
m_nestingLevel = timerNestingLevel + 1;
scriptExecutionContext()->addTimeout(m_timeoutId, this);
@@ -74,11 +74,10 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, ScheduledAction* action, int
DOMTimer::~DOMTimer()
{
- if (scriptExecutionContext()) {
+ if (scriptExecutionContext())
scriptExecutionContext()->removeTimeout(m_timeoutId);
- }
}
-
+
int DOMTimer::install(ScriptExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot)
{
// DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'.
@@ -110,7 +109,7 @@ void DOMTimer::fired()
if (m_nestingLevel >= maxTimerNestingLevel)
augmentRepeatInterval(s_minTimerInterval - repeatInterval());
}
-
+
// No access to member variables after this point, it can delete the timer.
m_action->execute(context);
return;
@@ -121,7 +120,7 @@ void DOMTimer::fired()
// No access to member variables after this point.
delete this;
-
+
action->execute(context);
delete action;
timerNestingLevel = 0;
@@ -147,24 +146,24 @@ void DOMTimer::stop()
m_action.clear();
}
-void DOMTimer::suspend()
-{
- ASSERT(m_nextFireInterval == 0 && m_repeatInterval == 0);
+void DOMTimer::suspend()
+{
+ ASSERT(!m_nextFireInterval && !m_repeatInterval);
m_nextFireInterval = nextFireInterval();
m_repeatInterval = repeatInterval();
TimerBase::stop();
-}
-
-void DOMTimer::resume()
-{
+}
+
+void DOMTimer::resume()
+{
start(m_nextFireInterval, m_repeatInterval);
m_nextFireInterval = 0;
m_repeatInterval = 0;
-}
-
-
-bool DOMTimer::canSuspend() const
-{
+}
+
+
+bool DOMTimer::canSuspend() const
+{
return true;
}
diff --git a/src/3rdparty/webkit/WebCore/page/DOMTimer.h b/src/3rdparty/webkit/WebCore/page/DOMTimer.h
index f6343fc..6d6271f 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMTimer.h
+++ b/src/3rdparty/webkit/WebCore/page/DOMTimer.h
@@ -33,41 +33,41 @@
namespace WebCore {
-class ScheduledAction;
+ 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 void removeById(ScriptExecutionContext*, int timeoutId);
+ 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 void removeById(ScriptExecutionContext*, int timeoutId);
- // ActiveDOMObject
- virtual bool hasPendingActivity() const;
- virtual void contextDestroyed();
- virtual void stop();
- virtual bool canSuspend() const;
- virtual void suspend();
- virtual void resume();
+ // ActiveDOMObject
+ virtual bool hasPendingActivity() const;
+ virtual void contextDestroyed();
+ virtual void stop();
+ virtual bool canSuspend() const;
+ virtual void suspend();
+ virtual void resume();
- // The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
- // Default is 10ms.
- // Chromium uses a non-default timeout.
- static double minTimerInterval() { return s_minTimerInterval; }
- static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
+ // The lowest allowable timer setting (in seconds, 0.001 == 1 ms).
+ // Default is 10ms.
+ // Chromium uses a non-default timeout.
+ static double minTimerInterval() { return s_minTimerInterval; }
+ static void setMinTimerInterval(double value) { s_minTimerInterval = value; }
-private:
- DOMTimer(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
- virtual void fired();
+ private:
+ DOMTimer(ScriptExecutionContext*, ScheduledAction*, int timeout, bool singleShot);
+ virtual void fired();
- int m_timeoutId;
- int m_nestingLevel;
- OwnPtr<ScheduledAction> m_action;
- double m_nextFireInterval;
- double m_repeatInterval;
- static double s_minTimerInterval;
-};
+ int m_timeoutId;
+ int m_nestingLevel;
+ OwnPtr<ScheduledAction> m_action;
+ double m_nextFireInterval;
+ double m_repeatInterval;
+ static double s_minTimerInterval;
+ };
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
index 8e64fe3..e8f9004 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.cpp
@@ -546,12 +546,17 @@ Storage* DOMWindow::sessionStorage() const
{
if (m_sessionStorage)
return m_sessionStorage.get();
-
- Page* page = m_frame->page();
+
+ Document* document = this->document();
+ if (!document)
+ return 0;
+
+ Page* page = document->page();
if (!page)
return 0;
- Document* document = m_frame->document();
+ if (!page->settings()->sessionStorageEnabled())
+ return 0;
RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
page->inspectorController()->didUseDOMStorage(storageArea.get(), false, m_frame);
@@ -573,8 +578,7 @@ Storage* DOMWindow::localStorage() const
if (!page)
return 0;
- Settings* settings = document->settings();
- if (!settings || !settings->localStorageEnabled())
+ if (!page->settings()->localStorageEnabled())
return 0;
StorageNamespace* localStorage = page->group().localStorage();
diff --git a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
index bfdebd4..e1c9ff0 100644
--- a/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
+++ b/src/3rdparty/webkit/WebCore/page/DOMWindow.idl
@@ -304,6 +304,7 @@ module window {
attribute CounterConstructor Counter;
attribute CSSRuleListConstructor CSSRuleList;
attribute RectConstructor Rect;
+ attribute RGBColorConstructor RGBColor;
attribute StyleSheetListConstructor StyleSheetList;
// FIXME: Implement the commented-out global constructors for interfaces listed in DOM Level 3 Core specification.
diff --git a/src/3rdparty/webkit/WebCore/page/DragController.cpp b/src/3rdparty/webkit/WebCore/page/DragController.cpp
index 2fe5d97..64cb212 100644
--- a/src/3rdparty/webkit/WebCore/page/DragController.cpp
+++ b/src/3rdparty/webkit/WebCore/page/DragController.cpp
@@ -72,7 +72,7 @@ static PlatformMouseEvent createMouseEvent(DragData* dragData)
LeftButton, MouseEventMoved, 0, false, false, false, false, currentTime());
}
-
+
DragController::DragController(Page* page, DragClient* client)
: m_page(page)
, m_client(client)
@@ -85,12 +85,12 @@ DragController::DragController(Page* page, DragClient* client)
, m_sourceDragOperation(DragOperationNone)
{
}
-
+
DragController::~DragController()
-{
+{
m_client->dragControllerDestroyed();
}
-
+
static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragData, RefPtr<Range> context,
bool allowPlainText, bool& chosePlainText)
{
@@ -122,7 +122,7 @@ static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData* dragD
chosePlainText = true;
return createFragmentFromText(context.get(), dragData->asPlainText()).get();
}
-
+
return 0;
}
@@ -140,20 +140,20 @@ void DragController::cancelDrag()
void DragController::dragEnded()
{
m_dragInitiator = 0;
- m_didInitiateDrag = false;
- m_page->dragCaretController()->clear();
-}
+ m_didInitiateDrag = false;
+ m_page->dragCaretController()->clear();
+}
-DragOperation DragController::dragEntered(DragData* dragData)
+DragOperation DragController::dragEntered(DragData* dragData)
{
return dragEnteredOrUpdated(dragData);
}
-
-void DragController::dragExited(DragData* dragData)
-{
+
+void DragController::dragExited(DragData* dragData)
+{
ASSERT(dragData);
Frame* mainFrame = m_page->mainFrame();
-
+
if (RefPtr<FrameView> v = mainFrame->view()) {
ClipboardAccessPolicy policy = (!m_documentUnderMouse || m_documentUnderMouse->securityOrigin()->isLocal()) ? ClipboardReadable : ClipboardTypesReadable;
RefPtr<Clipboard> clipboard = dragData->createClipboard(policy);
@@ -164,14 +164,13 @@ void DragController::dragExited(DragData* dragData)
mouseMovedIntoDocument(0);
}
-
-DragOperation DragController::dragUpdated(DragData* dragData)
+DragOperation DragController::dragUpdated(DragData* dragData)
{
return dragEnteredOrUpdated(dragData);
}
-
+
bool DragController::performDrag(DragData* dragData)
-{
+{
ASSERT(dragData);
m_documentUnderMouse = m_page->mainFrame()->documentAtPoint(dragData->clientPosition());
if (m_isHandlingDrag) {
@@ -187,13 +186,13 @@ bool DragController::performDrag(DragData* dragData)
}
m_documentUnderMouse = 0;
return true;
- }
-
+ }
+
if ((m_dragDestinationAction & DragDestinationActionEdit) && concludeEditDrag(dragData)) {
m_documentUnderMouse = 0;
return true;
}
-
+
m_documentUnderMouse = 0;
if (operationForLoad(dragData) == DragOperationNone)
@@ -237,30 +236,30 @@ DragOperation DragController::dragEnteredOrUpdated(DragData* dragData)
static HTMLInputElement* asFileInput(Node* node)
{
ASSERT(node);
-
+
// The button for a FILE input is a sub element with no set input type
// In order to get around this problem we assume any non-FILE input element
// is this internal button, and try querying the shadow parent node.
if (node->hasTagName(HTMLNames::inputTag) && node->isShadowNode() && static_cast<HTMLInputElement*>(node)->inputType() != HTMLInputElement::FILE)
node = node->shadowParentNode();
-
+
if (!node || !node->hasTagName(HTMLNames::inputTag))
return 0;
-
+
HTMLInputElement* inputElem = static_cast<HTMLInputElement*>(node);
if (inputElem->inputType() == HTMLInputElement::FILE)
return inputElem;
-
+
return 0;
}
-
+
bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction actionMask, DragOperation& operation)
{
ASSERT(dragData);
-
+
if (!m_documentUnderMouse)
return false;
-
+
m_isHandlingDrag = false;
if (actionMask & DragDestinationActionDHTML) {
m_isHandlingDrag = tryDHTMLDrag(dragData, operation);
@@ -289,7 +288,7 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a
operation = DragOperationGeneric;
return true;
}
-
+
IntPoint dragPos = dragData->clientPosition();
IntPoint point = frameView->windowToContents(dragPos);
Element* element = m_documentUnderMouse->elementFromPoint(point.x(), point.y());
@@ -307,11 +306,11 @@ bool DragController::tryDocumentDrag(DragData* dragData, DragDestinationAction a
}
DragSourceAction DragController::delegateDragSourceAction(const IntPoint& windowPoint)
-{
+{
m_dragSourceAction = m_client->dragSourceActionMaskForPoint(windowPoint);
return m_dragSourceAction;
}
-
+
DragOperation DragController::operationForLoad(DragData* dragData)
{
ASSERT(dragData);
@@ -336,15 +335,15 @@ bool DragController::concludeEditDrag(DragData* dragData)
{
ASSERT(dragData);
ASSERT(!m_isHandlingDrag);
-
+
if (!m_documentUnderMouse)
return false;
-
+
IntPoint point = m_documentUnderMouse->view()->windowToContents(dragData->clientPosition());
Element* element = m_documentUnderMouse->elementFromPoint(point.x(), point.y());
ASSERT(element);
Frame* innerFrame = element->ownerDocument()->frame();
- ASSERT(innerFrame);
+ ASSERT(innerFrame);
if (dragData->containsColor()) {
Color color = dragData->asColor();
@@ -362,32 +361,32 @@ bool DragController::concludeEditDrag(DragData* dragData)
innerFrame->editor()->applyStyle(style.get(), EditActionSetColor);
return true;
}
-
+
if (!m_page->dragController()->canProcessDrag(dragData)) {
m_page->dragCaretController()->clear();
return false;
}
-
+
if (HTMLInputElement* fileInput = asFileInput(element)) {
if (!fileInput->isEnabledFormControl())
return false;
-
+
if (!dragData->containsFiles())
return false;
-
+
Vector<String> filenames;
dragData->asFilenames(filenames);
if (filenames.isEmpty())
return false;
-
- // Ugly. For security none of the API's available to us to set the input value
+
+ // Ugly. For security none of the API's available to us to set the input value
// on file inputs. Even forcing a change in HTMLInputElement doesn't work as
// RenderFileUploadControl clears the file when doing updateFromElement()
RenderFileUploadControl* renderer = static_cast<RenderFileUploadControl*>(fileInput->renderer());
-
+
if (!renderer)
return false;
-
+
renderer->receiveDroppedFiles(filenames);
return true;
}
@@ -395,71 +394,70 @@ bool DragController::concludeEditDrag(DragData* dragData)
VisibleSelection dragCaret(m_page->dragCaretController()->selection());
m_page->dragCaretController()->clear();
RefPtr<Range> range = dragCaret.toNormalizedRange();
-
+
// For range to be null a WebKit client must have done something bad while
// manually controlling drag behaviour
- if (!range)
+ if (!range)
return false;
DocLoader* loader = range->ownerDocument()->docLoader();
loader->setAllowStaleResources(true);
- if (dragIsMove(innerFrame->selection()) || dragCaret.isContentRichlyEditable()) {
+ if (dragIsMove(innerFrame->selection()) || dragCaret.isContentRichlyEditable()) {
bool chosePlainText = false;
RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, range, true, chosePlainText);
if (!fragment || !innerFrame->editor()->shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
loader->setAllowStaleResources(false);
return false;
}
-
+
m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
if (dragIsMove(innerFrame->selection())) {
- bool smartMove = innerFrame->selectionGranularity() == WordGranularity
- && innerFrame->editor()->smartInsertDeleteEnabled()
+ bool smartMove = innerFrame->selectionGranularity() == WordGranularity
+ && innerFrame->editor()->smartInsertDeleteEnabled()
&& dragData->canSmartReplace();
applyCommand(MoveSelectionCommand::create(fragment, dragCaret.base(), smartMove));
} else {
if (setSelectionToDragCaret(innerFrame, dragCaret, range, point))
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse, fragment, true, dragData->canSmartReplace(), chosePlainText));
- }
+ applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse, fragment, true, dragData->canSmartReplace(), chosePlainText));
+ }
} else {
String text = dragData->asPlainText();
if (text.isEmpty() || !innerFrame->editor()->shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
loader->setAllowStaleResources(false);
return false;
}
-
+
m_client->willPerformDragDestinationAction(DragDestinationActionEdit, dragData);
if (setSelectionToDragCaret(innerFrame, dragCaret, range, point))
- applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse, createFragmentFromText(range.get(), text), true, false, true));
+ applyCommand(ReplaceSelectionCommand::create(m_documentUnderMouse, createFragmentFromText(range.get(), text), true, false, true));
}
loader->setAllowStaleResources(false);
return true;
}
-
-
-bool DragController::canProcessDrag(DragData* dragData)
+
+bool DragController::canProcessDrag(DragData* dragData)
{
ASSERT(dragData);
if (!dragData->containsCompatibleContent())
return false;
-
+
IntPoint point = m_page->mainFrame()->view()->windowToContents(dragData->clientPosition());
HitTestResult result = HitTestResult(point);
if (!m_page->mainFrame()->contentRenderer())
return false;
result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, true);
-
- if (!result.innerNonSharedNode())
+
+ if (!result.innerNonSharedNode())
return false;
-
+
if (dragData->containsFiles() && asFileInput(result.innerNonSharedNode()))
return true;
-
+
if (!result.innerNonSharedNode()->isContentEditable())
return false;
-
+
if (m_didInitiateDrag && m_documentUnderMouse == m_dragInitiator && result.isSelected())
return false;
@@ -482,7 +480,7 @@ static DragOperation defaultOperationForDrag(DragOperation srcOpMask)
}
bool DragController::tryDHTMLDrag(DragData* dragData, DragOperation& operation)
-{
+{
ASSERT(dragData);
ASSERT(m_documentUnderMouse);
RefPtr<Frame> mainFrame = m_page->mainFrame();
@@ -525,7 +523,7 @@ bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPo
mouseDownTarget = frame->eventHandler()->hitTestResultAtPoint(framePos, true);
- if (mouseDownTarget.image()
+ if (mouseDownTarget.image()
&& !mouseDownTarget.absoluteImageURL().isEmpty()
&& frame->settings()->loadsImagesAutomatically()
&& m_dragSourceAction & DragSourceActionImage)
@@ -543,56 +541,56 @@ bool DragController::mayStartDragAtEventLocation(const Frame* frame, const IntPo
return false;
}
-
+
static CachedImage* getCachedImage(Element* element)
{
ASSERT(element);
RenderObject* renderer = element->renderer();
- if (!renderer || !renderer->isImage())
+ if (!renderer || !renderer->isImage())
return 0;
RenderImage* image = toRenderImage(renderer);
return image->cachedImage();
}
-
+
static Image* getImage(Element* element)
{
ASSERT(element);
RenderObject* renderer = element->renderer();
- if (!renderer || !renderer->isImage())
+ if (!renderer || !renderer->isImage())
return 0;
-
+
RenderImage* image = toRenderImage(renderer);
if (image->cachedImage() && !image->cachedImage()->errorOccurred())
return image->cachedImage()->image();
return 0;
}
-
+
static void prepareClipboardForImageDrag(Frame* src, Clipboard* clipboard, Element* node, const KURL& linkURL, const KURL& imageURL, const String& label)
{
RefPtr<Range> range = src->document()->createRange();
ExceptionCode ec = 0;
range->selectNode(node, ec);
- ASSERT(ec == 0);
- src->selection()->setSelection(VisibleSelection(range.get(), DOWNSTREAM));
+ ASSERT(!ec);
+ src->selection()->setSelection(VisibleSelection(range.get(), DOWNSTREAM));
clipboard->declareAndWriteDragImage(node, !linkURL.isEmpty() ? linkURL : imageURL, label, src);
}
-
+
static IntPoint dragLocForDHTMLDrag(const IntPoint& mouseDraggedPoint, const IntPoint& dragOrigin, const IntPoint& dragImageOffset, bool isLinkImage)
{
// dragImageOffset is the cursor position relative to the lower-left corner of the image.
-#if PLATFORM(MAC)
- // We add in the Y dimension because we are a flipped view, so adding moves the image down.
+#if PLATFORM(MAC)
+ // We add in the Y dimension because we are a flipped view, so adding moves the image down.
const int yOffset = dragImageOffset.y();
#else
const int yOffset = -dragImageOffset.y();
#endif
-
+
if (isLinkImage)
return IntPoint(mouseDraggedPoint.x() - dragImageOffset.x(), mouseDraggedPoint.y() + yOffset);
-
+
return IntPoint(dragOrigin.x() - dragImageOffset.x(), dragOrigin.y() + yOffset);
}
-
+
static IntPoint dragLocForSelectionDrag(Frame* src)
{
IntRect draggingRect = enclosingIntRect(src->selectionBounds());
@@ -607,63 +605,63 @@ static IntPoint dragLocForSelectionDrag(Frame* src)
#endif
return IntPoint(xpos, ypos);
}
-
+
bool DragController::startDrag(Frame* src, Clipboard* clipboard, DragOperation srcOp, const PlatformMouseEvent& dragEvent, const IntPoint& dragOrigin, bool isDHTMLDrag)
-{
+{
ASSERT(src);
ASSERT(clipboard);
-
+
if (!src->view() || !src->contentRenderer())
return false;
-
+
HitTestResult dragSource = HitTestResult(dragOrigin);
dragSource = src->eventHandler()->hitTestResultAtPoint(dragOrigin, true);
KURL linkURL = dragSource.absoluteLinkURL();
KURL imageURL = dragSource.absoluteImageURL();
bool isSelected = dragSource.isSelected();
-
+
IntPoint mouseDraggedPoint = src->view()->windowToContents(dragEvent.pos());
-
+
m_draggingImageURL = KURL();
m_sourceDragOperation = srcOp;
-
+
DragImageRef dragImage = 0;
IntPoint dragLoc(0, 0);
IntPoint dragImageOffset(0, 0);
-
- if (isDHTMLDrag)
+
+ if (isDHTMLDrag)
dragImage = clipboard->createDragImage(dragImageOffset);
-
+
// We allow DHTML/JS to set the drag image, even if its a link, image or text we're dragging.
// This is in the spirit of the IE API, which allows overriding of pasteboard data and DragOp.
if (dragImage) {
dragLoc = dragLocForDHTMLDrag(mouseDraggedPoint, dragOrigin, dragImageOffset, !linkURL.isEmpty());
m_dragOffset = dragImageOffset;
}
-
+
bool startedDrag = true; // optimism - we almost always manage to start the drag
-
+
Node* node = dragSource.innerNonSharedNode();
-
+
Image* image = getImage(static_cast<Element*>(node));
if (!imageURL.isEmpty() && node && node->isElementNode() && image
&& (m_dragSourceAction & DragSourceActionImage)) {
- // We shouldn't be starting a drag for an image that can't provide an extension.
+ // We shouldn't be starting a drag for an image that can't provide an extension.
// This is an early detection for problems encountered later upon drop.
ASSERT(!image->filenameExtension().isEmpty());
Element* element = static_cast<Element*>(node);
if (!clipboard->hasData()) {
- m_draggingImageURL = imageURL;
+ m_draggingImageURL = imageURL;
prepareClipboardForImageDrag(src, clipboard, element, linkURL, imageURL, dragSource.altDisplayString());
}
-
+
m_client->willPerformDragSourceAction(DragSourceActionImage, dragOrigin, clipboard);
-
+
if (!dragImage) {
IntRect imageRect = dragSource.imageRect();
imageRect.setLocation(m_page->mainFrame()->view()->windowToContents(src->view()->contentsToWindow(imageRect.location())));
doImageDrag(element, dragOrigin, dragSource.imageRect(), clipboard, src, m_dragOffset);
- } else
+ } else
// DHTML defined drag image
doSystemDrag(dragImage, dragLoc, dragOrigin, clipboard, src, false);
@@ -689,12 +687,12 @@ bool DragController::startDrag(Frame* src, Clipboard* clipboard, DragOperation s
IntSize size = dragImageSize(dragImage);
m_dragOffset = IntPoint(-size.width() / 2, -LinkDragBorderInset);
dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDraggedPoint.y() + m_dragOffset.y());
- }
+ }
doSystemDrag(dragImage, dragLoc, mouseDraggedPoint, clipboard, src, true);
} else if (isSelected && (m_dragSourceAction & DragSourceActionSelection)) {
RefPtr<Range> selectionRange = src->selection()->toNormalizedRange();
ASSERT(selectionRange);
- if (!clipboard->hasData())
+ if (!clipboard->hasData())
clipboard->writeRange(selectionRange.get(), src);
m_client->willPerformDragSourceAction(DragSourceActionSelection, dragOrigin, clipboard);
if (!dragImage) {
@@ -712,7 +710,7 @@ bool DragController::startDrag(Frame* src, Clipboard* clipboard, DragOperation s
// under the mousedown point, so linkURL, imageURL and isSelected are all false/empty.
startedDrag = false;
}
-
+
if (dragImage)
deleteDragImage(dragImage);
return startedDrag;
@@ -723,17 +721,17 @@ void DragController::doImageDrag(Element* element, const IntPoint& dragOrigin, c
IntPoint mouseDownPoint = dragOrigin;
DragImageRef dragImage;
IntPoint origin;
-
+
Image* image = getImage(element);
if (image && image->size().height() * image->size().width() <= MaxOriginalImageArea
&& (dragImage = createDragImageFromImage(image))) {
IntSize originalSize = rect.size();
origin = rect.location();
-
+
dragImage = fitDragImageToMaxSize(dragImage, rect.size(), maxDragImageSize());
dragImage = dissolveDragImageToFraction(dragImage, DragImageAlpha);
IntSize newSize = dragImageSize(dragImage);
-
+
// Properly orient the drag image and orient it differently if it's smaller than the original
float scale = newSize.width() / (float)originalSize.width();
float dx = origin.x() - mouseDownPoint.x();
@@ -751,14 +749,14 @@ void DragController::doImageDrag(Element* element, const IntPoint& dragOrigin, c
if (dragImage)
origin = IntPoint(DragIconRightInset - dragImageSize(dragImage).width(), DragIconBottomInset);
}
-
+
dragImageOffset.setX(mouseDownPoint.x() + origin.x());
dragImageOffset.setY(mouseDownPoint.y() + origin.y());
doSystemDrag(dragImage, dragImageOffset, dragOrigin, clipboard, frame, false);
-
+
deleteDragImage(dragImage);
}
-
+
void DragController::doSystemDrag(DragImageRef image, const IntPoint& dragLoc, const IntPoint& eventPos, Clipboard* clipboard, Frame* frame, bool forLink)
{
m_didInitiateDrag = true;
@@ -768,10 +766,10 @@ void DragController::doSystemDrag(DragImageRef image, const IntPoint& dragLoc, c
RefPtr<FrameView> viewProtector = frameProtector->view();
m_client->startDrag(image, viewProtector->windowToContents(frame->view()->contentsToWindow(dragLoc)),
viewProtector->windowToContents(frame->view()->contentsToWindow(eventPos)), clipboard, frameProtector.get(), forLink);
-
+
cleanupAfterSystemDrag();
}
-
+
// Manual drag caret manipulation
void DragController::placeDragCaret(const IntPoint& windowPoint)
{
@@ -783,8 +781,8 @@ void DragController::placeDragCaret(const IntPoint& windowPoint)
if (!frameView)
return;
IntPoint framePoint = frameView->windowToContents(windowPoint);
- VisibleSelection dragCaret(frame->visiblePositionForPoint(framePoint));
+ VisibleSelection dragCaret(frame->visiblePositionForPoint(framePoint));
m_page->dragCaretController()->setSelection(dragCaret);
}
-
+
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
index 3f0296e..547485c 100644
--- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
+++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
@@ -141,6 +141,8 @@ EventHandler::EventHandler(Frame* frame)
, m_mouseDownWasSingleClickInSelection(false)
, m_beganSelectingText(false)
, m_panScrollInProgress(false)
+ , m_panScrollButtonPressed(false)
+ , m_springLoadedPanScrollInProgress(false)
, m_hoverTimer(this, &EventHandler::hoverTimerFired)
, m_autoscrollTimer(this, &EventHandler::autoscrollTimerFired)
, m_autoscrollRenderer(0)
@@ -346,6 +348,11 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve
// Reset drag state.
dragState().m_dragSrc = 0;
+ if (ScrollView* scrollView = m_frame->view()) {
+ if (scrollView->isPointInScrollbarCorner(event.event().pos()))
+ return false;
+ }
+
bool singleClick = event.event().clickCount() <= 1;
// If we got the event back, that must mean it wasn't prevented,
@@ -650,7 +657,7 @@ void EventHandler::autoscrollTimerFired(Timer<EventHandler>*)
}
}
#if ENABLE(PAN_SCROLLING)
- setPanScrollCursor();
+ updatePanScrollState();
toRenderBox(r)->panScroll(m_panScrollStartPos);
#endif
}
@@ -658,7 +665,7 @@ void EventHandler::autoscrollTimerFired(Timer<EventHandler>*)
#if ENABLE(PAN_SCROLLING)
-void EventHandler::setPanScrollCursor()
+void EventHandler::updatePanScrollState()
{
FrameView* view = m_frame->view();
if (!view)
@@ -671,6 +678,9 @@ void EventHandler::setPanScrollCursor()
bool north = m_panScrollStartPos.y() > (m_currentMousePosition.y() + ScrollView::noPanScrollRadius);
bool south = m_panScrollStartPos.y() < (m_currentMousePosition.y() - ScrollView::noPanScrollRadius);
+ if ((east || west || north || south) && m_panScrollButtonPressed)
+ m_springLoadedPanScrollInProgress = true;
+
if (north) {
if (east)
view->setCursor(northEastPanningCursor());
@@ -831,6 +841,7 @@ void EventHandler::stopAutoscrollTimer(bool rendererIsBeingDestroyed)
m_autoscrollTimer.stop();
m_panScrollInProgress = false;
+ m_springLoadedPanScrollInProgress = false;
// If we're not in the top frame we notify it that we are not doing a panScroll any more.
if (Page* page = m_frame->page()) {
@@ -1158,6 +1169,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
if (renderer) {
m_panScrollInProgress = true;
+ m_panScrollButtonPressed = true;
handleAutoscroll(renderer);
invalidateClick();
return true;
@@ -1195,8 +1207,12 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
if (swallowEvent) {
// scrollbars should get events anyway, even disabled controls might be scrollable
- if (mev.scrollbar())
- passMousePressEventToScrollbar(mev, mev.scrollbar());
+ Scrollbar* scrollbar = mev.scrollbar();
+
+ updateLastScrollbarUnderMouse(scrollbar, true);
+
+ if (scrollbar)
+ passMousePressEventToScrollbar(mev, scrollbar);
} else {
// Refetch the event target node if it currently is the shadow node inside an <input> element.
// If a mouse event handler changes the input element type to one that has a widget associated,
@@ -1211,6 +1227,9 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
Scrollbar* scrollbar = view ? view->scrollbarAtPoint(mouseEvent.pos()) : 0;
if (!scrollbar)
scrollbar = mev.scrollbar();
+
+ updateLastScrollbarUnderMouse(scrollbar, true);
+
if (scrollbar && passMousePressEventToScrollbar(mev, scrollbar))
swallowEvent = true;
else
@@ -1327,12 +1346,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
if (!scrollbar)
scrollbar = mev.scrollbar();
- if (m_lastScrollbarUnderMouse != scrollbar) {
- // Send mouse exited to the old scrollbar.
- if (m_lastScrollbarUnderMouse)
- m_lastScrollbarUnderMouse->mouseExited();
- m_lastScrollbarUnderMouse = m_mousePressed ? 0 : scrollbar;
- }
+ updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed);
}
bool swallowEvent = false;
@@ -1383,6 +1397,13 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
{
RefPtr<FrameView> protector(m_frame->view());
+#if ENABLE(PAN_SCROLLING)
+ if (mouseEvent.button() == MiddleButton)
+ m_panScrollButtonPressed = false;
+ if (m_springLoadedPanScrollInProgress)
+ stopAutoscrollTimer();
+#endif
+
m_mousePressed = false;
m_currentMousePosition = mouseEvent.pos();
@@ -2422,4 +2443,16 @@ bool EventHandler::passMousePressEventToScrollbar(MouseEventWithHitTestResults&
return scrollbar->mouseDown(mev.event());
}
+// If scrollbar (under mouse) is different from last, send a mouse exited. Set
+// last to scrollbar if setLast is true; else set last to 0.
+void EventHandler::updateLastScrollbarUnderMouse(Scrollbar* scrollbar, bool setLast)
+{
+ if (m_lastScrollbarUnderMouse != scrollbar) {
+ // Send mouse exited to the old scrollbar.
+ if (m_lastScrollbarUnderMouse)
+ m_lastScrollbarUnderMouse->mouseExited();
+ m_lastScrollbarUnderMouse = setLast ? scrollbar : 0;
+ }
+}
+
}
diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.h b/src/3rdparty/webkit/WebCore/page/EventHandler.h
index d5c0b97..409913a 100644
--- a/src/3rdparty/webkit/WebCore/page/EventHandler.h
+++ b/src/3rdparty/webkit/WebCore/page/EventHandler.h
@@ -69,7 +69,7 @@ extern const int GeneralDragHysteresis;
enum HitTestScrollbars { ShouldHitTestScrollbars, DontHitTestScrollbars };
-class EventHandler : Noncopyable {
+class EventHandler : public Noncopyable {
public:
EventHandler(Frame*);
~EventHandler();
@@ -207,7 +207,7 @@ private:
Cursor selectCursor(const MouseEventWithHitTestResults&, Scrollbar*);
#if ENABLE(PAN_SCROLLING)
- void setPanScrollCursor();
+ void updatePanScrollState();
#endif
void hoverTimerFired(Timer<EventHandler>*);
@@ -271,6 +271,8 @@ private:
void updateSelectionForMouseDrag(Node* targetNode, const IntPoint& localPoint);
+ void updateLastScrollbarUnderMouse(Scrollbar*, bool);
+
bool capturesDragging() const { return m_capturesDragging; }
#if PLATFORM(MAC) && defined(__OBJC__)
@@ -295,6 +297,9 @@ private:
IntPoint m_panScrollStartPos;
bool m_panScrollInProgress;
+ bool m_panScrollButtonPressed;
+ bool m_springLoadedPanScrollInProgress;
+
Timer<EventHandler> m_hoverTimer;
Timer<EventHandler> m_autoscrollTimer;
diff --git a/src/3rdparty/webkit/WebCore/page/Frame.cpp b/src/3rdparty/webkit/WebCore/page/Frame.cpp
index 870bd2a..2d6a795 100644
--- a/src/3rdparty/webkit/WebCore/page/Frame.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Frame.cpp
@@ -42,21 +42,20 @@
#include "EditingText.h"
#include "EditorClient.h"
#include "EventNames.h"
-#include "FocusController.h"
#include "FloatQuad.h"
+#include "FocusController.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameView.h"
#include "GraphicsContext.h"
#include "HTMLDocument.h"
+#include "HTMLFormControlElement.h"
#include "HTMLFormElement.h"
#include "HTMLFrameElementBase.h"
-#include "HTMLFormControlElement.h"
#include "HTMLNames.h"
#include "HTMLTableCellElement.h"
#include "HitTestResult.h"
#include "Logging.h"
-#include "markup.h"
#include "MediaFeatureNames.h"
#include "Navigator.h"
#include "NodeList.h"
@@ -67,12 +66,13 @@
#include "RenderTextControl.h"
#include "RenderTheme.h"
#include "RenderView.h"
+#include "ScriptController.h"
#include "Settings.h"
#include "TextIterator.h"
#include "TextResourceDecoder.h"
#include "XMLNames.h"
-#include "ScriptController.h"
#include "htmlediting.h"
+#include "markup.h"
#include "npruntime_impl.h"
#include "visible_units.h"
#include <wtf/RefCountedLeakCounter.h>
@@ -104,7 +104,7 @@ namespace WebCore {
using namespace HTMLNames;
-#ifndef NDEBUG
+#ifndef NDEBUG
static WTF::RefCountedLeakCounter frameCounter("Frame");
#endif
@@ -115,7 +115,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
return ownerElement->document()->frame();
}
-Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient)
+Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient)
: m_page(page)
, m_treeNode(this, parentFromOwnerElement(ownerElement))
, m_loader(this, frameLoaderClient)
@@ -163,7 +163,7 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient*
else {
page->incrementFrameCount();
// Make sure we will not end up with two frames referencing the same owner element.
- ASSERT((!(ownerElement->m_contentFrame)) || (ownerElement->m_contentFrame->ownerElement() != ownerElement));
+ ASSERT((!(ownerElement->m_contentFrame)) || (ownerElement->m_contentFrame->ownerElement() != ownerElement));
ownerElement->m_contentFrame = this;
}
@@ -176,7 +176,7 @@ Frame::~Frame()
{
setView(0);
loader()->cancelAndClear();
-
+
// FIXME: We should not be doing all this work inside the destructor
ASSERT(!m_lifeSupportTimer.isActive());
@@ -186,14 +186,14 @@ Frame::~Frame()
#endif
disconnectOwnerElement();
-
+
if (m_domWindow)
m_domWindow->disconnectFrame();
HashSet<DOMWindow*>::iterator end = m_liveFormerWindows.end();
for (HashSet<DOMWindow*>::iterator it = m_liveFormerWindows.begin(); it != end; ++it)
(*it)->disconnectFrame();
-
+
if (m_view) {
m_view->hide();
m_view->clearFrame();
@@ -262,7 +262,7 @@ void Frame::setDocument(PassRefPtr<Document> newDoc)
m_doc = newDoc;
if (m_doc && selection()->isFocusedAndActive())
setUseSecureKeyboardEntry(m_doc->useSecureKeyboardEntryWhenActive());
-
+
if (m_doc && !m_doc->attached())
m_doc->attach();
@@ -307,14 +307,14 @@ IntRect Frame::firstRectForRange(Range* range) const
if (startCaretRect.y() == endCaretRect.y()) {
// start and end are on the same line
- return IntRect(min(startCaretRect.x(), endCaretRect.x()),
- startCaretRect.y(),
+ return IntRect(min(startCaretRect.x(), endCaretRect.x()),
+ startCaretRect.y(),
abs(endCaretRect.x() - startCaretRect.x()),
max(startCaretRect.height(), endCaretRect.height()));
}
-
+
// start and end aren't on the same line, so go from start to the end of its line
- return IntRect(startCaretRect.x(),
+ return IntRect(startCaretRect.x(),
startCaretRect.y(),
startCaretRect.width() + extraWidthToEndOfLine,
startCaretRect.height());
@@ -365,23 +365,21 @@ static RegularExpression* createRegExpForLabels(const Vector<String>& labels)
bool startsWithWordChar = false;
bool endsWithWordChar = false;
- if (label.length() != 0) {
+ if (label.length()) {
startsWithWordChar = wordRegExp.match(label.substring(0, 1)) >= 0;
endsWithWordChar = wordRegExp.match(label.substring(label.length() - 1, 1)) >= 0;
}
-
- if (i != 0)
+
+ if (i)
pattern.append("|");
// Search for word boundaries only if label starts/ends with "word characters".
// If we always searched for word boundaries, this wouldn't work for languages
// such as Japanese.
- if (startsWithWordChar) {
+ if (startsWithWordChar)
pattern.append("\\b");
- }
pattern.append(label);
- if (endsWithWordChar) {
+ if (endsWithWordChar)
pattern.append("\\b");
- }
}
pattern.append(")");
return new RegularExpression(pattern, TextCaseInsensitive);
@@ -462,9 +460,8 @@ String Frame::searchForLabelsBeforeElement(const Vector<String>& labels, Element
// If we started in a cell, but bailed because we found the start of the form or the
// previous element, we still might need to search the row above us for a label.
- if (startingTableCell && !searchedCellAbove) {
+ if (startingTableCell && !searchedCellAbove)
return searchForLabelsAboveCell(regExp.get(), startingTableCell);
- }
return String();
}
@@ -477,7 +474,7 @@ String Frame::matchLabelsAgainstElement(const Vector<String>& labels, Element* e
// Make numbers and _'s in field names behave like word boundaries, e.g., "address2"
replace(name, RegularExpression("\\d", TextCaseSensitive), " ");
name.replace('_', ' ');
-
+
OwnPtr<RegularExpression> regExp(createRegExpForLabels(labels));
// Use the largest match we can find in the whole name string
int pos;
@@ -640,7 +637,7 @@ void Frame::selectionLayoutChanged()
return;
VisibleSelection selection = this->selection()->selection();
-
+
if (!selection.isRange())
view->clearSelection();
else {
@@ -654,7 +651,7 @@ void Frame::selectionLayoutChanged()
Position endPos = selection.end();
if (endPos.upstream().isCandidate())
endPos = endPos.upstream();
-
+
// We can get into a state where the selection endpoints map to the same VisiblePosition when a selection is deleted
// because we don't yet notify the SelectionController of text removal.
if (startPos.isNotNull() && endPos.isNotNull() && selection.visibleStart() != selection.visibleEnd()) {
@@ -729,12 +726,12 @@ bool Frame::shouldApplyPageZoom() const
}
void Frame::setZoomFactor(float percent, bool isTextOnly)
-{
+{
if (m_zoomFactor == percent && isZoomFactorTextOnly() == isTextOnly)
return;
#if ENABLE(SVG)
- // SVG doesn't care if the zoom factor is text only. It will always apply a
+ // SVG doesn't care if the zoom factor is text only. It will always apply a
// zoom to the whole SVG.
if (m_doc->isSVGDocument()) {
if (!static_cast<SVGDocument*>(m_doc.get())->zoomAndPanEnabled())
@@ -827,7 +824,7 @@ void Frame::reapplyStyles()
// FIXME: This call doesn't really make sense in a function called reapplyStyles.
// We should probably eventually move it into its own function.
m_doc->docLoader()->setAutoLoadImages(m_page && m_page->settings()->loadsImagesAutomatically());
-
+
#if FRAME_LOADS_USER_STYLESHEET
const KURL userStyleSheetLocation = m_page ? m_page->settings()->userStyleSheetLocation() : KURL();
if (!userStyleSheetLocation.isEmpty())
@@ -859,7 +856,7 @@ bool Frame::shouldDeleteSelection(const VisibleSelection& selection) const
return editor()->client()->shouldDeleteRange(selection.toNormalizedRange().get());
}
-bool Frame::isContentEditable() const
+bool Frame::isContentEditable() const
{
if (m_editor.clientIsEditable())
return true;
@@ -897,7 +894,7 @@ void Frame::clearTypingStyle()
void Frame::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction editingAction)
{
- if (!style || style->length() == 0) {
+ if (!style || !style->length()) {
clearTypingStyle();
return;
}
@@ -933,7 +930,7 @@ void Frame::computeAndSetTypingStyle(CSSStyleDeclaration *style, EditAction edit
blockStyle->diff(mutableStyle.get());
if (blockStyle->length() > 0)
applyCommand(ApplyStyleCommand::create(document(), blockStyle.get(), editingAction));
-
+
// Set the remaining style as the typing style.
m_typingStyle = mutableStyle.release();
}
@@ -950,7 +947,7 @@ String Frame::selectionStartStylePropertyValue(int stylePropertyID) const
if (nodeToRemove) {
ExceptionCode ec = 0;
nodeToRemove->remove(ec);
- ASSERT(ec == 0);
+ ASSERT(!ec);
}
return value;
@@ -969,7 +966,7 @@ PassRefPtr<CSSComputedStyleDeclaration> Frame::selectionComputedStyle(Node*& nod
Element *elem = pos.element();
if (!elem)
return 0;
-
+
RefPtr<Element> styleElement = elem;
ExceptionCode ec = 0;
@@ -977,10 +974,10 @@ PassRefPtr<CSSComputedStyleDeclaration> Frame::selectionComputedStyle(Node*& nod
styleElement = document()->createElement(spanTag, false);
styleElement->setAttribute(styleAttr, m_typingStyle->cssText().impl(), ec);
- ASSERT(ec == 0);
-
+ ASSERT(!ec);
+
styleElement->appendChild(document()->createEditingTextNode(""), ec);
- ASSERT(ec == 0);
+ ASSERT(!ec);
if (elem->renderer() && elem->renderer()->canHaveChildren()) {
elem->appendChild(styleElement, ec);
@@ -988,13 +985,12 @@ PassRefPtr<CSSComputedStyleDeclaration> Frame::selectionComputedStyle(Node*& nod
Node *parent = elem->parent();
Node *next = elem->nextSibling();
- if (next) {
+ if (next)
parent->insertBefore(styleElement, next, ec);
- } else {
+ else
parent->appendChild(styleElement, ec);
- }
}
- ASSERT(ec == 0);
+ ASSERT(!ec);
nodeToRemove = styleElement.get();
}
@@ -1044,18 +1040,16 @@ void Frame::applyEditingStyleToBodyElement() const
{
RefPtr<NodeList> list = m_doc->getElementsByTagName("body");
unsigned len = list->length();
- for (unsigned i = 0; i < len; i++) {
- applyEditingStyleToElement(static_cast<Element*>(list->item(i)));
- }
+ for (unsigned i = 0; i < len; i++)
+ applyEditingStyleToElement(static_cast<Element*>(list->item(i)));
}
void Frame::removeEditingStyleFromBodyElement() const
{
RefPtr<NodeList> list = m_doc->getElementsByTagName("body");
unsigned len = list->length();
- for (unsigned i = 0; i < len; i++) {
- removeEditingStyleFromElement(static_cast<Element*>(list->item(i)));
- }
+ for (unsigned i = 0; i < len; i++)
+ removeEditingStyleFromElement(static_cast<Element*>(list->item(i)));
}
void Frame::applyEditingStyleToElement(Element* element) const
@@ -1068,11 +1062,11 @@ void Frame::applyEditingStyleToElement(Element* element) const
ExceptionCode ec = 0;
style->setProperty(CSSPropertyWordWrap, "break-word", false, ec);
- ASSERT(ec == 0);
+ ASSERT(!ec);
style->setProperty(CSSPropertyWebkitNbspMode, "space", false, ec);
- ASSERT(ec == 0);
+ ASSERT(!ec);
style->setProperty(CSSPropertyWebkitLineBreak, "after-white-space", false, ec);
- ASSERT(ec == 0);
+ ASSERT(!ec);
}
void Frame::removeEditingStyleFromElement(Element*) const
@@ -1189,7 +1183,7 @@ FloatRect Frame::selectionBounds(bool clipToVisibleContent) const
FrameView* view = m_view.get();
if (!root || !view)
return IntRect();
-
+
IntRect selectionRect = root->selectionBounds(clipToVisibleContent);
return clipToVisibleContent ? intersection(selectionRect, view->visibleContentRect()) : selectionRect;
}
@@ -1240,7 +1234,7 @@ HTMLFormElement *Frame::currentForm() const
Node *start = m_doc ? m_doc->focusedNode() : 0;
if (!start)
start = selection()->start().node();
-
+
// try walking up the node tree to find a form element
Node *n;
for (n = start; n; n = n->parentNode()) {
@@ -1249,7 +1243,7 @@ HTMLFormElement *Frame::currentForm() const
else if (n->isHTMLElement() && static_cast<Element*>(n)->isFormControlElement())
return static_cast<HTMLFormControlElement*>(n)->form();
}
-
+
// try walking forward in the node tree to find a form element
return start ? scanForForm(start) : 0;
}
@@ -1259,21 +1253,21 @@ void Frame::revealSelection(const ScrollAlignment& alignment, bool revealExtent)
IntRect rect;
switch (selection()->selectionType()) {
- case VisibleSelection::NoSelection:
- return;
- case VisibleSelection::CaretSelection:
- rect = selection()->absoluteCaretBounds();
- break;
- case VisibleSelection::RangeSelection:
- rect = revealExtent ? VisiblePosition(selection()->extent()).absoluteCaretBounds() : enclosingIntRect(selectionBounds(false));
- break;
+ case VisibleSelection::NoSelection:
+ return;
+ case VisibleSelection::CaretSelection:
+ rect = selection()->absoluteCaretBounds();
+ break;
+ case VisibleSelection::RangeSelection:
+ rect = revealExtent ? VisiblePosition(selection()->extent()).absoluteCaretBounds() : enclosingIntRect(selectionBounds(false));
+ break;
}
Position start = selection()->start();
ASSERT(start.node());
if (start.node() && start.node()->renderer()) {
// FIXME: This code only handles scrolling the startContainer's layer, but
- // the selection rect could intersect more than just that.
+ // the selection rect could intersect more than just that.
// See <rdar://problem/4799899>.
if (RenderLayer* layer = start.node()->renderer()->enclosingLayer())
layer->scrollRectToVisible(rect, false, alignment, alignment);
@@ -1313,46 +1307,46 @@ void Frame::clearTimers()
RenderStyle *Frame::styleForSelectionStart(Node *&nodeToRemove) const
{
nodeToRemove = 0;
-
+
if (selection()->isNone())
return 0;
-
+
Position pos = selection()->selection().visibleStart().deepEquivalent();
if (!pos.isCandidate())
return 0;
Node *node = pos.node();
if (!node)
return 0;
-
+
if (!m_typingStyle)
return node->renderer()->style();
-
+
RefPtr<Element> styleElement = document()->createElement(spanTag, false);
-
+
ExceptionCode ec = 0;
String styleText = m_typingStyle->cssText() + " display: inline";
styleElement->setAttribute(styleAttr, styleText.impl(), ec);
- ASSERT(ec == 0);
-
+ ASSERT(!ec);
+
styleElement->appendChild(document()->createEditingTextNode(""), ec);
- ASSERT(ec == 0);
-
+ ASSERT(!ec);
+
node->parentNode()->appendChild(styleElement, ec);
- ASSERT(ec == 0);
-
- nodeToRemove = styleElement.get();
+ ASSERT(!ec);
+
+ nodeToRemove = styleElement.get();
return styleElement->renderer() ? styleElement->renderer()->style() : 0;
}
void Frame::setSelectionFromNone()
{
- // Put a caret inside the body if the entire frame is editable (either the
+ // Put a caret inside the body if the entire frame is editable (either the
// entire WebView is editable or designMode is on for this document).
Document *doc = document();
bool caretBrowsing = settings() && settings()->caretBrowsingEnabled();
if (!selection()->isNone() || !(isContentEditable() || caretBrowsing))
return;
-
+
Node* node = doc->documentElement();
while (node && !node->hasTagName(bodyTag))
node = node->traverseNextNode();
@@ -1375,10 +1369,10 @@ bool Frame::findString(const String& target, bool forward, bool caseFlag, bool w
{
if (target.isEmpty())
return false;
-
+
if (excludeFromTextSearch())
return false;
-
+
// Start from an edge of the selection, if there's a selection that's not in shadow content. Which edge
// is used depends on whether we're searching forward or backward, and whether startInSelection is set.
RefPtr<Range> searchRange(rangeOfContents(document()));
@@ -1419,7 +1413,7 @@ bool Frame::findString(const String& target, bool forward, bool caseFlag, bool w
resultRange = findPlainText(searchRange.get(), target, forward, caseFlag);
}
-
+
ExceptionCode exception = 0;
// If nothing was found in the shadow tree, search in main content following the shadow tree.
@@ -1432,7 +1426,7 @@ bool Frame::findString(const String& target, bool forward, bool caseFlag, bool w
resultRange = findPlainText(searchRange.get(), target, forward, caseFlag);
}
-
+
if (!editor()->insideVisibleArea(resultRange.get())) {
resultRange = editor()->nextVisibleRange(resultRange.get(), target, forward, caseFlag, wrapFlag);
if (!resultRange)
@@ -1461,9 +1455,9 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
{
if (target.isEmpty())
return 0;
-
+
RefPtr<Range> searchRange(rangeOfContents(document()));
-
+
ExceptionCode exception = 0;
unsigned matchCount = 0;
do {
@@ -1476,7 +1470,7 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
searchRange->setStartAfter(resultRange->startContainer()->shadowAncestorNode(), exception);
continue;
}
-
+
// A non-collapsed result range can in some funky whitespace cases still not
// advance the range's start position (4509328). Break to avoid infinite loop.
VisiblePosition newStart = endVisiblePosition(resultRange.get(), DOWNSTREAM);
@@ -1488,18 +1482,18 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
++matchCount;
document()->addMarker(resultRange.get(), DocumentMarker::TextMatch);
}
-
+
// Stop looking if we hit the specified limit. A limit of 0 means no limit.
if (limit > 0 && matchCount >= limit)
break;
-
+
setStart(searchRange.get(), newStart);
Node* shadowTreeRoot = searchRange->shadowTreeRootNode();
if (searchRange->collapsed(exception) && shadowTreeRoot)
searchRange->setEnd(shadowTreeRoot, shadowTreeRoot->childNodeCount(), exception);
} while (true);
-
- // Do a "fake" paint in order to execute the code that computes the rendered rect for
+
+ // Do a "fake" paint in order to execute the code that computes the rendered rect for
// each text match.
Document* doc = document();
if (m_view && contentRenderer()) {
@@ -1511,7 +1505,7 @@ unsigned Frame::markAllMatchesForText(const String& target, bool caseFlag, unsig
m_view->paintContents(&context, visibleRect);
}
}
-
+
return matchCount;
}
@@ -1524,7 +1518,7 @@ void Frame::setMarkedTextMatchesAreHighlighted(bool flag)
{
if (flag == m_highlightTextMatches)
return;
-
+
m_highlightTextMatches = flag;
document()->repaintMarkers(DocumentMarker::TextMatch);
}
@@ -1553,7 +1547,7 @@ DOMWindow* Frame::domWindow() const
void Frame::clearFormerDOMWindow(DOMWindow* window)
{
- m_liveFormerWindows.remove(window);
+ m_liveFormerWindows.remove(window);
}
Page* Frame::page() const
@@ -1619,7 +1613,7 @@ void Frame::unfocusWindow()
{
if (!page())
return;
-
+
// If we're a top level window, deactivate the window.
if (!tree()->parent())
page()->chrome()->unfocus();
@@ -1680,14 +1674,13 @@ void Frame::respondToChangedSelection(const VisibleSelection& oldSelection, bool
// oldSelection may no longer be in the document.
if (closeTyping && oldSelection.isContentEditable() && oldSelection.start().node() && oldSelection.start().node()->inDocument()) {
VisiblePosition oldStart(oldSelection.visibleStart());
- VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
+ VisibleSelection oldAdjacentWords = VisibleSelection(startOfWord(oldStart, LeftWordIfOnBoundary), endOfWord(oldStart, RightWordIfOnBoundary));
if (oldAdjacentWords != newAdjacentWords) {
if (isContinuousGrammarCheckingEnabled) {
VisibleSelection oldSelectedSentence = VisibleSelection(startOfSentence(oldStart), endOfSentence(oldStart));
editor()->markMisspellingsAndBadGrammar(oldAdjacentWords, oldSelectedSentence != newSelectedSentence, oldSelectedSentence);
- } else {
+ } else
editor()->markMisspellingsAndBadGrammar(oldAdjacentWords, false, oldAdjacentWords);
- }
}
}
@@ -1722,15 +1715,15 @@ VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint)
visiblePos = VisiblePosition(Position(node, 0));
return visiblePos;
}
-
+
Document* Frame::documentAtPoint(const IntPoint& point)
-{
- if (!view())
+{
+ if (!view())
return 0;
-
+
IntPoint pt = view()->windowToContents(point);
HitTestResult result = HitTestResult(pt);
-
+
if (contentRenderer())
result = eventHandler()->hitTestResultAtPoint(pt, false);
return result.innerNode() ? result.innerNode()->document() : 0;
diff --git a/src/3rdparty/webkit/WebCore/page/Frame.h b/src/3rdparty/webkit/WebCore/page/Frame.h
index 0a44a6d..652269a 100644
--- a/src/3rdparty/webkit/WebCore/page/Frame.h
+++ b/src/3rdparty/webkit/WebCore/page/Frame.h
@@ -37,8 +37,8 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "Range.h"
-#include "ScrollBehavior.h"
#include "ScriptController.h"
+#include "ScrollBehavior.h"
#include "SelectionController.h"
#include "TextGranularity.h"
@@ -62,315 +62,315 @@ typedef struct HBITMAP__* HBITMAP;
namespace WebCore {
-class CSSMutableStyleDeclaration;
-class Editor;
-class EventHandler;
-class FrameLoader;
-class FrameLoaderClient;
-class FrameTree;
-class FrameView;
-class HTMLFrameOwnerElement;
-class HTMLTableCellElement;
-class RegularExpression;
-class RenderPart;
-class ScriptController;
-class SelectionController;
-class Settings;
-class VisibleSelection;
-class Widget;
+ class CSSMutableStyleDeclaration;
+ class Editor;
+ class EventHandler;
+ class FrameLoader;
+ class FrameLoaderClient;
+ class FrameTree;
+ class FrameView;
+ class HTMLFrameOwnerElement;
+ class HTMLTableCellElement;
+ class RegularExpression;
+ class RenderPart;
+ class ScriptController;
+ class SelectionController;
+ class Settings;
+ class VisibleSelection;
+ class Widget;
#if FRAME_LOADS_USER_STYLESHEET
class UserStyleSheetLoader;
#endif
-template <typename T> class Timer;
+ template <typename T> class Timer;
-class Frame : public RefCounted<Frame> {
-public:
- static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
- {
- return adoptRef(new Frame(page, ownerElement, client));
- }
- void setView(PassRefPtr<FrameView>);
- ~Frame();
-
- void init();
+ class Frame : public RefCounted<Frame> {
+ public:
+ static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
+ {
+ return adoptRef(new Frame(page, ownerElement, client));
+ }
+ void setView(PassRefPtr<FrameView>);
+ ~Frame();
- Page* page() const;
- HTMLFrameOwnerElement* ownerElement() const;
+ void init();
- void pageDestroyed();
- void disconnectOwnerElement();
+ Page* page() const;
+ HTMLFrameOwnerElement* ownerElement() const;
- Document* document() const;
- FrameView* view() const;
+ void pageDestroyed();
+ void disconnectOwnerElement();
- void setDOMWindow(DOMWindow*);
- DOMWindow* domWindow() const;
- void clearFormerDOMWindow(DOMWindow*);
+ Document* document() const;
+ FrameView* view() const;
- Editor* editor() const;
- EventHandler* eventHandler() const;
- FrameLoader* loader() const;
- SelectionController* selection() const;
- FrameTree* tree() const;
- AnimationController* animation() const;
- ScriptController* script();
+ void setDOMWindow(DOMWindow*);
+ DOMWindow* domWindow() const;
+ void clearFormerDOMWindow(DOMWindow*);
- RenderView* contentRenderer() const; // root renderer for the document contained in this frame
- RenderPart* ownerRenderer() const; // renderer for the element that contains this frame
-
- bool isDisconnected() const;
- void setIsDisconnected(bool);
- bool excludeFromTextSearch() const;
- void setExcludeFromTextSearch(bool);
+ Editor* editor() const;
+ EventHandler* eventHandler() const;
+ FrameLoader* loader() const;
+ SelectionController* selection() const;
+ FrameTree* tree() const;
+ AnimationController* animation() const;
+ ScriptController* script();
- void createView(const IntSize&, const Color&, bool, const IntSize &, bool,
- ScrollbarMode = ScrollbarAuto, ScrollbarMode = ScrollbarAuto);
+ RenderView* contentRenderer() const; // root renderer for the document contained in this frame
+ RenderPart* ownerRenderer() const; // renderer for the element that contains this frame
+ bool isDisconnected() const;
+ void setIsDisconnected(bool);
+ bool excludeFromTextSearch() const;
+ void setExcludeFromTextSearch(bool);
-private:
- Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
-
-// === undecided, would like to consider moving to another class
+ void createView(const IntSize&, const Color&, bool, const IntSize &, bool,
+ ScrollbarMode = ScrollbarAuto, ScrollbarMode = ScrollbarAuto);
-public:
- static Frame* frameForWidget(const Widget*);
- Settings* settings() const; // can be NULL
+ private:
+ Frame(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
-#if FRAME_LOADS_USER_STYLESHEET
- void setUserStyleSheetLocation(const KURL&);
- void setUserStyleSheet(const String& styleSheetData);
-#endif
+ // === undecided, would like to consider moving to another class
- void setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize);
+ public:
+ static Frame* frameForWidget(const Widget*);
- bool inViewSourceMode() const;
- void setInViewSourceMode(bool = true);
+ Settings* settings() const; // can be NULL
- void keepAlive(); // Used to keep the frame alive when running a script that might destroy it.
-#ifndef NDEBUG
- static void cancelAllKeepAlive();
-#endif
+ #if FRAME_LOADS_USER_STYLESHEET
+ void setUserStyleSheetLocation(const KURL&);
+ void setUserStyleSheet(const String& styleSheetData);
+ #endif
- void setDocument(PassRefPtr<Document>);
+ void setPrinting(bool printing, float minPageWidth, float maxPageWidth, bool adjustViewSize);
- void clearTimers();
- static void clearTimers(FrameView*, Document*);
+ bool inViewSourceMode() const;
+ void setInViewSourceMode(bool = true);
- void setNeedsReapplyStyles();
- bool needsReapplyStyles() const;
- void reapplyStyles();
+ void keepAlive(); // Used to keep the frame alive when running a script that might destroy it.
+ #ifndef NDEBUG
+ static void cancelAllKeepAlive();
+ #endif
- String documentTypeString() const;
+ void setDocument(PassRefPtr<Document>);
- // This method -- and the corresponding list of former DOM windows --
- // should move onto ScriptController
- void clearDOMWindow();
+ void clearTimers();
+ static void clearTimers(FrameView*, Document*);
- String displayStringModifiedByEncoding(const String& str) const
- {
- return document() ? document()->displayStringModifiedByEncoding(str) : str;
- }
+ void setNeedsReapplyStyles();
+ bool needsReapplyStyles() const;
+ void reapplyStyles();
-private:
- void lifeSupportTimerFired(Timer<Frame>*);
+ String documentTypeString() const;
-// === to be moved into FrameView
+ // This method -- and the corresponding list of former DOM windows --
+ // should move onto ScriptController
+ void clearDOMWindow();
-public:
- void setZoomFactor(float scale, bool isTextOnly);
- float zoomFactor() const;
- bool isZoomFactorTextOnly() const;
- bool shouldApplyTextZoom() const;
- bool shouldApplyPageZoom() const;
- float pageZoomFactor() const { return shouldApplyPageZoom() ? zoomFactor() : 1.0f; }
- float textZoomFactor() const { return shouldApplyTextZoom() ? zoomFactor() : 1.0f; }
+ String displayStringModifiedByEncoding(const String& str) const
+ {
+ return document() ? document()->displayStringModifiedByEncoding(str) : str;
+ }
-// === to be moved into Chrome
+ private:
+ void lifeSupportTimerFired(Timer<Frame>*);
-public:
- void focusWindow();
- void unfocusWindow();
- bool shouldClose(RegisteredEventListenerVector* alternateEventListeners = 0);
- void scheduleClose();
+ // === to be moved into FrameView
- void setJSStatusBarText(const String&);
- void setJSDefaultStatusBarText(const String&);
- String jsStatusBarText() const;
- String jsDefaultStatusBarText() const;
+ public:
+ void setZoomFactor(float scale, bool isTextOnly);
+ float zoomFactor() const;
+ bool isZoomFactorTextOnly() const;
+ bool shouldApplyTextZoom() const;
+ bool shouldApplyPageZoom() const;
+ float pageZoomFactor() const { return shouldApplyPageZoom() ? zoomFactor() : 1.0f; }
+ float textZoomFactor() const { return shouldApplyTextZoom() ? zoomFactor() : 1.0f; }
-// === to be moved into Editor
+ // === to be moved into Chrome
-public:
- String selectedText() const;
- bool findString(const String&, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection);
+ public:
+ void focusWindow();
+ void unfocusWindow();
+ bool shouldClose(RegisteredEventListenerVector* alternateEventListeners = 0);
+ void scheduleClose();
- const VisibleSelection& mark() const; // Mark, to be used as emacs uses it.
- void setMark(const VisibleSelection&);
+ void setJSStatusBarText(const String&);
+ void setJSDefaultStatusBarText(const String&);
+ String jsStatusBarText() const;
+ String jsDefaultStatusBarText() const;
- void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
- String selectionStartStylePropertyValue(int stylePropertyID) const;
- void applyEditingStyleToBodyElement() const;
- void removeEditingStyleFromBodyElement() const;
- void applyEditingStyleToElement(Element*) const;
- void removeEditingStyleFromElement(Element*) const;
+ // === to be moved into Editor
- IntRect firstRectForRange(Range*) const;
-
- void respondToChangedSelection(const VisibleSelection& oldSelection, bool closeTyping);
- bool shouldChangeSelection(const VisibleSelection& oldSelection, const VisibleSelection& newSelection, EAffinity, bool stillSelecting) const;
+ public:
+ String selectedText() const;
+ bool findString(const String&, bool forward, bool caseFlag, bool wrapFlag, bool startInSelection);
- RenderStyle* styleForSelectionStart(Node*& nodeToRemove) const;
+ const VisibleSelection& mark() const; // Mark, to be used as emacs uses it.
+ void setMark(const VisibleSelection&);
- unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit);
- bool markedTextMatchesAreHighlighted() const;
- void setMarkedTextMatchesAreHighlighted(bool flag);
+ void computeAndSetTypingStyle(CSSStyleDeclaration* , EditAction = EditActionUnspecified);
+ String selectionStartStylePropertyValue(int stylePropertyID) const;
+ void applyEditingStyleToBodyElement() const;
+ void removeEditingStyleFromBodyElement() const;
+ void applyEditingStyleToElement(Element*) const;
+ void removeEditingStyleFromElement(Element*) const;
- PassRefPtr<CSSComputedStyleDeclaration> selectionComputedStyle(Node*& nodeToRemove) const;
+ IntRect firstRectForRange(Range*) const;
- void textFieldDidBeginEditing(Element*);
- void textFieldDidEndEditing(Element*);
- void textDidChangeInTextField(Element*);
- bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
- void textWillBeDeletedInTextField(Element* input);
- void textDidChangeInTextArea(Element*);
+ void respondToChangedSelection(const VisibleSelection& oldSelection, bool closeTyping);
+ bool shouldChangeSelection(const VisibleSelection& oldSelection, const VisibleSelection& newSelection, EAffinity, bool stillSelecting) const;
- DragImageRef dragImageForSelection();
-
-// === to be moved into SelectionController
+ RenderStyle* styleForSelectionStart(Node*& nodeToRemove) const;
-public:
- TextGranularity selectionGranularity() const;
- void setSelectionGranularity(TextGranularity);
+ unsigned markAllMatchesForText(const String&, bool caseFlag, unsigned limit);
+ bool markedTextMatchesAreHighlighted() const;
+ void setMarkedTextMatchesAreHighlighted(bool flag);
- bool shouldChangeSelection(const VisibleSelection&) const;
- bool shouldDeleteSelection(const VisibleSelection&) const;
- void clearCaretRectIfNeeded();
- void setFocusedNodeIfNeeded();
- void selectionLayoutChanged();
- void notifyRendererOfSelectionChange(bool userTriggered);
+ PassRefPtr<CSSComputedStyleDeclaration> selectionComputedStyle(Node*& nodeToRemove) const;
- void invalidateSelection();
+ void textFieldDidBeginEditing(Element*);
+ void textFieldDidEndEditing(Element*);
+ void textDidChangeInTextField(Element*);
+ bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
+ void textWillBeDeletedInTextField(Element* input);
+ void textDidChangeInTextArea(Element*);
- void setCaretVisible(bool = true);
- void paintCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
- void paintDragCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
+ DragImageRef dragImageForSelection();
- bool isContentEditable() const; // if true, everything in frame is editable
+ // === to be moved into SelectionController
- void updateSecureKeyboardEntryIfActive();
+ public:
+ TextGranularity selectionGranularity() const;
+ void setSelectionGranularity(TextGranularity);
- CSSMutableStyleDeclaration* typingStyle() const;
- void setTypingStyle(CSSMutableStyleDeclaration*);
- void clearTypingStyle();
+ bool shouldChangeSelection(const VisibleSelection&) const;
+ bool shouldDeleteSelection(const VisibleSelection&) const;
+ void clearCaretRectIfNeeded();
+ void setFocusedNodeIfNeeded();
+ void selectionLayoutChanged();
+ void notifyRendererOfSelectionChange(bool userTriggered);
- FloatRect selectionBounds(bool clipToVisibleContent = true) const;
- void selectionTextRects(Vector<FloatRect>&, bool clipToVisibleContent = true) const;
+ void invalidateSelection();
- HTMLFormElement* currentForm() const;
+ void setCaretVisible(bool = true);
+ void paintCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
+ void paintDragCaret(GraphicsContext*, int tx, int ty, const IntRect& clipRect) const;
- void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
- void setSelectionFromNone();
+ bool isContentEditable() const; // if true, everything in frame is editable
- void setUseSecureKeyboardEntry(bool);
+ void updateSecureKeyboardEntryIfActive();
-private:
- void caretBlinkTimerFired(Timer<Frame>*);
+ CSSMutableStyleDeclaration* typingStyle() const;
+ void setTypingStyle(CSSMutableStyleDeclaration*);
+ void clearTypingStyle();
-public:
- SelectionController* dragCaretController() const;
+ FloatRect selectionBounds(bool clipToVisibleContent = true) const;
+ void selectionTextRects(Vector<FloatRect>&, bool clipToVisibleContent = true) const;
- String searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
- String searchForLabelsBeforeElement(const Vector<String>& labels, Element*);
- String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
-
- VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
- Document* documentAtPoint(const IntPoint& windowPoint);
+ HTMLFormElement* currentForm() const;
-#if PLATFORM(MAC)
+ void revealSelection(const ScrollAlignment& = ScrollAlignment::alignCenterIfNeeded, bool revealExtent = false);
+ void setSelectionFromNone();
-// === undecided, would like to consider moving to another class
+ void setUseSecureKeyboardEntry(bool);
-public:
- NSString* searchForNSLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
- NSString* searchForLabelsBeforeElement(NSArray* labels, Element*);
- NSString* matchLabelsAgainstElement(NSArray* labels, Element*);
+ private:
+ void caretBlinkTimerFired(Timer<Frame>*);
-#if ENABLE(DASHBOARD_SUPPORT)
- NSMutableDictionary* dashboardRegionsDictionary();
-#endif
+ public:
+ SelectionController* dragCaretController() const;
- NSImage* selectionImage(bool forceBlackText = false) const;
- NSImage* snapshotDragImage(Node*, NSRect* imageRect, NSRect* elementRect) const;
- NSImage* nodeImage(Node*) const;
+ String searchForLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
+ String searchForLabelsBeforeElement(const Vector<String>& labels, Element*);
+ String matchLabelsAgainstElement(const Vector<String>& labels, Element*);
-private:
- NSImage* imageFromRect(NSRect) const;
+ VisiblePosition visiblePositionForPoint(const IntPoint& framePoint);
+ Document* documentAtPoint(const IntPoint& windowPoint);
-// === to be moved into Editor
+ #if PLATFORM(MAC)
-public:
- NSDictionary* fontAttributesForSelectionStart() const;
- NSWritingDirection baseWritingDirectionForSelectionStart() const;
+ // === undecided, would like to consider moving to another class
-#endif
+ public:
+ NSString* searchForNSLabelsAboveCell(RegularExpression*, HTMLTableCellElement*);
+ NSString* searchForLabelsBeforeElement(NSArray* labels, Element*);
+ NSString* matchLabelsAgainstElement(NSArray* labels, Element*);
-#if PLATFORM(WIN)
+ #if ENABLE(DASHBOARD_SUPPORT)
+ NSMutableDictionary* dashboardRegionsDictionary();
+ #endif
-public:
- // FIXME - We should have a single version of nodeImage instead of using platform types.
- HBITMAP nodeImage(Node*) const;
+ NSImage* selectionImage(bool forceBlackText = false) const;
+ NSImage* snapshotDragImage(Node*, NSRect* imageRect, NSRect* elementRect) const;
+ NSImage* nodeImage(Node*) const;
-#endif
+ private:
+ NSImage* imageFromRect(NSRect) const;
-private:
- Page* m_page;
- mutable FrameTree m_treeNode;
- mutable FrameLoader m_loader;
+ // === to be moved into Editor
- mutable RefPtr<DOMWindow> m_domWindow;
- HashSet<DOMWindow*> m_liveFormerWindows;
+ public:
+ NSDictionary* fontAttributesForSelectionStart() const;
+ NSWritingDirection baseWritingDirectionForSelectionStart() const;
- HTMLFrameOwnerElement* m_ownerElement;
- RefPtr<FrameView> m_view;
- RefPtr<Document> m_doc;
+ #endif
- ScriptController m_script;
+ #if PLATFORM(WIN)
- String m_kjsStatusBarText;
- String m_kjsDefaultStatusBarText;
+ public:
+ // FIXME - We should have a single version of nodeImage instead of using platform types.
+ HBITMAP nodeImage(Node*) const;
- float m_zoomFactor;
+ #endif
- TextGranularity m_selectionGranularity;
+ private:
+ Page* m_page;
+ mutable FrameTree m_treeNode;
+ mutable FrameLoader m_loader;
- mutable SelectionController m_selectionController;
- mutable VisibleSelection m_mark;
- Timer<Frame> m_caretBlinkTimer;
- mutable Editor m_editor;
- mutable EventHandler m_eventHandler;
- mutable AnimationController m_animationController;
+ mutable RefPtr<DOMWindow> m_domWindow;
+ HashSet<DOMWindow*> m_liveFormerWindows;
- RefPtr<CSSMutableStyleDeclaration> m_typingStyle;
+ HTMLFrameOwnerElement* m_ownerElement;
+ RefPtr<FrameView> m_view;
+ RefPtr<Document> m_doc;
- Timer<Frame> m_lifeSupportTimer;
+ ScriptController m_script;
- bool m_caretVisible;
- bool m_caretPaint;
-
- bool m_highlightTextMatches;
- bool m_inViewSourceMode;
- bool m_needsReapplyStyles;
- bool m_isDisconnected;
- bool m_excludeFromTextSearch;
+ String m_kjsStatusBarText;
+ String m_kjsDefaultStatusBarText;
-#if FRAME_LOADS_USER_STYLESHEET
- UserStyleSheetLoader* m_userStyleSheetLoader;
-#endif
+ float m_zoomFactor;
+
+ TextGranularity m_selectionGranularity;
+
+ mutable SelectionController m_selectionController;
+ mutable VisibleSelection m_mark;
+ Timer<Frame> m_caretBlinkTimer;
+ mutable Editor m_editor;
+ mutable EventHandler m_eventHandler;
+ mutable AnimationController m_animationController;
+
+ RefPtr<CSSMutableStyleDeclaration> m_typingStyle;
+
+ Timer<Frame> m_lifeSupportTimer;
+
+ bool m_caretVisible;
+ bool m_caretPaint;
+
+ bool m_highlightTextMatches;
+ bool m_inViewSourceMode;
+ bool m_needsReapplyStyles;
+ bool m_isDisconnected;
+ bool m_excludeFromTextSearch;
+
+ #if FRAME_LOADS_USER_STYLESHEET
+ UserStyleSheetLoader* m_userStyleSheetLoader;
+ #endif
-};
+ };
} // namespace WebCore
diff --git a/src/3rdparty/webkit/WebCore/page/FrameTree.h b/src/3rdparty/webkit/WebCore/page/FrameTree.h
index d4c8c43..9ab999f 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameTree.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameTree.h
@@ -26,7 +26,7 @@ namespace WebCore {
class Frame;
- class FrameTree : Noncopyable {
+ class FrameTree : public Noncopyable {
public:
FrameTree(Frame* thisFrame, Frame* parentFrame)
: m_thisFrame(thisFrame)
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
index d57e845..9160c89 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp
@@ -825,6 +825,19 @@ void FrameView::repaintContentRectangle(const IntRect& r, bool immediate)
ScrollView::repaintContentRectangle(r, immediate);
}
+void FrameView::visibleContentsResized()
+{
+ // We check to make sure the view is attached to a frame() as this method can
+ // be triggered before the view is attached by Frame::createView(...) setting
+ // various values such as setScrollBarModes(...) for example. An ASSERT is
+ // triggered when a view is layout before being attached to a frame().
+ if (!frame()->view())
+ return;
+
+ if (needsLayout())
+ layout();
+}
+
void FrameView::beginDeferredRepaints()
{
Page* page = m_frame->page();
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.h b/src/3rdparty/webkit/WebCore/page/FrameView.h
index 8eee5b8..83e2c1e 100644
--- a/src/3rdparty/webkit/WebCore/page/FrameView.h
+++ b/src/3rdparty/webkit/WebCore/page/FrameView.h
@@ -207,11 +207,7 @@ private:
virtual void repaintContentRectangle(const IntRect&, bool immediate);
virtual void contentsResized() { setNeedsLayout(); }
- virtual void visibleContentsResized()
- {
- if (needsLayout())
- layout();
- }
+ virtual void visibleContentsResized();
// Override ScrollView methods to do point conversion via renderers, in order to
// take transforms into account.
diff --git a/src/3rdparty/webkit/WebCore/page/NavigatorBase.cpp b/src/3rdparty/webkit/WebCore/page/NavigatorBase.cpp
index 5138b0f..5b0c5d4 100644
--- a/src/3rdparty/webkit/WebCore/page/NavigatorBase.cpp
+++ b/src/3rdparty/webkit/WebCore/page/NavigatorBase.cpp
@@ -29,6 +29,10 @@
#include "NetworkStateNotifier.h"
#include "PlatformString.h"
+#if PLATFORM(LINUX)
+#include "sys/utsname.h"
+#include <wtf/StdLibExtras.h>
+#endif
#ifndef WEBCORE_NAVIGATOR_PLATFORM
#if PLATFORM(MAC) && (PLATFORM(PPC) || PLATFORM(PPC64))
@@ -37,6 +41,8 @@
#define WEBCORE_NAVIGATOR_PLATFORM "MacIntel"
#elif PLATFORM(WIN_OS)
#define WEBCORE_NAVIGATOR_PLATFORM "Win32"
+#elif PLATFORM(SYMBIAN)
+#define WEBCORE_NAVIGATOR_PLATFORM "Symbian"
#else
#define WEBCORE_NAVIGATOR_PLATFORM ""
#endif
@@ -79,7 +85,15 @@ String NavigatorBase::appVersion() const
String NavigatorBase::platform() const
{
+#if PLATFORM(LINUX)
+ if (String("") != WEBCORE_NAVIGATOR_PLATFORM)
+ return WEBCORE_NAVIGATOR_PLATFORM;
+ struct utsname osname;
+ DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : ""));
+ return platformName;
+#else
return WEBCORE_NAVIGATOR_PLATFORM;
+#endif
}
String NavigatorBase::appCodeName() const
diff --git a/src/3rdparty/webkit/WebCore/page/Page.cpp b/src/3rdparty/webkit/WebCore/page/Page.cpp
index 6494707..32c60c6 100644
--- a/src/3rdparty/webkit/WebCore/page/Page.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Page.cpp
@@ -100,7 +100,7 @@ Page::Page(ChromeClient* chromeClient, ContextMenuClient* contextMenuClient, Edi
, m_dragController(new DragController(this, dragClient))
, m_focusController(new FocusController(this))
, m_contextMenuController(new ContextMenuController(this, contextMenuClient))
- , m_inspectorController(InspectorController::create(this, inspectorClient))
+ , m_inspectorController(new InspectorController(this, inspectorClient))
, m_settings(new Settings(this))
, m_progress(new ProgressTracker)
, m_backForwardList(BackForwardList::create(this))
diff --git a/src/3rdparty/webkit/WebCore/page/Page.h b/src/3rdparty/webkit/WebCore/page/Page.h
index b5d6f4b..cc3d25d 100644
--- a/src/3rdparty/webkit/WebCore/page/Page.h
+++ b/src/3rdparty/webkit/WebCore/page/Page.h
@@ -73,7 +73,7 @@ namespace WebCore {
enum FindDirection { FindDirectionForward, FindDirectionBackward };
- class Page : Noncopyable {
+ class Page : public Noncopyable {
public:
static void setNeedsReapplyStyles();
@@ -209,7 +209,7 @@ namespace WebCore {
OwnPtr<DragController> m_dragController;
OwnPtr<FocusController> m_focusController;
OwnPtr<ContextMenuController> m_contextMenuController;
- RefPtr<InspectorController> m_inspectorController;
+ OwnPtr<InspectorController> m_inspectorController;
OwnPtr<Settings> m_settings;
OwnPtr<ProgressTracker> m_progress;
diff --git a/src/3rdparty/webkit/WebCore/page/PageGroup.h b/src/3rdparty/webkit/WebCore/page/PageGroup.h
index cbde1c3..f92c2e6 100644
--- a/src/3rdparty/webkit/WebCore/page/PageGroup.h
+++ b/src/3rdparty/webkit/WebCore/page/PageGroup.h
@@ -37,7 +37,7 @@ namespace WebCore {
class Page;
class StorageNamespace;
- class PageGroup : Noncopyable {
+ class PageGroup : public Noncopyable {
public:
PageGroup(const String& name);
PageGroup(Page*);
diff --git a/src/3rdparty/webkit/WebCore/page/PageGroupLoadDeferrer.h b/src/3rdparty/webkit/WebCore/page/PageGroupLoadDeferrer.h
index 1bdb45c..d443ebd 100644
--- a/src/3rdparty/webkit/WebCore/page/PageGroupLoadDeferrer.h
+++ b/src/3rdparty/webkit/WebCore/page/PageGroupLoadDeferrer.h
@@ -28,7 +28,7 @@ namespace WebCore {
class Frame;
class Page;
- class PageGroupLoadDeferrer : Noncopyable {
+ class PageGroupLoadDeferrer : public Noncopyable {
public:
PageGroupLoadDeferrer(Page*, bool deferSelf);
~PageGroupLoadDeferrer();
diff --git a/src/3rdparty/webkit/WebCore/page/Settings.cpp b/src/3rdparty/webkit/WebCore/page/Settings.cpp
index 6f8b7c7..133dd9a 100644
--- a/src/3rdparty/webkit/WebCore/page/Settings.cpp
+++ b/src/3rdparty/webkit/WebCore/page/Settings.cpp
@@ -64,6 +64,7 @@ Settings::Settings(Page* page)
, m_arePluginsEnabled(false)
, m_databasesEnabled(false)
, m_localStorageEnabled(false)
+ , m_sessionStorageEnabled(true)
, m_isJavaScriptEnabled(false)
, m_isWebSecurityEnabled(true)
, m_allowUniversalAccessFromFileURLs(true)
@@ -244,6 +245,11 @@ void Settings::setLocalStorageEnabled(bool localStorageEnabled)
m_localStorageEnabled = localStorageEnabled;
}
+void Settings::setSessionStorageEnabled(bool sessionStorageEnabled)
+{
+ m_sessionStorageEnabled = sessionStorageEnabled;
+}
+
void Settings::setPrivateBrowsingEnabled(bool privateBrowsingEnabled)
{
m_privateBrowsingEnabled = privateBrowsingEnabled;
diff --git a/src/3rdparty/webkit/WebCore/page/Settings.h b/src/3rdparty/webkit/WebCore/page/Settings.h
index 962af18..544d0d5 100644
--- a/src/3rdparty/webkit/WebCore/page/Settings.h
+++ b/src/3rdparty/webkit/WebCore/page/Settings.h
@@ -125,6 +125,9 @@ namespace WebCore {
void setLocalStorageEnabled(bool);
bool localStorageEnabled() const { return m_localStorageEnabled; }
+ void setSessionStorageEnabled(bool);
+ bool sessionStorageEnabled() const { return m_sessionStorageEnabled; }
+
void setPrivateBrowsingEnabled(bool);
bool privateBrowsingEnabled() const { return m_privateBrowsingEnabled; }
@@ -277,6 +280,7 @@ namespace WebCore {
bool m_arePluginsEnabled : 1;
bool m_databasesEnabled : 1;
bool m_localStorageEnabled : 1;
+ bool m_sessionStorageEnabled : 1;
bool m_isJavaScriptEnabled : 1;
bool m_isWebSecurityEnabled : 1;
bool m_allowUniversalAccessFromFileURLs: 1;
diff --git a/src/3rdparty/webkit/WebCore/page/XSSAuditor.cpp b/src/3rdparty/webkit/WebCore/page/XSSAuditor.cpp
index 5dfc963..70b691b 100644
--- a/src/3rdparty/webkit/WebCore/page/XSSAuditor.cpp
+++ b/src/3rdparty/webkit/WebCore/page/XSSAuditor.cpp
@@ -46,9 +46,14 @@ using namespace WTF;
namespace WebCore {
-static bool isNonNullControlCharacter(UChar c)
+static bool isNonCanonicalCharacter(UChar c)
{
- return (c > '\0' && c < ' ') || c == 127;
+ // Note, we don't remove backslashes like PHP stripslashes(), which among other things converts "\\0" to the \0 character.
+ // Instead, we remove backslashes and zeros (since the string "\\0" =(remove backslashes)=> "0"). However, this has the
+ // adverse effect that we remove any legitimate zeros from a string.
+ //
+ // For instance: new String("http://localhost:8000") => new String("http://localhost:8").
+ return (c == '\\' || c == '0' || c < ' ' || c == 127);
}
XSSAuditor::XSSAuditor(Frame* frame)
@@ -66,12 +71,12 @@ bool XSSAuditor::isEnabled() const
return (settings && settings->xssAuditorEnabled());
}
-bool XSSAuditor::canEvaluate(const String& sourceCode) const
+bool XSSAuditor::canEvaluate(const String& code) const
{
if (!isEnabled())
return true;
- if (findInRequest(sourceCode, false, true, false)) {
+ if (findInRequest(code, false)) {
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute a JavaScript script. Source code of script found within request.\n"));
m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
return false;
@@ -84,7 +89,7 @@ bool XSSAuditor::canEvaluateJavaScriptURL(const String& code) const
if (!isEnabled())
return true;
- if (findInRequest(code, false, false, true, true)) {
+ if (findInRequest(code)) {
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute a JavaScript script. Source code of script found within request.\n"));
m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
return false;
@@ -123,7 +128,7 @@ bool XSSAuditor::canLoadObject(const String& url) const
if (!isEnabled())
return true;
- if (findInRequest(url, false, false)) {
+ if (findInRequest(url)) {
DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute a JavaScript script. Source code of script found within request"));
m_frame->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage, 1, String());
return false;
@@ -145,11 +150,16 @@ bool XSSAuditor::canSetBaseElementURL(const String& url) const
return true;
}
-String XSSAuditor::decodeURL(const String& str, const TextEncoding& encoding, bool allowNullCharacters,
- bool allowNonNullControlCharacters, bool decodeHTMLentities, bool leaveUndecodableHTMLEntitiesUntouched)
+String XSSAuditor::canonicalize(const String& string)
+{
+ String result = decodeHTMLEntities(string);
+ return result.removeCharacters(&isNonCanonicalCharacter);
+}
+
+String XSSAuditor::decodeURL(const String& string, const TextEncoding& encoding, bool decodeHTMLentities)
{
String result;
- String url = str;
+ String url = string;
url.replace('+', ' ');
result = decodeURLEscapeSequences(url);
@@ -157,20 +167,13 @@ String XSSAuditor::decodeURL(const String& str, const TextEncoding& encoding, bo
if (!decodedResult.isEmpty())
result = decodedResult;
if (decodeHTMLentities)
- result = decodeHTMLEntities(result, leaveUndecodableHTMLEntitiesUntouched);
- if (!allowNullCharacters)
- result = StringImpl::createStrippingNullCharacters(result.characters(), result.length());
- if (!allowNonNullControlCharacters) {
- decodedResult = result.removeCharacters(&isNonNullControlCharacter);
- if (!decodedResult.isEmpty())
- result = decodedResult;
- }
+ result = decodeHTMLEntities(result);
return result;
}
-String XSSAuditor::decodeHTMLEntities(const String& str, bool leaveUndecodableHTMLEntitiesUntouched)
+String XSSAuditor::decodeHTMLEntities(const String& string, bool leaveUndecodableHTMLEntitiesUntouched)
{
- SegmentedString source(str);
+ SegmentedString source(string);
SegmentedString sourceShadow;
Vector<UChar> result;
@@ -193,7 +196,7 @@ String XSSAuditor::decodeHTMLEntities(const String& str, bool leaveUndecodableHT
if (entity > 0xFFFF) {
result.append(U16_LEAD(entity));
result.append(U16_TRAIL(entity));
- } else if (!leaveUndecodableHTMLEntitiesUntouched || entity != 0xFFFD){
+ } else if (entity && (!leaveUndecodableHTMLEntitiesUntouched || entity != 0xFFFD)){
result.append(entity);
} else {
result.append('&');
@@ -205,22 +208,18 @@ String XSSAuditor::decodeHTMLEntities(const String& str, bool leaveUndecodableHT
return String::adopt(result);
}
-bool XSSAuditor::findInRequest(const String& string, bool matchNullCharacters, bool matchNonNullControlCharacters,
- bool decodeHTMLentities, bool leaveUndecodableHTMLEntitiesUntouched) const
+bool XSSAuditor::findInRequest(const String& string, bool decodeHTMLentities) const
{
bool result = false;
Frame* parentFrame = m_frame->tree()->parent();
if (parentFrame && m_frame->document()->url() == blankURL())
- result = findInRequest(parentFrame, string, matchNullCharacters, matchNonNullControlCharacters,
- decodeHTMLentities, leaveUndecodableHTMLEntitiesUntouched);
+ result = findInRequest(parentFrame, string, decodeHTMLentities);
if (!result)
- result = findInRequest(m_frame, string, matchNullCharacters, matchNonNullControlCharacters,
- decodeHTMLentities, leaveUndecodableHTMLEntitiesUntouched);
+ result = findInRequest(m_frame, string, decodeHTMLentities);
return result;
}
-bool XSSAuditor::findInRequest(Frame* frame, const String& string, bool matchNullCharacters, bool matchNonNullControlCharacters,
- bool decodeHTMLentities, bool leaveUndecodableHTMLEntitiesUntouched) const
+bool XSSAuditor::findInRequest(Frame* frame, const String& string, bool decodeHTMLentities) const
{
ASSERT(frame->document());
String pageURL = frame->document()->url().string();
@@ -236,11 +235,14 @@ bool XSSAuditor::findInRequest(Frame* frame, const String& string, bool matchNul
if (string.isEmpty())
return false;
+ String canonicalizedString = canonicalize(string);
+ if (canonicalizedString.isEmpty())
+ return false;
+
if (string.length() < pageURL.length()) {
// The string can actually fit inside the pageURL.
- String decodedPageURL = decodeURL(pageURL, frame->document()->decoder()->encoding(), matchNullCharacters,
- matchNonNullControlCharacters, decodeHTMLentities, leaveUndecodableHTMLEntitiesUntouched);
- if (decodedPageURL.find(string, 0, false) != -1)
+ String decodedPageURL = canonicalize(decodeURL(pageURL, frame->document()->decoder()->encoding(), decodeHTMLentities));
+ if (decodedPageURL.find(canonicalizedString, 0, false) != -1)
return true; // We've found the smoking gun.
}
@@ -252,9 +254,8 @@ bool XSSAuditor::findInRequest(Frame* frame, const String& string, bool matchNul
// the url-encoded POST data because the length of the url-decoded
// code is less than or equal to the length of the url-encoded
// string.
- String decodedFormData = decodeURL(formData, frame->document()->decoder()->encoding(), matchNullCharacters,
- matchNonNullControlCharacters, decodeHTMLentities, leaveUndecodableHTMLEntitiesUntouched);
- if (decodedFormData.find(string, 0, false) != -1)
+ String decodedFormData = canonicalize(decodeURL(formData, frame->document()->decoder()->encoding(), decodeHTMLentities));
+ if (decodedFormData.find(canonicalizedString, 0, false) != -1)
return true; // We found the string in the POST data.
}
}
diff --git a/src/3rdparty/webkit/WebCore/page/XSSAuditor.h b/src/3rdparty/webkit/WebCore/page/XSSAuditor.h
index 6c6a56c..26f10ab 100644
--- a/src/3rdparty/webkit/WebCore/page/XSSAuditor.h
+++ b/src/3rdparty/webkit/WebCore/page/XSSAuditor.h
@@ -72,7 +72,7 @@ namespace WebCore {
// Determines whether the script should be allowed or denied execution
// based on the content of any user-submitted data.
- bool canEvaluate(const String& sourceCode) const;
+ bool canEvaluate(const String& code) const;
// Determines whether the JavaScript URL should be allowed or denied execution
// based on the content of any user-submitted data.
@@ -99,17 +99,15 @@ namespace WebCore {
bool canSetBaseElementURL(const String& url) const;
private:
- static String decodeURL(const String& url, const TextEncoding& encoding = UTF8Encoding(), bool allowNullCharacters = false,
- bool allowNonNullControlCharacters = true, bool decodeHTMLentities = true,
- bool leaveUndecodableHTMLEntitiesUntouched = false);
+ static String canonicalize(const String&);
- static String decodeHTMLEntities(const String&, bool leaveUndecodableHTMLEntitiesUntouched = false);
+ static String decodeURL(const String& url, const TextEncoding& encoding = UTF8Encoding(), bool decodeHTMLentities = true);
+
+ static String decodeHTMLEntities(const String&, bool leaveUndecodableHTMLEntitiesUntouched = true);
- bool findInRequest(const String&, bool matchNullCharacters = true, bool matchNonNullControlCharacters = true,
- bool decodeHTMLentities = true, bool leaveUndecodableHTMLEntitiesUntouched = false) const;
+ bool findInRequest(const String&, bool decodeHTMLentities = true) const;
- bool findInRequest(Frame*, const String&, bool matchNullCharacters = true, bool matchNonNullControlCharacters = true,
- bool decodeHTMLentities = true, bool leaveUndecodableHTMLEntitiesUntouched = false) const;
+ bool findInRequest(Frame*, const String&, bool decodeHTMLentities = true) const;
// The frame to audit.
Frame* m_frame;
diff --git a/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp b/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
index a4916e9..dad763c 100644
--- a/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
+++ b/src/3rdparty/webkit/WebCore/page/animation/AnimationBase.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -113,11 +113,23 @@ static inline IntSize blendFunc(const AnimationBase* anim, const IntSize& from,
blendFunc(anim, from.height(), to.height(), progress));
}
+static inline ShadowStyle blendFunc(const AnimationBase* anim, ShadowStyle from, ShadowStyle to, double progress)
+{
+ if (from == to)
+ return to;
+
+ double fromVal = from == Normal ? 1 : 0;
+ double toVal = to == Normal ? 1 : 0;
+ double result = blendFunc(anim, fromVal, toVal, progress);
+ return result > 0 ? Normal : Inset;
+}
+
static inline ShadowData* blendFunc(const AnimationBase* anim, const ShadowData* from, const ShadowData* to, double progress)
{
ASSERT(from && to);
return new ShadowData(blendFunc(anim, from->x, to->x, progress), blendFunc(anim, from->y, to->y, progress),
- blendFunc(anim, from->blur, to->blur, progress), blendFunc(anim, from->color, to->color, progress));
+ blendFunc(anim, from->blur, to->blur, progress), blendFunc(anim, from->spread, to->spread, progress),
+ blendFunc(anim, from->style, to->style, progress), blendFunc(anim, from->color, to->color, progress));
}
static inline TransformOperations blendFunc(const AnimationBase* anim, const TransformOperations& from, const TransformOperations& to, double progress)
@@ -300,7 +312,7 @@ public:
{
ShadowData* shadowA = (a->*m_getter)();
ShadowData* shadowB = (b->*m_getter)();
- ShadowData defaultShadowData(0, 0, 0, Color::transparent);
+ ShadowData defaultShadowData(0, 0, 0, 0, Normal, Color::transparent);
if (!shadowA)
shadowA = &defaultShadowData;
@@ -473,7 +485,7 @@ static void ensurePropertyMap()
gPropertyWrappers->append(new PropertyWrapperMaybeInvalidColor(CSSPropertyOutlineColor, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor));
// These are for shadows
- gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyWebkitBoxShadow, &RenderStyle::boxShadow, &RenderStyle::setBoxShadow));
+ gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyBoxShadow, &RenderStyle::boxShadow, &RenderStyle::setBoxShadow));
gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyTextShadow, &RenderStyle::textShadow, &RenderStyle::setTextShadow));
#if ENABLE(SVG)
diff --git a/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp
new file mode 100644
index 0000000..0b95558
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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"
+
+#include <InterfaceDefs.h>
+
+
+namespace WebCore
+{
+
+// FIXME: These values are straight out of DragControllerMac, so probably have
+// little correlation with Haiku 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()
+{
+ if (modifiers() & B_COMMAND_KEY)
+ return true;
+
+ 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/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp
new file mode 100644
index 0000000..8d5dcb5
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ *
+ * 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 "EventHandler.h"
+
+#include "ClipboardHaiku.h"
+#include "EventNames.h"
+#include "FocusController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "HitTestResult.h"
+#include "KeyboardEvent.h"
+#include "MouseEventWithHitTestResults.h"
+#include "Page.h"
+#include "PlatformKeyboardEvent.h"
+#include "PlatformScrollBar.h"
+#include "PlatformWheelEvent.h"
+#include "RenderWidget.h"
+
+#include "NotImplemented.h"
+
+#include <interface/View.h>
+
+
+namespace WebCore {
+
+const double EventHandler::TextDragDelay = 0.0;
+
+static bool isKeyboardOptionTab(KeyboardEvent* event)
+{
+ return event
+ && (event->type() == eventNames().keydownEvent
+ || event->type() == eventNames().keypressEvent)
+ && event->altKey()
+ && event->keyIdentifier() == "U+000009";
+}
+
+bool EventHandler::invertSenseOfTabsToLinks(KeyboardEvent* event) const
+{
+ return isKeyboardOptionTab(event);
+}
+
+bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
+{
+ bool handlingOptionTab = isKeyboardOptionTab(event);
+
+ return handlingOptionTab;
+}
+
+void EventHandler::focusDocumentView()
+{
+ BView* view = m_frame->view()->platformWidget();
+ if (view)
+ view->MakeFocus();
+
+ Page* page = m_frame->page();
+ if (page)
+ page->focusController()->setFocusedFrame(m_frame);
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event)
+{
+ // Figure out which view to send the event to.
+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0;
+ if (!target || !target->isWidget())
+ return false;
+
+ return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget());
+}
+
+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget)
+{
+ return passMouseDownEventToWidget(renderWidget->widget());
+}
+
+bool EventHandler::passMouseDownEventToWidget(Widget* widget)
+{
+ notImplemented();
+ return false;
+}
+
+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const
+{
+ notImplemented();
+ return false;
+}
+
+bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe, HitTestResult*)
+{
+ notImplemented();
+ return true;
+}
+
+bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget)
+{
+ notImplemented();
+ return false;
+}
+
+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
+{
+ return new ClipboardHaiku(ClipboardWritable, true);
+}
+
+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+ return passSubframeEventToSubframe(mev, subframe);
+}
+
+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode)
+{
+ return passSubframeEventToSubframe(mev, subframe, hoveredNode);
+}
+
+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
+{
+ return passSubframeEventToSubframe(mev, subframe);
+}
+
+unsigned EventHandler::accessKeyModifiers()
+{
+ return PlatformKeyboardEvent::AltKey;
+}
+
+} // namespace WebCore
+
diff --git a/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp
new file mode 100644
index 0000000..50168dd
--- /dev/null
+++ b/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 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 "Frame.h"
+
+#include "NotImplemented.h"
+
+
+namespace WebCore {
+
+DragImageRef Frame::dragImageForSelection()
+{
+ notImplemented();
+ return 0;
+}
+
+} // namespace WebCore
+