提交 f36e7b49 编写于 作者: O Ojan Vafai

Assorted cleanup of RenderLayer.

-Move perspectiveOrigin to RenderBox. It's only used in
one place and called on a RenderBox.
-Inline some methods that were just calling out to the renderer.
-Inline updateStackingNode() into the constructor and remove
the branch since requiresStackingNode is always true.
-Delete a bunch of dead code.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/961053002
上级 a3eeb226
...@@ -281,6 +281,17 @@ FloatQuad RenderBox::absoluteContentQuad() const ...@@ -281,6 +281,17 @@ FloatQuad RenderBox::absoluteContentQuad() const
return localToAbsoluteQuad(FloatRect(rect)); return localToAbsoluteQuad(FloatRect(rect));
} }
FloatPoint RenderBox::perspectiveOrigin() const
{
if (!hasTransform())
return FloatPoint();
const LayoutRect borderBox = borderBoxRect();
return FloatPoint(
floatValueForLength(style()->perspectiveOriginX(), borderBox.width().toFloat()),
floatValueForLength(style()->perspectiveOriginY(), borderBox.height().toFloat()));
}
void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderBox*) const void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& additionalOffset, const RenderBox*) const
{ {
if (!size().isEmpty()) if (!size().isEmpty())
...@@ -835,7 +846,7 @@ void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPainting ...@@ -835,7 +846,7 @@ void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPainting
} }
} }
if (layer()->isTransparent()) { if (isTransparent()) {
context->save(); context->save();
LayoutRect clipRect = intersection(paintingInfo.paintDirtyRect, LayoutRect clipRect = intersection(paintingInfo.paintDirtyRect,
transparencyClipBox(layer(), localPaintingInfo.rootLayer, localPaintingInfo.subPixelAccumulation)); transparencyClipBox(layer(), localPaintingInfo.rootLayer, localPaintingInfo.subPixelAccumulation));
...@@ -873,7 +884,7 @@ void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPainting ...@@ -873,7 +884,7 @@ void RenderBox::paintLayerContents(GraphicsContext* context, const LayerPainting
layer()->restoreClip(context, localPaintingInfo.paintDirtyRect, contentRect); layer()->restoreClip(context, localPaintingInfo.paintDirtyRect, contentRect);
if (layer()->isTransparent()) { if (isTransparent()) {
context->endLayer(); context->endLayer();
context->restore(); context->restore();
} }
......
...@@ -172,6 +172,8 @@ public: ...@@ -172,6 +172,8 @@ public:
// The content box converted to absolute coords (taking transforms into account). // The content box converted to absolute coords (taking transforms into account).
FloatQuad absoluteContentQuad() const; FloatQuad absoluteContentQuad() const;
FloatPoint perspectiveOrigin() const;
// This returns the content area of the box (excluding padding and border). The only difference with contentBoxRect is that computedCSSContentBoxRect // This returns the content area of the box (excluding padding and border). The only difference with contentBoxRect is that computedCSSContentBoxRect
// does include the intrinsic padding in the content box as this is what some callers expect (like getComputedStyle). // does include the intrinsic padding in the content box as this is what some callers expect (like getComputedStyle).
LayoutRect computedCSSContentBoxRect() const { return LayoutRect(borderLeft() + computedCSSPaddingLeft(), borderTop() + computedCSSPaddingTop(), clientWidth() - computedCSSPaddingLeft() - computedCSSPaddingRight(), clientHeight() - computedCSSPaddingTop() - computedCSSPaddingBottom()); } LayoutRect computedCSSContentBoxRect() const { return LayoutRect(borderLeft() + computedCSSPaddingLeft(), borderTop() + computedCSSPaddingTop(), clientWidth() - computedCSSPaddingLeft() - computedCSSPaddingRight(), clientHeight() - computedCSSPaddingTop() - computedCSSPaddingBottom()); }
......
...@@ -92,8 +92,7 @@ RenderLayer::RenderLayer(RenderBox* renderer, LayerType type) ...@@ -92,8 +92,7 @@ RenderLayer::RenderLayer(RenderBox* renderer, LayerType type)
, m_last(0) , m_last(0)
, m_clipper(*renderer) , m_clipper(*renderer)
{ {
updateStackingNode(); m_stackingNode = adoptPtr(new RenderLayerStackingNode(this));
m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); m_isSelfPaintingLayer = shouldBeSelfPaintingLayer();
} }
...@@ -102,33 +101,15 @@ RenderLayer::~RenderLayer() ...@@ -102,33 +101,15 @@ RenderLayer::~RenderLayer()
removeFilterInfoIfNeeded(); removeFilterInfoIfNeeded();
} }
String RenderLayer::debugName() const
{
return renderer()->debugName();
}
LayoutSize RenderLayer::subpixelAccumulation() const
{
return m_subpixelAccumulation;
}
void RenderLayer::setSubpixelAccumulation(const LayoutSize& size)
{
m_subpixelAccumulation = size;
}
void RenderLayer::updateLayerPositionsAfterLayout() void RenderLayer::updateLayerPositionsAfterLayout()
{ {
TRACE_EVENT0("blink", "RenderLayer::updateLayerPositionsAfterLayout");
m_clipper.clearClipRectsIncludingDescendants(); m_clipper.clearClipRectsIncludingDescendants();
} }
void RenderLayer::updateTransformationMatrix() void RenderLayer::updateTransformationMatrix()
{ {
if (m_transform) { if (m_transform) {
RenderBox* box = renderBox(); RenderBox* box = renderer();
ASSERT(box);
m_transform->makeIdentity(); m_transform->makeIdentity();
box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin); box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin);
// FIXME(sky): We shouldn't need to do this once Skia has 4x4 matrix support. // FIXME(sky): We shouldn't need to do this once Skia has 4x4 matrix support.
...@@ -166,38 +147,6 @@ void RenderLayer::updateTransform(const RenderStyle* oldStyle, RenderStyle* newS ...@@ -166,38 +147,6 @@ void RenderLayer::updateTransform(const RenderStyle* oldStyle, RenderStyle* newS
dirty3DTransformedDescendantStatus(); dirty3DTransformedDescendantStatus();
} }
static RenderLayer* enclosingLayerForContainingBlock(RenderLayer* layer)
{
if (RenderObject* containingBlock = layer->renderer()->containingBlock())
return containingBlock->enclosingLayer();
return 0;
}
RenderLayer* RenderLayer::renderingContextRoot()
{
RenderLayer* renderingContext = 0;
if (shouldPreserve3D())
renderingContext = this;
for (RenderLayer* current = enclosingLayerForContainingBlock(this); current && current->shouldPreserve3D(); current = enclosingLayerForContainingBlock(current))
renderingContext = current;
return renderingContext;
}
RenderLayer* RenderLayer::enclosingOverflowClipLayer(IncludeSelfOrNot includeSelf) const
{
const RenderLayer* layer = (includeSelf == IncludeSelf) ? this : parent();
while (layer) {
if (layer->renderer()->hasOverflowClip())
return const_cast<RenderLayer*>(layer);
layer = layer->parent();
}
return 0;
}
void RenderLayer::dirty3DTransformedDescendantStatus() void RenderLayer::dirty3DTransformedDescendantStatus()
{ {
RenderLayerStackingNode* stackingNode = m_stackingNode->ancestorStackingContextNode(); RenderLayerStackingNode* stackingNode = m_stackingNode->ancestorStackingContextNode();
...@@ -241,14 +190,9 @@ bool RenderLayer::update3DTransformedDescendantStatus() ...@@ -241,14 +190,9 @@ bool RenderLayer::update3DTransformedDescendantStatus()
IntSize RenderLayer::size() const IntSize RenderLayer::size() const
{ {
if (renderer()->isInline() && renderer()->isRenderInline())
return toRenderInline(renderer())->linesBoundingBox().size();
// FIXME: Is snapping the size really needed here? // FIXME: Is snapping the size really needed here?
if (RenderBox* box = renderBox()) RenderBox* box = renderer();
return pixelSnappedIntSize(box->size(), box->location()); return pixelSnappedIntSize(box->size(), box->location());
return IntSize();
} }
LayoutPoint RenderLayer::location() const LayoutPoint RenderLayer::location() const
...@@ -261,8 +205,8 @@ LayoutPoint RenderLayer::location() const ...@@ -261,8 +205,8 @@ LayoutPoint RenderLayer::location() const
IntRect lineBox = inlineFlow->linesBoundingBox(); IntRect lineBox = inlineFlow->linesBoundingBox();
inlineBoundingBoxOffset = toSize(lineBox.location()); inlineBoundingBoxOffset = toSize(lineBox.location());
localPoint += inlineBoundingBoxOffset; localPoint += inlineBoundingBoxOffset;
} else if (RenderBox* box = renderBox()) { } else {
localPoint += box->locationOffset(); localPoint += renderer()->locationOffset();
} }
if (!renderer()->isOutOfFlowPositioned() && renderer()->parent()) { if (!renderer()->isOutOfFlowPositioned() && renderer()->parent()) {
...@@ -285,47 +229,6 @@ LayoutPoint RenderLayer::location() const ...@@ -285,47 +229,6 @@ LayoutPoint RenderLayer::location() const
return localPoint; return localPoint;
} }
TransformationMatrix RenderLayer::perspectiveTransform() const
{
if (!renderer()->hasTransform())
return TransformationMatrix();
RenderStyle* style = renderer()->style();
if (!style->hasPerspective())
return TransformationMatrix();
// Maybe fetch the perspective from the backing?
const IntRect borderBox = renderer()->pixelSnappedBorderBoxRect();
const float boxWidth = borderBox.width();
const float boxHeight = borderBox.height();
float perspectiveOriginX = floatValueForLength(style->perspectiveOriginX(), boxWidth);
float perspectiveOriginY = floatValueForLength(style->perspectiveOriginY(), boxHeight);
// A perspective origin of 0,0 makes the vanishing point in the center of the element.
// We want it to be in the top-left, so subtract half the height and width.
perspectiveOriginX -= boxWidth / 2.0f;
perspectiveOriginY -= boxHeight / 2.0f;
TransformationMatrix t;
t.translate(perspectiveOriginX, perspectiveOriginY);
t.applyPerspective(style->perspective());
t.translate(-perspectiveOriginX, -perspectiveOriginY);
return t;
}
FloatPoint RenderLayer::perspectiveOrigin() const
{
if (!renderer()->hasTransform())
return FloatPoint();
const LayoutRect borderBox = renderer()->borderBoxRect();
RenderStyle* style = renderer()->style();
return FloatPoint(floatValueForLength(style->perspectiveOriginX(), borderBox.width().toFloat()), floatValueForLength(style->perspectiveOriginY(), borderBox.height().toFloat()));
}
RenderLayer* RenderLayer::enclosingPositionedAncestor() const RenderLayer* RenderLayer::enclosingPositionedAncestor() const
{ {
RenderLayer* curr = parent(); RenderLayer* curr = parent();
...@@ -527,14 +430,6 @@ void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR ...@@ -527,14 +430,6 @@ void RenderLayer::convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutR
rect.move(-delta.x(), -delta.y()); rect.move(-delta.x(), -delta.y());
} }
void RenderLayer::updateStackingNode()
{
if (requiresStackingNode())
m_stackingNode = adoptPtr(new RenderLayerStackingNode(this));
else
m_stackingNode = nullptr;
}
static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLayer) static bool inContainingBlockChain(RenderLayer* startLayer, RenderLayer* endLayer)
{ {
if (startLayer == endLayer) if (startLayer == endLayer)
...@@ -617,8 +512,7 @@ LayoutRect RenderLayer::logicalBoundingBox() const ...@@ -617,8 +512,7 @@ LayoutRect RenderLayer::logicalBoundingBox() const
if (renderer()->isInline() && renderer()->isRenderInline()) { if (renderer()->isInline() && renderer()->isRenderInline()) {
result = toRenderInline(renderer())->linesVisualOverflowBoundingBox(); result = toRenderInline(renderer())->linesVisualOverflowBoundingBox();
} else { } else {
RenderBox* box = renderBox(); RenderBox* box = renderer();
ASSERT(box);
result = box->borderBoxRect(); result = box->borderBoxRect();
result.unite(box->visualOverflowRect()); result.unite(box->visualOverflowRect());
} }
...@@ -716,22 +610,12 @@ bool RenderLayer::shouldBeSelfPaintingLayer() const ...@@ -716,22 +610,12 @@ bool RenderLayer::shouldBeSelfPaintingLayer() const
return m_layerType == NormalLayer; return m_layerType == NormalLayer;
} }
bool RenderLayer::hasBoxDecorationsOrBackground() const
{
return renderer()->style()->hasBoxDecorations() || renderer()->style()->hasBackground();
}
bool RenderLayer::hasVisibleBoxDecorations() const
{
return hasBoxDecorationsOrBackground();
}
void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
{ {
if (!newStyle->hasFilter() && (!oldStyle || !oldStyle->hasFilter())) if (!newStyle->hasFilter() && (!oldStyle || !oldStyle->hasFilter()))
return; return;
if (!hasFilter()) { if (!renderer()->hasFilter()) {
removeFilterInfoIfNeeded(); removeFilterInfoIfNeeded();
return; return;
} }
......
...@@ -73,11 +73,7 @@ public: ...@@ -73,11 +73,7 @@ public:
RenderLayer(RenderBox*, LayerType); RenderLayer(RenderBox*, LayerType);
~RenderLayer(); ~RenderLayer();
String debugName() const;
RenderBox* renderer() const { return m_renderer; } RenderBox* renderer() const { return m_renderer; }
// FIXME(sky): Remove
RenderBox* renderBox() const { return m_renderer; }
RenderLayer* parent() const { return m_parent; } RenderLayer* parent() const { return m_parent; }
RenderLayer* previousSibling() const { return m_previous; } RenderLayer* previousSibling() const { return m_previous; }
RenderLayer* nextSibling() const { return m_next; } RenderLayer* nextSibling() const { return m_next; }
...@@ -91,14 +87,9 @@ public: ...@@ -91,14 +87,9 @@ public:
void insertOnlyThisLayer(); void insertOnlyThisLayer();
void styleChanged(StyleDifference, const RenderStyle* oldStyle); void styleChanged(StyleDifference, const RenderStyle* oldStyle);
// FIXME: Many people call this function while it has out-of-date information.
bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; }
void setLayerType(LayerType layerType) { m_layerType = layerType; } void setLayerType(LayerType layerType) { m_layerType = layerType; }
bool isTransparent() const { return renderer()->isTransparent(); }
const RenderLayer* root() const const RenderLayer* root() const
{ {
const RenderLayer* curr = this; const RenderLayer* curr = this;
...@@ -109,30 +100,20 @@ public: ...@@ -109,30 +100,20 @@ public:
LayoutPoint location() const; LayoutPoint location() const;
IntSize size() const; IntSize size() const;
LayoutRect rect() const { return LayoutRect(location(), size()); } LayoutRect rect() const { return LayoutRect(location(), size()); }
bool isRootLayer() const { return m_isRootLayer; } bool isRootLayer() const { return m_isRootLayer; }
void updateLayerPositionsAfterLayout(); void updateLayerPositionsAfterLayout();
void updateTransformationMatrix(); void updateTransformationMatrix();
RenderLayer* renderingContextRoot();
RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); } RenderLayerStackingNode* stackingNode() { return m_stackingNode.get(); }
const RenderLayerStackingNode* stackingNode() const { return m_stackingNode.get(); } const RenderLayerStackingNode* stackingNode() const { return m_stackingNode.get(); }
bool hasBoxDecorationsOrBackground() const;
bool hasVisibleBoxDecorations() const;
// True if this layer container renderers that paint.
bool hasNonEmptyChildRenderers() const;
// Gets the nearest enclosing positioned ancestor layer (also includes // Gets the nearest enclosing positioned ancestor layer (also includes
// the <html> layer and the root layer). // the <html> layer and the root layer).
RenderLayer* enclosingPositionedAncestor() const; RenderLayer* enclosingPositionedAncestor() const;
RenderLayer* enclosingOverflowClipLayer(IncludeSelfOrNot = IncludeSelf) const;
const RenderLayer* compositingContainer() const; const RenderLayer* compositingContainer() const;
void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) const; void convertToLayerCoords(const RenderLayer* ancestorLayer, LayoutPoint&) const;
...@@ -144,25 +125,11 @@ public: ...@@ -144,25 +125,11 @@ public:
// Bounding box relative to some ancestor layer. Pass offsetFromRoot if known. // Bounding box relative to some ancestor layer. Pass offsetFromRoot if known.
LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot = 0) const; LayoutRect physicalBoundingBox(const RenderLayer* ancestorLayer, const LayoutPoint* offsetFromRoot = 0) const;
LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const RenderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const; LayoutRect physicalBoundingBoxIncludingReflectionAndStackingChildren(const RenderLayer* ancestorLayer, const LayoutPoint& offsetFromRoot) const;
// If true, this layer's children are included in its bounds for overlap testing.
// We can't rely on the children's positions if this layer has a filter that could have moved the children's pixels around.
bool overlapBoundsIncludeChildren() const { return hasFilter() && renderer()->style()->filter().hasFilterThatMovesPixels(); }
LayoutRect boundingBoxForCompositing(const RenderLayer* ancestorLayer = 0) const; LayoutRect boundingBoxForCompositing(const RenderLayer* ancestorLayer = 0) const;
LayoutSize subpixelAccumulation() const;
void setSubpixelAccumulation(const LayoutSize&);
bool hasTransform() const { return renderer()->hasTransform(); }
// This transform has the transform-origin baked in. // This transform has the transform-origin baked in.
TransformationMatrix* transform() const { return m_transform.get(); } TransformationMatrix* transform() const { return m_transform.get(); }
// Get the perspective transform, which is applied to transformed sublayers.
// Returns true if the layer has a -webkit-perspective.
// Note that this transform has the perspective-origin baked in.
TransformationMatrix perspectiveTransform() const;
FloatPoint perspectiveOrigin() const;
bool preserves3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; } bool preserves3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; }
bool has3DTransform() const { return m_transform && !m_transform->isAffine(); } bool has3DTransform() const { return m_transform && !m_transform->isAffine(); }
...@@ -173,8 +140,6 @@ public: ...@@ -173,8 +140,6 @@ public:
// FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959 // FIXME: reflections should force transform-style to be flat in the style: https://bugs.webkit.org/show_bug.cgi?id=106959
bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; } bool shouldPreserve3D() const { return renderer()->style()->transformStyle3D() == TransformStyle3DPreserve3D; }
bool hasFilter() const { return renderer()->hasFilter(); }
void* operator new(size_t); void* operator new(size_t);
// Only safe to call from RenderBox::destroyLayer() // Only safe to call from RenderBox::destroyLayer()
void operator delete(void*); void operator delete(void*);
...@@ -196,16 +161,13 @@ public: ...@@ -196,16 +161,13 @@ public:
bool hasFilterInfo() const { return m_hasFilterInfo; } bool hasFilterInfo() const { return m_hasFilterInfo; }
void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo; } void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo; }
void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle);
RenderLayerClipper& clipper() { return m_clipper; } RenderLayerClipper& clipper() { return m_clipper; }
const RenderLayerClipper& clipper() const { return m_clipper; } const RenderLayerClipper& clipper() const { return m_clipper; }
inline bool isPositionedContainer() const inline bool isPositionedContainer() const
{ {
// FIXME: This is not in sync with containingBlock. // FIXME: This is not in sync with containingBlock.
RenderBox* layerRenderer = renderer(); return isRootLayer() || renderer()->isPositioned() || renderer()->hasTransform();
return isRootLayer() || layerRenderer->isPositioned() || hasTransform();
} }
void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius); void clipToRect(const LayerPaintingInfo&, GraphicsContext*, const ClipRect&, BorderRadiusClippingRule = IncludeSelfForBorderRadius);
...@@ -220,14 +182,9 @@ private: ...@@ -220,14 +182,9 @@ private:
void setFirstChild(RenderLayer* first) { m_first = first; } void setFirstChild(RenderLayer* first) { m_first = first; }
void setLastChild(RenderLayer* last) { m_last = last; } void setLastChild(RenderLayer* last) { m_last = last; }
LayoutPoint renderBoxLocation() const { return renderer()->location(); }
bool shouldBeSelfPaintingLayer() const; bool shouldBeSelfPaintingLayer() const;
// FIXME: We should only create the stacking node if needed. void updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle);
bool requiresStackingNode() const { return true; }
void updateStackingNode();
void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle); void updateTransform(const RenderStyle* oldStyle, RenderStyle* newStyle);
void dirty3DTransformedDescendantStatus(); void dirty3DTransformedDescendantStatus();
...@@ -260,8 +217,6 @@ private: ...@@ -260,8 +217,6 @@ private:
RenderLayerClipper m_clipper; // FIXME: Lazily allocate? RenderLayerClipper m_clipper; // FIXME: Lazily allocate?
OwnPtr<RenderLayerStackingNode> m_stackingNode; OwnPtr<RenderLayerStackingNode> m_stackingNode;
LayoutSize m_subpixelAccumulation; // The accumulated subpixel offset of a composited layer's composited bounds compared to absolute coordinates.
}; };
} // namespace blink } // namespace blink
......
...@@ -1432,7 +1432,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject ...@@ -1432,7 +1432,7 @@ void RenderObject::getTransformFromContainer(const RenderObject* containerObject
if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) { if (containerObject && containerObject->hasLayer() && containerObject->style()->hasPerspective()) {
// Perpsective on the container affects us, so we have to factor it in here. // Perpsective on the container affects us, so we have to factor it in here.
ASSERT(containerObject->hasLayer()); ASSERT(containerObject->hasLayer());
FloatPoint perspectiveOrigin = toRenderBox(containerObject)->layer()->perspectiveOrigin(); FloatPoint perspectiveOrigin = toRenderBox(containerObject)->perspectiveOrigin();
TransformationMatrix perspectiveMatrix; TransformationMatrix perspectiveMatrix;
perspectiveMatrix.applyPerspective(containerObject->style()->perspective()); perspectiveMatrix.applyPerspective(containerObject->style()->perspective());
......
...@@ -356,8 +356,6 @@ static void write(TextStream& ts, RenderLayer& l, ...@@ -356,8 +356,6 @@ static void write(TextStream& ts, RenderLayer& l,
if (!adjustedClipRect.contains(adjustedLayoutBounds)) if (!adjustedClipRect.contains(adjustedLayoutBounds))
ts << " clip " << adjustedClipRect; ts << " clip " << adjustedClipRect;
} }
if (l.isTransparent())
ts << " transparent";
ts << "\n"; ts << "\n";
write(ts, *l.renderer(), indent + 1, behavior); write(ts, *l.renderer(), indent + 1, behavior);
...@@ -369,8 +367,8 @@ void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer, ...@@ -369,8 +367,8 @@ void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
// FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh. // FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh.
LayoutRect paintDirtyRect(paintRect); LayoutRect paintDirtyRect(paintRect);
if (rootLayer == layer) { if (rootLayer == layer) {
paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLayer->renderBox()->layoutOverflowRect().maxX())); paintDirtyRect.setWidth(max<LayoutUnit>(paintDirtyRect.width(), rootLayer->renderer()->layoutOverflowRect().maxX()));
paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLayer->renderBox()->layoutOverflowRect().maxY())); paintDirtyRect.setHeight(max<LayoutUnit>(paintDirtyRect.height(), rootLayer->renderer()->layoutOverflowRect().maxY()));
} }
// Calculate the clip rects we should use. // Calculate the clip rects we should use.
...@@ -380,7 +378,7 @@ void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer, ...@@ -380,7 +378,7 @@ void RenderTreeAsText::writeLayers(TextStream& ts, const RenderLayer* rootLayer,
// FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh. // FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh.
if (rootLayer == layer) if (rootLayer == layer)
layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(layer->renderBox()->maxLayoutOverflow(), LayoutPoint(0, 0)))); layerBounds.setSize(layer->size().expandedTo(pixelSnappedIntSize(layer->renderer()->maxLayoutOverflow(), LayoutPoint(0, 0))));
// Ensure our lists are up-to-date. // Ensure our lists are up-to-date.
layer->stackingNode()->updateLayerListsIfNeeded(); layer->stackingNode()->updateLayerListsIfNeeded();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册