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

Issue 1133853006: Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is …

Created:
5 years, 7 months ago by changseok
Modified:
4 years, 10 months ago
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Elements whose contents start with an astral Unicode symbol disappear when CSS `::first-letter` is applied to them. This CL is inspired by http://trac.webkit.org/changeset/172513 written by Myles C. Maxfield. The previous code assumed that all "characters" are exactly 1 16-bit code unit wide. Instead, use numCharactersInGraphemeClusters(). For blink, we add countCharactersAndGraphemesInCluster to bring a similar functionality to blink. This api is based on countGraphemesInCluster and improved to figure out the number of characters and grapheme at the same time in the given clusters. BUG=401945 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200227

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add a test missed from last CL. #

Patch Set 3 : Working in process patch #

Total comments: 1

Patch Set 4 : Rebased #

Patch Set 5 : Updated cl #

Patch Set 6 : Reuse the existing interface of countGraphemesInCluster #

Patch Set 7 : Rebase and resolve conflicts #

Patch Set 8 : Change unsinged variable to int to make win compiler happy. #

Patch Set 9 : Fixed layout test failures. #

Patch Set 10 : Fixed UAF failures for ASan #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -23 lines) Patch
A LayoutTests/css1/pseudo/firstletter-surrogate.html View 1 1 chunk +8 lines, -0 lines 0 comments Download
A LayoutTests/css1/pseudo/firstletter-surrogate-expected.html View 1 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/dom/FirstLetterPseudoElement.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -1 line 0 comments Download
M Source/platform/fonts/shaping/HarfBuzzShaper.cpp View 1 2 3 4 5 6 7 8 2 chunks +1 line, -22 lines 0 comments Download
M Source/platform/text/TextBreakIterator.h View 1 2 3 4 5 6 2 chunks +11 lines, -0 lines 0 comments Download
M Source/platform/text/TextBreakIterator.cpp View 1 2 3 4 5 6 7 8 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (11 generated)
changseok
Please review this.
5 years, 7 months ago (2015-05-14 17:13:06 UTC) #2
eae
https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp File Source/platform/text/TextBreakIterator.cpp (right): https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp#newcode53 Source/platform/text/TextBreakIterator.cpp:53: unsigned numCharactersInGraphemeClusters(const String& string, unsigned numGraphemeClusters) We already have ...
5 years, 7 months ago (2015-05-14 23:52:48 UTC) #3
changseok
https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp File Source/platform/text/TextBreakIterator.cpp (right): https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp#newcode53 Source/platform/text/TextBreakIterator.cpp:53: unsigned numCharactersInGraphemeClusters(const String& string, unsigned numGraphemeClusters) On 2015/05/14 23:52:48, ...
5 years, 7 months ago (2015-05-15 17:08:56 UTC) #4
changseok
On 2015/05/14 23:52:48, eae wrote: > https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp > File Source/platform/text/TextBreakIterator.cpp (right): > > https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp#newcode53 > ...
5 years, 7 months ago (2015-05-18 14:52:55 UTC) #5
changseok
On 2015/05/18 14:52:55, changseok wrote: > On 2015/05/14 23:52:48, eae wrote: > > > https://codereview.chromium.org/1133853006/diff/1/Source/platform/text/TextBreakIterator.cpp ...
5 years, 7 months ago (2015-05-25 06:28:20 UTC) #6
eae
True, they both handle graphnemes in clusters though and I'd like to see the logic ...
5 years, 7 months ago (2015-05-26 22:40:06 UTC) #7
changseok
On 2015/05/26 22:40:06, eae wrote: > True, they both handle graphnemes in clusters though and ...
5 years, 6 months ago (2015-06-01 17:47:47 UTC) #8
changseok
On 2015/06/01 17:47:47, changseok wrote: > On 2015/05/26 22:40:06, eae wrote: > > True, they ...
5 years, 6 months ago (2015-06-08 08:27:12 UTC) #9
changseok
The CL is updated. Comment please?
5 years, 6 months ago (2015-06-16 09:24:24 UTC) #10
eae
This creates two extra copies of the string, is that really necessary? Sorry for being ...
5 years, 6 months ago (2015-06-16 16:30:18 UTC) #11
changseok
On 2015/06/16 16:30:18, eae wrote: > This creates two extra copies of the string, is ...
5 years, 6 months ago (2015-06-17 02:18:11 UTC) #12
changseok
On 2015/06/17 02:18:11, changseok wrote: > On 2015/06/16 16:30:18, eae wrote: > > This creates ...
5 years, 6 months ago (2015-06-23 06:50:42 UTC) #13
changseok
Hello? I'd like to make this happen. Would you comment on the latest patch? ''a
5 years, 4 months ago (2015-08-03 05:26:02 UTC) #14
leviw_travelin_and_unemployed
eae has been out on vacation. Adding drott.
5 years, 4 months ago (2015-08-03 20:05:20 UTC) #16
eae
LGTM
5 years, 4 months ago (2015-08-03 20:42:25 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1133853006/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1133853006/120001
5 years, 4 months ago (2015-08-04 05:33:56 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/72464)
5 years, 4 months ago (2015-08-04 05:48:12 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1133853006/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1133853006/140001
5 years, 4 months ago (2015-08-04 05:58:22 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: win_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/win_blink_rel/builds/72470)
5 years, 4 months ago (2015-08-04 06:59:18 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1133853006/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1133853006/160001
5 years, 4 months ago (2015-08-09 05:18:51 UTC) #30
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://src.chromium.org/viewvc/blink?view=rev&revision=200227
5 years, 4 months ago (2015-08-09 06:39:07 UTC) #31
sof
A revert of this CL (patchset #9 id:160001) has been created in https://codereview.chromium.org/1277803004/ by sigbjornf@opera.com. ...
5 years, 4 months ago (2015-08-09 12:54:45 UTC) #32
changseok
On 2015/08/09 12:54:45, sof wrote: > A revert of this CL (patchset #9 id:160001) has ...
5 years, 4 months ago (2015-08-10 04:12:22 UTC) #33
drott
On 2015/08/10 04:12:22, changseok wrote: > On 2015/08/09 12:54:45, sof wrote: > > A revert ...
5 years, 3 months ago (2015-09-02 07:50:37 UTC) #34
changseok
5 years, 3 months ago (2015-09-02 07:59:11 UTC) #35
On 2015/09/02 07:50:37, drott wrote:
> On 2015/08/10 04:12:22, changseok wrote:
> > On 2015/08/09 12:54:45, sof wrote:
> > > A revert of this CL (patchset #9 id:160001) has been created in
> > > https://codereview.chromium.org/1277803004/ by mailto:sigbjornf@opera.com.
> > > 
> > > The reason for reverting is: ASan picking up a number of UAF failures due
to
> > > this one,
> > > 
> > > 
> > >
> >
>
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%20ASAN/bu....
> > 
> > Sorry for the inconvenience. I think the UAF failures are fixed, but I don't
> > know how I can land an updated patch again.
> > Is it enough to submit the patch here, or do I need to create a new ticket
for
> > it?
> 
> Sorry for the delay in answering to your question. If you have additional
> improvements to this CL, please create a new CL, describe how you addressed
the
> issues that lead to the revert, and call it something like "Reland of: Fix CSS
> ::first-letter for UTF-16 surrogate pairs" and please ask for review again.

Thanks for the answer. I'll do it soon.

Powered by Google App Engine
This is Rietveld 408576698