| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 bool sharesSameElementData(const Element& other) const { return elementData(
) == other.elementData(); } | 230 bool sharesSameElementData(const Element& other) const { return elementData(
) == other.elementData(); } |
| 231 | 231 |
| 232 // Clones attributes only. | 232 // Clones attributes only. |
| 233 void cloneAttributesFromElement(const Element&); | 233 void cloneAttributesFromElement(const Element&); |
| 234 | 234 |
| 235 // Clones all attribute-derived data, including subclass specifics (through
copyNonAttributeProperties.) | 235 // Clones all attribute-derived data, including subclass specifics (through
copyNonAttributeProperties.) |
| 236 void cloneDataFromElement(const Element&); | 236 void cloneDataFromElement(const Element&); |
| 237 | 237 |
| 238 bool hasEquivalentAttributes(const Element* other) const; | 238 bool hasEquivalentAttributes(const Element* other) const; |
| 239 | 239 |
| 240 virtual void copyNonAttributePropertiesFromElement(const Element&) { } | |
| 241 | |
| 242 virtual void attach(const AttachContext& = AttachContext()) override; | 240 virtual void attach(const AttachContext& = AttachContext()) override; |
| 243 virtual void detach(const AttachContext& = AttachContext()) override; | 241 virtual void detach(const AttachContext& = AttachContext()) override; |
| 244 virtual RenderObject* createRenderer(RenderStyle*); | 242 virtual RenderObject* createRenderer(RenderStyle*); |
| 245 virtual bool rendererIsNeeded(const RenderStyle&); | 243 virtual bool rendererIsNeeded(const RenderStyle&); |
| 246 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = 0); | 244 void recalcStyle(StyleRecalcChange, Text* nextTextSibling = 0); |
| 247 void didAffectSelector(AffectedSelectorMask); | 245 void didAffectSelector(AffectedSelectorMask); |
| 248 void setAnimationStyleChange(bool); | 246 void setAnimationStyleChange(bool); |
| 249 void setNeedsAnimationStyleRecalc(); | 247 void setNeedsAnimationStyleRecalc(); |
| 250 | 248 |
| 251 void setNeedsCompositingUpdate(); | 249 void setNeedsCompositingUpdate(); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 | 320 |
| 323 void beginParsingChildren() { setIsFinishedParsingChildren(false); } | 321 void beginParsingChildren() { setIsFinishedParsingChildren(false); } |
| 324 | 322 |
| 325 virtual bool matchesReadOnlyPseudoClass() const { return false; } | 323 virtual bool matchesReadOnlyPseudoClass() const { return false; } |
| 326 virtual bool matchesReadWritePseudoClass() const { return false; } | 324 virtual bool matchesReadWritePseudoClass() const { return false; } |
| 327 bool matches(const String& selectors, ExceptionState&); | 325 bool matches(const String& selectors, ExceptionState&); |
| 328 virtual bool shouldAppearIndeterminate() const { return false; } | 326 virtual bool shouldAppearIndeterminate() const { return false; } |
| 329 | 327 |
| 330 DOMTokenList& classList(); | 328 DOMTokenList& classList(); |
| 331 | 329 |
| 332 virtual bool isFormControlElement() const { return false; } | |
| 333 virtual bool isOptionalFormControl() const { return false; } | |
| 334 virtual bool isRequiredFormControl() const { return false; } | |
| 335 virtual bool isDefaultButtonForForm() const { return false; } | |
| 336 virtual bool willValidate() const { return false; } | |
| 337 virtual bool isValidFormControlElement() { return false; } | |
| 338 virtual bool isInRange() const { return false; } | |
| 339 virtual bool isOutOfRange() const { return false; } | |
| 340 | |
| 341 virtual bool canContainRangeEndPoint() const override { return true; } | 330 virtual bool canContainRangeEndPoint() const override { return true; } |
| 342 | 331 |
| 343 // Used for disabled form elements; if true, prevents mouse events from bein
g dispatched | |
| 344 // to event listeners, and prevents DOMActivate events from being sent at al
l. | |
| 345 virtual bool isDisabledFormControl() const { return false; } | |
| 346 | |
| 347 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition>); | 332 void setCustomElementDefinition(PassRefPtr<CustomElementDefinition>); |
| 348 CustomElementDefinition* customElementDefinition() const; | 333 CustomElementDefinition* customElementDefinition() const; |
| 349 | 334 |
| 350 bool isSpellCheckingEnabled() const; | 335 bool isSpellCheckingEnabled() const; |
| 351 | 336 |
| 352 // FIXME: public for RenderTreeBuilder, we shouldn't expose this though. | 337 // FIXME: public for RenderTreeBuilder, we shouldn't expose this though. |
| 353 PassRefPtr<RenderStyle> styleForRenderer(); | 338 PassRefPtr<RenderStyle> styleForRenderer(); |
| 354 | 339 |
| 355 bool hasID() const; | 340 bool hasID() const; |
| 356 bool hasClass() const; | 341 bool hasClass() const; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); | 482 ASSERT_WITH_SECURITY_IMPLICATION(isElementOfType<const T>(node)); |
| 498 return static_cast<const T&>(node); | 483 return static_cast<const T&>(node); |
| 499 } | 484 } |
| 500 template<typename T> inline const T* toElement(const Node* node) | 485 template<typename T> inline const T* toElement(const Node* node) |
| 501 { | 486 { |
| 502 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); | 487 ASSERT_WITH_SECURITY_IMPLICATION(!node || isElementOfType<const T>(*node)); |
| 503 return static_cast<const T*>(node); | 488 return static_cast<const T*>(node); |
| 504 } | 489 } |
| 505 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re
turn toElement<T>(node.get()); } | 490 template<typename T, typename U> inline T* toElement(const RefPtr<U>& node) { re
turn toElement<T>(node.get()); } |
| 506 | 491 |
| 507 inline bool isDisabledFormControl(const Node* node) | |
| 508 { | |
| 509 return node->isElementNode() && toElement(node)->isDisabledFormControl(); | |
| 510 } | |
| 511 | |
| 512 inline Element* Node::parentElement() const | 492 inline Element* Node::parentElement() const |
| 513 { | 493 { |
| 514 ContainerNode* parent = parentNode(); | 494 ContainerNode* parent = parentNode(); |
| 515 return parent && parent->isElementNode() ? toElement(parent) : 0; | 495 return parent && parent->isElementNode() ? toElement(parent) : 0; |
| 516 } | 496 } |
| 517 | 497 |
| 518 inline void Element::synchronizeAttribute(const AtomicString& localName) const | 498 inline void Element::synchronizeAttribute(const AtomicString& localName) const |
| 519 { | 499 { |
| 520 if (!elementData()) | 500 if (!elementData()) |
| 521 return; | 501 return; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 static PassRefPtr<T> create(const QualifiedName&, Document&) | 659 static PassRefPtr<T> create(const QualifiedName&, Document&) |
| 680 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 660 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
| 681 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ | 661 PassRefPtr<T> T::create(const QualifiedName& tagName, Document& document) \ |
| 682 { \ | 662 { \ |
| 683 return adoptRef(new T(tagName, document)); \ | 663 return adoptRef(new T(tagName, document)); \ |
| 684 } | 664 } |
| 685 | 665 |
| 686 } // namespace | 666 } // namespace |
| 687 | 667 |
| 688 #endif // Element_h | 668 #endif // Element_h |
| OLD | NEW |