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

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:49:53 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7ea147dc67e4243b4056fffe965149fb318b9f76
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 15 23:35:59 2002 +0000

    	- fixed 3021713 -- text selection background obliterates descenders
    	(in www.theregister.co.uk articles)
    	- fixed 3038207 -- Selected link text doesn't draw its link underline
    
            * khtml/rendering/render_text.cpp:
            (TextSlave::printSelection): Don't draw text at all, just draw a selection background.
            (RenderText::printObject): Draw in two passes. Draw the selection background in the
    	first pass, and the text in the second pass. That way pieces of the background won't
    	cover any other text or adornments, like underlines.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2334 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f450c41..d4d3874 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,17 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+	- fixed 3021713 -- text selection background obliterates descenders
+	(in www.theregister.co.uk articles)
+	- fixed 3038207 -- Selected link text doesn't draw its link underline
+
+        * khtml/rendering/render_text.cpp:
+        (TextSlave::printSelection): Don't draw text at all, just draw a selection background.
+        (RenderText::printObject): Draw in two passes. Draw the selection background in the
+	first pass, and the text in the second pass. That way pieces of the background won't
+	cover any other text or adornments, like underlines.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
         * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
 	Move the special case of a different anchor within the same
 	page into WebKit from here.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f450c41..d4d3874 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,17 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+	- fixed 3021713 -- text selection background obliterates descenders
+	(in www.theregister.co.uk articles)
+	- fixed 3038207 -- Selected link text doesn't draw its link underline
+
+        * khtml/rendering/render_text.cpp:
+        (TextSlave::printSelection): Don't draw text at all, just draw a selection background.
+        (RenderText::printObject): Draw in two passes. Draw the selection background in the
+	first pass, and the text in the second pass. That way pieces of the background won't
+	cover any other text or adornments, like underlines.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
         * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
 	Move the special case of a different anchor within the same
 	page into WebKit from here.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f450c41..d4d3874 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,17 @@
 2002-10-15  Darin Adler  <darin at apple.com>
 
+	- fixed 3021713 -- text selection background obliterates descenders
+	(in www.theregister.co.uk articles)
+	- fixed 3038207 -- Selected link text doesn't draw its link underline
+
+        * khtml/rendering/render_text.cpp:
+        (TextSlave::printSelection): Don't draw text at all, just draw a selection background.
+        (RenderText::printObject): Draw in two passes. Draw the selection background in the
+	first pass, and the text in the second pass. That way pieces of the background won't
+	cover any other text or adornments, like underlines.
+
+2002-10-15  Darin Adler  <darin at apple.com>
+
         * kwq/KWQKHTMLPartImpl.mm: (KWQKHTMLPartImpl::urlSelected):
 	Move the special case of a different anchor within the same
 	page into WebKit from here.
diff --git a/WebCore/khtml/rendering/render_text.cpp b/WebCore/khtml/rendering/render_text.cpp
index 4181de4..41576dd 100644
--- a/WebCore/khtml/rendering/render_text.cpp
+++ b/WebCore/khtml/rendering/render_text.cpp
@@ -44,13 +44,13 @@ void TextSlave::printSelection(const Font *f, RenderText *text, QPainter *p, Ren
     if(startPos < 0) startPos = 0;
 
     p->save();
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
     // Macintosh-style text highlighting is to draw with a particular background color, not invert.
     QColor textColor = style->color();
     QColor c = QPainter::selectedTextBackgroundColor();
     if (textColor == c)
         c = QColor(0xff - c.red(), 0xff - c.green(), 0xff - c.blue());
-    p->setPen(textColor);
+    p->setPen(c); // Don't draw text at all!
 #else
     QColor c = style->color();
     p->setPen(QColor(0xff-c.red(),0xff-c.green(),0xff-c.blue()));
@@ -76,7 +76,7 @@ void TextSlave::printDecoration( QPainter *pt, RenderText* p, int _tx, int _ty,
     if ( end )
         width -= p->paddingRight() + p->borderRight();
 
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
     // Use a special function for underlines to get the positioning exactly right.
     if(deco & UNDERLINE)
         pt->drawUnderlineForText(_tx, _ty + m_baseline, p->str->s + m_start, m_len);
@@ -158,7 +158,7 @@ FindSelectionResult TextSlave::checkSelectionPoint(int _x, int _y, int _tx, int
         return m_reversed ? SelectionPointAfterInLine : SelectionPointBeforeInLine;
     }
 
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
     // Floating point version needed for best results with Mac OS X text.
     float delta = _x - (_tx + m_x);
     float widths[m_len]; 
@@ -553,6 +553,18 @@ void RenderText::printObject( QPainter *p, int /*x*/, int y, int /*w*/, int h,
 
 	const Font *font = &style()->htmlFont();
 
+#if APPLE_CHANGES
+        // Do one pass for the selection, then another for the rest.
+        bool haveSelection = startPos != endPos && !isPrinting && selectionState() != SelectionNone;
+        int startLine = si;
+        for (int pass = 0; pass < (haveSelection ? 2 : 1); pass++) {
+            si = startLine;
+            
+            bool drawDecorations = !haveSelection || pass == 0;
+            bool drawSelectionBackground = haveSelection && pass == 0;
+            bool drawText = !haveSelection || pass == 1;
+#endif
+
         // run until we find one that is outside the range, then we
         // know we can stop
         do {
@@ -584,12 +596,19 @@ void RenderText::printObject( QPainter *p, int /*x*/, int y, int /*w*/, int h,
 		font = &_style->htmlFont();
 	    }
 
+#if APPLE_CHANGES
+            if (drawDecorations)
+#endif
             if((hasSpecialObjects()  &&
                 (parent()->isInline() || pseudoStyle)) &&
                (!pseudoStyle || s->m_firstLine))
                 s->printBoxDecorations(p, _style, this, tx, ty, si == 0, si == (int)m_lines.count()-1);
 
 
+#if APPLE_CHANGES
+            if (drawText) {
+#endif
+
             if(_style->color() != p->pen().color())
                 p->setPen(_style->color());
 
@@ -603,7 +622,15 @@ void RenderText::printObject( QPainter *p, int /*x*/, int y, int /*w*/, int h,
                 s->printDecoration(p, this, tx, ty, d, si == 0, si == ( int ) m_lines.count()-1);
             }
 
-            if (!isPrinting && (selectionState() != SelectionNone)) {
+#if APPLE_CHANGES
+            } // drawText
+#endif
+
+#if APPLE_CHANGES
+            if (drawSelectionBackground)
+#endif
+            if (!isPrinting && (selectionState() != SelectionNone))
+            {
 		int offset = s->m_start;
 		int sPos = QMAX( startPos - offset, 0 );
 		int ePos = QMIN( endPos - offset, s->m_len );
@@ -612,6 +639,10 @@ void RenderText::printObject( QPainter *p, int /*x*/, int y, int /*w*/, int h,
 		    s->printSelection(font, this, p, _style, tx, ty, sPos, ePos);
 
             }
+
+#if APPLE_CHANGES
+            if (drawText)
+#endif
             if(renderOutline) {
                 if(outlinebox_y == s->m_y) {
                     if(minx > s->m_x)  minx = s->m_x;
@@ -644,6 +675,10 @@ void RenderText::printObject( QPainter *p, int /*x*/, int y, int /*w*/, int h,
 
         } while (++si < (int)m_lines.count() && m_lines[si]->checkVerticalPoint(y-ow, ty, h, m_lineHeight));
 
+#if APPLE_CHANGES
+        } // end of for loop
+#endif
+
         if(renderOutline)
 	  {
 	    linerects.append(new QRect(minx, outlinebox_y, maxx-minx, m_lineHeight));
@@ -770,7 +805,7 @@ const QFont &RenderText::font()
 
 void RenderText::setText(DOMStringImpl *text, bool force)
 {
-#ifdef APPLE_CHANGES
+#if APPLE_CHANGES
     if (!text)
         return;
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list