Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1213)

Issue 6490106: Replace Domado's editable flags with node policy objects determined by parents. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 8 months ago by kpreid2
Modified:
11 years, 6 months ago
Reviewers:
felix8a, ihab.awad
CC:
caja-discuss-undisclosed_googlegroups.com, MarkM, ihab.awad, Jasvir, metaweta, MikeSamuel, felix8a
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

The opaque and foreign node restrictions as previously implemented are completely broken, because they attempt to suppress ancestor methods by overriding them, and the nodes are not even marked editable. To achieve proper protection, all amplification-capable function objects (that is, TameNode methods) must instead respect the intended policy. To achieve this, several new flags are defined to capture the intended behavior of opaque and foreign nodes. To maintain simplicity, all flags (including the existing editability flags) are bundled into 'node policy' objects, of which there are a small set. Furthermore, the current taming membrane has as a premise that there is only one tame object per feral object; but this is inconsistent with the Domado design which determines editability flags according to the way in which the node being tamed was reached. In order to avoid accidental mutability of opaque nodes' children, the node policy of a node is now almost always determined by the policy of its parent node -- with the exceptions of opaque nodes and foreign nodes. Incidentally, an attempt to tame a foreign node's descendant (which should never happen) is now guaranteed to crash, as the foreign node policy refuses to specify a child policy. Foreign nodes' descendants are now hidden from NodeLists; this adds the cost of scanning a prefix of the host NodeList to filter it, but the results are cached as long as the guest does not modify the DOM. Node editability and child-relationship editability checks have been refactored to be implemented in one place each. Also added a note about our slightly inaccurate implementation of innerText. @r5143

Patch Set 1 #

Patch Set 2 : Replace Domado's editable flags with node policy objects determined by parents. #

Total comments: 11

Patch Set 3 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 4 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 5 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 6 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 7 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 8 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 9 : Replace Domado's editable flags with node policy objects determined by parents. #

Total comments: 6

Patch Set 10 : Replace Domado's editable flags with node policy objects determined by parents. #

Patch Set 11 : Replace Domado's editable flags with node policy objects determined by parents. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+659 lines, -390 lines) Patch
M src/com/google/caja/plugin/domado.js View 1 2 3 4 5 6 7 8 9 10 95 chunks +553 lines, -363 lines 0 comments Download
M src/com/google/caja/plugin/html-emitter.js View 1 2 3 4 5 6 7 8 9 10 4 chunks +6 lines, -6 lines 0 comments Download
M tests/com/google/caja/plugin/browser-test-case.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -8 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-canvas-guest.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -1 line 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-dom-guest.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +10 lines, -6 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-events-guest.html View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-foreign.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
M tests/com/google/caja/plugin/es53-test-domado-foreign-guest.html View 1 2 3 4 5 6 7 8 9 10 6 chunks +67 lines, -4 lines 0 comments Download

Messages

Total messages: 23
kpreid2
11 years, 8 months ago (2012-09-11 22:34:19 UTC) #1
kpreid2
Patch Set 2 has been updated to base r5044 and slightly tweaked. Ready for review.
11 years, 8 months ago (2012-09-12 19:04:47 UTC) #2
felix8a
partial comments. I'm still working through the code in domado.js https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js File tests/com/google/caja/plugin/browser-test-case.js (right): https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js#newcode363 ...
11 years, 8 months ago (2012-09-13 19:53:57 UTC) #3
kpreid2
https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js File tests/com/google/caja/plugin/browser-test-case.js (right): https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js#newcode363 tests/com/google/caja/plugin/browser-test-case.js:363: // (Note taming membrane is in use here, so ...
11 years, 8 months ago (2012-09-13 20:43:59 UTC) #4
felix8a
https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js File tests/com/google/caja/plugin/browser-test-case.js (right): https://codereview.appspot.com/6490106/diff/3001/tests/com/google/caja/plugin/browser-test-case.js#newcode363 tests/com/google/caja/plugin/browser-test-case.js:363: // (Note taming membrane is in use here, so ...
11 years, 8 months ago (2012-09-13 21:01:55 UTC) #5
felix8a
ok, done looking at domado.js. two minor nits, but also, I think I can get ...
11 years, 8 months ago (2012-09-14 22:19:04 UTC) #6
kpreid2
On 2012/09/14 22:19:04, felix8a wrote: > ok, done looking at domado.js. two minor nits, but ...
11 years, 8 months ago (2012-09-14 22:33:00 UTC) #7
felix8a
ok I'm fine with just adding a TODO for that On Sep 14, 2012 3:33 ...
11 years, 8 months ago (2012-09-14 22:43:20 UTC) #8
felix8a
no wait. tamebackednode doesn't walk up the tree. it only checks the parent. so I ...
11 years, 8 months ago (2012-09-14 22:49:14 UTC) #9
kpreid2
(Responses now; snapshot coming when I've run a smoke test.) https://codereview.appspot.com/6490106/diff/3001/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/6490106/diff/3001/src/com/google/caja/plugin/domado.js#newcode2706 ...
11 years, 8 months ago (2012-09-14 22:50:34 UTC) #10
kpreid2
On 2012/09/14 22:49:14, felix8a wrote: > no wait. tamebackednode doesn't walk up the tree. it ...
11 years, 8 months ago (2012-09-14 22:54:50 UTC) #11
felix8a
On 2012/09/14 22:54:50, kpreid2 wrote: > On 2012/09/14 22:49:14, felix8a wrote: > > no wait. ...
11 years, 8 months ago (2012-09-14 23:22:31 UTC) #12
kpreid2
Patch Set 5/6 adds node-list filtering so that getElementsByTagName and friends do not expose foreign ...
11 years, 7 months ago (2012-10-03 15:48:33 UTC) #13
felix8a
the nodelist filtering feels to me kind of complex and fragile. what's the harm of ...
11 years, 7 months ago (2012-10-03 20:49:30 UTC) #14
kpreid2
On 2012/10/03 20:49:30, felix8a wrote: > the nodelist filtering feels to me kind of complex ...
11 years, 7 months ago (2012-10-03 20:57:43 UTC) #15
felix8a
hm. one thing that concerns me is that once someone starts admitting foreign nodes, it's ...
11 years, 7 months ago (2012-10-03 21:20:22 UTC) #16
kpreid2
On 2012/10/03 21:20:22, felix8a wrote: > hm. one thing that concerns me is that once ...
11 years, 7 months ago (2012-10-03 21:29:56 UTC) #17
kpreid2
On 2012/10/03 21:29:56, kpreid2 wrote: > On 2012/10/03 21:20:22, felix8a wrote: > > how about ...
11 years, 7 months ago (2012-10-03 23:41:30 UTC) #18
kpreid2
Patch Set 9 adds a bit I overlooked, namely preventing getAttribute[Node] from exposing attributes when ...
11 years, 7 months ago (2012-10-05 21:41:25 UTC) #19
felix8a
https://codereview.appspot.com/6490106/diff/24001/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/6490106/diff/24001/src/com/google/caja/plugin/domado.js#newcode2337 src/com/google/caja/plugin/domado.js:2337: // mutation generation counter) at which time the cache ...
11 years, 7 months ago (2012-10-09 00:40:08 UTC) #20
kpreid2
https://codereview.appspot.com/6490106/diff/24001/src/com/google/caja/plugin/domado.js File src/com/google/caja/plugin/domado.js (right): https://codereview.appspot.com/6490106/diff/24001/src/com/google/caja/plugin/domado.js#newcode2356 src/com/google/caja/plugin/domado.js:2356: feralIndex < expectation.length && feralIndex < feralLength; On 2012/10/09 ...
11 years, 7 months ago (2012-10-09 19:53:26 UTC) #21
felix8a
lgtm
11 years, 7 months ago (2012-10-09 23:31:27 UTC) #22
kpreid2
11 years, 7 months ago (2012-10-12 22:58:55 UTC) #23
Updated, only trivial conflict resolution, passes tests.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b