diff options
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r-- | webkit/glue/webframe_impl.cc | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc index dfdb7b3..36affe7 100644 --- a/webkit/glue/webframe_impl.cc +++ b/webkit/glue/webframe_impl.cc @@ -701,8 +701,7 @@ v8::Local<v8::Context> WebFrameImpl::mainWorldScriptContext() const { } #endif -bool WebFrameImpl::insertStyleText( - const WebString& css, const WebString& id) { +bool WebFrameImpl::insertStyleText(const WebString& css) { Document* document = frame()->document(); if (!document) return false; @@ -710,24 +709,9 @@ bool WebFrameImpl::insertStyleText( if (!document_element) return false; - ExceptionCode err = 0; - - if (!id.isEmpty()) { - WebCore::Element* old_element = - document->getElementById(webkit_glue::WebStringToString(id)); - if (old_element) { - Node* parent = old_element->parent(); - if (!parent) - return false; - parent->removeChild(old_element, err); - } - } - RefPtr<WebCore::Element> stylesheet = document->createElement( WebCore::HTMLNames::styleTag, false); - if (!id.isEmpty()) - stylesheet->setAttribute(WebCore::HTMLNames::idAttr, - webkit_glue::WebStringToString(id)); + ExceptionCode err = 0; stylesheet->setTextContent(webkit_glue::WebStringToString(css), err); DCHECK(!err) << "Failed to set style element content"; WebCore::Node* first = document_element->firstChild(); |