gecko-dev/layout/forms/crashtests/1388230-1.html
Daniel Holbert 1c34ad7112 Bug 1388230: Make nsColorControlFrame::UpdateColor() a no-op if value is empty (which implies our element is still being appended). r=jwatt
nsColorControlFrame::UpdateColor() looks up the color value from the
corresponding <input> element -- and it expects to receive a valid color
string, regardless of what the user/author has done (or whether they've done
anything), thanks to the HTMLInputElement sanitization code that gets run when
the value is set.

As a basic sanity-check, UpdateColor() has an assertion to verify that the
value it receives is non-empty. However, if it happens to be called while the
element is still being appended (e.g. due to greedy frame construction), then
it *can* legitimately get an empty value.  So, the assertion isn't entirely valid!

Hence, this patch relaxes the assertion to only take effect after the frame has
been reflowed, and it also makes UpdateColor() a no-op in that case.  This
is fine because we can expect that UpdateColor() will be called again (and will
see a non-empty color value at that point) before the frame gets
reflowed/painted.

MozReview-Commit-ID: LOymuwy6gIM

--HG--
extra : rebase_source : 57a2b58cc371ec82f1d2db0334b2236a33056e40
2017-10-03 15:20:07 -07:00

4 lines
62 B
HTML

<cite contenteditable='true'>
<input type='color'/>
</cite>