[webkit-dev] XHTML, XML and WebKit editing

Rob Burns robburns1 at mac.com
Thu Aug 24 12:33:37 PDT 2006


I  sent the following message to the sdk list, but perhaps this list  
is more appropriate. Briefly, when loading XHTML into an editable  
WebView, the contents are getting rearranged: moving elements from  
the HEAD to the BODY. I thought someone here might know where the  
code is located that does this editing of rhd source upon load. In  
addition to rearranging elements, the WebView is also removing "/"  
from self-closing elements. I

Originally,  was loading the file as HTML, but i've since corrected  
that but still encounter this bug.

(http://bugzilla.opendarwin.org/show_bug.cgi?id=10507)

Thanks for any assistance.

Rob



> I'm working on an application that uses WebKit's editing  
> capabilities. Though the headers show ample support for XHTML  
> concepts and Safari handles XHTML very well, the use of XHTML in an  
> editing situation seems to be difficult.
>
> 1) First of all, WebView immediately converts all elements in an  
> XHTML document to upper case, which is not consistent wit the  
> recommendation.
>
> 2) It also converts all self-closing elements to HTML style  
> implicitly closed elements.
>
> 3) WebView removes the DocType declaration and the XML declaration  
> from the document.
>
> I've found work-arounds for these unfortunate bugs, but now I'm  
> encounter more difficult problems. If an XHTML document includes  
> elements from another namespace in the head, WEbView graciously  
> moves them to the body element instead. The previous issues I  
> planed to just fix upon save, but now I can't work with non-XHTM  
> elements in the head whiole the document is editable by WebView  
> because WebView jmoves those  elements to where they do not belong.  
> I filed a bug report on this, (http://bugzilla.opendarwin.org/ 
> show_bug.cgi?id=10507).
>
> Has anyone else encountered these problems and found ways to work  
> around them. I'd like to get in there and fix them myself, but I'm  
> not that familiar with C++ and I'm still getting my head around the  
> vast array of classes. Any thoughts?
>
> best,
> Rob Burns




More information about the webkit-dev mailing list