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

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

Issue 871203005: Remove ElementFlags system. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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') | 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 * 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class PseudoElement; 56 class PseudoElement;
57 class ShadowRoot; 57 class ShadowRoot;
58 class StylePropertySet; 58 class StylePropertySet;
59 59
60 enum SpellcheckAttributeState { 60 enum SpellcheckAttributeState {
61 SpellcheckAttributeTrue, 61 SpellcheckAttributeTrue,
62 SpellcheckAttributeFalse, 62 SpellcheckAttributeFalse,
63 SpellcheckAttributeDefault 63 SpellcheckAttributeDefault
64 }; 64 };
65 65
66 enum ElementFlags {
67 TabIndexWasSetExplicitly = 1 << 0,
68
69 NumberOfElementFlags = 2, // Required size of bitfield used to store the fla gs.
70 };
71
72 class Element : public ContainerNode { 66 class Element : public ContainerNode {
73 DEFINE_WRAPPERTYPEINFO(); 67 DEFINE_WRAPPERTYPEINFO();
74 public: 68 public:
75 static PassRefPtr<Element> create(const QualifiedName&, Document*); 69 static PassRefPtr<Element> create(const QualifiedName&, Document*);
76 virtual ~Element(); 70 virtual ~Element();
77 71
78 bool hasAttribute(const QualifiedName&) const; 72 bool hasAttribute(const QualifiedName&) const;
79 const AtomicString& getAttribute(const QualifiedName&) const; 73 const AtomicString& getAttribute(const QualifiedName&) const;
80 Vector<RefPtr<Attr>> getAttributes(); 74 Vector<RefPtr<Attr>> getAttributes();
81 bool hasAttributes() const; 75 bool hasAttributes() const;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 protected: 285 protected:
292 Element(const QualifiedName& tagName, Document*, ConstructionType); 286 Element(const QualifiedName& tagName, Document*, ConstructionType);
293 287
294 const ElementData* elementData() const { return m_elementData.get(); } 288 const ElementData* elementData() const { return m_elementData.get(); }
295 UniqueElementData& ensureUniqueElementData(); 289 UniqueElementData& ensureUniqueElementData();
296 290
297 virtual void insertedInto(ContainerNode*) override; 291 virtual void insertedInto(ContainerNode*) override;
298 virtual void removedFrom(ContainerNode*) override; 292 virtual void removedFrom(ContainerNode*) override;
299 virtual void childrenChanged(const ChildrenChange&) override; 293 virtual void childrenChanged(const ChildrenChange&) override;
300 294
301 void clearTabIndexExplicitlyIfNeeded();
302 void setTabIndexExplicitly(short);
303 // Subclasses may override this method to affect focusability. Unlike 295 // Subclasses may override this method to affect focusability. Unlike
304 // supportsFocus, this method must be called on an up-to-date layout, so it 296 // supportsFocus, this method must be called on an up-to-date layout, so it
305 // may use the renderer to reason about focusability. This method cannot be 297 // may use the renderer to reason about focusability. This method cannot be
306 // moved to RenderObject because some focusable nodes don't have renderers, 298 // moved to RenderObject because some focusable nodes don't have renderers,
307 // e.g., HTMLOptionElement. 299 // e.g., HTMLOptionElement.
308 virtual bool rendererIsFocusable() const; 300 virtual bool rendererIsFocusable() const;
309 301
310 // classAttributeChanged() exists to share code between 302 // classAttributeChanged() exists to share code between
311 // parseAttribute (called via setAttribute()) and 303 // parseAttribute (called via setAttribute()) and
312 // svgAttributeChanged (called when element.className.baseValue is set) 304 // svgAttributeChanged (called when element.className.baseValue is set)
313 void classAttributeChanged(const AtomicString& newClassString); 305 void classAttributeChanged(const AtomicString& newClassString);
314 306
315 private: 307 private:
316 void attributeChanged(const QualifiedName&, const AtomicString&, AttributeMo dificationReason = ModifiedDirectly); 308 void attributeChanged(const QualifiedName&, const AtomicString&, AttributeMo dificationReason = ModifiedDirectly);
317 309
318 bool classChangeNeedsStyleRecalc(const SpaceSplitString& oldClasses, const S paceSplitString& newClasses); 310 bool classChangeNeedsStyleRecalc(const SpaceSplitString& oldClasses, const S paceSplitString& newClasses);
319 311
320 bool hasElementFlag(ElementFlags mask) const { return hasRareData() && hasEl ementFlagInternal(mask); }
321 void setElementFlag(ElementFlags, bool value = true);
322 void clearElementFlag(ElementFlags);
323 bool hasElementFlagInternal(ElementFlags) const;
324
325 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check. 312 bool isElementNode() const = delete; // This will catch anyone doing an unne cessary check.
326 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check. 313 bool isDocumentFragment() const = delete; // This will catch anyone doing an unnecessary check.
327 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check. 314 bool isDocumentNode() const = delete; // This will catch anyone doing an unn ecessary check.
328 315
329 void styleAttributeChanged(const AtomicString& newStyleString); 316 void styleAttributeChanged(const AtomicString& newStyleString);
330 317
331 void inlineStyleChanged(); 318 void inlineStyleChanged();
332 PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper(); 319 PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper();
333 void setInlineStyleFromString(const AtomicString&); 320 void setInlineStyleFromString(const AtomicString&);
334 321
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 static PassRefPtr<T> create(const QualifiedName&, Document&) 572 static PassRefPtr<T> create(const QualifiedName&, Document&)
586 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ 573 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \
587 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ 574 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \
588 { \ 575 { \
589 return adoptRef(new T(tagName, document)); \ 576 return adoptRef(new T(tagName, document)); \
590 } 577 }
591 578
592 } // namespace 579 } // namespace
593 580
594 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ 581 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698