Title: [126959] trunk
- Revision
- 126959
- Author
- [email protected]
- Date
- 2012-08-28 22:11:05 -0700 (Tue, 28 Aug 2012)
Log Message
style->fontMetrics() should be available when setting line-height
https://bugs.webkit.org/show_bug.cgi?id=93327
Reviewed by Darin Adler.
Source/WebCore:
Setting line-height assumes the fontMetrics are available for the affected font, but
the fontMetrics won't be available immediately after setting other properties like
font-size. Call styleResolver->updateFont() before setting line-height to update fontMetrics.
Added a test case to fast/canvas/crash-set-font.html.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::setFont):
Call styleResolver->updateFont() before styleResolver->applyPropertyToCurrentStyle(CSSPropertyLineHeight,...)
LayoutTests:
* fast/canvas/crash-set-font.html: Add a test case that sets both font-size and line-height.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (126958 => 126959)
--- trunk/LayoutTests/ChangeLog 2012-08-29 05:10:04 UTC (rev 126958)
+++ trunk/LayoutTests/ChangeLog 2012-08-29 05:11:05 UTC (rev 126959)
@@ -1,3 +1,12 @@
+2012-08-28 Kenichi Ishibashi <[email protected]>
+
+ style->fontMetrics() should be available when setting line-height
+ https://bugs.webkit.org/show_bug.cgi?id=93327
+
+ Reviewed by Darin Adler.
+
+ * fast/canvas/crash-set-font.html: Add a test case that sets both font-size and line-height.
+
2012-08-28 Philip Rogers <[email protected]>
Unreviewed rebaseline after r126683
Modified: trunk/LayoutTests/fast/canvas/crash-set-font.html (126958 => 126959)
--- trunk/LayoutTests/fast/canvas/crash-set-font.html 2012-08-29 05:10:04 UTC (rev 126958)
+++ trunk/LayoutTests/fast/canvas/crash-set-font.html 2012-08-29 05:11:05 UTC (rev 126959)
@@ -9,6 +9,7 @@
oContext2d.font = "small-caps .0ex G";
oContext2d.font = "italic .0ex G";
oContext2d.font = "italic 400 .0ex G";
+ oContext2d.font = "italic 400 small/.0ex G";
</script>
</head>
<body>
Modified: trunk/Source/WebCore/ChangeLog (126958 => 126959)
--- trunk/Source/WebCore/ChangeLog 2012-08-29 05:10:04 UTC (rev 126958)
+++ trunk/Source/WebCore/ChangeLog 2012-08-29 05:11:05 UTC (rev 126959)
@@ -1,3 +1,20 @@
+2012-08-28 Kenichi Ishibashi <[email protected]>
+
+ style->fontMetrics() should be available when setting line-height
+ https://bugs.webkit.org/show_bug.cgi?id=93327
+
+ Reviewed by Darin Adler.
+
+ Setting line-height assumes the fontMetrics are available for the affected font, but
+ the fontMetrics won't be available immediately after setting other properties like
+ font-size. Call styleResolver->updateFont() before setting line-height to update fontMetrics.
+
+ Added a test case to fast/canvas/crash-set-font.html.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::setFont):
+ Call styleResolver->updateFont() before styleResolver->applyPropertyToCurrentStyle(CSSPropertyLineHeight,...)
+
2012-08-28 David Reveman <[email protected]>
[Chromium] Scheduler will never process a commit until it receives a vsync tick.
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (126958 => 126959)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2012-08-29 05:10:04 UTC (rev 126958)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2012-08-29 05:11:05 UTC (rev 126959)
@@ -2060,11 +2060,12 @@
styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontVariant, parsedStyle->getPropertyCSSValue(CSSPropertyFontVariant).get());
styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontWeight, parsedStyle->getPropertyCSSValue(CSSPropertyFontWeight).get());
- // As described in BUG66291, setting font-size on a font may entail a CSSPrimitiveValue::computeLengthDouble call,
+ // As described in BUG66291, setting font-size and line-height on a font may entail a CSSPrimitiveValue::computeLengthDouble call,
// which assumes the fontMetrics are available for the affected font, otherwise a crash occurs (see http://trac.webkit.org/changeset/96122).
- // The updateFont() call below updates the fontMetrics and ensures the proper setting of font-size.
+ // The updateFont() calls below update the fontMetrics and ensure the proper setting of font-size and line-height.
styleResolver->updateFont();
styleResolver->applyPropertyToCurrentStyle(CSSPropertyFontSize, parsedStyle->getPropertyCSSValue(CSSPropertyFontSize).get());
+ styleResolver->updateFont();
styleResolver->applyPropertyToCurrentStyle(CSSPropertyLineHeight, parsedStyle->getPropertyCSSValue(CSSPropertyLineHeight).get());
modifiableState().m_font = newStyle->font();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes