From 3f902efe54b985b88622296c93523b0fa7c78dff Mon Sep 17 00:00:00 2001 From: Josh Soref <2119212+jsoref@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:06:20 -0400 Subject: [PATCH] spelling: specificity Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --- .../flash/importers/svg/SvgImporter.java | 4 +- .../flash/importers/svg/css/CssParser.java | 48 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgImporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgImporter.java index 667805e4f..6593aa90a 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgImporter.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/SvgImporter.java @@ -471,11 +471,11 @@ public class SvgImporter { NamedNodeMap attrs = node.getAttributes(); Node styleAttr = attrs.getNamedItem("ffdec-style"); if (styleAttr != null) { - styleAttr.setNodeValue(styleAttr.getNodeValue() + ";" + "{" + cssParser.getSpecifity(i) + "}" + cssParser.getDeclarations(i)); + styleAttr.setNodeValue(styleAttr.getNodeValue() + ";" + "{" + cssParser.getSpecificity(i) + "}" + cssParser.getDeclarations(i)); attrs.setNamedItem(styleAttr); } else { Node styleNode = doc.createAttribute("ffdec-style"); - styleNode.setNodeValue("{" + cssParser.getSpecifity(i) + "}" + cssParser.getDeclarations(i)); + styleNode.setNodeValue("{" + cssParser.getSpecificity(i) + "}" + cssParser.getDeclarations(i)); attrs.setNamedItem(styleNode); } } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/css/CssParser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/css/CssParser.java index cc0ce7bd1..d3b5635fb 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/css/CssParser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/importers/svg/css/CssParser.java @@ -107,14 +107,14 @@ public class CssParser { private boolean ruleset() throws IOException, CssParseException { int posSelectorStart = lexer.getPos(); - int specifity = selector(); - if (specifity == -1) { + int specificity = selector(); + if (specificity == -1) { return false; } CssParsedSymbol symb = lex(); while (symb.isType(",")) { sstar(); - specifity += selector(); + specificity += selector(); symb = lex(); } expect(symb, "{"); @@ -122,7 +122,7 @@ public class CssParser { int posSelectorEnd = lexer.getPos() - 1; String selectorStr = s.substring(posSelectorStart, posSelectorEnd).trim(); selectors.add(selectorStr); - specificities.add(specifity); + specificities.add(specificity); int declarationsStart = lexer.getPos(); Reference propName = new Reference<>(""); @@ -164,8 +164,8 @@ public class CssParser { } private int selector() throws IOException, CssParseException { - int specifity = simple_selector(); - if (specifity == -1) { + int specificity = simple_selector(); + if (specificity == -1) { return -1; } @@ -176,44 +176,44 @@ public class CssParser { } if (symb.isType("+", ">")) { sstar(); - specifity += selector(); + specificity += selector(); } else { lexer.pushback(symb); if (symb.isType("*", ".", "[", ":") || symb.isType(CssSymbolType.IDENT, CssSymbolType.HASH)) { - specifity += selector(); + specificity += selector(); } } } else if (symb.isType("+", ">")) { sstar(); - specifity += selector(); + specificity += selector(); } else { lexer.pushback(symb); } - return specifity; + return specificity; } private int simple_selector() throws IOException, CssParseException { CssParsedSymbol symb = lex(); - int specifity = 0; + int specificity = 0; if (symb.isType(CssSymbolType.IDENT) || symb.isType("*")) { if (symb.isType(CssSymbolType.IDENT)) { - specifity += 1; + specificity += 1; } while (true) { symb = lex(); if (symb.type == CssSymbolType.HASH) { - specifity += 100; + specificity += 100; } else if (symb.isType(".")) { expect(CssSymbolType.IDENT); - specifity += 10; + specificity += 10; } else if (symb.isType("[")) { lexer.pushback(symb); attrib(); - specifity += 10; + specificity += 10; } else if (symb.isType(":")) { lexer.pushback(symb); pseudo(); - specifity += 10; + specificity += 10; } else { lexer.pushback(symb); break; @@ -223,21 +223,21 @@ public class CssParser { int count = 0; while (true) { if (symb.type == CssSymbolType.HASH) { - specifity += 100; + specificity += 100; count++; } else if (symb.isType(".")) { expect(CssSymbolType.IDENT); - specifity += 10; + specificity += 10; count++; } else if (symb.isType("[")) { lexer.pushback(symb); attrib(); - specifity += 10; + specificity += 10; count++; } else if (symb.isType(":")) { lexer.pushback(symb); pseudo(); - specifity += 10; + specificity += 10; count++; } else { if (count == 0) { @@ -250,7 +250,7 @@ public class CssParser { } lexer.pushback(symb); } - return specifity; + return specificity; } private void pseudo() throws IOException, CssParseException { @@ -524,11 +524,11 @@ public class CssParser { } /** - * Gets specifity of ruleset. + * Gets specificity of ruleset. * @param index Index of ruleset - * @return Specifity + * @return Specificity */ - public int getSpecifity(int index) { + public int getSpecificity(int index) { return specificities.get(index); } }