Version: (using KDE KDE 3.5.2) Installed from: Compiled From Sources Compiler: GCC 3.4.6 OS: Linux Empty DOM #text nodes cannot be set by javascript DOM nodeValue method. In details i can be set, but they aren't rendered. Try http://www.astral.lodz.pl/~hannibal/nodeValue.html a use "Show DOM" tool. When you set first DIV #text node with initial value everything is OK. But any changes make second DIV with empty #text are invisible on rendered page. This same situation occurs when page is accesed through javascript.
Created an attachment (id=15722) [details] text node value settig fix I found that the cause of this bug is missing renderer object in empty (whitespace) text node. This patch fix this problem by creating this object when new value isn't whitespace. Take a close look to this code because I found used in it functions accidentaly, and I only guess their purpose only by their name :P
I know that you have many bugs to view, and low time, but I send week ago patch which fix bug I found. You should take litte more attention to people that want help you in your work. I don't expect that my patch will be added whitout changes (or added at all), but any comment will be appreciated. Couple words how I can improve this patch, some criticsm that I apply changes in wrong place or something like that. Sorry for OT and spaming your mailboxes.
Please don't fustrate if there is not immediate action. We are drouwning bug reports as you suspected.
SVN commit 535371 by carewolf: If we saved creating a renderer at attach. Create it if we later need it. BUG:125715 M +0 -1 dom_nodeimpl.cpp M +13 -9 dom_textimpl.cpp --- branches/KDE/3.5/kdelibs/khtml/xml/dom_nodeimpl.cpp #535370:535371 @@ -925,7 +925,6 @@ return; #endif - assert(!attached()); assert(!m_render); NodeImpl *parent = parentNode(); --- branches/KDE/3.5/kdelibs/khtml/xml/dom_textimpl.cpp #535370:535371 @@ -384,17 +384,17 @@ if (!onlyWS) { return true; } - + RenderObject *par = parentNode()->renderer(); - + if (par->isTable() || par->isTableRow() || par->isTableSection()) { return false; } - + if (style->preserveWS() || style->preserveLF()) { return true; } - + if (par->isInline()) { // <span><div/> <div/></span> RenderObject *prev = previousRenderer(); @@ -406,7 +406,7 @@ if (par->isRenderBlock() && !par->childrenInline() && (!prev || !prev->isInline())) { return false; } - + RenderObject *first = par->firstChild(); RenderObject *next = nextRenderer(); if (!first || next == first) { @@ -415,7 +415,7 @@ return false; } } - + return true; } @@ -438,6 +438,10 @@ void TextImpl::recalcStyle( StyleChange change ) { // qDebug("textImpl::recalcStyle"); + // Create renderer if now needed + if ( changed() && !m_render) { + createRendererIfNeeded(); + } if (change != NoChange && parentNode()) { // qDebug("DomText::recalcStyle"); if(m_render) @@ -461,9 +465,9 @@ DOMStringImpl* TextImpl::renderString() const { - if (renderer()) + if (renderer()) return static_cast<RenderText*>(renderer())->string(); - else + else return string(); } @@ -481,7 +485,7 @@ if(endOffset >=0 || startOffset >0) str = str.copy(); //we are going to modify this, so make a copy. I hope I'm doing this right. if(endOffset >= 0) - str.truncate(endOffset); + str.truncate(endOffset); if(startOffset > 0) //note the order of these 2 'if' statements so that it works right when n==m_startContainer==m_endContainer str.remove(0, startOffset); return escapeHTML( str );
You need to log in before you can comment on or make changes to this bug.