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

Side by Side Diff: sky/engine/core/dom/Element.cpp

Issue 1051713007: Revert "First iteration on custom layout." (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 #include "sky/engine/core/editing/htmlediting.h" 65 #include "sky/engine/core/editing/htmlediting.h"
66 #include "sky/engine/core/events/EventDispatcher.h" 66 #include "sky/engine/core/events/EventDispatcher.h"
67 #include "sky/engine/core/events/FocusEvent.h" 67 #include "sky/engine/core/events/FocusEvent.h"
68 #include "sky/engine/core/frame/FrameView.h" 68 #include "sky/engine/core/frame/FrameView.h"
69 #include "sky/engine/core/frame/LocalFrame.h" 69 #include "sky/engine/core/frame/LocalFrame.h"
70 #include "sky/engine/core/frame/Settings.h" 70 #include "sky/engine/core/frame/Settings.h"
71 #include "sky/engine/core/html/HTMLElement.h" 71 #include "sky/engine/core/html/HTMLElement.h"
72 #include "sky/engine/core/html/HTMLTemplateElement.h" 72 #include "sky/engine/core/html/HTMLTemplateElement.h"
73 #include "sky/engine/core/html/parser/HTMLDocumentParser.h" 73 #include "sky/engine/core/html/parser/HTMLDocumentParser.h"
74 #include "sky/engine/core/html/parser/HTMLParserIdioms.h" 74 #include "sky/engine/core/html/parser/HTMLParserIdioms.h"
75 #include "sky/engine/core/layout/LayoutCallback.h"
76 #include "sky/engine/core/page/ChromeClient.h" 75 #include "sky/engine/core/page/ChromeClient.h"
77 #include "sky/engine/core/page/FocusController.h" 76 #include "sky/engine/core/page/FocusController.h"
78 #include "sky/engine/core/page/Page.h" 77 #include "sky/engine/core/page/Page.h"
79 #include "sky/engine/core/painting/PaintingCallback.h" 78 #include "sky/engine/core/painting/PaintingCallback.h"
80 #include "sky/engine/core/painting/PaintingTasks.h" 79 #include "sky/engine/core/painting/PaintingTasks.h"
81 #include "sky/engine/core/rendering/RenderCustomLayout.h"
82 #include "sky/engine/core/rendering/RenderLayer.h" 80 #include "sky/engine/core/rendering/RenderLayer.h"
83 #include "sky/engine/core/rendering/RenderView.h" 81 #include "sky/engine/core/rendering/RenderView.h"
84 #include "sky/engine/platform/EventDispatchForbiddenScope.h" 82 #include "sky/engine/platform/EventDispatchForbiddenScope.h"
85 #include "sky/engine/tonic/dart_state.h" 83 #include "sky/engine/tonic/dart_state.h"
86 #include "sky/engine/wtf/BitVector.h" 84 #include "sky/engine/wtf/BitVector.h"
87 #include "sky/engine/wtf/HashFunctions.h" 85 #include "sky/engine/wtf/HashFunctions.h"
88 #include "sky/engine/wtf/text/CString.h" 86 #include "sky/engine/wtf/text/CString.h"
89 #include "sky/engine/wtf/text/StringBuilder.h" 87 #include "sky/engine/wtf/text/StringBuilder.h"
90 #include "sky/engine/wtf/text/TextPosition.h" 88 #include "sky/engine/wtf/text/TextPosition.h"
91 89
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 return m_tagName.localName(); 620 return m_tagName.localName();
623 } 621 }
624 622
625 const AtomicString Element::imageSourceURL() const 623 const AtomicString Element::imageSourceURL() const
626 { 624 {
627 return getAttribute(HTMLNames::srcAttr); 625 return getAttribute(HTMLNames::srcAttr);
628 } 626 }
629 627
630 RenderObject* Element::createRenderer(RenderStyle* style) 628 RenderObject* Element::createRenderer(RenderStyle* style)
631 { 629 {
632 if (m_layoutManager)
633 return new RenderCustomLayout(this);
634 return RenderObject::createObject(this, style); 630 return RenderObject::createObject(this, style);
635 } 631 }
636 632
637 void Element::insertedInto(ContainerNode* insertionPoint) 633 void Element::insertedInto(ContainerNode* insertionPoint)
638 { 634 {
639 // need to do superclass processing first so inDocument() is true 635 // need to do superclass processing first so inDocument() is true
640 // by the time we reach updateId 636 // by the time we reach updateId
641 ContainerNode::insertedInto(insertionPoint); 637 ContainerNode::insertedInto(insertionPoint);
642 638
643 if (!insertionPoint->isInTreeScope()) 639 if (!insertionPoint->isInTreeScope())
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 } 879 }
884 880
885 ShadowRoot* Element::shadowRoot() const 881 ShadowRoot* Element::shadowRoot() const
886 { 882 {
887 ElementShadow* elementShadow = shadow(); 883 ElementShadow* elementShadow = shadow();
888 if (!elementShadow) 884 if (!elementShadow)
889 return 0; 885 return 0;
890 return elementShadow->shadowRoot(); 886 return elementShadow->shadowRoot();
891 } 887 }
892 888
893 double Element::x() const
894 {
895 if (RenderBox* box = renderBox())
896 return box->x();
897 return 0;
898 }
899
900 void Element::setX(double x)
901 {
902 if (RenderBox* box = renderBox())
903 return box->setX(x);
904 }
905
906 double Element::y() const
907 {
908 if (RenderBox* box = renderBox())
909 return box->y();
910 return 0;
911 }
912
913 void Element::setY(double y)
914 {
915 if (RenderBox* box = renderBox())
916 return box->setY(y);
917 }
918
919 double Element::width() const
920 {
921 if (RenderBox* box = renderBox())
922 return box->width();
923 return 0;
924 }
925
926 void Element::setWidth(double width)
927 {
928 if (RenderBox* box = renderBox())
929 return box->setWidth(width);
930 }
931
932 double Element::height() const
933 {
934 if (RenderBox* box = renderBox())
935 return box->height();
936 return 0;
937 }
938
939 void Element::setHeight(double height)
940 {
941 if (RenderBox* box = renderBox())
942 return box->setHeight(height);
943 }
944
945 LayoutCallback* Element::layoutManager() const
946 {
947 return m_layoutManager.get();
948 }
949
950 void Element::setLayoutManager(PassOwnPtr<LayoutCallback> callback)
951 {
952 m_layoutManager = callback;
953 }
954
955 void Element::childrenChanged(const ChildrenChange& change) 889 void Element::childrenChanged(const ChildrenChange& change)
956 { 890 {
957 ContainerNode::childrenChanged(change); 891 ContainerNode::childrenChanged(change);
958 892
959 if (ElementShadow* shadow = this->shadow()) 893 if (ElementShadow* shadow = this->shadow())
960 shadow->setNeedsDistributionRecalc(); 894 shadow->setNeedsDistributionRecalc();
961 } 895 }
962 896
963 #ifndef NDEBUG 897 #ifndef NDEBUG
964 void Element::formatForDebugger(char* buffer, unsigned length) const 898 void Element::formatForDebugger(char* buffer, unsigned length) const
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 return false; 1555 return false;
1622 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue)) 1556 if (treeScope().scopedStyleResolver().hasSelectorForId(idValue))
1623 return true; 1557 return true;
1624 // Host rules could also have effects. 1558 // Host rules could also have effects.
1625 if (ShadowRoot* shadowRoot = this->shadowRoot()) 1559 if (ShadowRoot* shadowRoot = this->shadowRoot())
1626 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue); 1560 return shadowRoot->scopedStyleResolver().hasSelectorForId(idValue);
1627 return false; 1561 return false;
1628 } 1562 }
1629 1563
1630 } // namespace blink 1564 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698