Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#14247 closed defect (fixed)

browser window resize doesn't resize layout widgets on IE9

Reported by: Eric Wang Owned by: bill
Priority: high Milestone: 1.6.1
Component: Dijit Version: 1.7.0
Keywords: layout Cc:
Blocked By: Blocking:

Description

dijit layout failed on IE9.

the root cause is IE9 need to bind "onresize" event on window.global, not as IE6/7/8 bind on domNode.

the testcase file and patch as follow.

Attachments (4)

LayoutContainer.html (12.4 KB) - added by Eric Wang 8 years ago.
Testcase for layout on IE9.
dijit.layout (682 bytes) - added by Eric Wang 8 years ago.
patch of dijit.layout._LayoutWidget.js
bcSample.html (979 bytes) - added by adros 7 years ago.
Testcase
bcSample_16.html (947 bytes) - added by haysmark 6 years ago.
Test case for 1.6 branch.

Download all attachments as: .zip

Change History (18)

Changed 8 years ago by Eric Wang

Attachment: LayoutContainer.html added

Testcase for layout on IE9.

Changed 8 years ago by Eric Wang

Attachment: dijit.layout added

patch of dijit.layout._LayoutWidget.js

comment:1 Changed 8 years ago by bill

Owner: set to bill
Status: newassigned

When you say that "dijit layout failed on IE9" what do you mean exactly? I'm guessing you mean that resizing the browser window doesn't resize the widget.

If so, good catch. I wish we could feature-test for this, but on IE9

"onresize" in document.createElement("div")

returns true even though that onresize handler never fires.

So, your fix seems good; I'll check that in... or possibly just remove the IE path altogether.

comment:2 Changed 8 years ago by bill

In [27007]:

Remove IE branch to monitor resize events per node, rather than on the browser window. Although theoretically more efficient, it doesn't work on IE9, and I've heard stories of endless resize loops when myWidget.resize() (incorrectly) changes the size of the widget, rather than just doing internal layout.

Fixing on trunk, refs #14247 !strict.

comment:3 Changed 8 years ago by bill

Resolution: fixed
Status: assignedclosed

In [27008]:

Remove IE branch to monitor resize events per node, rather than on the browser window. Although theoretically more efficient, it doesn't work on IE9, and I've heard stories of endless resize loops when myWidget.resize() (incorrectly) changes the size of the widget, rather than just doing internal layout.

Fixing on 1.7 branch, fixes #14247 !strict.

comment:4 Changed 7 years ago by bill

In [27262]:

[27007] updated the browser-resize detection for subclasses of _LayoutWidget, but not for subclasses of ContentPane. Adding in code for ContentPane too. However, that exposes the infinite loop problem, where ContentPane.resize() causes a(nother) browser resize event, so have to add guard code to detect spurious resize notifications, hence a new !Viewport.js helper module.

Also modifying Dialog to leverage the viewport resize events it gets as a ContentPane subclass, rather than setting up it's own listener.

Also modifying robotx.js so that it sets the iframe size before dojo loads (inside the iframe), rather than after. The !BorderContainer_full.html test was hitting a corner case (on IE) where DOH resized the iframe after the BorderContainer layout() ran, but the BorderContainer didn't get a resize event (like on a true browser resize), so it didn't resize itself.

Refs #14247 !strict.

comment:5 in reply to:  4 Changed 7 years ago by ben hockey

Replying to bill:

fyi - you left in some debugging in r27262.

comment:6 Changed 7 years ago by bill

In [27283]:

remove console.log() statements, refs #14247 !strict.

comment:7 Changed 7 years ago by adros

Resolution: fixed
Status: closedreopened

There is still a problem with same behaviour in Chrome 15, IE 9, FF 4. If I resize window only verticaly, width of the BorderContainer? stays unchanged. Then resizing the window horizontaly causes adapting width of the BorderContainer? to the width of the window. But height stays unchanged.
The same behaviour applies for resizing the window the other way around.
I'll attach a small sample.

Changed 7 years ago by adros

Attachment: bcSample.html added

Testcase

comment:8 Changed 7 years ago by bill

Milestone: 1.7.11.7.2
Summary: dijit layout failed on IE9browser window resize doesn't resize layout widgets on IE9

Hmm, too bad, OK I'll take another look.

comment:9 Changed 7 years ago by bill

PS: @adros - You must work with, or are the same person as matej, this is the same format of test file he attached. Your test case is not self contained, it shouldn't reference a file called sample.js.

comment:10 Changed 7 years ago by bill

Resolution: fixed
Status: reopenedclosed

In [27427]:

fix typo preventing resize code from getting called if only horizontal or only vertical size is changed, fixes #14247 on trunk/ !strict

comment:11 Changed 7 years ago by bill

Milestone: 1.7.21.7.1
Priority: highnormal

Actually, this problem doesn't occur on the 1.7 branch / 1.7.1 tag (and I fixed trunk in the above checkin).

Changed 6 years ago by haysmark

Attachment: bcSample_16.html added

Test case for 1.6 branch.

comment:12 Changed 6 years ago by haysmark

Milestone: 1.7.11.6.1

This also works just fine in 1.6, attaching the test case I used to reproduce. I don't think it needs to be backported (thankfully)!

comment:13 Changed 6 years ago by bill

In [31402]:

remove no-longer used dependency after [27262], refs #14247 !strict.

comment:14 Changed 5 years ago by Bill Keese <bill@…>

In bfcc0886bf28d6bb222df9e1e8b93e7a9d4fedb6/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.