Bug 149449 - CSS class redefinition gets ignored inside SVGs
Summary: CSS class redefinition gets ignored inside SVGs
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0 target:7.4.0.0.beta2 tar...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-04 11:35 UTC by Paris Oplopoios
Modified: 2022-07-12 11:52 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
test case (858 bytes, image/svg+xml)
2022-06-04 11:36 UTC, Paris Oplopoios
Details
comparison, LO left, Chrome right (12.88 KB, image/png)
2022-06-04 11:36 UTC, Paris Oplopoios
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paris Oplopoios 2022-06-04 11:35:15 UTC
Description:
There's some CSS inside the attached svg that looks like this:

.cls-2,
.cls-3 {
    fill: #fff;
}

.cls-2 {
    opacity: 0.3;
}

The expected behavior is that .cls-2 has both fill: #fff and opacity: 0.3 attributes. Instead it only gets the first attribute. If you move the opacity line to the block you will notice that this is not a problem with opacity but with the second definition of the class getting ignored.

Steps to Reproduce:
1. Open attached SVG

Actual Results:
Bottom left circle is opaque white

Expected Results:
Bottom left circle is transparent white, causing a lighter blue color as demonstrated in the comparison


Reproducible: Always


User Profile Reset: Yes



Additional Info:
-
Comment 1 Paris Oplopoios 2022-06-04 11:36:09 UTC
Created attachment 180563 [details]
test case
Comment 2 Paris Oplopoios 2022-06-04 11:36:55 UTC
Created attachment 180564 [details]
comparison, LO left, Chrome right
Comment 3 Paris Oplopoios 2022-06-19 21:00:24 UTC
I have fixed this bug here:

https://gerrit.libreoffice.org/c/core/+/136109

would be great if anyone can review it. The test case looks as expected now.
Comment 4 Commit Notification 2022-06-22 12:14:58 UTC
offtkp committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/99f8e8aa0ccb741c2b5ede6cab75798c1793d899

tdf#149449 Don't ignore CSS class redefinition inside SVGs

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 5 Commit Notification 2022-06-22 12:16:07 UTC
offtkp committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/eedc5b1c576fcaaea85a5278762efc8ba8c5a084

tdf#149449 Add unit test for CSS class redefinition inside SVGs

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2022-06-23 09:12:04 UTC
offtkp committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/34e08a82a317e06d2526f5a16a522323c3902bd7

tdf#149449 Don't ignore CSS class redefinition inside SVGs

It will be available in 7.4.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2022-06-23 21:08:41 UTC
offtkp committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/d931e8876cbaf8e409ebbba97d991d0099124de4

tdf#149449 Add unit test for CSS class redefinition inside SVGs

It will be available in 7.4.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2022-07-12 11:52:30 UTC
offtkp committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/c9f71c923f82cf430c3b67ee7af8ff9c681e7c0b

tdf#149449 Don't ignore CSS class redefinition inside SVGs

It will be available in 7.3.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.