Changeset 117259 in webkit


Ignore:
Timestamp:
May 16, 2012 4:29:14 AM (12 years ago)
Author:
pierre.rossi@gmail.com
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.
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r117258 r117259  
     12012-05-15  Pierre Rossi  <pierre.rossi@gmail.com>
     2
     3        [Qt] Enable SVG Fonts by default
     4        https://bugs.webkit.org/show_bug.cgi?id=86463
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        * platform/qt-4.8/Skipped: Skipped the relevant tests...
     9        * platform/qt/Skipped: ... and unskipped them here.
     10
    1112012-05-16  Christophe Dumez  <christophe.dumez@intel.com>
    212
  • trunk/LayoutTests/platform/qt-4.8/Skipped

    r117081 r117259  
    8282fullscreen
    8383plugins/fullscreen-plugins-dont-reload.html
     84
     85# Fail until SUBPIXEL_LAYOUT is enabled
     86# https://bugs.webkit.org/show_bug.cgi?id=85532
     87fast/sub-pixel/client-width-height-snapping.html
     88fast/sub-pixel/layout-boxes-with-zoom.html
     89fast/sub-pixel/size-of-box-with-zoom.html
     90
     91# SVG Fonts are only supported when using QRawFont, which is not
     92# supported with Qt 4.
     93
     94svg/W3C-SVG-1.1/animate-elem-03-t.svg
     95svg/W3C-SVG-1.1/animate-elem-24-t.svg
     96svg/W3C-SVG-1.1/animate-elem-36-t.svg
     97svg/W3C-SVG-1.1/animate-elem-40-t.svg
     98svg/W3C-SVG-1.1/fonts-elem-01-t.svg
     99svg/W3C-SVG-1.1/fonts-elem-02-t.svg
     100svg/W3C-SVG-1.1/fonts-elem-03-b.svg
     101svg/W3C-SVG-1.1/fonts-elem-04-b.svg
     102svg/W3C-SVG-1.1/fonts-elem-05-t.svg
     103svg/W3C-SVG-1.1/fonts-elem-06-t.svg
     104svg/W3C-SVG-1.1/fonts-elem-07-b.svg
     105svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
     106svg/W3C-SVG-1.1/fonts-glyph-03-t.svg
     107svg/W3C-SVG-1.1/fonts-kern-01-t.svg
     108svg/W3C-SVG-1.1/masking-mask-01-b.svg
     109svg/W3C-SVG-1.1/pservers-grad-08-b.svg
     110svg/W3C-SVG-1.1/struct-cond-03-t.svg
     111svg/W3C-SVG-1.1/struct-image-02-b.svg
     112svg/W3C-SVG-1.1/text-align-08-b.svg
     113svg/W3C-SVG-1.1/text-altglyph-01-b.svg
     114svg/W3C-SVG-1.1/text-fonts-03-t.svg
     115svg/W3C-SVG-1.1/text-intro-01-t.svg
     116svg/W3C-SVG-1.1/text-intro-02-b.svg
     117svg/W3C-SVG-1.1/text-intro-03-b.svg
     118svg/W3C-SVG-1.1/text-intro-04-t.svg
     119svg/W3C-SVG-1.1/text-text-04-t.svg
     120svg/W3C-SVG-1.1/text-text-05-t.svg
     121svg/W3C-SVG-1.1/text-text-06-t.svg
     122svg/custom/acid3-test-77.html
     123svg/custom/altglyph.svg
     124svg/custom/font-face-simple.svg
     125svg/custom/global-constructors.html
     126svg/custom/glyph-selection-lang-attribute.svg
     127svg/custom/glyph-setting-d-attribute.svg
     128svg/custom/insertItemBefore-from-non-list-origin.svg
     129svg/custom/svg-fonts-in-text-controls.html
     130svg/custom/svg-fonts-with-no-element-reference.html
     131svg/custom/svg-fonts-without-missing-glyph.xhtml
     132svg/custom/svg-fonts-word-spacing.html
     133svg/dom/altGlyph-dom.xhtml
     134svg/dom/baseVal-animVal-crash.html
     135svg/dom/font-face-elements.html
     136svg/text/kerning.svg
     137svg/text/multichar-glyph.svg
     138svg/text/text-altglyph-01-b.svg
     139svg/text/text-fonts-01-t.svg
     140svg/text/text-hkern-on-vertical-text.svg
     141svg/text/text-hkern.svg
     142svg/text/text-text-04-t.svg
     143svg/text/text-text-05-t.svg
     144svg/text/text-text-06-t.svg
     145svg/text/text-vkern-on-horizontal-text.svg
     146svg/text/text-vkern.svg
     147http/tests/misc/SVGFont-delayed-load.html
  • trunk/LayoutTests/platform/qt/Skipped

    r117249 r117259  
    12341234svg/custom/visibility-override-filter.svg
    12351235svg/custom/stroke-width-click.svg
    1236 svg/text/text-fonts-01-t.svg
    12371236svg/text/text-intro-05-t.svg
    12381237svg/text/text-tselect-02-f.svg
     
    13101309svg/text/text-intro-05-t.svg
    13111310svg/text/text-tselect-02-f.svg
    1312 
    1313 # Integrate SVG Fonts within GlyphPage concept, removing the special SVG code paths
    1314 # from Font, making it possible to reuse the simple text code path for SVG Fonts
    1315 # https://bugs.webkit.org/show_bug.cgi?id=59085
    1316 # Failing tests after http://trac.webkit.org/changeset/89233
    1317 # They will pass again when QRawFont is enabled by default.
    1318 svg/W3C-SVG-1.1/animate-elem-03-t.svg
    1319 svg/W3C-SVG-1.1/animate-elem-24-t.svg
    1320 svg/W3C-SVG-1.1/animate-elem-36-t.svg
    1321 svg/W3C-SVG-1.1/animate-elem-40-t.svg
    1322 svg/W3C-SVG-1.1/fonts-elem-01-t.svg
    1323 svg/W3C-SVG-1.1/fonts-elem-02-t.svg
    1324 svg/W3C-SVG-1.1/fonts-elem-03-b.svg
    1325 svg/W3C-SVG-1.1/fonts-elem-04-b.svg
    1326 svg/W3C-SVG-1.1/fonts-elem-05-t.svg
    1327 svg/W3C-SVG-1.1/fonts-elem-06-t.svg
    1328 svg/W3C-SVG-1.1/fonts-elem-07-b.svg
    1329 svg/W3C-SVG-1.1/fonts-glyph-02-t.svg
    1330 svg/W3C-SVG-1.1/fonts-glyph-03-t.svg
    1331 svg/W3C-SVG-1.1/fonts-kern-01-t.svg
    1332 svg/W3C-SVG-1.1/masking-mask-01-b.svg
    1333 svg/W3C-SVG-1.1/pservers-grad-08-b.svg
    1334 svg/W3C-SVG-1.1/struct-cond-03-t.svg
    1335 svg/W3C-SVG-1.1/struct-image-02-b.svg
    1336 svg/W3C-SVG-1.1/text-align-08-b.svg
    1337 svg/W3C-SVG-1.1/text-altglyph-01-b.svg
    1338 svg/W3C-SVG-1.1/text-fonts-03-t.svg
    1339 svg/W3C-SVG-1.1/text-intro-01-t.svg
    1340 svg/W3C-SVG-1.1/text-intro-02-b.svg
    1341 svg/W3C-SVG-1.1/text-intro-03-b.svg
    1342 svg/W3C-SVG-1.1/text-intro-04-t.svg
    1343 svg/W3C-SVG-1.1/text-text-04-t.svg
    1344 svg/W3C-SVG-1.1/text-text-05-t.svg
    1345 svg/W3C-SVG-1.1/text-text-06-t.svg
    1346 svg/custom/acid3-test-77.html
    1347 svg/custom/altglyph.svg
    1348 svg/custom/font-face-simple.svg
    1349 svg/custom/global-constructors.html
    1350 svg/custom/glyph-selection-lang-attribute.svg
    1351 svg/custom/glyph-setting-d-attribute.svg
    1352 svg/custom/insertItemBefore-from-non-list-origin.svg
    1353 svg/custom/svg-fonts-in-text-controls.html
    1354 svg/custom/svg-fonts-with-no-element-reference.html
    1355 svg/custom/svg-fonts-without-missing-glyph.xhtml
    1356 svg/dom/altGlyph-dom.xhtml
    1357 svg/dom/baseVal-animVal-crash.html
    1358 svg/dom/font-face-elements.html
    1359 svg/text/kerning.svg
    1360 svg/text/multichar-glyph.svg
    1361 svg/text/text-altglyph-01-b.svg
    1362 svg/text/text-hkern-on-vertical-text.svg
    1363 svg/text/text-hkern.svg
    1364 svg/text/text-text-04-t.svg
    1365 svg/text/text-text-05-t.svg
    1366 svg/text/text-text-06-t.svg
    1367 svg/text/text-vkern-on-horizontal-text.svg
    1368 svg/text/text-vkern.svg
    1369 http/tests/misc/SVGFont-delayed-load.html
    13701311
    13711312# [Qt] svg/animations/animate-path-nested-transforms.html fails
     
    21512092fast/text/midword-break-before-surrogate-pair.html
    21522093svg/custom/svg-fonts-fallback.xhtml
    2153 svg/custom/svg-fonts-word-spacing.html
    21542094
    21552095# new tests, they needs investigation
  • trunk/Source/WebCore/ChangeLog

    r117257 r117259  
     12012-05-15  Pierre Rossi  <pierre.rossi@gmail.com>
     2
     3        [Qt] Enable SVG Fonts by default
     4        https://bugs.webkit.org/show_bug.cgi?id=86463
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        Another feature we can get for free after switching to using
     9        the font fast path with QRawFont.
     10        It will get disabled in features.prf if either SVG support is
     11        disabled or if we are not using QRawFont (e.g. for Qt 4).
     12
     13        Covered by a series of tests that were skipped for the
     14        Qt port up until now.
     15
     16        * platform/graphics/qt/FontPlatformData.h:
     17        (WebCore::FontPlatformDataPrivate::FontPlatformDataPrivate):
     18        Initialize the platform data used as fallback in conjunction with SVG
     19        fonts so it will honor size, weight and oblique-ness.
     20        * rendering/svg/SVGTextMetricsBuilder.cpp: Avoid forcing the complex path.
     21        (WebCore::SVGTextMetricsBuilder::advance):
     22        (WebCore::SVGTextMetricsBuilder::advanceSimpleText):
     23        (WebCore::SVGTextMetricsBuilder::initializeMeasurementWithTextRenderer):
     24        * svg/SVGFontElement.cpp:
     25        (WebCore::SVGFontElement::ensureGlyphCache): avoid ambiguity with String(const QString&)
     26
    1272012-05-16  Kenichi Ishibashi  <bashi@chromium.org>
    228
  • trunk/Source/WebCore/platform/graphics/qt/FontPlatformData.h

    r113968 r117259  
    5656        , oblique(oblique)
    5757        , isDeletedValue(false)
    58     { }
     58    {
     59// This is necessary for SVG Fonts, which are only supported when using QRawFont.
     60// It is used to construct the appropriate platform data to use as a fallback.
     61#if HAVE(QRAWFONT)
     62        QFont font;
     63        font.setBold(bold);
     64        font.setItalic(oblique);
     65        rawFont = QRawFont::fromFont(font, QFontDatabase::Any);
     66        rawFont.setPixelSize(size);
     67#endif
     68    }
    5969#if !HAVE(QRAWFONT)
    6070    FontPlatformDataPrivate(const QFont& font)
  • trunk/Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp

    r105143 r117259  
    4949        return false;
    5050
    51 #if PLATFORM(QT)
     51#if PLATFORM(QT) && !HAVE(QRAWFONT)
    5252    advanceComplexText();
    5353#else
     
    6363void SVGTextMetricsBuilder::advanceSimpleText()
    6464{
    65 #if PLATFORM(QT)
     65#if PLATFORM(QT) && !HAVE(QRAWFONT)
    6666    ASSERT_NOT_REACHED();
    6767#else
     
    116116    m_isComplexText = scaledFont.codePath(m_run) == Font::Complex;
    117117
    118 #if !PLATFORM(QT)
     118#if !PLATFORM(QT) || HAVE(QRAWFONT)
    119119    if (m_isComplexText)
    120120        m_simpleWidthIterator.clear();
  • trunk/Source/WebCore/svg/SVGFontElement.cpp

    r90680 r117259  
    135135            // Register ligatures, if needed, don't mix up with surrogate pairs though!
    136136            if (unicode.length() > 1 && !U16_IS_SURROGATE(unicode[0]))
    137                 ligatures.append(unicode);
     137                ligatures.append(unicode.string());
    138138        } else if (child->hasTagName(SVGNames::hkernTag)) {
    139139            SVGHKernElement* hkern = static_cast<SVGHKernElement*>(child);
  • trunk/Tools/ChangeLog

    r117258 r117259  
     12012-05-15  Pierre Rossi  <pierre.rossi@gmail.com>
     2
     3        [Qt] Enable SVG Fonts by default
     4        https://bugs.webkit.org/show_bug.cgi?id=86463
     5
     6        Reviewed by Nikolas Zimmermann.
     7
     8        * qmake/mkspecs/features/features.pri:
     9
    1102012-05-16  Christophe Dumez  <christophe.dumez@intel.com>
    211
  • trunk/Tools/qmake/mkspecs/features/features.pri

    r117028 r117259  
    8686    ENABLE_SVG=1 \
    8787    ENABLE_SVG_DOM_OBJC_BINDINGS=0 \
    88     ENABLE_SVG_FONTS=0 \
     88    ENABLE_SVG_FONTS=1 \
    8989    ENABLE_TEXT_NOTIFICATIONS_ONLY=0 \
    9090    ENABLE_TOUCH_ADJUSTMENT=1 \
Note: See TracChangeset for help on using the changeset viewer.