Index: third_party/google_input_tools/src/chrome/os/inputview/elements/layout/linearlayout.js |
diff --git a/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/linearlayout.js b/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/linearlayout.js |
index f583c8e50632422bdac9b6f50ae628029886b321..ebcfebdc9207e0d8fd8650515a59af81b95419cb 100644 |
--- a/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/linearlayout.js |
+++ b/third_party/google_input_tools/src/chrome/os/inputview/elements/layout/linearlayout.js |
@@ -119,6 +119,12 @@ LinearLayout.prototype.getWidthInWeight = function() { |
LinearLayout.prototype.resize = function(width, height) { |
goog.base(this, 'resize', width, height); |
+ var elem = this.getElement(); |
+ var borderBox = goog.style.getBorderBox(elem); |
+ var paddingBox = goog.style.getPaddingBox(elem); |
+ var marginBox = goog.style.getMarginBox(elem); |
+ var w = width - borderBox.left - borderBox.right - paddingBox.left - |
+ paddingBox.right - marginBox.left - marginBox.right; |
var weightArray = []; |
for (var i = 0; i < this.getChildCount(); i++) { |
var child = /** @type {i18n.input.chrome.inputview.elements.Weightable} */ ( |
@@ -126,7 +132,7 @@ LinearLayout.prototype.resize = function(width, height) { |
weightArray.push(child.getWidthInWeight()); |
} |
var splitedWidth = i18n.input.chrome.inputview.util.splitValue(weightArray, |
- width); |
+ w); |
for (var i = 0; i < this.getChildCount(); i++) { |
var child = /** @type {i18n.input.chrome.inputview.elements.Element} */ ( |
this.getChildAt(i)); |