Opened 15 years ago

Closed 14 years ago

#459 closed defect (fixed)

all body attributes removed in full page mode in FireFox

Reported by: mharrisonline Owned by: gogo
Priority: normal Milestone:
Component: Xinha Core Version:
Severity: normal Keywords: full page body color


When XINHA is in full page mode (plugin or config change) in Firefox, all body attributes are removed.

Change History (11)

comment:1 Changed 15 years ago by mharrisonline

  • Component changed from Documentation to Xinha Core
  • Owner changed from akaEdge to gogo

This used to work...

comment:2 Changed 15 years ago by mharrisonline

I went through several old downloads I have, and the latest download I have that it worked in was:

-- $LastChangedDate?: 2005-06-28 03:03:17 +1200 (Tue, 28 Jun 2005) $

-- $LastChangedRevision?: 245 $
-- $LastChangedBy?: gocher $

comment:3 Changed 15 years ago by mharrisonline

I tried loading every version of htmlarea.js into the download from 6/28, and it always worked fine (body attributes were intact in firefox)with the fullpage plugin, even though the current download and example don't work (body attributes were removed in firefox).

I took the full-page plugin from 6/28 and dropped it into today's download, and the bug went away when the older full-page plugin was used.

However, after I turned full-page to true in htmlarea.js, with or without the full-page plugin all body attributes were removed in firefox.

comment:4 Changed 15 years ago by mharrisonline

  • Keywords full page body color added

Actually, it only worked normally in my download from 6/28 because I made the rollback to older code to fix undo/redo in full page mode I mentioned in ticket 298, which wouldn't now work in a current version of htmlarea.js. Also, I was using the version of undo/redo from that time.

So, I think two things have happened:

XINHA began removing all body attributes in firefox when htmlarea.js was configured to full page mode in changeset 177, which had also broken undo redo in full page mode:

Revision 177 (by gogo, 05/19/05 10:28:30) * Minor comment changes.

  • Refactor events for form submit, reset and window unload
  • Fix reset handler to properly use the original textarea content
  • Minor changes to setHTML etc
  • Use onload for iframe to determine when to initIframe, instead of a


  • Remove overlooked debugging statement in loadPlugins
  • Change some event registrations to use addDom0Event rather than

element.onxxx = something

  • Add HTMLArea.flushEvents() as an implementation of #30* - sadly,

doesn't work. This is not enabled in the full_example, use
examples/testbed.html to test it out.

  • Added methods HTMLArea.addDom0Event and HTMLArea.prependDom0Event

which are to be used instead of element.onxxxxx = something;

Undo/redo were fixed in full page in changeset 245, but body attributes in firefox had not been identified as being broken.

Later, the full page plugin was altered, and the bug was then in the plugin also, breaking the plugin. if you are using firefox, with a current version of XINHA, with a current version of the full-page plugin, you cannot change the background colors, etc., even using the full page plugin.

comment:5 Changed 15 years ago by mharrisonline


Body attributes began dissapearing from HTML files in full page config Xinha in firefox with changeset 177.

However, in firefox body attributes were still retained if the full page plugin was used. After changeset 248, the plugin no longer preserved the body attributes.

Changeset 177 broke body attributes in Xinha in firefox with htmlarea.js configured for full page. The full page plugin when used made attributes stay.

Changeset 248 broke the full page plugin in firefox by stopping it also from preserving body attributes.

This means that if background colors or images or other attributes are present in the body tag when Xinha is used in firefox, Xinha now strips the body tag down to <body>, corrupting content Xinha (and formerly HTMLArea3) was fully able to edit until changesets 177 and 248.

comment:6 Changed 15 years ago by gocher

fix for Changset 248, replace select_color.html with color_picker.js

Index: docprop.html
--- docprop.html	(revision 299)
+++ docprop.html	(working copy)
@@ -2,6 +2,7 @@
 <title>Document properties</title>
 <script type="text/javascript" src="../../../popups/popup.js"></script>
+<script type="text/javascript" src="../../../popups/color_picker.js"></script>
 <link rel="stylesheet" type="text/css" href="../../../popups/popup.css" />
 <script type="text/javascript">
 FullPage = window.opener.FullPage; // load the FullPage plugin and lang file ;-)
@@ -32,6 +33,26 @@
   editor = params.editor;
+  var f_bgcolor = document.getElementById('f_body_bgcolor');
+  var b_bgcolor = document.getElementById('bgcolorselect');
+  var p_bgcolor = new colorPicker (
+        { cellsize: '5px',
+          callback: function(color){f_bgcolor.value=color},
+          granularity: 18
+        }
+      );
+  b_bgcolor.onclick = function() {'bottom,left', document.getElementById('title')) };
+  var f_fgcolor = document.getElementById('f_body_fgcolor');
+  var b_fgcolor = document.getElementById('fgcolorselect');
+  var p_fgcolor = new colorPicker (
+        { cellsize: '5px',
+          callback: function(color){f_fgcolor.value=color},
+          granularity: 18
+        }
+      );
+  b_fgcolor.onclick = function() {'bottom,left', document.getElementById('title')) };
 function onOK() {
@@ -60,18 +81,6 @@
   return false;
-function chooseColor(id) {
-  var old_window_name =;
- = 'docprop';
-  var input = document.getElementById(id);
-  editor._popupDialog("select_color.html", function(color) {
-    if (color && (typeof color == 'string') ) {
- = "#" + color;
-      input.value = "#" + color;
-    }
- = old_window_name;
-  }, input.value);
 <style type="text/css">
 .fr { width: 11em; float: left; padding: 2px 5px; text-align: right; }
@@ -82,7 +91,7 @@
 <body class="dialog" onload="Init()">
-<div class="title">Document properties</div>
+<div id="title" class="title">Document properties</div>
@@ -113,11 +122,13 @@
   <label class="fr" for="f_body_bgcolor">Background color:</label>
-  <input type="text" id="f_body_bgcolor" class="txt" autocomplete="off" onclick="chooseColor('f_body_bgcolor');" />
+  <input type="text" id="f_body_bgcolor" class="txt" />
+	<input type="button" id="bgcolorselect" />
   <label class="fr" for="f_body_fgcolor">Text color:</label>
-  <input type="text" id="f_body_fgcolor" class="txt" autocomplete="off" onclick="chooseColor('f_body_fgcolor');" />
+  <input type="text" id="f_body_fgcolor" class="txt" />
+	<input type="button" id="fgcolorselect" />
   <label class="fr" for="f_charset">Character set:</label>
@@ -139,4 +150,4 @@
\ No newline at end of file

comment:7 Changed 15 years ago by gocher

look at Ticket #265

comment:8 Changed 15 years ago by mharrisonline

This bug still exists in full page mode when full page is set as a config option in htmlarea.js. It is fixed for the full-page plugin only, not for the core XINHA.

comment:9 Changed 15 years ago by gogo

Does this bug still exist after recent changes to FullPage? stuff?

comment:10 Changed 15 years ago by Symon

The bug is still here... I downloaded Xinha on december 2 and the bug happened with or without the fullpage plugin.

comment:11 Changed 14 years ago by ray

  • Resolution set to fixed
  • Status changed from new to closed

rev [731]: This was due to a different way setFullHTML() worked in Gecko than IE (setting head & body innerHTML vs. rewriting the whole editor document). Though the former way is more elegant, I can see no reason why to keep it if causes a severe malfunction while the other way is proven to work

Note: See TracTickets for help on using tickets.