Title: [95874] trunk
Revision
95874
Author
m...@apple.com
Date
2011-09-23 15:45:17 -0700 (Fri, 23 Sep 2011)

Log Message

<rdar://problem/10178576> REGRESSION (r95391): Crash in -[WebCascadeList objectAtIndex:] when a font-family list contains missing fonts
https://bugs.webkit.org/show_bug.cgi?id=68737

Reviewed by Darin Adler.

Source/WebCore: 

Test: fast/text/combining-character-sequence-fallback-crash.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(-[WebCascadeList initWithFont:WebCore::character:]): Changed to intialize _count to the exact
number of FontData instances in the fallback list rather than the number of font families in the
font description.

LayoutTests: 

* fast/text/combining-character-sequence-fallback-crash-expected.txt: Added.
* fast/text/combining-character-sequence-fallback-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95873 => 95874)


--- trunk/LayoutTests/ChangeLog	2011-09-23 22:44:19 UTC (rev 95873)
+++ trunk/LayoutTests/ChangeLog	2011-09-23 22:45:17 UTC (rev 95874)
@@ -1,3 +1,13 @@
+2011-09-23  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10178576> REGRESSION (r95391): Crash in -[WebCascadeList objectAtIndex:] when a font-family list contains missing fonts
+        https://bugs.webkit.org/show_bug.cgi?id=68737
+
+        Reviewed by Darin Adler.
+
+        * fast/text/combining-character-sequence-fallback-crash-expected.txt: Added.
+        * fast/text/combining-character-sequence-fallback-crash.html: Added.
+
 2011-09-23  David Reveman  <reve...@chromium.org>
 
         [Chromium] Fix CSS 3D corner anti-aliasing.

Added: trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash-expected.txt (0 => 95874)


--- trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash-expected.txt	2011-09-23 22:45:17 UTC (rev 95874)
@@ -0,0 +1,5 @@
+Test for https://bugs.webkit.org/show_bug.cgi?id=68737 REGRESSION (r95391): Crash in -[WebCascadeList objectAtIndex:] when a font-family list contains missing fonts.
+
+The test passes if it does not cause a crash.
+
+î and i̿

Added: trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash.html (0 => 95874)


--- trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/combining-character-sequence-fallback-crash.html	2011-09-23 22:45:17 UTC (rev 95874)
@@ -0,0 +1,14 @@
+<p>
+    Test for <i><a href=""
+    REGRESSION (r95391): Crash in -[WebCascadeList objectAtIndex:] when a font-family list contains missing fonts</i>.
+</p>
+<p>
+    The test passes if it does not cause a crash.
+</p>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<div style="font-family: verdana, a-font-you-do-not-have;">
+    i&#x0302; and i&#x033f;
+</div>

Modified: trunk/Source/WebCore/ChangeLog (95873 => 95874)


--- trunk/Source/WebCore/ChangeLog	2011-09-23 22:44:19 UTC (rev 95873)
+++ trunk/Source/WebCore/ChangeLog	2011-09-23 22:45:17 UTC (rev 95874)
@@ -1,3 +1,17 @@
+2011-09-23  Dan Bernstein  <m...@apple.com>
+
+        <rdar://problem/10178576> REGRESSION (r95391): Crash in -[WebCascadeList objectAtIndex:] when a font-family list contains missing fonts
+        https://bugs.webkit.org/show_bug.cgi?id=68737
+
+        Reviewed by Darin Adler.
+
+        Test: fast/text/combining-character-sequence-fallback-crash.html
+
+        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+        (-[WebCascadeList initWithFont:WebCore::character:]): Changed to intialize _count to the exact
+        number of FontData instances in the fallback list rather than the number of font families in the
+        font description.
+
 2011-09-23  David Reveman  <reve...@chromium.org>
 
         [Chromium] Fix CSS 3D corner anti-aliasing.

Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (95873 => 95874)


--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2011-09-23 22:44:19 UTC (rev 95873)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm	2011-09-23 22:45:17 UTC (rev 95874)
@@ -70,7 +70,9 @@
     _font = font;
     _character = character;
 
-    for (const WebCore::FontFamily* family = &font->family(); family; family = family->next())
+    // By the time a WebCascadeList is used, the Font has already been asked to realize all of its
+    // FontData, so this loop does not hit the FontCache.
+    while (_font->fontDataAt(_count))
         _count++;
 
     return self;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to