Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036683
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajorhave not tried2017-08-22 09:022017-09-21 16:49
ReporteradrianromeroView Statuspublic 
Assigned Tocaristu 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q4
StatusclosedFix in branchFixed in SCM revision73827432edb3
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesUser Interface Client Kernel
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036683: CSS minifier breaks @font-face directives

DescriptionAdding CSS (stylesheet) resource files that contains @font-face directives in a module using BaseComponentProvider breaks the generated minified stylesheet.

The minifier manages incorrectly quotations. For example translates this:

@font-face {
  font-family: 'Roboto-Condensed-Bold';
  src: url('./../font/Roboto-Condensed/Roboto-Condensed-Bold.woff') format('woff');
}

Into this:

@font-face{font-family: 'Roboto-Condensed-Bold';src: url(./../font/Roboto-Condensed/Roboto-Condensed-Bold.woff') format('woff);}

Observe that it has been removed the first quote in url(... and the last quote in format(...

This problems seems to be located near:

https://code.openbravo.com/erp/devel/pi/file/c272160f0246/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java#l201 [^]
Steps To ReproduceFor example in the org.openbravo.retail.posterminal component provider OBPOSComponentProvider add a new css file that includes a @font-face directive like

@font-face {
  font-family: 'Roboto-Condensed-Bold';
  src: url('./../font/Roboto-Condensed/Roboto-Condensed-Bold.woff') format('woff');
}

Set the module in non development mode to activate the css minifier and load POS

Observe that in the css generated the quotes has been wrongly managed
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0025574 closeddbaz Openbravo ERP Upgrade SmartClient 10.0d 
has duplicate feature request 0036014 newjorge-garcia Retail Modules Include source maps for our javascript files 
related to defect 0036708 closeddbaz Openbravo ERP CSSMinimizer does not work well with "transform-origin" property 

-  Notes
(0098587)
hgbot (developer)
2017-08-23 09:49

Repository: erp/devel/pi
Changeset: 573badaa70f519eab4de9ea2787985ca16fb544e
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Aug 23 09:42:26 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/573badaa70f519eab4de9ea2787985ca16fb544e [^]

fixes issue 36683: CSS minifier breaks @font-face directives

CSSMinimizer have problems dealing with selectors like url('data:image/....'). The url content need to be surrounded with double quotes in order to minimize it properly. For this reason a regular expression is used in order to replace the single quotes of the url definition with double quotes.

The problem here was that if additional single quotes appeared after the url definition, like for example:

  src: url('./../font/Roboto-Condensed/Roboto-Condensed-Bold.woff') format('woff');

the replacement was not being done properly.

To fix the problem the regular expression has been changed in order to look for the closing quote of the url content. Thus, we ensure that we are replacing just the single quotes of the url value.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java
---
(0098647)
caristu (developer)
2017-08-25 10:01
edited on: 2017-08-25 10:07

The original problem of the CSSMinimizer dealing with selectors like url('data:image/....') is solved in the latest version of the CSSMin library[1].

That change also fixes this issue.

After discussing it with dbaz we are agree to apply the same fix on our library and let the library fix the problem instead of pre-processing anything.

[1] https://github.com/barryvan/CSSMin/commit/fc2f1305d9624cc71725522be3b61c0a84b18d95 [^]

(0098648)
hgbot (developer)
2017-08-25 10:07

Repository: erp/devel/pi
Changeset: 73827432edb31f02b641f50b7c7be02901733106
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Aug 25 10:06:32 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/73827432edb31f02b641f50b7c7be02901733106 [^]

fixes issue 36683: CSS minifier breaks @font-face directives

 Apply the CSSMin library[1] original solution to handle url expressions properly on the CSSMinimizer java class. This way the pre-processing to replace the single quotes with double quotes done before passing the CSS content to the minimizer is no longer needed

[1] https://github.com/barryvan/CSSMin/commit/fc2f1305d9624cc71725522be3b61c0a84b18d95 [^]

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/CSSMinimizer.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/StyleSheetResourceComponent.java
---
(0098681)
alostale (developer)
2017-08-29 08:55

reviewed

tested:

-reported case
-css in core is not affected by this changes, so minified css does not differ from previous version
(0099319)
hudsonbot (developer)
2017-09-21 16:49

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test
(0099329)
hudsonbot (developer)
2017-09-21 16:49

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9750b78d3e5c [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-08-22 09:02 adrianromero New Issue
2017-08-22 09:02 adrianromero Assigned To => platform
2017-08-22 09:02 adrianromero Modules => Core
2017-08-22 09:02 adrianromero Triggers an Emergency Pack => No
2017-08-22 09:02 adrianromero Modules Core => User Interface Client Kernel
2017-08-23 08:47 caristu Assigned To platform => caristu
2017-08-23 08:47 caristu Relationship added related to 0025574
2017-08-23 09:49 hgbot Checkin
2017-08-23 09:49 hgbot Note Added: 0098587
2017-08-23 09:49 hgbot Status new => resolved
2017-08-23 09:49 hgbot Resolution open => fixed
2017-08-23 09:49 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/573badaa70f519eab4de9ea2787985ca16fb544e [^]
2017-08-23 09:49 caristu Review Assigned To => alostale
2017-08-24 08:31 caristu Relationship added related to 0036708
2017-08-25 10:01 caristu Note Added: 0098647
2017-08-25 10:07 hgbot Checkin
2017-08-25 10:07 hgbot Note Added: 0098648
2017-08-25 10:07 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/573badaa70f519eab4de9ea2787985ca16fb544e [^] => http://code.openbravo.com/erp/devel/pi/rev/73827432edb31f02b641f50b7c7be02901733106 [^]
2017-08-25 10:07 caristu Note Edited: 0098647 View Revisions
2017-08-28 09:56 alostale Relationship added has duplicate 0036014
2017-08-29 08:55 alostale Note Added: 0098681
2017-08-29 08:55 alostale Status resolved => closed
2017-08-29 08:55 alostale Fixed in Version => 3.0PR17Q4
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099319
2017-09-21 16:49 hudsonbot Checkin
2017-09-21 16:49 hudsonbot Note Added: 0099329


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker