Bug 20059 - Font name gets removed (truncated) when contentEditable region
Summary: Font name gets removed (truncated) when contentEditable region
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://www.nick-santos.com/tests/font...
Keywords: GoogleBug, InRadar
Depends on:
Blocks:
 
Reported: 2008-07-16 11:58 PDT by Nick Santos
Modified: 2022-07-30 10:50 PDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Santos 2008-07-16 11:58:41 PDT
When you have a contentEditable element with the contents
<span style='font-family: non-existent-font, comic sans ms'>Some text</span>
and the user edits it, Webkit will truncate the font-family to "non-existent-font".

<enter> and <backspace> keys trigger the issue most often.

See the link for a demo.
Comment 1 Justin Garcia 2008-07-16 12:15:05 PDT
There's a FIXME about this in CSSComputedStyleDeclaration.cpp:

        case CSSPropertyFontFamily:
            // FIXME: This only returns the first family.
            return CSSPrimitiveValue::create(style->fontDescription().family().family().string(), CSSPrimitiveValue::CSS_STRING);
Comment 2 mitz 2008-07-16 13:22:56 PDT
<rdar://problem/6080664>
Comment 3 Ahmad Saleem 2022-07-30 09:38:13 PDT
I took the test case from URL field and found it via Wayback Archive below:

https://web.archive.org/web/20140806233320/https://nick-santos.com/tests/font_truncation.html

I am not able to reproduce the bug where the text lose the font detail as per reproduction steps in the test case in Safari 15.6 on macOS 12.5.

I think this got fixed along the way and this can be marked as "RESOLVED CONFIGURATION CHANGED". Further, I am not able to find "FIXME:..." mentioned in Webkit Github source file:

https://github.com/WebKit/WebKit/blob/e8c097a648c8dbf127e1508535667689a3a2011c/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Comment 4 Sam Sneddon [:gsnedders] 2022-07-30 10:50:28 PDT
And `git log -S'FIXME: This only returns the first family.' -- '**/CSSComputedStyleDeclaration.cpp'` finds us 6084a5fe617e (35715@main) which indeed looks like it would've fixed this. No Bugzilla bug for that change, though!