gecko-dev/layout/style/crashtests/1579788.html
Emilio Cobos Álvarez ff890f406e Bug 1579788 - Don't update validity state when the JS engine fails to execute the pattern. r=smaug
When we call nsContentUtils::IsPatternMatching, we swallow JS engine errors
unconditionally returning true.

This is bad, because if it happens in one of the value sets that arguably
shouldn't change the state of the element, we end up returning an arbitrary
value (true) which may or may not match the previous state of the element.

Handle error explicitly instead, by not updating the state.

Differential Revision: https://phabricator.services.mozilla.com/D45727

--HG--
extra : moz-landing-system : lando
2019-09-16 10:11:42 +00:00

16 lines
331 B
HTML

<script>
function start() {
document.addEventListener('DOMAttrModified', function() {
b.scroll()
b.setAttribute('dir', 'ltr')
b.dir = ''
})
a.setAttribute('d', '')
}
document.addEventListener('DOMContentLoaded', start)
</script>
<form dir="rtl">
<object id="a">
<input value="X" multiple pattern="[]">
<p id="b">