Title: Building Around Browser Bugs
1Building Around Browser Bugs
Edward Grossman
2Exterminator?
- Edward Grossman
- Editor-at-Large, internet.com
- JavaBoutique.com, ServerWatch.com,
WebServerCompare.com, search.internet.com,
IntranetDesignMagazine.com, WDVL.com - egrossman_at_internet.com
- http//wdvl.com/Authoring/HTML/BrowserBugs/
3Bugs Bug
- What Well Cover
- Define Bugs
- How to Kill
- Squash Bugs
- Audience Bugs
- What Well Assume
- You Know What HTML Is
- Youre Building for v4 Browsers
- You Want to Squash Bugs
4What Are Bugs?
- Display Bugs
- Layout, Rendering
- Application Bugs
- Memory Leak
- Security Bugs
- Expose HD or Personal Information
5Display Bugs
- Rendering Problems
- Often Caused by Bad Code
- Sometimes Caused by Good Code
- Valid HTML sometimes causes display problems
- Valid HTML rendered differently by different
browsers platforms - Sometimes all are OK, just different
- Sometimes one (or some) platform/browser totally
breaks - Different Than Not Implemented
6Platform Matters
- www.internet.com Browser Versions
- IE 5 -- 52
- NS 4 -- 24
- IE 4 -- 19
- Everything Else --
- WebTV -- .3
- Mozilla (NS6) -- .1
Source internet.com Log Files, 2000/03/16
7Platform Matters
- www.internet.com OS Versions
- Windows NT -- 49
- Windows 95/98 -- 42
- Macintosh -- 5
- Linux -- 2
- Everything Else
Source internet.com Log Files, 2000/03/16
8Bug Examples
- Underscore Bug
- Table-Space Bug
9Underscore Bug Example
10Table-Space Bug Example
11Squashing Bugs
- The Madness
- The Method
- The Solution(s)
12The Madness
- Browsers Do an Incredibly Good Job of Displaying
Bad Code - Sometimes They Cant Cope
- Browsers/HTML Are Conflicted About Displaying
White Space - CSS/XML is Poorly Implemented
- Werent Complete
13The Method
- Remove Code
- Until Bug Scrams
- Add Code Back
- Until Bug Appears
- Non-Valid Solution?
- Should You Care?
- Sometimes Solution is NOT Valid HTML
- Write Good Code
- Dont Tangle
- Indent
- Comment Tags
- Write Valid Code
- Close Tags
- Nest Properly
- Examine White Space
- Examine Alignment
14The Method -- Digression
SRC"/java-mini-yellow.gif ALTjava BORDER0
Click Above Image for
JavaBoutique
15The Method -- Digression
SRC"/java-mini-yellow.gif ALTjavaBORDER0
Click Above Image
for JavaBoutique
16The Method -- Digression
Click Above
Image for JavaBoutique
17The Solutions
- Assume v4 Browsers
- Majority are Windows Surfers
- Kill Bugs!!!!
- Underscore Bug
- Table Space Bug
- CSS Bugs
- Generic Font Declarations
- Lose Style
- Body Padding Bug
18Underscore Bug
19Underscore Bug Bad HTML
JavaBoutique is Cool.
Here is a Link to
the Site ue.com" WIDTH"114" HEIGHT"43" BORDER"1"
ALT"" Click Above Image for
JavaBoutique
20Underscore Bug Good HTML
JavaBoutique is Cool.
Here is a Link to
the Site ue.com" WIDTH"114" HEIGHT"43" BORDER"1"
ALT"" Click Above Image for
JavaBoutique
21Underscore Bug Squashed!
22Table-Space Bug
23Table-Space Bug Bad HTML
cellpadding"0"
E-Comm is Cool
alt"" bgcolor"000000" E-Comm is Cool
24Table-Space Bug Good HTML
cellpadding"0"
E-Comm is Cool
alt"" bgcolor"000000" E-Comm is Cool
25Table-Space Bug Best HTML
cellpadding"0"
E-Comm is Cool
alt""
E-Comm is Cool
26Table-Space Bug Squashed!
27Table Space Bug Addendum
- Is it really a bug?
- Yes
- Space Before Doesnt Cause Same Displacement
- Irregular Behavior
- No
- HTML Does Not Require (at this point) the Strict
Declaration of Text Content ? White Space
Recognized by Default.
28CSS Bug Generic Font
NS4
IE4
IE5
29Generic Font Bad HTML
.cStyle font-familycursi
vefont-size18pt .ssStyle font-familysans-ser
if .mStyle font-familymonospace --
-- -- Cursive Text
Here Sans Serif Text
Here Monospace Text
Here
30Generic Font Good HTML
.cStyle font-familyScrip
t,Zapf-Chancery,cursive font-size18pt .ssSt
yle font-familysans-serif .mStyle font-family
monospace -- -- -- class"cStyle"Cursive Text Here class"ssStyle"Sans Serif Text Here class"mStyle"Monospace Text Here
31Generic Font Bug Squashed!
NS4
IE4
IE5
32CSS Bug Lose Style
33Lose Style Bug Bad HTML
P font-familyarialfont-
size16pt -- -- -- This is a
paragraph of text
with a table inline
SiteURLd icominternt.com/tr yahooyahoo.com
but the font style is
lost. Here's another par
and the style
is retained.
34Lose Style Bug Good HTML
P font-familyarialfont-
size16pt -- -- -- This is now
two paragraphs of text. border"1" SiteURL
icominternt.com
yahooyahoo.com
The style is re-established. pHere's another par
and the style is
retained.
35Lose Style Bug Best HTML
P font-familyarialfont-
size16pt .P font-familyarialfont-size16pt
-- -- -- This is a par of
text
with a table inline border"1" SiteURL
icominternt.com
yahooyahoo.com
and the style is
re-established. Here's another
paragraph
and the style is retained.
36Lose Style Bug Squashed!
37Body Padding Bug (aka WDVL-Hell)
38Body Padding Bug Bad HTML
cellspacing"0" border"0" bgcolor"black"
Hello
World
color"FFFFFF"NavBar width"70"Content
39Body Padding Bug
40Body Padding Bug Good HTML
cellpadding"0" cellspacing"0" border"0" bgcolor"black" color"FFFFFF"Hello World
bgcolor"black" NavBaront Content table
41Body Padding Bug
42Body Padding Bug Better HTML
style"margin 0px" cellpadding"0" cellspacing"0" border"0" bgcolor"black" color"FFFFFF"Hello World
bgcolor"black" NavBaront Content table
43Body Padding Bug
Not HTML4 Compliant
44Body Padding Bug Back to the Drawing Board
Give IE apadding 0pxand it works. Means IE
Adds 8pxby default. Could it bethat NS
adds0px to a defaultpadding of 8px?
45Body Padding Bug Best HTML 1
BODY margin-top-8pxmargin-left-8px /style cellpadding"0" cellspacing"0" border"0" bgcolor"black" color"FFFFFF"Hello World
color"FFFFFF"NavBar width70"Content
46Body Padding Bug
47Body Padding Bug Best HTML 2
BODY margin-top-8pxmargin-left-8px /style cellpadding"0" cellspacing"0" border"0" bgcolor"black" color"FFFFFF"Hello World
color"FFFFFF"NavBar width"69"Content
nbsp
nbsp
48Body Padding Bug Squashed!
49Body Padding Bug Addendum
- Solution ? Exactly The Same Display in All
Browsers - Acceptable Compromise!
50Audience Bugs
- Send bugs to egrossman_at_internet.com
51Summary
- There Are Bugs
- Underscore, Resize, Cache, Macintosh
- Fighting Bugs
- Examine White Space
- Simplifiy
- Strip Away Code Methodically
- Build Back Up
- We Smashed Bugs
- Examples of Building Better Code
52Conclusion
- Know Your Audience
- Technically Adept - Newer Browsers
- Consumer and/or Commerce - Play It Safe
- Testing
- Browsers, Platforms
- Validation
- http//validator.w3.org/
- There Will Be Bugs
- IE5, Gecko, Opera, Linux, BeOS, XML, XHTML
53Resources
- http//wdvl.com/Authoring/HTML/BrowserBugs/
- http//developer.netscape.com80/support/bugs/know
n/javascript.html - http//developer.netscape.com80/support/bugs/know
n/css.html - http//support.microsoft.com/support/kb/articles/q
222/0/64.asp - http//www.w3.org
- http//www.webreference.com/dhtml/diner/resize/
- http//www.webreference.com/html/tutorial4/
- http//www.webreference.com/html/watch/ie5/
54Building Around Browser Bugs
55Mac Bug IE Div
56IE Div Bug Bad HTML
table
October 5,
1999
Left Hand Column
Left Hand Column Left Hand Column Left Hand
Column Left Hand Column Left Hand Column Left
Hand Column Left Hand Column Left Hand Column
Right Hand Column
Right
Hand Column
Right Hand Column
Right Hand
Column
Right Hand Column
Right Hand
Column
57Mac Bug IE Div
58IE Div Bug Good HTML
courier"October 5, 1999
clearall Left
Hand Column Left Hand Column Left Hand Column
Left Hand Column Left Hand Column Left Hand
Column Left Hand Column Left Hand Column Left
Hand Column
Right Hand Column
Right Hand
Column
Right Hand Column
Right Hand
Column
Right Hand Column
Right Hand
Column
59IE Div Bug Squashed!
60Mac Bug NS Java VM
61NS Java VM Bug (
- Netscape has confirmed that the JVM shipped with
the Macintosh version of NS 4 is not fully Java
Compliant. - No plans to fix in a v4 release
- Waiting on v5(6?)/Gecko
- Solutions?
- Determine Need for Java Applet
- Determine Need for Mac/NS Audience
- Rigorous Testing