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

Side by Side Diff: sky/engine/core/rendering/RenderRemote.cpp

Issue 682413006: Add a separate call to initialize the bounds for a sky <iframe> element. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: . 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/rendering/RenderRemote.h" 7 #include "core/rendering/RenderRemote.h"
8 8
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/RemoteFrame.h"
10 #include "core/html/HTMLIFrameElement.h" 11 #include "core/html/HTMLIFrameElement.h"
12 #include "core/loader/FrameLoaderClient.h"
11 #include "core/rendering/PaintInfo.h" 13 #include "core/rendering/PaintInfo.h"
12 #include "platform/geometry/LayoutPoint.h" 14 #include "platform/geometry/LayoutPoint.h"
13 15
14 namespace blink { 16 namespace blink {
15 17
16 RenderRemote::RenderRemote(HTMLIFrameElement* view) 18 RenderRemote::RenderRemote(HTMLIFrameElement* iframe)
17 : RenderReplaced(view) 19 : RenderReplaced(iframe)
18 { 20 {
19 } 21 }
20 22
21 RenderRemote::~RenderRemote() 23 RenderRemote::~RenderRemote()
22 { 24 {
23 } 25 }
24 26
27 void RenderRemote::layout()
28 {
29 RenderReplaced::layout();
30
31 // TODO(mpcomplete): This will generate extra SetBounds calls in some cases
32 // because some layout modules involve multiple passes (e.g., flexbox).
33 // Instead, we'll need to defer the work to later in the pipeline.
34 HTMLIFrameElement* frame = toHTMLIFrameElement(node());
35 frame->contentFrame()->setBounds(pixelSnappedIntRect(frameRect()));
36 }
37
25 void RenderRemote::paintReplaced(PaintInfo& paintInfo, 38 void RenderRemote::paintReplaced(PaintInfo& paintInfo,
26 const LayoutPoint& paintOffset) { 39 const LayoutPoint& paintOffset)
40 {
27 // Draw a gray background. This should be painted over by the actual 41 // Draw a gray background. This should be painted over by the actual
28 // content. 42 // content.
29 // TODO(mpcomplete): figure out what we should actually do here. 43 // TODO(mpcomplete): figure out what we should actually do here.
30 GraphicsContext* context = paintInfo.context; 44 GraphicsContext* context = paintInfo.context;
31 45
32 IntRect paintRect = pixelSnappedIntRect(LayoutRect( 46 IntRect paintRect = pixelSnappedIntRect(LayoutRect(
33 paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight())); 47 paintOffset.x(), paintOffset.y(), contentWidth(), contentHeight()));
34 context->setStrokeStyle(SolidStroke); 48 context->setStrokeStyle(SolidStroke);
35 context->setStrokeColor(Color::lightGray); 49 context->setStrokeColor(Color::lightGray);
36 context->setFillColor(Color::darkGray); 50 context->setFillColor(Color::darkGray);
37 context->drawRect(paintRect); 51 context->drawRect(paintRect);
38 } 52 }
39 53
40 } // namespace blink 54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698