Chromium Code Reviews| Index: sky/engine/core/dom/Element.cpp |
| diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp |
| index 20666a14ae90a52322bf29b283cc87931fe3bdca..b1c611c1cc80acab40268215d638acfba24280f2 100644 |
| --- a/sky/engine/core/dom/Element.cpp |
| +++ b/sky/engine/core/dom/Element.cpp |
| @@ -73,11 +73,13 @@ |
| #include "sky/engine/core/html/HTMLTemplateElement.h" |
| #include "sky/engine/core/html/parser/HTMLDocumentParser.h" |
| #include "sky/engine/core/html/parser/HTMLParserIdioms.h" |
| +#include "sky/engine/core/layout/LayoutCallback.h" |
| #include "sky/engine/core/page/ChromeClient.h" |
| #include "sky/engine/core/page/FocusController.h" |
| #include "sky/engine/core/page/Page.h" |
| #include "sky/engine/core/painting/PaintingCallback.h" |
| #include "sky/engine/core/painting/PaintingTasks.h" |
| +#include "sky/engine/core/rendering/RenderCustomLayout.h" |
| #include "sky/engine/core/rendering/RenderLayer.h" |
| #include "sky/engine/core/rendering/RenderView.h" |
| #include "sky/engine/platform/EventDispatchForbiddenScope.h" |
| @@ -632,6 +634,8 @@ const AtomicString Element::imageSourceURL() const |
| RenderObject* Element::createRenderer(RenderStyle* style) |
| { |
| + if (m_layoutManager) |
| + return new RenderCustomLayout(this); |
| return RenderObject::createObject(this, style); |
| } |
| @@ -891,6 +895,68 @@ ShadowRoot* Element::shadowRoot() const |
| return elementShadow->shadowRoot(); |
| } |
| +double Element::x() const |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->x(); |
| + return 0; |
| +} |
| + |
| +void Element::setX(double x) |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->setX(x); |
| +} |
| + |
| +double Element::y() const |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->y(); |
| + return 0; |
| +} |
| + |
| +void Element::setY(double y) |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->setY(y); |
| +} |
| + |
| +double Element::width() const |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->width(); |
| + return 0; |
| +} |
| + |
| +void Element::setWidth(double width) |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->setWidth(width); |
| +} |
| + |
| +double Element::height() const |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->height(); |
| + return 0; |
| +} |
| + |
| +void Element::setHeight(double height) |
| +{ |
| + if (RenderBox* box = renderBox()) |
| + return box->setHeight(height); |
| +} |
| + |
| +LayoutCallback* Element::layoutManager() const |
| +{ |
| + return m_layoutManager.get(); |
| +} |
| + |
| +void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback) |
| +{ |
| + m_layoutManager = callback; |
|
abarth-chromium
2015/03/25 00:18:51
Do we need to dirty ourselves somehow so that Elem
ojan
2015/04/02 00:02:29
Yes! Will fix in followup patch. There's a number
|
| +} |
| + |
| void Element::childrenChanged(const ChildrenChange& change) |
| { |
| ContainerNode::childrenChanged(change); |