Last active
December 16, 2015 05:29
-
-
Save wlt/5385224 to your computer and use it in GitHub Desktop.
メソッドutil.xmlToDomForTemplateが常に、2n+1番目のノードのみを返す問題の修正
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HG changeset patch | |
# User wlt_lain <wltlain@gmail.com> | |
# Date 1366000762 25200 | |
# Node ID b39b4cdbf57003cfb730f1722ebe9e18f7d33375 | |
# Parent cc470b88dfb692ca10dcb33fe3c4c7d3978dc2db | |
fix: util.xmlToDomForTemplate | |
diff -r cc470b88dfb6 -r b39b4cdbf570 common/content/util.js | |
--- a/common/content/util.js Sat Apr 13 19:34:16 2013 +0900 | |
+++ b/common/content/util.js Sun Apr 14 21:39:22 2013 -0700 | |
@@ -786,8 +786,8 @@ | |
var range = doc.createRange(); | |
var fragment = range.createContextualFragment( | |
xml`<div xmlns:ns=${NS} xmlns:xul=${XUL} xmlns=${XHTML}>${node}</div>`.toString()); | |
- for (let node of fragment.firstChild.childNodes) | |
- dom.appendChild(node); | |
+ while (fragment.firstChild.childNodes.length > 0) | |
+ dom.appendChild(fragment.firstChild.firstChild) | |
range.detach(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
これは分かりやすい!ありがとうございます。