| 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 15 matching lines...) Expand all Loading... |
| 26 #ifndef LayoutTreeAsText_h | 26 #ifndef LayoutTreeAsText_h |
| 27 #define LayoutTreeAsText_h | 27 #define LayoutTreeAsText_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "platform/text/TextStream.h" | 30 #include "platform/text/TextStream.h" |
| 31 #include "wtf/Forward.h" | 31 #include "wtf/Forward.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class Color; | 35 class Color; |
| 36 class DeprecatedPaintLayer; |
| 36 class Element; | 37 class Element; |
| 37 class LayoutRect; | 38 class LayoutRect; |
| 38 class LocalFrame; | 39 class LocalFrame; |
| 39 class Node; | 40 class Node; |
| 40 class DeprecatedPaintLayer; | 41 class LayoutBlockFlow; |
| 41 class LayoutObject; | 42 class LayoutObject; |
| 42 class TextStream; | 43 class TextStream; |
| 43 | 44 |
| 44 enum LayoutAsTextBehaviorFlags { | 45 enum LayoutAsTextBehaviorFlags { |
| 45 LayoutAsTextBehaviorNormal = 0, | 46 LayoutAsTextBehaviorNormal = 0, |
| 46 LayoutAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that
would paint. | 47 LayoutAsTextShowAllLayers = 1 << 0, // Dump all layers, not just those that
would paint. |
| 47 LayoutAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists. | 48 LayoutAsTextShowLayerNesting = 1 << 1, // Annotate the layer lists. |
| 48 LayoutAsTextShowCompositedLayers = 1 << 2, // Show which layers are composit
ed. | 49 LayoutAsTextShowCompositedLayers = 1 << 2, // Show which layers are composit
ed. |
| 49 LayoutAsTextShowAddresses = 1 << 3, // Show layer and layoutObject addresses
. | 50 LayoutAsTextShowAddresses = 1 << 3, // Show layer and layoutObject addresses
. |
| 50 LayoutAsTextShowIDAndClass = 1 << 4, // Show id and class attributes | 51 LayoutAsTextShowIDAndClass = 1 << 4, // Show id and class attributes |
| 51 LayoutAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode. | 52 LayoutAsTextPrintingMode = 1 << 5, // Dump the tree in printing mode. |
| 52 LayoutAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it sa
fe to call showLayerTree() from the debugger inside layout or painting code. | 53 LayoutAsTextDontUpdateLayout = 1 << 6, // Don't update layout, to make it sa
fe to call showLayerTree() from the debugger inside layout or painting code. |
| 53 LayoutAsTextShowLayoutState = 1 << 7 // Print the various 'needs layout' bit
s on layoutObjects. | 54 LayoutAsTextShowLayoutState = 1 << 7, // Print the various 'needs layout' bi
ts on layoutObjects. |
| 55 LayoutAsTextShowLineTrees = 1 << 8 // Dump the line trees for each LayoutBlo
ckFlow. |
| 54 }; | 56 }; |
| 55 typedef unsigned LayoutAsTextBehavior; | 57 typedef unsigned LayoutAsTextBehavior; |
| 56 | 58 |
| 57 // You don't need pageWidthInPixels if you don't specify LayoutAsTextInPrintingM
ode. | 59 // You don't need pageWidthInPixels if you don't specify LayoutAsTextInPrintingM
ode. |
| 58 CORE_EXPORT String externalRepresentation(LocalFrame*, LayoutAsTextBehavior = La
youtAsTextBehaviorNormal); | 60 CORE_EXPORT String externalRepresentation(LocalFrame*, LayoutAsTextBehavior = La
youtAsTextBehaviorNormal); |
| 59 CORE_EXPORT String externalRepresentation(Element*, LayoutAsTextBehavior = Layou
tAsTextBehaviorNormal); | 61 CORE_EXPORT String externalRepresentation(Element*, LayoutAsTextBehavior = Layou
tAsTextBehaviorNormal); |
| 60 void write(TextStream&, const LayoutObject&, int indent = 0, LayoutAsTextBehavio
r = LayoutAsTextBehaviorNormal); | 62 void write(TextStream&, const LayoutObject&, int indent = 0, LayoutAsTextBehavio
r = LayoutAsTextBehaviorNormal); |
| 61 | 63 |
| 62 class LayoutTreeAsText { | 64 class LayoutTreeAsText { |
| 63 // FIXME: This is a cheesy hack to allow easy access to ComputedStyle colors. I
t won't be needed if we convert | 65 // FIXME: This is a cheesy hack to allow easy access to ComputedStyle colors. I
t won't be needed if we convert |
| 64 // it to use visitedDependentColor instead. (This just involves rebaselining man
y results though, so for now it's | 66 // it to use visitedDependentColor instead. (This just involves rebaselining man
y results though, so for now it's |
| 65 // not being done). | 67 // not being done). |
| 66 public: | 68 public: |
| 67 static void writeLayoutObject(TextStream&, const LayoutObject&, LayoutAsTextBeha
vior); | 69 static void writeLayoutObject(TextStream&, const LayoutObject&, LayoutAsTextBeha
vior); |
| 68 static void writeLayers(TextStream&, const DeprecatedPaintLayer* rootLayer, Depr
ecatedPaintLayer*, const LayoutRect& paintDirtyRect, int indent = 0, LayoutAsTex
tBehavior = LayoutAsTextBehaviorNormal); | 70 static void writeLayers(TextStream&, const DeprecatedPaintLayer* rootLayer, Depr
ecatedPaintLayer*, const LayoutRect& paintDirtyRect, int indent = 0, LayoutAsTex
tBehavior = LayoutAsTextBehaviorNormal); |
| 71 static void writeLineBoxTree(TextStream&, const LayoutBlockFlow&, int indent = 0
); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 // Helper function shared with SVGLayoutTreeAsText | 74 // Helper function shared with SVGLayoutTreeAsText |
| 72 String quoteAndEscapeNonPrintables(const String&); | 75 String quoteAndEscapeNonPrintables(const String&); |
| 73 | 76 |
| 74 CORE_EXPORT String counterValueForElement(Element*); | 77 CORE_EXPORT String counterValueForElement(Element*); |
| 75 | 78 |
| 76 CORE_EXPORT String markerTextForListItem(Element*); | 79 CORE_EXPORT String markerTextForListItem(Element*); |
| 77 | 80 |
| 78 CORE_EXPORT String nodePositionAsStringForTesting(Node*); | 81 CORE_EXPORT String nodePositionAsStringForTesting(Node*); |
| 79 | 82 |
| 80 TextStream& operator<<(TextStream&, const Color&); | 83 TextStream& operator<<(TextStream&, const Color&); |
| 81 | 84 |
| 82 } // namespace blink | 85 } // namespace blink |
| 83 | 86 |
| 84 #endif // LayoutTreeAsText_h | 87 #endif // LayoutTreeAsText_h |
| OLD | NEW |