[Patch] new outline painting algorithm

Leo Savernik l.savernik at aon.at
Fri Sep 10 03:01:19 BST 2004


Hello,

Attached is a new outline painting algorithm that is able to draw outlines 
around any higher/lower inline box for the first/last line box. That way, 
images in links won't look like as if they've been cut through by the 
outline.

As this patch fixes outlines, new troubles were uncovered, namely the damage 
rectangle is too small, so that part of the outlines aren't painted (a 
primary example are Google's previous and next links). This bug is not caused 
by this patch, but has only been uncovered by it.

The method of outlining is (3) as described in outline.txt, as agreed with 
Tobias when we discussed the outlining issue.

The new algorithm is quite powerful in coalescing segments that have the same 
orientation, i. e. no more drawBorder calls are issued than necessary. Though 
I tried to merge the new and old algorithms, I had to finally replace the old 
one, as I wouldn't have been able to do the coalescing (hope you don't mind, 
Tobias ;-) ).

I'm off for the weekend and thus leaving the patch for review/comments. In the 
khtml regression-testsuite under 
khtmltests/regression/tests/css/outline*.html you'll find 20 testcases that 
demonstrate the abilities of the new algorithm. The baseline contains 
screenshots of how the outlines are to be drawn under 
khtmltests/regression/baseline/css/outline*.png

mfg
 Leo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khtml_outline_10.diff
Type: text/x-diff
Size: 24479 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040910/df10bc60/attachment.diff>
-------------- next part --------------
Darstellungsm�glichkeiten von Umrissen bei Inline-Elementen
-----------------------------------------------------------

1. Einbuchtungen in x-Richtung

                +-------+
                |. . . .|
       +--------+. Bild.+----------------------------------+
       | bla bla . . . . Erste InlineFlowBox   bla bla bla |
       +------------------+             +------------------+
                          |. . . . . . .|
                          |.           .|
                          |.  Gro�es   .|
                          |.           .|             +-------+
+-------------------------+.   Bild    .+-------------+. . . .+----+
| bla bla       Mittlere   . . . . . . . InlineFlowBox . Bild. bla |
+----+             +----------------------------------+. . . .+----+
+----+. . . . . . .+---------------------+            +-------+
| Bla . Noch ein  . Letzte InlineFlowBox |
+----+.   Bild    .+---------------------+
     |. . . . . . .|
     +-------------+

Zu kompliziert.


2. Einbuchtungen/Ausw�chse in y-Richtung auch bei mittleren Boxen

                +-------+
                |. . . .|
       +--------+. Bild.+----------------------------------+
       | bla bla . . . . Erste InlineFlowBox   bla bla bla |
       |                                                   |
       |                   . . . . . . .                   |
       |                   .           .                   |
       |                   .  Gro�es   .                   |
       |                   .           .                   +--+
+------+                   .   Bild    .               . . . .+----+
| bla bla       Mittlere   . . . . . . . InlineFlowBox . Bild. bla |
|                                        +------------+. . . .+----+
|     . . . . . . .                      |            +-------+
| Bla . Noch ein  . Letzte InlineFlowBox |
+----+.   Bild    .+---------------------+
     |. . . . . . .|
     +-------------+

Sieht sch�n aus, ist allerdings komplizierter zu implementieren.


3. Nur Einbuchtungen/Ausw�chse in y-Richtung bei begrenzenden Boxen

                +-------+
                |. . . .|
       +--------+. Bild.+----------------------------------+
       | bla bla . . . . Erste InlineFlowBox   bla bla bla |
+------+                                                   +-------+
|                          . . . . . . .                           |
|                          .           .                           |
|                          .  Gro�es   .                           |
|                          .           .                           |
|                          .   Bild    .               . . . .     |
| bla bla       Mittlere   . . . . . . . InlineFlowBox . Bild. bla |
|                                                      . . . .     |
|     . . . . . . .                      +-------------------------+
| Bla . Noch ein  . Letzte InlineFlowBox |
+----+.   Bild    .+---------------------+
     |. . . . . . .|
     +-------------+

Darstellung wie durch meinen Algorithmus beschrieben. Sieht nicht ganz so sch�n
aus, ist aber einfacher zu implementieren.

Viel Spa� dabei :-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040910/df10bc60/attachment.sig>


More information about the kfm-devel mailing list