summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/Android.mk2
-rw-r--r--WebCore/bindings/v8/V8GCController.cpp14
-rw-r--r--WebCore/html/HTMLInputElement.cpp4
-rw-r--r--WebCore/platform/Timer.cpp5
-rw-r--r--WebCore/platform/android/PlatformBridge.h5
-rw-r--r--WebCore/platform/network/android/AuthenticationChallenge.h2
-rw-r--r--WebCore/platform/network/android/Cookie.cpp57
-rw-r--r--WebCore/platform/network/android/CookieJarAndroid.cpp (renamed from WebCore/platform/network/android/CookieClient.h)31
-rw-r--r--WebCore/rendering/RenderPartObject.cpp15
9 files changed, 33 insertions, 102 deletions
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 46d9caa..1fdbcbb 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -514,7 +514,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
platform/network/ResourceRequestBase.cpp \
platform/network/ResourceResponseBase.cpp \
\
- platform/network/android/Cookie.cpp \
+ platform/network/android/CookieJarAndroid.cpp \
platform/network/android/NetworkStateNotifierAndroid.cpp \
platform/network/android/ResourceHandleAndroid.cpp \
platform/network/android/ResourceRequestAndroid.cpp \
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp
index e08cf66..b478636 100644
--- a/WebCore/bindings/v8/V8GCController.cpp
+++ b/WebCore/bindings/v8/V8GCController.cpp
@@ -239,16 +239,6 @@ bool operator<(const GrouperItem& a, const GrouperItem& b)
typedef Vector<GrouperItem> GrouperList;
-#if PLATFORM(ANDROID)
-// Android's implementation of std::sort seems unable to do the necessary
-// template matching to pick up operator< for GrouperItem, so we have to
-// manually pass a comparison function.
-static bool compareGrouperItem(const GrouperItem& a, const GrouperItem& b)
-{
- return a < b;
-}
-#endif
-
class ObjectGrouperVisitor : public DOMWrapperMap<Node>::Visitor {
public:
ObjectGrouperVisitor()
@@ -295,11 +285,7 @@ public:
void applyGrouping()
{
// Group by sorting by the group id.
-#if PLATFORM(ANDROID)
- std::sort(m_grouper.begin(), m_grouper.end(), compareGrouperItem);
-#else
std::sort(m_grouper.begin(), m_grouper.end());
-#endif
// FIXME Should probably work in iterators here, but indexes were easier for my simple mind.
for (size_t i = 0; i < m_grouper.size(); ) {
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 163424d..acfe51f 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -340,11 +340,11 @@ bool HTMLInputElement::stepMismatch() const
// double's fractional part size is DBL_MAN_DIG-bit. If the current
// value is greater than step*2^DBL_MANT_DIG, the following fmod() makes
// no sense.
- if (doubleValue / pow(2, DBL_MANT_DIG) > step)
+ if (doubleValue / pow(2.0, DBL_MANT_DIG) > step)
return false;
double remainder = fmod(doubleValue, step);
// Accepts errors in lower 7-bit.
- double acceptableError = step / pow(2, DBL_MANT_DIG - 7);
+ double acceptableError = step / pow(2.0, DBL_MANT_DIG - 7);
return acceptableError < remainder && remainder < (step - acceptableError);
}
// Non-RANGE types should be rejected by getAllowedValueStep().
diff --git a/WebCore/platform/Timer.cpp b/WebCore/platform/Timer.cpp
index 4804540..ea3effd 100644
--- a/WebCore/platform/Timer.cpp
+++ b/WebCore/platform/Timer.cpp
@@ -37,11 +37,6 @@
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
-#if PLATFORM(ANDROID)
-#include "stl_iterator_base.h"
-#include "heap.h"
-#endif
-
using namespace std;
namespace WebCore {
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h
index e3f3b98..fcdfac7 100644
--- a/WebCore/platform/android/PlatformBridge.h
+++ b/WebCore/platform/android/PlatformBridge.h
@@ -48,6 +48,10 @@ public:
// KeyGenerator
static WTF::Vector<String> getSupportedKeyStrengthList();
static String getSignedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL&);
+ // Cookies
+ static void setCookies(const KURL&, const String& value);
+ static String cookies(const KURL&);
+ static bool cookiesEnabled();
// These ids need to be in sync with the constants in BrowserFrame.java
enum rawResId {
NoDomain = 1,
@@ -59,5 +63,6 @@ public:
};
static String* globalLocalizedName(rawResId resId);
};
+
}
#endif // PlatformBridge_h
diff --git a/WebCore/platform/network/android/AuthenticationChallenge.h b/WebCore/platform/network/android/AuthenticationChallenge.h
index e272d60..954bfd8 100644
--- a/WebCore/platform/network/android/AuthenticationChallenge.h
+++ b/WebCore/platform/network/android/AuthenticationChallenge.h
@@ -31,8 +31,6 @@
namespace WebCore {
-class ResourceHandle;
-
class AuthenticationChallenge : public AuthenticationChallengeBase {
};
diff --git a/WebCore/platform/network/android/Cookie.cpp b/WebCore/platform/network/android/Cookie.cpp
deleted file mode 100644
index 3d10e4a..0000000
--- a/WebCore/platform/network/android/Cookie.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright 2007, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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 "CookieClient.h"
-#include "JavaSharedClient.h"
-
-using namespace android;
-
-namespace WebCore {
-
-class Document;
-
-void setCookies(Document*, const KURL& url, const String& value)
-{
- if (JavaSharedClient::GetCookieClient())
- JavaSharedClient::GetCookieClient()->setCookies(url, value);
-}
-
-String cookies(const Document* , const KURL& url)
-{
- if (JavaSharedClient::GetCookieClient())
- return JavaSharedClient::GetCookieClient()->cookies(url);
- return String();
-}
-
-bool cookiesEnabled(const Document* )
-{
- if (JavaSharedClient::GetCookieClient())
- return JavaSharedClient::GetCookieClient()->cookiesEnabled();
- return false;
-}
-
-}
diff --git a/WebCore/platform/network/android/CookieClient.h b/WebCore/platform/network/android/CookieJarAndroid.cpp
index be2963e..ba4b5dc 100644
--- a/WebCore/platform/network/android/CookieClient.h
+++ b/WebCore/platform/network/android/CookieJarAndroid.cpp
@@ -23,24 +23,27 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef COOKIE_CLIENT_H
-#define COOKIE_CLIENT_H
+#include "config.h"
-#include "KURL.h"
-#include "PlatformString.h"
+#include "CookieJar.h"
-using namespace WebCore;
+#include "PlatformBridge.h"
-namespace android {
+namespace WebCore {
-class CookieClient {
+void setCookies(Document*, const KURL& url, const String& value)
+{
+ PlatformBridge::setCookies(url, value);
+}
+
+String cookies(const Document*, const KURL& url)
+{
+ return PlatformBridge::cookies(url);
+}
-public:
- virtual ~CookieClient() {}
- virtual void setCookies(const KURL& url, const String& value) = 0;
- virtual String cookies(const KURL& url) = 0;
- virtual bool cookiesEnabled() = 0;
-};
+bool cookiesEnabled(const Document*)
+{
+ return PlatformBridge::cookiesEnabled();
+}
}
-#endif
diff --git a/WebCore/rendering/RenderPartObject.cpp b/WebCore/rendering/RenderPartObject.cpp
index f864c00..8e9118e 100644
--- a/WebCore/rendering/RenderPartObject.cpp
+++ b/WebCore/rendering/RenderPartObject.cpp
@@ -322,10 +322,15 @@ void RenderPartObject::layout()
#ifdef FLATTEN_IFRAME
RenderPart::calcWidth();
RenderPart::calcHeight();
+ // Calculate the styled dimensions by subtracting the border and padding.
+ int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight();
+ int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
+ int styleWidth = width() - extraWidth;
+ int styleHeight = height() - extraHeight;
// Some IFrames have a width and/or height of 1 when they are meant to be
// hidden. If that is the case, do not try to expand.
- if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView()
- && width() > 1 && height() > 1) {
+ if (node()->hasTagName(iframeTag) && widget() && widget()->isFrameView() &&
+ styleWidth > 1 && styleHeight > 1) {
HTMLIFrameElement* element = static_cast<HTMLIFrameElement*>(node());
bool scrolling = element->scrollingMode() != ScrollbarAlwaysOff;
bool widthIsFixed = style()->width().isFixed();
@@ -336,15 +341,11 @@ void RenderPartObject::layout()
if (scrolling || !widthIsFixed || !heightIsFixed) {
FrameView* view = static_cast<FrameView*>(widget());
RenderView* root = view ? view->frame()->contentRenderer() : NULL;
- RenderPart* owner = view->frame()->ownerRenderer();
- if (root && style()->visibility() != HIDDEN
- && (!owner || owner->style()->visibility() != HIDDEN)) {
+ if (root && style()->visibility() != HIDDEN) {
// Update the dimensions to get the correct minimum preferred
// width
updateWidgetPosition();
- int extraWidth = paddingLeft() + paddingRight() + borderLeft() + borderRight();
- int extraHeight = paddingTop() + paddingBottom() + borderTop() + borderBottom();
// Use the preferred width if it is larger and only if
// scrollbars are visible or the width style is not fixed.
if (scrolling || !widthIsFixed)