Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
0d31406
Revert "no need to care about inherit in css3 anymore"
ylafon Sep 6, 2021
0329205
more casting issues fixed
ylafon Sep 6, 2021
0ea7224
revert defaults, how can this be fixed properly...
ylafon Sep 6, 2021
4c5ecd4
add way to access the stylesheet from the main context
ylafon Sep 6, 2021
e1dacb0
fix size when expression is not set
ylafon Sep 6, 2021
2772a7e
redo variable resolution, moved to a more global place for all variab…
ylafon Sep 6, 2021
abee1f9
added relevant check functions to delegate value check, proper fix of…
ylafon Sep 6, 2021
8bd4837
more casting issues
ylafon Sep 6, 2021
7e6e994
casting issue + use proper value instead of ident (might use getRawTy…
ylafon Sep 6, 2021
d969b44
cast issue+ updated ref
ylafon Sep 6, 2021
809ab35
cast issue (continuing...) + updated per https://www.w3.org/TR/2020/W…
ylafon Sep 6, 2021
939efde
cast issue (cont.) + ref
ylafon Sep 6, 2021
f088576
casting issue + use proper value instead of ident (might use getRawTy…
ylafon Sep 6, 2021
77b2e24
check based on resolved value
ylafon Sep 6, 2021
d32e2c5
casting issue (cont)
ylafon Sep 6, 2021
31c357f
updated to https://www.w3.org/TR/2020/WD-css-overflow-3-20200603/#pro…
ylafon Sep 6, 2021
2e2cc50
casting issue (cont)
ylafon Sep 6, 2021
f415054
casting issue (cont)
ylafon Sep 6, 2021
e9ac19a
internalize idents at parsing time
ylafon Sep 6, 2021
6c30f3f
regen
ylafon Sep 6, 2021
c89caf4
casting issue (cont)
ylafon Sep 6, 2021
37305d0
casting issue (cont)
ylafon Sep 6, 2021
1eacc41
updated per https://www.w3.org/TR/2021/WD-css-ruby-1-20210310/#propde…
ylafon Sep 6, 2021
0cf06af
cast+ref
ylafon Sep 6, 2021
165b843
updated per https://www.w3.org/TR/2021/WD-css-ruby-1-20210310/#propde…
ylafon Sep 6, 2021
9057e1f
rewrote entirely ruby-overhang per https://www.w3.org/TR/2021/WD-css-…
ylafon Sep 7, 2021
7f6f00e
cast+ref
ylafon Sep 7, 2021
4b9dfb7
don't forget the value
ylafon Sep 7, 2021
f42b36b
cast+ref
ylafon Sep 7, 2021
c0cee83
cast+ref (on deprecated classes)
ylafon Sep 7, 2021
0693abf
cast+ref
ylafon Sep 7, 2021
1ebfe9c
fix equality when 2nd val is null
ylafon Sep 7, 2021
fa5b752
redid content per https://www.w3.org/TR/2019/WD-css-content-3-2019080…
ylafon Sep 7, 2021
f9d8c09
cast+ref
ylafon Sep 8, 2021
153f369
refs+cast + added 'text' value as obsolete from webcompat spec
ylafon Sep 8, 2021
5a65845
typo in test
ylafon Sep 8, 2021
b06bfa3
getting ident without testing type first is not right
ylafon Sep 8, 2021
018565f
same as b06bfa3a17ddd49946026a314ccdc6d5106d5868
ylafon Sep 8, 2021
905f675
cast (cont)
ylafon Sep 8, 2021
3be827a
use original value
ylafon Sep 8, 2021
a5f7863
cast (cont)
ylafon Sep 8, 2021
3f837bf
cast+mark as deprecated (should be removed at some point)
ylafon Sep 8, 2021
49ef87d
redone font src parsing per https://www.w3.org/TR/2021/WD-css-fonts-4…
ylafon Sep 8, 2021
2c06677
refs+cast (cont)
ylafon Sep 8, 2021
f686ded
handle both css3 and svg based on the profile used, as the css3 versi…
ylafon Sep 8, 2021
665eff8
cast (cont) on deprecated property
ylafon Sep 8, 2021
30b3c3d
cast (cont) + small updates
ylafon Sep 8, 2021
a9a0aaf
ref+cast and mark deprecated
ylafon Sep 8, 2021
dff56ac
ref+cast (cont)
ylafon Sep 8, 2021
7b5a795
updated refs + cast issue (cont)
ylafon Sep 8, 2021
3b182a8
print-color-adjust per https://www.w3.org/TR/2021/WD-css-color-adjust…
ylafon Sep 8, 2021
a736b1a
updated + cast (cont)
ylafon Sep 8, 2021
24ae446
updated per https://www.w3.org/TR/2021/WD-css-color-adjust-1-20210616…
ylafon Sep 8, 2021
499c27a
cast (cont)
ylafon Sep 8, 2021
64a6db6
cast (cont)
ylafon Sep 9, 2021
7908e4c
cast + refs (cont)
ylafon Sep 9, 2021
e63f951
refs+cast (cont)
ylafon Sep 9, 2021
c7eee2f
cast (cont)
ylafon Sep 9, 2021
e1250b6
cast (cont) + marked as deprecated
ylafon Sep 9, 2021
7c590b0
inline-sizing per https://www.w3.org/TR/2020/WD-css-inline-3-20200827…
ylafon Sep 9, 2021
a3e71f3
baseline-source per https://www.w3.org/TR/2020/WD-css-inline-3-202008…
ylafon Sep 9, 2021
f8dcfc7
cast+refs (cont.)
ylafon Sep 9, 2021
c87ee82
cast+refs (cont.)
ylafon Sep 9, 2021
25254da
mark as deprecated
ylafon Sep 9, 2021
f1143be
cast+refs (cont.) + a few updates
ylafon Sep 9, 2021
ecaa943
cast+ref (cont.)
ylafon Sep 9, 2021
f427cbe
cast+ref (cont.)
ylafon Sep 9, 2021
4458367
mark as deprecated
ylafon Sep 9, 2021
39aef5d
cast (cont.)
ylafon Sep 9, 2021
79d2c06
cast (cont.)
ylafon Sep 9, 2021
17f8130
refs+cast (cont.)
ylafon Sep 9, 2021
84c59cb
refs+cast (cont.)
ylafon Sep 9, 2021
dd4fb2e
column now use row to parse, updated ref+cast
ylafon Sep 10, 2021
3023126
aligned all refs
ylafon Sep 10, 2021
f646100
refs+cast (cont.)
ylafon Sep 10, 2021
9ffdf7e
removed overloaded value
ylafon Sep 10, 2021
bbed863
cast+refs (cont.)
ylafon Sep 10, 2021
7931fe1
color accessor
ylafon Sep 10, 2021
d6feb0a
cast+refs (cont.)
ylafon Sep 10, 2021
8247284
Updated all font properties to https://www.w3.org/TR/2021/WD-css-font…
ylafon Sep 12, 2021
10f25a1
remove redundant check
ylafon Sep 12, 2021
f44bf1d
fix remaining CssIdent casts
ylafon Sep 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add way to access the stylesheet from the main context
  • Loading branch information
ylafon committed Sep 6, 2021
commit 4c5ecd4a7cbf3c0a5e0c38a04fd76aaf92db815c
6 changes: 3 additions & 3 deletions org/w3c/css/css/DocumentParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public DocumentParser(ApplContext ac, Reader reader, String urlString, MimeType
mediatype = MimeType.TEXT_CSS;
}
if (mediatype.match(MimeType.TEXT_CSS) == MimeType.MATCH_SPECIFIC_SUBTYPE) {
StyleSheetParser csshandler = new StyleSheetParser();
StyleSheetParser csshandler = new StyleSheetParser(ac);
csshandler.parseStyleSheet(ac, reader, htmlURL);
style = csshandler.getStyleSheet();
} else if (mediatype.match(MimeType.TEXT_HTML) == MimeType.MATCH_SPECIFIC_SUBTYPE) {
Expand Down Expand Up @@ -88,7 +88,7 @@ public DocumentParser(ApplContext ac, String urlString) throws Exception {

if (!"http".equals(urlProtocol) && !"https".equals(urlProtocol)) {
if (urlLower.endsWith(".css")) {
StyleSheetParser parser = new StyleSheetParser();
StyleSheetParser parser = new StyleSheetParser(ac);
parser.parseURL(ac, htmlURL, null, null, media, StyleSheetOrigin.AUTHOR);
style = parser.getStyleSheet();
} else if (urlLower.endsWith(".html") || urlLower.endsWith(".htm") ||
Expand Down Expand Up @@ -157,7 +157,7 @@ public DocumentParser(ApplContext ac, String urlString) throws Exception {
style.setType("text/html");
}
} else if (contentType.match(MimeType.TEXT_CSS) == MimeType.MATCH_SPECIFIC_SUBTYPE) {
StyleSheetParser parser = new StyleSheetParser();
StyleSheetParser parser = new StyleSheetParser(ac);
parser.parseURL(ac, htmlURL, null, null, media, StyleSheetOrigin.AUTHOR);
style = parser.getStyleSheet();
} else if ((contentType.match(MimeType.TEXT_XML) == MimeType.MATCH_SPECIFIC_SUBTYPE)
Expand Down
3 changes: 2 additions & 1 deletion org/w3c/css/css/HTMLParserStyleSheetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class HTMLParserStyleSheetHandler implements ContentHandler, LexicalHandl
boolean isHTML5;

// StyleSheet styleSheet = new StyleSheet();
StyleSheetParser styleSheetParser = new StyleSheetParser();
StyleSheetParser styleSheetParser = null;

boolean inStyle = false;
String media = null;
Expand All @@ -88,6 +88,7 @@ public HTMLParserStyleSheetHandler(URL baseURI, ApplContext ac) {
this.documentURI = baseURI;
this.baseURI = baseURI;
this.ac = ac;
this.styleSheetParser = new StyleSheetParser(ac);
}

public void setDocumentLocator(Locator locator) {
Expand Down
4 changes: 4 additions & 0 deletions org/w3c/css/css/StyleSheetParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ public final class StyleSheetParser
CssFouffa cssFouffa;
StyleSheet style = new StyleSheet();

public StyleSheetParser(ApplContext ac) {
ac.setStyleSheet(getStyleSheet());
}

public void reInit() {
style = new StyleSheet();
}
Expand Down
4 changes: 2 additions & 2 deletions org/w3c/css/css/TagSoupStyleSheetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ public class TagSoupStyleSheetHandler implements ContentHandler, LexicalHandler,
URL documentURI = null;
URL baseURI = null;

// StyleSheet styleSheet = new StyleSheet();
StyleSheetParser styleSheetParser = new StyleSheetParser();
StyleSheetParser styleSheetParser = null;

boolean inStyle = false;
String media = null;
Expand All @@ -85,6 +84,7 @@ public TagSoupStyleSheetHandler(URL baseURI, ApplContext ac) {
this.documentURI = baseURI;
this.baseURI = baseURI;
this.ac = ac;
this.styleSheetParser = new StyleSheetParser(ac);
}

public void setDocumentLocator(Locator locator) {
Expand Down
3 changes: 2 additions & 1 deletion org/w3c/css/css/XMLStyleSheetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class XMLStyleSheetHandler implements ContentHandler, LexicalHandler,
URL baseURI = null;

// StyleSheet styleSheet = new StyleSheet();
StyleSheetParser styleSheetParser = new StyleSheetParser();
StyleSheetParser styleSheetParser = null;

boolean inStyle = false;

Expand All @@ -90,6 +90,7 @@ public XMLStyleSheetHandler(URL baseURI, ApplContext ac) {
this.documentURI = baseURI;
this.baseURI = baseURI;
this.ac = ac;
this.styleSheetParser = new StyleSheetParser(ac);
}

public void setDocumentLocator(Locator locator) {
Expand Down
4 changes: 2 additions & 2 deletions org/w3c/css/servlet/CssValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ public void doGet(HttpServletRequest req, HttpServletResponse res)

if ("css".equals(type) || ("none".equals(type) && isCSS(text))) {
// if CSS:
parser = new StyleSheetParser();
parser = new StyleSheetParser(ac);
parser.parseStyleElement(ac, is, null, usermedium,
new URL(fileName), 0);

Expand Down Expand Up @@ -716,7 +716,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
ac.setFakeURL(fileName);
if (isCSS) {
//if CSS:
parser = new StyleSheetParser();
parser = new StyleSheetParser(ac);
parser.parseStyleElement(ac, is, null, ac.getMedium(),
new URL(fileName), 0);

Expand Down
10 changes: 10 additions & 0 deletions org/w3c/css/util/ApplContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.w3c.css.util;


import org.w3c.css.css.StyleSheet;
import org.w3c.css.parser.Frame;
import org.w3c.www.http.HttpAcceptCharset;
import org.w3c.www.http.HttpAcceptCharsetList;
Expand Down Expand Up @@ -75,6 +76,7 @@ private BomEncoding() {
String lang;
Messages msgs;
Frame frame;
StyleSheet styleSheet = null;
CssVersion version = CssVersion.getDefault();
CssProfile profile = CssProfile.NONE;
String input;
Expand Down Expand Up @@ -149,6 +151,14 @@ public Frame getFrame() {
return frame;
}

public void setStyleSheet(StyleSheet styleSheet) {
this.styleSheet = styleSheet;
}

public StyleSheet getStyleSheet() {
return styleSheet;
}

public Class getCssSelectorsStyle() {
return cssselectorstyle;
}
Expand Down