Bug 200472

Summary: Javadoc preview panel renders text in font size 1
Product: platform Reporter: Jiri Kovalsky <jkovalsky>
Component: Window SystemAssignee: Stanislav Aubrecht <saubrecht>
Status: VERIFIED FIXED QA Contact: issues <issues.netbeans.org>
Priority: P2 CC: anebuzelsky, jbecicka, m1k0, mmirilovic, musilt2, pjiricka
Version: 7.0   
Target Milestone: 7.0.1   
Hardware: PC   
OS: Linux   
Whiteboard: 701patch2-verified
Issue Type: DEFECT Exception Report:
Attachments: Screenshot of unreadable Javadoc in NetBeans 7.0.1.
Screenshot of readable Javadoc in NetBeans 7.0.

Description Jiri Kovalsky 2011-07-28 13:03:34 UTC
Created attachment 109673 [details]
Screenshot of unreadable Javadoc in NetBeans 7.0.1.

Product Version: NetBeans IDE 7.0.1 (Build 201107211357)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Linux version 2.6.35-22-generic running on amd64; UTF-8; cs_CZ (nb)
Userdir: /home/cesilko/.netbeans/7.0

Description:
============
Preview panel in Javadoc window displays its content in a tiny font impossible to read - see attached screenshot for NetBeans 7.0.1. Please note that the same thing works fine in NetBeans 7.0. Besides, it seems like NetBeans 7.0 provides more search results for "String" text. I don't know if it relates to this bug or not.

Steps to reproduce:
===================
1. Install NetBeans 7.0.1 RC build #201107211357 using installer.
2. Invoke "Help > Javadoc Index Search" from main menu.
3. Type "String" into the search textfield and press Enter.
4. Make sure that "Toggle the display of the HTML Viewer" buttons is pressed.
5. Select first "String" entry and after a while the javadoc will be displayed in the panel below but you won't be able to read it.
Comment 1 Jiri Kovalsky 2011-07-28 13:04:03 UTC
Created attachment 109674 [details]
Screenshot of readable Javadoc in NetBeans 7.0.
Comment 2 Jiri Prox 2011-07-28 13:15:00 UTC
Reproducible also on 

Product Version: NetBeans IDE 7.0.1 (Build 201107211357)
Java: 1.7.0; Java HotSpot(TM) 64-Bit Server VM 21.0-b17
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Userdir: C:\Users\jprox\.netbeans\7.0
Comment 3 Jan Becicka 2011-07-28 13:33:47 UTC
The problem is not 7.0 vs 7.0.1 but JDK 6 javadoc vs JDK 7 javadoc.
It looks like they changed style sheets or something recently. It worked few weeks ago.
Comment 4 Jan Becicka 2011-07-29 09:09:10 UTC
Javadoc module uses o.o.awt.HtmlBrowser to render web pages. Please evaluate.
Comment 5 Stanislav Aubrecht 2011-08-01 10:45:46 UTC
works fine on ms windows

Product Version: NetBeans IDE Dev (Build 20110718-3dab36469148)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Windows 7 version 6.1 running on x86; Cp1250; en_US (nb)
Comment 6 Jan Becicka 2011-08-01 10:51:07 UTC
Reported on Linux. I can reproduce it on Mac. Jiri Prox reproduced it on Windows 7...
Did you try it with javadoc from http://download.oracle.com/javase/7/docs/api/
?
Comment 7 Stanislav Aubrecht 2011-08-01 10:54:18 UTC
(In reply to comment #6)
> Reported on Linux. I can reproduce it on Mac. Jiri Prox reproduced it on
> Windows 7...
> Did you try it with javadoc from http://download.oracle.com/javase/7/docs/api/
> ?

i see. i used local zip archive with javadoc
i'll try again with online docs
Comment 8 Stanislav Aubrecht 2011-08-01 11:59:53 UTC
the new JavaDoc uses CSS heavily and the plain Swing JEditorPane doesn't render it correctly. the internal javadoc viewer in NetBeans is also based on JEditorPane.
Comment 9 Marian Mirilovic 2011-08-18 09:39:43 UTC
Stando, do you think you will be able to fix it for 7.0.1 Patch1 ?
Comment 10 Stanislav Aubrecht 2011-08-18 09:44:13 UTC
i think i'm not able to fix this bug at all
Comment 11 Marian Mirilovic 2011-08-18 09:49:08 UTC
(In reply to comment #10)
> i think i'm not able to fix this bug at all

what about workarounds ?
Comment 12 Stanislav Aubrecht 2011-08-18 10:21:22 UTC
we could ask the oracle docs team to fix the CSS for us
or we could check the url or javadoc being displayed and apply some xslt transformations or hack the CSS...
Comment 13 Petr Jiricka 2011-08-23 11:50:13 UTC
Should we also file a bug against JEditorPane so we have some evaluation from the JDK team?
Comment 14 Petr Jiricka 2011-08-23 12:02:12 UTC
Steps to reproduce on Mac where JDK 7 is not available yet:
M1: Go to Tools -> Java Platforms and switch to the Javadoc tab for the default registered platform
M2: Remote the JDK 6 URL
M3: Using Add URL..., add http://download.oracle.com/javase/7/docs/api/ and close the dialog
M4: Follow steps 2-5 from the original description
Comment 15 Marian Mirilovic 2011-08-23 12:41:13 UTC
*** Bug 201242 has been marked as a duplicate of this bug. ***
Comment 16 Stanislav Aubrecht 2011-08-24 13:27:34 UTC
i tried switching all styles off in firefox and the javadoc rendered in acceptable way. so we could either force some sort of empty StyleSheet object to be used in the SwingBrowser or we could parse the javadoc HTML and strip all CSS-related formatting off. 
i briefly experimented with the former option but with no luck so far.
Comment 17 Tomas Danek 2011-08-25 11:40:06 UTC
we won't make it to patch1 -> reverting to more generic sw "701patch-candidate"
Comment 18 Antonin Nebuzelsky 2011-09-07 11:22:12 UTC
Stando, prepare the fix that we discussed ASAP. Thanks.
Comment 19 Stanislav Aubrecht 2011-09-07 12:47:51 UTC
core-main d7b3299fa246

the problem is in "body { font-size:76%; }" in javadoc's stylesheet. the fix overrides that css rule so the HTML is now readable. (it doesn't look very nice though).
the fix is safe and doesn't break other HTML code. it applies also to locally downloaded javadoc ZIP bundles.
Comment 20 Quality Engineering 2011-09-08 14:27:11 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/d7b3299fa246
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #200472 - hack to make JDK 1.7 javadoc readable
Comment 21 Tomas Danek 2011-09-14 08:32:14 UTC
does not look nice, but is readable. Verified in 20100912
Comment 22 Marian Mirilovic 2011-09-14 08:34:10 UTC
Thanks Tomasi ... Standa, could you please proceed with integration into release701_fixes branch ?
Comment 23 Stanislav Aubrecht 2011-09-14 12:14:25 UTC
transplanted to release701_fixes branch as 22c4066b1b87
Comment 24 Quality Engineering 2011-09-14 18:29:56 UTC
Integrated into 'releases'
Changeset: http://hg.netbeans.org/releases/rev/22c4066b1b87
User: S. Aubrecht <saubrecht@netbeans.org>
Log: #200472 - hack to make JDK 1.7 javadoc readable
(transplanted from d7b3299fa24683f502356d4e02b8e5d644f1cdf9)
Comment 25 Tomas Danek 2011-09-15 13:38:08 UTC
verified in patch2
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo