|
Lines 1-3
a/Source/WebCore/ChangeLog_sec1
|
|
|
1 |
2012-04-16 Hajime Morrita <morrita@chromium.org> |
| 2 |
|
| 3 |
insertedIntoDocument and insertedIntoTree should be unitifed. |
| 4 |
https://bugs.webkit.org/show_bug.cgi?id=82701 |
| 5 |
|
| 6 |
Reviewed by NOBODY (OOPS!). |
| 7 |
|
| 8 |
Both Node::insertedIntoTree() and Node::insertedIntoDocument() are |
| 9 |
served as lifecycle callbacks which are invoked when a node is |
| 10 |
inserted into its new parent. There are also removedFromTree() |
| 11 |
and removedFromDocument() respectively. Considering that this pair |
| 12 |
of virtual functions are laid onto the hot path, it's worth |
| 13 |
merging them into one, to gain some speedup. Such |
| 14 |
unification could clarify the semantics as well. |
| 15 |
|
| 16 |
This change makes following change to merge these functions. |
| 17 |
|
| 18 |
- pulling the tree traversal out from ContainerNode to ChildNodeInsertionNotifier. |
| 19 |
- letting new Node::insertInto() do the job for its own, but not |
| 20 |
for its children and |
| 21 |
- Pass the parent of each insertion root as a parameter of insertedInto(). |
| 22 |
This root node can tell inserted node where it is inserted, |
| 23 |
specifically whetehr the insertion is to the document or not. |
| 24 |
|
| 25 |
Same pattern is also applied to Node::removedFromDocument() and |
| 26 |
Node::removedFromTree(), which are factored to Node::removedFrom() |
| 27 |
and ChildNodeRemovalNotifier respectively. |
| 28 |
|
| 29 |
Speed up on Dromaeo/dom-modify.html is about 2%. |
| 30 |
Further speed-up by de-virtulization would be possible. |
| 31 |
|
| 32 |
Caveat: |
| 33 |
|
| 34 |
There is possible situation where a node need to invoke |
| 35 |
insertedInto() after its children is nofitied, instead of before |
| 36 |
that. It was represented naturally with previous |
| 37 |
traversal-by-ContainerNode pattern, but is no longer simple with |
| 38 |
this new external traversal. To support this scenario, we |
| 39 |
introduced the InsertionNotificationRequest as a return value of insertedInto() |
| 40 |
and a supplemental hook Node::didNotifyDescendantInseretions(). See for |
| 41 |
example HTMLFormElement.cpp to learn how it works. |
| 42 |
|
| 43 |
No new tests. Covered by existing tests. |
| 44 |
|
| 45 |
* CMakeLists.txt: |
| 46 |
* GNUmakefile.list.am: |
| 47 |
* Target.pri: |
| 48 |
* WebCore.gypi: |
| 49 |
* WebCore.xcodeproj/project.pbxproj: |
| 50 |
* dom/ContainerNode.cpp: |
| 51 |
(WebCore::ContainerNode::parserInsertBefore): |
| 52 |
(WebCore::ContainerNode::removeChild): |
| 53 |
(WebCore::ContainerNode::parserRemoveChild): |
| 54 |
(WebCore::ContainerNode::removeChildren): |
| 55 |
(WebCore::ContainerNode::parserAddChild): |
| 56 |
(WebCore::updateTreeAfterInsertion): |
| 57 |
* dom/ContainerNode.h: |
| 58 |
(ContainerNode): |
| 59 |
(WebCore::Node::highestAncestor): |
| 60 |
(WebCore): |
| 61 |
* dom/ContainerNodeAlgorithms.cpp: Added. |
| 62 |
(WebCore): |
| 63 |
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): |
| 64 |
(WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): |
| 65 |
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): |
| 66 |
(WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): |
| 67 |
* dom/ContainerNodeAlgorithms.h: |
| 68 |
(ChildNodeInsertionNotifier): |
| 69 |
(WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): |
| 70 |
(WebCore): |
| 71 |
(ChildNodeRemovalNotifier): |
| 72 |
(WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): |
| 73 |
(WebCore::removeAllChildrenInContainer): |
| 74 |
(WebCore::appendChildToContainer): |
| 75 |
(Private): |
| 76 |
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): |
| 77 |
(WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): |
| 78 |
(WebCore::ChildNodeInsertionNotifier::notifyInsertedIntoDocument): |
| 79 |
(WebCore::ChildNodeInsertionNotifier::notify): |
| 80 |
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): |
| 81 |
(WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): |
| 82 |
(WebCore::ChildNodeRemovalNotifier::notify): |
| 83 |
* dom/DOMAllInOne.cpp: |
| 84 |
* dom/DocumentType.cpp: |
| 85 |
(WebCore::DocumentType::insertedInto): |
| 86 |
(WebCore::DocumentType::removedFrom): |
| 87 |
* dom/DocumentType.h: |
| 88 |
(DocumentType): |
| 89 |
* dom/Element.cpp: |
| 90 |
(WebCore::Element::insertedInto): |
| 91 |
(WebCore::Element::removedFrom): |
| 92 |
* dom/Element.h: |
| 93 |
(Element): |
| 94 |
* dom/Node.cpp: |
| 95 |
(WebCore::Node::insertedInto): |
| 96 |
(WebCore::Node::removedFrom): |
| 97 |
* dom/Node.h: |
| 98 |
(Node): |
| 99 |
(WebCore::Node::didNotifyDescendantInseretions): |
| 100 |
* dom/ProcessingInstruction.cpp: |
| 101 |
(WebCore::ProcessingInstruction::insertedInto): |
| 102 |
(WebCore::ProcessingInstruction::removedFrom): |
| 103 |
* dom/ProcessingInstruction.h: |
| 104 |
(ProcessingInstruction): |
| 105 |
* dom/ScriptElement.cpp: |
| 106 |
(WebCore::ScriptElement::insertedInto): |
| 107 |
* dom/ScriptElement.h: |
| 108 |
(WebCore): |
| 109 |
(ScriptElement): |
| 110 |
* dom/ShadowTree.cpp: |
| 111 |
(WebCore::ShadowTree::addShadowRoot): |
| 112 |
(WebCore::ShadowTree::removeAllShadowRoots): |
| 113 |
* dom/ShadowTree.h: |
| 114 |
(ShadowTree): |
| 115 |
(ShadowRootVector): |
| 116 |
(WebCore::ShadowRootVector::ShadowRootVector): |
| 117 |
(WebCore): |
| 118 |
* html/FormAssociatedElement.cpp: |
| 119 |
(WebCore::FormAssociatedElement::insertedInto): |
| 120 |
(WebCore::FormAssociatedElement::removedFrom): |
| 121 |
(WebCore::FormAssociatedElement::formRemovedFromTree): |
| 122 |
* html/FormAssociatedElement.h: |
| 123 |
(FormAssociatedElement): |
| 124 |
* html/HTMLBaseElement.cpp: |
| 125 |
(WebCore::HTMLBaseElement::insertedInto): |
| 126 |
(WebCore::HTMLBaseElement::removedFrom): |
| 127 |
* html/HTMLBaseElement.h: |
| 128 |
(HTMLBaseElement): |
| 129 |
* html/HTMLBodyElement.cpp: |
| 130 |
(WebCore::HTMLBodyElement::insertedInto): |
| 131 |
(WebCore::HTMLBodyElement::didNotifyDescendantInseretions): |
| 132 |
* html/HTMLBodyElement.h: |
| 133 |
(HTMLBodyElement): |
| 134 |
* html/HTMLFormControlElement.cpp: |
| 135 |
(WebCore::HTMLFormControlElement::insertedInto): |
| 136 |
(WebCore::HTMLFormControlElement::removedFrom): |
| 137 |
* html/HTMLFormControlElement.h: |
| 138 |
(HTMLFormControlElement): |
| 139 |
* html/HTMLFormElement.cpp: |
| 140 |
(WebCore::HTMLFormElement::insertedInto): |
| 141 |
(WebCore::HTMLFormElement::didNotifyDescendantInseretions): |
| 142 |
(WebCore::HTMLFormElement::removedFrom): |
| 143 |
* html/HTMLFormElement.h: |
| 144 |
(HTMLFormElement): |
| 145 |
* html/HTMLFrameElementBase.cpp: |
| 146 |
(WebCore::HTMLFrameElementBase::insertedInto): |
| 147 |
(WebCore): |
| 148 |
(WebCore::HTMLFrameElementBase::didNotifyDescendantInseretions): |
| 149 |
* html/HTMLFrameElementBase.h: |
| 150 |
(HTMLFrameElementBase): |
| 151 |
* html/HTMLFrameSetElement.cpp: |
| 152 |
(WebCore::HTMLFrameSetElement::insertedInto): |
| 153 |
(WebCore::HTMLFrameSetElement::removedFrom): |
| 154 |
* html/HTMLFrameSetElement.h: |
| 155 |
(HTMLFrameSetElement): |
| 156 |
* html/HTMLIFrameElement.cpp: |
| 157 |
(WebCore::HTMLIFrameElement::insertedInto): |
| 158 |
(WebCore::HTMLIFrameElement::removedFrom): |
| 159 |
* html/HTMLIFrameElement.h: |
| 160 |
(HTMLIFrameElement): |
| 161 |
* html/HTMLImageElement.cpp: |
| 162 |
(WebCore::HTMLImageElement::insertedInto): |
| 163 |
(WebCore::HTMLImageElement::removedFrom): |
| 164 |
* html/HTMLImageElement.h: |
| 165 |
(HTMLImageElement): |
| 166 |
* html/HTMLInputElement.cpp: |
| 167 |
(WebCore::HTMLInputElement::insertedInto): |
| 168 |
(WebCore::HTMLInputElement::removedFrom): |
| 169 |
* html/HTMLInputElement.h: |
| 170 |
* html/HTMLLinkElement.cpp: |
| 171 |
(WebCore::HTMLLinkElement::insertedInto): |
| 172 |
(WebCore::HTMLLinkElement::removedFrom): |
| 173 |
* html/HTMLLinkElement.h: |
| 174 |
(HTMLLinkElement): |
| 175 |
* html/HTMLMapElement.cpp: |
| 176 |
(WebCore::HTMLMapElement::insertedInto): |
| 177 |
(WebCore::HTMLMapElement::removedFrom): |
| 178 |
* html/HTMLMapElement.h: |
| 179 |
(HTMLMapElement): |
| 180 |
* html/HTMLMediaElement.cpp: |
| 181 |
(WebCore::HTMLMediaElement::insertedInto): |
| 182 |
(WebCore::HTMLMediaElement::removedFrom): |
| 183 |
* html/HTMLMediaElement.h: |
| 184 |
(HTMLMediaElement): |
| 185 |
* html/HTMLMetaElement.cpp: |
| 186 |
(WebCore::HTMLMetaElement::insertedInto): |
| 187 |
* html/HTMLMetaElement.h: |
| 188 |
(HTMLMetaElement): |
| 189 |
* html/HTMLObjectElement.cpp: |
| 190 |
(WebCore::HTMLObjectElement::insertedInto): |
| 191 |
(WebCore::HTMLObjectElement::removedFrom): |
| 192 |
* html/HTMLObjectElement.h: |
| 193 |
(HTMLObjectElement): |
| 194 |
* html/HTMLOptionElement.cpp: |
| 195 |
(WebCore::HTMLOptionElement::insertedInto): |
| 196 |
* html/HTMLOptionElement.h: |
| 197 |
(HTMLOptionElement): |
| 198 |
* html/HTMLQuoteElement.cpp: |
| 199 |
(WebCore::HTMLQuoteElement::insertedInto): |
| 200 |
* html/HTMLQuoteElement.h: |
| 201 |
(HTMLQuoteElement): |
| 202 |
* html/HTMLScriptElement.cpp: |
| 203 |
(WebCore::HTMLScriptElement::insertedInto): |
| 204 |
* html/HTMLScriptElement.h: |
| 205 |
(HTMLScriptElement): |
| 206 |
* html/HTMLSelectElement.cpp: |
| 207 |
(WebCore::HTMLSelectElement::insertedInto): |
| 208 |
* html/HTMLSelectElement.h: |
| 209 |
* html/HTMLSourceElement.cpp: |
| 210 |
(WebCore::HTMLSourceElement::insertedInto): |
| 211 |
* html/HTMLSourceElement.h: |
| 212 |
(HTMLSourceElement): |
| 213 |
* html/HTMLStyleElement.cpp: |
| 214 |
(WebCore::HTMLStyleElement::insertedInto): |
| 215 |
(WebCore::HTMLStyleElement::removedFrom): |
| 216 |
* html/HTMLStyleElement.h: |
| 217 |
(HTMLStyleElement): |
| 218 |
* html/HTMLTextFormControlElement.cpp: |
| 219 |
(WebCore::HTMLTextFormControlElement::insertedInto): |
| 220 |
* html/HTMLTextFormControlElement.h: |
| 221 |
* html/HTMLTitleElement.cpp: |
| 222 |
(WebCore::HTMLTitleElement::insertedInto): |
| 223 |
(WebCore::HTMLTitleElement::removedFrom): |
| 224 |
* html/HTMLTitleElement.h: |
| 225 |
(HTMLTitleElement): |
| 226 |
* html/HTMLTrackElement.cpp: |
| 227 |
(WebCore::HTMLTrackElement::insertedInto): |
| 228 |
* html/HTMLTrackElement.h: |
| 229 |
(HTMLTrackElement): |
| 230 |
* mathml/MathMLMathElement.cpp: |
| 231 |
(WebCore::MathMLMathElement::insertedInto): |
| 232 |
* mathml/MathMLMathElement.h: |
| 233 |
(MathMLMathElement): |
| 234 |
* svg/SVGElement.cpp: |
| 235 |
(WebCore::SVGElement::removedFrom): |
| 236 |
* svg/SVGElement.h: |
| 237 |
(SVGElement): |
| 238 |
* svg/SVGFEImageElement.cpp: |
| 239 |
(WebCore::SVGFEImageElement::insertedInto): |
| 240 |
(WebCore::SVGFEImageElement::removedFrom): |
| 241 |
* svg/SVGFEImageElement.h: |
| 242 |
(SVGFEImageElement): |
| 243 |
* svg/SVGFontFaceElement.cpp: |
| 244 |
(WebCore::SVGFontFaceElement::insertedInto): |
| 245 |
(WebCore::SVGFontFaceElement::removedFrom): |
| 246 |
* svg/SVGFontFaceElement.h: |
| 247 |
(SVGFontFaceElement): |
| 248 |
* svg/SVGFontFaceUriElement.cpp: |
| 249 |
(WebCore::SVGFontFaceUriElement::insertedInto): |
| 250 |
* svg/SVGFontFaceUriElement.h: |
| 251 |
(SVGFontFaceUriElement): |
| 252 |
* svg/SVGGlyphElement.cpp: |
| 253 |
(WebCore::SVGGlyphElement::insertedInto): |
| 254 |
(WebCore::SVGGlyphElement::removedFrom): |
| 255 |
* svg/SVGGlyphElement.h: |
| 256 |
(SVGGlyphElement): |
| 257 |
* svg/SVGHKernElement.cpp: |
| 258 |
(WebCore::SVGHKernElement::insertedInto): |
| 259 |
(WebCore::SVGHKernElement::removedFrom): |
| 260 |
* svg/SVGHKernElement.h: |
| 261 |
(SVGHKernElement): |
| 262 |
* svg/SVGImageElement.cpp: |
| 263 |
(WebCore::SVGImageElement::insertedInto): |
| 264 |
* svg/SVGImageElement.h: |
| 265 |
(SVGImageElement): |
| 266 |
* svg/SVGSVGElement.cpp: |
| 267 |
(WebCore::SVGSVGElement::insertedInto): |
| 268 |
(WebCore::SVGSVGElement::removedFrom): |
| 269 |
* svg/SVGSVGElement.h: |
| 270 |
(SVGSVGElement): |
| 271 |
* svg/SVGScriptElement.cpp: |
| 272 |
(WebCore::SVGScriptElement::insertedInto): |
| 273 |
* svg/SVGScriptElement.h: |
| 274 |
(SVGScriptElement): |
| 275 |
* svg/SVGStyleElement.cpp: |
| 276 |
(WebCore::SVGStyleElement::insertedInto): |
| 277 |
(WebCore::SVGStyleElement::removedFrom): |
| 278 |
* svg/SVGStyleElement.h: |
| 279 |
(SVGStyleElement): |
| 280 |
* svg/SVGStyledElement.cpp: |
| 281 |
(WebCore::SVGStyledElement::insertedInto): |
| 282 |
(WebCore::SVGStyledElement::removedFrom): |
| 283 |
(WebCore::SVGStyledElement::updateRelativeLengthsInformation): |
| 284 |
* svg/SVGStyledElement.h: |
| 285 |
(SVGStyledElement): |
| 286 |
* svg/SVGTRefElement.cpp: |
| 287 |
(WebCore::SVGTRefElement::buildPendingResource): |
| 288 |
(WebCore::SVGTRefElement::insertedInto): |
| 289 |
(WebCore::SVGTRefElement::removedFrom): |
| 290 |
* svg/SVGTRefElement.h: |
| 291 |
(SVGTRefElement): |
| 292 |
* svg/SVGTextPathElement.cpp: |
| 293 |
(WebCore::SVGTextPathElement::insertedInto): |
| 294 |
* svg/SVGTextPathElement.h: |
| 295 |
* svg/SVGTitleElement.cpp: |
| 296 |
(WebCore::SVGTitleElement::insertedInto): |
| 297 |
(WebCore::SVGTitleElement::removedFrom): |
| 298 |
* svg/SVGTitleElement.h: |
| 299 |
(SVGTitleElement): |
| 300 |
* svg/SVGUseElement.cpp: |
| 301 |
(WebCore::SVGUseElement::insertedInto): |
| 302 |
(WebCore::SVGUseElement::removedFrom): |
| 303 |
* svg/SVGUseElement.h: |
| 304 |
(SVGUseElement): |
| 305 |
* svg/SVGVKernElement.cpp: |
| 306 |
(WebCore::SVGVKernElement::insertedInto): |
| 307 |
(WebCore::SVGVKernElement::removedFrom): |
| 308 |
* svg/SVGVKernElement.h: |
| 309 |
(SVGVKernElement): |
| 310 |
* svg/animation/SVGSMILElement.cpp: |
| 311 |
(WebCore::SVGSMILElement::insertedInto): |
| 312 |
(WebCore::SVGSMILElement::removedFrom): |
| 313 |
* svg/animation/SVGSMILElement.h: |
| 314 |
(SVGSMILElement): |
| 315 |
|
| 1 |
2012-04-14 Emil A Eklund <eae@chromium.org> |
316 |
2012-04-14 Emil A Eklund <eae@chromium.org> |
| 2 |
|
317 |
|
| 3 |
Fix pixelSnapping for CalendarPicker, MediaControl and ScrollbarPart |
318 |
Fix pixelSnapping for CalendarPicker, MediaControl and ScrollbarPart |