Title: [125118] trunk
Revision
125118
Author
[email protected]
Date
2012-08-08 16:59:34 -0700 (Wed, 08 Aug 2012)

Log Message

CanvasRenderContext2D::setFont() should ignore inherited properties and default keyword value
https://bugs.webkit.org/show_bug.cgi?id=93491

Patch by Thiago Marcos P. Santos <[email protected]> on 2012-08-08
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Treat "inherit" as an invalid value. Also ignore the "default"
keyword that was previously treated as a font family. This second
change was done in the property validation and will also affect the
CSS font parsing, but it is probably harmless since font doesn't
recognize the default keyword anyway.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseFontFamily):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):

LayoutTests:

Unskipped tests that are now passing after this fix and removed wrong
expectations.

* platform/chromium/TestExpectations:
* platform/chromium/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt: Removed.
* platform/efl/Skipped:
* platform/gtk/TestExpectations:
* platform/mac/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt: Removed.
* platform/qt/Skipped:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (125117 => 125118)


--- trunk/LayoutTests/ChangeLog	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/ChangeLog	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1,3 +1,20 @@
+2012-08-08  Thiago Marcos P. Santos  <[email protected]>
+
+        CanvasRenderContext2D::setFont() should ignore inherited properties and default keyword value
+        https://bugs.webkit.org/show_bug.cgi?id=93491
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Unskipped tests that are now passing after this fix and removed wrong
+        expectations.
+
+        * platform/chromium/TestExpectations:
+        * platform/chromium/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt: Removed.
+        * platform/efl/Skipped:
+        * platform/gtk/TestExpectations:
+        * platform/mac/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt: Removed.
+        * platform/qt/Skipped:
+
 2012-08-08  Roger Fong  <[email protected]>
 
         css3/calc/transitions-dependent.html was causing css3/calc/transitions.html to fail

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (125117 => 125118)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1910,13 +1910,11 @@
 
 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
-BUGWK50859 : canvas/philip/tests/2d.text.font.parse.invalid.html = TEXT
 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
 BUGWK50859 : canvas/philip/tests/2d.text.font.parse.system.html = TEXT
 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
-BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.invalid.html = TEXT
 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
 BUGWK50859 : platform/chromium/virtual/gpu/canvas/philip/tests/2d.text.font.parse.system.html = TEXT

Deleted: trunk/LayoutTests/platform/chromium/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt (125117 => 125118)


--- trunk/LayoutTests/platform/chromium/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/chromium/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1 +0,0 @@
-Passed

Modified: trunk/LayoutTests/platform/efl/Skipped (125117 => 125118)


--- trunk/LayoutTests/platform/efl/Skipped	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/efl/Skipped	2012-08-08 23:59:34 UTC (rev 125118)
@@ -327,7 +327,6 @@
 canvas/philip/tests/2d.text.draw.space.collapse.start.html
 canvas/philip/tests/2d.text.font.parse.basic.html
 canvas/philip/tests/2d.text.font.parse.complex.html
-canvas/philip/tests/2d.text.font.parse.invalid.html
 canvas/philip/tests/2d.text.font.parse.size.percentage.html
 canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
 canvas/philip/tests/2d.text.font.parse.system.html

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (125117 => 125118)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-08-08 23:59:34 UTC (rev 125118)
@@ -900,7 +900,6 @@
 BUGWKGTK : canvas/philip/tests/2d.text.draw.space.collapse.start.html = TEXT
 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.basic.html = TEXT
 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.complex.html = TEXT
-BUGWKGTK : canvas/philip/tests/2d.text.font.parse.invalid.html = TEXT
 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.size.percentage.html = TEXT
 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.size.percentage.default.html = TEXT
 BUGWKGTK : canvas/philip/tests/2d.text.font.parse.system.html = TEXT

Deleted: trunk/LayoutTests/platform/mac/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt (125117 => 125118)


--- trunk/LayoutTests/platform/mac/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/mac/canvas/philip/tests/2d.text.font.parse.invalid-expected.txt	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1,2 +0,0 @@
-Failed assertion ctx.font === '20px serif' (got inherit[string], expected 20px serif[string])
-Failed assertion ctx.font === '20px serif' (got 10px default[string], expected 20px serif[string])

Modified: trunk/LayoutTests/platform/qt/Skipped (125117 => 125118)


--- trunk/LayoutTests/platform/qt/Skipped	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/LayoutTests/platform/qt/Skipped	2012-08-08 23:59:34 UTC (rev 125118)
@@ -2115,7 +2115,6 @@
 canvas/philip/tests/2d.text.draw.space.collapse.start.html
 canvas/philip/tests/2d.text.font.parse.basic.html
 canvas/philip/tests/2d.text.font.parse.complex.html
-canvas/philip/tests/2d.text.font.parse.invalid.html
 canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
 canvas/philip/tests/2d.text.font.parse.size.percentage.html
 canvas/philip/tests/2d.text.font.parse.system.html

Modified: trunk/Source/WebCore/ChangeLog (125117 => 125118)


--- trunk/Source/WebCore/ChangeLog	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/Source/WebCore/ChangeLog	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1,3 +1,21 @@
+2012-08-08  Thiago Marcos P. Santos  <[email protected]>
+
+        CanvasRenderContext2D::setFont() should ignore inherited properties and default keyword value
+        https://bugs.webkit.org/show_bug.cgi?id=93491
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Treat "inherit" as an invalid value. Also ignore the "default"
+        keyword that was previously treated as a font family. This second
+        change was done in the property validation and will also affect the
+        CSS font parsing, but it is probably harmless since font doesn't
+        recognize the default keyword anyway.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseFontFamily):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::setFont):
+
 2012-08-08  James Robinson  <[email protected]>
 
         [chromium] Add missing OVERRIDE and virtual annotations in compositor

Modified: trunk/Source/WebCore/css/CSSParser.cpp (125117 => 125118)


--- trunk/Source/WebCore/css/CSSParser.cpp	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2012-08-08 23:59:34 UTC (rev 125118)
@@ -4854,7 +4854,7 @@
     bool inFamily = false;
 
     while (value) {
-        if (value->id == CSSValueInitial || value->id == CSSValueInherit)
+        if (value->id == CSSValueInitial || value->id == CSSValueInherit || value->id == CSSValueDefault)
             return 0;
         CSSParserValue* nextValue = m_valueList->next();
         bool nextValBreaksFont = !nextValue ||

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (125117 => 125118)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-08-08 23:59:09 UTC (rev 125117)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp	2012-08-08 23:59:34 UTC (rev 125118)
@@ -1996,6 +1996,10 @@
     if (parsedStyle->isEmpty())
         return;
 
+    RefPtr<CSSValue> fontValue = parsedStyle->getPropertyCSSValue(CSSPropertyFont);
+    if (fontValue && fontValue->isInheritedValue())
+        return;
+
     // The parse succeeded.
     realizeSaves();
     modifiableState().m_unparsedFont = newFont;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to