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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 568 } |
569 } | 569 } |
570 | 570 |
571 ts << "\n"; | 571 ts << "\n"; |
572 | 572 |
573 if (paintPhase != LayerPaintPhaseBackground) | 573 if (paintPhase != LayerPaintPhaseBackground) |
574 write(ts, *l.renderer(), indent + 1, behavior); | 574 write(ts, *l.renderer(), indent + 1, behavior); |
575 } | 575 } |
576 | 576 |
577 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
RenderLayer* layer, | 577 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
RenderLayer* layer, |
578 const LayoutRect& paintRect, int indent, RenderAsTextBeh
avior behavior) | 578 const LayoutRect& paintRect, int indent, RenderAsTextBehavior behavior) |
579 { | 579 { |
580 // FIXME: Apply overflow to the root layer to not break every test. Complet
e hack. Sigh. | 580 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. |
581 LayoutRect paintDirtyRect(paintRect); | 581 LayoutRect paintDirtyRect(paintRect); |
582 if (rootLayer == layer) { | 582 if (rootLayer == layer) { |
583 paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLaye
r->renderBox()->layoutOverflowRect().maxX())); | 583 paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLaye
r->renderBox()->layoutOverflowRect().maxX())); |
584 paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLa
yer->renderBox()->layoutOverflowRect().maxY())); | 584 paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLa
yer->renderBox()->layoutOverflowRect().maxY())); |
585 layer->setSizeHackForRenderTreeAsText(layer->size().expandedTo(pixelSnap
pedIntSize(layer->renderBox()->maxLayoutOverflow(), LayoutPoint(0, 0)))); | |
586 } | 585 } |
587 | 586 |
588 // Calculate the clip rects we should use. | 587 // Calculate the clip rects we should use. |
589 LayoutRect layerBounds; | 588 LayoutRect layerBounds; |
590 ClipRect damageRect, clipRectToApply, outlineRect; | 589 ClipRect damageRect, clipRectToApply, outlineRect; |
591 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect); | 590 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintDirtyRect, layerBounds, damageRect, clipRectToApply, outlineRect); |
592 | 591 |
| 592 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. |
| 593 if (rootLayer == layer) |
| 594 layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(layer->
renderBox()->maxLayoutOverflow(), LayoutPoint(0, 0)))); |
| 595 |
593 // Ensure our lists are up-to-date. | 596 // Ensure our lists are up-to-date. |
594 layer->stackingNode()->updateLayerListsIfNeeded(); | 597 layer->stackingNode()->updateLayerListsIfNeeded(); |
595 | 598 |
596 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : layer->in
tersectsDamageRect(layerBounds, damageRect.rect(), rootLayer); | 599 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : layer->in
tersectsDamageRect(layerBounds, damageRect.rect(), rootLayer); |
597 | 600 |
598 Vector<RenderLayerStackingNode*>* negList = layer->stackingNode()->negZOrder
List(); | 601 Vector<RenderLayerStackingNode*>* negList = layer->stackingNode()->negZOrder
List(); |
599 bool paintsBackgroundSeparately = negList && negList->size() > 0; | 602 bool paintsBackgroundSeparately = negList && negList->size() > 0; |
600 if (shouldPaint && paintsBackgroundSeparately) | 603 if (shouldPaint && paintsBackgroundSeparately) |
601 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, outlineRect.rect(), LayerPaintPhaseBackground, indent, behavior); | 604 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, outlineRect.rect(), LayerPaintPhaseBackground, indent, behavior); |
602 | 605 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 element->document().updateLayout(); | 774 element->document().updateLayout(); |
772 | 775 |
773 RenderObject* renderer = element->renderer(); | 776 RenderObject* renderer = element->renderer(); |
774 if (!renderer || !renderer->isListItem()) | 777 if (!renderer || !renderer->isListItem()) |
775 return String(); | 778 return String(); |
776 | 779 |
777 return toRenderListItem(renderer)->markerText(); | 780 return toRenderListItem(renderer)->markerText(); |
778 } | 781 } |
779 | 782 |
780 } // namespace blink | 783 } // namespace blink |
OLD | NEW |