[Approved] RFR: 8230492: font-family not set in HTMLEditor if font name has a number in it
kcr at openjdk.org
Tue Nov 5 10:56:18 UTC 2019
On Wed, 30 Oct 2019 10:07:42 GMT, Arun Joseph <github.com+24428922+arun-Joseph at openjdk.org> wrote:
> In the HTMLEditor, when positioning the caret in a text and trying to set a font-family that has a number in it is not working.
> Issue: In [CSSPropertyParser.cpp](https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WebCore/css/parser/CSSPropertyParser.cpp), concatenateFamilyName() function parses only identifiers. So, when a number is introduced in a font-name, it fails.
> Fix: Pass the font-name as a string in HTMLEditorSkin.java by adding quotes.
> A new font is added as a resource for the test. This font is same as modules/javafx.web/src/main/native/Tools/DumpRenderTree/fonts/WebKit Layout Tests 2.ttf
> - 5a1fbade: 8230492: font-family not set in HTMLEditor if font name has a number in it
> Changes: https://git.openjdk.java.net/jfx/pull/27/files
> Webrev: https://webrevs.openjdk.java.net/jfx/27/webrev.00
> Issue: https://bugs.openjdk.java.net/browse/JDK-8230492
> Stats: 62 lines in 3 files changed: 60 ins; 0 del; 2 mod
> Patch: https://git.openjdk.java.net/jfx/pull/27.diff
> Fetch: git fetch https://git.openjdk.java.net/jfx pull/27/head:pull/27
The fix and new test look good to me. I can confirm that the new test fails without the fix and passes with the fix.
I left one minor formatting comment that you can correct before you integrate.
Unless @Maxoudela has any concerns, I think this can go in with a single reviewer (or he may wish to be the second reviewer).
Approved by kcr (Lead).
More information about the openjfx-dev