| Index: third_party/google_input_tools/third_party/closure_library/closure/goog/i18n/bidi.js
|
| diff --git a/third_party/google_input_tools/third_party/closure_library/closure/goog/i18n/bidi.js b/third_party/google_input_tools/third_party/closure_library/closure/goog/i18n/bidi.js
|
| index f984c28cd0be89693b74d1fec3f28a1b9c0880e7..37b5b9f9771c39e027122dbb501cd92f845a9ce9 100644
|
| --- a/third_party/google_input_tools/third_party/closure_library/closure/goog/i18n/bidi.js
|
| +++ b/third_party/google_input_tools/third_party/closure_library/closure/goog/i18n/bidi.js
|
| @@ -118,13 +118,7 @@ goog.i18n.bidi.Dir = {
|
| /**
|
| * Neither left-to-right nor right-to-left.
|
| */
|
| - NEUTRAL: 0,
|
| -
|
| - /**
|
| - * A historical misnomer for NEUTRAL.
|
| - * @deprecated For "neutral", use NEUTRAL; for "unknown", use null.
|
| - */
|
| - UNKNOWN: 0
|
| + NEUTRAL: 0
|
| };
|
|
|
|
|
| @@ -209,7 +203,8 @@ goog.i18n.bidi.ltrChars_ =
|
| * @type {string}
|
| * @private
|
| */
|
| -goog.i18n.bidi.rtlChars_ = '\u0591-\u07FF\u200F\uFB1D-\uFDFF\uFE70-\uFEFC';
|
| +goog.i18n.bidi.rtlChars_ =
|
| + '\u0591-\u06EF\u06FA-\u07FF\u200F\uFB1D-\uFDFF\uFE70-\uFEFC';
|
|
|
|
|
| /**
|
| @@ -761,10 +756,20 @@ goog.i18n.bidi.wordSeparatorRe_ = /\s+/;
|
| * Regular expression to check if a string contains any numerals. Used to
|
| * differentiate between completely neutral strings and those containing
|
| * numbers, which are weakly LTR.
|
| + *
|
| + * Native Arabic digits (\u0660 - \u0669) are not included because although they
|
| + * do flow left-to-right inside a number, this is the case even if the overall
|
| + * directionality is RTL, and a mathematical expression using these digits is
|
| + * supposed to flow right-to-left overall, including unary plus and minus
|
| + * appearing to the right of a number, and this does depend on the overall
|
| + * directionality being RTL. The digits used in Farsi (\u06F0 - \u06F9), on the
|
| + * other hand, are included, since Farsi math (including unary plus and minus)
|
| + * does flow left-to-right.
|
| + *
|
| * @type {RegExp}
|
| * @private
|
| */
|
| -goog.i18n.bidi.hasNumeralsRe_ = /\d/;
|
| +goog.i18n.bidi.hasNumeralsRe_ = /[\d\u06f0-\u06f9]/;
|
|
|
|
|
| /**
|
| @@ -853,6 +858,26 @@ goog.i18n.bidi.setElementDirAndAlign = function(element, dir) {
|
| };
|
|
|
|
|
| +/**
|
| + * Sets element dir based on estimated directionality of the given text.
|
| + * @param {!Element} element
|
| + * @param {string} text
|
| + */
|
| +goog.i18n.bidi.setElementDirByTextDirectionality = function(element, text) {
|
| + switch (goog.i18n.bidi.estimateDirection(text)) {
|
| + case (goog.i18n.bidi.Dir.LTR):
|
| + element.dir = 'ltr';
|
| + break;
|
| + case (goog.i18n.bidi.Dir.RTL):
|
| + element.dir = 'rtl';
|
| + break;
|
| + default:
|
| + // Default for no direction, inherit from document.
|
| + element.removeAttribute('dir');
|
| + }
|
| +};
|
| +
|
| +
|
|
|
| /**
|
| * Strings that have an (optional) known direction.
|
|
|