diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-07-01 10:07:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-04 10:20:36 +0200 |
commit | 0e144ccbdc274016da279124af1367c71bac932d (patch) | |
tree | 1a1776f92ed1a1350ae1dcdc14580a94ce4f2cbe | |
parent | 58f505beb352c0cc15bd673f4a9f537032d54db0 (diff) | |
download | qtwebengine-chromium-0e144ccbdc274016da279124af1367c71bac932d.tar.gz |
Restore WebFrameContentDumper::DumpAsMarkup
Qt WebEngine is still using it.
Change-Id: I8f9aed97c06c8e38032b8c89161e1800f2169cde
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r-- | chromium/third_party/blink/public/web/web_frame_content_dumper.h | 4 | ||||
-rw-r--r-- | chromium/third_party/blink/renderer/core/exported/web_frame_content_dumper.cc | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/chromium/third_party/blink/public/web/web_frame_content_dumper.h b/chromium/third_party/blink/public/web/web_frame_content_dumper.h index acfb0bcd9cf..34d81f6f625 100644 --- a/chromium/third_party/blink/public/web/web_frame_content_dumper.h +++ b/chromium/third_party/blink/public/web/web_frame_content_dumper.h @@ -35,6 +35,10 @@ class WebString; // memory and CPU during a text capture. class WebFrameContentDumper { public: + // Returns HTML text for the contents of this frame, generated + // from the DOM. + BLINK_EXPORT static WebString DumpAsMarkup(WebLocalFrame* frame); + // Returns the contents of this frame's local subtree as a string. If the // text is longer than |max_chars|, it will be clipped to that length. BLINK_EXPORT static WebString DumpFrameTreeAsText(WebLocalFrame* frame, diff --git a/chromium/third_party/blink/renderer/core/exported/web_frame_content_dumper.cc b/chromium/third_party/blink/renderer/core/exported/web_frame_content_dumper.cc index c756d0ad26e..05668d2de5f 100644 --- a/chromium/third_party/blink/renderer/core/exported/web_frame_content_dumper.cc +++ b/chromium/third_party/blink/renderer/core/exported/web_frame_content_dumper.cc @@ -6,6 +6,7 @@ #include "third_party/blink/public/platform/web_string.h" #include "third_party/blink/public/web/web_local_frame.h" +#include "third_party/blink/renderer/core/editing/serializers/serialization.h" #include "third_party/blink/renderer/core/frame/frame_content_as_text.h" #include "third_party/blink/renderer/core/frame/local_frame.h" #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h" @@ -13,6 +14,12 @@ namespace blink { +WebString WebFrameContentDumper::DumpAsMarkup(WebLocalFrame* frame) { + if (!frame) + return WebString(); + return CreateMarkup(To<WebLocalFrameImpl>(frame)->GetFrame()->GetDocument()); +} + WebString WebFrameContentDumper::DumpFrameTreeAsText(WebLocalFrame* frame, size_t max_chars) { StringBuilder text; |