OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebFrameContentDumper_h |
| 6 #define WebFrameContentDumper_h |
| 7 |
| 8 #include "public/platform/WebCommon.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class WebLocalFrame; |
| 13 class WebString; |
| 14 |
| 15 // Functions in this class should only be used for |
| 16 // testing purposes. |
| 17 // The exceptions to this rule are tracked in http://crbug.com/585164. |
| 18 class WebFrameContentDumper { |
| 19 public: |
| 20 // Control of layoutTreeAsText output |
| 21 enum LayoutAsTextControl { |
| 22 LayoutAsTextNormal = 0, |
| 23 LayoutAsTextDebug = 1 << 0, |
| 24 LayoutAsTextPrinting = 1 << 1, |
| 25 LayoutAsTextWithLineTrees = 1 << 2 |
| 26 }; |
| 27 typedef unsigned LayoutAsTextControls; |
| 28 |
| 29 // Returns the contents of this frame as a string. If the text is |
| 30 // longer than maxChars, it will be clipped to that length. WARNING: |
| 31 // This function may be slow depending on the number of characters |
| 32 // retrieved and page complexity. For a typically sized page, expect |
| 33 // it to take on the order of milliseconds. |
| 34 // |
| 35 // If there is room, subframe text will be recursively appended. Each |
| 36 // frame will be separated by an empty line. |
| 37 BLINK_EXPORT static WebString dumpFrameTreeAsText(WebLocalFrame*, size_t max
Chars); |
| 38 |
| 39 // Returns HTML text for the contents of this frame, generated |
| 40 // from the DOM. |
| 41 BLINK_EXPORT static WebString dumpAsMarkup(WebLocalFrame*); |
| 42 |
| 43 // Returns a text representation of the render tree. This method is used |
| 44 // to support layout tests. |
| 45 BLINK_EXPORT static WebString dumpLayoutTreeAsText(WebLocalFrame*, LayoutAsT
extControls toShow = LayoutAsTextNormal); |
| 46 }; |
| 47 |
| 48 } // namespace blink |
| 49 |
| 50 #endif |
OLD | NEW |