Bug 20059
Summary: | Font name gets removed (truncated) when contentEditable region | ||
---|---|---|---|
Product: | WebKit | Reporter: | Nick Santos <nicksantos> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, jparent, justin.garcia, mitz, rniwa |
Priority: | P2 | Keywords: | GoogleBug, InRadar |
Version: | 525.x (Safari 3.1) | ||
Hardware: | PC | ||
OS: | OS X 10.5 | ||
URL: | http://www.nick-santos.com/tests/font_truncation.html |
Nick Santos
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.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Justin Garcia
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);
mitz
<rdar://problem/6080664>
Ahmad Saleem
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
Sam Sneddon [:gsnedders]
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!