| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014, Google Inc. All rights reserved. | 2 * Copyright (c) 2014, 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 137 |
| 138 const HeapVector<Member<UpdateCharacterDataRecord>>& | 138 const HeapVector<Member<UpdateCharacterDataRecord>>& |
| 139 updatedCharacterDataRecords() const { | 139 updatedCharacterDataRecords() const { |
| 140 return m_updatedCharacterDataRecords; | 140 return m_updatedCharacterDataRecords; |
| 141 } | 141 } |
| 142 | 142 |
| 143 DECLARE_TRACE(); | 143 DECLARE_TRACE(); |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 // Implement |SynchronousMutationObserver| member functions. | 146 // Implement |SynchronousMutationObserver| member functions. |
| 147 void contextDestroyed() final; | 147 void contextDestroyed(Document*) final; |
| 148 void didChangeChildren(const ContainerNode&) final; | 148 void didChangeChildren(const ContainerNode&) final; |
| 149 void didMergeTextNodes(Text&, unsigned) final; | 149 void didMergeTextNodes(Text&, unsigned) final; |
| 150 void didSplitTextNode(const Text&) final; | 150 void didSplitTextNode(const Text&) final; |
| 151 void didUpdateCharacterData(CharacterData*, | 151 void didUpdateCharacterData(CharacterData*, |
| 152 unsigned offset, | 152 unsigned offset, |
| 153 unsigned oldLength, | 153 unsigned oldLength, |
| 154 unsigned newLength) final; | 154 unsigned newLength) final; |
| 155 void nodeChildrenWillBeRemoved(ContainerNode&) final; | 155 void nodeChildrenWillBeRemoved(ContainerNode&) final; |
| 156 void nodeWillBeRemoved(Node&) final; | 156 void nodeWillBeRemoved(Node&) final; |
| 157 | 157 |
| 158 int m_contextDestroyedCalledCounter = 0; | 158 int m_contextDestroyedCalledCounter = 0; |
| 159 HeapVector<Member<const ContainerNode>> m_childrenChangedNodes; | 159 HeapVector<Member<const ContainerNode>> m_childrenChangedNodes; |
| 160 HeapVector<Member<MergeTextNodesRecord>> m_mergeTextNodesRecords; | 160 HeapVector<Member<MergeTextNodesRecord>> m_mergeTextNodesRecords; |
| 161 HeapVector<Member<ContainerNode>> m_removedChildrenNodes; | 161 HeapVector<Member<ContainerNode>> m_removedChildrenNodes; |
| 162 HeapVector<Member<Node>> m_removedNodes; | 162 HeapVector<Member<Node>> m_removedNodes; |
| 163 HeapVector<Member<const Text>> m_splitTextNodes; | 163 HeapVector<Member<const Text>> m_splitTextNodes; |
| 164 HeapVector<Member<UpdateCharacterDataRecord>> m_updatedCharacterDataRecords; | 164 HeapVector<Member<UpdateCharacterDataRecord>> m_updatedCharacterDataRecords; |
| 165 | 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(TestSynchronousMutationObserver); | 166 DISALLOW_COPY_AND_ASSIGN(TestSynchronousMutationObserver); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 TestSynchronousMutationObserver::TestSynchronousMutationObserver( | 169 TestSynchronousMutationObserver::TestSynchronousMutationObserver( |
| 170 Document& document) { | 170 Document& document) { |
| 171 setContext(&document); | 171 setContext(&document); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void TestSynchronousMutationObserver::contextDestroyed() { | 174 void TestSynchronousMutationObserver::contextDestroyed(Document*) { |
| 175 ++m_contextDestroyedCalledCounter; | 175 ++m_contextDestroyedCalledCounter; |
| 176 } | 176 } |
| 177 | 177 |
| 178 void TestSynchronousMutationObserver::didChangeChildren( | 178 void TestSynchronousMutationObserver::didChangeChildren( |
| 179 const ContainerNode& container) { | 179 const ContainerNode& container) { |
| 180 m_childrenChangedNodes.push_back(&container); | 180 m_childrenChangedNodes.push_back(&container); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void TestSynchronousMutationObserver::didMergeTextNodes(Text& node, | 183 void TestSynchronousMutationObserver::didMergeTextNodes(Text& node, |
| 184 unsigned offset) { | 184 unsigned offset) { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 { | 603 { |
| 604 setHtmlInnerHTML( | 604 setHtmlInnerHTML( |
| 605 "<body>" | 605 "<body>" |
| 606 "<meta name=\"theme-color\" content=\"#00ff00\">"); | 606 "<meta name=\"theme-color\" content=\"#00ff00\">"); |
| 607 EXPECT_EQ(Color(0, 255, 0), document().themeColor()) | 607 EXPECT_EQ(Color(0, 255, 0), document().themeColor()) |
| 608 << "Theme color should be bright green."; | 608 << "Theme color should be bright green."; |
| 609 } | 609 } |
| 610 } | 610 } |
| 611 | 611 |
| 612 } // namespace blink | 612 } // namespace blink |
| OLD | NEW |