Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make text input relayout when value is changed directly. #5318

Merged
merged 2 commits into from Mar 24, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

use dom::bindings::codegen::Bindings::ElementBinding::ElementMethods;
use dom::bindings::codegen::Bindings::HTMLHeadElementBinding;
use dom::bindings::codegen::Bindings::NodeBinding::NodeMethods;
use dom::bindings::codegen::Bindings::DocumentBinding::DocumentMethods;
@@ -51,7 +50,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLHeadElement> {
let htmlelement: &JSRef<HTMLElement> = HTMLElementCast::from_borrowed_ref(self);
Some(htmlelement as &VirtualMethods)
}
fn bind_to_tree(&self, tree_in_doc: bool) {
fn bind_to_tree(&self, _tree_in_doc: bool) {
if !opts::get().userscripts {
return;
}
@@ -259,6 +259,7 @@ impl<'a> HTMLInputElementMethods for JSRef<'a, HTMLInputElement> {
fn SetValue(self, value: DOMString) {
self.textinput.borrow_mut().set_content(value);
self.value_changed.set(true);
self.force_relayout();
}

// https://html.spec.whatwg.org/multipage/forms.html#dom-input-defaultvalue
@@ -427,6 +428,7 @@ impl<'a> HTMLInputElementHelpers for JSRef<'a, HTMLInputElement> {

self.SetValue(self.DefaultValue());
self.value_changed.set(false);
self.force_relayout();
}
}

@@ -8,6 +8,7 @@
#![feature(core)]
#![feature(int_uint)]
#![feature(old_io)]
#![feature(path)]
#![feature(plugin)]
#![feature(rustc_private)]
#![feature(std_misc)]
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.