OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "wtf/Forward.h" | 30 #include "wtf/Forward.h" |
31 | 31 |
32 namespace blink { | 32 namespace blink { |
33 | 33 |
34 class Color; | 34 class Color; |
35 class Element; | 35 class Element; |
36 class LayoutRect; | 36 class LayoutRect; |
37 class LocalFrame; | 37 class LocalFrame; |
38 class Node; | 38 class Node; |
39 class Layer; | 39 class Layer; |
40 class RenderObject; | 40 class LayoutObject; |
41 class TextStream; | 41 class TextStream; |
42 | 42 |
43 enum LayoutAsTextBehaviorFlags { | 43 enum LayoutAsTextBehaviorFlags { |
44 LayoutAsTextBehaviorNormal = 0, | 44 LayoutAsTextBehaviorNormal = 0, |
45 LayoutAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that
would paint. | 45 LayoutAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that
would paint. |
46 LayoutAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists. | 46 LayoutAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists. |
47 LayoutAsTextShowCompositedLayers = 1 << 2, // Show which layers are composit
ed. | 47 LayoutAsTextShowCompositedLayers = 1 << 2, // Show which layers are composit
ed. |
48 LayoutAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses. | 48 LayoutAsTextShowAddresses = 1 << 3, // Show layer and renderer addresses. |
49 LayoutAsTextShowIDAndClass = 1 << 4, // Show id and class attributes | 49 LayoutAsTextShowIDAndClass = 1 << 4, // Show id and class attributes |
50 LayoutAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode. | 50 LayoutAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode. |
51 LayoutAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it sa
fe to call showLayerTree() from the debugger inside layout or painting code. | 51 LayoutAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it sa
fe to call showLayerTree() from the debugger inside layout or painting code. |
52 LayoutAsTextShowLayoutState = 1 << 7 // Print the various 'needs layout' bit
s on renderers. | 52 LayoutAsTextShowLayoutState = 1 << 7 // Print the various 'needs layout' bit
s on renderers. |
53 }; | 53 }; |
54 typedef unsigned LayoutAsTextBehavior; | 54 typedef unsigned LayoutAsTextBehavior; |
55 | 55 |
56 // You don't need pageWidthInPixels if you don't specify LayoutAsTextInPrintingM
ode. | 56 // You don't need pageWidthInPixels if you don't specify LayoutAsTextInPrintingM
ode. |
57 String externalRepresentation(LocalFrame*, LayoutAsTextBehavior = LayoutAsTextBe
haviorNormal); | 57 String externalRepresentation(LocalFrame*, LayoutAsTextBehavior = LayoutAsTextBe
haviorNormal); |
58 String externalRepresentation(Element*, LayoutAsTextBehavior = LayoutAsTextBehav
iorNormal); | 58 String externalRepresentation(Element*, LayoutAsTextBehavior = LayoutAsTextBehav
iorNormal); |
59 void write(TextStream&, const RenderObject&, int indent = 0, LayoutAsTextBehavio
r = LayoutAsTextBehaviorNormal); | 59 void write(TextStream&, const LayoutObject&, int indent = 0, LayoutAsTextBehavio
r = LayoutAsTextBehaviorNormal); |
60 | 60 |
61 class LayoutTreeAsText { | 61 class LayoutTreeAsText { |
62 // FIXME: This is a cheesy hack to allow easy access to RenderStyle colors. It
won't be needed if we convert | 62 // FIXME: This is a cheesy hack to allow easy access to RenderStyle colors. It
won't be needed if we convert |
63 // it to use visitedDependentColor instead. (This just involves rebaselining man
y results though, so for now it's | 63 // it to use visitedDependentColor instead. (This just involves rebaselining man
y results though, so for now it's |
64 // not being done). | 64 // not being done). |
65 public: | 65 public: |
66 static void writeRenderObject(TextStream&, const RenderObject&, LayoutAsTextBeha
vior); | 66 static void writeLayoutObject(TextStream&, const LayoutObject&, LayoutAsTextBeha
vior); |
67 static void writeLayers(TextStream&, const Layer* rootLayer, Layer*, const Layou
tRect& paintDirtyRect, int indent = 0, LayoutAsTextBehavior = LayoutAsTextBehavi
orNormal); | 67 static void writeLayers(TextStream&, const Layer* rootLayer, Layer*, const Layou
tRect& paintDirtyRect, int indent = 0, LayoutAsTextBehavior = LayoutAsTextBehavi
orNormal); |
68 }; | 68 }; |
69 | 69 |
70 // Helper function shared with SVGRenderTreeAsText | 70 // Helper function shared with SVGRenderTreeAsText |
71 String quoteAndEscapeNonPrintables(const String&); | 71 String quoteAndEscapeNonPrintables(const String&); |
72 | 72 |
73 String counterValueForElement(Element*); | 73 String counterValueForElement(Element*); |
74 | 74 |
75 String markerTextForListItem(Element*); | 75 String markerTextForListItem(Element*); |
76 | 76 |
77 String nodePositionAsStringForTesting(Node*); | 77 String nodePositionAsStringForTesting(Node*); |
78 | 78 |
79 TextStream& operator<<(TextStream&, const Color&); | 79 TextStream& operator<<(TextStream&, const Color&); |
80 | 80 |
81 } // namespace blink | 81 } // namespace blink |
82 | 82 |
83 #endif // LayoutTreeAsText_h | 83 #endif // LayoutTreeAsText_h |
OLD | NEW |