mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 11:28:38 +00:00
298702866a
Recomputing the placeholder visibility does not require the placeholder div itself to be present, as the only information required for that is the current value of the text control which is present either way. This patch fixes nsTextEditorState::ValueWasChanged and nsTextEditorState::UpdatePlaceholderVisibility to that effect. But the real fix is in nsTextEditorState::UpdatePlaceholderText, where after setting the placeholder text on the anonymous div, we redo the placeholder visibility computation. Since this function can be called from HTMLTextAreaElement::CreatePlaceholderNode during frame construction, the GetValue function may return the wrong value since the editor has not properly been set up yet, resulting in this bug. And this function call is useless anyway, because changing the placeholder text does not really affect the result of the visibility computation, so there is no need to do this work in the first place.
17 lines
362 B
HTML
17 lines
362 B
HTML
<!DOCTYPE html>
|
|
<html class="reftest-wait">
|
|
<textarea placeholder="placeholder"></textarea>
|
|
<script>
|
|
onload = function() {
|
|
var t = document.querySelector("textarea");
|
|
t.style.display = "none";
|
|
t.value = "test";
|
|
setTimeout(function() {
|
|
t.style.display = "";
|
|
t.value = "";
|
|
document.documentElement.className = "";
|
|
}, 0);
|
|
};
|
|
</script>
|
|
</html>
|