Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutText.cpp

Issue 1834703002: Fix preferred width calculation for 8bit ltr runs in rtl blocks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 int nextBreakable = -1; 897 int nextBreakable = -1;
898 int lastWordBoundary = 0; 898 int lastWordBoundary = 0;
899 float cachedWordTrailingSpaceWidth[2] = { 0, 0 }; // LTR, RTL 899 float cachedWordTrailingSpaceWidth[2] = { 0, 0 }; // LTR, RTL
900 900
901 bool breakAll = (styleToUse.wordBreak() == BreakAllWordBreak || styleToUse.w ordBreak() == BreakWordBreak) && styleToUse.autoWrap(); 901 bool breakAll = (styleToUse.wordBreak() == BreakAllWordBreak || styleToUse.w ordBreak() == BreakWordBreak) && styleToUse.autoWrap();
902 bool keepAll = styleToUse.wordBreak() == KeepAllWordBreak && styleToUse.auto Wrap(); 902 bool keepAll = styleToUse.wordBreak() == KeepAllWordBreak && styleToUse.auto Wrap();
903 903
904 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; 904 BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
905 BidiCharacterRun* run; 905 BidiCharacterRun* run;
906 TextDirection textDirection = styleToUse.direction(); 906 TextDirection textDirection = styleToUse.direction();
907 if (is8Bit() || isOverride(styleToUse.unicodeBidi())) { 907 if ((is8Bit() && textDirection == LTR) || isOverride(styleToUse.unicodeBidi( ))) {
908 run = 0; 908 run = 0;
909 } else { 909 } else {
910 TextRun textRun(text()); 910 TextRun textRun(text());
911 BidiStatus status(textDirection, false); 911 BidiStatus status(textDirection, false);
912 bidiResolver.setStatus(status); 912 bidiResolver.setStatus(status);
913 bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0)); 913 bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0));
914 bool hardLineBreak = false; 914 bool hardLineBreak = false;
915 bool reorderRuns = false; 915 bool reorderRuns = false;
916 bidiResolver.createBidiRunsForLine(TextRunIterator(&textRun, textRun.len gth()), NoVisualOverride, hardLineBreak, reorderRuns); 916 bidiResolver.createBidiRunsForLine(TextRunIterator(&textRun, textRun.len gth()), NoVisualOverride, hardLineBreak, reorderRuns);
917 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs(); 917 BidiRunList<BidiCharacterRun>& bidiRuns = bidiResolver.runs();
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) { 1751 for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
1752 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason); 1752 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason);
1753 if (box->truncation() != cNoTruncation) { 1753 if (box->truncation() != cNoTruncation) {
1754 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox()) 1754 if (EllipsisBox* ellipsisBox = box->root().ellipsisBox())
1755 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason); 1755 paintInvalidationContainer.invalidateDisplayItemClientOnBacking( *ellipsisBox, invalidationReason);
1756 } 1756 }
1757 } 1757 }
1758 } 1758 }
1759 1759
1760 } // namespace blink 1760 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698