Changeset 128076 in webkit


Ignore:
Timestamp:
Sep 10, 2012 10:20:54 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Font value should be parsed as a individual property
https://bugs.webkit.org/show_bug.cgi?id=96271

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-09-10
Reviewed by Eric Seidel.

Source/WebCore:

Parsing the font value as an individual CSS property instead of a style
body should make it significantly more effective and will not
validate something like ctx.font = "25px serif; background: green".

Updated canvas/philip/tests/2d.text.font.parse.invalid.html to cover
this use case.

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::setFont):

LayoutTests:

Updated test to the latest W3C approved version. It adds a test
that verifies this fix.

  • canvas/philip/tests/2d.text.font.parse.invalid.html:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128075 r128076  
     12012-09-10  Thiago Marcos P. Santos  <thiago.santos@intel.com>
     2
     3        Font value should be parsed as a individual property
     4        https://bugs.webkit.org/show_bug.cgi?id=96271
     5
     6        Reviewed by Eric Seidel.
     7
     8        Updated test to the latest W3C approved version. It adds a test
     9        that verifies this fix.
     10
     11        * canvas/philip/tests/2d.text.font.parse.invalid.html:
     12
    1132012-09-10  Silvia Pfeiffer  <silviapf@chromium.org>
    214
  • trunk/LayoutTests/canvas/philip/tests/2d.text.font.parse.invalid.html

    r71481 r128076  
    4040_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
    4141
     42ctx.font = '20px serif';
     43ctx.font = '1em serif; background: green; margin: 10px';
     44_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
    4245
    4346});
  • trunk/Source/WebCore/ChangeLog

    r128075 r128076  
     12012-09-10  Thiago Marcos P. Santos  <thiago.santos@intel.com>
     2
     3        Font value should be parsed as a individual property
     4        https://bugs.webkit.org/show_bug.cgi?id=96271
     5
     6        Reviewed by Eric Seidel.
     7
     8        Parsing the font value as an individual CSS property instead of a style
     9        body should make it significantly more effective and will not
     10        validate something like ctx.font = "25px serif; background: green".
     11
     12        Updated canvas/philip/tests/2d.text.font.parse.invalid.html to cover
     13        this use case.
     14
     15        * html/canvas/CanvasRenderingContext2D.cpp:
     16        (WebCore::CanvasRenderingContext2D::setFont):
     17
    1182012-09-10  Silvia Pfeiffer  <silviapf@chromium.org>
    219
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r128014 r128076  
    20272027{
    20282028    RefPtr<StylePropertySet> parsedStyle = StylePropertySet::create();
    2029     CSSParser(strictToCSSParserMode(!m_usesCSSCompatibilityParseMode)).parseDeclaration(parsedStyle.get(), "font:" + newFont, 0, 0);
     2029    CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, newFont, true, strictToCSSParserMode(!m_usesCSSCompatibilityParseMode), 0);
    20302030    if (parsedStyle->isEmpty())
    20312031        return;
Note: See TracChangeset for help on using the changeset viewer.