This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236961 - Black screen in Embedded WebKit Browser in the simple HelloWorld app
Summary: Black screen in Embedded WebKit Browser in the simple HelloWorld app
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Inspection (show other bugs)
Version: 7.4
Hardware: PC Linux
: P1 normal with 6 votes (vote)
Assignee: Jan Stola
URL:
Keywords:
: 243134 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-09 18:44 UTC by sealexer
Modified: 2015-05-28 08:34 UTC (History)
9 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (63.10 KB, text/plain)
2013-10-09 18:44 UTC, sealexer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sealexer 2013-10-09 18:44:48 UTC
Steps to reproduce:
1. New Project - Java Web - Web Application
2. Specify bundled tomcat instance
3. After creation: Project properties - Run - Display Browser on Run - Select Embedded WebKit Browser
4. Just run the app

Result: black screen in the area purposed for the page


Product Version = NetBeans IDE 7.4 RC2 (Build 201309252201)
Operating System = Linux version 3.4.47-2.38-desktop running on amd64
Java; VM; Vendor = 1.7.0_40
Runtime = Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Comment 1 sealexer 2013-10-09 18:44:56 UTC
Created attachment 140960 [details]
IDE log
Comment 2 Stanislav Aubrecht 2013-10-14 14:24:06 UTC
Cannot reproduce in 

Product Version: NetBeans IDE Dev (Build 20131009-59920d5335a3)
Java: 1.7.0_40; Java HotSpot(TM) 64-Bit Server VM 24.0-b56
Runtime: Java(TM) SE Runtime Environment 1.7.0_40-b43
System: Linux version 3.8.0-29-generic running on amd64; UTF-8; en_US (nb)


Reporter, what flavor or Linux are you running?
Comment 3 sealexer 2013-10-14 21:00:18 UTC
OpenSuse 12.2 with KDE
Comment 4 chunkyks 2013-10-16 23:25:41 UTC
I'm observing the same thing, in the new version of netbeans [7.4 release]:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_17; Java HotSpot(TM) 64-Bit Server VM 23.7-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_17-b02
System: Linux version 3.5.0-41-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/gbriggs/.netbeans/7.4
Cache directory: /home/gbriggs/.cache/netbeans/7.4

gbriggs@gbriggs-desktop:~/Downloads$ lsb_release -a
LSB Version:	core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID:	Ubuntu
Description:	Ubuntu 12.10
Release:	12.10
Codename:	quantal
gbriggs@gbriggs-desktop:~/Downloads$ 


I'm using LXDE as my desktop environment.
Comment 5 patkoscsaba 2013-10-20 11:38:58 UTC
Same problem here with a simple PHP project. The content appears for a fraction of a second, then the browser tab turns black. See the video below:

https://dl.dropboxusercontent.com/u/18447347/netbeans_black_preview.mkv

Operating system: Sabayon Linux 64 bits, running KDE 4.11
Linux Kernel: 3.11.0
Netbeans: 7.4 final.
Oracle JDK: 1.7.0_25
Comment 6 Stanislav Aubrecht 2013-10-29 13:49:12 UTC
JavaFX supports only Ubuntu 10.2 or better.
Comment 7 Stanislav Aubrecht 2013-10-29 13:49:49 UTC
(In reply to chunkyks from comment #4)

> I'm using LXDE as my desktop environment.

Reporter, does it make any difference when you switch your desktop environment?
Comment 8 patkoscsaba 2013-10-29 14:24:38 UTC
@Stanislav

>JavaFX supports only Ubuntu 10.2 or better.

Does this mean/imply that __ONLY__ Ubuntu users can use NetBeans' built-in browser?
Comment 9 patkoscsaba 2013-11-09 09:30:38 UTC
Updated to latest JDK. Still the same problem. There is some additional information in this other bug report. It seems to be NVidia graphics related: https://netbeans.org/bugzilla/show_bug.cgi?id=237691

System details:

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.11.0-sabayon running on amd64; UTF-8; en_US (nb)
User directory: /home/csaba/.netbeans/7.4
Cache directory: /home/csaba/.cache/netbeans/7.4
Comment 10 sealexer 2013-11-11 10:56:56 UTC
Yes, my graphics adapter is NVidia too.

# sudo lspci -v -s 02:00.0
02:00.0 VGA compatible controller: NVIDIA Corporation G96 [GeForce 9500 GT] (rev a1) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device 82f1
        Flags: bus master, fast devsel, latency 0, IRQ 24
        Memory at fa000000 (32-bit, non-prefetchable) [size=16M]
        Memory at d0000000 (64-bit, prefetchable) [size=256M]
        Memory at f8000000 (64-bit, non-prefetchable) [size=32M]
        I/O ports at ac00 [size=128]
        [virtual] Expansion ROM at fbb80000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [b4] Vendor Specific Information: Len=14 <?>
        Capabilities: [100] Virtual Channel
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Kernel driver in use: nvidia

(Using drivers downloaded from nvidia.com/drivers: NVIDIA-Linux-x86_64-319.60.run)
Comment 11 rmuller 2013-11-21 13:17:07 UTC
Same here, the content appears for a fraction of a second, then the browser tab turns black.

Ubuntu 12.04 LTS x64
Oracle Java 7u45
Netbeans 7.4
NVIDIA Corporation MCP78S [GeForce 8200]
02:00.0 VGA compatible controller: NVIDIA Corporation GT218 [GeForce G210] (rev a2) (prog-if 00 [VGA controller])
        Subsystem: Pegatron Device 9045
        Flags: bus master, fast devsel, latency 0, IRQ 19
        Memory at fd000000 (32-bit, non-prefetchable) [size=16M]
        Memory at e0000000 (64-bit, prefetchable) [size=256M]
        Memory at de000000 (64-bit, prefetchable) [size=32M]
        I/O ports at ec00 [size=128]
        [virtual] Expansion ROM at feb80000 [disabled] [size=512K]
        Capabilities: [60] Power Management version 3
        Capabilities: [68] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Express Endpoint, MSI 00
        Capabilities: [b4] Vendor Specific Information: Len=14 <?>
        Capabilities: [100] Virtual Channel
        Capabilities: [128] Power Budgeting <?>
        Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
        Kernel driver in use: nvidia
        Kernel modules: nvidia_304, nouveau, nvidiafb
Comment 12 websafe 2013-12-19 16:35:38 UTC
I'm on Linux with Nvidia too, but I think this is not Nvidia related. The problem is caused by the canvas added at the end of the previewed html.

Currently I'm using a quick workaround, I' just added this code:

~~~~ html
<script>
    $(document).ready(function(){
        function hideNetbeansGlassPane() {
            $('#netbeans_glasspane').remove();
        }
        setTimeout(hideNetbeansGlassPane, 500);
    });
</script>
~~~~

at the end of HTML generated by the app I'm working on. It's basically about hiding `<canvas id="netbeans_glasspane" ...` which is added at the end of generated HTML (You can see this right click on browser -> dump document).
Canvas needs to be destroyed/hidden after a small delay. Directly on `.ready` without a delay will not work as expected.

http://devlog.websafe.pl/2013/12/19/black-screen-netbeans-embedded-webkit-browser-workaround/
Comment 13 Vladimir Riha 2014-02-05 09:14:23 UTC
Reproduced on Mac with Nvidia graphic card as well and it is caused by the canvas added to enable web inspection

Product Version: NetBeans IDE Dev (Build 201402050001)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b128
System: Mac OS X version 10.8.5 running on x86_64; UTF-8; en_US (nb)
Comment 14 Vladimir Riha 2014-03-21 20:12:51 UTC
*** Bug 243134 has been marked as a duplicate of this bug. ***
Comment 15 Vladimir Riha 2014-03-21 20:13:22 UTC
reporter from issue 243134 has  ATI HD Radeon 5500 graphic card
Comment 16 MentatGilbertus 2014-03-30 15:32:02 UTC
(In reply to websafe from comment #12)

Thanks for workaround. You can compress it to:

$(document).ready(function() {
  setTimeout(function() { $('#netbeans_glasspane').remove(); }, 500);
});

Also clean javascript version:

setTimeout(function() {
  e = document.getElementById('netbeans_glasspane');
  e.parentNode.removeChild(e);
}, 500);

Anyone know how to permanently disable canvas inclusion?
Comment 17 Vladimir Riha 2014-08-15 10:47:12 UTC
Sadly I can now reproduce it as well but only with JDK8u20 (see below). To reproduce, simply run HTML5 project in embedded browser and hover over some node in Browser DOM window => window goes black. Again, canvas element from Web inspection seems to cause this

I don't have any dedicated graphic card, but some integrated Intel GC. The same works fine with JDK8u11

Ubuntu 14.04 32b
Product Version: NetBeans IDE 8.0.1 (Build 201408142300)
Java: 1.8.0_20; Java HotSpot(TM) Client VM 25.20-b23
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-b31
System: Linux version 3.13.0-32-generic running on i386; UTF-8; en_US (nb)
Comment 18 Jiri Kovalsky 2014-08-15 11:18:47 UTC
Reproducible. I saw "TODO write content" for a while but then came the ominous darkness...

Product Version: NetBeans IDE 8.0.1 (Build 201408142300)
Java: 1.8.0_20-ea; Java HotSpot(TM) 64-Bit Server VM 25.20-b16
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-ea-b16
System: Linux version 3.13.0-24-generic running on amd64; UTF-8; en_US (nb)
Comment 19 sunshineo 2014-10-11 09:06:11 UTC
The workaround totally kills the inspection function. We need a proper fix.
Comment 20 tremel 2014-10-27 08:43:45 UTC
Reproducable on Linux Mint 17, codename "Qiana" with Cinnamon Desktop and Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4350/4550].
Comment 21 vernons 2014-11-28 01:45:24 UTC
Same problem running OS X Yosemite 10.10
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Comment 22 Jaroslav Tulach 2015-02-20 19:17:36 UTC
While it is known that the problem started only in newer versions of JDK, it is clearly related to NetBeans inspection functionality. I don't think it makes sense to treat it as JDK bug.

Cannot we more the bug to web.webkit.debugging or web.inspect for evaluation? The chances are higher that Jan Štola & friends will find a fix sooner than a member of JavaFX team turns computer on.
Comment 23 sorinn 2015-02-23 17:28:55 UTC
Finally this feature "embedded html preview" promoted on Netbeans website should stay out from "Netbeans Features" at least until this big time bug is fixed.

BTW - probably firefox should be used as the main web engine under the hood - Firebug is better than chrome inspector - beside that webkit is used / customised by every vendor in a very different way - there is a wrong perception that webkit is the same plaftorm just because the name - webkit under safari is complete another beast than Chrome webkit.

On my test Firefox is way superior to Chrome in memory management .. I can open 80 tabs without killing the machine - but 20 tabs in Chrome will kill a 32bit quadcore with 4GB RAM even with Linux.
Comment 24 Jan Stola 2015-02-26 12:19:36 UTC
It seems to be a bug in JavaFX or in some native library (or its usage by JavaFX). I was struggling to reproduce this issue. I was not able to reproduce it on Windows. I was not able to reproduce it on Ubuntu 12.10 in VirtualBox. I was not able to reproduce it on some Suse Linux. Eventually, I was able to reproduce it on Ubuntu 14.04 LTS (not in VirtualBox).

The bug appeared when the canvas (that we use in page inspection) was redrawn. Unfortunately, not every repaint of the canvas causes this problem. The repaints caused by scrolling seemed to be more vulnerable.

I have experimented with the repainting code and the situation got much better (if not fixed completely) when clearRect() method of canvas' context is not used.

Happily, the content of the canvas can be cleared using context.width = width; trick as well. This approach is slower than clearRect() but can serve as a workaround when Embedded WebKit Browser is used.

Of course, I have no idea how well this workaround will work on other machines, but it worked very well on the only machine where I saw the problem.

Modified files: https://hg.netbeans.org/web-main/rev/e6a673ec0e04
Comment 25 Jaroslav Tulach 2015-02-26 14:39:31 UTC
I can confirm that your fix helps to address "black screen problem" on my Kubuntu 14.04 and

$ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

as well as 

$ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

On both JDKs I can reproduce the "black screen problem" with NetBeans 8.0 quite easily. With your fix everything seems to work. I knew you would be able to do it!
Comment 26 nbantonio 2015-02-26 17:01:35 UTC
I'm still experiencing the bug in Kubuntu 14.10.

    netbeans-trunk-nightly-201502260001-linux

    java version "1.8.0_25"
    Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

    Linux antoniok 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

I reproduce the bug easily by scrolling, or by loading content with sliders,like: 

http://demos.gabfirethemes.com/advanced/
Comment 27 Jan Stola 2015-02-26 17:22:03 UTC
(In reply to nbantonio from comment #26)
> I'm still experiencing the bug in Kubuntu 14.10.
> 
>     netbeans-trunk-nightly-201502260001-linux

Note that I have made the change today (in our team repository). It is not in nightly builds yet. It will get there in few days. Jaroslav Tulach was able to test the change because he built NetBeans from the source code.
Comment 28 nbantonio 2015-02-26 17:28:10 UTC
How can I be aware of the next downloadable build including the fix?
Comment 29 Jiri Kovalsky 2015-02-26 17:32:06 UTC
You will be notified by a Bugzilla e-mail in a day or two. Just monitor your Inbox. And thanks for your upcoming verification!
Comment 30 Jan Stola 2015-02-27 08:27:38 UTC
@nbantonio The fix (resp. an attempt for a workaround) is available in the latest nightly build: http://bits.netbeans.org/download/trunk/nightly/2015-02-27_00-01-28/
Comment 31 nbantonio 2015-02-27 09:35:35 UTC
Thanks.

Yes, now it works perfectly here. 

Congratulations.
Comment 32 Jaroslav Tulach 2015-05-05 09:33:59 UTC
I think this bug should be a candidate for backport to some 8.0.x patch release. What do you think, Marian?
Comment 33 Marian Mirilovic 2015-05-06 07:20:26 UTC
(In reply to Jaroslav Tulach from comment #32)
> I think this bug should be a candidate for backport to some 8.0.x patch
> release. What do you think, Marian?

No objections, just we do not plan any patch in next few months.
Comment 34 Jan Stola 2015-05-18 15:38:37 UTC
Integrated into release801 branch:
https://hg.netbeans.org/releases/rev/95356e73be9a
https://hg.netbeans.org/releases/rev/3191f426f585
Comment 35 Vladimir Riha 2015-05-18 15:50:34 UTC
Thanks Honzo
Comment 36 Jaroslav Tulach 2015-05-20 05:23:50 UTC
> No objections, just we do not plan any patch in next few months.

If it can get out at the same time as fix for bug 245732, then that will be perfect.
Comment 37 Vladimir Riha 2015-05-28 08:34:14 UTC
Verified in patch

Product Version: NetBeans IDE 8.0.2 (Build 201411181905)
Updates: NetBeans IDE is updated to version NetBeans 8.0.2 Patch 2
Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25
Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25
System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)