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

Unified Diff: Source/WebCore/Resources/calendarPicker.js

Issue 10780025: Merge 122212 - (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « ManualTests/forms/calendar-picker.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/Resources/calendarPicker.js
===================================================================
--- Source/WebCore/Resources/calendarPicker.js (revision 122792)
+++ Source/WebCore/Resources/calendarPicker.js (working copy)
@@ -310,13 +310,23 @@
maxCellWidth = headers[i].offsetWidth;
}
var DaysAreaContainerBorder = 1;
- var maxRight = Math.max(yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth,
- daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder);
+ var main = $("main");
+ var yearMonthEnd;
+ var daysAreaEnd;
+ if (global.params.isRTL) {
+ var startOffset = main.offsetLeft + main.offsetWidth;
+ yearMonthEnd = startOffset - yearMonthRightElement.offsetLeft;
+ daysAreaEnd = startOffset - (daysAreaElement.offsetLeft + daysAreaElement.offsetWidth) + maxCellWidth * 7 + DaysAreaContainerBorder;
+ } else {
+ yearMonthEnd = yearMonthRightElement.offsetLeft + yearMonthRightElement.offsetWidth;
+ daysAreaEnd = daysAreaElement.offsetLeft + maxCellWidth * 7 + DaysAreaContainerBorder;
+ }
+
+ var maxEnd = Math.max(yearMonthEnd, daysAreaEnd);
var MainPadding = 6;
var MainBorder = 1;
- var desiredBodyWidth = maxRight + MainPadding + MainBorder;
+ var desiredBodyWidth = maxEnd + MainPadding + MainBorder;
- var main = $("main");
var mainHeight = main.offsetHeight;
main.style.width = "auto";
daysAreaElement.style.width = "100%";
@@ -355,6 +365,8 @@
function layout() {
if (global.params.isRTL)
document.body.dir = "rtl";
+ else
+ document.body.dir = "ltr";
var main = $("main");
var params = global.params;
main.removeChild(main.firstChild);
« no previous file with comments | « ManualTests/forms/calendar-picker.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698