Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2098)

Unified Diff: sky/engine/core/rendering/RenderIFrame.cpp

Issue 730653002: Sky: update the HTMLIFrameElement's geometry during paint invalidation rather (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: null check Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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,

Powered by Google App Engine
This is Rietveld 408576698