Ticket #2531256 (closed defect)

Reporter


einarq
Opened: 09/29/11
Last modified: 10/19/11
Status: closed
Type: defect
Resolution: duplicate
Duplicate of: #2531310

Owner


Luke Smith
Target Release:
Priority: P3 (normal)
Summary: event-resize not working with custom configuration of YUI
Description:

I am trying to migrate from 3.3.0 to 3.4.1, and getting a few problems. They seem to be related to my custom configuration of YUI. I have previsouly migrated from YUI 2, so using the "normal" pattern
of having only the seed file and load everything async doesn't work for me in all cases since it would involve changing hundreds of pages and thousands of lines of code.

The latest problem I found in 3.4.1 is this one related to event-resize when using my custom configuration. If I have use a only seed file initially it works fine, so it seems like most of the
internal testing of YUI is being done on the seed file only.

Anyway, I get a "Member not found" error in IE 7, which I didn't get before.

Type: defect Observed in Version: 3.4.1
Component: Event Severity: S3 (normal)
Assigned To: Luke Smith Target Release:
Location: Priority: P3 (normal)
Tags: Relates To:
Browsers: IE 7.x,IE 8.x,IE 9.x
URL:
Test Information:

- Open the attachment in IE 7
- Resize the window
- Javascript error is thrown

Attachments

Attachment #1: test.htm (download)

Change History

Luke Smith

YUI Contributor

Posted: 09/29/11
  • priority changed to P3 (normal)
  • status changed from new to accepted

Luke Smith

YUI Contributor

Posted: 09/29/11

I wonder if this has to do with the global _yuid leak in combination with Y.guid using MS's proprietary id generation method. Perhaps the method doesn't exist on the window object in IE.

Luke Smith

YUI Contributor

Posted: 09/30/11
  • status changed from accepted to infoneeded

I was unable to recreate the error locally with a couple different configurations, so you'll need to provide more info on your custom setup.

einarq

Posted: 09/30/11
  • status changed from infoneeded to assigned

einarq

Posted: 09/30/11

Did you try the one in the attachment? Or do you mean more information about why I have the custom setup that I have included in the attachment?

Arnaud Didry

YUI Contributor

Posted: 10/5/11
  • browser changed from IE 7.x to IE 7.x,IE 8.x

Arnaud Didry

YUI Contributor

Posted: 10/5/11

Hi,

I tried to track down the problem :

event-resize.js >> "new DOMEventFacade(...)" >> DOMEventFacade:init() >> "this.altKey = e.altKey" >> cause IE to throw the "Member not found" error.

Here is my quick and dirty fix : https://gist.github.com/1264931

einarq

Posted: 10/6/11

Seemed to me that if I used yui-min.js instead of my custom configuration, everything was fine. That is not an option for me unfortunately, need to preload the essential parts of YUI before doing anything else (legacy application).

I am getting a lot of problems when trying to use custom configurations in general (for instance using yui-base instead of yui).
I created a ticket about this (http://yuilibrary.com/projects/yui3/ticket/2531255), hopefully this will be resolved in 3.5.0. Especially on mobile it seems extra important to download as little as possible to the browser. According to Google, every byte matters when it comes to load time and parsing of javascript on mobile (http://code.google.com/speed/page-speed/docs/mobile.html).

John Gymer

Posted: 10/6/11
  • browser changed from IE 7.x,IE 8.x to IE 7.x,IE 8.x,IE 9.x

John Gymer

Posted: 10/6/11

Here's an example which manifests itself in IE (only tried 9), but ok in FireFox 3.6...
Using a VERY simple setup using IIS, if I locally host YUI 3.4.0 or 3.4.1, the resize event causes an exception in IE:
"Error: member not found"
In IE debugger, relates to event-base-min.js, highlighting the code "this.altKey=i.altKey". I can provide more details of this error's location if necessary.

html looks like this (sorry, not sure how to format it nicely here):

<html>
<head>
<title>YUI Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="yui340/build/yui/yui.js"></script>
</head>

<body>
<h1>YUI Test</h1>
<p>This is a test of some YUI controls and functions</p>

<script>

YUI().use('node', 'event',
function (Y)
{
winResizeFn();
Y.on("windowresize", winResizeFn);
}
);

function winResizeFn()
{

YUI().use('node',
function (Y)
{
Y.one('#windowSize').setContent('It has been resized now! ' + Y.one('#windowSize').get('winWidth') + ' ' + Y.one('#windowSize').get('docWidth') + ' ' + Y.one('#windowSize').getX());
Y.one('#gen-ReportOutputHTMLCntrl').set('width',Y.one('#gen-ReportOutputHTMLCntrl').get('winWidth') - (Y.one('#gen-ReportOutputHTMLCntrl').getX()*2));
Y.one('#gen-ReportOutputHTMLCntrl').set('height',((Y.one('#gen-ReportOutputHTMLCntrl').get('winHeight') - (Y.one('#gen-ReportOutputHTMLCntrl').getY()) - Y.one('#gen-ReportOutputHTMLCntrl').getX()))-10);
}
);
}

</script>

<p id="windowSize">The browser window has not been resized yet</p>

<iframe id="gen-ReportOutputHTMLCntrl" class="ReportOutputHTMLCntrl" src="TestIt-IFrame.html" style="text-align:left;" scrolling='no' frameborder='1' marginheight='0' marginwidth='0'></iframe>

</body>
</html>

Above, I reference "yui340/build/yui/yui.js" as the local YUI libraries. Same problem using 3.4.1. 3.3.0 is ok, so I'm deferring to that for the time-being.

The IFRAME is incidental, and the 2nd html sourced by it contains just this:

<p id="windowSize-Inner">The browser window has not been changed yet - Inner</p>

<div id="myDiv" class="myDivClass">
<p id="oddText">Here it is<br>with a number of lines<br>so that it gets scrolling<br>marvellous<br>hey, what what<br>noice<br>fab<br>keep going<br>a little more</p>
</div>

The purpose of this simple example is to automatically resize the IFRAME as the Browser window resizes.

Not sure if that helps, but thought it might be useful info.

Regards,
John

Arnaud Didry

YUI Contributor

Posted: 10/6/11

Luke Smith

YUI Contributor

Posted: 10/19/11
  • duplicate changed to 2531310
  • resolution changed to duplicate
  • status changed from assigned to closed

This ticket was marked as a duplicate of #2531310