Changeset 125450 in webkit


Ignore:
Timestamp:
Aug 13, 2012, 2:15:06 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

CanvasRenderContext2D::font() does not re-serialize the font
https://bugs.webkit.org/show_bug.cgi?id=50859

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-08-13
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Added proper serialization for the font property.

No new tests, unskipped the existing ones.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::font):

LayoutTests:

Unskip tests that will now pass and remove wrong/duplicated
expectations. canvas-font-ex-units-crash has now the wrong
expectations until we fix the issue on 93840.

  • fast/canvas/canvas-font-ex-units-crash-expected.txt:
  • fast/canvas/script-tests/canvas-font-ex-units-crash.js:

Even though we are setting a value on this test case (and verifying),
the font is not being effectiviely set as the serialization reveled. This
is going to be fixed in another bug.

  • platform/chromium/TestExpectations:
  • platform/chromium/canvas/philip/tests/2d.text.font.parse.system-expected.txt: Removed.
  • platform/efl/Skipped:
  • platform/gtk/TestExpectations:
  • platform/mac/canvas/philip/tests/2d.text.font.parse.system-expected.txt: Removed.
  • platform/qt/Skipped:
Location:
trunk
Files:
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r125448 r125450  
     12012-08-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
     2
     3        CanvasRenderContext2D::font() does not re-serialize the font
     4        https://bugs.webkit.org/show_bug.cgi?id=50859
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Unskip tests that will now pass and remove wrong/duplicated
     9        expectations. canvas-font-ex-units-crash has now the wrong
     10        expectations until we fix the issue on 93840.
     11
     12        * fast/canvas/canvas-font-ex-units-crash-expected.txt:
     13        * fast/canvas/script-tests/canvas-font-ex-units-crash.js:
     14        Even though we are setting a value on this test case (and verifying),
     15        the font is not being effectiviely set as the serialization reveled. This
     16        is going to be fixed in another bug.
     17        * platform/chromium/TestExpectations:
     18        * platform/chromium/canvas/philip/tests/2d.text.font.parse.system-expected.txt: Removed.
     19        * platform/efl/Skipped:
     20        * platform/gtk/TestExpectations:
     21        * platform/mac/canvas/philip/tests/2d.text.font.parse.system-expected.txt: Removed.
     22        * platform/qt/Skipped:
     23
    1242012-08-13  Elliott Sprehn  <esprehn@chromium.org>
    225
  • trunk/LayoutTests/fast/canvas/canvas-font-ex-units-crash-expected.txt

    r68513 r125450  
    44
    55
    6 PASS ctx.font = '5ex sans-serif'; ctx.font is '5ex sans-serif'
     6PASS ctx.font = '0px sans-serif'; ctx.font is '0px sans-serif'
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/fast/canvas/script-tests/canvas-font-ex-units-crash.js

    r98407 r125450  
    33ctx = document.createElement('canvas').getContext('2d');
    44
     5// Relative units doesn't work when the canvas has no parent. See bug 93840.
    56ctx.font = "5ex sans-serif";
    6 shouldBe("ctx.font = '5ex sans-serif'; ctx.font", "'5ex sans-serif'");
     7shouldBe("ctx.font = '0px sans-serif'; ctx.font", "'0px sans-serif'");
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r125437 r125450  
    18971897BUGWK45991 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.draw.space.collapse.start.html = TEXT
    18981898
    1899 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
    1900 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
    19011899BUGWK50859 : canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
    19021900BUGWK50859 : canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
    1903 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.system.html = TEXT
    1904 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
    1905 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
    19061901BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
    19071902BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
    1908 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.system.html = TEXT
    19091903
    19101904BUGWK45991 : canvas/philip/tests/2d.text.measure.width.space.html = TEXT
  • trunk/LayoutTests/platform/efl/Skipped

    r125432 r125450  
    326326canvas/philip/tests/2d.text.draw.space.collapse.space.html
    327327canvas/philip/tests/2d.text.draw.space.collapse.start.html
    328 canvas/philip/tests/2d.text.font.parse.basic.html
    329 canvas/philip/tests/2d.text.font.parse.complex.html
    330328canvas/philip/tests/2d.text.font.parse.size.percentage.html
    331329canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
    332 canvas/philip/tests/2d.text.font.parse.system.html
    333330canvas/philip/tests/2d.text.measure.width.space.html
    334331canvas/philip/tests/type.prototype.html
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r125437 r125450  
    908908BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.space.html = TEXT
    909909BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.start.html = TEXT
    910 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
    911 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
    912910BUGWKGTK : canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
    913911BUGWKGTK : canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
    914 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.system.html = TEXT
    915912BUGWKGTK : canvas/philip/tests/2d.text.measure.width.space.html = TEXT
    916913BUGWKGTK : canvas/philip/tests/type.prototype.html = TEXT
  • trunk/LayoutTests/platform/qt/Skipped

    r125447 r125450  
    21122112canvas/philip/tests/2d.text.draw.space.collapse.space.html
    21132113canvas/philip/tests/2d.text.draw.space.collapse.start.html
    2114 canvas/philip/tests/2d.text.font.parse.basic.html
    2115 canvas/philip/tests/2d.text.font.parse.complex.html
    21162114canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
    21172115canvas/philip/tests/2d.text.font.parse.size.percentage.html
    2118 canvas/philip/tests/2d.text.font.parse.system.html
    21192116canvas/philip/tests/2d.text.measure.width.space.html
    21202117canvas/philip/tests/2d.transformation.setTransform.skewed.html
  • trunk/Source/WebCore/ChangeLog

    r125448 r125450  
     12012-08-13  Thiago Marcos P. Santos  <thiago.santos@intel.com>
     2
     3        CanvasRenderContext2D::font() does not re-serialize the font
     4        https://bugs.webkit.org/show_bug.cgi?id=50859
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Added proper serialization for the font property.
     9
     10        No new tests, unskipped the existing ones.
     11
     12        * html/canvas/CanvasRenderingContext2D.cpp:
     13        (WebCore::CanvasRenderingContext2D::font):
     14
    1152012-08-13  Elliott Sprehn  <esprehn@chromium.org>
    216
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r125118 r125450  
    66 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
    77 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
     8 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    89 *
    910 * Redistribution and use in source and binary forms, with or without
     
    19871988String CanvasRenderingContext2D::font() const
    19881989{
    1989     return state().m_unparsedFont;
     1990    if (!state().m_realizedFont)
     1991        return defaultFont;
     1992
     1993    String serializedFont;
     1994    const FontDescription& fontDescription = state().m_font.fontDescription();
     1995
     1996    if (fontDescription.italic())
     1997        serializedFont += "italic ";
     1998    if (fontDescription.smallCaps() == FontSmallCapsOn)
     1999        serializedFont += "small-caps ";
     2000
     2001    serializedFont += String::number(fontDescription.computedPixelSize()) + "px";
     2002
     2003    const FontFamily& firstFontFamily = fontDescription.family();
     2004    for (const FontFamily* fontFamily = &firstFontFamily; fontFamily; fontFamily = fontFamily->next()) {
     2005        if (fontFamily != &firstFontFamily)
     2006            serializedFont += ",";
     2007
     2008        String family = fontFamily->family();
     2009        if (family.startsWith("-webkit-"))
     2010            family = family.substring(8);
     2011        if (family.contains(' '))
     2012            family = makeString('"', family, '"');
     2013
     2014        serializedFont += " " + family;
     2015    }
     2016
     2017    return serializedFont;
    19902018}
    19912019
Note: See TracChangeset for help on using the changeset viewer.