Comments (7)
You are confusing escaping on the input stream and escaping in URLs - this is done based on different syntaxes.
The URL escaping is defined at https://www.w3.org/TR/css-syntax-3/#consume-url-token and it is okay.
The escaping of \xxxxxx is done directly in the jjtree file.
from ph-css.
I can't fully follow you 😞 Currently browser can handle such escaped values in the url()
function by unescaping them according to the unescpae diagram. And i belive that's the "shortcoming" right now of the unescapeURL method. Not sure, if it'd make sense to have the "new" unescape logic extracted into a general unescape
method to be able to use it for other CSS values to be unescaped.
Although this issue really references the current improper unescaping of the URL value.
So to me it seems your current approach in your alternate-fix-91
branch is fine.
from ph-css.
Well, there are 2 layers of unescaping when reading CSS. There is one top-level unescaping that can be used everywhere.
https://www.w3.org/TR/css-syntax-3/#input-preprocessing is used for all bytes on all areas. It's like a "filter InputStream". That should be handled on a different level of reading the CSS.
Additionally there is a special escaping for URLs - as defined by https://www.w3.org/TR/css-syntax-3/#consume-url-token and implemented in unescapeURL
.
I will create some more tests to see what the exact status of the implementation is
from ph-css.
Ahh i see. However, for unescapeURL
if a REVERSE SOLIDUS () is detected it is required to unescape the code point according to https://www.w3.org/TR/css-syntax-3/#consume-url-token. And this unescaping has to based on https://drafts.csswg.org/css-syntax/#escape-diagram (https://www.w3.org/TR/css-syntax-3/#consume-an-escaped-code-point). Therefore i'd say your implementation, in alternate-fix-91
for unescapeURL
is correct. But i agree my assumption this mehod could be used for other CSS values, during the parsing/processing is probably wrong.
from ph-css.
I am trying a totally different approach. I am doing the unescaping at the point where the stream is read (in class CSSCharStream
). This however interferes with a lot of existing tests (and IE hacks like \0
or \9
), which further complicates the process. So I am on it, but give me some time.
from ph-css.
Sure, no worries. Meanwhile we've a quick-fix hack on our side to fix this \2f
escape issue. But thanks alot for the update. Looking forward to new release then 😄
from ph-css.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from ph-css.
Related Issues (20)
- Unexpected rule '@': Unknown rule in the middle of a rule-set is not allowed! HOT 4
- Previous sibling selectors incorrectly parsed without whitespace HOT 12
- Unable to add declarations where property contains "--" or "@" HOT 3
- Strange exception when creating own shorthand descriptors HOT 2
- :lang with empty expression list parsed incorrectly HOT 3
- :host and ::slotted pseudo class/element functions are parsed incorrectly (used in shadow DOM) HOT 2
- Semantic distinction between an IDENT and a STRING within the CSSExpressionMemberTermSimple HOT 6
- :host and ::slotted parsing sort of wrong HOT 6
- CSSReaderDeclarationList missing methods to pass in CReaderSettings as argument HOT 1
- Scientific number notation not supported by parser HOT 4
- Add :host-context pseudo class function to the Parser HOT 3
- Scientific notation can also contain '.' HOT 7
- *IDENT (<=IE6 hack) in style declaration block, drops all declarations after this one (in browser compliant mode) HOT 7
- Class selector not supported inside :where HOT 5
- :nth-child(expr) is parsed as CSSSelectorSimpleMember HOT 1
- Support `@supports` HOT 1
- Support for CSS nesting module HOT 3
- Can't parse Bulma 1.0
- parse css extension
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ph-css.