Bug 1790769 [wpt PR 35890] - Add CSSTokenizer-created strings to CSSVariableData...
commite9c3ec269ec23056ba1f34f53258cfd8ac4d6082
authorAnders Hartvoll Ruud <andruud@chromium.org>
Wed, 21 Sep 2022 19:47:59 +0000 (21 19:47 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 23 Sep 2022 22:52:50 +0000 (23 22:52 +0000)
treeaa5c2d76254b83eb622713413b6933445c288ece
parent4475e82fc687f13a9a01ad354b178ebe30ef2df5
Bug 1790769 [wpt PR 35890] - Add CSSTokenizer-created strings to CSSVariableData's backing strings, a=testonly

Automatic update from web-platform-tests
Add CSSTokenizer-created strings to CSSVariableData's backing strings

When computing the value of a registered custom property, we create
a CSSVariableData object equivalent to the computed CSSValue by
serializing that CSSValue to a String, then tokenizing that value.

The problem is that CSSTokenizer can create *new* string objects
during the tokenization process (see calls to CSSTokenizer::
RegisterString), without communicating that fact to the call-site.

Therefore, this CL adds a way to access those strings so they can
be added to the backing strings of the CSSVariableData.

Also added a DCHECK to verify that we don't have any tokens with
non-backed string pointers.

Fixed: 1358907
Change-Id: Ib4585cbb419b616713bb3709c7b81ca1708880ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3892782
Reviewed-by: Steinar H Gunderson <sesse@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046868}

--

wpt-commits: 3f544cd972b2a18f26f29d4f33281c52f92d87a3
wpt-pr: 35890
testing/web-platform/tests/css/css-properties-values-api/registered-property-computation.html