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, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl
e Inc. All rights reserved. | 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 Appl
e 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 AffectedSelectorVisited = 1 << 6 | 68 AffectedSelectorVisited = 1 << 6 |
69 }; | 69 }; |
70 typedef int AffectedSelectorMask; | 70 typedef int AffectedSelectorMask; |
71 | 71 |
72 enum SpellcheckAttributeState { | 72 enum SpellcheckAttributeState { |
73 SpellcheckAttributeTrue, | 73 SpellcheckAttributeTrue, |
74 SpellcheckAttributeFalse, | 74 SpellcheckAttributeFalse, |
75 SpellcheckAttributeDefault | 75 SpellcheckAttributeDefault |
76 }; | 76 }; |
77 | 77 |
| 78 enum ElementFlags { |
| 79 TabIndexWasSetExplicitly = 1 << 0, |
| 80 NeedsFocusAppearanceUpdateSoonAfterAttach = 1 << 1, |
| 81 StyleAffectedByEmpty = 1 << 2, |
| 82 IsInCanvasSubtree = 1 << 3, |
| 83 ContainsFullScreenElement = 1 << 4, |
| 84 IsInTopLayer = 1 << 5, |
| 85 HasPendingResources = 1 << 6, |
| 86 ChildrenAffectedByFocus = 1 << 7, |
| 87 ChildrenAffectedByHover = 1 << 8, |
| 88 ChildrenAffectedByActive = 1 << 9, |
| 89 ChildrenAffectedByDrag = 1 << 10, |
| 90 ChildrenAffectedByFirstChildRules = 1 << 11, |
| 91 ChildrenAffectedByLastChildRules = 1 << 12, |
| 92 ChildrenAffectedByDirectAdjacentRules = 1 << 13, |
| 93 ChildrenAffectedByForwardPositionalRules = 1 << 14, |
| 94 ChildrenAffectedByBackwardPositionalRules = 1 << 15, |
| 95 |
| 96 // If any of these flags are set we cannot share style. |
| 97 ElementFlagsPreventingStyleSharing = |
| 98 ChildrenAffectedByFocus |
| 99 | ChildrenAffectedByHover |
| 100 | ChildrenAffectedByActive |
| 101 | ChildrenAffectedByDrag |
| 102 | ChildrenAffectedByFirstChildRules |
| 103 | ChildrenAffectedByLastChildRules |
| 104 | ChildrenAffectedByDirectAdjacentRules |
| 105 | ChildrenAffectedByForwardPositionalRules |
| 106 | ChildrenAffectedByBackwardPositionalRules, |
| 107 }; |
| 108 |
78 class Element : public ContainerNode { | 109 class Element : public ContainerNode { |
79 public: | 110 public: |
80 static PassRefPtr<Element> create(const QualifiedName&, Document*); | 111 static PassRefPtr<Element> create(const QualifiedName&, Document*); |
81 virtual ~Element(); | 112 virtual ~Element(); |
82 | 113 |
83 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); | 114 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecopy); |
84 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); | 115 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforecut); |
85 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); | 116 DEFINE_ATTRIBUTE_EVENT_LISTENER(beforepaste); |
86 DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); | 117 DEFINE_ATTRIBUTE_EVENT_LISTENER(copy); |
87 DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); | 118 DEFINE_ATTRIBUTE_EVENT_LISTENER(cut); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 349 |
319 bool hasAuthorShadowRoot() const { return shadowRoot(); } | 350 bool hasAuthorShadowRoot() const { return shadowRoot(); } |
320 virtual void didAddShadowRoot(ShadowRoot&); | 351 virtual void didAddShadowRoot(ShadowRoot&); |
321 ShadowRoot* userAgentShadowRoot() const; | 352 ShadowRoot* userAgentShadowRoot() const; |
322 ShadowRoot& ensureUserAgentShadowRoot(); | 353 ShadowRoot& ensureUserAgentShadowRoot(); |
323 bool isInDescendantTreeOf(const Element* shadowHost) const; | 354 bool isInDescendantTreeOf(const Element* shadowHost) const; |
324 | 355 |
325 RenderStyle* computedStyle(PseudoId = NOPSEUDO); | 356 RenderStyle* computedStyle(PseudoId = NOPSEUDO); |
326 | 357 |
327 // Methods for indicating the style is affected by dynamic updates (e.g., ch
ildren changing, our position changing in our sibling list, etc.) | 358 // Methods for indicating the style is affected by dynamic updates (e.g., ch
ildren changing, our position changing in our sibling list, etc.) |
328 bool styleAffectedByEmpty() const { return hasRareData() && rareDataStyleAff
ectedByEmpty(); } | 359 bool styleAffectedByEmpty() const { return hasElementFlag(StyleAffectedByEmp
ty); } |
329 bool childrenAffectedByFocus() const { return hasRareData() && rareDataChild
renAffectedByFocus(); } | 360 void setStyleAffectedByEmpty() { setElementFlag(StyleAffectedByEmpty); } |
330 bool childrenAffectedByHover() const { return hasRareData() && rareDataChild
renAffectedByHover(); } | 361 |
331 bool childrenAffectedByActive() const { return hasRareData() && rareDataChil
drenAffectedByActive(); } | 362 bool childrenAffectedByFocus() const { return hasElementFlag(ChildrenAffecte
dByFocus); } |
332 bool childrenAffectedByDrag() const { return hasRareData() && rareDataChildr
enAffectedByDrag(); } | 363 void setChildrenAffectedByFocus() { setElementFlag(ChildrenAffectedByFocus);
} |
333 bool childrenAffectedByPositionalRules() const { return hasRareData() && (ra
reDataChildrenAffectedByForwardPositionalRules() || rareDataChildrenAffectedByBa
ckwardPositionalRules()); } | 364 |
334 bool childrenAffectedByFirstChildRules() const { return hasRareData() && rar
eDataChildrenAffectedByFirstChildRules(); } | 365 bool childrenAffectedByHover() const { return hasElementFlag(ChildrenAffecte
dByHover); } |
335 bool childrenAffectedByLastChildRules() const { return hasRareData() && rare
DataChildrenAffectedByLastChildRules(); } | 366 void setChildrenAffectedByHover() { setElementFlag(ChildrenAffectedByHover);
} |
336 bool childrenAffectedByDirectAdjacentRules() const { return hasRareData() &&
rareDataChildrenAffectedByDirectAdjacentRules(); } | 367 |
337 bool childrenAffectedByForwardPositionalRules() const { return hasRareData()
&& rareDataChildrenAffectedByForwardPositionalRules(); } | 368 bool childrenAffectedByActive() const { return hasElementFlag(ChildrenAffect
edByActive); } |
338 bool childrenAffectedByBackwardPositionalRules() const { return hasRareData(
) && rareDataChildrenAffectedByBackwardPositionalRules(); } | 369 void setChildrenAffectedByActive() { setElementFlag(ChildrenAffectedByActive
); } |
| 370 |
| 371 bool childrenAffectedByDrag() const { return hasElementFlag(ChildrenAffected
ByDrag); } |
| 372 void setChildrenAffectedByDrag() { setElementFlag(ChildrenAffectedByDrag); } |
| 373 |
| 374 bool childrenAffectedByPositionalRules() const { return hasElementFlag(Child
renAffectedByForwardPositionalRules) || hasElementFlag(ChildrenAffectedByBackwar
dPositionalRules); } |
| 375 |
| 376 bool childrenAffectedByFirstChildRules() const { return hasElementFlag(Child
renAffectedByFirstChildRules); } |
| 377 void setChildrenAffectedByFirstChildRules() { setElementFlag(ChildrenAffecte
dByFirstChildRules); } |
| 378 |
| 379 bool childrenAffectedByLastChildRules() const { return hasElementFlag(Childr
enAffectedByLastChildRules); } |
| 380 void setChildrenAffectedByLastChildRules() { setElementFlag(ChildrenAffected
ByLastChildRules); } |
| 381 |
| 382 bool childrenAffectedByDirectAdjacentRules() const { return hasElementFlag(C
hildrenAffectedByDirectAdjacentRules); } |
| 383 void setChildrenAffectedByDirectAdjacentRules() { setElementFlag(ChildrenAff
ectedByDirectAdjacentRules); } |
| 384 |
| 385 bool childrenAffectedByForwardPositionalRules() const { return hasElementFla
g(ChildrenAffectedByForwardPositionalRules); } |
| 386 void setChildrenAffectedByForwardPositionalRules() { setElementFlag(Children
AffectedByForwardPositionalRules); } |
| 387 |
| 388 bool childrenAffectedByBackwardPositionalRules() const { return hasElementFl
ag(ChildrenAffectedByBackwardPositionalRules); } |
| 389 void setChildrenAffectedByBackwardPositionalRules() { setElementFlag(Childre
nAffectedByBackwardPositionalRules); } |
| 390 |
| 391 void setIsInCanvasSubtree(bool value) { setElementFlag(IsInCanvasSubtree, va
lue); } |
| 392 bool isInCanvasSubtree() const { return hasElementFlag(IsInCanvasSubtree); } |
| 393 |
339 unsigned childIndex() const { return hasRareData() ? rareDataChildIndex() :
0; } | 394 unsigned childIndex() const { return hasRareData() ? rareDataChildIndex() :
0; } |
340 | |
341 bool childrenSupportStyleSharing() const; | |
342 | |
343 void setStyleAffectedByEmpty(); | |
344 void setChildrenAffectedByFocus(); | |
345 void setChildrenAffectedByHover(); | |
346 void setChildrenAffectedByActive(); | |
347 void setChildrenAffectedByDrag(); | |
348 void setChildrenAffectedByFirstChildRules(); | |
349 void setChildrenAffectedByLastChildRules(); | |
350 void setChildrenAffectedByDirectAdjacentRules(); | |
351 void setChildrenAffectedByForwardPositionalRules(); | |
352 void setChildrenAffectedByBackwardPositionalRules(); | |
353 void setChildIndex(unsigned); | 395 void setChildIndex(unsigned); |
354 | 396 |
355 void setIsInCanvasSubtree(bool); | 397 bool childrenSupportStyleSharing() const { return !hasElementFlag(ElementFla
gsPreventingStyleSharing); } |
356 bool isInCanvasSubtree() const; | |
357 | 398 |
358 bool isUpgradedCustomElement() { return customElementState() == Upgraded; } | 399 bool isUpgradedCustomElement() { return customElementState() == Upgraded; } |
359 bool isUnresolvedCustomElement() { return customElementState() == WaitingFor
Upgrade; } | 400 bool isUnresolvedCustomElement() { return customElementState() == WaitingFor
Upgrade; } |
360 | 401 |
361 AtomicString computeInheritedLanguage() const; | 402 AtomicString computeInheritedLanguage() const; |
362 Locale& locale() const; | 403 Locale& locale() const; |
363 | 404 |
364 virtual void accessKeyAction(bool /*sendToAnyEvent*/) { } | 405 virtual void accessKeyAction(bool /*sendToAnyEvent*/) { } |
365 | 406 |
366 virtual bool isURLAttribute(const Attribute&) const { return false; } | 407 virtual bool isURLAttribute(const Attribute&) const { return false; } |
367 virtual bool isHTMLContentAttribute(const Attribute&) const { return false;
} | 408 virtual bool isHTMLContentAttribute(const Attribute&) const { return false;
} |
368 | 409 |
369 KURL getURLAttribute(const QualifiedName&) const; | 410 KURL getURLAttribute(const QualifiedName&) const; |
370 KURL getNonEmptyURLAttribute(const QualifiedName&) const; | 411 KURL getNonEmptyURLAttribute(const QualifiedName&) const; |
371 | 412 |
372 virtual const AtomicString imageSourceURL() const; | 413 virtual const AtomicString imageSourceURL() const; |
373 virtual Image* imageContents() { return 0; } | 414 virtual Image* imageContents() { return 0; } |
374 | 415 |
375 virtual void focus(bool restorePreviousSelection = true, FocusType = FocusTy
peNone); | 416 virtual void focus(bool restorePreviousSelection = true, FocusType = FocusTy
peNone); |
376 virtual void updateFocusAppearance(bool restorePreviousSelection); | 417 virtual void updateFocusAppearance(bool restorePreviousSelection); |
377 virtual void blur(); | 418 virtual void blur(); |
378 // Whether this element can receive focus at all. Most elements are not | 419 // Whether this element can receive focus at all. Most elements are not |
379 // focusable but some elements, such as form controls and links, are. Unlike | 420 // focusable but some elements, such as form controls and links, are. Unlike |
380 // rendererIsFocusable(), this method may be called when layout is not up to | 421 // rendererIsFocusable(), this method may be called when layout is not up to |
381 // date, so it must not use the renderer to determine focusability. | 422 // date, so it must not use the renderer to determine focusability. |
382 virtual bool supportsFocus() const; | 423 virtual bool supportsFocus() const { return hasElementFlag(TabIndexWasSetExp
licitly); } |
383 // Whether the node can actually be focused. | 424 // Whether the node can actually be focused. |
384 bool isFocusable() const; | 425 bool isFocusable() const; |
385 virtual bool isKeyboardFocusable() const; | 426 virtual bool isKeyboardFocusable() const; |
386 virtual bool isMouseFocusable() const; | 427 virtual bool isMouseFocusable() const; |
387 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType); | 428 virtual void dispatchFocusEvent(Element* oldFocusedElement, FocusType); |
388 virtual void dispatchBlurEvent(Element* newFocusedElement); | 429 virtual void dispatchBlurEvent(Element* newFocusedElement); |
389 void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocused
Element); | 430 void dispatchFocusInEvent(const AtomicString& eventType, Element* oldFocused
Element); |
390 void dispatchFocusOutEvent(const AtomicString& eventType, Element* newFocuse
dElement); | 431 void dispatchFocusOutEvent(const AtomicString& eventType, Element* newFocuse
dElement); |
391 | 432 |
392 String innerText(); | 433 String innerText(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 virtual bool isFrameElementBase() const { return false; } | 502 virtual bool isFrameElementBase() const { return false; } |
462 virtual bool isPasswordGeneratorButtonElement() const { return false; } | 503 virtual bool isPasswordGeneratorButtonElement() const { return false; } |
463 virtual bool isClearButtonElement() const { return false; } | 504 virtual bool isClearButtonElement() const { return false; } |
464 | 505 |
465 virtual bool canContainRangeEndPoint() const OVERRIDE { return true; } | 506 virtual bool canContainRangeEndPoint() const OVERRIDE { return true; } |
466 | 507 |
467 // Used for disabled form elements; if true, prevents mouse events from bein
g dispatched | 508 // Used for disabled form elements; if true, prevents mouse events from bein
g dispatched |
468 // to event listeners, and prevents DOMActivate events from being sent at al
l. | 509 // to event listeners, and prevents DOMActivate events from being sent at al
l. |
469 virtual bool isDisabledFormControl() const { return false; } | 510 virtual bool isDisabledFormControl() const { return false; } |
470 | 511 |
471 bool hasPendingResources() const; | 512 bool hasPendingResources() const { return hasElementFlag(HasPendingResources
); } |
472 void setHasPendingResources(); | 513 void setHasPendingResources(bool value) { setElementFlag(HasPendingResources
); } |
473 void clearHasPendingResources(); | 514 void clearHasPendingResources() { clearFlag(HasPendingResources); } |
474 virtual void buildPendingResource() { }; | 515 virtual void buildPendingResource() { }; |
475 | 516 |
476 enum { | 517 enum { |
477 ALLOW_KEYBOARD_INPUT = 1 << 0, | 518 ALLOW_KEYBOARD_INPUT = 1 << 0, |
478 LEGACY_MOZILLA_REQUEST = 1 << 1, | 519 LEGACY_MOZILLA_REQUEST = 1 << 1, |
479 }; | 520 }; |
480 | 521 |
481 void webkitRequestFullScreen(unsigned short flags); | 522 void webkitRequestFullScreen(unsigned short flags); |
482 bool containsFullScreenElement() const; | 523 bool containsFullScreenElement() const { return hasElementFlag(ContainsFullS
creenElement); } |
483 void setContainsFullScreenElement(bool); | 524 void setContainsFullScreenElement(bool); |
484 void setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(bool); | 525 void setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(bool); |
485 | 526 |
486 // W3C API | 527 // W3C API |
487 void webkitRequestFullscreen(); | 528 void webkitRequestFullscreen(); |
488 | 529 |
489 bool isInTopLayer() const; | 530 bool isInTopLayer() const { return hasElementFlag(IsInTopLayer); } |
490 void setIsInTopLayer(bool); | 531 void setIsInTopLayer(bool); |
491 | 532 |
492 void webkitRequestPointerLock(); | 533 void webkitRequestPointerLock(); |
493 | 534 |
494 bool isSpellCheckingEnabled() const; | 535 bool isSpellCheckingEnabled() const; |
495 | 536 |
496 // FIXME: public for RenderTreeBuilder, we shouldn't expose this though. | 537 // FIXME: public for RenderTreeBuilder, we shouldn't expose this though. |
497 PassRefPtr<RenderStyle> styleForRenderer(); | 538 PassRefPtr<RenderStyle> styleForRenderer(); |
498 | 539 |
499 bool hasID() const; | 540 bool hasID() const; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // classAttributeChanged() exists to share code between | 597 // classAttributeChanged() exists to share code between |
557 // parseAttribute (called via setAttribute()) and | 598 // parseAttribute (called via setAttribute()) and |
558 // svgAttributeChanged (called when element.className.baseValue is set) | 599 // svgAttributeChanged (called when element.className.baseValue is set) |
559 void classAttributeChanged(const AtomicString& newClassString); | 600 void classAttributeChanged(const AtomicString& newClassString); |
560 | 601 |
561 PassRefPtr<RenderStyle> originalStyleForRenderer(); | 602 PassRefPtr<RenderStyle> originalStyleForRenderer(); |
562 | 603 |
563 Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&); | 604 Node* insertAdjacent(const String& where, Node* newChild, ExceptionState&); |
564 | 605 |
565 private: | 606 private: |
| 607 bool hasElementFlag(ElementFlags mask) const { return hasRareData() && hasEl
ementFlagInternal(mask); } |
| 608 void setElementFlag(ElementFlags, bool value = true); |
| 609 void clearElementFlag(ElementFlags); |
| 610 bool hasElementFlagInternal(ElementFlags) const; |
| 611 |
566 void styleAttributeChanged(const AtomicString& newStyleString, AttributeModi
ficationReason); | 612 void styleAttributeChanged(const AtomicString& newStyleString, AttributeModi
ficationReason); |
567 | 613 |
568 void updatePresentationAttributeStyle(); | 614 void updatePresentationAttributeStyle(); |
569 | 615 |
570 void inlineStyleChanged(); | 616 void inlineStyleChanged(); |
571 PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper(); | 617 PropertySetCSSStyleDeclaration* inlineStyleCSSOMWrapper(); |
572 void setInlineStyleFromString(const AtomicString&); | 618 void setInlineStyleFromString(const AtomicString&); |
573 | 619 |
574 StyleRecalcChange recalcOwnStyle(StyleRecalcChange); | 620 StyleRecalcChange recalcOwnStyle(StyleRecalcChange); |
575 void recalcChildStyle(StyleRecalcChange); | 621 void recalcChildStyle(StyleRecalcChange); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 inline void updateCallbackSelectors(RenderStyle* oldStyle, RenderStyle* newS
tyle); | 674 inline void updateCallbackSelectors(RenderStyle* oldStyle, RenderStyle* newS
tyle); |
629 inline void removeCallbackSelectors(); | 675 inline void removeCallbackSelectors(); |
630 inline void addCallbackSelectors(); | 676 inline void addCallbackSelectors(); |
631 | 677 |
632 // cloneNode is private so that non-virtual cloneElementWithChildren and clo
neElementWithoutChildren | 678 // cloneNode is private so that non-virtual cloneElementWithChildren and clo
neElementWithoutChildren |
633 // are used instead. | 679 // are used instead. |
634 virtual PassRefPtr<Node> cloneNode(bool deep) OVERRIDE; | 680 virtual PassRefPtr<Node> cloneNode(bool deep) OVERRIDE; |
635 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); | 681 virtual PassRefPtr<Element> cloneElementWithoutAttributesAndChildren(); |
636 | 682 |
637 QualifiedName m_tagName; | 683 QualifiedName m_tagName; |
638 bool rareDataStyleAffectedByEmpty() const; | 684 |
639 bool rareDataChildrenAffectedByFocus() const; | |
640 bool rareDataChildrenAffectedByHover() const; | |
641 bool rareDataChildrenAffectedByActive() const; | |
642 bool rareDataChildrenAffectedByDrag() const; | |
643 bool rareDataChildrenAffectedByFirstChildRules() const; | |
644 bool rareDataChildrenAffectedByLastChildRules() const; | |
645 bool rareDataChildrenAffectedByDirectAdjacentRules() const; | |
646 bool rareDataChildrenAffectedByForwardPositionalRules() const; | |
647 bool rareDataChildrenAffectedByBackwardPositionalRules() const; | |
648 unsigned rareDataChildIndex() const; | 685 unsigned rareDataChildIndex() const; |
649 | 686 |
650 SpellcheckAttributeState spellcheckAttributeState() const; | 687 SpellcheckAttributeState spellcheckAttributeState() const; |
651 | 688 |
652 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt
ring& newName); | 689 void updateNamedItemRegistration(const AtomicString& oldName, const AtomicSt
ring& newName); |
653 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato
micString& newName); | 690 void updateExtraNamedItemRegistration(const AtomicString& oldName, const Ato
micString& newName); |
654 | 691 |
655 void createUniqueElementData(); | 692 void createUniqueElementData(); |
656 | 693 |
657 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const
QualifiedName&, const AtomicString&); | 694 bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const
QualifiedName&, const AtomicString&); |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 template <> inline bool isElementOfType<const thisType>(const Element& eleme
nt) { return element.predicate; } \ | 929 template <> inline bool isElementOfType<const thisType>(const Element& eleme
nt) { return element.predicate; } \ |
893 DEFINE_NODE_TYPE_CASTS(thisType, predicate) | 930 DEFINE_NODE_TYPE_CASTS(thisType, predicate) |
894 | 931 |
895 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ | 932 #define DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ |
896 template <> inline bool isElementOfType<const thisType>(const Element& eleme
nt) { return is##thisType(element); } \ | 933 template <> inline bool isElementOfType<const thisType>(const Element& eleme
nt) { return is##thisType(element); } \ |
897 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) | 934 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(thisType) |
898 | 935 |
899 } // namespace | 936 } // namespace |
900 | 937 |
901 #endif | 938 #endif |
OLD | NEW |