Reviewed by Darin.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 16:18:05 +0000 (16:18 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Jul 2006 16:18:05 +0000 (16:18 +0000)
        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
          REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text

        * manual-tests/ATSU-bad-layout.html: Added.
        * platform/mac/FontMac.mm:
        (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@15305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/manual-tests/ATSU-bad-layout.html [new file with mode: 0644]
WebCore/platform/mac/FontMac.mm

index 8f4ec3a91c5fac801d0d4eeca3c3365774d4d097..c314e00ffe5616700134185d3c031d7ed2eb9c75 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
+
+        Reviewed by Darin.
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
+          REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
+
+        * manual-tests/ATSU-bad-layout.html: Added.
+        * platform/mac/FontMac.mm:
+        (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
+
 2006-07-10  Darin Adler  <darin@apple.com>
 
         - try to fix the no-SVG build
diff --git a/WebCore/manual-tests/ATSU-bad-layout.html b/WebCore/manual-tests/ATSU-bad-layout.html
new file mode 100644 (file)
index 0000000..7563554
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+        "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+</head>
+<body>
+<p><b>BUG ID:</b> <a href="http://bugzilla.opendarwin.org/show_bug.cgi?id=9808">Bugzilla bug 9808</a> REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text</p>
+
+<p id="test" style="background-color:skyblue; padding:3px;"><b>STEPS TO TEST:</b> 
+Choose <i>Use ATSU For All Text</i> from Safari&rsquo;s <i>Debug</i> menu and reload this page.
+</p>
+
+<p id="success" style="background-color:palegreen; padding:3px;"><b>TEST PASS:</b> 
+The text &ldquo;Lorem ipsum&rdquo; below will remain on one line.
+</p>
+
+<p id="failure" style="background-color:#FF3300; padding:3px;"><b>TEST FAIL:</b>  
+There will be a line break after &ldquo;Lorem&rdquo; (and at many other places on this page).
+</p>
+
+<span>Lorem</span> ipsum
+
+</body>
+</html>
index 9648c277fe1b3a0657e15f028bcd160d5dee938a..cc3769e5a3565c44ce2c4260527ff0082607acc4 100644 (file)
@@ -505,6 +505,9 @@ void Font::drawComplexText(GraphicsContext* graphicsContext, const TextRun& run,
 
 float Font::floatWidthForComplexText(const TextRun& run, const TextStyle& style) const
 {
+    if (run.from() == run.to())
+        return 0;
+
     ATSULayoutParameters params(run, style);
     params.initialize(this);