Skip to content

Commit

Permalink
#344@trivial: Continues on CSSStyleDeclaration.
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed Aug 31, 2022
1 parent fb13f37 commit 4ca836b
Show file tree
Hide file tree
Showing 4 changed files with 386 additions and 34 deletions.
Expand Up @@ -51,7 +51,12 @@ export default class CSSStyleDeclarationPropertyGetParser {
!properties['border-top-width']?.value ||
properties['border-top-width']?.value !== properties['border-right-width']?.value ||
properties['border-top-width']?.value !== properties['border-bottom-width']?.value ||
properties['border-top-width']?.value !== properties['border-left-width']?.value
properties['border-top-width']?.value !== properties['border-left-width']?.value ||
!properties['border-image-source']?.value ||
!properties['border-image-slice']?.value ||
!properties['border-image-width']?.value ||
!properties['border-image-outset']?.value ||
!properties['border-image-repeat']?.value
) {
return null;
}
Expand Down
Expand Up @@ -198,18 +198,6 @@ export default class CSSStyleDeclarationPropertyManager {
* @param important Important.
*/
public set(name: string, value: string, important: boolean): void {
const globalValue = CSSStyleDeclarationValueParser.getGlobal(value);

if (globalValue) {
this.remove(name);
this.properties[name] = {
value: globalValue,
important
};
this.definedPropertyNames[name] = true;
return;
}

let properties = null;

switch (name) {
Expand Down Expand Up @@ -237,6 +225,24 @@ export default class CSSStyleDeclarationPropertyManager {
case 'border-color':
properties = CSSStyleDeclarationPropertySetParser.getBorderColor(value, important);
break;
case 'border-image':
properties = CSSStyleDeclarationPropertySetParser.getBorderImage(value, important);
break;
case 'border-image-source':
properties = CSSStyleDeclarationPropertySetParser.getBorderImageSource(value, important);
break;
case 'border-image-slice':
properties = CSSStyleDeclarationPropertySetParser.getBorderImageSlice(value, important);
break;
case 'border-image-width':
properties = CSSStyleDeclarationPropertySetParser.getBorderImageWidth(value, important);
break;
case 'border-image-outset':
properties = CSSStyleDeclarationPropertySetParser.getBorderImageOutset(value, important);
break;
case 'border-image-repeat':
properties = CSSStyleDeclarationPropertySetParser.getBorderImageRepeat(value, important);
break;
case 'border-top-width':
properties = CSSStyleDeclarationPropertySetParser.getBorderTopWidth(value, important);
break;
Expand Down Expand Up @@ -421,9 +427,10 @@ export default class CSSStyleDeclarationPropertyManager {
properties = CSSStyleDeclarationPropertySetParser.getFloodColor(value, important);
break;
default:
const globalValue = CSSStyleDeclarationValueParser.getGlobal(value);
properties = value
? {
[name]: { value, important }
[name]: { value: globalValue ? globalValue : value, important }
}
: null;
break;
Expand Down

0 comments on commit 4ca836b

Please sign in to comment.