过滤器集合在*某些*版本的 IE9 上不可用
我创建了一个 Windows 边栏小工具,它使用 过滤器
HTMLElements
上的集合,以便我可以显示过渡效果(在照片之间......该小工具是一个照片查看器)。
然而,在最新版本的 IE9 中,我发现在某些情况下,filters
集合不可用;并在尝试访问它时抛出错误。
最初,我将其归因于 IE9 默认处于标准模式而不是怪异模式的一些奇怪问题(如 IE9 中所示, Microsoft 停用了 style.filter 属性支持 style.opacity
,试图符合 opacity 标准),但是经过进一步调试后,事实并非如此。
在以下所有测试中,对于引发错误的小工具和未引发错误的小工具,返回的结果相同:
document.documentMode
为 5document .compatMode
是 BackCompattypeof some_html_element.style.filter
是 stringtypeof some_html_element.style.MsFilter
是未定义
但是,以下测试给出了不同的结果:
typeof some_html_element.filters
在未损坏的小工具中是 objecttypeof some_html_element.filters
> 在损坏的小工具中未知
下面是损坏小工具的用户代理字符串的选择:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; BRI/1; .NET CLR 1.1.4322; .NET4.0C)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MATP; InfoPath.2; FunWebProducts; .NET4.0C; yie9)
下面是工作小工具的用户代理字符串的选择:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; yie9)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MALN; InfoPath.2; .NET4.0C)
不幸的是,这个问题让我非常困惑,我什至无法在我的开发机器上重现它;所以我真的没有更多的信息可以继续。
有人以前经历过类似的事情/知道可能是什么原因造成的吗?
为了确保我的问题清楚:
- 有人以前经历过这种情况/知道可能是什么原因造成的吗?
- 有谁知道我可以向服务器报告的任何其他变量以尝试进一步诊断问题的原因?
赏金编辑:任何人都可以下载小工具,重现问题,然后发布有关其 Windows 环境(操作系统版本、安装的更新)及其 IE 配置(版本、安装的插件)的详细信息?
如果小工具损坏,当鼠标悬停在小工具左上角时单击任何状态图标(加载微调器、错误图标)时,您会看到一条错误消息,指出“几个问题(最明显的是禁用的转换)”在安装 Internet Explorer 9 时引入。我们正在积极修复。”您会注意到照片更改之间没有任何过渡效果(并且一些用户报告标题/作者/播放控制栏也没有不透明度)。
注意:不用说,交叉兼容性对我来说不是问题。我需要该小工具在 IE7、8 和 9 中运行,仅此而已(Windows 边栏使用幕后安装的 IE 副本的损坏版本)。
I've created a Windows Sidebar Gadget which uses the filters
collection on HTMLElements
, so that I can show transition effects (between photos... the gadget is a photo viewer).
With the latest version of IE9 however, I've discovered that in some cases, the filters
collection is not available; and throws an error when access to it is attempted.
Originally, I put this down to some weird problem with IE9 being in Standards mode instead of Quirks by default (as in IE9, Microsoft retired the style.filter property in favour of style.opacity
in an attempt to be standards compliant with opacity), however after further debugging, this isn't the case.
In all the following tests, the results came back the same for both gadgets that were throwing errors, and gadgets that weren't:
document.documentMode
is 5document.compatMode
is BackCompattypeof some_html_element.style.filter
is stringtypeof some_html_element.style.MsFilter
is undefined
However, the following test gave different results:
typeof some_html_element.filters
is object in unbroken gadgetstypeof some_html_element.filters
is unknown in broken gadgets
A selection of useragent strings of broken gadgets are below:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; BRI/1; .NET CLR 1.1.4322; .NET4.0C)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; Tablet PC 2.0)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MATP; InfoPath.2; FunWebProducts; .NET4.0C; yie9)
A selection of useragent strings of working gadgets are below:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Win64; x64; Trident/5.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; yie9)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MALN; InfoPath.2; .NET4.0C)
Unfortunately, the problem is baffling me so much, I can't even reproduce it on my development machine; so I haven't really got much more information to go on.
Anyone experienced anything like this before/ have any idea what could be causing it?
To ensure I'm making my question(s) clear:
- Has anyone experienced this before/ have any idea what could be causing it?
- Does anyone know any other variables I could report to the server to try diagnose the cause of the problem futher?
Bounty Edit: Can anyone download the gadget, reproduce the problem, and post detailed information on their Windows Environment (OS version, updates installed), and their IE configuration (version, plugins installed)?
If the gadget is broken, upon clicking any status icon (loading spinner, error icon) displayed in the top left of the gadget whilst hovering over it, you'll see an error saying "Several problems (most noticeably disabled transitions) were introduced when installing Internet Explorer 9. We are actively working on a fix.". You'll notice there aren't any transition effects between photo changes (and several users have reported the title/author/play back control bar has no opacity either).
N.B: Needless to say, cross compatability is not an issue for me. I need the gadget to run in IE7, 8 and 9 and that's it (Windows Sidebar uses a mangled version of the copy of IE installed behind the scenes).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我下载了这个小工具,没有发现任何问题。我看到过渡(溶解)和控制栏透明度也在那里。
我的用户代理:
Mozilla/5.0(兼容;MSIE 9.0;Windows NT 6.1;WOW64;Trident/5.0)
我正在运行 Win7 x64 SP1、IE9 32 位。我没有很多插件,只有几个,包括 Shockwave、Kaspersky AV Broswer 帮助程序、MS Office 缓存处理程序、WIndows Live Sign In 帮助程序。
根据损坏的用户代理,问题似乎出在 IE7 的某些变体中。另外,如果您查看最后一个,其中有一个
FunWebProducts
,它告诉我系统上还有其他组件(可能是 addons/activex)可能会产生干扰。不确定,但我怀疑 Windows 更新也是罪魁祸首。
很难确切地说是什么导致了这个问题,但这里有一些提示:
if (!/MSIE (5\.5|6|7|8)/.test(navigator.userAgent) || typeoffilters == 'unknown') return;
这也可能对您有所帮助。除了最后一个项目符号之外,其他一切都是模糊的指针。如果可以的话,请使用 Blackbox。很确定您能够找到导致问题的原因。
看起来代码绝对不是罪魁祸首,而是导致此问题的系统上的因素/组件的组合。
I downloaded the gadget and see no problems. I see the transitions (dissolve) and control bar transparency is also there.
My user agent:
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
I'm running Win7 x64 SP1, IE9 32bit. I do not have many addons, just a few including Shockwave, Kaspersky AV Broswer helpers, MS Office cache handler, WIndows Live Sign In helper.
Based on the broken user agents, the problem seems to be in some variants of IE7. Also if you look at the last one, there is this
FunWebProducts
in it which tells me that there are other components on the system (addons/activex maybe) which could be interfering.Not sure but I would suspect windows updates to be a culprit too.
It is hard to say exactly what is causing this issue, but here's few pointers:
if (!/MSIE (5\.5|6|7|8)/.test(navigator.userAgent) || typeof filters == 'unknown') return;
which can probably help you in general too.Except for the last bullet, everything else are vague pointers. If you can, use Blackbox. Pretty sure you'll be able to find what's causing the issue.
It definitely looks like the code is not the culprit, but a combination of factors/components on those systems that are causing this.
当未指定文档类型时,IE9 以怪异模式运行。然而,您可能会注意到 IE9 的变化表现不同,因为它们(最终)被修复了。 IE9 的行为方式与 IE8 不同,IE8 的行为方式与 IE7 不同,IE7 的行为方式与 IE6 不同,而且它们都与其他更现代的浏览器不同。
一些“过滤器”属性现在已正确放置到带有 -ms 前缀的供应商扩展中。
IE9 runs in quirks mode when a doctype isn't specified. However, you may be noticing changes to IE9 that act differently cause they were (finally) fixed. IE9 does not act like IE8 which doesn't act like IE7 which doesn't act like IE6 and none of them act like any of the other far more modern browsers.
Some of the 'filter' properties are now properly placed into vendor extensions with the -ms prefix.