summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/loader/cache/CachedResourceLoader.cpp2
-rw-r--r--Source/WebCore/page/Settings.cpp10
-rw-r--r--Source/WebCore/page/Settings.h8
-rw-r--r--Source/WebCore/platform/graphics/android/FontDataAndroid.cpp8
4 files changed, 26 insertions, 2 deletions
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
index 91c0629..fe25a93 100644
--- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp
+++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp
@@ -293,6 +293,8 @@ bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url
}
#if ENABLE(LINK_PREFETCH)
case CachedResource::LinkResource:
+ if (!m_document->settings()->linkPrefetchEnabled())
+ return false;
break;
#endif
}
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index c26a0fc..f668f3e 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -149,6 +149,9 @@ Settings::Settings(Page* page)
// they can't use by. Leaving enabled for now to not change existing behavior.
, m_downloadableBinaryFontsEnabled(true)
, m_xssAuditorEnabled(false)
+#if ENABLE(LINK_PREFETCH)
+ , m_linkPrefetchEnabled(true)
+#endif
, m_acceleratedCompositingEnabled(true)
, m_acceleratedCompositingFor3DTransformsEnabled(true)
, m_acceleratedCompositingForVideoEnabled(true)
@@ -823,6 +826,13 @@ void Settings::setXSSAuditorEnabled(bool xssAuditorEnabled)
m_xssAuditorEnabled = xssAuditorEnabled;
}
+#if ENABLE(LINK_PREFETCH)
+void Settings::setLinkPrefetchEnabled(bool linkPrefetchEnabled)
+{
+ m_linkPrefetchEnabled = linkPrefetchEnabled;
+}
+#endif
+
void Settings::setAcceleratedCompositingEnabled(bool enabled)
{
if (m_acceleratedCompositingEnabled == enabled)
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index 2bb222d..2cf7715 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -352,6 +352,11 @@ namespace WebCore {
void setXSSAuditorEnabled(bool);
bool xssAuditorEnabled() const { return m_xssAuditorEnabled; }
+#if ENABLE(LINK_PREFETCH)
+ void setLinkPrefetchEnabled(bool);
+ bool linkPrefetchEnabled() const { return m_linkPrefetchEnabled; }
+#endif
+
void setCanvasUsesAcceleratedDrawing(bool);
bool canvasUsesAcceleratedDrawing() const { return m_canvasUsesAcceleratedDrawing; }
@@ -567,6 +572,9 @@ namespace WebCore {
bool m_acceleratedDrawingEnabled : 1;
bool m_downloadableBinaryFontsEnabled : 1;
bool m_xssAuditorEnabled : 1;
+#if ENABLE(LINK_PREFETCH)
+ bool m_linkPrefetchEnabled : 1;
+#endif
bool m_acceleratedCompositingEnabled : 1;
bool m_acceleratedCompositingFor3DTransformsEnabled : 1;
bool m_acceleratedCompositingForVideoEnabled : 1;
diff --git a/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp b/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp
index c6dd174..88822df 100644
--- a/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/FontDataAndroid.cpp
@@ -56,8 +56,12 @@ void SimpleFontData::platformInit()
m_fontMetrics.setAscent(a);
m_fontMetrics.setDescent(d);
m_fontMetrics.setXHeight(SkScalarToFloat(-skiaFontMetrics.fAscent) * 0.56f); // hack I stole from the window's port
- m_fontMetrics.setLineSpacing(a + d);
- m_fontMetrics.setLineGap(SkScalarToFloat(skiaFontMetrics.fLeading));
+ float lineGap = SkScalarToFloat(skiaFontMetrics.fLeading);
+ if (platformData().orientation() == Vertical && lineGap == 0) {
+ lineGap = skiaFontMetrics.fAvgCharWidth * 0.56f;
+ }
+ m_fontMetrics.setLineGap(lineGap);
+ m_fontMetrics.setLineSpacing(a + d + lineGap);
if (platformData().orientation() == Vertical && !isTextOrientationFallback()) {
static const uint32_t vheaTag = SkSetFourByteTag('v', 'h', 'e', 'a');