Title: [117259] trunk
Revision
117259
Author
[email protected]
Date
2012-05-16 04:29:14 -0700 (Wed, 16 May 2012)

Log Message

[Qt] Enable SVG Fonts by default
https://bugs.webkit.org/show_bug.cgi?id=86463

Reviewed by Nikolas Zimmermann.

Source/WebCore:

Another feature we can get for free after switching to using
the font fast path with QRawFont.
It will get disabled in features.prf if either SVG support is
disabled or if we are not using QRawFont (e.g. for Qt 4).

Covered by a series of tests that were skipped for the
Qt port up until now.

* platform/graphics/qt/FontPlatformData.h:
(WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
Initialize the platform data used as fallback in conjunction with SVG
fonts so it will honor size, weight and oblique-ness.
* rendering/svg/SVGTextMetricsBuilder.cpp: Avoid forcing the complex path.
(WebCore::SVGTextMetricsBuilder::advance):
(WebCore::SVGTextMetricsBuilder::advanceSimpleText):
(WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
* svg/SVGFontElement.cpp:
(WebCore::SVGFontElement::ensureGlyphCache): avoid ambiguity with String(const QString&)

Tools:

* qmake/mkspecs/features/features.pri:

LayoutTests:

* platform/qt-4.8/Skipped: Skipped the relevant tests...
* platform/qt/Skipped: ... and unskipped them here.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (117258 => 117259)


--- trunk/LayoutTests/ChangeLog	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/LayoutTests/ChangeLog	2012-05-16 11:29:14 UTC (rev 117259)
@@ -1,3 +1,13 @@
+2012-05-15  Pierre Rossi  <[email protected]>
+
+        [Qt] Enable SVG Fonts by default
+        https://bugs.webkit.org/show_bug.cgi?id=86463
+
+        Reviewed by Nikolas Zimmermann.
+
+        * platform/qt-4.8/Skipped: Skipped the relevant tests...
+        * platform/qt/Skipped: ... and unskipped them here.
+
 2012-05-16  Christophe Dumez  <[email protected]>
 
         [EFL] EFL's LayoutTestController does not implement setApplicationCacheOriginQuota

Modified: trunk/LayoutTests/platform/qt/Skipped (117258 => 117259)


--- trunk/LayoutTests/platform/qt/Skipped	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-05-16 11:29:14 UTC (rev 117259)
@@ -1233,7 +1233,6 @@
 svg/custom/path-bad-data.svg
 svg/custom/visibility-override-filter.svg
 svg/custom/stroke-width-click.svg
-svg/text/text-fonts-01-t.svg
 svg/text/text-intro-05-t.svg
 svg/text/text-tselect-02-f.svg
 svg/W3C-SVG-1.1/animate-elem-80-t.svg
@@ -1310,64 +1309,6 @@
 svg/text/text-intro-05-t.svg
 svg/text/text-tselect-02-f.svg
 
-# Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths
-# from Font, making it possible to reuse the simple text code path for SVG Fonts
-# https://bugs.webkit.org/show_bug.cgi?id=59085
-# Failing tests after http://trac.webkit.org/changeset/89233
-# They will pass again when QRawFont is enabled by default.
-svg/W3C-SVG-1.1/animate-elem-03-t.svg
-svg/W3C-SVG-1.1/animate-elem-24-t.svg
-svg/W3C-SVG-1.1/animate-elem-36-t.svg
-svg/W3C-SVG-1.1/animate-elem-40-t.svg
-svg/W3C-SVG-1.1/fonts-elem-01-t.svg
-svg/W3C-SVG-1.1/fonts-elem-02-t.svg
-svg/W3C-SVG-1.1/fonts-elem-03-b.svg
-svg/W3C-SVG-1.1/fonts-elem-04-b.svg
-svg/W3C-SVG-1.1/fonts-elem-05-t.svg
-svg/W3C-SVG-1.1/fonts-elem-06-t.svg
-svg/W3C-SVG-1.1/fonts-elem-07-b.svg
-svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
-svg/W3C-SVG-1.1/fonts-glyph-03-t.svg
-svg/W3C-SVG-1.1/fonts-kern-01-t.svg
-svg/W3C-SVG-1.1/masking-mask-01-b.svg
-svg/W3C-SVG-1.1/pservers-grad-08-b.svg
-svg/W3C-SVG-1.1/struct-cond-03-t.svg
-svg/W3C-SVG-1.1/struct-image-02-b.svg
-svg/W3C-SVG-1.1/text-align-08-b.svg
-svg/W3C-SVG-1.1/text-altglyph-01-b.svg
-svg/W3C-SVG-1.1/text-fonts-03-t.svg
-svg/W3C-SVG-1.1/text-intro-01-t.svg
-svg/W3C-SVG-1.1/text-intro-02-b.svg
-svg/W3C-SVG-1.1/text-intro-03-b.svg
-svg/W3C-SVG-1.1/text-intro-04-t.svg
-svg/W3C-SVG-1.1/text-text-04-t.svg
-svg/W3C-SVG-1.1/text-text-05-t.svg
-svg/W3C-SVG-1.1/text-text-06-t.svg
-svg/custom/acid3-test-77.html
-svg/custom/altglyph.svg
-svg/custom/font-face-simple.svg
-svg/custom/global-constructors.html
-svg/custom/glyph-selection-lang-attribute.svg
-svg/custom/glyph-setting-d-attribute.svg
-svg/custom/insertItemBefore-from-non-list-origin.svg
-svg/custom/svg-fonts-in-text-controls.html
-svg/custom/svg-fonts-with-no-element-reference.html
-svg/custom/svg-fonts-without-missing-glyph.xhtml
-svg/dom/altGlyph-dom.xhtml
-svg/dom/baseVal-animVal-crash.html
-svg/dom/font-face-elements.html
-svg/text/kerning.svg
-svg/text/multichar-glyph.svg
-svg/text/text-altglyph-01-b.svg
-svg/text/text-hkern-on-vertical-text.svg
-svg/text/text-hkern.svg
-svg/text/text-text-04-t.svg
-svg/text/text-text-05-t.svg
-svg/text/text-text-06-t.svg
-svg/text/text-vkern-on-horizontal-text.svg
-svg/text/text-vkern.svg
-http/tests/misc/SVGFont-delayed-load.html
-
 # [Qt] svg/animations/animate-path-nested-transforms.html fails
 # https://bugs.webkit.org/show_bug.cgi?id=48987
 svg/animations/animate-path-nested-transforms.html
@@ -2150,7 +2091,6 @@
 # failing new tests
 fast/text/midword-break-before-surrogate-pair.html
 svg/custom/svg-fonts-fallback.xhtml
-svg/custom/svg-fonts-word-spacing.html
 
 # new tests, they needs investigation
 

Modified: trunk/LayoutTests/platform/qt-4.8/Skipped (117258 => 117259)


--- trunk/LayoutTests/platform/qt-4.8/Skipped	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/LayoutTests/platform/qt-4.8/Skipped	2012-05-16 11:29:14 UTC (rev 117259)
@@ -81,3 +81,67 @@
 # Fullscreen API is not supported with WK1 therefore not supported with Qt 4.8
 fullscreen
 plugins/fullscreen-plugins-dont-reload.html
+
+# Fail until SUBPIXEL_LAYOUT is enabled
+# https://bugs.webkit.org/show_bug.cgi?id=85532
+fast/sub-pixel/client-width-height-snapping.html
+fast/sub-pixel/layout-boxes-with-zoom.html
+fast/sub-pixel/size-of-box-with-zoom.html
+
+# SVG Fonts are only supported when using QRawFont, which is not
+# supported with Qt 4.
+
+svg/W3C-SVG-1.1/animate-elem-03-t.svg
+svg/W3C-SVG-1.1/animate-elem-24-t.svg
+svg/W3C-SVG-1.1/animate-elem-36-t.svg
+svg/W3C-SVG-1.1/animate-elem-40-t.svg
+svg/W3C-SVG-1.1/fonts-elem-01-t.svg
+svg/W3C-SVG-1.1/fonts-elem-02-t.svg
+svg/W3C-SVG-1.1/fonts-elem-03-b.svg
+svg/W3C-SVG-1.1/fonts-elem-04-b.svg
+svg/W3C-SVG-1.1/fonts-elem-05-t.svg
+svg/W3C-SVG-1.1/fonts-elem-06-t.svg
+svg/W3C-SVG-1.1/fonts-elem-07-b.svg
+svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
+svg/W3C-SVG-1.1/fonts-glyph-03-t.svg
+svg/W3C-SVG-1.1/fonts-kern-01-t.svg
+svg/W3C-SVG-1.1/masking-mask-01-b.svg
+svg/W3C-SVG-1.1/pservers-grad-08-b.svg
+svg/W3C-SVG-1.1/struct-cond-03-t.svg
+svg/W3C-SVG-1.1/struct-image-02-b.svg
+svg/W3C-SVG-1.1/text-align-08-b.svg
+svg/W3C-SVG-1.1/text-altglyph-01-b.svg
+svg/W3C-SVG-1.1/text-fonts-03-t.svg
+svg/W3C-SVG-1.1/text-intro-01-t.svg
+svg/W3C-SVG-1.1/text-intro-02-b.svg
+svg/W3C-SVG-1.1/text-intro-03-b.svg
+svg/W3C-SVG-1.1/text-intro-04-t.svg
+svg/W3C-SVG-1.1/text-text-04-t.svg
+svg/W3C-SVG-1.1/text-text-05-t.svg
+svg/W3C-SVG-1.1/text-text-06-t.svg
+svg/custom/acid3-test-77.html
+svg/custom/altglyph.svg
+svg/custom/font-face-simple.svg
+svg/custom/global-constructors.html
+svg/custom/glyph-selection-lang-attribute.svg
+svg/custom/glyph-setting-d-attribute.svg
+svg/custom/insertItemBefore-from-non-list-origin.svg
+svg/custom/svg-fonts-in-text-controls.html
+svg/custom/svg-fonts-with-no-element-reference.html
+svg/custom/svg-fonts-without-missing-glyph.xhtml
+svg/custom/svg-fonts-word-spacing.html
+svg/dom/altGlyph-dom.xhtml
+svg/dom/baseVal-animVal-crash.html
+svg/dom/font-face-elements.html
+svg/text/kerning.svg
+svg/text/multichar-glyph.svg
+svg/text/text-altglyph-01-b.svg
+svg/text/text-fonts-01-t.svg
+svg/text/text-hkern-on-vertical-text.svg
+svg/text/text-hkern.svg
+svg/text/text-text-04-t.svg
+svg/text/text-text-05-t.svg
+svg/text/text-text-06-t.svg
+svg/text/text-vkern-on-horizontal-text.svg
+svg/text/text-vkern.svg
+http/tests/misc/SVGFont-delayed-load.html

Modified: trunk/Source/WebCore/ChangeLog (117258 => 117259)


--- trunk/Source/WebCore/ChangeLog	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Source/WebCore/ChangeLog	2012-05-16 11:29:14 UTC (rev 117259)
@@ -1,3 +1,29 @@
+2012-05-15  Pierre Rossi  <[email protected]>
+
+        [Qt] Enable SVG Fonts by default
+        https://bugs.webkit.org/show_bug.cgi?id=86463
+
+        Reviewed by Nikolas Zimmermann.
+
+        Another feature we can get for free after switching to using
+        the font fast path with QRawFont.
+        It will get disabled in features.prf if either SVG support is
+        disabled or if we are not using QRawFont (e.g. for Qt 4).
+
+        Covered by a series of tests that were skipped for the
+        Qt port up until now.
+
+        * platform/graphics/qt/FontPlatformData.h:
+        (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
+        Initialize the platform data used as fallback in conjunction with SVG
+        fonts so it will honor size, weight and oblique-ness.
+        * rendering/svg/SVGTextMetricsBuilder.cpp: Avoid forcing the complex path.
+        (WebCore::SVGTextMetricsBuilder::advance):
+        (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
+        (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
+        * svg/SVGFontElement.cpp:
+        (WebCore::SVGFontElement::ensureGlyphCache): avoid ambiguity with String(const QString&)
+
 2012-05-16  Kenichi Ishibashi  <[email protected]>
 
         [Chromium] WebTransformationMatrixTest.verifyDefaultConstructorCreatesIdentityMatrix is failing

Modified: trunk/Source/WebCore/platform/graphics/qt/FontPlatformData.h (117258 => 117259)


--- trunk/Source/WebCore/platform/graphics/qt/FontPlatformData.h	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Source/WebCore/platform/graphics/qt/FontPlatformData.h	2012-05-16 11:29:14 UTC (rev 117259)
@@ -55,7 +55,17 @@
         , bold(bold)
         , oblique(oblique)
         , isDeletedValue(false)
-    { }
+    {
+// This is necessary for SVG Fonts, which are only supported when using QRawFont.
+// It is used to construct the appropriate platform data to use as a fallback.
+#if HAVE(QRAWFONT)
+        QFont font;
+        font.setBold(bold);
+        font.setItalic(oblique);
+        rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
+        rawFont.setPixelSize(size);
+#endif
+    }
 #if !HAVE(QRAWFONT)
     FontPlatformDataPrivate(const QFont& font)
         : font(font)

Modified: trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp (117258 => 117259)


--- trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp	2012-05-16 11:29:14 UTC (rev 117259)
@@ -48,7 +48,7 @@
     if (int(m_textPosition) >= m_run.charactersLength())
         return false;
 
-#if PLATFORM(QT)
+#if PLATFORM(QT) && !HAVE(QRAWFONT)
     advanceComplexText();
 #else
     if (m_isComplexText)
@@ -62,7 +62,7 @@
 
 void SVGTextMetricsBuilder::advanceSimpleText()
 {
-#if PLATFORM(QT)
+#if PLATFORM(QT) && !HAVE(QRAWFONT)
     ASSERT_NOT_REACHED();
 #else
     unsigned metricsLength = m_simpleWidthIterator->advance(m_textPosition + 1);
@@ -115,7 +115,7 @@
     m_run = SVGTextMetrics::constructTextRun(text, text->characters(), 0, text->textLength());
     m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
 
-#if !PLATFORM(QT)
+#if !PLATFORM(QT) || HAVE(QRAWFONT)
     if (m_isComplexText)
         m_simpleWidthIterator.clear();
     else

Modified: trunk/Source/WebCore/svg/SVGFontElement.cpp (117258 => 117259)


--- trunk/Source/WebCore/svg/SVGFontElement.cpp	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Source/WebCore/svg/SVGFontElement.cpp	2012-05-16 11:29:14 UTC (rev 117259)
@@ -134,7 +134,7 @@
 
             // Register ligatures, if needed, don't mix up with surrogate pairs though!
             if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0]))
-                ligatures.append(unicode);
+                ligatures.append(unicode.string());
         } else if (child->hasTagName(SVGNames::hkernTag)) {
             SVGHKernElement* hkern = static_cast<SVGHKernElement*>(child);
             hkern->buildHorizontalKerningPair(m_horizontalKerningPairs);

Modified: trunk/Tools/ChangeLog (117258 => 117259)


--- trunk/Tools/ChangeLog	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Tools/ChangeLog	2012-05-16 11:29:14 UTC (rev 117259)
@@ -1,3 +1,12 @@
+2012-05-15  Pierre Rossi  <[email protected]>
+
+        [Qt] Enable SVG Fonts by default
+        https://bugs.webkit.org/show_bug.cgi?id=86463
+
+        Reviewed by Nikolas Zimmermann.
+
+        * qmake/mkspecs/features/features.pri:
+
 2012-05-16  Christophe Dumez  <[email protected]>
 
         [EFL] EFL's LayoutTestController does not implement setApplicationCacheOriginQuota

Modified: trunk/Tools/qmake/mkspecs/features/features.pri (117258 => 117259)


--- trunk/Tools/qmake/mkspecs/features/features.pri	2012-05-16 11:26:49 UTC (rev 117258)
+++ trunk/Tools/qmake/mkspecs/features/features.pri	2012-05-16 11:29:14 UTC (rev 117259)
@@ -85,7 +85,7 @@
     ENABLE_STYLE_SCOPED=0 \
     ENABLE_SVG=1 \
     ENABLE_SVG_DOM_OBJC_BINDINGS=0 \
-    ENABLE_SVG_FONTS=0 \
+    ENABLE_SVG_FONTS=1 \
     ENABLE_TEXT_NOTIFICATIONS_ONLY=0 \
     ENABLE_TOUCH_ADJUSTMENT=1 \
     ENABLE_TOUCH_EVENTS=1 \
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to