mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1097894: if the embedding level of a frame is unset, get the direction from style, r=dholbert
This commit is contained in:
parent
a5e6b6466d
commit
1c01b9709d
@ -5900,7 +5900,18 @@ nsFrame::GetPointFromOffset(int32_t inOffset, nsPoint* outPoint)
|
||||
if (newContent){
|
||||
int32_t newOffset = newContent->IndexOf(mContent);
|
||||
|
||||
bool isRTL = (NS_GET_EMBEDDING_LEVEL(this) & 1) == 1;
|
||||
// Find the direction of the frame from the EmbeddingLevelProperty,
|
||||
// which is the resolved bidi level set in
|
||||
// nsBidiPresUtils::ResolveParagraph (odd levels = right-to-left).
|
||||
// If the embedding level isn't set, just use the CSS direction
|
||||
// property.
|
||||
bool hasEmbeddingLevel;
|
||||
nsBidiLevel embeddingLevel =
|
||||
NS_PTR_TO_INT32(Properties().Get(nsIFrame::EmbeddingLevelProperty(),
|
||||
&hasEmbeddingLevel));
|
||||
bool isRTL = hasEmbeddingLevel
|
||||
? (embeddingLevel & 1) == 1
|
||||
: StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL;
|
||||
if ((!isRTL && inOffset > newOffset) ||
|
||||
(isRTL && inOffset <= newOffset)) {
|
||||
pt = contentRect.TopRight();
|
||||
|
Loading…
Reference in New Issue
Block a user