@@ -28,7 +28,7 @@ typedef OnMathError = Widget Function(
2828 String exception,
2929 String exceptionWithType,
3030);
31- typedef OnCSSParseError = String ? Function (
31+ typedef OnCssParseError = String ? Function (
3232 String css,
3333 List <cssparser.Message > errors,
3434);
@@ -42,7 +42,7 @@ class HtmlParser extends StatelessWidget {
4242 final dom.Document htmlData;
4343 final OnTap ? onLinkTap;
4444 final OnTap ? onImageTap;
45- final OnCSSParseError ? onCSSParseError ;
45+ final OnCssParseError ? onCssParseError ;
4646 final ImageErrorListener ? onImageError;
4747 final OnMathError ? onMathError;
4848 final bool shrinkWrap;
@@ -59,7 +59,7 @@ class HtmlParser extends StatelessWidget {
5959 required this .htmlData,
6060 required this .onLinkTap,
6161 required this .onImageTap,
62- required this .onCSSParseError ,
62+ required this .onCssParseError ,
6363 required this .onImageError,
6464 required this .onMathError,
6565 required this .shrinkWrap,
@@ -72,18 +72,18 @@ class HtmlParser extends StatelessWidget {
7272
7373 @override
7474 Widget build (BuildContext context) {
75- Map <String , Map <String , List <css.Expression >>> declarations = _getExternalCSSDeclarations (htmlData.getElementsByTagName ("style" ), onCSSParseError );
75+ Map <String , Map <String , List <css.Expression >>> declarations = _getExternalCssDeclarations (htmlData.getElementsByTagName ("style" ), onCssParseError );
7676 StyledElement lexedTree = lexDomTree (
7777 htmlData,
7878 customRender.keys.toList (),
7979 tagsList,
8080 navigationDelegateForIframe,
8181 );
82- StyledElement ? externalCSSStyledTree ;
82+ StyledElement ? externalCssStyledTree ;
8383 if (declarations.isNotEmpty) {
84- externalCSSStyledTree = _applyExternalCSS (declarations, lexedTree);
84+ externalCssStyledTree = _applyExternalCss (declarations, lexedTree);
8585 }
86- StyledElement inlineStyledTree = _applyInlineStyles (externalCSSStyledTree ?? lexedTree, onCSSParseError );
86+ StyledElement inlineStyledTree = _applyInlineStyles (externalCssStyledTree ?? lexedTree, onCssParseError );
8787 StyledElement customStyledTree = _applyCustomStyles (style, inlineStyledTree);
8888 StyledElement cascadedStyledTree = _cascadeStyles (style, customStyledTree);
8989 StyledElement cleanedTree = cleanTree (cascadedStyledTree);
@@ -119,8 +119,8 @@ class HtmlParser extends StatelessWidget {
119119 return htmlparser.parse (data);
120120 }
121121
122- /// [parseCSS ] converts a string of CSS to a CSS stylesheet using the dart `csslib` library.
123- static css.StyleSheet parseCSS (String data) {
122+ /// [parseCss ] converts a string of CSS to a CSS stylesheet using the dart `csslib` library.
123+ static css.StyleSheet parseCss (String data) {
124124 return cssparser.parse (data);
125125 }
126126
@@ -200,34 +200,34 @@ class HtmlParser extends StatelessWidget {
200200 }
201201 }
202202
203- static Map <String , Map <String , List <css.Expression >>> _getExternalCSSDeclarations (List <dom.Element > styles, OnCSSParseError ? errorHandler) {
204- String fullCSS = "" ;
203+ static Map <String , Map <String , List <css.Expression >>> _getExternalCssDeclarations (List <dom.Element > styles, OnCssParseError ? errorHandler) {
204+ String fullCss = "" ;
205205 for (final e in styles) {
206- fullCSS = fullCSS + e.innerHtml;
206+ fullCss = fullCss + e.innerHtml;
207207 }
208- if (fullCSS .isNotEmpty) {
209- final declarations = parseExternalCSS (fullCSS , errorHandler);
208+ if (fullCss .isNotEmpty) {
209+ final declarations = parseExternalCss (fullCss , errorHandler);
210210 return declarations;
211211 } else {
212212 return {};
213213 }
214214 }
215215
216- static StyledElement _applyExternalCSS (Map <String , Map <String , List <css.Expression >>> declarations, StyledElement tree) {
216+ static StyledElement _applyExternalCss (Map <String , Map <String , List <css.Expression >>> declarations, StyledElement tree) {
217217 declarations.forEach ((key, style) {
218218 if (tree.matchesSelector (key)) {
219219 tree.style = tree.style.merge (declarationsToStyle (style));
220220 }
221221 });
222222
223- tree.children.forEach ((e) => _applyExternalCSS (declarations, e));
223+ tree.children.forEach ((e) => _applyExternalCss (declarations, e));
224224
225225 return tree;
226226 }
227227
228- static StyledElement _applyInlineStyles (StyledElement tree, OnCSSParseError ? errorHandler) {
228+ static StyledElement _applyInlineStyles (StyledElement tree, OnCssParseError ? errorHandler) {
229229 if (tree.attributes.containsKey ("style" )) {
230- final newStyle = inlineCSSToStyle (tree.attributes['style' ], errorHandler);
230+ final newStyle = inlineCssToStyle (tree.attributes['style' ], errorHandler);
231231 if (newStyle != null ) {
232232 tree.style = tree.style.merge (newStyle);
233233 }
0 commit comments