Re: [webkit-dev] Version control survey results
(For current svn users I assume using svn would become effectively impossible; the only tool I could find to do this is server-side and essentially maintains git and svn repositories in parallel.) FYI, any Git repository on GitHub also functions as a Subversion repository: $ svn checkout https://github.com/WebKit/webkit/trunk WebKit AWebKit/.dir-locals.el AWebKit/.gitattributes AWebKit/.gitignore AWebKit/.qmake.conf AWebKit/CMakeLists.txt AWebKit/ChangeLog AWebKit/ChangeLog-2012-05-22 AWebKit/Examples AWebKit/Examples/ChangeLog AWebKit/Examples/NetscapeCocoaPlugin AWebKit/Examples/NetscapeCocoaPlugin/English.lproj AWebKit/Examples/NetscapeCocoaPlugin/English.lproj/InfoPlist.strings AWebKit/Examples/NetscapeCocoaPlugin/Info.plist AWebKit/Examples/NetscapeCocoaPlugin/MenuHandler.h AWebKit/Examples/NetscapeCocoaPlugin/MenuHandler.m … You can even use Subversion branches to create pull requests on GitHub (though I don't know what the performance would be like for a repository as large as WebKit): https://github.com/blog/1178-collaborating-on-github-with-subversion. GitHub doesn't currently make the Subversion-Git bridge available for non-GitHub repositories. I don't say this to try to convince anyone to switch to Git or GitHub; I just thought it seemed relevant. -Adam ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Access WebKit Rendering pixel data
Thanks for the reply. What you saying is that there is no clean way to do it in WebKit itself, I will have to go to the platform specific code to do it. Best, Michael From: Arunprasad Rajkumar ararunpra...@gmail.com To: Michael Chen michael8...@yahoo.com Cc: webkit-dev@lists.webkit.org webkit-dev@lists.webkit.org Sent: Saturday, February 16, 2013 5:51 AM Subject: Re: [webkit-dev] Access WebKit Rendering pixel data Are you talking about Rendered buffer? It is graphics library specific. From which layer you wanted to access? Each WebKit port(qt,gtk,chromium,efl,wx,mac) has their own API exposed to the app developers. Incase of Qt QWebView is a QWidget and you can use http://doc.qt.digia.com/qt/qwidget.html#render to get the rendered buffer as QPixmap object. In GTK port you can get the Cairo context and copy it to the Cairo_image_t(pixman backed Cairo surface). On Feb 16, 2013 8:23 AM, Michael Chen michael8...@yahoo.com wrote: Hi All, I am new to WebKit. Is it possible to get a raw pointer to the WebKit rendering buffer? I appreciate any comments. Best regards, Michael ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Github repository not being updated
Fixed a few hours ago. During my holidays last week there was a network failure problem, followed by one of those vcproj files becoming dirty and not allowing the mirror to update itself. Sorry of the inconvenience. cheers, jesus 2013/2/16 Vivek Galatage viv...@webkit.org: Hello Webkit-dev, I am using the github repository https://github.com/webkit/webkit but since the rev 142863 its not been updated. i.e. since 3 days. So wanted to see if someone who is maintaining this repo can look into this and fix if possible. Many thanks, Vivek ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Access WebKit Rendering pixel data
yes :). WebKit is not a library, so it don't have defined form of API exposed. The one who _uses_ WebCore(WebCore+WTF+JSC/V8) called as Embedders have some form of API, but again it is up-to them to expose the level of control to outside. Embedders call their work by different names like QtWebKit, GTK WebKit, EFL WebKit,... they may provide as libraries. All have some level of documented Public API for its users. Refer, GTK WebKit - http://webkitgtk.org/?page=documentation QtWebKit - http://qt-project.org/doc/qt-4.8/qtwebkit.html EFL WebKit Start-up Guide - http://www.politreco.com/2010/10/easily-embedding-webkit-into-your-efl-application/ If you already choose some library, then make your question specific and post it to appropriate mailing listhttps://lists.webkit.org/mailman/listinfo. webkit-dev is not the right place to ask this question :) On 18 February 2013 22:04, Michael Chen michael8...@yahoo.com wrote: Thanks for the reply. What you saying is that there is no clean way to do it in WebKit itself, I will have to go to the platform specific code to do it. Best, Michael -- *From:* Arunprasad Rajkumar ararunpra...@gmail.com *To:* Michael Chen michael8...@yahoo.com *Cc:* webkit-dev@lists.webkit.org webkit-dev@lists.webkit.org *Sent:* Saturday, February 16, 2013 5:51 AM *Subject:* Re: [webkit-dev] Access WebKit Rendering pixel data Are you talking about Rendered buffer? It is graphics library specific. From which layer you wanted to access? Each WebKit port(qt,gtk,chromium,efl,wx,mac) has their own API exposed to the app developers. Incase of Qt QWebView is a QWidget and you can use http://doc.qt.digia.com/qt/qwidget.html#render to get the rendered buffer as QPixmap object. In GTK port you can get the Cairo context and copy it to the Cairo_image_t(pixman backed Cairo surface). On Feb 16, 2013 8:23 AM, Michael Chen michael8...@yahoo.com wrote: Hi All, I am new to WebKit. Is it possible to get a raw pointer to the WebKit rendering buffer? I appreciate any comments. Best regards, Michael ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev -- *Arunprasad Rajkumar* http://in.linkedin.com/in/ararunprasad ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Access WebKit Rendering pixel data
On Mon, Feb 18, 2013 at 9:57 AM, Arunprasad Rajkumar ararunpra...@gmail.com wrote: yes :). WebKit is not a library, so it don't have defined form of API exposed. The one who _uses_ WebCore(WebCore+WTF+JSC/V8) called as Embedders have some form of API, but again it is up-to them to expose the level of control to outside. Embedders call their work by different names like QtWebKit, GTK WebKit, EFL WebKit,... they may provide as libraries. All have some level of documented Public API for its users. A small clarification: The ports are not embedders. It's true that WebKit, the project, is not a library. It is a code base and a community. Certain ports of WebKit are libraries or embedding APIs, such as Mac Webkit, QtWebKit, EFLWebKit and WebKitGTK+. Because of the history of the WebKit project, the Mac port is sometimes just called WebKit. You can think of the ports as WebKit implemented for a particular platform. These port libraries expose WebKit in slightly different ways depending on the culture and needs of the communities in which they exist. Applications that use a WebKit library to show a WebView or otherwise access web content are called embedders. Since this discussion is not about development of WebKit internals, it's probably better to move it to webkit-help. --Martin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Access WebKit Rendering pixel data
Yes :) Thanks for your better explanation correction. On 19 February 2013 00:04, Martin Robinson mrobin...@webkit.org wrote: On Mon, Feb 18, 2013 at 9:57 AM, Arunprasad Rajkumar ararunpra...@gmail.com wrote: yes :). WebKit is not a library, so it don't have defined form of API exposed. The one who _uses_ WebCore(WebCore+WTF+JSC/V8) called as Embedders have some form of API, but again it is up-to them to expose the level of control to outside. Embedders call their work by different names like QtWebKit, GTK WebKit, EFL WebKit,... they may provide as libraries. All have some level of documented Public API for its users. A small clarification: The ports are not embedders. It's true that WebKit, the project, is not a library. It is a code base and a community. Certain ports of WebKit are libraries or embedding APIs, such as Mac Webkit, QtWebKit, EFLWebKit and WebKitGTK+. Because of the history of the WebKit project, the Mac port is sometimes just called WebKit. You can think of the ports as WebKit implemented for a particular platform. These port libraries expose WebKit in slightly different ways depending on the culture and needs of the communities in which they exist. Applications that use a WebKit library to show a WebView or otherwise access web content are called embedders. Since this discussion is not about development of WebKit internals, it's probably better to move it to webkit-help. --Martin -- *Arunprasad Rajkumar* http://in.linkedin.com/in/ararunprasad ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
[webkit-dev] Getting involved
Hi all, With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated. Also I have the code all built, however if I ./run-safari I get Can't find built framework at /Users/jason/research/webkit/WebKitBuild/Release/JavaScriptCore.framework/Versions/A/JavaScriptCore. I will work out the problem, but in case someone knows exactly what I have done wrong, it may save me some time. Cheers Jason ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Getting involved
Hi Jason, On Mon, Feb 18, 2013 at 2:45 PM, Jason Anderssen janders...@exactal.comwrote: With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated. Also I have the code all built, however if I ./run-safari I get Can't find built framework at /Users/jason/research/webkit/WebKitBuild/Release/JavaScriptCore.framework/Versions/A/JavaScriptCore. I will work out the problem, but in case someone knows exactly what I have done wrong, it may save me some time. First welcome to WebKit :) I am sure there is a better use of your time than fixing the coding style. A side project of mine is improving and cleaning some of WebKit testing infrastructure. There are some fairly easy tasks related to that if you are interested. I am sure others will have ideas of easy things to do to get started. For your build/run issues, it will be easier to ask on IRC #webkit than on the mailing list. Benjamin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Getting involved
On Feb 18, 2013, at 2:45 PM, Jason Anderssen janders...@exactal.com wrote: Hi all, With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated We actually shy away from mass code reformatting. It obscures useful revision history. It's fine to reformat code for code you're actually changing, but reformatting for the sake of reformatting isn't useful, and may be harmful. Simon ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Getting involved
One alternative to mass-reformatting is to improve the style checker. There are many cases not covered by it today: http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py On Mon, Feb 18, 2013 at 3:30 PM, Simon Fraser simon.fra...@apple.comwrote: On Feb 18, 2013, at 2:45 PM, Jason Anderssen janders...@exactal.com wrote: Hi all, With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated We actually shy away from mass code reformatting. It obscures useful revision history. It's fine to reformat code for code you're actually changing, but reformatting for the sake of reformatting isn't useful, and may be harmful. Simon ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Getting involved
Thank you Simon for you response and totally understand your stance. What would my best options to help towards this project to get started? Jason From: Simon Fraser simon.fra...@apple.commailto:simon.fra...@apple.com Date: Tue, 19 Feb 2013 09:30:09 +1000 To: Jason Anderssen janders...@exactal.commailto:janders...@exactal.com Cc: webkit-dev@lists.webkit.orgmailto:webkit-dev@lists.webkit.org webkit-dev@lists.webkit.orgmailto:webkit-dev@lists.webkit.org Subject: Re: [webkit-dev] Getting involved On Feb 18, 2013, at 2:45 PM, Jason Anderssen janders...@exactal.commailto:janders...@exactal.com wrote: Hi all, With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.orghttp://webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated We actually shy away from mass code reformatting. It obscures useful revision history. It's fine to reformat code for code you're actually changing, but reformatting for the sake of reformatting isn't useful, and may be harmful. Simon ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] Getting involved
Hello Benjamin, Thank you for a starting point and would like to explore further with this. Please point me in the right direction to how I can help in the cleaning of the WebKit testing infrastructure please. This will also allow me to understand how all you guys work together and understand the procedures etc.. Cheers Jason From: Benjamin Poulain benja...@webkit.orgmailto:benja...@webkit.org Date: Tue, 19 Feb 2013 08:52:17 +1000 To: Jason Anderssen janders...@exactal.commailto:janders...@exactal.com Cc: webkit-dev@lists.webkit.orgmailto:webkit-dev@lists.webkit.org webkit-dev@lists.webkit.orgmailto:webkit-dev@lists.webkit.org Subject: Re: [webkit-dev] Getting involved Hi Jason, On Mon, Feb 18, 2013 at 2:45 PM, Jason Anderssen janders...@exactal.commailto:janders...@exactal.com wrote: With a background in development (both windows and MAC) I was wanting to get involved in an open source project that I believe is going to make the world a greater place. So I have decided to get involved with the WebKit project. I would like to start of by performing the boring work of reformatting code to suite the guidelines as stipulated on the webkit.orghttp://webkit.org website (and double check that they are still up to date), and would like recommendations to which parts of the project could do with the re-formatting first up. ( I feel this will get me to know the framework, and structure of the code base well, before I can start inputting my coding and help. ) Any feedback to where to start would be very much appreciated. Also I have the code all built, however if I ./run-safari I get Can't find built framework at /Users/jason/research/webkit/WebKitBuild/Release/JavaScriptCore.framework/Versions/A/JavaScriptCore. I will work out the problem, but in case someone knows exactly what I have done wrong, it may save me some time. First welcome to WebKit :) I am sure there is a better use of your time than fixing the coding style. A side project of mine is improving and cleaning some of WebKit testing infrastructure. There are some fairly easy tasks related to that if you are interested. I am sure others will have ideas of easy things to do to get started. For your build/run issues, it will be easier to ask on IRC #webkit than on the mailing list. Benjamin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
[webkit-dev] AncestorChainWalker substance and style thoughts
I am trying to learn about code related to shadow DOM that needs to be understood by anyone working on an part of the DOM. I have some questions and concerns about AncestorChainWalker. If there is a document I should be reading that covers these, please point me to it. The parentNode and parentElement functions are just plain old functions that are used to walk the ancestor chain of the normal DOM. But the shadow DOM AncestorChainWalker is a class. Why? It seems that it could just be a function with two return values. Is it more efficient to have it be a class? Can the operation be correctly done without storing m_distributedNode in a data member? There is a function in AncestorChainWalker named parent. That name is a noun, so the function should be a const function that returns a value. Since it’s not, the function name should be a verb phrase, such as advanceToParent, or event just “advance” since it’s in the context of an ancestor chain walker. The function crossingInsertionPoint should be named isCrossingInsertionPoint as the data member is. But also, since the walker sits still on a single node, I don’t think it makes sense to talk about the position as “is crossing”. It should be “just crossed” or something like that instead. Unless an insertion point is like a bridge and is not itself a “true node”. The function that returns the current node in the ancestor chain is named “get”. That’s not a good name, and should be avoided if possible. It could be named “node” or “currentNode” instead. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
See https://bugs.webkit.org/show_bug.cgi?id=110146 where we're going to rename the class, member functions and variables. On Mon, Feb 18, 2013 at 5:37 PM, Darin Adler da...@apple.com wrote: There is a function in AncestorChainWalker named parent. That name is a noun, so the function should be a const function that returns a value. Since it’s not, the function name should be a verb phrase, such as advanceToParent, or event just “advance” since it’s in the context of an ancestor chain walker. The function crossingInsertionPoint should be named isCrossingInsertionPoint as the data member is. But also, since the walker sits still on a single node, I don’t think it makes sense to talk about the position as “is crossing”. It should be “just crossed” or something like that instead. Unless an insertion point is like a bridge and is not itself a “true node”. hasCrossedInsertionPoint? The function that returns the current node in the ancestor chain is named “get”. That’s not a good name, and should be avoided if possible. It could be named “node” or “currentNode” instead. Yup. Completely agree. - R. Niwa ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
AncestorChainWalker follows the style of ComposedShadowTreeWalker, which also breaks conventions like mutations-should-be-verbs. We also fix its style for integrity. Non-trivial tree traversal API in general should, IMO, be modeled after recently introduced NodeTraversal. Having separate namespaces allows us to keep Node API minimal. Also it is stateless and simple. I made NodeRenderingTraversal in that way. AncestorChainWalker could be just merged to NodeRenderingTraversal. Speaking of ComposedShadowTreeWalker, I think it is worth having a class instead of namespace since it holds configuration parameters to decide, for example, whether it skips specific types of node. On Tue, Feb 19, 2013 at 10:37 AM, Darin Adler da...@apple.com wrote: I am trying to learn about code related to shadow DOM that needs to be understood by anyone working on an part of the DOM. I have some questions and concerns about AncestorChainWalker. If there is a document I should be reading that covers these, please point me to it. The parentNode and parentElement functions are just plain old functions that are used to walk the ancestor chain of the normal DOM. But the shadow DOM AncestorChainWalker is a class. Why? It seems that it could just be a function with two return values. Is it more efficient to have it be a class? Can the operation be correctly done without storing m_distributedNode in a data member? There is a function in AncestorChainWalker named parent. That name is a noun, so the function should be a const function that returns a value. Since it’s not, the function name should be a verb phrase, such as advanceToParent, or event just “advance” since it’s in the context of an ancestor chain walker. The function crossingInsertionPoint should be named isCrossingInsertionPoint as the data member is. But also, since the walker sits still on a single node, I don’t think it makes sense to talk about the position as “is crossing”. It should be “just crossed” or something like that instead. Unless an insertion point is like a bridge and is not itself a “true node”. The function that returns the current node in the ancestor chain is named “get”. That’s not a good name, and should be avoided if possible. It could be named “node” or “currentNode” instead. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Feb 18, 2013, at 6:17 PM, Ryosuke Niwa rn...@webkit.org wrote: See https://bugs.webkit.org/show_bug.cgi?id=110146 where we're going to rename the class, member functions and variables. Thanks. Good discussion there. What about my other question? Why is this a class instead of a function? -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Feb 18, 2013, at 6:18 PM, Hajime Morrita morr...@chromium.org wrote: Non-trivial tree traversal API in general should, IMO, be modeled after recently introduced NodeTraversal. Having separate namespaces allows us to keep Node API minimal. Also it is stateless and simple. I made NodeRenderingTraversal in that way. AncestorChainWalker could be just merged to NodeRenderingTraversal. That sounds like a promising direction. Speaking of ComposedShadowTreeWalker, I think it is worth having a class instead of namespace since it holds configuration parameters to decide, for example, whether it skips specific types of node. I think this depends on how often this is used, and how. The designers of the DOM took an approach like this with NodeIterator and it has not proved a popular API design with clients. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
AncestorChainWalker follows the style of ComposedShadowTreeWalker, which also breaks conventions like mutations-should-be-verbs. We also fix its style for integrity. We *should*. It is yet to be done :-/ ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Mon, Feb 18, 2013 at 6:18 PM, Darin Adler da...@apple.com wrote: On Feb 18, 2013, at 6:17 PM, Ryosuke Niwa rn...@webkit.org wrote: See https://bugs.webkit.org/show_bug.cgi?id=110146 where we're going to rename the class, member functions and variables. Thanks. Good discussion there. What about my other question? Why is this a class instead of a function? 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. 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. - R. Niwa ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Feb 18, 2013, at 6:28 PM, Ryosuke Niwa rn...@webkit.org wrote: 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. Does it? Is it really necessary to have the distributed node state or is that just performance optimization? -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Mon, Feb 18, 2013 at 6:38 PM, Darin Adler da...@apple.com wrote: On Feb 18, 2013, at 6:28 PM, Ryosuke Niwa rn...@webkit.org wrote: 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. Does it? Is it really necessary to have the distributed node state or is that just performance optimization? Many users of this class ends up walking up the ancestry tree. In that case, having a state/iterator object like this makes sense. But you're right in that the case of one off call to parent(), there isn't much point in creating an object. We can probably get away with a single function call. - R. Niwa ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev
Re: [webkit-dev] AncestorChainWalker substance and style thoughts
On Feb 18, 2013, at 6:40 PM, Ryosuke Niwa rn...@webkit.org wrote: But you're right in that the case of one off call to parent(), there isn't much point in creating an object. We can probably get away with a single function call. We can always add a convenience function for going a single level even if the walker class exists. But before we decide we have to have both, I suggest we double check that we need the class. That’s why I am asking. -- Darin ___ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev