VK said:
Not really. It is a sort of test; are you capable of analysing a problem
to the point of identifying the real issue, and so seeing the question
you need answered or will you just fixate on browser detecting and write
another brittle, unreliable maintenance-heavy script.
<quote>
Compliant Behavior
... , the width and height properties specify the distance
between the left and right edges and top and bottom edges
of the bounding box, respectively. ...
Noncompliant Behavior
... , the width property includes the object's content box, plus
the values of the following properties: border-left, border-right,
padding-left, and padding-right. ...
In standards mode the CSS width/height does not include the borders and
padding, while in quirks mode it does. Since the offsetWidth/Height
properties of a block element state the dimensions of the block
including the borders and padding all you have to do is compare the
offsetWidth/Height of a suitable element with its specified CSS
width/height and if the offset values exceed the CSS values that the CSS
values are defining distances excluding borders and padding.
And that test will tell you no more, and no less, than the disposition
of the CSS width/height properties on every browser that exposes the
appropriate properties, past present and future, and without any
interest in or dependency upon the web browser in question.
There is only one browser implementing IE's Box Model
in quirk mode,
Given that you have a superficial familiarity with two or three web
browsers, in their default configurations, you are not the person to be
generalising about web browsers. As it happens IceBrowser 5 did a very
good job of reproducing the IE box model, it may not be alone in that.
and overall only one known browser
Known to you, don't forget that you don't know much really (and
sometimes less and less as time goes on).
implementing a different box model
in quirk mode: this is IE.
False!
So the minimum reqirement is:
Detect that this is IE
and
Detect that it's in quirk mode
Look at that, you posted the definition of the differences between
standards mode and quirks mode and didn't stop to read the words and see
that they effectively state the question you wanted answered.
Do more work on problem analysis and logic, you will find them
invaluable skills in programming.
Richard.