Chromium Code Reviews| Index: Source/core/dom/Position.cpp |
| diff --git a/Source/core/dom/Position.cpp b/Source/core/dom/Position.cpp |
| index 64f8730cc6f540937921deecae0cba42dc7c9d30..be00622ba2c966e90fc7cc11fcc75474b262f90c 100644 |
| --- a/Source/core/dom/Position.cpp |
| +++ b/Source/core/dom/Position.cpp |
| @@ -1260,7 +1260,14 @@ void Position::getInlineBoxAndOffset(EAffinity affinity, TextDirection primaryDi |
| break; |
| inlineBox = prevBox; |
| } |
| - caretOffset = inlineBox->caretLeftmostOffset(); |
| + // A special scenario when attribute auto is set. if the direction is changed use right offset |
|
leviw_travelin_and_unemployed
2014/05/28 17:42:31
It's not just "attribute auto," but dirAuto.
Inst
Habib Virji
2014/05/29 07:58:26
Ok thanks will update accordingly.
Habib Virji
2014/05/29 11:31:51
Done.
|
| + bool isAuto = false; |
| + if (deprecatedNode()->document().focusedElement()) |
|
leviw_travelin_and_unemployed
2014/05/28 17:42:31
Why the check for a focused element?
Habib Virji
2014/05/29 07:58:26
I need a way to access directionality function and
|
| + toHTMLElement(deprecatedNode()->document().focusedElement())->directionalityIfhasDirAutoAttribute(isAuto); |
|
leviw_travelin_and_unemployed
2014/05/28 17:42:31
directionalityIfhasDirAutoAttributre returns the d
Habib Virji
2014/05/29 07:58:26
directionalityIfhasDirAutoAttribute takes bool arg
Habib Virji
2014/05/29 11:31:51
Done.
|
| + if (isAuto) |
| + caretOffset = (inlineBox->bidiLevel() < level) ? inlineBox->caretLeftmostOffset() : inlineBox->caretRightmostOffset(); |
| + else |
| + caretOffset = inlineBox->caretLeftmostOffset(); |
| } else if (nextBox->bidiLevel() > level) { |
| // Left edge of a "tertiary" run. Set to the right edge of that run. |
| while (InlineBox* tertiaryBox = inlineBox->nextLeafChildIgnoringLineBreak()) { |