diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-13 13:24:50 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-10-14 10:57:25 +0000 |
commit | af3d4809763ef308f08ced947a73b624729ac7ea (patch) | |
tree | 4402b911e30383f6c6dace1e8cf3b8e85355db3a /chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp | |
parent | 0e8ff63a407fe323e215bb1a2c423c09a4747c8a (diff) | |
download | qtwebengine-chromium-af3d4809763ef308f08ced947a73b624729ac7ea.tar.gz |
BASELINE: Update Chromium to 47.0.2526.14
Also adding in sources needed for spellchecking.
Change-Id: Idd44170fa1616f26315188970a8d5ba7d472b18a
Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp')
-rw-r--r-- | chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp | 48 |
1 files changed, 5 insertions, 43 deletions
diff --git a/chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp b/chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp index 51d555e32c9..34bc016e83c 100644 --- a/chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp @@ -82,7 +82,7 @@ #include "core/dom/Document.h" #include "core/dom/DocumentType.h" #include "core/dom/Element.h" -#include "core/editing/markup.h" +#include "core/editing/serializers/Serialization.h" #include "core/html/HTMLAllCollection.h" #include "core/html/HTMLElement.h" #include "core/html/HTMLFormElement.h" @@ -425,14 +425,11 @@ void WebPageSerializerImpl::buildContentForNode(Node* node, } WebPageSerializerImpl::WebPageSerializerImpl(WebFrame* frame, - bool recursiveSerialization, WebPageSerializerClient* client, const WebVector<WebURL>& links, const WebVector<WebString>& localPaths, const WebString& localDirectoryName) : m_client(client) - , m_recursiveSerialization(recursiveSerialization) - , m_framesCollected(false) , m_localDirectoryName(localDirectoryName) , m_htmlEntities(false) , m_xmlEntities(true) @@ -453,51 +450,16 @@ WebPageSerializerImpl::WebPageSerializerImpl(WebFrame* frame, ASSERT(m_dataBuffer.isEmpty()); } -void WebPageSerializerImpl::collectTargetFrames() -{ - ASSERT(!m_framesCollected); - m_framesCollected = true; - - // First, process main frame. - m_frames.append(m_specifiedWebLocalFrameImpl); - // Return now if user only needs to serialize specified frame, not including - // all sub-frames. - if (!m_recursiveSerialization) - return; - // Collect all frames inside the specified frame. - for (WebLocalFrameImpl* frame : m_frames) { - // Get current using document. - Document* currentDoc = frame->frame()->document(); - // Go through sub-frames. - RefPtrWillBeRawPtr<HTMLAllCollection> all = currentDoc->all(); - - for (unsigned i = 0; Element* element = all->item(i); ++i) { - if (!element->isHTMLElement()) - continue; - WebLocalFrameImpl* webFrame = - WebLocalFrameImpl::fromFrameOwnerElement(element); - if (webFrame) - m_frames.append(webFrame); - } - } -} - bool WebPageSerializerImpl::serialize() { - if (!m_framesCollected) - collectTargetFrames(); - bool didSerialization = false; KURL mainURL = m_specifiedWebLocalFrameImpl->frame()->document()->url(); - for (unsigned i = 0; i < m_frames.size(); ++i) { - WebLocalFrameImpl* webFrame = m_frames[i]; - Document* document = webFrame->frame()->document(); - const KURL& url = document->url(); - - if (!url.isValid() || !m_localLinks.contains(url.string())) - continue; + WebLocalFrameImpl* webFrame = m_specifiedWebLocalFrameImpl; + Document* document = webFrame->frame()->document(); + const KURL& url = document->url(); + if (url.isValid() && m_localLinks.contains(url.string())) { didSerialization = true; const WTF::TextEncoding& textEncoding = document->encoding().isValid() ? document->encoding() : UTF8Encoding(); |