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

Issue 12508: Issue 972: Domita is missing document.defaultView (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 2 months ago by MikeSamuel
Modified:
16 years, 8 months ago
Reviewers:
Jasvir
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

defaultView is an instance of the DOM-2 AbstractView as described at http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView That isn't really very useful, since the only API that specifies is that there is a readonly "document" member that points back. https://developer.mozilla.org/en/DOM/document.defaultView says document.defaultView is generally a reference to the window object for the document, however that is not defined in the specification and can't be relied upon for all host environments, particularly as not all browsers implement it. We can't provide access to the tamed window obviously since that's a gadget's global scope, so would leak way too much authority. The view is meant to be a dumping ground for all kind of methods that capture the way the document is presented to the user, so we can expose the computed style, sizing, resizing, and the position properties. I implement a TameDefaultView class in such a way that it exposes: document {resize,scroll}{By,To} getComputedStyle {client,offset, scroll}{Left,Top,Height,Width} page{X,Y}Offset

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -31 lines) Patch
M src/com/google/caja/plugin/domita.js View 8 chunks +65 lines, -16 lines 0 comments Download
M tests/com/google/caja/plugin/domita_test_untrusted.html View 7 chunks +50 lines, -15 lines 0 comments Download

Messages

Total messages: 3
MikeSamuel
17 years, 2 months ago (2009-01-26 06:28:11 UTC) #1
Jasvir
LGTM
17 years, 2 months ago (2009-01-27 00:57:38 UTC) #2
MikeSamuel
17 years, 2 months ago (2009-01-27 01:31:14 UTC) #3
@3208
Sign in to reply to this message.

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