summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/config.h4
-rw-r--r--WebCore/platform/android/PlatformBridge.h2
-rw-r--r--WebCore/rendering/RenderBox.cpp16
3 files changed, 22 insertions, 0 deletions
diff --git a/WebCore/config.h b/WebCore/config.h
index 8494f9e..4c7c2a9 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -135,6 +135,10 @@
#define ANDROID_FIX
+// Ensure that the fixed elements are set relative to the screen
+// rather than the virtual viewport
+#define ANDROID_FIXED_ELEMENTS
+
// Passes the webkit-originated changes of a focused textfield to our UI
// thread
#define ANDROID_ACCEPT_CHANGES_TO_FOCUSED_TEXTFIELDS
diff --git a/WebCore/platform/android/PlatformBridge.h b/WebCore/platform/android/PlatformBridge.h
index 45da526..43313a5 100644
--- a/WebCore/platform/android/PlatformBridge.h
+++ b/WebCore/platform/android/PlatformBridge.h
@@ -128,6 +128,8 @@ public:
static void setUIRootLayer(const FrameView* view, const LayerAndroid* layer);
static void immediateRepaint(const FrameView* view);
#endif // USE(ACCELERATED_COMPOSITING)
+ static int screenWidth(const FrameView* view);
+ static int screenHeight(const FrameView* view);
// Whether the WebView is paused.
// ANDROID
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index 92c3d99..722b772 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -56,6 +56,10 @@
#include "WMLNames.h"
#endif
+#ifdef ANDROID_FIXED_ELEMENTS
+#include "PlatformBridge.h"
+#endif
+
using namespace std;
namespace WebCore {
@@ -1786,6 +1790,12 @@ void RenderBox::calcVerticalMargins()
int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* containingBlock) const
{
+#ifdef ANDROID_FIXED_ELEMENTS
+ if (containingBlock->isRenderView()) {
+ const RenderView* view = toRenderView(containingBlock);
+ return PlatformBridge::screenWidth(view->frameView());
+ }
+#endif
if (containingBlock->isBox()) {
const RenderBox* containingBlockBox = toRenderBox(containingBlock);
return containingBlockBox->width() - containingBlockBox->borderLeft() - containingBlockBox->borderRight() - containingBlockBox->verticalScrollbarWidth();
@@ -1816,6 +1826,12 @@ int RenderBox::containingBlockWidthForPositioned(const RenderBoxModelObject* con
int RenderBox::containingBlockHeightForPositioned(const RenderBoxModelObject* containingBlock) const
{
+#ifdef ANDROID_FIXED_ELEMENTS
+ if (containingBlock->isRenderView()) {
+ const RenderView* view = toRenderView(containingBlock);
+ return PlatformBridge::screenHeight(view->frameView());
+ }
+#endif
int heightResult = 0;
if (containingBlock->isBox())
heightResult = toRenderBox(containingBlock)->height();