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

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

Issue 1101793003: Expose minContentWidth/maxContentWidth and a callback for computing them. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: make variable names consistent 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 | « no previous file | sky/engine/core/dom/Element.cpp » ('j') | sky/engine/core/dom/Element.idl » ('J')
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 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 double y() const; 209 double y() const;
210 void setY(double); 210 void setY(double);
211 211
212 double width() const; 212 double width() const;
213 void setWidth(double); 213 void setWidth(double);
214 214
215 double height() const; 215 double height() const;
216 void setHeight(double); 216 void setHeight(double);
217 217
218 double minContentWidth() const;
219 void setMinContentWidth(double);
220
221 double maxContentWidth() const;
222 void setMaxContentWidth(double);
223
218 void setNeedsLayout(); 224 void setNeedsLayout();
219 void layout(); 225 void layout();
220 226
227 LayoutCallback* intrinsicWidthsComputer() const;
221 LayoutCallback* layoutManager() const; 228 LayoutCallback* layoutManager() const;
222 void setLayoutManager(PassOwnPtr<LayoutCallback>); 229 void setLayoutManager(PassOwnPtr<LayoutCallback> layoutManager,
230 PassOwnPtr<LayoutCallback> intrinsicWidthsComputer);
223 231
224 RenderStyle* computedStyle(); 232 RenderStyle* computedStyle();
225 233
226 bool isUpgradedCustomElement() const { return customElementState() == Upgrad ed; } 234 bool isUpgradedCustomElement() const { return customElementState() == Upgrad ed; }
227 bool isUnresolvedCustomElement() const { return customElementState() == Wait ingForUpgrade; } 235 bool isUnresolvedCustomElement() const { return customElementState() == Wait ingForUpgrade; }
228 236
229 AtomicString computeInheritedLanguage() const; 237 AtomicString computeInheritedLanguage() const;
230 238
231 virtual bool isURLAttribute(const Attribute&) const { return false; } 239 virtual bool isURLAttribute(const Attribute&) const { return false; }
232 240
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 371
364 void createUniqueElementData(); 372 void createUniqueElementData();
365 373
366 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&); 374 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&);
367 375
368 ElementRareData* elementRareData() const; 376 ElementRareData* elementRareData() const;
369 ElementRareData& ensureElementRareData(); 377 ElementRareData& ensureElementRareData();
370 378
371 RefPtr<ElementData> m_elementData; 379 RefPtr<ElementData> m_elementData;
372 OwnPtr<LayoutCallback> m_layoutManager; 380 OwnPtr<LayoutCallback> m_layoutManager;
381 OwnPtr<LayoutCallback> m_intrinsicWidthsComputer;
373 }; 382 };
374 383
375 DEFINE_NODE_TYPE_CASTS(Element, isElementNode()); 384 DEFINE_NODE_TYPE_CASTS(Element, isElementNode());
376 template <typename T> bool isElementOfType(const Node&); 385 template <typename T> bool isElementOfType(const Node&);
377 template <> inline bool isElementOfType<const Element>(const Node& node) { retur n node.isElementNode(); } 386 template <> inline bool isElementOfType<const Element>(const Node& node) { retur n node.isElementNode(); }
378 template <typename T> inline bool isElementOfType(const Element& element) { retu rn isElementOfType<T>(static_cast<const Node&>(element)); } 387 template <typename T> inline bool isElementOfType(const Element& element) { retu rn isElementOfType<T>(static_cast<const Node&>(element)); }
379 template <> inline bool isElementOfType<const Element>(const Element&) { return true; } 388 template <> inline bool isElementOfType<const Element>(const Element&) { return true; }
380 389
381 // Type casting. 390 // Type casting.
382 template<typename T> inline T& toElement(Node& node) 391 template<typename T> inline T& toElement(Node& node)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 static PassRefPtr<T> create(const QualifiedName&, Document&) 584 static PassRefPtr<T> create(const QualifiedName&, Document&)
576 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 585 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
577 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 586 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \
578 { \ 587 { \
579 return adoptRef(new T(tagName, document)); \ 588 return adoptRef(new T(tagName, document)); \
580 } 589 }
581 590
582 } // namespace 591 } // namespace
583 592
584 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ 593 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/Element.cpp » ('j') | sky/engine/core/dom/Element.idl » ('J')

Powered by Google App Engine
This is Rietveld 408576698