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

Issue 23075004: Fixes a crash when copying elements with font-weight lighter or bolder (Closed)

Created:
7 years, 4 months ago by abinader
Modified:
7 years, 4 months ago
CC:
blink-reviews, dglazkov+blink, eae+blinkwatch, Savago-old, ojan, yosin_UTC9
Visibility:
Public.

Description

Fixes a crash when copying elements with font-weight lighter or bolder While investigating some editing crashes, I noticed an assertion triggering in EditingStyle due to no treatment over font-weight's 'lighter' and 'bolder' values. This patch fixes this and adds a test to verify it does not crash when copying/pasting elements using these values. BUG=272363 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=156188

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -14 lines) Patch
A LayoutTests/editing/pasteboard/insert-font-weight.html View 1 1 chunk +19 lines, -0 lines 0 comments Download
A LayoutTests/editing/pasteboard/insert-font-weight-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
M Source/core/editing/EditingStyle.cpp View 1 3 chunks +11 lines, -14 lines 1 comment Download

Messages

Total messages: 11 (0 generated)
abinader
7 years, 4 months ago (2013-08-13 18:37:59 UTC) #1
esprehn
https://codereview.chromium.org/23075004/diff/1/Source/core/editing/EditingStyle.cpp File Source/core/editing/EditingStyle.cpp (left): https://codereview.chromium.org/23075004/diff/1/Source/core/editing/EditingStyle.cpp#oldcode1520 Source/core/editing/EditingStyle.cpp:1520: ASSERT_NOT_REACHED(); // For CSSValueBolder and CSSValueLighter Why was this ...
7 years, 4 months ago (2013-08-13 20:07:43 UTC) #2
eseidel
I suspect the editing code never deals in terms of lighter/bolder but only specific values, ...
7 years, 4 months ago (2013-08-13 20:11:49 UTC) #3
leviw_travelin_and_unemployed
This LGTM.
7 years, 4 months ago (2013-08-13 20:26:28 UTC) #4
rniwa-cr
https://codereview.chromium.org/23075004/diff/1/Source/core/editing/EditingStyle.cpp File Source/core/editing/EditingStyle.cpp (right): https://codereview.chromium.org/23075004/diff/1/Source/core/editing/EditingStyle.cpp#newcode1512 Source/core/editing/EditingStyle.cpp:1512: case CSSValueBolder: This is incorrect. e.g. in <span style="font-weight: ...
7 years, 4 months ago (2013-08-13 20:52:53 UTC) #5
abinader
On 2013/08/13 20:26:28, Levi wrote: > This LGTM. As discussed with Ryosuke on IRC, we ...
7 years, 4 months ago (2013-08-13 20:57:57 UTC) #6
abinader
Updated patch - avoid removing property if value needs resolving. Adding resolving code to static ...
7 years, 4 months ago (2013-08-14 19:16:57 UTC) #7
leviw_travelin_and_unemployed
lgtm
7 years, 4 months ago (2013-08-16 01:49:24 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bruno.d@partner.samsung.com/23075004/20001
7 years, 4 months ago (2013-08-16 01:58:10 UTC) #9
commit-bot: I haz the power
Change committed as 156188
7 years, 4 months ago (2013-08-16 03:29:41 UTC) #10
rniwa-cr
7 years, 4 months ago (2013-08-16 05:56:52 UTC) #11
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/23075004/diff/20001/Source/core/editin...
File Source/core/editing/EditingStyle.cpp (right):

https://chromiumcodereview.appspot.com/23075004/diff/20001/Source/core/editin...
Source/core/editing/EditingStyle.cpp:1545: if
(!fontWeightNeedsResolving(fontWeight.get()) &&
(fontWeightIsBold(fontWeight.get()) == fontWeightIsBold(baseFontWeight.get())))
This is still incorrect. This function MUST remove the property if they're
equal. Not removing it results in incorrect behavior elsewhere.

Powered by Google App Engine
This is Rietveld 408576698