[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mitz at apple.com mitz at apple.com
Wed Dec 22 13:21:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7c67b29094c08afa87c280a23411b81f1eb676a3
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Sep 12 23:04:16 2010 +0000

    Neglect unlikely hyphenation opportunities
    https://bugs.webkit.org/show_bug.cgi?id=45606
    
    Reviewed by Adele Peterson.
    
    Avoid looking for hyphenation points in about 40% of the cases at the cost of missing about
    3% of the hyphenation opportunities.
    
    * rendering/RenderBlockLineLayout.cpp:
    (WebCore::tryHyphenating): Bail out if the widest the prefix before the hyphen can be is no more
    than 5/4 the font size.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67350 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index bafc72e..c1dd0aa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-12  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Adele Peterson.
+
+        Neglect unlikely hyphenation opportunities
+        https://bugs.webkit.org/show_bug.cgi?id=45606
+
+        Avoid looking for hyphenation points in about 40% of the cases at the cost of missing about
+        3% of the hyphenation opportunities.
+
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::tryHyphenating): Bail out if the widest the prefix before the hyphen can be is no more
+        than 5/4 the font size.
+
 2010-09-12  Oswald Buddenhagen  <oswald.buddenhagen at nokia.com>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index 84c110a..6785eb2 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -1328,7 +1328,13 @@ static void tryHyphenating(RenderText* text, const Font& font, const AtomicStrin
     const AtomicString& hyphenString = text->style()->hyphenString();
     int hyphenWidth = font.width(TextRun(hyphenString.characters(), hyphenString.length()));
 
-    unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing, false);
+    int maxPrefixWidth = availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing;
+    // If the maximum width available for the prefix before the hyphen is small, then it is very unlikely
+    // that an hyphenation opportunity exists, so do not bother to look for it.
+    if (maxPrefixWidth <= font.pixelSize() * 5 / 4)
+        return;
+
+    unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), maxPrefixWidth, false);
     if (!prefixLength)
         return;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list