Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index 1b064688c8f92e02e4ce5d9fc47aab0608aa33a3..0565e76ae0136c47e47b11680c4ecfaf928c1f7f 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -1366,6 +1366,25 @@ void FrameView::viewportConstrainedVisibleContentSizeChanged(bool widthChanged, |
} |
} |
+bool FrameView::shouldPlaceVerticalScrollbarOnLeft() const |
+{ |
+ // FIXME: Mainframe scrollbar placement should respect the embedding application RTL UI policy. |
+ // See crbug.com/249860. |
+ if (isMainFrame()) |
+ return false; |
+ |
+ Document* document = m_frame->document(); |
+ if (!document) |
+ return false; |
+ |
+ // <body> inherits 'direction' from <html>, so it can safaly be used |
+ // to dictate the frame vertical scrollbar placement. |
+ if (!document->body() || !document->body()->renderer()) |
+ return false; |
+ |
+ return document->body()->renderer()->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); |
+} |
+ |
IntSize FrameView::scrollOffsetForFixedPosition() const |
{ |
return toIntSize(clampScrollPosition(scrollPosition())); |