| OLD | NEW |
| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 virtual short tabIndex() const override; | 298 virtual short tabIndex() const override; |
| 299 | 299 |
| 300 String textFromChildren(); | 300 String textFromChildren(); |
| 301 | 301 |
| 302 protected: | 302 protected: |
| 303 Element(const QualifiedName& tagName, Document*, ConstructionType); | 303 Element(const QualifiedName& tagName, Document*, ConstructionType); |
| 304 | 304 |
| 305 const ElementData* elementData() const { return m_elementData.get(); } | 305 const ElementData* elementData() const { return m_elementData.get(); } |
| 306 UniqueElementData& ensureUniqueElementData(); | 306 UniqueElementData& ensureUniqueElementData(); |
| 307 | 307 |
| 308 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 308 virtual void insertedInto(ContainerNode*) override; |
| 309 virtual void removedFrom(ContainerNode*) override; | 309 virtual void removedFrom(ContainerNode*) override; |
| 310 virtual void childrenChanged(const ChildrenChange&) override; | 310 virtual void childrenChanged(const ChildrenChange&) override; |
| 311 | 311 |
| 312 void clearTabIndexExplicitlyIfNeeded(); | 312 void clearTabIndexExplicitlyIfNeeded(); |
| 313 void setTabIndexExplicitly(short); | 313 void setTabIndexExplicitly(short); |
| 314 // Subclasses may override this method to affect focusability. Unlike | 314 // Subclasses may override this method to affect focusability. Unlike |
| 315 // supportsFocus, this method must be called on an up-to-date layout, so it | 315 // supportsFocus, this method must be called on an up-to-date layout, so it |
| 316 // may use the renderer to reason about focusability. This method cannot be | 316 // may use the renderer to reason about focusability. This method cannot be |
| 317 // moved to RenderObject because some focusable nodes don't have renderers, | 317 // moved to RenderObject because some focusable nodes don't have renderers, |
| 318 // e.g., HTMLOptionElement. | 318 // e.g., HTMLOptionElement. |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 return elementData() && elementData()->hasClass(); | 520 return elementData() && elementData()->hasClass(); |
| 521 } | 521 } |
| 522 | 522 |
| 523 inline UniqueElementData& Element::ensureUniqueElementData() | 523 inline UniqueElementData& Element::ensureUniqueElementData() |
| 524 { | 524 { |
| 525 if (!elementData() || !elementData()->isUnique()) | 525 if (!elementData() || !elementData()->isUnique()) |
| 526 createUniqueElementData(); | 526 createUniqueElementData(); |
| 527 return toUniqueElementData(*m_elementData); | 527 return toUniqueElementData(*m_elementData); |
| 528 } | 528 } |
| 529 | 529 |
| 530 inline Node::InsertionNotificationRequest Node::insertedInto(ContainerNode* inse
rtionPoint) | 530 inline void Node::insertedInto(ContainerNode* insertionPoint) |
| 531 { | 531 { |
| 532 ASSERT(insertionPoint->inDocument() || isContainerNode()); | 532 ASSERT(insertionPoint->inDocument() || isContainerNode()); |
| 533 if (insertionPoint->inDocument()) | 533 if (insertionPoint->inDocument()) |
| 534 setFlag(InDocumentFlag); | 534 setFlag(InDocumentFlag); |
| 535 if (parentOrShadowHostNode()->isInShadowTree()) | 535 if (parentOrShadowHostNode()->isInShadowTree()) |
| 536 setFlag(IsInShadowTreeFlag); | 536 setFlag(IsInShadowTreeFlag); |
| 537 if (childNeedsDistributionRecalc() && !insertionPoint->childNeedsDistributio
nRecalc()) | 537 if (childNeedsDistributionRecalc() && !insertionPoint->childNeedsDistributio
nRecalc()) |
| 538 insertionPoint->markAncestorsWithChildNeedsDistributionRecalc(); | 538 insertionPoint->markAncestorsWithChildNeedsDistributionRecalc(); |
| 539 return InsertionDone; | |
| 540 } | 539 } |
| 541 | 540 |
| 542 inline void Node::removedFrom(ContainerNode* insertionPoint) | 541 inline void Node::removedFrom(ContainerNode* insertionPoint) |
| 543 { | 542 { |
| 544 ASSERT(insertionPoint->inDocument() || isContainerNode()); | 543 ASSERT(insertionPoint->inDocument() || isContainerNode()); |
| 545 if (insertionPoint->inDocument()) | 544 if (insertionPoint->inDocument()) |
| 546 clearFlag(InDocumentFlag); | 545 clearFlag(InDocumentFlag); |
| 547 if (isInShadowTree() && !treeScope().rootNode().isShadowRoot()) | 546 if (isInShadowTree() && !treeScope().rootNode().isShadowRoot()) |
| 548 clearFlag(IsInShadowTreeFlag); | 547 clearFlag(IsInShadowTreeFlag); |
| 549 } | 548 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 static PassRefPtr<T> create(const QualifiedName&, Document&) | 585 static PassRefPtr<T> create(const QualifiedName&, Document&) |
| 587 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 586 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 588 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ | 587 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ |
| 589 { \ | 588 { \ |
| 590 return adoptRef(new T(tagName, document)); \ | 589 return adoptRef(new T(tagName, document)); \ |
| 591 } | 590 } |
| 592 | 591 |
| 593 } // namespace | 592 } // namespace |
| 594 | 593 |
| 595 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ | 594 #endif // SKY_ENGINE_CORE_DOM_ELEMENT_H_ |
| OLD | NEW |