diff options
author | Grace Kloba <klobag@google.com> | 2010-04-05 21:59:09 -0700 |
---|---|---|
committer | Grace Kloba <klobag@google.com> | 2010-04-06 12:39:41 -0700 |
commit | 6aaf87eda8480c9d766ba7d5a88d43240657c179 (patch) | |
tree | fc535f4a83e339e58e90b740fb05626b257541f5 | |
parent | b721be96061253a7a8e35313bb5ee794d03d9af8 (diff) | |
download | external_webkit-6aaf87eda8480c9d766ba7d5a88d43240657c179.zip external_webkit-6aaf87eda8480c9d766ba7d5a88d43240657c179.tar.gz external_webkit-6aaf87eda8480c9d766ba7d5a88d43240657c179.tar.bz2 |
When handling Fixed position, always relative to
the top document.
Fix http://b/issue?id=2281574
-rw-r--r-- | WebCore/config.h | 3 | ||||
-rw-r--r-- | WebCore/rendering/RenderView.cpp | 27 |
2 files changed, 30 insertions, 0 deletions
diff --git a/WebCore/config.h b/WebCore/config.h index 9c14b28..cdbc0a4 100644 --- a/WebCore/config.h +++ b/WebCore/config.h @@ -137,6 +137,9 @@ #define ANDROID_FIX +// Ensure that the fixed elements are always relative to the top document. +#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/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp index 502563e..094abfd 100644 --- a/WebCore/rendering/RenderView.cpp +++ b/WebCore/rendering/RenderView.cpp @@ -151,12 +151,30 @@ void RenderView::mapLocalToContainer(RenderBoxModelObject* repaintContainer, boo // then we should have found it by now. ASSERT_UNUSED(repaintContainer, !repaintContainer || repaintContainer == this); +#ifdef ANDROID_FIXED_ELEMENTS +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + const Settings * settings = document()->settings(); + if (settings && (settings->viewportWidth() == -1 || settings->viewportWidth() == 0) && + !settings->viewportUserScalable()) +#else + if (false) +#endif +#endif if (fixed && m_frameView) transformState.move(m_frameView->scrollOffset()); } void RenderView::mapAbsoluteToLocalPoint(bool fixed, bool /*useTransforms*/, TransformState& transformState) const { +#ifdef ANDROID_FIXED_ELEMENTS +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + const Settings * settings = document()->settings(); + if (settings && (settings->viewportWidth() == -1 || settings->viewportWidth() == 0) && + !settings->viewportUserScalable()) +#else + if (false) +#endif +#endif if (fixed && m_frameView) transformState.move(-m_frameView->scrollOffset()); } @@ -280,6 +298,15 @@ void RenderView::computeRectForRepaint(RenderBoxModelObject* repaintContainer, I if (printing()) return; +#ifdef ANDROID_FIXED_ELEMENTS +#if ENABLE(COMPOSITED_FIXED_ELEMENTS) + const Settings * settings = document()->settings(); + if (settings && (settings->viewportWidth() == -1 || settings->viewportWidth() == 0) && + !settings->viewportUserScalable()) +#else + if (false) +#endif +#endif if (fixed && m_frameView) rect.move(m_frameView->scrollX(), m_frameView->scrollY()); |