Skip to content

getOpacity malfunctions with IE 9 #175

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

Open
jwestbrook opened this issue Apr 29, 2014 · 2 comments
Open

getOpacity malfunctions with IE 9 #175

jwestbrook opened this issue Apr 29, 2014 · 2 comments
Labels

Comments

@jwestbrook
Copy link
Collaborator

previous lighthouse ticket #1671
by Matthew Schultz


getOpacity malfunctions with IE 9 by not setting it properly because it is retrieved as a string. The reason for this is getStyle is overwritten with this:

if ('styleFloat' in DIV.style) { methods.getStyle = getStyle_IE; methods.setOpacity = setOpacity_IE; methods.getOpacity = getOpacity_IE; }

Here's the trace of what happens to trigger this bug:

Element.getOpacity(element);
Element.getStyle(element, 'opacity'); <- overwritten
Element.getStyle_IE(element, 'opacity');
return $value; <- getOpacity_IE is not called because standard opacity is supported
I have enclosed a patch which will fix this problem. This ensures that when getOpacity_IE gets called and the standard opacity call is supported, it will actually call the standard call instead of using the overwritten one.

diff --git a/src/prototype/dom/dom.js b/src/prototype/dom/dom.js
index f14639b..b456875 100644
--- a/src/prototype/dom/dom.js
+++ b/src/prototype/dom/dom.js
@@ -2847,6 +2847,10 @@
    *  
   **/
   function getStyle(element, style) {
+    return getDomStyle(element, style);
+  }
+
+  function getDomStyle(element, style) {
     element = $(element);
     style = normalizeStyleName(style);

@@ -2989,7 +2993,7 @@
    *  Returns the opacity of the element.
   **/
   function getOpacity(element) {
-    return Element.getStyle(element, 'opacity');
+    return getDomStyle(element, 'opacity');
   }

   function getOpacity_IE(element) {
@jwestbrook
Copy link
Collaborator Author

Victor
January 24th, 2013 @ 08:20 PM

I've made pull request for opacity in IE9 4 months ago: #73

@savetheclocktower
Copy link
Collaborator

I need to investigate whether this is still happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants