kissyteam / kissy

A Powerful Collection Of Modules
http://docs.kissyui.com
2.7k stars 863 forks source link

dom: contains is not consistent #183

Closed yiminghe closed 12 years ago

yiminghe commented 12 years ago

KISSY Version :

<=1.3.0

Browsers :

all

What steps will reproduce the problem?

KISSY.ready(function  (S) {
      var $ = S.all;
      var newNode = $('<div></div>');
      console.log(S.one(document).contains(newNode));
      console.log(S.one(document.body).contains(newNode));
   })

Expected

all is same : false false

actual

ie和safari一致,chrome和firefox一致。

yiminghe commented 12 years ago

document.contains ie/safari 没有 chrome 有

firefox uses compareDocumentPosition