本文介绍了jQueryUI选项卡和Firefox:getBBox破碎?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在FF 3.6中几乎完全开发了一个前端。它在IE9(即使有很多的SVG),Opera和Webkit,但完全在FF9中完全破解。我花了整整一天的时间来调试它,看起来像getBBox已经打破了沿线的某个地方。可能有两个单独的问题,这两个问题都与在包含多个文本元素的组上获得边界框,旋转文本或者分散在多行上的文本有关。

其他人看到这个?我不得不说,我真的,真的,这一点生气。 Bugzilla没有任何东西。如果他们没有这样一个愚蠢的发行周期,我会试图回去尝试一个旧版本,但它似乎更容易转储它... ... $ / b
$ b

编辑



对于以这种方式来的人来说,答案如下。这基本上是与jQuery UI选项卡, display:none 和维度计算,但问题是,在jqueryui.com()是不完整的。



1 - getBBox的问题通常是由于 display:none 在某处,但是我的代码没有显式的显示:无在其中



- FireFox比其他浏览器更容易受到display / getBBox问题的影响。奇怪的是,在Win7上的FF 9.0.1比在XP上的9.0.1要好3 - 在隐藏的标签(或隐藏的东西)中进行尺寸计算的标准方法是显示在屏幕外(参见上面的链接),而不是应用 display:none



4 - 没有上面的解决方法,FF抛出一个异常,Chrome得到的数字错误,Opera不关心,等等。
$ b $ 5但是上面的解决方法(离屏显示在 .ui-tabs-hide )是不够的。如果你这样做,但是选择标签(选项卡('select')做你的维数计算,那么FF仍然可能会出错(但它不会抛出异常)。 IE9,Opera和Webkit都可以。

6 - 我错了FF 3.6 - 3.6 / Linux似乎和FF 9.0.1 / XP一样。只要在进行维度计算之前选择该选项卡,就可以轻松地进入选项卡代码。对我来说,但可能会打败大多数人的练习点。

更改提到标签的主题

解决方案

时间帮助您获得更多的组织和控制发生的事情!使用多个版本的Firefox可能会很麻烦,尽管这样可以帮助您排除一切。这可能会花费你一个小时在一台功能强大的机器上,但是你将掌握更多的能力,通过让你的计算机保持最新状态,并使其更有条理性地完成任务。

寻找基于Gecko的错误的第一个地方是。



虽然我可以告诉你,但我并不使用SVG,Mozilla一直在大量地更新标准,尽管没有宽限期(很多DOM3 / 4的变化有像杀isSameNode)。

抛开政治,你真的需要使用单独的安装和配置文件。要做到这一点,你需要一些关键的东西...



保持离线安装程序



这是非常重要的,你保持工作的安装程序(这意味着而不是互联网下载器)的工作版本的软件。



你可以得到一些的稳定版本虽然牢记Mozilla正在做的很多建议一些药物测试是为了顺序去页面,然后搜索Firefox旧版本以查找旧版本的安装程序。



安装测试版本




  • C:\MEDIA\INTERNET\Mozilla Firefox 3.6\


  • C:\MEDIA\INTERNET\Mozilla Firefox 4.0\


  • C:\MEDIA\INTERNET\\ \\ Mozilla Firefox 5.0 \


  • C:\MEDIA\INTERNET\Mozilla Firefox 6.0 \\ b \\ li

    C:\MEDIA\INTERNET\Mozilla Firefox 7.0 \



$ b

etc ...

禁用自动升级

自动升级100%反作用于正确测试Gecko渲染引擎的不同版本。



你测试渲染引擎而不是浏览器版本正确吗?

Gecko / Firefox
KHTML / Konqueror(带有KDE桌面的Linux发行版)
Presto / Opera
Trident / Internet Explorer
WebKit / Chrome / Safari( WebKit是两者之间的一个复杂的分支)



熟悉Firefox的配置文件。

设置快捷方式如果您使用的是Windows,那么您的主要Firefox快捷键应该看起来像这样...
$ b $ b

 C:\MEDIA\INTERNET\Mozilla Firefox 8.0\firefox.exe-PMozilla Firefox 8.0

这将自动启动安装了该版本的那个名称的配置文件。您将在迁移到新版本时更新此内容。我强烈推荐使用企业版,每54周更新一次,而不是42天。坦率地说,更新Firefox以获得其他CSS3 word-wrap属性和专有的Microsoft JScript方法的支持是非常荒谬的,因为这些方法不适合用于应用程序级编程。



如果这个(或下一步)中没有这个名字的配置文件存在,配置文件管理器将出现,您将有机会自己创建它。



其他版本



其他版本需要略有不同的快捷方式...



版本/配置文件组合



要快速加载版本/配置文件组合,请使用以下内容...

 C:\MEDIA\INTERNET\Mozilla Firefox 7.0\firefox.exe-no-remote -PMozilla Firefox 7.0

使用-no-remote可以同时运行多个版本的Firefox。您可以多次使用同一个Firefox副本,但您只能在给定实例中使用每个配置文件。


$ b

强制firefox使用配置文件管理器



为了强制Firefox永远向您显示个人资料管理器(如果您有多个个人资料可供选择,例如我有康卡斯特谁要我在无价值的美国电视上吹钱而不是给我可靠的流,我不得不手动下载YouTube视频,所以我有一个专门的配置文件,我下载视频,并从下载窗口中观看,这将浪费我的主要配置文件中的空间)。这些快捷键应该看起来像这样...

 C:\MEDIA\INTERNET\Mozilla Firefox 8.0\firefox .exe-no-remote -ProfileManager 

...再次 - no-remote 打开一个独立于其他实例的新的Firefox实例。



管理你的配置文件



管理配置文件以保持它们的清洁和有序并不困难。再次在Windows上,你可以找到配置文件文件(在你修改之前你想修改它的副本)在...

  C:\documents and settings\YOUR_WINDOWS_USER_NAME\Application Data\Mozilla\Firefox\profiles.ini 

我强烈建议按产品/版本(例如Mozilla Firefox 7.0)命名您的个人资料文件夹。

通过保留单独的配置文件,你可以保留你的个人设置/扩展/等,并确保他们仍然在旧版本的工作。如果Firefox 3.6(很多用户仍在使用)中的某些内容出现中断,并且在新版本中没有中断,那么您的扩展仍然可以在该版本中运行,而如果您在几年之后外出寻找扩展,兼容版本可能会不可用。您可以将扩展名为.xpi的文件重命名为.zip,解压缩install.rdf文件,然后破解最小/最大兼容性版本,尽管这个版本对我来说是100%的工作时间。



Firefox 1.5和更新版本的工具使用-no-remote,我认为Firefox 1.0有一个不同的命令参数。通常我会回到Gecko 1.8+(Firefox 1.5),但主要是Firefox 3.6和适用于中等测试的最新版本。

配置文件之间的同步



新版本出来了,如果你不想更新Firefox每42天去企业(版本10.0将是企业,并将继续支持54周,我认为这是)。我总是重新创建配置文件,以防止垃圾从旧版本传递到新版本,尽管您可以使用同步获取您的密码,并可以导出/导入您的书签。
$ b

备份和还原



如果这听起来很费力,您可以通过映像硬盘来备份所有自定义设置。有一个Macrium反映的免费版本,您可以映像硬盘驱动器分区(也许特定的文件夹,不知道)。花了不到半个小时的时间,把一个驱动器镜像到另一个驱动器上,而不到20个镜头就能够恢复映像。如果我的系统显示蓝屏,我可以在一个半小时内将所有内容恢复到最后一个镜像或镜像(而不是一个小时的安装,几小时的重新安装,设置等等)。

希望这可以帮助你用更新的版本进行更舒适的测试,而不会感到你不得不一直处理更新,同时还能够测试多个版本。






重要!如果您不希望每42天更新一次(对于Firefox进行任何有意义的更改都是不可能的),我建议您使用扩展版本支持版本的火狐作为您的主要副本,支持54周。您仍然可以打开更新的平凡版本,然后在54周后迁移到下一个主要版本,时间过得真的值得您花时间迁移到新版本。您可以下载的扩展版本支持版本。


Just developed a front-end almost entirely in FF 3.6. It works perfectly in IE9 (even with lots of SVG), Opera, and Webkit, but is completely broken in FF9. I've spent the entire day debugging it, and it looks like getBBox has broken somewhere along the line. There are possibly two separate issues, both related to getting a bounding box on a group containing multiple text elements, with rotated text, or text spread over multiple lines.

Anyone else seen this? I've got to say I'm really, really, pissed off by this. Nothing in Bugzilla. If they didn't have such a moronic release cycle I'd be tempted to go back and try an older version, but it seems a lot easier just to dump it...

EDIT

Here's the answer, for anyone who comes by this way. It's basically to do with jQuery UI tabs, display:none, and dimensional computation, but the issue is that the workaround at jqueryui.com (here) is incomplete.

1 - getBBox issues are generally due to a display:none somewhere, but my code didn't have an explicit display:none in it

2 - FireFox is a lot more susceptible to display/getBBox issues than other browsers. Oddly, FF 9.0.1 on Win7 is better than 9.0.1 on XP

3 - the standard way to do dimensional computations in a hidden tab (or hidden anything) is to display off-screen (see the link above), instead of applying display:none

4 - Without the linked workaround above, FF throws an exception, Chrome gets the numbers wrong, Opera doesn't care, etc

5 - But the workaround above (off-screen display in .ui-tabs-hide) isn't sufficient. If you do this, but select the tab (tabs('select')) after doing your dimensional computations, then FF can still get it wrong (but it doesn't throw an exception). IE9, Opera, and Webkit are Ok.

6 - I was wrong about FF 3.6 - 3.6/Linux seems to behave the same as FF 9.0.1/XP

7 - short of digging into the tabs code, one fix is simply to select the tab before doing the dimensional computation. Ok for me, but would probably defeat the point of the exercise for most people.

Changed the subject to mention tabs.

解决方案

Time to help you get a lot more organized and in control of what's going on! Working with multiple versions of Firefox can be a pain though this will help you sort it all out. This may take you an hour on a capable machine however YOU will be in control and much more capable of getting things done by having your computer up to date and having it much more organized.

The first place to look for Gecko based bugs is Bugzilla.

I don't work with SVG though I can tell you Mozilla has been churning away heavily to update standards though without grace (many DOM 3/4 changes have bug with names like "kill isSameNode").

Politics aside, you seriously need to be using separate installs and profiles. To do this you need a few key things...

Keep offline installers

It's exceptionally important that you keep working installers (and that means not internet downloaders) of working versions of software.

You can get SOME of the stable releases though keep in mind a LOT of what Mozilla is doing suggests some drug testing is in order by going to the Firefox Releases page and then searching "Firefox old versions" to find older installers.

Install the versions you plan on testing

  • C:\MEDIA\INTERNET\Mozilla Firefox 3.6\

  • C:\MEDIA\INTERNET\Mozilla Firefox 4.0\

  • C:\MEDIA\INTERNET\Mozilla Firefox 5.0\

  • C:\MEDIA\INTERNET\Mozilla Firefox 6.0\

  • C:\MEDIA\INTERNET\Mozilla Firefox 7.0\

etc...

Disable automatic upgrades

Automatic upgrades are 100% counter-productive to properly testing different versions of the Gecko rendering engine.

You ARE testing rendering engines and not browser versions correct?

Gecko / FirefoxKHTML / Konqueror (Linux distro with KDE desktop)Presto / OperaTrident / Internet ExplorerWebKit / Chrome/Safari (WebKit is a complex fork between the two essentially)

Get acquainted with Firefox's profiles.

Set up your shortcuts

Your primary Firefox shortcut should look something like this if you're using Windows...

"C:\MEDIA\INTERNET\Mozilla Firefox 8.0\firefox.exe" -P "Mozilla Firefox 8.0"

This will automatically launch the profile with that name with that version installed. You will want to update this when you migrate to a newer version. I HIGHLY recommend using the enterprise edition which will be updated once every 54 weeks instead of 42 days. I maintain other profiles though frankly it's beyond ludicrous to update Firefox to gain support for a miscellaneous CSS3 word-wrap property and a proprietary Microsoft JScript method that isn't reliable to use for application level programming to begin with.

If a profile without that name exists for either this (or the next step) the profile manager will appear and you'll have the opportunity to create it yourself.

Other versions

Other versions need shortcuts that are slightly different...

Version/Profile combos

For quickly loading Version/Profile combos use the following...

"C:\MEDIA\INTERNET\Mozilla Firefox 7.0\firefox.exe" -no-remote -P "Mozilla Firefox 7.0"

The -no-remote lets you run multiple versions of Firefox simultaneously. You can use the same copy of Firefox multiple times however you can only use each profile in once given instance.

Force firefox to use the profile manager

To force Firefox to always show you the profile manager (if you have multiple profiles you want to choose from, in example since I have Comcast who wants me to blow money on the worthless "American" television instead of giving me reliable streams I have to manually download YouTube videos so I have a dedicated profile where I download videos and watch them from the download window, this would waste space in my main profile). Those shortcuts should look like this...

"C:\MEDIA\INTERNET\Mozilla Firefox 8.0\firefox.exe" -no-remote -ProfileManager

...and again -no-remote opens a new instance of Firefox separate from other instances.

Managing your profiles

Managing profiles to keep them clean and orderly is not difficult. Again on Windows you'll find the profile text file (which you'll want to make a copy of before you modify it in case you goof something up) at...

C:\documents and settings\YOUR_WINDOWS_USER_NAME\Application Data\Mozilla\Firefox\profiles.ini

I highly recommend naming your profile folders by product/version (e.g. "Mozilla Firefox 7.0").

By keeping separate profiles you can retain your personal settings/extensions/etc and make sure they still work in older versions. If something breaks in Firefox 3.6 (which a lot of users still use) and it's not broken in newer versions you'll still have your extensions working in that version whereas if you go out looking for the extension a few years later a compatible version might not be available. You can rename an extension file from .xpi to .zip, extract the install.rdf file, and hack the min/max compatibility version though which has worked 100% of the time for me.

Firefox 1.5 and newer work with -no-remote and I think there was a different command parameter for Firefox 1.0. Generally I test back to Gecko 1.8+ (Firefox 1.5) though primarily Firefox 3.6 and the latest version for moderate testing purposes.

Syncing between profiles

New versions come out and again if you're not interested in updating Firefox every 42 days go enterprise (version 10.0 will be enterprise and will remain supported for 54 weeks I think it was). I always recreate profiles to prevent garbage from passing from older versions to newer versions though you can use sync to get your passwords and you can export/import your bookmarks.

Backups and restoring

If this sounds like a lot of effort you can back up all your customizations by imaging your hard drive. There is a freeware version of Macrium Reflect that you can image a hard drive partition (maybe specific folders, not sure). Took me less than half an hour to mirror one drive to another and less then 20 to make an image to be restored. If my system permantly blue screens I can restore everything to the last image or mirror in about half an hour (instead of an hour install, hours of reinstalling, setting stuff up, etc).

Hopefully this will help you feel more comfortable testing with newer versions without feeling like you're forced to deal with updates all the time while still being able to test multiple versions.


Important! If you're NOT interested in updating everything once every 42 days (which is impossible for any meaningful changes to be made to Firefox) I highly recommend using the extended release support version of Firefox as your main copy which is supported for 54 weeks. You can still open newer trivial versions and then after 54 weeks migrate to the next major version where the time passed will actually make it worth your time to migrate to the newer version. You can download the extended release support version here.

这篇关于jQueryUI选项卡和Firefox:getBBox破碎?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 08:17