[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:45:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit bfd5cfbd50d0a5b10b839c7d75bc630ba673b08a
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jun 13 21:13:19 2003 +0000

    	Fixed 3282087.  Don't use our <pre> optimizations
    	if text contains non-ascii, and consequently may
    	result in font substitution.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4545 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 61e85da..9f1af3a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,19 @@
 2003-06-13  Richard Williamson  <rjw at apple.com>
 
+	Fixed 3282087.  Don't use our <pre> optimizations
+	if text contains non-ascii, and consequently may
+	result in font substitution.
+
+        Reviewed by Darin.
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::RenderText):
+        (RenderText::allAscii):
+        (RenderText::shouldUseMonospaceCache):
+        * khtml/rendering/render_text.h:
+
+2003-06-13  Richard Williamson  <rjw at apple.com>
+
         Reviewed by NOBODY (OOPS!).
 
         * kwq/KWQObject.mm:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 61e85da..9f1af3a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2003-06-13  Richard Williamson  <rjw at apple.com>
 
+	Fixed 3282087.  Don't use our <pre> optimizations
+	if text contains non-ascii, and consequently may
+	result in font substitution.
+
+        Reviewed by Darin.
+
+        * khtml/rendering/render_text.cpp:
+        (RenderText::RenderText):
+        (RenderText::allAscii):
+        (RenderText::shouldUseMonospaceCache):
+        * khtml/rendering/render_text.h:
+
+2003-06-13  Richard Williamson  <rjw at apple.com>
+
         Reviewed by NOBODY (OOPS!).
 
         * kwq/KWQObject.mm:
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 00f40ac..b5329ed 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -327,6 +327,8 @@ RenderText::RenderText(DOM::NodeImpl* node, DOMStringImpl *_str)
 
 #ifdef APPLE_CHANGES
     m_monospaceCharacterWidth = 0;
+    m_allAsciiChecked = false;
+    m_allAscii = false;
 #endif
 
     str = _str;
@@ -824,9 +826,28 @@ void RenderText::paint(QPainter *p, int x, int y, int w, int h,
 
 #ifdef APPLE_CHANGES
 
+bool RenderText::allAscii() const
+{
+    if (m_allAsciiChecked)
+        return m_allAscii;
+    m_allAsciiChecked = true;
+    
+    unsigned int i;
+    for (i = 0; i < str->l; i++){
+        if (str->s[i].unicode() >= 0x7f){
+            m_allAscii = false;
+            return m_allAscii;
+        }
+    }
+    
+    m_allAscii = true;
+    
+    return m_allAscii;
+}
+
 bool RenderText::shouldUseMonospaceCache(const Font *f) const
 {
-    return (f && f->isFixedPitch());
+    return (f && f->isFixedPitch() && allAscii());
 }
 
 // We cache the width of the ' ' character for <pre> text.  We could go futher
diff --git a/WebCore/khtml/rendering/render_text.h b/WebCore/khtml/rendering/render_text.h
index 0600d50..64eae30 100644
--- a/WebCore/khtml/rendering/render_text.h
+++ b/WebCore/khtml/rendering/render_text.h
@@ -211,6 +211,7 @@ public:
     int widthFromCache(const Font *, int start, int len) const;
     bool shouldUseMonospaceCache(const Font *) const;
     void cacheWidths();
+    bool allAscii() const;
 #endif
 
 protected:
@@ -239,6 +240,8 @@ protected: // members
     
     // 19 bits left
 #if APPLE_CHANGES
+    mutable bool m_allAsciiChecked:1;
+    mutable bool m_allAscii:1;
     int m_monospaceCharacterWidth;
 #endif
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list