Automatic update from web-platform-tests
Avoid DCHECK failure when reusing space and newline with white-space:pre
Consider this code:
<style>i { white-space: pre-line }</style>
X<i> </i><i> </i>
The first time that NGInlineNode::CollectInlines runs, the text data
will be "X", then "X ", and then AppendForcedBreakCollapseWhitespace
will remove the trailing whitespace before inserting the forced break,
so we get "X\n".
But if some text is appended dynamically, CollectInlines will run again,
and this time it will try to reuse existing items in AppendTextReusing.
Before this patch, this would produce "X \n", which would trigger a
DCHECK failure in ComputeOffsetMapping because it's a different string.
Therefore, this patch prevents AppendTextReusing from reusing existing
items if the last item to collapse with ends with collapsible spaces and
the first item to reuse has 'white-space:pre' and begins with a newline.
Bug: 1136688
TEST=external/wpt/css/css-text/white-space/pre-line-with-space-and-newline.html
Change-Id: I0ff71b125b66256ec3b5c263605c3c116f9ac55f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466279
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Oriol Brufau <obrufau@igalia.com>
Cr-Commit-Position: refs/heads/master@{#816641}
--
wpt-commits: 5b6e508729caf23ab70c4db695315aef951c3d50
wpt-pr: 26101
An explanation of the Firefox Source Code Directory Structure and links to
project pages with documentation can be found at:
https://firefox-source-docs.mozilla.org/contributing/directory_structure.html
For information on how to build Firefox from the source code and create the patch see:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
If you have a question about developing Firefox, and can't find the solution
on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel.
Nightly development builds can be downloaded from:
https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
- or -
https://www.mozilla.org/firefox/channel/desktop/#nightly
Keep in mind that nightly builds, which are used by Firefox developers for
testing, may be buggy.