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

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:46:50 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 8c371e5b36abd7b2909aa947580279c97f6a5e57
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jun 16 01:19:26 2004 +0000

    	Initial impl of the EllipsisBox.  This code just gets the box created and gets it placed vertically.  The next
    	stage will be to position the box horizontally as well.
    
            Reviewed by trey
    
            * khtml/rendering/bidi.cpp:
            (khtml::RenderBlock::checkLinesForTextOverflow):
            * khtml/rendering/render_line.cpp:
            (RootInlineBox::placeEllipsis):
            * khtml/rendering/render_line.h:
            (khtml::EllipsisBox::m_str):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6860 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index db99c8f..6666cb0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,19 @@
 2004-06-15  David Hyatt  <hyatt at apple.com>
 
+	Initial impl of the EllipsisBox.  This code just gets the box created and gets it placed vertically.  The next
+	stage will be to position the box horizontally as well.
+	
+        Reviewed by trey
+
+        * khtml/rendering/bidi.cpp:
+        (khtml::RenderBlock::checkLinesForTextOverflow):
+        * khtml/rendering/render_line.cpp:
+        (RootInlineBox::placeEllipsis):
+        * khtml/rendering/render_line.h:
+        (khtml::EllipsisBox::m_str):
+
+2004-06-15  David Hyatt  <hyatt at apple.com>
+
 	Implement canAccommodateEllipsis.  The basic idea is that everything on a line will allow an ellipsis to be
 	drawn on top of it unless it's a replaced element.  Then, if the replaced element overlaps, the ellipsis won't
 	be allowed.
diff --git a/WebCore/khtml/rendering/bidi.cpp b/WebCore/khtml/rendering/bidi.cpp
index be93a53..008cc51 100644
--- a/WebCore/khtml/rendering/bidi.cpp
+++ b/WebCore/khtml/rendering/bidi.cpp
@@ -36,6 +36,8 @@
 #define BIDI_DEBUG 0
 //#define DEBUG_LINEBREAKS
 
+using DOM::AtomicString;
+
 namespace khtml {
 
 
@@ -2259,6 +2261,7 @@ void RenderBlock::checkLinesForTextOverflow()
 {
     // Determine the width of the ellipsis using the current font.
     QChar ellipsis = 0x2026; // FIXME: CSS3 says this is configurable, also need to use 0x002E (FULL STOP) if 0x2026 not renderable
+    AtomicString ellipsisStr(ellipsis);
     const Font& firstLineFont = style(true)->htmlFont();
     const Font& font = style()->htmlFont();
     int firstLineEllipsisWidth = firstLineFont.width(&ellipsis, 1, 0);
@@ -2282,7 +2285,7 @@ void RenderBlock::checkLinesForTextOverflow()
             // space.
             int width = curr == firstRootBox() ? firstLineEllipsisWidth : ellipsisWidth;
             if (curr->canAccommodateEllipsis(ltr, lineBoxEdge, blockEdge, width))
-                curr->placeEllipsis(&ellipsis, blockEdge, ltr, width);
+                curr->placeEllipsis(ellipsisStr, blockEdge, ltr, width);
         }
     }
 }
diff --git a/WebCore/khtml/rendering/render_line.cpp b/WebCore/khtml/rendering/render_line.cpp
index 7277862..0e4ec09 100644
--- a/WebCore/khtml/rendering/render_line.cpp
+++ b/WebCore/khtml/rendering/render_line.cpp
@@ -846,12 +846,12 @@ bool RootInlineBox::canAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxE
     return InlineFlowBox::canAccommodateEllipsis(ltr, blockEdge, ellipsisWidth);
 }
 
-void RootInlineBox::placeEllipsis(QChar* ellipsisStr, int blockEdge, bool ltr, int ellipsisWidth)
+void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, int blockEdge, bool ltr, int ellipsisWidth)
 {
     // Create an ellipsis box.
-    
-    // Position the ellipsis box vertically.
-    
+    m_ellipsisBox = new (m_object->renderArena()) EllipsisBox(m_object, ellipsisStr, this, ellipsisWidth,
+                                                              yPos(), height(), baseline());
+
     // Now attempt to find the nearest glyph horizontally and place just to the right (or left in RTL)
     // of that glyph.  Mark all of the objects that intersect the ellipsis box as not painting (as being
     // truncated).
diff --git a/WebCore/khtml/rendering/render_line.h b/WebCore/khtml/rendering/render_line.h
index fb24bc4..d9ce605 100644
--- a/WebCore/khtml/rendering/render_line.h
+++ b/WebCore/khtml/rendering/render_line.h
@@ -24,6 +24,10 @@
 
 #include "rendering/render_object.h"
 
+namespace DOM {
+class AtomicString;
+};
+
 namespace khtml {
 
 class InlineFlowBox;
@@ -272,6 +276,23 @@ protected:
     bool m_hasTextChildren : 1;
 };
 
+class EllipsisBox : public InlineBox
+{
+public:
+    EllipsisBox(RenderObject* obj, const DOM::AtomicString& ellipsisStr, InlineFlowBox* p,
+                int w, int y, int h, int b)
+    :InlineBox(obj), m_str(ellipsisStr) {
+        m_parent = p;
+        m_width = w;
+        m_y = y;
+        m_height = h;
+        m_baseline = b;
+    }
+
+private:
+    DOM::AtomicString m_str;
+};
+
 class RootInlineBox : public InlineFlowBox
 {
 public:
@@ -308,7 +329,7 @@ public:
     void childRemoved(InlineBox* box);
 
     bool canAccommodateEllipsis(bool ltr, int blockEdge, int lineBoxEdge, int ellipsisWidth);
-    void placeEllipsis(QChar* ellipsisStr, int blockEdge, bool ltr, int ellipsisWidth);
+    void placeEllipsis(const DOM::AtomicString& ellipsisStr, int blockEdge, bool ltr, int ellipsisWidth);
 
 protected:
     // Normally we are only as tall as the style on our block dictates, but we might have content
@@ -329,7 +350,7 @@ protected:
     bool m_endsWithBreak;
     
     // An inline text box that represents our text truncation string.
-    InlineBox* m_ellipsisBox;
+    EllipsisBox* m_ellipsisBox;
 };
 
 }; //namespace

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list