Changeset 101736 in webkit
- Timestamp:
- Dec 1, 2011, 7:39:11 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r101734 r101736 1 2011-12-01 Rafael Weinstein <rafaelw@chromium.org> 2 3 [MutationObservers] StyleAttributeMutationScope shouldn't be implemented with static classes 4 https://bugs.webkit.org/show_bug.cgi?id=73596 5 6 Reviewed by Ojan Vafai. 7 8 No tests needed. This patch is a minor refactor. 9 10 * css/CSSMutableStyleDeclaration.cpp: 11 1 12 2011-12-01 Andreas Kling <kling@webkit.org> 2 13 -
trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp
r101734 r101736 68 68 69 69 CSSInlineStyleDeclaration* inlineDecl = toCSSInlineStyleDeclaration(s_currentDecl); 70 s_mutationRecipients = MutationObserverInterestGroup::createForAttributesMutation(inlineDecl->element(), HTMLNames::styleAttr);71 if ( s_mutationRecipients->isEmpty()) {72 s_mutationRecipients.clear();70 m_mutationRecipients = MutationObserverInterestGroup::createForAttributesMutation(inlineDecl->element(), HTMLNames::styleAttr); 71 if (m_mutationRecipients->isEmpty()) { 72 m_mutationRecipients.clear(); 73 73 return; 74 74 } 75 75 76 AtomicString oldValue = s_mutationRecipients->isOldValueRequested() ? inlineDecl->element()->getAttribute(HTMLNames::styleAttr) : nullAtom;77 s_mutation = MutationRecord::createAttributes(inlineDecl->element(), HTMLNames::styleAttr, oldValue);76 AtomicString oldValue = m_mutationRecipients->isOldValueRequested() ? inlineDecl->element()->getAttribute(HTMLNames::styleAttr) : nullAtom; 77 m_mutation = MutationRecord::createAttributes(inlineDecl->element(), HTMLNames::styleAttr, oldValue); 78 78 } 79 79 … … 81 81 { 82 82 --s_scopeCount; 83 if (!s_scopeCount) 84 s_currentDecl = 0; 83 if (s_scopeCount) 84 return; 85 86 s_currentDecl = 0; 87 if (m_mutation && s_shouldDeliver) 88 m_mutationRecipients->enqueueMutationRecord(m_mutation); 85 89 } 86 90 87 91 void enqueueMutationRecord() 88 92 { 89 if (!s_mutation) 90 return; 91 s_mutationRecipients->enqueueMutationRecord(s_mutation); 92 s_mutation.clear(); 93 s_mutationRecipients.clear(); 93 s_shouldDeliver = true; 94 94 } 95 95 96 96 private: 97 97 static unsigned s_scopeCount; 98 static OwnPtr<MutationObserverInterestGroup> s_mutationRecipients;99 static RefPtr<MutationRecord> s_mutation;100 98 static CSSMutableStyleDeclaration* s_currentDecl; 99 static bool s_shouldDeliver; 100 101 OwnPtr<MutationObserverInterestGroup> m_mutationRecipients; 102 RefPtr<MutationRecord> m_mutation; 101 103 }; 102 104 103 105 unsigned StyleAttributeMutationScope::s_scopeCount = 0; 104 OwnPtr<MutationObserverInterestGroup> StyleAttributeMutationScope::s_mutationRecipients;105 RefPtr<MutationRecord> StyleAttributeMutationScope::s_mutation;106 106 CSSMutableStyleDeclaration* StyleAttributeMutationScope::s_currentDecl = 0; 107 bool StyleAttributeMutationScope::s_shouldDeliver = false; 107 108 108 109 } // namespace
Note:
See TracChangeset
for help on using the changeset viewer.