Raymond Martens

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromRaymond Martens
ToMe
SubjectNo, IE ... - overflow:visible: How to make Mozilla use the wrong behaviour?
Date19 November 2004 00:01
Dear Mark,


I read with great interest your site on 'No IE did not handle it
properly'. I was really astonished to see that many of the things I
tried with IE where actually bugs!

On the 'overflow: visible' page you mention that the W3C standard can do
much more than IE (with float, clear, min/max-height/width, overflow...)
But I have a case where I would like mozilla (and all other standard
compliant browsers) to do exactly like IE.

The problem:

I have a box with a lot of content in it. That box is resizable via a
image the user can drag. But the user should not be able to make the box
so small that some of the content is either not shown or spills over.
So in IE I use set the style.width property of the box element. This
makes IE resize the box but only to a certain point - making sure all
content always fits into it. Then I can read the size the box has by
reading the offsetWidth property. Then I can adjust the style property
again.

Now Mozilla and Opera support the offsetWidth property but the problem
is that they will not stop making the box smaller until the width of it
is 0px. 

So either I have to find a way of telling mozilla to behave like IE or I
need a way to compute the least width the content of a div (or any other
html-element) can take without overspilling or hiding or creating
scrollbars.

Any advice would be very usefull.

Best Regards,

Ray
FromMe
ToRaymond Martens
SubjectRe: No, IE ... - overflow:visible: How to make Mozilla use the wrong behaviour?
Date19 November 2004 8:50
Ray,

Since you need to use the width style, and not the min-width style (for the
resizing effect), you cannot use the float/clear trick to make IE behave.
You are quite correct that you need to modify the behaviour of the other
browsers to match IE.

According to the standard, there is one type of element that is allowed to
treat the 'width' style as a guideline, not an explicit rule; a table cell.
Table cells are allowed to stretch to allow the contents to fit. In fact,
that is the basis of how my mini window script works.

Of course, your page may not be able to use a table cell for this, but
because standards compliant browsers also understand the display:table-cell;
style, you can use that instead:
<div style="width:20px;display:table-cell;border:1px solid red;">
supercalifragilisticexpialidoceous
</div>

This works in all current popular browsers.
Mozilla/Firefox, Opera, Safari, Konqueror and even ICEbrowser will use the
display:table-cell; and will therefore allow it to stretch to fit the
contents. IE and iCab do not understand display:table-cell; but they also
don't obay the standard and will stretch it anyway.

I will add a note about this to the article page.

Hope this is what you were looking for.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromRaymond Martens
ToMe
SubjectRe: No, IE ... - overflow:visible: How to make Mozilla use the wrong behaviour?
Date19 November 2004 12:53
Tarquin,


Thank you so much for your prompt and very accurate answer - it helped
me a lot. But I found out that when I make the display: table-cell, I
can resize the box perfectly, except that it won't resize bigger than
it's original width!

I played around a bit with different display-values and found that
display:table does the trick. It solves both problems. 

Now the next problem that comes up is that mozilla ignores the
border-style:outset and shows a border-style:groove. I guess this is not
a feature but indeed a display bug. (Only inset and outset get
misinterpreted, all other styles are shown as expected.)

- but wait: I found out - it only happened when
'border-collapse:collapse;' was used. Dunno why I had that line in
there... So as I removed it, it solved the border-style problem as well.
Any explanation to that?

Best Regards,

Ray

P.S: If you are anyhow interested in seeing what I'm using it for:

[project page address]

It is yet another browser based editor ;) works on mozilla (1.3+?) and
ie (5+)
It might take some time to load the first time (even 20 seconds) but I'm
working on that - as on many many other issues.

What makes mine different to the bunch of other ones around, is that it
auto-loads on client-side, is _very_ modular, really compatible to IE
and mozilla and aimed at being integrated into any site very easily.

I will soon create a project page for it.
FromMe
ToRaymond Martens
SubjectRe: No, IE ... - overflow:visible: How to make Mozilla use the wrong behaviour?
Date19 November 2004 13:51
> found that display:table does the trick. It solves both problems.

Excellent. I will change the note on the article to say that can also be used

> it only happened when 'border-collapse:collapse;' was used.
> Any explanation to that?

heh, sounds like a bug to me. see if you can make a minimal test case and
if so, submit it to bugzilla
http://bugzilla.mozilla.org/

> It might take some time to load the first time (even 20 seconds)

Oh no. Much longer. closer to 40. I have a 100 Mbps direct connection to
the internet, and a 1.8 GHz processor. IE downloaded it all in a couple of
seconds then took _ages_ to render it. Firefox took longer to download it
(about 5 seconds), but rendered it in a couple of seconds.

I also got a rendering artifact in IE. Looks like some borders got left
behind. I have attached a screenshot.

As a side point, one thing I really like about HTMLarea is that it uses
textareas. I am an Opera user, and therefore I cannot use these HTML
editors, but I can easily edit the HTML code myself. HTMLarea does that for
me. IE and Mozilla users get the full blown editor. Opera, Safari, IE 5, IE
Mac, Mozilla 1.2- users, and users of other browsers get a textarea with
the source code. Would make many of us happy if you could implement
something like that :)

Personally, I envision something like a textarea and an output area.
Whenever onchange fires for the textarea, it loads the code into the output
area (innerHTML), so I can see my results. Just a thought.

keep up the good work.

Tarquin
FromRaymond Martens
ToMe
SubjectNested list collapsing script - enhanced/CSSed
Date26 November 2004 23:53
Attachmentpage using CSS generated content to make a list look like a folder structure
Dear Mark,

I wanted to share this creation of mine with you. It is still only
adapted to modern browsers but can be done for IE as well.

I used your 'Nested list collapsing script' to make a first try
implementing the same functionality as the 'Collapsible list generation
controls' script.

Most importantly CSS is used to obtain these results.

I could also do some 'behaviour' to automatically switch between a plus
and a minus.

If it's of any interest for you, feel free to use it. -Ray
FromRaymond Martens
ToMe
SubjectRe: Nested list collapsing script - enhanced/CSSed
Date27 November 04 10:25
Attachmentpage using CSS generated content to make a list look like a folder structure
Mark:

I made an update of the list. Now it will also correctly switch +/- in
Mozilla (don't know for others). I also introduced a new parameter in
your script to make it possible, that only the 'plus/minus' is used as a
link and not the whole list-item.

Any comments from your side? -Ray
FromMe
ToRaymond Martens
SubjectRe: Nested list collapsing script - enhanced/CSSed
Date28 November 2004 16:31
Ray,

very nice. _very_ nice.

I love the idea of the generated content, even if it does mean that you
have to use the ugly fix to get it working in IE. And fortunately since the
generated content is inline, it does not have an adverse effect on
Mozilla/Firefox either (gecko engine cannot make generated content block
level).

The good news is that it works in Opera (without the last-child support but
that is not bad) and almost certainly Safari as well. nicely done.

Would you mind if I make your CSS driven version available on my site? I
like the change you made to the script as well, looks like something worth
a proper release.

Tarquin
FromRaymond Martens
ToMe
SubjectRe: Nested list collapsing script - enhanced/CSSed
Date28 November 2004 23:53
Attachmentpage using script to make a list look like a folder structure
Mark,

Thank you, always nice to hear, especially from the 'godfather of
javascript browser compatibility' ;)

Cool that Opera does it - Unfortunately for IE it's more difficult,
because 'IE7' (Dean Edwards project) won't work correctly at this stage.

This is why I finalized a script (in the attachment) that will make it
work with IE5+.

Of course you may make anything available I send/sent you - I'm happy
with it.

For the modification of your script, you might have noticed, that the
new parameters are always the last ones in the function call and
defaulted to false (easier for transition).

Ray
FromRaymond Martens
ToMe
SubjectMovable mini-window: functionality expansion
Date31 March 2005 11:22
Dear Mark,


I wanted to tell you that I added some functionality to your mini-window
script:
I added the possibility of creating an IFRAME in the main-content like this:

var iFrameData = ['iframeName', 'iframeURL', windowWidth, windowHeight,
useScrollbar];

createMiniWinLayer(iFrameData, ....);

The special thing about it, is that when dragging the mini-window or when
resizing it, I hide the frame to ease the mouse operations (you surely know
that it is not quite handy loosing all mouse events to the iframe).

I added the files for this; it is still draft though.

The reason I did this, is because I often need external windows, but the data
comes from another file - or the content of that window changes often.

Since my first e-mail somehow didn't get to you, I got time to add a new
file: the calendar-popup using the miniwindow. It was just the idea of making it
usable with _any_ popup-blocker.

To see it all, just start the 'movablewindow.html'

The file can be downloaded at

http://www.aiesec.org.mx/aleweb/uploads/movable_window_addition_draft_c.rar

Best regards,

Ray
FromMe
ToRaymond Martens
SubjectRe: Movable mini-window: functionality expansion
Date31 March 2005 11:05
Ray,

> I added the possibility of creating an IFRAME in the main-content like this:
>
> var iFrameData = ['iframeName', 'iframeURL', windowWidth, windowHeight,
> useScrollbar];

what can I say :) wow!

I still see problems in browsers like Opera that use the standard iframe
widgets (that are not able to overlap), and also when hitting maximise (as
the iframes do not resize), but it looks a lot better than anything I put
together for iframes.

Neat effect with the calendar as well :)

> I hide the frame to ease the mouse operations (you surely know
> that it is not quite handy loosing all mouse events to the iframe).

That is not the only problem. Gecko browsers, IE Mac and Safari/Konqueror
hate moving iframes, but by hiding them, you avoid those bugs, and you make
it run much faster.

> PP.S. It's kinda hard (if not impossible) reaching you by e-mail. I tried at
> least 5 mails over several weeks - all came back!

Yeah, sorry, for two weeks, my ISP has been bouncing virtually all my
emails (over 99% of them) for no apparent reason. I have asked them to fix
it. they tried to blame my email domain, I told them I used to be an email
administrator, and please don't talk to me like I am an idiot, as the
bounces clearly show it is their fault, not mine. they said that I would
need to use a phone number and not email (I was using my work email
address), but the number they gave me only works in the UK, and I am
working in Norway for 6 months (for Opera). so I am a little annoyed with
them, and I am going to ask them one more time, and if they do not fix it,
I will get another provider.

Keep an eye on http://www.howtocreate.co.uk/sendEmail.php as I will put
details on there if/when it is fixed. For now ... sorry, I can't do very
much to fix it :(

Tarquin
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.