Bug 1077139 - Use the vertical-text I-beam cursor when the writing mode is vertical. r=dbaron
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -3783,20 +3783,21 @@ nsIFrame::AssociateImage(const nsStyleIm
nsresult
nsFrame::GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor)
{
FillCursorInformationFromStyle(StyleUserInterface(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
// If this is editable, I-beam cursor is better for most elements.
aCursor.mCursor =
- (mContent && mContent->IsEditable()) ? NS_STYLE_CURSOR_TEXT :
- NS_STYLE_CURSOR_DEFAULT;
- }
-
+ (mContent && mContent->IsEditable())
+ ? GetWritingMode().IsVertical()
+ ? NS_STYLE_CURSOR_VERTICAL_TEXT : NS_STYLE_CURSOR_TEXT
+ : NS_STYLE_CURSOR_DEFAULT;
+ }
return NS_OK;
}
// Resize and incremental reflow
/* virtual */ void
nsFrame::MarkIntrinsicISizesDirty()
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -4212,19 +4212,20 @@ NS_IMPL_FRAMEARENA_HELPERS(nsContinuingT
nsTextFrame::~nsTextFrame()
{
}
nsresult
nsTextFrame::GetCursor(const nsPoint& aPoint,
nsIFrame::Cursor& aCursor)
{
- FillCursorInformationFromStyle(StyleUserInterface(), aCursor);
+ FillCursorInformationFromStyle(StyleUserInterface(), aCursor);
if (NS_STYLE_CURSOR_AUTO == aCursor.mCursor) {
- aCursor.mCursor = NS_STYLE_CURSOR_TEXT;
+ aCursor.mCursor = GetWritingMode().IsVertical()
+ ? NS_STYLE_CURSOR_VERTICAL_TEXT : NS_STYLE_CURSOR_TEXT;
// If this is editable, we should ignore tabindex value.
if (mContent->IsEditable()) {
return NS_OK;
}
// If tabindex >= 0, use default cursor to indicate it's not selectable
nsIFrame *ancestorFrame = this;
while ((ancestorFrame = ancestorFrame->GetParent()) != nullptr) {