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 262855 - Print to HTML generates invalid font size due to no 'px' suffix
Summary: Print to HTML generates invalid font size due to no 'px' suffix
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-18 14:39 UTC by SiddheshRane
Modified: 2016-07-18 15:46 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Opera 38 inspector shows font size as invalid (84.30 KB, image/png)
2016-07-18 14:41 UTC, SiddheshRane
Details
font size fixed after adding px suffix (74.30 KB, image/png)
2016-07-18 14:42 UTC, SiddheshRane
Details
What the file looks like in the editor, for reference (37.11 KB, image/png)
2016-07-18 14:43 UTC, SiddheshRane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SiddheshRane 2016-07-18 14:39:05 UTC

    
Comment 1 SiddheshRane 2016-07-18 14:41:20 UTC
Created attachment 160428 [details]
Opera 38 inspector shows font size as invalid
Comment 2 SiddheshRane 2016-07-18 14:42:25 UTC
Created attachment 160429 [details]
font size fixed after adding px suffix
Comment 3 SiddheshRane 2016-07-18 14:43:31 UTC
Created attachment 160430 [details]
What the file looks like in the editor, for reference
Comment 4 SiddheshRane 2016-07-18 15:46:48 UTC
When the Print To HTML action generates styles for non default font sizes, it skips the px suffix that is required by modern browsers. Without the suffix the font size gets ignored by the browser. This has been tested on Opera 38 as well as Firefox 46; Chrome should be similar as Opera is based on it.

The fix lies in the file editor/src/org/netbeans/modules/editor/HtmlPrintContainer.java
(http://hg.netbeans.org/main/file/186d1d9ef175/editor/src/org/netbeans/modules/editor/HtmlPrintContainer.java) on line 355. It will take me some time to generate a patch.