[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    [PATCH] Re: Bug#22562: ordered list HTML tag "<ol>" does not recognize
From:       Michael Bedy <mjbedy () mediaone ! net>
Date:       2001-03-17 8:51:21
[Download RAW message or body]

I'm a little shaky on this portion of khtml. If someone could look at
this fix and make sure I got it right I would be greatful.

  If there are no problems, I will commit it.

    - Mike




On 17 Mar 2001 rpasserini@mediaone.net wrote:

> Package: khtml
> Version: KDE 2.1.0 
> Severity: normal
> Installed from:    SuSE RPMs
> Compiler:          Not Specified
> OS:                Linux
> OS/Compiler notes: Not Specified
> 
> This does not, but should work:
> 
> <ol start="123">
>   <li>This should be 123</li>
>   <li>This should be 124</li>
>   <li>This should be 125</li>
> <ol>
> 
> Instead of 123, 124, 125, they're 1, 2, 3
> 
> 
> 
> (Submitted via bugs.kde.org)
> 
> 

["orderedlists.diff" (TEXT/PLAIN)]

Index: html_listimpl.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_listimpl.cpp,v
retrieving revision 1.20
diff -u -r1.20 html_listimpl.cpp
--- html_listimpl.cpp	2001/01/21 16:06:18	1.20
+++ html_listimpl.cpp	2001/03/17 08:47:10
@@ -186,6 +186,21 @@
     }
 }
 
+void HTMLLIElementImpl::attach(KHTMLView *w)
+{
+    HTMLElementImpl::attach(w);
+
+    if (parentNode() && parentNode()->id() == ID_OL)
+    {
+        HTMLOListElementImpl *ol = static_cast<HTMLOListElementImpl *>(parentNode());
+        
+        if(ol->firstChild() && ol->firstChild() == this &&  m_render)
+           static_cast<RenderListItem*>(m_render)->setValue(ol->start());
+    }
+    
+}
+
+
 // -------------------------------------------------------------------------
 
 
Index: html_listimpl.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/html/html_listimpl.h,v
retrieving revision 1.15
diff -u -r1.15 html_listimpl.h
--- html_listimpl.h	2001/02/05 11:38:13	1.15
+++ html_listimpl.h	2001/03/17 08:47:10
@@ -125,6 +125,8 @@
     virtual tagStatus endTag() const { return LIEndTag; }
 
     virtual void parseAttribute(AttrImpl *attr);
+    
+    virtual void attach(KHTMLView *);
 };
 
 // -------------------------------------------------------------------------


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic