On Mon, Feb 18, 2013 at 6:18 PM, Darin Adler <span dir="ltr"><<a href="mailto:darin@apple.com" target="_blank">darin@apple.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Feb 18, 2013, at 6:17 PM, Ryosuke Niwa <<a href="mailto:rniwa@webkit.org">rniwa@webkit.org</a>> wrote:<br>
<br>
> See <a href="https://bugs.webkit.org/show_bug.cgi?id=110146" target="_blank">https://bugs.webkit.org/show_bug.cgi?id=110146</a> where we're going to rename the class, member functions and variables.<br>
<br>
</div>Thanks. Good discussion there.<br>
<br>
What about my other question? Why is this a class instead of a function?<br></blockquote><div><br></div><div>I had the same question when I found this class today but when I tried to turn it into a function, I realized that each caller of this function now needs to maintain two variables instead of one. Since those two variables (node and distributedNode) need to be in a consistent state, I've thought of creating a state object but then it seemed silly to create a state object only and a free function. It's much more natural for it be just a "walker" class.</div>
<div><br></div><div>Having said that, I don't like seemingly excessive use of design patterns prevalent in some of the code we're adding, particularly, for shadow DOM.</div><div><br></div><div>- R. Niwa</div><div>
<br></div></div>