Commit 8598e702 authored by jan.koester's avatar jan.koester
Browse files

added script element handling

parent cf78c93c
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -658,6 +658,9 @@ void libhtmlpp::HtmlElement::insertChild(const libhtmlpp::Element* el){
        case CommentEl:
            _childElement=new CommentElement;
            break;
        case ScriptEL:
            _childElement=new ScriptElement;
            break;
        default:
            HTMLException ex;
            ex[HTMLException::Critical] << "appendChild: Unknown html element found: "<< el->getType() << " !";
@@ -689,6 +692,9 @@ void libhtmlpp::HtmlElement::appendChild(const libhtmlpp::Element* el){
                case CommentEl:
                    curel=new CommentElement;
                    break;
                case ScriptEL:
                    curel=new ScriptElement;
                    break;
                default:
                    HTMLException ex;
                    ex[HTMLException::Critical] << "appendChild: Unknown html element found: "<< el->getType() << " !";
@@ -842,6 +848,9 @@ NEWEL:
                    case CommentEl:
                        ((libhtmlpp::HtmlElement*)dest)->_childElement = new CommentElement;
                        break;
                    case ScriptEL:
                        ((libhtmlpp::HtmlElement*)dest)->_childElement = new ScriptElement;
                        break;
                    default:
                        HTMLException ex;
                        ex[HTMLException::Critical] << "_copy: Unknown html element found !";
@@ -856,6 +865,8 @@ NEWEL:
            ((TextElement*)dest)->_Text=(((TextElement*)src)->_Text);
        }else if(src->getType()==libhtmlpp::CommentEl && dest->getType()== libhtmlpp::CommentEl){
            ((CommentElement*)dest)->_Comment=(((CommentElement*)src)->_Comment);
        }else if(src->getType()==libhtmlpp::ScriptEL && dest->getType()== libhtmlpp::ScriptEL){
            ((ScriptElement*)dest)->_Script=(((ScriptElement*)src)->_Script);
        }

        dest->_firstElement=firstdest;
@@ -876,6 +887,9 @@ NEWEL:
                case CommentEl:
                    dest->_nextElement= new CommentElement();
                    break;
               case ScriptEL:
                    dest->_nextElement= new ScriptElement();
                    break;
                default:
                    HTMLException ex;
                    ex[HTMLException::Critical] << "_copy: Unknown next html element found !";