-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report bad prop in declaration w/ vendor/hack flag
This change causes errors to be reported for bad property names even in cases where the declaration containing the property has an expression with values that have been flagged as vendor extensions or CSS hacks. Without this change, if an expression is flagged as containing a value that is a vendor extension or CSS hack but the declaration it’s in has an invalid property name (e.g., `background-image` misspelled as `backround-image` but with a value of `-webkit-image-set(...)`), no error is emitted for the invalid property name. This change works by 1) removing from the createProperty method in the CssPropertyFactory code the warning-report handling for declarations that have vendor extensions and CSS hacks, 2) moving that handling into the parser code, where it now checks what method threw an InvalidParamException if one is thrown when parsing a declaration, and 3) reporting an error if the method that threw InvalidParamException in a vendor-extension/CSS-hack case is the createProperty method (which means it was thrown for a bad property name) rather than other code that throws it (which indicates that it’s a vendor-extension/CSS-hack *value* rather than a bad property name). (Incidentally, a potential alternative way of dealing with this problem would be to not throw an InvalidParamException for bad property names in the createProperty method to begin with, but to instead throw some different (new?) exception that could be caught and handled separately.) Note that this change also adds handling to emit a specific warning or error in the case where a function name is a vendor extension (that is, the function name starts with `-`) — because after the rest of this change is made to the code, no error or warning would otherwise be reported in that case.
- Loading branch information
1 parent
d4f15aa
commit f8c809a
Showing
3 changed files
with
148 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters