Commit e51a9813 authored by Weilun Shi's avatar Weilun Shi Committed by Commit Bot

Fix the regression problem after using unsafe appendChild

This is a hacky way to fix the regression problem after using the unsafe
appendChild. We need to convert the merged doc back and forth to make
sure it builds indexes for the later pretty-print.

Bug: 1115727
Change-Id: I9225999aec8132e3a069fe79cacc8b1377e99af7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2354206Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Steven Holte <holte@chromium.org>
Auto-Submit: Weilun Shi <sweilun@chromium.org>
Cr-Commit-Position: refs/heads/master@{#798176}
parent c4c488a7
...@@ -131,7 +131,12 @@ def MergeTrees(trees): ...@@ -131,7 +131,12 @@ def MergeTrees(trees):
# Sort the histograms by name and return a single <histograms> node. # Sort the histograms by name and return a single <histograms> node.
CombineHistogramsSorted(doc, trees) + CombineHistogramsSorted(doc, trees) +
GetElementsByTagName(trees, 'histogram_suffixes_list'))) GetElementsByTagName(trees, 'histogram_suffixes_list')))
return doc # After using the unsafe version of appendChild, we see a regression when
# pretty-printing the merged |doc|. This might because the unsafe appendChild
# doesn't build indexes for later lookup. And thus, we need to convert the
# merged |doc| to a xml string and convert it back to force it to build
# indexes for the merged |doc|.
return xml.dom.minidom.parseString(doc.toxml())
def MergeFiles(filenames=[], files=[]): def MergeFiles(filenames=[], files=[]):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment