XML rendering [IRC Channel]

Dave Hyatt hyatt at apple.com
Sat Jun 5 19:52:36 CEST 2004


Seems like you should push this fix down behind setAttributeNS, right?  
You want to make sure that function does the right thing for HTML 
elements when the URI is the XHTML namespace...

dave

On Jun 5, 2004, at 8:19 AM, Zack Rusin wrote:

> On Saturday 05 June 2004 09:18, Leo Savernik wrote:
>> Though, the attached testcase still doesn't work in khtml (throws
>> some "null object" error. Is getElementsByTagName not impl'd for
>> xml?). Compare to Mozilla to check what the testcase should do.
>
> Oh, cool, good one :)
>
> I need to merge some of my local changes, but one of the worst problems
> right now is the lack of style detection in the xhtml documents for xml
> elements. Check the enclosed testcase.
>
> I can easily fix the elements with inlined style by just adding the
> following patch to the xml tokenizer:
>
> --- xml/xml_tokenizer.cpp       2 Jun 2004 17:47:52 -0000       1.52
> +++ xml/xml_tokenizer.cpp       5 Jun 2004 15:14:45 -0000
> @@ -29,6 +29,7 @@
>  #include "rendering/render_object.h"
>  #include "misc/htmltags.h"
>  #include "misc/htmlattrs.h"
> +#include "misc/htmlhashes.h"
>  #include "misc/loader.h"
>
>  #include "khtmlview.h"
> @@ -149,7 +150,17 @@ bool XMLHandler::startElement( const QSt
>          DOMString uri(atts.uri(i));
>          DOMString qn(atts.qName(i));
>          DOMString val(atts.value(i));
> -        newElement->setAttributeNS(uri, qn, val, exceptioncode);
> +
> +        if ( newElement->isHTMLElement() ) {
> +            int exceptioncode = 0;
> +            QCString str = qn.string().utf8();
> +            unsigned int a = getAttrID( str, str.length() );
> +            newElement->setAttribute( a, val, qn, exceptioncode );
> +        } else {
> +            newElement->setAttributeNS( uri, qn, val, exceptioncode );
> +        }
> +
>          if (exceptioncode) // exception setting attributes
>              return false;
>      }
>
> But this is not optimal and still leaves the problem of the predefined
> style for div id="data" element. Any ideas?
>
> And btw, let me remind everyone that we do have a very low traffic
> #khtml irc channel on freenode with essentially only the few kde
> developers you see on this list. We'd love to see some Apple and
> Omnigroup developers there (ties and shirts not required, but about 21"
> in bicep strongly recommended ;) ).
>
> Zack
>
> -- 
> The reason we nerds dominate is . . . Oh, wait, Is that beer?
> <demo2.xml>_______________________________________________
> Khtml-devel at kde.org
> https://mail.kde.org/mailman/listinfo/khtml-devel



More information about the Khtml-devel mailing list