OLD | NEW |
1 /* | 1 /* |
2 * (C) 1999 Lars Knoll (knoll@kde.org) | 2 * (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Dirk Mueller (mueller@kde.org) | 3 * (C) 2000 Dirk Mueller (mueller@kde.org) |
4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 5 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 case ETextAlign::kStart: | 787 case ETextAlign::kStart: |
788 rightAligned = !cbStyle.isLeftToRightDirection(); | 788 rightAligned = !cbStyle.isLeftToRightDirection(); |
789 break; | 789 break; |
790 case ETextAlign::kEnd: | 790 case ETextAlign::kEnd: |
791 rightAligned = cbStyle.isLeftToRightDirection(); | 791 rightAligned = cbStyle.isLeftToRightDirection(); |
792 break; | 792 break; |
793 } | 793 } |
794 | 794 |
795 // for unicode-bidi: plaintext, use inlineBoxBidiLevel() to test the correct | 795 // for unicode-bidi: plaintext, use inlineBoxBidiLevel() to test the correct |
796 // direction for the cursor. | 796 // direction for the cursor. |
797 if (rightAligned && style()->unicodeBidi() == EUnicodeBidi::kPlaintext) { | 797 if (rightAligned && style()->getUnicodeBidi() == UnicodeBidi::kPlaintext) { |
798 if (inlineBox->bidiLevel() % 2 != 1) | 798 if (inlineBox->bidiLevel() % 2 != 1) |
799 rightAligned = false; | 799 rightAligned = false; |
800 } | 800 } |
801 | 801 |
802 if (rightAligned) { | 802 if (rightAligned) { |
803 left = std::max(left, leftEdge); | 803 left = std::max(left, leftEdge); |
804 left = std::min(left, rootRight - caretWidth()); | 804 left = std::min(left, rootRight - caretWidth()); |
805 } else { | 805 } else { |
806 left = std::min(left, rightEdge - caretWidthRightOfOffset); | 806 left = std::min(left, rightEdge - caretWidthRightOfOffset); |
807 left = std::max(left, rootLeft); | 807 left = std::max(left, rootLeft); |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1088 styleToUse.autoWrap() ? styleToUse.getHyphenation() : nullptr; | 1088 styleToUse.autoWrap() ? styleToUse.getHyphenation() : nullptr; |
1089 bool disableSoftHyphen = styleToUse.getHyphens() == HyphensNone; | 1089 bool disableSoftHyphen = styleToUse.getHyphens() == HyphensNone; |
1090 float maxWordWidth = 0; | 1090 float maxWordWidth = 0; |
1091 if (!hyphenation) | 1091 if (!hyphenation) |
1092 maxWordWidth = std::numeric_limits<float>::infinity(); | 1092 maxWordWidth = std::numeric_limits<float>::infinity(); |
1093 | 1093 |
1094 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; | 1094 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; |
1095 BidiCharacterRun* run; | 1095 BidiCharacterRun* run; |
1096 TextDirection textDirection = styleToUse.direction(); | 1096 TextDirection textDirection = styleToUse.direction(); |
1097 if ((is8Bit() && textDirection == TextDirection::kLtr) || | 1097 if ((is8Bit() && textDirection == TextDirection::kLtr) || |
1098 isOverride(styleToUse.unicodeBidi())) { | 1098 isOverride(styleToUse.getUnicodeBidi())) { |
1099 run = 0; | 1099 run = 0; |
1100 } else { | 1100 } else { |
1101 TextRun textRun(text()); | 1101 TextRun textRun(text()); |
1102 BidiStatus status(textDirection, false); | 1102 BidiStatus status(textDirection, false); |
1103 bidiResolver.setStatus(status); | 1103 bidiResolver.setStatus(status); |
1104 bidiResolver.setPositionIgnoringNestedIsolates( | 1104 bidiResolver.setPositionIgnoringNestedIsolates( |
1105 TextRunIterator(&textRun, 0)); | 1105 TextRunIterator(&textRun, 0)); |
1106 bool hardLineBreak = false; | 1106 bool hardLineBreak = false; |
1107 bool reorderRuns = false; | 1107 bool reorderRuns = false; |
1108 bidiResolver.createBidiRunsForLine( | 1108 bidiResolver.createBidiRunsForLine( |
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 LayoutRect rect = LayoutRect( | 1993 LayoutRect rect = LayoutRect( |
1994 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); | 1994 IntRect(firstRunX(), firstRunY(), linesBox.width(), linesBox.height())); |
1995 LayoutBlock* block = containingBlock(); | 1995 LayoutBlock* block = containingBlock(); |
1996 if (block && hasTextBoxes()) | 1996 if (block && hasTextBoxes()) |
1997 block->adjustChildDebugRect(rect); | 1997 block->adjustChildDebugRect(rect); |
1998 | 1998 |
1999 return rect; | 1999 return rect; |
2000 } | 2000 } |
2001 | 2001 |
2002 } // namespace blink | 2002 } // namespace blink |
OLD | NEW |