| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 ts << static_cast<const void*>(&l) << " "; | 349 ts << static_cast<const void*>(&l) << " "; |
| 350 | 350 |
| 351 ts << adjustedLayoutBounds; | 351 ts << adjustedLayoutBounds; |
| 352 | 352 |
| 353 if (!adjustedLayoutBounds.isEmpty()) { | 353 if (!adjustedLayoutBounds.isEmpty()) { |
| 354 if (!adjustedBackgroundClipRect.contains(adjustedLayoutBounds)) | 354 if (!adjustedBackgroundClipRect.contains(adjustedLayoutBounds)) |
| 355 ts << " backgroundClip " << adjustedBackgroundClipRect; | 355 ts << " backgroundClip " << adjustedBackgroundClipRect; |
| 356 if (!adjustedClipRect.contains(adjustedLayoutBounds)) | 356 if (!adjustedClipRect.contains(adjustedLayoutBounds)) |
| 357 ts << " clip " << adjustedClipRect; | 357 ts << " clip " << adjustedClipRect; |
| 358 } | 358 } |
| 359 if (l.isTransparent()) | |
| 360 ts << " transparent"; | |
| 361 | 359 |
| 362 ts << "\n"; | 360 ts << "\n"; |
| 363 write(ts, *l.renderer(), indent + 1, behavior); | 361 write(ts, *l.renderer(), indent + 1, behavior); |
| 364 } | 362 } |
| 365 | 363 |
| 366 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
RenderLayer* layer, | 364 void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
RenderLayer* layer, |
| 367 const LayoutRect& paintRect, int indent, RenderAsTextBehavior behavior) | 365 const LayoutRect& paintRect, int indent, RenderAsTextBehavior behavior) |
| 368 { | 366 { |
| 369 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. | 367 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. |
| 370 LayoutRect paintDirtyRect(paintRect); | 368 LayoutRect paintDirtyRect(paintRect); |
| 371 if (rootLayer == layer) { | 369 if (rootLayer == layer) { |
| 372 paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLaye
r->renderBox()->layoutOverflowRect().maxX())); | 370 paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLaye
r->renderer()->layoutOverflowRect().maxX())); |
| 373 paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLa
yer->renderBox()->layoutOverflowRect().maxY())); | 371 paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLa
yer->renderer()->layoutOverflowRect().maxY())); |
| 374 } | 372 } |
| 375 | 373 |
| 376 // Calculate the clip rects we should use. | 374 // Calculate the clip rects we should use. |
| 377 LayoutRect layerBounds; | 375 LayoutRect layerBounds; |
| 378 ClipRect damageRect, clipRectToApply; | 376 ClipRect damageRect, clipRectToApply; |
| 379 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintDirtyRect, layerBounds, damageRect, clipRectToApply); | 377 layer->clipper().calculateRects(ClipRectsContext(rootLayer, UncachedClipRect
s), paintDirtyRect, layerBounds, damageRect, clipRectToApply); |
| 380 | 378 |
| 381 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. | 379 // FIXME: Apply overflow to the root layer to not break every test. Complete
hack. Sigh. |
| 382 if (rootLayer == layer) | 380 if (rootLayer == layer) |
| 383 layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(layer->
renderBox()->maxLayoutOverflow(), LayoutPoint(0, 0)))); | 381 layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(layer->
renderer()->maxLayoutOverflow(), LayoutPoint(0, 0)))); |
| 384 | 382 |
| 385 // Ensure our lists are up-to-date. | 383 // Ensure our lists are up-to-date. |
| 386 layer->stackingNode()->updateLayerListsIfNeeded(); | 384 layer->stackingNode()->updateLayerListsIfNeeded(); |
| 387 | 385 |
| 388 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : layer->in
tersectsDamageRect(layerBounds, damageRect.rect(), rootLayer); | 386 bool shouldPaint = (behavior & RenderAsTextShowAllLayers) ? true : layer->in
tersectsDamageRect(layerBounds, damageRect.rect(), rootLayer); |
| 389 | 387 |
| 390 if (shouldPaint) | 388 if (shouldPaint) |
| 391 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, indent, behavior); | 389 write(ts, *layer, layerBounds, damageRect.rect(), clipRectToApply.rect()
, indent, behavior); |
| 392 | 390 |
| 393 if (Vector<RenderLayerStackingNode*>* normalFlowList = layer->stackingNode()
->normalFlowList()) { | 391 if (Vector<RenderLayerStackingNode*>* normalFlowList = layer->stackingNode()
->normalFlowList()) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 element->document().updateLayout(); | 493 element->document().updateLayout(); |
| 496 | 494 |
| 497 RenderObject* renderer = element->renderer(); | 495 RenderObject* renderer = element->renderer(); |
| 498 if (!renderer || !renderer->isBox()) | 496 if (!renderer || !renderer->isBox()) |
| 499 return String(); | 497 return String(); |
| 500 | 498 |
| 501 return externalRepresentation(toRenderBox(renderer), behavior | RenderAsText
ShowAllLayers); | 499 return externalRepresentation(toRenderBox(renderer), behavior | RenderAsText
ShowAllLayers); |
| 502 } | 500 } |
| 503 | 501 |
| 504 } // namespace blink | 502 } // namespace blink |
| OLD | NEW |