mirror of
https://github.com/google/blockly.git
synced 2026-01-09 10:00:09 +01:00
Field textinput pixel perfect input (#3443)
* Fix sizing of text input field in zelos, pixel perfect input in other browsers
This commit is contained in:
@@ -201,10 +201,14 @@ suite('Angle Fields', function() {
|
||||
this.angleField.htmlInput_ = Object.create(null);
|
||||
this.angleField.htmlInput_.oldValue_ = '1';
|
||||
this.angleField.htmlInput_.untypedDefaultValue_ = 1;
|
||||
this.stub = sinon.stub(this.angleField, 'resizeEditor_');
|
||||
});
|
||||
teardown(function() {
|
||||
this.angleField.setValidator(null);
|
||||
this.angleField.htmlInput_ = null;
|
||||
if (this.stub) {
|
||||
this.stub.restore();
|
||||
}
|
||||
});
|
||||
suite('Null Validator', function() {
|
||||
setup(function() {
|
||||
|
||||
@@ -329,10 +329,14 @@ suite('Number Fields', function() {
|
||||
this.numberField.htmlInput_ = Object.create(null);
|
||||
this.numberField.htmlInput_.oldValue_ = '1';
|
||||
this.numberField.htmlInput_.untypedDefaultValue_ = 1;
|
||||
this.stub = sinon.stub(this.numberField, 'resizeEditor_');
|
||||
});
|
||||
teardown(function() {
|
||||
this.numberField.setValidator(null);
|
||||
this.numberField.htmlInput_ = null;
|
||||
if (this.stub) {
|
||||
this.stub.restore();
|
||||
}
|
||||
});
|
||||
suite('Null Validator', function() {
|
||||
setup(function() {
|
||||
|
||||
@@ -161,10 +161,14 @@ suite('Text Input Fields', function() {
|
||||
this.textInputField.htmlInput_ = Object.create(null);
|
||||
this.textInputField.htmlInput_.oldValue_ = 'value';
|
||||
this.textInputField.htmlInput_.untypedDefaultValue_ = 'value';
|
||||
this.stub = sinon.stub(this.textInputField, 'resizeEditor_');
|
||||
});
|
||||
teardown(function() {
|
||||
this.textInputField.setValidator(null);
|
||||
Blockly.FieldTextInput.htmlInput_ = null;
|
||||
if (this.stub) {
|
||||
this.stub.restore();
|
||||
}
|
||||
});
|
||||
suite('Null Validator', function() {
|
||||
setup(function() {
|
||||
@@ -233,6 +237,7 @@ suite('Text Input Fields', function() {
|
||||
FIELD_TEXT_FONTWEIGHT: 'normal',
|
||||
FIELD_TEXT_FONTFAMILY: 'sans-serif'
|
||||
};
|
||||
field.clickTarget_ = document.createElement('div');
|
||||
Blockly.WidgetDiv.DIV = document.createElement('div');
|
||||
this.stub = sinon.stub(field, 'resizeEditor_');
|
||||
};
|
||||
|
||||
@@ -38,9 +38,12 @@ suite('Procedures', function() {
|
||||
context.defBlock.setFieldValue(startName, 'NAME');
|
||||
context.callBlock = new Blockly.Block(this.workspace, context.callType);
|
||||
context.callBlock.setFieldValue(startName, 'NAME');
|
||||
context.stub = sinon.stub(
|
||||
context.defBlock.getField('NAME'), 'resizeEditor_');
|
||||
func.call(context);
|
||||
context.defBlock.dispose();
|
||||
context.callBlock.dispose();
|
||||
context.stub.restore();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user