Revision: 5509
Author: [email protected]
Date: Thu Jul 25 11:57:29 2013
Log: Apply proper style overrides to new third wrapper div.
https://codereview.appspot.com/11853043
Fixes <https://code.google.com/p/google-caja/issues/detail?id=1824> and
some jQuery tests.
[email protected]
http://code.google.com/p/google-caja/source/detail?r=5509
Modified:
/trunk/src/com/google/caja/plugin/domado.js
/trunk/tests/com/google/caja/plugin/third-party-tests.json
=======================================
--- /trunk/src/com/google/caja/plugin/domado.js Wed Jul 24 15:19:27 2013
+++ /trunk/src/com/google/caja/plugin/domado.js Thu Jul 25 11:57:29 2013
@@ -1863,18 +1863,25 @@
feralPseudoWindow.className = 'caja-vdoc-wrapper';
feralPseudoDocument.className = 'caja-vdoc-wrapper
caja-vdoc-inner ' +
'vdoc-container___ ' + idClass;
- // Visual isolation.
+ // Visual isolation and formatting. We use inline styles because
they
+ // cannot be overridden by any stylesheet.
// TODO(kpreid): Add explanation of how these style rules produce
the
// needed effects.
- makeDOMAccessible(outerIsolator.style);
- outerIsolator.style.display = 'block';
+ [outerIsolator, feralPseudoWindow, feralPseudoDocument].forEach(
+ function(el) {
+ makeDOMAccessible(el.style);
+ // Ensure block display and no additional borders/gaps.
+ el.style.display = 'block';
+ el.style.margin = '0';
+ el.style.border = 'none';
+ el.style.padding = '0';
+ });
+ // Establish a new coordinate system for absolutely-positioned
elements.
+ // TODO(kpreid): Explain why it is necessary to have two nested.
outerIsolator.style.position = 'relative';
+ feralPseudoWindow.style.position = 'relative';
+ // Clip content to bounds of container.
outerIsolator.style.overflow = 'hidden';
- outerIsolator.style.margin = '0';
- outerIsolator.style.padding = '0';
- makeDOMAccessible(feralPseudoWindow.style);
- feralPseudoWindow.style.display = 'block';
- feralPseudoWindow.style.position = 'relative';
// Final hookup; move existing children (like static HTML produced
by
// the cajoler) into the virtual document.
while (outerContainerNode.firstChild) {
=======================================
--- /trunk/tests/com/google/caja/plugin/third-party-tests.json Wed Jul 24
15:19:27 2013
+++ /trunk/tests/com/google/caja/plugin/third-party-tests.json Thu Jul 25
11:57:29 2013
@@ -105,7 +105,7 @@
},
{
"guest": "manipulation",
- "expected-pass": { "firefox": 574, "chrome": 559 },
+ "expected-pass": { "firefox": 588, "chrome": 559 },
"comment": [
"Current modifications made to test suite:",
"Removed SES-incompatible Array.prototype modification; was
only",
@@ -149,7 +149,7 @@
},
{
"guest": "effects",
- "expected-pass": { "firefox": 552, "chrome": 551 },
+ "expected-pass": 552,
"comment": [
"Current failure categories:",
"fill-opacity SVG-only CSS property."
--
---
You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.