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

Issue 26315006: Avoid creating first-letter RenderTextFragments for unsuitable text nodes (Closed)

Created:
7 years, 2 months ago by leviw_travelin_and_unemployed
Modified:
7 years, 2 months ago
Reviewers:
esprehn, eseidel
CC:
blink-reviews, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering
Visibility:
Public.

Description

Avoid creating first-letter RenderTextFragments for unsuitable text nodes First-letter code would formerly find the first RenderText in a RenderBlock and pass it off to be split into RenderTextFragments. If no suitable letter was found in that RenderText, we'd use its entire contents (be it whitespace or punctuation) in the RenderTextFragment. When the RenderText is whitespace only and was combined with column handling code that splits blocks, this could lead to creating first-letter renderers out of pre-existing first- letter renderers, which could cause crashes. Adding some assertions and changing the search algorithm for the first text node to also check for a valid first-letter character. This avoids the crashes and leads to results that are closer to my interpretation of what the spec suggests (i.e. we won't apply first-letter to only punctuation). BUG=264574 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=159205

Patch Set 1 #

Total comments: 2

Patch Set 2 : Update to ToT. #

Patch Set 3 : Fixing test expectations (test was updated last night) #

Patch Set 4 : Merged to ToT again. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -18 lines) Patch
LayoutTests/editing/selection/extend-by-word-002.html View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
LayoutTests/editing/selection/extend-by-word-002-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
LayoutTests/fast/css-generated-content/empty-first-letter-with-columns-crash.html View 1 chunk +21 lines, -0 lines 0 comments Download
LayoutTests/fast/css-generated-content/empty-first-letter-with-columns-crash-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
LayoutTests/fast/css-generated-content/quote-first-letter-expected.html View 1 chunk +2 lines, -2 lines 0 comments Download
Source/core/rendering/RenderBlock.h View 1 1 chunk +1 line, -1 line 0 comments Download
Source/core/rendering/RenderBlock.cpp View 1 5 chunks +18 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
leviw_travelin_and_unemployed
7 years, 2 months ago (2013-10-07 21:30:40 UTC) #1
eseidel
https://codereview.chromium.org/26315006/diff/1/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/26315006/diff/1/Source/core/rendering/RenderBlock.cpp#newcode5745 Source/core/rendering/RenderBlock.cpp:5745: if (text.length() && length == text.length()) So when you ...
7 years, 2 months ago (2013-10-07 22:27:25 UTC) #2
leviw_travelin_and_unemployed
https://codereview.chromium.org/26315006/diff/1/Source/core/rendering/RenderBlock.cpp File Source/core/rendering/RenderBlock.cpp (right): https://codereview.chromium.org/26315006/diff/1/Source/core/rendering/RenderBlock.cpp#newcode5745 Source/core/rendering/RenderBlock.cpp:5745: if (text.length() && length == text.length()) On 2013/10/07 22:27:25, ...
7 years, 2 months ago (2013-10-07 22:33:19 UTC) #3
eseidel
lgtm
7 years, 2 months ago (2013-10-07 23:23:53 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/26315006/1
7 years, 2 months ago (2013-10-07 23:25:19 UTC) #5
commit-bot: I haz the power
Failed to apply patch for Source/core/rendering/RenderBlock.cpp: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 2 months ago (2013-10-07 23:25:22 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/26315006/11001
7 years, 2 months ago (2013-10-08 00:01:50 UTC) #7
commit-bot: I haz the power
Failed to apply patch for LayoutTests/platform/win/editing/selection/extend-by-word-002-expected.txt: While running patch -p1 --forward --force --no-backup-if-mismatch; can't find ...
7 years, 2 months ago (2013-10-08 04:08:17 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/26315006/27001
7 years, 2 months ago (2013-10-08 19:51:08 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/26315006/41001
7 years, 2 months ago (2013-10-08 23:00:51 UTC) #10
commit-bot: I haz the power
7 years, 2 months ago (2013-10-09 05:47:21 UTC) #11
Message was sent while issue was closed.
Change committed as 159205

Powered by Google App Engine
This is Rietveld 408576698