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

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 16:37:09 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 0a775b884b0186b421a2663fc7f5084b7cf44cdc
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 29 12:05:56 2010 +0000

    2010-11-29  Jan Erik Hanssen  <jhanssen at sencha.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            QtWebKit asserts when selecting elided text.
            https://bugs.webkit.org/show_bug.cgi?id=45391
    
            Ensure that the length passed to fromRawDataWithoutRef() does
            not exceed the length of the string.
    
            * platform/graphics/qt/FontQt.cpp:
            (WebCore::Font::selectionRectForSimpleText):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72788 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2f680cf..8f38852 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-29  Jan Erik Hanssen  <jhanssen at sencha.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        QtWebKit asserts when selecting elided text.
+        https://bugs.webkit.org/show_bug.cgi?id=45391
+
+        Ensure that the length passed to fromRawDataWithoutRef() does
+        not exceed the length of the string.
+
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::Font::selectionRectForSimpleText):
+
 2010-11-26  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index 564ab2b..89dfd00 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -344,7 +344,7 @@ FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint&
 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
     String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
     QString wholeText = fromRawDataWithoutRef(sanitized);
-    QString selectedText = fromRawDataWithoutRef(sanitized, from, to - from);
+    QString selectedText = fromRawDataWithoutRef(sanitized, from, qMin(to - from, wholeText.length() - from));
 
     int startX = QFontMetrics(font()).width(wholeText, from, Qt::TextBypassShaping);
     int width = QFontMetrics(font()).width(selectedText, -1, Qt::TextBypassShaping);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list