WenTao-Love / base2

Automatically exported from code.google.com/p/base2
0 stars 1 forks source link

Not only black for getComputedStyle, use also white #104

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
During rewamping http://www.pastie.org/356766 for mootools, I discovered,
that no only black has to be tested. I dont know why edge colors are
broken, but it works.

Original issue reported on code.google.com by daniel.s...@gmail.com on 9 Jan 2009 at 6:49

GoogleCodeExporter commented 9 years ago
Thanks MooTools guys! I will incorporate your improvements in the next release.

Original comment by dean.edw...@gmail.com on 19 Jan 2009 at 8:52

GoogleCodeExporter commented 9 years ago
Hi dean, I just discovered another issue. backgroundPosition has to be returned 
as
join of backgroundPositionX and backgroundPositionY. 

Daniel Steigerwald

Original comment by daniel.s...@gmail.com on 20 Jan 2009 at 10:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Source with specs: http://pastie.org/366178 

Original comment by daniel.s...@gmail.com on 20 Jan 2009 at 10:46

GoogleCodeExporter commented 9 years ago
A fix for this will be in the next release of base2.DOM.

Original comment by dean.edw...@gmail.com on 6 Feb 2009 at 5:49

GoogleCodeExporter commented 9 years ago
I've now completely re-written the colour converter. It is now smaller and 
avoids the 
black/white problem. Here's the code:

{{{
function _MSIE_getColorValue(color) {
  if (window.createPopup) {
    var document = createPopup().document;
  } else {
    document = new ActiveXObject("htmlfile");
    document.write("<body>");
  }
  var body  = document.body,
      range = body.createTextRange();
  body.style.color = color.toLowerCase();
  var value = range.queryCommandValue("ForeColor");
  return format("rgb(%1, %2, %3)", value & 0xff, (value & 0xff00) >> 8,  (value & 
0xff0000) >> 16);
};
}}}

Original comment by dean.edw...@gmail.com on 23 Sep 2009 at 9:03