diff --git a/sky/engine/core/core.gni b/sky/engine/core/core.gni index 1080a77e5ae..e9ce6e03f63 100644 --- a/sky/engine/core/core.gni +++ b/sky/engine/core/core.gni @@ -400,7 +400,6 @@ sky_core_files = [ "inspector/ScriptCallFrame.h", "inspector/ScriptCallStack.cpp", "inspector/ScriptCallStack.h", - "layout/LayoutCallback.h", "loader/CanvasImageDecoder.cpp", "loader/CanvasImageDecoder.h", "loader/DocumentLoadTiming.cpp", @@ -512,8 +511,6 @@ sky_core_files = [ "rendering/RenderBox.h", "rendering/RenderBoxModelObject.cpp", "rendering/RenderBoxModelObject.h", - "rendering/RenderCustomLayout.cpp", - "rendering/RenderCustomLayout.h", "rendering/RenderFlexibleBox.cpp", "rendering/RenderFlexibleBox.h", "rendering/RenderGeometryMap.cpp", @@ -678,7 +675,6 @@ core_idl_files = get_path_info([ "html/ImageData.idl", "html/TextMetrics.idl", "html/VoidCallback.idl", - "layout/LayoutCallback.idl", "loader/ImageDecoder.idl", "loader/ImageDecoderCallback.idl", "painting/Canvas.idl", diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp index 57d26cb8f97..c6398d1ac48 100644 --- a/sky/engine/core/dom/Element.cpp +++ b/sky/engine/core/dom/Element.cpp @@ -60,14 +60,12 @@ #include "sky/engine/core/frame/Settings.h" #include "sky/engine/core/html/HTMLElement.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/Page.h" #include "sky/engine/core/painting/Canvas.h" #include "sky/engine/core/painting/PaintingCallback.h" #include "sky/engine/core/painting/PaintingTasks.h" #include "sky/engine/core/painting/PictureRecorder.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" @@ -524,8 +522,6 @@ const AtomicString Element::imageSourceURL() const RenderObject* Element::createRenderer(RenderStyle* style) { - if (m_layoutManager) - return new RenderCustomLayout(this); return RenderObject::createObject(this, style); } @@ -794,33 +790,6 @@ void Element::layout() box->layoutIfNeeded(); } -LayoutCallback* Element::layoutManager() const -{ - return m_layoutManager.get(); -} - -LayoutCallback* Element::intrinsicWidthsComputer() const -{ - return m_intrinsicWidthsComputer.get(); -} - -void Element::setLayoutManager(PassOwnPtr layoutManager, - PassOwnPtr intrinsicWidthsComputer) -{ - bool isAlreadyCustomLayout = renderer() && renderer()->isRenderCustomLayout(); - bool requiresCustomLayout = layoutManager; - if (requiresCustomLayout != isAlreadyCustomLayout) { - // We don't go through the normal reattach codepaths because - // those are all tied to changes to the RenderStyle. - markAncestorsWithChildNeedsStyleRecalc(); - detach(); - } else if (layoutManager.get() != m_layoutManager) { - setNeedsLayout(); - } - m_layoutManager = layoutManager; - m_intrinsicWidthsComputer = intrinsicWidthsComputer; -} - void Element::childrenChanged(const ChildrenChange& change) { ContainerNode::childrenChanged(change); diff --git a/sky/engine/core/dom/Element.h b/sky/engine/core/dom/Element.h index d1b6d2a2ea5..58ae1d1645b 100644 --- a/sky/engine/core/dom/Element.h +++ b/sky/engine/core/dom/Element.h @@ -214,11 +214,6 @@ public: void setNeedsLayout(); void layout(); - LayoutCallback* intrinsicWidthsComputer() const; - LayoutCallback* layoutManager() const; - void setLayoutManager(PassOwnPtr layoutManager, - PassOwnPtr intrinsicWidthsComputer); - RenderStyle* computedStyle(); AtomicString computeInheritedLanguage() const; @@ -335,8 +330,6 @@ private: ElementRareData& ensureElementRareData(); RefPtr m_elementData; - OwnPtr m_layoutManager; - OwnPtr m_intrinsicWidthsComputer; }; DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); diff --git a/sky/engine/core/dom/Element.idl b/sky/engine/core/dom/Element.idl index 9d1402c2fb0..c8b2d9d3fad 100644 --- a/sky/engine/core/dom/Element.idl +++ b/sky/engine/core/dom/Element.idl @@ -14,7 +14,6 @@ interface Element : ParentNode { void setNeedsLayout(); void layout(); - void setLayoutManager(LayoutCallback layout, LayoutCallback computeIntrinsicWidths); // TODO(abarth): Move to Node. readonly attribute CSSStyleDeclaration style; diff --git a/sky/engine/core/frame/FrameView.cpp b/sky/engine/core/frame/FrameView.cpp index 8018a94510e..85289cc9035 100644 --- a/sky/engine/core/frame/FrameView.cpp +++ b/sky/engine/core/frame/FrameView.cpp @@ -106,7 +106,6 @@ void FrameView::reset() m_nestedLayoutCount = 0; m_postLayoutTasksTimer.stop(); m_firstLayout = true; - m_firstLayoutCallbackPending = false; m_lastViewportSize = IntSize(); m_lastPaintTime = 0; m_isPainting = false; @@ -298,7 +297,6 @@ void FrameView::layout(bool allowSubtree) if (!inSubtreeLayout) { if (m_firstLayout) { m_firstLayout = false; - m_firstLayoutCallbackPending = true; m_lastViewportSize = layoutSize(); } @@ -514,11 +512,6 @@ void FrameView::performPostLayoutTasks() m_postLayoutTasksTimer.stop(); ASSERT(m_frame->document()); - if (m_nestedLayoutCount <= 1) { - if (m_firstLayoutCallbackPending) - m_firstLayoutCallbackPending = false; - } - sendResizeEventIfNeeded(); } diff --git a/sky/engine/core/frame/FrameView.h b/sky/engine/core/frame/FrameView.h index 74e346250da..e0352cfffdf 100644 --- a/sky/engine/core/frame/FrameView.h +++ b/sky/engine/core/frame/FrameView.h @@ -205,7 +205,6 @@ private: int m_layoutCount; unsigned m_nestedLayoutCount; Timer m_postLayoutTasksTimer; - bool m_firstLayoutCallbackPending; bool m_firstLayout; bool m_isTransparent; diff --git a/sky/engine/core/layout/LayoutCallback.h b/sky/engine/core/layout/LayoutCallback.h deleted file mode 100644 index 0013f92194d..00000000000 --- a/sky/engine/core/layout/LayoutCallback.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 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. - -#ifndef SKY_ENGINE_CORE_PAINTING_LAYOUTCALLBACK_H_ -#define SKY_ENGINE_CORE_PAINTING_LAYOUTCALLBACK_H_ - -namespace blink { - -class LayoutCallback { -public: - virtual ~LayoutCallback() {} - virtual void handleEvent() = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_PAINTING_LAYOUTCALLBACK_H_ diff --git a/sky/engine/core/layout/LayoutCallback.idl b/sky/engine/core/layout/LayoutCallback.idl deleted file mode 100644 index b6618f90c1c..00000000000 --- a/sky/engine/core/layout/LayoutCallback.idl +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2015 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. - -callback interface LayoutCallback { - void handleEvent(); -}; diff --git a/sky/engine/core/rendering/RenderCustomLayout.cpp b/sky/engine/core/rendering/RenderCustomLayout.cpp deleted file mode 100644 index 8a59ff71055..00000000000 --- a/sky/engine/core/rendering/RenderCustomLayout.cpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2015 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 "sky/engine/core/rendering/RenderCustomLayout.h" - -#include "sky/engine/core/rendering/RenderLayer.h" -#include "sky/engine/core/layout/LayoutCallback.h" - -namespace blink { - -RenderCustomLayout::RenderCustomLayout(ContainerNode* node) - : RenderBlock(node) -{ -} - -RenderCustomLayout::~RenderCustomLayout() -{ -} - -void RenderCustomLayout::computePreferredLogicalWidths() -{ - ASSERT(node()->isElementNode()); - toElement(node())->intrinsicWidthsComputer()->handleEvent(); - clearPreferredLogicalWidthsDirty(); -} - -void RenderCustomLayout::layout() -{ - ASSERT(node()->isElementNode()); - toElement(node())->layoutManager()->handleEvent(); - clearNeedsLayout(); -} - -const char* RenderCustomLayout::renderName() const -{ - return "RenderCustomLayout"; -} - -} // namespace blink - diff --git a/sky/engine/core/rendering/RenderCustomLayout.h b/sky/engine/core/rendering/RenderCustomLayout.h deleted file mode 100644 index 826a787fb42..00000000000 --- a/sky/engine/core/rendering/RenderCustomLayout.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2015 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. - -#ifndef SKY_ENGINE_CORE_RENDERING_RENDERCUSTOMLAYOUT_H_ -#define SKY_ENGINE_CORE_RENDERING_RENDERCUSTOMLAYOUT_H_ - -#include "sky/engine/core/rendering/RenderBlock.h" - -namespace blink { - -class RenderCustomLayout : public RenderBlock { -public: - explicit RenderCustomLayout(ContainerNode* node); - void computePreferredLogicalWidths() final; - void layout() final; - const char* renderName() const; - bool isRenderCustomLayout() const final { return true; } - -protected: - virtual ~RenderCustomLayout(); -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_RENDERING_RENDERCUSTOMLAYOUT_H_ diff --git a/sky/engine/core/rendering/RenderObject.h b/sky/engine/core/rendering/RenderObject.h index ddbd16e27da..54ed169cd5c 100644 --- a/sky/engine/core/rendering/RenderObject.h +++ b/sky/engine/core/rendering/RenderObject.h @@ -249,7 +249,6 @@ public: virtual bool isImage() const { return false; } virtual bool isInlineBlock() const { return false; } virtual bool isRenderBlock() const { return false; } - virtual bool isRenderCustomLayout() const { return false; } virtual bool isRenderParagraph() const { return false; } virtual bool isRenderInline() const { return false; } virtual bool isRenderView() const { return false; }