Chromium Code Reviews| Index: sky/engine/core/rendering/RenderIFrame.cpp |
| diff --git a/sky/engine/core/rendering/RenderIFrame.cpp b/sky/engine/core/rendering/RenderIFrame.cpp |
| index 6d78270eee223f1266a1f26e43a70834bbbfe586..750df9ab2e347c5651933a2f9c2eba122673b5a9 100644 |
| --- a/sky/engine/core/rendering/RenderIFrame.cpp |
| +++ b/sky/engine/core/rendering/RenderIFrame.cpp |
| @@ -10,6 +10,7 @@ |
| #include "core/html/HTMLIFrameElement.h" |
| #include "core/loader/FrameLoaderClient.h" |
| #include "core/rendering/PaintInfo.h" |
| +#include "core/rendering/RenderView.h" |
| #include "platform/geometry/LayoutPoint.h" |
| namespace blink { |
| @@ -17,30 +18,32 @@ namespace blink { |
| RenderIFrame::RenderIFrame(HTMLIFrameElement* iframe) |
| : RenderReplaced(iframe) |
| { |
| + view()->addIFrame(this); |
| } |
| RenderIFrame::~RenderIFrame() |
| { |
| + if (view()) |
| + view()->removeIFrame(this); |
| } |
| -void RenderIFrame::layout() |
| +bool RenderIFrame::invalidateWidgetBounds() |
| { |
| - RenderReplaced::layout(); |
| - |
| - // TODO(mpcomplete): This will generate extra SetBounds calls in some cases |
| - // because some layout modules involve multiple passes (e.g., flexbox). |
| - // Instead, we'll need to defer the work to later in the pipeline. |
| mojo::View* contentView = toHTMLIFrameElement(node())->contentView(); |
| if (!contentView) |
| - return; |
| + return false; |
|
esprehn
2014/11/14 21:46:08
You only return false if there's no content view,
Matt Perry
2014/11/14 22:03:34
Done.
|
| IntRect bounds = pixelSnappedIntRect(frameRect()); |
| - mojo::Rect mojo_bounds; |
| - mojo_bounds.x = bounds.x(); |
| - mojo_bounds.y = bounds.y(); |
| - mojo_bounds.width = bounds.width(); |
| - mojo_bounds.height = bounds.height(); |
| - contentView->SetBounds(mojo_bounds); |
| + mojo::Rect mojoBounds; |
| + mojoBounds.x = bounds.x(); |
| + mojoBounds.y = bounds.y(); |
| + mojoBounds.width = bounds.width(); |
| + mojoBounds.height = bounds.height(); |
| + if (mojoBounds.Equals(contentView->bounds())) |
|
esprehn
2014/11/14 21:46:08
This should be inside View::SetBounds(const Rect&
|
| + return true; |
| + |
| + contentView->SetBounds(mojoBounds); |
| + return true; |
| } |
| void RenderIFrame::paintReplaced(PaintInfo& paintInfo, |