diff options
| author | eae <eae@chromium.org> | 2016-03-24 15:54:38 -0700 |
|---|---|---|
| committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 22:56:14 +0000 |
| commit | 5ba3aaa03c4a14575babc54240831d713975d8ca (patch) | |
| tree | 48fcddfdc1408221bdda58bfb4b33cdfc4e60862 | |
| parent | a7467383c208ef2e5a90d8e20979b6ba722ac104 (diff) | |
| download | chromium_src-5ba3aaa03c4a14575babc54240831d713975d8ca.zip chromium_src-5ba3aaa03c4a14575babc54240831d713975d8ca.tar.gz chromium_src-5ba3aaa03c4a14575babc54240831d713975d8ca.tar.bz2 | |
Fix preferred width calculation for 8bit ltr runs in rtl blocks
Fix trigger criteria in LayoutText::computePreferredLogicalWidths for 8-
bit runs. Before all 8-bit runs without explciit directionality override
was assumed to have the same fixed direction. This failed in cases where
the text direction had been specified for the parent block (direction:).
This caused RTL font metrics to be used to determine the preferred width
but LTR metrics to compute line breaking, resulting in incorrect breaks.
TEST=fast/text/ltr-text-in-rtl-8bit-block.html,
fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks.html
BUG=589525
R=szager@chromium.org
Review URL: https://codereview.chromium.org/1834703002
Cr-Commit-Position: refs/heads/master@{#383175}
4 files changed, 35 insertions, 1 deletions
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 3a1da95..d43bbe2 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations @@ -1233,6 +1233,16 @@ crbug.com/521730 [ Win10 ] svg/as-image/svg-canvas-xhtml-tainted.html [ Failure crbug.com/521730 [ Win10 ] svg/css/text-shadow-multiple.xhtml [ Failure ] crbug.com/521730 [ Win10 ] svg/custom/textPath-change-id2-pattern.svg [ Failure ] +crbug.com/589525 fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks.html [ NeedsRebaseline ] +crbug.com/589525 fast/text/bidi-embedding-pop-and-push-same.html [ NeedsRebaseline ] +crbug.com/589525 editing/selection/caret-ltr-2-left.html [ NeedsRebaseline ] +crbug.com/589525 fast/css/bidi-override-in-anonymous-block.html [ NeedsRebaseline ] +crbug.com/589525 fast/dom/34176.html [ NeedsRebaseline ] +crbug.com/589525 fast/inline/inline-continuation-borders.html [ NeedsRebaseline ] +crbug.com/589525 editing/selection/caret-ltr-2.html [ NeedsRebaseline ] +crbug.com/589525 tables/mozilla/bugs/bug5838.html [ NeedsRebaseline ] +crbug.com/589525 fast/block/basic/016.html [ NeedsRebaseline ] + crbug.com/591500 [ Win10 ] virtual/threaded/printing/ellipsis-printing-style.html [ Skip ] crbug.com/591500 [ Win10 ] printing/ellipsis-printing-style.html [ Skip ] crbug.com/591500 [ Win10 ] printing/iframe-print.html [ Skip ] diff --git a/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block-expected.html b/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block-expected.html new file mode 100644 index 0000000..d36693d --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block-expected.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + </head> + <body> + <span style="border:solid 1px red;display:inline-block;">SAP SE</span> + <p> + Line above should not wrap. + </p> + </body> +</html> diff --git a/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block.html b/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block.html new file mode 100644 index 0000000..4a02e3a --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/text/ltr-text-in-rtl-8bit-block.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html> + <head> + <meta charset="utf-8"> + </head> + <body> + <span style="border:solid 1px red;display:inline-block;direction:rtl">SAP SE</span> + <p> + Line above should not wrap. + </p> + </body> +</html> diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp index 3099e44..5525b67 100644 --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp @@ -904,7 +904,7 @@ void LayoutText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; BidiCharacterRun* run; TextDirection textDirection = styleToUse.direction(); - if (is8Bit() || isOverride(styleToUse.unicodeBidi())) { + if ((is8Bit() && textDirection == LTR) || isOverride(styleToUse.unicodeBidi())) { run = 0; } else { TextRun textRun(text()); |
