Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
41 changes: 0 additions & 41 deletions openpdf-html/src/main/java/org/openpdf/css/parser/CSSParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public PropertyValue parsePropertyValue(CSSName cssName, Origin origin, String e
// [ namespace [S|CDO|CDC]* ]*
// [ [ ruleset | media | page | font_face ] [S|CDO|CDC]* ]*
private void stylesheet(Stylesheet stylesheet) throws IOException {
//System.out.println("stylesheet()");
Token t = la();
try {
if (t == Token.TK_CHARSET_SYM) {
Expand Down Expand Up @@ -248,7 +247,6 @@ private void stylesheet(Stylesheet stylesheet) throws IOException {
// [STRING|URI] S* [ medium [ COMMA S* medium]* ]? ';' S*
// ;
private void import_rule(Stylesheet stylesheet) throws IOException {
//System.out.println("import()");
try {
Token t = next();
if (t == Token.TK_IMPORT_SYM) {
Expand Down Expand Up @@ -276,7 +274,6 @@ private void import_rule(Stylesheet stylesheet) throws IOException {
URI parent = new URI(stylesheet.getURI());
String tokenValue = getTokenValue(t);
String resolvedUri = parent.resolve(tokenValue).toString();
System.out.println("Token: " + tokenValue + " resolved " + resolvedUri);
uri = resolvedUri;
} catch (URISyntaxException use) {
throw new CSSParseException("Invalid URL, " + use.getMessage(), getCurrentLine(), use);
Expand Down Expand Up @@ -386,7 +383,6 @@ private void namespace() throws IOException {
// : MEDIA_SYM S* medium [ COMMA S* medium ]* LBRACE S* ruleset* '}' S*
// ;
private void media(Stylesheet stylesheet) throws IOException {
//System.out.println("media()");
Token t = next();
try {
if (t == Token.TK_MEDIA_SYM) {
Expand Down Expand Up @@ -448,7 +444,6 @@ private void media(Stylesheet stylesheet) throws IOException {
// : IDENT S*
// ;
private String medium() throws IOException {
//System.out.println("medium()");
Token t = next();
if (t == Token.TK_IDENT) {
String result = getTokenValue(t);
Expand All @@ -465,7 +460,6 @@ private String medium() throws IOException {
// '{' S* declaration [ ';' S* declaration ]* '}' S*
// ;
private void font_face(Stylesheet stylesheet) throws IOException {
// System.out.println(font_face()");
Token t = next();
try {
FontFaceRule fontFaceRule = new FontFaceRule(stylesheet.getOrigin());
Expand Down Expand Up @@ -515,7 +509,6 @@ private void font_face(Stylesheet stylesheet) throws IOException {
// '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S*
//
private void page(Stylesheet stylesheet) throws IOException {
//System.out.println("page()");
Token t = next();
try {
if (t == Token.TK_PAGE_SYM) {
Expand Down Expand Up @@ -619,7 +612,6 @@ private Map<MarginBoxName, List<PropertyDeclaration>> margin(Stylesheet styleshe
// : ':' IDENT
// ;
private String pseudo_page() throws IOException {
//System.out.println("pseudo_page()");
Token t = next();
if (t == Token.TK_COLON) {
t = next();
Expand All @@ -642,7 +634,6 @@ private String pseudo_page() throws IOException {
// : '/' S* | COMMA S* | /* empty */
// ;
private void operator() throws IOException {
//System.out.println("operator()");
Token t = la();
switch (t.getType()) {
case VIRGULE:
Expand All @@ -659,7 +650,6 @@ private void operator() throws IOException {
// | S
// ;
private Token combinator() throws IOException {
//System.out.println("combinator()");
Token t = next();
if (t == Token.TK_PLUS || t == Token.TK_GREATER) {
skip_whitespace();
Expand All @@ -677,7 +667,6 @@ private Token combinator() throws IOException {
// : '-' | PLUS
// ;
private int unary_operator() throws IOException {
//System.out.println("unary_operator()");
Token t = next();
if (! (t == Token.TK_MINUS || t == Token.TK_PLUS)) {
push(t);
Expand All @@ -695,7 +684,6 @@ private int unary_operator() throws IOException {
// : IDENT S*
// ;
private String property() throws IOException {
//System.out.println("property()");
Token t = next();
String result;
if (t == Token.TK_IDENT) {
Expand All @@ -714,7 +702,6 @@ private String property() throws IOException {
// : [ declaration ';' S* ]*
private void declaration_list(
Ruleset ruleset, boolean expectEOF, boolean expectAtRule, boolean inFontFace) throws IOException {
//System.out.println("declaration_list()");
Token t;
LOOP:
while (true) {
Expand Down Expand Up @@ -751,7 +738,6 @@ private void declaration_list(
// LBRACE S* [ declaration ';' S* ]* '}' S*
// ;
private void ruleset(RulesetContainer container) throws IOException {
//System.out.println("ruleset()");
try {
Ruleset ruleset = new Ruleset(container.getOrigin());

Expand Down Expand Up @@ -797,7 +783,6 @@ private void ruleset(RulesetContainer container) throws IOException {
// : simple_selector [ combinator simple_selector ]*
// ;
private void selector(Ruleset ruleset) throws IOException {
//System.out.println("selector()");
List<Selector> selectors = new ArrayList<>();
List<Token> combinators = new ArrayList<>();
selectors.add(simple_selector(ruleset));
Expand Down Expand Up @@ -891,7 +876,6 @@ private Selector mergeSimpleSelectors(List<Selector> selectors, List<Token> comb
// | [ HASH | class | attrib | pseudo ]+
// ;
private Selector simple_selector(Ruleset ruleset) throws IOException {
//System.out.println("simple_selector()");
Selector selector = new Selector();
selector.setParent(ruleset);
Token t = la();
Expand Down Expand Up @@ -1020,7 +1004,6 @@ private NamespacePair typed_value(boolean matchAttribute) throws IOException {
// : '.' IDENT
// ;
private void class_selector(Selector selector) throws IOException {
//System.out.println("class_selector()");
Token t = next();
if (t == Token.TK_PERIOD) {
t = next();
Expand All @@ -1036,23 +1019,6 @@ private void class_selector(Selector selector) throws IOException {
}
}

// element_name
// : IDENT | '*'
// ;
/*
private String element_name() throws IOException {
//System.out.println("element_name()");
Token t = next();
if (t == Token.TK_IDENT || t == Token.TK_ASTERISK) {
return getTokenValue(t, true);
} else {
push(t);
throw new CSSParseException(
t, new Token[] { Token.TK_IDENT, Token.TK_ASTERISK }, getCurrentLine());
}
}
*/

// attrib
// : '[' S* [ namespace_prefix ]? IDENT S*
// [ [ PREFIXMATCH |
Expand All @@ -1064,7 +1030,6 @@ private String element_name() throws IOException {
// ]? ']'
// ;
private void attrib(Selector selector) throws IOException {
//System.out.println("attrib()");
Token t = next();
if (t == Token.TK_LBRACKET) {
skip_whitespace();
Expand Down Expand Up @@ -1216,7 +1181,6 @@ private void addPseudoElement(Token t, Selector selector) {
// : ':' ':'? [ IDENT | FUNCTION S* IDENT? S* ')' ]
// ;
private void pseudo(Selector selector) throws IOException {
//System.out.println("pseudo()");
Token t = next();
if (t == Token.TK_COLON) {
t = next();
Expand Down Expand Up @@ -1272,7 +1236,6 @@ private boolean checkCSSName(@Nullable CSSName cssName, String propertyName) {
// : property ':' S* expr prio?
// ;
private void declaration(Ruleset ruleset, boolean inFontFace) throws IOException {
//System.out.println("declaration()");
try {
Token t = la();
if (t == Token.TK_IDENT) {
Expand Down Expand Up @@ -1346,7 +1309,6 @@ private void prio() throws IOException {
// : term [ operator term ]*
// ;
private List<PropertyValue> expr(boolean literal) throws IOException {
//System.out.println("expr()");
List<PropertyValue> result = new ArrayList<>(10);
result.add(term(literal, null));
LOOP: while (true) {
Expand Down Expand Up @@ -1444,7 +1406,6 @@ private String sign(float sign) {
// | STRING S* | IDENT S* | URI S* | hexcolor | function
// ;
private PropertyValue term(boolean literal, @Nullable Token operatorToken) throws IOException {
//System.out.println("term()");
float sign = 1;
Token t = la();
if (t == Token.TK_PLUS || t == Token.TK_MINUS) {
Expand Down Expand Up @@ -1606,7 +1567,6 @@ private PropertyValue term(boolean literal, @Nullable Token operatorToken) throw
// : FUNCTION S* expr ')' S*
// ;
private PropertyValue function(Token operatorToken) throws IOException {
//System.out.println("function()");
final PropertyValue result;
Token t = next();
if (t == Token.TK_FUNCTION) {
Expand Down Expand Up @@ -1737,7 +1697,6 @@ private short validateType(int index, PropertyValue value) {
// : HASH S*
// ;
private PropertyValue hexcolor(Token operatorToken) throws IOException {
//System.out.println("hexcolor()");
final PropertyValue result;
Token t = next();
if (t == Token.TK_HASH) {
Expand Down
10 changes: 0 additions & 10 deletions openpdf-html/src/main/java/org/openpdf/swing/BasicPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ protected BasicPanel(UserAgentCallback uac) {
super(new SharedContext(uac));
mouseTracker = new MouseTracker(this);
formSubmissionListener = query -> {
System.out.println("Form Submitted!");
System.out.println("Data: " + query);

JOptionPane.showMessageDialog(
null,
Expand Down Expand Up @@ -304,14 +302,6 @@ public void setLayout(LayoutManager l) {
public void setSize(Dimension d) {
XRLog.layout(Level.FINEST, "set size called");
super.setSize(d);
/* CLEAN: do we need this?
if (doc != null && body_box != null) {
if(body_box.width != d.width)
RenderQueue.getInstance().dispatchLayoutEvent(new ReflowEvent(ReflowEvent.CANVAS_RESIZED, d));
//don't need the below, surely
//else if(body_box.height != d.height)
// RenderQueue.getInstance().dispatchRepaintEvent(new ReflowEvent(ReflowEvent.CANVAS_RESIZED, d));
} */
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.google.errorprone.annotations.CheckReturnValue;
import org.jspecify.annotations.Nullable;
import org.slf4j.LoggerFactory;
import org.openpdf.DefaultCSSMarker;

import java.io.BufferedInputStream;
import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@



package org.openpdf;
package org.openpdf.util;



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ public void cssParsingPerformance() throws IOException {
CSSParser p = new CSSParser(errorHandler);
Stylesheet stylesheet = p.parseStylesheet(null, USER_AGENT, new StringReader(longTest));
long end = System.currentTimeMillis();
// System.out.println("Took " + (end-start) + " ms");
total += (end-start);

assertThat(stylesheet.getContents()).hasSize(count);
}
System.out.println("Average " + (total/10) + " ms");

total = 0;
for (int i = 0; i < 10; i++) {
Expand All @@ -64,7 +62,7 @@ public void cssParsingPerformance() throws IOException {
total += (end-start);
assertThat(stylesheet.getContents()).hasSize(count);
}
System.out.println("Average " + (total/10) + " ms");


CSSParser p = new CSSParser(errorHandler);

Expand All @@ -81,7 +79,6 @@ public void cssParsingPerformance() throws IOException {
// System.out.println("Took " + (end-start) + " ms");
total += (end-start);
}
System.out.println("Average " + (total/10) + " ms");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public void run() {
this.statusLock.wait(5000);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt(); // ← Preserve the interrupt status
PDFDebugger.debug("Thread interrupted while waiting for status change.");
}

}
Expand Down Expand Up @@ -248,7 +247,6 @@ public void waitForFinish() {
this.statusLock.wait(5000);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt(); // ← Preserve the interrupt status
PDFDebugger.debug("Thread interrupted while waiting for status change.");
}

}
Expand Down
84 changes: 0 additions & 84 deletions openpdf-renderer/src/main/java/org/openpdf/renderer/HexDump.java

This file was deleted.

Loading
Loading