{
if (parent()) // don't attempt to scroll subframes; they're fully visible
return;
- PlatformBridge::setScrollPosition(this, pt.x(), pt.y());
+ PlatformBridge::setScrollPosition(this, m_scrollOrigin.x() + pt.x(),
+ m_scrollOrigin.y() + pt.y());
}
void ScrollView::platformSetScrollbarModes()
void ScrollView::platformRepaintContentRectangle(const IntRect &rect, bool now)
{
- android::WebViewCore::getWebViewCore(this)->contentInvalidate(rect);
+ IntRect offsetRect = rect;
+ offsetRect.move(m_scrollOrigin.x(), m_scrollOrigin.y());
+ android::WebViewCore::getWebViewCore(this)->contentInvalidate(offsetRect);
}
#ifdef ANDROID_CAPTURE_OFFSCREEN_PAINTS
pFrame->sendOrientationChangeEvent(orientation);
}
+static jboolean GetShouldStartScrolledRight(JNIEnv *env, jobject obj,
+ jint browserFrame)
+{
+ jboolean startScrolledRight = false; // default is start scrolled left
+ WebCore::Frame* frame = reinterpret_cast<WebCore::Frame*>(browserFrame);
+ WebCore::Document* document = frame->document();
+ if (document) {
+ RenderStyle* style = document->renderer()->style();
+ WritingMode writingMode = style->writingMode();
+ LOG_ASSERT(writingMode != WebCore::BottomToTopWritingMode,
+ "BottomToTopWritingMode isn't supported");
+ if (writingMode == WebCore::RightToLeftWritingMode)
+ startScrolledRight = true; // vertical-rl pages start scrolled right
+ else if (writingMode == WebCore::TopToBottomWritingMode)
+ startScrolledRight = !style->isLeftToRightDirection(); // RTL starts right
+ }
+ return startScrolledRight;
+}
+
#if USE(CHROME_NETWORK_STACK)
static void AuthenticationProceed(JNIEnv *env, jobject obj, int handle, jstring jUsername, jstring jPassword)
(void*) SslCertErrorCancel },
{ "nativeSslClientCert", "(I[B[[B)V",
(void*) SslClientCert },
+ { "nativeGetShouldStartScrolledRight", "(I)Z",
+ (void*) GetShouldStartScrolledRight },
};
int registerWebFrame(JNIEnv* env)
WebCore::PlatformGraphicsContext pgc(recordingCanvas);
WebCore::GraphicsContext gc(&pgc);
- recordingCanvas->translate(-inval.fLeft, -inval.fTop);
+ IntPoint origin = view->minimumScrollPosition();
+ WebCore::IntRect drawArea(inval.fLeft + origin.x(), inval.fTop + origin.y(),
+ inval.width(), inval.height());
+ recordingCanvas->translate(-drawArea.x(), -drawArea.y());
recordingCanvas->save();
- view->platformWidget()->draw(&gc, WebCore::IntRect(inval.fLeft,
- inval.fTop, inval.width(), inval.height()));
+ view->platformWidget()->draw(&gc, drawArea);
m_rebuildInval.op(inval, SkRegion::kUnion_Op);
DBG_SET_LOGD("m_rebuildInval={%d,%d,r=%d,b=%d}",
m_rebuildInval.getBounds().fLeft, m_rebuildInval.getBounds().fTop,
// When redirect with locked history, we would like to reset the
// scale factor. This is important for www.yahoo.com as it is
// redirected to www.yahoo.com/?rs=1 on load.
- || loadType == WebCore::FrameLoadTypeRedirectWithLockedBackForwardList);
+ || loadType == WebCore::FrameLoadTypeRedirectWithLockedBackForwardList
+ // When "request desktop page" is used, we want to treat it as
+ // a newly-loaded page.
+ || loadType == WebCore::FrameLoadTypeSame);
checkException(env);
DBG_NAV_LOG("call updateFrameCache");
if (width != screenWidth) {
m_mainFrame->view()->setUseFixedLayout(true);
m_mainFrame->view()->setFixedLayoutSize(IntSize(width, height));
- } else {
+ } else
m_mainFrame->view()->setUseFixedLayout(false);
- }
r->setNeedsLayoutAndPrefWidthsRecalc();
- m_mainFrame->view()->forceLayout();
+ if (m_mainFrame->view()->didFirstLayout())
+ m_mainFrame->view()->forceLayout();
// scroll to restore current screen center
if (node) {
if (width != screenWidth) {
m_mainFrame->view()->setUseFixedLayout(true);
m_mainFrame->view()->setFixedLayoutSize(IntSize(width, height));
- } else {
+ } else
m_mainFrame->view()->setUseFixedLayout(false);
- }
}
// update the currently visible screen as perceived by the plugin