summaryrefslogtreecommitdiff
path: root/Source/WebCore/page/FrameView.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:09:45 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-22 09:10:13 +0100
commit470286ecfe79d59df14944e5b5d34630fc739391 (patch)
tree43983212872e06cebefd2ae474418fa2908ca54c /Source/WebCore/page/FrameView.cpp
parent23037105e948c2065da5a937d3a2396b0ff45c1e (diff)
downloadqtwebkit-470286ecfe79d59df14944e5b5d34630fc739391.tar.gz
Imported WebKit commit e89504fa9195b2063b2530961d4b73dd08de3242 (http://svn.webkit.org/repository/webkit/trunk@135485)
Change-Id: I03774e5ac79721c13ffa30d152537a74d0b12e66 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'Source/WebCore/page/FrameView.cpp')
-rw-r--r--Source/WebCore/page/FrameView.cpp46
1 files changed, 11 insertions, 35 deletions
diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp
index 6acd1087f..93ce91bf0 100644
--- a/Source/WebCore/page/FrameView.cpp
+++ b/Source/WebCore/page/FrameView.cpp
@@ -192,6 +192,9 @@ FrameView::FrameView(Frame* frame)
, m_shouldAutoSize(false)
, m_inAutoSize(false)
, m_didRunAutosize(false)
+#if ENABLE(CSS_FILTERS)
+ , m_hasSoftwareFilters(false)
+#endif
{
init();
@@ -509,6 +512,11 @@ void FrameView::updateCanHaveScrollbars()
PassRefPtr<Scrollbar> FrameView::createScrollbar(ScrollbarOrientation orientation)
{
+ if (Settings* settings = m_frame->settings()) {
+ if (!settings->allowCustomScrollbarInMainFrame() && m_frame->page() && m_frame->page()->mainFrame() == m_frame)
+ return ScrollView::createScrollbar(orientation);
+ }
+
// FIXME: We need to update the scrollbar dynamically as documents change (or as doc elements and bodies get discovered that have custom styles).
Document* doc = m_frame->document();
@@ -1205,13 +1213,12 @@ void FrameView::layout(bool allowSubtree)
// Now update the positions of all layers.
beginDeferredRepaints();
- bool hasLayerOffset;
- LayoutPoint offsetFromRoot = layer->computeOffsetFromRoot(hasLayerOffset);
if (m_doFullRepaint)
root->view()->repaint(); // FIXME: This isn't really right, since the RenderView doesn't fully encompass the visibleContentRect(). It just happens
// to work out most of the time, since first layouts and printing don't have you scrolled anywhere.
- layer->updateLayerPositions(hasLayerOffset ? &offsetFromRoot : 0, updateLayerPositionFlags(layer, subtree, m_doFullRepaint));
+ layer->updateLayerPositionsAfterLayout(rootRenderer(this)->layer(), updateLayerPositionFlags(layer, subtree, m_doFullRepaint));
+
endDeferredRepaints();
#if USE(ACCELERATED_COMPOSITING)
@@ -1465,45 +1472,14 @@ void FrameView::removeViewportConstrainedObject(RenderObject* object)
}
}
-static int fixedPositionScrollOffset(int scrollPosition, int maxValue, int scrollOrigin, float dragFactor)
-{
- if (!maxValue)
- return 0;
-
- if (!scrollOrigin) {
- if (scrollPosition < 0)
- scrollPosition = 0;
- else if (scrollPosition > maxValue)
- scrollPosition = maxValue;
- } else {
- if (scrollPosition > 0)
- scrollPosition = 0;
- else if (scrollPosition < -maxValue)
- scrollPosition = -maxValue;
- }
-
- return scrollPosition * dragFactor;
-}
-
IntSize FrameView::scrollOffsetForFixedPosition() const
{
IntRect visibleContentRect = this->visibleContentRect();
IntSize contentsSize = this->contentsSize();
IntPoint scrollPosition = this->scrollPosition();
IntPoint scrollOrigin = this->scrollOrigin();
-
- IntSize maxOffset(contentsSize.width() - visibleContentRect.width(), contentsSize.height() - visibleContentRect.height());
-
float frameScaleFactor = m_frame ? m_frame->frameScaleFactor() : 1;
-
- FloatSize dragFactor = fixedElementsLayoutRelativeToFrame() ? FloatSize(1, 1) : FloatSize(
- (contentsSize.width() - visibleContentRect.width() * frameScaleFactor) / maxOffset.width(),
- (contentsSize.height() - visibleContentRect.height() * frameScaleFactor) / maxOffset.height());
-
- int x = fixedPositionScrollOffset(scrollPosition.x(), maxOffset.width(), scrollOrigin.x(), dragFactor.width() / frameScaleFactor);
- int y = fixedPositionScrollOffset(scrollPosition.y(), maxOffset.height(), scrollOrigin.y(), dragFactor.height() / frameScaleFactor);
-
- return IntSize(x, y);
+ return WebCore::scrollOffsetForFixedPosition(visibleContentRect, contentsSize, scrollPosition, scrollOrigin, frameScaleFactor, fixedElementsLayoutRelativeToFrame());
}
bool FrameView::fixedElementsLayoutRelativeToFrame() const