When include_partial_glyphs = false and the position is exactly at a character boundary, OffsetForPosition() returns the previous character. This does not match to what PositionForOffset(), and fails several tests in ShapingLineBreaker.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1fb6007f25ce38b50bd6700f292e65ca8e501e7b commit 1fb6007f25ce38b50bd6700f292e65ca8e501e7b Author: kojii <kojii@chromium.org> Date: Tue Jun 06 12:02:26 2017 Fix ShapeResult::OffsetForPosition edge behavior This patch fixes ShapeResult::OffsetForPosition, when the position is at exact character boundaries and include_partial_glyphs is false, to return the next character. Before this change, boundaries were part of previous characters. This function is used to identify how many characters can fit in a space, such as ShapingLineBreaker, ellipsis, and break-all, and thus the old behavior failed to fit a character exactly equal to the available space. Existing tests were rebaselined for such cases to be better. This fix also make OffsetForPosition matches to PositionForOffset. BUG= 729318 Review-Url: https://codereview.chromium.org/2924463002 Cr-Commit-Position: refs/heads/master@{#477263} [modify] https://crrev.com/1fb6007f25ce38b50bd6700f292e65ca8e501e7b/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/1fb6007f25ce38b50bd6700f292e65ca8e501e7b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp [modify] https://crrev.com/1fb6007f25ce38b50bd6700f292e65ca8e501e7b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8 commit ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8 Author: Rebaseline Bot <blink-rebaseline-bot@chromium.org> Date: Tue Jun 06 13:55:44 2017 Auto-rebaseline for r477263 Build: https://build.chromium.org/p/chromium.infra.cron/builders/rebaseline-o-matic/builds/711471 https://chromium.googlesource.com/chromium/src/+/1fb6007f25ce3 BUG= 729318 TBR=kojii@chromium.org Review-Url: https://codereview.chromium.org/2924823002 . Cr-Commit-Position: refs/heads/master@{#477276} [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-center-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-justify-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-left-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-ellipsis-text-align-right-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/text-overflow-input-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/line-clamp-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-ltr-text-in-rtl-flow-leading-space-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-2-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-center-2-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-2-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-left-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/fast/text/place-mixed-ellipsis-in-inline-blocks-align-right-2-expected.png [add] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/editing/selection/select-text-overflow-ellipsis-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-center-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-justify-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-left-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-ellipsis-text-align-right-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/text-overflow-input-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-center-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/css/vertical-text-overflow-ellipsis-text-align-right-expected.txt [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/fast/overflow/line-clamp-expected.png [modify] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/paint/spellmarkers/inline_spelling_markers-expected.png [add] https://crrev.com/ab6eafccc224203a0cf2bbad843d7e3bc84c3bf8/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/spellmarkers/inline_spelling_markers-expected.png
Comment 1 by kojii@chromium.org
, Jun 4 2017