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

Issue 571603003: Convert first letter into a pseudo element. (Closed)

Created:
6 years, 3 months ago by dsinclair
Modified:
6 years, 2 months ago
CC:
aandrey+blink_chromium.org, darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-rendering, caseq+blink_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, eae+blinkwatch, ed+blinkwatch_opera.com, eustas+blink_chromium.org, jchaffraix+rendering, leviw+renderwatch, loislo+blink_chromium.org, lushnikov+blink_chromium.org, malch+blink_chromium.org, paulirish+reviews_chromium.org, pdr., pfeldman+blink_chromium.org, rwlbuis, rune+blink, sergeyv+blink_chromium.org, sof, vsevik+blink_chromium.org, yosin_UTC9, yurys+blink_chromium.org, zoltan1
Project:
blink
Visibility:
Public.

Description

Convert first letter into a pseudo element. Currently, first letter renderers are created and destroyed through the updateFirstLetters() call in RenderBlock. This has, historically, been problematic as we may miss places where the call was required, leading to accessing invalid memory. This CL converts the first letter code to use a PseudoElement for the first-letter instead of creating classes during layout. With the PseudoElement implementation the two tests which are currently in LayoutTests/fast/css/first-letter-removed-added.html work as expected. BUG=391288 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=183913

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Rendering of first-letter with styles working .... #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : Rebase to master #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Patch Set 12 : Shuffle code around #

Patch Set 13 : #

Patch Set 14 : #

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Total comments: 49

Patch Set 18 : Rebase to master #

Patch Set 19 : #

Total comments: 21

Patch Set 20 : Rebase to Master #

Patch Set 21 : #

Patch Set 22 : Remove accidental expectations #

Patch Set 23 : #

Patch Set 24 : Rebase to master #

Patch Set 25 : #

Patch Set 26 : #

Patch Set 27 : Rebase to master #

Patch Set 28 : #

Patch Set 29 : #

Total comments: 56

Patch Set 30 : #

Patch Set 31 : #

Patch Set 32 : Rebase to master #

Patch Set 33 : Fix bad merge #

Patch Set 34 : Rebase to master #

Total comments: 42

Patch Set 35 : #

Patch Set 36 : Rebase to master #

Patch Set 37 : #

Total comments: 43

Patch Set 38 : Adding test expectations #

Patch Set 39 : Review updates #

Patch Set 40 : Rebase to master #

Patch Set 41 : #

Patch Set 42 : Rebase to master #

Patch Set 43 : #

Patch Set 44 : #

Patch Set 45 : #

Patch Set 46 : #

Patch Set 47 : Rebase to master #

Patch Set 48 : #

Total comments: 4

Patch Set 49 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+715 lines, -481 lines) Patch
M LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 1 chunk +54 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/dynamic-class-pseudo-elements.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/css/dynamic-class-pseudo-elements-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/fast/css/first-letter.html View 1 1 chunk +11 lines, -0 lines 0 comments Download
M LayoutTests/fast/css/first-letter-removed-added.html View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/css/first-letter-removed-added-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/core.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +16 lines, -3 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 7 chunks +45 lines, -1 line 0 comments Download
M Source/core/dom/ElementRareData.h View 1 2 3 5 chunks +11 lines, -1 line 0 comments Download
M Source/core/dom/ElementRareData.cpp View 2 chunks +2 lines, -1 line 0 comments Download
A Source/core/dom/FirstLetterPseudoElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 1 chunk +69 lines, -0 lines 0 comments Download
A Source/core/dom/FirstLetterPseudoElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 1 chunk +290 lines, -0 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Position.cpp View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/PseudoElement.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 chunks +14 lines, -8 lines 0 comments Download
M Source/core/dom/PseudoElement.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 5 chunks +11 lines, -4 lines 0 comments Download
M Source/core/dom/RenderTreeBuilder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 2 chunks +4 lines, -19 lines 0 comments Download
M Source/core/dom/RenderTreeBuilder.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 5 chunks +35 lines, -5 lines 0 comments Download
M Source/core/editing/TextIterator.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 4 chunks +40 lines, -31 lines 0 comments Download
M Source/core/inspector/InspectorCSSAgent.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 chunk +16 lines, -10 lines 0 comments Download
M Source/core/rendering/HitTestResult.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +0 lines, -2 lines 0 comments Download
M Source/core/rendering/HitTestResult.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 7 chunks +1 line, -12 lines 0 comments Download
M Source/core/rendering/RenderBlock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 2 chunks +0 lines, -4 lines 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 3 chunks +0 lines, -246 lines 0 comments Download
M Source/core/rendering/RenderBoxModelObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderBoxModelObject.cpp View 3 chunks +0 lines, -28 lines 0 comments Download
M Source/core/rendering/RenderObject.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderObjectChildList.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +9 lines, -7 lines 0 comments Download
M Source/core/rendering/RenderTableCell.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderTextFragment.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 3 chunks +17 lines, -11 lines 0 comments Download
M Source/core/rendering/RenderTextFragment.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 5 chunks +45 lines, -66 lines 0 comments Download
M Source/core/rendering/RenderTreeAsText.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 33 (3 generated)
dsinclair
PTAL. This is ready for review now. The only outstanding thing that I know of ...
6 years, 2 months ago (2014-09-27 03:21:22 UTC) #2
dsinclair
6 years, 2 months ago (2014-09-27 16:15:59 UTC) #4
esprehn
This seems like it's moving in the right direction, but those SubtreeStyleChanges are bad, we ...
6 years, 2 months ago (2014-09-30 09:00:31 UTC) #5
dsinclair
https://codereview.chromium.org/571603003/diff/320001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/320001/Source/core/dom/Element.cpp#newcode1757 Source/core/dom/Element.cpp:1757: clearFirstLetterPseudoElement(); On 2014/09/30 09:00:30, esprehn wrote: > Destroying it ...
6 years, 2 months ago (2014-09-30 21:46:34 UTC) #6
Julien - ping for review
https://codereview.chromium.org/571603003/diff/360001/Source/core/dom/FirstLetterHelper.cpp File Source/core/dom/FirstLetterHelper.cpp (right): https://codereview.chromium.org/571603003/diff/360001/Source/core/dom/FirstLetterHelper.cpp#newcode83 Source/core/dom/FirstLetterHelper.cpp:83: // Keep looking allowed punctuation for the :first-letter. Keep ...
6 years, 2 months ago (2014-10-01 21:14:48 UTC) #7
dsinclair
I'm getting a crash with the current code that I don't understand. Any idea what ...
6 years, 2 months ago (2014-10-04 02:01:35 UTC) #8
dsinclair
Figured it out, I was just sync'd to a bad point in the tree. Issue ...
6 years, 2 months ago (2014-10-04 03:39:02 UTC) #9
dsinclair
PTAL. esprehn@, jchaffraix@ I believe I've got everything worked out after the review changes.
6 years, 2 months ago (2014-10-04 16:00:44 UTC) #10
Julien - ping for review
https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp#newcode2512 Source/core/dom/Element.cpp:2512: if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoElement(element)->remainingTextRenderer() Wouldn't |element| be ...
6 years, 2 months ago (2014-10-06 17:47:34 UTC) #11
Julien - ping for review
https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp#newcode2512 Source/core/dom/Element.cpp:2512: if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoElement(element)->remainingTextRenderer() On 2014/10/06 at ...
6 years, 2 months ago (2014-10-06 20:11:46 UTC) #12
esprehn
You're causing full document forced style recalcs, that's not right. https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/Element.cpp#newcode2519 ...
6 years, 2 months ago (2014-10-07 00:17:40 UTC) #13
dsinclair
PTAL. esprehn@, how do I trigger a walk to recalc style of nodes without triggering ...
6 years, 2 months ago (2014-10-07 19:36:21 UTC) #14
esprehn
You want to do setNeedsStyleRecalc(LocalStyleChange) on the specific nodes you need a recalc for. To ...
6 years, 2 months ago (2014-10-07 21:06:19 UTC) #15
dsinclair
On 2014/10/07 21:06:19, esprehn wrote: > You want to do setNeedsStyleRecalc(LocalStyleChange) on the specific nodes ...
6 years, 2 months ago (2014-10-07 21:12:53 UTC) #16
dsinclair
On 2014/10/07 21:12:53, dsinclair wrote: > On 2014/10/07 21:06:19, esprehn wrote: > > You want ...
6 years, 2 months ago (2014-10-08 19:44:57 UTC) #17
Julien - ping for review
https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/FirstLetterPseudoElement.cpp File Source/core/dom/FirstLetterPseudoElement.cpp (right): https://codereview.chromium.org/571603003/diff/560001/Source/core/dom/FirstLetterPseudoElement.cpp#newcode104 Source/core/dom/FirstLetterPseudoElement.cpp:104: parentRenderer = element.parentOrShadowHostElement()->renderer(); On 2014/10/07 19:36:20, dsinclair wrote: > ...
6 years, 2 months ago (2014-10-09 18:24:49 UTC) #18
dsinclair
https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp File Source/core/dom/FirstLetterPseudoElement.cpp (right): https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp#newcode3 Source/core/dom/FirstLetterPseudoElement.cpp:3: // found in the LICENSE file. On 2014/10/09 18:24:47, ...
6 years, 2 months ago (2014-10-09 21:14:23 UTC) #19
Julien - ping for review
https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp File Source/core/dom/FirstLetterPseudoElement.cpp (right): https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp#newcode132 Source/core/dom/FirstLetterPseudoElement.cpp:132: // FIXME: This black-list of disallowed RenderText subclasses is ...
6 years, 2 months ago (2014-10-10 14:47:07 UTC) #20
dsinclair
https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp File Source/core/dom/FirstLetterPseudoElement.cpp (right): https://codereview.chromium.org/571603003/diff/660001/Source/core/dom/FirstLetterPseudoElement.cpp#newcode132 Source/core/dom/FirstLetterPseudoElement.cpp:132: // FIXME: This black-list of disallowed RenderText subclasses is ...
6 years, 2 months ago (2014-10-10 18:06:53 UTC) #21
Julien - ping for review
I think the next iteration is going to be it. My big issue with this ...
6 years, 2 months ago (2014-10-10 22:47:23 UTC) #22
esprehn
https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/Element.cpp#newcode2510 Source/core/dom/Element.cpp:2510: if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoElement(element)->remainingTextRenderer() This feels like ...
6 years, 2 months ago (2014-10-11 04:46:20 UTC) #23
esprehn
https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/RenderTreeBuilder.cpp File Source/core/dom/RenderTreeBuilder.cpp (right): https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/RenderTreeBuilder.cpp#newcode59 Source/core/dom/RenderTreeBuilder.cpp:59: if (m_renderingParent->node() && m_renderingParent->node()->needsAttach()) On 2014/10/11 at 04:46:20, esprehn ...
6 years, 2 months ago (2014-10-11 04:49:35 UTC) #24
esprehn
lgtm, please fix my comments before landing. This is a huge improvement, lets land it ...
6 years, 2 months ago (2014-10-11 04:51:31 UTC) #25
dsinclair
https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/Element.cpp File Source/core/dom/Element.cpp (right): https://codereview.chromium.org/571603003/diff/1060001/Source/core/dom/Element.cpp#newcode2510 Source/core/dom/Element.cpp:2510: if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoElement(element)->remainingTextRenderer() On 2014/10/11 04:46:19, ...
6 years, 2 months ago (2014-10-14 14:31:28 UTC) #26
esprehn
On 2014/10/14 at 14:31:28, dsinclair wrote: > ... > > This was more to be ...
6 years, 2 months ago (2014-10-14 14:38:55 UTC) #27
Julien - ping for review
lgtm https://codereview.chromium.org/571603003/diff/1550001/Source/core/dom/FirstLetterPseudoElement.h File Source/core/dom/FirstLetterPseudoElement.h (right): https://codereview.chromium.org/571603003/diff/1550001/Source/core/dom/FirstLetterPseudoElement.h#newcode48 Source/core/dom/FirstLetterPseudoElement.h:48: bool needsUpdate() const {return m_needsUpdate; } Style: space ...
6 years, 2 months ago (2014-10-17 16:49:59 UTC) #28
dsinclair
https://codereview.chromium.org/571603003/diff/1550001/Source/core/dom/FirstLetterPseudoElement.h File Source/core/dom/FirstLetterPseudoElement.h (right): https://codereview.chromium.org/571603003/diff/1550001/Source/core/dom/FirstLetterPseudoElement.h#newcode48 Source/core/dom/FirstLetterPseudoElement.h:48: bool needsUpdate() const {return m_needsUpdate; } On 2014/10/17 16:49:59, ...
6 years, 2 months ago (2014-10-17 17:21:39 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/571603003/1570001
6 years, 2 months ago (2014-10-17 17:23:06 UTC) #31
commit-bot: I haz the power
Committed patchset #49 (id:1570001) as 183913
6 years, 2 months ago (2014-10-17 18:34:53 UTC) #32
dsinclair
6 years, 2 months ago (2014-10-21 16:49:47 UTC) #33
Message was sent while issue was closed.
A revert of this CL (patchset #49 id:1570001) has been created in
https://codereview.chromium.org/639863006/ by dsinclair@chromium.org.

The reason for reverting is: Causing clusterfuzz regressions..

Powered by Google App Engine
This is Rietveld 408576698