summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/page
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/page')
-rw-r--r--Source/WebCore/page/EventHandler.cpp8
-rw-r--r--Source/WebCore/page/Location.cpp18
-rw-r--r--Source/WebCore/page/Location.h4
3 files changed, 6 insertions, 24 deletions
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index a737754..45450b5 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -3224,15 +3224,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// When sending a touch cancel event, use empty touches and targetTouches lists.
bool isTouchCancelEvent = (state == PlatformTouchPoint::TouchCancelled);
RefPtr<TouchList>& effectiveTouches(isTouchCancelEvent ? emptyList : touches);
-#if PLATFORM(ANDROID)
- AtomicString stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state)));
- if (event.type() == TouchLongPress)
- stateName = eventNames().touchlongpressEvent;
- else if (event.type() == TouchDoubleTap)
- stateName = eventNames().touchdoubletapEvent;
-#else
const AtomicString& stateName(eventNameForTouchPointState(static_cast<PlatformTouchPoint::State>(state)));
-#endif
const EventTargetSet& targetsForState = changedTouches[state].m_targets;
for (EventTargetSet::const_iterator it = targetsForState.begin(); it != targetsForState.end(); ++it) {
diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp
index 4835a83..fb68a09 100644
--- a/Source/WebCore/page/Location.cpp
+++ b/Source/WebCore/page/Location.cpp
@@ -63,8 +63,7 @@ String Location::href() const
if (!m_frame)
return String();
- const KURL& url = this->url();
- return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";
+ return url().string();
}
String Location::protocol() const
@@ -83,7 +82,7 @@ String Location::host() const
// Note: this is the IE spec. The NS spec swaps the two, it says
// "The hostname property is the concatenation of the host and port properties, separated by a colon."
const KURL& url = this->url();
- return url.port() ? url.host() + ":" + String::number(url.port()) : url.host();
+ return url.hasPort() ? url.host() + ":" + String::number(url.port()) : url.host();
}
String Location::hostname() const
@@ -100,7 +99,7 @@ String Location::port() const
return String();
const KURL& url = this->url();
- return url.port() ? String::number(url.port()) : "";
+ return url.hasPort() ? String::number(url.port()) : "";
}
String Location::pathname() const
@@ -147,15 +146,6 @@ String Location::getParameter(const String& name) const
return parameters.get(name);
}
-String Location::toString() const
-{
- if (!m_frame)
- return String();
-
- const KURL& url = this->url();
- return url.hasPath() ? url.prettyURL() : url.prettyURL() + "/";
-}
-
void Location::setHref(const String& urlString, DOMWindow* activeWindow, DOMWindow* firstWindow)
{
if (!m_frame)
@@ -199,7 +189,7 @@ void Location::setPort(const String& portString, DOMWindow* activeWindow, DOMWin
return;
KURL url = m_frame->document()->url();
int port = portString.toInt();
- if (port < 0 || port > 0xFFFF)
+ if (port < 0 || port > 0xFFFF || portString.isEmpty())
url.removePort();
else
url.setPort(port);
diff --git a/Source/WebCore/page/Location.h b/Source/WebCore/page/Location.h
index 1b68cee..0e89ecf 100644
--- a/Source/WebCore/page/Location.h
+++ b/Source/WebCore/page/Location.h
@@ -29,9 +29,9 @@
#ifndef Location_h
#define Location_h
-#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -71,7 +71,7 @@ public:
String hash() const;
String origin() const;
- String toString() const;
+ String toString() const { return href(); }
String getParameter(const String&) const;