Compare commits

...

2 Commits

Author SHA1 Message Date
CI
b482725994 chore(release): 1.3.1 2021-08-14 06:06:09 +00:00
1b55ed5668 fix: multi arg transition/animation duration (#2657) 2021-08-14 14:05:15 +08:00
7 changed files with 26 additions and 12 deletions

View File

@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.3.1](https://github.com/niklasvh/html2canvas/compare/v1.3.0...v1.3.1) (2021-08-14)
### fix
* multi arg transition/animation duration (#2657) ([1b55ed5](https://github.com/niklasvh/html2canvas/commit/1b55ed5668dcbbe1c6d8d7e94736d8f2da2d31c5)), closes [#2657](https://github.com/niklasvh/html2canvas/issues/2657)
# [1.3.0](https://github.com/niklasvh/html2canvas/compare/v1.2.2...v1.3.0) (2021-08-13)

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "html2canvas",
"version": "1.3.0",
"version": "1.3.1",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@ -6,7 +6,7 @@
"module": "dist/html2canvas.esm.js",
"typings": "dist/types/index.d.ts",
"browser": "dist/html2canvas.js",
"version": "1.3.0",
"version": "1.3.1",
"author": {
"name": "Niklas von Hertzen",
"email": "niklasvh@gmail.com",

View File

@ -82,7 +82,7 @@ import {webkitTextStrokeWidth} from './property-descriptors/webkit-text-stroke-w
import {Context} from '../core/context';
export class CSSParsedDeclaration {
animationDuration: ReturnType<typeof time.parse>;
animationDuration: ReturnType<typeof duration.parse>;
backgroundClip: ReturnType<typeof backgroundClip.parse>;
backgroundColor: Color;
backgroundImage: ReturnType<typeof backgroundImage.parse>;
@ -143,7 +143,7 @@ export class CSSParsedDeclaration {
textTransform: ReturnType<typeof textTransform.parse>;
transform: ReturnType<typeof transform.parse>;
transformOrigin: ReturnType<typeof transformOrigin.parse>;
transitionDuration: ReturnType<typeof time.parse>;
transitionDuration: ReturnType<typeof duration.parse>;
visibility: ReturnType<typeof visibility.parse>;
webkitTextStrokeColor: Color;
webkitTextStrokeWidth: ReturnType<typeof webkitTextStrokeWidth.parse>;

View File

@ -1,9 +1,14 @@
import {IPropertyTypeValueDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';
import {IPropertyListDescriptor, PropertyDescriptorParsingType} from '../IPropertyDescriptor';
import {Context} from '../../core/context';
import {CSSValue, isDimensionToken} from '../syntax/parser';
import {time} from '../types/time';
export const duration: IPropertyTypeValueDescriptor = {
export const duration: IPropertyListDescriptor<number[]> = {
name: 'duration',
initialValue: '0s',
prefix: false,
type: PropertyDescriptorParsingType.TYPE_VALUE,
format: 'time'
type: PropertyDescriptorParsingType.LIST,
parse: (context: Context, tokens: CSSValue[]) => {
return tokens.filter(isDimensionToken).map((token) => time.parse(context, token));
}
};

View File

@ -23,10 +23,10 @@ export class ElementContainer {
this.elements = [];
if (isHTMLElementNode(element)) {
if (this.styles.animationDuration > 0) {
if (this.styles.animationDuration.some((duration) => duration > 0)) {
element.style.animationDuration = '0s';
}
if (this.styles.transitionDuration > 0) {
if (this.styles.transitionDuration.some((duration) => duration > 0)) {
element.style.transitionDuration = '0s';
}

View File

@ -40,7 +40,7 @@
.animated.working p {
animation-name: rotate0;
animation-duration: 1ms;
animation-duration: 1ms, 1ms;
animation-play-state: paused;
}
@ -51,7 +51,7 @@
}
.transitioned p {
transition: 1ms;
transition: 1ms, 1ms;
transform: rotate(45deg)
}