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

Unified Diff: sky/engine/core/dom/Document.cpp

Issue 1148253003: Add LayoutRoot (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Updated Created 5 years, 7 months 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/dom/Document.cpp
diff --git a/sky/engine/core/dom/Document.cpp b/sky/engine/core/dom/Document.cpp
index 2b37f28f7ecafc4db297bfb9f6979456130dc959..c643fe8964fec30a4991619b81adc57e52299c2d 100644
--- a/sky/engine/core/dom/Document.cpp
+++ b/sky/engine/core/dom/Document.cpp
@@ -253,6 +253,7 @@ Document::Document(const DocumentInit& initializer)
, m_templateDocumentHost(nullptr)
, m_hasViewportUnits(false)
, m_styleRecalcElementCounter(0)
+ , m_frameView(nullptr)
{
setClient(this);
@@ -332,13 +333,6 @@ Document::~Document()
InspectorCounters::decrementCounter(InspectorCounters::DocumentCounter);
}
-PassRefPtr<Document> Document::create(Document& document)
-{
- DocumentInit init = DocumentInit::fromContext(document.contextDocument())
- .withElementRegistry(document.elementRegistry());
- return adoptRef(new Document(init));
-}
-
#if !ENABLE(OILPAN)
void Document::dispose()
{
@@ -415,6 +409,11 @@ PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionS
return HTMLElementFactory::createElement(name, *this, false);
}
+PassRefPtr<Text> Document::createText(const String& text)
+{
+ return Text::create(*this, text);
+}
+
void Document::registerElement(const AtomicString& name, PassRefPtr<DartValue> type, ExceptionState& es)
{
m_elementRegistry->RegisterElement(name, type);
@@ -829,6 +828,8 @@ void Document::setStateForNewFormElements(const Vector<String>& stateVector)
FrameView* Document::view() const
{
+ if (m_frameView)
+ return m_frameView;
return m_frame ? m_frame->view() : 0;
}
@@ -904,7 +905,8 @@ void Document::scheduleRenderTreeUpdate()
void Document::scheduleVisualUpdate()
{
- page()->animator().scheduleVisualUpdate();
+ if (page())
+ page()->animator().scheduleVisualUpdate();
}
void Document::updateDistributionIfNeeded()

Powered by Google App Engine
This is Rietveld 408576698