Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1200)

Unified Diff: chrome/browser/resources/pdf/pdf.js

Issue 1364163002: Material PDF: Support RTL languages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use reflectToAttribute Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/pdf/pdf.js
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js
index e3cd1f346c96643af0e7550fb2da638d896e0f41..4b7e9ce9cee6ba92d4a33ccb70c108324fb759ad 100644
--- a/chrome/browser/resources/pdf/pdf.js
+++ b/chrome/browser/resources/pdf/pdf.js
@@ -569,6 +569,8 @@ PDFViewer.prototype = {
if (this.materialToolbar_)
this.materialToolbar_.strings = strings;
this.zoomToolbar_.strings = strings;
+ document.dir = strings['textdirection'];
+ document.lang = strings['language'];
} else {
this.passwordScreen_.text = strings.passwordPrompt;
this.progressBar_.text = strings.pageLoading;
@@ -748,8 +750,9 @@ PDFViewer.prototype = {
// will be half a scrollbar width further left than the spec but if there
// is a scrollbar visible it will be half a scrollbar width further right
// than the spec.
- this.zoomToolbar_.style.right = -verticalScrollbarWidth +
- (scrollbarWidth / 2) + 'px';
+ if (document.dir == 'ltr')
raymes 2015/09/28 03:14:53 nit: add comment about why this is the case add {}
tsergeant 2015/09/28 04:26:33 Done
+ this.zoomToolbar_.style.right = -verticalScrollbarWidth +
+ (scrollbarWidth / 2) + 'px';
// Having a horizontal scrollbar is much rarer so we don't offset the
// toolbar from the bottom any more than what the spec says. This means
// that when there is a scrollbar visible, it will be a full scrollbar

Powered by Google App Engine
This is Rietveld 408576698