OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class MutationObserverRegistration { | 43 class MutationObserverRegistration { |
44 public: | 44 public: |
45 | 45 |
46 static PassOwnPtr<MutationObserverRegistration> create(PassRefPtr<WebKitMuta
tionObserver>, Node*); | 46 static PassOwnPtr<MutationObserverRegistration> create(PassRefPtr<WebKitMuta
tionObserver>, Node*); |
47 | 47 |
48 ~MutationObserverRegistration(); | 48 ~MutationObserverRegistration(); |
49 | 49 |
50 void resetObservation(MutationObserverOptions, const HashSet<AtomicString>&
attributeFilter); | 50 void resetObservation(MutationObserverOptions, const HashSet<AtomicString>&
attributeFilter); |
51 void observedSubtreeNodeWillDetach(PassRefPtr<Node>); | 51 void observedSubtreeNodeWillDetach(PassRefPtr<Node>); |
52 void clearTransientRegistrations(); | 52 void clearTransientRegistrations(); |
| 53 bool hasTransientRegistrations() { return m_transientRegistrationNodes && !m
_transientRegistrationNodes->isEmpty(); } |
53 void unregister(); | 54 void unregister(); |
54 | 55 |
55 bool shouldReceiveMutationFrom(Node*, WebKitMutationObserver::MutationType,
const AtomicString& attributeName); | 56 bool shouldReceiveMutationFrom(Node*, WebKitMutationObserver::MutationType,
const AtomicString& attributeName); |
56 bool inline isSubtree() const { return m_options & WebKitMutationObserver::S
ubtree; } | 57 bool inline isSubtree() const { return m_options & WebKitMutationObserver::S
ubtree; } |
57 | 58 |
58 WebKitMutationObserver* observer() { return m_observer.get(); } | 59 WebKitMutationObserver* observer() { return m_observer.get(); } |
59 MutationRecordDeliveryOptions deliveryOptions() const { return m_options & (
WebKitMutationObserver::AttributeOldValue | WebKitMutationObserver::CharacterDat
aOldValue); } | 60 MutationRecordDeliveryOptions deliveryOptions() const { return m_options & (
WebKitMutationObserver::AttributeOldValue | WebKitMutationObserver::CharacterDat
aOldValue); } |
60 MutationObserverOptions mutationTypes() const { return m_options & WebKitMut
ationObserver::AllMutationTypes; } | 61 MutationObserverOptions mutationTypes() const { return m_options & WebKitMut
ationObserver::AllMutationTypes; } |
61 | 62 |
62 private: | 63 private: |
63 MutationObserverRegistration(PassRefPtr<WebKitMutationObserver>, Node*); | 64 MutationObserverRegistration(PassRefPtr<WebKitMutationObserver>, Node*); |
64 | 65 |
65 const HashSet<AtomicString>& caseInsensitiveAttributeFilter(); | 66 const HashSet<AtomicString>& caseInsensitiveAttributeFilter(); |
66 | 67 |
67 RefPtr<WebKitMutationObserver> m_observer; | 68 RefPtr<WebKitMutationObserver> m_observer; |
68 Node* m_registrationNode; | 69 Node* m_registrationNode; |
69 RefPtr<Node> m_registrationNodeKeepAlive; | 70 RefPtr<Node> m_registrationNodeKeepAlive; |
70 typedef HashSet<RefPtr<Node> > NodeHashSet; | 71 typedef HashSet<RefPtr<Node> > NodeHashSet; |
71 OwnPtr<NodeHashSet> m_transientRegistrationNodes; | 72 OwnPtr<NodeHashSet> m_transientRegistrationNodes; |
72 | 73 |
73 MutationObserverOptions m_options; | 74 MutationObserverOptions m_options; |
74 HashSet<AtomicString> m_attributeFilter; | 75 HashSet<AtomicString> m_attributeFilter; |
75 }; | 76 }; |
76 | 77 |
77 } // namespace WebCore | 78 } // namespace WebCore |
78 | 79 |
79 #endif // ENABLE(MUTATION_OBSERVERS) | 80 #endif // ENABLE(MUTATION_OBSERVERS) |
80 | 81 |
81 #endif // MutationObserverRegistration_h | 82 #endif // MutationObserverRegistration_h |
OLD | NEW |