OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 << ")"; | 635 << ")"; |
636 } | 636 } |
637 } | 637 } |
638 | 638 |
639 ts << "\n"; | 639 ts << "\n"; |
640 | 640 |
641 if (paintPhase != LayerPaintPhaseBackground) | 641 if (paintPhase != LayerPaintPhaseBackground) |
642 write(ts, *layer.layoutObject(), indent + 1, behavior); | 642 write(ts, *layer.layoutObject(), indent + 1, behavior); |
643 } | 643 } |
644 | 644 |
| 645 static Vector<DeprecatedPaintLayerStackingNode*> normalFlowListFor(DeprecatedPai
ntLayerStackingNode* node) |
| 646 { |
| 647 DeprecatedPaintLayerStackingNodeIterator it(*node, NormalFlowChildren); |
| 648 Vector<DeprecatedPaintLayerStackingNode*> vector; |
| 649 while (DeprecatedPaintLayerStackingNode* normalFlowChild = it.next()) |
| 650 vector.append(normalFlowChild); |
| 651 return vector; |
| 652 } |
| 653 |
645 void LayoutTreeAsText::writeLayers(TextStream& ts, const DeprecatedPaintLayer* r
ootLayer, DeprecatedPaintLayer* layer, | 654 void LayoutTreeAsText::writeLayers(TextStream& ts, const DeprecatedPaintLayer* r
ootLayer, DeprecatedPaintLayer* layer, |
646 const LayoutRect& paintRect, int indent, LayoutAsTextBehavior behavior) | 655 const LayoutRect& paintRect, int indent, LayoutAsTextBehavior behavior) |
647 { | 656 { |
648 // Calculate the clip rects we should use. | 657 // Calculate the clip rects we should use. |
649 LayoutRect layerBounds; | 658 LayoutRect layerBounds; |
650 ClipRect damageRect, clipRectToApply, outlineRect; | 659 ClipRect damageRect, clipRectToApply, outlineRect; |
651 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintRect, layerBounds, damageRect, clipRectToApply, outlineRect); | 660 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintRect, layerBounds, damageRect, clipRectToApply, outlineRect); |
652 | 661 |
653 // Ensure our lists are up-to-date. | 662 // Ensure our lists are up-to-date. |
654 layer->stackingNode()->updateLayerListsIfNeeded(); | 663 layer->stackingNode()->updateLayerListsIfNeeded(); |
(...skipping 12 matching lines...) Expand all Loading... |
667 ts << " negative z-order list(" << negList->size() << ")\n"; | 676 ts << " negative z-order list(" << negList->size() << ")\n"; |
668 ++currIndent; | 677 ++currIndent; |
669 } | 678 } |
670 for (unsigned i = 0; i != negList->size(); ++i) | 679 for (unsigned i = 0; i != negList->size(); ++i) |
671 writeLayers(ts, rootLayer, negList->at(i)->layer(), paintRect, currI
ndent, behavior); | 680 writeLayers(ts, rootLayer, negList->at(i)->layer(), paintRect, currI
ndent, behavior); |
672 } | 681 } |
673 | 682 |
674 if (shouldPaint) | 683 if (shouldPaint) |
675 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, outlineRect.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : L
ayerPaintPhaseAll, indent, behavior); | 684 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, outlineRect.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : L
ayerPaintPhaseAll, indent, behavior); |
676 | 685 |
677 if (Vector<DeprecatedPaintLayerStackingNode*>* normalFlowList = layer->stack
ingNode()->normalFlowList()) { | 686 Vector<DeprecatedPaintLayerStackingNode*> normalFlowList = normalFlowListFor
(layer->stackingNode()); |
| 687 if (!normalFlowList.isEmpty()) { |
678 int currIndent = indent; | 688 int currIndent = indent; |
679 if (behavior & LayoutAsTextShowLayerNesting) { | 689 if (behavior & LayoutAsTextShowLayerNesting) { |
680 writeIndent(ts, indent); | 690 writeIndent(ts, indent); |
681 ts << " normal flow list(" << normalFlowList->size() << ")\n"; | 691 ts << " normal flow list(" << normalFlowList.size() << ")\n"; |
682 ++currIndent; | 692 ++currIndent; |
683 } | 693 } |
684 for (unsigned i = 0; i != normalFlowList->size(); ++i) | 694 for (unsigned i = 0; i != normalFlowList.size(); ++i) |
685 writeLayers(ts, rootLayer, normalFlowList->at(i)->layer(), paintRect
, currIndent, behavior); | 695 writeLayers(ts, rootLayer, normalFlowList.at(i)->layer(), paintRect,
currIndent, behavior); |
686 } | 696 } |
687 | 697 |
688 if (Vector<DeprecatedPaintLayerStackingNode*>* posList = layer->stackingNode
()->posZOrderList()) { | 698 if (Vector<DeprecatedPaintLayerStackingNode*>* posList = layer->stackingNode
()->posZOrderList()) { |
689 int currIndent = indent; | 699 int currIndent = indent; |
690 if (behavior & LayoutAsTextShowLayerNesting) { | 700 if (behavior & LayoutAsTextShowLayerNesting) { |
691 writeIndent(ts, indent); | 701 writeIndent(ts, indent); |
692 ts << " positive z-order list(" << posList->size() << ")\n"; | 702 ts << " positive z-order list(" << posList->size() << ")\n"; |
693 ++currIndent; | 703 ++currIndent; |
694 } | 704 } |
695 for (unsigned i = 0; i != posList->size(); ++i) | 705 for (unsigned i = 0; i != posList->size(); ++i) |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 element->document().updateLayout(); | 842 element->document().updateLayout(); |
833 | 843 |
834 LayoutObject* layoutObject = element->layoutObject(); | 844 LayoutObject* layoutObject = element->layoutObject(); |
835 if (!layoutObject || !layoutObject->isListItem()) | 845 if (!layoutObject || !layoutObject->isListItem()) |
836 return String(); | 846 return String(); |
837 | 847 |
838 return toLayoutListItem(layoutObject)->markerText(); | 848 return toLayoutListItem(layoutObject)->markerText(); |
839 } | 849 } |
840 | 850 |
841 } // namespace blink | 851 } // namespace blink |
OLD | NEW |