Title: [112116] trunk/Source/WebKit2
- Revision
- 112116
- Author
- [email protected]
- Date
- 2012-03-26 10:04:39 -0700 (Mon, 26 Mar 2012)
Log Message
[Qt][WK2] default families are not set in QWebPreferences
https://bugs.webkit.org/show_bug.cgi?id=81933
This would result in an attempt to create FontPlatformData
with the -webkit- prefixed family name.
Logic adapted from QWebSettings.
Patch by Pierre Rossi <[email protected]> on 2012-03-26
Reviewed by Kenneth Rohde Christiansen.
* UIProcess/API/qt/qwebpreferences.cpp:
(QWebPreferencesPrivate::createPreferences):
(QWebPreferencesPrivate::initFontDefaults):
* UIProcess/API/qt/qwebpreferences_p_p.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (112115 => 112116)
--- trunk/Source/WebKit2/ChangeLog 2012-03-26 16:55:26 UTC (rev 112115)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-26 17:04:39 UTC (rev 112116)
@@ -1,3 +1,19 @@
+2012-03-26 Pierre Rossi <[email protected]>
+
+ [Qt][WK2] default families are not set in QWebPreferences
+ https://bugs.webkit.org/show_bug.cgi?id=81933
+
+ This would result in an attempt to create FontPlatformData
+ with the -webkit- prefixed family name.
+ Logic adapted from QWebSettings.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/API/qt/qwebpreferences.cpp:
+ (QWebPreferencesPrivate::createPreferences):
+ (QWebPreferencesPrivate::initFontDefaults):
+ * UIProcess/API/qt/qwebpreferences_p_p.h:
+
2012-03-26 Dinu Jacob <[email protected]>
[Qt WK2] Disable/enable mouse events when displaying dialogs only for desktop view
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp (112115 => 112116)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp 2012-03-26 16:55:26 UTC (rev 112115)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp 2012-03-26 17:04:39 UTC (rev 112116)
@@ -32,6 +32,7 @@
{
QWebPreferences* prefs = new QWebPreferences;
prefs->d->webViewPrivate = webViewPrivate;
+ prefs->d->initializeDefaultFontSettings();
return prefs;
}
@@ -97,6 +98,30 @@
}
}
+void QWebPreferencesPrivate::initializeDefaultFontSettings()
+{
+ setFontSize(MinimumFontSize, 0);
+ setFontSize(DefaultFontSize, 16);
+ setFontSize(DefaultFixedFontSize, 13);
+
+ QFont defaultFont;
+ defaultFont.setStyleHint(QFont::Serif);
+ setFontFamily(StandardFont, defaultFont.defaultFamily());
+ setFontFamily(SerifFont, defaultFont.defaultFamily());
+
+ defaultFont.setStyleHint(QFont::Fantasy);
+ setFontFamily(FantasyFont, defaultFont.defaultFamily());
+
+ defaultFont.setStyleHint(QFont::Cursive);
+ setFontFamily(CursiveFont, defaultFont.defaultFamily());
+
+ defaultFont.setStyleHint(QFont::SansSerif);
+ setFontFamily(SansSerifFont, defaultFont.defaultFamily());
+
+ defaultFont.setStyleHint(QFont::Monospace);
+ setFontFamily(FixedFont, defaultFont.defaultFamily());
+}
+
void QWebPreferencesPrivate::setFontFamily(QWebPreferencesPrivate::FontFamily which, const QString& family)
{
switch (which) {
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p_p.h (112115 => 112116)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p_p.h 2012-03-26 16:55:26 UTC (rev 112115)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences_p_p.h 2012-03-26 17:04:39 UTC (rev 112116)
@@ -59,6 +59,7 @@
void setAttribute(WebAttribute attr, bool enable);
bool testAttribute(WebAttribute attr) const;
+ void initFontDefaults();
void setFontFamily(FontFamily which, const QString& family);
QString fontFamily(FontFamily which) const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes