|
|
|
Created:
18 years ago by MikeSamuel Modified:
17 years, 4 months ago CC:
google-caja-discuss_googlegroups.com Base URL:
http://google-caja.googlecode.com/svn/trunk/ Visibility:
Public. |
DescriptionThe package.html describes the code layout for the fleshed out DOMita.
It lists the files and broadly what each will do, talks about how the
tamed node types are derived from the definitions in the DOM Level 2
spec, and covers topics such as parentNode and ownerDocument
navigation in valija and cajita; and focus handling.
Patch Set 1 #Patch Set 2 : Rough draft of design for a fleshed out DOMita. #Patch Set 3 : Rough draft of design for a fleshed out DOMita. #
Total comments: 7
Patch Set 4 : Rough draft of design for a fleshed out DOMita. #Patch Set 5 : Rough draft of design for a fleshed out DOMita. #Patch Set 6 : Rough draft of design for a fleshed out DOMita. #Patch Set 7 : Rough draft of design for a fleshed out DOMita. #Patch Set 8 : Rough draft of design for a fleshed out DOMita. #Patch Set 9 : Rough draft of design for a fleshed out DOMita. #
Total comments: 30
Patch Set 10 : Rough draft of design for a fleshed out DOMita. #Patch Set 11 : Rough draft of design for a fleshed out DOMita. #Patch Set 12 : Rough draft of design for a fleshed out DOMita. #
Total comments: 26
Patch Set 13 : Rough draft of design for a fleshed out DOMita. #
Total comments: 1
MessagesTotal messages: 10
A couple notes; haven't finished reading yet. http://codereview.appspot.com/8877/diff/1/2 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/1/2#newcode152 Line 152: var myGrandChild = myChild.firstSibling; // roots are union(R,[myNode,myChild]) myChild = myNode.firstChild; myGrandChild = myChild.firstChild; http://codereview.appspot.com/8877/diff/1/2#newcode163 Line 163: then the node at which <code>myNode</code>'s is rooted is used. The Extra 's, and I don't understand: how does it know to use myNode's root when accessing myGrandChild?
Sign in to reply to this message.
http://codereview.appspot.com/8877/diff/1/2 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/1/2#newcode14 Line 14: <dd>A node N is a descendant of M iff N is M is reachable from M by "N is M is reachable from M..." did you mean "N is M or N is reachable from M..."? http://codereview.appspot.com/8877/diff/1/2#newcode19 Line 19: <dd>A node which governs upwards cut off sentence? http://codereview.appspot.com/8877/diff/1/2#newcode29 Line 29: it may be a descendant of a sibling of a strict ancestor of M.</dd> Or (assuming a forest, as you do below) N may simply be in a tree disjoint from the tree containing M. http://codereview.appspot.com/8877/diff/1/2#newcode87 Line 87: which <code>parentNode</code> is exposed to legacy code in Valija. Most of the rest of the document elaborates this original plan, which is consistent with the original Domado plan at the Cajita level. However, from our verbal conversations, it seems we're likely to dispense with this plan. If we go instead with a coarser-grain division of the dom tree into separately permitted virtual iframes (vframes?), rather than separately permitted nodes, the rest of this document comes to be only of historical interest. Within a vframe, parent navigation would be available at the Cajita level via the legacy API (i.e., without needing the roots parameter). http://codereview.appspot.com/8877/diff/1/2#newcode176 Line 176: restricted by the virtual document scheme. Does "virtual document" refer to the same notion as our conversation about vframes? http://codereview.appspot.com/8877/diff/1/2#newcode176 Line 176: restricted by the virtual document scheme. Under the vframe scheme, similar issues arise if we allow the splicing of a dom tree from one vframe into another. http://codereview.appspot.com/8877/diff/1/2#newcode199 Line 199: <p>When <code>parentNode</code> (or other containing node member) Under the vframe scheme, the corresponding question is: should parent or child traversal past a vframe boundary result in an opaque node rather than the apparent absence of a node? Probably not, but an interesting question. http://codereview.appspot.com/8877/diff/1/2#newcode204 Line 204: <h3>GUI Focus</h3> It seems like this section should remain valid as is under the vframe scheme. http://codereview.appspot.com/8877/diff/1/2#newcode263 Line 263: // version of its super class. I do not understand this at all. Why is chaining directly to the superclass valid? http://codereview.appspot.com/8877/diff/1/2#newcode288 Line 288: var parts = node.nodeValue.split(/\b(TODO)\b/g); Cajita has no regexp literal. Replace with new RegExp('\\b(TODO)\\b','g'). (After all, our own new pages should cajole with Cajita.) Btw, I hate blink so much I'm now reading a printout. I live in fear of the day we upgrade our printers with blinking ink ;).
Sign in to reply to this message.
http://codereview.appspot.com/8877/diff/601/602 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/601/602#newcode20 Line 20: <dd>A node which prevents root-wards navigation by cajoled code. I don't know how virtual documents and virtual frames fit together. I didn't want to use the vframe term yet, since I think virtual frames might be built on top of virtual documents. I think vframes specifically might solve the gotcha re documents appearing as children of other nodes above. Perhaps some scheme with a <div class="vdoc-frame___"> above a <div class="vdoc-doc___">. http://codereview.appspot.com/8877/diff/601/602#newcode159 Line 159: <dfn>Descendant</dfn> or <dfn>Uncontained</dfn> node.</strike> I'll remove the stricken bits before submitting, but I thought it'd be easier to leave them in as people will likely read the DOC as HTML instead of viewing the side-by-side diffs.
Sign in to reply to this message.
http://codereview.appspot.com/8877/diff/1001/603 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/1001/603#newcode27 Line 27: <dd>A node N is not contained in M if N is not a descendant of M. iff N is not a descendent of M. http://codereview.appspot.com/8877/diff/1001/603#newcode60 Line 60: parameter types. and zero or more nominal exception types. replace ',' with ';' and '.' with ',' http://codereview.appspot.com/8877/diff/1001/603#newcode206 Line 206: then the node at which <code>myNode</code>'s is rooted is used. The myNode's what is rooted? http://codereview.appspot.com/8877/diff/1001/603#newcode326 Line 326: A virtual document is represented in the untamed DOM byull. by what? http://codereview.appspot.com/8877/diff/1001/603#newcode356 Line 356: allow this should documented this as a quirk. "should document it" http://codereview.appspot.com/8877/diff/1001/603#newcode360 Line 360: or any contained virtual document, but not to any in a containing end of sentence missing ("containing document."?) http://codereview.appspot.com/8877/diff/1001/603#newcode365 Line 365: <code>===</code>, <code>!==</code>, <code>==</code>, <code>!==</code>, last operator in list should be !=
Sign in to reply to this message.
On 2009/01/14 03:27:19, DavidSarah wrote: > http://codereview.appspot.com/8877/diff/1001/603 > File src/com/google/caja/domita/package.html (right): > > http://codereview.appspot.com/8877/diff/1001/603#newcode27 > Line 27: <dd>A node N is not contained in M if N is not a descendant of M. > iff N is not a descendent of M. > > http://codereview.appspot.com/8877/diff/1001/603#newcode60 > Line 60: parameter types. and zero or more nominal exception types. > replace ',' with ';' and '.' with ',' > > http://codereview.appspot.com/8877/diff/1001/603#newcode206 > Line 206: then the node at which <code>myNode</code>'s is rooted is used. The > myNode's what is rooted? > > http://codereview.appspot.com/8877/diff/1001/603#newcode326 > Line 326: A virtual document is represented in the untamed DOM byull. > by what? > > http://codereview.appspot.com/8877/diff/1001/603#newcode356 > Line 356: allow this should documented this as a quirk. > "should document it" > > http://codereview.appspot.com/8877/diff/1001/603#newcode360 > Line 360: or any contained virtual document, but not to any in a containing > end of sentence missing ("containing document."?) > > http://codereview.appspot.com/8877/diff/1001/603#newcode365 > Line 365: <code>===</code>, <code>!==</code>, <code>==</code>, <code>!==</code>, > last operator in list should be != Done all.
Sign in to reply to this message.
Inline comments are all minor. Altogether, I wasn't really able to gather the design from this document. Let's go over this in person. http://codereview.appspot.com/8877/diff/1013/611 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/1013/611#newcode68 Line 68: parameter types, and zero or more nominal exception types. I am skeptical as to whether it is useful for a function signature to specify which exceptions it may throw. How would your taming system make use of this? If a tamed function throws an Error we've tamed, but that isn't listed in the function's tamed exception signature, shouldn't we allow it anyway? Besides Errors, I can see the possibility of declaring which things are throwable across a taming bundary. But any of these should be throwable by any tamed function independent of that function's signature. http://codereview.appspot.com/8877/diff/1013/611#newcode80 Line 80: from at most one nominal type. > Each interface derives from at most one nominal type. I am confused. What is the distinction between an interface and a nominal type? Perhaps you meant "corresponds" rather than "derives"? http://codereview.appspot.com/8877/diff/1013/611#newcode95 Line 95: <p>Defining an interface via <code>tamedDom.tameInterface</code> adds I think it would be clearer if this sentence appeared at the beginning of the previous paragraph. http://codereview.appspot.com/8877/diff/1013/611#newcode104 Line 104: <p>Defines a mapping from javascript objects to vtables Doesn't this actually define a mapping from types or interfaces or something to vtables? http://codereview.appspot.com/8877/diff/1013/611#newcode119 Line 119: <li><code>vdoc.getVdocClass(node)</code> — given an element Not clear if "vdoc" here represents a singleton exported by vdoc.js (in which case getVdocClass, etc, would be static methods) or if it represents a single vdoc instance (in which case getVdocClass, etc, are instance methods). http://codereview.appspot.com/8877/diff/1013/611#newcode120 Line 120: with a class <code>vdoc-<XYZ>___</code> returns This was all very mysterious until I read the markup in the "Multiple Documents" section that appears much later. Also, since we've just been discussing types and interfaces (and especially because ES-Harmony will actually have classes of some form), we should always say "css class" when needed to disambiguate. http://codereview.appspot.com/8877/diff/1013/611#newcode137 Line 137: virtual documents, the value returned is always an element or n How can n not be an element? http://codereview.appspot.com/8877/diff/1013/611#newcode224 Line 224: <p>The <code>ownerDocument</code> getter returns a virtual document whose Confusing. The ownerDocument is a getter on a Node. Does it return the vdoc whose body immediately contains that Node? http://codereview.appspot.com/8877/diff/1013/611#newcode330 Line 330: node's constructor being callable avoiding checks Does that mean we should tame it as callable (presumably as a constructor)? http://codereview.appspot.com/8877/diff/1013/611#newcode335 Line 335: A virtual document is represented in the untamed DOM by markup like the below: You should move this example markup much earlier. I didn't understand much of the document until I saw this and then reread earlier sections. http://codereview.appspot.com/8877/diff/1013/611#newcode359 Line 359: virtual document is nested inside another, it is possible that this I am confused about this whole topic, which is central to this design: do vdoc boundaries prevent downward as well as upward navigation? Nothing in this doc suggests so, but if not, I don't understand what's going on. Elsewhere you say that you'd like to build the vframe abstraction on top of (or derived from or something) the vdoc abstraction. What do you expect to be the salient differences between them? Is it this nesting issue? http://codereview.appspot.com/8877/diff/1013/611#newcode361 Line 361: have <code>nodeType === 9</code> may confuse legacy code that assumes What's 9? Don't make your reader look that up. http://codereview.appspot.com/8877/diff/1013/611#newcode391 Line 391: <code>length</code> member (but not on IE6 or IE7 The unconditional whitelisting of numeric indexes and length should eventually not depend on inheritance from Object.prototype. (And won't once we've got your optimization in place.) http://codereview.appspot.com/8877/diff/1013/611#newcode456 Line 456: // An ES3.1 or SpiderMonkey setter can throw an exception Note that a normal readonly ES3 data property, as well as a readonly ES3.1 property assigned by a nonstrict assignment, no exception will be thrown. The code here still seems correct in that case. Altogether, I'm wondering whether we should case split isDomNode by browser. It seems really ugly and fragile as is, though it is pleasingly short. (Also, to deal better with this unrecoverable case, I wonder whether we should place the assignment restoring the original nodeType in a finally block?) http://codereview.appspot.com/8877/diff/1013/611#newcode503 Line 503: We don't need to filter results from any of these since in no case, does a node Lose the comma, or place it after "these".
Sign in to reply to this message.
http://codereview.appspot.com/8877/diff/1013/611 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/1013/611#newcode68 Line 68: parameter types, and zero or more nominal exception types. This is describing the IDL as used in DOM level 2. http://codereview.appspot.com/8877/diff/1013/611#newcode80 Line 80: from at most one nominal type. On 2009/01/19 22:00:24, MarkM wrote: > > Each interface derives from at most one nominal type. > > I am confused. What is the distinction between an interface and a nominal type? > Perhaps you meant "corresponds" rather than "derives"? For example, HTMLTableElement derives from HTMLElement derives from Element derives from Node http://codereview.appspot.com/8877/diff/1013/611#newcode95 Line 95: <p>Defining an interface via <code>tamedDom.tameInterface</code> adds On 2009/01/19 22:00:24, MarkM wrote: > I think it would be clearer if this sentence appeared at the beginning of the > previous paragraph. Done. http://codereview.appspot.com/8877/diff/1013/611#newcode104 Line 104: <p>Defines a mapping from javascript objects to vtables On 2009/01/19 22:00:24, MarkM wrote: > Doesn't this actually define a mapping from types or interfaces or something to > vtables? When cajita.callPub fails to prove the member callable, then it needs to try to find a vtable for the object whose method is to be called. It could do that by coming up mapping from object -> type, and type -> vtable, but that split seems unnecessary. http://codereview.appspot.com/8877/diff/1013/611#newcode119 Line 119: <li><code>vdoc.getVdocClass(node)</code> — given an element On 2009/01/19 22:00:24, MarkM wrote: > Not clear if "vdoc" here represents a singleton exported by vdoc.js (in which > case getVdocClass, etc, would be static methods) or if it represents a single > vdoc instance (in which case getVdocClass, etc, are instance methods). Yes. vdoc is a namespace. Clarified. http://codereview.appspot.com/8877/diff/1013/611#newcode120 Line 120: with a class <code>vdoc-<XYZ>___</code> returns On 2009/01/19 22:00:24, MarkM wrote: > This was all very mysterious until I read the markup in the "Multiple Documents" > section that appears much later. Also, since we've just been discussing types > and interfaces (and especially because ES-Harmony will actually have classes of > some form), we should always say "css class" when needed to disambiguate. Ok. I added a bunch of examples that introduce some of these concepts closer together. Let me know if that clarifies, and if it doesn't I'll try to reorganize somehow. http://codereview.appspot.com/8877/diff/1013/611#newcode137 Line 137: virtual documents, the value returned is always an element or n On 2009/01/19 22:00:24, MarkM wrote: > How can n not be an element? n might be a document. The "or n" was meant to be "or null" http://codereview.appspot.com/8877/diff/1013/611#newcode224 Line 224: <p>The <code>ownerDocument</code> getter returns a virtual document whose On 2009/01/19 22:00:24, MarkM wrote: > Confusing. The ownerDocument is a getter on a Node. Does it return the vdoc > whose body immediately contains that Node? This should have changed. Done. http://codereview.appspot.com/8877/diff/1013/611#newcode330 Line 330: node's constructor being callable avoiding checks On 2009/01/19 22:00:24, MarkM wrote: > Does that mean we should tame it as callable (presumably as a constructor)? No. It should not be marked callable since nodes are supposed to be created by document.createElement and friends. http://codereview.appspot.com/8877/diff/1013/611#newcode335 Line 335: A virtual document is represented in the untamed DOM by markup like the below: On 2009/01/19 22:00:24, MarkM wrote: > You should move this example markup much earlier. I didn't understand much of > the document until I saw this and then reread earlier sections. Let me know if the added examples addresses this. http://codereview.appspot.com/8877/diff/1013/611#newcode359 Line 359: virtual document is nested inside another, it is possible that this On 2009/01/19 22:00:24, MarkM wrote: > I am confused about this whole topic, which is central to this design: do vdoc > boundaries prevent downward as well as upward navigation? Nothing in this doc > suggests so, but if not, I don't understand what's going on. > > Elsewhere you say that you'd like to build the vframe abstraction on top of (or > derived from or something) the vdoc abstraction. What do you expect to be the > salient differences between them? Is it this nesting issue? Let's chat about this and see if we can't sort that out. My thought as that they would stop root-ward navigation but not prevent leaf-ward navigation. http://codereview.appspot.com/8877/diff/1013/611#newcode361 Line 361: have <code>nodeType === 9</code> may confuse legacy code that assumes On 2009/01/19 22:00:24, MarkM wrote: > What's 9? Don't make your reader look that up. It's the nodetype for DOCUMENT. Clarified. http://codereview.appspot.com/8877/diff/1013/611#newcode391 Line 391: <code>length</code> member (but not on IE6 or IE7 On 2009/01/19 22:00:24, MarkM wrote: > The unconditional whitelisting of numeric indexes and length should eventually > not depend on inheritance from Object.prototype. (And won't once we've got your > optimization in place.) Quite right. Changed to make it clear this should be tested. http://codereview.appspot.com/8877/diff/1013/611#newcode456 Line 456: // An ES3.1 or SpiderMonkey setter can throw an exception On 2009/01/19 22:00:24, MarkM wrote: > Note that a normal readonly ES3 data property, as well as a readonly ES3.1 > property assigned by a nonstrict assignment, no exception will be thrown. The > code here still seems correct in that case. > > Altogether, I'm wondering whether we should case split isDomNode by browser. It > seems really ugly and fragile as is, though it is pleasingly short. (Also, to > deal better with this unrecoverable case, I wonder whether we should place the > assignment restoring the original nodeType in a finally block?) That sounds like an excellent idea. http://codereview.appspot.com/8877/diff/1013/611#newcode503 Line 503: We don't need to filter results from any of these since in no case, does a node On 2009/01/19 22:00:24, MarkM wrote: > Lose the comma, or place it after "these". Done.
Sign in to reply to this message.
Since none of my comments here are design issues, LGTM. My one real design concern is allowing regular dom traversal to be able to navigate into virtual docs, rather than have the boundary be bidirectional. From an authority pov, that's fine. The outer includes full rights to the inner. From a legacy compatibility pov, I'm skeptical but willing to give it a try. Perhaps the outer-to-inner navigation should look more like interaction between iframes from the same origin? http://codereview.appspot.com/8877/diff/616/1016 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/616/1016#newcode47 Line 47: <dd>A mapping from a property names to means by which the property delete "a ". http://codereview.appspot.com/8877/diff/616/1016#newcode136 Line 136: <code>document.getElementById(':foo')</code>. Because of the global nature Not a sentence. Perhaps "... is called"? http://codereview.appspot.com/8877/diff/616/1016#newcode142 Line 142: virtual document as the method was invoked on. If it is not, a fallback This fallback is never explained. http://codereview.appspot.com/8877/diff/616/1016#newcode185 Line 185: !== document</code> One negative too many. You mean something like: Uncajoled, it is always true that: document.createElement('DIV').ownerDocument === document But cajoled it won't be, since the virtual ownerDocument is calculated by walking the parent chain. http://codereview.appspot.com/8877/diff/616/1016#newcode218 Line 218: <li>Style returns a regular caja object that uses the CSS schema to validate So how does setting "color" on this regular Caja object (as in the above code example) cause a visible effect? http://codereview.appspot.com/8877/diff/616/1016#newcode401 Line 401: node modifiable by the event handler. In what way does granting focus to node X involve modifying node X? Perhaps you mean that modify rights are required on the node on which you do addEventListener? http://codereview.appspot.com/8877/diff/616/1016#newcode430 Line 430: <p>Since DOMita does not wrap nodes, we don't need to worry about a I do not understand what point is being made here. http://codereview.appspot.com/8877/diff/616/1016#newcode440 Line 440: <div class="vdoc-body___"><!-- Corresponds to the BODY element --> The class attribute here also includes another unmentionable caja module id class, no? http://codereview.appspot.com/8877/diff/616/1016#newcode504 Line 504: property access on a DOM node occurs, the following happens: In order for this to happen, some changes to Cajita will be needed, in order to hook failure handling from outside the object in question. http://codereview.appspot.com/8877/diff/616/1016#newcode514 Line 514: return property.read(node, propertyName); If we invoke the readHandler as return property.handleRead.call(node, propertyName); then we can use the same read-fault handler functions we'd use to handle faults on the node itself. http://codereview.appspot.com/8877/diff/616/1016#newcode522 Line 522: if (obj.nodeType === 1) { Please stop using bare numeric constants without even a comment explaining what they mean. http://codereview.appspot.com/8877/diff/616/1016#newcode564 Line 564: candidate.nodeType = nodeType; Weren't you going to restore this in a finally block? http://codereview.appspot.com/8877/diff/616/1016#newcode718 Line 718: Otherwise another strategy is applied to find a node with the given id that Is this other strategy explained anywhere?
Sign in to reply to this message.
http://codereview.appspot.com/8877/diff/616/1016 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/616/1016#newcode47 Line 47: <dd>A mapping from a property names to means by which the property On 2009/02/03 23:38:02, MarkM wrote: > delete "a ". Done. http://codereview.appspot.com/8877/diff/616/1016#newcode136 Line 136: <code>document.getElementById(':foo')</code>. Because of the global nature On 2009/02/03 23:38:02, MarkM wrote: > Not a sentence. Perhaps "... is called"? Done. http://codereview.appspot.com/8877/diff/616/1016#newcode142 Line 142: virtual document as the method was invoked on. If it is not, a fallback On 2009/02/03 23:38:02, MarkM wrote: > This fallback is never explained. Yep. I responded to these comments in reverse order so I don't confuse line numbers. I address this in the last comment. http://codereview.appspot.com/8877/diff/616/1016#newcode185 Line 185: !== document</code> On 2009/02/03 23:38:02, MarkM wrote: > One negative too many. You mean something like: > > Uncajoled, it is always true that: > document.createElement('DIV').ownerDocument === document > But cajoled it won't be, since the virtual ownerDocument is calculated by > walking the parent chain. Done. http://codereview.appspot.com/8877/diff/616/1016#newcode218 Line 218: <li>Style returns a regular caja object that uses the CSS schema to validate On 2009/02/03 23:38:02, MarkM wrote: > So how does setting "color" on this regular Caja object (as in the above code > example) cause a visible effect? It has a get handler for css property names that sanitizes and then delegates the set. http://codereview.appspot.com/8877/diff/616/1016#newcode401 Line 401: node modifiable by the event handler. On 2009/02/03 23:38:02, MarkM wrote: > In what way does granting focus to node X involve modifying node X? Perhaps you > mean that modify rights are required on the node on which you do > addEventListener? changed "modifiable" to read "reachable" http://codereview.appspot.com/8877/diff/616/1016#newcode430 Line 430: <p>Since DOMita does not wrap nodes, we don't need to worry about a On 2009/02/03 23:38:02, MarkM wrote: > I do not understand what point is being made here. We currently have a failure in Valija mode where you can do new (myElement.constructor)(...) http://codereview.appspot.com/8877/diff/616/1016#newcode440 Line 440: <div class="vdoc-body___"><!-- Corresponds to the BODY element --> On 2009/02/03 23:38:02, MarkM wrote: > The class attribute here also includes another unmentionable caja module id > class, no? Typically. Though the granting of authority to style a subtree is separable from the decomposition of a DOM into vdocs. http://codereview.appspot.com/8877/diff/616/1016#newcode504 Line 504: property access on a DOM node occurs, the following happens: On 2009/02/03 23:38:02, MarkM wrote: > In order for this to happen, some changes to Cajita will be needed, in order to > hook failure handling from outside the object in question. Yep. Added a note to that effect. http://codereview.appspot.com/8877/diff/616/1016#newcode514 Line 514: return property.read(node, propertyName); On 2009/02/03 23:38:02, MarkM wrote: > If we invoke the readHandler as > return property.handleRead.call(node, propertyName); > then we can use the same read-fault handler functions we'd use to handle faults > on the node itself. Changed the calling convention. I'm not sure I follow though. Would that first fault round be on Object.prototype? http://codereview.appspot.com/8877/diff/616/1016#newcode522 Line 522: if (obj.nodeType === 1) { On 2009/02/03 23:38:02, MarkM wrote: > Please stop using bare numeric constants without even a comment explaining what > they mean. Done. http://codereview.appspot.com/8877/diff/616/1016#newcode564 Line 564: candidate.nodeType = nodeType; On 2009/02/03 23:38:02, MarkM wrote: > Weren't you going to restore this in a finally block? In case candidate.nodeType is a getter that might throw an exception at 562? This code already fails in the presence of getters and setters. http://codereview.appspot.com/8877/diff/616/1016#newcode718 Line 718: Otherwise another strategy is applied to find a node with the given id that On 2009/02/03 23:38:02, MarkM wrote: > Is this other strategy explained anywhere? No. I was thinking of - using xpath on browsers that support it and walking the DOM on ones that don't. - using document.getElementsById('*') as an alternative to walking - researching John Resig's CSS selector stuff for ideas - removing nodes with the same ID and retrying until we find a match or run out. Discussing the pros and cons of those seems a bit outside the scope of this doc though.
Sign in to reply to this message.
LGTM. I like it. >http://codereview.appspot.com/8877/diff/616/1016#newcode514 >Line 514: return property.read(node, propertyName); >On 2009/02/03 23:38:02, MarkM wrote: >> If we invoke the readHandler as >> return property.handleRead.call(node, propertyName); >> then we can use the same read-fault handler functions we'd >> use to handle faults on the node itself. > >Changed the calling convention. I'm not sure I follow >though. Would that first fault round be on >Object.prototype? No. My point was only that a faultHandler written for one context (as well as the learning of how to write such a fault handler) be reusable in the other context. >http://codereview.appspot.com/8877/diff/616/1016#newcode564 >Line 564: candidate.nodeType = nodeType; >On 2009/02/03 23:38:02, MarkM wrote: >> Weren't you going to restore this in a finally block? > >In case candidate.nodeType is a getter that might throw an >exception at 562? This code already fails in the presence >of getters and setters. You're right. The only remaining issue is robustness under maintenance, and this is as easily dealt with by a comment. http://codereview.appspot.com/8877/diff/3201/2202 File src/com/google/caja/domita/package.html (right): http://codereview.appspot.com/8877/diff/3201/2202#newcode431 Line 431: <p>Since DOMita does not wrap nodes, we don't need to worry about a Sorry, but even with your clarification I still don't understand this. Let's just do this verbally sometime. It need not delay the LGTM.
Sign in to reply to this message.
|
