author | Jonathan Kew <jkew@mozilla.com> |
Tue, 23 Jun 2015 06:06:16 -0700 | |
changeset 250039 | 7160a417588962af23e68c38feb02699de07db2b |
parent 250038 | 1019348c77860c34354e5674e21cbba09877c891 |
child 250040 | 5e9a6613f8ed9456c5b99b696b93c2f510c4f385 |
push id | 28943 |
push user | cbook@mozilla.com |
push date | Wed, 24 Jun 2015 14:02:00 +0000 |
treeherder | mozilla-central@4cdc1a95a672 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smontagu |
bugs | 1174504 |
milestone | 41.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -729,31 +729,49 @@ public: */ void SetRect(mozilla::WritingMode aWritingMode, const mozilla::LogicalRect& aRect, nscoord aContainerWidth) { SetRect(aRect.GetPhysicalRect(aWritingMode, aContainerWidth)); } /** - * Set this frame's size from a logical size in its own writing direction + * Set this frame's size from a logical size in its own writing direction. + * This leaves the frame's logical position unchanged, which means its + * physical position may change (for right-to-left modes). */ void SetSize(const mozilla::LogicalSize& aSize) { SetSize(GetWritingMode(), aSize); } /* - * Set this frame's size from a logical size in a different writing direction + * Set this frame's size from a logical size in a different writing direction. + * This leaves the frame's logical position in the given mode unchanged, + * which means its physical position may change (for right-to-left modes). */ void SetSize(mozilla::WritingMode aWritingMode, - const mozilla::LogicalSize& aSize) { - SetSize(aSize.GetPhysicalSize(aWritingMode)); + const mozilla::LogicalSize& aSize) + { + if ((!aWritingMode.IsVertical() && !aWritingMode.IsBidiLTR()) || + aWritingMode.IsVerticalRL()) { + nscoord oldWidth = mRect.width; + SetSize(aSize.GetPhysicalSize(aWritingMode)); + mRect.x -= mRect.width - oldWidth; + } else { + SetSize(aSize.GetPhysicalSize(aWritingMode)); + } } + + /** + * Set this frame's physical size. This leaves the frame's physical position + * (topLeft) unchanged. + */ void SetSize(const nsSize& aSize) { SetRect(nsRect(mRect.TopLeft(), aSize)); } + void SetPosition(const nsPoint& aPt) { mRect.MoveTo(aPt); } void SetPosition(mozilla::WritingMode aWritingMode, const mozilla::LogicalPoint& aPt, nscoord aContainerWidth) { // We subtract mRect.width from the container width to account for // the fact that logical origins in RTL coordinate systems are at // the top right of the frame instead of the top left. mRect.MoveTo(aPt.GetPhysicalPoint(aWritingMode,