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

Unified Diff: sky/engine/core/html/HTMLIFrameElement.cpp

Issue 708903002: Initial work on a new <view> element backed by a mojo::View. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: m_URL 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
« no previous file with comments | « sky/engine/core/html/HTMLIFrameElement.h ('k') | sky/engine/core/html/HTMLIFrameElement.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/html/HTMLIFrameElement.cpp
diff --git a/sky/engine/core/html/HTMLIFrameElement.cpp b/sky/engine/core/html/HTMLIFrameElement.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..0885e331baf4509eb03eb9383c730ac4eba7c830
--- /dev/null
+++ b/sky/engine/core/html/HTMLIFrameElement.cpp
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/html/HTMLIFrameElement.h"
+
+#include "core/HTMLNames.h"
+#include "core/frame/LocalFrame.h"
+#include "core/html/parser/HTMLParserIdioms.h"
+#include "core/loader/FrameLoaderClient.h"
+#include "core/rendering/RenderRemote.h"
+
+namespace blink {
+
+PassRefPtr<HTMLIFrameElement> HTMLIFrameElement::create(Document& document)
+{
+ return adoptRef(new HTMLIFrameElement(document));
+}
+
+HTMLIFrameElement::HTMLIFrameElement(Document& document)
+ : HTMLElement(HTMLNames::iframeTag, document)
+{
+}
+
+HTMLIFrameElement::~HTMLIFrameElement()
+{
+}
+
+Node::InsertionNotificationRequest HTMLIFrameElement::insertedInto(ContainerNode* insertionPoint)
+{
+ InsertionNotificationRequest result = HTMLElement::insertedInto(insertionPoint);
+ if (insertionPoint->inDocument())
+ createView();
+ return result;
+}
+
+void HTMLIFrameElement::removedFrom(ContainerNode* insertionPoint)
+{
+ HTMLElement::removedFrom(insertionPoint);
+ if (insertionPoint->inDocument()) {
+ // TODO(mpcomplete): Tear down the mojo View.
+ }
+}
+
+RenderObject* HTMLIFrameElement::createRenderer(RenderStyle* style)
+{
+ return new RenderRemote(this);
+}
+
+void HTMLIFrameElement::createView()
+{
+ String urlString = stripLeadingAndTrailingHTMLSpaces(getAttribute(HTMLNames::srcAttr));
+ if (urlString.isEmpty())
+ urlString = blankURL().string();
+
+ LocalFrame* parentFrame = document().frame();
+ if (!parentFrame)
+ return;
+
+ KURL url = document().completeURL(urlString);
+ parentFrame->loaderClient()->createView(url);
+}
+
+}
« no previous file with comments | « sky/engine/core/html/HTMLIFrameElement.h ('k') | sky/engine/core/html/HTMLIFrameElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698