Commit 643f50c9 authored by dino@apple.com's avatar dino@apple.com

Don't trust character widths for internal OS X fonts in form controls

https://bugs.webkit.org/show_bug.cgi?id=115883
<rdar://problem/13817757>

Reviewed by Darin Adler.

We ignore the character width for a bunch of fonts when predicting
the width of a form control. Some of the internal fonts in OS X are
not in the ignored list. Rather than add them, simply test for
fonts whose family begins with a period character ".".

* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::hasValidAvgCharWidth): Return false for
    any family that starts with "."

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8e515664
2013-05-09 Dean Jackson <dino@apple.com>
Don't trust character widths for internal OS X fonts in form controls
https://bugs.webkit.org/show_bug.cgi?id=115883
<rdar://problem/13817757>
Reviewed by Darin Adler.
We ignore the character width for a bunch of fonts when predicting
the width of a form control. Some of the internal fonts in OS X are
not in the ignored list. Rather than add them, simply test for
fonts whose family begins with a period character ".".
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::hasValidAvgCharWidth): Return false for
any family that starts with "."
2013-05-10 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove unnecessary GLIB_CHECK_VERSION #ifdefs
......
......@@ -218,11 +218,17 @@ static const char* fontFamiliesWithInvalidCharWidth[] = {
// all platforms.
bool RenderTextControl::hasValidAvgCharWidth(AtomicString family)
{
static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = 0;
if (family.isEmpty())
return false;
// Internal fonts on OS X also have an invalid entry in the table for avgCharWidth.
// They are hidden by having a name that begins with a period, so simply search
// for that here rather than try to keep the list up to date.
if (family.startsWith('.'))
return false;
static HashSet<AtomicString>* fontFamiliesWithInvalidCharWidthMap = 0;
if (!fontFamiliesWithInvalidCharWidthMap) {
fontFamiliesWithInvalidCharWidthMap = new HashSet<AtomicString>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment