Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE9+、jQuery1.8.X~1.10.Xで、ポップアップウィンドウ内の要素をターゲットにインジケータを出そうとするとエラーが発生する #310

Closed
fukudayasuo opened this issue May 12, 2014 · 0 comments
Assignees
Milestone

Comments

@fukudayasuo
Copy link

jQuery1.8.X~1.10.Xには、ポップアップウィンドウ内の要素のスタイルを取得できないバグがある。(iframe内の要素なら問題ない)

それが原因で、ポップアップウィンドウにインジケータを表示しようとすると、jQuery内部でエラーが発生する。

エラーの原因は、getComputedStyleが常にjQueryを読んでいるwindowのものが呼ばれていることが原因で、回避するためにjQueryを使わずにスタイルを取得するようにする。

なお、IE8-は、jQueryのスタイル値取得コードで問題なく取得できる。

@simdy simdy added this to the v1.1.10 milestone May 12, 2014
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
(IE9+ jQuery1.8.X~1.10.Xでポップアップウィンドウについてスタイルを取得しようとするとエラーになるので、その回避のため)
fadeIn(),fadeOut()も同様にjQueryの内部でエラーが起きてしまうため、自分で実装しました。
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
iframe内のwindowにインジケータを表示するテストを追加しました。
hifive#310 テストコードで、ポップアップウィンドウ内の要素のスタイルを取得するコードをcss()メソッドを使わないよう修正しました。
(style.displayを取得するように変更したことで、computedStyleは取得できていませんが、現時点での実装ではインジケータはインジケータ要素のdisplayをblockにして表示しているため、style.displayで確認しています。)
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
getStyle -> getComputedStyleWrapper
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
getComputedStyleWrapper -> getComputedStyleObject
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 12, 2014
getWidth,getHeightは、jQueryのwidth(),height()と同じでoffsetWidth/Heightからpaddingを引いた数値を返すように修正。
[inner,outer]Height/Widthについても、jQueryの対応するメソッドと同じ結果が返るように修正。
インジケータのコンテンツの縦位置計算がおかしかったので修正。
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 13, 2014
getComputedStyleがあるかどうかの判定は、そのエレメントが属するwindowを使って判定するようにしました。
elm→elemにリネームしました。
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue May 13, 2014
(widthi()メソッドで設定すると、IE9+、jQuery1.8.X~1.10.XでgetComputedStyleバグが起きてしまうため)
@simdy simdy closed this as completed May 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants