Reduce unnecessary generation of HTML elements in DocumentXMLTreeViewer.js.
The current structure looks (in a very abstract form for readability, e.g. <div class="collapsible"...> -> <collapsible>): <collapsible> (stay) <expanded> (remove) <line> (stay) <collapse-button> (-> collapsible-button) <html-tag> (stay) <collapsible-content> (-> expanded-content) <collapsible> (stay) <line> (stay) <html-tag> (stay) <collapsed> (-> collapsed-content, become <text>...</text>, move under <collapsible>) <line> (remove) <expand-button> (merged to collapsible-button) <html-tag> (remove) <text>... (remove) <html-tag> (remove) The changed structure looks: <collapsible> <line> <collapsible-button> <html-tag> <expanded-content> <collapsible> <collapsed-content>... <line> <html-tag> The saving in terms of number of elements ranges 20%-30% depending on the size of the text in an XML element. For example, a longer text in XML will create more HTML elements, which means the saving ratio is higher in that case. Tested XML files (from random searches): https://www.sitemaps.org/sitemap.xml https://ririkaburbe.tk/sitemap_0.xml http://big5.sputniknews.cn/export/rss2/archive/index.xml Change-Id: Ibfefb175b58bc54c3f31e65456ff832d432d5c6a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2062797 Commit-Queue: Dong-Hwi Lee <leedh@google.com> Reviewed-by:Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#742705}
Showing
Please register or sign in to comment