gecko-dev/dom/xml
Kirk Steuber 7fdb378650 Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz
Currently, attribute and child arrays (implemented in dom/base/nsAttrAndChildArray.h) start out empty. When cloning, the array ends up being resized multiple times in order to add the attributes and children that are being cloned from the original node. This would be quicker if the array was initialized to the correct size in the first place so that resizes are not necessary.

However, preallocating space for children is only necessary when performing a deep clone. Therefore, an additional parameter is being added to the Clone, CopyInnerTo, and CloneDocHelper methods to indicate whether preallocation of children should happen. Attributes are copied either way, so that part of the array is preallocated in both cases.

MozReview-Commit-ID: 3iVezeAKXnI

--HG--
extra : rebase_source : 9c3deec6d7aafd6411044d623d4863637b45fd58
2017-04-20 12:57:48 -07:00
..
crashtests
resources Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
test Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
CDATASection.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
CDATASection.h
ProcessingInstruction.cpp Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm. 2016-03-29 10:09:43 +11:00
ProcessingInstruction.h
XMLDocument.cpp Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz 2017-04-20 12:57:48 -07:00
XMLDocument.h Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz 2017-04-20 12:57:48 -07:00
XMLStylesheetProcessingInstruction.cpp Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
XMLStylesheetProcessingInstruction.h
htmlmathml-f.ent
moz.build Bug 1335099 - add BUG_COMPONENT to many dom/* subdir files. r=overholt 2017-02-06 09:45:55 -05:00
nsIXMLContentSink.h
nsXMLContentSink.cpp Bug 1333990: Part 2c.1 - Interrupt the XML flush loop after inserting document element. r=hsivonen 2017-03-15 14:04:37 -07:00
nsXMLContentSink.h Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky 2017-01-05 15:31:56 +08:00
nsXMLElement.cpp Bug 1355351: Add a node property to access the ::before and ::after pseudo-elements. r=heycam 2017-04-16 17:29:49 +02:00
nsXMLElement.h Bug 1359556 - Optimize cloneNode by preinitializing attribute and child arrays r=bz 2017-04-20 12:57:48 -07:00
nsXMLFragmentContentSink.cpp Bug 1356843 - Fix -Wcomma warnings in dom/base/ and dom/xml/. r=bz 2017-03-27 19:41:50 -07:00
nsXMLPrettyPrinter.cpp Bug 1304623 - Create a pref to control the default referrer policy - part 3. r=bkelly 2017-01-05 11:29:56 +08:00
nsXMLPrettyPrinter.h