From b2ea03dde036fa73a863419ea44ec8ab4381ecf0 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 27 May 2017 12:29:44 -0400 Subject: [PATCH] prevent textarea from having both value and children --- src/validate/html/validateElement.ts | 8 ++++++++ .../validator/samples/textarea-value-children/errors.json | 8 ++++++++ test/validator/samples/textarea-value-children/input.html | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 test/validator/samples/textarea-value-children/errors.json create mode 100644 test/validator/samples/textarea-value-children/input.html diff --git a/src/validate/html/validateElement.ts b/src/validate/html/validateElement.ts index 6610e7ee69..18c906b298 100644 --- a/src/validate/html/validateElement.ts +++ b/src/validate/html/validateElement.ts @@ -77,6 +77,14 @@ export default function validateElement ( validator: Validator, node: Node ) { validator.error( `Missing transition '${attribute.name}'`, attribute.start ); } } + + else if ( attribute.type === 'Attribute' ) { + if ( attribute.name === 'value' && node.name === 'textarea' ) { + if ( node.children.length ) { + validator.error( `A \ No newline at end of file