Bug 115270 - LibreOffice Impress export *.SVG = fail. Usage of "javascript:window" in a TEXT Link results in fundamentally flawed behavior in the web browser.
Summary: LibreOffice Impress export *.SVG = fail. Usage of "javascript:window" in a TE...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:svg, regression
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2018-01-28 05:02 UTC by UbunLibOffImp
Modified: 2022-12-17 03:19 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (11.42 KB, application/vnd.oasis.opendocument.presentation)
2018-03-01 14:59 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description UbunLibOffImp 2018-01-28 05:02:50 UTC
Description:
Environment = Ubuntu 16.04 & Firefox 58 & LibreOffice Impress Version: 5.3.7.2

In LibreOffice Impress 5.1.X.X a hyperlink (' Link ') could be assigned to text, the slide could be exported to *.SVG and the hyperlink would function properly.
Using the same code on text in Impress 5.3.7.2 and exporting the slide to *.SVG results in illogical window behavior in the web browser.
Using the same code on an image (imported *.svg file) in Impress 5.3.7.2 and exporting the slide to *.SVG results in correct window behavior in the web browser.

Here is the Link contents:

javascript:window.alert("https://google.com/");window.open("https://google.com/");window.history.go(document.baseURI);

Notice that the code above has three window objects.

The *.SVG file created by Impress instructs the web browser to open three new windows if this javascript is assigned to *TEXT*.
The *.SVG file created by Impress instructs the web browser to open one window if this javascript is assigned to an *IMAGE*.

Note that this javascript is being used since Impress cannot export a *.odp to *.svg that has relative links.
See BUG # 115236.

Here is sample HTML code that demonstrates correct behavior.
Create a *.html file and open this file in a web browser.
After clicking the button an alert box will open up on the page, followed by a new window opening up @google.com, then the first window will reset to initial state.

<!DOCTYPE html>
<html>
<body>
<p>Click the button to open a new browser window.</p>
<button onclick="myFunction()">Try it</button>
<script>
function myFunction() {window.alert("https://google.com/");window.open("https://google.com/");window.history.go(document.baseURI);}
</script>
</body>
</html> 

Impress used to be able to create a *.SVG file that could do exactly what the HTML code listed above can do.

Steps to Reproduce:
1. Create a new *.odp
2. Type some text
3. Select some amount of text that has been typed
4. Create hyperlink out of selected text
5. Insert > Link... > Web > javascript:(use code from above)
6. Insert an image into the document to compare behavior
7. Insert > Image > pick any image
8. Select Image
9. Insert > Link... > Web > javascript:(use code from above)
10. File > Save
11. File > Export >*.svg
12. Open *.svg in a web browser and observe the incorrect behavior of the text link

Actual Results:  
Using text for a hyperlink does not result in the same behavior as when an image is used for a hyperlink. The link protocol must be javascript: since the file:// protocol fails for all situations when Impress tries to export a *.SVG.

Expected Results:
It is expected that Impress can export a *.SVG file with relative links.
Impress cannot do this.

It is expected that Impress can export a *.SVG file with javascript assigned to text.
Impress cannot do this.



Reproducible: Always


User Profile Reset: No



Additional Info:
There are *many* problems with *.SVG export from Impress. A thorough review of this functionality is needed. LibreOffice should not refer to the 5.3.7.2 release as suitable for "an enterprise or corporate environment or a conservative user".




User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0
Comment 1 Buovjaga 2018-03-01 14:59:06 UTC
Created attachment 140252 [details]
Example file

I confirm it worked in 5.0.2.2, but not in 6.1.

Version: 6.1.0.0.alpha0+ (x64)
Build ID: e1082e45361a92a31adedcc3ed0a35c704bca543
CPU threads: 4; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-02-15_23:24:06
Locale: fi-FI (fi_FI); Calc: group
Comment 2 Buovjaga 2018-03-01 15:07:30 UTC
How it works in 5.0:
1. click the link
2. alert pops up in the current tab
3. click the OK button
4. Google opens in a new tab

How it works in 6.1:
1. click the link
2. a new tab opens and alert pops up
3. click the OK button
4. nothing happens
5. Go to the original tab, notice an alert is in there as well
6. click the OK button
7. Google opens in a new tab
Comment 3 Buovjaga 2018-03-01 15:08:58 UTC
(In reply to Buovjaga from comment #2)
> 7. Google opens in a new tab

Addendum: if you allow pop ups from the SVG, Google will open in *two* new tabs at this point.
Comment 4 Buovjaga 2018-03-01 17:53:21 UTC
Bisected and it comes from https://cgit.freedesktop.org/libreoffice/core/commit/?id=154521777f8c551f10ffbe414891df9d2a529ae3

Adding Marco C.
Comment 5 Xisco Faulí 2018-06-05 19:45:40 UTC
Adding Cc: to Marco Cecchetti
Comment 6 QA Administrators 2020-12-16 03:57:15 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2022-12-17 03:19:23 UTC
Dear UbunLibOffImp,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug